@reevit/svelte 0.4.6 → 0.4.8

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.
package/dist/index.mjs CHANGED
@@ -1,133 +1,133 @@
1
- import { createEventDispatcher as Xt, onMount as ni, onDestroy as ri } from "svelte";
2
- import { createInitialState as ii, ReevitAPIClient as si, generateReference as ai, detectCountryFromCurrency as oi, reevitReducer as li, cn as ue, validatePhone as wn, detectNetwork as ci, createThemeVariables as ui, createReevitClient as fi } from "@reevit/core";
3
- import { ReevitAPIClient as Ba, cn as Va, createInitialState as Ya, createReevitClient as Ga, detectCountryFromCurrency as Wa, detectNetwork as Ja, formatAmount as Za, formatPhone as Qa, reevitReducer as Xa, validatePhone as $a } from "@reevit/core";
4
- const di = "5";
5
- typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(di);
6
- let Nt = !1, vi = !1;
7
- function pi() {
8
- Nt = !0;
9
- }
10
- pi();
11
- const hi = 1, mi = 2, cr = 4, _i = 8, yi = 16, bi = 1, gi = 2, wi = 4, Ei = 8, Pi = 16, Si = 1, ki = 2, se = /* @__PURE__ */ Symbol(), Ii = "http://www.w3.org/1999/xhtml", kn = !1;
12
- var ur = Array.isArray, Mi = Array.prototype.indexOf, Fn = Array.from, fr = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, dr = Object.getOwnPropertyDescriptors, Ci = Object.prototype, xi = Array.prototype, Dn = Object.getPrototypeOf;
13
- const In = () => {
1
+ import { createEventDispatcher as nn, onMount as oi, onDestroy as ai } from "svelte";
2
+ import { createInitialState as si, ReevitAPIClient as li, generateReference as ci, detectCountryFromCurrency as ui, reevitReducer as fi, cn as de, validatePhone as kn, detectNetwork as di, createThemeVariables as vi, createReevitClient as pi } from "@reevit/core";
3
+ import { ReevitAPIClient as Za, cn as Qa, createInitialState as Xa, createReevitClient as $a, detectCountryFromCurrency as es, detectNetwork as ts, formatAmount as ns, formatPhone as rs, reevitReducer as is, validatePhone as os } from "@reevit/core";
4
+ const hi = "5";
5
+ typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(hi);
6
+ let Ot = !1, mi = !1;
7
+ function _i() {
8
+ Ot = !0;
9
+ }
10
+ _i();
11
+ const yi = 1, bi = 2, dr = 4, gi = 8, wi = 16, Ei = 1, Pi = 2, Si = 4, ki = 8, Ci = 16, Ii = 1, Mi = 2, ae = /* @__PURE__ */ Symbol(), xi = "http://www.w3.org/1999/xhtml", xn = !1;
12
+ var vr = Array.isArray, Ri = Array.prototype.indexOf, jn = Array.from, pr = Object.defineProperty, Vt = Object.getOwnPropertyDescriptor, hr = Object.getOwnPropertyDescriptors, Ti = Object.prototype, Ai = Array.prototype, zn = Object.getPrototypeOf;
13
+ const Rn = () => {
14
14
  };
15
- function Ri(e) {
15
+ function Ni(e) {
16
16
  return e();
17
17
  }
18
- function Mn(e) {
18
+ function Tn(e) {
19
19
  for (var t = 0; t < e.length; t++)
20
20
  e[t]();
21
21
  }
22
- function vr() {
23
- var e, t, n = new Promise((r, s) => {
24
- e = r, t = s;
22
+ function mr() {
23
+ var e, t, n = new Promise((r, o) => {
24
+ e = r, t = o;
25
25
  });
26
26
  return { promise: n, resolve: e, reject: t };
27
27
  }
28
- const re = 2, pr = 4, $t = 8, Ti = 1 << 24, Ne = 16, Le = 32, ht = 64, Un = 128, Pe = 512, te = 1024, fe = 2048, Se = 4096, _e = 8192, Re = 16384, jn = 32768, It = 65536, Qn = 1 << 17, hr = 1 << 18, en = 1 << 19, mr = 1 << 20, xe = 1 << 25, tt = 32768, Cn = 1 << 21, zn = 1 << 22, qe = 1 << 23, vt = /* @__PURE__ */ Symbol("$state"), Ai = /* @__PURE__ */ Symbol("legacy props"), Ni = /* @__PURE__ */ Symbol(""), ft = new class extends Error {
28
+ const ie = 2, _r = 4, rn = 8, Li = 1 << 24, Ne = 16, Le = 32, yt = 64, Hn = 128, Pe = 512, ne = 1024, pe = 2048, Se = 4096, me = 8192, Re = 16384, Bn = 32768, Mt = 65536, er = 1 << 17, yr = 1 << 18, on = 1 << 19, br = 1 << 20, xe = 1 << 25, rt = 32768, An = 1 << 21, Kn = 1 << 22, qe = 1 << 23, mt = /* @__PURE__ */ Symbol("$state"), Oi = /* @__PURE__ */ Symbol("legacy props"), Fi = /* @__PURE__ */ Symbol(""), pt = new class extends Error {
29
29
  name = "StaleReactionError";
30
30
  message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
31
31
  }();
32
- function Li() {
32
+ function Di() {
33
33
  throw new Error("https://svelte.dev/e/async_derived_orphan");
34
34
  }
35
- function Oi(e) {
35
+ function Ui(e) {
36
36
  throw new Error("https://svelte.dev/e/effect_in_teardown");
37
37
  }
38
- function Fi() {
38
+ function ji() {
39
39
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
40
40
  }
41
- function Di(e) {
41
+ function zi(e) {
42
42
  throw new Error("https://svelte.dev/e/effect_orphan");
43
43
  }
44
- function Ui() {
44
+ function Hi() {
45
45
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
46
46
  }
47
- function ji(e) {
47
+ function Bi(e) {
48
48
  throw new Error("https://svelte.dev/e/props_invalid_value");
49
49
  }
50
- function zi() {
50
+ function Ki() {
51
51
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
52
52
  }
53
- function Hi() {
53
+ function qi() {
54
54
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
55
55
  }
56
- function Ki() {
56
+ function Vi() {
57
57
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
58
58
  }
59
- function _r(e) {
59
+ function gr(e) {
60
60
  return e === this.v;
61
61
  }
62
- function qi(e, t) {
62
+ function Yi(e, t) {
63
63
  return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
64
64
  }
65
- function yr(e) {
66
- return !qi(e, this.v);
65
+ function wr(e) {
66
+ return !Yi(e, this.v);
67
67
  }
68
- let $ = null;
69
- function Bt(e) {
70
- $ = e;
68
+ let ee = null;
69
+ function Gt(e) {
70
+ ee = e;
71
71
  }
72
- function tn(e, t = !1, n) {
73
- $ = {
74
- p: $,
72
+ function an(e, t = !1, n) {
73
+ ee = {
74
+ p: ee,
75
75
  i: !1,
76
76
  c: null,
77
77
  e: null,
78
78
  s: e,
79
79
  x: null,
80
- l: Nt && !t ? { s: null, u: null, $: [] } : null
80
+ l: Ot && !t ? { s: null, u: null, $: [] } : null
81
81
  };
82
82
  }
83
- function nn(e) {
83
+ function sn(e) {
84
84
  var t = (
85
85
  /** @type {ComponentContext} */
86
- $
86
+ ee
87
87
  ), n = t.e;
88
88
  if (n !== null) {
89
89
  t.e = null;
90
90
  for (var r of n)
91
- xr(r);
91
+ Ar(r);
92
92
  }
93
- return t.i = !0, $ = t.p, /** @type {T} */
93
+ return t.i = !0, ee = t.p, /** @type {T} */
94
94
  {};
95
95
  }
96
- function Lt() {
97
- return !Nt || $ !== null && $.l === null;
96
+ function Ft() {
97
+ return !Ot || ee !== null && ee.l === null;
98
98
  }
99
- let Je = [];
100
- function br() {
101
- var e = Je;
102
- Je = [], Mn(e);
99
+ let Qe = [];
100
+ function Er() {
101
+ var e = Qe;
102
+ Qe = [], Tn(e);
103
103
  }
104
- function Hn(e) {
105
- if (Je.length === 0 && !kt) {
106
- var t = Je;
104
+ function qn(e) {
105
+ if (Qe.length === 0 && !It) {
106
+ var t = Qe;
107
107
  queueMicrotask(() => {
108
- t === Je && br();
108
+ t === Qe && Er();
109
109
  });
110
110
  }
111
- Je.push(e);
111
+ Qe.push(e);
112
112
  }
113
- function Bi() {
114
- for (; Je.length > 0; )
115
- br();
113
+ function Gi() {
114
+ for (; Qe.length > 0; )
115
+ Er();
116
116
  }
117
- function Vi(e) {
117
+ function Wi(e) {
118
118
  var t = j;
119
119
  if (t === null)
120
- return N.f |= qe, e;
121
- if ((t.f & jn) === 0) {
122
- if ((t.f & Un) === 0)
120
+ return A.f |= qe, e;
121
+ if ((t.f & Bn) === 0) {
122
+ if ((t.f & Hn) === 0)
123
123
  throw e;
124
124
  t.b.error(e);
125
125
  } else
126
- Vt(e, t);
126
+ Wt(e, t);
127
127
  }
128
- function Vt(e, t) {
128
+ function Wt(e, t) {
129
129
  for (; t !== null; ) {
130
- if ((t.f & Un) !== 0)
130
+ if ((t.f & Hn) !== 0)
131
131
  try {
132
132
  t.b.error(e);
133
133
  return;
@@ -138,9 +138,9 @@ function Vt(e, t) {
138
138
  }
139
139
  throw e;
140
140
  }
141
- const zt = /* @__PURE__ */ new Set();
142
- let L = null, qt = null, ge = null, be = [], rn = null, xn = !1, kt = !1;
143
- class Mt {
141
+ const Kt = /* @__PURE__ */ new Set();
142
+ let N = null, Yt = null, ge = null, be = [], ln = null, Nn = !1, It = !1;
143
+ class xt {
144
144
  committed = !1;
145
145
  /**
146
146
  * The current values of any sources that are updated in this batch
@@ -178,7 +178,7 @@ class Mt {
178
178
  * TODO replace with Promise.withResolvers once supported widely enough
179
179
  * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
180
180
  */
181
- #s = null;
181
+ #o = null;
182
182
  /**
183
183
  * Deferred effects (which run after async work has completed) that are DIRTY
184
184
  * @type {Set<Effect>}
@@ -204,7 +204,7 @@ class Mt {
204
204
  * @param {Effect[]} root_effects
205
205
  */
206
206
  process(t) {
207
- be = [], qt = null, this.apply();
207
+ be = [], Yt = null, this.apply();
208
208
  var n = {
209
209
  parent: null,
210
210
  effect: null,
@@ -213,7 +213,7 @@ class Mt {
213
213
  };
214
214
  for (const r of t)
215
215
  this.#l(r, n);
216
- this.is_fork || this.#u(), this.is_deferred() ? (this.#o(n.effects), this.#o(n.render_effects)) : (qt = this, L = null, Xn(n.render_effects), Xn(n.effects), qt = null, this.#s?.resolve()), ge = null;
216
+ this.is_fork || this.#u(), this.is_deferred() ? (this.#s(n.effects), this.#s(n.render_effects)) : (Yt = this, N = null, tr(n.render_effects), tr(n.effects), Yt = null, this.#o?.resolve()), ge = null;
217
217
  }
218
218
  /**
219
219
  * Traverse the effect tree, executing effects or stashing
@@ -222,16 +222,16 @@ class Mt {
222
222
  * @param {EffectTarget} target
223
223
  */
224
224
  #l(t, n) {
225
- t.f ^= te;
225
+ t.f ^= ne;
226
226
  for (var r = t.first; r !== null; ) {
227
- var s = r.f, i = (s & (Le | ht)) !== 0, l = i && (s & te) !== 0, o = l || (s & _e) !== 0 || this.skipped_effects.has(r);
228
- if ((r.f & Un) !== 0 && r.b?.is_pending() && (n = {
227
+ var o = r.f, i = (o & (Le | yt)) !== 0, l = i && (o & ne) !== 0, s = l || (o & me) !== 0 || this.skipped_effects.has(r);
228
+ if ((r.f & Hn) !== 0 && r.b?.is_pending() && (n = {
229
229
  parent: n,
230
230
  effect: r,
231
231
  effects: [],
232
232
  render_effects: []
233
- }), !o && r.fn !== null) {
234
- i ? r.f ^= te : (s & pr) !== 0 ? n.effects.push(r) : mt(r) && ((r.f & Ne) !== 0 && this.#i.add(r), pt(r));
233
+ }), !s && r.fn !== null) {
234
+ i ? r.f ^= ne : (o & _r) !== 0 ? n.effects.push(r) : bt(r) && ((r.f & Ne) !== 0 && this.#i.add(r), _t(r));
235
235
  var c = r.first;
236
236
  if (c !== null) {
237
237
  r = c;
@@ -240,16 +240,16 @@ class Mt {
240
240
  }
241
241
  var u = r.parent;
242
242
  for (r = r.next; r === null && u !== null; )
243
- u === n.effect && (this.#o(n.effects), this.#o(n.render_effects), n = /** @type {EffectTarget} */
243
+ u === n.effect && (this.#s(n.effects), this.#s(n.render_effects), n = /** @type {EffectTarget} */
244
244
  n.parent), r = u.next, u = u.parent;
245
245
  }
246
246
  }
247
247
  /**
248
248
  * @param {Effect[]} effects
249
249
  */
250
- #o(t) {
250
+ #s(t) {
251
251
  for (const n of t)
252
- (n.f & fe) !== 0 ? this.#i.add(n) : (n.f & Se) !== 0 && this.#a.add(n), this.#c(n.deps), ne(n, te);
252
+ (n.f & pe) !== 0 ? this.#i.add(n) : (n.f & Se) !== 0 && this.#a.add(n), this.#c(n.deps), re(n, ne);
253
253
  }
254
254
  /**
255
255
  * @param {Value[] | null} deps
@@ -257,7 +257,7 @@ class Mt {
257
257
  #c(t) {
258
258
  if (t !== null)
259
259
  for (const n of t)
260
- (n.f & re) === 0 || (n.f & tt) === 0 || (n.f ^= tt, this.#c(
260
+ (n.f & ie) === 0 || (n.f & rt) === 0 || (n.f ^= rt, this.#c(
261
261
  /** @type {Derived} */
262
262
  n.deps
263
263
  ));
@@ -272,14 +272,14 @@ class Mt {
272
272
  this.previous.has(t) || this.previous.set(t, n), (t.f & qe) === 0 && (this.current.set(t, t.v), ge?.set(t, t.v));
273
273
  }
274
274
  activate() {
275
- L = this, this.apply();
275
+ N = this, this.apply();
276
276
  }
277
277
  deactivate() {
278
- L === this && (L = null, ge = null);
278
+ N === this && (N = null, ge = null);
279
279
  }
280
280
  flush() {
281
281
  if (this.activate(), be.length > 0) {
282
- if (gr(), L !== null && L !== this)
282
+ if (Pr(), N !== null && N !== this)
283
283
  return;
284
284
  } else this.#e === 0 && this.process([]);
285
285
  this.deactivate();
@@ -296,7 +296,7 @@ class Mt {
296
296
  this.#e === 0 && this.#f();
297
297
  }
298
298
  #f() {
299
- if (zt.size > 1) {
299
+ if (Kt.size > 1) {
300
300
  this.previous.clear();
301
301
  var t = ge, n = !0, r = {
302
302
  parent: null,
@@ -304,7 +304,7 @@ class Mt {
304
304
  effects: [],
305
305
  render_effects: []
306
306
  };
307
- for (const i of zt) {
307
+ for (const i of Kt) {
308
308
  if (i === this) {
309
309
  n = !1;
310
310
  continue;
@@ -320,25 +320,25 @@ class Mt {
320
320
  }
321
321
  if (l.length === 0)
322
322
  continue;
323
- const o = [...i.current.keys()].filter((c) => !this.current.has(c));
324
- if (o.length > 0) {
325
- var s = be;
323
+ const s = [...i.current.keys()].filter((c) => !this.current.has(c));
324
+ if (s.length > 0) {
325
+ var o = be;
326
326
  be = [];
327
327
  const c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map();
328
328
  for (const f of l)
329
- wr(f, o, c, u);
329
+ Sr(f, s, c, u);
330
330
  if (be.length > 0) {
331
- L = i, i.apply();
331
+ N = i, i.apply();
332
332
  for (const f of be)
333
333
  i.#l(f, r);
334
334
  i.deactivate();
335
335
  }
336
- be = s;
336
+ be = o;
337
337
  }
338
338
  }
339
- L = null, ge = t;
339
+ N = null, ge = t;
340
340
  }
341
- this.committed = !0, zt.delete(this);
341
+ this.committed = !0, Kt.delete(this);
342
342
  }
343
343
  /**
344
344
  *
@@ -356,9 +356,9 @@ class Mt {
356
356
  }
357
357
  revive() {
358
358
  for (const t of this.#i)
359
- this.#a.delete(t), ne(t, fe), nt(t);
359
+ this.#a.delete(t), re(t, pe), it(t);
360
360
  for (const t of this.#a)
361
- ne(t, Se), nt(t);
361
+ re(t, Se), it(t);
362
362
  this.flush();
363
363
  }
364
364
  /** @param {() => void} fn */
@@ -370,197 +370,197 @@ class Mt {
370
370
  this.#n.add(t);
371
371
  }
372
372
  settled() {
373
- return (this.#s ??= vr()).promise;
373
+ return (this.#o ??= mr()).promise;
374
374
  }
375
375
  static ensure() {
376
- if (L === null) {
377
- const t = L = new Mt();
378
- zt.add(L), kt || Mt.enqueue(() => {
379
- L === t && t.flush();
376
+ if (N === null) {
377
+ const t = N = new xt();
378
+ Kt.add(N), It || xt.enqueue(() => {
379
+ N === t && t.flush();
380
380
  });
381
381
  }
382
- return L;
382
+ return N;
383
383
  }
384
384
  /** @param {() => void} task */
385
385
  static enqueue(t) {
386
- Hn(t);
386
+ qn(t);
387
387
  }
388
388
  apply() {
389
389
  }
390
390
  }
391
- function Yi(e) {
392
- var t = kt;
393
- kt = !0;
391
+ function Ji(e) {
392
+ var t = It;
393
+ It = !0;
394
394
  try {
395
395
  for (var n; ; ) {
396
- if (Bi(), be.length === 0 && (L?.flush(), be.length === 0))
397
- return rn = null, /** @type {T} */
396
+ if (Gi(), be.length === 0 && (N?.flush(), be.length === 0))
397
+ return ln = null, /** @type {T} */
398
398
  n;
399
- gr();
399
+ Pr();
400
400
  }
401
401
  } finally {
402
- kt = t;
402
+ It = t;
403
403
  }
404
404
  }
405
- function gr() {
406
- var e = Qe;
407
- xn = !0;
405
+ function Pr() {
406
+ var e = $e;
407
+ Nn = !0;
408
408
  var t = null;
409
409
  try {
410
410
  var n = 0;
411
- for (Jt(!0); be.length > 0; ) {
412
- var r = Mt.ensure();
411
+ for (Xt(!0); be.length > 0; ) {
412
+ var r = xt.ensure();
413
413
  if (n++ > 1e3) {
414
- var s, i;
415
- Gi();
414
+ var o, i;
415
+ Zi();
416
416
  }
417
- r.process(be), Be.clear();
417
+ r.process(be), Ve.clear();
418
418
  }
419
419
  } finally {
420
- xn = !1, Jt(e), rn = null;
420
+ Nn = !1, Xt(e), ln = null;
421
421
  }
422
422
  }
423
- function Gi() {
423
+ function Zi() {
424
424
  try {
425
- Ui();
425
+ Hi();
426
426
  } catch (e) {
427
- Vt(e, rn);
427
+ Wt(e, ln);
428
428
  }
429
429
  }
430
- let Ce = null;
431
- function Xn(e) {
430
+ let Me = null;
431
+ function tr(e) {
432
432
  var t = e.length;
433
433
  if (t !== 0) {
434
434
  for (var n = 0; n < t; ) {
435
435
  var r = e[n++];
436
- if ((r.f & (Re | _e)) === 0 && mt(r) && (Ce = /* @__PURE__ */ new Set(), pt(r), r.deps === null && r.first === null && r.nodes === null && (r.teardown === null && r.ac === null ? Nr(r) : r.fn = null), Ce?.size > 0)) {
437
- Be.clear();
438
- for (const s of Ce) {
439
- if ((s.f & (Re | _e)) !== 0) continue;
440
- const i = [s];
441
- let l = s.parent;
436
+ if ((r.f & (Re | me)) === 0 && bt(r) && (Me = /* @__PURE__ */ new Set(), _t(r), r.deps === null && r.first === null && r.nodes === null && (r.teardown === null && r.ac === null ? Fr(r) : r.fn = null), Me?.size > 0)) {
437
+ Ve.clear();
438
+ for (const o of Me) {
439
+ if ((o.f & (Re | me)) !== 0) continue;
440
+ const i = [o];
441
+ let l = o.parent;
442
442
  for (; l !== null; )
443
- Ce.has(l) && (Ce.delete(l), i.push(l)), l = l.parent;
444
- for (let o = i.length - 1; o >= 0; o--) {
445
- const c = i[o];
446
- (c.f & (Re | _e)) === 0 && pt(c);
443
+ Me.has(l) && (Me.delete(l), i.push(l)), l = l.parent;
444
+ for (let s = i.length - 1; s >= 0; s--) {
445
+ const c = i[s];
446
+ (c.f & (Re | me)) === 0 && _t(c);
447
447
  }
448
448
  }
449
- Ce.clear();
449
+ Me.clear();
450
450
  }
451
451
  }
452
- Ce = null;
452
+ Me = null;
453
453
  }
454
454
  }
455
- function wr(e, t, n, r) {
455
+ function Sr(e, t, n, r) {
456
456
  if (!n.has(e) && (n.add(e), e.reactions !== null))
457
- for (const s of e.reactions) {
458
- const i = s.f;
459
- (i & re) !== 0 ? wr(
457
+ for (const o of e.reactions) {
458
+ const i = o.f;
459
+ (i & ie) !== 0 ? Sr(
460
460
  /** @type {Derived} */
461
- s,
461
+ o,
462
462
  t,
463
463
  n,
464
464
  r
465
- ) : (i & (zn | Ne)) !== 0 && (i & fe) === 0 && Er(s, t, r) && (ne(s, fe), nt(
465
+ ) : (i & (Kn | Ne)) !== 0 && (i & pe) === 0 && kr(o, t, r) && (re(o, pe), it(
466
466
  /** @type {Effect} */
467
- s
467
+ o
468
468
  ));
469
469
  }
470
470
  }
471
- function Er(e, t, n) {
471
+ function kr(e, t, n) {
472
472
  const r = n.get(e);
473
473
  if (r !== void 0) return r;
474
474
  if (e.deps !== null)
475
- for (const s of e.deps) {
476
- if (t.includes(s))
475
+ for (const o of e.deps) {
476
+ if (t.includes(o))
477
477
  return !0;
478
- if ((s.f & re) !== 0 && Er(
478
+ if ((o.f & ie) !== 0 && kr(
479
479
  /** @type {Derived} */
480
- s,
480
+ o,
481
481
  t,
482
482
  n
483
483
  ))
484
484
  return n.set(
485
485
  /** @type {Derived} */
486
- s,
486
+ o,
487
487
  !0
488
488
  ), !0;
489
489
  }
490
490
  return n.set(e, !1), !1;
491
491
  }
492
- function nt(e) {
493
- for (var t = rn = e; t.parent !== null; ) {
492
+ function it(e) {
493
+ for (var t = ln = e; t.parent !== null; ) {
494
494
  t = t.parent;
495
495
  var n = t.f;
496
- if (xn && t === j && (n & Ne) !== 0 && (n & hr) === 0)
496
+ if (Nn && t === j && (n & Ne) !== 0 && (n & yr) === 0)
497
497
  return;
498
- if ((n & (ht | Le)) !== 0) {
499
- if ((n & te) === 0) return;
500
- t.f ^= te;
498
+ if ((n & (yt | Le)) !== 0) {
499
+ if ((n & ne) === 0) return;
500
+ t.f ^= ne;
501
501
  }
502
502
  }
503
503
  be.push(t);
504
504
  }
505
- function Wi(e, t, n, r) {
506
- const s = Lt() ? sn : Ct;
505
+ function Qi(e, t, n, r) {
506
+ const o = Ft() ? cn : Rt;
507
507
  if (n.length === 0 && e.length === 0) {
508
- r(t.map(s));
508
+ r(t.map(o));
509
509
  return;
510
510
  }
511
- var i = L, l = (
511
+ var i = N, l = (
512
512
  /** @type {Effect} */
513
513
  j
514
- ), o = Ji();
514
+ ), s = Xi();
515
515
  function c() {
516
- Promise.all(n.map((u) => /* @__PURE__ */ Zi(u))).then((u) => {
517
- o();
516
+ Promise.all(n.map((u) => /* @__PURE__ */ $i(u))).then((u) => {
517
+ s();
518
518
  try {
519
- r([...t.map(s), ...u]);
519
+ r([...t.map(o), ...u]);
520
520
  } catch (f) {
521
- (l.f & Re) === 0 && Vt(f, l);
521
+ (l.f & Re) === 0 && Wt(f, l);
522
522
  }
523
- i?.deactivate(), Yt();
523
+ i?.deactivate(), Jt();
524
524
  }).catch((u) => {
525
- Vt(u, l);
525
+ Wt(u, l);
526
526
  });
527
527
  }
528
528
  e.length > 0 ? Promise.all(e).then(() => {
529
- o();
529
+ s();
530
530
  try {
531
531
  return c();
532
532
  } finally {
533
- i?.deactivate(), Yt();
533
+ i?.deactivate(), Jt();
534
534
  }
535
535
  }) : c();
536
536
  }
537
- function Ji() {
538
- var e = j, t = N, n = $, r = L;
537
+ function Xi() {
538
+ var e = j, t = A, n = ee, r = N;
539
539
  return function(i = !0) {
540
- Ve(e), Me(t), Bt(n), i && r?.activate();
540
+ Ye(e), Ce(t), Gt(n), i && r?.activate();
541
541
  };
542
542
  }
543
- function Yt() {
544
- Ve(null), Me(null), Bt(null);
543
+ function Jt() {
544
+ Ye(null), Ce(null), Gt(null);
545
545
  }
546
546
  // @__NO_SIDE_EFFECTS__
547
- function sn(e) {
548
- var t = re | fe, n = N !== null && (N.f & re) !== 0 ? (
547
+ function cn(e) {
548
+ var t = ie | pe, n = A !== null && (A.f & ie) !== 0 ? (
549
549
  /** @type {Derived} */
550
- N
550
+ A
551
551
  ) : null;
552
- return j !== null && (j.f |= en), {
553
- ctx: $,
552
+ return j !== null && (j.f |= on), {
553
+ ctx: ee,
554
554
  deps: null,
555
555
  effects: null,
556
- equals: _r,
556
+ equals: gr,
557
557
  f: t,
558
558
  fn: e,
559
559
  reactions: null,
560
560
  rv: 0,
561
561
  v: (
562
562
  /** @type {V} */
563
- se
563
+ ae
564
564
  ),
565
565
  wv: 0,
566
566
  parent: n ?? j,
@@ -568,73 +568,73 @@ function sn(e) {
568
568
  };
569
569
  }
570
570
  // @__NO_SIDE_EFFECTS__
571
- function Zi(e, t) {
571
+ function $i(e, t) {
572
572
  let n = (
573
573
  /** @type {Effect | null} */
574
574
  j
575
575
  );
576
- n === null && Li();
576
+ n === null && Di();
577
577
  var r = (
578
578
  /** @type {Boundary} */
579
579
  n.b
580
- ), s = (
580
+ ), o = (
581
581
  /** @type {Promise<V>} */
582
582
  /** @type {unknown} */
583
583
  void 0
584
- ), i = xt(
584
+ ), i = Tt(
585
585
  /** @type {V} */
586
- se
587
- ), l = !N, o = /* @__PURE__ */ new Map();
588
- return os(() => {
589
- var c = vr();
590
- s = c.promise;
586
+ ae
587
+ ), l = !A, s = /* @__PURE__ */ new Map();
588
+ return uo(() => {
589
+ var c = mr();
590
+ o = c.promise;
591
591
  try {
592
592
  Promise.resolve(e()).then(c.resolve, c.reject).then(() => {
593
- u === L && u.committed && u.deactivate(), Yt();
593
+ u === N && u.committed && u.deactivate(), Jt();
594
594
  });
595
- } catch (v) {
596
- c.reject(v), Yt();
595
+ } catch (d) {
596
+ c.reject(d), Jt();
597
597
  }
598
598
  var u = (
599
599
  /** @type {Batch} */
600
- L
600
+ N
601
601
  );
602
602
  if (l) {
603
603
  var f = !r.is_pending();
604
- r.update_pending_count(1), u.increment(f), o.get(u)?.reject(ft), o.delete(u), o.set(u, c);
604
+ r.update_pending_count(1), u.increment(f), s.get(u)?.reject(pt), s.delete(u), s.set(u, c);
605
605
  }
606
- const d = (v, m = void 0) => {
606
+ const h = (d, m = void 0) => {
607
607
  if (u.activate(), m)
608
- m !== ft && (i.f |= qe, Rt(i, m));
608
+ m !== pt && (i.f |= qe, At(i, m));
609
609
  else {
610
- (i.f & qe) !== 0 && (i.f ^= qe), Rt(i, v);
611
- for (const [_, h] of o) {
612
- if (o.delete(_), _ === u) break;
613
- h.reject(ft);
610
+ (i.f & qe) !== 0 && (i.f ^= qe), At(i, d);
611
+ for (const [_, p] of s) {
612
+ if (s.delete(_), _ === u) break;
613
+ p.reject(pt);
614
614
  }
615
615
  }
616
616
  l && (r.update_pending_count(-1), u.decrement(f));
617
617
  };
618
- c.promise.then(d, (v) => d(null, v || "unknown"));
619
- }), qn(() => {
620
- for (const c of o.values())
621
- c.reject(ft);
618
+ c.promise.then(h, (d) => h(null, d || "unknown"));
619
+ }), Yn(() => {
620
+ for (const c of s.values())
621
+ c.reject(pt);
622
622
  }), new Promise((c) => {
623
623
  function u(f) {
624
- function d() {
625
- f === s ? c(i) : u(s);
624
+ function h() {
625
+ f === o ? c(i) : u(o);
626
626
  }
627
- f.then(d, d);
627
+ f.then(h, h);
628
628
  }
629
- u(s);
629
+ u(o);
630
630
  });
631
631
  }
632
632
  // @__NO_SIDE_EFFECTS__
633
- function Ct(e) {
634
- const t = /* @__PURE__ */ sn(e);
635
- return t.equals = yr, t;
633
+ function Rt(e) {
634
+ const t = /* @__PURE__ */ cn(e);
635
+ return t.equals = wr, t;
636
636
  }
637
- function Pr(e) {
637
+ function Cr(e) {
638
638
  var t = e.effects;
639
639
  if (t !== null) {
640
640
  e.effects = null;
@@ -645,9 +645,9 @@ function Pr(e) {
645
645
  );
646
646
  }
647
647
  }
648
- function Qi(e) {
648
+ function eo(e) {
649
649
  for (var t = e.parent; t !== null; ) {
650
- if ((t.f & re) === 0)
650
+ if ((t.f & ie) === 0)
651
651
  return (t.f & Re) === 0 ? (
652
652
  /** @type {Effect} */
653
653
  t
@@ -656,281 +656,281 @@ function Qi(e) {
656
656
  }
657
657
  return null;
658
658
  }
659
- function Kn(e) {
659
+ function Vn(e) {
660
660
  var t, n = j;
661
- Ve(Qi(e));
661
+ Ye(eo(e));
662
662
  try {
663
- e.f &= ~tt, Pr(e), t = jr(e);
663
+ e.f &= ~rt, Cr(e), t = Br(e);
664
664
  } finally {
665
- Ve(n);
665
+ Ye(n);
666
666
  }
667
667
  return t;
668
668
  }
669
- function Sr(e) {
670
- var t = Kn(e);
671
- if (e.equals(t) || (L?.is_fork || (e.v = t), e.wv = Dr()), !rt)
669
+ function Ir(e) {
670
+ var t = Vn(e);
671
+ if (e.equals(t) || (N?.is_fork || (e.v = t), e.wv = zr()), !ot)
672
672
  if (ge !== null)
673
- (Wt() || L?.is_fork) && ge.set(e, t);
673
+ (Qt() || N?.is_fork) && ge.set(e, t);
674
674
  else {
675
- var n = (e.f & Pe) === 0 ? Se : te;
676
- ne(e, n);
675
+ var n = (e.f & Pe) === 0 ? Se : ne;
676
+ re(e, n);
677
677
  }
678
678
  }
679
- let Rn = /* @__PURE__ */ new Set();
680
- const Be = /* @__PURE__ */ new Map();
681
- let kr = !1;
682
- function xt(e, t) {
679
+ let Ln = /* @__PURE__ */ new Set();
680
+ const Ve = /* @__PURE__ */ new Map();
681
+ let Mr = !1;
682
+ function Tt(e, t) {
683
683
  var n = {
684
684
  f: 0,
685
685
  // TODO ideally we could skip this altogether, but it causes type errors
686
686
  v: e,
687
687
  reactions: null,
688
- equals: _r,
688
+ equals: gr,
689
689
  rv: 0,
690
690
  wv: 0
691
691
  };
692
692
  return n;
693
693
  }
694
694
  // @__NO_SIDE_EFFECTS__
695
- function ze(e, t) {
696
- const n = xt(e);
697
- return fs(n), n;
695
+ function He(e, t) {
696
+ const n = Tt(e);
697
+ return ho(n), n;
698
698
  }
699
699
  // @__NO_SIDE_EFFECTS__
700
- function Q(e, t = !1, n = !0) {
701
- const r = xt(e);
702
- return t || (r.equals = yr), Nt && n && $ !== null && $.l !== null && ($.l.s ??= []).push(r), r;
700
+ function $(e, t = !1, n = !0) {
701
+ const r = Tt(e);
702
+ return t || (r.equals = wr), Ot && n && ee !== null && ee.l !== null && (ee.l.s ??= []).push(r), r;
703
703
  }
704
- function A(e, t, n = !1) {
705
- N !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
704
+ function T(e, t, n = !1) {
705
+ A !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
706
706
  // to ensure we error if state is set inside an inspect effect
707
- (!Ie || (N.f & Qn) !== 0) && Lt() && (N.f & (re | Ne | zn | Qn)) !== 0 && !Ae?.includes(e) && Ki();
708
- let r = n ? dt(t) : t;
709
- return Rt(e, r);
707
+ (!ke || (A.f & er) !== 0) && Ft() && (A.f & (ie | Ne | Kn | er)) !== 0 && !Ae?.includes(e) && Vi();
708
+ let r = n ? ht(t) : t;
709
+ return At(e, r);
710
710
  }
711
- function Rt(e, t) {
711
+ function At(e, t) {
712
712
  if (!e.equals(t)) {
713
713
  var n = e.v;
714
- rt ? Be.set(e, t) : Be.set(e, n), e.v = t;
715
- var r = Mt.ensure();
716
- r.capture(e, n), (e.f & re) !== 0 && ((e.f & fe) !== 0 && Kn(
714
+ ot ? Ve.set(e, t) : Ve.set(e, n), e.v = t;
715
+ var r = xt.ensure();
716
+ r.capture(e, n), (e.f & ie) !== 0 && ((e.f & pe) !== 0 && Vn(
717
717
  /** @type {Derived} */
718
718
  e
719
- ), ne(e, (e.f & Pe) !== 0 ? te : Se)), e.wv = Dr(), Ir(e, fe), Lt() && j !== null && (j.f & te) !== 0 && (j.f & (Le | ht)) === 0 && (ye === null ? ds([e]) : ye.push(e)), !r.is_fork && Rn.size > 0 && !kr && Xi();
719
+ ), re(e, (e.f & Pe) !== 0 ? ne : Se)), e.wv = zr(), xr(e, pe), Ft() && j !== null && (j.f & ne) !== 0 && (j.f & (Le | yt)) === 0 && (ye === null ? mo([e]) : ye.push(e)), !r.is_fork && Ln.size > 0 && !Mr && to();
720
720
  }
721
721
  return t;
722
722
  }
723
- function Xi() {
724
- kr = !1;
725
- var e = Qe;
726
- Jt(!0);
727
- const t = Array.from(Rn);
723
+ function to() {
724
+ Mr = !1;
725
+ var e = $e;
726
+ Xt(!0);
727
+ const t = Array.from(Ln);
728
728
  try {
729
729
  for (const n of t)
730
- (n.f & te) !== 0 && ne(n, Se), mt(n) && pt(n);
730
+ (n.f & ne) !== 0 && re(n, Se), bt(n) && _t(n);
731
731
  } finally {
732
- Jt(e);
732
+ Xt(e);
733
733
  }
734
- Rn.clear();
734
+ Ln.clear();
735
735
  }
736
- function En(e) {
737
- A(e, e.v + 1);
736
+ function Cn(e) {
737
+ T(e, e.v + 1);
738
738
  }
739
- function Ir(e, t) {
739
+ function xr(e, t) {
740
740
  var n = e.reactions;
741
741
  if (n !== null)
742
- for (var r = Lt(), s = n.length, i = 0; i < s; i++) {
743
- var l = n[i], o = l.f;
742
+ for (var r = Ft(), o = n.length, i = 0; i < o; i++) {
743
+ var l = n[i], s = l.f;
744
744
  if (!(!r && l === j)) {
745
- var c = (o & fe) === 0;
746
- if (c && ne(l, t), (o & re) !== 0) {
745
+ var c = (s & pe) === 0;
746
+ if (c && re(l, t), (s & ie) !== 0) {
747
747
  var u = (
748
748
  /** @type {Derived} */
749
749
  l
750
750
  );
751
- ge?.delete(u), (o & tt) === 0 && (o & Pe && (l.f |= tt), Ir(u, Se));
752
- } else c && ((o & Ne) !== 0 && Ce !== null && Ce.add(
751
+ ge?.delete(u), (s & rt) === 0 && (s & Pe && (l.f |= rt), xr(u, Se));
752
+ } else c && ((s & Ne) !== 0 && Me !== null && Me.add(
753
753
  /** @type {Effect} */
754
754
  l
755
- ), nt(
755
+ ), it(
756
756
  /** @type {Effect} */
757
757
  l
758
758
  ));
759
759
  }
760
760
  }
761
761
  }
762
- function dt(e) {
763
- if (typeof e != "object" || e === null || vt in e)
762
+ function ht(e) {
763
+ if (typeof e != "object" || e === null || mt in e)
764
764
  return e;
765
- const t = Dn(e);
766
- if (t !== Ci && t !== xi)
765
+ const t = zn(e);
766
+ if (t !== Ti && t !== Ai)
767
767
  return e;
768
- var n = /* @__PURE__ */ new Map(), r = ur(e), s = /* @__PURE__ */ ze(0), i = Xe, l = (o) => {
769
- if (Xe === i)
770
- return o();
771
- var c = N, u = Xe;
772
- Me(null), nr(i);
773
- var f = o();
774
- return Me(c), nr(u), f;
768
+ var n = /* @__PURE__ */ new Map(), r = vr(e), o = /* @__PURE__ */ He(0), i = et, l = (s) => {
769
+ if (et === i)
770
+ return s();
771
+ var c = A, u = et;
772
+ Ce(null), or(i);
773
+ var f = s();
774
+ return Ce(c), or(u), f;
775
775
  };
776
- return r && n.set("length", /* @__PURE__ */ ze(
776
+ return r && n.set("length", /* @__PURE__ */ He(
777
777
  /** @type {any[]} */
778
778
  e.length
779
779
  )), new Proxy(
780
780
  /** @type {any} */
781
781
  e,
782
782
  {
783
- defineProperty(o, c, u) {
784
- (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && zi();
783
+ defineProperty(s, c, u) {
784
+ (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Ki();
785
785
  var f = n.get(c);
786
786
  return f === void 0 ? f = l(() => {
787
- var d = /* @__PURE__ */ ze(u.value);
788
- return n.set(c, d), d;
789
- }) : A(f, u.value, !0), !0;
787
+ var h = /* @__PURE__ */ He(u.value);
788
+ return n.set(c, h), h;
789
+ }) : T(f, u.value, !0), !0;
790
790
  },
791
- deleteProperty(o, c) {
791
+ deleteProperty(s, c) {
792
792
  var u = n.get(c);
793
793
  if (u === void 0) {
794
- if (c in o) {
795
- const f = l(() => /* @__PURE__ */ ze(se));
796
- n.set(c, f), En(s);
794
+ if (c in s) {
795
+ const f = l(() => /* @__PURE__ */ He(ae));
796
+ n.set(c, f), Cn(o);
797
797
  }
798
798
  } else
799
- A(u, se), En(s);
799
+ T(u, ae), Cn(o);
800
800
  return !0;
801
801
  },
802
- get(o, c, u) {
803
- if (c === vt)
802
+ get(s, c, u) {
803
+ if (c === mt)
804
804
  return e;
805
- var f = n.get(c), d = c in o;
806
- if (f === void 0 && (!d || Kt(o, c)?.writable) && (f = l(() => {
807
- var m = dt(d ? o[c] : se), _ = /* @__PURE__ */ ze(m);
805
+ var f = n.get(c), h = c in s;
806
+ if (f === void 0 && (!h || Vt(s, c)?.writable) && (f = l(() => {
807
+ var m = ht(h ? s[c] : ae), _ = /* @__PURE__ */ He(m);
808
808
  return _;
809
809
  }), n.set(c, f)), f !== void 0) {
810
- var v = a(f);
811
- return v === se ? void 0 : v;
810
+ var d = a(f);
811
+ return d === ae ? void 0 : d;
812
812
  }
813
- return Reflect.get(o, c, u);
813
+ return Reflect.get(s, c, u);
814
814
  },
815
- getOwnPropertyDescriptor(o, c) {
816
- var u = Reflect.getOwnPropertyDescriptor(o, c);
815
+ getOwnPropertyDescriptor(s, c) {
816
+ var u = Reflect.getOwnPropertyDescriptor(s, c);
817
817
  if (u && "value" in u) {
818
818
  var f = n.get(c);
819
819
  f && (u.value = a(f));
820
820
  } else if (u === void 0) {
821
- var d = n.get(c), v = d?.v;
822
- if (d !== void 0 && v !== se)
821
+ var h = n.get(c), d = h?.v;
822
+ if (h !== void 0 && d !== ae)
823
823
  return {
824
824
  enumerable: !0,
825
825
  configurable: !0,
826
- value: v,
826
+ value: d,
827
827
  writable: !0
828
828
  };
829
829
  }
830
830
  return u;
831
831
  },
832
- has(o, c) {
833
- if (c === vt)
832
+ has(s, c) {
833
+ if (c === mt)
834
834
  return !0;
835
- var u = n.get(c), f = u !== void 0 && u.v !== se || Reflect.has(o, c);
836
- if (u !== void 0 || j !== null && (!f || Kt(o, c)?.writable)) {
835
+ var u = n.get(c), f = u !== void 0 && u.v !== ae || Reflect.has(s, c);
836
+ if (u !== void 0 || j !== null && (!f || Vt(s, c)?.writable)) {
837
837
  u === void 0 && (u = l(() => {
838
- var v = f ? dt(o[c]) : se, m = /* @__PURE__ */ ze(v);
838
+ var d = f ? ht(s[c]) : ae, m = /* @__PURE__ */ He(d);
839
839
  return m;
840
840
  }), n.set(c, u));
841
- var d = a(u);
842
- if (d === se)
841
+ var h = a(u);
842
+ if (h === ae)
843
843
  return !1;
844
844
  }
845
845
  return f;
846
846
  },
847
- set(o, c, u, f) {
848
- var d = n.get(c), v = c in o;
847
+ set(s, c, u, f) {
848
+ var h = n.get(c), d = c in s;
849
849
  if (r && c === "length")
850
850
  for (var m = u; m < /** @type {Source<number>} */
851
- d.v; m += 1) {
851
+ h.v; m += 1) {
852
852
  var _ = n.get(m + "");
853
- _ !== void 0 ? A(_, se) : m in o && (_ = l(() => /* @__PURE__ */ ze(se)), n.set(m + "", _));
853
+ _ !== void 0 ? T(_, ae) : m in s && (_ = l(() => /* @__PURE__ */ He(ae)), n.set(m + "", _));
854
854
  }
855
- if (d === void 0)
856
- (!v || Kt(o, c)?.writable) && (d = l(() => /* @__PURE__ */ ze(void 0)), A(d, dt(u)), n.set(c, d));
855
+ if (h === void 0)
856
+ (!d || Vt(s, c)?.writable) && (h = l(() => /* @__PURE__ */ He(void 0)), T(h, ht(u)), n.set(c, h));
857
857
  else {
858
- v = d.v !== se;
859
- var h = l(() => dt(u));
860
- A(d, h);
858
+ d = h.v !== ae;
859
+ var p = l(() => ht(u));
860
+ T(h, p);
861
861
  }
862
- var p = Reflect.getOwnPropertyDescriptor(o, c);
863
- if (p?.set && p.set.call(f, u), !v) {
862
+ var v = Reflect.getOwnPropertyDescriptor(s, c);
863
+ if (v?.set && v.set.call(f, u), !d) {
864
864
  if (r && typeof c == "string") {
865
865
  var y = (
866
866
  /** @type {Source<number>} */
867
867
  n.get("length")
868
868
  ), B = Number(c);
869
- Number.isInteger(B) && B >= y.v && A(y, B + 1);
869
+ Number.isInteger(B) && B >= y.v && T(y, B + 1);
870
870
  }
871
- En(s);
871
+ Cn(o);
872
872
  }
873
873
  return !0;
874
874
  },
875
- ownKeys(o) {
876
- a(s);
877
- var c = Reflect.ownKeys(o).filter((d) => {
878
- var v = n.get(d);
879
- return v === void 0 || v.v !== se;
875
+ ownKeys(s) {
876
+ a(o);
877
+ var c = Reflect.ownKeys(s).filter((h) => {
878
+ var d = n.get(h);
879
+ return d === void 0 || d.v !== ae;
880
880
  });
881
881
  for (var [u, f] of n)
882
- f.v !== se && !(u in o) && c.push(u);
882
+ f.v !== ae && !(u in s) && c.push(u);
883
883
  return c;
884
884
  },
885
885
  setPrototypeOf() {
886
- Hi();
886
+ qi();
887
887
  }
888
888
  }
889
889
  );
890
890
  }
891
- var $i, es, ts;
892
- function Ze(e = "") {
891
+ var no, ro, io;
892
+ function Xe(e = "") {
893
893
  return document.createTextNode(e);
894
894
  }
895
895
  // @__NO_SIDE_EFFECTS__
896
- function Gt(e) {
896
+ function Zt(e) {
897
897
  return (
898
898
  /** @type {TemplateNode | null} */
899
- es.call(e)
899
+ ro.call(e)
900
900
  );
901
901
  }
902
902
  // @__NO_SIDE_EFFECTS__
903
- function Ot(e) {
903
+ function Dt(e) {
904
904
  return (
905
905
  /** @type {TemplateNode | null} */
906
- ts.call(e)
906
+ io.call(e)
907
907
  );
908
908
  }
909
- function g(e, t) {
910
- return /* @__PURE__ */ Gt(e);
909
+ function E(e, t) {
910
+ return /* @__PURE__ */ Zt(e);
911
911
  }
912
912
  function Ke(e, t = !1) {
913
913
  {
914
- var n = /* @__PURE__ */ Gt(e);
915
- return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ot(n) : n;
914
+ var n = /* @__PURE__ */ Zt(e);
915
+ return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Dt(n) : n;
916
916
  }
917
917
  }
918
- function q(e, t = 1, n = !1) {
918
+ function U(e, t = 1, n = !1) {
919
919
  let r = e;
920
920
  for (; t--; )
921
921
  r = /** @type {TemplateNode} */
922
- /* @__PURE__ */ Ot(r);
922
+ /* @__PURE__ */ Dt(r);
923
923
  return r;
924
924
  }
925
- function ns(e) {
925
+ function oo(e) {
926
926
  e.textContent = "";
927
927
  }
928
- function Mr() {
928
+ function Rr() {
929
929
  return !1;
930
930
  }
931
- let $n = !1;
932
- function rs() {
933
- $n || ($n = !0, document.addEventListener(
931
+ let nr = !1;
932
+ function ao() {
933
+ nr || (nr = !0, document.addEventListener(
934
934
  "reset",
935
935
  (e) => {
936
936
  Promise.resolve().then(() => {
@@ -947,37 +947,37 @@ function rs() {
947
947
  { capture: !0 }
948
948
  ));
949
949
  }
950
- function an(e) {
951
- var t = N, n = j;
952
- Me(null), Ve(null);
950
+ function un(e) {
951
+ var t = A, n = j;
952
+ Ce(null), Ye(null);
953
953
  try {
954
954
  return e();
955
955
  } finally {
956
- Me(t), Ve(n);
956
+ Ce(t), Ye(n);
957
957
  }
958
958
  }
959
- function is(e, t, n, r = n) {
960
- e.addEventListener(t, () => an(n));
961
- const s = e.__on_r;
962
- s ? e.__on_r = () => {
963
- s(), r(!0);
964
- } : e.__on_r = () => r(!0), rs();
959
+ function so(e, t, n, r = n) {
960
+ e.addEventListener(t, () => un(n));
961
+ const o = e.__on_r;
962
+ o ? e.__on_r = () => {
963
+ o(), r(!0);
964
+ } : e.__on_r = () => r(!0), ao();
965
965
  }
966
- function Cr(e) {
967
- j === null && (N === null && Di(), Fi()), rt && Oi();
966
+ function Tr(e) {
967
+ j === null && (A === null && zi(), ji()), ot && Ui();
968
968
  }
969
- function ss(e, t) {
969
+ function lo(e, t) {
970
970
  var n = t.last;
971
971
  n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
972
972
  }
973
- function Ye(e, t, n) {
973
+ function Ge(e, t, n) {
974
974
  var r = j;
975
- r !== null && (r.f & _e) !== 0 && (e |= _e);
976
- var s = {
977
- ctx: $,
975
+ r !== null && (r.f & me) !== 0 && (e |= me);
976
+ var o = {
977
+ ctx: ee,
978
978
  deps: null,
979
979
  nodes: null,
980
- f: e | fe | Pe,
980
+ f: e | pe | Pe,
981
981
  first: null,
982
982
  fn: t,
983
983
  last: null,
@@ -991,114 +991,114 @@ function Ye(e, t, n) {
991
991
  };
992
992
  if (n)
993
993
  try {
994
- pt(s), s.f |= jn;
995
- } catch (o) {
996
- throw Te(s), o;
994
+ _t(o), o.f |= Bn;
995
+ } catch (s) {
996
+ throw Te(o), s;
997
997
  }
998
- else t !== null && nt(s);
999
- var i = s;
998
+ else t !== null && it(o);
999
+ var i = o;
1000
1000
  if (n && i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && // either `null`, or a singular child
1001
- (i.f & en) === 0 && (i = i.first, (e & Ne) !== 0 && (e & It) !== 0 && i !== null && (i.f |= It)), i !== null && (i.parent = r, r !== null && ss(i, r), N !== null && (N.f & re) !== 0 && (e & ht) === 0)) {
1001
+ (i.f & on) === 0 && (i = i.first, (e & Ne) !== 0 && (e & Mt) !== 0 && i !== null && (i.f |= Mt)), i !== null && (i.parent = r, r !== null && lo(i, r), A !== null && (A.f & ie) !== 0 && (e & yt) === 0)) {
1002
1002
  var l = (
1003
1003
  /** @type {Derived} */
1004
- N
1004
+ A
1005
1005
  );
1006
1006
  (l.effects ??= []).push(i);
1007
1007
  }
1008
- return s;
1008
+ return o;
1009
1009
  }
1010
- function Wt() {
1011
- return N !== null && !Ie;
1010
+ function Qt() {
1011
+ return A !== null && !ke;
1012
1012
  }
1013
- function qn(e) {
1014
- const t = Ye($t, null, !1);
1015
- return ne(t, te), t.teardown = e, t;
1013
+ function Yn(e) {
1014
+ const t = Ge(rn, null, !1);
1015
+ return re(t, ne), t.teardown = e, t;
1016
1016
  }
1017
- function er(e) {
1018
- Cr();
1017
+ function rr(e) {
1018
+ Tr();
1019
1019
  var t = (
1020
1020
  /** @type {Effect} */
1021
1021
  j.f
1022
- ), n = !N && (t & Le) !== 0 && (t & jn) === 0;
1022
+ ), n = !A && (t & Le) !== 0 && (t & Bn) === 0;
1023
1023
  if (n) {
1024
1024
  var r = (
1025
1025
  /** @type {ComponentContext} */
1026
- $
1026
+ ee
1027
1027
  );
1028
1028
  (r.e ??= []).push(e);
1029
1029
  } else
1030
- return xr(e);
1030
+ return Ar(e);
1031
1031
  }
1032
- function xr(e) {
1033
- return Ye(pr | mr, e, !1);
1032
+ function Ar(e) {
1033
+ return Ge(_r | br, e, !1);
1034
1034
  }
1035
- function as(e) {
1036
- return Cr(), Ye($t | mr, e, !0);
1035
+ function co(e) {
1036
+ return Tr(), Ge(rn | br, e, !0);
1037
1037
  }
1038
- function ee(e, t) {
1038
+ function te(e, t) {
1039
1039
  var n = (
1040
1040
  /** @type {ComponentContextLegacy} */
1041
- $
1041
+ ee
1042
1042
  ), r = { effect: null, ran: !1, deps: e };
1043
- n.l.$.push(r), r.effect = Vn(() => {
1043
+ n.l.$.push(r), r.effect = Wn(() => {
1044
1044
  e(), !r.ran && (r.ran = !0, w(t));
1045
1045
  });
1046
1046
  }
1047
- function Bn() {
1047
+ function Gn() {
1048
1048
  var e = (
1049
1049
  /** @type {ComponentContextLegacy} */
1050
- $
1050
+ ee
1051
1051
  );
1052
- Vn(() => {
1052
+ Wn(() => {
1053
1053
  for (var t of e.l.$) {
1054
1054
  t.deps();
1055
1055
  var n = t.effect;
1056
- (n.f & te) !== 0 && ne(n, Se), mt(n) && pt(n), t.ran = !1;
1056
+ (n.f & ne) !== 0 && re(n, Se), bt(n) && _t(n), t.ran = !1;
1057
1057
  }
1058
1058
  });
1059
1059
  }
1060
- function os(e) {
1061
- return Ye(zn | en, e, !0);
1060
+ function uo(e) {
1061
+ return Ge(Kn | on, e, !0);
1062
1062
  }
1063
- function Vn(e, t = 0) {
1064
- return Ye($t | t, e, !0);
1063
+ function Wn(e, t = 0) {
1064
+ return Ge(rn | t, e, !0);
1065
1065
  }
1066
- function X(e, t = [], n = [], r = []) {
1067
- Wi(r, t, n, (s) => {
1068
- Ye($t, () => e(...s.map(a)), !0);
1066
+ function Q(e, t = [], n = [], r = []) {
1067
+ Qi(r, t, n, (o) => {
1068
+ Ge(rn, () => e(...o.map(a)), !0);
1069
1069
  });
1070
1070
  }
1071
- function Rr(e, t = 0) {
1072
- var n = Ye(Ne | t, e, !0);
1071
+ function Nr(e, t = 0) {
1072
+ var n = Ge(Ne | t, e, !0);
1073
1073
  return n;
1074
1074
  }
1075
- function Tt(e) {
1076
- return Ye(Le | en, e, !0);
1075
+ function Nt(e) {
1076
+ return Ge(Le | on, e, !0);
1077
1077
  }
1078
- function Tr(e) {
1078
+ function Lr(e) {
1079
1079
  var t = e.teardown;
1080
1080
  if (t !== null) {
1081
- const n = rt, r = N;
1082
- tr(!0), Me(null);
1081
+ const n = ot, r = A;
1082
+ ir(!0), Ce(null);
1083
1083
  try {
1084
1084
  t.call(null);
1085
1085
  } finally {
1086
- tr(n), Me(r);
1086
+ ir(n), Ce(r);
1087
1087
  }
1088
1088
  }
1089
1089
  }
1090
- function Ar(e, t = !1) {
1090
+ function Or(e, t = !1) {
1091
1091
  var n = e.first;
1092
1092
  for (e.first = e.last = null; n !== null; ) {
1093
- const s = n.ac;
1094
- s !== null && an(() => {
1095
- s.abort(ft);
1093
+ const o = n.ac;
1094
+ o !== null && un(() => {
1095
+ o.abort(pt);
1096
1096
  });
1097
1097
  var r = n.next;
1098
- (n.f & ht) !== 0 ? n.parent = null : Te(n, t), n = r;
1098
+ (n.f & yt) !== 0 ? n.parent = null : Te(n, t), n = r;
1099
1099
  }
1100
1100
  }
1101
- function ls(e) {
1101
+ function fo(e) {
1102
1102
  for (var t = e.first; t !== null; ) {
1103
1103
  var n = t.next;
1104
1104
  (t.f & Le) === 0 && Te(t), t = n;
@@ -1106,67 +1106,67 @@ function ls(e) {
1106
1106
  }
1107
1107
  function Te(e, t = !0) {
1108
1108
  var n = !1;
1109
- (t || (e.f & hr) !== 0) && e.nodes !== null && e.nodes.end !== null && (cs(
1109
+ (t || (e.f & yr) !== 0) && e.nodes !== null && e.nodes.end !== null && (vo(
1110
1110
  e.nodes.start,
1111
1111
  /** @type {TemplateNode} */
1112
1112
  e.nodes.end
1113
- ), n = !0), Ar(e, t && !n), Zt(e, 0), ne(e, Re);
1113
+ ), n = !0), Or(e, t && !n), $t(e, 0), re(e, Re);
1114
1114
  var r = e.nodes && e.nodes.t;
1115
1115
  if (r !== null)
1116
1116
  for (const i of r)
1117
1117
  i.stop();
1118
- Tr(e);
1119
- var s = e.parent;
1120
- s !== null && s.first !== null && Nr(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1118
+ Lr(e);
1119
+ var o = e.parent;
1120
+ o !== null && o.first !== null && Fr(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1121
1121
  }
1122
- function cs(e, t) {
1122
+ function vo(e, t) {
1123
1123
  for (; e !== null; ) {
1124
- var n = e === t ? null : /* @__PURE__ */ Ot(e);
1124
+ var n = e === t ? null : /* @__PURE__ */ Dt(e);
1125
1125
  e.remove(), e = n;
1126
1126
  }
1127
1127
  }
1128
- function Nr(e) {
1128
+ function Fr(e) {
1129
1129
  var t = e.parent, n = e.prev, r = e.next;
1130
1130
  n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
1131
1131
  }
1132
- function Yn(e, t, n = !0) {
1132
+ function Jn(e, t, n = !0) {
1133
1133
  var r = [];
1134
- Lr(e, r, !0);
1135
- var s = () => {
1134
+ Dr(e, r, !0);
1135
+ var o = () => {
1136
1136
  n && Te(e), t && t();
1137
1137
  }, i = r.length;
1138
1138
  if (i > 0) {
1139
- var l = () => --i || s();
1140
- for (var o of r)
1141
- o.out(l);
1139
+ var l = () => --i || o();
1140
+ for (var s of r)
1141
+ s.out(l);
1142
1142
  } else
1143
- s();
1143
+ o();
1144
1144
  }
1145
- function Lr(e, t, n) {
1146
- if ((e.f & _e) === 0) {
1147
- e.f ^= _e;
1145
+ function Dr(e, t, n) {
1146
+ if ((e.f & me) === 0) {
1147
+ e.f ^= me;
1148
1148
  var r = e.nodes && e.nodes.t;
1149
1149
  if (r !== null)
1150
- for (const o of r)
1151
- (o.is_global || n) && t.push(o);
1152
- for (var s = e.first; s !== null; ) {
1153
- var i = s.next, l = (s.f & It) !== 0 || // If this is a branch effect without a block effect parent,
1150
+ for (const s of r)
1151
+ (s.is_global || n) && t.push(s);
1152
+ for (var o = e.first; o !== null; ) {
1153
+ var i = o.next, l = (o.f & Mt) !== 0 || // If this is a branch effect without a block effect parent,
1154
1154
  // it means the parent block effect was pruned. In that case,
1155
1155
  // transparency information was transferred to the branch effect.
1156
- (s.f & Le) !== 0 && (e.f & Ne) !== 0;
1157
- Lr(s, t, l ? n : !1), s = i;
1156
+ (o.f & Le) !== 0 && (e.f & Ne) !== 0;
1157
+ Dr(o, t, l ? n : !1), o = i;
1158
1158
  }
1159
1159
  }
1160
1160
  }
1161
- function Gn(e) {
1162
- Or(e, !0);
1161
+ function Zn(e) {
1162
+ Ur(e, !0);
1163
1163
  }
1164
- function Or(e, t) {
1165
- if ((e.f & _e) !== 0) {
1166
- e.f ^= _e, (e.f & te) === 0 && (ne(e, fe), nt(e));
1164
+ function Ur(e, t) {
1165
+ if ((e.f & me) !== 0) {
1166
+ e.f ^= me, (e.f & ne) === 0 && (re(e, pe), it(e));
1167
1167
  for (var n = e.first; n !== null; ) {
1168
- var r = n.next, s = (n.f & It) !== 0 || (n.f & Le) !== 0;
1169
- Or(n, s ? t : !1), n = r;
1168
+ var r = n.next, o = (n.f & Mt) !== 0 || (n.f & Le) !== 0;
1169
+ Ur(n, o ? t : !1), n = r;
1170
1170
  }
1171
1171
  var i = e.nodes && e.nodes.t;
1172
1172
  if (i !== null)
@@ -1174,57 +1174,57 @@ function Or(e, t) {
1174
1174
  (l.is_global || t) && l.in();
1175
1175
  }
1176
1176
  }
1177
- function us(e, t) {
1177
+ function po(e, t) {
1178
1178
  if (e.nodes)
1179
1179
  for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) {
1180
- var s = n === r ? null : /* @__PURE__ */ Ot(n);
1181
- t.append(n), n = s;
1180
+ var o = n === r ? null : /* @__PURE__ */ Dt(n);
1181
+ t.append(n), n = o;
1182
1182
  }
1183
1183
  }
1184
- let Qe = !1;
1185
- function Jt(e) {
1186
- Qe = e;
1184
+ let $e = !1;
1185
+ function Xt(e) {
1186
+ $e = e;
1187
1187
  }
1188
- let rt = !1;
1189
- function tr(e) {
1190
- rt = e;
1188
+ let ot = !1;
1189
+ function ir(e) {
1190
+ ot = e;
1191
1191
  }
1192
- let N = null, Ie = !1;
1193
- function Me(e) {
1194
- N = e;
1192
+ let A = null, ke = !1;
1193
+ function Ce(e) {
1194
+ A = e;
1195
1195
  }
1196
1196
  let j = null;
1197
- function Ve(e) {
1197
+ function Ye(e) {
1198
1198
  j = e;
1199
1199
  }
1200
1200
  let Ae = null;
1201
- function fs(e) {
1202
- N !== null && (Ae === null ? Ae = [e] : Ae.push(e));
1201
+ function ho(e) {
1202
+ A !== null && (Ae === null ? Ae = [e] : Ae.push(e));
1203
1203
  }
1204
- let le = null, he = 0, ye = null;
1205
- function ds(e) {
1204
+ let ce = null, he = 0, ye = null;
1205
+ function mo(e) {
1206
1206
  ye = e;
1207
1207
  }
1208
- let Fr = 1, At = 0, Xe = At;
1209
- function nr(e) {
1210
- Xe = e;
1208
+ let jr = 1, Lt = 0, et = Lt;
1209
+ function or(e) {
1210
+ et = e;
1211
1211
  }
1212
- function Dr() {
1213
- return ++Fr;
1212
+ function zr() {
1213
+ return ++jr;
1214
1214
  }
1215
- function mt(e) {
1215
+ function bt(e) {
1216
1216
  var t = e.f;
1217
- if ((t & fe) !== 0)
1217
+ if ((t & pe) !== 0)
1218
1218
  return !0;
1219
- if (t & re && (e.f &= ~tt), (t & Se) !== 0) {
1219
+ if (t & ie && (e.f &= ~rt), (t & Se) !== 0) {
1220
1220
  var n = e.deps;
1221
1221
  if (n !== null)
1222
- for (var r = n.length, s = 0; s < r; s++) {
1223
- var i = n[s];
1224
- if (mt(
1222
+ for (var r = n.length, o = 0; o < r; o++) {
1223
+ var i = n[o];
1224
+ if (bt(
1225
1225
  /** @type {Derived} */
1226
1226
  i
1227
- ) && Sr(
1227
+ ) && Ir(
1228
1228
  /** @type {Derived} */
1229
1229
  i
1230
1230
  ), i.wv > e.wv)
@@ -1232,160 +1232,160 @@ function mt(e) {
1232
1232
  }
1233
1233
  (t & Pe) !== 0 && // During time traveling we don't want to reset the status so that
1234
1234
  // traversal of the graph in the other batches still happens
1235
- ge === null && ne(e, te);
1235
+ ge === null && re(e, ne);
1236
1236
  }
1237
1237
  return !1;
1238
1238
  }
1239
- function Ur(e, t, n = !0) {
1239
+ function Hr(e, t, n = !0) {
1240
1240
  var r = e.reactions;
1241
1241
  if (r !== null && !Ae?.includes(e))
1242
- for (var s = 0; s < r.length; s++) {
1243
- var i = r[s];
1244
- (i.f & re) !== 0 ? Ur(
1242
+ for (var o = 0; o < r.length; o++) {
1243
+ var i = r[o];
1244
+ (i.f & ie) !== 0 ? Hr(
1245
1245
  /** @type {Derived} */
1246
1246
  i,
1247
1247
  t,
1248
1248
  !1
1249
- ) : t === i && (n ? ne(i, fe) : (i.f & te) !== 0 && ne(i, Se), nt(
1249
+ ) : t === i && (n ? re(i, pe) : (i.f & ne) !== 0 && re(i, Se), it(
1250
1250
  /** @type {Effect} */
1251
1251
  i
1252
1252
  ));
1253
1253
  }
1254
1254
  }
1255
- function jr(e) {
1256
- var t = le, n = he, r = ye, s = N, i = Ae, l = $, o = Ie, c = Xe, u = e.f;
1257
- le = /** @type {null | Value[]} */
1258
- null, he = 0, ye = null, N = (u & (Le | ht)) === 0 ? e : null, Ae = null, Bt(e.ctx), Ie = !1, Xe = ++At, e.ac !== null && (an(() => {
1259
- e.ac.abort(ft);
1255
+ function Br(e) {
1256
+ var t = ce, n = he, r = ye, o = A, i = Ae, l = ee, s = ke, c = et, u = e.f;
1257
+ ce = /** @type {null | Value[]} */
1258
+ null, he = 0, ye = null, A = (u & (Le | yt)) === 0 ? e : null, Ae = null, Gt(e.ctx), ke = !1, et = ++Lt, e.ac !== null && (un(() => {
1259
+ e.ac.abort(pt);
1260
1260
  }), e.ac = null);
1261
1261
  try {
1262
- e.f |= Cn;
1262
+ e.f |= An;
1263
1263
  var f = (
1264
1264
  /** @type {Function} */
1265
1265
  e.fn
1266
- ), d = f(), v = e.deps;
1267
- if (le !== null) {
1266
+ ), h = f(), d = e.deps;
1267
+ if (ce !== null) {
1268
1268
  var m;
1269
- if (Zt(e, he), v !== null && he > 0)
1270
- for (v.length = he + le.length, m = 0; m < le.length; m++)
1271
- v[he + m] = le[m];
1269
+ if ($t(e, he), d !== null && he > 0)
1270
+ for (d.length = he + ce.length, m = 0; m < ce.length; m++)
1271
+ d[he + m] = ce[m];
1272
1272
  else
1273
- e.deps = v = le;
1274
- if (Wt() && (e.f & Pe) !== 0)
1275
- for (m = he; m < v.length; m++)
1276
- (v[m].reactions ??= []).push(e);
1277
- } else v !== null && he < v.length && (Zt(e, he), v.length = he);
1278
- if (Lt() && ye !== null && !Ie && v !== null && (e.f & (re | Se | fe)) === 0)
1273
+ e.deps = d = ce;
1274
+ if (Qt() && (e.f & Pe) !== 0)
1275
+ for (m = he; m < d.length; m++)
1276
+ (d[m].reactions ??= []).push(e);
1277
+ } else d !== null && he < d.length && ($t(e, he), d.length = he);
1278
+ if (Ft() && ye !== null && !ke && d !== null && (e.f & (ie | Se | pe)) === 0)
1279
1279
  for (m = 0; m < /** @type {Source[]} */
1280
1280
  ye.length; m++)
1281
- Ur(
1281
+ Hr(
1282
1282
  ye[m],
1283
1283
  /** @type {Effect} */
1284
1284
  e
1285
1285
  );
1286
- return s !== null && s !== e && (At++, ye !== null && (r === null ? r = ye : r.push(.../** @type {Source[]} */
1287
- ye))), (e.f & qe) !== 0 && (e.f ^= qe), d;
1286
+ return o !== null && o !== e && (Lt++, ye !== null && (r === null ? r = ye : r.push(.../** @type {Source[]} */
1287
+ ye))), (e.f & qe) !== 0 && (e.f ^= qe), h;
1288
1288
  } catch (_) {
1289
- return Vi(_);
1289
+ return Wi(_);
1290
1290
  } finally {
1291
- e.f ^= Cn, le = t, he = n, ye = r, N = s, Ae = i, Bt(l), Ie = o, Xe = c;
1291
+ e.f ^= An, ce = t, he = n, ye = r, A = o, Ae = i, Gt(l), ke = s, et = c;
1292
1292
  }
1293
1293
  }
1294
- function vs(e, t) {
1294
+ function _o(e, t) {
1295
1295
  let n = t.reactions;
1296
1296
  if (n !== null) {
1297
- var r = Mi.call(n, e);
1297
+ var r = Ri.call(n, e);
1298
1298
  if (r !== -1) {
1299
- var s = n.length - 1;
1300
- s === 0 ? n = t.reactions = null : (n[r] = n[s], n.pop());
1299
+ var o = n.length - 1;
1300
+ o === 0 ? n = t.reactions = null : (n[r] = n[o], n.pop());
1301
1301
  }
1302
1302
  }
1303
- n === null && (t.f & re) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1303
+ n === null && (t.f & ie) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1304
1304
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1305
1305
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1306
- (le === null || !le.includes(t)) && (ne(t, Se), (t.f & Pe) !== 0 && (t.f ^= Pe, t.f &= ~tt), Pr(
1306
+ (ce === null || !ce.includes(t)) && (re(t, Se), (t.f & Pe) !== 0 && (t.f ^= Pe, t.f &= ~rt), Cr(
1307
1307
  /** @type {Derived} **/
1308
1308
  t
1309
- ), Zt(
1309
+ ), $t(
1310
1310
  /** @type {Derived} **/
1311
1311
  t,
1312
1312
  0
1313
1313
  ));
1314
1314
  }
1315
- function Zt(e, t) {
1315
+ function $t(e, t) {
1316
1316
  var n = e.deps;
1317
1317
  if (n !== null)
1318
1318
  for (var r = t; r < n.length; r++)
1319
- vs(e, n[r]);
1319
+ _o(e, n[r]);
1320
1320
  }
1321
- function pt(e) {
1321
+ function _t(e) {
1322
1322
  var t = e.f;
1323
1323
  if ((t & Re) === 0) {
1324
- ne(e, te);
1325
- var n = j, r = Qe;
1326
- j = e, Qe = !0;
1324
+ re(e, ne);
1325
+ var n = j, r = $e;
1326
+ j = e, $e = !0;
1327
1327
  try {
1328
- (t & (Ne | Ti)) !== 0 ? ls(e) : Ar(e), Tr(e);
1329
- var s = jr(e);
1330
- e.teardown = typeof s == "function" ? s : null, e.wv = Fr;
1328
+ (t & (Ne | Li)) !== 0 ? fo(e) : Or(e), Lr(e);
1329
+ var o = Br(e);
1330
+ e.teardown = typeof o == "function" ? o : null, e.wv = jr;
1331
1331
  var i;
1332
- kn && vi && (e.f & fe) !== 0 && e.deps;
1332
+ xn && mi && (e.f & pe) !== 0 && e.deps;
1333
1333
  } finally {
1334
- Qe = r, j = n;
1334
+ $e = r, j = n;
1335
1335
  }
1336
1336
  }
1337
1337
  }
1338
- async function ps() {
1339
- await Promise.resolve(), Yi();
1338
+ async function yo() {
1339
+ await Promise.resolve(), Ji();
1340
1340
  }
1341
1341
  function a(e) {
1342
- var t = e.f, n = (t & re) !== 0;
1343
- if (N !== null && !Ie) {
1342
+ var t = e.f, n = (t & ie) !== 0;
1343
+ if (A !== null && !ke) {
1344
1344
  var r = j !== null && (j.f & Re) !== 0;
1345
1345
  if (!r && !Ae?.includes(e)) {
1346
- var s = N.deps;
1347
- if ((N.f & Cn) !== 0)
1348
- e.rv < At && (e.rv = At, le === null && s !== null && s[he] === e ? he++ : le === null ? le = [e] : le.includes(e) || le.push(e));
1346
+ var o = A.deps;
1347
+ if ((A.f & An) !== 0)
1348
+ e.rv < Lt && (e.rv = Lt, ce === null && o !== null && o[he] === e ? he++ : ce === null ? ce = [e] : ce.includes(e) || ce.push(e));
1349
1349
  else {
1350
- (N.deps ??= []).push(e);
1350
+ (A.deps ??= []).push(e);
1351
1351
  var i = e.reactions;
1352
- i === null ? e.reactions = [N] : i.includes(N) || i.push(N);
1352
+ i === null ? e.reactions = [A] : i.includes(A) || i.push(A);
1353
1353
  }
1354
1354
  }
1355
1355
  }
1356
- if (rt) {
1357
- if (Be.has(e))
1358
- return Be.get(e);
1356
+ if (ot) {
1357
+ if (Ve.has(e))
1358
+ return Ve.get(e);
1359
1359
  if (n) {
1360
1360
  var l = (
1361
1361
  /** @type {Derived} */
1362
1362
  e
1363
- ), o = l.v;
1364
- return ((l.f & te) === 0 && l.reactions !== null || Hr(l)) && (o = Kn(l)), Be.set(l, o), o;
1363
+ ), s = l.v;
1364
+ return ((l.f & ne) === 0 && l.reactions !== null || qr(l)) && (s = Vn(l)), Ve.set(l, s), s;
1365
1365
  }
1366
- } else n && (!ge?.has(e) || L?.is_fork && !Wt()) && (l = /** @type {Derived} */
1367
- e, mt(l) && Sr(l), Qe && Wt() && (l.f & Pe) === 0 && zr(l));
1366
+ } else n && (!ge?.has(e) || N?.is_fork && !Qt()) && (l = /** @type {Derived} */
1367
+ e, bt(l) && Ir(l), $e && Qt() && (l.f & Pe) === 0 && Kr(l));
1368
1368
  if (ge?.has(e))
1369
1369
  return ge.get(e);
1370
1370
  if ((e.f & qe) !== 0)
1371
1371
  throw e.v;
1372
1372
  return e.v;
1373
1373
  }
1374
- function zr(e) {
1374
+ function Kr(e) {
1375
1375
  if (e.deps !== null) {
1376
1376
  e.f ^= Pe;
1377
1377
  for (const t of e.deps)
1378
- (t.reactions ??= []).push(e), (t.f & re) !== 0 && (t.f & Pe) === 0 && zr(
1378
+ (t.reactions ??= []).push(e), (t.f & ie) !== 0 && (t.f & Pe) === 0 && Kr(
1379
1379
  /** @type {Derived} */
1380
1380
  t
1381
1381
  );
1382
1382
  }
1383
1383
  }
1384
- function Hr(e) {
1385
- if (e.v === se) return !0;
1384
+ function qr(e) {
1385
+ if (e.v === ae) return !0;
1386
1386
  if (e.deps === null) return !1;
1387
1387
  for (const t of e.deps)
1388
- if (Be.has(t) || (t.f & re) !== 0 && Hr(
1388
+ if (Ve.has(t) || (t.f & ie) !== 0 && qr(
1389
1389
  /** @type {Derived} */
1390
1390
  t
1391
1391
  ))
@@ -1393,42 +1393,42 @@ function Hr(e) {
1393
1393
  return !1;
1394
1394
  }
1395
1395
  function w(e) {
1396
- var t = Ie;
1396
+ var t = ke;
1397
1397
  try {
1398
- return Ie = !0, e();
1398
+ return ke = !0, e();
1399
1399
  } finally {
1400
- Ie = t;
1400
+ ke = t;
1401
1401
  }
1402
1402
  }
1403
- const hs = -7169;
1404
- function ne(e, t) {
1405
- e.f = e.f & hs | t;
1403
+ const bo = -7169;
1404
+ function re(e, t) {
1405
+ e.f = e.f & bo | t;
1406
1406
  }
1407
1407
  function G(e) {
1408
1408
  if (!(typeof e != "object" || !e || e instanceof EventTarget)) {
1409
- if (vt in e)
1410
- Tn(e);
1409
+ if (mt in e)
1410
+ On(e);
1411
1411
  else if (!Array.isArray(e))
1412
1412
  for (let t in e) {
1413
1413
  const n = e[t];
1414
- typeof n == "object" && n && vt in n && Tn(n);
1414
+ typeof n == "object" && n && mt in n && On(n);
1415
1415
  }
1416
1416
  }
1417
1417
  }
1418
- function Tn(e, t = /* @__PURE__ */ new Set()) {
1418
+ function On(e, t = /* @__PURE__ */ new Set()) {
1419
1419
  if (typeof e == "object" && e !== null && // We don't want to traverse DOM elements
1420
1420
  !(e instanceof EventTarget) && !t.has(e)) {
1421
1421
  t.add(e), e instanceof Date && e.getTime();
1422
1422
  for (let r in e)
1423
1423
  try {
1424
- Tn(e[r], t);
1424
+ On(e[r], t);
1425
1425
  } catch {
1426
1426
  }
1427
- const n = Dn(e);
1427
+ const n = zn(e);
1428
1428
  if (n !== Object.prototype && n !== Array.prototype && n !== Map.prototype && n !== Set.prototype && n !== Date.prototype) {
1429
- const r = dr(n);
1430
- for (let s in r) {
1431
- const i = r[s].get;
1429
+ const r = hr(n);
1430
+ for (let o in r) {
1431
+ const i = r[o].get;
1432
1432
  if (i)
1433
1433
  try {
1434
1434
  i.call(e);
@@ -1438,91 +1438,91 @@ function Tn(e, t = /* @__PURE__ */ new Set()) {
1438
1438
  }
1439
1439
  }
1440
1440
  }
1441
- function ms(e, t, n, r = {}) {
1442
- function s(i) {
1443
- if (r.capture || _s.call(t, i), !i.cancelBubble)
1444
- return an(() => n?.call(this, i));
1441
+ function go(e, t, n, r = {}) {
1442
+ function o(i) {
1443
+ if (r.capture || wo.call(t, i), !i.cancelBubble)
1444
+ return un(() => n?.call(this, i));
1445
1445
  }
1446
- return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? Hn(() => {
1447
- t.addEventListener(e, s, r);
1448
- }) : t.addEventListener(e, s, r), s;
1446
+ return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? qn(() => {
1447
+ t.addEventListener(e, o, r);
1448
+ }) : t.addEventListener(e, o, r), o;
1449
1449
  }
1450
- function ce(e, t, n, r, s) {
1451
- var i = { capture: r, passive: s }, l = ms(e, t, n, i);
1450
+ function fe(e, t, n, r, o) {
1451
+ var i = { capture: r, passive: o }, l = go(e, t, n, i);
1452
1452
  (t === document.body || // @ts-ignore
1453
1453
  t === window || // @ts-ignore
1454
1454
  t === document || // Firefox has quirky behavior, it can happen that we still get "canplay" events when the element is already removed
1455
- t instanceof HTMLMediaElement) && qn(() => {
1455
+ t instanceof HTMLMediaElement) && Yn(() => {
1456
1456
  t.removeEventListener(e, l, i);
1457
1457
  });
1458
1458
  }
1459
- let rr = null;
1460
- function _s(e) {
1459
+ let ar = null;
1460
+ function wo(e) {
1461
1461
  var t = this, n = (
1462
1462
  /** @type {Node} */
1463
1463
  t.ownerDocument
1464
- ), r = e.type, s = e.composedPath?.() || [], i = (
1464
+ ), r = e.type, o = e.composedPath?.() || [], i = (
1465
1465
  /** @type {null | Element} */
1466
- s[0] || e.target
1466
+ o[0] || e.target
1467
1467
  );
1468
- rr = e;
1469
- var l = 0, o = rr === e && e.__root;
1470
- if (o) {
1471
- var c = s.indexOf(o);
1468
+ ar = e;
1469
+ var l = 0, s = ar === e && e.__root;
1470
+ if (s) {
1471
+ var c = o.indexOf(s);
1472
1472
  if (c !== -1 && (t === document || t === /** @type {any} */
1473
1473
  window)) {
1474
1474
  e.__root = t;
1475
1475
  return;
1476
1476
  }
1477
- var u = s.indexOf(t);
1477
+ var u = o.indexOf(t);
1478
1478
  if (u === -1)
1479
1479
  return;
1480
1480
  c <= u && (l = c);
1481
1481
  }
1482
1482
  if (i = /** @type {Element} */
1483
- s[l] || e.target, i !== t) {
1484
- fr(e, "currentTarget", {
1483
+ o[l] || e.target, i !== t) {
1484
+ pr(e, "currentTarget", {
1485
1485
  configurable: !0,
1486
1486
  get() {
1487
1487
  return i || n;
1488
1488
  }
1489
1489
  });
1490
- var f = N, d = j;
1491
- Me(null), Ve(null);
1490
+ var f = A, h = j;
1491
+ Ce(null), Ye(null);
1492
1492
  try {
1493
- for (var v, m = []; i !== null; ) {
1493
+ for (var d, m = []; i !== null; ) {
1494
1494
  var _ = i.assignedSlot || i.parentNode || /** @type {any} */
1495
1495
  i.host || null;
1496
1496
  try {
1497
- var h = i["__" + r];
1498
- h != null && (!/** @type {any} */
1497
+ var p = i["__" + r];
1498
+ p != null && (!/** @type {any} */
1499
1499
  i.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1500
1500
  // -> the target could not have been disabled because it emits the event in the first place
1501
- e.target === i) && h.call(i, e);
1502
- } catch (p) {
1503
- v ? m.push(p) : v = p;
1501
+ e.target === i) && p.call(i, e);
1502
+ } catch (v) {
1503
+ d ? m.push(v) : d = v;
1504
1504
  }
1505
1505
  if (e.cancelBubble || _ === t || _ === null)
1506
1506
  break;
1507
1507
  i = _;
1508
1508
  }
1509
- if (v) {
1510
- for (let p of m)
1509
+ if (d) {
1510
+ for (let v of m)
1511
1511
  queueMicrotask(() => {
1512
- throw p;
1512
+ throw v;
1513
1513
  });
1514
- throw v;
1514
+ throw d;
1515
1515
  }
1516
1516
  } finally {
1517
- e.__root = t, delete e.currentTarget, Me(f), Ve(d);
1517
+ e.__root = t, delete e.currentTarget, Ce(f), Ye(h);
1518
1518
  }
1519
1519
  }
1520
1520
  }
1521
- function ys(e) {
1521
+ function Eo(e) {
1522
1522
  var t = document.createElement("template");
1523
1523
  return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
1524
1524
  }
1525
- function Qt(e, t) {
1525
+ function en(e, t) {
1526
1526
  var n = (
1527
1527
  /** @type {Effect} */
1528
1528
  j
@@ -1530,38 +1530,38 @@ function Qt(e, t) {
1530
1530
  n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null });
1531
1531
  }
1532
1532
  // @__NO_SIDE_EFFECTS__
1533
- function T(e, t) {
1534
- var n = (t & Si) !== 0, r = (t & ki) !== 0, s, i = !e.startsWith("<!>");
1533
+ function R(e, t) {
1534
+ var n = (t & Ii) !== 0, r = (t & Mi) !== 0, o, i = !e.startsWith("<!>");
1535
1535
  return () => {
1536
- s === void 0 && (s = ys(i ? e : "<!>" + e), n || (s = /** @type {TemplateNode} */
1537
- /* @__PURE__ */ Gt(s)));
1536
+ o === void 0 && (o = Eo(i ? e : "<!>" + e), n || (o = /** @type {TemplateNode} */
1537
+ /* @__PURE__ */ Zt(o)));
1538
1538
  var l = (
1539
1539
  /** @type {TemplateNode} */
1540
- r || $i ? document.importNode(s, !0) : s.cloneNode(!0)
1540
+ r || no ? document.importNode(o, !0) : o.cloneNode(!0)
1541
1541
  );
1542
1542
  if (n) {
1543
- var o = (
1543
+ var s = (
1544
1544
  /** @type {TemplateNode} */
1545
- /* @__PURE__ */ Gt(l)
1545
+ /* @__PURE__ */ Zt(l)
1546
1546
  ), c = (
1547
1547
  /** @type {TemplateNode} */
1548
1548
  l.lastChild
1549
1549
  );
1550
- Qt(o, c);
1550
+ en(s, c);
1551
1551
  } else
1552
- Qt(l, l);
1552
+ en(l, l);
1553
1553
  return l;
1554
1554
  };
1555
1555
  }
1556
- function bs(e = "") {
1556
+ function Po(e = "") {
1557
1557
  {
1558
- var t = Ze(e + "");
1559
- return Qt(t, t), t;
1558
+ var t = Xe(e + "");
1559
+ return en(t, t), t;
1560
1560
  }
1561
1561
  }
1562
- function ut() {
1563
- var e = document.createDocumentFragment(), t = document.createComment(""), n = Ze();
1564
- return e.append(t, n), Qt(t, n), e;
1562
+ function vt() {
1563
+ var e = document.createDocumentFragment(), t = document.createComment(""), n = Xe();
1564
+ return e.append(t, n), en(t, n), e;
1565
1565
  }
1566
1566
  function P(e, t) {
1567
1567
  e !== null && e.before(
@@ -1569,11 +1569,11 @@ function P(e, t) {
1569
1569
  t
1570
1570
  );
1571
1571
  }
1572
- function me(e, t) {
1572
+ function ve(e, t) {
1573
1573
  var n = t == null ? "" : typeof t == "object" ? t + "" : t;
1574
1574
  n !== (e.__t ??= e.nodeValue) && (e.__t = n, e.nodeValue = n + "");
1575
1575
  }
1576
- class gs {
1576
+ class So {
1577
1577
  /** @type {TemplateNode} */
1578
1578
  anchor;
1579
1579
  /** @type {Map<Batch, Key>} */
@@ -1608,18 +1608,18 @@ class gs {
1608
1608
  * Whether to pause (i.e. outro) on change, or destroy immediately.
1609
1609
  * This is necessary for `<svelte:element>`
1610
1610
  */
1611
- #s = !0;
1611
+ #o = !0;
1612
1612
  /**
1613
1613
  * @param {TemplateNode} anchor
1614
1614
  * @param {boolean} transition
1615
1615
  */
1616
1616
  constructor(t, n = !0) {
1617
- this.anchor = t, this.#s = n;
1617
+ this.anchor = t, this.#o = n;
1618
1618
  }
1619
1619
  #i = () => {
1620
1620
  var t = (
1621
1621
  /** @type {Batch} */
1622
- L
1622
+ N
1623
1623
  );
1624
1624
  if (this.#t.has(t)) {
1625
1625
  var n = (
@@ -1627,28 +1627,28 @@ class gs {
1627
1627
  this.#t.get(t)
1628
1628
  ), r = this.#n.get(n);
1629
1629
  if (r)
1630
- Gn(r), this.#r.delete(n);
1630
+ Zn(r), this.#r.delete(n);
1631
1631
  else {
1632
- var s = this.#e.get(n);
1633
- s && (this.#n.set(n, s.effect), this.#e.delete(n), s.fragment.lastChild.remove(), this.anchor.before(s.fragment), r = s.effect);
1632
+ var o = this.#e.get(n);
1633
+ o && (this.#n.set(n, o.effect), this.#e.delete(n), o.fragment.lastChild.remove(), this.anchor.before(o.fragment), r = o.effect);
1634
1634
  }
1635
1635
  for (const [i, l] of this.#t) {
1636
1636
  if (this.#t.delete(i), i === t)
1637
1637
  break;
1638
- const o = this.#e.get(l);
1639
- o && (Te(o.effect), this.#e.delete(l));
1638
+ const s = this.#e.get(l);
1639
+ s && (Te(s.effect), this.#e.delete(l));
1640
1640
  }
1641
1641
  for (const [i, l] of this.#n) {
1642
1642
  if (i === n || this.#r.has(i)) continue;
1643
- const o = () => {
1643
+ const s = () => {
1644
1644
  if (Array.from(this.#t.values()).includes(i)) {
1645
1645
  var u = document.createDocumentFragment();
1646
- us(l, u), u.append(Ze()), this.#e.set(i, { effect: l, fragment: u });
1646
+ po(l, u), u.append(Xe()), this.#e.set(i, { effect: l, fragment: u });
1647
1647
  } else
1648
1648
  Te(l);
1649
1649
  this.#r.delete(i), this.#n.delete(i);
1650
1650
  };
1651
- this.#s || !r ? (this.#r.add(i), Yn(l, o, !1)) : o();
1651
+ this.#o || !r ? (this.#r.add(i), Jn(l, s, !1)) : s();
1652
1652
  }
1653
1653
  }
1654
1654
  };
@@ -1658,8 +1658,8 @@ class gs {
1658
1658
  #a = (t) => {
1659
1659
  this.#t.delete(t);
1660
1660
  const n = Array.from(this.#t.values());
1661
- for (const [r, s] of this.#e)
1662
- n.includes(r) || (Te(s.effect), this.#e.delete(r));
1661
+ for (const [r, o] of this.#e)
1662
+ n.includes(r) || (Te(o.effect), this.#e.delete(r));
1663
1663
  };
1664
1664
  /**
1665
1665
  *
@@ -1669,55 +1669,55 @@ class gs {
1669
1669
  ensure(t, n) {
1670
1670
  var r = (
1671
1671
  /** @type {Batch} */
1672
- L
1673
- ), s = Mr();
1672
+ N
1673
+ ), o = Rr();
1674
1674
  if (n && !this.#n.has(t) && !this.#e.has(t))
1675
- if (s) {
1676
- var i = document.createDocumentFragment(), l = Ze();
1675
+ if (o) {
1676
+ var i = document.createDocumentFragment(), l = Xe();
1677
1677
  i.append(l), this.#e.set(t, {
1678
- effect: Tt(() => n(l)),
1678
+ effect: Nt(() => n(l)),
1679
1679
  fragment: i
1680
1680
  });
1681
1681
  } else
1682
1682
  this.#n.set(
1683
1683
  t,
1684
- Tt(() => n(this.anchor))
1684
+ Nt(() => n(this.anchor))
1685
1685
  );
1686
- if (this.#t.set(r, t), s) {
1687
- for (const [o, c] of this.#n)
1688
- o === t ? r.skipped_effects.delete(c) : r.skipped_effects.add(c);
1689
- for (const [o, c] of this.#e)
1690
- o === t ? r.skipped_effects.delete(c.effect) : r.skipped_effects.add(c.effect);
1686
+ if (this.#t.set(r, t), o) {
1687
+ for (const [s, c] of this.#n)
1688
+ s === t ? r.skipped_effects.delete(c) : r.skipped_effects.add(c);
1689
+ for (const [s, c] of this.#e)
1690
+ s === t ? r.skipped_effects.delete(c.effect) : r.skipped_effects.add(c.effect);
1691
1691
  r.oncommit(this.#i), r.ondiscard(this.#a);
1692
1692
  } else
1693
1693
  this.#i();
1694
1694
  }
1695
1695
  }
1696
1696
  function J(e, t, n = !1) {
1697
- var r = new gs(e), s = n ? It : 0;
1698
- function i(l, o) {
1699
- r.ensure(l, o);
1697
+ var r = new So(e), o = n ? Mt : 0;
1698
+ function i(l, s) {
1699
+ r.ensure(l, s);
1700
1700
  }
1701
- Rr(() => {
1701
+ Nr(() => {
1702
1702
  var l = !1;
1703
- t((o, c = !0) => {
1704
- l = !0, i(c, o);
1703
+ t((s, c = !0) => {
1704
+ l = !0, i(c, s);
1705
1705
  }), l || i(!1, null);
1706
- }, s);
1706
+ }, o);
1707
1707
  }
1708
- function ws(e, t, n) {
1709
- for (var r = [], s = t.length, i, l = t.length, o = 0; o < s; o++) {
1710
- let d = t[o];
1711
- Yn(
1712
- d,
1708
+ function ko(e, t, n) {
1709
+ for (var r = [], o = t.length, i, l = t.length, s = 0; s < o; s++) {
1710
+ let h = t[s];
1711
+ Jn(
1712
+ h,
1713
1713
  () => {
1714
1714
  if (i) {
1715
- if (i.pending.delete(d), i.done.add(d), i.pending.size === 0) {
1716
- var v = (
1715
+ if (i.pending.delete(h), i.done.add(h), i.pending.size === 0) {
1716
+ var d = (
1717
1717
  /** @type {Set<EachOutroGroup>} */
1718
1718
  e.outrogroups
1719
1719
  );
1720
- An(Fn(i.done)), v.delete(i), v.size === 0 && (e.outrogroups = null);
1720
+ Fn(jn(i.done)), d.delete(i), d.size === 0 && (e.outrogroups = null);
1721
1721
  }
1722
1722
  } else
1723
1723
  l -= 1;
@@ -1735,275 +1735,275 @@ function ws(e, t, n) {
1735
1735
  /** @type {Element} */
1736
1736
  u.parentNode
1737
1737
  );
1738
- ns(f), f.append(u), e.items.clear();
1738
+ oo(f), f.append(u), e.items.clear();
1739
1739
  }
1740
- An(t, !c);
1740
+ Fn(t, !c);
1741
1741
  } else
1742
1742
  i = {
1743
1743
  pending: new Set(t),
1744
1744
  done: /* @__PURE__ */ new Set()
1745
1745
  }, (e.outrogroups ??= /* @__PURE__ */ new Set()).add(i);
1746
1746
  }
1747
- function An(e, t = !0) {
1747
+ function Fn(e, t = !0) {
1748
1748
  for (var n = 0; n < e.length; n++)
1749
1749
  Te(e[n], t);
1750
1750
  }
1751
- var ir;
1752
- function Wn(e, t, n, r, s, i = null) {
1753
- var l = e, o = /* @__PURE__ */ new Map(), c = (t & cr) !== 0;
1751
+ var sr;
1752
+ function Qn(e, t, n, r, o, i = null) {
1753
+ var l = e, s = /* @__PURE__ */ new Map(), c = (t & dr) !== 0;
1754
1754
  if (c) {
1755
1755
  var u = (
1756
1756
  /** @type {Element} */
1757
1757
  e
1758
1758
  );
1759
- l = u.appendChild(Ze());
1759
+ l = u.appendChild(Xe());
1760
1760
  }
1761
- var f = null, d = /* @__PURE__ */ Ct(() => {
1761
+ var f = null, h = /* @__PURE__ */ Rt(() => {
1762
1762
  var y = n();
1763
- return ur(y) ? y : y == null ? [] : Fn(y);
1764
- }), v, m = !0;
1763
+ return vr(y) ? y : y == null ? [] : jn(y);
1764
+ }), d, m = !0;
1765
1765
  function _() {
1766
- p.fallback = f, Es(p, v, l, t, r), f !== null && (v.length === 0 ? (f.f & xe) === 0 ? Gn(f) : (f.f ^= xe, St(f, null, l)) : Yn(f, () => {
1766
+ v.fallback = f, Co(v, d, l, t, r), f !== null && (d.length === 0 ? (f.f & xe) === 0 ? Zn(f) : (f.f ^= xe, Ct(f, null, l)) : Jn(f, () => {
1767
1767
  f = null;
1768
1768
  }));
1769
1769
  }
1770
- var h = Rr(() => {
1771
- v = /** @type {V[]} */
1772
- a(d);
1773
- for (var y = v.length, B = /* @__PURE__ */ new Set(), S = (
1770
+ var p = Nr(() => {
1771
+ d = /** @type {V[]} */
1772
+ a(h);
1773
+ for (var y = d.length, B = /* @__PURE__ */ new Set(), k = (
1774
1774
  /** @type {Batch} */
1775
- L
1776
- ), z = Mr(), H = 0; H < y; H += 1) {
1777
- var Z = v[H], O = r(Z, H), V = m ? null : o.get(O);
1778
- V ? (V.v && Rt(V.v, Z), V.i && Rt(V.i, H), z && S.skipped_effects.delete(V.e)) : (V = Ps(
1779
- o,
1780
- m ? l : ir ??= Ze(),
1781
- Z,
1782
- O,
1783
- H,
1775
+ N
1776
+ ), z = Rr(), H = 0; H < y; H += 1) {
1777
+ var X = d[H], L = r(X, H), q = m ? null : s.get(L);
1778
+ q ? (q.v && At(q.v, X), q.i && At(q.i, H), z && k.skipped_effects.delete(q.e)) : (q = Io(
1784
1779
  s,
1780
+ m ? l : sr ??= Xe(),
1781
+ X,
1782
+ L,
1783
+ H,
1784
+ o,
1785
1785
  t,
1786
1786
  n
1787
- ), m || (V.e.f |= xe), o.set(O, V)), B.add(O);
1787
+ ), m || (q.e.f |= xe), s.set(L, q)), B.add(L);
1788
1788
  }
1789
- if (y === 0 && i && !f && (m ? f = Tt(() => i(l)) : (f = Tt(() => i(ir ??= Ze())), f.f |= xe)), !m)
1789
+ if (y === 0 && i && !f && (m ? f = Nt(() => i(l)) : (f = Nt(() => i(sr ??= Xe())), f.f |= xe)), !m)
1790
1790
  if (z) {
1791
- for (const [I, E] of o)
1792
- B.has(I) || S.skipped_effects.add(E.e);
1793
- S.oncommit(_), S.ondiscard(() => {
1791
+ for (const [C, g] of s)
1792
+ B.has(C) || k.skipped_effects.add(g.e);
1793
+ k.oncommit(_), k.ondiscard(() => {
1794
1794
  });
1795
1795
  } else
1796
1796
  _();
1797
- a(d);
1798
- }), p = { effect: h, items: o, outrogroups: null, fallback: f };
1797
+ a(h);
1798
+ }), v = { effect: p, items: s, outrogroups: null, fallback: f };
1799
1799
  m = !1;
1800
1800
  }
1801
- function Es(e, t, n, r, s) {
1802
- var i = (r & _i) !== 0, l = t.length, o = e.items, c = e.effect.first, u, f = null, d, v = [], m = [], _, h, p, y;
1801
+ function Co(e, t, n, r, o) {
1802
+ var i = (r & gi) !== 0, l = t.length, s = e.items, c = e.effect.first, u, f = null, h, d = [], m = [], _, p, v, y;
1803
1803
  if (i)
1804
1804
  for (y = 0; y < l; y += 1)
1805
- _ = t[y], h = s(_, y), p = /** @type {EachItem} */
1806
- o.get(h).e, (p.f & xe) === 0 && (p.nodes?.a?.measure(), (d ??= /* @__PURE__ */ new Set()).add(p));
1805
+ _ = t[y], p = o(_, y), v = /** @type {EachItem} */
1806
+ s.get(p).e, (v.f & xe) === 0 && (v.nodes?.a?.measure(), (h ??= /* @__PURE__ */ new Set()).add(v));
1807
1807
  for (y = 0; y < l; y += 1) {
1808
- if (_ = t[y], h = s(_, y), p = /** @type {EachItem} */
1809
- o.get(h).e, e.outrogroups !== null)
1810
- for (const E of e.outrogroups)
1811
- E.pending.delete(p), E.done.delete(p);
1812
- if ((p.f & xe) !== 0)
1813
- if (p.f ^= xe, p === c)
1814
- St(p, null, n);
1808
+ if (_ = t[y], p = o(_, y), v = /** @type {EachItem} */
1809
+ s.get(p).e, e.outrogroups !== null)
1810
+ for (const g of e.outrogroups)
1811
+ g.pending.delete(v), g.done.delete(v);
1812
+ if ((v.f & xe) !== 0)
1813
+ if (v.f ^= xe, v === c)
1814
+ Ct(v, null, n);
1815
1815
  else {
1816
1816
  var B = f ? f.next : c;
1817
- p === e.effect.last && (e.effect.last = p.prev), p.prev && (p.prev.next = p.next), p.next && (p.next.prev = p.prev), He(e, f, p), He(e, p, B), St(p, B, n), f = p, v = [], m = [], c = f.next;
1817
+ v === e.effect.last && (e.effect.last = v.prev), v.prev && (v.prev.next = v.next), v.next && (v.next.prev = v.prev), Be(e, f, v), Be(e, v, B), Ct(v, B, n), f = v, d = [], m = [], c = f.next;
1818
1818
  continue;
1819
1819
  }
1820
- if ((p.f & _e) !== 0 && (Gn(p), i && (p.nodes?.a?.unfix(), (d ??= /* @__PURE__ */ new Set()).delete(p))), p !== c) {
1821
- if (u !== void 0 && u.has(p)) {
1822
- if (v.length < m.length) {
1823
- var S = m[0], z;
1824
- f = S.prev;
1825
- var H = v[0], Z = v[v.length - 1];
1826
- for (z = 0; z < v.length; z += 1)
1827
- St(v[z], S, n);
1820
+ if ((v.f & me) !== 0 && (Zn(v), i && (v.nodes?.a?.unfix(), (h ??= /* @__PURE__ */ new Set()).delete(v))), v !== c) {
1821
+ if (u !== void 0 && u.has(v)) {
1822
+ if (d.length < m.length) {
1823
+ var k = m[0], z;
1824
+ f = k.prev;
1825
+ var H = d[0], X = d[d.length - 1];
1826
+ for (z = 0; z < d.length; z += 1)
1827
+ Ct(d[z], k, n);
1828
1828
  for (z = 0; z < m.length; z += 1)
1829
1829
  u.delete(m[z]);
1830
- He(e, H.prev, Z.next), He(e, f, H), He(e, Z, S), c = S, f = Z, y -= 1, v = [], m = [];
1830
+ Be(e, H.prev, X.next), Be(e, f, H), Be(e, X, k), c = k, f = X, y -= 1, d = [], m = [];
1831
1831
  } else
1832
- u.delete(p), St(p, c, n), He(e, p.prev, p.next), He(e, p, f === null ? e.effect.first : f.next), He(e, f, p), f = p;
1832
+ u.delete(v), Ct(v, c, n), Be(e, v.prev, v.next), Be(e, v, f === null ? e.effect.first : f.next), Be(e, f, v), f = v;
1833
1833
  continue;
1834
1834
  }
1835
- for (v = [], m = []; c !== null && c !== p; )
1835
+ for (d = [], m = []; c !== null && c !== v; )
1836
1836
  (u ??= /* @__PURE__ */ new Set()).add(c), m.push(c), c = c.next;
1837
1837
  if (c === null)
1838
1838
  continue;
1839
1839
  }
1840
- (p.f & xe) === 0 && v.push(p), f = p, c = p.next;
1840
+ (v.f & xe) === 0 && d.push(v), f = v, c = v.next;
1841
1841
  }
1842
1842
  if (e.outrogroups !== null) {
1843
- for (const E of e.outrogroups)
1844
- E.pending.size === 0 && (An(Fn(E.done)), e.outrogroups?.delete(E));
1843
+ for (const g of e.outrogroups)
1844
+ g.pending.size === 0 && (Fn(jn(g.done)), e.outrogroups?.delete(g));
1845
1845
  e.outrogroups.size === 0 && (e.outrogroups = null);
1846
1846
  }
1847
1847
  if (c !== null || u !== void 0) {
1848
- var O = [];
1848
+ var L = [];
1849
1849
  if (u !== void 0)
1850
- for (p of u)
1851
- (p.f & _e) === 0 && O.push(p);
1850
+ for (v of u)
1851
+ (v.f & me) === 0 && L.push(v);
1852
1852
  for (; c !== null; )
1853
- (c.f & _e) === 0 && c !== e.fallback && O.push(c), c = c.next;
1854
- var V = O.length;
1855
- if (V > 0) {
1856
- var I = (r & cr) !== 0 && l === 0 ? n : null;
1853
+ (c.f & me) === 0 && c !== e.fallback && L.push(c), c = c.next;
1854
+ var q = L.length;
1855
+ if (q > 0) {
1856
+ var C = (r & dr) !== 0 && l === 0 ? n : null;
1857
1857
  if (i) {
1858
- for (y = 0; y < V; y += 1)
1859
- O[y].nodes?.a?.measure();
1860
- for (y = 0; y < V; y += 1)
1861
- O[y].nodes?.a?.fix();
1858
+ for (y = 0; y < q; y += 1)
1859
+ L[y].nodes?.a?.measure();
1860
+ for (y = 0; y < q; y += 1)
1861
+ L[y].nodes?.a?.fix();
1862
1862
  }
1863
- ws(e, O, I);
1863
+ ko(e, L, C);
1864
1864
  }
1865
1865
  }
1866
- i && Hn(() => {
1867
- if (d !== void 0)
1868
- for (p of d)
1869
- p.nodes?.a?.apply();
1866
+ i && qn(() => {
1867
+ if (h !== void 0)
1868
+ for (v of h)
1869
+ v.nodes?.a?.apply();
1870
1870
  });
1871
1871
  }
1872
- function Ps(e, t, n, r, s, i, l, o) {
1873
- var c = (l & hi) !== 0 ? (l & yi) === 0 ? /* @__PURE__ */ Q(n, !1, !1) : xt(n) : null, u = (l & mi) !== 0 ? xt(s) : null;
1872
+ function Io(e, t, n, r, o, i, l, s) {
1873
+ var c = (l & yi) !== 0 ? (l & wi) === 0 ? /* @__PURE__ */ $(n, !1, !1) : Tt(n) : null, u = (l & bi) !== 0 ? Tt(o) : null;
1874
1874
  return {
1875
1875
  v: c,
1876
1876
  i: u,
1877
- e: Tt(() => (i(t, c ?? n, u ?? s, o), () => {
1877
+ e: Nt(() => (i(t, c ?? n, u ?? o, s), () => {
1878
1878
  e.delete(r);
1879
1879
  }))
1880
1880
  };
1881
1881
  }
1882
- function St(e, t, n) {
1882
+ function Ct(e, t, n) {
1883
1883
  if (e.nodes)
1884
- for (var r = e.nodes.start, s = e.nodes.end, i = t && (t.f & xe) === 0 ? (
1884
+ for (var r = e.nodes.start, o = e.nodes.end, i = t && (t.f & xe) === 0 ? (
1885
1885
  /** @type {EffectNodes} */
1886
1886
  t.nodes.start
1887
1887
  ) : n; r !== null; ) {
1888
1888
  var l = (
1889
1889
  /** @type {TemplateNode} */
1890
- /* @__PURE__ */ Ot(r)
1890
+ /* @__PURE__ */ Dt(r)
1891
1891
  );
1892
- if (i.before(r), r === s)
1892
+ if (i.before(r), r === o)
1893
1893
  return;
1894
1894
  r = l;
1895
1895
  }
1896
1896
  }
1897
- function He(e, t, n) {
1897
+ function Be(e, t, n) {
1898
1898
  t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t;
1899
1899
  }
1900
- function Nn(e, t, n, r, s) {
1900
+ function Dn(e, t, n, r, o) {
1901
1901
  var i = t.$$slots?.[n], l = !1;
1902
- i === !0 && (i = t[n === "default" ? "children" : n], l = !0), i === void 0 ? s !== null && s(e) : i(e, l ? () => r : r);
1902
+ i === !0 && (i = t[n === "default" ? "children" : n], l = !0), i === void 0 ? o !== null && o(e) : i(e, l ? () => r : r);
1903
1903
  }
1904
- function Kr(e) {
1904
+ function Vr(e) {
1905
1905
  var t, n, r = "";
1906
1906
  if (typeof e == "string" || typeof e == "number") r += e;
1907
1907
  else if (typeof e == "object") if (Array.isArray(e)) {
1908
- var s = e.length;
1909
- for (t = 0; t < s; t++) e[t] && (n = Kr(e[t])) && (r && (r += " "), r += n);
1908
+ var o = e.length;
1909
+ for (t = 0; t < o; t++) e[t] && (n = Vr(e[t])) && (r && (r += " "), r += n);
1910
1910
  } else for (n in e) e[n] && (r && (r += " "), r += n);
1911
1911
  return r;
1912
1912
  }
1913
- function Ss() {
1914
- for (var e, t, n = 0, r = "", s = arguments.length; n < s; n++) (e = arguments[n]) && (t = Kr(e)) && (r && (r += " "), r += t);
1913
+ function Mo() {
1914
+ for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Vr(e)) && (r && (r += " "), r += t);
1915
1915
  return r;
1916
1916
  }
1917
- function $e(e) {
1918
- return typeof e == "object" ? Ss(e) : e ?? "";
1917
+ function tt(e) {
1918
+ return typeof e == "object" ? Mo(e) : e ?? "";
1919
1919
  }
1920
- function ks(e, t, n) {
1920
+ function xo(e, t, n) {
1921
1921
  var r = e == null ? "" : "" + e;
1922
1922
  return r === "" ? null : r;
1923
1923
  }
1924
- function Is(e, t) {
1924
+ function Ro(e, t) {
1925
1925
  return e == null ? null : String(e);
1926
1926
  }
1927
- function et(e, t, n, r, s, i) {
1927
+ function nt(e, t, n, r, o, i) {
1928
1928
  var l = e.__className;
1929
1929
  if (l !== n || l === void 0) {
1930
- var o = ks(n);
1931
- o == null ? e.removeAttribute("class") : e.className = o, e.__className = n;
1930
+ var s = xo(n);
1931
+ s == null ? e.removeAttribute("class") : e.className = s, e.__className = n;
1932
1932
  }
1933
1933
  return i;
1934
1934
  }
1935
- function Jn(e, t, n, r) {
1936
- var s = e.__style;
1937
- if (s !== t) {
1938
- var i = Is(t);
1935
+ function Xn(e, t, n, r) {
1936
+ var o = e.__style;
1937
+ if (o !== t) {
1938
+ var i = Ro(t);
1939
1939
  i == null ? e.removeAttribute("style") : e.style.cssText = i, e.__style = t;
1940
1940
  }
1941
1941
  return r;
1942
1942
  }
1943
- const Ms = /* @__PURE__ */ Symbol("is custom element"), Cs = /* @__PURE__ */ Symbol("is html");
1944
- function Ln(e, t, n, r) {
1945
- var s = xs(e);
1946
- s[t] !== (s[t] = n) && (t === "loading" && (e[Ni] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && Rs(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
1943
+ const To = /* @__PURE__ */ Symbol("is custom element"), Ao = /* @__PURE__ */ Symbol("is html");
1944
+ function tn(e, t, n, r) {
1945
+ var o = No(e);
1946
+ o[t] !== (o[t] = n) && (t === "loading" && (e[Fi] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && Lo(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
1947
1947
  }
1948
- function xs(e) {
1948
+ function No(e) {
1949
1949
  return (
1950
1950
  /** @type {Record<string | symbol, unknown>} **/
1951
1951
  // @ts-expect-error
1952
1952
  e.__attributes ??= {
1953
- [Ms]: e.nodeName.includes("-"),
1954
- [Cs]: e.namespaceURI === Ii
1953
+ [To]: e.nodeName.includes("-"),
1954
+ [Ao]: e.namespaceURI === xi
1955
1955
  }
1956
1956
  );
1957
1957
  }
1958
- var sr = /* @__PURE__ */ new Map();
1959
- function Rs(e) {
1960
- var t = e.getAttribute("is") || e.nodeName, n = sr.get(t);
1958
+ var lr = /* @__PURE__ */ new Map();
1959
+ function Lo(e) {
1960
+ var t = e.getAttribute("is") || e.nodeName, n = lr.get(t);
1961
1961
  if (n) return n;
1962
- sr.set(t, n = []);
1963
- for (var r, s = e, i = Element.prototype; i !== s; ) {
1964
- r = dr(s);
1962
+ lr.set(t, n = []);
1963
+ for (var r, o = e, i = Element.prototype; i !== o; ) {
1964
+ r = hr(o);
1965
1965
  for (var l in r)
1966
1966
  r[l].set && n.push(l);
1967
- s = Dn(s);
1967
+ o = zn(o);
1968
1968
  }
1969
1969
  return n;
1970
1970
  }
1971
- function Ts(e, t, n = t) {
1971
+ function Oo(e, t, n = t) {
1972
1972
  var r = /* @__PURE__ */ new WeakSet();
1973
- is(e, "input", async (s) => {
1974
- var i = s ? e.defaultValue : e.value;
1975
- if (i = Pn(e) ? Sn(i) : i, n(i), L !== null && r.add(L), await ps(), i !== (i = t())) {
1976
- var l = e.selectionStart, o = e.selectionEnd, c = e.value.length;
1977
- if (e.value = i ?? "", o !== null) {
1973
+ so(e, "input", async (o) => {
1974
+ var i = o ? e.defaultValue : e.value;
1975
+ if (i = In(e) ? Mn(i) : i, n(i), N !== null && r.add(N), await yo(), i !== (i = t())) {
1976
+ var l = e.selectionStart, s = e.selectionEnd, c = e.value.length;
1977
+ if (e.value = i ?? "", s !== null) {
1978
1978
  var u = e.value.length;
1979
- l === o && o === c && u > c ? (e.selectionStart = u, e.selectionEnd = u) : (e.selectionStart = l, e.selectionEnd = Math.min(o, u));
1979
+ l === s && s === c && u > c ? (e.selectionStart = u, e.selectionEnd = u) : (e.selectionStart = l, e.selectionEnd = Math.min(s, u));
1980
1980
  }
1981
1981
  }
1982
1982
  }), // If we are hydrating and the value has since changed,
1983
1983
  // then use the updated value from the input instead.
1984
1984
  // If defaultValue is set, then value == defaultValue
1985
1985
  // TODO Svelte 6: remove input.value check and set to empty string?
1986
- w(t) == null && e.value && (n(Pn(e) ? Sn(e.value) : e.value), L !== null && r.add(L)), Vn(() => {
1987
- var s = t();
1986
+ w(t) == null && e.value && (n(In(e) ? Mn(e.value) : e.value), N !== null && r.add(N)), Wn(() => {
1987
+ var o = t();
1988
1988
  if (e === document.activeElement) {
1989
1989
  var i = (
1990
1990
  /** @type {Batch} */
1991
- qt ?? L
1991
+ Yt ?? N
1992
1992
  );
1993
1993
  if (r.has(i))
1994
1994
  return;
1995
1995
  }
1996
- Pn(e) && s === Sn(e.value) || e.type === "date" && !s && !e.value || s !== e.value && (e.value = s ?? "");
1996
+ In(e) && o === Mn(e.value) || e.type === "date" && !o && !e.value || o !== e.value && (e.value = o ?? "");
1997
1997
  });
1998
1998
  }
1999
- function Pn(e) {
1999
+ function In(e) {
2000
2000
  var t = e.type;
2001
2001
  return t === "number" || t === "range";
2002
2002
  }
2003
- function Sn(e) {
2003
+ function Mn(e) {
2004
2004
  return e === "" ? null : +e;
2005
2005
  }
2006
- function As(e) {
2006
+ function Fo(e) {
2007
2007
  return function(...t) {
2008
2008
  var n = (
2009
2009
  /** @type {Event} */
@@ -2012,47 +2012,47 @@ function As(e) {
2012
2012
  return n.preventDefault(), e?.apply(this, t);
2013
2013
  };
2014
2014
  }
2015
- function on(e = !1) {
2015
+ function fn(e = !1) {
2016
2016
  const t = (
2017
2017
  /** @type {ComponentContextLegacy} */
2018
- $
2018
+ ee
2019
2019
  ), n = t.l.u;
2020
2020
  if (!n) return;
2021
2021
  let r = () => G(t.s);
2022
2022
  if (e) {
2023
- let s = 0, i = (
2023
+ let o = 0, i = (
2024
2024
  /** @type {Record<string, any>} */
2025
2025
  {}
2026
2026
  );
2027
- const l = /* @__PURE__ */ sn(() => {
2028
- let o = !1;
2027
+ const l = /* @__PURE__ */ cn(() => {
2028
+ let s = !1;
2029
2029
  const c = t.s;
2030
2030
  for (const u in c)
2031
- c[u] !== i[u] && (i[u] = c[u], o = !0);
2032
- return o && s++, s;
2031
+ c[u] !== i[u] && (i[u] = c[u], s = !0);
2032
+ return s && o++, o;
2033
2033
  });
2034
2034
  r = () => a(l);
2035
2035
  }
2036
- n.b.length && as(() => {
2037
- ar(t, r), Mn(n.b);
2038
- }), er(() => {
2039
- const s = w(() => n.m.map(Ri));
2036
+ n.b.length && co(() => {
2037
+ cr(t, r), Tn(n.b);
2038
+ }), rr(() => {
2039
+ const o = w(() => n.m.map(Ni));
2040
2040
  return () => {
2041
- for (const i of s)
2041
+ for (const i of o)
2042
2042
  typeof i == "function" && i();
2043
2043
  };
2044
- }), n.a.length && er(() => {
2045
- ar(t, r), Mn(n.a);
2044
+ }), n.a.length && rr(() => {
2045
+ cr(t, r), Tn(n.a);
2046
2046
  });
2047
2047
  }
2048
- function ar(e, t) {
2048
+ function cr(e, t) {
2049
2049
  if (e.l.s)
2050
2050
  for (const n of e.l.s) a(n);
2051
2051
  t();
2052
2052
  }
2053
- function qr(e, t, n) {
2053
+ function Yr(e, t, n) {
2054
2054
  if (e == null)
2055
- return t(void 0), In;
2055
+ return t(void 0), Rn;
2056
2056
  const r = w(
2057
2057
  () => e.subscribe(
2058
2058
  t,
@@ -2062,35 +2062,35 @@ function qr(e, t, n) {
2062
2062
  );
2063
2063
  return r.unsubscribe ? () => r.unsubscribe() : r;
2064
2064
  }
2065
- function Ns(e) {
2065
+ function Do(e) {
2066
2066
  let t;
2067
- return qr(e, (n) => t = n)(), t;
2067
+ return Yr(e, (n) => t = n)(), t;
2068
2068
  }
2069
- let Ht = !1, On = /* @__PURE__ */ Symbol();
2070
- function Ls(e, t, n) {
2069
+ let qt = !1, Un = /* @__PURE__ */ Symbol();
2070
+ function Uo(e, t, n) {
2071
2071
  const r = n[t] ??= {
2072
2072
  store: null,
2073
- source: /* @__PURE__ */ Q(void 0),
2074
- unsubscribe: In
2073
+ source: /* @__PURE__ */ $(void 0),
2074
+ unsubscribe: Rn
2075
2075
  };
2076
- if (r.store !== e && !(On in n))
2076
+ if (r.store !== e && !(Un in n))
2077
2077
  if (r.unsubscribe(), r.store = e ?? null, e == null)
2078
- r.source.v = void 0, r.unsubscribe = In;
2078
+ r.source.v = void 0, r.unsubscribe = Rn;
2079
2079
  else {
2080
- var s = !0;
2081
- r.unsubscribe = qr(e, (i) => {
2082
- s ? r.source.v = i : A(r.source, i);
2083
- }), s = !1;
2080
+ var o = !0;
2081
+ r.unsubscribe = Yr(e, (i) => {
2082
+ o ? r.source.v = i : T(r.source, i);
2083
+ }), o = !1;
2084
2084
  }
2085
- return e && On in n ? Ns(e) : a(r.source);
2085
+ return e && Un in n ? Do(e) : a(r.source);
2086
2086
  }
2087
- function Os() {
2087
+ function jo() {
2088
2088
  const e = {};
2089
2089
  function t() {
2090
- qn(() => {
2090
+ Yn(() => {
2091
2091
  for (var n in e)
2092
2092
  e[n].unsubscribe();
2093
- fr(e, On, {
2093
+ pr(e, Un, {
2094
2094
  enumerable: !1,
2095
2095
  value: !0
2096
2096
  });
@@ -2098,61 +2098,61 @@ function Os() {
2098
2098
  }
2099
2099
  return [e, t];
2100
2100
  }
2101
- function Fs(e) {
2102
- var t = Ht;
2101
+ function zo(e) {
2102
+ var t = qt;
2103
2103
  try {
2104
- return Ht = !1, [e(), Ht];
2104
+ return qt = !1, [e(), qt];
2105
2105
  } finally {
2106
- Ht = t;
2106
+ qt = t;
2107
2107
  }
2108
2108
  }
2109
- function D(e, t, n, r) {
2110
- var s = !Nt || (n & gi) !== 0, i = (n & Ei) !== 0, l = (n & Pi) !== 0, o = (
2109
+ function F(e, t, n, r) {
2110
+ var o = !Ot || (n & Pi) !== 0, i = (n & ki) !== 0, l = (n & Ci) !== 0, s = (
2111
2111
  /** @type {V} */
2112
2112
  r
2113
- ), c = !0, u = () => (c && (c = !1, o = l ? w(
2113
+ ), c = !0, u = () => (c && (c = !1, s = l ? w(
2114
2114
  /** @type {() => V} */
2115
2115
  r
2116
2116
  ) : (
2117
2117
  /** @type {V} */
2118
2118
  r
2119
- )), o), f;
2119
+ )), s), f;
2120
2120
  if (i) {
2121
- var d = vt in e || Ai in e;
2122
- f = Kt(e, t)?.set ?? (d && t in e ? (S) => e[t] = S : void 0);
2121
+ var h = mt in e || Oi in e;
2122
+ f = Vt(e, t)?.set ?? (h && t in e ? (k) => e[t] = k : void 0);
2123
2123
  }
2124
- var v, m = !1;
2125
- i ? [v, m] = Fs(() => (
2124
+ var d, m = !1;
2125
+ i ? [d, m] = zo(() => (
2126
2126
  /** @type {V} */
2127
2127
  e[t]
2128
- )) : v = /** @type {V} */
2129
- e[t], v === void 0 && r !== void 0 && (v = u(), f && (s && ji(), f(v)));
2128
+ )) : d = /** @type {V} */
2129
+ e[t], d === void 0 && r !== void 0 && (d = u(), f && (o && Bi(), f(d)));
2130
2130
  var _;
2131
- if (s ? _ = () => {
2132
- var S = (
2131
+ if (o ? _ = () => {
2132
+ var k = (
2133
2133
  /** @type {V} */
2134
2134
  e[t]
2135
2135
  );
2136
- return S === void 0 ? u() : (c = !0, S);
2136
+ return k === void 0 ? u() : (c = !0, k);
2137
2137
  } : _ = () => {
2138
- var S = (
2138
+ var k = (
2139
2139
  /** @type {V} */
2140
2140
  e[t]
2141
2141
  );
2142
- return S !== void 0 && (o = /** @type {V} */
2143
- void 0), S === void 0 ? o : S;
2144
- }, s && (n & wi) === 0)
2142
+ return k !== void 0 && (s = /** @type {V} */
2143
+ void 0), k === void 0 ? s : k;
2144
+ }, o && (n & Si) === 0)
2145
2145
  return _;
2146
2146
  if (f) {
2147
- var h = e.$$legacy;
2147
+ var p = e.$$legacy;
2148
2148
  return (
2149
2149
  /** @type {() => V} */
2150
- (function(S, z) {
2151
- return arguments.length > 0 ? ((!s || !z || h || m) && f(z ? _() : S), S) : _();
2150
+ (function(k, z) {
2151
+ return arguments.length > 0 ? ((!o || !z || p || m) && f(z ? _() : k), k) : _();
2152
2152
  })
2153
2153
  );
2154
2154
  }
2155
- var p = !1, y = ((n & bi) !== 0 ? sn : Ct)(() => (p = !1, _()));
2155
+ var v = !1, y = ((n & Ei) !== 0 ? cn : Rt)(() => (v = !1, _()));
2156
2156
  i && a(y);
2157
2157
  var B = (
2158
2158
  /** @type {Effect} */
@@ -2160,17 +2160,17 @@ function D(e, t, n, r) {
2160
2160
  );
2161
2161
  return (
2162
2162
  /** @type {() => V} */
2163
- (function(S, z) {
2163
+ (function(k, z) {
2164
2164
  if (arguments.length > 0) {
2165
- const H = z ? a(y) : s && i ? dt(S) : S;
2166
- return A(y, H), p = !0, o !== void 0 && (o = H), S;
2165
+ const H = z ? a(y) : o && i ? ht(k) : k;
2166
+ return T(y, H), v = !0, s !== void 0 && (s = H), k;
2167
2167
  }
2168
- return rt && p || (B.f & Re) !== 0 ? y.v : a(y);
2168
+ return ot && v || (B.f & Re) !== 0 ? y.v : a(y);
2169
2169
  })
2170
2170
  );
2171
2171
  }
2172
- const Ds = "https://api.reevit.io";
2173
- function Us(e, t) {
2172
+ const Ho = "https://api.reevit.io";
2173
+ function Bo(e, t) {
2174
2174
  return {
2175
2175
  code: t?.code || "payment_link_error",
2176
2176
  message: t?.message || "Payment link request failed",
@@ -2181,18 +2181,18 @@ function Us(e, t) {
2181
2181
  }
2182
2182
  };
2183
2183
  }
2184
- function js(e) {
2184
+ function Ko(e) {
2185
2185
  const t = e.toLowerCase();
2186
2186
  return t.includes("paystack") ? "paystack" : t.includes("hubtel") ? "hubtel" : t.includes("flutterwave") ? "flutterwave" : t.includes("stripe") ? "stripe" : t.includes("monnify") ? "monnify" : t.includes("mpesa") || t.includes("m-pesa") ? "mpesa" : "paystack";
2187
2187
  }
2188
- function zs(e) {
2188
+ function qo(e) {
2189
2189
  const t = e.toLowerCase().trim();
2190
2190
  return t === "card" ? "card" : t === "mobile_money" || t === "momo" || t === "mobilemoney" ? "mobile_money" : t === "bank" || t === "bank_transfer" || t === "transfer" ? "bank_transfer" : null;
2191
2191
  }
2192
- function Hs(e) {
2192
+ function Vo(e) {
2193
2193
  if (!(!e || e.length === 0))
2194
2194
  return e.map((t) => {
2195
- const n = t.methods.map((r) => zs(r)).filter(Boolean);
2195
+ const n = t.methods.map((r) => qo(r)).filter(Boolean);
2196
2196
  return {
2197
2197
  provider: t.provider,
2198
2198
  name: t.name,
@@ -2201,7 +2201,15 @@ function Hs(e) {
2201
2201
  };
2202
2202
  }).filter((t) => t.methods.length > 0);
2203
2203
  }
2204
- function Ks(e, t) {
2204
+ function Yo(e) {
2205
+ if (!e)
2206
+ return {};
2207
+ const t = e, n = { ...t }, r = (l) => typeof l == "string" ? l : void 0, o = (l) => typeof l == "boolean" ? l : void 0, i = (l, s) => {
2208
+ s !== void 0 && (n[l] = s);
2209
+ };
2210
+ return i("logoUrl", r(t.logoUrl ?? t.logo_url)), i("companyName", r(t.companyName ?? t.company_name)), i("primaryColor", r(t.primaryColor ?? t.primary_color)), i("primaryForegroundColor", r(t.primaryForegroundColor ?? t.primary_foreground_color)), i("backgroundColor", r(t.backgroundColor ?? t.background_color)), i("surfaceColor", r(t.surfaceColor ?? t.surface_color)), i("textColor", r(t.textColor ?? t.text_color)), i("mutedTextColor", r(t.mutedTextColor ?? t.muted_text_color)), i("borderRadius", r(t.borderRadius ?? t.border_radius)), i("fontFamily", r(t.fontFamily ?? t.font_family)), i("darkMode", o(t.darkMode ?? t.dark_mode)), i("pspSelectorBgColor", r(t.pspSelectorBgColor ?? t.psp_selector_bg_color)), i("pspSelectorTextColor", r(t.pspSelectorTextColor ?? t.psp_selector_text_color)), i("pspSelectorBorderColor", r(t.pspSelectorBorderColor ?? t.psp_selector_border_color)), i("pspSelectorUseBorder", o(t.pspSelectorUseBorder ?? t.psp_selector_use_border)), n;
2211
+ }
2212
+ function Go(e, t) {
2205
2213
  return {
2206
2214
  id: e.id,
2207
2215
  clientSecret: e.client_secret,
@@ -2210,7 +2218,7 @@ function Ks(e, t) {
2210
2218
  amount: e.amount,
2211
2219
  currency: e.currency,
2212
2220
  status: e.status,
2213
- recommendedPsp: js(e.provider),
2221
+ recommendedPsp: Ko(e.provider),
2214
2222
  availableMethods: t.paymentMethods || ["card", "mobile_money"],
2215
2223
  reference: e.reference || t.reference,
2216
2224
  connectionId: e.connection_id,
@@ -2219,35 +2227,36 @@ function Ks(e, t) {
2219
2227
  feeCurrency: e.fee_currency,
2220
2228
  netAmount: e.net_amount,
2221
2229
  metadata: t.metadata,
2222
- availableProviders: Hs(e.available_psps),
2223
- branding: e.branding
2230
+ availableProviders: Vo(e.available_psps),
2231
+ branding: Yo(e.branding)
2224
2232
  };
2225
2233
  }
2226
- function qs(e) {
2227
- const { config: t, onSuccess: n, onError: r, onClose: s, onStateChange: i, apiBaseUrl: l } = e;
2228
- let o = ii();
2229
- t.initialPaymentIntent && (o = {
2230
- ...o,
2234
+ function Wo(e) {
2235
+ const { config: t, onSuccess: n, onError: r, onClose: o, onStateChange: i, apiBaseUrl: l } = e;
2236
+ let s = si(), c = 0;
2237
+ t.initialPaymentIntent && (s = {
2238
+ ...s,
2231
2239
  status: "ready",
2232
2240
  paymentIntent: t.initialPaymentIntent,
2233
2241
  selectedMethod: t.initialPaymentIntent.availableMethods?.length === 1 ? t.initialPaymentIntent.availableMethods[0] : null
2234
2242
  });
2235
- const c = /* @__PURE__ */ new Set(), u = new si({
2243
+ const u = /* @__PURE__ */ new Set(), f = new li({
2236
2244
  publicKey: t.publicKey,
2237
2245
  baseUrl: l
2238
- }), f = () => {
2239
- c.forEach((k) => k(o));
2240
- }, d = (k) => {
2241
- const x = o.status;
2242
- o = li(o, k), f(), o.status !== x && i?.(o.status);
2243
- }, v = (k) => (c.add(k), k(o), () => c.delete(k)), m = async (k, x) => {
2246
+ }), h = () => {
2247
+ u.forEach((S) => S(s));
2248
+ }, d = (S) => {
2249
+ const M = s.status;
2250
+ s = fi(s, S), h(), s.status !== M && i?.(s.status);
2251
+ }, m = (S) => (u.add(S), S(s), () => u.delete(S)), _ = async (S, M) => {
2252
+ const K = ++c;
2244
2253
  d({ type: "INIT_START" });
2245
2254
  try {
2246
- const R = t.reference || ai(), K = oi(t.currency), b = t.paymentMethods && t.paymentMethods.length === 1 ? t.paymentMethods[0] : void 0, de = k ?? b;
2247
- let we, ae;
2255
+ const b = t.reference || ci(), V = ui(t.currency), Oe = t.paymentMethods && t.paymentMethods.length === 1 ? t.paymentMethods[0] : void 0, _e = S ?? Oe;
2256
+ let at, Ie;
2248
2257
  if (t.paymentLinkCode) {
2249
- const ve = await fetch(
2250
- `${l || Ds}/v1/pay/${t.paymentLinkCode}/pay`,
2258
+ const we = await fetch(
2259
+ `${l || Ho}/v1/pay/${t.paymentLinkCode}/pay`,
2251
2260
  {
2252
2261
  method: "POST",
2253
2262
  headers: {
@@ -2259,149 +2268,153 @@ function qs(e) {
2259
2268
  email: t.email || "",
2260
2269
  name: t.customerName || "",
2261
2270
  phone: t.phone || "",
2262
- method: de,
2263
- country: K,
2264
- provider: x?.preferredProvider || x?.allowedProviders?.[0],
2271
+ method: _e,
2272
+ country: V,
2273
+ provider: M?.preferredProvider || M?.allowedProviders?.[0],
2265
2274
  custom_fields: t.customFields
2266
2275
  })
2267
2276
  }
2268
- ), _t = await ve.json().catch(() => ({}));
2269
- ve.ok ? we = _t : ae = Us(ve, _t);
2277
+ ), jt = await we.json().catch(() => ({}));
2278
+ we.ok ? at = jt : Ie = Bo(we, jt);
2270
2279
  } else {
2271
- const ve = await u.createPaymentIntent(
2272
- { ...t, reference: R },
2273
- de,
2274
- K,
2280
+ const we = await f.createPaymentIntent(
2281
+ { ...t, reference: b },
2282
+ _e,
2283
+ V,
2275
2284
  {
2276
- preferredProviders: x?.preferredProvider ? [x.preferredProvider] : void 0,
2277
- allowedProviders: x?.allowedProviders
2285
+ preferredProviders: M?.preferredProvider ? [M.preferredProvider] : void 0,
2286
+ allowedProviders: M?.allowedProviders
2278
2287
  }
2279
2288
  );
2280
- we = ve.data, ae = ve.error;
2289
+ at = we.data, Ie = we.error;
2281
2290
  }
2282
- if (ae) {
2283
- d({ type: "INIT_ERROR", payload: ae }), r?.(ae);
2291
+ if (K !== c)
2292
+ return;
2293
+ if (Ie) {
2294
+ d({ type: "INIT_ERROR", payload: Ie }), r?.(Ie);
2284
2295
  return;
2285
2296
  }
2286
- if (!we) {
2287
- const ve = {
2297
+ if (!at) {
2298
+ const we = {
2288
2299
  code: "INIT_FAILED",
2289
2300
  message: "No data received from API",
2290
2301
  recoverable: !0
2291
2302
  };
2292
- d({ type: "INIT_ERROR", payload: ve }), r?.(ve);
2303
+ d({ type: "INIT_ERROR", payload: we }), r?.(we);
2293
2304
  return;
2294
2305
  }
2295
- const cn = Ks(we, { ...t, reference: R });
2296
- d({ type: "INIT_SUCCESS", payload: cn });
2297
- } catch (R) {
2298
- const K = {
2306
+ const Ut = Go(at, { ...t, reference: b });
2307
+ d({ type: "INIT_SUCCESS", payload: Ut });
2308
+ } catch (b) {
2309
+ if (K !== c)
2310
+ return;
2311
+ const V = {
2299
2312
  code: "INIT_FAILED",
2300
- message: R instanceof Error ? R.message : "Failed to initialize checkout",
2313
+ message: b instanceof Error ? b.message : "Failed to initialize checkout",
2301
2314
  recoverable: !0,
2302
- originalError: R
2315
+ originalError: b
2303
2316
  };
2304
- d({ type: "INIT_ERROR", payload: K }), r?.(K);
2317
+ d({ type: "INIT_ERROR", payload: V }), r?.(V);
2305
2318
  }
2306
- }, _ = (k) => {
2307
- d({ type: "SELECT_METHOD", payload: k });
2308
- }, h = async (k) => {
2309
- if (!(!o.paymentIntent || !o.selectedMethod)) {
2319
+ }, p = (S) => {
2320
+ d({ type: "SELECT_METHOD", payload: S });
2321
+ }, v = async (S) => {
2322
+ if (!(!s.paymentIntent || !s.selectedMethod)) {
2310
2323
  d({ type: "PROCESS_START" });
2311
2324
  try {
2312
- let x;
2313
- if (o.paymentIntent.clientSecret) {
2314
- const { data: K, error: b } = await u.confirmPaymentIntent(
2315
- o.paymentIntent.id,
2316
- o.paymentIntent.clientSecret
2325
+ let M;
2326
+ if (s.paymentIntent.clientSecret) {
2327
+ const { data: b, error: V } = await f.confirmPaymentIntent(
2328
+ s.paymentIntent.id,
2329
+ s.paymentIntent.clientSecret
2317
2330
  );
2318
- if (b) {
2319
- d({ type: "PROCESS_ERROR", payload: b }), r?.(b);
2331
+ if (V) {
2332
+ d({ type: "PROCESS_ERROR", payload: V }), r?.(V);
2320
2333
  return;
2321
2334
  }
2322
- x = K;
2335
+ M = b;
2323
2336
  } else {
2324
- const { data: K, error: b } = await u.confirmPayment(o.paymentIntent.id);
2325
- if (b) {
2326
- d({ type: "PROCESS_ERROR", payload: b }), r?.(b);
2337
+ const { data: b, error: V } = await f.confirmPayment(s.paymentIntent.id);
2338
+ if (V) {
2339
+ d({ type: "PROCESS_ERROR", payload: V }), r?.(V);
2327
2340
  return;
2328
2341
  }
2329
- x = K;
2342
+ M = b;
2330
2343
  }
2331
- const R = {
2332
- paymentId: o.paymentIntent.id,
2333
- reference: k.reference || o.paymentIntent.reference || o.paymentIntent.metadata?.reference || "",
2334
- amount: o.paymentIntent.amount,
2335
- currency: o.paymentIntent.currency,
2336
- paymentMethod: o.selectedMethod,
2337
- psp: o.paymentIntent.recommendedPsp,
2338
- pspReference: k.pspReference || x?.provider_ref_id || "",
2344
+ const K = {
2345
+ paymentId: s.paymentIntent.id,
2346
+ reference: S.reference || s.paymentIntent.reference || s.paymentIntent.metadata?.reference || "",
2347
+ amount: s.paymentIntent.amount,
2348
+ currency: s.paymentIntent.currency,
2349
+ paymentMethod: s.selectedMethod,
2350
+ psp: s.paymentIntent.recommendedPsp,
2351
+ pspReference: S.pspReference || M?.provider_ref_id || "",
2339
2352
  status: "success",
2340
- metadata: k
2353
+ metadata: S
2341
2354
  };
2342
- d({ type: "PROCESS_SUCCESS", payload: R }), n?.(R);
2343
- } catch (x) {
2344
- const R = {
2355
+ d({ type: "PROCESS_SUCCESS", payload: K }), n?.(K);
2356
+ } catch (M) {
2357
+ const K = {
2345
2358
  code: "PAYMENT_FAILED",
2346
- message: x instanceof Error ? x.message : "Payment failed",
2359
+ message: M instanceof Error ? M.message : "Payment failed",
2347
2360
  recoverable: !0,
2348
- originalError: x
2361
+ originalError: M
2349
2362
  };
2350
- d({ type: "PROCESS_ERROR", payload: R }), r?.(R);
2363
+ d({ type: "PROCESS_ERROR", payload: K }), r?.(K);
2351
2364
  }
2352
2365
  }
2353
2366
  };
2354
2367
  return {
2355
2368
  // Svelte store contract
2356
- subscribe: v,
2369
+ subscribe: m,
2357
2370
  // Actions
2358
- initialize: m,
2359
- selectMethod: _,
2360
- processPayment: h,
2361
- handlePspSuccess: async (k) => {
2362
- await h(k);
2371
+ initialize: _,
2372
+ selectMethod: p,
2373
+ processPayment: v,
2374
+ handlePspSuccess: async (S) => {
2375
+ await v(S);
2363
2376
  },
2364
- handlePspError: (k) => {
2365
- d({ type: "PROCESS_ERROR", payload: k }), r?.(k);
2377
+ handlePspError: (S) => {
2378
+ d({ type: "PROCESS_ERROR", payload: S }), r?.(S);
2366
2379
  },
2367
2380
  reset: () => {
2368
- d({ type: "RESET" });
2381
+ c += 1, d({ type: "RESET" });
2369
2382
  },
2370
2383
  close: async () => {
2371
- if (o.paymentIntent && o.status !== "success")
2384
+ if (s.paymentIntent && s.status !== "success")
2372
2385
  try {
2373
- await u.cancelPaymentIntent(o.paymentIntent.id);
2386
+ await f.cancelPaymentIntent(s.paymentIntent.id);
2374
2387
  } catch {
2375
2388
  }
2376
- d({ type: "CLOSE" }), s?.();
2389
+ d({ type: "CLOSE" }), o?.();
2377
2390
  },
2378
2391
  // Getters
2379
- getStatus: () => o.status,
2380
- getPaymentIntent: () => o.paymentIntent,
2381
- getSelectedMethod: () => o.selectedMethod,
2382
- getError: () => o.error,
2383
- getResult: () => o.result,
2384
- isLoading: () => o.status === "loading" || o.status === "processing",
2385
- isReady: () => o.status === "ready" || o.status === "method_selected",
2386
- isComplete: () => o.status === "success",
2387
- canRetry: () => o.error?.recoverable ?? !1
2392
+ getStatus: () => s.status,
2393
+ getPaymentIntent: () => s.paymentIntent,
2394
+ getSelectedMethod: () => s.selectedMethod,
2395
+ getError: () => s.error,
2396
+ getResult: () => s.result,
2397
+ isLoading: () => s.status === "loading" || s.status === "processing",
2398
+ isReady: () => s.status === "ready" || s.status === "method_selected",
2399
+ isComplete: () => s.status === "success",
2400
+ canRetry: () => s.error?.recoverable ?? !1
2388
2401
  };
2389
2402
  }
2390
- var Bs = /* @__PURE__ */ T('<div class="reevit-method-selector__label">Select payment method</div>'), Vs = /* @__PURE__ */ T('<span class="reevit-method-option__description"> </span>'), Ys = /* @__PURE__ */ T('<span class="reevit-method-option__check"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg></span>'), Gs = /* @__PURE__ */ T('<span class="reevit-method-option__chevron"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg></span>'), Ws = /* @__PURE__ */ T('<button type="button"><span class="reevit-method-option__icon-wrapper"><span class="reevit-method-option__icon"> </span></span> <div class="reevit-method-option__content"><span class="reevit-method-option__label"> </span> <!></div> <!></button>'), Js = /* @__PURE__ */ T("<div><!> <div></div></div>");
2391
- function Br(e, t) {
2392
- tn(t, !1);
2393
- const n = /* @__PURE__ */ Q(), r = /* @__PURE__ */ Q();
2394
- let s = D(t, "methods", 8), i = D(t, "selected", 8);
2395
- D(t, "provider", 8, void 0);
2396
- let l = D(t, "layout", 8, "list"), o = D(t, "showLabel", 8, !0);
2397
- const c = Xt();
2403
+ var Jo = /* @__PURE__ */ R('<div class="reevit-method-selector__label">Select payment method</div>'), Zo = /* @__PURE__ */ R('<span class="reevit-method-option__description"> </span>'), Qo = /* @__PURE__ */ R('<span class="reevit-method-option__check"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg></span>'), Xo = /* @__PURE__ */ R('<span class="reevit-method-option__chevron"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg></span>'), $o = /* @__PURE__ */ R('<button type="button"><span class="reevit-method-option__icon-wrapper"><span class="reevit-method-option__icon"> </span></span> <div class="reevit-method-option__content"><span class="reevit-method-option__label"> </span> <!></div> <!></button>'), ea = /* @__PURE__ */ R("<div><!> <div></div></div>");
2404
+ function Gr(e, t) {
2405
+ an(t, !1);
2406
+ const n = /* @__PURE__ */ $(), r = /* @__PURE__ */ $();
2407
+ let o = F(t, "methods", 8), i = F(t, "selected", 8);
2408
+ F(t, "provider", 8, void 0);
2409
+ let l = F(t, "layout", 8, "list"), s = F(t, "showLabel", 8, !0);
2410
+ const c = nn();
2398
2411
  function u(_) {
2399
2412
  c("select", _);
2400
2413
  }
2401
- ee(() => G(l()), () => {
2402
- A(n, l() === "grid");
2403
- }), ee(() => G(s()), () => {
2404
- A(r, [
2414
+ te(() => G(l()), () => {
2415
+ T(n, l() === "grid");
2416
+ }), te(() => G(o()), () => {
2417
+ T(r, [
2405
2418
  {
2406
2419
  id: "card",
2407
2420
  name: "Card",
@@ -2420,81 +2433,81 @@ function Br(e, t) {
2420
2433
  icon: "🏦",
2421
2434
  description: "Pay directly from your bank account"
2422
2435
  }
2423
- ].filter((_) => s().includes(_.id)));
2424
- }), Bn(), on();
2425
- var f = Js(), d = g(f);
2436
+ ].filter((_) => o().includes(_.id)));
2437
+ }), Gn(), fn();
2438
+ var f = ea(), h = E(f);
2426
2439
  {
2427
- var v = (_) => {
2428
- var h = Bs();
2429
- P(_, h);
2440
+ var d = (_) => {
2441
+ var p = Jo();
2442
+ P(_, p);
2430
2443
  };
2431
- J(d, (_) => {
2432
- o() && _(v);
2444
+ J(h, (_) => {
2445
+ s() && _(d);
2433
2446
  });
2434
2447
  }
2435
- var m = q(d, 2);
2436
- Wn(m, 7, () => a(r), (_) => _.id, (_, h, p) => {
2437
- var y = Ws(), B = g(y), S = g(B), z = g(S), H = q(B, 2), Z = g(H), O = g(Z), V = q(Z, 2);
2448
+ var m = U(h, 2);
2449
+ Qn(m, 7, () => a(r), (_) => _.id, (_, p, v) => {
2450
+ var y = $o(), B = E(y), k = E(B), z = E(k), H = U(B, 2), X = E(H), L = E(X), q = U(X, 2);
2438
2451
  {
2439
- var I = (M) => {
2440
- var k = Vs(), x = g(k);
2441
- X(() => me(x, (a(h), w(() => a(h).description)))), P(M, k);
2452
+ var C = (I) => {
2453
+ var Z = Zo(), S = E(Z);
2454
+ Q(() => ve(S, (a(p), w(() => a(p).description)))), P(I, Z);
2442
2455
  };
2443
- J(V, (M) => {
2444
- a(n) || M(I);
2456
+ J(q, (I) => {
2457
+ a(n) || I(C);
2445
2458
  });
2446
2459
  }
2447
- var E = q(H, 2);
2460
+ var g = U(H, 2);
2448
2461
  {
2449
- var F = (M) => {
2450
- var k = ut(), x = Ke(k);
2462
+ var O = (I) => {
2463
+ var Z = vt(), S = Ke(Z);
2451
2464
  {
2452
- var R = (b) => {
2453
- var de = Ys();
2454
- P(b, de);
2465
+ var M = (b) => {
2466
+ var V = Qo();
2467
+ P(b, V);
2455
2468
  }, K = (b) => {
2456
- var de = Gs();
2457
- P(b, de);
2469
+ var V = Xo();
2470
+ P(b, V);
2458
2471
  };
2459
- J(x, (b) => {
2460
- G(i()), a(h), w(() => i() === a(h).id) ? b(R) : b(K, !1);
2472
+ J(S, (b) => {
2473
+ G(i()), a(p), w(() => i() === a(p).id) ? b(M) : b(K, !1);
2461
2474
  });
2462
2475
  }
2463
- P(M, k);
2476
+ P(I, Z);
2464
2477
  };
2465
- J(E, (M) => {
2466
- a(n) || M(F);
2478
+ J(g, (I) => {
2479
+ a(n) || I(O);
2467
2480
  });
2468
2481
  }
2469
- X(
2470
- (M) => {
2471
- et(y, 1, M), Jn(y, `animation-delay: ${a(p) * 0.05}s`), me(z, (a(h), w(() => a(h).icon))), me(O, (a(h), w(() => a(h).name)));
2482
+ Q(
2483
+ (I) => {
2484
+ nt(y, 1, I), Xn(y, `animation-delay: ${a(v) * 0.05}s`), ve(z, (a(p), w(() => a(p).icon))), ve(L, (a(p), w(() => a(p).name)));
2472
2485
  },
2473
2486
  [
2474
- () => $e((G(ue), a(n), G(i()), a(h), w(() => ue(
2487
+ () => tt((G(de), a(n), G(i()), a(p), w(() => de(
2475
2488
  "reevit-method-option",
2476
2489
  a(n) ? "reevit-method-option--grid" : "reevit-method-option--list",
2477
- i() === a(h).id && "reevit-method-option--selected"
2490
+ i() === a(p).id && "reevit-method-option--selected"
2478
2491
  ))))
2479
2492
  ]
2480
- ), ce("click", y, () => u(a(h).id)), P(_, y);
2481
- }), X(
2482
- (_, h) => {
2483
- et(f, 1, _), et(m, 1, h);
2493
+ ), fe("click", y, () => u(a(p).id)), P(_, y);
2494
+ }), Q(
2495
+ (_, p) => {
2496
+ nt(f, 1, _), nt(m, 1, p);
2484
2497
  },
2485
2498
  [
2486
- () => $e((G(ue), a(n), w(() => ue("reevit-method-selector", a(n) && "reevit-method-selector--grid")))),
2487
- () => $e((G(ue), a(n), w(() => ue("reevit-method-selector__options", a(n) ? "reevit-method-selector__options--grid" : "reevit-method-selector__options--list"))))
2499
+ () => tt((G(de), a(n), w(() => de("reevit-method-selector", a(n) && "reevit-method-selector--grid")))),
2500
+ () => tt((G(de), a(n), w(() => de("reevit-method-selector__options", a(n) ? "reevit-method-selector__options--grid" : "reevit-method-selector__options--list"))))
2488
2501
  ]
2489
- ), P(e, f), nn();
2490
- }
2491
- var Zs = /* @__PURE__ */ T('<img alt="" class="reevit-psp-option__logo-img" loading="lazy"/>'), Qs = /* @__PURE__ */ T('<span class="reevit-psp-option__logo-fallback"> </span>'), Xs = /* @__PURE__ */ T('<div class="reevit-psp-accordion__content reevit-animate-fade-in"><div class="reevit-psp-methods"><!></div> <!></div>'), $s = /* @__PURE__ */ T('<div class="reevit-psp-accordion"><button type="button"><span class="reevit-psp-option__logo" aria-hidden="true"><!></span> <div class="reevit-psp-option__content"><span class="reevit-psp-option__name"> </span> <span class="reevit-psp-option__methods"> </span></div></button> <!></div>'), ea = /* @__PURE__ */ T('<div class="reevit-psp-selector"><div class="reevit-psp-selector__label">Select payment provider</div> <div class="reevit-psp-selector__options"></div></div>');
2492
- function ta(e, t) {
2493
- tn(t, !1);
2494
- let n = D(t, "providers", 24, () => []), r = D(t, "selectedProvider", 8, null), s = D(t, "disabled", 8, !1);
2495
- D(t, "theme", 8, void 0);
2496
- let i = D(t, "selectedMethod", 8, null);
2497
- const l = Xt(), o = {
2502
+ ), P(e, f), sn();
2503
+ }
2504
+ var ta = /* @__PURE__ */ R('<img alt="" class="reevit-psp-option__logo-img" loading="lazy"/>'), na = /* @__PURE__ */ R('<span class="reevit-psp-option__logo-fallback"> </span>'), ra = /* @__PURE__ */ R('<div class="reevit-psp-accordion__content reevit-animate-fade-in"><div class="reevit-psp-methods"><!></div> <!></div>'), ia = /* @__PURE__ */ R('<div class="reevit-psp-accordion"><button type="button"><span class="reevit-psp-option__logo" aria-hidden="true"><!></span> <div class="reevit-psp-option__content"><span class="reevit-psp-option__name"> </span> <span class="reevit-psp-option__methods"> </span></div></button> <!></div>'), oa = /* @__PURE__ */ R('<div class="reevit-psp-selector"><div class="reevit-psp-selector__label">Select payment provider</div> <div class="reevit-psp-selector__options"></div></div>');
2505
+ function aa(e, t) {
2506
+ an(t, !1);
2507
+ let n = F(t, "providers", 24, () => []), r = F(t, "selectedProvider", 8, null), o = F(t, "disabled", 8, !1);
2508
+ F(t, "theme", 8, void 0);
2509
+ let i = F(t, "selectedMethod", 8, null);
2510
+ const l = nn(), s = {
2498
2511
  paystack: "https://reevit.io/images/providers/paystack.png",
2499
2512
  stripe: "https://reevit.io/images/providers/stripe.png",
2500
2513
  flutterwave: "https://reevit.io/images/providers/flutterwave.png",
@@ -2505,34 +2518,34 @@ function ta(e, t) {
2505
2518
  card: "Card",
2506
2519
  mobile_money: "Mobile Money",
2507
2520
  bank_transfer: "Bank Transfer"
2508
- }, u = (_) => _.length ? _.map((h) => c[h]).join(", ") : "Payment methods", f = (_, h) => _.toLowerCase().includes("hubtel") ? h.filter((p) => p === "card" || p === "mobile_money") : h;
2509
- function d(_) {
2521
+ }, u = (_) => _.length ? _.map((p) => c[p]).join(", ") : "Payment methods", f = (_, p) => _.toLowerCase().includes("hubtel") ? p.filter((v) => v === "card" || v === "mobile_money") : p;
2522
+ function h(_) {
2510
2523
  l("select", _);
2511
2524
  }
2512
- on();
2513
- var v = ea(), m = q(g(v), 2);
2514
- Wn(m, 5, n, (_) => _.provider, (_, h) => {
2515
- const p = /* @__PURE__ */ Ct(() => (G(r()), a(h), w(() => r() === a(h).provider))), y = /* @__PURE__ */ Ct(() => (a(h), w(() => f(a(h).provider, a(h).methods))));
2516
- var B = $s(), S = g(B), z = g(S), H = g(z);
2525
+ fn();
2526
+ var d = oa(), m = U(E(d), 2);
2527
+ Qn(m, 5, n, (_) => _.provider, (_, p) => {
2528
+ const v = /* @__PURE__ */ Rt(() => (G(r()), a(p), w(() => r() === a(p).provider))), y = /* @__PURE__ */ Rt(() => (a(p), w(() => f(a(p).provider, a(p).methods))));
2529
+ var B = ia(), k = E(B), z = E(k), H = E(z);
2517
2530
  {
2518
- var Z = (R) => {
2519
- var K = Zs();
2520
- X(() => Ln(K, "src", (a(h), w(() => o[a(h).provider])))), P(R, K);
2521
- }, O = (R) => {
2522
- var K = Qs(), b = g(K);
2523
- X((de) => me(b, de), [
2524
- () => (a(h), w(() => a(h).name.slice(0, 1).toUpperCase()))
2525
- ]), P(R, K);
2531
+ var X = (M) => {
2532
+ var K = ta();
2533
+ Q(() => tn(K, "src", (a(p), w(() => s[a(p).provider])))), P(M, K);
2534
+ }, L = (M) => {
2535
+ var K = na(), b = E(K);
2536
+ Q((V) => ve(b, V), [
2537
+ () => (a(p), w(() => a(p).name.slice(0, 1).toUpperCase()))
2538
+ ]), P(M, K);
2526
2539
  };
2527
- J(H, (R) => {
2528
- a(h), w(() => o[a(h).provider]) ? R(Z) : R(O, !1);
2540
+ J(H, (M) => {
2541
+ a(p), w(() => s[a(p).provider]) ? M(X) : M(L, !1);
2529
2542
  });
2530
2543
  }
2531
- var V = q(z, 2), I = g(V), E = g(I), F = q(I, 2), M = g(F), k = q(S, 2);
2544
+ var q = U(z, 2), C = E(q), g = E(C), O = U(C, 2), I = E(O), Z = U(k, 2);
2532
2545
  {
2533
- var x = (R) => {
2534
- var K = Xs(), b = g(K), de = g(b);
2535
- Br(de, {
2546
+ var S = (M) => {
2547
+ var K = ra(), b = E(K), V = E(b);
2548
+ Gr(V, {
2536
2549
  get methods() {
2537
2550
  return a(y);
2538
2551
  },
@@ -2540,111 +2553,111 @@ function ta(e, t) {
2540
2553
  return i();
2541
2554
  },
2542
2555
  get provider() {
2543
- return a(h), w(() => a(h).provider);
2556
+ return a(p), w(() => a(p).provider);
2544
2557
  },
2545
2558
  layout: "list",
2546
2559
  showLabel: !1,
2547
- $$events: { select: (ae) => l("methodSelect", ae.detail) }
2560
+ $$events: { select: (_e) => l("methodSelect", _e.detail) }
2548
2561
  });
2549
- var we = q(b, 2);
2550
- Nn(we, t, "method-content", {}, null), P(R, K);
2562
+ var Oe = U(b, 2);
2563
+ Dn(Oe, t, "method-content", {}, null), P(M, K);
2551
2564
  };
2552
- J(k, (R) => {
2553
- a(p) && R(x);
2565
+ J(Z, (M) => {
2566
+ a(v) && M(S);
2554
2567
  });
2555
2568
  }
2556
- X(
2557
- (R, K) => {
2558
- et(S, 1, R), S.disabled = s(), Ln(S, "aria-expanded", a(p)), me(E, (a(h), w(() => a(h).name))), me(M, K);
2569
+ Q(
2570
+ (M, K) => {
2571
+ nt(k, 1, M), k.disabled = o(), tn(k, "aria-expanded", a(v)), ve(g, (a(p), w(() => a(p).name))), ve(I, K);
2559
2572
  },
2560
2573
  [
2561
- () => $e((G(ue), G(a(p)), G(s()), w(() => ue("reevit-psp-option", a(p) && "reevit-psp-option--selected", s() && "reevit-psp-option--disabled")))),
2574
+ () => tt((G(de), G(a(v)), G(o()), w(() => de("reevit-psp-option", a(v) && "reevit-psp-option--selected", o() && "reevit-psp-option--disabled")))),
2562
2575
  () => (G(a(y)), w(() => u(a(y))))
2563
2576
  ]
2564
- ), ce("click", S, () => d(a(h).provider)), P(_, B);
2565
- }), P(e, v), nn();
2566
- }
2567
- var na = /* @__PURE__ */ T('<button type="button"><div class="reevit-network-dot"></div> </button>'), ra = /* @__PURE__ */ T('<p class="reevit-error-message"> </p>'), ia = /* @__PURE__ */ T('<button type="button" class="reevit-btn reevit-btn--secondary">Back</button>'), sa = /* @__PURE__ */ T('<span class="reevit-spinner"></span>'), aa = /* @__PURE__ */ T("<span>Continue</span>"), oa = /* @__PURE__ */ T('<form class="reevit-momo-form"><div class="reevit-form-group"><label class="reevit-label" for="reevit-phone">Phone Number</label> <input id="reevit-phone" type="tel" placeholder="e.g. 024 123 4567" autocomplete="tel"/></div> <div class="reevit-network-selector"><label class="reevit-label" for="reevit-network-grid">Select Network</label> <div id="reevit-network-grid" class="reevit-networks-grid"></div></div> <!> <div class="reevit-momo-form__actions"><!> <button type="submit" class="reevit-btn reevit-btn--primary"><!></button></div> <p class="reevit-secure-text">🔒 Secure mobile money payment via Reevit</p></form>');
2568
- function or(e, t) {
2569
- tn(t, !1);
2570
- let n = D(t, "initialPhone", 8, ""), r = D(t, "loading", 8, !1), s = D(t, "hideCancel", 8, !1);
2571
- const i = Xt();
2572
- let l = /* @__PURE__ */ Q(n()), o = /* @__PURE__ */ Q(null), c = /* @__PURE__ */ Q(null);
2577
+ ), fe("click", k, () => h(a(p).provider)), P(_, B);
2578
+ }), P(e, d), sn();
2579
+ }
2580
+ var sa = /* @__PURE__ */ R('<button type="button"><div class="reevit-network-dot"></div> </button>'), la = /* @__PURE__ */ R('<p class="reevit-error-message"> </p>'), ca = /* @__PURE__ */ R('<button type="button" class="reevit-btn reevit-btn--secondary">Back</button>'), ua = /* @__PURE__ */ R('<span class="reevit-spinner"></span>'), fa = /* @__PURE__ */ R("<span>Continue</span>"), da = /* @__PURE__ */ R('<form class="reevit-momo-form"><div class="reevit-form-group"><label class="reevit-label" for="reevit-phone">Phone Number</label> <input id="reevit-phone" type="tel" placeholder="e.g. 024 123 4567" autocomplete="tel"/></div> <div class="reevit-network-selector"><label class="reevit-label" for="reevit-network-grid">Select Network</label> <div id="reevit-network-grid" class="reevit-networks-grid"></div></div> <!> <div class="reevit-momo-form__actions"><!> <button type="submit" class="reevit-btn reevit-btn--primary"><!></button></div> <p class="reevit-secure-text">🔒 Secure mobile money payment via Reevit</p></form>');
2581
+ function ur(e, t) {
2582
+ an(t, !1);
2583
+ let n = F(t, "initialPhone", 8, ""), r = F(t, "loading", 8, !1), o = F(t, "hideCancel", 8, !1);
2584
+ const i = nn();
2585
+ let l = /* @__PURE__ */ $(n()), s = /* @__PURE__ */ $(null), c = /* @__PURE__ */ $(null);
2573
2586
  function u() {
2574
- if (!wn(a(l))) {
2575
- A(c, "Please enter a valid phone number");
2587
+ if (!kn(a(l))) {
2588
+ T(c, "Please enter a valid phone number");
2576
2589
  return;
2577
2590
  }
2578
- if (!a(o)) {
2579
- A(c, "Please select your mobile network");
2591
+ if (!a(s)) {
2592
+ T(c, "Please select your mobile network");
2580
2593
  return;
2581
2594
  }
2582
- i("submit", { phone: a(l), network: a(o) });
2595
+ i("submit", { phone: a(l), network: a(s) });
2583
2596
  }
2584
2597
  const f = [
2585
2598
  { id: "mtn", name: "MTN", color: "#FFCC00" },
2586
2599
  { id: "vodafone", name: "Vodafone", color: "#E60000" },
2587
2600
  { id: "airteltigo", name: "AirtelTigo", color: "#005596" }
2588
2601
  ];
2589
- ee(() => (a(l), a(c)), () => {
2590
- const I = ci(a(l));
2591
- I && A(o, I), a(c) && A(c, null);
2592
- }), Bn(), on();
2593
- var d = oa(), v = g(d), m = q(g(v), 2), _ = q(v, 2), h = q(g(_), 2);
2594
- Wn(h, 5, () => f, (I) => I.id, (I, E) => {
2595
- var F = na(), M = g(F), k = q(M);
2596
- X(
2597
- (x) => {
2598
- et(F, 1, x), F.disabled = r(), Jn(M, `background-color: ${a(E), w(() => a(E).color) ?? ""}`), me(k, ` ${a(E), w(() => a(E).name) ?? ""}`);
2602
+ te(() => (a(l), a(c)), () => {
2603
+ const C = di(a(l));
2604
+ C && T(s, C), a(c) && T(c, null);
2605
+ }), Gn(), fn();
2606
+ var h = da(), d = E(h), m = U(E(d), 2), _ = U(d, 2), p = U(E(_), 2);
2607
+ Qn(p, 5, () => f, (C) => C.id, (C, g) => {
2608
+ var O = sa(), I = E(O), Z = U(I);
2609
+ Q(
2610
+ (S) => {
2611
+ nt(O, 1, S), O.disabled = r(), Xn(I, `background-color: ${a(g), w(() => a(g).color) ?? ""}`), ve(Z, ` ${a(g), w(() => a(g).name) ?? ""}`);
2599
2612
  },
2600
2613
  [
2601
- () => $e((G(ue), a(o), a(E), w(() => ue("reevit-network-btn", a(o) === a(E).id && "reevit-network-btn--selected"))))
2614
+ () => tt((G(de), a(s), a(g), w(() => de("reevit-network-btn", a(s) === a(g).id && "reevit-network-btn--selected"))))
2602
2615
  ]
2603
- ), ce("click", F, () => A(o, a(E).id)), P(I, F);
2616
+ ), fe("click", O, () => T(s, a(g).id)), P(C, O);
2604
2617
  });
2605
- var p = q(_, 2);
2618
+ var v = U(_, 2);
2606
2619
  {
2607
- var y = (I) => {
2608
- var E = ra(), F = g(E);
2609
- X(() => me(F, a(c))), P(I, E);
2620
+ var y = (C) => {
2621
+ var g = la(), O = E(g);
2622
+ Q(() => ve(O, a(c))), P(C, g);
2610
2623
  };
2611
- J(p, (I) => {
2612
- a(c) && I(y);
2624
+ J(v, (C) => {
2625
+ a(c) && C(y);
2613
2626
  });
2614
2627
  }
2615
- var B = q(p, 2), S = g(B);
2628
+ var B = U(v, 2), k = E(B);
2616
2629
  {
2617
- var z = (I) => {
2618
- var E = ia();
2619
- X(() => E.disabled = r()), ce("click", E, () => i("cancel")), P(I, E);
2630
+ var z = (C) => {
2631
+ var g = ca();
2632
+ Q(() => g.disabled = r()), fe("click", g, () => i("cancel")), P(C, g);
2620
2633
  };
2621
- J(S, (I) => {
2622
- s() || I(z);
2634
+ J(k, (C) => {
2635
+ o() || C(z);
2623
2636
  });
2624
2637
  }
2625
- var H = q(S, 2), Z = g(H);
2638
+ var H = U(k, 2), X = E(H);
2626
2639
  {
2627
- var O = (I) => {
2628
- var E = sa();
2629
- P(I, E);
2630
- }, V = (I) => {
2631
- var E = aa();
2632
- P(I, E);
2640
+ var L = (C) => {
2641
+ var g = ua();
2642
+ P(C, g);
2643
+ }, q = (C) => {
2644
+ var g = fa();
2645
+ P(C, g);
2633
2646
  };
2634
- J(Z, (I) => {
2635
- r() ? I(O) : I(V, !1);
2647
+ J(X, (C) => {
2648
+ r() ? C(L) : C(q, !1);
2636
2649
  });
2637
2650
  }
2638
- X(
2639
- (I) => {
2640
- et(m, 1, I), m.disabled = r(), H.disabled = r() || !a(l);
2651
+ Q(
2652
+ (C) => {
2653
+ nt(m, 1, C), m.disabled = r(), H.disabled = r() || !a(l);
2641
2654
  },
2642
2655
  [
2643
- () => $e((G(ue), a(c), G(wn), a(l), w(() => ue("reevit-input", a(c) && !wn(a(l)) && "reevit-input--error"))))
2656
+ () => tt((G(de), a(c), G(kn), a(l), w(() => de("reevit-input", a(c) && !kn(a(l)) && "reevit-input--error"))))
2644
2657
  ]
2645
- ), Ts(m, () => a(l), (I) => A(l, I)), ce("submit", d, As(u)), P(e, d), nn();
2658
+ ), Oo(m, () => a(l), (C) => T(l, C)), fe("submit", h, Fo(u)), P(e, h), sn();
2646
2659
  }
2647
- class la {
2660
+ class va {
2648
2661
  constructor(t) {
2649
2662
  this.baseUrl = "https://unified-pay.hubtel.com", this.messageHandler = null, this.stylesInjected = !1, t && (this.baseUrl = t);
2650
2663
  }
@@ -2655,8 +2668,8 @@ class la {
2655
2668
  * @throws {Error} If the popup is blocked by the browser.
2656
2669
  */
2657
2670
  redirect({ purchaseInfo: t, config: n }) {
2658
- const r = this.createCheckoutUrl(t, n), s = window.open(r);
2659
- if (!s || s.closed || typeof s.closed > "u")
2671
+ const r = this.createCheckoutUrl(t, n), o = window.open(r);
2672
+ if (!o || o.closed || typeof o.closed > "u")
2660
2673
  throw new Error("Popup was blocked by the browser. Please allow popups for this site.");
2661
2674
  }
2662
2675
  /**
@@ -2668,8 +2681,8 @@ class la {
2668
2681
  * @param iframeStyle - The style options for the iframe (optional).
2669
2682
  * @throws {Error} If the container element with id "hubtel-checkout-iframe" is not found.
2670
2683
  */
2671
- initIframe({ purchaseInfo: t, callBacks: n, config: r, iframeStyle: s }) {
2672
- var i, l, o;
2684
+ initIframe({ purchaseInfo: t, callBacks: n, config: r, iframeStyle: o }) {
2685
+ var i, l, s;
2673
2686
  this.registerEvents(n);
2674
2687
  const c = document.getElementById("hubtel-checkout-iframe");
2675
2688
  if (!c)
@@ -2678,17 +2691,17 @@ class la {
2678
2691
  const u = document.createElement("div");
2679
2692
  u.textContent = "Loading...", c.appendChild(u);
2680
2693
  const f = document.createElement("iframe");
2681
- f.setAttribute("id", "hubtel-iframe-element"), f.src = this.createCheckoutUrl(t, r), f.style.display = "none", f.style.width = (i = s?.width) !== null && i !== void 0 ? i : "100%", f.style.height = (l = s?.height) !== null && l !== void 0 ? l : "100%", f.style.minHeight = s?.minHeight || "400px", f.style.border = (o = s?.border) !== null && o !== void 0 ? o : "none", f.onload = () => {
2682
- var d;
2683
- c.removeChild(u), f.style.display = "block", (d = n.onLoad) === null || d === void 0 || d.call(n);
2694
+ f.setAttribute("id", "hubtel-iframe-element"), f.src = this.createCheckoutUrl(t, r), f.style.display = "none", f.style.width = (i = o?.width) !== null && i !== void 0 ? i : "100%", f.style.height = (l = o?.height) !== null && l !== void 0 ? l : "100%", f.style.minHeight = o?.minHeight || "400px", f.style.border = (s = o?.border) !== null && s !== void 0 ? s : "none", f.onload = () => {
2695
+ var h;
2696
+ c.removeChild(u), f.style.display = "block", (h = n.onLoad) === null || h === void 0 || h.call(n);
2684
2697
  }, c.appendChild(f);
2685
2698
  }
2686
2699
  openModal({ purchaseInfo: t, callBacks: n, config: r }) {
2687
2700
  this.injectStyles(), this.createIframe(), this.handleBackButton(), this.registerEvents(n), this.renderWebpageInPopup(this.createCheckoutUrl(t, r), n.onClose, n.onLoad);
2688
2701
  }
2689
2702
  createCheckoutUrl(t, n) {
2690
- const r = Object.assign(Object.assign({}, t), n), s = Object.keys(r).reduce((u, f) => (r[f] !== null && r[f] !== void 0 && (u[f] = r[f]), u), {}), i = Object.keys(s).map((u) => `${u}=${encodeURIComponent(s[u])}`).join("&"), l = this.encodeBase64(i), o = encodeURIComponent(l);
2691
- return `${s?.branding === "disabled" ? `${this.baseUrl}/pay/direct` : `${this.baseUrl}/pay`}?p=${o}`;
2703
+ const r = Object.assign(Object.assign({}, t), n), o = Object.keys(r).reduce((u, f) => (r[f] !== null && r[f] !== void 0 && (u[f] = r[f]), u), {}), i = Object.keys(o).map((u) => `${u}=${encodeURIComponent(o[u])}`).join("&"), l = this.encodeBase64(i), s = encodeURIComponent(l);
2704
+ return `${o?.branding === "disabled" ? `${this.baseUrl}/pay/direct` : `${this.baseUrl}/pay`}?p=${s}`;
2692
2705
  }
2693
2706
  encodeBase64(t) {
2694
2707
  return btoa(unescape(encodeURIComponent(t)));
@@ -2707,21 +2720,21 @@ class la {
2707
2720
  registerEvents(t) {
2708
2721
  this.messageHandler && window.removeEventListener("message", this.messageHandler, !1);
2709
2722
  const n = (r) => {
2710
- var s, i, l, o, c, u;
2723
+ var o, i, l, s, c, u;
2711
2724
  if (r.origin !== this.baseUrl)
2712
2725
  return;
2713
2726
  const { data: f } = r;
2714
2727
  if (f.success === !0)
2715
- (s = t.onPaymentSuccess) === null || s === void 0 || s.call(t, f);
2728
+ (o = t.onPaymentSuccess) === null || o === void 0 || o.call(t, f);
2716
2729
  else if (f.success === !1)
2717
2730
  (i = t.onPaymentFailure) === null || i === void 0 || i.call(t, f);
2718
2731
  else if (f.initialized)
2719
- (l = t.init) === null || l === void 0 || l.call(t, f), (o = t.onInit) === null || o === void 0 || o.call(t, f);
2732
+ (l = t.init) === null || l === void 0 || l.call(t, f), (s = t.onInit) === null || s === void 0 || s.call(t, f);
2720
2733
  else if (f.feesChanged)
2721
2734
  (c = t.onFeesChanged) === null || c === void 0 || c.call(t, f.fees);
2722
2735
  else if (f.resize) {
2723
- const d = document.getElementById("hubtel-iframe-element");
2724
- d && (d.style.height = f.height + "px"), (u = t?.onResize) === null || u === void 0 || u.call(t, f);
2736
+ const h = document.getElementById("hubtel-iframe-element");
2737
+ h && (h.style.height = f.height + "px"), (u = t?.onResize) === null || u === void 0 || u.call(t, f);
2725
2738
  }
2726
2739
  };
2727
2740
  this.messageHandler = n, window.addEventListener("message", n, !1);
@@ -2734,15 +2747,15 @@ class la {
2734
2747
  this.messageHandler && (window.removeEventListener("message", this.messageHandler, !1), this.messageHandler = null);
2735
2748
  }
2736
2749
  renderWebpageInPopup(t, n, r) {
2737
- const s = document.createElement("div");
2738
- s.classList.add("checkout-modal");
2750
+ const o = document.createElement("div");
2751
+ o.classList.add("checkout-modal");
2739
2752
  const i = document.createElement("div");
2740
2753
  i.setAttribute("id", "checkout-close-icon"), i.innerHTML = "&times;", i.classList.add("close-icon"), i.addEventListener("click", () => {
2741
2754
  this.closePopUp(), n?.();
2742
- }), s.appendChild(i);
2755
+ }), o.appendChild(i);
2743
2756
  const l = document.createElement("iframe");
2744
- l.src = t, history.pushState({ modalOpen: !0 }, ""), l.classList.add("iframe"), s.appendChild(l), document.body.appendChild(s), s.style.opacity = "0", l.addEventListener("load", () => {
2745
- s.style.opacity = "1", r?.();
2757
+ l.src = t, history.pushState({ modalOpen: !0 }, ""), l.classList.add("iframe"), o.appendChild(l), document.body.appendChild(o), o.style.opacity = "0", l.addEventListener("load", () => {
2758
+ o.style.opacity = "1", r?.();
2746
2759
  });
2747
2760
  }
2748
2761
  closePopUp() {
@@ -2856,37 +2869,37 @@ class la {
2856
2869
  `, document.head.appendChild(t), this.stylesInjected = !0;
2857
2870
  }
2858
2871
  }
2859
- const lr = /* @__PURE__ */ new Map();
2860
- function ln(e, t) {
2861
- const n = lr.get(t);
2872
+ const fr = /* @__PURE__ */ new Map();
2873
+ function dn(e, t) {
2874
+ const n = fr.get(t);
2862
2875
  if (n) return n;
2863
- const r = new Promise((s, i) => {
2876
+ const r = new Promise((o, i) => {
2864
2877
  if (document.getElementById(t)) {
2865
- s();
2878
+ o();
2866
2879
  return;
2867
2880
  }
2868
2881
  const l = document.createElement("script");
2869
- l.id = t, l.src = e, l.async = !0, l.onload = () => s(), l.onerror = () => i(new Error(`Failed to load ${t} script`)), document.head.appendChild(l);
2882
+ l.id = t, l.src = e, l.async = !0, l.onload = () => o(), l.onerror = () => i(new Error(`Failed to load ${t} script`)), document.head.appendChild(l);
2870
2883
  });
2871
- return lr.set(t, r), r;
2884
+ return fr.set(t, r), r;
2872
2885
  }
2873
- function ca() {
2874
- return ln("https://js.paystack.co/v1/inline.js", "paystack-script");
2886
+ function pa() {
2887
+ return dn("https://js.paystack.co/v1/inline.js", "paystack-script");
2875
2888
  }
2876
- function ja() {
2889
+ function Va() {
2877
2890
  return Promise.resolve();
2878
2891
  }
2879
- function ua() {
2880
- return ln("https://checkout.flutterwave.com/v3.js", "flutterwave-script");
2892
+ function ha() {
2893
+ return dn("https://checkout.flutterwave.com/v3.js", "flutterwave-script");
2881
2894
  }
2882
- function fa() {
2883
- return ln("https://js.stripe.com/v3/", "stripe-script");
2895
+ function ma() {
2896
+ return dn("https://js.stripe.com/v3/", "stripe-script");
2884
2897
  }
2885
- function da() {
2886
- return ln("https://sdk.monnify.com/plugin/monnify.js", "monnify-script");
2898
+ function _a() {
2899
+ return dn("https://sdk.monnify.com/plugin/monnify.js", "monnify-script");
2887
2900
  }
2888
- async function va(e) {
2889
- if (await ca(), !window.PaystackPop)
2901
+ async function ya(e) {
2902
+ if (await pa(), !window.PaystackPop)
2890
2903
  throw new Error("Paystack script not loaded");
2891
2904
  window.PaystackPop.setup({
2892
2905
  key: e.key,
@@ -2899,18 +2912,18 @@ async function va(e) {
2899
2912
  onClose: e.onClose
2900
2913
  }).openIframe();
2901
2914
  }
2902
- async function pa(e) {
2903
- const t = new la(), n = e.preferredMethod === "mobile_money" ? "momo" : e.preferredMethod === "card" ? "card" : void 0, r = {
2915
+ async function ba(e) {
2916
+ const t = new va(), n = e.preferredMethod === "mobile_money" ? "momo" : e.preferredMethod === "card" ? "card" : void 0, r = {
2904
2917
  amount: e.amount,
2905
2918
  purchaseDescription: e.purchaseDescription,
2906
2919
  customerPhoneNumber: e.customerPhone || "",
2907
2920
  clientReference: `hubtel_${Date.now()}`,
2908
2921
  ...n ? { paymentMethod: n } : {}
2909
- }, s = e.hubtelSessionToken || e.basicAuth || "", i = {
2922
+ }, o = e.hubtelSessionToken || e.basicAuth || "", i = {
2910
2923
  branding: "enabled",
2911
2924
  callbackUrl: e.callbackUrl || (typeof window < "u" ? window.location.href : ""),
2912
2925
  merchantAccount: typeof e.clientId == "string" ? parseInt(e.clientId, 10) : e.clientId,
2913
- basicAuth: s,
2926
+ basicAuth: o,
2914
2927
  ...n ? { paymentMethod: n } : {}
2915
2928
  };
2916
2929
  t.openModal({
@@ -2929,8 +2942,8 @@ async function pa(e) {
2929
2942
  }
2930
2943
  });
2931
2944
  }
2932
- async function ha(e) {
2933
- if (await ua(), !window.FlutterwaveCheckout)
2945
+ async function ga(e) {
2946
+ if (await ha(), !window.FlutterwaveCheckout)
2934
2947
  throw new Error("Flutterwave script not loaded");
2935
2948
  window.FlutterwaveCheckout({
2936
2949
  public_key: e.public_key,
@@ -2944,13 +2957,13 @@ async function ha(e) {
2944
2957
  onclose: e.onclose
2945
2958
  });
2946
2959
  }
2947
- async function ma(e) {
2948
- if (await fa(), !window.Stripe)
2960
+ async function wa(e) {
2961
+ if (await ma(), !window.Stripe)
2949
2962
  throw new Error("Stripe.js not loaded");
2950
2963
  return window.Stripe(e);
2951
2964
  }
2952
- async function za(e) {
2953
- const n = await (await ma(e.publishableKey)).confirmPayment({
2965
+ async function Ya(e) {
2966
+ const n = await (await wa(e.publishableKey)).confirmPayment({
2954
2967
  elements: e.elements,
2955
2968
  clientSecret: e.clientSecret,
2956
2969
  redirect: "if_required"
@@ -2960,8 +2973,8 @@ async function za(e) {
2960
2973
  status: n.paymentIntent.status
2961
2974
  });
2962
2975
  }
2963
- async function _a(e) {
2964
- if (await da(), !window.MonnifySDK)
2976
+ async function Ea(e) {
2977
+ if (await _a(), !window.MonnifySDK)
2965
2978
  throw new Error("Monnify SDK not loaded");
2966
2979
  window.MonnifySDK.initialize({
2967
2980
  amount: e.amount,
@@ -2985,7 +2998,7 @@ async function _a(e) {
2985
2998
  onClose: e.onClose
2986
2999
  });
2987
3000
  }
2988
- async function ya(e, t) {
3001
+ async function Pa(e, t) {
2989
3002
  e.onInitiated();
2990
3003
  try {
2991
3004
  const n = await fetch(t, {
@@ -3013,11 +3026,11 @@ async function ya(e, t) {
3013
3026
  return e.onError({ message: r }), { status: "failed", message: r };
3014
3027
  }
3015
3028
  }
3016
- var ba = /* @__PURE__ */ T('<span class="reevit-spinner"></span>'), ga = /* @__PURE__ */ T('<button type="button" class="reevit-pay-button"><!></button>'), wa = /* @__PURE__ */ T('<div class="reevit-loading-state"><div class="reevit-spinner reevit-spinner--large"></div> <p>Initializing payment...</p></div>'), Ea = /* @__PURE__ */ T('<div class="reevit-error-state"><div class="reevit-error-icon">⚠️</div> <h3>Payment Failed</h3> <p> </p> <button class="reevit-retry-btn">Retry</button></div>'), Pa = /* @__PURE__ */ T('<div class="reevit-success-state"><div class="reevit-success-icon">✅</div> <h3>Payment Successful</h3> <p>Thank you for your payment.</p> <button class="reevit-done-btn">Done</button></div>'), Sa = /* @__PURE__ */ T(`<div class="reevit-inline-action"><p class="reevit-inline-action__hint">You'll be redirected to complete your card payment securely.</p> <button class="reevit-btn reevit-btn--primary">Pay with Card</button></div>`), ka = /* @__PURE__ */ T('<p class="reevit-inline-action__hint"> </p> <button class="reevit-btn reevit-btn--primary"> </button>', 1), Ia = /* @__PURE__ */ T('<div class="reevit-inline-action"><!></div>'), Ma = /* @__PURE__ */ T('<div slot="method-content" class="reevit-animate-fade-in"><!></div>'), Ca = /* @__PURE__ */ T('<span class="reevit-spinner"></span>'), xa = /* @__PURE__ */ T("<span> </span>"), Ra = /* @__PURE__ */ T('<div class="reevit-card-info reevit-animate-fade-in"><p class="reevit-info-text"> </p> <button class="reevit-submit-btn"><!></button></div>'), Ta = /* @__PURE__ */ T('<div class="reevit-method-step__actions reevit-animate-slide-up"><!></div>'), Aa = /* @__PURE__ */ T("<!> <!>", 1), Na = /* @__PURE__ */ T('<div class="reevit-method-step reevit-animate-slide-up"><!></div>'), La = /* @__PURE__ */ T('<div class="reevit-modal-overlay" role="button" tabindex="0"><div><button class="reevit-modal-close" aria-label="Close">&times;</button> <div class="reevit-modal-header"><img alt="Checkout" class="reevit-modal__logo"/></div> <div class="reevit-modal-body"><!></div> <div class="reevit-modal-footer"><div class="reevit-trust-badges"><span>PCI DSS Compliant</span> <span>•</span> <span>SSL Secure</span></div></div></div></div>'), Oa = /* @__PURE__ */ T('<div class="reevit-sdk-container"><!> <!></div>');
3017
- function Ha(e, t) {
3018
- tn(t, !1);
3019
- const n = () => Ls(b, "$store", r), [r, s] = Os(), i = /* @__PURE__ */ Q(), l = /* @__PURE__ */ Q(), o = /* @__PURE__ */ Q(), c = /* @__PURE__ */ Q(), u = /* @__PURE__ */ Q(), f = Xt();
3020
- let d = D(t, "publicKey", 8, void 0), v = D(t, "amount", 8), m = D(t, "currency", 8), _ = D(t, "email", 8, void 0), h = D(t, "phone", 8, void 0), p = D(t, "customerName", 8, void 0), y = D(t, "reference", 8, void 0), B = D(t, "metadata", 8, void 0), S = D(t, "customFields", 8, void 0), z = D(t, "paymentLinkCode", 8, void 0), H = D(t, "paymentMethods", 24, () => ["card", "mobile_money"]), Z = D(t, "theme", 24, () => ({})), O = D(t, "isOpen", 12, !1), V = D(t, "apiBaseUrl", 8, void 0), I = D(t, "initialPaymentIntent", 8, void 0), E = /* @__PURE__ */ Q({}), F = /* @__PURE__ */ Q(null), M = /* @__PURE__ */ Q("paystack"), k = /* @__PURE__ */ Q(["card", "mobile_money"]), x = /* @__PURE__ */ Q([]), R = /* @__PURE__ */ Q(a(k));
3029
+ var Sa = /* @__PURE__ */ R('<span class="reevit-spinner"></span>'), ka = /* @__PURE__ */ R('<button type="button" class="reevit-pay-button"><!></button>'), Ca = /* @__PURE__ */ R('<span class="reevit-modal__brand-name"> </span>'), Ia = /* @__PURE__ */ R('<div class="reevit-loading-state"><div class="reevit-spinner reevit-spinner--large"></div> <p>Initializing payment...</p></div>'), Ma = /* @__PURE__ */ R('<div class="reevit-error-state"><div class="reevit-error-icon">⚠️</div> <h3>Payment Failed</h3> <p> </p> <button class="reevit-retry-btn">Retry</button></div>'), xa = /* @__PURE__ */ R('<div class="reevit-success-state"><div class="reevit-success-icon">✅</div> <h3>Payment Successful</h3> <p>Thank you for your payment.</p> <button class="reevit-done-btn">Done</button></div>'), Ra = /* @__PURE__ */ R(`<div class="reevit-inline-action"><p class="reevit-inline-action__hint">You'll be redirected to complete your card payment securely.</p> <button class="reevit-btn reevit-btn--primary">Pay with Card</button></div>`), Ta = /* @__PURE__ */ R('<p class="reevit-inline-action__hint"> </p> <button class="reevit-btn reevit-btn--primary"> </button>', 1), Aa = /* @__PURE__ */ R('<div class="reevit-inline-action"><!></div>'), Na = /* @__PURE__ */ R('<div slot="method-content" class="reevit-animate-fade-in"><!></div>'), La = /* @__PURE__ */ R('<span class="reevit-spinner"></span>'), Oa = /* @__PURE__ */ R("<span> </span>"), Fa = /* @__PURE__ */ R('<div class="reevit-card-info reevit-animate-fade-in"><p class="reevit-info-text"> </p> <button class="reevit-submit-btn"><!></button></div>'), Da = /* @__PURE__ */ R('<div class="reevit-method-step__actions reevit-animate-slide-up"><!></div>'), Ua = /* @__PURE__ */ R("<!> <!>", 1), ja = /* @__PURE__ */ R('<div class="reevit-method-step reevit-animate-slide-up"><!></div>'), za = /* @__PURE__ */ R('<div class="reevit-modal-overlay" role="button" tabindex="0"><div><button class="reevit-modal-close" aria-label="Close">&times;</button> <div class="reevit-modal-header"><div class="reevit-modal__branding"><img class="reevit-modal__logo"/> <!></div></div> <div class="reevit-modal-body"><!></div> <div class="reevit-modal-footer"><div class="reevit-trust-badges"><span>PCI DSS Compliant</span> <span>•</span> <span>SSL Secure</span></div></div></div></div>'), Ha = /* @__PURE__ */ R('<div class="reevit-sdk-container"><!> <!></div>');
3030
+ function Ga(e, t) {
3031
+ an(t, !1);
3032
+ const n = () => Uo(b, "$store", r), [r, o] = jo(), i = /* @__PURE__ */ $(), l = /* @__PURE__ */ $(), s = /* @__PURE__ */ $(), c = /* @__PURE__ */ $(), u = /* @__PURE__ */ $(), f = nn();
3033
+ let h = F(t, "publicKey", 8, void 0), d = F(t, "amount", 8), m = F(t, "currency", 8), _ = F(t, "email", 8, void 0), p = F(t, "phone", 8, void 0), v = F(t, "customerName", 8, void 0), y = F(t, "reference", 8, void 0), B = F(t, "metadata", 8, void 0), k = F(t, "customFields", 8, void 0), z = F(t, "paymentLinkCode", 8, void 0), H = F(t, "paymentMethods", 24, () => ["card", "mobile_money"]), X = F(t, "theme", 24, () => ({})), L = F(t, "isOpen", 12, !1), q = F(t, "apiBaseUrl", 8, void 0), C = F(t, "initialPaymentIntent", 8, void 0), g = /* @__PURE__ */ $({}), O = /* @__PURE__ */ $(null), I = /* @__PURE__ */ $("paystack"), Z = /* @__PURE__ */ $(["card", "mobile_money"]), S = /* @__PURE__ */ $([]), M = /* @__PURE__ */ $(a(Z));
3021
3034
  const K = {
3022
3035
  hubtel: "Hubtel",
3023
3036
  paystack: "Paystack",
@@ -3025,44 +3038,44 @@ function Ha(e, t) {
3025
3038
  monnify: "Monnify",
3026
3039
  mpesa: "M-Pesa",
3027
3040
  stripe: "Stripe"
3028
- }, b = qs({
3041
+ }, b = Wo({
3029
3042
  config: {
3030
- publicKey: d(),
3031
- amount: v(),
3043
+ publicKey: h(),
3044
+ amount: d(),
3032
3045
  currency: m(),
3033
3046
  email: _(),
3034
- phone: h(),
3035
- customerName: p(),
3047
+ phone: p(),
3048
+ customerName: v(),
3036
3049
  reference: y(),
3037
3050
  metadata: B(),
3038
- customFields: S(),
3051
+ customFields: k(),
3039
3052
  paymentLinkCode: z(),
3040
3053
  paymentMethods: H(),
3041
- initialPaymentIntent: I()
3054
+ initialPaymentIntent: C()
3042
3055
  },
3043
- apiBaseUrl: V(),
3044
- onSuccess: (C) => f("success", C),
3045
- onError: (C) => f("error", C),
3056
+ apiBaseUrl: q(),
3057
+ onSuccess: (x) => f("success", x),
3058
+ onError: (x) => f("error", x),
3046
3059
  onClose: () => {
3047
- O(!1), f("close");
3060
+ L(!1), f("close");
3048
3061
  }
3049
3062
  });
3050
- function de() {
3051
- O(!0), A(F, null);
3063
+ function V() {
3064
+ L(!0), T(O, null);
3052
3065
  }
3053
- function we() {
3054
- O(!1), A(F, null), b.close();
3066
+ function Oe() {
3067
+ L(!1), T(O, null), b.close();
3055
3068
  }
3056
- async function ae(C) {
3069
+ async function _e(x) {
3057
3070
  if (!a(i).paymentIntent) return;
3058
- const W = a(M);
3071
+ const W = a(I);
3059
3072
  try {
3060
3073
  switch (W) {
3061
3074
  case "paystack": {
3062
- await va({
3063
- key: a(i).paymentIntent.pspPublicKey ?? d() ?? "",
3075
+ await ya({
3076
+ key: a(i).paymentIntent.pspPublicKey ?? h() ?? "",
3064
3077
  email: _() ?? "",
3065
- amount: v(),
3078
+ amount: d(),
3066
3079
  currency: m(),
3067
3080
  ref: a(i).paymentIntent.id,
3068
3081
  onSuccess: (Y) => b.handlePspSuccess(Y),
@@ -3072,38 +3085,38 @@ function Ha(e, t) {
3072
3085
  break;
3073
3086
  }
3074
3087
  case "hubtel": {
3075
- const Y = a(i).paymentIntent.pspCredentials?.merchantAccount, oe = fi({ publicKey: d(), baseUrl: V() }), { data: U, error: ie } = await oe.createHubtelSession(a(i).paymentIntent.id, a(i).paymentIntent.clientSecret);
3076
- if (ie || !U?.basicAuth) {
3088
+ const Y = a(i).paymentIntent.pspCredentials?.merchantAccount, se = pi({ publicKey: h(), baseUrl: q() }), { data: D, error: oe } = await se.createHubtelSession(a(i).paymentIntent.id, a(i).paymentIntent.clientSecret);
3089
+ if (oe || !D?.basicAuth) {
3077
3090
  f("error", {
3078
- code: ie?.code || "hubtel_session_error",
3079
- message: ie?.message || "Failed to create Hubtel session"
3091
+ code: oe?.code || "hubtel_session_error",
3092
+ message: oe?.message || "Failed to create Hubtel session"
3080
3093
  });
3081
3094
  return;
3082
3095
  }
3083
- const pe = a(i).selectedMethod === "card" || a(i).selectedMethod === "mobile_money" ? a(i).selectedMethod : void 0;
3084
- await pa({
3085
- clientId: U.merchantAccount || (typeof Y == "string" ? Y : d() ?? ""),
3086
- purchaseDescription: `Payment for ${v()} ${m()}`,
3087
- amount: v(),
3088
- customerPhone: C?.phone ?? h() ?? "",
3096
+ const le = a(i).selectedMethod === "card" || a(i).selectedMethod === "mobile_money" ? a(i).selectedMethod : void 0;
3097
+ await ba({
3098
+ clientId: D.merchantAccount || (typeof Y == "string" ? Y : h() ?? ""),
3099
+ purchaseDescription: `Payment for ${d()} ${m()}`,
3100
+ amount: d(),
3101
+ customerPhone: x?.phone ?? p() ?? "",
3089
3102
  customerEmail: _() ?? "",
3090
- basicAuth: U.basicAuth,
3091
- preferredMethod: pe,
3092
- onSuccess: (yt) => b.handlePspSuccess(yt),
3103
+ basicAuth: D.basicAuth,
3104
+ preferredMethod: le,
3105
+ onSuccess: (gt) => b.handlePspSuccess(gt),
3093
3106
  onClose: () => {
3094
3107
  }
3095
3108
  });
3096
3109
  break;
3097
3110
  }
3098
3111
  case "flutterwave": {
3099
- await ha({
3100
- public_key: a(i).paymentIntent.pspPublicKey ?? d() ?? "",
3112
+ await ga({
3113
+ public_key: a(i).paymentIntent.pspPublicKey ?? h() ?? "",
3101
3114
  tx_ref: a(i).paymentIntent.id,
3102
- amount: v(),
3115
+ amount: d(),
3103
3116
  currency: m(),
3104
3117
  customer: {
3105
3118
  email: _() ?? "",
3106
- phone_number: C?.phone ?? h() ?? ""
3119
+ phone_number: x?.phone ?? p() ?? ""
3107
3120
  },
3108
3121
  callback: (Y) => b.handlePspSuccess(Y),
3109
3122
  onclose: () => {
@@ -3112,44 +3125,44 @@ function Ha(e, t) {
3112
3125
  break;
3113
3126
  }
3114
3127
  case "monnify": {
3115
- const Y = B()?.contract_code, oe = a(i).paymentIntent.pspPublicKey ?? d() ?? "", U = typeof Y == "string" ? Y : d() ?? "";
3116
- if (!oe || !U) {
3128
+ const Y = B()?.contract_code, se = a(i).paymentIntent.pspPublicKey ?? h() ?? "", D = typeof Y == "string" ? Y : h() ?? "";
3129
+ if (!se || !D) {
3117
3130
  b.handlePspError({
3118
3131
  code: "MONNIFY_CONFIG_MISSING",
3119
3132
  message: "Monnify configuration is missing. Please check your API key and contract code."
3120
3133
  });
3121
3134
  return;
3122
3135
  }
3123
- await _a({
3124
- apiKey: oe,
3125
- contractCode: U,
3126
- amount: v(),
3136
+ await Ea({
3137
+ apiKey: se,
3138
+ contractCode: D,
3139
+ amount: d(),
3127
3140
  currency: m(),
3128
3141
  reference: a(i).paymentIntent.reference ?? a(i).paymentIntent.id,
3129
3142
  customerName: B()?.customer_name ?? _() ?? "",
3130
3143
  customerEmail: _() ?? "",
3131
- customerPhone: C?.phone ?? h() ?? "",
3144
+ customerPhone: x?.phone ?? p() ?? "",
3132
3145
  metadata: B(),
3133
- onSuccess: (ie) => b.handlePspSuccess(ie),
3146
+ onSuccess: (oe) => b.handlePspSuccess(oe),
3134
3147
  onClose: () => {
3135
3148
  }
3136
3149
  });
3137
3150
  break;
3138
3151
  }
3139
3152
  case "mpesa": {
3140
- const oe = `${V() ?? "https://api.reevit.io"}/v1/payments/${a(i).paymentIntent.id}/mpesa`;
3141
- await ya(
3153
+ const se = `${q() ?? "https://api.reevit.io"}/v1/payments/${a(i).paymentIntent.id}/mpesa`;
3154
+ await Pa(
3142
3155
  {
3143
- phoneNumber: C?.phone ?? h() ?? "",
3144
- amount: v(),
3156
+ phoneNumber: x?.phone ?? p() ?? "",
3157
+ amount: d(),
3145
3158
  reference: a(i).paymentIntent.reference ?? a(i).paymentIntent.id,
3146
3159
  description: `Payment ${a(i).paymentIntent.reference ?? ""}`,
3147
3160
  onInitiated: () => {
3148
3161
  },
3149
- onSuccess: (U) => b.handlePspSuccess(U),
3150
- onError: (U) => b.handlePspError({ code: "MPESA_ERROR", message: U.message })
3162
+ onSuccess: (D) => b.handlePspSuccess(D),
3163
+ onError: (D) => b.handlePspError({ code: "MPESA_ERROR", message: D.message })
3151
3164
  },
3152
- oe
3165
+ se
3153
3166
  );
3154
3167
  break;
3155
3168
  }
@@ -3173,382 +3186,392 @@ function Ha(e, t) {
3173
3186
  });
3174
3187
  }
3175
3188
  }
3176
- function cn(C) {
3177
- if (C === a(F)) {
3178
- A(F, null), b.reset();
3189
+ function at(x) {
3190
+ if (x === a(O)) {
3191
+ T(O, null), b.reset();
3179
3192
  return;
3180
3193
  }
3181
- const W = a(x).find((U) => U.provider === C), Y = W?.methods?.length ? W.methods : a(k), oe = a(i).selectedMethod && Y.includes(a(i).selectedMethod) ? a(i).selectedMethod : Y[0];
3182
- A(F, C), b.reset(), b.initialize(oe, { preferredProvider: C, allowedProviders: [C] });
3194
+ const W = a(S).find((D) => D.provider === x), Y = W?.methods?.length ? W.methods : a(Z), se = a(i).selectedMethod && Y.includes(a(i).selectedMethod) ? a(i).selectedMethod : Y[0];
3195
+ T(O, x), b.reset(), b.initialize(se, { preferredProvider: x, allowedProviders: [x] });
3183
3196
  }
3184
- ni(() => {
3185
- O() && b.initialize();
3186
- }), ri(() => {
3197
+ oi(() => {
3198
+ L() && b.initialize();
3199
+ }), ai(() => {
3187
3200
  typeof document < "u" && (document.body.style.overflow = "");
3188
- }), ee(() => n(), () => {
3189
- A(i, n());
3190
- }), ee(() => (a(i), G(Z())), () => {
3191
- A(E, {
3201
+ }), te(() => n(), () => {
3202
+ T(i, n());
3203
+ }), te(() => (a(i), G(X())), () => {
3204
+ T(g, {
3192
3205
  ...a(i).paymentIntent?.branding || {},
3193
- ...Z() || {}
3206
+ ...X() || {}
3194
3207
  });
3195
- }), ee(() => a(E), () => {
3196
- A(l, ui(a(E)));
3197
- }), ee(() => G(H()), () => {
3198
- A(k, H()?.length ? H() : ["card", "mobile_money"]);
3199
- }), ee(() => (a(i), a(k)), () => {
3200
- A(x, (() => {
3201
- const C = a(i).paymentIntent;
3202
- if (!C) return [];
3203
- const W = new Set(a(k)), Y = (C.availableProviders || []).map((U) => {
3204
- const ie = U.provider.toLowerCase().includes("hubtel") ? U.methods.filter((pe) => pe === "card" || pe === "mobile_money") : U.methods;
3208
+ }), te(() => a(g), () => {
3209
+ T(l, vi(a(g)));
3210
+ }), te(() => G(H()), () => {
3211
+ T(Z, H()?.length ? H() : ["card", "mobile_money"]);
3212
+ }), te(() => (a(i), a(Z)), () => {
3213
+ T(S, (() => {
3214
+ const x = a(i).paymentIntent;
3215
+ if (!x) return [];
3216
+ const W = new Set(a(Z)), Y = (x.availableProviders || []).map((D) => {
3217
+ const oe = D.provider.toLowerCase().includes("hubtel") ? D.methods.filter((le) => le === "card" || le === "mobile_money") : D.methods;
3205
3218
  return {
3206
- ...U,
3207
- methods: ie.filter((pe) => W.has(pe))
3219
+ ...D,
3220
+ methods: oe.filter((le) => W.has(le))
3208
3221
  };
3209
- }).filter((U) => U.methods.length > 0);
3222
+ }).filter((D) => D.methods.length > 0);
3210
3223
  if (Y.length > 0) return Y;
3211
- const oe = C.recommendedPsp.toLowerCase().includes("hubtel") ? a(k).filter((U) => U === "card" || U === "mobile_money") : a(k);
3224
+ const se = x.recommendedPsp.toLowerCase().includes("hubtel") ? a(Z).filter((D) => D === "card" || D === "mobile_money") : a(Z);
3212
3225
  return [
3213
3226
  {
3214
- provider: C.recommendedPsp,
3215
- name: K[C.recommendedPsp] || C.recommendedPsp,
3216
- methods: oe
3227
+ provider: x.recommendedPsp,
3228
+ name: K[x.recommendedPsp] || x.recommendedPsp,
3229
+ methods: se
3217
3230
  }
3218
3231
  ];
3219
3232
  })());
3220
- }), ee(() => (a(x), a(F)), () => {
3221
- a(x).length > 0 && (a(F) && a(x).some((C) => C.provider === a(F)) || (a(x).length === 1 ? A(F, a(x)[0].provider) : A(F, null)));
3222
- }), ee(() => (a(F), a(i)), () => {
3223
- A(M, a(F) || a(i).paymentIntent?.recommendedPsp || "paystack");
3224
- }), ee(
3225
- () => (a(x), a(M), a(k)),
3233
+ }), te(() => (a(S), a(O)), () => {
3234
+ a(S).length > 0 && (a(O) && a(S).some((x) => x.provider === a(O)) || (a(S).length === 1 ? T(O, a(S)[0].provider) : T(O, null)));
3235
+ }), te(() => (a(O), a(i)), () => {
3236
+ T(I, a(O) || a(i).paymentIntent?.recommendedPsp || "paystack");
3237
+ }), te(
3238
+ () => (a(S), a(I), a(Z)),
3226
3239
  () => {
3227
- A(R, (() => {
3228
- const C = a(x).find((W) => W.provider === a(M));
3229
- return C?.methods.length ? C.methods : a(k);
3240
+ T(M, (() => {
3241
+ const x = a(S).find((W) => W.provider === a(I));
3242
+ return x?.methods.length ? x.methods : a(Z);
3230
3243
  })());
3231
3244
  }
3232
- ), ee(() => (a(i), a(R)), () => {
3233
- a(i).selectedMethod && a(R).length > 0 && !a(R).includes(a(i).selectedMethod) && b.selectMethod(a(R)[0]);
3234
- }), ee(() => {
3245
+ ), te(() => (a(i), a(M)), () => {
3246
+ a(i).selectedMethod && a(M).length > 0 && !a(M).includes(a(i).selectedMethod) && b.selectMethod(a(M)[0]);
3247
+ }), te(() => {
3235
3248
  }, () => {
3236
- A(o, b.isLoading());
3237
- }), ee(() => {
3249
+ T(s, b.isLoading());
3250
+ }), te(() => {
3238
3251
  }, () => {
3239
- A(c, b.getStatus() === "processing");
3240
- }), ee(() => {
3252
+ T(c, b.getStatus() === "processing");
3253
+ }), te(() => {
3241
3254
  }, () => {
3242
- A(u, b.getStatus() === "method_selected");
3243
- }), ee(
3244
- () => (G(O()), a(i), a(F), G(h())),
3255
+ T(u, b.getStatus() === "method_selected");
3256
+ }), te(
3257
+ () => (G(L()), a(i), a(O), G(p())),
3245
3258
  () => {
3246
- if (O() && a(i).paymentIntent && a(i).selectedMethod) {
3247
- const W = (a(F) || a(i).paymentIntent.recommendedPsp || "paystack").toLowerCase().includes("mpesa");
3248
- (a(i).selectedMethod === "card" || a(i).selectedMethod === "mobile_money" && (!W || h())) && ae(null);
3259
+ if (L() && a(i).paymentIntent && a(i).selectedMethod) {
3260
+ const W = (a(O) || a(i).paymentIntent.recommendedPsp || "paystack").toLowerCase().includes("mpesa");
3261
+ (a(i).selectedMethod === "card" || a(i).selectedMethod === "mobile_money" && (!W || p())) && _e(null);
3249
3262
  }
3250
3263
  }
3251
- ), ee(() => (G(O()), a(i)), () => {
3252
- O() ? (document.body.style.overflow = "hidden", !a(i).paymentIntent && a(i).status === "idle" && b.initialize()) : typeof document < "u" && (document.body.style.overflow = "");
3253
- }), Bn(), on();
3254
- var ve = Oa(), _t = g(ve);
3255
- Nn(
3256
- _t,
3264
+ ), te(() => (G(L()), a(i)), () => {
3265
+ L() ? (document.body.style.overflow = "hidden", !a(i).paymentIntent && a(i).status === "idle" && b.initialize()) : typeof document < "u" && (document.body.style.overflow = "");
3266
+ }), Gn(), fn();
3267
+ var Ie = Ha(), Ut = E(Ie);
3268
+ Dn(
3269
+ Ut,
3257
3270
  t,
3258
3271
  "default",
3259
3272
  {
3260
- handleOpen: de,
3273
+ handleOpen: V,
3261
3274
  get isLoading() {
3262
- return a(o);
3275
+ return a(s);
3263
3276
  }
3264
3277
  },
3265
- (C) => {
3266
- var W = ga(), Y = g(W);
3278
+ (x) => {
3279
+ var W = ka(), Y = E(W);
3267
3280
  {
3268
- var oe = (ie) => {
3269
- var pe = ba();
3270
- P(ie, pe);
3271
- }, U = (ie) => {
3272
- var pe = ut(), yt = Ke(pe);
3273
- Nn(yt, t, "button-text", {}, (un) => {
3274
- var fn = bs("Pay Now");
3275
- P(un, fn);
3276
- }), P(ie, pe);
3281
+ var se = (oe) => {
3282
+ var le = Sa();
3283
+ P(oe, le);
3284
+ }, D = (oe) => {
3285
+ var le = vt(), gt = Ke(le);
3286
+ Dn(gt, t, "button-text", {}, (vn) => {
3287
+ var pn = Po("Pay Now");
3288
+ P(vn, pn);
3289
+ }), P(oe, le);
3277
3290
  };
3278
- J(Y, (ie) => {
3279
- a(o) ? ie(oe) : ie(U, !1);
3291
+ J(Y, (oe) => {
3292
+ a(s) ? oe(se) : oe(D, !1);
3280
3293
  });
3281
3294
  }
3282
- X(() => W.disabled = a(o)), ce("click", W, de), P(C, W);
3295
+ Q(() => W.disabled = a(s)), fe("click", W, V), P(x, W);
3283
3296
  }
3284
3297
  );
3285
- var Vr = q(_t, 2);
3298
+ var we = U(Ut, 2);
3286
3299
  {
3287
- var Yr = (C) => {
3288
- var W = La(), Y = g(W), oe = g(Y), U = q(oe, 2), ie = g(U), pe = q(U, 2), yt = g(pe);
3300
+ var jt = (x) => {
3301
+ var W = za(), Y = E(W), se = E(Y), D = U(se, 2), oe = E(D), le = E(oe), gt = U(le, 2);
3289
3302
  {
3290
- var un = (ke) => {
3291
- var Ft = wa();
3292
- P(ke, Ft);
3293
- }, fn = (ke) => {
3294
- var Ft = ut(), Gr = Ke(Ft);
3303
+ var vn = (ue) => {
3304
+ var We = Ca(), hn = E(We);
3305
+ Q(() => ve(hn, (a(g), w(() => a(g).companyName)))), P(ue, We);
3306
+ };
3307
+ J(gt, (ue) => {
3308
+ a(g), w(() => a(g).companyName) && ue(vn);
3309
+ });
3310
+ }
3311
+ var pn = U(D, 2), Wr = E(pn);
3312
+ {
3313
+ var Jr = (ue) => {
3314
+ var We = Ia();
3315
+ P(ue, We);
3316
+ }, Zr = (ue) => {
3317
+ var We = vt(), hn = Ke(We);
3295
3318
  {
3296
- var Wr = (it) => {
3297
- var bt = Ea(), Dt = q(g(bt), 4), dn = g(Dt), vn = q(Dt, 2);
3298
- X(() => me(dn, (a(i), w(() => a(i).error.message)))), ce("click", vn, () => b.initialize()), P(it, bt);
3299
- }, Jr = (it) => {
3300
- var bt = ut(), Dt = Ke(bt);
3319
+ var Qr = (st) => {
3320
+ var wt = Ma(), zt = U(E(wt), 4), mn = E(zt), _n = U(zt, 2);
3321
+ Q(() => ve(mn, (a(i), w(() => a(i).error.message)))), fe("click", _n, () => b.initialize()), P(st, wt);
3322
+ }, Xr = (st) => {
3323
+ var wt = vt(), zt = Ke(wt);
3301
3324
  {
3302
- var dn = (st) => {
3303
- var gt = Pa(), pn = q(g(gt), 6);
3304
- ce("click", pn, we), P(st, gt);
3305
- }, vn = (st) => {
3306
- var gt = ut(), pn = Ke(gt);
3325
+ var mn = (lt) => {
3326
+ var Et = xa(), yn = U(E(Et), 6);
3327
+ fe("click", yn, Oe), P(lt, Et);
3328
+ }, _n = (lt) => {
3329
+ var Et = vt(), yn = Ke(Et);
3307
3330
  {
3308
- var Zr = (hn) => {
3309
- var Zn = Na(), Qr = g(Zn);
3331
+ var $r = (bn) => {
3332
+ var $n = ja(), ei = E($n);
3310
3333
  {
3311
- var Xr = (at) => {
3312
- ta(at, {
3334
+ var ti = (ct) => {
3335
+ aa(ct, {
3313
3336
  get providers() {
3314
- return a(x);
3337
+ return a(S);
3315
3338
  },
3316
3339
  get selectedProvider() {
3317
- return a(F);
3340
+ return a(O);
3318
3341
  },
3319
3342
  get disabled() {
3320
- return a(o);
3343
+ return a(s);
3321
3344
  },
3322
3345
  get theme() {
3323
- return a(E);
3346
+ return a(g);
3324
3347
  },
3325
3348
  get selectedMethod() {
3326
3349
  return a(i), w(() => a(i).selectedMethod);
3327
3350
  },
3328
3351
  $$events: {
3329
- select: (Oe) => cn(Oe.detail),
3330
- methodSelect: (Oe) => b.selectMethod(Oe.detail)
3352
+ select: (Fe) => at(Fe.detail),
3353
+ methodSelect: (Fe) => b.selectMethod(Fe.detail)
3331
3354
  },
3332
3355
  $$slots: {
3333
- "method-content": (Oe, mn) => {
3334
- var Ut = Ma(), _n = g(Ut);
3356
+ "method-content": (Fe, gn) => {
3357
+ var Ht = Na(), wn = E(Ht);
3335
3358
  {
3336
- var Ge = (Fe) => {
3337
- var We = Sa(), ot = q(g(We), 2);
3338
- X(() => ot.disabled = a(c)), ce("click", ot, () => ae(null)), P(Fe, We);
3339
- }, jt = (Fe) => {
3340
- var We = ut(), ot = Ke(We);
3359
+ var Je = (De) => {
3360
+ var Ze = Ra(), ut = U(E(Ze), 2);
3361
+ Q(() => ut.disabled = a(c)), fe("click", ut, () => _e(null)), P(De, Ze);
3362
+ }, Bt = (De) => {
3363
+ var Ze = vt(), ut = Ke(Ze);
3341
3364
  {
3342
- var De = (Ue) => {
3343
- var wt = Ia(), yn = g(wt);
3365
+ var Ue = (je) => {
3366
+ var Pt = Aa(), En = E(Pt);
3344
3367
  {
3345
- var Et = (je) => {
3346
- or(je, {
3368
+ var St = (ze) => {
3369
+ ur(ze, {
3347
3370
  get initialPhone() {
3348
- return h();
3371
+ return p();
3349
3372
  },
3350
3373
  get loading() {
3351
3374
  return a(c);
3352
3375
  },
3353
3376
  hideCancel: !0,
3354
- $$events: { submit: (lt) => ae(lt.detail) }
3377
+ $$events: { submit: (ft) => _e(ft.detail) }
3355
3378
  });
3356
- }, bn = (je) => {
3357
- var lt = ka(), Ee = Ke(lt), ct = g(Ee), Pt = q(Ee, 2), gn = g(Pt);
3358
- X(
3359
- (ei, ti) => {
3360
- me(ct, ei), Pt.disabled = a(c), me(gn, ti);
3379
+ }, Pn = (ze) => {
3380
+ var ft = Ta(), Ee = Ke(ft), dt = E(Ee), kt = U(Ee, 2), Sn = E(kt);
3381
+ Q(
3382
+ (ri, ii) => {
3383
+ ve(dt, ri), kt.disabled = a(c), ve(Sn, ii);
3361
3384
  },
3362
3385
  [
3363
- () => (a(M), w(() => a(M).includes("hubtel") ? "Opens the Hubtel checkout with Mobile Money selected." : `Continue to pay securely with Mobile Money via ${K[a(M)] || a(M)}.`)),
3364
- () => (a(M), w(() => a(M).includes("hubtel") ? "Continue with Hubtel" : "Pay with Mobile Money"))
3386
+ () => (a(I), w(() => a(I).includes("hubtel") ? "Opens the Hubtel checkout with Mobile Money selected." : `Continue to pay securely with Mobile Money via ${K[a(I)] || a(I)}.`)),
3387
+ () => (a(I), w(() => a(I).includes("hubtel") ? "Continue with Hubtel" : "Pay with Mobile Money"))
3365
3388
  ]
3366
- ), ce("click", Pt, () => ae(null)), P(je, lt);
3389
+ ), fe("click", kt, () => _e(null)), P(ze, ft);
3367
3390
  };
3368
- J(yn, (je) => {
3369
- a(M), G(h()), w(() => a(M).includes("mpesa") && !h()) ? je(Et) : je(bn, !1);
3391
+ J(En, (ze) => {
3392
+ a(I), G(p()), w(() => a(I).includes("mpesa") && !p()) ? ze(St) : ze(Pn, !1);
3370
3393
  });
3371
3394
  }
3372
- P(Ue, wt);
3395
+ P(je, Pt);
3373
3396
  };
3374
3397
  J(
3375
- ot,
3376
- (Ue) => {
3377
- a(i), w(() => a(i).selectedMethod === "mobile_money") && Ue(De);
3398
+ ut,
3399
+ (je) => {
3400
+ a(i), w(() => a(i).selectedMethod === "mobile_money") && je(Ue);
3378
3401
  },
3379
3402
  !0
3380
3403
  );
3381
3404
  }
3382
- P(Fe, We);
3405
+ P(De, Ze);
3383
3406
  };
3384
- J(_n, (Fe) => {
3385
- a(i), w(() => a(i).selectedMethod === "card") ? Fe(Ge) : Fe(jt, !1);
3407
+ J(wn, (De) => {
3408
+ a(i), w(() => a(i).selectedMethod === "card") ? De(Je) : De(Bt, !1);
3386
3409
  });
3387
3410
  }
3388
- P(Oe, Ut);
3411
+ P(Fe, Ht);
3389
3412
  }
3390
3413
  }
3391
3414
  });
3392
- }, $r = (at) => {
3393
- var Oe = Aa(), mn = Ke(Oe);
3394
- Br(mn, {
3415
+ }, ni = (ct) => {
3416
+ var Fe = Ua(), gn = Ke(Fe);
3417
+ Gr(gn, {
3395
3418
  get methods() {
3396
- return a(R);
3419
+ return a(M);
3397
3420
  },
3398
3421
  get selected() {
3399
3422
  return a(i), w(() => a(i).selectedMethod);
3400
3423
  },
3401
3424
  get amount() {
3402
- return v();
3425
+ return d();
3403
3426
  },
3404
3427
  get currency() {
3405
3428
  return m();
3406
3429
  },
3407
3430
  get provider() {
3408
- return a(M);
3431
+ return a(I);
3409
3432
  },
3410
3433
  layout: "grid",
3411
3434
  showLabel: !1,
3412
- $$events: { select: (Ge) => b.selectMethod(Ge.detail) }
3435
+ $$events: { select: (Je) => b.selectMethod(Je.detail) }
3413
3436
  });
3414
- var Ut = q(mn, 2);
3437
+ var Ht = U(gn, 2);
3415
3438
  {
3416
- var _n = (Ge) => {
3417
- var jt = Ta(), Fe = g(jt);
3439
+ var wn = (Je) => {
3440
+ var Bt = Da(), De = E(Bt);
3418
3441
  {
3419
- var We = (De) => {
3420
- or(De, {
3442
+ var Ze = (Ue) => {
3443
+ ur(Ue, {
3421
3444
  get initialPhone() {
3422
- return h();
3445
+ return p();
3423
3446
  },
3424
3447
  get loading() {
3425
3448
  return a(c);
3426
3449
  },
3427
3450
  $$events: {
3428
- submit: (Ue) => ae(Ue.detail),
3451
+ submit: (je) => _e(je.detail),
3429
3452
  cancel: () => b.selectMethod(null)
3430
3453
  }
3431
3454
  });
3432
- }, ot = (De) => {
3433
- var Ue = Ra(), wt = g(Ue), yn = g(wt), Et = q(wt, 2), bn = g(Et);
3455
+ }, ut = (Ue) => {
3456
+ var je = Fa(), Pt = E(je), En = E(Pt), St = U(Pt, 2), Pn = E(St);
3434
3457
  {
3435
- var je = (Ee) => {
3436
- var ct = Ca();
3437
- P(Ee, ct);
3438
- }, lt = (Ee) => {
3439
- var ct = xa(), Pt = g(ct);
3440
- X((gn) => me(Pt, gn), [
3441
- () => (a(i), a(M), w(() => a(i).selectedMethod === "card" ? "Pay with Card" : a(M).includes("hubtel") ? "Continue with Hubtel" : "Pay with Mobile Money"))
3442
- ]), P(Ee, ct);
3458
+ var ze = (Ee) => {
3459
+ var dt = La();
3460
+ P(Ee, dt);
3461
+ }, ft = (Ee) => {
3462
+ var dt = Oa(), kt = E(dt);
3463
+ Q((Sn) => ve(kt, Sn), [
3464
+ () => (a(i), a(I), w(() => a(i).selectedMethod === "card" ? "Pay with Card" : a(I).includes("hubtel") ? "Continue with Hubtel" : "Pay with Mobile Money"))
3465
+ ]), P(Ee, dt);
3443
3466
  };
3444
- J(bn, (Ee) => {
3445
- a(c) ? Ee(je) : Ee(lt, !1);
3467
+ J(Pn, (Ee) => {
3468
+ a(c) ? Ee(ze) : Ee(ft, !1);
3446
3469
  });
3447
3470
  }
3448
- X(
3471
+ Q(
3449
3472
  (Ee) => {
3450
- me(yn, Ee), Et.disabled = a(c);
3473
+ ve(En, Ee), St.disabled = a(c);
3451
3474
  },
3452
3475
  [
3453
- () => (a(i), a(M), w(() => a(i).selectedMethod === "card" ? "You will be redirected to complete your card payment securely." : a(M).includes("hubtel") ? "Opens the Hubtel checkout with Mobile Money selected." : `Continue to pay securely via ${K[a(M)] || a(M)}.`))
3476
+ () => (a(i), a(I), w(() => a(i).selectedMethod === "card" ? "You will be redirected to complete your card payment securely." : a(I).includes("hubtel") ? "Opens the Hubtel checkout with Mobile Money selected." : `Continue to pay securely via ${K[a(I)] || a(I)}.`))
3454
3477
  ]
3455
- ), ce("click", Et, () => ae(null)), P(De, Ue);
3478
+ ), fe("click", St, () => _e(null)), P(Ue, je);
3456
3479
  };
3457
- J(Fe, (De) => {
3458
- a(i), a(M), G(h()), w(() => a(i).selectedMethod === "mobile_money" && a(M).includes("mpesa") && !h()) ? De(We) : De(ot, !1);
3480
+ J(De, (Ue) => {
3481
+ a(i), a(I), G(p()), w(() => a(i).selectedMethod === "mobile_money" && a(I).includes("mpesa") && !p()) ? Ue(Ze) : Ue(ut, !1);
3459
3482
  });
3460
3483
  }
3461
- P(Ge, jt);
3484
+ P(Je, Bt);
3462
3485
  };
3463
- J(Ut, (Ge) => {
3464
- a(u) && Ge(_n);
3486
+ J(Ht, (Je) => {
3487
+ a(u) && Je(wn);
3465
3488
  });
3466
3489
  }
3467
- P(at, Oe);
3490
+ P(ct, Fe);
3468
3491
  };
3469
- J(Qr, (at) => {
3470
- a(x), w(() => a(x).length > 1) ? at(Xr) : at($r, !1);
3492
+ J(ei, (ct) => {
3493
+ a(S), w(() => a(S).length > 1) ? ct(ti) : ct(ni, !1);
3471
3494
  });
3472
3495
  }
3473
- P(hn, Zn);
3496
+ P(bn, $n);
3474
3497
  };
3475
3498
  J(
3476
- pn,
3477
- (hn) => {
3478
- a(i), a(u), w(() => a(i).status === "ready" || a(u)) && hn(Zr);
3499
+ yn,
3500
+ (bn) => {
3501
+ a(i), a(u), w(() => a(i).status === "ready" || a(u)) && bn($r);
3479
3502
  },
3480
3503
  !0
3481
3504
  );
3482
3505
  }
3483
- P(st, gt);
3506
+ P(lt, Et);
3484
3507
  };
3485
3508
  J(
3486
- Dt,
3487
- (st) => {
3488
- a(i), w(() => a(i).status === "success") ? st(dn) : st(vn, !1);
3509
+ zt,
3510
+ (lt) => {
3511
+ a(i), w(() => a(i).status === "success") ? lt(mn) : lt(_n, !1);
3489
3512
  },
3490
3513
  !0
3491
3514
  );
3492
3515
  }
3493
- P(it, bt);
3516
+ P(st, wt);
3494
3517
  };
3495
3518
  J(
3496
- Gr,
3497
- (it) => {
3498
- a(i), w(() => a(i).status === "failed" && a(i).error) ? it(Wr) : it(Jr, !1);
3519
+ hn,
3520
+ (st) => {
3521
+ a(i), w(() => a(i).status === "failed" && a(i).error) ? st(Qr) : st(Xr, !1);
3499
3522
  },
3500
3523
  !0
3501
3524
  );
3502
3525
  }
3503
- P(ke, Ft);
3526
+ P(ue, We);
3504
3527
  };
3505
- J(yt, (ke) => {
3506
- a(i), w(() => a(i).status === "loading") ? ke(un) : ke(fn, !1);
3528
+ J(Wr, (ue) => {
3529
+ a(i), w(() => a(i).status === "loading") ? ue(Jr) : ue(Zr, !1);
3507
3530
  });
3508
3531
  }
3509
- X(
3510
- (ke) => {
3511
- et(Y, 1, ke), Ln(ie, "src", (a(E), w(() => a(E).logoUrl || "https://i.imgur.com/bzUR5Lm.png")));
3532
+ Q(
3533
+ (ue) => {
3534
+ nt(Y, 1, ue), tn(le, "src", (a(g), w(() => a(g).logoUrl || "https://i.imgur.com/bzUR5Lm.png"))), tn(le, "alt", (a(g), w(() => a(g).companyName || "Reevit")));
3512
3535
  },
3513
3536
  [
3514
- () => $e((G(ue), a(E), w(() => ue("reevit-modal-content", a(E).darkMode && "reevit-modal--dark"))))
3537
+ () => tt((G(de), a(g), w(() => de("reevit-modal-content", a(g).darkMode && "reevit-modal--dark"))))
3515
3538
  ]
3516
- ), ce("click", oe, we), ce("click", W, we), ce("keydown", W, (ke) => ke.key === "Escape" && we()), P(C, W);
3539
+ ), fe("click", se, Oe), fe("click", W, Oe), fe("keydown", W, (ue) => ue.key === "Escape" && Oe()), P(x, W);
3517
3540
  };
3518
- J(Vr, (C) => {
3519
- O() && C(Yr);
3541
+ J(we, (x) => {
3542
+ L() && x(jt);
3520
3543
  });
3521
3544
  }
3522
- X((C) => Jn(ve, C), [
3523
- () => (a(l), w(() => Object.entries(a(l)).map(([C, W]) => `${C}:${W}`).join(";")))
3524
- ]), P(e, ve), nn(), s();
3545
+ Q((x) => Xn(Ie, x), [
3546
+ () => (a(l), w(() => Object.entries(a(l)).map(([x, W]) => `${x}:${W}`).join(";")))
3547
+ ]), P(e, Ie), sn(), o();
3525
3548
  }
3526
3549
  export {
3527
- or as MobileMoneyForm,
3528
- Br as PaymentMethodSelector,
3529
- ta as ProviderSelector,
3530
- Ba as ReevitAPIClient,
3531
- Ha as ReevitCheckout,
3532
- Va as cn,
3533
- za as confirmStripePayment,
3534
- Ya as createInitialState,
3535
- Ga as createReevitClient,
3536
- qs as createReevitStore,
3537
- ma as createStripeInstance,
3538
- Wa as detectCountryFromCurrency,
3539
- Ja as detectNetwork,
3540
- Za as formatAmount,
3541
- Qa as formatPhone,
3542
- ya as initiateMPesaSTKPush,
3543
- ua as loadFlutterwaveScript,
3544
- ja as loadHubtelScript,
3545
- da as loadMonnifyScript,
3546
- ca as loadPaystackScript,
3547
- fa as loadStripeScript,
3548
- ha as openFlutterwaveModal,
3549
- pa as openHubtelPopup,
3550
- _a as openMonnifyModal,
3551
- va as openPaystackPopup,
3552
- Xa as reevitReducer,
3553
- $a as validatePhone
3550
+ ur as MobileMoneyForm,
3551
+ Gr as PaymentMethodSelector,
3552
+ aa as ProviderSelector,
3553
+ Za as ReevitAPIClient,
3554
+ Ga as ReevitCheckout,
3555
+ Qa as cn,
3556
+ Ya as confirmStripePayment,
3557
+ Xa as createInitialState,
3558
+ $a as createReevitClient,
3559
+ Wo as createReevitStore,
3560
+ wa as createStripeInstance,
3561
+ es as detectCountryFromCurrency,
3562
+ ts as detectNetwork,
3563
+ ns as formatAmount,
3564
+ rs as formatPhone,
3565
+ Pa as initiateMPesaSTKPush,
3566
+ ha as loadFlutterwaveScript,
3567
+ Va as loadHubtelScript,
3568
+ _a as loadMonnifyScript,
3569
+ pa as loadPaystackScript,
3570
+ ma as loadStripeScript,
3571
+ ga as openFlutterwaveModal,
3572
+ ba as openHubtelPopup,
3573
+ Ea as openMonnifyModal,
3574
+ ya as openPaystackPopup,
3575
+ is as reevitReducer,
3576
+ os as validatePhone
3554
3577
  };