@revenuecat/purchases-js 0.0.17 → 0.0.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.
@@ -0,0 +1,4832 @@
1
+ var Rt = Object.defineProperty;
2
+ var Ut = (t, e, r) => e in t ? Rt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var D = (t, e, r) => (Ut(t, typeof e != "symbol" ? e + "" : e, r), r);
4
+ function Ct(t) {
5
+ return t != null;
6
+ }
7
+ var St = /* @__PURE__ */ ((t) => (t.Unknown = "unknown", t.Custom = "custom", t.Lifetime = "$rc_lifetime", t.Annual = "$rc_annual", t.SixMonth = "$rc_six_month", t.ThreeMonth = "$rc_three_month", t.TwoMonth = "$rc_two_month", t.Monthly = "$rc_monthly", t.Weekly = "$rc_weekly", t))(St || {});
8
+ const Ot = (t, e) => ({
9
+ identifier: t.identifier,
10
+ displayName: t.title,
11
+ currentPrice: t.current_price,
12
+ normalPeriodDuration: t.normal_period_duration,
13
+ presentedOfferingIdentifier: e
14
+ }), Lt = (t, e, r) => {
15
+ const n = r[e.platform_product_identifier];
16
+ return n === void 0 ? null : {
17
+ identifier: e.identifier,
18
+ rcBillingProduct: Ot(n, t),
19
+ packageType: Ft(e.identifier)
20
+ };
21
+ }, je = (t, e) => {
22
+ const r = t.packages.map(
23
+ (i) => Lt(t.identifier, i, e)
24
+ ).filter(Ct), n = {};
25
+ for (const i of r)
26
+ i != null && (n[i.identifier] = i);
27
+ return r.length == 0 ? null : {
28
+ identifier: t.identifier,
29
+ serverDescription: t.description,
30
+ metadata: t.metadata,
31
+ packagesById: n,
32
+ availablePackages: r,
33
+ lifetime: n.$rc_lifetime ?? null,
34
+ annual: n.$rc_annual ?? null,
35
+ sixMonth: n.$rc_six_month ?? null,
36
+ threeMonth: n.$rc_three_month ?? null,
37
+ twoMonth: n.$rc_two_month ?? null,
38
+ monthly: n.$rc_monthly ?? null,
39
+ weekly: n.$rc_weekly ?? null
40
+ };
41
+ };
42
+ function Ft(t) {
43
+ switch (t) {
44
+ case "$rc_lifetime":
45
+ return "$rc_lifetime";
46
+ case "$rc_annual":
47
+ return "$rc_annual";
48
+ case "$rc_six_month":
49
+ return "$rc_six_month";
50
+ case "$rc_three_month":
51
+ return "$rc_three_month";
52
+ case "$rc_two_month":
53
+ return "$rc_two_month";
54
+ case "$rc_monthly":
55
+ return "$rc_monthly";
56
+ case "$rc_weekly":
57
+ return "$rc_weekly";
58
+ default:
59
+ return t.startsWith("$rc_") ? "unknown" : "custom";
60
+ }
61
+ }
62
+ function v() {
63
+ }
64
+ function Gt(t, e) {
65
+ for (const r in e)
66
+ t[r] = e[r];
67
+ return (
68
+ /** @type {T & S} */
69
+ t
70
+ );
71
+ }
72
+ function At(t) {
73
+ return t();
74
+ }
75
+ function Je() {
76
+ return /* @__PURE__ */ Object.create(null);
77
+ }
78
+ function he(t) {
79
+ t.forEach(At);
80
+ }
81
+ function te(t) {
82
+ return typeof t == "function";
83
+ }
84
+ function R(t, e) {
85
+ return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function";
86
+ }
87
+ let Ie;
88
+ function q(t, e) {
89
+ return t === e ? !0 : (Ie || (Ie = document.createElement("a")), Ie.href = e, t === Ie.href);
90
+ }
91
+ function xe(t) {
92
+ return t.split(",").map((e) => e.trim().split(" ").filter(Boolean));
93
+ }
94
+ function Yt(t, e) {
95
+ const r = xe(t.srcset), n = xe(e || "");
96
+ return n.length === r.length && n.every(
97
+ ([i, s], l) => s === r[l][1] && // We need to test both ways because Vite will create an a full URL with
98
+ // `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the
99
+ // relative URLs inside srcset are not automatically resolved to absolute URLs by
100
+ // browsers (in contrast to img.src). This means both SSR and DOM code could
101
+ // contain relative or absolute URLs.
102
+ (q(r[l][0], i) || q(i, r[l][0]))
103
+ );
104
+ }
105
+ function Ht(t) {
106
+ return Object.keys(t).length === 0;
107
+ }
108
+ function J(t, e, r, n) {
109
+ if (t) {
110
+ const i = _t(t, e, r, n);
111
+ return t[0](i);
112
+ }
113
+ }
114
+ function _t(t, e, r, n) {
115
+ return t[1] && n ? Gt(r.ctx.slice(), t[1](n(e))) : r.ctx;
116
+ }
117
+ function x(t, e, r, n) {
118
+ if (t[2] && n) {
119
+ const i = t[2](n(r));
120
+ if (e.dirty === void 0)
121
+ return i;
122
+ if (typeof i == "object") {
123
+ const s = [], l = Math.max(e.dirty.length, i.length);
124
+ for (let o = 0; o < l; o += 1)
125
+ s[o] = e.dirty[o] | i[o];
126
+ return s;
127
+ }
128
+ return e.dirty | i;
129
+ }
130
+ return e.dirty;
131
+ }
132
+ function V(t, e, r, n, i, s) {
133
+ if (i) {
134
+ const l = _t(e, r, n, s);
135
+ t.p(l, i);
136
+ }
137
+ }
138
+ function W(t) {
139
+ if (t.ctx.length > 32) {
140
+ const e = [], r = t.ctx.length / 32;
141
+ for (let n = 0; n < r; n++)
142
+ e[n] = -1;
143
+ return e;
144
+ }
145
+ return -1;
146
+ }
147
+ function _e(t) {
148
+ return t ?? "";
149
+ }
150
+ function T(t, e) {
151
+ t.appendChild(e);
152
+ }
153
+ function O(t, e, r) {
154
+ const n = Kt(t);
155
+ if (!n.getElementById(e)) {
156
+ const i = $("style");
157
+ i.id = e, i.textContent = r, jt(n, i);
158
+ }
159
+ }
160
+ function Kt(t) {
161
+ if (!t)
162
+ return document;
163
+ const e = t.getRootNode ? t.getRootNode() : t.ownerDocument;
164
+ return e && /** @type {ShadowRoot} */
165
+ e.host ? (
166
+ /** @type {ShadowRoot} */
167
+ e
168
+ ) : t.ownerDocument;
169
+ }
170
+ function jt(t, e) {
171
+ return T(
172
+ /** @type {Document} */
173
+ t.head || t,
174
+ e
175
+ ), e.sheet;
176
+ }
177
+ function g(t, e, r) {
178
+ t.insertBefore(e, r || null);
179
+ }
180
+ function m(t) {
181
+ t.parentNode && t.parentNode.removeChild(t);
182
+ }
183
+ function $(t) {
184
+ return document.createElement(t);
185
+ }
186
+ function L(t) {
187
+ return document.createTextNode(t);
188
+ }
189
+ function P() {
190
+ return L(" ");
191
+ }
192
+ function ne() {
193
+ return L("");
194
+ }
195
+ function Ee(t, e, r, n) {
196
+ return t.addEventListener(e, r, n), () => t.removeEventListener(e, r, n);
197
+ }
198
+ function pt(t) {
199
+ return function(e) {
200
+ return e.preventDefault(), t.call(this, e);
201
+ };
202
+ }
203
+ function h(t, e, r) {
204
+ r == null ? t.removeAttribute(e) : t.getAttribute(e) !== r && t.setAttribute(e, r);
205
+ }
206
+ const Jt = ["width", "height"];
207
+ function xt(t, e) {
208
+ const r = Object.getOwnPropertyDescriptors(t.__proto__);
209
+ for (const n in e)
210
+ e[n] == null ? t.removeAttribute(n) : n === "style" ? t.style.cssText = e[n] : n === "__value" ? t.value = t[n] = e[n] : r[n] && r[n].set && Jt.indexOf(n) === -1 ? t[n] = e[n] : h(t, n, e[n]);
211
+ }
212
+ function Vt(t, e) {
213
+ Object.keys(e).forEach((r) => {
214
+ Wt(t, r, e[r]);
215
+ });
216
+ }
217
+ function Wt(t, e, r) {
218
+ const n = e.toLowerCase();
219
+ n in t ? t[n] = typeof t[n] == "boolean" && r === "" ? !0 : r : e in t ? t[e] = typeof t[e] == "boolean" && r === "" ? !0 : r : h(t, e, r);
220
+ }
221
+ function qt(t) {
222
+ return /-/.test(t) ? Vt : xt;
223
+ }
224
+ function zt(t) {
225
+ return Array.from(t.childNodes);
226
+ }
227
+ function le(t, e) {
228
+ e = "" + e, t.data !== e && (t.data = /** @type {string} */
229
+ e);
230
+ }
231
+ function Ve(t, e) {
232
+ t.value = e ?? "";
233
+ }
234
+ function Xt(t, e, { bubbles: r = !1, cancelable: n = !1 } = {}) {
235
+ return new CustomEvent(t, { detail: e, bubbles: r, cancelable: n });
236
+ }
237
+ let pe;
238
+ function Ae(t) {
239
+ pe = t;
240
+ }
241
+ function Me() {
242
+ if (!pe)
243
+ throw new Error("Function called outside component initialization");
244
+ return pe;
245
+ }
246
+ function Te(t) {
247
+ Me().$$.on_mount.push(t);
248
+ }
249
+ function Zt() {
250
+ const t = Me();
251
+ return (e, r, { cancelable: n = !1 } = {}) => {
252
+ const i = t.$$.callbacks[e];
253
+ if (i) {
254
+ const s = Xt(
255
+ /** @type {string} */
256
+ e,
257
+ r,
258
+ { cancelable: n }
259
+ );
260
+ return i.slice().forEach((l) => {
261
+ l.call(t, s);
262
+ }), !s.defaultPrevented;
263
+ }
264
+ return !0;
265
+ };
266
+ }
267
+ function en(t, e) {
268
+ return Me().$$.context.set(t, e), e;
269
+ }
270
+ function tn(t) {
271
+ return Me().$$.context.get(t);
272
+ }
273
+ function ht(t, e) {
274
+ const r = t.$$.callbacks[e.type];
275
+ r && r.slice().forEach((n) => n.call(this, e));
276
+ }
277
+ const se = [], ve = [];
278
+ let oe = [];
279
+ const Le = [], nn = /* @__PURE__ */ Promise.resolve();
280
+ let Fe = !1;
281
+ function rn() {
282
+ Fe || (Fe = !0, nn.then(Et));
283
+ }
284
+ function Ge(t) {
285
+ oe.push(t);
286
+ }
287
+ function sn(t) {
288
+ Le.push(t);
289
+ }
290
+ const Ce = /* @__PURE__ */ new Set();
291
+ let re = 0;
292
+ function Et() {
293
+ if (re !== 0)
294
+ return;
295
+ const t = pe;
296
+ do {
297
+ try {
298
+ for (; re < se.length; ) {
299
+ const e = se[re];
300
+ re++, Ae(e), ln(e.$$);
301
+ }
302
+ } catch (e) {
303
+ throw se.length = 0, re = 0, e;
304
+ }
305
+ for (Ae(null), se.length = 0, re = 0; ve.length; )
306
+ ve.pop()();
307
+ for (let e = 0; e < oe.length; e += 1) {
308
+ const r = oe[e];
309
+ Ce.has(r) || (Ce.add(r), r());
310
+ }
311
+ oe.length = 0;
312
+ } while (se.length);
313
+ for (; Le.length; )
314
+ Le.pop()();
315
+ Fe = !1, Ce.clear(), Ae(t);
316
+ }
317
+ function ln(t) {
318
+ if (t.fragment !== null) {
319
+ t.update(), he(t.before_update);
320
+ const e = t.dirty;
321
+ t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, e), t.after_update.forEach(Ge);
322
+ }
323
+ }
324
+ function on(t) {
325
+ const e = [], r = [];
326
+ oe.forEach((n) => t.indexOf(n) === -1 ? e.push(n) : r.push(n)), r.forEach((n) => n()), oe = e;
327
+ }
328
+ const ke = /* @__PURE__ */ new Set();
329
+ let Z;
330
+ function F() {
331
+ Z = {
332
+ r: 0,
333
+ c: [],
334
+ p: Z
335
+ // parent group
336
+ };
337
+ }
338
+ function G() {
339
+ Z.r || he(Z.c), Z = Z.p;
340
+ }
341
+ function a(t, e) {
342
+ t && t.i && (ke.delete(t), t.i(e));
343
+ }
344
+ function f(t, e, r, n) {
345
+ if (t && t.o) {
346
+ if (ke.has(t))
347
+ return;
348
+ ke.add(t), Z.c.push(() => {
349
+ ke.delete(t), n && (r && t.d(1), n());
350
+ }), t.o(e);
351
+ } else
352
+ n && n();
353
+ }
354
+ function cn(t, e, r) {
355
+ const n = t.$$.props[e];
356
+ n !== void 0 && (t.$$.bound[n] = r, r(t.$$.ctx[n]));
357
+ }
358
+ function w(t) {
359
+ t && t.c();
360
+ }
361
+ function E(t, e, r) {
362
+ const { fragment: n, after_update: i } = t.$$;
363
+ n && n.m(e, r), Ge(() => {
364
+ const s = t.$$.on_mount.map(At).filter(te);
365
+ t.$$.on_destroy ? t.$$.on_destroy.push(...s) : he(s), t.$$.on_mount = [];
366
+ }), i.forEach(Ge);
367
+ }
368
+ function I(t, e) {
369
+ const r = t.$$;
370
+ r.fragment !== null && (on(r.after_update), he(r.on_destroy), r.fragment && r.fragment.d(e), r.on_destroy = r.fragment = null, r.ctx = []);
371
+ }
372
+ function an(t, e) {
373
+ t.$$.dirty[0] === -1 && (se.push(t), rn(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31;
374
+ }
375
+ function U(t, e, r, n, i, s, l = null, o = [-1]) {
376
+ const c = pe;
377
+ Ae(t);
378
+ const u = t.$$ = {
379
+ fragment: null,
380
+ ctx: [],
381
+ // state
382
+ props: s,
383
+ update: v,
384
+ not_equal: i,
385
+ bound: Je(),
386
+ // lifecycle
387
+ on_mount: [],
388
+ on_destroy: [],
389
+ on_disconnect: [],
390
+ before_update: [],
391
+ after_update: [],
392
+ context: new Map(e.context || (c ? c.$$.context : [])),
393
+ // everything else
394
+ callbacks: Je(),
395
+ dirty: o,
396
+ skip_bound: !1,
397
+ root: e.target || c.$$.root
398
+ };
399
+ l && l(u.root);
400
+ let _ = !1;
401
+ if (u.ctx = r ? r(t, e.props || {}, (A, k, ...B) => {
402
+ const b = B.length ? B[0] : k;
403
+ return u.ctx && i(u.ctx[A], u.ctx[A] = b) && (!u.skip_bound && u.bound[A] && u.bound[A](b), _ && an(t, A)), k;
404
+ }) : [], u.update(), _ = !0, he(u.before_update), u.fragment = n ? n(u.ctx) : !1, e.target) {
405
+ if (e.hydrate) {
406
+ const A = zt(e.target);
407
+ u.fragment && u.fragment.l(A), A.forEach(m);
408
+ } else
409
+ u.fragment && u.fragment.c();
410
+ e.intro && a(t.$$.fragment), E(t, e.target, e.anchor), Et();
411
+ }
412
+ Ae(c);
413
+ }
414
+ class C {
415
+ constructor() {
416
+ /**
417
+ * ### PRIVATE API
418
+ *
419
+ * Do not use, may change at any time
420
+ *
421
+ * @type {any}
422
+ */
423
+ D(this, "$$");
424
+ /**
425
+ * ### PRIVATE API
426
+ *
427
+ * Do not use, may change at any time
428
+ *
429
+ * @type {any}
430
+ */
431
+ D(this, "$$set");
432
+ }
433
+ /** @returns {void} */
434
+ $destroy() {
435
+ I(this, 1), this.$destroy = v;
436
+ }
437
+ /**
438
+ * @template {Extract<keyof Events, string>} K
439
+ * @param {K} type
440
+ * @param {((e: Events[K]) => void) | null | undefined} callback
441
+ * @returns {() => void}
442
+ */
443
+ $on(e, r) {
444
+ if (!te(r))
445
+ return v;
446
+ const n = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
447
+ return n.push(r), () => {
448
+ const i = n.indexOf(r);
449
+ i !== -1 && n.splice(i, 1);
450
+ };
451
+ }
452
+ /**
453
+ * @param {Partial<Props>} props
454
+ * @returns {void}
455
+ */
456
+ $set(e) {
457
+ this.$$set && !Ht(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
458
+ }
459
+ }
460
+ const un = "4";
461
+ typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(un);
462
+ function fn(t) {
463
+ O(t, "svelte-8uc6s0", "aside.svelte-8uc6s0{color:yellowgreen;font-weight:bold;text-transform:uppercase;padding:0.5rem 0;width:100%;font-size:0.75rem;border-radius:0.5rem}");
464
+ }
465
+ function dn(t) {
466
+ let e;
467
+ return {
468
+ c() {
469
+ e = $("aside"), e.innerHTML = "<span>Sandbox Mode</span>", h(e, "class", "svelte-8uc6s0");
470
+ },
471
+ m(r, n) {
472
+ g(r, e, n);
473
+ },
474
+ p: v,
475
+ i: v,
476
+ o: v,
477
+ d(r) {
478
+ r && m(e);
479
+ }
480
+ };
481
+ }
482
+ class mn extends C {
483
+ constructor(e) {
484
+ super(), U(this, e, null, dn, R, {}, fn);
485
+ }
486
+ }
487
+ function gn(t) {
488
+ O(t, "svelte-ujomz3", ".rcb-modal-section.svelte-ujomz3{padding:0.5rem 0rem;display:flex}.rcb-modal-section.svelte-ujomz3:last-of-type{padding:0}");
489
+ }
490
+ function Se(t) {
491
+ let e, r;
492
+ const n = (
493
+ /*#slots*/
494
+ t[2].default
495
+ ), i = J(
496
+ n,
497
+ t,
498
+ /*$$scope*/
499
+ t[1],
500
+ null
501
+ );
502
+ return {
503
+ c() {
504
+ e = $(
505
+ /*as*/
506
+ t[0]
507
+ ), i && i.c(), qt(
508
+ /*as*/
509
+ t[0]
510
+ )(e, {
511
+ class: _e("rcb-modal-section") + " svelte-ujomz3"
512
+ });
513
+ },
514
+ m(s, l) {
515
+ g(s, e, l), i && i.m(e, null), r = !0;
516
+ },
517
+ p(s, l) {
518
+ i && i.p && (!r || l & /*$$scope*/
519
+ 2) && V(
520
+ i,
521
+ n,
522
+ s,
523
+ /*$$scope*/
524
+ s[1],
525
+ r ? x(
526
+ n,
527
+ /*$$scope*/
528
+ s[1],
529
+ l,
530
+ null
531
+ ) : W(
532
+ /*$$scope*/
533
+ s[1]
534
+ ),
535
+ null
536
+ );
537
+ },
538
+ i(s) {
539
+ r || (a(i, s), r = !0);
540
+ },
541
+ o(s) {
542
+ f(i, s), r = !1;
543
+ },
544
+ d(s) {
545
+ s && m(e), i && i.d(s);
546
+ }
547
+ };
548
+ }
549
+ function An(t) {
550
+ let e = (
551
+ /*as*/
552
+ t[0]
553
+ ), r, n, i = (
554
+ /*as*/
555
+ t[0] && Se(t)
556
+ );
557
+ return {
558
+ c() {
559
+ i && i.c(), r = ne();
560
+ },
561
+ m(s, l) {
562
+ i && i.m(s, l), g(s, r, l), n = !0;
563
+ },
564
+ p(s, [l]) {
565
+ /*as*/
566
+ s[0] ? e ? R(
567
+ e,
568
+ /*as*/
569
+ s[0]
570
+ ) ? (i.d(1), i = Se(s), e = /*as*/
571
+ s[0], i.c(), i.m(r.parentNode, r)) : i.p(s, l) : (i = Se(s), e = /*as*/
572
+ s[0], i.c(), i.m(r.parentNode, r)) : e && (i.d(1), i = null, e = /*as*/
573
+ s[0]);
574
+ },
575
+ i(s) {
576
+ n || (a(i, s), n = !0);
577
+ },
578
+ o(s) {
579
+ f(i, s), n = !1;
580
+ },
581
+ d(s) {
582
+ s && m(r), i && i.d(s);
583
+ }
584
+ };
585
+ }
586
+ function _n(t, e, r) {
587
+ let { $$slots: n = {}, $$scope: i } = e, { as: s = "section" } = e;
588
+ return t.$$set = (l) => {
589
+ "as" in l && r(0, s = l.as), "$$scope" in l && r(1, i = l.$$scope);
590
+ }, [s, i, n];
591
+ }
592
+ class z extends C {
593
+ constructor(e) {
594
+ super(), U(this, e, _n, An, R, { as: 0 }, gn);
595
+ }
596
+ }
597
+ var H = /* @__PURE__ */ ((t) => (t[t.Silent = 0] = "Silent", t[t.Error = 1] = "Error", t[t.Warn = 2] = "Warn", t[t.Info = 3] = "Info", t[t.Debug = 4] = "Debug", t[t.Verbose = 5] = "Verbose", t))(H || {});
598
+ class j {
599
+ static setLogLevel(e) {
600
+ this.logLevel = e;
601
+ }
602
+ static log(e, r = this.logLevel) {
603
+ const n = `[Purchases] ${e}`;
604
+ if (!(this.logLevel < r || r === H.Silent))
605
+ switch (r) {
606
+ case H.Error:
607
+ console.error(n);
608
+ break;
609
+ case H.Warn:
610
+ console.warn(n);
611
+ break;
612
+ case H.Info:
613
+ console.info(n);
614
+ break;
615
+ case H.Debug:
616
+ console.debug(n);
617
+ break;
618
+ case H.Verbose:
619
+ console.debug(n);
620
+ break;
621
+ }
622
+ }
623
+ static errorLog(e) {
624
+ this.log(e, H.Error);
625
+ }
626
+ static warnLog(e) {
627
+ this.log(e, H.Warn);
628
+ }
629
+ static infoLog(e) {
630
+ this.log(e, H.Info);
631
+ }
632
+ static debugLog(e) {
633
+ this.log(e, H.Debug);
634
+ }
635
+ static verboseLog(e) {
636
+ this.log(e, H.Verbose);
637
+ }
638
+ }
639
+ D(j, "logLevel", H.Silent);
640
+ var me = /* @__PURE__ */ ((t) => (t.Year = "year", t.Month = "month", t.Week = "week", t.Day = "day", t))(me || {});
641
+ function pn(t) {
642
+ const e = t.match(/^PT?([0-9]+)([MDYW])$/);
643
+ if (!e || e.length < 3)
644
+ return j.errorLog(`Invalid ISO 8601 duration format: ${t}`), null;
645
+ const r = parseInt(e[1]);
646
+ switch (e[2]) {
647
+ case "Y":
648
+ return {
649
+ number: r,
650
+ unit: "year"
651
+ /* Year */
652
+ };
653
+ case "M":
654
+ return {
655
+ number: r,
656
+ unit: "month"
657
+ /* Month */
658
+ };
659
+ case "W":
660
+ return {
661
+ number: r,
662
+ unit: "week"
663
+ /* Week */
664
+ };
665
+ case "D":
666
+ return {
667
+ number: r,
668
+ unit: "day"
669
+ /* Day */
670
+ };
671
+ default:
672
+ return j.errorLog(`Invalid ISO 8601 unit duration format: ${t}`), null;
673
+ }
674
+ }
675
+ const We = (t, e) => {
676
+ const r = t / 100;
677
+ return new Intl.NumberFormat("en-US", {
678
+ style: "currency",
679
+ currency: e
680
+ }).format(r);
681
+ }, qe = (t) => {
682
+ const e = pn(t);
683
+ if (!e)
684
+ return "unknown";
685
+ const r = e.number;
686
+ if (r === 1)
687
+ switch (e.unit) {
688
+ case me.Year:
689
+ return "yearly";
690
+ case me.Month:
691
+ return "monthly";
692
+ case me.Week:
693
+ return "weekly";
694
+ case me.Day:
695
+ return "daily";
696
+ }
697
+ else
698
+ return `every ${r} ${e.unit}s`;
699
+ };
700
+ function hn(t) {
701
+ O(t, "svelte-1oa6nu8", ".rcb-pricing-info.svelte-1oa6nu8{display:flex;flex-direction:column;height:10rem;justify-content:flex-end}.rcb-product-price.svelte-1oa6nu8{font-size:1.5rem}.rcb-product-duration.svelte-1oa6nu8{opacity:0.6}");
702
+ }
703
+ function En(t) {
704
+ let e, r, n = (
705
+ /*productDetails*/
706
+ t[0].displayName + ""
707
+ ), i, s, l, o = (
708
+ /*productDetails*/
709
+ t[0].currentPrice.currency + ""
710
+ ), c, u = " ", _, A = We(
711
+ /*productDetails*/
712
+ t[0].currentPrice.amount,
713
+ /*productDetails*/
714
+ t[0].currentPrice.currency
715
+ ) + "", k, B, b, y, M = qe(
716
+ /*productDetails*/
717
+ t[0].normalPeriodDuration
718
+ ) + "", N;
719
+ return {
720
+ c() {
721
+ e = $("div"), r = $("span"), i = L(n), s = P(), l = $("span"), c = L(o), _ = L(u), k = L(A), B = P(), b = $("span"), y = L("Billed "), N = L(M), h(l, "class", "rcb-product-price svelte-1oa6nu8"), h(b, "class", "rcb-product-duration svelte-1oa6nu8"), h(e, "class", "rcb-pricing-info svelte-1oa6nu8");
722
+ },
723
+ m(d, p) {
724
+ g(d, e, p), T(e, r), T(r, i), T(e, s), T(e, l), T(l, c), T(l, _), T(l, k), T(e, B), T(e, b), T(b, y), T(b, N);
725
+ },
726
+ p(d, p) {
727
+ p & /*productDetails*/
728
+ 1 && n !== (n = /*productDetails*/
729
+ d[0].displayName + "") && le(i, n), p & /*productDetails*/
730
+ 1 && o !== (o = /*productDetails*/
731
+ d[0].currentPrice.currency + "") && le(c, o), p & /*productDetails*/
732
+ 1 && A !== (A = We(
733
+ /*productDetails*/
734
+ d[0].currentPrice.amount,
735
+ /*productDetails*/
736
+ d[0].currentPrice.currency
737
+ ) + "") && le(k, A), p & /*productDetails*/
738
+ 1 && M !== (M = qe(
739
+ /*productDetails*/
740
+ d[0].normalPeriodDuration
741
+ ) + "") && le(N, M);
742
+ },
743
+ d(d) {
744
+ d && m(e);
745
+ }
746
+ };
747
+ }
748
+ function In(t) {
749
+ let e, r;
750
+ return e = new z({
751
+ props: {
752
+ $$slots: { default: [En] },
753
+ $$scope: { ctx: t }
754
+ }
755
+ }), {
756
+ c() {
757
+ w(e.$$.fragment);
758
+ },
759
+ m(n, i) {
760
+ E(e, n, i), r = !0;
761
+ },
762
+ p(n, [i]) {
763
+ const s = {};
764
+ i & /*$$scope, productDetails*/
765
+ 3 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s);
766
+ },
767
+ i(n) {
768
+ r || (a(e.$$.fragment, n), r = !0);
769
+ },
770
+ o(n) {
771
+ f(e.$$.fragment, n), r = !1;
772
+ },
773
+ d(n) {
774
+ I(e, n);
775
+ }
776
+ };
777
+ }
778
+ function wn(t, e, r) {
779
+ let { productDetails: n } = e;
780
+ return t.$$set = (i) => {
781
+ "productDetails" in i && r(0, n = i.productDetails);
782
+ }, [n];
783
+ }
784
+ class It extends C {
785
+ constructor(e) {
786
+ super(), U(this, e, wn, In, R, { productDetails: 0 }, hn);
787
+ }
788
+ }
789
+ const bn = "data:image/gif;base64,R0lGODlhMgAyAPcBAAAAAAD/AAMDAwcHBxERERUVFSoqKi0tLTAwMDg4OD09PURERElJSUtLS1BQUFJSUlVVVVdXV1paWl9fX2NjY2ZmZmlpaWxsbG1tbXNzc3t7e39/f4GBgYKCgoSEhIaGhoeHh4iIiIuLi5KSkpSUlJaWlp2dnaGhoaOjo6SkpKWlpaenp6ioqKqqqqurq6ysrLCwsLGxsbS0tLa2tri4uLm5ub29vb6+vsDAwMHBwcLCwsXFxcjIyMnJyc3Nzc7OztPT09TU1NXV1dfX19nZ2dra2tvb29zc3N7e3uDg4OHh4eLi4uPj4+fn5+np6ezs7O7u7vDw8PHx8fLy8vPz8/X19fb29vj4+Pn5+fz8/P39/f7+/v///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFBAABACwAAAAAMgAyAIcAAAAA/wADAwMHBwcREREVFRUqKiotLS0wMDA4ODg9PT1ERERJSUlLS0tQUFBSUlJVVVVXV1daWlpfX19jY2NmZmZpaWlsbGxtbW1zc3N7e3t/f3+BgYGCgoKEhISGhoaHh4eIiIiLi4uSkpKUlJSWlpadnZ2hoaGjo6OkpKSlpaWnp6eoqKiqqqqrq6usrKywsLCxsbG0tLS2tra4uLi5ubm9vb2+vr7AwMDBwcHCwsLFxcXIyMjJycnNzc3Ozs7T09PU1NTV1dXX19fZ2dna2trb29vc3Nze3t7g4ODh4eHi4uLj4+Pn5+fp6ens7Ozu7u7w8PDx8fHy8vLz8/P19fX29vb4+Pj5+fn8/Pz9/f3+/v7///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8I/wCzcBFIcKDBgggPKkzIcCEXLlq4bIEokeLEiBcrYrTIcaNHjRobinQ4sqRCkBlTdtR44MBKlR9TmjQJQMBMkgZfdpwSMSYAACgpRtHpcSYSFUIa1mz448UQnAWDfmzSooUVmD9XVnnBwglMlDdvvMjhcOlCHit23CSqcUrVJiizpnTC4sXQmB1vZvmxwgYWhWYLznjRA+rJryqvxGhxxGNLjkVcwMCCN6ZeLkNevDCcRYYKJJfZptyCQwdiijl0CDxdlLPryw2lymY9WzTs17ijVq69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";
790
+ function $n(t) {
791
+ let e, r;
792
+ return {
793
+ c() {
794
+ e = $("img"), q(e.src, r = bn) || h(e, "src", r), h(e, "alt", "spinner");
795
+ },
796
+ m(n, i) {
797
+ g(n, e, i);
798
+ },
799
+ p: v,
800
+ i: v,
801
+ o: v,
802
+ d(n) {
803
+ n && m(e);
804
+ }
805
+ };
806
+ }
807
+ class kn extends C {
808
+ constructor(e) {
809
+ super(), U(this, e, null, $n, R, {});
810
+ }
811
+ }
812
+ function Bn(t) {
813
+ O(t, "svelte-4wmtg7", ".rcb-modal-loader.svelte-4wmtg7{width:100%;min-height:10rem;display:flex;justify-content:center;align-items:center}");
814
+ }
815
+ function yn(t) {
816
+ let e, r, n;
817
+ return r = new kn({}), {
818
+ c() {
819
+ e = $("div"), w(r.$$.fragment), h(e, "class", "rcb-modal-loader svelte-4wmtg7");
820
+ },
821
+ m(i, s) {
822
+ g(i, e, s), E(r, e, null), n = !0;
823
+ },
824
+ p: v,
825
+ i(i) {
826
+ n || (a(r.$$.fragment, i), n = !0);
827
+ },
828
+ o(i) {
829
+ f(r.$$.fragment, i), n = !1;
830
+ },
831
+ d(i) {
832
+ i && m(e), I(r);
833
+ }
834
+ };
835
+ }
836
+ class Pe extends C {
837
+ constructor(e) {
838
+ super(), U(this, e, null, yn, R, {}, Bn);
839
+ }
840
+ }
841
+ var ge = /* @__PURE__ */ ((t) => (t.Started = "started", t.InProgress = "in_progress", t.Succeeded = "succeeded", t.Failed = "failed", t))(ge || {}), Be = /* @__PURE__ */ ((t) => (t[t.SetupIntentCreationFailed = 1] = "SetupIntentCreationFailed", t[t.PaymentMethodCreationFailed = 2] = "PaymentMethodCreationFailed", t[t.PaymentChargeFailed = 3] = "PaymentChargeFailed", t))(Be || {}), S = /* @__PURE__ */ ((t) => (t[t.ErrorSettingUpPurchase = 0] = "ErrorSettingUpPurchase", t[t.ErrorChargingPayment = 1] = "ErrorChargingPayment", t[t.UnknownError = 2] = "UnknownError", t[t.NetworkError = 3] = "NetworkError", t[t.StripeError = 4] = "StripeError", t[t.MissingEmailError = 5] = "MissingEmailError", t))(S || {});
842
+ class Y extends Error {
843
+ constructor(e, r, n) {
844
+ super(r), this.errorCode = e, this.underlyingErrorMessage = n;
845
+ }
846
+ }
847
+ class Dn {
848
+ constructor(e, r = 10) {
849
+ D(this, "operationSessionId", null);
850
+ D(this, "backend");
851
+ D(this, "maxNumberAttempts");
852
+ D(this, "waitMSBetweenAttempts", 1e3);
853
+ this.backend = e, this.maxNumberAttempts = r;
854
+ }
855
+ async startPurchase(e, r, n) {
856
+ const i = await this.backend.postSubscribe(
857
+ e,
858
+ r,
859
+ n
860
+ );
861
+ return this.operationSessionId = i.operation_session_id, i;
862
+ }
863
+ async pollCurrentPurchaseForCompletion() {
864
+ const e = this.operationSessionId;
865
+ if (!e)
866
+ throw new Y(
867
+ 0,
868
+ "No purchase in progress"
869
+ );
870
+ return new Promise((r, n) => {
871
+ const i = (s = 1) => {
872
+ if (s > this.maxNumberAttempts) {
873
+ this.clearPurchaseInProgress(), n(
874
+ new Y(
875
+ 2,
876
+ "Max attempts reached trying to get successful purchase status"
877
+ )
878
+ );
879
+ return;
880
+ }
881
+ this.backend.getCheckoutStatus(e).then((l) => {
882
+ switch (l.operation.status) {
883
+ case ge.Started:
884
+ case ge.InProgress:
885
+ setTimeout(
886
+ () => i(s + 1),
887
+ this.waitMSBetweenAttempts
888
+ );
889
+ break;
890
+ case ge.Succeeded:
891
+ this.clearPurchaseInProgress(), r();
892
+ return;
893
+ case ge.Failed:
894
+ this.clearPurchaseInProgress(), this.handlePaymentError(
895
+ l.operation.error,
896
+ n
897
+ );
898
+ }
899
+ }).catch((l) => {
900
+ n(
901
+ new Y(
902
+ 3,
903
+ l.message
904
+ )
905
+ );
906
+ });
907
+ };
908
+ i();
909
+ });
910
+ }
911
+ clearPurchaseInProgress() {
912
+ this.operationSessionId = null;
913
+ }
914
+ handlePaymentError(e, r) {
915
+ if (e == null) {
916
+ r(
917
+ new Y(
918
+ 2,
919
+ "Got an error status but error field is empty."
920
+ )
921
+ );
922
+ return;
923
+ }
924
+ switch (e.code) {
925
+ case Be.SetupIntentCreationFailed:
926
+ r(
927
+ new Y(
928
+ 0,
929
+ "Setup intent creation failed"
930
+ )
931
+ );
932
+ return;
933
+ case Be.PaymentMethodCreationFailed:
934
+ r(
935
+ new Y(
936
+ 0,
937
+ "Payment method creation failed"
938
+ )
939
+ );
940
+ return;
941
+ case Be.PaymentChargeFailed:
942
+ r(
943
+ new Y(
944
+ 1,
945
+ "Payment charge failed"
946
+ )
947
+ );
948
+ return;
949
+ }
950
+ }
951
+ }
952
+ function vn(t) {
953
+ O(t, "svelte-igat39", "button.svelte-igat39{border:none;border-radius:3.5rem;font-size:1rem;cursor:pointer;height:3.5rem;color:black;background-color:#dfdfdf}button.intent-primary.svelte-igat39{background-color:#000;color:white;font-size:1rem}");
954
+ }
955
+ function Qn(t) {
956
+ let e, r, n, i, s;
957
+ const l = (
958
+ /*#slots*/
959
+ t[3].default
960
+ ), o = J(
961
+ l,
962
+ t,
963
+ /*$$scope*/
964
+ t[2],
965
+ null
966
+ );
967
+ return {
968
+ c() {
969
+ e = $("button"), o && o.c(), h(e, "class", r = _e(`intent-${/*intent*/
970
+ t[0]}`) + " svelte-igat39"), e.disabled = /*disabled*/
971
+ t[1];
972
+ },
973
+ m(c, u) {
974
+ g(c, e, u), o && o.m(e, null), n = !0, i || (s = Ee(
975
+ e,
976
+ "click",
977
+ /*click_handler*/
978
+ t[4]
979
+ ), i = !0);
980
+ },
981
+ p(c, [u]) {
982
+ o && o.p && (!n || u & /*$$scope*/
983
+ 4) && V(
984
+ o,
985
+ l,
986
+ c,
987
+ /*$$scope*/
988
+ c[2],
989
+ n ? x(
990
+ l,
991
+ /*$$scope*/
992
+ c[2],
993
+ u,
994
+ null
995
+ ) : W(
996
+ /*$$scope*/
997
+ c[2]
998
+ ),
999
+ null
1000
+ ), (!n || u & /*intent*/
1001
+ 1 && r !== (r = _e(`intent-${/*intent*/
1002
+ c[0]}`) + " svelte-igat39")) && h(e, "class", r), (!n || u & /*disabled*/
1003
+ 2) && (e.disabled = /*disabled*/
1004
+ c[1]);
1005
+ },
1006
+ i(c) {
1007
+ n || (a(o, c), n = !0);
1008
+ },
1009
+ o(c) {
1010
+ f(o, c), n = !1;
1011
+ },
1012
+ d(c) {
1013
+ c && m(e), o && o.d(c), i = !1, s();
1014
+ }
1015
+ };
1016
+ }
1017
+ function Mn(t, e, r) {
1018
+ let { $$slots: n = {}, $$scope: i } = e, { intent: s = "primary" } = e, { disabled: l = !1 } = e;
1019
+ function o(c) {
1020
+ ht.call(this, t, c);
1021
+ }
1022
+ return t.$$set = (c) => {
1023
+ "intent" in c && r(0, s = c.intent), "disabled" in c && r(1, l = c.disabled), "$$scope" in c && r(2, i = c.$$scope);
1024
+ }, [s, l, i, n, o];
1025
+ }
1026
+ class ce extends C {
1027
+ constructor(e) {
1028
+ super(), U(this, e, Mn, Qn, R, { intent: 0, disabled: 1 }, vn);
1029
+ }
1030
+ }
1031
+ function Tn(t) {
1032
+ O(t, "svelte-1f9z0o8", "footer.svelte-1f9z0o8{display:flex;flex-direction:column}");
1033
+ }
1034
+ function Pn(t) {
1035
+ let e, r;
1036
+ const n = (
1037
+ /*#slots*/
1038
+ t[1].default
1039
+ ), i = J(
1040
+ n,
1041
+ t,
1042
+ /*$$scope*/
1043
+ t[0],
1044
+ null
1045
+ );
1046
+ return {
1047
+ c() {
1048
+ e = $("footer"), i && i.c(), h(e, "class", "rcb-modal-footer svelte-1f9z0o8");
1049
+ },
1050
+ m(s, l) {
1051
+ g(s, e, l), i && i.m(e, null), r = !0;
1052
+ },
1053
+ p(s, [l]) {
1054
+ i && i.p && (!r || l & /*$$scope*/
1055
+ 1) && V(
1056
+ i,
1057
+ n,
1058
+ s,
1059
+ /*$$scope*/
1060
+ s[0],
1061
+ r ? x(
1062
+ n,
1063
+ /*$$scope*/
1064
+ s[0],
1065
+ l,
1066
+ null
1067
+ ) : W(
1068
+ /*$$scope*/
1069
+ s[0]
1070
+ ),
1071
+ null
1072
+ );
1073
+ },
1074
+ i(s) {
1075
+ r || (a(i, s), r = !0);
1076
+ },
1077
+ o(s) {
1078
+ f(i, s), r = !1;
1079
+ },
1080
+ d(s) {
1081
+ s && m(e), i && i.d(s);
1082
+ }
1083
+ };
1084
+ }
1085
+ function Nn(t, e, r) {
1086
+ let { $$slots: n = {}, $$scope: i } = e;
1087
+ return t.$$set = (s) => {
1088
+ "$$scope" in s && r(0, i = s.$$scope);
1089
+ }, [i, n];
1090
+ }
1091
+ class Ne extends C {
1092
+ constructor(e) {
1093
+ super(), U(this, e, Nn, Pn, R, {}, Tn);
1094
+ }
1095
+ }
1096
+ const Rn = "data:image/svg+xml,%3csvg%20width='124'%20height='124'%20viewBox='0%200%20124%20124'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='62'%20cy='62'%20r='62'%20fill='%23767676'/%3e%3cpath%20d='M87.6668%2041.504L82.4968%2036.334L62.0002%2056.8307L41.5035%2036.334L36.3335%2041.504L56.8302%2062.0006L36.3335%2082.4973L41.5035%2087.6673L62.0002%2067.1706L82.4968%2087.6673L87.6668%2082.4973L67.1702%2062.0006L87.6668%2041.504Z'%20fill='white'/%3e%3c/svg%3e";
1097
+ function Un(t) {
1098
+ O(t, "svelte-7khg4b", "img.svelte-7khg4b{width:7.75rem;height:7.75rem;margin:0 auto}");
1099
+ }
1100
+ function Cn(t) {
1101
+ let e, r;
1102
+ return {
1103
+ c() {
1104
+ e = $("img"), q(e.src, r = Rn) || h(e, "src", r), h(e, "alt", "icon"), h(e, "class", "rcb-ui-asset-icon svelte-7khg4b");
1105
+ },
1106
+ m(n, i) {
1107
+ g(n, e, i);
1108
+ },
1109
+ p: v,
1110
+ i: v,
1111
+ o: v,
1112
+ d(n) {
1113
+ n && m(e);
1114
+ }
1115
+ };
1116
+ }
1117
+ class Sn extends C {
1118
+ constructor(e) {
1119
+ super(), U(this, e, null, Cn, R, {}, Un);
1120
+ }
1121
+ }
1122
+ function On(t) {
1123
+ O(t, "svelte-18njhoa", '.column.svelte-18njhoa{display:flex;flex-direction:column;justify-content:flex-start;gap:var(--gap, "0.5rem")}');
1124
+ }
1125
+ function Ln(t) {
1126
+ let e, r, n;
1127
+ const i = (
1128
+ /*#slots*/
1129
+ t[2].default
1130
+ ), s = J(
1131
+ i,
1132
+ t,
1133
+ /*$$scope*/
1134
+ t[1],
1135
+ null
1136
+ );
1137
+ return {
1138
+ c() {
1139
+ e = $("div"), s && s.c(), h(e, "class", "column svelte-18njhoa"), h(e, "style", r = `--gap:${/*gutter*/
1140
+ t[0]};`);
1141
+ },
1142
+ m(l, o) {
1143
+ g(l, e, o), s && s.m(e, null), n = !0;
1144
+ },
1145
+ p(l, [o]) {
1146
+ s && s.p && (!n || o & /*$$scope*/
1147
+ 2) && V(
1148
+ s,
1149
+ i,
1150
+ l,
1151
+ /*$$scope*/
1152
+ l[1],
1153
+ n ? x(
1154
+ i,
1155
+ /*$$scope*/
1156
+ l[1],
1157
+ o,
1158
+ null
1159
+ ) : W(
1160
+ /*$$scope*/
1161
+ l[1]
1162
+ ),
1163
+ null
1164
+ ), (!n || o & /*gutter*/
1165
+ 1 && r !== (r = `--gap:${/*gutter*/
1166
+ l[0]};`)) && h(e, "style", r);
1167
+ },
1168
+ i(l) {
1169
+ n || (a(s, l), n = !0);
1170
+ },
1171
+ o(l) {
1172
+ f(s, l), n = !1;
1173
+ },
1174
+ d(l) {
1175
+ l && m(e), s && s.d(l);
1176
+ }
1177
+ };
1178
+ }
1179
+ function Fn(t, e, r) {
1180
+ let { $$slots: n = {}, $$scope: i } = e, { gutter: s = "0.5rem" } = e;
1181
+ return t.$$set = (l) => {
1182
+ "gutter" in l && r(0, s = l.gutter), "$$scope" in l && r(1, i = l.$$scope);
1183
+ }, [s, i, n];
1184
+ }
1185
+ class X extends C {
1186
+ constructor(e) {
1187
+ super(), U(this, e, Fn, Ln, R, { gutter: 0 }, On);
1188
+ }
1189
+ }
1190
+ const Gn = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='mdi_close'%3e%3cpath%20id='Vector'%20d='M19%206.41L17.59%205L12%2010.59L6.41%205L5%206.41L10.59%2012L5%2017.59L6.41%2019L12%2013.41L17.59%2019L19%2017.59L13.41%2012L19%206.41Z'%20fill='%23767676'/%3e%3c/g%3e%3c/svg%3e";
1191
+ function Yn(t) {
1192
+ O(t, "svelte-r1ujja", ".close-button.svelte-r1ujja{border:none;cursor:pointer;background-color:transparent}");
1193
+ }
1194
+ function Hn(t) {
1195
+ let e, r, n, i, s;
1196
+ return {
1197
+ c() {
1198
+ e = $("button"), r = $("img"), q(r.src, n = Gn) || h(r, "src", n), h(r, "alt", "close"), h(e, "class", "close-button svelte-r1ujja"), e.disabled = /*disabled*/
1199
+ t[0];
1200
+ },
1201
+ m(l, o) {
1202
+ g(l, e, o), T(e, r), i || (s = Ee(
1203
+ e,
1204
+ "click",
1205
+ /*click_handler*/
1206
+ t[1]
1207
+ ), i = !0);
1208
+ },
1209
+ p(l, [o]) {
1210
+ o & /*disabled*/
1211
+ 1 && (e.disabled = /*disabled*/
1212
+ l[0]);
1213
+ },
1214
+ i: v,
1215
+ o: v,
1216
+ d(l) {
1217
+ l && m(e), i = !1, s();
1218
+ }
1219
+ };
1220
+ }
1221
+ function Kn(t, e, r) {
1222
+ let { disabled: n = !1 } = e;
1223
+ function i(s) {
1224
+ ht.call(this, t, s);
1225
+ }
1226
+ return t.$$set = (s) => {
1227
+ "disabled" in s && r(0, n = s.disabled);
1228
+ }, [n, i];
1229
+ }
1230
+ class jn extends C {
1231
+ constructor(e) {
1232
+ super(), U(this, e, Kn, Hn, R, { disabled: 0 }, Yn);
1233
+ }
1234
+ }
1235
+ function Jn(t) {
1236
+ O(t, "svelte-10u48yl", ".rcb-app-icon.svelte-10u48yl{width:2.5rem;height:2.5rem;border-radius:0.75rem;box-shadow:0px 1px 10px 0px rgba(0, 0, 0, 0.1);margin-right:1rem}.rcb-app-icon-picture-container.svelte-10u48yl{height:2.5rem}.rcb-app-icon.loading.svelte-10u48yl{background-color:gray}");
1237
+ }
1238
+ function xn(t) {
1239
+ let e;
1240
+ return {
1241
+ c() {
1242
+ e = $("div"), h(e, "class", "rcb-app-icon loading svelte-10u48yl");
1243
+ },
1244
+ m(r, n) {
1245
+ g(r, e, n);
1246
+ },
1247
+ p: v,
1248
+ d(r) {
1249
+ r && m(e);
1250
+ }
1251
+ };
1252
+ }
1253
+ function Vn(t) {
1254
+ let e, r, n, i, s, l;
1255
+ return {
1256
+ c() {
1257
+ e = $("picture"), r = $("source"), i = P(), s = $("img"), h(r, "type", "image/webp"), Yt(r, n = /*srcWebp*/
1258
+ t[1]) || h(r, "srcset", n), h(s, "class", "rcb-app-icon svelte-10u48yl"), q(s.src, l = /*src*/
1259
+ t[0]) || h(s, "src", l), h(s, "alt", "App icon"), h(e, "class", "rcb-app-icon-picture-container svelte-10u48yl");
1260
+ },
1261
+ m(o, c) {
1262
+ g(o, e, c), T(e, r), T(e, i), T(e, s);
1263
+ },
1264
+ p(o, c) {
1265
+ c & /*srcWebp*/
1266
+ 2 && n !== (n = /*srcWebp*/
1267
+ o[1]) && h(r, "srcset", n), c & /*src*/
1268
+ 1 && !q(s.src, l = /*src*/
1269
+ o[0]) && h(s, "src", l);
1270
+ },
1271
+ d(o) {
1272
+ o && m(e);
1273
+ }
1274
+ };
1275
+ }
1276
+ function Wn(t) {
1277
+ let e;
1278
+ function r(s, l) {
1279
+ return (
1280
+ /*src*/
1281
+ s[0] !== null ? Vn : xn
1282
+ );
1283
+ }
1284
+ let n = r(t), i = n(t);
1285
+ return {
1286
+ c() {
1287
+ i.c(), e = ne();
1288
+ },
1289
+ m(s, l) {
1290
+ i.m(s, l), g(s, e, l);
1291
+ },
1292
+ p(s, [l]) {
1293
+ n === (n = r(s)) && i ? i.p(s, l) : (i.d(1), i = n(s), i && (i.c(), i.m(e.parentNode, e)));
1294
+ },
1295
+ i: v,
1296
+ o: v,
1297
+ d(s) {
1298
+ s && m(e), i.d(s);
1299
+ }
1300
+ };
1301
+ }
1302
+ function qn(t, e, r) {
1303
+ let { src: n = null } = e, { srcWebp: i = null } = e;
1304
+ return t.$$set = (s) => {
1305
+ "src" in s && r(0, n = s.src), "srcWebp" in s && r(1, i = s.srcWebp);
1306
+ }, [n, i];
1307
+ }
1308
+ class wt extends C {
1309
+ constructor(e) {
1310
+ super(), U(this, e, qn, Wn, R, { src: 0, srcWebp: 1 }, Jn);
1311
+ }
1312
+ }
1313
+ const we = (t) => `https://da08ctfrofx1b.cloudfront.net/${t}`;
1314
+ function zn(t) {
1315
+ O(t, "svelte-1tdgim9", ".app-title.svelte-1tdgim9{font-weight:500;margin:0.5rem 0;font-size:1rem}.rcb-header-layout__business-info.svelte-1tdgim9{display:flex;align-items:center}");
1316
+ }
1317
+ function Xn(t) {
1318
+ let e, r;
1319
+ return e = new wt({}), {
1320
+ c() {
1321
+ w(e.$$.fragment);
1322
+ },
1323
+ m(n, i) {
1324
+ E(e, n, i), r = !0;
1325
+ },
1326
+ p: v,
1327
+ i(n) {
1328
+ r || (a(e.$$.fragment, n), r = !0);
1329
+ },
1330
+ o(n) {
1331
+ f(e.$$.fragment, n), r = !1;
1332
+ },
1333
+ d(n) {
1334
+ I(e, n);
1335
+ }
1336
+ };
1337
+ }
1338
+ function Zn(t) {
1339
+ let e, r, n = (
1340
+ /*brandingInfo*/
1341
+ t[0].seller_company_name + ""
1342
+ ), i, s, l = (
1343
+ /*brandingInfo*/
1344
+ t[0].app_icon_webp !== null && /*brandingInfo*/
1345
+ t[0].app_icon !== null && ze(t)
1346
+ );
1347
+ return {
1348
+ c() {
1349
+ l && l.c(), e = P(), r = $("span"), i = L(n), h(r, "class", "app-title svelte-1tdgim9");
1350
+ },
1351
+ m(o, c) {
1352
+ l && l.m(o, c), g(o, e, c), g(o, r, c), T(r, i), s = !0;
1353
+ },
1354
+ p(o, c) {
1355
+ /*brandingInfo*/
1356
+ o[0].app_icon_webp !== null && /*brandingInfo*/
1357
+ o[0].app_icon !== null ? l ? (l.p(o, c), c & /*brandingInfo*/
1358
+ 1 && a(l, 1)) : (l = ze(o), l.c(), a(l, 1), l.m(e.parentNode, e)) : l && (F(), f(l, 1, 1, () => {
1359
+ l = null;
1360
+ }), G()), (!s || c & /*brandingInfo*/
1361
+ 1) && n !== (n = /*brandingInfo*/
1362
+ o[0].seller_company_name + "") && le(i, n);
1363
+ },
1364
+ i(o) {
1365
+ s || (a(l), s = !0);
1366
+ },
1367
+ o(o) {
1368
+ f(l), s = !1;
1369
+ },
1370
+ d(o) {
1371
+ o && (m(e), m(r)), l && l.d(o);
1372
+ }
1373
+ };
1374
+ }
1375
+ function ze(t) {
1376
+ let e, r;
1377
+ return e = new wt({
1378
+ props: {
1379
+ src: we(
1380
+ /*brandingInfo*/
1381
+ t[0].app_icon
1382
+ ),
1383
+ srcWebp: we(
1384
+ /*brandingInfo*/
1385
+ t[0].app_icon_webp
1386
+ )
1387
+ }
1388
+ }), {
1389
+ c() {
1390
+ w(e.$$.fragment);
1391
+ },
1392
+ m(n, i) {
1393
+ E(e, n, i), r = !0;
1394
+ },
1395
+ p(n, i) {
1396
+ const s = {};
1397
+ i & /*brandingInfo*/
1398
+ 1 && (s.src = we(
1399
+ /*brandingInfo*/
1400
+ n[0].app_icon
1401
+ )), i & /*brandingInfo*/
1402
+ 1 && (s.srcWebp = we(
1403
+ /*brandingInfo*/
1404
+ n[0].app_icon_webp
1405
+ )), e.$set(s);
1406
+ },
1407
+ i(n) {
1408
+ r || (a(e.$$.fragment, n), r = !0);
1409
+ },
1410
+ o(n) {
1411
+ f(e.$$.fragment, n), r = !1;
1412
+ },
1413
+ d(n) {
1414
+ I(e, n);
1415
+ }
1416
+ };
1417
+ }
1418
+ function er(t) {
1419
+ let e, r, n, i;
1420
+ const s = [Zn, Xn], l = [];
1421
+ function o(c, u) {
1422
+ return (
1423
+ /*brandingInfo*/
1424
+ c[0] !== null ? 0 : 1
1425
+ );
1426
+ }
1427
+ return r = o(t), n = l[r] = s[r](t), {
1428
+ c() {
1429
+ e = $("div"), n.c(), h(e, "class", "rcb-header-layout__business-info svelte-1tdgim9");
1430
+ },
1431
+ m(c, u) {
1432
+ g(c, e, u), l[r].m(e, null), i = !0;
1433
+ },
1434
+ p(c, [u]) {
1435
+ let _ = r;
1436
+ r = o(c), r === _ ? l[r].p(c, u) : (F(), f(l[_], 1, 1, () => {
1437
+ l[_] = null;
1438
+ }), G(), n = l[r], n ? n.p(c, u) : (n = l[r] = s[r](c), n.c()), a(n, 1), n.m(e, null));
1439
+ },
1440
+ i(c) {
1441
+ i || (a(n), i = !0);
1442
+ },
1443
+ o(c) {
1444
+ f(n), i = !1;
1445
+ },
1446
+ d(c) {
1447
+ c && m(e), l[r].d();
1448
+ }
1449
+ };
1450
+ }
1451
+ function tr(t, e, r) {
1452
+ let { brandingInfo: n = null } = e;
1453
+ return t.$$set = (i) => {
1454
+ "brandingInfo" in i && r(0, n = i.brandingInfo);
1455
+ }, [n];
1456
+ }
1457
+ class bt extends C {
1458
+ constructor(e) {
1459
+ super(), U(this, e, tr, er, R, { brandingInfo: 0 }, zn);
1460
+ }
1461
+ }
1462
+ function nr(t) {
1463
+ O(t, "svelte-j03lz1", ".rcb-post-purchase-header-layout.svelte-j03lz1{display:flex;justify-content:space-between;align-items:center;width:100%}");
1464
+ }
1465
+ function rr(t) {
1466
+ let e, r, n, i, s;
1467
+ return r = new bt({
1468
+ props: { brandingInfo: (
1469
+ /*brandingInfo*/
1470
+ t[0]
1471
+ ) }
1472
+ }), i = new jn({}), i.$on("click", function() {
1473
+ te(
1474
+ /*onClose*/
1475
+ t[1]
1476
+ ) && t[1].apply(this, arguments);
1477
+ }), {
1478
+ c() {
1479
+ e = $("div"), w(r.$$.fragment), n = P(), w(i.$$.fragment), h(e, "class", "rcb-post-purchase-header-layout svelte-j03lz1");
1480
+ },
1481
+ m(l, o) {
1482
+ g(l, e, o), E(r, e, null), T(e, n), E(i, e, null), s = !0;
1483
+ },
1484
+ p(l, o) {
1485
+ t = l;
1486
+ const c = {};
1487
+ o & /*brandingInfo*/
1488
+ 1 && (c.brandingInfo = /*brandingInfo*/
1489
+ t[0]), r.$set(c);
1490
+ },
1491
+ i(l) {
1492
+ s || (a(r.$$.fragment, l), a(i.$$.fragment, l), s = !0);
1493
+ },
1494
+ o(l) {
1495
+ f(r.$$.fragment, l), f(i.$$.fragment, l), s = !1;
1496
+ },
1497
+ d(l) {
1498
+ l && m(e), I(r), I(i);
1499
+ }
1500
+ };
1501
+ }
1502
+ function ir(t) {
1503
+ let e, r;
1504
+ return e = new z({
1505
+ props: {
1506
+ as: "header",
1507
+ $$slots: { default: [rr] },
1508
+ $$scope: { ctx: t }
1509
+ }
1510
+ }), {
1511
+ c() {
1512
+ w(e.$$.fragment);
1513
+ },
1514
+ m(n, i) {
1515
+ E(e, n, i), r = !0;
1516
+ },
1517
+ p(n, [i]) {
1518
+ const s = {};
1519
+ i & /*$$scope, onClose, brandingInfo*/
1520
+ 7 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s);
1521
+ },
1522
+ i(n) {
1523
+ r || (a(e.$$.fragment, n), r = !0);
1524
+ },
1525
+ o(n) {
1526
+ f(e.$$.fragment, n), r = !1;
1527
+ },
1528
+ d(n) {
1529
+ I(e, n);
1530
+ }
1531
+ };
1532
+ }
1533
+ function sr(t, e, r) {
1534
+ let { brandingInfo: n = null } = e, { onClose: i } = e;
1535
+ return t.$$set = (s) => {
1536
+ "brandingInfo" in s && r(0, n = s.brandingInfo), "onClose" in s && r(1, i = s.onClose);
1537
+ }, [n, i];
1538
+ }
1539
+ class $t extends C {
1540
+ constructor(e) {
1541
+ super(), U(this, e, sr, ir, R, { brandingInfo: 0, onClose: 1 }, nr);
1542
+ }
1543
+ }
1544
+ function lr(t) {
1545
+ O(t, "svelte-ahi052", ".rcb-modal-error.svelte-ahi052{width:100%;min-height:10rem;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center}.title.svelte-ahi052{font-size:24px}.subtitle.svelte-ahi052{font-size:16px}");
1546
+ }
1547
+ function Xe(t) {
1548
+ let e, r, n, i, s;
1549
+ return {
1550
+ c() {
1551
+ e = L("If this error persists, please contact "), r = $("a"), n = L(
1552
+ /*supportEmail*/
1553
+ t[1]
1554
+ ), s = L("."), h(r, "href", i = "mailto:" + /*supportEmail*/
1555
+ t[1]);
1556
+ },
1557
+ m(l, o) {
1558
+ g(l, e, o), g(l, r, o), T(r, n), g(l, s, o);
1559
+ },
1560
+ p(l, o) {
1561
+ o & /*supportEmail*/
1562
+ 2 && le(
1563
+ n,
1564
+ /*supportEmail*/
1565
+ l[1]
1566
+ ), o & /*supportEmail*/
1567
+ 2 && i !== (i = "mailto:" + /*supportEmail*/
1568
+ l[1]) && h(r, "href", i);
1569
+ },
1570
+ d(l) {
1571
+ l && (m(e), m(r), m(s));
1572
+ }
1573
+ };
1574
+ }
1575
+ function or(t) {
1576
+ let e, r, n, i = (
1577
+ /*getErrorMessage*/
1578
+ t[3]() + ""
1579
+ ), s, l, o = (
1580
+ /*supportEmail*/
1581
+ t[1] && Xe(t)
1582
+ );
1583
+ return {
1584
+ c() {
1585
+ e = $("span"), e.textContent = "Something went wrong.", r = P(), n = $("span"), s = L(i), l = P(), o && o.c(), h(e, "class", "title svelte-ahi052"), h(n, "class", "subtitle svelte-ahi052");
1586
+ },
1587
+ m(c, u) {
1588
+ g(c, e, u), g(c, r, u), g(c, n, u), T(n, s), T(n, l), o && o.m(n, null);
1589
+ },
1590
+ p(c, u) {
1591
+ /*supportEmail*/
1592
+ c[1] ? o ? o.p(c, u) : (o = Xe(c), o.c(), o.m(n, null)) : o && (o.d(1), o = null);
1593
+ },
1594
+ d(c) {
1595
+ c && (m(e), m(r), m(n)), o && o.d();
1596
+ }
1597
+ };
1598
+ }
1599
+ function cr(t) {
1600
+ let e, r, n, i;
1601
+ return e = new Sn({}), n = new X({
1602
+ props: {
1603
+ gutter: "1rem",
1604
+ $$slots: { default: [or] },
1605
+ $$scope: { ctx: t }
1606
+ }
1607
+ }), {
1608
+ c() {
1609
+ w(e.$$.fragment), r = P(), w(n.$$.fragment);
1610
+ },
1611
+ m(s, l) {
1612
+ E(e, s, l), g(s, r, l), E(n, s, l), i = !0;
1613
+ },
1614
+ p(s, l) {
1615
+ const o = {};
1616
+ l & /*$$scope, supportEmail*/
1617
+ 34 && (o.$$scope = { dirty: l, ctx: s }), n.$set(o);
1618
+ },
1619
+ i(s) {
1620
+ i || (a(e.$$.fragment, s), a(n.$$.fragment, s), i = !0);
1621
+ },
1622
+ o(s) {
1623
+ f(e.$$.fragment, s), f(n.$$.fragment, s), i = !1;
1624
+ },
1625
+ d(s) {
1626
+ s && m(r), I(e, s), I(n, s);
1627
+ }
1628
+ };
1629
+ }
1630
+ function ar(t) {
1631
+ let e, r, n;
1632
+ return r = new X({
1633
+ props: {
1634
+ gutter: "1rem",
1635
+ $$slots: { default: [cr] },
1636
+ $$scope: { ctx: t }
1637
+ }
1638
+ }), {
1639
+ c() {
1640
+ e = $("div"), w(r.$$.fragment), h(e, "class", "rcb-modal-error svelte-ahi052");
1641
+ },
1642
+ m(i, s) {
1643
+ g(i, e, s), E(r, e, null), n = !0;
1644
+ },
1645
+ p(i, s) {
1646
+ const l = {};
1647
+ s & /*$$scope, supportEmail*/
1648
+ 34 && (l.$$scope = { dirty: s, ctx: i }), r.$set(l);
1649
+ },
1650
+ i(i) {
1651
+ n || (a(r.$$.fragment, i), n = !0);
1652
+ },
1653
+ o(i) {
1654
+ f(r.$$.fragment, i), n = !1;
1655
+ },
1656
+ d(i) {
1657
+ i && m(e), I(r);
1658
+ }
1659
+ };
1660
+ }
1661
+ function ur(t) {
1662
+ let e;
1663
+ return {
1664
+ c() {
1665
+ e = L("Go back to app");
1666
+ },
1667
+ m(r, n) {
1668
+ g(r, e, n);
1669
+ },
1670
+ d(r) {
1671
+ r && m(e);
1672
+ }
1673
+ };
1674
+ }
1675
+ function fr(t) {
1676
+ let e, r;
1677
+ return e = new ce({
1678
+ props: {
1679
+ $$slots: { default: [ur] },
1680
+ $$scope: { ctx: t }
1681
+ }
1682
+ }), e.$on("click", function() {
1683
+ te(
1684
+ /*onContinue*/
1685
+ t[2]
1686
+ ) && t[2].apply(this, arguments);
1687
+ }), {
1688
+ c() {
1689
+ w(e.$$.fragment);
1690
+ },
1691
+ m(n, i) {
1692
+ E(e, n, i), r = !0;
1693
+ },
1694
+ p(n, i) {
1695
+ t = n;
1696
+ const s = {};
1697
+ i & /*$$scope*/
1698
+ 32 && (s.$$scope = { dirty: i, ctx: t }), e.$set(s);
1699
+ },
1700
+ i(n) {
1701
+ r || (a(e.$$.fragment, n), r = !0);
1702
+ },
1703
+ o(n) {
1704
+ f(e.$$.fragment, n), r = !1;
1705
+ },
1706
+ d(n) {
1707
+ I(e, n);
1708
+ }
1709
+ };
1710
+ }
1711
+ function dr(t) {
1712
+ let e, r, n, i, s, l;
1713
+ return e = new $t({
1714
+ props: {
1715
+ brandingInfo: (
1716
+ /*brandingInfo*/
1717
+ t[0]
1718
+ ),
1719
+ onClose: (
1720
+ /*onContinue*/
1721
+ t[2]
1722
+ )
1723
+ }
1724
+ }), n = new z({
1725
+ props: {
1726
+ $$slots: { default: [ar] },
1727
+ $$scope: { ctx: t }
1728
+ }
1729
+ }), s = new Ne({
1730
+ props: {
1731
+ $$slots: { default: [fr] },
1732
+ $$scope: { ctx: t }
1733
+ }
1734
+ }), {
1735
+ c() {
1736
+ w(e.$$.fragment), r = P(), w(n.$$.fragment), i = P(), w(s.$$.fragment);
1737
+ },
1738
+ m(o, c) {
1739
+ E(e, o, c), g(o, r, c), E(n, o, c), g(o, i, c), E(s, o, c), l = !0;
1740
+ },
1741
+ p(o, c) {
1742
+ const u = {};
1743
+ c & /*brandingInfo*/
1744
+ 1 && (u.brandingInfo = /*brandingInfo*/
1745
+ o[0]), c & /*onContinue*/
1746
+ 4 && (u.onClose = /*onContinue*/
1747
+ o[2]), e.$set(u);
1748
+ const _ = {};
1749
+ c & /*$$scope, supportEmail*/
1750
+ 34 && (_.$$scope = { dirty: c, ctx: o }), n.$set(_);
1751
+ const A = {};
1752
+ c & /*$$scope, onContinue*/
1753
+ 36 && (A.$$scope = { dirty: c, ctx: o }), s.$set(A);
1754
+ },
1755
+ i(o) {
1756
+ l || (a(e.$$.fragment, o), a(n.$$.fragment, o), a(s.$$.fragment, o), l = !0);
1757
+ },
1758
+ o(o) {
1759
+ f(e.$$.fragment, o), f(n.$$.fragment, o), f(s.$$.fragment, o), l = !1;
1760
+ },
1761
+ d(o) {
1762
+ o && (m(r), m(i)), I(e, o), I(n, o), I(s, o);
1763
+ }
1764
+ };
1765
+ }
1766
+ function mr(t) {
1767
+ let e, r;
1768
+ return e = new X({
1769
+ props: {
1770
+ gutter: "2rem",
1771
+ $$slots: { default: [dr] },
1772
+ $$scope: { ctx: t }
1773
+ }
1774
+ }), {
1775
+ c() {
1776
+ w(e.$$.fragment);
1777
+ },
1778
+ m(n, i) {
1779
+ E(e, n, i), r = !0;
1780
+ },
1781
+ p(n, [i]) {
1782
+ const s = {};
1783
+ i & /*$$scope, onContinue, supportEmail, brandingInfo*/
1784
+ 39 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s);
1785
+ },
1786
+ i(n) {
1787
+ r || (a(e.$$.fragment, n), r = !0);
1788
+ },
1789
+ o(n) {
1790
+ f(e.$$.fragment, n), r = !1;
1791
+ },
1792
+ d(n) {
1793
+ I(e, n);
1794
+ }
1795
+ };
1796
+ }
1797
+ function gr(t, e, r) {
1798
+ let { brandingInfo: n = null } = e, { lastError: i } = e, { supportEmail: s = null } = e, { onContinue: l } = e;
1799
+ Te(() => {
1800
+ j.errorLog(`Displayed error: ${S[i.errorCode]}. Message: ${i.message ?? "None"}. Underlying error: ${i.underlyingErrorMessage ?? "None"}`);
1801
+ });
1802
+ function o() {
1803
+ switch (i.errorCode) {
1804
+ case S.UnknownError:
1805
+ return "An unknown error occurred.";
1806
+ case S.ErrorSettingUpPurchase:
1807
+ return "Purchase not started due to an error.";
1808
+ case S.ErrorChargingPayment:
1809
+ return "Payment failed.";
1810
+ case S.NetworkError:
1811
+ return "Network error. Please check your internet connection.";
1812
+ case S.StripeError:
1813
+ return i.message;
1814
+ case S.MissingEmailError:
1815
+ return "Email is required to complete the purchase.";
1816
+ }
1817
+ return i.message;
1818
+ }
1819
+ return t.$$set = (c) => {
1820
+ "brandingInfo" in c && r(0, n = c.brandingInfo), "lastError" in c && r(4, i = c.lastError), "supportEmail" in c && r(1, s = c.supportEmail), "onContinue" in c && r(2, l = c.onContinue);
1821
+ }, [n, s, l, o, i];
1822
+ }
1823
+ class Ar extends C {
1824
+ constructor(e) {
1825
+ super(), U(
1826
+ this,
1827
+ e,
1828
+ gr,
1829
+ mr,
1830
+ R,
1831
+ {
1832
+ brandingInfo: 0,
1833
+ lastError: 4,
1834
+ supportEmail: 1,
1835
+ onContinue: 2
1836
+ },
1837
+ lr
1838
+ );
1839
+ }
1840
+ }
1841
+ const _r = "data:image/svg+xml,%3csvg%20width='124'%20height='124'%20viewBox='0%200%20124%20124'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='62'%20cy='62'%20r='62'%20fill='%23576CDB'/%3e%3crect%20x='44.1116'%20y='56'%20width='27.5'%20height='11'%20transform='rotate(45%2044.1116%2056)'%20fill='white'/%3e%3crect%20x='79.1133'%20y='44.334'%20width='11'%20height='44'%20transform='rotate(45%2079.1133%2044.334)'%20fill='white'/%3e%3c/svg%3e";
1842
+ function pr(t) {
1843
+ O(t, "svelte-7khg4b", "img.svelte-7khg4b{width:7.75rem;height:7.75rem;margin:0 auto}");
1844
+ }
1845
+ function hr(t) {
1846
+ let e, r;
1847
+ return {
1848
+ c() {
1849
+ e = $("img"), q(e.src, r = _r) || h(e, "src", r), h(e, "alt", "icon"), h(e, "class", "rcb-ui-asset-icon svelte-7khg4b");
1850
+ },
1851
+ m(n, i) {
1852
+ g(n, e, i);
1853
+ },
1854
+ p: v,
1855
+ i: v,
1856
+ o: v,
1857
+ d(n) {
1858
+ n && m(e);
1859
+ }
1860
+ };
1861
+ }
1862
+ class Er extends C {
1863
+ constructor(e) {
1864
+ super(), U(this, e, null, hr, R, {}, pr);
1865
+ }
1866
+ }
1867
+ function Ir(t) {
1868
+ O(t, "svelte-1lcsna9", ".rcb-modal-success.svelte-1lcsna9{width:100%;min-height:10rem;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center}.title.svelte-1lcsna9{font-size:24px}.subtitle.svelte-1lcsna9{font-size:16px}");
1869
+ }
1870
+ function wr(t) {
1871
+ let e, r, n;
1872
+ return {
1873
+ c() {
1874
+ e = $("span"), e.textContent = "Purchase Successful", r = P(), n = $("span"), n.textContent = "Your plan is now active.", h(e, "class", "title svelte-1lcsna9"), h(n, "class", "subtitle svelte-1lcsna9");
1875
+ },
1876
+ m(i, s) {
1877
+ g(i, e, s), g(i, r, s), g(i, n, s);
1878
+ },
1879
+ p: v,
1880
+ d(i) {
1881
+ i && (m(e), m(r), m(n));
1882
+ }
1883
+ };
1884
+ }
1885
+ function br(t) {
1886
+ let e, r, n, i;
1887
+ return e = new Er({}), n = new X({
1888
+ props: {
1889
+ gutter: "1rem",
1890
+ $$slots: { default: [wr] },
1891
+ $$scope: { ctx: t }
1892
+ }
1893
+ }), {
1894
+ c() {
1895
+ w(e.$$.fragment), r = P(), w(n.$$.fragment);
1896
+ },
1897
+ m(s, l) {
1898
+ E(e, s, l), g(s, r, l), E(n, s, l), i = !0;
1899
+ },
1900
+ p(s, l) {
1901
+ const o = {};
1902
+ l & /*$$scope*/
1903
+ 4 && (o.$$scope = { dirty: l, ctx: s }), n.$set(o);
1904
+ },
1905
+ i(s) {
1906
+ i || (a(e.$$.fragment, s), a(n.$$.fragment, s), i = !0);
1907
+ },
1908
+ o(s) {
1909
+ f(e.$$.fragment, s), f(n.$$.fragment, s), i = !1;
1910
+ },
1911
+ d(s) {
1912
+ s && m(r), I(e, s), I(n, s);
1913
+ }
1914
+ };
1915
+ }
1916
+ function $r(t) {
1917
+ let e, r, n;
1918
+ return r = new X({
1919
+ props: {
1920
+ gutter: "1rem",
1921
+ $$slots: { default: [br] },
1922
+ $$scope: { ctx: t }
1923
+ }
1924
+ }), {
1925
+ c() {
1926
+ e = $("div"), w(r.$$.fragment), h(e, "class", "rcb-modal-success svelte-1lcsna9");
1927
+ },
1928
+ m(i, s) {
1929
+ g(i, e, s), E(r, e, null), n = !0;
1930
+ },
1931
+ p(i, s) {
1932
+ const l = {};
1933
+ s & /*$$scope*/
1934
+ 4 && (l.$$scope = { dirty: s, ctx: i }), r.$set(l);
1935
+ },
1936
+ i(i) {
1937
+ n || (a(r.$$.fragment, i), n = !0);
1938
+ },
1939
+ o(i) {
1940
+ f(r.$$.fragment, i), n = !1;
1941
+ },
1942
+ d(i) {
1943
+ i && m(e), I(r);
1944
+ }
1945
+ };
1946
+ }
1947
+ function kr(t) {
1948
+ let e;
1949
+ return {
1950
+ c() {
1951
+ e = L("Go back to app");
1952
+ },
1953
+ m(r, n) {
1954
+ g(r, e, n);
1955
+ },
1956
+ d(r) {
1957
+ r && m(e);
1958
+ }
1959
+ };
1960
+ }
1961
+ function Br(t) {
1962
+ let e, r;
1963
+ return e = new ce({
1964
+ props: {
1965
+ $$slots: { default: [kr] },
1966
+ $$scope: { ctx: t }
1967
+ }
1968
+ }), e.$on("click", function() {
1969
+ te(
1970
+ /*onContinue*/
1971
+ t[1]
1972
+ ) && t[1].apply(this, arguments);
1973
+ }), {
1974
+ c() {
1975
+ w(e.$$.fragment);
1976
+ },
1977
+ m(n, i) {
1978
+ E(e, n, i), r = !0;
1979
+ },
1980
+ p(n, i) {
1981
+ t = n;
1982
+ const s = {};
1983
+ i & /*$$scope*/
1984
+ 4 && (s.$$scope = { dirty: i, ctx: t }), e.$set(s);
1985
+ },
1986
+ i(n) {
1987
+ r || (a(e.$$.fragment, n), r = !0);
1988
+ },
1989
+ o(n) {
1990
+ f(e.$$.fragment, n), r = !1;
1991
+ },
1992
+ d(n) {
1993
+ I(e, n);
1994
+ }
1995
+ };
1996
+ }
1997
+ function yr(t) {
1998
+ let e, r, n, i, s, l;
1999
+ return e = new $t({
2000
+ props: {
2001
+ brandingInfo: (
2002
+ /*brandingInfo*/
2003
+ t[0]
2004
+ ),
2005
+ onClose: (
2006
+ /*onContinue*/
2007
+ t[1]
2008
+ )
2009
+ }
2010
+ }), n = new z({
2011
+ props: {
2012
+ $$slots: { default: [$r] },
2013
+ $$scope: { ctx: t }
2014
+ }
2015
+ }), s = new Ne({
2016
+ props: {
2017
+ $$slots: { default: [Br] },
2018
+ $$scope: { ctx: t }
2019
+ }
2020
+ }), {
2021
+ c() {
2022
+ w(e.$$.fragment), r = P(), w(n.$$.fragment), i = P(), w(s.$$.fragment);
2023
+ },
2024
+ m(o, c) {
2025
+ E(e, o, c), g(o, r, c), E(n, o, c), g(o, i, c), E(s, o, c), l = !0;
2026
+ },
2027
+ p(o, c) {
2028
+ const u = {};
2029
+ c & /*brandingInfo*/
2030
+ 1 && (u.brandingInfo = /*brandingInfo*/
2031
+ o[0]), c & /*onContinue*/
2032
+ 2 && (u.onClose = /*onContinue*/
2033
+ o[1]), e.$set(u);
2034
+ const _ = {};
2035
+ c & /*$$scope*/
2036
+ 4 && (_.$$scope = { dirty: c, ctx: o }), n.$set(_);
2037
+ const A = {};
2038
+ c & /*$$scope, onContinue*/
2039
+ 6 && (A.$$scope = { dirty: c, ctx: o }), s.$set(A);
2040
+ },
2041
+ i(o) {
2042
+ l || (a(e.$$.fragment, o), a(n.$$.fragment, o), a(s.$$.fragment, o), l = !0);
2043
+ },
2044
+ o(o) {
2045
+ f(e.$$.fragment, o), f(n.$$.fragment, o), f(s.$$.fragment, o), l = !1;
2046
+ },
2047
+ d(o) {
2048
+ o && (m(r), m(i)), I(e, o), I(n, o), I(s, o);
2049
+ }
2050
+ };
2051
+ }
2052
+ function Dr(t) {
2053
+ let e, r;
2054
+ return e = new X({
2055
+ props: {
2056
+ gutter: "2rem",
2057
+ $$slots: { default: [yr] },
2058
+ $$scope: { ctx: t }
2059
+ }
2060
+ }), {
2061
+ c() {
2062
+ w(e.$$.fragment);
2063
+ },
2064
+ m(n, i) {
2065
+ E(e, n, i), r = !0;
2066
+ },
2067
+ p(n, [i]) {
2068
+ const s = {};
2069
+ i & /*$$scope, onContinue, brandingInfo*/
2070
+ 7 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s);
2071
+ },
2072
+ i(n) {
2073
+ r || (a(e.$$.fragment, n), r = !0);
2074
+ },
2075
+ o(n) {
2076
+ f(e.$$.fragment, n), r = !1;
2077
+ },
2078
+ d(n) {
2079
+ I(e, n);
2080
+ }
2081
+ };
2082
+ }
2083
+ function vr(t, e, r) {
2084
+ let { brandingInfo: n = null } = e, { onContinue: i } = e;
2085
+ return t.$$set = (s) => {
2086
+ "brandingInfo" in s && r(0, n = s.brandingInfo), "onContinue" in s && r(1, i = s.onContinue);
2087
+ }, [n, i];
2088
+ }
2089
+ class Qr extends C {
2090
+ constructor(e) {
2091
+ super(), U(this, e, vr, Dr, R, { brandingInfo: 0, onContinue: 1 }, Ir);
2092
+ }
2093
+ }
2094
+ function Mr(t, e, r, n, i = {}) {
2095
+ const s = r.create(e, i);
2096
+ return s.mount(t), s.on("change", (l) => n("change", l)), s.on("ready", (l) => n("ready", l)), s.on("focus", (l) => n("focus", l)), s.on("blur", (l) => n("blur", l)), s.on("escape", (l) => n("escape", l)), s.on("click", (l) => n("click", l)), s.on("loaderror", (l) => n("loaderror", l)), s.on("loaderstart", (l) => n("loaderstart", l)), s.on("networkschange", (l) => n("networkschange", l)), s;
2097
+ }
2098
+ const Tr = typeof window > "u";
2099
+ function Pr(t) {
2100
+ if (!Tr)
2101
+ return t.registerAppInfo({
2102
+ name: "svelte-stripe-js",
2103
+ url: "https://svelte-stripe-js.vercel.app"
2104
+ });
2105
+ }
2106
+ function Nr(t) {
2107
+ let e;
2108
+ return {
2109
+ c() {
2110
+ e = $("div");
2111
+ },
2112
+ m(r, n) {
2113
+ g(r, e, n), t[6](e);
2114
+ },
2115
+ p: v,
2116
+ i: v,
2117
+ o: v,
2118
+ d(r) {
2119
+ r && m(e), t[6](null);
2120
+ }
2121
+ };
2122
+ }
2123
+ function Rr(t, e, r) {
2124
+ let n, i;
2125
+ const s = Zt(), { elements: l } = tn("stripe");
2126
+ let { options: o = void 0 } = e;
2127
+ Te(() => (n = Mr(i, "payment", l, s, o), () => n.destroy()));
2128
+ function c() {
2129
+ n.blur();
2130
+ }
2131
+ function u() {
2132
+ n.clear();
2133
+ }
2134
+ function _() {
2135
+ n.destroy();
2136
+ }
2137
+ function A() {
2138
+ n.focus();
2139
+ }
2140
+ function k(B) {
2141
+ ve[B ? "unshift" : "push"](() => {
2142
+ i = B, r(0, i);
2143
+ });
2144
+ }
2145
+ return t.$$set = (B) => {
2146
+ "options" in B && r(1, o = B.options);
2147
+ }, [i, o, c, u, _, A, k];
2148
+ }
2149
+ class Ur extends C {
2150
+ constructor(e) {
2151
+ super(), U(this, e, Rr, Nr, R, {
2152
+ options: 1,
2153
+ blur: 2,
2154
+ clear: 3,
2155
+ destroy: 4,
2156
+ focus: 5
2157
+ });
2158
+ }
2159
+ get blur() {
2160
+ return this.$$.ctx[2];
2161
+ }
2162
+ get clear() {
2163
+ return this.$$.ctx[3];
2164
+ }
2165
+ get destroy() {
2166
+ return this.$$.ctx[4];
2167
+ }
2168
+ get focus() {
2169
+ return this.$$.ctx[5];
2170
+ }
2171
+ }
2172
+ function Ze(t) {
2173
+ let e;
2174
+ const r = (
2175
+ /*#slots*/
2176
+ t[15].default
2177
+ ), n = J(
2178
+ r,
2179
+ t,
2180
+ /*$$scope*/
2181
+ t[14],
2182
+ null
2183
+ );
2184
+ return {
2185
+ c() {
2186
+ n && n.c();
2187
+ },
2188
+ m(i, s) {
2189
+ n && n.m(i, s), e = !0;
2190
+ },
2191
+ p(i, s) {
2192
+ n && n.p && (!e || s & /*$$scope*/
2193
+ 16384) && V(
2194
+ n,
2195
+ r,
2196
+ i,
2197
+ /*$$scope*/
2198
+ i[14],
2199
+ e ? x(
2200
+ r,
2201
+ /*$$scope*/
2202
+ i[14],
2203
+ s,
2204
+ null
2205
+ ) : W(
2206
+ /*$$scope*/
2207
+ i[14]
2208
+ ),
2209
+ null
2210
+ );
2211
+ },
2212
+ i(i) {
2213
+ e || (a(n, i), e = !0);
2214
+ },
2215
+ o(i) {
2216
+ f(n, i), e = !1;
2217
+ },
2218
+ d(i) {
2219
+ n && n.d(i);
2220
+ }
2221
+ };
2222
+ }
2223
+ function Cr(t) {
2224
+ let e, r, n = (
2225
+ /*stripe*/
2226
+ t[1] && /*elements*/
2227
+ t[0] && Ze(t)
2228
+ );
2229
+ return {
2230
+ c() {
2231
+ n && n.c(), e = ne();
2232
+ },
2233
+ m(i, s) {
2234
+ n && n.m(i, s), g(i, e, s), r = !0;
2235
+ },
2236
+ p(i, [s]) {
2237
+ /*stripe*/
2238
+ i[1] && /*elements*/
2239
+ i[0] ? n ? (n.p(i, s), s & /*stripe, elements*/
2240
+ 3 && a(n, 1)) : (n = Ze(i), n.c(), a(n, 1), n.m(e.parentNode, e)) : n && (F(), f(n, 1, 1, () => {
2241
+ n = null;
2242
+ }), G());
2243
+ },
2244
+ i(i) {
2245
+ r || (a(n), r = !0);
2246
+ },
2247
+ o(i) {
2248
+ f(n), r = !1;
2249
+ },
2250
+ d(i) {
2251
+ i && m(e), n && n.d(i);
2252
+ }
2253
+ };
2254
+ }
2255
+ function Sr(t, e, r) {
2256
+ let n, { $$slots: i = {}, $$scope: s } = e, { stripe: l } = e, { mode: o = void 0 } = e, { theme: c = "stripe" } = e, { variables: u = {} } = e, { rules: _ = {} } = e, { labels: A = "above" } = e, { loader: k = "auto" } = e, { fonts: B = [] } = e, { locale: b = "auto" } = e, { currency: y = void 0 } = e, { amount: M = void 0 } = e, { clientSecret: N = void 0 } = e, { elements: d = null } = e;
2257
+ return t.$$set = (p) => {
2258
+ "stripe" in p && r(1, l = p.stripe), "mode" in p && r(2, o = p.mode), "theme" in p && r(3, c = p.theme), "variables" in p && r(4, u = p.variables), "rules" in p && r(5, _ = p.rules), "labels" in p && r(6, A = p.labels), "loader" in p && r(7, k = p.loader), "fonts" in p && r(8, B = p.fonts), "locale" in p && r(9, b = p.locale), "currency" in p && r(10, y = p.currency), "amount" in p && r(11, M = p.amount), "clientSecret" in p && r(12, N = p.clientSecret), "elements" in p && r(0, d = p.elements), "$$scope" in p && r(14, s = p.$$scope);
2259
+ }, t.$$.update = () => {
2260
+ t.$$.dirty & /*theme, variables, rules, labels*/
2261
+ 120 && r(13, n = { theme: c, variables: u, rules: _, labels: A }), t.$$.dirty & /*stripe, elements, mode, currency, amount, appearance, clientSecret, fonts, loader, locale*/
2262
+ 16263 && l && !d && (r(0, d = l.elements({
2263
+ mode: o,
2264
+ currency: y,
2265
+ amount: M,
2266
+ appearance: n,
2267
+ clientSecret: N,
2268
+ fonts: B,
2269
+ loader: k,
2270
+ locale: b
2271
+ })), Pr(l), en("stripe", { stripe: l, elements: d })), t.$$.dirty & /*elements, appearance, locale*/
2272
+ 8705 && d && d.update({ appearance: n, locale: b });
2273
+ }, [
2274
+ d,
2275
+ l,
2276
+ o,
2277
+ c,
2278
+ u,
2279
+ _,
2280
+ A,
2281
+ k,
2282
+ B,
2283
+ b,
2284
+ y,
2285
+ M,
2286
+ N,
2287
+ n,
2288
+ s,
2289
+ i
2290
+ ];
2291
+ }
2292
+ class Or extends C {
2293
+ constructor(e) {
2294
+ super(), U(this, e, Sr, Cr, R, {
2295
+ stripe: 1,
2296
+ mode: 2,
2297
+ theme: 3,
2298
+ variables: 4,
2299
+ rules: 5,
2300
+ labels: 6,
2301
+ loader: 7,
2302
+ fonts: 8,
2303
+ locale: 9,
2304
+ currency: 10,
2305
+ amount: 11,
2306
+ clientSecret: 12,
2307
+ elements: 0
2308
+ });
2309
+ }
2310
+ }
2311
+ var kt = "https://js.stripe.com/v3", Lr = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, et = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", Fr = function() {
2312
+ for (var e = document.querySelectorAll('script[src^="'.concat(kt, '"]')), r = 0; r < e.length; r++) {
2313
+ var n = e[r];
2314
+ if (Lr.test(n.src))
2315
+ return n;
2316
+ }
2317
+ return null;
2318
+ }, tt = function(e) {
2319
+ var r = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script");
2320
+ n.src = "".concat(kt).concat(r);
2321
+ var i = document.head || document.body;
2322
+ if (!i)
2323
+ throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
2324
+ return i.appendChild(n), n;
2325
+ }, Gr = function(e, r) {
2326
+ !e || !e._registerWrapper || e._registerWrapper({
2327
+ name: "stripe-js",
2328
+ version: "2.3.0",
2329
+ startTime: r
2330
+ });
2331
+ }, fe = null, be = null, $e = null, Yr = function(e) {
2332
+ return function() {
2333
+ e(new Error("Failed to load Stripe.js"));
2334
+ };
2335
+ }, Hr = function(e, r) {
2336
+ return function() {
2337
+ window.Stripe ? e(window.Stripe) : r(new Error("Stripe.js not available"));
2338
+ };
2339
+ }, Kr = function(e) {
2340
+ return fe !== null ? fe : (fe = new Promise(function(r, n) {
2341
+ if (typeof window > "u" || typeof document > "u") {
2342
+ r(null);
2343
+ return;
2344
+ }
2345
+ if (window.Stripe && e && console.warn(et), window.Stripe) {
2346
+ r(window.Stripe);
2347
+ return;
2348
+ }
2349
+ try {
2350
+ var i = Fr();
2351
+ if (i && e)
2352
+ console.warn(et);
2353
+ else if (!i)
2354
+ i = tt(e);
2355
+ else if (i && $e !== null && be !== null) {
2356
+ var s;
2357
+ i.removeEventListener("load", $e), i.removeEventListener("error", be), (s = i.parentNode) === null || s === void 0 || s.removeChild(i), i = tt(e);
2358
+ }
2359
+ $e = Hr(r, n), be = Yr(n), i.addEventListener("load", $e), i.addEventListener("error", be);
2360
+ } catch (l) {
2361
+ n(l);
2362
+ return;
2363
+ }
2364
+ }), fe.catch(function(r) {
2365
+ return fe = null, Promise.reject(r);
2366
+ }));
2367
+ }, jr = function(e, r, n) {
2368
+ if (e === null)
2369
+ return null;
2370
+ var i = e.apply(void 0, r);
2371
+ return Gr(i, n), i;
2372
+ }, de, Bt = !1, yt = function() {
2373
+ return de || (de = Kr(null).catch(function(e) {
2374
+ return de = null, Promise.reject(e);
2375
+ }), de);
2376
+ };
2377
+ Promise.resolve().then(function() {
2378
+ return yt();
2379
+ }).catch(function(t) {
2380
+ Bt || console.warn(t);
2381
+ });
2382
+ var Jr = function() {
2383
+ for (var e = arguments.length, r = new Array(e), n = 0; n < e; n++)
2384
+ r[n] = arguments[n];
2385
+ Bt = !0;
2386
+ var i = Date.now();
2387
+ return yt().then(function(s) {
2388
+ return jr(s, r, i);
2389
+ });
2390
+ };
2391
+ function xr(t) {
2392
+ O(t, "svelte-1fwwzeb", ".rcb-stripe-elements-container.svelte-1fwwzeb{width:100%;margin-bottom:1rem}");
2393
+ }
2394
+ function Vr(t) {
2395
+ let e, r;
2396
+ return e = new Pe({}), {
2397
+ c() {
2398
+ w(e.$$.fragment);
2399
+ },
2400
+ m(n, i) {
2401
+ E(e, n, i), r = !0;
2402
+ },
2403
+ p: v,
2404
+ i(n) {
2405
+ r || (a(e.$$.fragment, n), r = !0);
2406
+ },
2407
+ o(n) {
2408
+ f(e.$$.fragment, n), r = !1;
2409
+ },
2410
+ d(n) {
2411
+ I(e, n);
2412
+ }
2413
+ };
2414
+ }
2415
+ function Wr(t) {
2416
+ let e, r, n, i, s, l;
2417
+ function o(u) {
2418
+ t[9](u);
2419
+ }
2420
+ let c = {
2421
+ stripe: (
2422
+ /*stripe*/
2423
+ t[2]
2424
+ ),
2425
+ clientSecret: (
2426
+ /*clientSecret*/
2427
+ t[4]
2428
+ ),
2429
+ loader: "always",
2430
+ $$slots: { default: [ri] },
2431
+ $$scope: { ctx: t }
2432
+ };
2433
+ return (
2434
+ /*elements*/
2435
+ t[1] !== void 0 && (c.elements = /*elements*/
2436
+ t[1]), r = new Or({ props: c }), ve.push(() => cn(r, "elements", o)), {
2437
+ c() {
2438
+ e = $("form"), w(r.$$.fragment);
2439
+ },
2440
+ m(u, _) {
2441
+ g(u, e, _), E(r, e, null), i = !0, s || (l = Ee(e, "submit", pt(
2442
+ /*handleContinue*/
2443
+ t[5]
2444
+ )), s = !0);
2445
+ },
2446
+ p(u, _) {
2447
+ const A = {};
2448
+ _ & /*stripe*/
2449
+ 4 && (A.stripe = /*stripe*/
2450
+ u[2]), _ & /*$$scope, processing, onClose*/
2451
+ 2057 && (A.$$scope = { dirty: _, ctx: u }), !n && _ & /*elements*/
2452
+ 2 && (n = !0, A.elements = /*elements*/
2453
+ u[1], sn(() => n = !1)), r.$set(A);
2454
+ },
2455
+ i(u) {
2456
+ i || (a(r.$$.fragment, u), i = !0);
2457
+ },
2458
+ o(u) {
2459
+ f(r.$$.fragment, u), i = !1;
2460
+ },
2461
+ d(u) {
2462
+ u && m(e), I(r), s = !1, l();
2463
+ }
2464
+ }
2465
+ );
2466
+ }
2467
+ function qr(t) {
2468
+ let e, r, n;
2469
+ return r = new Ur({}), {
2470
+ c() {
2471
+ e = $("div"), w(r.$$.fragment), h(e, "class", "rcb-stripe-elements-container svelte-1fwwzeb");
2472
+ },
2473
+ m(i, s) {
2474
+ g(i, e, s), E(r, e, null), n = !0;
2475
+ },
2476
+ p: v,
2477
+ i(i) {
2478
+ n || (a(r.$$.fragment, i), n = !0);
2479
+ },
2480
+ o(i) {
2481
+ f(r.$$.fragment, i), n = !1;
2482
+ },
2483
+ d(i) {
2484
+ i && m(e), I(r);
2485
+ }
2486
+ };
2487
+ }
2488
+ function zr(t) {
2489
+ let e;
2490
+ return {
2491
+ c() {
2492
+ e = L("Pay");
2493
+ },
2494
+ m(r, n) {
2495
+ g(r, e, n);
2496
+ },
2497
+ d(r) {
2498
+ r && m(e);
2499
+ }
2500
+ };
2501
+ }
2502
+ function Xr(t) {
2503
+ let e;
2504
+ return {
2505
+ c() {
2506
+ e = L("Processing...");
2507
+ },
2508
+ m(r, n) {
2509
+ g(r, e, n);
2510
+ },
2511
+ d(r) {
2512
+ r && m(e);
2513
+ }
2514
+ };
2515
+ }
2516
+ function Zr(t) {
2517
+ let e;
2518
+ function r(s, l) {
2519
+ return (
2520
+ /*processing*/
2521
+ s[3] ? Xr : zr
2522
+ );
2523
+ }
2524
+ let n = r(t), i = n(t);
2525
+ return {
2526
+ c() {
2527
+ i.c(), e = ne();
2528
+ },
2529
+ m(s, l) {
2530
+ i.m(s, l), g(s, e, l);
2531
+ },
2532
+ p(s, l) {
2533
+ n !== (n = r(s)) && (i.d(1), i = n(s), i && (i.c(), i.m(e.parentNode, e)));
2534
+ },
2535
+ d(s) {
2536
+ s && m(e), i.d(s);
2537
+ }
2538
+ };
2539
+ }
2540
+ function ei(t) {
2541
+ let e;
2542
+ return {
2543
+ c() {
2544
+ e = L("Close");
2545
+ },
2546
+ m(r, n) {
2547
+ g(r, e, n);
2548
+ },
2549
+ d(r) {
2550
+ r && m(e);
2551
+ }
2552
+ };
2553
+ }
2554
+ function ti(t) {
2555
+ let e, r, n, i;
2556
+ return e = new ce({
2557
+ props: {
2558
+ disabled: (
2559
+ /*processing*/
2560
+ t[3]
2561
+ ),
2562
+ $$slots: { default: [Zr] },
2563
+ $$scope: { ctx: t }
2564
+ }
2565
+ }), n = new ce({
2566
+ props: {
2567
+ disabled: (
2568
+ /*processing*/
2569
+ t[3]
2570
+ ),
2571
+ intent: "secondary",
2572
+ $$slots: { default: [ei] },
2573
+ $$scope: { ctx: t }
2574
+ }
2575
+ }), n.$on("click", function() {
2576
+ te(
2577
+ /*onClose*/
2578
+ t[0]
2579
+ ) && t[0].apply(this, arguments);
2580
+ }), {
2581
+ c() {
2582
+ w(e.$$.fragment), r = P(), w(n.$$.fragment);
2583
+ },
2584
+ m(s, l) {
2585
+ E(e, s, l), g(s, r, l), E(n, s, l), i = !0;
2586
+ },
2587
+ p(s, l) {
2588
+ t = s;
2589
+ const o = {};
2590
+ l & /*processing*/
2591
+ 8 && (o.disabled = /*processing*/
2592
+ t[3]), l & /*$$scope, processing*/
2593
+ 2056 && (o.$$scope = { dirty: l, ctx: t }), e.$set(o);
2594
+ const c = {};
2595
+ l & /*processing*/
2596
+ 8 && (c.disabled = /*processing*/
2597
+ t[3]), l & /*$$scope*/
2598
+ 2048 && (c.$$scope = { dirty: l, ctx: t }), n.$set(c);
2599
+ },
2600
+ i(s) {
2601
+ i || (a(e.$$.fragment, s), a(n.$$.fragment, s), i = !0);
2602
+ },
2603
+ o(s) {
2604
+ f(e.$$.fragment, s), f(n.$$.fragment, s), i = !1;
2605
+ },
2606
+ d(s) {
2607
+ s && m(r), I(e, s), I(n, s);
2608
+ }
2609
+ };
2610
+ }
2611
+ function ni(t) {
2612
+ let e, r;
2613
+ return e = new X({
2614
+ props: {
2615
+ $$slots: { default: [ti] },
2616
+ $$scope: { ctx: t }
2617
+ }
2618
+ }), {
2619
+ c() {
2620
+ w(e.$$.fragment);
2621
+ },
2622
+ m(n, i) {
2623
+ E(e, n, i), r = !0;
2624
+ },
2625
+ p(n, i) {
2626
+ const s = {};
2627
+ i & /*$$scope, processing, onClose*/
2628
+ 2057 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s);
2629
+ },
2630
+ i(n) {
2631
+ r || (a(e.$$.fragment, n), r = !0);
2632
+ },
2633
+ o(n) {
2634
+ f(e.$$.fragment, n), r = !1;
2635
+ },
2636
+ d(n) {
2637
+ I(e, n);
2638
+ }
2639
+ };
2640
+ }
2641
+ function ri(t) {
2642
+ let e, r, n, i;
2643
+ return e = new z({
2644
+ props: {
2645
+ $$slots: { default: [qr] },
2646
+ $$scope: { ctx: t }
2647
+ }
2648
+ }), n = new Ne({
2649
+ props: {
2650
+ $$slots: { default: [ni] },
2651
+ $$scope: { ctx: t }
2652
+ }
2653
+ }), {
2654
+ c() {
2655
+ w(e.$$.fragment), r = P(), w(n.$$.fragment);
2656
+ },
2657
+ m(s, l) {
2658
+ E(e, s, l), g(s, r, l), E(n, s, l), i = !0;
2659
+ },
2660
+ p(s, l) {
2661
+ const o = {};
2662
+ l & /*$$scope*/
2663
+ 2048 && (o.$$scope = { dirty: l, ctx: s }), e.$set(o);
2664
+ const c = {};
2665
+ l & /*$$scope, processing, onClose*/
2666
+ 2057 && (c.$$scope = { dirty: l, ctx: s }), n.$set(c);
2667
+ },
2668
+ i(s) {
2669
+ i || (a(e.$$.fragment, s), a(n.$$.fragment, s), i = !0);
2670
+ },
2671
+ o(s) {
2672
+ f(e.$$.fragment, s), f(n.$$.fragment, s), i = !1;
2673
+ },
2674
+ d(s) {
2675
+ s && m(r), I(e, s), I(n, s);
2676
+ }
2677
+ };
2678
+ }
2679
+ function ii(t) {
2680
+ let e, r, n, i;
2681
+ const s = [Wr, Vr], l = [];
2682
+ function o(c, u) {
2683
+ return (
2684
+ /*stripe*/
2685
+ c[2] && /*clientSecret*/
2686
+ c[4] ? 0 : 1
2687
+ );
2688
+ }
2689
+ return r = o(t), n = l[r] = s[r](t), {
2690
+ c() {
2691
+ e = $("div"), n.c();
2692
+ },
2693
+ m(c, u) {
2694
+ g(c, e, u), l[r].m(e, null), i = !0;
2695
+ },
2696
+ p(c, [u]) {
2697
+ let _ = r;
2698
+ r = o(c), r === _ ? l[r].p(c, u) : (F(), f(l[_], 1, 1, () => {
2699
+ l[_] = null;
2700
+ }), G(), n = l[r], n ? n.p(c, u) : (n = l[r] = s[r](c), n.c()), a(n, 1), n.m(e, null));
2701
+ },
2702
+ i(c) {
2703
+ i || (a(n), i = !0);
2704
+ },
2705
+ o(c) {
2706
+ f(n), i = !1;
2707
+ },
2708
+ d(c) {
2709
+ c && m(e), l[r].d();
2710
+ }
2711
+ };
2712
+ }
2713
+ function si(t, e, r) {
2714
+ let { onClose: n } = e, { onContinue: i } = e, { onError: s } = e, { paymentInfoCollectionMetadata: l } = e;
2715
+ const o = l.data.client_secret;
2716
+ let c = null, u, _ = !1, A;
2717
+ Te(async () => {
2718
+ const b = l.data.publishable_api_key, y = l.data.stripe_account_id;
2719
+ if (!b || !y)
2720
+ throw new Error("Stripe publishable key or account ID not found");
2721
+ r(2, c = await Jr(b, { stripeAccount: y }));
2722
+ });
2723
+ const k = async () => {
2724
+ if (_ || !c || !A)
2725
+ return;
2726
+ r(3, _ = !0);
2727
+ const b = await c.confirmSetup({
2728
+ elements: A,
2729
+ redirect: "if_required"
2730
+ });
2731
+ b.error ? (r(3, _ = !1), s(new Y(S.StripeError, b.error.message))) : i();
2732
+ };
2733
+ function B(b) {
2734
+ u = b, r(1, u);
2735
+ }
2736
+ return t.$$set = (b) => {
2737
+ "onClose" in b && r(0, n = b.onClose), "onContinue" in b && r(6, i = b.onContinue), "onError" in b && r(7, s = b.onError), "paymentInfoCollectionMetadata" in b && r(8, l = b.paymentInfoCollectionMetadata);
2738
+ }, t.$$.update = () => {
2739
+ t.$$.dirty & /*elements*/
2740
+ 2 && u && u._elements.length > 0 && (A = u);
2741
+ }, [
2742
+ n,
2743
+ u,
2744
+ c,
2745
+ _,
2746
+ o,
2747
+ k,
2748
+ i,
2749
+ s,
2750
+ l,
2751
+ B
2752
+ ];
2753
+ }
2754
+ class li extends C {
2755
+ constructor(e) {
2756
+ super(), U(
2757
+ this,
2758
+ e,
2759
+ si,
2760
+ ii,
2761
+ R,
2762
+ {
2763
+ onClose: 0,
2764
+ onContinue: 6,
2765
+ onError: 7,
2766
+ paymentInfoCollectionMetadata: 8
2767
+ },
2768
+ xr
2769
+ );
2770
+ }
2771
+ }
2772
+ function oi(t) {
2773
+ O(t, "svelte-1xardyz", ".form-container.svelte-1xardyz{display:flex;flex-direction:column;width:100%}.form-label.svelte-1xardyz{margin-top:0.5rem;margin-bottom:0.5rem;display:block}.form-input.svelte-1xardyz{margin-bottom:1rem}.title.svelte-1xardyz{font-size:1.5rem;margin:0;margin-bottom:0.5rem}input.svelte-1xardyz{width:94%;padding:0.5rem;border:1px solid #ccc;border-radius:0.25rem}");
2774
+ }
2775
+ function ci(t) {
2776
+ let e;
2777
+ return {
2778
+ c() {
2779
+ e = $("span"), e.textContent = "User authentication", h(e, "class", "title svelte-1xardyz");
2780
+ },
2781
+ m(r, n) {
2782
+ g(r, e, n);
2783
+ },
2784
+ p: v,
2785
+ d(r) {
2786
+ r && m(e);
2787
+ }
2788
+ };
2789
+ }
2790
+ function ai(t) {
2791
+ let e, r, n, i, s, l, o;
2792
+ return {
2793
+ c() {
2794
+ e = $("div"), r = $("div"), r.innerHTML = '<label for="email">E-mail</label>', n = P(), i = $("div"), s = $("input"), h(r, "class", "form-label svelte-1xardyz"), h(s, "name", "email"), h(s, "placeholder", "john@appleseed.com"), h(s, "class", "svelte-1xardyz"), h(i, "class", "form-input svelte-1xardyz"), h(e, "class", "form-container svelte-1xardyz");
2795
+ },
2796
+ m(c, u) {
2797
+ g(c, e, u), T(e, r), T(e, n), T(e, i), T(i, s), Ve(
2798
+ s,
2799
+ /*email*/
2800
+ t[1]
2801
+ ), l || (o = Ee(
2802
+ s,
2803
+ "input",
2804
+ /*input_input_handler*/
2805
+ t[4]
2806
+ ), l = !0);
2807
+ },
2808
+ p(c, u) {
2809
+ u & /*email*/
2810
+ 2 && s.value !== /*email*/
2811
+ c[1] && Ve(
2812
+ s,
2813
+ /*email*/
2814
+ c[1]
2815
+ );
2816
+ },
2817
+ d(c) {
2818
+ c && m(e), l = !1, o();
2819
+ }
2820
+ };
2821
+ }
2822
+ function ui(t) {
2823
+ let e;
2824
+ return {
2825
+ c() {
2826
+ e = L("Continue");
2827
+ },
2828
+ m(r, n) {
2829
+ g(r, e, n);
2830
+ },
2831
+ d(r) {
2832
+ r && m(e);
2833
+ }
2834
+ };
2835
+ }
2836
+ function fi(t) {
2837
+ let e;
2838
+ return {
2839
+ c() {
2840
+ e = L("Close");
2841
+ },
2842
+ m(r, n) {
2843
+ g(r, e, n);
2844
+ },
2845
+ d(r) {
2846
+ r && m(e);
2847
+ }
2848
+ };
2849
+ }
2850
+ function di(t) {
2851
+ let e, r, n, i;
2852
+ return e = new ce({
2853
+ props: {
2854
+ $$slots: { default: [ui] },
2855
+ $$scope: { ctx: t }
2856
+ }
2857
+ }), n = new ce({
2858
+ props: {
2859
+ intent: "secondary",
2860
+ $$slots: { default: [fi] },
2861
+ $$scope: { ctx: t }
2862
+ }
2863
+ }), n.$on("click", function() {
2864
+ te(
2865
+ /*onClose*/
2866
+ t[0]
2867
+ ) && t[0].apply(this, arguments);
2868
+ }), {
2869
+ c() {
2870
+ w(e.$$.fragment), r = P(), w(n.$$.fragment);
2871
+ },
2872
+ m(s, l) {
2873
+ E(e, s, l), g(s, r, l), E(n, s, l), i = !0;
2874
+ },
2875
+ p(s, l) {
2876
+ t = s;
2877
+ const o = {};
2878
+ l & /*$$scope*/
2879
+ 32 && (o.$$scope = { dirty: l, ctx: t }), e.$set(o);
2880
+ const c = {};
2881
+ l & /*$$scope*/
2882
+ 32 && (c.$$scope = { dirty: l, ctx: t }), n.$set(c);
2883
+ },
2884
+ i(s) {
2885
+ i || (a(e.$$.fragment, s), a(n.$$.fragment, s), i = !0);
2886
+ },
2887
+ o(s) {
2888
+ f(e.$$.fragment, s), f(n.$$.fragment, s), i = !1;
2889
+ },
2890
+ d(s) {
2891
+ s && m(r), I(e, s), I(n, s);
2892
+ }
2893
+ };
2894
+ }
2895
+ function mi(t) {
2896
+ let e, r;
2897
+ return e = new X({
2898
+ props: {
2899
+ $$slots: { default: [di] },
2900
+ $$scope: { ctx: t }
2901
+ }
2902
+ }), {
2903
+ c() {
2904
+ w(e.$$.fragment);
2905
+ },
2906
+ m(n, i) {
2907
+ E(e, n, i), r = !0;
2908
+ },
2909
+ p(n, i) {
2910
+ const s = {};
2911
+ i & /*$$scope, onClose*/
2912
+ 33 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s);
2913
+ },
2914
+ i(n) {
2915
+ r || (a(e.$$.fragment, n), r = !0);
2916
+ },
2917
+ o(n) {
2918
+ f(e.$$.fragment, n), r = !1;
2919
+ },
2920
+ d(n) {
2921
+ I(e, n);
2922
+ }
2923
+ };
2924
+ }
2925
+ function gi(t) {
2926
+ let e, r, n, i, s, l, o, c, u, _;
2927
+ return n = new z({
2928
+ props: {
2929
+ $$slots: { default: [ci] },
2930
+ $$scope: { ctx: t }
2931
+ }
2932
+ }), s = new z({
2933
+ props: {
2934
+ $$slots: { default: [ai] },
2935
+ $$scope: { ctx: t }
2936
+ }
2937
+ }), o = new Ne({
2938
+ props: {
2939
+ $$slots: { default: [mi] },
2940
+ $$scope: { ctx: t }
2941
+ }
2942
+ }), {
2943
+ c() {
2944
+ e = $("div"), r = $("form"), w(n.$$.fragment), i = P(), w(s.$$.fragment), l = P(), w(o.$$.fragment);
2945
+ },
2946
+ m(A, k) {
2947
+ g(A, e, k), T(e, r), E(n, r, null), T(r, i), E(s, r, null), T(r, l), E(o, r, null), c = !0, u || (_ = Ee(r, "submit", pt(
2948
+ /*handleContinue*/
2949
+ t[2]
2950
+ )), u = !0);
2951
+ },
2952
+ p(A, [k]) {
2953
+ const B = {};
2954
+ k & /*$$scope*/
2955
+ 32 && (B.$$scope = { dirty: k, ctx: A }), n.$set(B);
2956
+ const b = {};
2957
+ k & /*$$scope, email*/
2958
+ 34 && (b.$$scope = { dirty: k, ctx: A }), s.$set(b);
2959
+ const y = {};
2960
+ k & /*$$scope, onClose*/
2961
+ 33 && (y.$$scope = { dirty: k, ctx: A }), o.$set(y);
2962
+ },
2963
+ i(A) {
2964
+ c || (a(n.$$.fragment, A), a(s.$$.fragment, A), a(o.$$.fragment, A), c = !0);
2965
+ },
2966
+ o(A) {
2967
+ f(n.$$.fragment, A), f(s.$$.fragment, A), f(o.$$.fragment, A), c = !1;
2968
+ },
2969
+ d(A) {
2970
+ A && m(e), I(n), I(s), I(o), u = !1, _();
2971
+ }
2972
+ };
2973
+ }
2974
+ function Ai(t, e, r) {
2975
+ let n, { onContinue: i } = e, { onClose: s } = e;
2976
+ const l = async () => {
2977
+ i({ email: n });
2978
+ };
2979
+ function o() {
2980
+ n = this.value, r(1, n);
2981
+ }
2982
+ return t.$$set = (c) => {
2983
+ "onContinue" in c && r(3, i = c.onContinue), "onClose" in c && r(0, s = c.onClose);
2984
+ }, r(1, n = ""), [s, n, l, i, o];
2985
+ }
2986
+ class _i extends C {
2987
+ constructor(e) {
2988
+ super(), U(this, e, Ai, gi, R, { onContinue: 3, onClose: 0 }, oi);
2989
+ }
2990
+ }
2991
+ const pi = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20opacity='0.5'%20clip-path='url(%23clip0_344_3390)'%3e%3cpath%20d='M7%2018C5.9%2018%205.01%2018.9%205.01%2020C5.01%2021.1%205.9%2022%207%2022C8.1%2022%209%2021.1%209%2020C9%2018.9%208.1%2018%207%2018ZM1%202V4H3L6.6%2011.59L5.25%2014.04C5.09%2014.32%205%2014.65%205%2015C5%2016.1%205.9%2017%207%2017H19V15H7.42C7.28%2015%207.17%2014.89%207.17%2014.75L7.2%2014.63L8.1%2013H15.55C16.3%2013%2016.96%2012.59%2017.3%2011.97L20.88%205.48C20.96%205.34%2021%205.17%2021%205C21%204.45%2020.55%204%2020%204H5.21L4.27%202H1ZM17%2018C15.9%2018%2015.01%2018.9%2015.01%2020C15.01%2021.1%2015.9%2022%2017%2022C18.1%2022%2019%2021.1%2019%2020C19%2018.9%2018.1%2018%2017%2018Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_344_3390'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
2992
+ function hi(t) {
2993
+ let e, r;
2994
+ return {
2995
+ c() {
2996
+ e = $("img"), q(e.src, r = pi) || h(e, "src", r), h(e, "alt", "icon"), h(e, "class", "rcb-ui-asset-icon");
2997
+ },
2998
+ m(n, i) {
2999
+ g(n, e, i);
3000
+ },
3001
+ p: v,
3002
+ i: v,
3003
+ o: v,
3004
+ d(n) {
3005
+ n && m(e);
3006
+ }
3007
+ };
3008
+ }
3009
+ class Ei extends C {
3010
+ constructor(e) {
3011
+ super(), U(this, e, null, hi, R, {});
3012
+ }
3013
+ }
3014
+ function Ii(t) {
3015
+ O(t, "svelte-1ggdgso", ".rcb-header-layout.svelte-1ggdgso{display:flex;justify-content:space-between;align-items:center;width:100%}");
3016
+ }
3017
+ function wi(t) {
3018
+ let e, r, n, i, s;
3019
+ return r = new bt({
3020
+ props: { brandingInfo: (
3021
+ /*brandingInfo*/
3022
+ t[0]
3023
+ ) }
3024
+ }), i = new Ei({}), {
3025
+ c() {
3026
+ e = $("div"), w(r.$$.fragment), n = P(), w(i.$$.fragment), h(e, "class", "rcb-header-layout svelte-1ggdgso");
3027
+ },
3028
+ m(l, o) {
3029
+ g(l, e, o), E(r, e, null), T(e, n), E(i, e, null), s = !0;
3030
+ },
3031
+ p(l, o) {
3032
+ const c = {};
3033
+ o & /*brandingInfo*/
3034
+ 1 && (c.brandingInfo = /*brandingInfo*/
3035
+ l[0]), r.$set(c);
3036
+ },
3037
+ i(l) {
3038
+ s || (a(r.$$.fragment, l), a(i.$$.fragment, l), s = !0);
3039
+ },
3040
+ o(l) {
3041
+ f(r.$$.fragment, l), f(i.$$.fragment, l), s = !1;
3042
+ },
3043
+ d(l) {
3044
+ l && m(e), I(r), I(i);
3045
+ }
3046
+ };
3047
+ }
3048
+ function bi(t) {
3049
+ let e, r;
3050
+ return e = new z({
3051
+ props: {
3052
+ as: "header",
3053
+ $$slots: { default: [wi] },
3054
+ $$scope: { ctx: t }
3055
+ }
3056
+ }), {
3057
+ c() {
3058
+ w(e.$$.fragment);
3059
+ },
3060
+ m(n, i) {
3061
+ E(e, n, i), r = !0;
3062
+ },
3063
+ p(n, [i]) {
3064
+ const s = {};
3065
+ i & /*$$scope, brandingInfo*/
3066
+ 3 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s);
3067
+ },
3068
+ i(n) {
3069
+ r || (a(e.$$.fragment, n), r = !0);
3070
+ },
3071
+ o(n) {
3072
+ f(e.$$.fragment, n), r = !1;
3073
+ },
3074
+ d(n) {
3075
+ I(e, n);
3076
+ }
3077
+ };
3078
+ }
3079
+ function $i(t, e, r) {
3080
+ let { brandingInfo: n = null } = e;
3081
+ return t.$$set = (i) => {
3082
+ "brandingInfo" in i && r(0, n = i.brandingInfo);
3083
+ }, [n];
3084
+ }
3085
+ class ki extends C {
3086
+ constructor(e) {
3087
+ super(), U(this, e, $i, bi, R, { brandingInfo: 0 }, Ii);
3088
+ }
3089
+ }
3090
+ function Bi(t) {
3091
+ O(t, "svelte-17dhulw", ".rcb-modal-backdrop.svelte-17dhulw{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:rgba(40, 40, 40, 0.75);display:flex;flex-direction:column;justify-content:space-around}");
3092
+ }
3093
+ function yi(t) {
3094
+ let e, r;
3095
+ const n = (
3096
+ /*#slots*/
3097
+ t[1].default
3098
+ ), i = J(
3099
+ n,
3100
+ t,
3101
+ /*$$scope*/
3102
+ t[0],
3103
+ null
3104
+ );
3105
+ return {
3106
+ c() {
3107
+ e = $("div"), i && i.c(), h(e, "class", "rcb-modal-backdrop svelte-17dhulw");
3108
+ },
3109
+ m(s, l) {
3110
+ g(s, e, l), i && i.m(e, null), r = !0;
3111
+ },
3112
+ p(s, [l]) {
3113
+ i && i.p && (!r || l & /*$$scope*/
3114
+ 1) && V(
3115
+ i,
3116
+ n,
3117
+ s,
3118
+ /*$$scope*/
3119
+ s[0],
3120
+ r ? x(
3121
+ n,
3122
+ /*$$scope*/
3123
+ s[0],
3124
+ l,
3125
+ null
3126
+ ) : W(
3127
+ /*$$scope*/
3128
+ s[0]
3129
+ ),
3130
+ null
3131
+ );
3132
+ },
3133
+ i(s) {
3134
+ r || (a(i, s), r = !0);
3135
+ },
3136
+ o(s) {
3137
+ f(i, s), r = !1;
3138
+ },
3139
+ d(s) {
3140
+ s && m(e), i && i.d(s);
3141
+ }
3142
+ };
3143
+ }
3144
+ function Di(t, e, r) {
3145
+ let { $$slots: n = {}, $$scope: i } = e;
3146
+ return t.$$set = (s) => {
3147
+ "$$scope" in s && r(0, i = s.$$scope);
3148
+ }, [i, n];
3149
+ }
3150
+ class vi extends C {
3151
+ constructor(e) {
3152
+ super(), U(this, e, Di, yi, R, {}, Bi);
3153
+ }
3154
+ }
3155
+ function Qi(t) {
3156
+ O(t, "svelte-m6kocx", ".rcb-modal-main.svelte-m6kocx{box-sizing:border-box;border-radius:0.5rem;background-color:#fff;color:black;max-width:40rem;min-width:30rem;overflow-y:auto;padding:2.5rem}.rcb-modal-dark.svelte-m6kocx{background-color:#000;color:#fff;max-width:30rem;min-width:20rem}@media screen and (max-width: 60rem){.rcb-modal-main.svelte-m6kocx,.rcb-modal-dark.svelte-m6kocx{max-width:40rem;min-width:90vw}}");
3157
+ }
3158
+ function Mi(t) {
3159
+ let e, r, n;
3160
+ const i = (
3161
+ /*#slots*/
3162
+ t[2].default
3163
+ ), s = J(
3164
+ i,
3165
+ t,
3166
+ /*$$scope*/
3167
+ t[1],
3168
+ null
3169
+ );
3170
+ return {
3171
+ c() {
3172
+ e = $("main"), s && s.c(), h(e, "class", r = _e(`rcb-modal-main ${/*dark*/
3173
+ t[0] ? "rcb-modal-dark" : ""}`) + " svelte-m6kocx");
3174
+ },
3175
+ m(l, o) {
3176
+ g(l, e, o), s && s.m(e, null), n = !0;
3177
+ },
3178
+ p(l, [o]) {
3179
+ s && s.p && (!n || o & /*$$scope*/
3180
+ 2) && V(
3181
+ s,
3182
+ i,
3183
+ l,
3184
+ /*$$scope*/
3185
+ l[1],
3186
+ n ? x(
3187
+ i,
3188
+ /*$$scope*/
3189
+ l[1],
3190
+ o,
3191
+ null
3192
+ ) : W(
3193
+ /*$$scope*/
3194
+ l[1]
3195
+ ),
3196
+ null
3197
+ ), (!n || o & /*dark*/
3198
+ 1 && r !== (r = _e(`rcb-modal-main ${/*dark*/
3199
+ l[0] ? "rcb-modal-dark" : ""}`) + " svelte-m6kocx")) && h(e, "class", r);
3200
+ },
3201
+ i(l) {
3202
+ n || (a(s, l), n = !0);
3203
+ },
3204
+ o(l) {
3205
+ f(s, l), n = !1;
3206
+ },
3207
+ d(l) {
3208
+ l && m(e), s && s.d(l);
3209
+ }
3210
+ };
3211
+ }
3212
+ function Ti(t, e, r) {
3213
+ let { $$slots: n = {}, $$scope: i } = e, { dark: s = !1 } = e;
3214
+ return t.$$set = (l) => {
3215
+ "dark" in l && r(0, s = l.dark), "$$scope" in l && r(1, i = l.$$scope);
3216
+ }, [s, i, n];
3217
+ }
3218
+ class Pi extends C {
3219
+ constructor(e) {
3220
+ super(), U(this, e, Ti, Mi, R, { dark: 0 }, Qi);
3221
+ }
3222
+ }
3223
+ function Ni(t) {
3224
+ let e;
3225
+ const r = (
3226
+ /*#slots*/
3227
+ t[1].default
3228
+ ), n = J(
3229
+ r,
3230
+ t,
3231
+ /*$$scope*/
3232
+ t[2],
3233
+ null
3234
+ );
3235
+ return {
3236
+ c() {
3237
+ n && n.c();
3238
+ },
3239
+ m(i, s) {
3240
+ n && n.m(i, s), e = !0;
3241
+ },
3242
+ p(i, s) {
3243
+ n && n.p && (!e || s & /*$$scope*/
3244
+ 4) && V(
3245
+ n,
3246
+ r,
3247
+ i,
3248
+ /*$$scope*/
3249
+ i[2],
3250
+ e ? x(
3251
+ r,
3252
+ /*$$scope*/
3253
+ i[2],
3254
+ s,
3255
+ null
3256
+ ) : W(
3257
+ /*$$scope*/
3258
+ i[2]
3259
+ ),
3260
+ null
3261
+ );
3262
+ },
3263
+ i(i) {
3264
+ e || (a(n, i), e = !0);
3265
+ },
3266
+ o(i) {
3267
+ f(n, i), e = !1;
3268
+ },
3269
+ d(i) {
3270
+ n && n.d(i);
3271
+ }
3272
+ };
3273
+ }
3274
+ function Ri(t) {
3275
+ let e, r;
3276
+ return e = new vi({
3277
+ props: {
3278
+ $$slots: { default: [Ui] },
3279
+ $$scope: { ctx: t }
3280
+ }
3281
+ }), {
3282
+ c() {
3283
+ w(e.$$.fragment);
3284
+ },
3285
+ m(n, i) {
3286
+ E(e, n, i), r = !0;
3287
+ },
3288
+ p(n, i) {
3289
+ const s = {};
3290
+ i & /*$$scope*/
3291
+ 4 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s);
3292
+ },
3293
+ i(n) {
3294
+ r || (a(e.$$.fragment, n), r = !0);
3295
+ },
3296
+ o(n) {
3297
+ f(e.$$.fragment, n), r = !1;
3298
+ },
3299
+ d(n) {
3300
+ I(e, n);
3301
+ }
3302
+ };
3303
+ }
3304
+ function Ui(t) {
3305
+ let e;
3306
+ const r = (
3307
+ /*#slots*/
3308
+ t[1].default
3309
+ ), n = J(
3310
+ r,
3311
+ t,
3312
+ /*$$scope*/
3313
+ t[2],
3314
+ null
3315
+ );
3316
+ return {
3317
+ c() {
3318
+ n && n.c();
3319
+ },
3320
+ m(i, s) {
3321
+ n && n.m(i, s), e = !0;
3322
+ },
3323
+ p(i, s) {
3324
+ n && n.p && (!e || s & /*$$scope*/
3325
+ 4) && V(
3326
+ n,
3327
+ r,
3328
+ i,
3329
+ /*$$scope*/
3330
+ i[2],
3331
+ e ? x(
3332
+ r,
3333
+ /*$$scope*/
3334
+ i[2],
3335
+ s,
3336
+ null
3337
+ ) : W(
3338
+ /*$$scope*/
3339
+ i[2]
3340
+ ),
3341
+ null
3342
+ );
3343
+ },
3344
+ i(i) {
3345
+ e || (a(n, i), e = !0);
3346
+ },
3347
+ o(i) {
3348
+ f(n, i), e = !1;
3349
+ },
3350
+ d(i) {
3351
+ n && n.d(i);
3352
+ }
3353
+ };
3354
+ }
3355
+ function Ci(t) {
3356
+ let e, r, n, i;
3357
+ const s = [Ri, Ni], l = [];
3358
+ function o(c, u) {
3359
+ return (
3360
+ /*condition*/
3361
+ c[0] ? 0 : 1
3362
+ );
3363
+ }
3364
+ return e = o(t), r = l[e] = s[e](t), {
3365
+ c() {
3366
+ r.c(), n = ne();
3367
+ },
3368
+ m(c, u) {
3369
+ l[e].m(c, u), g(c, n, u), i = !0;
3370
+ },
3371
+ p(c, [u]) {
3372
+ let _ = e;
3373
+ e = o(c), e === _ ? l[e].p(c, u) : (F(), f(l[_], 1, 1, () => {
3374
+ l[_] = null;
3375
+ }), G(), r = l[e], r ? r.p(c, u) : (r = l[e] = s[e](c), r.c()), a(r, 1), r.m(n.parentNode, n));
3376
+ },
3377
+ i(c) {
3378
+ i || (a(r), i = !0);
3379
+ },
3380
+ o(c) {
3381
+ f(r), i = !1;
3382
+ },
3383
+ d(c) {
3384
+ c && m(n), l[e].d(c);
3385
+ }
3386
+ };
3387
+ }
3388
+ function Si(t, e, r) {
3389
+ let { $$slots: n = {}, $$scope: i } = e, { condition: s = !1 } = e;
3390
+ return t.$$set = (l) => {
3391
+ "condition" in l && r(0, s = l.condition), "$$scope" in l && r(2, i = l.$$scope);
3392
+ }, [s, n, i];
3393
+ }
3394
+ class Oi extends C {
3395
+ constructor(e) {
3396
+ super(), U(this, e, Si, Ci, R, { condition: 0 });
3397
+ }
3398
+ }
3399
+ function nt(t) {
3400
+ let e, r;
3401
+ return e = new ki({
3402
+ props: { brandingInfo: (
3403
+ /*brandingInfo*/
3404
+ t[2]
3405
+ ) }
3406
+ }), {
3407
+ c() {
3408
+ w(e.$$.fragment);
3409
+ },
3410
+ m(n, i) {
3411
+ E(e, n, i), r = !0;
3412
+ },
3413
+ p(n, i) {
3414
+ const s = {};
3415
+ i & /*brandingInfo*/
3416
+ 4 && (s.brandingInfo = /*brandingInfo*/
3417
+ n[2]), e.$set(s);
3418
+ },
3419
+ i(n) {
3420
+ r || (a(e.$$.fragment, n), r = !0);
3421
+ },
3422
+ o(n) {
3423
+ f(e.$$.fragment, n), r = !1;
3424
+ },
3425
+ d(n) {
3426
+ I(e, n);
3427
+ }
3428
+ };
3429
+ }
3430
+ function Li(t) {
3431
+ let e, r, n = (
3432
+ /*showHeader*/
3433
+ t[1] && nt(t)
3434
+ );
3435
+ const i = (
3436
+ /*#slots*/
3437
+ t[3].default
3438
+ ), s = J(
3439
+ i,
3440
+ t,
3441
+ /*$$scope*/
3442
+ t[4],
3443
+ null
3444
+ );
3445
+ return {
3446
+ c() {
3447
+ n && n.c(), e = P(), s && s.c();
3448
+ },
3449
+ m(l, o) {
3450
+ n && n.m(l, o), g(l, e, o), s && s.m(l, o), r = !0;
3451
+ },
3452
+ p(l, o) {
3453
+ /*showHeader*/
3454
+ l[1] ? n ? (n.p(l, o), o & /*showHeader*/
3455
+ 2 && a(n, 1)) : (n = nt(l), n.c(), a(n, 1), n.m(e.parentNode, e)) : n && (F(), f(n, 1, 1, () => {
3456
+ n = null;
3457
+ }), G()), s && s.p && (!r || o & /*$$scope*/
3458
+ 16) && V(
3459
+ s,
3460
+ i,
3461
+ l,
3462
+ /*$$scope*/
3463
+ l[4],
3464
+ r ? x(
3465
+ i,
3466
+ /*$$scope*/
3467
+ l[4],
3468
+ o,
3469
+ null
3470
+ ) : W(
3471
+ /*$$scope*/
3472
+ l[4]
3473
+ ),
3474
+ null
3475
+ );
3476
+ },
3477
+ i(l) {
3478
+ r || (a(n), a(s, l), r = !0);
3479
+ },
3480
+ o(l) {
3481
+ f(n), f(s, l), r = !1;
3482
+ },
3483
+ d(l) {
3484
+ l && m(e), n && n.d(l), s && s.d(l);
3485
+ }
3486
+ };
3487
+ }
3488
+ function Fi(t) {
3489
+ let e, r;
3490
+ return e = new Pi({
3491
+ props: {
3492
+ dark: (
3493
+ /*dark*/
3494
+ t[0]
3495
+ ),
3496
+ $$slots: { default: [Li] },
3497
+ $$scope: { ctx: t }
3498
+ }
3499
+ }), {
3500
+ c() {
3501
+ w(e.$$.fragment);
3502
+ },
3503
+ m(n, i) {
3504
+ E(e, n, i), r = !0;
3505
+ },
3506
+ p(n, [i]) {
3507
+ const s = {};
3508
+ i & /*dark*/
3509
+ 1 && (s.dark = /*dark*/
3510
+ n[0]), i & /*$$scope, brandingInfo, showHeader*/
3511
+ 22 && (s.$$scope = { dirty: i, ctx: n }), e.$set(s);
3512
+ },
3513
+ i(n) {
3514
+ r || (a(e.$$.fragment, n), r = !0);
3515
+ },
3516
+ o(n) {
3517
+ f(e.$$.fragment, n), r = !1;
3518
+ },
3519
+ d(n) {
3520
+ I(e, n);
3521
+ }
3522
+ };
3523
+ }
3524
+ function Gi(t, e, r) {
3525
+ let { $$slots: n = {}, $$scope: i } = e, { dark: s = !1 } = e, { showHeader: l = !1 } = e, { brandingInfo: o = null } = e;
3526
+ return t.$$set = (c) => {
3527
+ "dark" in c && r(0, s = c.dark), "showHeader" in c && r(1, l = c.showHeader), "brandingInfo" in c && r(2, o = c.brandingInfo), "$$scope" in c && r(4, i = c.$$scope);
3528
+ }, [s, l, o, n, i];
3529
+ }
3530
+ class Dt extends C {
3531
+ constructor(e) {
3532
+ super(), U(this, e, Gi, Fi, R, { dark: 0, showHeader: 1, brandingInfo: 2 });
3533
+ }
3534
+ }
3535
+ var Re = /* @__PURE__ */ ((t) => (t[t.UnknownError = 0] = "UnknownError", t[t.UserCancelledError = 1] = "UserCancelledError", t[t.StoreProblemError = 2] = "StoreProblemError", t[t.PurchaseNotAllowedError = 3] = "PurchaseNotAllowedError", t[t.PurchaseInvalidError = 4] = "PurchaseInvalidError", t[t.ProductNotAvailableForPurchaseError = 5] = "ProductNotAvailableForPurchaseError", t[t.ProductAlreadyPurchasedError = 6] = "ProductAlreadyPurchasedError", t[t.ReceiptAlreadyInUseError = 7] = "ReceiptAlreadyInUseError", t[t.InvalidReceiptError = 8] = "InvalidReceiptError", t[t.MissingReceiptFileError = 9] = "MissingReceiptFileError", t[t.NetworkError = 10] = "NetworkError", t[t.InvalidCredentialsError = 11] = "InvalidCredentialsError", t[t.UnexpectedBackendResponseError = 12] = "UnexpectedBackendResponseError", t[t.InvalidAppUserIdError = 14] = "InvalidAppUserIdError", t[t.OperationAlreadyInProgressError = 15] = "OperationAlreadyInProgressError", t[t.UnknownBackendError = 16] = "UnknownBackendError", t[t.InvalidAppleSubscriptionKeyError = 17] = "InvalidAppleSubscriptionKeyError", t[t.IneligibleError = 18] = "IneligibleError", t[t.InsufficientPermissionsError = 19] = "InsufficientPermissionsError", t[t.PaymentPendingError = 20] = "PaymentPendingError", t[t.InvalidSubscriberAttributesError = 21] = "InvalidSubscriberAttributesError", t[t.LogOutWithAnonymousUserError = 22] = "LogOutWithAnonymousUserError", t[t.ConfigurationError = 23] = "ConfigurationError", t[t.UnsupportedError = 24] = "UnsupportedError", t[t.EmptySubscriberAttributesError = 25] = "EmptySubscriberAttributesError", t[t.CustomerInfoError = 28] = "CustomerInfoError", t[t.SignatureVerificationError = 36] = "SignatureVerificationError", t))(Re || {});
3536
+ class ye {
3537
+ static getPublicMessage(e) {
3538
+ switch (e) {
3539
+ case 0:
3540
+ return "Unknown error.";
3541
+ case 1:
3542
+ return "Purchase was cancelled.";
3543
+ case 2:
3544
+ return "There was a problem with the store.";
3545
+ case 3:
3546
+ return "The device or user is not allowed to make the purchase.";
3547
+ case 4:
3548
+ return "One or more of the arguments provided are invalid.";
3549
+ case 5:
3550
+ return "The product is not available for purchase.";
3551
+ case 6:
3552
+ return "This product is already active for the user.";
3553
+ case 7:
3554
+ return "There is already another active subscriber using the same receipt.";
3555
+ case 8:
3556
+ return "The receipt is not valid.";
3557
+ case 9:
3558
+ return "The receipt is missing.";
3559
+ case 10:
3560
+ return "Error performing request.";
3561
+ case 11:
3562
+ return "There was a credentials issue. Check the underlying error for more details.";
3563
+ case 12:
3564
+ return "Received unexpected response from the backend.";
3565
+ case 14:
3566
+ return "The app user id is not valid.";
3567
+ case 15:
3568
+ return "The operation is already in progress.";
3569
+ case 16:
3570
+ return "There was an unknown backend error.";
3571
+ case 17:
3572
+ return "Apple Subscription Key is invalid or not present. In order to provide subscription offers, you must first generate a subscription key. Please see https://docs.revenuecat.com/docs/ios-subscription-offers for more info.";
3573
+ case 18:
3574
+ return "The User is ineligible for that action.";
3575
+ case 19:
3576
+ return "App does not have sufficient permissions to make purchases.";
3577
+ case 20:
3578
+ return "The payment is pending.";
3579
+ case 21:
3580
+ return "One or more of the attributes sent could not be saved.";
3581
+ case 22:
3582
+ return "Called logOut but the current user is anonymous.";
3583
+ case 23:
3584
+ return "There is an issue with your configuration. Check the underlying error for more details.";
3585
+ case 24:
3586
+ return "There was a problem with the operation. Looks like we doesn't support that yet. Check the underlying error for more details.";
3587
+ case 25:
3588
+ return "A request for subscriber attributes returned none.";
3589
+ case 28:
3590
+ return "There was a problem related to the customer info.";
3591
+ case 36:
3592
+ return "Request failed signature verification. Please see https://rev.cat/trusted-entitlements for more info.";
3593
+ }
3594
+ }
3595
+ static getErrorCodeForBackendErrorCode(e) {
3596
+ switch (e) {
3597
+ case 7101:
3598
+ return 2;
3599
+ case 7102:
3600
+ return 7;
3601
+ case 7103:
3602
+ return 8;
3603
+ case 7107:
3604
+ case 7224:
3605
+ case 7225:
3606
+ return 11;
3607
+ case 7105:
3608
+ case 7106:
3609
+ return 4;
3610
+ case 7220:
3611
+ return 14;
3612
+ case 7229:
3613
+ return 2;
3614
+ case 7230:
3615
+ case 7e3:
3616
+ return 23;
3617
+ case 7231:
3618
+ return 2;
3619
+ case 7232:
3620
+ return 18;
3621
+ case 7263:
3622
+ case 7264:
3623
+ return 21;
3624
+ case 7104:
3625
+ case 7234:
3626
+ case 7226:
3627
+ case 7110:
3628
+ return 12;
3629
+ case 7662:
3630
+ return 24;
3631
+ }
3632
+ }
3633
+ static convertCodeToBackendErrorCode(e) {
3634
+ return e in vt ? e : null;
3635
+ }
3636
+ static convertPurchaseFlowErrorCodeToErrorCode(e) {
3637
+ switch (e) {
3638
+ case S.ErrorSettingUpPurchase:
3639
+ return 2;
3640
+ case S.ErrorChargingPayment:
3641
+ return 20;
3642
+ case S.NetworkError:
3643
+ return 10;
3644
+ case S.MissingEmailError:
3645
+ return 4;
3646
+ case S.StripeError:
3647
+ return 2;
3648
+ case S.UnknownError:
3649
+ return 0;
3650
+ }
3651
+ }
3652
+ }
3653
+ var vt = /* @__PURE__ */ ((t) => (t[t.BackendInvalidPlatform = 7e3] = "BackendInvalidPlatform", t[t.BackendStoreProblem = 7101] = "BackendStoreProblem", t[t.BackendCannotTransferPurchase = 7102] = "BackendCannotTransferPurchase", t[t.BackendInvalidReceiptToken = 7103] = "BackendInvalidReceiptToken", t[t.BackendInvalidAppStoreSharedSecret = 7104] = "BackendInvalidAppStoreSharedSecret", t[t.BackendInvalidPaymentModeOrIntroPriceNotProvided = 7105] = "BackendInvalidPaymentModeOrIntroPriceNotProvided", t[t.BackendProductIdForGoogleReceiptNotProvided = 7106] = "BackendProductIdForGoogleReceiptNotProvided", t[t.BackendInvalidPlayStoreCredentials = 7107] = "BackendInvalidPlayStoreCredentials", t[t.BackendInternalServerError = 7110] = "BackendInternalServerError", t[t.BackendEmptyAppUserId = 7220] = "BackendEmptyAppUserId", t[t.BackendInvalidAuthToken = 7224] = "BackendInvalidAuthToken", t[t.BackendInvalidAPIKey = 7225] = "BackendInvalidAPIKey", t[t.BackendBadRequest = 7226] = "BackendBadRequest", t[t.BackendPlayStoreQuotaExceeded = 7229] = "BackendPlayStoreQuotaExceeded", t[t.BackendPlayStoreInvalidPackageName = 7230] = "BackendPlayStoreInvalidPackageName", t[t.BackendPlayStoreGenericError = 7231] = "BackendPlayStoreGenericError", t[t.BackendUserIneligibleForPromoOffer = 7232] = "BackendUserIneligibleForPromoOffer", t[t.BackendInvalidAppleSubscriptionKey = 7234] = "BackendInvalidAppleSubscriptionKey", t[t.BackendInvalidSubscriberAttributes = 7263] = "BackendInvalidSubscriberAttributes", t[t.BackendInvalidSubscriberAttributesBody = 7264] = "BackendInvalidSubscriberAttributesBody", t[t.BackendProductIDsMalformed = 7662] = "BackendProductIDsMalformed", t))(vt || {});
3654
+ class ee extends Error {
3655
+ constructor(r, n, i) {
3656
+ super(n);
3657
+ D(this, "toString", () => `PurchasesError(code: ${Re[this.errorCode]}, message: ${this.message})`);
3658
+ this.errorCode = r, this.underlyingErrorMessage = i;
3659
+ }
3660
+ /** @internal */
3661
+ static getForBackendError(r, n) {
3662
+ const i = ye.getErrorCodeForBackendErrorCode(r);
3663
+ return new ee(
3664
+ i,
3665
+ ye.getPublicMessage(i),
3666
+ n
3667
+ );
3668
+ }
3669
+ /** @internal */
3670
+ static getForPurchasesFlowError(r) {
3671
+ return new ee(
3672
+ ye.convertPurchaseFlowErrorCodeToErrorCode(
3673
+ r.errorCode
3674
+ ),
3675
+ r.message,
3676
+ r.underlyingErrorMessage
3677
+ );
3678
+ }
3679
+ }
3680
+ class Yi extends Error {
3681
+ constructor() {
3682
+ super("Purchases must be configured before calling getInstance");
3683
+ }
3684
+ }
3685
+ const Hi = "0.0.10", ae = "https://api.revenuecat.com";
3686
+ var Qe;
3687
+ (function(t) {
3688
+ t[t.CONTINUE = 100] = "CONTINUE", t[t.SWITCHING_PROTOCOLS = 101] = "SWITCHING_PROTOCOLS", t[t.PROCESSING = 102] = "PROCESSING", t[t.EARLY_HINTS = 103] = "EARLY_HINTS", t[t.OK = 200] = "OK", t[t.CREATED = 201] = "CREATED", t[t.ACCEPTED = 202] = "ACCEPTED", t[t.NON_AUTHORITATIVE_INFORMATION = 203] = "NON_AUTHORITATIVE_INFORMATION", t[t.NO_CONTENT = 204] = "NO_CONTENT", t[t.RESET_CONTENT = 205] = "RESET_CONTENT", t[t.PARTIAL_CONTENT = 206] = "PARTIAL_CONTENT", t[t.MULTI_STATUS = 207] = "MULTI_STATUS", t[t.MULTIPLE_CHOICES = 300] = "MULTIPLE_CHOICES", t[t.MOVED_PERMANENTLY = 301] = "MOVED_PERMANENTLY", t[t.MOVED_TEMPORARILY = 302] = "MOVED_TEMPORARILY", t[t.SEE_OTHER = 303] = "SEE_OTHER", t[t.NOT_MODIFIED = 304] = "NOT_MODIFIED", t[t.USE_PROXY = 305] = "USE_PROXY", t[t.TEMPORARY_REDIRECT = 307] = "TEMPORARY_REDIRECT", t[t.PERMANENT_REDIRECT = 308] = "PERMANENT_REDIRECT", t[t.BAD_REQUEST = 400] = "BAD_REQUEST", t[t.UNAUTHORIZED = 401] = "UNAUTHORIZED", t[t.PAYMENT_REQUIRED = 402] = "PAYMENT_REQUIRED", t[t.FORBIDDEN = 403] = "FORBIDDEN", t[t.NOT_FOUND = 404] = "NOT_FOUND", t[t.METHOD_NOT_ALLOWED = 405] = "METHOD_NOT_ALLOWED", t[t.NOT_ACCEPTABLE = 406] = "NOT_ACCEPTABLE", t[t.PROXY_AUTHENTICATION_REQUIRED = 407] = "PROXY_AUTHENTICATION_REQUIRED", t[t.REQUEST_TIMEOUT = 408] = "REQUEST_TIMEOUT", t[t.CONFLICT = 409] = "CONFLICT", t[t.GONE = 410] = "GONE", t[t.LENGTH_REQUIRED = 411] = "LENGTH_REQUIRED", t[t.PRECONDITION_FAILED = 412] = "PRECONDITION_FAILED", t[t.REQUEST_TOO_LONG = 413] = "REQUEST_TOO_LONG", t[t.REQUEST_URI_TOO_LONG = 414] = "REQUEST_URI_TOO_LONG", t[t.UNSUPPORTED_MEDIA_TYPE = 415] = "UNSUPPORTED_MEDIA_TYPE", t[t.REQUESTED_RANGE_NOT_SATISFIABLE = 416] = "REQUESTED_RANGE_NOT_SATISFIABLE", t[t.EXPECTATION_FAILED = 417] = "EXPECTATION_FAILED", t[t.IM_A_TEAPOT = 418] = "IM_A_TEAPOT", t[t.INSUFFICIENT_SPACE_ON_RESOURCE = 419] = "INSUFFICIENT_SPACE_ON_RESOURCE", t[t.METHOD_FAILURE = 420] = "METHOD_FAILURE", t[t.MISDIRECTED_REQUEST = 421] = "MISDIRECTED_REQUEST", t[t.UNPROCESSABLE_ENTITY = 422] = "UNPROCESSABLE_ENTITY", t[t.LOCKED = 423] = "LOCKED", t[t.FAILED_DEPENDENCY = 424] = "FAILED_DEPENDENCY", t[t.UPGRADE_REQUIRED = 426] = "UPGRADE_REQUIRED", t[t.PRECONDITION_REQUIRED = 428] = "PRECONDITION_REQUIRED", t[t.TOO_MANY_REQUESTS = 429] = "TOO_MANY_REQUESTS", t[t.REQUEST_HEADER_FIELDS_TOO_LARGE = 431] = "REQUEST_HEADER_FIELDS_TOO_LARGE", t[t.UNAVAILABLE_FOR_LEGAL_REASONS = 451] = "UNAVAILABLE_FOR_LEGAL_REASONS", t[t.INTERNAL_SERVER_ERROR = 500] = "INTERNAL_SERVER_ERROR", t[t.NOT_IMPLEMENTED = 501] = "NOT_IMPLEMENTED", t[t.BAD_GATEWAY = 502] = "BAD_GATEWAY", t[t.SERVICE_UNAVAILABLE = 503] = "SERVICE_UNAVAILABLE", t[t.GATEWAY_TIMEOUT = 504] = "GATEWAY_TIMEOUT", t[t.HTTP_VERSION_NOT_SUPPORTED = 505] = "HTTP_VERSION_NOT_SUPPORTED", t[t.INSUFFICIENT_STORAGE = 507] = "INSUFFICIENT_STORAGE", t[t.NETWORK_AUTHENTICATION_REQUIRED = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
3689
+ })(Qe || (Qe = {}));
3690
+ function Ye(t) {
3691
+ return t ? t.startsWith("rcb_sb_") : !1;
3692
+ }
3693
+ async function ie(t, e, r, n) {
3694
+ const i = await fetch(t.url(), {
3695
+ method: t.method,
3696
+ headers: Ji(e, n),
3697
+ body: ji(r)
3698
+ });
3699
+ return await Ki(i, t), await i.json();
3700
+ }
3701
+ async function Ki(t, e) {
3702
+ const r = t.status;
3703
+ if (r >= Qe.INTERNAL_SERVER_ERROR)
3704
+ Oe(e, r, await t.text());
3705
+ else if (r >= Qe.BAD_REQUEST) {
3706
+ const n = await t.json(), i = n ? JSON.stringify(n) : null, s = n == null ? void 0 : n.code, l = n == null ? void 0 : n.message;
3707
+ if (s != null) {
3708
+ const o = ye.convertCodeToBackendErrorCode(s);
3709
+ if (o == null)
3710
+ Oe(e, r, i);
3711
+ else
3712
+ throw ee.getForBackendError(
3713
+ o,
3714
+ l
3715
+ );
3716
+ } else
3717
+ Oe(e, r, i);
3718
+ }
3719
+ }
3720
+ function Oe(t, e, r) {
3721
+ throw new ee(
3722
+ Re.UnknownBackendError,
3723
+ `Unknown backend error. Request: ${t.name}. Status code: ${e}. Body: ${r}.`
3724
+ );
3725
+ }
3726
+ function ji(t) {
3727
+ return t == null ? null : JSON.stringify(t);
3728
+ }
3729
+ function Ji(t, e) {
3730
+ let r = {
3731
+ Authorization: `Bearer ${t}`,
3732
+ "Content-Type": "application/json",
3733
+ Accept: "application/json",
3734
+ "X-Platform": "web",
3735
+ "X-Version": Hi,
3736
+ "X-Is-Sandbox": `${Ye(t)}`
3737
+ };
3738
+ return e != null && (r = { ...r, ...e }), r;
3739
+ }
3740
+ const Qt = "/v1/subscribers", Ue = "/rcbilling/v1";
3741
+ class xi {
3742
+ constructor(e) {
3743
+ D(this, "appUserId");
3744
+ D(this, "method", "GET");
3745
+ D(this, "name", "getOfferings");
3746
+ this.appUserId = e;
3747
+ }
3748
+ url() {
3749
+ return `${ae}${Qt}/${this.appUserId}/offerings`;
3750
+ }
3751
+ }
3752
+ class Vi {
3753
+ constructor() {
3754
+ D(this, "method", "POST");
3755
+ D(this, "name", "subscribe");
3756
+ }
3757
+ url() {
3758
+ return `${ae}${Ue}/subscribe`;
3759
+ }
3760
+ }
3761
+ class Wi {
3762
+ constructor(e, r) {
3763
+ D(this, "method", "GET");
3764
+ D(this, "name", "getProducts");
3765
+ D(this, "appUserId");
3766
+ D(this, "productIds");
3767
+ this.appUserId = e, this.productIds = r;
3768
+ }
3769
+ url() {
3770
+ return `${ae}${Ue}/subscribers/${this.appUserId}/products?id=${this.productIds.join("&id=")}`;
3771
+ }
3772
+ }
3773
+ class qi {
3774
+ constructor(e) {
3775
+ D(this, "method", "GET");
3776
+ D(this, "name", "getCustomerInfo");
3777
+ D(this, "appUserId");
3778
+ this.appUserId = e;
3779
+ }
3780
+ url() {
3781
+ return `${ae}${Qt}/${this.appUserId}`;
3782
+ }
3783
+ }
3784
+ class zi {
3785
+ constructor() {
3786
+ D(this, "method", "GET");
3787
+ D(this, "name", "getBrandingInfo");
3788
+ }
3789
+ url() {
3790
+ return `${ae}${Ue}/branding`;
3791
+ }
3792
+ }
3793
+ class Xi {
3794
+ constructor(e) {
3795
+ D(this, "method", "GET");
3796
+ D(this, "name", "getCheckoutStatus");
3797
+ D(this, "operationSessionId");
3798
+ this.operationSessionId = e;
3799
+ }
3800
+ url() {
3801
+ return `${ae}${Ue}/checkout/${this.operationSessionId}`;
3802
+ }
3803
+ }
3804
+ class Zi {
3805
+ constructor(e) {
3806
+ D(this, "API_KEY");
3807
+ this.API_KEY = e;
3808
+ }
3809
+ async getOfferings(e) {
3810
+ return await ie(
3811
+ new xi(e),
3812
+ this.API_KEY
3813
+ );
3814
+ }
3815
+ async getCustomerInfo(e) {
3816
+ return await ie(
3817
+ new qi(e),
3818
+ this.API_KEY
3819
+ );
3820
+ }
3821
+ async getProducts(e, r) {
3822
+ return await ie(
3823
+ new Wi(e, r),
3824
+ this.API_KEY
3825
+ );
3826
+ }
3827
+ async getBrandingInfo() {
3828
+ return await ie(
3829
+ new zi(),
3830
+ this.API_KEY
3831
+ );
3832
+ }
3833
+ async postSubscribe(e, r, n) {
3834
+ return await ie(
3835
+ new Vi(),
3836
+ this.API_KEY,
3837
+ {
3838
+ app_user_id: e,
3839
+ product_id: r,
3840
+ email: n
3841
+ }
3842
+ );
3843
+ }
3844
+ async getCheckoutStatus(e) {
3845
+ return await ie(
3846
+ new Xi(e),
3847
+ this.API_KEY
3848
+ );
3849
+ }
3850
+ }
3851
+ function es(t) {
3852
+ O(t, "svelte-ofxzf4", `.rcb-ui-container.svelte-ofxzf4{color-scheme:none;font-family:"PP Object Sans",
3853
+ -apple-system,
3854
+ BlinkMacSystemFont,
3855
+ avenir next,
3856
+ avenir,
3857
+ segoe ui,
3858
+ helvetica neue,
3859
+ helvetica,
3860
+ Cantarell,
3861
+ Ubuntu,
3862
+ roboto,
3863
+ noto,
3864
+ arial,
3865
+ sans-serif}.rcb-ui-layout.svelte-ofxzf4{display:flex;justify-content:center;align-items:flex-start}.rcb-ui-aside.svelte-ofxzf4{margin-right:1rem}@media screen and (max-width: 60rem){.rcb-ui-layout.svelte-ofxzf4{flex-direction:column;align-items:center;justify-content:flex-end;height:100%}.rcb-ui-aside.svelte-ofxzf4{margin-right:0;margin-bottom:1rem}}`);
3866
+ }
3867
+ function rt(t) {
3868
+ let e, r, n, i = (
3869
+ /*purchases*/
3870
+ t[1].isSandbox()
3871
+ ), s;
3872
+ r = new Dt({
3873
+ props: {
3874
+ dark: !0,
3875
+ showHeader: !0,
3876
+ brandingInfo: (
3877
+ /*brandingInfo*/
3878
+ t[3]
3879
+ ),
3880
+ $$slots: { default: [ts] },
3881
+ $$scope: { ctx: t }
3882
+ }
3883
+ });
3884
+ let l = i && st();
3885
+ return {
3886
+ c() {
3887
+ e = $("div"), w(r.$$.fragment), n = P(), l && l.c(), h(e, "class", "rcb-ui-aside svelte-ofxzf4");
3888
+ },
3889
+ m(o, c) {
3890
+ g(o, e, c), E(r, e, null), T(e, n), l && l.m(e, null), s = !0;
3891
+ },
3892
+ p(o, c) {
3893
+ const u = {};
3894
+ c & /*brandingInfo*/
3895
+ 8 && (u.brandingInfo = /*brandingInfo*/
3896
+ o[3]), c & /*$$scope, productDetails*/
3897
+ 4194308 && (u.$$scope = { dirty: c, ctx: o }), r.$set(u), c & /*purchases*/
3898
+ 2 && (i = /*purchases*/
3899
+ o[1].isSandbox()), i ? l ? c & /*purchases*/
3900
+ 2 && a(l, 1) : (l = st(), l.c(), a(l, 1), l.m(e, null)) : l && (F(), f(l, 1, 1, () => {
3901
+ l = null;
3902
+ }), G());
3903
+ },
3904
+ i(o) {
3905
+ s || (a(r.$$.fragment, o), a(l), s = !0);
3906
+ },
3907
+ o(o) {
3908
+ f(r.$$.fragment, o), f(l), s = !1;
3909
+ },
3910
+ d(o) {
3911
+ o && m(e), I(r), l && l.d();
3912
+ }
3913
+ };
3914
+ }
3915
+ function it(t) {
3916
+ let e, r;
3917
+ return e = new It({
3918
+ props: {
3919
+ productDetails: (
3920
+ /*productDetails*/
3921
+ t[2]
3922
+ )
3923
+ }
3924
+ }), {
3925
+ c() {
3926
+ w(e.$$.fragment);
3927
+ },
3928
+ m(n, i) {
3929
+ E(e, n, i), r = !0;
3930
+ },
3931
+ p(n, i) {
3932
+ const s = {};
3933
+ i & /*productDetails*/
3934
+ 4 && (s.productDetails = /*productDetails*/
3935
+ n[2]), e.$set(s);
3936
+ },
3937
+ i(n) {
3938
+ r || (a(e.$$.fragment, n), r = !0);
3939
+ },
3940
+ o(n) {
3941
+ f(e.$$.fragment, n), r = !1;
3942
+ },
3943
+ d(n) {
3944
+ I(e, n);
3945
+ }
3946
+ };
3947
+ }
3948
+ function ts(t) {
3949
+ let e, r, n = (
3950
+ /*productDetails*/
3951
+ t[2] && it(t)
3952
+ );
3953
+ return {
3954
+ c() {
3955
+ n && n.c(), e = ne();
3956
+ },
3957
+ m(i, s) {
3958
+ n && n.m(i, s), g(i, e, s), r = !0;
3959
+ },
3960
+ p(i, s) {
3961
+ /*productDetails*/
3962
+ i[2] ? n ? (n.p(i, s), s & /*productDetails*/
3963
+ 4 && a(n, 1)) : (n = it(i), n.c(), a(n, 1), n.m(e.parentNode, e)) : n && (F(), f(n, 1, 1, () => {
3964
+ n = null;
3965
+ }), G());
3966
+ },
3967
+ i(i) {
3968
+ r || (a(n), r = !0);
3969
+ },
3970
+ o(i) {
3971
+ f(n), r = !1;
3972
+ },
3973
+ d(i) {
3974
+ i && m(e), n && n.d(i);
3975
+ }
3976
+ };
3977
+ }
3978
+ function st(t) {
3979
+ let e, r;
3980
+ return e = new mn({}), {
3981
+ c() {
3982
+ w(e.$$.fragment);
3983
+ },
3984
+ m(n, i) {
3985
+ E(e, n, i), r = !0;
3986
+ },
3987
+ i(n) {
3988
+ r || (a(e.$$.fragment, n), r = !0);
3989
+ },
3990
+ o(n) {
3991
+ f(e.$$.fragment, n), r = !1;
3992
+ },
3993
+ d(n) {
3994
+ I(e, n);
3995
+ }
3996
+ };
3997
+ }
3998
+ function lt(t) {
3999
+ let e, r;
4000
+ return e = new It({
4001
+ props: {
4002
+ productDetails: (
4003
+ /*productDetails*/
4004
+ t[2]
4005
+ )
4006
+ }
4007
+ }), {
4008
+ c() {
4009
+ w(e.$$.fragment);
4010
+ },
4011
+ m(n, i) {
4012
+ E(e, n, i), r = !0;
4013
+ },
4014
+ p(n, i) {
4015
+ const s = {};
4016
+ i & /*productDetails*/
4017
+ 4 && (s.productDetails = /*productDetails*/
4018
+ n[2]), e.$set(s);
4019
+ },
4020
+ i(n) {
4021
+ r || (a(e.$$.fragment, n), r = !0);
4022
+ },
4023
+ o(n) {
4024
+ f(e.$$.fragment, n), r = !1;
4025
+ },
4026
+ d(n) {
4027
+ I(e, n);
4028
+ }
4029
+ };
4030
+ }
4031
+ function ot(t) {
4032
+ let e, r;
4033
+ return e = new Pe({}), {
4034
+ c() {
4035
+ w(e.$$.fragment);
4036
+ },
4037
+ m(n, i) {
4038
+ E(e, n, i), r = !0;
4039
+ },
4040
+ i(n) {
4041
+ r || (a(e.$$.fragment, n), r = !0);
4042
+ },
4043
+ o(n) {
4044
+ f(e.$$.fragment, n), r = !1;
4045
+ },
4046
+ d(n) {
4047
+ I(e, n);
4048
+ }
4049
+ };
4050
+ }
4051
+ function ct(t) {
4052
+ let e, r;
4053
+ return e = new Pe({}), {
4054
+ c() {
4055
+ w(e.$$.fragment);
4056
+ },
4057
+ m(n, i) {
4058
+ E(e, n, i), r = !0;
4059
+ },
4060
+ i(n) {
4061
+ r || (a(e.$$.fragment, n), r = !0);
4062
+ },
4063
+ o(n) {
4064
+ f(e.$$.fragment, n), r = !1;
4065
+ },
4066
+ d(n) {
4067
+ I(e, n);
4068
+ }
4069
+ };
4070
+ }
4071
+ function at(t) {
4072
+ let e, r;
4073
+ return e = new _i({
4074
+ props: {
4075
+ onContinue: (
4076
+ /*handleContinue*/
4077
+ t[9]
4078
+ ),
4079
+ onClose: (
4080
+ /*handleClose*/
4081
+ t[8]
4082
+ )
4083
+ }
4084
+ }), {
4085
+ c() {
4086
+ w(e.$$.fragment);
4087
+ },
4088
+ m(n, i) {
4089
+ E(e, n, i), r = !0;
4090
+ },
4091
+ p: v,
4092
+ i(n) {
4093
+ r || (a(e.$$.fragment, n), r = !0);
4094
+ },
4095
+ o(n) {
4096
+ f(e.$$.fragment, n), r = !1;
4097
+ },
4098
+ d(n) {
4099
+ I(e, n);
4100
+ }
4101
+ };
4102
+ }
4103
+ function ut(t) {
4104
+ let e, r;
4105
+ return e = new li({
4106
+ props: {
4107
+ paymentInfoCollectionMetadata: (
4108
+ /*paymentInfoCollectionMetadata*/
4109
+ t[4]
4110
+ ),
4111
+ onContinue: (
4112
+ /*handleContinue*/
4113
+ t[9]
4114
+ ),
4115
+ onClose: (
4116
+ /*handleClose*/
4117
+ t[8]
4118
+ ),
4119
+ onError: (
4120
+ /*handleError*/
4121
+ t[10]
4122
+ )
4123
+ }
4124
+ }), {
4125
+ c() {
4126
+ w(e.$$.fragment);
4127
+ },
4128
+ m(n, i) {
4129
+ E(e, n, i), r = !0;
4130
+ },
4131
+ p(n, i) {
4132
+ const s = {};
4133
+ i & /*paymentInfoCollectionMetadata*/
4134
+ 16 && (s.paymentInfoCollectionMetadata = /*paymentInfoCollectionMetadata*/
4135
+ n[4]), e.$set(s);
4136
+ },
4137
+ i(n) {
4138
+ r || (a(e.$$.fragment, n), r = !0);
4139
+ },
4140
+ o(n) {
4141
+ f(e.$$.fragment, n), r = !1;
4142
+ },
4143
+ d(n) {
4144
+ I(e, n);
4145
+ }
4146
+ };
4147
+ }
4148
+ function ft(t) {
4149
+ let e, r;
4150
+ return e = new Pe({}), {
4151
+ c() {
4152
+ w(e.$$.fragment);
4153
+ },
4154
+ m(n, i) {
4155
+ E(e, n, i), r = !0;
4156
+ },
4157
+ i(n) {
4158
+ r || (a(e.$$.fragment, n), r = !0);
4159
+ },
4160
+ o(n) {
4161
+ f(e.$$.fragment, n), r = !1;
4162
+ },
4163
+ d(n) {
4164
+ I(e, n);
4165
+ }
4166
+ };
4167
+ }
4168
+ function dt(t) {
4169
+ var n;
4170
+ let e, r;
4171
+ return e = new Ar({
4172
+ props: {
4173
+ brandingInfo: (
4174
+ /*brandingInfo*/
4175
+ t[3]
4176
+ ),
4177
+ lastError: (
4178
+ /*lastError*/
4179
+ t[5] ?? new Y(S.UnknownError, "Unknown error without state set.")
4180
+ ),
4181
+ supportEmail: (
4182
+ /*brandingInfo*/
4183
+ (n = t[3]) == null ? void 0 : n.seller_company_support_email
4184
+ ),
4185
+ onContinue: (
4186
+ /*closeWithError*/
4187
+ t[11]
4188
+ )
4189
+ }
4190
+ }), {
4191
+ c() {
4192
+ w(e.$$.fragment);
4193
+ },
4194
+ m(i, s) {
4195
+ E(e, i, s), r = !0;
4196
+ },
4197
+ p(i, s) {
4198
+ var o;
4199
+ const l = {};
4200
+ s & /*brandingInfo*/
4201
+ 8 && (l.brandingInfo = /*brandingInfo*/
4202
+ i[3]), s & /*lastError*/
4203
+ 32 && (l.lastError = /*lastError*/
4204
+ i[5] ?? new Y(S.UnknownError, "Unknown error without state set.")), s & /*brandingInfo*/
4205
+ 8 && (l.supportEmail = /*brandingInfo*/
4206
+ (o = i[3]) == null ? void 0 : o.seller_company_support_email), e.$set(l);
4207
+ },
4208
+ i(i) {
4209
+ r || (a(e.$$.fragment, i), r = !0);
4210
+ },
4211
+ o(i) {
4212
+ f(e.$$.fragment, i), r = !1;
4213
+ },
4214
+ d(i) {
4215
+ I(e, i);
4216
+ }
4217
+ };
4218
+ }
4219
+ function mt(t) {
4220
+ let e, r;
4221
+ return e = new Qr({
4222
+ props: {
4223
+ brandingInfo: (
4224
+ /*brandingInfo*/
4225
+ t[3]
4226
+ ),
4227
+ onContinue: (
4228
+ /*handleContinue*/
4229
+ t[9]
4230
+ )
4231
+ }
4232
+ }), {
4233
+ c() {
4234
+ w(e.$$.fragment);
4235
+ },
4236
+ m(n, i) {
4237
+ E(e, n, i), r = !0;
4238
+ },
4239
+ p(n, i) {
4240
+ const s = {};
4241
+ i & /*brandingInfo*/
4242
+ 8 && (s.brandingInfo = /*brandingInfo*/
4243
+ n[3]), e.$set(s);
4244
+ },
4245
+ i(n) {
4246
+ r || (a(e.$$.fragment, n), r = !0);
4247
+ },
4248
+ o(n) {
4249
+ f(e.$$.fragment, n), r = !1;
4250
+ },
4251
+ d(n) {
4252
+ I(e, n);
4253
+ }
4254
+ };
4255
+ }
4256
+ function ns(t) {
4257
+ let e, r, n, i, s, l, o, c, u, _ = (
4258
+ /*state*/
4259
+ t[6] === "present-offer" && /*productDetails*/
4260
+ t[2] && lt(t)
4261
+ ), A = (
4262
+ /*state*/
4263
+ t[6] === "present-offer" && !/*productDetails*/
4264
+ t[2] && ot()
4265
+ ), k = (
4266
+ /*state*/
4267
+ t[6] === "polling-purchase-status" && ct()
4268
+ ), B = (
4269
+ /*state*/
4270
+ t[6] === "needs-auth-info" && at(t)
4271
+ ), b = (
4272
+ /*state*/
4273
+ t[6] === "needs-payment-info" && /*paymentInfoCollectionMetadata*/
4274
+ t[4] && ut(t)
4275
+ ), y = (
4276
+ /*state*/
4277
+ t[6] === "loading" && ft()
4278
+ ), M = (
4279
+ /*state*/
4280
+ t[6] === "error" && dt(t)
4281
+ ), N = (
4282
+ /*state*/
4283
+ t[6] === "success" && mt(t)
4284
+ );
4285
+ return {
4286
+ c() {
4287
+ _ && _.c(), e = P(), A && A.c(), r = P(), k && k.c(), n = P(), B && B.c(), i = P(), b && b.c(), s = P(), y && y.c(), l = P(), M && M.c(), o = P(), N && N.c(), c = ne();
4288
+ },
4289
+ m(d, p) {
4290
+ _ && _.m(d, p), g(d, e, p), A && A.m(d, p), g(d, r, p), k && k.m(d, p), g(d, n, p), B && B.m(d, p), g(d, i, p), b && b.m(d, p), g(d, s, p), y && y.m(d, p), g(d, l, p), M && M.m(d, p), g(d, o, p), N && N.m(d, p), g(d, c, p), u = !0;
4291
+ },
4292
+ p(d, p) {
4293
+ /*state*/
4294
+ d[6] === "present-offer" && /*productDetails*/
4295
+ d[2] ? _ ? (_.p(d, p), p & /*state, productDetails*/
4296
+ 68 && a(_, 1)) : (_ = lt(d), _.c(), a(_, 1), _.m(e.parentNode, e)) : _ && (F(), f(_, 1, 1, () => {
4297
+ _ = null;
4298
+ }), G()), /*state*/
4299
+ d[6] === "present-offer" && !/*productDetails*/
4300
+ d[2] ? A ? p & /*state, productDetails*/
4301
+ 68 && a(A, 1) : (A = ot(), A.c(), a(A, 1), A.m(r.parentNode, r)) : A && (F(), f(A, 1, 1, () => {
4302
+ A = null;
4303
+ }), G()), /*state*/
4304
+ d[6] === "polling-purchase-status" ? k ? p & /*state*/
4305
+ 64 && a(k, 1) : (k = ct(), k.c(), a(k, 1), k.m(n.parentNode, n)) : k && (F(), f(k, 1, 1, () => {
4306
+ k = null;
4307
+ }), G()), /*state*/
4308
+ d[6] === "needs-auth-info" ? B ? (B.p(d, p), p & /*state*/
4309
+ 64 && a(B, 1)) : (B = at(d), B.c(), a(B, 1), B.m(i.parentNode, i)) : B && (F(), f(B, 1, 1, () => {
4310
+ B = null;
4311
+ }), G()), /*state*/
4312
+ d[6] === "needs-payment-info" && /*paymentInfoCollectionMetadata*/
4313
+ d[4] ? b ? (b.p(d, p), p & /*state, paymentInfoCollectionMetadata*/
4314
+ 80 && a(b, 1)) : (b = ut(d), b.c(), a(b, 1), b.m(s.parentNode, s)) : b && (F(), f(b, 1, 1, () => {
4315
+ b = null;
4316
+ }), G()), /*state*/
4317
+ d[6] === "loading" ? y ? p & /*state*/
4318
+ 64 && a(y, 1) : (y = ft(), y.c(), a(y, 1), y.m(l.parentNode, l)) : y && (F(), f(y, 1, 1, () => {
4319
+ y = null;
4320
+ }), G()), /*state*/
4321
+ d[6] === "error" ? M ? (M.p(d, p), p & /*state*/
4322
+ 64 && a(M, 1)) : (M = dt(d), M.c(), a(M, 1), M.m(o.parentNode, o)) : M && (F(), f(M, 1, 1, () => {
4323
+ M = null;
4324
+ }), G()), /*state*/
4325
+ d[6] === "success" ? N ? (N.p(d, p), p & /*state*/
4326
+ 64 && a(N, 1)) : (N = mt(d), N.c(), a(N, 1), N.m(c.parentNode, c)) : N && (F(), f(N, 1, 1, () => {
4327
+ N = null;
4328
+ }), G());
4329
+ },
4330
+ i(d) {
4331
+ u || (a(_), a(A), a(k), a(B), a(b), a(y), a(M), a(N), u = !0);
4332
+ },
4333
+ o(d) {
4334
+ f(_), f(A), f(k), f(B), f(b), f(y), f(M), f(N), u = !1;
4335
+ },
4336
+ d(d) {
4337
+ d && (m(e), m(r), m(n), m(i), m(s), m(l), m(o), m(c)), _ && _.d(d), A && A.d(d), k && k.d(d), B && B.d(d), b && b.d(d), y && y.d(d), M && M.d(d), N && N.d(d);
4338
+ }
4339
+ };
4340
+ }
4341
+ function rs(t) {
4342
+ let e, r = (
4343
+ /*statesWhereOfferDetailsAreShown*/
4344
+ t[7].includes(
4345
+ /*state*/
4346
+ t[6]
4347
+ )
4348
+ ), n, i, s, l = r && rt(t);
4349
+ return i = new Dt({
4350
+ props: {
4351
+ $$slots: { default: [ns] },
4352
+ $$scope: { ctx: t }
4353
+ }
4354
+ }), {
4355
+ c() {
4356
+ e = $("div"), l && l.c(), n = P(), w(i.$$.fragment), h(e, "class", "rcb-ui-layout svelte-ofxzf4");
4357
+ },
4358
+ m(o, c) {
4359
+ g(o, e, c), l && l.m(e, null), T(e, n), E(i, e, null), s = !0;
4360
+ },
4361
+ p(o, c) {
4362
+ c & /*state*/
4363
+ 64 && (r = /*statesWhereOfferDetailsAreShown*/
4364
+ o[7].includes(
4365
+ /*state*/
4366
+ o[6]
4367
+ )), r ? l ? (l.p(o, c), c & /*state*/
4368
+ 64 && a(l, 1)) : (l = rt(o), l.c(), a(l, 1), l.m(e, n)) : l && (F(), f(l, 1, 1, () => {
4369
+ l = null;
4370
+ }), G());
4371
+ const u = {};
4372
+ c & /*$$scope, brandingInfo, state, lastError, paymentInfoCollectionMetadata, productDetails*/
4373
+ 4194428 && (u.$$scope = { dirty: c, ctx: o }), i.$set(u);
4374
+ },
4375
+ i(o) {
4376
+ s || (a(l), a(i.$$.fragment, o), s = !0);
4377
+ },
4378
+ o(o) {
4379
+ f(l), f(i.$$.fragment, o), s = !1;
4380
+ },
4381
+ d(o) {
4382
+ o && m(e), l && l.d(), I(i);
4383
+ }
4384
+ };
4385
+ }
4386
+ function is(t) {
4387
+ let e, r, n;
4388
+ return r = new Oi({
4389
+ props: {
4390
+ condition: (
4391
+ /*asModal*/
4392
+ t[0]
4393
+ ),
4394
+ $$slots: { default: [rs] },
4395
+ $$scope: { ctx: t }
4396
+ }
4397
+ }), {
4398
+ c() {
4399
+ e = $("div"), w(r.$$.fragment), h(e, "class", "rcb-ui-container svelte-ofxzf4");
4400
+ },
4401
+ m(i, s) {
4402
+ g(i, e, s), E(r, e, null), n = !0;
4403
+ },
4404
+ p(i, [s]) {
4405
+ const l = {};
4406
+ s & /*asModal*/
4407
+ 1 && (l.condition = /*asModal*/
4408
+ i[0]), s & /*$$scope, brandingInfo, state, lastError, paymentInfoCollectionMetadata, productDetails, purchases*/
4409
+ 4194430 && (l.$$scope = { dirty: s, ctx: i }), r.$set(l);
4410
+ },
4411
+ i(i) {
4412
+ n || (a(r.$$.fragment, i), n = !0);
4413
+ },
4414
+ o(i) {
4415
+ f(r.$$.fragment, i), n = !1;
4416
+ },
4417
+ d(i) {
4418
+ i && m(e), I(r);
4419
+ }
4420
+ };
4421
+ }
4422
+ function ss(t, e, r) {
4423
+ var Ke;
4424
+ let { asModal: n = !0 } = e, { customerEmail: i } = e, { appUserId: s } = e, { rcPackage: l } = e, { onFinished: o } = e, { onError: c } = e, { onClose: u } = e, { purchases: _ } = e, { backend: A } = e, { purchaseOperationHelper: k } = e, B = null, b = null, y = null, M = null;
4425
+ const N = ((Ke = l.rcBillingProduct) == null ? void 0 : Ke.identifier) ?? null;
4426
+ let d = "present-offer";
4427
+ const p = ["present-offer", "needs-auth-info", "needs-payment-info", "loading"];
4428
+ Te(async () => {
4429
+ if (r(2, B = l.rcBillingProduct), r(3, b = await A.getBrandingInfo()), d === "present-offer") {
4430
+ i ? He() : r(6, d = "needs-auth-info");
4431
+ return;
4432
+ }
4433
+ });
4434
+ const Mt = () => {
4435
+ u();
4436
+ }, He = () => {
4437
+ if (N === null) {
4438
+ ue(new Y(S.ErrorSettingUpPurchase, "Product ID was not set before purchase."));
4439
+ return;
4440
+ } else
4441
+ r(6, d = "loading");
4442
+ if (!i) {
4443
+ ue(new Y(S.MissingEmailError));
4444
+ return;
4445
+ }
4446
+ k.startPurchase(s, N, i).then((Q) => {
4447
+ if (Q.next_action === "collect_payment_info") {
4448
+ r(6, d = "needs-payment-info"), r(4, y = Q);
4449
+ return;
4450
+ }
4451
+ if (Q.next_action === "completed") {
4452
+ r(6, d = "success");
4453
+ return;
4454
+ }
4455
+ }).catch((Q) => {
4456
+ ue(new Y(S.ErrorSettingUpPurchase, Q.message, Q.underlyingErrorMessage));
4457
+ });
4458
+ }, Tt = (Q) => {
4459
+ if (d === "needs-auth-info") {
4460
+ Q && r(12, i = Q.email), He();
4461
+ return;
4462
+ }
4463
+ if (d === "needs-payment-info") {
4464
+ r(6, d = "polling-purchase-status"), k.pollCurrentPurchaseForCompletion().then(() => {
4465
+ r(6, d = "success");
4466
+ }).catch((Nt) => {
4467
+ ue(Nt);
4468
+ });
4469
+ return;
4470
+ }
4471
+ if (d === "success" || d === "error") {
4472
+ o();
4473
+ return;
4474
+ }
4475
+ r(6, d = "success");
4476
+ }, ue = (Q) => {
4477
+ r(5, M = Q), r(6, d = "error");
4478
+ }, Pt = () => {
4479
+ c(M ?? new Y(S.UnknownError, "Unknown error without state set."));
4480
+ };
4481
+ return t.$$set = (Q) => {
4482
+ "asModal" in Q && r(0, n = Q.asModal), "customerEmail" in Q && r(12, i = Q.customerEmail), "appUserId" in Q && r(13, s = Q.appUserId), "rcPackage" in Q && r(14, l = Q.rcPackage), "onFinished" in Q && r(15, o = Q.onFinished), "onError" in Q && r(16, c = Q.onError), "onClose" in Q && r(17, u = Q.onClose), "purchases" in Q && r(1, _ = Q.purchases), "backend" in Q && r(18, A = Q.backend), "purchaseOperationHelper" in Q && r(19, k = Q.purchaseOperationHelper);
4483
+ }, [
4484
+ n,
4485
+ _,
4486
+ B,
4487
+ b,
4488
+ y,
4489
+ M,
4490
+ d,
4491
+ p,
4492
+ Mt,
4493
+ Tt,
4494
+ ue,
4495
+ Pt,
4496
+ i,
4497
+ s,
4498
+ l,
4499
+ o,
4500
+ c,
4501
+ u,
4502
+ A,
4503
+ k
4504
+ ];
4505
+ }
4506
+ class ls extends C {
4507
+ constructor(e) {
4508
+ super(), U(
4509
+ this,
4510
+ e,
4511
+ ss,
4512
+ is,
4513
+ R,
4514
+ {
4515
+ asModal: 0,
4516
+ customerEmail: 12,
4517
+ appUserId: 13,
4518
+ rcPackage: 14,
4519
+ onFinished: 15,
4520
+ onError: 16,
4521
+ onClose: 17,
4522
+ purchases: 1,
4523
+ backend: 18,
4524
+ purchaseOperationHelper: 19
4525
+ },
4526
+ es
4527
+ );
4528
+ }
4529
+ }
4530
+ function os(t) {
4531
+ return t.expires_date == null ? !0 : new Date(t.expires_date) > /* @__PURE__ */ new Date();
4532
+ }
4533
+ function cs(t, e, r) {
4534
+ return {
4535
+ identifier: t,
4536
+ isActive: os(e),
4537
+ willRenew: fs(e, r),
4538
+ store: (r == null ? void 0 : r.store) ?? "unknown",
4539
+ originalPurchaseDate: new Date(e.purchase_date),
4540
+ expirationDate: De(e.expires_date),
4541
+ productIdentifier: e.product_identifier,
4542
+ unsubscribeDetectedAt: De(
4543
+ r == null ? void 0 : r.unsubscribe_detected_at
4544
+ ),
4545
+ billingIssueDetectedAt: De(
4546
+ r == null ? void 0 : r.billing_issues_detected_at
4547
+ ),
4548
+ isSandbox: (r == null ? void 0 : r.is_sandbox) ?? !1,
4549
+ periodType: (r == null ? void 0 : r.period_type) ?? "normal"
4550
+ };
4551
+ }
4552
+ function as(t, e) {
4553
+ const r = {}, n = {};
4554
+ for (const i in t) {
4555
+ const s = e[i] ?? null, l = cs(
4556
+ i,
4557
+ t[i],
4558
+ s
4559
+ );
4560
+ r[i] = l, l.isActive && (n[i] = l);
4561
+ }
4562
+ return {
4563
+ all: r,
4564
+ active: n
4565
+ };
4566
+ }
4567
+ function De(t) {
4568
+ return t == null ? null : new Date(t);
4569
+ }
4570
+ function us(t) {
4571
+ const e = ms(t), r = t.subscriber;
4572
+ return {
4573
+ entitlements: as(
4574
+ r.entitlements,
4575
+ r.subscriptions
4576
+ ),
4577
+ allExpirationDatesByProduct: e,
4578
+ allPurchaseDatesByProduct: ds(t),
4579
+ activeSubscriptions: gs(e),
4580
+ managementURL: r.management_url,
4581
+ requestDate: new Date(t.request_date),
4582
+ firstSeenDate: new Date(r.first_seen),
4583
+ originalPurchaseDate: De(
4584
+ r.original_purchase_date
4585
+ ),
4586
+ originalAppUserId: t.subscriber.original_app_user_id
4587
+ };
4588
+ }
4589
+ function fs(t, e) {
4590
+ if (e == null)
4591
+ return !1;
4592
+ const r = e.store == "promotional", n = t.expires_date == null, i = e.unsubscribe_detected_at != null, s = e.billing_issues_detected_at != null;
4593
+ return !(r || n || i || s);
4594
+ }
4595
+ function ds(t) {
4596
+ const e = {};
4597
+ for (const r in t.subscriber.subscriptions) {
4598
+ const n = t.subscriber.subscriptions[r];
4599
+ e[r] = new Date(
4600
+ n.purchase_date
4601
+ );
4602
+ }
4603
+ return e;
4604
+ }
4605
+ function ms(t) {
4606
+ const e = {};
4607
+ for (const r in t.subscriber.subscriptions) {
4608
+ const n = t.subscriber.subscriptions[r];
4609
+ n.expires_date == null ? e[r] = null : e[r] = new Date(
4610
+ n.expires_date
4611
+ );
4612
+ }
4613
+ return e;
4614
+ }
4615
+ function gs(t) {
4616
+ const e = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Date();
4617
+ for (const n in t) {
4618
+ const i = t[n];
4619
+ (i == null || i > r) && e.add(n);
4620
+ }
4621
+ return e;
4622
+ }
4623
+ const K = class K {
4624
+ /** @internal */
4625
+ constructor(e, r) {
4626
+ /** @internal */
4627
+ D(this, "_API_KEY");
4628
+ /** @internal */
4629
+ D(this, "_appUserId");
4630
+ /** @internal */
4631
+ D(this, "backend");
4632
+ /** @internal */
4633
+ D(this, "purchaseOperationHelper");
4634
+ /** @internal */
4635
+ D(this, "toOfferings", (e, r) => {
4636
+ const n = e.offerings.find(
4637
+ (o) => o.identifier === e.current_offering_id
4638
+ ) ?? null, i = {};
4639
+ r.product_details.forEach((o) => {
4640
+ i[o.identifier] = o;
4641
+ });
4642
+ const s = n == null ? null : je(n, i), l = {};
4643
+ return e.offerings.forEach((o) => {
4644
+ const c = je(o, i);
4645
+ c != null && (l[o.identifier] = c);
4646
+ }), Object.keys(l).length == 0 && j.debugLog(
4647
+ "Empty offerings. Please make sure you've configured offerings correctly in the RevenueCat dashboard and that the products are properly configured."
4648
+ ), {
4649
+ all: l,
4650
+ current: s
4651
+ };
4652
+ });
4653
+ this._API_KEY = e, this._appUserId = r, Ye(e) && j.debugLog("Initializing Purchases SDK with sandbox API Key"), this.backend = new Zi(this._API_KEY), this.purchaseOperationHelper = new Dn(this.backend);
4654
+ }
4655
+ /**
4656
+ * Set the log level. Logs of the given level and below will be printed
4657
+ * in the console.
4658
+ * Default is `LogLevel.Silent` so no logs will be printed in the console.
4659
+ * @param logLevel - LogLevel to set.
4660
+ */
4661
+ static setLogLevel(e) {
4662
+ j.setLogLevel(e);
4663
+ }
4664
+ /**
4665
+ * Get the singleton instance of Purchases. It's preferred to use the instance
4666
+ * obtained from the {@link Purchases.configure} method when possible.
4667
+ * @throws {@link UninitializedPurchasesError} if the instance has not been initialized yet.
4668
+ */
4669
+ static getSharedInstance() {
4670
+ if (K.isConfigured())
4671
+ return K.instance;
4672
+ throw new Yi();
4673
+ }
4674
+ /**
4675
+ * Returns whether the Purchases SDK is configured or not.
4676
+ */
4677
+ static isConfigured() {
4678
+ return K.instance !== void 0;
4679
+ }
4680
+ /**
4681
+ * Configures the Purchases SDK. This should be called as soon as your app
4682
+ * has a unique user id for your user. You should only call this once, and
4683
+ * keep the returned instance around for use throughout your application.
4684
+ * @param apiKey - RevenueCat API Key. Can be obtained from the RevenueCat dashboard.
4685
+ * @param appUserId - Your unique id for identifying the user.
4686
+ */
4687
+ static configure(e, r) {
4688
+ return K.instance !== void 0 ? (j.warnLog(
4689
+ "Purchases is already initialized. Ignoring and returning existing instance."
4690
+ ), K.getSharedInstance()) : (K.instance = new K(e, r), K.getSharedInstance());
4691
+ }
4692
+ /**
4693
+ * Fetch the configured offerings for this user. You can configure these
4694
+ * in the RevenueCat dashboard.
4695
+ */
4696
+ async getOfferings() {
4697
+ const e = this._appUserId, r = await this.backend.getOfferings(e), n = r.offerings.flatMap((s) => s.packages).map((s) => s.platform_product_identifier), i = await this.backend.getProducts(
4698
+ e,
4699
+ n
4700
+ );
4701
+ return this.logMissingProductIds(n, i.product_details), this.toOfferings(r, i);
4702
+ }
4703
+ /**
4704
+ * Convenience method to check whether a user is entitled to a specific
4705
+ * entitlement. This will use {@link Purchases.getCustomerInfo} under the hood.
4706
+ * @param entitlementIdentifier - The entitlement identifier you want to check.
4707
+ * @returns Whether the user is entitled to the specified entitlement
4708
+ * @throws {@link PurchasesError} if there is an error while fetching the customer info.
4709
+ * @see {@link Purchases.getCustomerInfo}
4710
+ */
4711
+ async isEntitledTo(e) {
4712
+ const r = await this.getCustomerInfo();
4713
+ return e in r.entitlements.active;
4714
+ }
4715
+ /**
4716
+ * Method to perform a purchase for a given package. You can obtain the
4717
+ * package from {@link Purchases.getOfferings}. This method will present the purchase
4718
+ * form on your site, using the given HTML element as the mount point, if
4719
+ * provided, or as a modal if not.
4720
+ * @param rcPackage - The package you want to purchase. Obtained from {@link Purchases.getOfferings}.
4721
+ * @param customerEmail - The email of the user. If null, RevenueCat will ask the customer for their email.
4722
+ * @param htmlTarget - The HTML element where the billing view should be added. If null, a new div will be created at the root of the page and appended to the body.
4723
+ * @returns The customer info after the purchase is completed successfuly.
4724
+ * @throws {@link PurchasesError} if there is an error while performing the purchase. If the {@link PurchasesError.errorCode} is {@link ErrorCode.UserCancelledError}, the user cancelled the purchase.
4725
+ */
4726
+ purchasePackage(e, r, n) {
4727
+ let i = n ?? document.getElementById("rcb-ui-root");
4728
+ if (i === null) {
4729
+ const c = document.createElement("div");
4730
+ c.className = "rcb-ui-root", document.body.appendChild(c), i = c;
4731
+ }
4732
+ if (i === null)
4733
+ throw new Error(
4734
+ "Could not generate a mount point for the billing widget"
4735
+ );
4736
+ const s = i, l = !n, o = this._appUserId;
4737
+ return j.debugLog(
4738
+ `Presenting purchase form for package ${e.identifier}`
4739
+ ), new Promise((c, u) => {
4740
+ new ls({
4741
+ target: s,
4742
+ props: {
4743
+ appUserId: o,
4744
+ rcPackage: e,
4745
+ customerEmail: r,
4746
+ onFinished: async () => {
4747
+ j.debugLog("Purchase finished"), s.innerHTML = "", c({
4748
+ customerInfo: await this._getCustomerInfoForUserId(o)
4749
+ });
4750
+ },
4751
+ onClose: () => {
4752
+ s.innerHTML = "", j.debugLog("Purchase cancelled by user"), u(new ee(Re.UserCancelledError));
4753
+ },
4754
+ onError: (_) => {
4755
+ s.innerHTML = "", u(ee.getForPurchasesFlowError(_));
4756
+ },
4757
+ purchases: this,
4758
+ backend: this.backend,
4759
+ purchaseOperationHelper: this.purchaseOperationHelper,
4760
+ asModal: l
4761
+ }
4762
+ });
4763
+ });
4764
+ }
4765
+ /**
4766
+ * Gets latest available {@link CustomerInfo}.
4767
+ * @returns The latest {@link CustomerInfo}.
4768
+ * @throws {@link PurchasesError} if there is an error while fetching the customer info.
4769
+ */
4770
+ async getCustomerInfo() {
4771
+ return await this._getCustomerInfoForUserId(this._appUserId);
4772
+ }
4773
+ /**
4774
+ * Gets the current app user id.
4775
+ */
4776
+ getAppUserId() {
4777
+ return this._appUserId;
4778
+ }
4779
+ /**
4780
+ * Change the current app user id. Returns the customer info for the new
4781
+ * user id.
4782
+ * @param newAppUserId - The user id to change to.
4783
+ */
4784
+ async changeUser(e) {
4785
+ return this._appUserId = e, await this.getCustomerInfo();
4786
+ }
4787
+ /** @internal */
4788
+ logMissingProductIds(e, r) {
4789
+ const n = {};
4790
+ r.forEach(
4791
+ (s) => n[s.identifier] = s
4792
+ );
4793
+ const i = [];
4794
+ e.forEach((s) => {
4795
+ n[s] === void 0 && i.push(s);
4796
+ }), i.length > 0 && j.debugLog(
4797
+ `Could not find product data for product ids:
4798
+ ${i.join()}.
4799
+ Please check that your product configuration is correct.`
4800
+ );
4801
+ }
4802
+ /**
4803
+ * @returns Whether the SDK is using a sandbox API Key.
4804
+ */
4805
+ isSandbox() {
4806
+ return Ye(this._API_KEY);
4807
+ }
4808
+ /**
4809
+ * Closes the Purchases instance. You should never have to do this normally.
4810
+ */
4811
+ close() {
4812
+ K.instance === this ? K.instance = void 0 : j.warnLog(
4813
+ "Trying to close a Purchases instance that is not the current instance. Ignoring."
4814
+ );
4815
+ }
4816
+ /** @internal */
4817
+ async _getCustomerInfoForUserId(e) {
4818
+ const r = await this.backend.getCustomerInfo(e);
4819
+ return us(r);
4820
+ }
4821
+ };
4822
+ /** @internal */
4823
+ D(K, "instance");
4824
+ let gt = K;
4825
+ export {
4826
+ Re as ErrorCode,
4827
+ H as LogLevel,
4828
+ St as PackageType,
4829
+ gt as Purchases,
4830
+ ee as PurchasesError,
4831
+ Yi as UninitializedPurchasesError
4832
+ };