@aglyn/plugins-commerce 1.10.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/package.json +13 -13
  2. package/src/lib/components/console/host-quotes-card.component.js +20 -11
  3. package/src/lib/components/console/host-quotes-card.component.js.map +1 -1
  4. package/src/lib/components/console/invoice-send.component.d.ts +9 -2
  5. package/src/lib/components/console/invoice-send.component.js +58 -30
  6. package/src/lib/components/console/invoice-send.component.js.map +1 -1
  7. package/src/lib/components/console/pay-link-readiness-notice.component.d.ts +84 -0
  8. package/src/lib/components/console/pay-link-readiness-notice.component.js +164 -0
  9. package/src/lib/components/console/pay-link-readiness-notice.component.js.map +1 -0
  10. package/src/lib/components/console/pos-kiosk/kiosk-menu.d.ts +10 -3
  11. package/src/lib/components/console/pos-kiosk/kiosk-menu.js +29 -8
  12. package/src/lib/components/console/pos-kiosk/kiosk-menu.js.map +1 -1
  13. package/src/lib/components/console/pos-kiosk/pos-kiosk-api.d.ts +2 -0
  14. package/src/lib/components/console/pos-kiosk/pos-kiosk-api.js +7 -0
  15. package/src/lib/components/console/pos-kiosk/pos-kiosk-api.js.map +1 -1
  16. package/src/lib/components/console/pos-kiosk-page.component.d.ts +2 -0
  17. package/src/lib/components/console/pos-kiosk-page.component.js +54 -3
  18. package/src/lib/components/console/pos-kiosk-page.component.js.map +1 -1
  19. package/src/lib/components/console/product-add-ons-fields.component.d.ts +0 -2
  20. package/src/lib/components/console/product-add-ons-fields.component.js +1 -6
  21. package/src/lib/components/console/product-add-ons-fields.component.js.map +1 -1
  22. package/src/lib/components/console/quote-editor-dialog.component.d.ts +2 -0
  23. package/src/lib/components/console/quote-editor-dialog.component.js +35 -27
  24. package/src/lib/components/console/quote-editor-dialog.component.js.map +1 -1
  25. package/src/lib/components/console/quote-pay-link.component.d.ts +3 -0
  26. package/src/lib/components/console/quote-pay-link.component.js +9 -0
  27. package/src/lib/components/console/quote-pay-link.component.js.map +1 -1
  28. package/src/lib/components/console/quote-send.component.d.ts +3 -0
  29. package/src/lib/components/console/quote-send.component.js +9 -0
  30. package/src/lib/components/console/quote-send.component.js.map +1 -1
  31. package/src/lib/components/product-detail.js +1 -1
  32. package/src/lib/components/product-detail.js.map +1 -1
  33. package/src/lib/components/product-grid.js +5 -3
  34. package/src/lib/components/product-grid.js.map +1 -1
  35. package/src/lib/components/product-reviews.js +17 -12
  36. package/src/lib/components/product-reviews.js.map +1 -1
  37. package/src/lib/components/quote-page-body.js +5 -3
  38. package/src/lib/components/quote-page-body.js.map +1 -1
  39. package/src/lib/components/related-products.js +2 -1
  40. package/src/lib/components/related-products.js.map +1 -1
  41. package/src/lib/model/commerce-invoices.d.ts +45 -5
  42. package/src/lib/model/commerce-invoices.js +46 -9
  43. package/src/lib/model/commerce-invoices.js.map +1 -1
  44. package/src/lib/model/commerce-kiosk-search.d.ts +22 -0
  45. package/src/lib/model/commerce-kiosk-search.js +32 -0
  46. package/src/lib/model/commerce-kiosk-search.js.map +1 -0
  47. package/src/lib/model/commerce-pos-kiosk.d.ts +7 -1
  48. package/src/lib/model/commerce-pos-kiosk.js +1 -1
  49. package/src/lib/model/commerce-pos-kiosk.js.map +1 -1
  50. package/src/lib/model/commerce-quote-pay.d.ts +110 -6
  51. package/src/lib/model/commerce-quote-pay.js +182 -23
  52. package/src/lib/model/commerce-quote-pay.js.map +1 -1
  53. package/src/lib/model/product-modifiers.d.ts +4 -0
  54. package/src/lib/model/product-modifiers.js +5 -0
  55. package/src/lib/model/product-modifiers.js.map +1 -1
  56. package/src/lib/server/billing-webhook.js +4 -1
  57. package/src/lib/server/billing-webhook.js.map +1 -1
  58. package/src/lib/server/commerce-pdf.js +2 -1
  59. package/src/lib/server/commerce-pdf.js.map +1 -1
  60. package/src/lib/server/invoice-email.js +2 -1
  61. package/src/lib/server/invoice-email.js.map +1 -1
  62. package/src/lib/server/order-invoice-send.js +1 -1
  63. package/src/lib/server/order-invoice-send.js.map +1 -1
  64. package/src/lib/server/order-status.d.ts +5 -1
  65. package/src/lib/server/order-status.js +19 -5
  66. package/src/lib/server/order-status.js.map +1 -1
  67. package/src/lib/server/pos-kiosk.js +70 -15
  68. package/src/lib/server/pos-kiosk.js.map +1 -1
  69. package/src/lib/server/quote-email.js +2 -1
  70. package/src/lib/server/quote-email.js.map +1 -1
  71. package/src/lib/server/quote-pay.d.ts +39 -0
  72. package/src/lib/server/quote-pay.js +103 -43
  73. package/src/lib/server/quote-pay.js.map +1 -1
  74. package/src/lib/server/quote-proofs.js +20 -11
  75. package/src/lib/server/quote-proofs.js.map +1 -1
  76. package/src/lib/server/site-page-enricher.js +5 -1
  77. package/src/lib/server/site-page-enricher.js.map +1 -1
  78. package/src/lib/testing/fake-firestore.js +34 -5
  79. package/src/lib/testing/fake-firestore.js.map +1 -1
  80. package/src/lib/transfer/product-register-cells.d.ts +75 -0
  81. package/src/lib/transfer/product-register-cells.js +487 -0
  82. package/src/lib/transfer/product-register-cells.js.map +1 -0
  83. package/src/lib/transfer/product-transfer.d.ts +12 -0
  84. package/src/lib/transfer/product-transfer.js +174 -10
  85. package/src/lib/transfer/product-transfer.js.map +1 -1
  86. package/src/lib/transfer/products.server.js +24 -9
  87. package/src/lib/transfer/products.server.js.map +1 -1
  88. package/src/lib/utils/invoice-email-content.d.ts +3 -1
  89. package/src/lib/utils/invoice-email-content.js +1 -1
  90. package/src/lib/utils/invoice-email-content.js.map +1 -1
  91. package/src/lib/utils/quote-email-content.d.ts +3 -1
  92. package/src/lib/utils/quote-email-content.js +3 -3
  93. package/src/lib/utils/quote-email-content.js.map +1 -1
