@openreceive/angular 0.4.17 → 0.4.18

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.
@@ -1,235 +1,239 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, ElementRef, NgZone, Input, Directive, ChangeDetectorRef, CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
3
- import { defineElements, validateCheckoutProps, createWrapperCheckoutShellBinding } from '@openreceive/angular';
4
-
5
- /**
6
- * Applying a wrapper binding to a custom element, independent of Angular.
7
- *
8
- * Angular templates can only bind attribute names written out literally, so a
9
- * hand-transcribed `[attr.*]` list silently drops any attribute the shared
10
- * factory later adds. Driving attributes and listeners from the binding object
11
- * keeps Angular in step with the other wrappers by construction.
12
- */
1
+ import * as i0 from "@angular/core";
2
+ import { CUSTOM_ELEMENTS_SCHEMA, ChangeDetectorRef, Component, Directive, ElementRef, Input, NgZone, inject } from "@angular/core";
3
+ import { createWrapperCheckoutShellBinding, defineElements, validateCheckoutProps } from "@openreceive/angular";
13
4
  const EMPTY_APPLIED_ELEMENT_BINDINGS = {
14
- attributes: [],
15
- listeners: [],
5
+ attributes: [],
6
+ listeners: []
16
7
  };
17
8
  function applyElementBindings(element, bindings, applied) {
18
- return {
19
- attributes: syncAttributes(element, bindings.attributes ?? {}, applied.attributes),
20
- listeners: syncListeners(element, bindings.listeners ?? {}, applied.listeners),
21
- };
9
+ return {
10
+ attributes: syncAttributes(element, bindings.attributes ?? {}, applied.attributes),
11
+ listeners: syncListeners(element, bindings.listeners ?? {}, applied.listeners)
12
+ };
22
13
  }
23
14
  function detachElementListeners(element, listeners) {
24
- for (const [name, handler] of listeners)
25
- element.removeEventListener(name, handler);
15
+ for (const [name, handler] of listeners) element.removeEventListener(name, handler);
26
16
  }
27
17
  function syncAttributes(element, attributes, applied) {
28
- for (const name of applied) {
29
- if (attributes[name] === undefined)
30
- element.removeAttribute(name);
31
- }
32
- const next = [];
33
- for (const [name, value] of Object.entries(attributes)) {
34
- if (value === undefined)
35
- continue;
36
- if (element.getAttribute(name) !== value)
37
- element.setAttribute(name, value);
38
- next.push(name);
39
- }
40
- return next;
18
+ for (const name of applied) if (attributes[name] === void 0) element.removeAttribute(name);
19
+ const next = [];
20
+ for (const [name, value] of Object.entries(attributes)) {
21
+ if (value === void 0) continue;
22
+ if (element.getAttribute(name) !== value) element.setAttribute(name, value);
23
+ next.push(name);
24
+ }
25
+ return next;
41
26
  }
42
27
  function syncListeners(element, listeners, attached) {
43
- const next = Object.entries(listeners).flatMap(([name, handler]) => handler === undefined ? [] : [[name, handler]]);
44
- const unchanged = next.length === attached.length &&
45
- next.every(([name, handler], index) => {
46
- const current = attached[index];
47
- return current !== undefined && current[0] === name && current[1] === handler;
48
- });
49
- if (unchanged)
50
- return attached;
51
- detachElementListeners(element, attached);
52
- for (const [name, handler] of next)
53
- element.addEventListener(name, handler);
54
- return next;
55
- }
56
-
57
- /** Applies a wrapper binding's attributes and listeners to the element host. */
58
- class ElementBindingsDirective {
59
- bindings = {};
60
- applied = EMPTY_APPLIED_ELEMENT_BINDINGS;
61
- // Zone-wrapped handlers are cached per original handler: the applier compares
62
- // identity to decide whether to re-attach, so a fresh wrapper each pass would
63
- // detach and re-add every listener on every change.
64
- zoneWrapped = new WeakMap();
65
- host = inject(ElementRef);
66
- zone = inject(NgZone);
67
- ngOnChanges() {
68
- // Setting attributes restarts the element's poll/countdown timers. Applying them
69
- // outside Angular keeps those timers unpatched, so they never schedule a change
70
- // detection pass; the listeners below re-enter the zone for host callbacks.
71
- this.zone.runOutsideAngular(() => {
72
- this.applied = applyElementBindings(this.host.nativeElement, { ...this.bindings, listeners: this.zoneListeners(this.bindings.listeners) }, this.applied);
73
- });
74
- }
75
- ngOnDestroy() {
76
- detachElementListeners(this.host.nativeElement, this.applied.listeners);
77
- this.applied = EMPTY_APPLIED_ELEMENT_BINDINGS;
78
- }
79
- zoneListeners(listeners) {
80
- if (listeners === undefined)
81
- return {};
82
- const wrapped = {};
83
- for (const [name, handler] of Object.entries(listeners)) {
84
- if (handler === undefined)
85
- continue;
86
- let entry = this.zoneWrapped.get(handler);
87
- if (entry === undefined) {
88
- entry = (event) => this.zone.run(() => handler(event));
89
- this.zoneWrapped.set(handler, entry);
90
- }
91
- wrapped[name] = entry;
92
- }
93
- return wrapped;
94
- }
95
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ElementBindingsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
96
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.1", type: ElementBindingsDirective, isStandalone: true, selector: "[openreceiveElementBindings]", inputs: { bindings: ["openreceiveElementBindings", "bindings"] }, usesOnChanges: true, ngImport: i0 });
28
+ const next = Object.entries(listeners).flatMap(([name, handler]) => handler === void 0 ? [] : [[name, handler]]);
29
+ if (next.length === attached.length && next.every(([name, handler], index) => {
30
+ const current = attached[index];
31
+ return current !== void 0 && current[0] === name && current[1] === handler;
32
+ })) return attached;
33
+ detachElementListeners(element, attached);
34
+ for (const [name, handler] of next) element.addEventListener(name, handler);
35
+ return next;
97
36
  }
