@repobit/dex-store-elements 1.4.1 → 1.4.3

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 (96) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +15 -4
  3. package/dist/src/actions/action.button.js +4 -11
  4. package/dist/src/actions/action.button.js.map +1 -1
  5. package/dist/src/actions/action.input.js +28 -22
  6. package/dist/src/actions/action.input.js.map +1 -1
  7. package/dist/src/actions/action.select.js +10 -8
  8. package/dist/src/actions/action.select.js.map +1 -1
  9. package/dist/src/actions/index.d.ts +1 -1
  10. package/dist/src/actions/index.js +45 -44
  11. package/dist/src/actions/index.js.map +1 -1
  12. package/dist/src/actions/utilty.d.ts +1 -0
  13. package/dist/src/actions/utilty.js +59 -29
  14. package/dist/src/actions/utilty.js.map +1 -1
  15. package/dist/src/contexts/context.datalayer.js.map +1 -1
  16. package/dist/src/contexts/context.derived.js.map +1 -1
  17. package/dist/src/contexts/context.option.js.map +1 -1
  18. package/dist/src/contexts/context.product.js.map +1 -1
  19. package/dist/src/contexts/context.state.js.map +1 -1
  20. package/dist/src/contexts/context.store.js.map +1 -1
  21. package/dist/src/controllers/collect-controller.d.ts +39 -0
  22. package/dist/src/controllers/collect-controller.js +161 -0
  23. package/dist/src/controllers/collect-controller.js.map +1 -0
  24. package/dist/src/controllers/compute-controller.d.ts +55 -0
  25. package/dist/src/controllers/compute-controller.js +350 -0
  26. package/dist/src/controllers/compute-controller.js.map +1 -0
  27. package/dist/src/controllers/eta-renderer/eta-dom-renderer.d.ts +21 -0
  28. package/dist/src/controllers/eta-renderer/eta-dom-renderer.js +152 -0
  29. package/dist/src/controllers/eta-renderer/eta-dom-renderer.js.map +1 -0
  30. package/dist/src/controllers/eta-renderer/eta-mutation-observer.d.ts +28 -0
  31. package/dist/src/controllers/eta-renderer/eta-mutation-observer.js +206 -0
  32. package/dist/src/controllers/eta-renderer/eta-mutation-observer.js.map +1 -0
  33. package/dist/src/controllers/eta-renderer/eta-renderer.d.ts +21 -0
  34. package/dist/src/controllers/eta-renderer/eta-renderer.js +77 -0
  35. package/dist/src/controllers/eta-renderer/eta-renderer.js.map +1 -0
  36. package/dist/src/controllers/eta-renderer/eta-template-cache.d.ts +21 -0
  37. package/dist/src/controllers/eta-renderer/eta-template-cache.js +52 -0
  38. package/dist/src/controllers/eta-renderer/eta-template-cache.js.map +1 -0
  39. package/dist/src/controllers/eta-renderer/eta-types.d.ts +11 -0
  40. package/dist/src/controllers/eta-renderer/eta-types.js +1 -0
  41. package/dist/src/controllers/eta-renderer/eta-types.js.map +1 -0
  42. package/dist/src/controllers/eta-renderer/index.d.ts +2 -0
  43. package/dist/src/controllers/eta-renderer/index.js +2 -0
  44. package/dist/src/controllers/eta-renderer/index.js.map +1 -0
  45. package/dist/src/controllers/event-pipeline-controller.d.ts +28 -0
  46. package/dist/src/controllers/event-pipeline-controller.js +72 -0
  47. package/dist/src/controllers/event-pipeline-controller.js.map +1 -0
  48. package/dist/src/dsl/compilers/array/compiler.js.map +1 -1
  49. package/dist/src/dsl/compilers/boolean/compiler.js.map +1 -1
  50. package/dist/src/dsl/compilers/enum/compiler.js.map +1 -1
  51. package/dist/src/dsl/compilers/index.js.map +1 -1
  52. package/dist/src/dsl/utilty.js.map +1 -1
  53. package/dist/src/events/events.js.map +1 -1
  54. package/dist/src/index.js.map +1 -1
  55. package/dist/src/nodes/node.context.js.map +1 -1
  56. package/dist/src/nodes/node.option.d.ts +4 -2
  57. package/dist/src/nodes/node.option.js +56 -56
  58. package/dist/src/nodes/node.option.js.map +1 -1
  59. package/dist/src/nodes/node.product.d.ts +4 -3
  60. package/dist/src/nodes/node.product.js +16 -28
  61. package/dist/src/nodes/node.product.js.map +1 -1
  62. package/dist/src/nodes/node.root.js.map +1 -1
  63. package/dist/src/nodes/node.state.d.ts +18 -70
  64. package/dist/src/nodes/node.state.js +42 -857
  65. package/dist/src/nodes/node.state.js.map +1 -1
  66. package/dist/src/renders/attributes/buyLink.js +12 -8
  67. package/dist/src/renders/attributes/buyLink.js.map +1 -1
  68. package/dist/src/renders/attributes/devices.js +10 -10
  69. package/dist/src/renders/attributes/devices.js.map +1 -1
  70. package/dist/src/renders/attributes/discount.js +60 -81
  71. package/dist/src/renders/attributes/discount.js.map +1 -1
  72. package/dist/src/renders/attributes/hide.js +21 -26
  73. package/dist/src/renders/attributes/hide.js.map +1 -1
  74. package/dist/src/renders/attributes/index.js.map +1 -1
  75. package/dist/src/renders/attributes/price.js +60 -81
  76. package/dist/src/renders/attributes/price.js.map +1 -1
  77. package/dist/src/renders/attributes/subscription.js +11 -11
  78. package/dist/src/renders/attributes/subscription.js.map +1 -1
  79. package/dist/src/renders/attributes/trialLink.js +5 -4
  80. package/dist/src/renders/attributes/trialLink.js.map +1 -1
  81. package/dist/src/renders/attributes/utilty.d.ts +2 -0
  82. package/dist/src/renders/attributes/utilty.js +3 -0
  83. package/dist/src/renders/attributes/utilty.js.map +1 -0
  84. package/dist/src/renders/context.js.map +1 -1
  85. package/dist/src/renders/format.js.map +1 -1
  86. package/dist/src/renders/index.d.ts +1 -1
  87. package/dist/src/renders/index.js +46 -45
  88. package/dist/src/renders/index.js.map +1 -1
  89. package/dist/src/renders/observe.js.map +1 -1
  90. package/dist/src/renders/utility.js +46 -38
  91. package/dist/src/renders/utility.js.map +1 -1
  92. package/dist/src/templating/eta.js.map +1 -1
  93. package/package.json +2 -2
  94. package/dist/src/contexts/context.event.d.ts +0 -5
  95. package/dist/src/contexts/context.event.js +0 -3
  96. package/dist/src/contexts/context.event.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eta-template-cache.js","sourceRoot":"","sources":["../../../../src/controllers/eta-renderer/eta-template-cache.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,gBAAgB;IAA7B;QACU,sBAAiB,GAAG,IAAI,OAAO,EAA8B,CAAC;QAC9D,mBAAc,GAAG,IAAI,OAAO,EAA2C,CAAC;IAwDlF,CAAC;IArDC,eA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KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAE5E,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,KAAK,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;YAC5B,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;YACtC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,KAAK,CAAC,GAAG,KAAK,UAAU,EAAE,CAAC;YAC7B,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACjD,oFAAoF;YACpF,uDAAuD;YACvD,IAAI,cAAc,IAAI,CAAC,oBAAoB,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC7D,KAAK,CAAC,GAAG,GAAG,UAAU,CAAC;gBACvB,OAAO,KAAK,CAAC,EAAE,CAAC;YAClB,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["import eta from \"@/templating/eta\";\n\ntype TemplateEntry = { src: string; fn?: ReturnType<typeof eta.compile> };\n\ntype UpdateOptions = {\n allowMutationRefresh: boolean;\n};\n\nexport class EtaTemplateCache {\n private _elementTemplates = new WeakMap<HTMLElement, TemplateEntry>();\n private _attrTemplates = new WeakMap<HTMLElement, Map<string, TemplateEntry>>();\n private _noEtaAttrs?: WeakSet<HTMLElement>;\n\n getElementEntry(el: HTMLElement): TemplateEntry | undefined {\n return this._elementTemplates.get(el);\n }\n\n hasTemplate(el: HTMLElement): boolean {\n const entry = this._elementTemplates.get(el);\n return Boolean(entry && entry.src && entry.src.includes(\"{{\"));\n }\n\n getOrCreateAttrCache(el: HTMLElement): Map<string, TemplateEntry> {\n let cache = this._attrTemplates.get(el);\n if (!cache) {\n cache = new Map();\n this._attrTemplates.set(el, cache);\n }\n return cache;\n }\n\n hasNoEtaAttrs(el: HTMLElement): boolean {\n return this._noEtaAttrs?.has(el) ?? false;\n }\n\n markNoEtaAttrs(el: HTMLElement) {\n if (!this._noEtaAttrs) this._noEtaAttrs = new WeakSet<HTMLElement>();\n this._noEtaAttrs.add(el);\n }\n\n clearNoEtaAttrs(el: HTMLElement) {\n this._noEtaAttrs?.delete(el);\n }\n\n updateElementEntry(el: HTMLElement, currentSrc: string, { allowMutationRefresh }: UpdateOptions): TemplateEntry {\n let entry = this._elementTemplates.get(el);\n const hadTemplate = Boolean(entry && entry.src && entry.src.includes(\"{{\"));\n\n if (!entry) {\n entry = { src: currentSrc };\n this._elementTemplates.set(el, entry);\n return entry;\n }\n\n if (entry.src !== currentSrc) {\n const isTemplateLike = currentSrc.includes(\"{{\");\n // Accept SPA-authored changes (even without templates) only when mutation-triggered\n // and the element did not previously cache a template.\n if (isTemplateLike || (allowMutationRefresh && !hadTemplate)) {\n entry.src = currentSrc;\n delete entry.fn;\n }\n }\n\n return entry;\n }\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import { ReactiveControllerHost } from "lit";
2
+ export type EtaRenderHost = ReactiveControllerHost & HTMLElement & {
3
+ etaMutationDelay: number;
4
+ etaMutationDelayMax: number;
5
+ shouldRunEtaStateRender(): boolean;
6
+ shouldObserveEtaMutations(): boolean;
7
+ getEtaArgs(): unknown[];
8
+ buildEtaContext(): Promise<object | undefined>;
9
+ isStateNodeElement(el: Element): boolean;
10
+ };
11
+ export type ObserveShadowRoot = (shadowRoot: ShadowRoot, host?: HTMLElement) => void;
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=eta-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eta-types.js","sourceRoot":"","sources":["../../../../src/controllers/eta-renderer/eta-types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactiveControllerHost } from \"lit\";\n\nexport type EtaRenderHost = ReactiveControllerHost & HTMLElement & {\n etaMutationDelay : number;\n etaMutationDelayMax: number;\n shouldRunEtaStateRender(): boolean;\n shouldObserveEtaMutations(): boolean;\n getEtaArgs(): unknown[];\n buildEtaContext(): Promise<object | undefined>;\n isStateNodeElement(el: Element): boolean;\n};\n\nexport type ObserveShadowRoot = (shadowRoot: ShadowRoot, host?: HTMLElement) => void;\n"]}
@@ -0,0 +1,2 @@
1
+ export { EtaRenderController } from "./eta-renderer.js";
2
+ export type { EtaRenderHost, ObserveShadowRoot } from "./eta-types.js";
@@ -0,0 +1,2 @@
1
+ export { EtaRenderController } from "./eta-renderer.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controllers/eta-renderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { EtaRenderController } from \"./eta-renderer\";\nexport type { EtaRenderHost, ObserveShadowRoot } from \"./eta-types\";\n\n"]}
@@ -0,0 +1,28 @@
1
+ import type { EventType } from "../events/events.js";
2
+ import { ReactiveController, ReactiveControllerHost } from "lit";
3
+ type NodeEvent = EventType | undefined;
4
+ type EventPipelineHost = ReactiveControllerHost & EventTarget & {
5
+ _eventParent?: NodeEvent;
6
+ _eventDom?: NodeEvent;
7
+ _event?: NodeEvent;
8
+ ignoreEventsParent: boolean;
9
+ autoForward: boolean;
10
+ };
11
+ export declare class EventPipelineController implements ReactiveController {
12
+ private host;
13
+ private _prevDomEventRef?;
14
+ private _prevParentEventRef?;
15
+ private _prevIgnoreParent?;
16
+ private _syncTask;
17
+ private _forwardTask;
18
+ private _forwardEvent;
19
+ private _notifyParent;
20
+ constructor(host: EventPipelineHost, forwardEvent: (e?: NodeEvent) => void, notifyParent: () => void);
21
+ get syncComplete(): Promise<void>;
22
+ get forwardComplete(): Promise<void>;
23
+ hostConnected(): void;
24
+ hostDisconnected(): void;
25
+ hostUpdate(): void;
26
+ hostUpdated(): void;
27
+ }
28
+ export {};
@@ -0,0 +1,72 @@
1
+ import { Task } from "@lit/task";
2
+ export class EventPipelineController {
3
+ constructor(host, forwardEvent, notifyParent) {
4
+ this.host = host;
5
+ this._forwardEvent = forwardEvent;
6
+ this._notifyParent = notifyParent;
7
+ host.addController(this);
8
+ this._syncTask = new Task(host, {
9
+ task: async ([fromParent, fromDom, ignoreParent]) => {
10
+ const dom = fromDom;
11
+ const parent = fromParent;
12
+ const domChanged = !!dom && dom !== this._prevDomEventRef;
13
+ const parentChanged = !!parent && parent !== this._prevParentEventRef;
14
+ const ignoreChanged = ignoreParent !== this._prevIgnoreParent;
15
+ if (!domChanged && !parentChanged && !ignoreChanged)
16
+ return;
17
+ this._prevIgnoreParent = ignoreParent;
18
+ if (domChanged)
19
+ this._prevDomEventRef = dom;
20
+ if (parentChanged)
21
+ this._prevParentEventRef = parent;
22
+ if (ignoreParent) {
23
+ if (domChanged) {
24
+ this.host._event = dom;
25
+ }
26
+ return;
27
+ }
28
+ if (domChanged) {
29
+ this.host._event = dom;
30
+ return;
31
+ }
32
+ if (parentChanged) {
33
+ this.host._event = parent;
34
+ return;
35
+ }
36
+ // If only the ignore flag changed, adopt parent event (if any).
37
+ if (!ignoreParent && parent) {
38
+ this.host._event = parent;
39
+ }
40
+ },
41
+ args: () => [this.host._eventParent, this.host._eventDom, this.host.ignoreEventsParent]
42
+ });
43
+ this._forwardTask = new Task(host, {
44
+ task: async ([evt, auto]) => {
45
+ if (!evt || !auto)
46
+ return;
47
+ this._forwardEvent(evt);
48
+ this._notifyParent();
49
+ },
50
+ args: () => [this.host._event, this.host.autoForward]
51
+ });
52
+ }
53
+ get syncComplete() {
54
+ return this._syncTask.taskComplete;
55
+ }
56
+ get forwardComplete() {
57
+ return this._forwardTask.taskComplete;
58
+ }
59
+ hostConnected() {
60
+ // no-op
61
+ }
62
+ hostDisconnected() {
63
+ // no-op
64
+ }
65
+ hostUpdate() {
66
+ // no-op
67
+ }
68
+ hostUpdated() {
69
+ // no-op
70
+ }
71
+ }
72
+ //# sourceMappingURL=event-pipeline-controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-pipeline-controller.js","sourceRoot":"","sources":["../../../src/controllers/event-pipeline-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAajC,MAAM,OAAO,uBAAuB;IAYlC,YAAY,IAAuB,EAAE,YAAqC,EAAE,YAAwB;QAClG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAEzB,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE;YAC9B,IAAI,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,EAAE;gBAClD,MAAM,GAAG,GAAG,OAAoB,CAAC;gBACjC,MAAM,MAAM,GAAG,UAAuB,CAAC;gBAEvC,MAAM,UAAU,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,IAAI,CAAC,gBAAgB,CAAC;gBAC1D,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,IAAI,MAAM,KAAK,IAAI,CAAC,mBAAmB,CAAC;gBACtE,MAAM,aAAa,GAAG,YAAY,KAAK,IAAI,CAAC,iBAAiB,CAAC;gBAE9D,IAAI,CAAC,UAAU,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa;oBAAE,OAAO;gBAE5D,IAAI,CAAC,iBAAiB,GAAG,YAAY,CAAC;gBACtC,IAAI,UAAU;oBAAE,IAAI,CAAC,gBAAgB,GAAG,GAAG,CAAC;gBAC5C,IAAI,aAAa;oBAAE,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC;gBAErD,IAAI,YAAY,EAAE,CAAC;oBACjB,IAAI,UAAU,EAAE,CAAC;wBACf,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;oBACzB,CAAC;oBACD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;IACV,CAAC;IAED,WAAW;QACT,QAAQ;IACV,CAAC;CACF","sourcesContent":["import type { EventType } from \"@/events/events\";\nimport { Task } from \"@lit/task\";\nimport { ReactiveController, ReactiveControllerHost } from \"lit\";\n\ntype NodeEvent = EventType | undefined;\n\ntype EventPipelineHost = ReactiveControllerHost & EventTarget & {\n _eventParent? : NodeEvent;\n _eventDom? : NodeEvent;\n _event? : NodeEvent;\n ignoreEventsParent: boolean;\n autoForward : boolean;\n};\n\nexport class EventPipelineController implements ReactiveController {\n private host: EventPipelineHost;\n\n private _prevDomEventRef? : NodeEvent;\n private _prevParentEventRef?: NodeEvent;\n private _prevIgnoreParent? : boolean;\n\n private _syncTask : Task<unknown[], void>;\n private _forwardTask : Task<unknown[], void>;\n private _forwardEvent: (e?: NodeEvent) => void;\n private _notifyParent: () => void;\n\n constructor(host: EventPipelineHost, forwardEvent: (e?: NodeEvent) => void, notifyParent: () => void) {\n this.host = host;\n this._forwardEvent = forwardEvent;\n this._notifyParent = notifyParent;\n host.addController(this);\n\n this._syncTask = new Task(host, {\n task: async ([fromParent, fromDom, ignoreParent]) => {\n const dom = fromDom as NodeEvent;\n const parent = fromParent as NodeEvent;\n\n const domChanged = !!dom && dom !== this._prevDomEventRef;\n const parentChanged = !!parent && parent !== this._prevParentEventRef;\n const ignoreChanged = ignoreParent !== this._prevIgnoreParent;\n\n if (!domChanged && !parentChanged && !ignoreChanged) return;\n\n this._prevIgnoreParent = ignoreParent;\n if (domChanged) this._prevDomEventRef = dom;\n if (parentChanged) this._prevParentEventRef = parent;\n\n if (ignoreParent) {\n if (domChanged) {\n this.host._event = dom;\n }\n return;\n }\n\n if (domChanged) {\n this.host._event = dom;\n return;\n }\n\n if (parentChanged) {\n this.host._event = parent;\n return;\n }\n\n // If only the ignore flag changed, adopt parent event (if any).\n if (!ignoreParent && parent) {\n this.host._event = parent;\n }\n },\n args: () => [this.host._eventParent, this.host._eventDom, this.host.ignoreEventsParent]\n });\n\n this._forwardTask = new Task(host, {\n task: async ([evt, auto]) => {\n if (!evt || !auto) return;\n this._forwardEvent(evt as NodeEvent);\n this._notifyParent();\n },\n args: () => [this.host._event, this.host.autoForward]\n });\n }\n\n get syncComplete() {\n return this._syncTask.taskComplete;\n }\n\n get forwardComplete() {\n return this._forwardTask.taskComplete;\n }\n\n hostConnected() {\n // no-op\n }\n\n hostDisconnected() {\n // no-op\n }\n\n hostUpdate() {\n // no-op\n }\n\n hostUpdated() {\n // no-op\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../../../../src/dsl/compilers/array/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,mCAAmC;AACnC,8CAA8C;AAC9C,mCAAmC;AACnC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAwB,EAAE;IAC5D,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACrB,IAAI,CAAC,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAE/B,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,MAAM,KAAK,GAAK,SAAS,CAAC;IAC1B,MAAM,OAAO,GAAG,4BAA4B,CAAC;IAE7C,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;QACjC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC9B,IAAI,CAAC,EAAE,CAAC;YACN,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC7B,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC7B,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7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,EAAE,CAAC,CAAC;YAC7B,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC,IAAI,IAAI;gBAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACvD,SAAS;QACX,CAAC;QACD,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;YAC7B,SAAS;QACX,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,0BAA0B,IAAI,GAAG,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAA","sourcesContent":["import { split } from \"@/dsl/utilty\";\n// \"2,3,4,5\" -> [2,3,4,5]\n// \"1..4,8,10..7\" -> [1,2,3,4,8,10,9,8,7]\n// \"\" -> undefined\nexport const compiler = (raw: string): number[] | undefined => {\n const s = raw.trim();\n if (s === \"\") return undefined;\n\n const out: number[] = [];\n const intRe = /^-?\\d+$/;\n const rangeRe = /^(-?\\d+)\\s*\\.\\.\\s*(-?\\d+)$/;\n\n for (const part of split(s, \",\")) {\n const m = part.match(rangeRe);\n if (m) {\n const a = parseInt(m[1], 10);\n const b = parseInt(m[2], 10);\n const step = a <= b ? 1 : -1;\n for (let v = a; v !== b + step; v += step) out.push(v);\n continue;\n }\n if (intRe.test(part)) {\n out.push(parseInt(part, 10));\n continue;\n }\n throw new Error(`Invalid number token: \"${part}\"`);\n }\n\n return out;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../../../../src/dsl/compilers/boolean/compiler.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,kBAAkB,CAAC;AAOnC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,CAAC,CAAC;IACnC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,EAAU,EAAE,EAAE;IAChD,SAAS,CAAC,IAAI,CAAC,CAAC;IAEhB,sEAAsE;IACtE,mBAAmB;IACnB,mBAAmB;IACnB,mFAAmF;IACnF,qEAAqE;IACrE,MAAM,UAAU,GAAG,IAAI;SACpB,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC;SAC1B,OAAO,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;IAEzC,oEAAoE;IACpE,MAAM,GAAG,GAAG,UAAU,UAAU,MAAM,CAAC;IAEvC,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QAChC,6CAA6C;QAC7C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC;IACvC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,kEAAkE;QAClE,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACvD,MAAM,IAAI,KAAK,CAAC,gCAAgC,GAAG,EAAE,CAAC,CAAC;IACzD,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { Ctx } from \"@/dsl/utilty\";\nimport eta from \"@/templating/eta\";\n\ntype Params = {\n expr: string,\n ctx : Ctx\n};\n\n// Very lightweight preflight checks so we can rely on Eta/JS\n// for actual expression evaluation while still catching a few\n// DSL-specific pitfalls we used to guard against.\nfunction preflight(expr: string) {\n // 1) Disallow chained comparisons like: a < b < c\n // Match two comparison operators with no logical op (&&, ||) between\n const chainedCmp = /(<=|>=|<|>)\\s*[^&|]+(<=|>=|<|>)/;\n if (chainedCmp.test(expr)) {\n throw new Error(\"Chained comparisons are not allowed\");\n }\n\n // 2) Basic parentheses balance check to surface a clearer error\n let depth = 0;\n for (const ch of expr) {\n if (ch === \"(\") depth++;\n else if (ch === \")\") {\n depth--;\n if (depth < 0) {\n // extra closing paren\n throw new Error(\"Unexpected ')'\");\n }\n }\n }\n if (depth > 0) {\n throw new Error(\"Expected ')' \");\n }\n}\n\nexport const compiler = ({ expr, ctx }: Params) => {\n preflight(expr);\n\n // Normalize equality to strict semantics to match legacy DSL behavior\n // - '==' -> '==='\n // - '!=' -> '!=='\n // Note: This is a simple text replacement and does not account for quoted strings,\n // but our DSL usage does not place operators inside string literals.\n const normalized = expr\n .replace(/!=(?!=)/g, '!==')\n .replace(/(?<![=!])==(?![=])/g, '===');\n\n // Build a tiny Eta template that coerces the expression to boolean.\n const tpl = `{{= !!(${normalized}) }}`;\n\n try {\n const fn = eta.compile(tpl);\n const out = eta.render(fn, ctx);\n // Eta returns a string; normalize to boolean\n return String(out).trim() === \"true\";\n } catch (e) {\n // Normalize error to a generic syntax error message used in tests\n const msg = e instanceof Error ? e.message : String(e);\n throw new Error(`Unexpected expression error: ${msg}`);\n }\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../../../../src/dsl/compilers/enum/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAQrC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAyB,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAmB,EAAuB,EAAE;IACvH,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,IAAI,CAAc,CAAC;IAC9C,wBAAwB;IACxB,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,eAAe,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAA"}
1
+ {"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../../../../src/dsl/compilers/enum/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAQrC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAyB,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAmB,EAAuB,EAAE;IACvH,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,IAAI,CAAc,CAAC;IAC9C,wBAAwB;IACxB,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,eAAe,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAA","sourcesContent":["import { split } from \"@/dsl/utilty\";\n\ntype Params<Allowed extends string> = {\n expr : string,\n allowed : readonly Allowed[],\n isAvailable: (variant: Allowed) => boolean,\n}\n\nexport const compiler = <Allowed extends string>({ expr, allowed, isAvailable }: Params<Allowed>): Allowed | undefined => {\n const tokens = split(expr, \"||\") as Allowed[];\n // validate tokens early\n for (const t of tokens) {\n if (!allowed.includes(t)) {\n console.warn(`[store] Unknown token \"${t}\". Allowed: ${allowed.join(\", \")}`);\n }\n }\n\n for (const t of tokens) {\n if (allowed.includes(t) && isAvailable(t)) return t;\n }\n return undefined;\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dsl/compilers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE1D,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,OAAO;IACP,IAAI,EAAE,WAAW;IACjB,KAAK;CACG,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dsl/compilers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE1D,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,OAAO;IACP,IAAI,EAAE,WAAW;IACjB,KAAK;CACG,CAAC","sourcesContent":["import { compiler as array } from \"./array/compiler\";\nimport { compiler as boolean } from \"./boolean/compiler\";\nimport { compiler as enumeration } from \"./enum/compiler\";\n\nexport const Compiler = {\n boolean,\n enum: enumeration,\n array\n} as const;"]}
@@ -1 +1 @@
1
- {"version":3,"file":"utilty.js","sourceRoot":"","sources":["../../../src/dsl/utilty.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAU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E;IACzC,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IAChD,IAAI,CAAC,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAC9B,IAAI,CAAC,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAChC,IAAI,CAAC,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAC9B,IAAI,CAAC,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACtC,IAAI,CAAC,CAAC,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpF,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAEF,qCAAqC;AACrC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,EAAE,CAChD,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;KAC9B,MAAM,CAAC,OAAO,CAAC,CAAC","sourcesContent":["export type Ctx = Record<string, unknown>;\nexport const isRecord = (v: unknown): v is Record<string, unknown> =>\n v !== null && typeof v === \"object\";\n\nexport const getPath = <T = unknown>(ctx: unknown, path: string): T | undefined => {\n let acc: unknown = ctx;\n for (const key of path.split(\".\")) {\n if (!isRecord(acc) || !(key in acc)) return undefined;\n acc = acc[key as keyof typeof acc];\n }\n return acc as T | undefined;\n}\n\nexport const isTruthy = (v: unknown) =>\n v !== \"\" && v !== false && v !== null && v !== undefined;\n\n// Parse quoted literal or pass-through\nexport const coerceLiteral = (s: string) => {\n if (/^-?\\d+(\\.\\d+)?$/.test(s)) return Number(s);\n if (s === \"true\") return true;\n if (s === \"false\") return false;\n if (s === \"null\") return null;\n if (s === \"undefined\") return undefined;\n const q = s[0], end = s[s.length - 1];\n if ((q === \"'\" && end === \"'\") || (q === '\"' && end === '\"')) return s.slice(1, -1);\n return s;\n};\n\n// Split by token, trim, drop empties\nexport const split = (raw: string, sep: string) =>\n raw.split(sep).map(s => s.trim())\n .filter(Boolean);"]}
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/events/events.ts"],"names":[],"mappings":"AA6CA,MAAM,OAAO,kBAAmB,SAAQ,WAA0B;aAChD,cAAS,GAAG,oBAAoB,CAAC;IAEjD,YAAY,MAAqB;QAC/B,KAAK,CAAC,kBAAkB,CAAC,SAAS,EAAE;YAClC,MAAM;YACN,OAAO,EAAK,IAAI;YAChB,QAAQ,EAAI,IAAI;YAChB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;IACL,CAAC;;AAGH,MAAM,OAAO,WAAY,SAAQ,WAAmB;aAClC,cAAS,GAAG,kBAAkB,CAAC;IAE/C,YAAY,MAAc;QACxB,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE;YAC3B,MAAM;YACN,OAAO,EAAK,IAAI;YAChB,QAAQ,EAAI,IAAI;YAChB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;IACL,CAAC;;AAGH,MAAM,OAAO,kBAAmB,SAAQ,WAA0B;aAChD,cAAS,GAAG,sBAAsB,CAAC;IAEnD,YAAY,MAAqB;QAC/B,KAAK,CAAC,kBAAkB,CAAC,SAAS,EAAE;YAClC,MAAM;YACN,OAAO,EAAK,IAAI;YAChB,QAAQ,EAAI,IAAI;YAChB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;IACL,CAAC;;AAGH,MAAM,OAAO,yBAA0B,SAAQ,WAAiC;aAC9D,cAAS,GAAG,+BAA+B,CAAC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AI,IAAI;YAChB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;IACL,CAAC;;AAGH,MAAM,OAAO,wBAAyB,SAAQ,WAAyB;aACrD,cAAS,GAAG,6BAA6B,CAAC;IAE1D,YAAY,MAAoB;QAC9B,KAAK,CAAC,wBAAwB,CAAC,SAAS,EAAE;YACxC,MAAM;YACN,OAAO,EAAK,IAAI;YAChB,QAAQ,EAAI,IAAI;YAChB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;IACL,CAAC","sourcesContent":["import { ProductOption } from \"@repobit/dex-store\";\n\nexport type UpdateByDelta = {\n type : \"devices\" | \"subscription\";\n delta : number | \"next\" | \"prev\";\n min? : number;\n max? : number;\n /**\n * If true, treat `delta` as the new absolute value\n * instead of adding/subtracting it.\n */\n useAsValue?: boolean;\n /**\n * Optional identifier of the action source element (data-store-id)\n */\n storeId? : string;\n}\n\nexport type Action = {\n id? : string;\n campaign? : string;\n bundle? : boolean;\n devices? : number;\n subscription?: number;\n /**\n * Optional identifier of the action source element (data-store-id)\n */\n storeId? : string;\n}\n\nexport type CollectUpdateByDelta = {\n name : symbol | string,\n update: UpdateByDelta | null\n};\n\nexport type CollectAction = {\n name : symbol | string,\n action: Action | null\n};\n\nexport type CollectOption = {\n name : symbol | string,\n options: Promise<ProductOption[]> | null,\n};\n\nexport class UpdateByDeltaEvent extends CustomEvent<UpdateByDelta> {\n static readonly eventName = \"store-update-delta\";\n\n constructor(detail: UpdateByDelta) {\n super(UpdateByDeltaEvent.eventName, {\n detail,\n bubbles : true,\n composed : true,\n cancelable: true\n });\n }\n}\n\nexport class ActionEvent extends CustomEvent<Action> {\n static readonly eventName = \"store-set-action\";\n\n constructor(detail: Action) {\n super(ActionEvent.eventName, {\n detail,\n bubbles : true,\n composed : true,\n cancelable: true\n });\n }\n}\n\nexport class CollectActionEvent extends CustomEvent<CollectAction> {\n static readonly eventName = \"store-collect-action\";\n\n constructor(detail: CollectAction) {\n super(CollectActionEvent.eventName, {\n detail,\n bubbles : true,\n composed : true,\n cancelable: true\n });\n }\n}\n\nexport class CollectUpdateByDeltaEvent extends CustomEvent<CollectUpdateByDelta> {\n static readonly eventName = \"store-collect-update-by-delta\";\n\n constructor(detail: CollectUpdateByDelta) {\n super(CollectUpdateByDeltaEvent.eventName, {\n detail,\n bubbles : true,\n composed : true,\n cancelable: true\n });\n }\n}\n\nexport class CollectOptionEvent extends CustomEvent<CollectOption> {\n static readonly eventName = \"store-collect-option\";\n\n constructor(detail: CollectOption) {\n super(CollectOptionEvent.eventName, {\n detail,\n bubbles : true,\n composed : true,\n cancelable: true\n });\n }\n}\n\n/**\n * Contextual child registration for updateComplete coordination.\n * Children dispatch these to their nearest StateNode-like parent.\n */\nexport type CollectChild = {\n child: HTMLElement;\n};\n\nexport class CollectChildEvent extends CustomEvent<CollectChild> {\n static readonly eventName = \"store-collect-child\";\n\n constructor(detail: CollectChild) {\n super(CollectChildEvent.eventName, {\n detail,\n bubbles : true,\n composed : true,\n cancelable: true\n });\n }\n}\n\nexport class CollectChildRemovedEvent extends CustomEvent<CollectChild> {\n static readonly eventName = \"store-collect-child-removed\";\n\n constructor(detail: CollectChild) {\n super(CollectChildRemovedEvent.eventName, {\n detail,\n bubbles : true,\n composed : true,\n cancelable: true\n });\n }\n}\n\nexport type EventType =\n UpdateByDeltaEvent |\n ActionEvent;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EA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YAAY,EAAE,WAAW;IACzB,WAAW,EAAG,UAAU;IACxB,YAAY,EAAE,WAAW;CACjB,CAAC;AAEX,MAAM,UAAU,oBAAoB;IAClC,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC7D,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;AACH,CAAC;AAED,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAS,EACV,CAAC","sourcesContent":["import { registerActionNodes } from \"./actions\";\nimport { ContextNode } from './nodes/node.context.js';\nimport { OptionNode } from './nodes/node.option.js';\nimport { ProductNode } from './nodes/node.product.js';\nimport { RootNode } from './nodes/node.root.js';\nimport { StateNode } from './nodes/node.state.js';\nimport { registerRenderNodes } from \"./renders\";\n\nexport { registerActionNodes, registerRenderNodes };\n\n// Export definitions for consumers who want tags + constructors\nexport const elementDefinitions = {\n 'bd-root' : RootNode,\n 'bd-state' : StateNode,\n 'bd-product': ProductNode,\n 'bd-option' : OptionNode,\n 'bd-context': ContextNode\n} as const;\n\nexport function registerContextNodes() {\n for (const [tag, Ctor] of Object.entries(elementDefinitions)) {\n if (!customElements.get(tag)) {\n customElements.define(tag, Ctor);\n }\n }\n}\n\nexport {\n ContextNode,\n OptionNode,\n ProductNode,\n RootNode,\n StateNode\n};\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"node.context.js","sourceRoot":"","sources":["../../../src/nodes/node.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,MAAM,OAAO,WAAY,SAAQ,SAAS;IAA1C;;QACE,uBAAkB,GAAG,IAAI,CAAC;IAC5B,CAAC;CAAA"}
1
+ {"version":3,"file":"node.context.js","sourceRoot":"","sources":["../../../src/nodes/node.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,MAAM,OAAO,WAAY,SAAQ,SAAS;IAA1C;;QACE,uBAAkB,GAAG,IAAI,CAAC;IAC5B,CAAC;CAAA","sourcesContent":["import { StateNode } from \"./node.state\";\nexport class ContextNode extends StateNode {\n ignoreEventsParent = true;\n}\n"]}
@@ -17,11 +17,13 @@ export declare class OptionNode extends StateNode {
17
17
  private _pendingDevicesFromEvent;
18
18
  private _pendingSubscriptionFromEvent;
19
19
  get option(): ProductOption | null | undefined;
20
+ private _collectFromTask;
21
+ private _syncOptionAttributes;
20
22
  private _changeOptionEvent;
21
23
  private _fireDataLayerTask;
22
24
  private _loadOptionByAttributes;
23
- private _etaOptionRenderTask;
24
- protected shouldRunEtaStateRender(): boolean;
25
+ getEtaArgs(): unknown[];
26
+ buildEtaContext(): Promise<object | undefined>;
25
27
  connectedCallback(): void;
26
28
  disconnectedCallback(): void;
27
29
  protected getUpdateComplete(): Promise<boolean>;
@@ -27,13 +27,7 @@ export class OptionNode extends StateNode {
27
27
  if (this._isIgnoredSource(evt)) {
28
28
  return null;
29
29
  }
30
- this._optionContext = this._changeOptionEvent.taskComplete;
31
- if (!this.noCollect) {
32
- this.collectOption({
33
- name: this.storeName,
34
- options: this._changeOptionEvent.taskComplete.then(option => option ? [option] : [])
35
- });
36
- }
30
+ this._collectFromTask(this._changeOptionEvent.taskComplete);
37
31
  let option = null;
38
32
  if (this.isActionEvent(evt)) {
39
33
  // Record event-driven attribute values (if any) so attribute task can skip
@@ -67,9 +61,14 @@ export class OptionNode extends StateNode {
67
61
  });
68
62
  this._loadOptionByAttributes = new Task(this, {
69
63
  task: async ([devices, subscription]) => {
64
+ const hasPendingDevices = this._pendingDevicesFromEvent !== undefined;
65
+ const hasPendingSubscription = this._pendingSubscriptionFromEvent !== undefined;
66
+ const matchesPendingDevices = !hasPendingDevices || devices === this._pendingDevicesFromEvent;
67
+ const matchesPendingSubscription = !hasPendingSubscription || subscription === this._pendingSubscriptionFromEvent;
70
68
  // Skip only when current attribute values were just set by an event
71
- if ((this._pendingDevicesFromEvent !== undefined && devices === this._pendingDevicesFromEvent) ||
72
- (this._pendingSubscriptionFromEvent !== undefined && subscription === this._pendingSubscriptionFromEvent)) {
69
+ if ((hasPendingDevices || hasPendingSubscription)
70
+ && matchesPendingDevices
71
+ && matchesPendingSubscription) {
73
72
  this._pendingDevicesFromEvent = undefined;
74
73
  this._pendingSubscriptionFromEvent = undefined;
75
74
  return this._option;
@@ -77,48 +76,49 @@ export class OptionNode extends StateNode {
77
76
  if (!this._option) {
78
77
  return null;
79
78
  }
80
- if (!devices || !subscription) {
79
+ if (devices === undefined || subscription === undefined) {
81
80
  this._option = null;
82
81
  return null;
83
82
  }
84
- this._optionContext = this._loadOptionByAttributes.taskComplete;
85
- if (!this.noCollect) {
86
- this.collectOption({
87
- name: this.storeName,
88
- options: this._loadOptionByAttributes.taskComplete.then(option => option ? [option] : [])
89
- });
90
- }
83
+ this._collectFromTask(this._loadOptionByAttributes.taskComplete);
91
84
  const option = await this.option?.getOption({ devices, subscription });
92
85
  this._option = option;
93
86
  return option;
94
87
  },
95
88
  args: () => [this.devices, this.subscription]
96
89
  });
97
- // Render text templates for option-specific context in direct children
98
- this._etaOptionRenderTask = new Task(this, {
99
- task: async ([opt, state, product, derived]) => {
100
- const option = opt ?? this._option;
101
- if (!option)
102
- return;
103
- this._etaRenderInProgress = true;
104
- try {
105
- const it = await toDSLContext({ option, product, state, derived });
106
- await this._renderEtaTemplates(it);
107
- }
108
- finally {
109
- this._etaRenderInProgress = false;
110
- // Resolve any waiters from super.getUpdateComplete()
111
- this._notifyEtaIdle();
112
- }
113
- },
114
- args: () => [this._option, this.state, this.product, this._derived]
115
- });
116
90
  }
117
91
  get option() {
118
92
  return this._option;
119
93
  }
120
- // Disable base state-level Eta render to avoid double rendering.
121
- shouldRunEtaStateRender() { return false; }
94
+ _collectFromTask(taskComplete) {
95
+ this._optionContext = taskComplete;
96
+ if (!this.noCollect) {
97
+ this.collectOption({
98
+ name: this.storeName,
99
+ options: taskComplete.then((option) => option ? [option] : [])
100
+ });
101
+ }
102
+ }
103
+ _syncOptionAttributes(option) {
104
+ const devices = option.getDevices();
105
+ const subscription = option.getSubscription();
106
+ // Mark as event-driven attribute update to avoid double work
107
+ this._pendingDevicesFromEvent = devices;
108
+ this._pendingSubscriptionFromEvent = subscription;
109
+ this.devices = devices;
110
+ this.subscription = subscription;
111
+ }
112
+ getEtaArgs() {
113
+ return [this._option, this.state, this.product, this._derived];
114
+ }
115
+ async buildEtaContext() {
116
+ await this._changeOptionEvent.taskComplete;
117
+ await this._loadOptionByAttributes.taskComplete;
118
+ if (!this._option)
119
+ return undefined;
120
+ return await toDSLContext({ option: this._option, product: this.product, state: this.state, derived: this._derived });
121
+ }
122
122
  connectedCallback() {
123
123
  super.connectedCallback();
124
124
  if (!this.noCollect) {
@@ -139,7 +139,6 @@ export class OptionNode extends StateNode {
139
139
  const result = await super.getUpdateComplete();
140
140
  await this._changeOptionEvent.taskComplete;
141
141
  await this._loadOptionByAttributes.taskComplete;
142
- await this._etaOptionRenderTask.taskComplete;
143
142
  await this._fireDataLayerTask.taskComplete;
144
143
  return result;
145
144
  }
@@ -158,19 +157,24 @@ export class OptionNode extends StateNode {
158
157
  // Keep all other events scoped to this option
159
158
  e.stopPropagation();
160
159
  }
161
- async _applyDeltaUpdate({ type, delta, useAsValue, min = Number.MAX_SAFE_INTEGER, max = Number.MIN_SAFE_INTEGER }) {
160
+ async _applyDeltaUpdate({ type, delta, useAsValue, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER }) {
162
161
  const devices = useAsValue && type === "devices" ? Number(delta) : this.devices;
163
162
  const subscription = useAsValue && type === "subscription" ? Number(delta) : this.subscription;
164
163
  let option;
165
164
  if (useAsValue) {
166
- if (!devices || !subscription) {
165
+ if (devices === undefined
166
+ || subscription === undefined
167
+ || Number.isNaN(devices)
168
+ || Number.isNaN(subscription)) {
167
169
  return null;
168
170
  }
169
171
  option = await this.option?.getOption({ devices, subscription });
170
172
  }
171
- option = await this.option?.nextOption(type === "devices" ?
172
- { devices: delta } :
173
- { subscription: delta });
173
+ else {
174
+ option = await this.option?.nextOption(type === "devices" ?
175
+ { devices: delta } :
176
+ { subscription: delta });
177
+ }
174
178
  if (!option) {
175
179
  return null;
176
180
  }
@@ -180,17 +184,13 @@ export class OptionNode extends StateNode {
180
184
  if (type === "subscription" && (option.getSubscription() < min || option.getSubscription() > max)) {
181
185
  return null;
182
186
  }
183
- // Mark as event-driven attribute update to avoid double work
184
- this._pendingDevicesFromEvent = devices;
185
- this._pendingSubscriptionFromEvent = subscription;
186
- this.devices = devices;
187
- this.subscription = subscription;
187
+ this._syncOptionAttributes(option);
188
188
  return option;
189
189
  }
190
190
  async __applyAction({ id, campaign, devices, subscription }) {
191
- this.devices = devices || this.devices;
192
- this.subscription = subscription || this.subscription;
193
- if (!this.devices || !this.subscription) {
191
+ this.devices = devices ?? this.devices;
192
+ this.subscription = subscription ?? this.subscription;
193
+ if (this.devices === undefined || this.subscription === undefined) {
194
194
  return null;
195
195
  }
196
196
  if (id) {
@@ -204,9 +204,9 @@ export class OptionNode extends StateNode {
204
204
  return this.option?.getOption({ devices: this.devices, subscription: this.subscription });
205
205
  }
206
206
  async __applyBundle(option) {
207
- const devices = option.devices || this.devices;
208
- const subscription = option.subscription || this.subscription;
209
- if (!devices || !subscription || !option.id) {
207
+ const devices = option.devices ?? this.devices;
208
+ const subscription = option.subscription ?? this.subscription;
209
+ if (devices === undefined || subscription === undefined || !option.id) {
210
210
  return null;
211
211
  }
212
212
  const productToBeBundled = await this._store?.getProduct({ id: option.id, campaign: option.campaign });
@@ -214,7 +214,7 @@ export class OptionNode extends StateNode {
214
214
  if (!optionToBeBundled) {
215
215
  return null;
216
216
  }
217
- if (this.devices && this.subscription) {
217
+ if (this.devices !== undefined && this.subscription !== undefined) {
218
218
  return this.option?.toogleBundle({
219
219
  devicesFixed: Boolean(option.devices),
220
220
  subscriptionFixed: Boolean(option.subscription),
@@ -1 +1 @@
1
- {"version":3,"file":"node.option.js","sourceRoot":"","sources":["../../../src/nodes/node.option.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,gBAAgB,EAA0C,MAAM,8BAA8B,CAAC;AACxG,OAAO,EAAE,aAAa,EAAqB,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAsB,MAAM,4BAA4B,CAAC;AAEhF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,OAAO,UAAW,SAAQ,SAAS;IAAzC;;QAcE,WAAM,GAAG,EAA2B,CAAC;QAarC,mDAAmD;QAC3C,mBAAc,GAAG,KAAK,CAAC;QAWvB,uBAAkB,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE;YAC1C,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;gBAC3B,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;oBACnB,OAAO,IAAI,CAAC;gBACd,CAAC;gBAED,kFAAkF;gBAClF,IAAI,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC/B,OAAO,IAAI,CAAC;gBACd,CAAC;gBAED,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC;gBAE3D,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;oBACpB,IAAI,CAAC,aAAa,CAAC;wBACjB,IAAI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erPayload } from \"@/contexts/context.datalayer\";\nimport { optionContext, optionContextType } from \"@/contexts/context.option\";\nimport { productContext, productContextType } from \"@/contexts/context.product\";\nimport { Action, EventType, UpdateByDelta } from \"@/events/events\";\nimport { toDSLContext } from \"@/renders/context\";\nimport { consume, provide } from \"@lit/context\";\nimport { Task } from \"@lit/task\";\nimport { ProductBundleOption, ProductOption } from \"@repobit/dex-store\";\nimport { property } from \"lit/decorators.js\";\nimport { StateNode } from \"./node.state\";\n\nexport class OptionNode extends StateNode {\n @provide({ context: optionContext })\n @property({ attribute: false })\n _optionContext?: optionContextType;\n\n @consume({ context: dataLayerContext, subscribe: true })\n @property({ attribute: false })\n _dataLayer?: dataLayerContextType;\n\n @consume({ context: productContext, subscribe: true })\n @property({ attribute: false })\n product?: productContextType;\n\n @property({ attribute: false })\n bundle = [] as ProductBundleOption[];\n\n @property({ type: Number, reflect: true })\n devices?: number;\n\n @property({ type: Number, reflect: true })\n subscription?: number;\n\n // Optional data layer event name to publish when option loads/changes\n @property({ attribute: 'data-layer-event' })\n dataLayerEvent?: dataLayerPayload[\"event\"];\n\n _option: ProductOption | null | undefined;\n // ensure datalayer is fired only once (first load)\n private _sentDataLayer = false;\n\n // Track attribute values last set by an incoming event\n // to avoid double work in _loadOptionByAttributes.\n private _pendingDevicesFromEvent : number | undefined;\n private _pendingSubscriptionFromEvent: number | undefined;\n\n get option(): ProductOption | null | undefined {\n return this._option;\n }\n\n private _collectFromTask(taskComplete: Promise<ProductOption | null | undefined>) {\n this._optionContext = taskComplete;\n\n if (!this.noCollect) {\n this.collectOption({\n name : this.storeName,\n options: taskComplete.then((option) => option ? [option] : [])\n });\n }\n }\n\n private _syncOptionAttributes(option: ProductOption) {\n const devices = option.getDevices();\n const subscription = option.getSubscription();\n\n // Mark as event-driven attribute update to avoid double work\n this._pendingDevicesFromEvent = devices;\n this._pendingSubscriptionFromEvent = subscription;\n\n this.devices = devices;\n this.subscription = subscription;\n }\n\n private _changeOptionEvent = new Task(this, {\n task: async ([evt, store]) => {\n if (!evt || !store) {\n return null;\n }\n\n // Ignore events matching this node's ignoreEvents list (works for DOM or context)\n if (this._isIgnoredSource(evt)) {\n return null;\n }\n\n this._collectFromTask(this._changeOptionEvent.taskComplete);\n\n let option: ProductOption | null | undefined = null;\n\n if (this.isActionEvent(evt)) {\n // Record event-driven attribute values (if any) so attribute task can skip\n this._pendingDevicesFromEvent = evt.detail?.devices;\n this._pendingSubscriptionFromEvent = evt.detail?.subscription;\n option = await this.__applyAction(evt.detail || {});\n }\n\n if (this.isBundleToogle(evt)) {\n option = await this.__applyBundle(evt.detail || {});\n }\n\n if (this.isDeltaUpdate(evt)) {\n option = await this._applyDeltaUpdate(evt.detail || {});\n }\n\n this._option = option;\n\n return option;\n },\n args: () => [this._event, this._store]\n });\n\n // Ensure datalayer is emitted if the callback becomes available slightly\n // after the first option was computed.\n private _fireDataLayerTask = new Task(this, {\n task: async ([opt, dl, evt]) => {\n if (this._sentDataLayer) return;\n if (opt && dl && evt) {\n dl({ option: opt, event: evt });\n this._sentDataLayer = true;\n }\n },\n args: () => [this._option, this._dataLayer, this.dataLayerEvent]\n });\n\n private _loadOptionByAttributes = new Task(this, {\n task: async ([devices, subscription]) => {\n const hasPendingDevices = this._pendingDevicesFromEvent !== undefined;\n const hasPendingSubscription = this._pendingSubscriptionFromEvent !== undefined;\n const matchesPendingDevices = !hasPendingDevices || devices === this._pendingDevicesFromEvent;\n const matchesPendingSubscription = !hasPendingSubscription || subscription === this._pendingSubscriptionFromEvent;\n\n // Skip only when current attribute values were just set by an event\n if (\n (hasPendingDevices || hasPendingSubscription)\n && matchesPendingDevices\n && matchesPendingSubscription\n ) {\n this._pendingDevicesFromEvent = undefined;\n this._pendingSubscriptionFromEvent = undefined;\n return this._option;\n }\n\n if (!this._option) {\n return null;\n }\n\n if (devices === undefined || subscription === undefined) {\n this._option = null;\n return null;\n }\n\n this._collectFromTask(this._loadOptionByAttributes.taskComplete);\n\n const option = await this.option?.getOption({ devices, subscription });\n\n this._option = option;\n return option;\n },\n args: () => [this.devices, this.subscription]\n });\n\n override getEtaArgs(): unknown[] {\n return [this._option, this.state, this.product, this._derived];\n }\n\n override async buildEtaContext(): Promise<object | undefined> {\n await this._changeOptionEvent.taskComplete;\n await this._loadOptionByAttributes.taskComplete;\n if (!this._option) return undefined;\n return await toDSLContext({ option: this._option, product: this.product, state: this.state, derived: this._derived });\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (!this.noCollect) {\n this.collectOption({\n name : this.storeName,\n options: Promise.resolve(this._option ? [this._option] : [])\n });\n }\n }\n\n disconnectedCallback() {\n this.collectOption({\n name : this.storeName,\n options: null\n });\n super.disconnectedCallback();\n }\n\n protected async getUpdateComplete() {\n const result = await super.getUpdateComplete();\n await this._changeOptionEvent.taskComplete;\n await this._loadOptionByAttributes.taskComplete;\n await this._fireDataLayerTask.taskComplete;\n return result;\n }\n\n protected _eventChange(e: EventType): void {\n // Respect option-level ignore list\n if (this._isIgnoredSource(e)) {\n e.stopPropagation();\n return;\n }\n\n // Always capture locally\n this._eventDom = e;\n\n // Allow only product-change events to bubble up to <bd-product>\n if (this.isProductChange(e)) {\n return; // no stopPropagation → let it bubble\n }\n\n // Keep all other events scoped to this option\n e.stopPropagation();\n }\n\n private async _applyDeltaUpdate({\n type,\n delta,\n useAsValue,\n min = Number.MIN_SAFE_INTEGER,\n max = Number.MAX_SAFE_INTEGER\n }: UpdateByDelta) {\n const devices = useAsValue && type === \"devices\" ? Number(delta) : this.devices;\n const subscription = useAsValue && type === \"subscription\" ? Number(delta) : this.subscription;\n let option: ProductOption | undefined;\n\n if (useAsValue) {\n if (\n devices === undefined\n || subscription === undefined\n || Number.isNaN(devices)\n || Number.isNaN(subscription)\n ) {\n return null;\n }\n\n option = await this.option?.getOption({ devices, subscription });\n } else {\n option = await this.option?.nextOption(\n type === \"devices\" ?\n { devices: delta } :\n { subscription: delta }\n );\n }\n\n if (!option) {\n return null;\n }\n\n if (type === \"devices\" && (option.getDevices() < min || option.getDevices() > max)) {\n return null\n }\n\n if (type === \"subscription\" && (option.getSubscription() < min || option.getSubscription() > max)) {\n return null\n }\n\n this._syncOptionAttributes(option);\n return option;\n }\n\n private async __applyAction({ id, campaign, devices, subscription }: Action) {\n this.devices = devices ?? this.devices;\n this.subscription = subscription ?? this.subscription;\n\n if (this.devices === undefined || this.subscription === undefined) {\n return null;\n }\n\n if (id) {\n const product = await this._store?.getProduct({ id, campaign });\n return product?.getOption({\n devices : this.devices,\n subscription: this.subscription,\n bundle : this.option?.getBundle() || [] });\n }\n\n return this.option?.getOption({ devices: this.devices, subscription: this.subscription });\n }\n\n private async __applyBundle(option: Action) {\n const devices = option.devices ?? this.devices;\n const subscription = option.subscription ?? this.subscription;\n\n if (devices === undefined || subscription === undefined || !option.id) {\n return null\n }\n\n const productToBeBundled = await this._store?.getProduct({ id: option.id, campaign: option.campaign })\n\n const optionToBeBundled = await productToBeBundled?.getOption({ devices, subscription })\n\n if (!optionToBeBundled) {\n return null;\n }\n\n if (this.devices !== undefined && this.subscription !== undefined) {\n return this.option?.toogleBundle({\n devicesFixed : Boolean(option.devices),\n subscriptionFixed: Boolean(option.subscription),\n option : optionToBeBundled\n });\n }\n return null;\n }\n\n}\n"]}
@@ -5,10 +5,11 @@ export declare class ProductNode extends StateNode {
5
5
  productId?: string;
6
6
  campaign?: string;
7
7
  product?: Product;
8
+ private _forwardAndNotify;
8
9
  private _productChangeEvent;
9
10
  private _forwardEventTask;
10
- private __loadProductTask;
11
- private _etaProductRenderTask;
12
- protected shouldRunEtaStateRender(): boolean;
11
+ private _loadProductTask;
12
+ getEtaArgs(): unknown[];
13
+ buildEtaContext(): Promise<object | undefined>;
13
14
  protected getUpdateComplete(): Promise<boolean>;
14
15
  }
@@ -25,8 +25,7 @@ export class ProductNode extends StateNode {
25
25
  this.productId = evt.detail.id;
26
26
  this.campaign = evt.detail.campaign;
27
27
  }
28
- this._forwardEvent(this._event);
29
- this._notifyParent();
28
+ this._forwardAndNotify(evt);
30
29
  },
31
30
  args: () => [this._event]
32
31
  });
@@ -41,13 +40,12 @@ export class ProductNode extends StateNode {
41
40
  }
42
41
  }
43
42
  if (id) {
44
- this._forwardEvent(new ActionEvent({ id, campaign }));
45
- this._notifyParent();
43
+ this._forwardAndNotify(new ActionEvent({ id, campaign }));
46
44
  }
47
45
  },
48
46
  args: () => [this.productId, this.campaign]
49
47
  });
50
- this.__loadProductTask = new Task(this, {
48
+ this._loadProductTask = new Task(this, {
51
49
  task: async ([store, id, campaign]) => {
52
50
  if (!store || !id) {
53
51
  this.product = undefined;
@@ -59,34 +57,24 @@ export class ProductNode extends StateNode {
59
57
  },
60
58
  args: () => [this._store, this.productId, this.campaign]
61
59
  });
62
- // Render text templates for product-specific context in direct children
63
- this._etaProductRenderTask = new Task(this, {
64
- task: async ([product, state, derived]) => {
65
- if (!product)
66
- return;
67
- this._etaRenderInProgress = true;
68
- try {
69
- const it = await toDSLContext({ product, state, derived });
70
- await this._renderEtaTemplates(it);
71
- }
72
- finally {
73
- this._etaRenderInProgress = false;
74
- // Resolve any waiters from super.getUpdateComplete()
75
- this._notifyEtaIdle();
76
- }
77
- },
78
- args: () => [this.product, this.state, this._derived]
79
- });
80
60
  }
81
- // Avoid double-rendering via StateNode's base Eta render;
82
- // product task includes state in its context.
83
- shouldRunEtaStateRender() { return false; }
61
+ _forwardAndNotify(event) {
62
+ this._forwardEvent(event);
63
+ this._notifyParent();
64
+ }
65
+ getEtaArgs() {
66
+ return [this.product, this.state, this._derived];
67
+ }
68
+ async buildEtaContext() {
69
+ if (!this.product)
70
+ return undefined;
71
+ return await toDSLContext({ product: this.product, state: this.state, derived: this._derived });
72
+ }
84
73
  async getUpdateComplete() {
85
74
  const result = await super.getUpdateComplete();
86
75
  await this._productChangeEvent.taskComplete;
87
76
  await this._forwardEventTask.taskComplete;
88
- await this.__loadProductTask.taskComplete;
89
- await this._etaProductRenderTask.taskComplete;
77
+ await this._loadProductTask.taskComplete;
90
78
  return result;
91
79
  }
92
80
  }