@@ -0,0 +1,487 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ /**
3
+ * @license
4
+ * Copyright 2026 Aglyn LLC
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ import { normalizeProductCheckIn } from "../model/commerce-check-in-product.js";
18
+ import { commerceSlug } from "../model/commerce.js";
19
+ import { variantPriceLabel } from "../model/product-modifiers.js";
20
+ const fail = (message)=>({
21
+ message
22
+ });
23
+ const QUOTE_THE_NAME = 'Put double quotes around a name with a comma, semicolon, colon or parenthesis, such as "Walls (vinyl)".';
24
+ const NOT_CLOSED = `A quote or parenthesis is not closed. ${QUOTE_THE_NAME}`;
25
+ /** A price at the end of a choice: `+$0.75`, `+0.75` or `$0.75`. */ const PRICE_TAIL = /(?:^|\s)([-+]\s?\$?|\$)([\d.,]+)$/;
26
+ const PRICE_DIGITS = /^(?:\d+(?:\.\d{1,2})?|\.\d{1,2})$/;
27
+ /**
28
+ * Walks a cell's text outside its quoted names, naming each character and how
29
+ * deep in parentheses it sits. A quote opens a name only where a name starts,
30
+ * so the `"` in `12" wall` is just a character. `false` when something is left
31
+ * open.
32
+ */ function walk(source, visit) {
33
+ let depth = 0;
34
+ let quoted = false;
35
+ let atStart = true;
36
+ for(let at = 0; at < source.length; at += 1){
37
+ const character = source[at];
38
+ if (quoted) {
39
+ if (character === '"') {
40
+ if (source[at + 1] === '"') at += 1;
41
+ else quoted = false;
42
+ }
43
+ continue;
44
+ }
45
+ if (character === '"' && atStart) {
46
+ quoted = true;
47
+ atStart = false;
48
+ continue;
49
+ }
50
+ if (character === ')') {
51
+ depth -= 1;
52
+ if (depth < 0) return false;
53
+ }
54
+ visit(character, at, depth);
55
+ if (character === '(') depth += 1;
56
+ if (!/\s/.test(character)) atStart = /[(,;:]/.test(character);
57
+ }
58
+ return !quoted && depth === 0;
59
+ }
60
+ /** The pieces between one separator, outside quotes and parentheses; `null` when something is left open. */ function splitTop(source, separator) {
61
+ const parts = [];
62
+ let start = 0;
63
+ const closed = walk(source, (character, at, depth)=>{
64
+ if (character === separator && depth === 0) {
65
+ parts.push(source.slice(start, at));
66
+ start = at + 1;
67
+ }
68
+ });
69
+ if (!closed) return null;
70
+ parts.push(source.slice(start));
71
+ return parts;
72
+ }
73
+ /** A piece split into what comes before its parentheses and what is in them. */ function takeParens(source) {
74
+ let open = -1;
75
+ let close = -1;
76
+ let groups = 0;
77
+ const closed = walk(source, (character, at, depth)=>{
78
+ if (character === '(' && depth === 0) {
79
+ groups += 1;
80
+ open = at;
81
+ }
82
+ if (character === ')' && depth === 0) close = at;
83
+ });
84
+ if (!closed) return fail(NOT_CLOSED);
85
+ if (open < 0) return {
86
+ value: {
87
+ head: source.trim(),
88
+ inner: null
89
+ }
90
+ };
91
+ if (groups > 1 || source.slice(close + 1).trim()) return fail(QUOTE_THE_NAME);
92
+ return {
93
+ value: {
94
+ head: source.slice(0, open).trim(),
95
+ inner: source.slice(open + 1, close)
96
+ }
97
+ };
98
+ }
99
+ /** A quoted name and what follows it; `null` when the quote never closes. */ function readQuoted(text) {
100
+ let name = '';
101
+ for(let at = 1; at < text.length; at += 1){
102
+ const character = text[at];
103
+ if (character !== '"') {
104
+ name += character;
105
+ } else if (text[at + 1] === '"') {
106
+ name += '"';
107
+ at += 1;
108
+ } else {
109
+ return {
110
+ name,
111
+ rest: text.slice(at + 1).trim()
112
+ };
113
+ }
114
+ }
115
+ return null;
116
+ }
117
+ function readCents(sign, digits) {
118
+ const price = `${sign}${digits}`.replace(/\s/g, '');
119
+ if (sign.startsWith('-') || !PRICE_DIGITS.test(digits)) {
120
+ return fail(`"${price}" is not a price. Write what the choice adds like +$0.75.`);
121
+ }
122
+ return {
123
+ value: Math.round(Number(digits) * 100)
124
+ };
125
+ }
126
+ /** A name with the price after it, if it has one. */ function readNameAndPrice(source) {
127
+ const text = source.trim();
128
+ let name = text;
129
+ let priceText = '';
130
+ if (text.startsWith('"')) {
131
+ var _PRICE_TAIL_exec;
132
+ const quoted = readQuoted(text);
133
+ if (!quoted) return fail(NOT_CLOSED);
134
+ name = quoted.name;
135
+ priceText = quoted.rest;
136
+ if (priceText && ((_PRICE_TAIL_exec = PRICE_TAIL.exec(priceText)) == null ? void 0 : _PRICE_TAIL_exec.index) !== 0) return fail(QUOTE_THE_NAME);
137
+ } else {
138
+ const tail = PRICE_TAIL.exec(text);
139
+ if (tail) {
140
+ name = text.slice(0, tail.index).trim();
141
+ priceText = tail[0].trim();
142
+ }
143
+ }
144
+ if (!priceText) return {
145
+ value: {
146
+ name,
147
+ cents: null
148
+ }
149
+ };
150
+ const price = PRICE_TAIL.exec(priceText);
151
+ const cents = readCents(price[1], price[2]);
152
+ return 'message' in cents ? cents : {
153
+ value: {
154
+ name,
155
+ cents: cents.value
156
+ }
157
+ };
158
+ }
159
+ /** How many a group takes when its cell does not say: as a new group starts, or its minimum if that is higher. */ const defaultMax = (min)=>Math.max(1, min);
160
+ function readSettings(inner) {
161
+ let min = 0;
162
+ let max = null;
163
+ let online = true;
164
+ for (const raw of (inner != null ? inner : '').split(',')){
165
+ const setting = raw.trim();
166
+ if (!setting) continue;
167
+ const least = /^at least (\d+)$/i.exec(setting);
168
+ const most = /^at most (\d+)$/i.exec(setting);
169
+ if (least) min = Number(least[1]);
170
+ else if (most) max = Number(most[1]);
171
+ else if (/^register only$/i.test(setting)) online = false;
172
+ else {
173
+ return fail(`"${setting}" is not a group setting. Use at least 1, at most 2 or register only. ${QUOTE_THE_NAME}`);
174
+ }
175
+ }
176
+ return {
177
+ value: {
178
+ min,
179
+ max: max != null ? max : defaultMax(min),
180
+ online
181
+ }
182
+ };
183
+ }
184
+ function readByVariant(inner, choice) {
185
+ if (inner === null) return {
186
+ value: []
187
+ };
188
+ const parts = splitTop(inner, ',');
189
+ if (!parts) return fail(NOT_CLOSED);
190
+ const byVariant = [];
191
+ for (const part of parts){
192
+ if (!part.trim()) continue;
193
+ const read = readNameAndPrice(part);
194
+ if ('message' in read) return read;
195
+ const { name: label, cents } = read.value;
196
+ if (!label || cents === null) {
197
+ return fail(`"${part.trim()}" needs a variant and a price, such as 10x20 +$75.00. ${QUOTE_THE_NAME}`);
198
+ }
199
+ if (byVariant.some((entry)=>variantLabelKey(entry.label) === variantLabelKey(label))) {
200
+ return fail(`"${choice}" is priced twice for "${label}".`);
201
+ }
202
+ byVariant.push({
203
+ label,
204
+ priceCents: cents
205
+ });
206
+ }
207
+ return {
208
+ value: byVariant
209
+ };
210
+ }
211
+ function readChoices(source, group) {
212
+ const parts = splitTop(source, ',');
213
+ if (!parts) return fail(NOT_CLOSED);
214
+ const choices = [];
215
+ let previousPriced = false;
216
+ for (const part of parts){
217
+ if (!part.trim()) continue;
218
+ const shape = takeParens(part);
219
+ if ('message' in shape) return shape;
220
+ const read = readNameAndPrice(shape.value.head);
221
+ if ('message' in read) return read;
222
+ const { name, cents } = read.value;
223
+ if (!name) return fail(`Name every choice in "${group}".`);
224
+ // `+$1,000.00` would read as a $1 choice and a free one named 000.00.
225
+ if (previousPriced && /^\d{3}(?:\.\d*)?$/.test(name)) {
226
+ return fail('Write a price without a comma, such as +$1000.00.');
227
+ }
228
+ const byVariant = readByVariant(shape.value.inner, name);
229
+ if ('message' in byVariant) return byVariant;
230
+ choices.push({
231
+ name,
232
+ priceCents: cents != null ? cents : 0,
233
+ byVariant: byVariant.value
234
+ });
235
+ previousPriced = cents !== null;
236
+ }
237
+ return {
238
+ value: choices
239
+ };
240
+ }
241
+ /** An add-ons cell as its groups, or what is wrong with it for the person to fix. */ export function readAddOnCell(cell) {
242
+ const groups = [];
243
+ const parts = splitTop(String(cell != null ? cell : ''), ';');
244
+ if (!parts) return fail(NOT_CLOSED);
245
+ for (const part of parts){
246
+ if (!part.trim()) continue;
247
+ const sides = splitTop(part, ':');
248
+ if (!sides) return fail(NOT_CLOSED);
249
+ if (sides.length === 1) {
250
+ return fail(`"${part.trim()}" needs its choices after a colon, such as Milk: Whole, Oat +$0.75.`);
251
+ }
252
+ if (sides.length > 2) return fail(QUOTE_THE_NAME);
253
+ const head = takeParens(sides[0]);
254
+ if ('message' in head) return head;
255
+ let name = head.value.head;
256
+ if (name.startsWith('"')) {
257
+ const quoted = readQuoted(name);
258
+ if (!quoted) return fail(NOT_CLOSED);
259
+ if (quoted.rest) return fail(QUOTE_THE_NAME);
260
+ name = quoted.name;
261
+ }
262
+ if (!name) return fail('Name every add-on group.');
263
+ const settings = readSettings(head.value.inner);
264
+ if ('message' in settings) return settings;
265
+ const choices = readChoices(sides[1], name);
266
+ if ('message' in choices) return choices;
267
+ groups.push(_extends({
268
+ name
269
+ }, settings.value, {
270
+ choices: choices.value
271
+ }));
272
+ }
273
+ return {
274
+ value: groups
275
+ };
276
+ }
277
+ function writeName(name) {
278
+ const plain = name.trim() === name && Boolean(name) && !name.startsWith('"') && !/[,;:()]/.test(name) && !PRICE_TAIL.test(name);
279
+ return plain ? name : `"${name.replace(/"/g, '""')}"`;
280
+ }
281
+ const writeCents = (cents)=>`+$${(cents / 100).toFixed(2)}`;
282
+ function writeChoice(choice) {
283
+ const price = choice.priceCents ? ` ${writeCents(choice.priceCents)}` : '';
284
+ const byVariant = choice.byVariant.length ? ` (${choice.byVariant.map((entry)=>`${writeName(entry.label)} ${writeCents(entry.priceCents)}`).join(', ')})` : '';
285
+ return `${writeName(choice.name)}${price}${byVariant}`;
286
+ }
287
+ /** Groups as the one way a cell writes them, so two cells saying the same thing are the same text. */ export function writeAddOnCell(groups) {
288
+ return groups.map((group)=>{
289
+ const settings = [
290
+ ...group.min > 0 ? [
291
+ `at least ${group.min}`
292
+ ] : [],
293
+ ...group.max !== defaultMax(group.min) ? [
294
+ `at most ${group.max}`
295
+ ] : [],
296
+ ...group.online ? [] : [
297
+ 'register only'
298
+ ]
299
+ ];
300
+ const head = settings.length ? `${writeName(group.name)} (${settings.join(', ')})` : writeName(group.name);
301
+ return `${head}: ${group.choices.map(writeChoice).join(', ')}`;
302
+ }).join('; ');
303
+ }
304
+ /** A stored product's add-ons as a cell; `null` when it has none. */ export function addOnCellOf(stored, variants) {
305
+ if (!Array.isArray(stored) || !stored.length) return null;
306
+ const groups = stored.map((group)=>{
307
+ var _ref;
308
+ return {
309
+ name: String((_ref = group == null ? void 0 : group.name) != null ? _ref : ''),
310
+ min: Number(group == null ? void 0 : group.min) || 0,
311
+ max: Number(group == null ? void 0 : group.max) || 0,
312
+ online: (group == null ? void 0 : group.online) === true,
313
+ choices: (Array.isArray(group == null ? void 0 : group.options) ? group.options : []).map((option)=>{
314
+ var _ref;
315
+ const byVariant = [];
316
+ for (const variant of variants){
317
+ var _option_priceCentsByVariant;
318
+ const priceCents = option == null ? void 0 : (_option_priceCentsByVariant = option.priceCentsByVariant) == null ? void 0 : _option_priceCentsByVariant[variant.id];
319
+ if (typeof priceCents !== 'number') continue;
320
+ const label = variantPriceLabel(variant);
321
+ if (!byVariant.some((entry)=>entry.label === label && entry.priceCents === priceCents)) {
322
+ byVariant.push({
323
+ label,
324
+ priceCents
325
+ });
326
+ }
327
+ }
328
+ return {
329
+ name: String((_ref = option == null ? void 0 : option.name) != null ? _ref : ''),
330
+ priceCents: Number(option == null ? void 0 : option.priceCents) || 0,
331
+ byVariant
332
+ };
333
+ })
334
+ };
335
+ });
336
+ return writeAddOnCell(groups);
337
+ }
338
+ /** A variant's name in a cell, in any case and whichever order its option values come in. */ export function variantLabelKey(label) {
339
+ return label.split('/').map((part)=>part.trim().toLowerCase()).sort().join('|');
340
+ }
341
+ /** The ids of a product's variants by the name a cell gives them. */ export function addOnVariantIds(variants) {
342
+ const out = {};
343
+ for (const variant of variants){
344
+ var _out_key;
345
+ const key = variantLabelKey(variantPriceLabel(variant));
346
+ out[key] = [
347
+ ...(_out_key = out[key]) != null ? _out_key : [],
348
+ variant.id
349
+ ];
350
+ }
351
+ return out;
352
+ }
353
+ /** An id nothing else holds, the same one for the same name so a retried write finds what it wrote. */ function freeId(prefix, name, taken) {
354
+ const base = `${prefix}-${commerceSlug(name) || 'choice'}`;
355
+ let id = base;
356
+ for(let suffix = 2; taken.has(id); suffix += 1)id = `${base}-${suffix}`;
357
+ taken.add(id);
358
+ return id;
359
+ }
360
+ /** Takes the first stored entry holding a name, so two entries with one name each find their own. */ function takeByName(pool, name) {
361
+ const key = name.trim().toLowerCase();
362
+ const at = pool.findIndex((entry)=>{
363
+ var _entry_name;
364
+ return String((_entry_name = entry.name) != null ? _entry_name : '').trim().toLowerCase() === key;
365
+ });
366
+ return at < 0 ? undefined : pool.splice(at, 1)[0];
367
+ }
368
+ /**
369
+ * The groups an add-ons cell stores. A group or choice the product already
370
+ * has keeps its id, so a cart holding that choice still finds it; one it does
371
+ * not have gets a new id. `problem` names a variant no price can land on.
372
+ * `groups` is `null` for a cell that cannot be read at all.
373
+ */ export function modifierGroupsFromAddOnCell(cell, existing, variantIds) {
374
+ const read = readAddOnCell(cell);
375
+ if ('message' in read) return {
376
+ groups: null,
377
+ problem: read.message
378
+ };
379
+ let problem = null;
380
+ const stored = Array.isArray(existing) ? existing : [];
381
+ const pool = [
382
+ ...stored
383
+ ];
384
+ const groupIds = new Set(stored.map((group)=>group.id));
385
+ const groups = read.value.map((group)=>{
386
+ var _ref;
387
+ const held = takeByName(pool, group.name);
388
+ const heldOptions = Array.isArray(held == null ? void 0 : held.options) ? [
389
+ ...held.options
390
+ ] : [];
391
+ const optionIds = new Set(heldOptions.map((option)=>option.id));
392
+ const options = group.choices.map((choice)=>{
393
+ var _ref;
394
+ const heldOption = takeByName(heldOptions, choice.name);
395
+ const prices = {};
396
+ for (const entry of choice.byVariant){
397
+ const ids = variantIds[variantLabelKey(entry.label)];
398
+ if (!(ids == null ? void 0 : ids.length)) {
399
+ problem != null ? problem : problem = `"${choice.name}" is priced for "${entry.label}", and this product has no variant by that name.`;
400
+ continue;
401
+ }
402
+ for (const id of ids)prices[id] = entry.priceCents;
403
+ }
404
+ const option = _extends({}, heldOption, {
405
+ id: (_ref = heldOption == null ? void 0 : heldOption.id) != null ? _ref : freeId('o', choice.name, optionIds),
406
+ name: choice.name,
407
+ priceCents: choice.priceCents
408
+ });
409
+ if (Object.keys(prices).length) option.priceCentsByVariant = prices;
410
+ else delete option.priceCentsByVariant;
411
+ return option;
412
+ });
413
+ return _extends({}, held != null ? held : {}, {
414
+ id: (_ref = held == null ? void 0 : held.id) != null ? _ref : freeId('g', group.name, groupIds),
415
+ name: group.name,
416
+ min: group.min,
417
+ max: group.max,
418
+ online: group.online,
419
+ options
420
+ });
421
+ });
422
+ return {
423
+ groups,
424
+ problem
425
+ };
426
+ }
427
+ /*==========================================
428
+ * CHECK-IN
429
+ *=========================================*/ const CHECK_IN_WORDS = {
430
+ yes: true,
431
+ y: true,
432
+ true: true,
433
+ on: true,
434
+ no: false,
435
+ n: false,
436
+ false: false,
437
+ off: false
438
+ };
439
+ const CHECK_IN_HELP = 'Write No, Yes, or Yes, 4 people, ask which day.';
440
+ /** A check-in cell as the setting it names, or what is wrong with it. How many people is the model's to refuse. */ export function readCheckInCell(cell) {
441
+ const [first = '', ...rest] = String(cell != null ? cell : '').split(',').map((part)=>part.trim());
442
+ const enabled = CHECK_IN_WORDS[first.toLowerCase()];
443
+ if (enabled === undefined) return fail(`"${first}" is not a check-in setting. ${CHECK_IN_HELP}`);
444
+ if (!enabled) return rest.some(Boolean) ? fail(`A product with no check-in has nothing else to set. ${CHECK_IN_HELP}`) : {
445
+ value: {
446
+ enabled: false
447
+ }
448
+ };
449
+ const setting = {
450
+ enabled: true,
451
+ headcount: 1
452
+ };
453
+ for (const part of rest){
454
+ if (!part) continue;
455
+ const people = /^(\d+) (?:people|person)$/i.exec(part);
456
+ if (people) setting.headcount = Number(people[1]);
457
+ else if (/^ask which day$/i.test(part)) setting.askUseDate = true;
458
+ else return fail(`"${part}" is not a check-in setting. ${CHECK_IN_HELP}`);
459
+ }
460
+ return {
461
+ value: setting
462
+ };
463
+ }
464
+ /** A setting as the one way a cell writes it. */ export function writeCheckInCell(setting) {
465
+ var _setting_headcount;
466
+ if (!setting.enabled) return 'No';
467
+ const headcount = (_setting_headcount = setting.headcount) != null ? _setting_headcount : 1;
468
+ return [
469
+ 'Yes',
470
+ ...headcount === 1 ? [] : [
471
+ `${headcount} people`
472
+ ],
473
+ ...setting.askUseDate === true ? [
474
+ 'ask which day'
475
+ ] : []
476
+ ].join(', ');
477
+ }
478
+ /** A stored check-in setting as a cell; `null` when it has none. */ export function checkInCellOf(stored) {
479
+ const setting = normalizeProductCheckIn(stored);
480
+ return setting ? writeCheckInCell(setting) : null;
481
+ }
482
+ /** The setting a cell stores; `undefined` for a blank cell. */ export function checkInFromCell(cell) {
483
+ const read = readCheckInCell(cell);
484
+ return 'message' in read ? undefined : read.value;
485
+ }
486
+
487
+ //# sourceMappingURL=product-register-cells.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/transfer/product-register-cells.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n normalizeProductCheckIn,\n type ProductCheckIn,\n} from '../model/commerce-check-in-product'\nimport { commerceSlug } from '../model/commerce'\nimport {\n variantPriceLabel,\n type ProductModifierGroup,\n type ProductModifierOption,\n} from '../model/product-modifiers'\n\n/*\n * A PRODUCT'S ADD-ONS AND CHECK-IN AS FILE CELLS (AGL-4060).\n *\n * Both settings are nested on the document and flat in a spreadsheet, so each\n * is one cell written in words a person can read and type:\n *\n * Add-ons Milk (at least 1): Whole, Oat +$0.75; Walls (at most 2, register only): Side +$50.00 (10x20 +$75.00)\n * Check-in Yes, 4 people, ask which day\n *\n * Add-ons: groups split by semicolons, a group's name then a colon then its\n * choices split by commas. The parentheses after a group hold what the\n * product editor calls At least, At most and Show on the website (off is\n * \"register only\"); left out they are what a new group starts with. The\n * parentheses after a choice hold what it adds on a variant, by the name the\n * editor gives that variant. A name holding a comma, semicolon, colon or\n * parenthesis goes in double quotes.\n *\n * A record reads as the same text a file does, so the dry run compares two\n * strings, shows them as before → after, and a re-imported export changes\n * nothing. Reading never decides what a store may hold: limits belong to\n * `validateProduct`, which the plan and the apply both ask.\n */\n\n/** What a cell read as, or why it could not be. */\ntype Read<T> = { value: T } | { message: string }\n\nconst fail = (message: string): { message: string } => ({ message })\n\nconst QUOTE_THE_NAME =\n 'Put double quotes around a name with a comma, semicolon, colon or parenthesis, such as \"Walls (vinyl)\".'\nconst NOT_CLOSED = `A quote or parenthesis is not closed. ${QUOTE_THE_NAME}`\n\n/** A price at the end of a choice: `+$0.75`, `+0.75` or `$0.75`. */\nconst PRICE_TAIL = /(?:^|\\s)([-+]\\s?\\$?|\\$)([\\d.,]+)$/\nconst PRICE_DIGITS = /^(?:\\d+(?:\\.\\d{1,2})?|\\.\\d{1,2})$/\n\n/**\n * Walks a cell's text outside its quoted names, naming each character and how\n * deep in parentheses it sits. A quote opens a name only where a name starts,\n * so the `\"` in `12\" wall` is just a character. `false` when something is left\n * open.\n */\nfunction walk(source: string, visit: (character: string, at: number, depth: number) => void): boolean {\n let depth = 0\n let quoted = false\n let atStart = true\n for (let at = 0; at < source.length; at += 1) {\n const character = source[at] as string\n if (quoted) {\n if (character === '\"') {\n if (source[at + 1] === '\"') at += 1\n else quoted = false\n }\n continue\n }\n if (character === '\"' && atStart) {\n quoted = true\n atStart = false\n continue\n }\n if (character === ')') {\n depth -= 1\n if (depth < 0) return false\n }\n visit(character, at, depth)\n if (character === '(') depth += 1\n if (!/\\s/.test(character)) atStart = /[(,;:]/.test(character)\n }\n return !quoted && depth === 0\n}\n\n/** The pieces between one separator, outside quotes and parentheses; `null` when something is left open. */\nfunction splitTop(source: string, separator: string): string[] | null {\n const parts: string[] = []\n let start = 0\n const closed = walk(source, (character, at, depth) => {\n if (character === separator && depth === 0) {\n parts.push(source.slice(start, at))\n start = at + 1\n }\n })\n if (!closed) return null\n parts.push(source.slice(start))\n return parts\n}\n\n/** A piece split into what comes before its parentheses and what is in them. */\nfunction takeParens(source: string): Read<{ head: string; inner: string | null }> {\n let open = -1\n let close = -1\n let groups = 0\n const closed = walk(source, (character, at, depth) => {\n if (character === '(' && depth === 0) {\n groups += 1\n open = at\n }\n if (character === ')' && depth === 0) close = at\n })\n if (!closed) return fail(NOT_CLOSED)\n if (open < 0) return { value: { head: source.trim(), inner: null } }\n if (groups > 1 || source.slice(close + 1).trim()) return fail(QUOTE_THE_NAME)\n return { value: { head: source.slice(0, open).trim(), inner: source.slice(open + 1, close) } }\n}\n\n/** A quoted name and what follows it; `null` when the quote never closes. */\nfunction readQuoted(text: string): { name: string; rest: string } | null {\n let name = ''\n for (let at = 1; at < text.length; at += 1) {\n const character = text[at] as string\n if (character !== '\"') {\n name += character\n } else if (text[at + 1] === '\"') {\n name += '\"'\n at += 1\n } else {\n return { name, rest: text.slice(at + 1).trim() }\n }\n }\n return null\n}\n\nfunction readCents(sign: string, digits: string): Read<number> {\n const price = `${sign}${digits}`.replace(/\\s/g, '')\n if (sign.startsWith('-') || !PRICE_DIGITS.test(digits)) {\n return fail(`\"${price}\" is not a price. Write what the choice adds like +$0.75.`)\n }\n return { value: Math.round(Number(digits) * 100) }\n}\n\n/** A name with the price after it, if it has one. */\nfunction readNameAndPrice(source: string): Read<{ name: string; cents: number | null }> {\n const text = source.trim()\n let name = text\n let priceText = ''\n if (text.startsWith('\"')) {\n const quoted = readQuoted(text)\n if (!quoted) return fail(NOT_CLOSED)\n name = quoted.name\n priceText = quoted.rest\n if (priceText && PRICE_TAIL.exec(priceText)?.index !== 0) return fail(QUOTE_THE_NAME)\n } else {\n const tail = PRICE_TAIL.exec(text)\n if (tail) {\n name = text.slice(0, tail.index).trim()\n priceText = tail[0].trim()\n }\n }\n if (!priceText) return { value: { name, cents: null } }\n const price = PRICE_TAIL.exec(priceText) as RegExpExecArray\n const cents = readCents(price[1] as string, price[2] as string)\n return 'message' in cents ? cents : { value: { name, cents: cents.value } }\n}\n\n/*==========================================\n * ADD-ONS\n *=========================================*/\n\n/** One choice as a cell names it. */\nexport interface AddOnCellChoice {\n name: string\n priceCents: number\n /** What it adds on a variant, by that variant's name. */\n byVariant: Array<{ label: string; priceCents: number }>\n}\n\n/** One group as a cell names it. */\nexport interface AddOnCellGroup {\n name: string\n min: number\n max: number\n online: boolean\n choices: AddOnCellChoice[]\n}\n\n/** How many a group takes when its cell does not say: as a new group starts, or its minimum if that is higher. */\nconst defaultMax = (min: number): number => Math.max(1, min)\n\nfunction readSettings(\n inner: string | null,\n): Read<Pick<AddOnCellGroup, 'min' | 'max' | 'online'>> {\n let min = 0\n let max: number | null = null\n let online = true\n for (const raw of (inner ?? '').split(',')) {\n const setting = raw.trim()\n if (!setting) continue\n const least = /^at least (\\d+)$/i.exec(setting)\n const most = /^at most (\\d+)$/i.exec(setting)\n if (least) min = Number(least[1])\n else if (most) max = Number(most[1])\n else if (/^register only$/i.test(setting)) online = false\n else {\n return fail(`\"${setting}\" is not a group setting. Use at least 1, at most 2 or register only. ${QUOTE_THE_NAME}`)\n }\n }\n return { value: { min, max: max ?? defaultMax(min), online } }\n}\n\nfunction readByVariant(inner: string | null, choice: string): Read<AddOnCellChoice['byVariant']> {\n if (inner === null) return { value: [] }\n const parts = splitTop(inner, ',')\n if (!parts) return fail(NOT_CLOSED)\n const byVariant: AddOnCellChoice['byVariant'] = []\n for (const part of parts) {\n if (!part.trim()) continue\n const read = readNameAndPrice(part)\n if ('message' in read) return read\n const { name: label, cents } = read.value\n if (!label || cents === null) {\n return fail(`\"${part.trim()}\" needs a variant and a price, such as 10x20 +$75.00. ${QUOTE_THE_NAME}`)\n }\n if (byVariant.some((entry) => variantLabelKey(entry.label) === variantLabelKey(label))) {\n return fail(`\"${choice}\" is priced twice for \"${label}\".`)\n }\n byVariant.push({ label, priceCents: cents })\n }\n return { value: byVariant }\n}\n\nfunction readChoices(source: string, group: string): Read<AddOnCellChoice[]> {\n const parts = splitTop(source, ',')\n if (!parts) return fail(NOT_CLOSED)\n const choices: AddOnCellChoice[] = []\n let previousPriced = false\n for (const part of parts) {\n if (!part.trim()) continue\n const shape = takeParens(part)\n if ('message' in shape) return shape\n const read = readNameAndPrice(shape.value.head)\n if ('message' in read) return read\n const { name, cents } = read.value\n if (!name) return fail(`Name every choice in \"${group}\".`)\n // `+$1,000.00` would read as a $1 choice and a free one named 000.00.\n if (previousPriced && /^\\d{3}(?:\\.\\d*)?$/.test(name)) {\n return fail('Write a price without a comma, such as +$1000.00.')\n }\n const byVariant = readByVariant(shape.value.inner, name)\n if ('message' in byVariant) return byVariant\n choices.push({ name, priceCents: cents ?? 0, byVariant: byVariant.value })\n previousPriced = cents !== null\n }\n return { value: choices }\n}\n\n/** An add-ons cell as its groups, or what is wrong with it for the person to fix. */\nexport function readAddOnCell(cell: unknown): Read<AddOnCellGroup[]> {\n const groups: AddOnCellGroup[] = []\n const parts = splitTop(String(cell ?? ''), ';')\n if (!parts) return fail(NOT_CLOSED)\n for (const part of parts) {\n if (!part.trim()) continue\n const sides = splitTop(part, ':')\n if (!sides) return fail(NOT_CLOSED)\n if (sides.length === 1) {\n return fail(`\"${part.trim()}\" needs its choices after a colon, such as Milk: Whole, Oat +$0.75.`)\n }\n if (sides.length > 2) return fail(QUOTE_THE_NAME)\n const head = takeParens(sides[0] as string)\n if ('message' in head) return head\n let name = head.value.head\n if (name.startsWith('\"')) {\n const quoted = readQuoted(name)\n if (!quoted) return fail(NOT_CLOSED)\n if (quoted.rest) return fail(QUOTE_THE_NAME)\n name = quoted.name\n }\n if (!name) return fail('Name every add-on group.')\n const settings = readSettings(head.value.inner)\n if ('message' in settings) return settings\n const choices = readChoices(sides[1] as string, name)\n if ('message' in choices) return choices\n groups.push({ name, ...settings.value, choices: choices.value })\n }\n return { value: groups }\n}\n\nfunction writeName(name: string): string {\n const plain =\n name.trim() === name &&\n Boolean(name) &&\n !name.startsWith('\"') &&\n !/[,;:()]/.test(name) &&\n !PRICE_TAIL.test(name)\n return plain ? name : `\"${name.replace(/\"/g, '\"\"')}\"`\n}\n\nconst writeCents = (cents: number): string => `+$${(cents / 100).toFixed(2)}`\n\nfunction writeChoice(choice: AddOnCellChoice): string {\n const price = choice.priceCents ? ` ${writeCents(choice.priceCents)}` : ''\n const byVariant = choice.byVariant.length\n ? ` (${choice.byVariant.map((entry) => `${writeName(entry.label)} ${writeCents(entry.priceCents)}`).join(', ')})`\n : ''\n return `${writeName(choice.name)}${price}${byVariant}`\n}\n\n/** Groups as the one way a cell writes them, so two cells saying the same thing are the same text. */\nexport function writeAddOnCell(groups: readonly AddOnCellGroup[]): string {\n return groups\n .map((group) => {\n const settings = [\n ...(group.min > 0 ? [`at least ${group.min}`] : []),\n ...(group.max !== defaultMax(group.min) ? [`at most ${group.max}`] : []),\n ...(group.online ? [] : ['register only']),\n ]\n const head = settings.length ? `${writeName(group.name)} (${settings.join(', ')})` : writeName(group.name)\n return `${head}: ${group.choices.map(writeChoice).join(', ')}`\n })\n .join('; ')\n}\n\ntype LabelledVariant = { id: string; options?: Record<string, string> }\n\n/** A stored product's add-ons as a cell; `null` when it has none. */\nexport function addOnCellOf(stored: unknown, variants: readonly LabelledVariant[]): string | null {\n if (!Array.isArray(stored) || !stored.length) return null\n const groups = (stored as Array<Partial<ProductModifierGroup> | null>).map((group): AddOnCellGroup => ({\n name: String(group?.name ?? ''),\n min: Number(group?.min) || 0,\n max: Number(group?.max) || 0,\n online: group?.online === true,\n choices: (Array.isArray(group?.options) ? group.options : []).map((option): AddOnCellChoice => {\n const byVariant: AddOnCellChoice['byVariant'] = []\n for (const variant of variants) {\n const priceCents = option?.priceCentsByVariant?.[variant.id]\n if (typeof priceCents !== 'number') continue\n const label = variantPriceLabel(variant)\n if (!byVariant.some((entry) => entry.label === label && entry.priceCents === priceCents)) {\n byVariant.push({ label, priceCents })\n }\n }\n return { name: String(option?.name ?? ''), priceCents: Number(option?.priceCents) || 0, byVariant }\n }),\n }))\n return writeAddOnCell(groups)\n}\n\n/** A variant's name in a cell, in any case and whichever order its option values come in. */\nexport function variantLabelKey(label: string): string {\n return label\n .split('/')\n .map((part) => part.trim().toLowerCase())\n .sort()\n .join('|')\n}\n\n/** The ids of a product's variants by the name a cell gives them. */\nexport function addOnVariantIds(variants: readonly LabelledVariant[]): Record<string, string[]> {\n const out: Record<string, string[]> = {}\n for (const variant of variants) {\n const key = variantLabelKey(variantPriceLabel(variant))\n out[key] = [...(out[key] ?? []), variant.id]\n }\n return out\n}\n\n/** An id nothing else holds, the same one for the same name so a retried write finds what it wrote. */\nfunction freeId(prefix: string, name: string, taken: Set<string>): string {\n const base = `${prefix}-${commerceSlug(name) || 'choice'}`\n let id = base\n for (let suffix = 2; taken.has(id); suffix += 1) id = `${base}-${suffix}`\n taken.add(id)\n return id\n}\n\n/** Takes the first stored entry holding a name, so two entries with one name each find their own. */\nfunction takeByName<T extends { name?: string }>(pool: T[], name: string): T | undefined {\n const key = name.trim().toLowerCase()\n const at = pool.findIndex((entry) => String(entry.name ?? '').trim().toLowerCase() === key)\n return at < 0 ? undefined : pool.splice(at, 1)[0]\n}\n\n/**\n * The groups an add-ons cell stores. A group or choice the product already\n * has keeps its id, so a cart holding that choice still finds it; one it does\n * not have gets a new id. `problem` names a variant no price can land on.\n * `groups` is `null` for a cell that cannot be read at all.\n */\nexport function modifierGroupsFromAddOnCell(\n cell: unknown,\n existing: readonly ProductModifierGroup[] | undefined,\n variantIds: Readonly<Record<string, string[]>>,\n): { groups: ProductModifierGroup[] | null; problem: string | null } {\n const read = readAddOnCell(cell)\n if ('message' in read) return { groups: null, problem: read.message }\n let problem: string | null = null\n const stored = Array.isArray(existing) ? existing : []\n const pool = [...stored]\n const groupIds = new Set(stored.map((group) => group.id))\n const groups = read.value.map((group): ProductModifierGroup => {\n const held = takeByName(pool, group.name)\n const heldOptions = Array.isArray(held?.options) ? [...held.options] : []\n const optionIds = new Set(heldOptions.map((option) => option.id))\n const options = group.choices.map((choice): ProductModifierOption => {\n const heldOption = takeByName(heldOptions, choice.name)\n const prices: Record<string, number> = {}\n for (const entry of choice.byVariant) {\n const ids = variantIds[variantLabelKey(entry.label)]\n if (!ids?.length) {\n problem ??= `\"${choice.name}\" is priced for \"${entry.label}\", and this product has no variant by that name.`\n continue\n }\n for (const id of ids) prices[id] = entry.priceCents\n }\n const option: ProductModifierOption = {\n ...heldOption,\n id: heldOption?.id ?? freeId('o', choice.name, optionIds),\n name: choice.name,\n priceCents: choice.priceCents,\n }\n if (Object.keys(prices).length) option.priceCentsByVariant = prices\n else delete option.priceCentsByVariant\n return option\n })\n return {\n ...(held ?? {}),\n id: held?.id ?? freeId('g', group.name, groupIds),\n name: group.name,\n min: group.min,\n max: group.max,\n online: group.online,\n options,\n }\n })\n return { groups, problem }\n}\n\n/*==========================================\n * CHECK-IN\n *=========================================*/\n\nconst CHECK_IN_WORDS: Readonly<Record<string, boolean>> = {\n yes: true,\n y: true,\n true: true,\n on: true,\n no: false,\n n: false,\n false: false,\n off: false,\n}\n\nconst CHECK_IN_HELP = 'Write No, Yes, or Yes, 4 people, ask which day.'\n\n/** A check-in cell as the setting it names, or what is wrong with it. How many people is the model's to refuse. */\nexport function readCheckInCell(cell: unknown): Read<ProductCheckIn> {\n const [first = '', ...rest] = String(cell ?? '')\n .split(',')\n .map((part) => part.trim())\n const enabled = CHECK_IN_WORDS[first.toLowerCase()]\n if (enabled === undefined) return fail(`\"${first}\" is not a check-in setting. ${CHECK_IN_HELP}`)\n if (!enabled) return rest.some(Boolean) ? fail(`A product with no check-in has nothing else to set. ${CHECK_IN_HELP}`) : { value: { enabled: false } }\n const setting: ProductCheckIn = { enabled: true, headcount: 1 }\n for (const part of rest) {\n if (!part) continue\n const people = /^(\\d+) (?:people|person)$/i.exec(part)\n if (people) setting.headcount = Number(people[1])\n else if (/^ask which day$/i.test(part)) setting.askUseDate = true\n else return fail(`\"${part}\" is not a check-in setting. ${CHECK_IN_HELP}`)\n }\n return { value: setting }\n}\n\n/** A setting as the one way a cell writes it. */\nexport function writeCheckInCell(setting: ProductCheckIn): string {\n if (!setting.enabled) return 'No'\n const headcount = setting.headcount ?? 1\n return [\n 'Yes',\n ...(headcount === 1 ? [] : [`${headcount} people`]),\n ...(setting.askUseDate === true ? ['ask which day'] : []),\n ].join(', ')\n}\n\n/** A stored check-in setting as a cell; `null` when it has none. */\nexport function checkInCellOf(stored: unknown): string | null {\n const setting = normalizeProductCheckIn(stored)\n return setting ? writeCheckInCell(setting) : null\n}\n\n/** The setting a cell stores; `undefined` for a blank cell. */\nexport function checkInFromCell(cell: unknown): ProductCheckIn | undefined {\n const read = readCheckInCell(cell)\n return 'message' in read ? undefined : read.value\n}\n"],"names":["normalizeProductCheckIn","commerceSlug","variantPriceLabel","fail","message","QUOTE_THE_NAME","NOT_CLOSED","PRICE_TAIL","PRICE_DIGITS","walk","source","visit","depth","quoted","atStart","at","length","character","test","splitTop","separator","parts","start","closed","push","slice","takeParens","open","close","groups","value","head","trim","inner","readQuoted","text","name","rest","readCents","sign","digits","price","replace","startsWith","Math","round","Number","readNameAndPrice","priceText","exec","index","tail","cents","defaultMax","min","max","readSettings","online","raw","split","setting","least","most","readByVariant","choice","byVariant","part","read","label","some","entry","variantLabelKey","priceCents","readChoices","group","choices","previousPriced","shape","readAddOnCell","cell","String","sides","settings","writeName","plain","Boolean","writeCents","toFixed","writeChoice","map","join","writeAddOnCell","addOnCellOf","stored","variants","Array","isArray","options","option","variant","priceCentsByVariant","id","toLowerCase","sort","addOnVariantIds","out","key","freeId","prefix","taken","base","suffix","has","add","takeByName","pool","findIndex","undefined","splice","modifierGroupsFromAddOnCell","existing","variantIds","problem","groupIds","Set","held","heldOptions","optionIds","heldOption","prices","ids","Object","keys","CHECK_IN_WORDS","yes","y","true","on","no","n","false","off","CHECK_IN_HELP","readCheckInCell","first","enabled","headcount","people","ask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ELD: {
36
36
  readonly taxExempt: "taxExempt";
37
37
  readonly oversellPolicy: "oversellPolicy";
38
38
  readonly lowStockThreshold: "lowStockThreshold";
39
+ readonly posQuickKey: "posQuickKey";
40
+ readonly checkIn: "checkIn";
41
+ readonly modifierGroups: "modifierGroups";
39
42
  readonly option1Value: "option1Value";
40
43
  readonly option2Value: "option2Value";
41
44
  readonly option3Value: "option3Value";
@@ -46,6 +49,7 @@ export declare const PRODUCT_FIELD: {
46
49
  readonly inventory: "inventory";
47
50
  readonly weightGrams: "weightGrams";
48
51
  readonly variantImage: "variantImage";
52
+ readonly variantCheckIn: "variantCheckIn";
49
53
  readonly priceFrom: "priceFrom";
50
54
  readonly totalInventory: "totalInventory";
51
55
  readonly soldOut: "soldOut";
@@ -152,6 +156,11 @@ export interface ProductRowPlan {
152
156
  };
153
157
  /** Why the product this row belongs to cannot be stored, when it cannot. */
154
158
  problem?: string;
159
+ /**
160
+ * On a first row whose add-ons are priced by variant: the variants by name
161
+ * once every row is written, since a later row may be what adds one.
162
+ */
163
+ addOnVariants?: Record<string, string[]>;
155
164
  }
156
165
  /** A planned row with what the apply needs. */
157
166
  export type ProductPlannedRow = PlannedTransferRow & {
@@ -196,6 +205,8 @@ export declare function applyProductRow(current: HostProduct, changes: {
196
205
  isNew: boolean;
197
206
  values: Readonly<Record<string, unknown>>;
198
207
  };
208
+ /** The variants an add-ons cell's prices name, when the plan knows more than the product holds yet. */
209
+ addOnVariants?: Readonly<Record<string, string[]>>;
199
210
  }, categoryIdsOf: CategoryIdsOf): HostProduct;
200
211
  /** A new product's document from its leader's plan, before the platform's stamps. */
201
212
  export declare function createProductDocument(create: NonNullable<ProductRowPlan['create']>, categoryIdsOf: CategoryIdsOf): HostProduct;
@@ -207,5 +218,6 @@ export declare function productRowChanges(row: ProductPlannedRow): {
207
218
  isNew: boolean;
208
219
  values: Record<string, unknown>;
209
220
  };
221
+ addOnVariants?: Record<string, string[]>;
210
222
  };
211
223
  export {};