98
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: ElementBindingsDirective, decorators: [{
99
- type: Directive,
100
- args: [{
101
- selector: "[openreceiveElementBindings]",
102
- standalone: true,
103
- }]
104
- }], propDecorators: { bindings: [{
105
- type: Input,
106
- args: ["openreceiveElementBindings"]
107
- }] } });
108
-
109
- class CheckoutComponent {
110
- // Prop names, defaults, and per-mode applicability are the shared contract in
111
- // docs/internal/wrapper-parity.md. These inputs RESTATE it because `@Input()`
112
- // is a decorator on a declared field: a type cannot generate fields, so they
113
- // cannot be derived from WrapperCheckoutComponentProps the way
114
- // Vue's defineProps and React's CheckoutProps are. The duplication is forced,
115
- // not neglected; tests/wrapper-parity.test.mjs is what keeps it in step.
116
- // Snapshot mode: bind a `checkout` to render it directly.
117
- // Create mode: omit `checkout` and bind `reference` (+ optional `prefix`); the underlying
118
- // <openreceive-checkout> element creates the checkout, then renders and polls itself.
119
- checkout;
120
- reference;
121
- prefix;
122
- csrfHeader;
123
- paymentWizard;
124
- decodeLinkUrl;
125
- themeToggle;
126
- defaultTheme;
127
- storageKey;
128
- // Create mode only.
129
- metadata;
130
- syncUrl;
131
- resumePathPrefix;
132
- routeReference;
133
- resumePaymentHash;
134
- resumePaymentRail;
135
- resumable;
136
- onCopy;
137
- onOpenWallet;
138
- onState;
139
- onSettled;
140
- onProviderCopy;
141
- onStartOver;
142
- onError;
143
- options = {};
144
- /**
145
- * The custom elements render only once this flips, and it flips inside
146
- * `runOutsideAngular`: the element starts poll and countdown timers in its
147
- * connected callback, and zone-patched timers would schedule a change-detection
148
- * pass on every tick for the lifetime of the checkout.
149
- */
150
- elementsReady = false;
151
- zone = inject(NgZone);
152
- changeDetector = inject(ChangeDetectorRef);
153
- // Rebuilt on input changes only. A getter would rebuild the whole binding
154
- // (storage reads, matchMedia, fresh objects) on every change-detection pass.
155
- // Null until the first `ngOnChanges`: inputs are not set yet at construction,
156
- // so building (and validating) here would reject every instantiation.
157
- shellBinding = null;
158
- // The shell root's attributes, driven by the same directive as the custom
159
- // elements: a hand-transcribed [attr.*] list would silently drop any root
160
- // attribute the shared factory later adds.
161
- rootBindings = {};
162
- ngAfterViewInit() {
163
- // No-op during Angular Universal SSR: custom elements only exist in the
164
- // browser, and the element renders itself after hydration.
165
- if (globalThis.customElements === undefined || globalThis.HTMLElement === undefined)
166
- return;
167
- this.zone.runOutsideAngular(() => {
168
- defineElements();
169
- this.elementsReady = true;
170
- // Rebuild so the mounted shell carries the stored theme, not the deferred default.
171
- this.applyShell();
172
- this.changeDetector.detectChanges();
173
- });
174
- }
175
- ngOnChanges() {
176
- this.applyShell();
177
- }
178
- get shell() {
179
- return this.shellBinding;
180
- }
181
- applyShell() {
182
- this.shellBinding = this.buildShell();
183
- this.rootBindings = { attributes: this.shellBinding.rootAttributes };
184
- }
185
- buildShell() {
186
- validateCheckoutProps({
187
- framework: "@openreceive/angular",
188
- checkout: this.checkout,
189
- reference: this.reference,
190
- metadata: this.metadata,
191
- syncUrl: this.syncUrl,
192
- resumePathPrefix: this.resumePathPrefix,
193
- routeReference: this.routeReference,
194
- resumePaymentHash: this.resumePaymentHash,
195
- resumePaymentRail: this.resumePaymentRail,
196
- });
197
- const options = {
198
- ...this.options,
199
- themeToggle: this.themeToggle ?? this.options.themeToggle ?? true,
200
- // Storage and matchMedia only exist in the browser: resolving the theme before
201
- // the elements mount would make a server-rendered shell disagree with hydration.
202
- deferThemeResolution: !this.elementsReady,
203
- ...(this.reference === undefined ? {} : { reference: this.reference }),
204
- ...(this.prefix === undefined ? {} : { prefix: this.prefix }),
205
- ...(this.csrfHeader === undefined ? {} : { csrfHeader: this.csrfHeader }),
206
- ...(this.paymentWizard === undefined ? {} : { paymentWizard: this.paymentWizard }),
207
- ...(this.decodeLinkUrl === undefined ? {} : { decodeLinkUrl: this.decodeLinkUrl }),
208
- ...(this.defaultTheme === undefined ? {} : { defaultTheme: this.defaultTheme }),
209
- ...(this.storageKey === undefined ? {} : { storageKey: this.storageKey }),
210
- ...(this.metadata === undefined ? {} : { metadata: this.metadata }),
211
- ...(this.syncUrl === undefined ? {} : { syncUrl: this.syncUrl }),
212
- ...(this.resumePathPrefix === undefined ? {} : { resumePathPrefix: this.resumePathPrefix }),
213
- ...(this.routeReference === undefined ? {} : { routeReference: this.routeReference }),
214
- ...(this.resumePaymentHash === undefined
215
- ? {}
216
- : { resumePaymentHash: this.resumePaymentHash }),
217
- ...(this.resumePaymentRail === undefined
218
- ? {}
219
- : { resumePaymentRail: this.resumePaymentRail }),
220
- ...(this.resumable === undefined ? {} : { resumable: this.resumable }),
221
- ...(this.onCopy === undefined ? {} : { onCopy: this.onCopy }),
222
- ...(this.onOpenWallet === undefined ? {} : { onOpenWallet: this.onOpenWallet }),
223
- ...(this.onState === undefined ? {} : { onState: this.onState }),
224
- ...(this.onSettled === undefined ? {} : { onSettled: this.onSettled }),
225
- ...(this.onProviderCopy === undefined ? {} : { onProviderCopy: this.onProviderCopy }),
226
- ...(this.onStartOver === undefined ? {} : { onStartOver: this.onStartOver }),
227
- ...(this.onError === undefined ? {} : { onError: this.onError }),
228
- };
229
- return createWrapperCheckoutShellBinding(this.checkout ?? null, options);
230
- }
231
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: CheckoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
232
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: CheckoutComponent, isStandalone: true, selector: "openreceive-angular-checkout", inputs: { checkout: "checkout", reference: "reference", prefix: "prefix", csrfHeader: "csrfHeader", paymentWizard: "paymentWizard", decodeLinkUrl: "decodeLinkUrl", themeToggle: "themeToggle", defaultTheme: "defaultTheme", storageKey: "storageKey", metadata: "metadata", syncUrl: "syncUrl", resumePathPrefix: "resumePathPrefix", routeReference: "routeReference", resumePaymentHash: "resumePaymentHash", resumePaymentRail: "resumePaymentRail", resumable: "resumable", onCopy: "onCopy", onOpenWallet: "onOpenWallet", onState: "onState", onSettled: "onSettled", onProviderCopy: "onProviderCopy", onStartOver: "onStartOver", onError: "onError", options: "options" }, usesOnChanges: true, ngImport: i0, template: `
37
+ var ElementBindingsDirective = class ElementBindingsDirective {
38
+ bindings = {};
39
+ applied = EMPTY_APPLIED_ELEMENT_BINDINGS;
40
+ zoneWrapped = /* @__PURE__ */ new WeakMap();
41
+ host = inject(ElementRef);
42
+ zone = inject(NgZone);
43
+ ngOnChanges() {
44
+ this.zone.runOutsideAngular(() => {
45
+ this.applied = applyElementBindings(this.host.nativeElement, {
46
+ ...this.bindings,
47
+ listeners: this.zoneListeners(this.bindings.listeners)
48
+ }, this.applied);
49
+ });
50
+ }
51
+ ngOnDestroy() {
52
+ detachElementListeners(this.host.nativeElement, this.applied.listeners);
53
+ this.applied = EMPTY_APPLIED_ELEMENT_BINDINGS;
54
+ }
55
+ zoneListeners(listeners) {
56
+ if (listeners === void 0) return {};
57
+ const wrapped = {};
58
+ for (const [name, handler] of Object.entries(listeners)) {
59
+ if (handler === void 0) continue;
60
+ let entry = this.zoneWrapped.get(handler);
61
+ if (entry === void 0) {
62
+ entry = (event) => this.zone.run(() => handler(event));
63
+ this.zoneWrapped.set(handler, entry);
64
+ }
65
+ wrapped[name] = entry;
66
+ }
67
+ return wrapped;
68
+ }
69
+ static ɵfac = i0.ɵɵngDeclareFactory({
70
+ minVersion: "12.0.0",
71
+ version: "22.2.1",
72
+ ngImport: i0,
73
+ type: ElementBindingsDirective,
74
+ deps: [],
75
+ target: i0.ɵɵFactoryTarget.Directive
76
+ });
77
+ static ɵdir = i0.ɵɵngDeclareDirective({
78
+ minVersion: "14.0.0",
79
+ version: "22.2.1",
80
+ type: ElementBindingsDirective,
81
+ isStandalone: true,
82
+ selector: "[openreceiveElementBindings]",
83
+ inputs: { bindings: ["openreceiveElementBindings", "bindings"] },
84
+ usesOnChanges: true,
85
+ ngImport: i0
86
+ });
87
+ };
88
+ i0.ɵɵngDeclareClassMetadata({
89
+ minVersion: "12.0.0",
90
+ version: "22.2.1",
91
+ ngImport: i0,
92
+ type: ElementBindingsDirective,
93
+ decorators: [{
94
+ type: Directive,
95
+ args: [{
96
+ selector: "[openreceiveElementBindings]",
97
+ standalone: true
98
+ }]
99
+ }],
100
+ propDecorators: { bindings: [{
101
+ type: Input,
102
+ args: ["openreceiveElementBindings"]
103
+ }] }
104
+ });
105
+ var CheckoutComponent = class CheckoutComponent {
106
+ checkout;
107
+ reference;
108
+ prefix;
109
+ csrfHeader;
110
+ paymentWizard;
111
+ decodeLinkUrl;
112
+ themeToggle;
113
+ defaultTheme;
114
+ storageKey;
115
+ metadata;
116
+ syncUrl;
117
+ resumePathPrefix;
118
+ routeReference;
119
+ resumePaymentHash;
120
+ resumePaymentRail;
121
+ resumable;
122
+ onCopy;
123
+ onOpenWallet;
124
+ onState;
125
+ onSettled;
126
+ onProviderCopy;
127
+ onStartOver;
128
+ onError;
129
+ options = {};
130
+ elementsReady = false;
131
+ zone = inject(NgZone);
132
+ changeDetector = inject(ChangeDetectorRef);
133
+ shellBinding = null;
134
+ rootBindings = {};
135
+ ngAfterViewInit() {
136
+ if (globalThis.customElements === void 0 || globalThis.HTMLElement === void 0) return;
137
+ this.zone.runOutsideAngular(() => {
138
+ defineElements();
139
+ this.elementsReady = true;
140
+ this.applyShell();
141
+ this.changeDetector.detectChanges();
142
+ });
143
+ }
144
+ ngOnChanges() {
145
+ this.applyShell();
146
+ }
147
+ get shell() {
148
+ return this.shellBinding;
149
+ }
150
+ applyShell() {
151
+ this.shellBinding = this.buildShell();
152
+ this.rootBindings = { attributes: this.shellBinding.rootAttributes };
153
+ }
154
+ buildShell() {
155
+ validateCheckoutProps({
156
+ framework: "@openreceive/angular",
157
+ checkout: this.checkout,
158
+ reference: this.reference,
159
+ metadata: this.metadata,
160
+ syncUrl: this.syncUrl,
161
+ resumePathPrefix: this.resumePathPrefix,
162
+ routeReference: this.routeReference,
163
+ resumePaymentHash: this.resumePaymentHash,
164
+ resumePaymentRail: this.resumePaymentRail
165
+ });
166
+ const options = {
167
+ ...this.options,
168
+ themeToggle: this.themeToggle ?? this.options.themeToggle ?? true,
169
+ deferThemeResolution: !this.elementsReady,
170
+ ...this.reference === void 0 ? {} : { reference: this.reference },
171
+ ...this.prefix === void 0 ? {} : { prefix: this.prefix },
172
+ ...this.csrfHeader === void 0 ? {} : { csrfHeader: this.csrfHeader },
173
+ ...this.paymentWizard === void 0 ? {} : { paymentWizard: this.paymentWizard },
174
+ ...this.decodeLinkUrl === void 0 ? {} : { decodeLinkUrl: this.decodeLinkUrl },
175
+ ...this.defaultTheme === void 0 ? {} : { defaultTheme: this.defaultTheme },
176
+ ...this.storageKey === void 0 ? {} : { storageKey: this.storageKey },
177
+ ...this.metadata === void 0 ? {} : { metadata: this.metadata },
178
+ ...this.syncUrl === void 0 ? {} : { syncUrl: this.syncUrl },
179
+ ...this.resumePathPrefix === void 0 ? {} : { resumePathPrefix: this.resumePathPrefix },
180
+ ...this.routeReference === void 0 ? {} : { routeReference: this.routeReference },
181
+ ...this.resumePaymentHash === void 0 ? {} : { resumePaymentHash: this.resumePaymentHash },
182
+ ...this.resumePaymentRail === void 0 ? {} : { resumePaymentRail: this.resumePaymentRail },
183
+ ...this.resumable === void 0 ? {} : { resumable: this.resumable },
184
+ ...this.onCopy === void 0 ? {} : { onCopy: this.onCopy },
185
+ ...this.onOpenWallet === void 0 ? {} : { onOpenWallet: this.onOpenWallet },
186
+ ...this.onState === void 0 ? {} : { onState: this.onState },
187
+ ...this.onSettled === void 0 ? {} : { onSettled: this.onSettled },
188
+ ...this.onProviderCopy === void 0 ? {} : { onProviderCopy: this.onProviderCopy },
189
+ ...this.onStartOver === void 0 ? {} : { onStartOver: this.onStartOver },
190
+ ...this.onError === void 0 ? {} : { onError: this.onError }
191
+ };
192
+ return createWrapperCheckoutShellBinding(this.checkout ?? null, options);
193
+ }
194
+ static ɵfac = i0.ɵɵngDeclareFactory({
195
+ minVersion: "12.0.0",
196
+ version: "22.2.1",
197
+ ngImport: i0,
198
+ type: CheckoutComponent,
199
+ deps: [],
200
+ target: i0.ɵɵFactoryTarget.Component
201
+ });
202
+ static ɵcmp = i0.ɵɵngDeclareComponent({
203
+ minVersion: "17.0.0",
204
+ version: "22.2.1",
205
+ type: CheckoutComponent,
206
+ isStandalone: true,
207
+ selector: "openreceive-angular-checkout",
208
+ inputs: {
209
+ checkout: "checkout",
210
+ reference: "reference",
211
+ prefix: "prefix",
212
+ csrfHeader: "csrfHeader",
213
+ paymentWizard: "paymentWizard",
214
+ decodeLinkUrl: "decodeLinkUrl",
215
+ themeToggle: "themeToggle",
216
+ defaultTheme: "defaultTheme",
217
+ storageKey: "storageKey",
218
+ metadata: "metadata",
219
+ syncUrl: "syncUrl",
220
+ resumePathPrefix: "resumePathPrefix",
221
+ routeReference: "routeReference",
222
+ resumePaymentHash: "resumePaymentHash",
223
+ resumePaymentRail: "resumePaymentRail",
224
+ resumable: "resumable",
225
+ onCopy: "onCopy",
226
+ onOpenWallet: "onOpenWallet",
227
+ onState: "onState",
228
+ onSettled: "onSettled",
229
+ onProviderCopy: "onProviderCopy",
230
+ onStartOver: "onStartOver",
231
+ onError: "onError",
232
+ options: "options"
233
+ },
234
+ usesOnChanges: true,
235
+ ngImport: i0,
236
+ template: `
233
237
  <section [openreceiveElementBindings]="rootBindings">
234
238
  @if (elementsReady && shell; as shell) {
235
239
  @if (shell.themeToggle) {
@@ -240,16 +244,29 @@ class CheckoutComponent {
240
244
  <openreceive-checkout [openreceiveElementBindings]="shell.checkout"></openreceive-checkout>
241
245
  }
242
246
  </section>
243
- `, isInline: true, dependencies: [{ kind: "directive", type: ElementBindingsDirective, selector: "[openreceiveElementBindings]", inputs: ["openreceiveElementBindings"] }] });
244
- }
245
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: CheckoutComponent, decorators: [{
246
- type: Component,
247
- args: [{
248
- selector: "openreceive-angular-checkout",
249
- standalone: true,
250
- imports: [ElementBindingsDirective],
251
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
252
- template: `
247
+ `,
248
+ isInline: true,
249
+ dependencies: [{
250
+ kind: "directive",
251
+ type: ElementBindingsDirective,
252
+ selector: "[openreceiveElementBindings]",
253
+ inputs: ["openreceiveElementBindings"]
254
+ }]
255
+ });
256
+ };
257
+ i0.ɵɵngDeclareClassMetadata({
258
+ minVersion: "12.0.0",
259
+ version: "22.2.1",
260
+ ngImport: i0,
261
+ type: CheckoutComponent,
262
+ decorators: [{
263
+ type: Component,
264
+ args: [{
265
+ selector: "openreceive-angular-checkout",
266
+ standalone: true,
267
+ imports: [ElementBindingsDirective],
268
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
269
+ template: `
253
270
  <section [openreceiveElementBindings]="rootBindings">
254
271
  @if (elementsReady && shell; as shell) {
255
272
  @if (shell.themeToggle) {
@@ -260,61 +277,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
260
277
  <openreceive-checkout [openreceiveElementBindings]="shell.checkout"></openreceive-checkout>
261
278
  }
262
279
  </section>
263
- `,
264
- }]
265
- }], propDecorators: { checkout: [{
266
- type: Input
267
- }], reference: [{
268
- type: Input
269
- }], prefix: [{
270
- type: Input
271
- }], csrfHeader: [{
272
- type: Input
273
- }], paymentWizard: [{
274
- type: Input
275
- }], decodeLinkUrl: [{
276
- type: Input
277
- }], themeToggle: [{
278
- type: Input
279
- }], defaultTheme: [{
280
- type: Input
281
- }], storageKey: [{
282
- type: Input
283
- }], metadata: [{
284
- type: Input
285
- }], syncUrl: [{
286
- type: Input
287
- }], resumePathPrefix: [{
288
- type: Input
289
- }], routeReference: [{
290
- type: Input
291
- }], resumePaymentHash: [{
292
- type: Input
293
- }], resumePaymentRail: [{
294
- type: Input
295
- }], resumable: [{
296
- type: Input
297
- }], onCopy: [{
298
- type: Input
299
- }], onOpenWallet: [{
300
- type: Input
301
- }], onState: [{
302
- type: Input
303
- }], onSettled: [{
304
- type: Input
305
- }], onProviderCopy: [{
306
- type: Input
307
- }], onStartOver: [{
308
- type: Input
309
- }], onError: [{
310
- type: Input
311
- }], options: [{
312
- type: Input
313
- }] } });
314
-
315
- /**
316
- * Generated bundle index. Do not edit.
317
- */
318
-
280
+ `
281
+ }]
282
+ }],
283
+ propDecorators: {
284
+ checkout: [{ type: Input }],
285
+ reference: [{ type: Input }],
286
+ prefix: [{ type: Input }],
287
+ csrfHeader: [{ type: Input }],
288
+ paymentWizard: [{ type: Input }],
289
+ decodeLinkUrl: [{ type: Input }],
290
+ themeToggle: [{ type: Input }],
291
+ defaultTheme: [{ type: Input }],
292
+ storageKey: [{ type: Input }],
293
+ metadata: [{ type: Input }],
294
+ syncUrl: [{ type: Input }],
295
+ resumePathPrefix: [{ type: Input }],
296
+ routeReference: [{ type: Input }],
297
+ resumePaymentHash: [{ type: Input }],
298
+ resumePaymentRail: [{ type: Input }],
299
+ resumable: [{ type: Input }],
300
+ onCopy: [{ type: Input }],
301
+ onOpenWallet: [{ type: Input }],
302
+ onState: [{ type: Input }],
303
+ onSettled: [{ type: Input }],
304
+ onProviderCopy: [{ type: Input }],
305
+ onStartOver: [{ type: Input }],
306
+ onError: [{ type: Input }],
307
+ options: [{ type: Input }]
308
+ }
309
+ });
319
310
  export { CheckoutComponent };
