@happyvertical/smrt-commerce 0.55.13 → 0.55.15

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 (55) hide show
  1. package/AGENTS.md +8 -0
  2. package/README.md +36 -0
  3. package/agents/cost-billing.md +41 -0
  4. package/agents/payment-allocations.md +45 -0
  5. package/agents/purchasing-ui.md +27 -0
  6. package/dist/allocation-integrity.d.ts +13 -0
  7. package/dist/allocation-integrity.d.ts.map +1 -0
  8. package/dist/billing/payment-attempts.d.ts.map +1 -1
  9. package/dist/chunks/money-DfrRxrel.js +50 -0
  10. package/dist/chunks/money-DfrRxrel.js.map +1 -0
  11. package/dist/chunks/{types-CRnln577.js → types-zVnIjSOk.js} +29 -2
  12. package/dist/chunks/{types-CRnln577.js.map → types-zVnIjSOk.js.map} +1 -1
  13. package/dist/collections/PaymentAllocationCollection.d.ts +14 -0
  14. package/dist/collections/PaymentAllocationCollection.d.ts.map +1 -1
  15. package/dist/cost-billing.d.ts +58 -0
  16. package/dist/cost-billing.d.ts.map +1 -0
  17. package/dist/cost-billing.js +126 -0
  18. package/dist/cost-billing.js.map +1 -0
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +175 -93
  22. package/dist/index.js.map +1 -1
  23. package/dist/manifest.json +43 -2
  24. package/dist/models/Contract.d.ts +7 -1
  25. package/dist/models/Contract.d.ts.map +1 -1
  26. package/dist/models/Invoice.d.ts.map +1 -1
  27. package/dist/models/Payment.d.ts +2 -0
  28. package/dist/models/Payment.d.ts.map +1 -1
  29. package/dist/models/PaymentAllocation.d.ts +7 -33
  30. package/dist/models/PaymentAllocation.d.ts.map +1 -1
  31. package/dist/playground.js +23 -0
  32. package/dist/playground.js.map +1 -1
  33. package/dist/smrt-knowledge.json +86 -8
  34. package/dist/svelte/components/PurchaseOrderHeaderForm.svelte +106 -0
  35. package/dist/svelte/components/PurchaseOrderHeaderForm.svelte.d.ts +49 -0
  36. package/dist/svelte/components/PurchaseOrderHeaderForm.svelte.d.ts.map +1 -0
  37. package/dist/svelte/index.d.ts +4 -0
  38. package/dist/svelte/index.d.ts.map +1 -1
  39. package/dist/svelte/index.js +3 -0
  40. package/dist/svelte/playground.d.ts +93 -0
  41. package/dist/svelte/playground.d.ts.map +1 -1
  42. package/dist/svelte/playground.js +20 -0
  43. package/dist/svelte/purchasing-i18n.d.ts +9 -0
  44. package/dist/svelte/purchasing-i18n.d.ts.map +1 -1
  45. package/dist/svelte/purchasing-i18n.js +9 -0
  46. package/dist/svelte/purchasing-types.d.ts +13 -0
  47. package/dist/svelte/purchasing-types.d.ts.map +1 -1
  48. package/dist/types/index.d.ts +7 -0
  49. package/dist/types/index.d.ts.map +1 -1
  50. package/dist/ui.d.ts.map +1 -1
  51. package/dist/ui.js +9 -0
  52. package/dist/ui.js.map +1 -1
  53. package/package.json +16 -12
  54. package/dist/chunks/money-WSMvSgWq.js +0 -8
  55. package/dist/chunks/money-WSMvSgWq.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-commerce",
5
- "packageVersion": "0.55.13",
5
+ "packageVersion": "0.55.15",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-commerce:ContractCollection": {
8
8
  "name": "contractcollection",
@@ -2087,6 +2087,25 @@
2087
2087
  "packageName": "@happyvertical/smrt-commerce",
2088
2088
  "fields": {},
2089
2089
  "methods": {
2090
+ "allocatePayment": {
2091
+ "name": "allocatePayment",
2092
+ "async": true,
2093
+ "parameters": [
2094
+ {
2095
+ "name": "input",
2096
+ "type": "object",
2097
+ "optional": false,
2098
+ "memberTypes": [
2099
+ "string",
2100
+ "object[]",
2101
+ "number"
2102
+ ]
2103
+ }
2104
+ ],
2105
+ "returnType": "Promise<PaymentAllocation[]>",
2106
+ "isStatic": false,
2107
+ "isPublic": true
2108
+ },
2090
2109
  "findByPayment": {
2091
2110
  "name": "findByPayment",
2092
2111
  "async": true,
@@ -6252,6 +6271,26 @@
6252
6271
  "_meta": {
6253
6272
  "description": "Where it came from, for example your shop, a marketplace or a phone call."
6254
6273
  }
6274
+ },
6275
+ "expectedDate": {
6276
+ "type": "meta",
6277
+ "required": false,
6278
+ "default": "",
6279
+ "description": "The date you expect the delivery, as YYYY-MM-DD. Leave blank if it is not known.",
6280
+ "_meta": {
6281
+ "description": "The date you expect the delivery, as YYYY-MM-DD. Leave blank if it is not known.",
6282
+ "underlyingType": "text"
6283
+ }
6284
+ },
6285
+ "shipTo": {
6286
+ "type": "meta",
6287
+ "required": false,
6288
+ "default": "",
6289
+ "description": "Where this order should be delivered, including any delivery instructions.",
6290
+ "_meta": {
6291
+ "description": "Where this order should be delivered, including any delivery instructions.",
6292
+ "underlyingType": "text"
6293
+ }
6255
6294
  }
6256
6295
  },
