@44-audio/components 0.1.0-dev.11 → 0.1.0-dev.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2649 @@
1
+ typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
2
+ const on = 1, cn = 2, vn = 16, dn = 1, hn = 4, _n = 8, pn = 16, Vi = 1, Wi = 2, Yi = 4, gn = 1, yn = 2, sr = "[", bt = "[!", Et = "]", Oe = {}, P = Symbol(), wn = "http://www.w3.org/1999/xhtml", lr = !1;
3
+ var Tt = Array.isArray, mn = Array.prototype.indexOf, xt = Array.from, Ze = Object.keys, Ie = Object.defineProperty, me = Object.getOwnPropertyDescriptor, $n = Object.getOwnPropertyDescriptors, bn = Object.prototype, En = Array.prototype, ar = Object.getPrototypeOf, Ut = Object.isExtensible;
4
+ function Gi(e) {
5
+ return typeof e == "function";
6
+ }
7
+ const Ki = () => {
8
+ };
9
+ function ur(e) {
10
+ for (var t = 0; t < e.length; t++)
11
+ e[t]();
12
+ }
13
+ function Tn() {
14
+ var e, t, r = new Promise((n, i) => {
15
+ e = n, t = i;
16
+ });
17
+ return { promise: r, resolve: e, reject: t };
18
+ }
19
+ const B = 2, At = 4, St = 8, De = 16, ae = 32, ge = 64, fr = 128, V = 256, Qe = 512, k = 1024, W = 2048, ye = 4096, Y = 8192, xe = 16384, Ct = 32768, Nt = 65536, Ht = 1 << 17, xn = 1 << 18, Fe = 1 << 19, An = 1 << 20, ht = 1 << 21, Rt = 1 << 22, $e = 1 << 23, ze = Symbol("$state"), or = Symbol("legacy props"), Sn = Symbol(""), Ot = new class extends Error {
20
+ name = "StaleReactionError";
21
+ message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
22
+ }(), Mt = 3, He = 8;
23
+ function Cn() {
24
+ throw new Error("https://svelte.dev/e/await_outside_boundary");
25
+ }
26
+ function cr(e) {
27
+ throw new Error("https://svelte.dev/e/lifecycle_outside_component");
28
+ }
29
+ function Nn() {
30
+ throw new Error("https://svelte.dev/e/async_derived_orphan");
31
+ }
32
+ function Rn(e) {
33
+ throw new Error("https://svelte.dev/e/effect_in_teardown");
34
+ }
35
+ function On() {
36
+ throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
37
+ }
38
+ function Mn(e) {
39
+ throw new Error("https://svelte.dev/e/effect_orphan");
40
+ }
41
+ function Ln() {
42
+ throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
43
+ }
44
+ function In() {
45
+ throw new Error("https://svelte.dev/e/hydration_failed");
46
+ }
47
+ function Pn(e) {
48
+ throw new Error("https://svelte.dev/e/props_invalid_value");
49
+ }
50
+ function kn() {
51
+ throw new Error("https://svelte.dev/e/state_descriptors_fixed");
52
+ }
53
+ function Dn() {
54
+ throw new Error("https://svelte.dev/e/state_prototype_fixed");
55
+ }
56
+ function Fn() {
57
+ throw new Error("https://svelte.dev/e/state_unsafe_mutation");
58
+ }
59
+ function it(e) {
60
+ console.warn("https://svelte.dev/e/hydration_mismatch");
61
+ }
62
+ let A = !1;
63
+ function ie(e) {
64
+ A = e;
65
+ }
66
+ let x;
67
+ function G(e) {
68
+ if (e === null)
69
+ throw it(), Oe;
70
+ return x = e;
71
+ }
72
+ function st() {
73
+ return G(
74
+ /** @type {TemplateNode} */
75
+ /* @__PURE__ */ ue(x)
76
+ );
77
+ }
78
+ function Be(e) {
79
+ if (A) {
80
+ if (/* @__PURE__ */ ue(x) !== null)
81
+ throw it(), Oe;
82
+ x = e;
83
+ }
84
+ }
85
+ function Xi(e = 1) {
86
+ if (A) {
87
+ for (var t = e, r = x; t--; )
88
+ r = /** @type {TemplateNode} */
89
+ /* @__PURE__ */ ue(r);
90
+ x = r;
91
+ }
92
+ }
93
+ function _t() {
94
+ for (var e = 0, t = x; ; ) {
95
+ if (t.nodeType === He) {
96
+ var r = (
97
+ /** @type {Comment} */
98
+ t.data
99
+ );
100
+ if (r === Et) {
101
+ if (e === 0) return t;
102
+ e -= 1;
103
+ } else (r === sr || r === bt) && (e += 1);
104
+ }
105
+ var n = (
106
+ /** @type {TemplateNode} */
107
+ /* @__PURE__ */ ue(t)
108
+ );
109
+ t.remove(), t = n;
110
+ }
111
+ }
112
+ function vr(e) {
113
+ if (!e || e.nodeType !== He)
114
+ throw it(), Oe;
115
+ return (
116
+ /** @type {Comment} */
117
+ e.data
118
+ );
119
+ }
120
+ function dr(e) {
121
+ return e === this.v;
122
+ }
123
+ function jn(e, t) {
124
+ return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
125
+ }
126
+ function hr(e) {
127
+ return !jn(e, this.v);
128
+ }
129
+ let zn = !1, q = null;
130
+ function et(e) {
131
+ q = e;
132
+ }
133
+ function Lt(e, t = !1, r) {
134
+ q = {
135
+ p: q,
136
+ c: null,
137
+ e: null,
138
+ s: e,
139
+ x: null,
140
+ l: null
141
+ };
142
+ }
143
+ function It(e) {
144
+ var t = (
145
+ /** @type {ComponentContext} */
146
+ q
147
+ ), r = t.e;
148
+ if (r !== null) {
149
+ t.e = null;
150
+ for (var n of r)
151
+ Lr(n);
152
+ }
153
+ return e !== void 0 && (t.x = e), q = t.p, e ?? /** @type {T} */
154
+ {};
155
+ }
156
+ function _r() {
157
+ return !0;
158
+ }
159
+ const Bn = /* @__PURE__ */ new WeakMap();
160
+ function qn(e) {
161
+ var t = b;
162
+ if (t === null)
163
+ return T.f |= $e, e;
164
+ if ((t.f & Ct) === 0) {
165
+ if ((t.f & fr) === 0)
166
+ throw !t.parent && e instanceof Error && pr(e), e;
167
+ t.b.error(e);
168
+ } else
169
+ Pt(e, t);
170
+ }
171
+ function Pt(e, t) {
172
+ for (; t !== null; ) {
173
+ if ((t.f & fr) !== 0)
174
+ try {
175
+ t.b.error(e);
176
+ return;
177
+ } catch (r) {
178
+ e = r;
179
+ }
180
+ t = t.parent;
181
+ }
182
+ throw e instanceof Error && pr(e), e;
183
+ }
184
+ function pr(e) {
185
+ const t = Bn.get(e);
186
+ t && (Ie(e, "message", {
187
+ value: t.message
188
+ }), Ie(e, "stack", {
189
+ value: t.stack
190
+ }));
191
+ }
192
+ let Ve = [], pt = [];
193
+ function gr() {
194
+ var e = Ve;
195
+ Ve = [], ur(e);
196
+ }
197
+ function Un() {
198
+ var e = pt;
199
+ pt = [], ur(e);
200
+ }
201
+ function yr(e) {
202
+ Ve.length === 0 && queueMicrotask(gr), Ve.push(e);
203
+ }
204
+ function Hn() {
205
+ Ve.length > 0 && gr(), pt.length > 0 && Un();
206
+ }
207
+ function Vn() {
208
+ const e = (
209
+ /** @type {Effect} */
210
+ b.b
211
+ );
212
+ return e === null && Cn(), e;
213
+ }
214
+ // @__NO_SIDE_EFFECTS__
215
+ function lt(e) {
216
+ var t = B | W, r = T !== null && (T.f & B) !== 0 ? (
217
+ /** @type {Derived} */
218
+ T
219
+ ) : null;
220
+ return b === null || r !== null && (r.f & V) !== 0 ? t |= V : b.f |= Fe, {
221
+ ctx: q,
222
+ deps: null,
223
+ effects: null,
224
+ equals: dr,
225
+ f: t,
226
+ fn: e,
227
+ reactions: null,
228
+ rv: 0,
229
+ v: (
230
+ /** @type {V} */
231
+ P
232
+ ),
233
+ wv: 0,
234
+ parent: r ?? b,
235
+ ac: null
236
+ };
237
+ }
238
+ // @__NO_SIDE_EFFECTS__
239
+ function Wn(e, t) {
240
+ let r = (
241
+ /** @type {Effect | null} */
242
+ b
243
+ );
244
+ r === null && Nn();
245
+ var n = (
246
+ /** @type {Boundary} */
247
+ r.b
248
+ ), i = (
249
+ /** @type {Promise<V>} */
250
+ /** @type {unknown} */
251
+ void 0
252
+ ), s = We(
253
+ /** @type {V} */
254
+ P
255
+ ), l = null, u = !T;
256
+ return ni(() => {
257
+ try {
258
+ var a = e();
259
+ l && Promise.resolve(a).catch(() => {
260
+ });
261
+ } catch (d) {
262
+ a = Promise.reject(d);
263
+ }
264
+ var f = () => a;
265
+ i = l?.then(f, f) ?? Promise.resolve(a), l = i;
266
+ var c = (
267
+ /** @type {Batch} */
268
+ L
269
+ ), h = n.is_pending();
270
+ u && (n.update_pending_count(1), h || c.increment());
271
+ const o = (d, v = void 0) => {
272
+ l = null, h || c.activate(), v ? v !== Ot && (s.f |= $e, rt(s, v)) : ((s.f & $e) !== 0 && (s.f ^= $e), rt(s, d)), u && (n.update_pending_count(-1), h || c.decrement()), br();
273
+ };
274
+ if (i.then(o, (d) => o(null, d || "unknown")), c)
275
+ return () => {
276
+ queueMicrotask(() => c.neuter());
277
+ };
278
+ }), new Promise((a) => {
279
+ function f(c) {
280
+ function h() {
281
+ c === i ? a(s) : f(i);
282
+ }
283
+ c.then(h, h);
284
+ }
285
+ f(i);
286
+ });
287
+ }
288
+ // @__NO_SIDE_EFFECTS__
289
+ function oe(e) {
290
+ const t = /* @__PURE__ */ lt(e);
291
+ return qr(t), t;
292
+ }
293
+ // @__NO_SIDE_EFFECTS__
294
+ function wr(e) {
295
+ const t = /* @__PURE__ */ lt(e);
296
+ return t.equals = hr, t;
297
+ }
298
+ function mr(e) {
299
+ var t = e.effects;
300
+ if (t !== null) {
301
+ e.effects = null;
302
+ for (var r = 0; r < t.length; r += 1)
303
+ Z(
304
+ /** @type {Effect} */
305
+ t[r]
306
+ );
307
+ }
308
+ }
309
+ function Yn(e) {
310
+ for (var t = e.parent; t !== null; ) {
311
+ if ((t.f & B) === 0)
312
+ return (
313
+ /** @type {Effect} */
314
+ t
315
+ );
316
+ t = t.parent;
317
+ }
318
+ return null;
319
+ }
320
+ function kt(e) {
321
+ var t, r = b;
322
+ pe(Yn(e));
323
+ try {
324
+ mr(e), t = Wr(e);
325
+ } finally {
326
+ pe(r);
327
+ }
328
+ return t;
329
+ }
330
+ function $r(e) {
331
+ var t = kt(e);
332
+ if (e.equals(t) || (e.v = t, e.wv = Hr()), !Ae) {
333
+ var r = (de || (e.f & V) !== 0) && e.deps !== null ? ye : k;
334
+ j(e, r);
335
+ }
336
+ }
337
+ function Gn(e, t, r) {
338
+ const n = lt;
339
+ if (t.length === 0) {
340
+ r(e.map(n));
341
+ return;
342
+ }
343
+ var i = L, s = (
344
+ /** @type {Effect} */
345
+ b
346
+ ), l = Kn(), u = Vn();
347
+ Promise.all(t.map((a) => /* @__PURE__ */ Wn(a))).then((a) => {
348
+ i?.activate(), l();
349
+ try {
350
+ r([...e.map(n), ...a]);
351
+ } catch (f) {
352
+ (s.f & xe) === 0 && Pt(f, s);
353
+ }
354
+ i?.deactivate(), br();
355
+ }).catch((a) => {
356
+ u.error(a);
357
+ });
358
+ }
359
+ function Kn() {
360
+ var e = b, t = T, r = q, n = L;
361
+ return function() {
362
+ pe(e), Q(t), et(r), n?.activate();
363
+ };
364
+ }
365
+ function br() {
366
+ pe(null), Q(null), et(null);
367
+ }
368
+ const ot = /* @__PURE__ */ new Set();
369
+ let L = null, Vt = /* @__PURE__ */ new Set(), tt = [];
370
+ function Er() {
371
+ const e = (
372
+ /** @type {() => void} */
373
+ tt.shift()
374
+ );
375
+ tt.length > 0 && queueMicrotask(Er), e();
376
+ }
377
+ let Ee = [], at = null, gt = !1, Ke = !1;
378
+ class Te {
379
+ /**
380
+ * The current values of any sources that are updated in this batch
381
+ * They keys of this map are identical to `this.#previous`
382
+ * @type {Map<Source, any>}
383
+ */
384
+ current = /* @__PURE__ */ new Map();
385
+ /**
386
+ * The values of any sources that are updated in this batch _before_ those updates took place.
387
+ * They keys of this map are identical to `this.#current`
388
+ * @type {Map<Source, any>}
389
+ */
390
+ #t = /* @__PURE__ */ new Map();
391
+ /**
392
+ * When the batch is committed (and the DOM is updated), we need to remove old branches
393
+ * and append new ones by calling the functions added inside (if/each/key/etc) blocks
394
+ * @type {Set<() => void>}
395
+ */
396
+ #e = /* @__PURE__ */ new Set();
397
+ /**
398
+ * The number of async effects that are currently in flight
399
+ */
400
+ #r = 0;
401
+ /**
402
+ * A deferred that resolves when the batch is committed, used with `settled()`
403
+ * TODO replace with Promise.withResolvers once supported widely enough
404
+ * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
405
+ */
406
+ #f = null;
407
+ /**
408
+ * True if an async effect inside this batch resolved and
409
+ * its parent branch was already deleted
410
+ */
411
+ #o = !1;
412
+ /**
413
+ * Async effects (created inside `async_derived`) encountered during processing.
414
+ * These run after the rest of the batch has updated, since they should
415
+ * always have the latest values
416
+ * @type {Effect[]}
417
+ */
418
+ #i = [];
419
+ /**
420
+ * The same as `#async_effects`, but for effects inside a newly-created
421
+ * `<svelte:boundary>` — these do not prevent the batch from committing
422
+ * @type {Effect[]}
423
+ */
424
+ #l = [];
425
+ /**
426
+ * Template effects and `$effect.pre` effects, which run when
427
+ * a batch is committed
428
+ * @type {Effect[]}
429
+ */
430
+ #s = [];
431
+ /**
432
+ * The same as `#render_effects`, but for `$effect` (which runs after)
433
+ * @type {Effect[]}
434
+ */
435
+ #n = [];
436
+ /**
437
+ * Block effects, which may need to re-run on subsequent flushes
438
+ * in order to update internal sources (e.g. each block items)
439
+ * @type {Effect[]}
440
+ */
441
+ #a = [];
442
+ /**
443
+ * Deferred effects (which run after async work has completed) that are DIRTY
444
+ * @type {Effect[]}
445
+ */
446
+ #c = [];
447
+ /**
448
+ * Deferred effects that are MAYBE_DIRTY
449
+ * @type {Effect[]}
450
+ */
451
+ #v = [];
452
+ /**
453
+ * A set of branches that still exist, but will be destroyed when this batch
454
+ * is committed — we skip over these during `process`
455
+ * @type {Set<Effect>}
456
+ */
457
+ skipped_effects = /* @__PURE__ */ new Set();
458
+ /**
459
+ *
460
+ * @param {Effect[]} root_effects
461
+ */
462
+ process(t) {
463
+ Ee = [];
464
+ for (const i of t)
465
+ this.#h(i);
466
+ if (this.#i.length === 0 && this.#r === 0) {
467
+ this.#d();
468
+ var r = this.#s, n = this.#n;
469
+ this.#s = [], this.#n = [], this.#a = [], L = null, Wt(r), Wt(n), L === null ? L = this : ot.delete(this), this.#f?.resolve();
470
+ } else
471
+ this.#u(this.#s), this.#u(this.#n), this.#u(this.#a);
472
+ for (const i of this.#i)
473
+ Le(i);
474
+ for (const i of this.#l)
475
+ Le(i);
476
+ this.#i = [], this.#l = [];
477
+ }
478
+ /**
479
+ * Traverse the effect tree, executing effects or stashing
480
+ * them for later execution as appropriate
481
+ * @param {Effect} root
482
+ */
483
+ #h(t) {
484
+ t.f ^= k;
485
+ for (var r = t.first; r !== null; ) {
486
+ var n = r.f, i = (n & (ae | ge)) !== 0, s = i && (n & k) !== 0, l = s || (n & Y) !== 0 || this.skipped_effects.has(r);
487
+ if (!l && r.fn !== null) {
488
+ if (i)
489
+ r.f ^= k;
490
+ else if ((n & At) !== 0)
491
+ this.#n.push(r);
492
+ else if ((n & k) === 0)
493
+ if ((n & Rt) !== 0) {
494
+ var u = r.b?.is_pending() ? this.#l : this.#i;
495
+ u.push(r);
496
+ } else ut(r) && ((r.f & De) !== 0 && this.#a.push(r), Le(r));
497
+ var a = r.first;
498
+ if (a !== null) {
499
+ r = a;
500
+ continue;
501
+ }
502
+ }
503
+ var f = r.parent;
504
+ for (r = r.next; r === null && f !== null; )
505
+ r = f.next, f = f.parent;
506
+ }
507
+ }
508
+ /**
509
+ * @param {Effect[]} effects
510
+ */
511
+ #u(t) {
512
+ for (const r of t)
513
+ ((r.f & W) !== 0 ? this.#c : this.#v).push(r), j(r, k);
514
+ t.length = 0;
515
+ }
516
+ /**
517
+ * Associate a change to a given source with the current
518
+ * batch, noting its previous and current values
519
+ * @param {Source} source
520
+ * @param {any} value
521
+ */
522
+ capture(t, r) {
523
+ this.#t.has(t) || this.#t.set(t, r), this.current.set(t, t.v);
524
+ }
525
+ activate() {
526
+ L = this;
527
+ }
528
+ deactivate() {
529
+ L = null;
530
+ for (const t of Vt)
531
+ if (Vt.delete(t), t(), L !== null)
532
+ break;
533
+ }
534
+ neuter() {
535
+ this.#o = !0;
536
+ }
537
+ flush() {
538
+ Ee.length > 0 ? Tr() : this.#d(), L === this && (this.#r === 0 && ot.delete(this), this.deactivate());
539
+ }
540
+ /**
541
+ * Append and remove branches to/from the DOM
542
+ */
543
+ #d() {
544
+ if (!this.#o)
545
+ for (const t of this.#e)
546
+ t();
547
+ this.#e.clear();
548
+ }
549
+ increment() {
550
+ this.#r += 1;
551
+ }
552
+ decrement() {
553
+ if (this.#r -= 1, this.#r === 0) {
554
+ for (const t of this.#c)
555
+ j(t, W), Pe(t);
556
+ for (const t of this.#v)
557
+ j(t, ye), Pe(t);
558
+ this.#s = [], this.#n = [], this.flush();
559
+ } else
560
+ this.deactivate();
561
+ }
562
+ /** @param {() => void} fn */
563
+ add_callback(t) {
564
+ this.#e.add(t);
565
+ }
566
+ settled() {
567
+ return (this.#f ??= Tn()).promise;
568
+ }
569
+ static ensure() {
570
+ if (L === null) {
571
+ const t = L = new Te();
572
+ ot.add(L), Ke || Te.enqueue(() => {
573
+ L === t && t.flush();
574
+ });
575
+ }
576
+ return L;
577
+ }
578
+ /** @param {() => void} task */
579
+ static enqueue(t) {
580
+ tt.length === 0 && queueMicrotask(Er), tt.unshift(t);
581
+ }
582
+ }
583
+ function re(e) {
584
+ var t = Ke;
585
+ Ke = !0;
586
+ try {
587
+ for (var r; ; ) {
588
+ if (Hn(), Ee.length === 0 && (L?.flush(), Ee.length === 0))
589
+ return at = null, /** @type {T} */
590
+ r;
591
+ Tr();
592
+ }
593
+ } finally {
594
+ Ke = t;
595
+ }
596
+ }
597
+ function Tr() {
598
+ var e = Me;
599
+ gt = !0;
600
+ try {
601
+ var t = 0;
602
+ for (Gt(!0); Ee.length > 0; ) {
603
+ var r = Te.ensure();
604
+ if (t++ > 1e3) {
605
+ var n, i;
606
+ Jn();
607
+ }
608
+ r.process(Ee), he.clear();
609
+ }
610
+ } finally {
611
+ gt = !1, Gt(e), at = null;
612
+ }
613
+ }
614
+ function Jn() {
615
+ try {
616
+ Ln();
617
+ } catch (e) {
618
+ Pt(e, at);
619
+ }
620
+ }
621
+ let we = null;
622
+ function Wt(e) {
623
+ var t = e.length;
624
+ if (t !== 0) {
625
+ for (var r = 0; r < t; ) {
626
+ var n = e[r++];
627
+ if ((n.f & (xe | Y)) === 0 && ut(n) && (we = [], Le(n), n.deps === null && n.first === null && n.nodes_start === null && (n.teardown === null && n.ac === null ? jr(n) : n.fn = null), we?.length > 0)) {
628
+ he.clear();
629
+ for (const i of we)
630
+ Le(i);
631
+ we = [];
632
+ }
633
+ }
634
+ we = null;
635
+ }
636
+ }
637
+ function Pe(e) {
638
+ for (var t = at = e; t.parent !== null; ) {
639
+ t = t.parent;
640
+ var r = t.f;
641
+ if (gt && t === b && (r & De) !== 0)
642
+ return;
643
+ if ((r & (ge | ae)) !== 0) {
644
+ if ((r & k) === 0) return;
645
+ t.f ^= k;
646
+ }
647
+ }
648
+ Ee.push(t);
649
+ }
650
+ const he = /* @__PURE__ */ new Map();
651
+ function We(e, t) {
652
+ var r = {
653
+ f: 0,
654
+ // TODO ideally we could skip this altogether, but it causes type errors
655
+ v: e,
656
+ reactions: null,
657
+ equals: dr,
658
+ rv: 0,
659
+ wv: 0
660
+ };
661
+ return r;
662
+ }
663
+ // @__NO_SIDE_EFFECTS__
664
+ function F(e, t) {
665
+ const r = We(e);
666
+ return qr(r), r;
667
+ }
668
+ // @__NO_SIDE_EFFECTS__
669
+ function xr(e, t = !1, r = !0) {
670
+ const n = We(e);
671
+ return t || (n.equals = hr), n;
672
+ }
673
+ function M(e, t, r = !1) {
674
+ T !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
675
+ // to ensure we error if state is set inside an inspect effect
676
+ (!J || (T.f & Ht) !== 0) && _r() && (T.f & (B | De | Rt | Ht)) !== 0 && !se?.includes(e) && Fn();
677
+ let n = r ? Re(t) : t;
678
+ return rt(e, n);
679
+ }
680
+ function rt(e, t) {
681
+ if (!e.equals(t)) {
682
+ var r = e.v;
683
+ Ae ? he.set(e, t) : he.set(e, r), e.v = t;
684
+ var n = Te.ensure();
685
+ n.capture(e, r), (e.f & B) !== 0 && ((e.f & W) !== 0 && kt(
686
+ /** @type {Derived} */
687
+ e
688
+ ), j(e, (e.f & V) === 0 ? k : ye)), e.wv = Hr(), Ar(e, W), b !== null && (b.f & k) !== 0 && (b.f & (ae | ge)) === 0 && (H === null ? li([e]) : H.push(e));
689
+ }
690
+ return t;
691
+ }
692
+ function ct(e) {
693
+ M(e, e.v + 1);
694
+ }
695
+ function Ar(e, t) {
696
+ var r = e.reactions;
697
+ if (r !== null)
698
+ for (var n = r.length, i = 0; i < n; i++) {
699
+ var s = r[i], l = s.f, u = (l & W) === 0;
700
+ u && j(s, t), (l & B) !== 0 ? Ar(
701
+ /** @type {Derived} */
702
+ s,
703
+ ye
704
+ ) : u && ((l & De) !== 0 && we !== null && we.push(
705
+ /** @type {Effect} */
706
+ s
707
+ ), Pe(
708
+ /** @type {Effect} */
709
+ s
710
+ ));
711
+ }
712
+ }
713
+ function Re(e) {
714
+ if (typeof e != "object" || e === null || ze in e)
715
+ return e;
716
+ const t = ar(e);
717
+ if (t !== bn && t !== En)
718
+ return e;
719
+ var r = /* @__PURE__ */ new Map(), n = Tt(e), i = /* @__PURE__ */ F(0), s = be, l = (u) => {
720
+ if (be === s)
721
+ return u();
722
+ var a = T, f = be;
723
+ Q(null), Jt(s);
724
+ var c = u();
725
+ return Q(a), Jt(f), c;
726
+ };
727
+ return n && r.set("length", /* @__PURE__ */ F(
728
+ /** @type {any[]} */
729
+ e.length
730
+ )), new Proxy(
731
+ /** @type {any} */
732
+ e,
733
+ {
734
+ defineProperty(u, a, f) {
735
+ (!("value" in f) || f.configurable === !1 || f.enumerable === !1 || f.writable === !1) && kn();
736
+ var c = r.get(a);
737
+ return c === void 0 ? c = l(() => {
738
+ var h = /* @__PURE__ */ F(f.value);
739
+ return r.set(a, h), h;
740
+ }) : M(c, f.value, !0), !0;
741
+ },
742
+ deleteProperty(u, a) {
743
+ var f = r.get(a);
744
+ if (f === void 0) {
745
+ if (a in u) {
746
+ const c = l(() => /* @__PURE__ */ F(P));
747
+ r.set(a, c), ct(i);
748
+ }
749
+ } else
750
+ M(f, P), ct(i);
751
+ return !0;
752
+ },
753
+ get(u, a, f) {
754
+ if (a === ze)
755
+ return e;
756
+ var c = r.get(a), h = a in u;
757
+ if (c === void 0 && (!h || me(u, a)?.writable) && (c = l(() => {
758
+ var d = Re(h ? u[a] : P), v = /* @__PURE__ */ F(d);
759
+ return v;
760
+ }), r.set(a, c)), c !== void 0) {
761
+ var o = p(c);
762
+ return o === P ? void 0 : o;
763
+ }
764
+ return Reflect.get(u, a, f);
765
+ },
766
+ getOwnPropertyDescriptor(u, a) {
767
+ var f = Reflect.getOwnPropertyDescriptor(u, a);
768
+ if (f && "value" in f) {
769
+ var c = r.get(a);
770
+ c && (f.value = p(c));
771
+ } else if (f === void 0) {
772
+ var h = r.get(a), o = h?.v;
773
+ if (h !== void 0 && o !== P)
774
+ return {
775
+ enumerable: !0,
776
+ configurable: !0,
777
+ value: o,
778
+ writable: !0
779
+ };
780
+ }
781
+ return f;
782
+ },
783
+ has(u, a) {
784
+ if (a === ze)
785
+ return !0;
786
+ var f = r.get(a), c = f !== void 0 && f.v !== P || Reflect.has(u, a);
787
+ if (f !== void 0 || b !== null && (!c || me(u, a)?.writable)) {
788
+ f === void 0 && (f = l(() => {
789
+ var o = c ? Re(u[a]) : P, d = /* @__PURE__ */ F(o);
790
+ return d;
791
+ }), r.set(a, f));
792
+ var h = p(f);
793
+ if (h === P)
794
+ return !1;
795
+ }
796
+ return c;
797
+ },
798
+ set(u, a, f, c) {
799
+ var h = r.get(a), o = a in u;
800
+ if (n && a === "length")
801
+ for (var d = f; d < /** @type {Source<number>} */
802
+ h.v; d += 1) {
803
+ var v = r.get(d + "");
804
+ v !== void 0 ? M(v, P) : d in u && (v = l(() => /* @__PURE__ */ F(P)), r.set(d + "", v));
805
+ }
806
+ if (h === void 0)
807
+ (!o || me(u, a)?.writable) && (h = l(() => /* @__PURE__ */ F(void 0)), M(h, Re(f)), r.set(a, h));
808
+ else {
809
+ o = h.v !== P;
810
+ var _ = l(() => Re(f));
811
+ M(h, _);
812
+ }
813
+ var y = Reflect.getOwnPropertyDescriptor(u, a);
814
+ if (y?.set && y.set.call(c, f), !o) {
815
+ if (n && typeof a == "string") {
816
+ var R = (
817
+ /** @type {Source<number>} */
818
+ r.get("length")
819
+ ), g = Number(a);
820
+ Number.isInteger(g) && g >= R.v && M(R, g + 1);
821
+ }
822
+ ct(i);
823
+ }
824
+ return !0;
825
+ },
826
+ ownKeys(u) {
827
+ p(i);
828
+ var a = Reflect.ownKeys(u).filter((h) => {
829
+ var o = r.get(h);
830
+ return o === void 0 || o.v !== P;
831
+ });
832
+ for (var [f, c] of r)
833
+ c.v !== P && !(f in u) && a.push(f);
834
+ return a;
835
+ },
836
+ setPrototypeOf() {
837
+ Dn();
838
+ }
839
+ }
840
+ );
841
+ }
842
+ var Yt, Sr, Cr, Nr;
843
+ function yt() {
844
+ if (Yt === void 0) {
845
+ Yt = window, Sr = /Firefox/.test(navigator.userAgent);
846
+ var e = Element.prototype, t = Node.prototype, r = Text.prototype;
847
+ Cr = me(t, "firstChild").get, Nr = me(t, "nextSibling").get, Ut(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), Ut(r) && (r.__t = void 0);
848
+ }
849
+ }
850
+ function le(e = "") {
851
+ return document.createTextNode(e);
852
+ }
853
+ // @__NO_SIDE_EFFECTS__
854
+ function _e(e) {
855
+ return Cr.call(e);
856
+ }
857
+ // @__NO_SIDE_EFFECTS__
858
+ function ue(e) {
859
+ return Nr.call(e);
860
+ }
861
+ function qe(e, t) {
862
+ if (!A)
863
+ return /* @__PURE__ */ _e(e);
864
+ var r = (
865
+ /** @type {TemplateNode} */
866
+ /* @__PURE__ */ _e(x)
867
+ );
868
+ if (r === null)
869
+ r = x.appendChild(le());
870
+ else if (t && r.nodeType !== Mt) {
871
+ var n = le();
872
+ return r?.before(n), G(n), n;
873
+ }
874
+ return G(r), r;
875
+ }
876
+ function Xn(e, t) {
877
+ if (!A) {
878
+ var r = (
879
+ /** @type {DocumentFragment} */
880
+ /* @__PURE__ */ _e(
881
+ /** @type {Node} */
882
+ e
883
+ )
884
+ );
885
+ return r instanceof Comment && r.data === "" ? /* @__PURE__ */ ue(r) : r;
886
+ }
887
+ return x;
888
+ }
889
+ function vt(e, t = 1, r = !1) {
890
+ let n = A ? x : e;
891
+ for (var i; t--; )
892
+ i = n, n = /** @type {TemplateNode} */
893
+ /* @__PURE__ */ ue(n);
894
+ if (!A)
895
+ return n;
896
+ if (r && n?.nodeType !== Mt) {
897
+ var s = le();
898
+ return n === null ? i?.after(s) : n.before(s), G(s), s;
899
+ }
900
+ return G(n), /** @type {TemplateNode} */
901
+ n;
902
+ }
903
+ function Rr(e) {
904
+ e.textContent = "";
905
+ }
906
+ function Or() {
907
+ return !1;
908
+ }
909
+ function Dt(e) {
910
+ var t = T, r = b;
911
+ Q(null), pe(null);
912
+ try {
913
+ return e();
914
+ } finally {
915
+ Q(t), pe(r);
916
+ }
917
+ }
918
+ function Zn(e) {
919
+ b === null && T === null && Mn(), T !== null && (T.f & V) !== 0 && b === null && On(), Ae && Rn();
920
+ }
921
+ function Qn(e, t) {
922
+ var r = t.last;
923
+ r === null ? t.last = t.first = e : (r.next = e, e.prev = r, t.last = e);
924
+ }
925
+ function ee(e, t, r, n = !0) {
926
+ var i = b;
927
+ i !== null && (i.f & Y) !== 0 && (e |= Y);
928
+ var s = {
929
+ ctx: q,
930
+ deps: null,
931
+ nodes_start: null,
932
+ nodes_end: null,
933
+ f: e | W,
934
+ first: null,
935
+ fn: t,
936
+ last: null,
937
+ next: null,
938
+ parent: i,
939
+ b: i && i.b,
940
+ prev: null,
941
+ teardown: null,
942
+ transitions: null,
943
+ wv: 0,
944
+ ac: null
945
+ };
946
+ if (r)
947
+ try {
948
+ Le(s), s.f |= Ct;
949
+ } catch (a) {
950
+ throw Z(s), a;
951
+ }
952
+ else t !== null && Pe(s);
953
+ if (n) {
954
+ var l = s;
955
+ if (r && l.deps === null && l.teardown === null && l.nodes_start === null && l.first === l.last && // either `null`, or a singular child
956
+ (l.f & Fe) === 0 && (l = l.first), l !== null && (l.parent = i, i !== null && Qn(l, i), T !== null && (T.f & B) !== 0 && (e & ge) === 0)) {
957
+ var u = (
958
+ /** @type {Derived} */
959
+ T
960
+ );
961
+ (u.effects ??= []).push(l);
962
+ }
963
+ }
964
+ return s;
965
+ }
966
+ function Mr(e) {
967
+ const t = ee(St, null, !1);
968
+ return j(t, k), t.teardown = e, t;
969
+ }
970
+ function ei(e) {
971
+ Zn();
972
+ var t = (
973
+ /** @type {Effect} */
974
+ b.f
975
+ ), r = !T && (t & ae) !== 0 && (t & Ct) === 0;
976
+ if (r) {
977
+ var n = (
978
+ /** @type {ComponentContext} */
979
+ q
980
+ );
981
+ (n.e ??= []).push(e);
982
+ } else
983
+ return Lr(e);
984
+ }
985
+ function Lr(e) {
986
+ return ee(At | An, e, !1);
987
+ }
988
+ function ti(e) {
989
+ Te.ensure();
990
+ const t = ee(ge | Fe, e, !0);
991
+ return () => {
992
+ Z(t);
993
+ };
994
+ }
995
+ function ri(e) {
996
+ Te.ensure();
997
+ const t = ee(ge | Fe, e, !0);
998
+ return (r = {}) => new Promise((n) => {
999
+ r.outro ? Ft(t, () => {
1000
+ Z(t), n(void 0);
1001
+ }) : (Z(t), n(void 0));
1002
+ });
1003
+ }
1004
+ function Ir(e) {
1005
+ return ee(At, e, !1);
1006
+ }
1007
+ function ni(e) {
1008
+ return ee(Rt | Fe, e, !0);
1009
+ }
1010
+ function Pr(e, t = 0) {
1011
+ return ee(St | t, e, !0);
1012
+ }
1013
+ function Ue(e, t = [], r = []) {
1014
+ Gn(t, r, (n) => {
1015
+ ee(St, () => e(...n.map(p)), !0);
1016
+ });
1017
+ }
1018
+ function kr(e, t = 0) {
1019
+ var r = ee(De | t, e, !0);
1020
+ return r;
1021
+ }
1022
+ function ke(e, t = !0) {
1023
+ return ee(ae | Fe, e, !0, t);
1024
+ }
1025
+ function Dr(e) {
1026
+ var t = e.teardown;
1027
+ if (t !== null) {
1028
+ const r = Ae, n = T;
1029
+ Kt(!0), Q(null);
1030
+ try {
1031
+ t.call(null);
1032
+ } finally {
1033
+ Kt(r), Q(n);
1034
+ }
1035
+ }
1036
+ }
1037
+ function Fr(e, t = !1) {
1038
+ var r = e.first;
1039
+ for (e.first = e.last = null; r !== null; ) {
1040
+ const i = r.ac;
1041
+ i !== null && Dt(() => {
1042
+ i.abort(Ot);
1043
+ });
1044
+ var n = r.next;
1045
+ (r.f & ge) !== 0 ? r.parent = null : Z(r, t), r = n;
1046
+ }
1047
+ }
1048
+ function ii(e) {
1049
+ for (var t = e.first; t !== null; ) {
1050
+ var r = t.next;
1051
+ (t.f & ae) === 0 && Z(t), t = r;
1052
+ }
1053
+ }
1054
+ function Z(e, t = !0) {
1055
+ var r = !1;
1056
+ (t || (e.f & xn) !== 0) && e.nodes_start !== null && e.nodes_end !== null && (si(
1057
+ e.nodes_start,
1058
+ /** @type {TemplateNode} */
1059
+ e.nodes_end
1060
+ ), r = !0), Fr(e, t && !r), nt(e, 0), j(e, xe);
1061
+ var n = e.transitions;
1062
+ if (n !== null)
1063
+ for (const s of n)
1064
+ s.stop();
1065
+ Dr(e);
1066
+ var i = e.parent;
1067
+ i !== null && i.first !== null && jr(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes_start = e.nodes_end = e.ac = null;
1068
+ }
1069
+ function si(e, t) {
1070
+ for (; e !== null; ) {
1071
+ var r = e === t ? null : (
1072
+ /** @type {TemplateNode} */
1073
+ /* @__PURE__ */ ue(e)
1074
+ );
1075
+ e.remove(), e = r;
1076
+ }
1077
+ }
1078
+ function jr(e) {
1079
+ var t = e.parent, r = e.prev, n = e.next;
1080
+ r !== null && (r.next = n), n !== null && (n.prev = r), t !== null && (t.first === e && (t.first = n), t.last === e && (t.last = r));
1081
+ }
1082
+ function Ft(e, t) {
1083
+ var r = [];
1084
+ jt(e, r, !0), zr(r, () => {
1085
+ Z(e), t && t();
1086
+ });
1087
+ }
1088
+ function zr(e, t) {
1089
+ var r = e.length;
1090
+ if (r > 0) {
1091
+ var n = () => --r || t();
1092
+ for (var i of e)
1093
+ i.out(n);
1094
+ } else
1095
+ t();
1096
+ }
1097
+ function jt(e, t, r) {
1098
+ if ((e.f & Y) === 0) {
1099
+ if (e.f ^= Y, e.transitions !== null)
1100
+ for (const l of e.transitions)
1101
+ (l.is_global || r) && t.push(l);
1102
+ for (var n = e.first; n !== null; ) {
1103
+ var i = n.next, s = (n.f & Nt) !== 0 || (n.f & ae) !== 0;
1104
+ jt(n, t, s ? r : !1), n = i;
1105
+ }
1106
+ }
1107
+ }
1108
+ function zt(e) {
1109
+ Br(e, !0);
1110
+ }
1111
+ function Br(e, t) {
1112
+ if ((e.f & Y) !== 0) {
1113
+ e.f ^= Y, (e.f & k) === 0 && (j(e, W), Pe(e));
1114
+ for (var r = e.first; r !== null; ) {
1115
+ var n = r.next, i = (r.f & Nt) !== 0 || (r.f & ae) !== 0;
1116
+ Br(r, i ? t : !1), r = n;
1117
+ }
1118
+ if (e.transitions !== null)
1119
+ for (const s of e.transitions)
1120
+ (s.is_global || t) && s.in();
1121
+ }
1122
+ }
1123
+ let Me = !1;
1124
+ function Gt(e) {
1125
+ Me = e;
1126
+ }
1127
+ let Ae = !1;
1128
+ function Kt(e) {
1129
+ Ae = e;
1130
+ }
1131
+ let T = null, J = !1;
1132
+ function Q(e) {
1133
+ T = e;
1134
+ }
1135
+ let b = null;
1136
+ function pe(e) {
1137
+ b = e;
1138
+ }
1139
+ let se = null;
1140
+ function qr(e) {
1141
+ T !== null && (se === null ? se = [e] : se.push(e));
1142
+ }
1143
+ let D = null, z = 0, H = null;
1144
+ function li(e) {
1145
+ H = e;
1146
+ }
1147
+ let Ur = 1, Ye = 0, be = Ye;
1148
+ function Jt(e) {
1149
+ be = e;
1150
+ }
1151
+ let de = !1;
1152
+ function Hr() {
1153
+ return ++Ur;
1154
+ }
1155
+ function ut(e) {
1156
+ var t = e.f;
1157
+ if ((t & W) !== 0)
1158
+ return !0;
1159
+ if ((t & ye) !== 0) {
1160
+ var r = e.deps, n = (t & V) !== 0;
1161
+ if (r !== null) {
1162
+ var i, s, l = (t & Qe) !== 0, u = n && b !== null && !de, a = r.length;
1163
+ if ((l || u) && (b === null || (b.f & xe) === 0)) {
1164
+ var f = (
1165
+ /** @type {Derived} */
1166
+ e
1167
+ ), c = f.parent;
1168
+ for (i = 0; i < a; i++)
1169
+ s = r[i], (l || !s?.reactions?.includes(f)) && (s.reactions ??= []).push(f);
1170
+ l && (f.f ^= Qe), u && c !== null && (c.f & V) === 0 && (f.f ^= V);
1171
+ }
1172
+ for (i = 0; i < a; i++)
1173
+ if (s = r[i], ut(
1174
+ /** @type {Derived} */
1175
+ s
1176
+ ) && $r(
1177
+ /** @type {Derived} */
1178
+ s
1179
+ ), s.wv > e.wv)
1180
+ return !0;
1181
+ }
1182
+ (!n || b !== null && !de) && j(e, k);
1183
+ }
1184
+ return !1;
1185
+ }
1186
+ function Vr(e, t, r = !0) {
1187
+ var n = e.reactions;
1188
+ if (n !== null && !se?.includes(e))
1189
+ for (var i = 0; i < n.length; i++) {
1190
+ var s = n[i];
1191
+ (s.f & B) !== 0 ? Vr(
1192
+ /** @type {Derived} */
1193
+ s,
1194
+ t,
1195
+ !1
1196
+ ) : t === s && (r ? j(s, W) : (s.f & k) !== 0 && j(s, ye), Pe(
1197
+ /** @type {Effect} */
1198
+ s
1199
+ ));
1200
+ }
1201
+ }
1202
+ function Wr(e) {
1203
+ var t = D, r = z, n = H, i = T, s = de, l = se, u = q, a = J, f = be, c = e.f;
1204
+ D = /** @type {null | Value[]} */
1205
+ null, z = 0, H = null, de = (c & V) !== 0 && (J || !Me || T === null), T = (c & (ae | ge)) === 0 ? e : null, se = null, et(e.ctx), J = !1, be = ++Ye, e.ac !== null && (Dt(() => {
1206
+ e.ac.abort(Ot);
1207
+ }), e.ac = null);
1208
+ try {
1209
+ e.f |= ht;
1210
+ var h = (
1211
+ /** @type {Function} */
1212
+ e.fn
1213
+ ), o = h(), d = e.deps;
1214
+ if (D !== null) {
1215
+ var v;
1216
+ if (nt(e, z), d !== null && z > 0)
1217
+ for (d.length = z + D.length, v = 0; v < D.length; v++)
1218
+ d[z + v] = D[v];
1219
+ else
1220
+ e.deps = d = D;
1221
+ if (!de || // Deriveds that already have reactions can cleanup, so we still add them as reactions
1222
+ (c & B) !== 0 && /** @type {import('#client').Derived} */
1223
+ e.reactions !== null)
1224
+ for (v = z; v < d.length; v++)
1225
+ (d[v].reactions ??= []).push(e);
1226
+ } else d !== null && z < d.length && (nt(e, z), d.length = z);
1227
+ if (_r() && H !== null && !J && d !== null && (e.f & (B | ye | W)) === 0)
1228
+ for (v = 0; v < /** @type {Source[]} */
1229
+ H.length; v++)
1230
+ Vr(
1231
+ H[v],
1232
+ /** @type {Effect} */
1233
+ e
1234
+ );
1235
+ return i !== null && i !== e && (Ye++, H !== null && (n === null ? n = H : n.push(.../** @type {Source[]} */
1236
+ H))), (e.f & $e) !== 0 && (e.f ^= $e), o;
1237
+ } catch (_) {
1238
+ return qn(_);
1239
+ } finally {
1240
+ e.f ^= ht, D = t, z = r, H = n, T = i, de = s, se = l, et(u), J = a, be = f;
1241
+ }
1242
+ }
1243
+ function ai(e, t) {
1244
+ let r = t.reactions;
1245
+ if (r !== null) {
1246
+ var n = mn.call(r, e);
1247
+ if (n !== -1) {
1248
+ var i = r.length - 1;
1249
+ i === 0 ? r = t.reactions = null : (r[n] = r[i], r.pop());
1250
+ }
1251
+ }
1252
+ r === null && (t.f & B) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1253
+ // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1254
+ // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1255
+ (D === null || !D.includes(t)) && (j(t, ye), (t.f & (V | Qe)) === 0 && (t.f ^= Qe), mr(
1256
+ /** @type {Derived} **/
1257
+ t
1258
+ ), nt(
1259
+ /** @type {Derived} **/
1260
+ t,
1261
+ 0
1262
+ ));
1263
+ }
1264
+ function nt(e, t) {
1265
+ var r = e.deps;
1266
+ if (r !== null)
1267
+ for (var n = t; n < r.length; n++)
1268
+ ai(e, r[n]);
1269
+ }
1270
+ function Le(e) {
1271
+ var t = e.f;
1272
+ if ((t & xe) === 0) {
1273
+ j(e, k);
1274
+ var r = b, n = Me;
1275
+ b = e, Me = !0;
1276
+ try {
1277
+ (t & De) !== 0 ? ii(e) : Fr(e), Dr(e);
1278
+ var i = Wr(e);
1279
+ e.teardown = typeof i == "function" ? i : null, e.wv = Ur;
1280
+ var s;
1281
+ lr && zn && (e.f & W) !== 0 && e.deps;
1282
+ } finally {
1283
+ Me = n, b = r;
1284
+ }
1285
+ }
1286
+ }
1287
+ function p(e) {
1288
+ var t = e.f, r = (t & B) !== 0;
1289
+ if (T !== null && !J) {
1290
+ var n = b !== null && (b.f & xe) !== 0;
1291
+ if (!n && !se?.includes(e)) {
1292
+ var i = T.deps;
1293
+ if ((T.f & ht) !== 0)
1294
+ e.rv < Ye && (e.rv = Ye, D === null && i !== null && i[z] === e ? z++ : D === null ? D = [e] : (!de || !D.includes(e)) && D.push(e));
1295
+ else {
1296
+ (T.deps ??= []).push(e);
1297
+ var s = e.reactions;
1298
+ s === null ? e.reactions = [T] : s.includes(T) || s.push(T);
1299
+ }
1300
+ }
1301
+ } else if (r && /** @type {Derived} */
1302
+ e.deps === null && /** @type {Derived} */
1303
+ e.effects === null) {
1304
+ var l = (
1305
+ /** @type {Derived} */
1306
+ e
1307
+ ), u = l.parent;
1308
+ u !== null && (u.f & V) === 0 && (l.f ^= V);
1309
+ }
1310
+ if (Ae) {
1311
+ if (he.has(e))
1312
+ return he.get(e);
1313
+ if (r) {
1314
+ l = /** @type {Derived} */
1315
+ e;
1316
+ var a = l.v;
1317
+ return ((l.f & k) === 0 && l.reactions !== null || Yr(l)) && (a = kt(l)), he.set(l, a), a;
1318
+ }
1319
+ } else r && (l = /** @type {Derived} */
1320
+ e, ut(l) && $r(l));
1321
+ if ((e.f & $e) !== 0)
1322
+ throw e.v;
1323
+ return e.v;
1324
+ }
1325
+ function Yr(e) {
1326
+ if (e.v === P) return !0;
1327
+ if (e.deps === null) return !1;
1328
+ for (const t of e.deps)
1329
+ if (he.has(t) || (t.f & B) !== 0 && Yr(
1330
+ /** @type {Derived} */
1331
+ t
1332
+ ))
1333
+ return !0;
1334
+ return !1;
1335
+ }
1336
+ function ft(e) {
1337
+ var t = J;
1338
+ try {
1339
+ return J = !0, e();
1340
+ } finally {
1341
+ J = t;
1342
+ }
1343
+ }
1344
+ const ui = -7169;
1345
+ function j(e, t) {
1346
+ e.f = e.f & ui | t;
1347
+ }
1348
+ const Gr = /* @__PURE__ */ new Set(), wt = /* @__PURE__ */ new Set();
1349
+ function fi(e, t, r, n = {}) {
1350
+ function i(s) {
1351
+ if (n.capture || je.call(t, s), !s.cancelBubble)
1352
+ return Dt(() => r?.call(this, s));
1353
+ }
1354
+ return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? yr(() => {
1355
+ t.addEventListener(e, i, n);
1356
+ }) : t.addEventListener(e, i, n), i;
1357
+ }
1358
+ function oi(e, t, r, n, i) {
1359
+ var s = { capture: n, passive: i }, l = fi(e, t, r, s);
1360
+ (t === document.body || // @ts-ignore
1361
+ t === window || // @ts-ignore
1362
+ t === document || // Firefox has quirky behavior, it can happen that we still get "canplay" events when the element is already removed
1363
+ t instanceof HTMLMediaElement) && Mr(() => {
1364
+ t.removeEventListener(e, l, s);
1365
+ });
1366
+ }
1367
+ function ci(e) {
1368
+ for (var t = 0; t < e.length; t++)
1369
+ Gr.add(e[t]);
1370
+ for (var r of wt)
1371
+ r(e);
1372
+ }
1373
+ let Xt = null;
1374
+ function je(e) {
1375
+ var t = this, r = (
1376
+ /** @type {Node} */
1377
+ t.ownerDocument
1378
+ ), n = e.type, i = e.composedPath?.() || [], s = (
1379
+ /** @type {null | Element} */
1380
+ i[0] || e.target
1381
+ );
1382
+ Xt = e;
1383
+ var l = 0, u = Xt === e && e.__root;
1384
+ if (u) {
1385
+ var a = i.indexOf(u);
1386
+ if (a !== -1 && (t === document || t === /** @type {any} */
1387
+ window)) {
1388
+ e.__root = t;
1389
+ return;
1390
+ }
1391
+ var f = i.indexOf(t);
1392
+ if (f === -1)
1393
+ return;
1394
+ a <= f && (l = a);
1395
+ }
1396
+ if (s = /** @type {Element} */
1397
+ i[l] || e.target, s !== t) {
1398
+ Ie(e, "currentTarget", {
1399
+ configurable: !0,
1400
+ get() {
1401
+ return s || r;
1402
+ }
1403
+ });
1404
+ var c = T, h = b;
1405
+ Q(null), pe(null);
1406
+ try {
1407
+ for (var o, d = []; s !== null; ) {
1408
+ var v = s.assignedSlot || s.parentNode || /** @type {any} */
1409
+ s.host || null;
1410
+ try {
1411
+ var _ = s["__" + n];
1412
+ if (_ != null && (!/** @type {any} */
1413
+ s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1414
+ // -> the target could not have been disabled because it emits the event in the first place
1415
+ e.target === s))
1416
+ if (Tt(_)) {
1417
+ var [y, ...R] = _;
1418
+ y.apply(s, [e, ...R]);
1419
+ } else
1420
+ _.call(s, e);
1421
+ } catch (g) {
1422
+ o ? d.push(g) : o = g;
1423
+ }
1424
+ if (e.cancelBubble || v === t || v === null)
1425
+ break;
1426
+ s = v;
1427
+ }
1428
+ if (o) {
1429
+ for (let g of d)
1430
+ queueMicrotask(() => {
1431
+ throw g;
1432
+ });
1433
+ throw o;
1434
+ }
1435
+ } finally {
1436
+ e.__root = t, delete e.currentTarget, Q(c), pe(h);
1437
+ }
1438
+ }
1439
+ }
1440
+ function Kr(e) {
1441
+ var t = document.createElement("template");
1442
+ return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
1443
+ }
1444
+ function X(e, t) {
1445
+ var r = (
1446
+ /** @type {Effect} */
1447
+ b
1448
+ );
1449
+ r.nodes_start === null && (r.nodes_start = e, r.nodes_end = t);
1450
+ }
1451
+ // @__NO_SIDE_EFFECTS__
1452
+ function Jr(e, t) {
1453
+ var r = (t & gn) !== 0, n = (t & yn) !== 0, i, s = !e.startsWith("<!>");
1454
+ return () => {
1455
+ if (A)
1456
+ return X(x, null), x;
1457
+ i === void 0 && (i = Kr(s ? e : "<!>" + e), r || (i = /** @type {Node} */
1458
+ /* @__PURE__ */ _e(i)));
1459
+ var l = (
1460
+ /** @type {TemplateNode} */
1461
+ n || Sr ? document.importNode(i, !0) : i.cloneNode(!0)
1462
+ );
1463
+ if (r) {
1464
+ var u = (
1465
+ /** @type {TemplateNode} */
1466
+ /* @__PURE__ */ _e(l)
1467
+ ), a = (
1468
+ /** @type {TemplateNode} */
1469
+ l.lastChild
1470
+ );
1471
+ X(u, a);
1472
+ } else
1473
+ X(l, l);
1474
+ return l;
1475
+ };
1476
+ }
1477
+ // @__NO_SIDE_EFFECTS__
1478
+ function vi(e, t, r = "svg") {
1479
+ var n = !e.startsWith("<!>"), i = `<${r}>${n ? e : "<!>" + e}</${r}>`, s;
1480
+ return () => {
1481
+ if (A)
1482
+ return X(x, null), x;
1483
+ if (!s) {
1484
+ var l = (
1485
+ /** @type {DocumentFragment} */
1486
+ Kr(i)
1487
+ ), u = (
1488
+ /** @type {Element} */
1489
+ /* @__PURE__ */ _e(l)
1490
+ );
1491
+ s = /** @type {Element} */
1492
+ /* @__PURE__ */ _e(u);
1493
+ }
1494
+ var a = (
1495
+ /** @type {TemplateNode} */
1496
+ s.cloneNode(!0)
1497
+ );
1498
+ return X(a, a), a;
1499
+ };
1500
+ }
1501
+ // @__NO_SIDE_EFFECTS__
1502
+ function Bt(e, t) {
1503
+ return /* @__PURE__ */ vi(e, t, "svg");
1504
+ }
1505
+ function Zt(e = "") {
1506
+ if (!A) {
1507
+ var t = le(e + "");
1508
+ return X(t, t), t;
1509
+ }
1510
+ var r = x;
1511
+ return r.nodeType !== Mt && (r.before(r = le()), G(r)), X(r, r), r;
1512
+ }
1513
+ function di() {
1514
+ if (A)
1515
+ return X(x, null), x;
1516
+ var e = document.createDocumentFragment(), t = document.createComment(""), r = le();
1517
+ return e.append(t, r), X(t, r), e;
1518
+ }
1519
+ function ne(e, t) {
1520
+ if (A) {
1521
+ b.nodes_end = x, st();
1522
+ return;
1523
+ }
1524
+ e !== null && e.before(
1525
+ /** @type {Node} */
1526
+ t
1527
+ );
1528
+ }
1529
+ const hi = ["touchstart", "touchmove"];
1530
+ function _i(e) {
1531
+ return hi.includes(e);
1532
+ }
1533
+ let Qt = !0;
1534
+ function er(e, t) {
1535
+ var r = t == null ? "" : typeof t == "object" ? t + "" : t;
1536
+ r !== (e.__t ??= e.nodeValue) && (e.__t = r, e.nodeValue = r + "");
1537
+ }
1538
+ function Xr(e, t) {
1539
+ return Zr(e, t);
1540
+ }
1541
+ function pi(e, t) {
1542
+ yt(), t.intro = t.intro ?? !1;
1543
+ const r = t.target, n = A, i = x;
1544
+ try {
1545
+ for (var s = (
1546
+ /** @type {TemplateNode} */
1547
+ /* @__PURE__ */ _e(r)
1548
+ ); s && (s.nodeType !== He || /** @type {Comment} */
1549
+ s.data !== sr); )
1550
+ s = /** @type {TemplateNode} */
1551
+ /* @__PURE__ */ ue(s);
1552
+ if (!s)
1553
+ throw Oe;
1554
+ ie(!0), G(
1555
+ /** @type {Comment} */
1556
+ s
1557
+ ), st();
1558
+ const l = Zr(e, { ...t, anchor: s });
1559
+ if (x === null || x.nodeType !== He || /** @type {Comment} */
1560
+ x.data !== Et)
1561
+ throw it(), Oe;
1562
+ return ie(!1), /** @type {Exports} */
1563
+ l;
1564
+ } catch (l) {
1565
+ if (l instanceof Error && l.message.split(`
1566
+ `).some((u) => u.startsWith("https://svelte.dev/e/")))
1567
+ throw l;
1568
+ return l !== Oe && console.warn("Failed to hydrate: ", l), t.recover === !1 && In(), yt(), Rr(r), ie(!1), Xr(e, t);
1569
+ } finally {
1570
+ ie(n), G(i);
1571
+ }
1572
+ }
1573
+ const Ne = /* @__PURE__ */ new Map();
1574
+ function Zr(e, { target: t, anchor: r, props: n = {}, events: i, context: s, intro: l = !0 }) {
1575
+ yt();
1576
+ var u = /* @__PURE__ */ new Set(), a = (h) => {
1577
+ for (var o = 0; o < h.length; o++) {
1578
+ var d = h[o];
1579
+ if (!u.has(d)) {
1580
+ u.add(d);
1581
+ var v = _i(d);
1582
+ t.addEventListener(d, je, { passive: v });
1583
+ var _ = Ne.get(d);
1584
+ _ === void 0 ? (document.addEventListener(d, je, { passive: v }), Ne.set(d, 1)) : Ne.set(d, _ + 1);
1585
+ }
1586
+ }
1587
+ };
1588
+ a(xt(Gr)), wt.add(a);
1589
+ var f = void 0, c = ri(() => {
1590
+ var h = r ?? t.appendChild(le());
1591
+ return ke(() => {
1592
+ if (s) {
1593
+ Lt({});
1594
+ var o = (
1595
+ /** @type {ComponentContext} */
1596
+ q
1597
+ );
1598
+ o.c = s;
1599
+ }
1600
+ i && (n.$$events = i), A && X(
1601
+ /** @type {TemplateNode} */
1602
+ h,
1603
+ null
1604
+ ), Qt = l, f = e(h, n) || {}, Qt = !0, A && (b.nodes_end = x), s && It();
1605
+ }), () => {
1606
+ for (var o of u) {
1607
+ t.removeEventListener(o, je);
1608
+ var d = (
1609
+ /** @type {number} */
1610
+ Ne.get(o)
1611
+ );
1612
+ --d === 0 ? (document.removeEventListener(o, je), Ne.delete(o)) : Ne.set(o, d);
1613
+ }
1614
+ wt.delete(a), h !== r && h.parentNode?.removeChild(h);
1615
+ };
1616
+ });
1617
+ return mt.set(f, c), f;
1618
+ }
1619
+ let mt = /* @__PURE__ */ new WeakMap();
1620
+ function gi(e, t) {
1621
+ const r = mt.get(e);
1622
+ return r ? (mt.delete(e), r(t)) : Promise.resolve();
1623
+ }
1624
+ function Qr(e) {
1625
+ q === null && cr(), ei(() => {
1626
+ const t = ft(e);
1627
+ if (typeof t == "function") return (
1628
+ /** @type {() => void} */
1629
+ t
1630
+ );
1631
+ });
1632
+ }
1633
+ function Zi(e) {
1634
+ q === null && cr(), Qr(() => () => ft(e));
1635
+ }
1636
+ function Je(e, t, r = !1) {
1637
+ A && st();
1638
+ var n = e, i = null, s = null, l = P, u = r ? Nt : 0, a = !1;
1639
+ const f = (d, v = !0) => {
1640
+ a = !0, o(v, d);
1641
+ };
1642
+ var c = null;
1643
+ function h() {
1644
+ c !== null && (c.lastChild.remove(), n.before(c), c = null);
1645
+ var d = l ? i : s, v = l ? s : i;
1646
+ d && zt(d), v && Ft(v, () => {
1647
+ l ? s = null : i = null;
1648
+ });
1649
+ }
1650
+ const o = (d, v) => {
1651
+ if (l === (l = d)) return;
1652
+ let _ = !1;
1653
+ if (A) {
1654
+ const C = vr(n) === bt;
1655
+ !!l === C && (n = _t(), G(n), ie(!1), _ = !0);
1656
+ }
1657
+ var y = Or(), R = n;
1658
+ if (y && (c = document.createDocumentFragment(), c.append(R = le())), l ? i ??= v && ke(() => v(R)) : s ??= v && ke(() => v(R)), y) {
1659
+ var g = (
1660
+ /** @type {Batch} */
1661
+ L
1662
+ ), w = l ? i : s, E = l ? s : i;
1663
+ w && g.skipped_effects.delete(w), E && g.skipped_effects.add(E), g.add_callback(h);
1664
+ } else
1665
+ h();
1666
+ _ && ie(!0);
1667
+ };
1668
+ kr(() => {
1669
+ a = !1, t(f), a || o(null, null);
1670
+ }, u), A && (n = x);
1671
+ }
1672
+ function yi(e, t) {
1673
+ return t;
1674
+ }
1675
+ function wi(e, t, r) {
1676
+ for (var n = e.items, i = [], s = t.length, l = 0; l < s; l++)
1677
+ jt(t[l].e, i, !0);
1678
+ var u = s > 0 && i.length === 0 && r !== null;
1679
+ if (u) {
1680
+ var a = (
1681
+ /** @type {Element} */
1682
+ /** @type {Element} */
1683
+ r.parentNode
1684
+ );
1685
+ Rr(a), a.append(
1686
+ /** @type {Element} */
1687
+ r
1688
+ ), n.clear(), K(e, t[0].prev, t[s - 1].next);
1689
+ }
1690
+ zr(i, () => {
1691
+ for (var f = 0; f < s; f++) {
1692
+ var c = t[f];
1693
+ u || (n.delete(c.k), K(e, c.prev, c.next)), Z(c.e, !u);
1694
+ }
1695
+ });
1696
+ }
1697
+ function mi(e, t, r, n, i, s = null) {
1698
+ var l = e, u = { flags: t, items: /* @__PURE__ */ new Map(), first: null };
1699
+ A && st();
1700
+ var a = null, f = !1, c = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ wr(() => {
1701
+ var _ = r();
1702
+ return Tt(_) ? _ : _ == null ? [] : xt(_);
1703
+ }), o, d;
1704
+ function v() {
1705
+ $i(
1706
+ d,
1707
+ o,
1708
+ u,
1709
+ c,
1710
+ l,
1711
+ i,
1712
+ t,
1713
+ n,
1714
+ r
1715
+ ), s !== null && (o.length === 0 ? a ? zt(a) : a = ke(() => s(l)) : a !== null && Ft(a, () => {
1716
+ a = null;
1717
+ }));
1718
+ }
1719
+ kr(() => {
1720
+ d ??= /** @type {Effect} */
1721
+ b, o = /** @type {V[]} */
1722
+ p(h);
1723
+ var _ = o.length;
1724
+ if (f && _ === 0)
1725
+ return;
1726
+ f = _ === 0;
1727
+ let y = !1;
1728
+ if (A) {
1729
+ var R = vr(l) === bt;
1730
+ R !== (_ === 0) && (l = _t(), G(l), ie(!1), y = !0);
1731
+ }
1732
+ if (A) {
1733
+ for (var g = null, w, E = 0; E < _; E++) {
1734
+ if (x.nodeType === He && /** @type {Comment} */
1735
+ x.data === Et) {
1736
+ l = /** @type {Comment} */
1737
+ x, y = !0, ie(!1);
1738
+ break;
1739
+ }
1740
+ var C = o[E], I = n(C, E);
1741
+ w = $t(
1742
+ x,
1743
+ u,
1744
+ g,
1745
+ null,
1746
+ C,
1747
+ I,
1748
+ E,
1749
+ i,
1750
+ t,
1751
+ r
1752
+ ), u.items.set(I, w), g = w;
1753
+ }
1754
+ _ > 0 && G(_t());
1755
+ }
1756
+ if (A)
1757
+ _ === 0 && s && (a = ke(() => s(l)));
1758
+ else if (Or()) {
1759
+ var fe = /* @__PURE__ */ new Set(), $ = (
1760
+ /** @type {Batch} */
1761
+ L
1762
+ );
1763
+ for (E = 0; E < _; E += 1) {
1764
+ C = o[E], I = n(C, E);
1765
+ var S = u.items.get(I) ?? c.get(I);
1766
+ S ? en(S, C, E) : (w = $t(
1767
+ null,
1768
+ u,
1769
+ null,
1770
+ null,
1771
+ C,
1772
+ I,
1773
+ E,
1774
+ i,
1775
+ t,
1776
+ r,
1777
+ !0
1778
+ ), c.set(I, w)), fe.add(I);
1779
+ }
1780
+ for (const [O, m] of u.items)
1781
+ fe.has(O) || $.skipped_effects.add(m.e);
1782
+ $.add_callback(v);
1783
+ } else
1784
+ v();
1785
+ y && ie(!0), p(h);
1786
+ }), A && (l = x);
1787
+ }
1788
+ function $i(e, t, r, n, i, s, l, u, a) {
1789
+ var f = t.length, c = r.items, h = r.first, o = h, d, v = null, _ = [], y = [], R, g, w, E;
1790
+ for (E = 0; E < f; E += 1) {
1791
+ if (R = t[E], g = u(R, E), w = c.get(g), w === void 0) {
1792
+ var C = n.get(g);
1793
+ if (C !== void 0) {
1794
+ n.delete(g), c.set(g, C);
1795
+ var I = v ? v.next : o;
1796
+ K(r, v, C), K(r, C, I), dt(C, I, i), v = C;
1797
+ } else {
1798
+ var fe = o ? (
1799
+ /** @type {TemplateNode} */
1800
+ o.e.nodes_start
1801
+ ) : i;
1802
+ v = $t(
1803
+ fe,
1804
+ r,
1805
+ v,
1806
+ v === null ? r.first : v.next,
1807
+ R,
1808
+ g,
1809
+ E,
1810
+ s,
1811
+ l,
1812
+ a
1813
+ );
1814
+ }
1815
+ c.set(g, v), _ = [], y = [], o = v.next;
1816
+ continue;
1817
+ }
1818
+ if (en(w, R, E), (w.e.f & Y) !== 0 && zt(w.e), w !== o) {
1819
+ if (d !== void 0 && d.has(w)) {
1820
+ if (_.length < y.length) {
1821
+ var $ = y[0], S;
1822
+ v = $.prev;
1823
+ var O = _[0], m = _[_.length - 1];
1824
+ for (S = 0; S < _.length; S += 1)
1825
+ dt(_[S], $, i);
1826
+ for (S = 0; S < y.length; S += 1)
1827
+ d.delete(y[S]);
1828
+ K(r, O.prev, m.next), K(r, v, O), K(r, m, $), o = $, v = m, E -= 1, _ = [], y = [];
1829
+ } else
1830
+ d.delete(w), dt(w, o, i), K(r, w.prev, w.next), K(r, w, v === null ? r.first : v.next), K(r, v, w), v = w;
1831
+ continue;
1832
+ }
1833
+ for (_ = [], y = []; o !== null && o.k !== g; )
1834
+ (o.e.f & Y) === 0 && (d ??= /* @__PURE__ */ new Set()).add(o), y.push(o), o = o.next;
1835
+ if (o === null)
1836
+ continue;
1837
+ w = o;
1838
+ }
1839
+ _.push(w), v = w, o = w.next;
1840
+ }
1841
+ if (o !== null || d !== void 0) {
1842
+ for (var N = d === void 0 ? [] : xt(d); o !== null; )
1843
+ (o.e.f & Y) === 0 && N.push(o), o = o.next;
1844
+ var U = N.length;
1845
+ if (U > 0) {
1846
+ var Se = null;
1847
+ wi(r, N, Se);
1848
+ }
1849
+ }
1850
+ e.first = r.first && r.first.e, e.last = v && v.e;
1851
+ for (var Ce of n.values())
1852
+ Z(Ce.e);
1853
+ n.clear();
1854
+ }
1855
+ function en(e, t, r, n) {
1856
+ rt(e.v, t), e.i = r;
1857
+ }
1858
+ function $t(e, t, r, n, i, s, l, u, a, f, c) {
1859
+ var h = (a & on) !== 0, o = (a & vn) === 0, d = h ? o ? /* @__PURE__ */ xr(i, !1, !1) : We(i) : i, v = (a & cn) === 0 ? l : We(l), _ = {
1860
+ i: v,
1861
+ v: d,
1862
+ k: s,
1863
+ a: null,
1864
+ // @ts-expect-error
1865
+ e: null,
1866
+ prev: r,
1867
+ next: n
1868
+ };
1869
+ try {
1870
+ if (e === null) {
1871
+ var y = document.createDocumentFragment();
1872
+ y.append(e = le());
1873
+ }
1874
+ return _.e = ke(() => u(
1875
+ /** @type {Node} */
1876
+ e,
1877
+ d,
1878
+ v,
1879
+ f
1880
+ ), A), _.e.prev = r && r.e, _.e.next = n && n.e, r === null ? c || (t.first = _) : (r.next = _, r.e.next = _.e), n !== null && (n.prev = _, n.e.prev = _.e), _;
1881
+ } finally {
1882
+ }
1883
+ }
1884
+ function dt(e, t, r) {
1885
+ for (var n = e.next ? (
1886
+ /** @type {TemplateNode} */
1887
+ e.next.e.nodes_start
1888
+ ) : r, i = t ? (
1889
+ /** @type {TemplateNode} */
1890
+ t.e.nodes_start
1891
+ ) : r, s = (
1892
+ /** @type {TemplateNode} */
1893
+ e.e.nodes_start
1894
+ ); s !== null && s !== n; ) {
1895
+ var l = (
1896
+ /** @type {TemplateNode} */
1897
+ /* @__PURE__ */ ue(s)
1898
+ );
1899
+ i.before(s), s = l;
1900
+ }
1901
+ }
1902
+ function K(e, t, r) {
1903
+ t === null ? e.first = r : (t.next = r, t.e.next = r && r.e), r !== null && (r.prev = t, r.e.prev = t && t.e);
1904
+ }
1905
+ function tn(e, t) {
1906
+ Ir(() => {
1907
+ var r = e.getRootNode(), n = (
1908
+ /** @type {ShadowRoot} */
1909
+ r.host ? (
1910
+ /** @type {ShadowRoot} */
1911
+ r
1912
+ ) : (
1913
+ /** @type {Document} */
1914
+ r.head ?? /** @type {Document} */
1915
+ r.ownerDocument.head
1916
+ )
1917
+ );
1918
+ if (!n.querySelector("#" + t.hash)) {
1919
+ const i = document.createElement("style");
1920
+ i.id = t.hash, i.textContent = t.code, n.appendChild(i);
1921
+ }
1922
+ });
1923
+ }
1924
+ function rn(e) {
1925
+ var t, r, n = "";
1926
+ if (typeof e == "string" || typeof e == "number") n += e;
1927
+ else if (typeof e == "object") if (Array.isArray(e)) {
1928
+ var i = e.length;
1929
+ for (t = 0; t < i; t++) e[t] && (r = rn(e[t])) && (n && (n += " "), n += r);
1930
+ } else for (r in e) e[r] && (n && (n += " "), n += r);
1931
+ return n;
1932
+ }
1933
+ function bi() {
1934
+ for (var e, t, r = 0, n = "", i = arguments.length; r < i; r++) (e = arguments[r]) && (t = rn(e)) && (n && (n += " "), n += t);
1935
+ return n;
1936
+ }
1937
+ function Ei(e) {
1938
+ return typeof e == "object" ? bi(e) : e ?? "";
1939
+ }
1940
+ const tr = [...`
1941
+ \r\f \v\uFEFF`];
1942
+ function Ti(e, t, r) {
1943
+ var n = e == null ? "" : "" + e;
1944
+ if (t && (n = n ? n + " " + t : t), r) {
1945
+ for (var i in r)
1946
+ if (r[i])
1947
+ n = n ? n + " " + i : i;
1948
+ else if (n.length)
1949
+ for (var s = i.length, l = 0; (l = n.indexOf(i, l)) >= 0; ) {
1950
+ var u = l + s;
1951
+ (l === 0 || tr.includes(n[l - 1])) && (u === n.length || tr.includes(n[u])) ? n = (l === 0 ? "" : n.substring(0, l)) + n.substring(u + 1) : l = u;
1952
+ }
1953
+ }
1954
+ return n === "" ? null : n;
1955
+ }
1956
+ function xi(e, t) {
1957
+ return e == null ? null : String(e);
1958
+ }
1959
+ function Ai(e, t, r, n, i, s) {
1960
+ var l = e.__className;
1961
+ if (A || l !== r || l === void 0) {
1962
+ var u = Ti(r, n, s);
1963
+ (!A || u !== e.getAttribute("class")) && (u == null ? e.removeAttribute("class") : t ? e.className = u : e.setAttribute("class", u)), e.__className = r;
1964
+ } else if (s && i !== s)
1965
+ for (var a in s) {
1966
+ var f = !!s[a];
1967
+ (i == null || f !== !!i[a]) && e.classList.toggle(a, f);
1968
+ }
1969
+ return s;
1970
+ }
1971
+ function Si(e, t, r, n) {
1972
+ var i = e.__style;
1973
+ if (A || i !== t) {
1974
+ var s = xi(t);
1975
+ (!A || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t;
1976
+ }
1977
+ return n;
1978
+ }
1979
+ const Ci = Symbol("is custom element"), Ni = Symbol("is html");
1980
+ function ce(e, t, r, n) {
1981
+ var i = Ri(e);
1982
+ A && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === "LINK") || i[t] !== (i[t] = r) && (t === "loading" && (e[Sn] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && Oi(e).includes(t) ? e[t] = r : e.setAttribute(t, r));
1983
+ }
1984
+ function Ri(e) {
1985
+ return (
1986
+ /** @type {Record<string | symbol, unknown>} **/
1987
+ // @ts-expect-error
1988
+ e.__attributes ??= {
1989
+ [Ci]: e.nodeName.includes("-"),
1990
+ [Ni]: e.namespaceURI === wn
1991
+ }
1992
+ );
1993
+ }
1994
+ var rr = /* @__PURE__ */ new Map();
1995
+ function Oi(e) {
1996
+ var t = e.getAttribute("is") || e.nodeName, r = rr.get(t);
1997
+ if (r) return r;
1998
+ rr.set(t, r = []);
1999
+ for (var n, i = e, s = Element.prototype; s !== i; ) {
2000
+ n = $n(i);
2001
+ for (var l in n)
2002
+ n[l].set && r.push(l);
2003
+ i = ar(i);
2004
+ }
2005
+ return r;
2006
+ }
2007
+ function nr(e, t) {
2008
+ return e === t || e?.[ze] === t;
2009
+ }
2010
+ function nn(e = {}, t, r, n) {
2011
+ return Ir(() => {
2012
+ var i, s;
2013
+ return Pr(() => {
2014
+ i = s, s = [], ft(() => {
2015
+ e !== r(...s) && (t(e, ...s), i && nr(r(...i), e) && t(null, ...i));
2016
+ });
2017
+ }), () => {
2018
+ yr(() => {
2019
+ s && nr(r(...s), e) && t(null, ...s);
2020
+ });
2021
+ };
2022
+ }), e;
2023
+ }
2024
+ function Mi(e, t, r, n, i) {
2025
+ var s = () => {
2026
+ n(r[e]);
2027
+ };
2028
+ r.addEventListener(t, s), s(), (r === document.body || r === window || r === document) && Mr(() => {
2029
+ r.removeEventListener(t, s);
2030
+ });
2031
+ }
2032
+ let Ge = !1;
2033
+ function Li(e) {
2034
+ var t = Ge;
2035
+ try {
2036
+ return Ge = !1, [e(), Ge];
2037
+ } finally {
2038
+ Ge = t;
2039
+ }
2040
+ }
2041
+ function ve(e, t, r, n) {
2042
+ var i = (r & _n) !== 0, s = (r & pn) !== 0, l = (
2043
+ /** @type {V} */
2044
+ n
2045
+ ), u = !0, a = () => (u && (u = !1, l = s ? ft(
2046
+ /** @type {() => V} */
2047
+ n
2048
+ ) : (
2049
+ /** @type {V} */
2050
+ n
2051
+ )), l), f;
2052
+ if (i) {
2053
+ var c = ze in e || or in e;
2054
+ f = me(e, t)?.set ?? (c && t in e ? (g) => e[t] = g : void 0);
2055
+ }
2056
+ var h, o = !1;
2057
+ i ? [h, o] = Li(() => (
2058
+ /** @type {V} */
2059
+ e[t]
2060
+ )) : h = /** @type {V} */
2061
+ e[t], h === void 0 && n !== void 0 && (h = a(), f && (Pn(), f(h)));
2062
+ var d;
2063
+ if (d = () => {
2064
+ var g = (
2065
+ /** @type {V} */
2066
+ e[t]
2067
+ );
2068
+ return g === void 0 ? a() : (u = !0, g);
2069
+ }, (r & hn) === 0)
2070
+ return d;
2071
+ if (f) {
2072
+ var v = e.$$legacy;
2073
+ return (
2074
+ /** @type {() => V} */
2075
+ (function(g, w) {
2076
+ return arguments.length > 0 ? ((!w || v || o) && f(w ? d() : g), g) : d();
2077
+ })
2078
+ );
2079
+ }
2080
+ var _ = !1, y = ((r & dn) !== 0 ? lt : wr)(() => (_ = !1, d()));
2081
+ i && p(y);
2082
+ var R = (
2083
+ /** @type {Effect} */
2084
+ b
2085
+ );
2086
+ return (
2087
+ /** @type {() => V} */
2088
+ (function(g, w) {
2089
+ if (arguments.length > 0) {
2090
+ const E = w ? p(y) : i ? Re(g) : g;
2091
+ return M(y, E), _ = !0, l !== void 0 && (l = E), g;
2092
+ }
2093
+ return Ae && _ || (R.f & xe) !== 0 ? y.v : p(y);
2094
+ })
2095
+ );
2096
+ }
2097
+ function Ii(e) {
2098
+ return new Pi(e);
2099
+ }
2100
+ class Pi {
2101
+ /** @type {any} */
2102
+ #t;
2103
+ /** @type {Record<string, any>} */
2104
+ #e;
2105
+ /**
2106
+ * @param {ComponentConstructorOptions & {
2107
+ * component: any;
2108
+ * }} options
2109
+ */
2110
+ constructor(t) {
2111
+ var r = /* @__PURE__ */ new Map(), n = (s, l) => {
2112
+ var u = /* @__PURE__ */ xr(l, !1, !1);
2113
+ return r.set(s, u), u;
2114
+ };
2115
+ const i = new Proxy(
2116
+ { ...t.props || {}, $$events: {} },
2117
+ {
2118
+ get(s, l) {
2119
+ return p(r.get(l) ?? n(l, Reflect.get(s, l)));
2120
+ },
2121
+ has(s, l) {
2122
+ return l === or ? !0 : (p(r.get(l) ?? n(l, Reflect.get(s, l))), Reflect.has(s, l));
2123
+ },
2124
+ set(s, l, u) {
2125
+ return M(r.get(l) ?? n(l, u), u), Reflect.set(s, l, u);
2126
+ }
2127
+ }
2128
+ );
2129
+ this.#e = (t.hydrate ? pi : Xr)(t.component, {
2130
+ target: t.target,
2131
+ anchor: t.anchor,
2132
+ props: i,
2133
+ context: t.context,
2134
+ intro: t.intro ?? !1,
2135
+ recover: t.recover
2136
+ }), (!t?.props?.$$host || t.sync === !1) && re(), this.#t = i.$$events;
2137
+ for (const s of Object.keys(this.#e))
2138
+ s === "$set" || s === "$destroy" || s === "$on" || Ie(this, s, {
2139
+ get() {
2140
+ return this.#e[s];
2141
+ },
2142
+ /** @param {any} value */
2143
+ set(l) {
2144
+ this.#e[s] = l;
2145
+ },
2146
+ enumerable: !0
2147
+ });
2148
+ this.#e.$set = /** @param {Record<string, any>} next */
2149
+ (s) => {
2150
+ Object.assign(i, s);
2151
+ }, this.#e.$destroy = () => {
2152
+ gi(this.#e);
2153
+ };
2154
+ }
2155
+ /** @param {Record<string, any>} props */
2156
+ $set(t) {
2157
+ this.#e.$set(t);
2158
+ }
2159
+ /**
2160
+ * @param {string} event
2161
+ * @param {(...args: any[]) => any} callback
2162
+ * @returns {any}
2163
+ */
2164
+ $on(t, r) {
2165
+ this.#t[t] = this.#t[t] || [];
2166
+ const n = (...i) => r.call(this, ...i);
2167
+ return this.#t[t].push(n), () => {
2168
+ this.#t[t] = this.#t[t].filter(
2169
+ /** @param {any} fn */
2170
+ (i) => i !== n
2171
+ );
2172
+ };
2173
+ }
2174
+ $destroy() {
2175
+ this.#e.$destroy();
2176
+ }
2177
+ }
2178
+ let sn;
2179
+ typeof HTMLElement == "function" && (sn = class extends HTMLElement {
2180
+ /** The Svelte component constructor */
2181
+ $$ctor;
2182
+ /** Slots */
2183
+ $$s;
2184
+ /** @type {any} The Svelte component instance */
2185
+ $$c;
2186
+ /** Whether or not the custom element is connected */
2187
+ $$cn = !1;
2188
+ /** @type {Record<string, any>} Component props data */
2189
+ $$d = {};
2190
+ /** `true` if currently in the process of reflecting component props back to attributes */
2191
+ $$r = !1;
2192
+ /** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
2193
+ $$p_d = {};
2194
+ /** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */
2195
+ $$l = {};
2196
+ /** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */
2197
+ $$l_u = /* @__PURE__ */ new Map();
2198
+ /** @type {any} The managed render effect for reflecting attributes */
2199
+ $$me;
2200
+ /**
2201
+ * @param {*} $$componentCtor
2202
+ * @param {*} $$slots
2203
+ * @param {*} use_shadow_dom
2204
+ */
2205
+ constructor(e, t, r) {
2206
+ super(), this.$$ctor = e, this.$$s = t, r && this.attachShadow({ mode: "open" });
2207
+ }
2208
+ /**
2209
+ * @param {string} type
2210
+ * @param {EventListenerOrEventListenerObject} listener
2211
+ * @param {boolean | AddEventListenerOptions} [options]
2212
+ */
2213
+ addEventListener(e, t, r) {
2214
+ if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
2215
+ const n = this.$$c.$on(e, t);
2216
+ this.$$l_u.set(t, n);
2217
+ }
2218
+ super.addEventListener(e, t, r);
2219
+ }
2220
+ /**
2221
+ * @param {string} type
2222
+ * @param {EventListenerOrEventListenerObject} listener
2223
+ * @param {boolean | AddEventListenerOptions} [options]
2224
+ */
2225
+ removeEventListener(e, t, r) {
2226
+ if (super.removeEventListener(e, t, r), this.$$c) {
2227
+ const n = this.$$l_u.get(t);
2228
+ n && (n(), this.$$l_u.delete(t));
2229
+ }
2230
+ }
2231
+ async connectedCallback() {
2232
+ if (this.$$cn = !0, !this.$$c) {
2233
+ let e = function(n) {
2234
+ return (i) => {
2235
+ const s = document.createElement("slot");
2236
+ n !== "default" && (s.name = n), ne(i, s);
2237
+ };
2238
+ };
2239
+ if (await Promise.resolve(), !this.$$cn || this.$$c)
2240
+ return;
2241
+ const t = {}, r = ki(this);
2242
+ for (const n of this.$$s)
2243
+ n in r && (n === "default" && !this.$$d.children ? (this.$$d.children = e(n), t.default = !0) : t[n] = e(n));
2244
+ for (const n of this.attributes) {
2245
+ const i = this.$$g_p(n.name);
2246
+ i in this.$$d || (this.$$d[i] = Xe(i, n.value, this.$$p_d, "toProp"));
2247
+ }
2248
+ for (const n in this.$$p_d)
2249
+ !(n in this.$$d) && this[n] !== void 0 && (this.$$d[n] = this[n], delete this[n]);
2250
+ this.$$c = Ii({
2251
+ component: this.$$ctor,
2252
+ target: this.shadowRoot || this,
2253
+ props: {
2254
+ ...this.$$d,
2255
+ $$slots: t,
2256
+ $$host: this
2257
+ }
2258
+ }), this.$$me = ti(() => {
2259
+ Pr(() => {
2260
+ this.$$r = !0;
2261
+ for (const n of Ze(this.$$c)) {
2262
+ if (!this.$$p_d[n]?.reflect) continue;
2263
+ this.$$d[n] = this.$$c[n];
2264
+ const i = Xe(
2265
+ n,
2266
+ this.$$d[n],
2267
+ this.$$p_d,
2268
+ "toAttribute"
2269
+ );
2270
+ i == null ? this.removeAttribute(this.$$p_d[n].attribute || n) : this.setAttribute(this.$$p_d[n].attribute || n, i);
2271
+ }
2272
+ this.$$r = !1;
2273
+ });
2274
+ });
2275
+ for (const n in this.$$l)
2276
+ for (const i of this.$$l[n]) {
2277
+ const s = this.$$c.$on(n, i);
2278
+ this.$$l_u.set(i, s);
2279
+ }
2280
+ this.$$l = {};
2281
+ }
2282
+ }
2283
+ // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
2284
+ // and setting attributes through setAttribute etc, this is helpful
2285
+ /**
2286
+ * @param {string} attr
2287
+ * @param {string} _oldValue
2288
+ * @param {string} newValue
2289
+ */
2290
+ attributeChangedCallback(e, t, r) {
2291
+ this.$$r || (e = this.$$g_p(e), this.$$d[e] = Xe(e, r, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
2292
+ }
2293
+ disconnectedCallback() {
2294
+ this.$$cn = !1, Promise.resolve().then(() => {
2295
+ !this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0);
2296
+ });
2297
+ }
2298
+ /**
2299
+ * @param {string} attribute_name
2300
+ */
2301
+ $$g_p(e) {
2302
+ return Ze(this.$$p_d).find(
2303
+ (t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e
2304
+ ) || e;
2305
+ }
2306
+ });
2307
+ function Xe(e, t, r, n) {
2308
+ const i = r[e]?.type;
2309
+ if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !n || !r[e])
2310
+ return t;
2311
+ if (n === "toAttribute")
2312
+ switch (i) {
2313
+ case "Object":
2314
+ case "Array":
2315
+ return t == null ? null : JSON.stringify(t);
2316
+ case "Boolean":
2317
+ return t ? "" : null;
2318
+ case "Number":
2319
+ return t ?? null;
2320
+ default:
2321
+ return t;
2322
+ }
2323
+ else
2324
+ switch (i) {
2325
+ case "Object":
2326
+ case "Array":
2327
+ return t && JSON.parse(t);
2328
+ case "Boolean":
2329
+ return t;
2330
+ // conversion already handled above
2331
+ case "Number":
2332
+ return t != null ? +t : t;
2333
+ default:
2334
+ return t;
2335
+ }
2336
+ }
2337
+ function ki(e) {
2338
+ const t = {};
2339
+ return e.childNodes.forEach((r) => {
2340
+ t[
2341
+ /** @type {Element} node */
2342
+ r.slot || "default"
2343
+ ] = !0;
2344
+ }), t;
2345
+ }
2346
+ function ln(e, t, r, n, i, s) {
2347
+ let l = class extends sn {
2348
+ constructor() {
2349
+ super(e, r, i), this.$$p_d = t;
2350
+ }
2351
+ static get observedAttributes() {
2352
+ return Ze(t).map(
2353
+ (u) => (t[u].attribute || u).toLowerCase()
2354
+ );
2355
+ }
2356
+ };
2357
+ return Ze(t).forEach((u) => {
2358
+ Ie(l.prototype, u, {
2359
+ get() {
2360
+ return this.$$c && u in this.$$c ? this.$$c[u] : this.$$d[u];
2361
+ },
2362
+ set(a) {
2363
+ a = Xe(u, a, t), this.$$d[u] = a;
2364
+ var f = this.$$c;
2365
+ if (f) {
2366
+ var c = me(f, u)?.get;
2367
+ c ? f[u] = a : f.$set({ [u]: a });
2368
+ }
2369
+ }
2370
+ });
2371
+ }), n.forEach((u) => {
2372
+ Ie(l.prototype, u, {
2373
+ get() {
2374
+ return this.$$c?.[u];
2375
+ }
2376
+ });
2377
+ }), e.element = /** @type {any} */
2378
+ l, l;
2379
+ }
2380
+ function ir(e) {
2381
+ if (isNaN(e) || e < 0)
2382
+ return "-:--";
2383
+ const t = Math.floor(e / 60), r = Math.round(e % 60);
2384
+ return `${t}:${r.toString().padStart(2, "0")}`;
2385
+ }
2386
+ var Di = /* @__PURE__ */ Bt('<rect rx="1"></rect>'), Fi = /* @__PURE__ */ Jr('<div class="container svelte-efr4jv" role="group" aria-label="audio player"><svg width="100%" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" class="svelte-efr4jv"><!></svg></div>');
2387
+ const ji = {
2388
+ hash: "svelte-efr4jv",
2389
+ code: `svg.svelte-efr4jv {box-sizing:border-box;margin:0;padding:0;}.container.svelte-efr4jv {flex:1;box-sizing:border-box;margin:0;padding:0;display:flex;align-items:center;}.bar.svelte-efr4jv {transition:fill 0.2s;}.played.svelte-efr4jv {fill:var(--44-color-2, var(--fortyfour-recorder-bg-primary));}.unplayed.svelte-efr4jv {fill:var(--44-color-1, var(--fortyfour-recorder-color-0));}.recording-pulse.svelte-efr4jv {
2390
+ animation: svelte-efr4jv-pulse 0.5s ease-out;}
2391
+
2392
+ @keyframes svelte-efr4jv-pulse {
2393
+ 0% {
2394
+ opacity: 0.5;
2395
+ }
2396
+ 100% {
2397
+ opacity: 1;
2398
+ }
2399
+ }`
2400
+ };
2401
+ function an(e, t) {
2402
+ Lt(t, !0), tn(e, ji);
2403
+ function r($, S) {
2404
+ const O = $.length / S, m = [];
2405
+ for (let N = 0; N < S; N++) {
2406
+ const U = Math.floor(N * O), Se = Math.floor((N + 1) * O), Ce = $.slice(U, Math.max(U + 1, Se)), te = Ce.reduce((fn, qt) => fn + qt * qt, 0), un = Math.sqrt(te / Ce.length);
2407
+ m.push(un);
2408
+ }
2409
+ return m;
2410
+ }
2411
+ let n = ve(t, "data", 7), i = ve(t, "timeMs", 7, null), s = ve(t, "barWidth", 7, 3), l = ve(t, "spacing", 7, 1), u = ve(t, "playedColor", 7, null), a = ve(t, "unplayedColor", 7, null), f = /* @__PURE__ */ F(0), c = /* @__PURE__ */ F(!1), h = null;
2412
+ Qr(() => {
2413
+ const $ = new ResizeObserver((S) => {
2414
+ for (let O of S)
2415
+ O.contentBoxSize ? M(f, O.contentBoxSize[0]?.inlineSize || O.contentBoxSize.inlineSize, !0) : M(f, O.contentRect.width, !0), M(c, !0);
2416
+ });
2417
+ return h && $.observe(h), () => {
2418
+ $.disconnect();
2419
+ };
2420
+ });
2421
+ const o = 56, d = 100, v = /* @__PURE__ */ oe(() => Math.floor(p(f) / (s() + l()))), _ = /* @__PURE__ */ oe(() => r(n(), p(v))), y = /* @__PURE__ */ oe(() => p(_).length ? n().length / p(_).length : 1), R = /* @__PURE__ */ oe(() => d * p(y)), g = /* @__PURE__ */ oe(() => p(_).map(($) => {
2422
+ const S = Math.max(3, Math.round($ / 100 * (o - 3) + 3));
2423
+ return S % 2 === 0 ? S + 1 : S;
2424
+ }));
2425
+ var w = {
2426
+ get data() {
2427
+ return n();
2428
+ },
2429
+ set data($) {
2430
+ n($), re();
2431
+ },
2432
+ get timeMs() {
2433
+ return i();
2434
+ },
2435
+ set timeMs($ = null) {
2436
+ i($), re();
2437
+ },
2438
+ get barWidth() {
2439
+ return s();
2440
+ },
2441
+ set barWidth($ = 3) {
2442
+ s($), re();
2443
+ },
2444
+ get spacing() {
2445
+ return l();
2446
+ },
2447
+ set spacing($ = 1) {
2448
+ l($), re();
2449
+ },
2450
+ get playedColor() {
2451
+ return u();
2452
+ },
2453
+ set playedColor($ = null) {
2454
+ u($), re();
2455
+ },
2456
+ get unplayedColor() {
2457
+ return a();
2458
+ },
2459
+ set unplayedColor($ = null) {
2460
+ a($), re();
2461
+ }
2462
+ }, E = Fi(), C = qe(E);
2463
+ ce(C, "height", o);
2464
+ var I = qe(C);
2465
+ {
2466
+ var fe = ($) => {
2467
+ var S = di(), O = Xn(S);
2468
+ mi(O, 17, () => p(g), yi, (m, N, U) => {
2469
+ const Se = /* @__PURE__ */ oe(() => U * p(R) < i()), Ce = /* @__PURE__ */ oe(() => i() === null && U === p(g).length - 1);
2470
+ var te = Di();
2471
+ Ue(() => {
2472
+ Ai(
2473
+ te,
2474
+ 0,
2475
+ Ei([
2476
+ "bar",
2477
+ p(Se) ? "played" : "unplayed",
2478
+ p(Ce) && "recording-pulse"
2479
+ ]),
2480
+ "svelte-efr4jv"
2481
+ ), ce(te, "x", U * (s() + l())), ce(te, "y", o / 4 - p(N) / 2), ce(te, "width", s() - 1), ce(te, "height", p(N)), Si(te, p(Se) ? u() ? `fill: ${u()}` : null : a() ? `fill: ${a()}` : null);
2482
+ }), ne(m, te);
2483
+ }), ne($, S);
2484
+ };
2485
+ Je(I, ($) => {
2486
+ p(c) && $(fe);
2487
+ });
2488
+ }
2489
+ return Be(C), nn(C, ($) => h = $, () => h), Be(E), Ue(() => ce(C, "viewBox", `0 0 ${p(f)} ${o / 2}`)), ne(e, E), It(w);
2490
+ }
2491
+ ln(
2492
+ an,
2493
+ {
2494
+ data: {},
2495
+ timeMs: {},
2496
+ barWidth: {},
2497
+ spacing: {},
2498
+ playedColor: {},
2499
+ unplayedColor: {}
2500
+ },
2501
+ [],
2502
+ [],
2503
+ !0
2504
+ );
2505
+ var zi = /* @__PURE__ */ Bt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" class="icon svelte-7u5az2"><path d="M176 96C149.5 96 128 117.5 128 144L128 496C128 522.5 149.5 544 176 544L240 544C266.5 544 288 522.5 288 496L288 144C288 117.5 266.5 96 240 96L176 96zM400 96C373.5 96 352 117.5 352 144L352 496C352 522.5 373.5 544 400 544L464 544C490.5 544 512 522.5 512 496L512 144C512 117.5 490.5 96 464 96L400 96z"></path></svg>'), Bi = /* @__PURE__ */ Bt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" class="icon svelte-7u5az2"><path d="M187.2 100.9C174.8 94.1 159.8 94.4 147.6 101.6C135.4 108.8 128 121.9 128 136L128 504C128 518.1 135.5 531.2 147.6 538.4C159.7 545.6 174.8 545.9 187.2 539.1L523.2 355.1C536 348.1 544 334.6 544 320C544 305.4 536 291.9 523.2 284.9L187.2 100.9z"></path></svg>'), qi = /* @__PURE__ */ Jr('<div class="container svelte-7u5az2" role="group" aria-label="Audio player"><button class="btn svelte-7u5az2"><!></button> <!> <div class="time svelte-7u5az2"><!></div> <audio></audio></div>');
2506
+ const Ui = {
2507
+ hash: "svelte-7u5az2",
2508
+ code: ".container.svelte-7u5az2 {display:flex;align-items:stretch;gap:0.5rem;flex:1;}.btn.svelte-7u5az2 {border:none;border-radius:50%;padding:0.5rem;cursor:pointer;display:flex;align-items:center;justify-content:center;aspect-ratio:1 / 1;flex-shrink:0;align-self:center;color:var(--fortyfour-recorder-btn-primary-color);background:var(--fortyfour-recorder-btn-primary-bg);}.btn.svelte-7u5az2:hover {color:var(--fortyfour-recorder-btn-primary-color-hover);background:var(--fortyfour-recorder-btn-primary-bg-hover);}.icon.svelte-7u5az2 {width:1.5em;height:1.5em;fill:currentColor;}.time.svelte-7u5az2 {display:flex;align-items:center;font-variant-numeric:tabular-nums;font-size:0.9rem;}"
2509
+ };
2510
+ function Hi(e, t) {
2511
+ Lt(t, !0), tn(e, Ui);
2512
+ let r = ve(t, "audioURL", 7), n = ve(t, "waveform", 7), i = /* @__PURE__ */ F(null), s = /* @__PURE__ */ F(0), l = /* @__PURE__ */ F(0), u = /* @__PURE__ */ F(
2513
+ "ready"
2514
+ // "ready", "playing", "paused"
2515
+ ), a = null;
2516
+ const c = typeof navigator < "u" && /iPad|iPhone|iPod/.test(navigator.userAgent) ? 350 : 0;
2517
+ function h() {
2518
+ p(i) && p(u) === "playing" && (M(s, p(i).currentTime, !0), a = requestAnimationFrame(h));
2519
+ }
2520
+ function o() {
2521
+ M(u, "ready"), M(s, 0), a && (cancelAnimationFrame(a), a = null);
2522
+ }
2523
+ function d() {
2524
+ p(i) && (p(u) === "playing" ? (p(i).pause(), M(u, "paused"), a && (cancelAnimationFrame(a), a = null)) : (p(i).play(), M(u, "playing"), h()));
2525
+ }
2526
+ var v = {
2527
+ get audioURL() {
2528
+ return r();
2529
+ },
2530
+ set audioURL(m) {
2531
+ r(m), re();
2532
+ },
2533
+ get waveform() {
2534
+ return n();
2535
+ },
2536
+ set waveform(m) {
2537
+ n(m), re();
2538
+ }
2539
+ }, _ = qi(), y = qe(_);
2540
+ y.__click = d;
2541
+ var R = qe(y);
2542
+ {
2543
+ var g = (m) => {
2544
+ var N = zi();
2545
+ ne(m, N);
2546
+ }, w = (m) => {
2547
+ var N = Bi();
2548
+ ne(m, N);
2549
+ };
2550
+ Je(R, (m) => {
2551
+ p(u) === "playing" ? m(g) : m(w, !1);
2552
+ });
2553
+ }
2554
+ Be(y);
2555
+ var E = vt(y, 2);
2556
+ {
2557
+ var C = (m) => {
2558
+ {
2559
+ let N = /* @__PURE__ */ oe(() => Math.round(p(s) * 1e3) + c);
2560
+ an(m, {
2561
+ get timeMs() {
2562
+ return p(N);
2563
+ },
2564
+ get data() {
2565
+ return n();
2566
+ }
2567
+ });
2568
+ }
2569
+ };
2570
+ Je(E, (m) => {
2571
+ n() && m(C);
2572
+ });
2573
+ }
2574
+ var I = vt(E, 2), fe = qe(I);
2575
+ {
2576
+ var $ = (m) => {
2577
+ var N = Zt();
2578
+ Ue((U) => er(N, U), [() => ir(p(s))]), ne(m, N);
2579
+ }, S = (m) => {
2580
+ var N = Zt();
2581
+ Ue((U) => er(N, U), [() => ir(p(l))]), ne(m, N);
2582
+ };
2583
+ Je(fe, (m) => {
2584
+ ["playing", "paused"].includes(p(u)) ? m($) : m(S, !1);
2585
+ });
2586
+ }
2587
+ Be(I);
2588
+ var O = vt(I, 2);
2589
+ return nn(O, (m) => M(i, m), () => p(i)), Be(_), Ue(() => {
2590
+ ce(y, "aria-label", p(u) === "playing" ? "Pause" : "Play"), ce(O, "src", r());
2591
+ }), oi("ended", O, o), Mi("duration", "durationchange", O, (m) => M(l, m)), ne(e, _), It(v);
2592
+ }
2593
+ ci(["click"]);
2594
+ ln(Hi, { audioURL: {}, waveform: {} }, [], [], !0);
2595
+ export {
2596
+ Hi as A,
2597
+ st as B,
2598
+ b as C,
2599
+ Qt as D,
2600
+ Nt as E,
2601
+ De as F,
2602
+ Ct as G,
2603
+ Ir as H,
2604
+ ft as I,
2605
+ Dt as J,
2606
+ Gi as K,
2607
+ yr as L,
2608
+ Ki as M,
2609
+ Vi as N,
2610
+ Wi as O,
2611
+ Re as P,
2612
+ Qr as Q,
2613
+ nn as R,
2614
+ ce as S,
2615
+ Yi as T,
2616
+ mi as U,
2617
+ yi as V,
2618
+ Ei as W,
2619
+ Zi as X,
2620
+ an as Y,
2621
+ Xi as Z,
2622
+ Bt as _,
2623
+ tn as a,
2624
+ ve as b,
2625
+ ln as c,
2626
+ ci as d,
2627
+ ne as e,
2628
+ Jr as f,
2629
+ It as g,
2630
+ re as h,
2631
+ Je as i,
2632
+ p as j,
2633
+ qe as k,
2634
+ vt as l,
2635
+ Xn as m,
2636
+ F as n,
2637
+ er as o,
2638
+ Lt as p,
2639
+ di as q,
2640
+ Be as r,
2641
+ Ai as s,
2642
+ Ue as t,
2643
+ oe as u,
2644
+ M as v,
2645
+ Zt as w,
2646
+ ei as x,
2647
+ Si as y,
2648
+ A as z
2649
+ };