320
- //# sourceMappingURL=openreceive-angular-checkout-component.mjs.map
311
+
312
+ //# sourceMappingURL=openreceive-angular-checkout-component.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"openreceive-angular-checkout-component.mjs","sources":["../../src/element-bindings.ts","../../src/openreceive-element-bindings.directive.ts","../../src/openreceive-checkout.component.ts","../../src/openreceive-angular-checkout-component.ts"],"sourcesContent":["/**\n * Applying a wrapper binding to a custom element, independent of Angular.\n *\n * Angular templates can only bind attribute names written out literally, so a\n * hand-transcribed `[attr.*]` list silently drops any attribute the shared\n * factory later adds. Driving attributes and listeners from the binding object\n * keeps Angular in step with the other wrappers by construction.\n */\n\nexport interface ElementBindings {\n readonly attributes?: Readonly<Record<string, string | undefined>>;\n readonly listeners?: Readonly<Record<string, ((event: Event) => void) | undefined>>;\n}\n\nexport interface ElementBindingTarget {\n getAttribute(name: string): string | null;\n setAttribute(name: string, value: string): void;\n removeAttribute(name: string): void;\n addEventListener(name: string, listener: (event: Event) => void): void;\n removeEventListener(name: string, listener: (event: Event) => void): void;\n}\n\nexport type AttachedListeners = readonly (readonly [string, (event: Event) => void])[];\n\nexport interface AppliedElementBindings {\n readonly attributes: readonly string[];\n readonly listeners: AttachedListeners;\n}\n\nexport const EMPTY_APPLIED_ELEMENT_BINDINGS: AppliedElementBindings = {\n attributes: [],\n listeners: [],\n};\n\nexport function applyElementBindings(\n element: ElementBindingTarget,\n bindings: ElementBindings,\n applied: AppliedElementBindings,\n): AppliedElementBindings {\n return {\n attributes: syncAttributes(element, bindings.attributes ?? {}, applied.attributes),\n listeners: syncListeners(element, bindings.listeners ?? {}, applied.listeners),\n };\n}\n\nexport function detachElementListeners(\n element: ElementBindingTarget,\n listeners: AttachedListeners,\n): void {\n for (const [name, handler] of listeners) element.removeEventListener(name, handler);\n}\n\nfunction syncAttributes(\n element: ElementBindingTarget,\n attributes: Readonly<Record<string, string | undefined>>,\n applied: readonly string[],\n): readonly string[] {\n for (const name of applied) {\n if (attributes[name] === undefined) element.removeAttribute(name);\n }\n const next: string[] = [];\n for (const [name, value] of Object.entries(attributes)) {\n if (value === undefined) continue;\n if (element.getAttribute(name) !== value) element.setAttribute(name, value);\n next.push(name);\n }\n return next;\n}\n\nfunction syncListeners(\n element: ElementBindingTarget,\n listeners: Readonly<Record<string, ((event: Event) => void) | undefined>>,\n attached: AttachedListeners,\n): AttachedListeners {\n const next = Object.entries(listeners).flatMap(([name, handler]) =>\n handler === undefined ? [] : [[name, handler] as const],\n );\n const unchanged =\n next.length === attached.length &&\n next.every(([name, handler], index) => {\n const current = attached[index];\n return current !== undefined && current[0] === name && current[1] === handler;\n });\n if (unchanged) return attached;\n detachElementListeners(element, attached);\n for (const [name, handler] of next) element.addEventListener(name, handler);\n return next;\n}\n","import {\n Directive,\n ElementRef,\n Input,\n NgZone,\n inject,\n type OnChanges,\n type OnDestroy,\n} from \"@angular/core\";\nimport {\n type AppliedElementBindings,\n EMPTY_APPLIED_ELEMENT_BINDINGS,\n type ElementBindings,\n applyElementBindings,\n detachElementListeners,\n} from \"./element-bindings\";\n\n/** Applies a wrapper binding's attributes and listeners to the element host. */\n@Directive({\n selector: \"[openreceiveElementBindings]\",\n standalone: true,\n})\nexport class ElementBindingsDirective implements OnChanges, OnDestroy {\n @Input(\"openreceiveElementBindings\") bindings: ElementBindings = {};\n\n private applied: AppliedElementBindings = EMPTY_APPLIED_ELEMENT_BINDINGS;\n // Zone-wrapped handlers are cached per original handler: the applier compares\n // identity to decide whether to re-attach, so a fresh wrapper each pass would\n // detach and re-add every listener on every change.\n private readonly zoneWrapped = new WeakMap<(event: Event) => void, (event: Event) => void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly zone = inject(NgZone);\n\n ngOnChanges(): void {\n // Setting attributes restarts the element's poll/countdown timers. Applying them\n // outside Angular keeps those timers unpatched, so they never schedule a change\n // detection pass; the listeners below re-enter the zone for host callbacks.\n this.zone.runOutsideAngular(() => {\n this.applied = applyElementBindings(\n this.host.nativeElement,\n { ...this.bindings, listeners: this.zoneListeners(this.bindings.listeners) },\n this.applied,\n );\n });\n }\n\n ngOnDestroy(): void {\n detachElementListeners(this.host.nativeElement, this.applied.listeners);\n this.applied = EMPTY_APPLIED_ELEMENT_BINDINGS;\n }\n\n private zoneListeners(\n listeners: ElementBindings[\"listeners\"],\n ): Readonly<Record<string, ((event: Event) => void) | undefined>> {\n if (listeners === undefined) return {};\n const wrapped: Record<string, ((event: Event) => void) | undefined> = {};\n for (const [name, handler] of Object.entries(listeners)) {\n if (handler === undefined) continue;\n let entry = this.zoneWrapped.get(handler);\n if (entry === undefined) {\n entry = (event: Event) => this.zone.run(() => handler(event));\n this.zoneWrapped.set(handler, entry);\n }\n wrapped[name] = entry;\n }\n return wrapped;\n }\n}\n","import {\n type AfterViewInit,\n ChangeDetectorRef,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n Input,\n inject,\n NgZone,\n type OnChanges,\n} from \"@angular/core\";\nimport {\n type CheckoutSnapshot,\n createWrapperCheckoutShellBinding,\n defineElements,\n type ThemePreference,\n validateCheckoutProps,\n type WrapperCheckoutShellBinding,\n type WrapperCheckoutShellOptions,\n} from \"@openreceive/angular\";\nimport type { ElementBindings } from \"./element-bindings\";\nimport { ElementBindingsDirective } from \"./openreceive-element-bindings.directive\";\n\n@Component({\n selector: \"openreceive-angular-checkout\",\n standalone: true,\n imports: [ElementBindingsDirective],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <section [openreceiveElementBindings]=\"rootBindings\">\n @if (elementsReady && shell; as shell) {\n @if (shell.themeToggle) {\n <openreceive-theme-toggle\n [openreceiveElementBindings]=\"shell.themeToggle\"\n ></openreceive-theme-toggle>\n }\n <openreceive-checkout [openreceiveElementBindings]=\"shell.checkout\"></openreceive-checkout>\n }\n </section>\n `,\n})\nexport class CheckoutComponent implements AfterViewInit, OnChanges {\n // Prop names, defaults, and per-mode applicability are the shared contract in\n // docs/internal/wrapper-parity.md. These inputs RESTATE it because `@Input()`\n // is a decorator on a declared field: a type cannot generate fields, so they\n // cannot be derived from WrapperCheckoutComponentProps the way\n // Vue's defineProps and React's CheckoutProps are. The duplication is forced,\n // not neglected; tests/wrapper-parity.test.mjs is what keeps it in step.\n // Snapshot mode: bind a `checkout` to render it directly.\n // Create mode: omit `checkout` and bind `reference` (+ optional `prefix`); the underlying\n // <openreceive-checkout> element creates the checkout, then renders and polls itself.\n @Input() checkout?: CheckoutSnapshot | null;\n @Input() reference?: string;\n @Input() prefix?: string;\n @Input() csrfHeader?: string;\n @Input() paymentWizard?: boolean;\n @Input() decodeLinkUrl?: string;\n @Input() themeToggle?: boolean;\n @Input() defaultTheme?: ThemePreference;\n @Input() storageKey?: string;\n // Create mode only.\n @Input() metadata?: Record<string, unknown>;\n @Input() syncUrl?: boolean;\n @Input() resumePathPrefix?: string;\n @Input() routeReference?: string;\n @Input() resumePaymentHash?: string;\n @Input() resumePaymentRail?: \"lightning\" | \"swap\";\n @Input() resumable?: boolean;\n @Input() onCopy?: (event: Event) => void;\n @Input() onOpenWallet?: (event: Event) => void;\n @Input() onState?: (event: Event) => void;\n @Input() onSettled?: (event: Event) => void;\n @Input() onProviderCopy?: (event: Event) => void;\n @Input() onStartOver?: (event: Event) => void;\n @Input() onError?: (event: Event) => void;\n @Input() options: WrapperCheckoutShellOptions = {};\n\n /**\n * The custom elements render only once this flips, and it flips inside\n * `runOutsideAngular`: the element starts poll and countdown timers in its\n * connected callback, and zone-patched timers would schedule a change-detection\n * pass on every tick for the lifetime of the checkout.\n */\n protected elementsReady = false;\n\n private readonly zone = inject(NgZone);\n private readonly changeDetector = inject(ChangeDetectorRef);\n\n // Rebuilt on input changes only. A getter would rebuild the whole binding\n // (storage reads, matchMedia, fresh objects) on every change-detection pass.\n // Null until the first `ngOnChanges`: inputs are not set yet at construction,\n // so building (and validating) here would reject every instantiation.\n protected shellBinding: WrapperCheckoutShellBinding | null = null;\n\n // The shell root's attributes, driven by the same directive as the custom\n // elements: a hand-transcribed [attr.*] list would silently drop any root\n // attribute the shared factory later adds.\n protected rootBindings: ElementBindings = {};\n\n ngAfterViewInit(): void {\n // No-op during Angular Universal SSR: custom elements only exist in the\n // browser, and the element renders itself after hydration.\n if (globalThis.customElements === undefined || globalThis.HTMLElement === undefined) return;\n this.zone.runOutsideAngular(() => {\n defineElements();\n this.elementsReady = true;\n // Rebuild so the mounted shell carries the stored theme, not the deferred default.\n this.applyShell();\n this.changeDetector.detectChanges();\n });\n }\n\n ngOnChanges(): void {\n this.applyShell();\n }\n\n get shell(): WrapperCheckoutShellBinding | null {\n return this.shellBinding;\n }\n\n private applyShell(): void {\n this.shellBinding = this.buildShell();\n this.rootBindings = { attributes: this.shellBinding.rootAttributes };\n }\n\n private buildShell(): WrapperCheckoutShellBinding {\n validateCheckoutProps({\n framework: \"@openreceive/angular\",\n checkout: this.checkout,\n reference: this.reference,\n metadata: this.metadata,\n syncUrl: this.syncUrl,\n resumePathPrefix: this.resumePathPrefix,\n routeReference: this.routeReference,\n resumePaymentHash: this.resumePaymentHash,\n resumePaymentRail: this.resumePaymentRail,\n });\n const options: WrapperCheckoutShellOptions = {\n ...this.options,\n themeToggle: this.themeToggle ?? this.options.themeToggle ?? true,\n // Storage and matchMedia only exist in the browser: resolving the theme before\n // the elements mount would make a server-rendered shell disagree with hydration.\n deferThemeResolution: !this.elementsReady,\n ...(this.reference === undefined ? {} : { reference: this.reference }),\n ...(this.prefix === undefined ? {} : { prefix: this.prefix }),\n ...(this.csrfHeader === undefined ? {} : { csrfHeader: this.csrfHeader }),\n ...(this.paymentWizard === undefined ? {} : { paymentWizard: this.paymentWizard }),\n ...(this.decodeLinkUrl === undefined ? {} : { decodeLinkUrl: this.decodeLinkUrl }),\n ...(this.defaultTheme === undefined ? {} : { defaultTheme: this.defaultTheme }),\n ...(this.storageKey === undefined ? {} : { storageKey: this.storageKey }),\n ...(this.metadata === undefined ? {} : { metadata: this.metadata }),\n ...(this.syncUrl === undefined ? {} : { syncUrl: this.syncUrl }),\n ...(this.resumePathPrefix === undefined ? {} : { resumePathPrefix: this.resumePathPrefix }),\n ...(this.routeReference === undefined ? {} : { routeReference: this.routeReference }),\n ...(this.resumePaymentHash === undefined\n ? {}\n : { resumePaymentHash: this.resumePaymentHash }),\n ...(this.resumePaymentRail === undefined\n ? {}\n : { resumePaymentRail: this.resumePaymentRail }),\n ...(this.resumable === undefined ? {} : { resumable: this.resumable }),\n ...(this.onCopy === undefined ? {} : { onCopy: this.onCopy }),\n ...(this.onOpenWallet === undefined ? {} : { onOpenWallet: this.onOpenWallet }),\n ...(this.onState === undefined ? {} : { onState: this.onState }),\n ...(this.onSettled === undefined ? {} : { onSettled: this.onSettled }),\n ...(this.onProviderCopy === undefined ? {} : { onProviderCopy: this.onProviderCopy }),\n ...(this.onStartOver === undefined ? {} : { onStartOver: this.onStartOver }),\n ...(this.onError === undefined ? {} : { onError: this.onError }),\n };\n return createWrapperCheckoutShellBinding(this.checkout ?? null, options);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './openreceive-checkout.component';\n"],"names":[],"mappings":";;;;AAAA;;;;;;;AAOG;AAsBI,MAAM,8BAA8B,GAA2B;AACpE,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,SAAS,EAAE,EAAE;CACd;SAEe,oBAAoB,CAClC,OAA6B,EAC7B,QAAyB,EACzB,OAA+B,EAAA;IAE/B,OAAO;AACL,QAAA,UAAU,EAAE,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,UA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A,kBAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,SAAA,EAAA,WAAA,EAAA,MAAA,EAAA,QAAA,EAAA,YAAA,EAAA,cAAA,EAAA,OAAA,EAAA,SAAA,EAAA,SAAA,EAAA,WAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,WAAA,EAAA,aAAA,EAAA,OAAA,EAAA,SAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAblB;;;;;;;;;;;AAWT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAbS,wBAAwB,EAAA,QAAA,EAAA,8BAAA,EAAA,MAAA,EAAA,CAAA,4BAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAevB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAlB7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,8BAA8B;AACxC,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,OAAO,EAAE,CAAC,sBAAsB,CAAC;AACjC,oBAAA,QAAQ,EAAE;;;;;;;;;;;AAWT,EAAA,CAAA;AACF,iBAAA;;sBAWE;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;;AC1EH;;AAEG;;;;"}
1
+ {"version":3,"file":"openreceive-angular-checkout-component.mjs","names":[],"sources":["../../src/element-bindings.ts","../../src/openreceive-element-bindings.directive.ts","../../src/openreceive-checkout.component.ts"],"sourcesContent":["/**\n * Applying a wrapper binding to a custom element, independent of Angular.\n *\n * Angular templates can only bind attribute names written out literally, so a\n * hand-transcribed `[attr.*]` list silently drops any attribute the shared\n * factory later adds. Driving attributes and listeners from the binding object\n * keeps Angular in step with the other wrappers by construction.\n */\n\nexport interface ElementBindings {\n readonly attributes?: Readonly<Record<string, string | undefined>>;\n readonly listeners?: Readonly<Record<string, ((event: Event) => void) | undefined>>;\n}\n\nexport interface ElementBindingTarget {\n getAttribute(name: string): string | null;\n setAttribute(name: string, value: string): void;\n removeAttribute(name: string): void;\n addEventListener(name: string, listener: (event: Event) => void): void;\n removeEventListener(name: string, listener: (event: Event) => void): void;\n}\n\nexport type AttachedListeners = readonly (readonly [string, (event: Event) => void])[];\n\nexport interface AppliedElementBindings {\n readonly attributes: readonly string[];\n readonly listeners: AttachedListeners;\n}\n\nexport const EMPTY_APPLIED_ELEMENT_BINDINGS: AppliedElementBindings = {\n attributes: [],\n listeners: [],\n};\n\nexport function applyElementBindings(\n element: ElementBindingTarget,\n bindings: ElementBindings,\n applied: AppliedElementBindings,\n): AppliedElementBindings {\n return {\n attributes: syncAttributes(element, bindings.attributes ?? {}, applied.attributes),\n listeners: syncListeners(element, bindings.listeners ?? {}, applied.listeners),\n };\n}\n\nexport function detachElementListeners(\n element: ElementBindingTarget,\n listeners: AttachedListeners,\n): void {\n for (const [name, handler] of listeners) element.removeEventListener(name, handler);\n}\n\nfunction syncAttributes(\n element: ElementBindingTarget,\n attributes: Readonly<Record<string, string | undefined>>,\n applied: readonly string[],\n): readonly string[] {\n for (const name of applied) {\n if (attributes[name] === undefined) element.removeAttribute(name);\n }\n const next: string[] = [];\n for (const [name, value] of Object.entries(attributes)) {\n if (value === undefined) continue;\n if (element.getAttribute(name) !== value) element.setAttribute(name, value);\n next.push(name);\n }\n return next;\n}\n\nfunction syncListeners(\n element: ElementBindingTarget,\n listeners: Readonly<Record<string, ((event: Event) => void) | undefined>>,\n attached: AttachedListeners,\n): AttachedListeners {\n const next = Object.entries(listeners).flatMap(([name, handler]) =>\n handler === undefined ? [] : [[name, handler] as const],\n );\n const unchanged =\n next.length === attached.length &&\n next.every(([name, handler], index) => {\n const current = attached[index];\n return current !== undefined && current[0] === name && current[1] === handler;\n });\n if (unchanged) return attached;\n detachElementListeners(element, attached);\n for (const [name, handler] of next) element.addEventListener(name, handler);\n return next;\n}\n","import {\n Directive,\n ElementRef,\n Input,\n NgZone,\n inject,\n type OnChanges,\n type OnDestroy,\n} from \"@angular/core\";\nimport {\n type AppliedElementBindings,\n EMPTY_APPLIED_ELEMENT_BINDINGS,\n type ElementBindings,\n applyElementBindings,\n detachElementListeners,\n} from \"./element-bindings\";\n\n/** Applies a wrapper binding's attributes and listeners to the element host. */\n@Directive({\n selector: \"[openreceiveElementBindings]\",\n standalone: true,\n})\nexport class ElementBindingsDirective implements OnChanges, OnDestroy {\n @Input(\"openreceiveElementBindings\") bindings: ElementBindings = {};\n\n private applied: AppliedElementBindings = EMPTY_APPLIED_ELEMENT_BINDINGS;\n // Zone-wrapped handlers are cached per original handler: the applier compares\n // identity to decide whether to re-attach, so a fresh wrapper each pass would\n // detach and re-add every listener on every change.\n private readonly zoneWrapped = new WeakMap<(event: Event) => void, (event: Event) => void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly zone = inject(NgZone);\n\n ngOnChanges(): void {\n // Setting attributes restarts the element's poll/countdown timers. Applying them\n // outside Angular keeps those timers unpatched, so they never schedule a change\n // detection pass; the listeners below re-enter the zone for host callbacks.\n this.zone.runOutsideAngular(() => {\n this.applied = applyElementBindings(\n this.host.nativeElement,\n { ...this.bindings, listeners: this.zoneListeners(this.bindings.listeners) },\n this.applied,\n );\n });\n }\n\n ngOnDestroy(): void {\n detachElementListeners(this.host.nativeElement, this.applied.listeners);\n this.applied = EMPTY_APPLIED_ELEMENT_BINDINGS;\n }\n\n private zoneListeners(\n listeners: ElementBindings[\"listeners\"],\n ): Readonly<Record<string, ((event: Event) => void) | undefined>> {\n if (listeners === undefined) return {};\n const wrapped: Record<string, ((event: Event) => void) | undefined> = {};\n for (const [name, handler] of Object.entries(listeners)) {\n if (handler === undefined) continue;\n let entry = this.zoneWrapped.get(handler);\n if (entry === undefined) {\n entry = (event: Event) => this.zone.run(() => handler(event));\n this.zoneWrapped.set(handler, entry);\n }\n wrapped[name] = entry;\n }\n return wrapped;\n }\n}\n","import {\n type AfterViewInit,\n ChangeDetectorRef,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n Input,\n inject,\n NgZone,\n type OnChanges,\n} from \"@angular/core\";\nimport {\n type CheckoutSnapshot,\n createWrapperCheckoutShellBinding,\n defineElements,\n type ThemePreference,\n validateCheckoutProps,\n type WrapperCheckoutShellBinding,\n type WrapperCheckoutShellOptions,\n} from \"@openreceive/angular\";\nimport type { ElementBindings } from \"./element-bindings\";\nimport { ElementBindingsDirective } from \"./openreceive-element-bindings.directive\";\n\n@Component({\n selector: \"openreceive-angular-checkout\",\n standalone: true,\n imports: [ElementBindingsDirective],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <section [openreceiveElementBindings]=\"rootBindings\">\n @if (elementsReady && shell; as shell) {\n @if (shell.themeToggle) {\n <openreceive-theme-toggle\n [openreceiveElementBindings]=\"shell.themeToggle\"\n ></openreceive-theme-toggle>\n }\n <openreceive-checkout [openreceiveElementBindings]=\"shell.checkout\"></openreceive-checkout>\n }\n </section>\n `,\n})\nexport class CheckoutComponent implements AfterViewInit, OnChanges {\n // Prop names, defaults, and per-mode applicability are the shared contract in\n // docs/internal/wrapper-parity.md. These inputs RESTATE it because `@Input()`\n // is a decorator on a declared field: a type cannot generate fields, so they\n // cannot be derived from WrapperCheckoutComponentProps the way\n // Vue's defineProps and React's CheckoutProps are. The duplication is forced,\n // not neglected; tests/wrapper-parity.test.mjs is what keeps it in step.\n // Snapshot mode: bind a `checkout` to render it directly.\n // Create mode: omit `checkout` and bind `reference` (+ optional `prefix`); the underlying\n // <openreceive-checkout> element creates the checkout, then renders and polls itself.\n @Input() checkout?: CheckoutSnapshot | null;\n @Input() reference?: string;\n @Input() prefix?: string;\n @Input() csrfHeader?: string;\n @Input() paymentWizard?: boolean;\n @Input() decodeLinkUrl?: string;\n @Input() themeToggle?: boolean;\n @Input() defaultTheme?: ThemePreference;\n @Input() storageKey?: string;\n // Create mode only.\n @Input() metadata?: Record<string, unknown>;\n @Input() syncUrl?: boolean;\n @Input() resumePathPrefix?: string;\n @Input() routeReference?: string;\n @Input() resumePaymentHash?: string;\n @Input() resumePaymentRail?: \"lightning\" | \"swap\";\n @Input() resumable?: boolean;\n @Input() onCopy?: (event: Event) => void;\n @Input() onOpenWallet?: (event: Event) => void;\n @Input() onState?: (event: Event) => void;\n @Input() onSettled?: (event: Event) => void;\n @Input() onProviderCopy?: (event: Event) => void;\n @Input() onStartOver?: (event: Event) => void;\n @Input() onError?: (event: Event) => void;\n @Input() options: WrapperCheckoutShellOptions = {};\n\n /**\n * The custom elements render only once this flips, and it flips inside\n * `runOutsideAngular`: the element starts poll and countdown timers in its\n * connected callback, and zone-patched timers would schedule a change-detection\n * pass on every tick for the lifetime of the checkout.\n */\n protected elementsReady = false;\n\n private readonly zone = inject(NgZone);\n private readonly changeDetector = inject(ChangeDetectorRef);\n\n // Rebuilt on input changes only. A getter would rebuild the whole binding\n // (storage reads, matchMedia, fresh objects) on every change-detection pass.\n // Null until the first `ngOnChanges`: inputs are not set yet at construction,\n // so building (and validating) here would reject every instantiation.\n protected shellBinding: WrapperCheckoutShellBinding | null = null;\n\n // The shell root's attributes, driven by the same directive as the custom\n // elements: a hand-transcribed [attr.*] list would silently drop any root\n // attribute the shared factory later adds.\n protected rootBindings: ElementBindings = {};\n\n ngAfterViewInit(): void {\n // No-op during Angular Universal SSR: custom elements only exist in the\n // browser, and the element renders itself after hydration.\n if (globalThis.customElements === undefined || globalThis.HTMLElement === undefined) return;\n this.zone.runOutsideAngular(() => {\n defineElements();\n this.elementsReady = true;\n // Rebuild so the mounted shell carries the stored theme, not the deferred default.\n this.applyShell();\n this.changeDetector.detectChanges();\n });\n }\n\n ngOnChanges(): void {\n this.applyShell();\n }\n\n get shell(): WrapperCheckoutShellBinding | null {\n return this.shellBinding;\n }\n\n private applyShell(): void {\n this.shellBinding = this.buildShell();\n this.rootBindings = { attributes: this.shellBinding.rootAttributes };\n }\n\n private buildShell(): WrapperCheckoutShellBinding {\n validateCheckoutProps({\n framework: \"@openreceive/angular\",\n checkout: this.checkout,\n reference: this.reference,\n metadata: this.metadata,\n syncUrl: this.syncUrl,\n resumePathPrefix: this.resumePathPrefix,\n routeReference: this.routeReference,\n resumePaymentHash: this.resumePaymentHash,\n resumePaymentRail: this.resumePaymentRail,\n });\n const options: WrapperCheckoutShellOptions = {\n ...this.options,\n themeToggle: this.themeToggle ?? this.options.themeToggle ?? true,\n // Storage and matchMedia only exist in the browser: resolving the theme before\n // the elements mount would make a server-rendered shell disagree with hydration.\n deferThemeResolution: !this.elementsReady,\n ...(this.reference === undefined ? {} : { reference: this.reference }),\n ...(this.prefix === undefined ? {} : { prefix: this.prefix }),\n ...(this.csrfHeader === undefined ? {} : { csrfHeader: this.csrfHeader }),\n ...(this.paymentWizard === undefined ? {} : { paymentWizard: this.paymentWizard }),\n ...(this.decodeLinkUrl === undefined ? {} : { decodeLinkUrl: this.decodeLinkUrl }),\n ...(this.defaultTheme === undefined ? {} : { defaultTheme: this.defaultTheme }),\n ...(this.storageKey === undefined ? {} : { storageKey: this.storageKey }),\n ...(this.metadata === undefined ? {} : { metadata: this.metadata }),\n ...(this.syncUrl === undefined ? {} : { syncUrl: this.syncUrl }),\n ...(this.resumePathPrefix === undefined ? {} : { resumePathPrefix: this.resumePathPrefix }),\n ...(this.routeReference === undefined ? {} : { routeReference: this.routeReference }),\n ...(this.resumePaymentHash === undefined\n ? {}\n : { resumePaymentHash: this.resumePaymentHash }),\n ...(this.resumePaymentRail === undefined\n ? {}\n : { resumePaymentRail: this.resumePaymentRail }),\n ...(this.resumable === undefined ? {} : { resumable: this.resumable }),\n ...(this.onCopy === undefined ? {} : { onCopy: this.onCopy }),\n ...(this.onOpenWallet === undefined ? {} : { onOpenWallet: this.onOpenWallet }),\n ...(this.onState === undefined ? {} : { onState: this.onState }),\n ...(this.onSettled === undefined ? {} : { onSettled: this.onSettled }),\n ...(this.onProviderCopy === undefined ? {} : { onProviderCopy: this.onProviderCopy }),\n ...(this.onStartOver === undefined ? {} : { onStartOver: this.onStartOver }),\n ...(this.onError === undefined ? {} : { onError: this.onError }),\n };\n return createWrapperCheckoutShellBinding(this.checkout ?? null, options);\n }\n}\n"],"mappings":";;;AA6BA,MAAa,iCAAyD;CACpE,YAAY,CAAA;CACZ,WAAW,CAAA;AACZ;AAED,SAAgB,qBACd,SACA,UACA,SAA+B;CAE/B,OAAO;EACL,YAAY,eAAe,SAAS,SAAS,cAAc,CAAA,GAAI,QAAQ,UAAU;EACjF,WAAW,cAAc,SAAS,SAAS,aAAa,CAAA,GAAI,QAAQ,SAAS;CAC9E;AACH;AAEA,SAAgB,uBACd,SACA,WAA4B;CAE5B,KAAK,MAAM,CAAC,MAAM,YAAY,WAAW,QAAQ,oBAAoB,MAAM,OAAO;AACpF;AAEA,SAAS,eACP,SACA,YACA,SAA0B;CAE1B,KAAK,MAAM,QAAQ,SACjB,IAAI,WAAW,UAAU,QAAW,QAAQ,gBAAgB,IAAI;CAElE,MAAM,OAAiB,CAAA;CACvB,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,UAAU,GAAG;EACtD,IAAI,UAAU,QAAW;EACzB,IAAI,QAAQ,aAAa,IAAI,MAAM,OAAO,QAAQ,aAAa,MAAM,KAAK;EAC1E,KAAK,KAAK,IAAI;CAChB;CACA,OAAO;AACT;AAEA,SAAS,cACP,SACA,WACA,UAA2B;CAE3B,MAAM,OAAO,OAAO,QAAQ,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,aACrD,YAAY,SAAY,CAAA,IAAK,CAAC,CAAC,MAAM,OAAO,CAAU,CAAC;CAQzD,IALE,KAAK,WAAW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AU;;;;;;;;;;;;EAYX,CAAA;;;EAWE,UAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,WAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,QAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,YAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,eAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,eAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,aAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,cAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,YAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EAEA,UAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,SAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,kBAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,gBAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,mBAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,mBAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,WAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,QAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,cAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,SAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,WAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,gBAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,aAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,SAAA,CAAA,EAAA,MAAA,MAAA,CAAA;EACA,SAAA,CAAA,EAAA,MAAA,MAAA,CAAA"}
@@ -1,12 +1 @@
1
- export * from '@openreceive/elements/wrapper-shared';
2
-
3
- // @openreceive/angular — thin wrapper over the OpenReceive checkout
4
- // custom element. The component ships on the ./checkout-component subpath;
5
- // the wrapper surface is implemented once in
6
- // @openreceive/elements/wrapper-shared.
7
- // tools/validate/check-public-api.mjs pins this surface.
8
-
9
- /**
10
- * Generated bundle index. Do not edit.
11
- */
12
- //# sourceMappingURL=openreceive-angular.mjs.map
1
+ export * from "@openreceive/elements/wrapper-shared";
@@ -1,7 +1,6 @@
1
- import * as i0 from '@angular/core';
2
- import { AfterViewInit, OnChanges } from '@angular/core';
3
- import { CheckoutSnapshot, ThemePreference, WrapperCheckoutShellOptions, WrapperCheckoutShellBinding } from '@openreceive/angular';
4
-
1
+ import * as i0 from "@angular/core";
2
+ import { AfterViewInit, OnChanges } from "@angular/core";
3
+ import { CheckoutSnapshot, ThemePreference, WrapperCheckoutShellBinding, WrapperCheckoutShellOptions } from "@openreceive/angular";
5
4
  /**
6
5
  * Applying a wrapper binding to a custom element, independent of Angular.
7
6
  *
@@ -11,53 +10,162 @@ import { CheckoutSnapshot, ThemePreference, WrapperCheckoutShellOptions, Wrapper
11
10
  * keeps Angular in step with the other wrappers by construction.
12
11
  */