6257
6296
  "methods": {
@@ -16215,13 +16254,15 @@
16215
16254
  }
16216
16255
  },
16217
16256
  "help": {
16218
- "markdown": "## Overview\n\nPurchases is where you order from your vendors and keep track of what you have\nbought. Every purchase order belongs to one of your vendors and records the\namounts, the dates and where the order stands.\n\n## Tasks\n\n### Place a purchase order\n\n1. Choose the **New** button above the list.\n2. Enter the **{field:vendorId}** you are buying from. Add them under Vendors\n first so they are on your list.\n3. Enter the **{field:subtotal}** and **{field:taxAmount}**, then the\n **{field:totalAmount}** you expect to pay.\n4. Set the **{field:issueDate}**, and the **{field:dueDate}** for when the\n goods or the payment are due.\n5. Add your own **{field:reference}**, such as the vendor's quote number, so\n you can match it to their paperwork.\n6. Save.\n\n### Follow an order until it arrives\n\n1. Open the purchase order from the list and choose Edit.\n2. Update **{field:status}** as the order moves along, for example from draft to\n sent, accepted and completed.\n3. Use **{field:notes}** to record what the vendor told you, such as delays or\n partial shipments.\n\n### Record the agreement\n\n1. Open the purchase order and choose Edit.\n2. Write down the **{field:terms}** you agreed with the vendor, such as payment\n or delivery conditions.\n3. Set **{field:expiryDate}** if the vendor's offer is only good until a certain\n day.\n",
16257
+ "markdown": "## Overview\n\nPurchases is where you order from your vendors and keep track of what you have\nbought. Every purchase order belongs to one of your vendors and records the\namounts, the dates and where the order stands.\n\n## Tasks\n\n### Place a purchase order\n\n1. Choose the **New** button above the list.\n2. Enter the **{field:vendorId}** you are buying from. Add them under Vendors\n first so they are on your list.\n3. Enter the **{field:subtotal}** and **{field:taxAmount}**, then the\n **{field:totalAmount}** you expect to pay.\n4. Set the **{field:issueDate}**, and the **{field:dueDate}** for when the\n goods or the payment are due.\n5. Add your own **{field:reference}**, such as the vendor's quote number, so\n you can match it to their paperwork.\n6. Enter **{field:expectedDate}** as YYYY-MM-DD if you know when the delivery\n should arrive. Leave it blank until a date is agreed.\n7. Use **{field:shipTo}** for the delivery address and instructions, such as\n which entrance or loading dock to use.\n8. Save.\n\n### Follow an order until it arrives\n\n1. Open the purchase order from the list and choose Edit.\n2. Update **{field:status}** as the order moves along, for example from draft to\n sent, accepted and completed.\n3. Use **{field:notes}** to record what the vendor told you, such as delays or\n partial shipments.\n\n### Record the agreement\n\n1. Open the purchase order and choose Edit.\n2. Write down the **{field:terms}** you agreed with the vendor, such as payment\n or delivery conditions.\n3. Set **{field:expiryDate}** if the vendor's offer is only good until a certain\n day.\n",
16219
16258
  "fieldRefs": [
16220
16259
  "dueDate",
16260
+ "expectedDate",
16221
16261
  "expiryDate",
16222
16262
  "issueDate",
16223
16263
  "notes",
16224
16264
  "reference",
16265
+ "shipTo",
16225
16266
  "status",
16226
16267
  "subtotal",
16227
16268
  "taxAmount",
@@ -3,7 +3,7 @@
3
3
  * @packageDocumentation
4
4
  */
5
5
  import { type Meta, SmrtObject } from '@happyvertical/smrt-core';
6
- import { type ContractOptions, ContractStatus, ContractType, type LicenseSaleOptions } from '../types/index.js';
6
+ import { type ContractOptions, ContractStatus, ContractType, type LicenseSaleOptions, type PurchaseOrderOptions } from '../types/index.js';
7
7
  /**
8
8
  * Contract is the base class for all commercial agreements.
9
9
  *
@@ -208,6 +208,12 @@ export declare class Agreement extends Contract {
208
208
  */
209
209
  export declare class PurchaseOrder extends Contract {
210
210
  contractType: ContractType;
211
+ /** Expected delivery calendar date (YYYY-MM-DD), or empty when unspecified. */
212
+ expectedDate: Meta<string>;
213
+ /** Delivery address/instructions snapshot, independent of the vendor address. */
214
+ shipTo: Meta<string>;
215
+ /** Construct a purchase order with its optional delivery header. */
216
+ constructor(options?: PurchaseOrderOptions);
211
217
  }
212
218
  /**
213
219
  * WholesaleOrder - B2B order placed by a wholesale customer.
@@ -1 +1 @@
1
- {"version":3,"file":"Contract.d.ts","sourceRoot":"","sources":["../../src/models/Contract.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGL,KAAK,IAAI,EACT,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,KAAK,eAAe,EACpB,cAAc,EACd,YAAY,EACZ,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AA2C3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAOa,QAAS,SAAQ,UAAU;IACtC;;;OAGG;IAEH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;OAEG;IAKH,YAAY,EAAE,YAAY,CAAsB;IAEhD;;OAEG;IAKH,MAAM,EAAE,cAAc,CAAwB;IAE9C;;OAEG;IAIH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEjC;;OAEG;IAIH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;;;;;;OAOG;IAEH,QAAQ,EAAE,MAAM,CAAK;IAErB;;OAEG;IAEH,SAAS,EAAE,MAAM,CAAK;IAEtB;;OAEG;IAEH,WAAW,EAAE,MAAM,CAAK;IAExB;;OAEG;IAKH,QAAQ,EAAE,MAAM,CAAS;IAEzB;;OAEG;IAEH,SAAS,EAAE,IAAI,CAAc;IAE7B;;OAEG;IAEH,OAAO,EAAE,IAAI,GAAG,IAAI,CAAQ;IAE5B;;OAEG;IA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H,MAAM,IAAI,IAAI;IASd;;OAEG;IACH,QAAQ,IAAI,IAAI;IAQhB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC;IAmG1E;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAiB7C;;;;;;;;;;;;;;;;;;;OAmBG;IACG,iBAAiB,IAAI,OAAO,CAAC,sBAAsB,CAAC;CAsC3D;AAED,eAAe,OAAO,CAAC"}
@@ -277,6 +277,8 @@ export declare class Payment extends SmrtObject {
277
277
  * ```
278
278
  */
279
279
  recordPayment(options: RecordPaymentOptions): Promise<Journal>;
280
+ /** Post and complete only inside recordPayment's claimed transaction. */
281
+ private postPaymentInTransaction;
280
282
  /**
281
283
  * Get the linked journal entry (if recorded)
282
284
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Payment.d.ts","sourceRoot":"","sources":["../../src/models/Payment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIL,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,EACL,aAAa,EACb,KAAK,cAAc,EACnB,aAAa,EACb,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAC;AA6C3B;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBA8Ca,OAAQ,SAAQ,UAAU;IACrC;;;OAGG;IAEH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;OAEG;IAGH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEjC;;OAEG;IAGH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEjC;;;;;;;OAOG;IAEH,MAAM,EAAE,MAAM,CAAK;IAEnB;;OAEG;IAKH,QAAQ,EAAE,MAAM,CAAS;IAEzB;;OAEG;IAIH,MAAM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,IAAI;IAOjC;;OAEG;IACH,MAAM,IAAI,IAAI;CAMf;AAED,eAAe,OAAO,CAAC"}
@@ -12,10 +12,10 @@ import type { PaymentAllocationOptions } from '../types/index.js';
12
12
  * - Split payments (one payment split across multiple invoices)
13
13
  * - Payment history per invoice
14
14
  *
15
- * **Note**: This model does not automatically validate that allocations
16
- * don't exceed the payment amount or invoice amount due. Use
17
- * `PaymentAllocationCollection.getUnallocatedFromPayment()` before creating
18
- * allocations to ensure sufficient funds are available.
15
+ * Saves atomically enforce parent existence, matching tenant/customer/currency,
16
+ * positive safe-integer amounts and both balance caps. Use
17
+ * `PaymentAllocationCollection.allocatePayment()` for atomic splits and replay.
18
+ * Direct saves retain caller-owned invoice status refresh.
19
19
  *
20
20
  * @example
21
21
  * ```typescript
@@ -38,7 +38,8 @@ import type { PaymentAllocationOptions } from '../types/index.js';
38
38
  * allocatedBy: 'user-uuid'
39
39
  * });
40
40
  *
41
- * // Update invoice payment status
41
+ * // Reload the revision advanced by the allocation, then update status.
42
+ * await invoice.loadFromId();
42
43
  * const totalAllocated = await allocations.getTotalAllocatedToInvoice(invoice.id);
43
44
  * invoice.updatePaymentStatus(totalAllocated);
44
45
  * await invoice.save();
@@ -83,34 +84,7 @@ export declare class PaymentAllocation extends SmrtObject {
83
84
  */
84
85
  notes: string;
85
86
  constructor(options?: PaymentAllocationOptions);
86
- /**
87
- * Save-time integrity guard (S5 audit #1390 + follow-up):
88
- * - allocation `amount` must be a finite, positive number,
89
- * - the sum of all allocations against the referenced Payment (this row
90
- * included) must not exceed the Payment's amount — over-applying a
91
- * payment across invoices would falsify both payment and invoice
92
- * balances, and
93
- * - the sum of all allocations against the referenced Invoice (this row
94
- * included) must not exceed the Invoice's `totalAmount`.
95
- *
96
- * The Payment-amount cap is enforced against the persisted Payment row. An
97
- * allocation always carries a `@foreignKey('Payment')` paymentId, so a
98
- * `paymentId` that doesn't resolve to a real Payment is a **hard error** (S5
99
- * audit #1390 round 2): previously a missing Payment silently skipped the cap
100
- * entirely, letting a caller over-apply (or fabricate) funds simply by
101
- * pointing at a non-existent payment. An empty `paymentId` is still rejected
102
- * by the underlying FK requirement; the positivity check always applies.
103
- *
104
- * The Invoice-total cap (follow-up) closes a complementary hole: the
105
- * per-Payment cap lets allocations from *different* payments each pass their
106
- * own check while jointly summing above the invoice total. The next
107
- * `Invoice.save()` would then recompute `amountPaid` from these allocations,
108
- * trip `assertNonNegativeAmounts` (amountPaid > totalAmount), and leave the
109
- * invoice permanently unsaveable while the over-allocations persist. Capping
110
- * here keeps allocations from ever exceeding what the invoice owes. The cap
111
- * is skipped only when the invoice row can't be resolved (e.g. ledger-less /
112
- * not-yet-persisted) so it never blocks an otherwise-valid allocation.
113
- */
87
+ /** Save and validate against both claimed parent rows in one transaction. */
114
88
  save(): Promise<this>;
115
89
  }
116
90
  export default PaymentAllocation;
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentAllocation.d.ts","sourceRoot":"","sources":["../../src/models/PaymentAllocation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAqB,UAAU,EAAQ,MAAM,0BAA0B,CAAC;AAG/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAYlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBAoBa,iBAAkB,SAAQ,UAAU;IAC/C;;;OAGG;IAEH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;OAEG;IAGH,SAAS,EAAE,MAAM,CAAM;IAEvB;;OAEG;IAGH,SAAS,EAAE,MAAM,CAAM;IAEvB;;;;;;;;;OASG;IAEH,MAAM,EAAE,MAAM,CAAK;IAEnB;;OAEG;IAEH,WAAW,EAAE,IAAI,CAAc;IAE/B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAM;IAEzB;;OAEG;IAEH,KAAK,EAAE,MAAM,CAAM;gBAEP,OAAO,GAAE,wBAA6B;IAalD;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACY,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAqFrC;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"PaymentAllocation.d.ts","sourceRoot":"","sources":["../../src/models/PaymentAllocation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAqB,UAAU,EAAQ,MAAM,0BAA0B,CAAC;AAI/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAYlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBAoBa,iBAAkB,SAAQ,UAAU;IAC/C;;;OAGG;IAEH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;OAEG;IAGH,SAAS,EAAE,MAAM,CAAM;IAEvB;;OAEG;IAGH,SAAS,EAAE,MAAM,CAAM;IAEvB;;;;;;;;;OASG;IAEH,MAAM,EAAE,MAAM,CAAK;IAEnB;;OAEG;IAEH,WAAW,EAAE,IAAI,CAAc;IAE/B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAM;IAEzB;;OAEG;IAEH,KAAK,EAAE,MAAM,CAAM;gBAEP,OAAO,GAAE,wBAA6B;IAalD,6EAA6E;IAC9D,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAgFrC;AAED,eAAe,iBAAiB,CAAC"}
@@ -108,6 +108,29 @@ var playground_default = {
108
108
  description: COMMERCE_MODULE_META.description,
109
109
  moduleMeta: COMMERCE_MODULE_META,
110
110
  entries: [
111
+ {
112
+ id: "purchase-order-header-form",
113
+ title: "Purchase order header",
114
+ description: "Retained delivery header with caller-owned validation and native transport.",
115
+ loadComponent: () => import("./svelte/components/PurchaseOrderHeaderForm.svelte"),
116
+ order: 32,
117
+ props: {
118
+ action: "#",
119
+ readonly: true,
120
+ vendors: [{
121
+ value: "vendor-1",
122
+ label: "North Studio"
123
+ }],
124
+ values: {
125
+ vendorId: "vendor-1",
126
+ reference: "PO-104",
127
+ expectedDate: "2026-11-02",
128
+ shipTo: "Receiving dock",
129
+ notes: "Call before delivery"
130
+ }
131
+ },
132
+ modes: { mock: { label: "Header preview" } }
133
+ },
111
134
  {
112
135
  id: "purchase-order-editor",
113
136
  title: "Purchase and award preparation",
@@ -1 +1 @@
1
- {"version":3,"file":"playground.js","names":[],"sources":["../src/svelte/playground.ts"],"sourcesContent":["import { COMMERCE_MODULE_META } from '../ui.js';\n\nconst noop = () => {};\n\nconst sampleInvoice = {\n id: 'invoice-2026-0142',\n invoiceNumber: 'INV-2026-0142',\n status: 'sent',\n issueDate: '2026-03-15T00:00:00.000Z',\n dueDate: '2026-03-29T00:00:00.000Z',\n totalAmount: 128450,\n customerName: 'Riverstone Newsroom',\n projectName: 'Editorial Systems Retainer',\n};\n\nconst sampleUnbilledItems = [\n {\n id: 'unbilled-time-1',\n type: 'time',\n description: 'Governance workflow setup',\n date: '2026-03-12T00:00:00.000Z',\n amount: 42000,\n category: 'Implementation',\n selected: true,\n },\n {\n id: 'unbilled-expense-1',\n type: 'expense',\n description: 'Contributor QA workshop',\n date: '2026-03-14T00:00:00.000Z',\n amount: 18500,\n category: 'Training',\n },\n {\n id: 'unbilled-time-2',\n type: 'time',\n description: 'Release validation and docs cleanup',\n date: '2026-03-18T00:00:00.000Z',\n amount: 33950,\n category: 'QA',\n },\n];\n\nconst sampleCustomer = {\n id: 'customer-riverstone',\n profileId: 'profile-riverstone',\n profile: {\n id: 'profile-riverstone',\n name: 'Riverstone Newsroom',\n email: 'accounts@riverstone.example',\n description: 'Independent newsroom and publishing customer.',\n identityKind: 'business',\n },\n status: 'active',\n customerType: 'wholesale',\n creditLimitMinor: 250000,\n paymentTerms: 'Net 30',\n taxExempt: false,\n defaultShippingAddress: {\n street1: '88 River Avenue',\n city: 'Edmonton',\n state: 'AB',\n postalCode: 'T5J 0K1',\n country: 'Canada',\n },\n contacts: [\n {\n id: 'contact-avery',\n name: 'Avery Chen',\n label: 'Accounts payable',\n email: 'avery@riverstone.example',\n phone: '+1 780 555 0142',\n },\n ],\n};\n\nconst sampleVendor = {\n id: 'vendor-northstar',\n profileId: 'profile-northstar',\n profile: {\n id: 'profile-northstar',\n name: 'Northstar Supply',\n email: 'orders@northstar.example',\n description: 'Regional materials and equipment supplier.',\n identityKind: 'business',\n },\n status: 'active',\n leadTimeDays: 7,\n minimumOrderMinor: 50000,\n paymentTerms: 'Net 45',\n currency: 'CAD',\n defaultContactEmail: 'orders@northstar.example',\n defaultContactPhone: '+1 403 555 0188',\n contacts: [\n {\n id: 'contact-morgan',\n name: 'Morgan Lee',\n label: 'Order desk',\n email: 'morgan@northstar.example',\n phone: '+1 403 555 0117',\n },\n ],\n};\n\nconst loadCustomerDirectory = () =>\n import('./components/CustomerDirectory.svelte');\nconst loadCustomerDetail = () => import('./components/CustomerDetail.svelte');\nconst loadPartySelectPreview = () =>\n import('./playground/PartySelectPreview.svelte');\nconst loadPartyFormPreview = () =>\n import('./playground/PartyFormPreview.svelte');\nconst loadInvoiceActions = () => import('./components/InvoiceActions.svelte');\nconst loadInvoiceCard = () => import('./components/InvoiceCard.svelte');\nconst loadUnbilledItems = () => import('./components/UnbilledItems.svelte');\nconst loadVendorDirectory = () => import('./components/VendorDirectory.svelte');\nconst loadVendorDetail = () => import('./components/VendorDetail.svelte');\n\nexport default {\n packageName: '@happyvertical/smrt-commerce',\n displayName: COMMERCE_MODULE_META.displayName,\n description: COMMERCE_MODULE_META.description,\n moduleMeta: COMMERCE_MODULE_META,\n entries: [\n {\n id: 'purchase-order-editor',\n title: 'Purchase and award preparation',\n description:\n 'Native allocation entry, review and retained uncertain-response recovery.',\n loadComponent: () => import('./components/PurchasingPlayground.svelte'),\n order: 30,\n props: { reduction: false },\n modes: { mock: { label: 'Interactive demo' } },\n },\n {\n id: 'purchase-reduction',\n title: 'Explicit allocation reduction',\n description:\n 'Every retained allocation remains present; zero is explicit, never inferred from blank.',\n loadComponent: () => import('./components/PurchasingPlayground.svelte'),\n order: 31,\n props: { reduction: true },\n modes: { mock: { label: 'Interactive demo' } },\n },\n\n {\n id: 'quote-editor',\n title: 'Vendor quotation editor',\n description:\n 'Edit, add/remove rows and recover a simulated rejected native submission.',\n loadComponent: () => import('./components/QuotePlayground.svelte'),\n order: 20,\n props: { kind: 'vendor-quotation' },\n modes: { mock: { label: 'Interactive demo' } },\n },\n {\n id: 'customer-estimate-editor',\n title: 'Customer estimate editor',\n description:\n 'Customer estimate draft and retained revision comparison, without acceptance or budget writes.',\n loadComponent: () => import('./components/QuotePlayground.svelte'),\n order: 21,\n props: { kind: 'customer-estimate' },\n modes: { mock: { label: 'Interactive demo' } },\n },\n\n {\n id: 'pricing-version-decision',\n title: 'Pricing version decisions',\n description:\n 'Compare retained estimates and rehearse a rejected decision without losing input.',\n loadComponent: () => import('./playground/PricingVersionPreview.svelte'),\n order: 30,\n props: {},\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'customer-directory',\n title: 'Customer Directory',\n description:\n 'Search, paging, responsive cards, and consumer-owned links.',\n loadComponent: loadCustomerDirectory,\n order: 1,\n props: {\n items: [{ data: sampleCustomer, href: '#customer-detail' }],\n total: 26,\n page: 1,\n pageSize: 25,\n nextHref: '#customer-page-2',\n addHref: '#add-customer',\n canCreate: true,\n },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'customer-detail',\n title: 'Customer Detail',\n description:\n 'Profile identity, commercial terms, addresses, and contacts.',\n loadComponent: loadCustomerDetail,\n order: 2,\n props: {\n customer: sampleCustomer,\n currency: 'CAD',\n backHref: '#customers',\n editHref: '#edit-customer',\n canEdit: true,\n },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'customer-form',\n title: 'Customer Form',\n description:\n 'Native create/edit submission with retained values and contacts.',\n loadComponent: loadPartyFormPreview,\n order: 3,\n props: { kind: 'customer' },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'vendor-directory',\n title: 'Vendor Directory',\n description:\n 'Search, paging, empty/error states, and consumer-owned links.',\n loadComponent: loadVendorDirectory,\n order: 4,\n props: {\n items: [{ data: sampleVendor, href: '#vendor-detail' }],\n total: 1,\n addHref: '#add-vendor',\n canCreate: true,\n },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'vendor-detail',\n title: 'Vendor Detail',\n description:\n 'Profile identity, purchasing terms, and contact composition.',\n loadComponent: loadVendorDetail,\n order: 5,\n props: {\n vendor: sampleVendor,\n backHref: '#vendors',\n editHref: '#edit-vendor',\n canEdit: true,\n },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'vendor-form',\n title: 'Vendor Form',\n description:\n 'Native create/edit submission with retained currency text and contacts.',\n loadComponent: loadPartyFormPreview,\n order: 6,\n props: { kind: 'vendor' },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'customer-select',\n title: 'Customer Select',\n description:\n 'Searchable customer picker with status and type, resolving the current value and offering a new-customer action.',\n loadComponent: loadPartySelectPreview,\n order: 10,\n props: { kind: 'customer' },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'vendor-select',\n title: 'Vendor Select',\n description:\n 'Searchable vendor picker with status; the caller supplies the lookup.',\n loadComponent: loadPartySelectPreview,\n order: 11,\n props: { kind: 'vendor' },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'invoice-preparation',\n title: 'Invoice Preparation',\n description:\n 'Edit invoice lines, prices, discounts and tax, with optional source allocations and retained rejection recovery.',\n loadComponent: () =>\n import('./playground/InvoicePreparationPreview.svelte'),\n order: 7,\n props: {},\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'invoice-card',\n title: 'Invoice Card',\n description:\n 'Compact invoice summary card used in billing and receivables views.',\n loadComponent: loadInvoiceCard,\n order: 20,\n props: {\n invoice: sampleInvoice,\n currency: 'CAD',\n onclick: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'invoice-actions',\n title: 'Invoice Actions',\n description:\n 'Status-aware billing actions for sending, printing, exporting, and payment confirmation.',\n loadComponent: loadInvoiceActions,\n order: 21,\n props: {\n status: 'sent',\n onmarkpaid: noop,\n onprint: noop,\n onexport: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'unbilled-items',\n title: 'Unbilled Items',\n description:\n 'Selectable unbilled work list for creating a new invoice from accumulated items.',\n loadComponent: loadUnbilledItems,\n order: 22,\n props: {\n items: sampleUnbilledItems,\n currency: 'CAD',\n onselectionchange: noop,\n oncreate: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n ],\n};\n"],"mappings":";;AAEA,IAAM,aAAa,CAAC;AAEpB,IAAM,gBAAgB;CACpB,IAAI;CACJ,eAAe;CACf,QAAQ;CACR,WAAW;CACX,SAAS;CACT,aAAa;CACb,cAAc;CACd,aAAa;AACf;AAEA,IAAM,sBAAsB;CAC1B;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,MAAM;EACN,QAAQ;EACR,UAAU;EACV,UAAU;CACZ;CACA;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,MAAM;EACN,QAAQ;EACR,UAAU;CACZ;CACA;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,MAAM;EACN,QAAQ;EACR,UAAU;CACZ;AACF;AAEA,IAAM,iBAAiB;CACrB,IAAI;CACJ,WAAW;CACX,SAAS;EACP,IAAI;EACJ,MAAM;EACN,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA,QAAQ;CACR,cAAc;CACd,kBAAkB;CAClB,cAAc;CACd,WAAW;CACX,wBAAwB;EACtB,SAAS;EACT,MAAM;EACN,OAAO;EACP,YAAY;EACZ,SAAS;CACX;CACA,UAAU,CACR;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,OAAO;EACP,OAAO;CACT,CACF;AACF;AAEA,IAAM,eAAe;CACnB,IAAI;CACJ,WAAW;CACX,SAAS;EACP,IAAI;EACJ,MAAM;EACN,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA,QAAQ;C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,EAAE,MAAM,EAAE,OAAO,OAAO,EAAE;EACnC;EACA;GACE,IAAI;GACJ,OAAO;GACP,aACE;GACF,eAAe;GACf,OAAO;GACP,OAAO,EAAE,MAAM,SAAS;GACxB,OAAO,EAAE,MAAM,EAAE,OAAO,OAAO,EAAE;EACnC;EACA;GACE,IAAI;GACJ,OAAO;GACP,aACE;GACF,qBACE,OAAO;GACT,OAAO;GACP,OAAO,CAAC;GACR,OAAO,EAAE,MAAM,EAAE,OAAO,OAAO,EAAE;EACnC;EACA;GACE,IAAI;GACJ,OAAO;GACP,aACE;GACF,eAAe;GACf,OAAO;GACP,OAAO;IACL,SAAS;IACT,UAAU;IACV,SAAS;GACX;GACA,OAAO,EACL,MAAM,EACJ,OAAO,OACT,EACF;EACF;EACA;GACE,IAAI;GACJ,OAAO;GACP,aACE;GACF,eAAe;GACf,OAAO;GACP,OAAO;IACL,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,UAAU;GACZ;GACA,OAAO,EACL,MAAM,EACJ,OAAO,OACT,EACF;EACF;EACA;GACE,IAAI;GACJ,OAAO;GACP,aACE;GACF,eAAe;GACf,OAAO;GACP,OAAO;IACL,OAAO;IACP,UAAU;IACV,mBAAmB;IACnB,UAAU;GACZ;GACA,OAAO,EACL,MAAM,EACJ,OAAO,OACT,EACF;EACF;CACF;AACF"}
1
+ {"version":3,"file":"playground.js","names":[],"sources":["../src/svelte/playground.ts"],"sourcesContent":["import { COMMERCE_MODULE_META } from '../ui.js';\n\nconst noop = () => {};\n\nconst sampleInvoice = {\n id: 'invoice-2026-0142',\n invoiceNumber: 'INV-2026-0142',\n status: 'sent',\n issueDate: '2026-03-15T00:00:00.000Z',\n dueDate: '2026-03-29T00:00:00.000Z',\n totalAmount: 128450,\n customerName: 'Riverstone Newsroom',\n projectName: 'Editorial Systems Retainer',\n};\n\nconst sampleUnbilledItems = [\n {\n id: 'unbilled-time-1',\n type: 'time',\n description: 'Governance workflow setup',\n date: '2026-03-12T00:00:00.000Z',\n amount: 42000,\n category: 'Implementation',\n selected: true,\n },\n {\n id: 'unbilled-expense-1',\n type: 'expense',\n description: 'Contributor QA workshop',\n date: '2026-03-14T00:00:00.000Z',\n amount: 18500,\n category: 'Training',\n },\n {\n id: 'unbilled-time-2',\n type: 'time',\n description: 'Release validation and docs cleanup',\n date: '2026-03-18T00:00:00.000Z',\n amount: 33950,\n category: 'QA',\n },\n];\n\nconst sampleCustomer = {\n id: 'customer-riverstone',\n profileId: 'profile-riverstone',\n profile: {\n id: 'profile-riverstone',\n name: 'Riverstone Newsroom',\n email: 'accounts@riverstone.example',\n description: 'Independent newsroom and publishing customer.',\n identityKind: 'business',\n },\n status: 'active',\n customerType: 'wholesale',\n creditLimitMinor: 250000,\n paymentTerms: 'Net 30',\n taxExempt: false,\n defaultShippingAddress: {\n street1: '88 River Avenue',\n city: 'Edmonton',\n state: 'AB',\n postalCode: 'T5J 0K1',\n country: 'Canada',\n },\n contacts: [\n {\n id: 'contact-avery',\n name: 'Avery Chen',\n label: 'Accounts payable',\n email: 'avery@riverstone.example',\n phone: '+1 780 555 0142',\n },\n ],\n};\n\nconst sampleVendor = {\n id: 'vendor-northstar',\n profileId: 'profile-northstar',\n profile: {\n id: 'profile-northstar',\n name: 'Northstar Supply',\n email: 'orders@northstar.example',\n description: 'Regional materials and equipment supplier.',\n identityKind: 'business',\n },\n status: 'active',\n leadTimeDays: 7,\n minimumOrderMinor: 50000,\n paymentTerms: 'Net 45',\n currency: 'CAD',\n defaultContactEmail: 'orders@northstar.example',\n defaultContactPhone: '+1 403 555 0188',\n contacts: [\n {\n id: 'contact-morgan',\n name: 'Morgan Lee',\n label: 'Order desk',\n email: 'morgan@northstar.example',\n phone: '+1 403 555 0117',\n },\n ],\n};\n\nconst loadCustomerDirectory = () =>\n import('./components/CustomerDirectory.svelte');\nconst loadCustomerDetail = () => import('./components/CustomerDetail.svelte');\nconst loadPartySelectPreview = () =>\n import('./playground/PartySelectPreview.svelte');\nconst loadPartyFormPreview = () =>\n import('./playground/PartyFormPreview.svelte');\nconst loadInvoiceActions = () => import('./components/InvoiceActions.svelte');\nconst loadInvoiceCard = () => import('./components/InvoiceCard.svelte');\nconst loadUnbilledItems = () => import('./components/UnbilledItems.svelte');\nconst loadVendorDirectory = () => import('./components/VendorDirectory.svelte');\nconst loadVendorDetail = () => import('./components/VendorDetail.svelte');\n\nexport default {\n packageName: '@happyvertical/smrt-commerce',\n displayName: COMMERCE_MODULE_META.displayName,\n description: COMMERCE_MODULE_META.description,\n moduleMeta: COMMERCE_MODULE_META,\n entries: [\n {\n id: 'purchase-order-header-form',\n title: 'Purchase order header',\n description:\n 'Retained delivery header with caller-owned validation and native transport.',\n loadComponent: () =>\n import('./components/PurchaseOrderHeaderForm.svelte'),\n order: 32,\n props: {\n action: '#',\n readonly: true,\n vendors: [{ value: 'vendor-1', label: 'North Studio' }],\n values: {\n vendorId: 'vendor-1',\n reference: 'PO-104',\n expectedDate: '2026-11-02',\n shipTo: 'Receiving dock',\n notes: 'Call before delivery',\n },\n },\n modes: { mock: { label: 'Header preview' } },\n },\n {\n id: 'purchase-order-editor',\n title: 'Purchase and award preparation',\n description:\n 'Native allocation entry, review and retained uncertain-response recovery.',\n loadComponent: () => import('./components/PurchasingPlayground.svelte'),\n order: 30,\n props: { reduction: false },\n modes: { mock: { label: 'Interactive demo' } },\n },\n {\n id: 'purchase-reduction',\n title: 'Explicit allocation reduction',\n description:\n 'Every retained allocation remains present; zero is explicit, never inferred from blank.',\n loadComponent: () => import('./components/PurchasingPlayground.svelte'),\n order: 31,\n props: { reduction: true },\n modes: { mock: { label: 'Interactive demo' } },\n },\n\n {\n id: 'quote-editor',\n title: 'Vendor quotation editor',\n description:\n 'Edit, add/remove rows and recover a simulated rejected native submission.',\n loadComponent: () => import('./components/QuotePlayground.svelte'),\n order: 20,\n props: { kind: 'vendor-quotation' },\n modes: { mock: { label: 'Interactive demo' } },\n },\n {\n id: 'customer-estimate-editor',\n title: 'Customer estimate editor',\n description:\n 'Customer estimate draft and retained revision comparison, without acceptance or budget writes.',\n loadComponent: () => import('./components/QuotePlayground.svelte'),\n order: 21,\n props: { kind: 'customer-estimate' },\n modes: { mock: { label: 'Interactive demo' } },\n },\n\n {\n id: 'pricing-version-decision',\n title: 'Pricing version decisions',\n description:\n 'Compare retained estimates and rehearse a rejected decision without losing input.',\n loadComponent: () => import('./playground/PricingVersionPreview.svelte'),\n order: 30,\n props: {},\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'customer-directory',\n title: 'Customer Directory',\n description:\n 'Search, paging, responsive cards, and consumer-owned links.',\n loadComponent: loadCustomerDirectory,\n order: 1,\n props: {\n items: [{ data: sampleCustomer, href: '#customer-detail' }],\n total: 26,\n page: 1,\n pageSize: 25,\n nextHref: '#customer-page-2',\n addHref: '#add-customer',\n canCreate: true,\n },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'customer-detail',\n title: 'Customer Detail',\n description:\n 'Profile identity, commercial terms, addresses, and contacts.',\n loadComponent: loadCustomerDetail,\n order: 2,\n props: {\n customer: sampleCustomer,\n currency: 'CAD',\n backHref: '#customers',\n editHref: '#edit-customer',\n canEdit: true,\n },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'customer-form',\n title: 'Customer Form',\n description:\n 'Native create/edit submission with retained values and contacts.',\n loadComponent: loadPartyFormPreview,\n order: 3,\n props: { kind: 'customer' },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'vendor-directory',\n title: 'Vendor Directory',\n description:\n 'Search, paging, empty/error states, and consumer-owned links.',\n loadComponent: loadVendorDirectory,\n order: 4,\n props: {\n items: [{ data: sampleVendor, href: '#vendor-detail' }],\n total: 1,\n addHref: '#add-vendor',\n canCreate: true,\n },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'vendor-detail',\n title: 'Vendor Detail',\n description:\n 'Profile identity, purchasing terms, and contact composition.',\n loadComponent: loadVendorDetail,\n order: 5,\n props: {\n vendor: sampleVendor,\n backHref: '#vendors',\n editHref: '#edit-vendor',\n canEdit: true,\n },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'vendor-form',\n title: 'Vendor Form',\n description:\n 'Native create/edit submission with retained currency text and contacts.',\n loadComponent: loadPartyFormPreview,\n order: 6,\n props: { kind: 'vendor' },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'customer-select',\n title: 'Customer Select',\n description:\n 'Searchable customer picker with status and type, resolving the current value and offering a new-customer action.',\n loadComponent: loadPartySelectPreview,\n order: 10,\n props: { kind: 'customer' },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'vendor-select',\n title: 'Vendor Select',\n description:\n 'Searchable vendor picker with status; the caller supplies the lookup.',\n loadComponent: loadPartySelectPreview,\n order: 11,\n props: { kind: 'vendor' },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'invoice-preparation',\n title: 'Invoice Preparation',\n description:\n 'Edit invoice lines, prices, discounts and tax, with optional source allocations and retained rejection recovery.',\n loadComponent: () =>\n import('./playground/InvoicePreparationPreview.svelte'),\n order: 7,\n props: {},\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'invoice-card',\n title: 'Invoice Card',\n description:\n 'Compact invoice summary card used in billing and receivables views.',\n loadComponent: loadInvoiceCard,\n order: 20,\n props: {\n invoice: sampleInvoice,\n currency: 'CAD',\n onclick: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'invoice-actions',\n title: 'Invoice Actions',\n description:\n 'Status-aware billing actions for sending, printing, exporting, and payment confirmation.',\n loadComponent: loadInvoiceActions,\n order: 21,\n props: {\n status: 'sent',\n onmarkpaid: noop,\n onprint: noop,\n onexport: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'unbilled-items',\n title: 'Unbilled Items',\n description:\n 'Selectable unbilled work list for creating a new invoice from accumulated items.',\n loadComponent: loadUnbilledItems,\n order: 22,\n props: {\n items: sampleUnbilledItems,\n currency: 'CAD',\n onselectionchange: noop,\n oncreate: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n ],\n};\n"],"mappings":";;AAEA,IAAM,aAAa,CAAC;AAEpB,IAAM,gBAAgB;CACpB,IAAI;CACJ,eAAe;CACf,QAAQ;CACR,WAAW;CACX,SAAS;CACT,aAAa;CACb,cAAc;CACd,aAAa;AACf;AAEA,IAAM,sBAAsB;CAC1B;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,MAAM;EACN,QAAQ;EACR,UAAU;EACV,UAAU;CACZ;CACA;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,MAAM;EACN,QAAQ;EACR,UAAU;CACZ;CACA;EACE,IAAI;EACJ,MAAM;EACN,aAAa;EACb,MAAM;EACN,QAAQ;EACR,UAAU;CACZ;AACF;AAEA,IAAM,iBAAiB;CACrB,IAAI;CACJ,WAAW;CACX,SAAS;EACP,IAAI;EACJ,MAAM;EACN,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA,QAAQ;CACR,cAAc;CACd,kBAAkB;CAClB,cAAc;CACd,WAAW;CACX,wBAAwB;EACtB,SAAS;EACT,MAAM;EACN,OAAO;EACP,YAAY;EACZ,SAAS;CACX;CACA,UAAU,CACR;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,OAAO;EACP,OAAO;CACT,CACF;AACF;AAEA,IAAM,eAAe;CACnB,IAAI;CACJ,WAAW;CACX,SAAS;EACP,IAAI;EACJ,MAAM;EACN,OAAO;EACP,aAAa;EACb,cAAc;CAChB;CACA,QAAQ;CACR,cAAc;CACd,mBAAmB;CACnB,cAAc;CACd,UAAU;CACV,qBAAqB;CACrB,qBAAqB;CACrB,UAAU,CACR;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,OAAO;EACP,OAAO;CACT,CACF;AACF;AAEA,IAAM,8BACJ,OAAO;AACT,IAAM,2BAA2B,OAAO;AACxC,IAAM,+BACJ,OAAO;AACT,IAAM,6BACJ,OAAO;AACT,IAAM,2BAA2B,OAAO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