@pie-players/pie-tool-calculator-inline-desmos 0.3.19 → 0.3.20

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