13
12
  interface ElementBindings {
14
- readonly attributes?: Readonly<Record<string, string | undefined>>;
15
- readonly listeners?: Readonly<Record<string, ((event: Event) => void) | undefined>>;
13
+ readonly attributes?: Readonly<Record<string, string | undefined>>;
14
+ readonly listeners?: Readonly<Record<string, ((event: Event) => void) | undefined>>;
16
15
  }
17
-
18
- declare class CheckoutComponent implements AfterViewInit, OnChanges {
19
- checkout?: CheckoutSnapshot | null;
20
- reference?: string;
21
- prefix?: string;
22
- csrfHeader?: string;
23
- paymentWizard?: boolean;
24
- decodeLinkUrl?: string;
25
- themeToggle?: boolean;
26
- defaultTheme?: ThemePreference;
27
- storageKey?: string;
28
- metadata?: Record<string, unknown>;
29
- syncUrl?: boolean;
30
- resumePathPrefix?: string;
31
- routeReference?: string;
32
- resumePaymentHash?: string;
33
- resumePaymentRail?: "lightning" | "swap";
34
- resumable?: boolean;
35
- onCopy?: (event: Event) => void;
36
- onOpenWallet?: (event: Event) => void;
37
- onState?: (event: Event) => void;
38
- onSettled?: (event: Event) => void;
39
- onProviderCopy?: (event: Event) => void;
40
- onStartOver?: (event: Event) => void;
41
- onError?: (event: Event) => void;
42
- options: WrapperCheckoutShellOptions;
43
- /**
44
- * The custom elements render only once this flips, and it flips inside
45
- * `runOutsideAngular`: the element starts poll and countdown timers in its
46
- * connected callback, and zone-patched timers would schedule a change-detection
47
- * pass on every tick for the lifetime of the checkout.
48
- */
49
- protected elementsReady: boolean;
50
- private readonly zone;
51
- private readonly changeDetector;
52
- protected shellBinding: WrapperCheckoutShellBinding | null;
53
- protected rootBindings: ElementBindings;
54
- ngAfterViewInit(): void;
55
- ngOnChanges(): void;
56
- get shell(): WrapperCheckoutShellBinding | null;
57
- private applyShell;
58
- private buildShell;
59
- static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutComponent, never>;
60
- static ɵcmp: i0.ɵɵComponentDeclaration<CheckoutComponent, "openreceive-angular-checkout", never, { "checkout": { "alias": "checkout"; "required": false; }; "reference": { "alias": "reference"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "csrfHeader": { "alias": "csrfHeader"; "required": false; }; "paymentWizard": { "alias": "paymentWizard"; "required": false; }; "decodeLinkUrl": { "alias": "decodeLinkUrl"; "required": false; }; "themeToggle": { "alias": "themeToggle"; "required": false; }; "defaultTheme": { "alias": "defaultTheme"; "required": false; }; "storageKey": { "alias": "storageKey"; "required": false; }; "metadata": { "alias": "metadata"; "required": false; }; "syncUrl": { "alias": "syncUrl"; "required": false; }; "resumePathPrefix": { "alias": "resumePathPrefix"; "required": false; }; "routeReference": { "alias": "routeReference"; "required": false; }; "resumePaymentHash": { "alias": "resumePaymentHash"; "required": false; }; "resumePaymentRail": { "alias": "resumePaymentRail"; "required": false; }; "resumable": { "alias": "resumable"; "required": false; }; "onCopy": { "alias": "onCopy"; "required": false; }; "onOpenWallet": { "alias": "onOpenWallet"; "required": false; }; "onState": { "alias": "onState"; "required": false; }; "onSettled": { "alias": "onSettled"; "required": false; }; "onProviderCopy": { "alias": "onProviderCopy"; "required": false; }; "onStartOver": { "alias": "onStartOver"; "required": false; }; "onError": { "alias": "onError"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, {}, never, never, true, never>;
16
+ interface ElementBindingTarget {
17
+ getAttribute(name: string): string | null;
18
+ setAttribute(name: string, value: string): void;
19
+ removeAttribute(name: string): void;
20
+ addEventListener(name: string, listener: (event: Event) => void): void;
21
+ removeEventListener(name: string, listener: (event: Event) => void): void;
61
22
  }
62
-
63
- export { CheckoutComponent };
23
+ type AttachedListeners = readonly (readonly [string, (event: Event) => void])[];
24
+ interface AppliedElementBindings {
25
+ readonly attributes: readonly string[];
26
+ readonly listeners: AttachedListeners;
27
+ }
28
+ declare const EMPTY_APPLIED_ELEMENT_BINDINGS: AppliedElementBindings;
29
+ declare function applyElementBindings(element: ElementBindingTarget, bindings: ElementBindings, applied: AppliedElementBindings): AppliedElementBindings;
30
+ declare function detachElementListeners(element: ElementBindingTarget, listeners: AttachedListeners): void;
31
+ export declare class CheckoutComponent implements AfterViewInit, OnChanges {
32
+ checkout?: CheckoutSnapshot | null;
33
+ reference?: string;
34
+ prefix?: string;
35
+ csrfHeader?: string;
36
+ paymentWizard?: boolean;
37
+ decodeLinkUrl?: string;
38
+ themeToggle?: boolean;
39
+ defaultTheme?: ThemePreference;
40
+ storageKey?: string;
41
+ metadata?: Record<string, unknown>;
42
+ syncUrl?: boolean;
43
+ resumePathPrefix?: string;
44
+ routeReference?: string;
45
+ resumePaymentHash?: string;
46
+ resumePaymentRail?: "lightning" | "swap";
47
+ resumable?: boolean;
48
+ onCopy?: (event: Event) => void;
49
+ onOpenWallet?: (event: Event) => void;
50
+ onState?: (event: Event) => void;
51
+ onSettled?: (event: Event) => void;
52
+ onProviderCopy?: (event: Event) => void;
53
+ onStartOver?: (event: Event) => void;
54
+ onError?: (event: Event) => void;
55
+ options: WrapperCheckoutShellOptions;
56
+ /**
57
+ * The custom elements render only once this flips, and it flips inside
58
+ * `runOutsideAngular`: the element starts poll and countdown timers in its
59
+ * connected callback, and zone-patched timers would schedule a change-detection
60
+ * pass on every tick for the lifetime of the checkout.
61
+ */
62
+ protected elementsReady: boolean;
63
+ private readonly zone;
64
+ private readonly changeDetector;
65
+ protected shellBinding: WrapperCheckoutShellBinding | null;
66
+ protected rootBindings: ElementBindings;
67
+ ngAfterViewInit(): void;
68
+ ngOnChanges(): void;
69
+ get shell(): WrapperCheckoutShellBinding | null;
70
+ private applyShell;
71
+ private buildShell;
72
+ static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutComponent, never>;
73
+ static ɵcmp: i0.ɵɵComponentDeclaration<CheckoutComponent, "openreceive-angular-checkout", never, {
74
+ "checkout": {
75
+ "alias": "checkout";
76
+ "required": false;
77
+ };
78
+ "reference": {
79
+ "alias": "reference";
80
+ "required": false;
81
+ };
82
+ "prefix": {
83
+ "alias": "prefix";
84
+ "required": false;
85
+ };
86
+ "csrfHeader": {
87
+ "alias": "csrfHeader";
88
+ "required": false;
89
+ };
90
+ "paymentWizard": {
91
+ "alias": "paymentWizard";
92
+ "required": false;
93
+ };
94
+ "decodeLinkUrl": {
95
+ "alias": "decodeLinkUrl";
96
+ "required": false;
97
+ };
98
+ "themeToggle": {
99
+ "alias": "themeToggle";
100
+ "required": false;
101
+ };
102
+ "defaultTheme": {
103
+ "alias": "defaultTheme";
104
+ "required": false;
105
+ };
106
+ "storageKey": {
107
+ "alias": "storageKey";
108
+ "required": false;
109
+ };
110
+ "metadata": {
111
+ "alias": "metadata";
112
+ "required": false;
113
+ };
114
+ "syncUrl": {
115
+ "alias": "syncUrl";
116
+ "required": false;
117
+ };
118
+ "resumePathPrefix": {
119
+ "alias": "resumePathPrefix";
120
+ "required": false;
121
+ };
122
+ "routeReference": {
123
+ "alias": "routeReference";
124
+ "required": false;
125
+ };
126
+ "resumePaymentHash": {
127
+ "alias": "resumePaymentHash";
128
+ "required": false;
129
+ };
130
+ "resumePaymentRail": {
131
+ "alias": "resumePaymentRail";
132
+ "required": false;
133
+ };
134
+ "resumable": {
135
+ "alias": "resumable";
136
+ "required": false;
137
+ };
138
+ "onCopy": {
139
+ "alias": "onCopy";
140
+ "required": false;
141
+ };
142
+ "onOpenWallet": {
143
+ "alias": "onOpenWallet";
144
+ "required": false;
145
+ };
146
+ "onState": {
147
+ "alias": "onState";
148
+ "required": false;
149
+ };
150
+ "onSettled": {
151
+ "alias": "onSettled";
152
+ "required": false;
153
+ };
154
+ "onProviderCopy": {
155
+ "alias": "onProviderCopy";
156
+ "required": false;
157
+ };
158
+ "onStartOver": {
159
+ "alias": "onStartOver";
160
+ "required": false;
161
+ };
162
+ "onError": {
163
+ "alias": "onError";
164
+ "required": false;
165
+ };
166
+ "options": {
167
+ "alias": "options";
168
+ "required": false;
169
+ };
170
+ }, {}, never, never, true, never>;
171
+ }
@@ -1 +1 @@
1
- export * from '@openreceive/elements/wrapper-shared';
1
+ export * from "@openreceive/elements/wrapper-shared";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openreceive/angular",
3
- "version": "0.4.17",
3
+ "version": "0.4.18",
4
4
  "description": "Angular component for Bitcoin Lightning checkout and optional USDT, USDC, SOL and ETH swaps.",
5
5
  "keywords": [
6
6
  "bitcoin",
@@ -20,8 +20,8 @@
20
20
  "module": "./dist/fesm2022/openreceive-angular.mjs",
21
21
  "types": "./dist/types/openreceive-angular.d.ts",
22
22
  "dependencies": {
23
- "@openreceive/browser": "0.4.17",
24
- "@openreceive/elements": "0.4.17"
23
+ "@openreceive/browser": "0.4.18",
24
+ "@openreceive/elements": "0.4.18"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@angular/core": ">=17.0.0"
@@ -1 +0,0 @@
1
- {"version":3,"file":"openreceive-angular.mjs","sources":["../../src/index.ts","../../src/openreceive-angular.ts"],"sourcesContent":["// @openreceive/angular — thin wrapper over the OpenReceive checkout\n// custom element. The component ships on the ./checkout-component subpath;\n// the wrapper surface is implemented once in\n// @openreceive/elements/wrapper-shared.\n// tools/validate/check-public-api.mjs pins this surface.\nexport * from \"@openreceive/elements/wrapper-shared\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;ACJA;;AAEG"}