@pie-players/pie-tool-answer-eliminator 0.2.4 → 0.2.5

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,123 +1,126 @@
1
- var or = Object.defineProperty;
2
- var Vt = (t) => {
1
+ var ai = Object.defineProperty;
2
+ var Kt = (t) => {
3
3
  throw TypeError(t);
4
4
  };
5
- var ar = (t, e, n) => e in t ? or(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
6
- var g = (t, e, n) => ar(t, typeof e != "symbol" ? e + "" : e, n), xt = (t, e, n) => e.has(t) || Vt("Cannot " + n);
7
- var o = (t, e, n) => (xt(t, e, "read from private field"), n ? n.call(t) : e.get(t)), b = (t, e, n) => e.has(t) ? Vt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), _ = (t, e, n, r) => (xt(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), C = (t, e, n) => (xt(t, e, "access private method"), n);
8
- var ln;
9
- typeof window < "u" && ((ln = window.__svelte ?? (window.__svelte = {})).v ?? (ln.v = /* @__PURE__ */ new Set())).add("5");
10
- const on = "[", an = "[!", un = "]", pt = {}, R = /* @__PURE__ */ Symbol(), Rt = !1;
11
- var ur = Array.isArray, cr = Array.prototype.indexOf, He = Array.prototype.includes, fr = Array.from, gt = Object.keys, _t = Object.defineProperty, Ne = Object.getOwnPropertyDescriptor, hr = Object.prototype, dr = Array.prototype, pr = Object.getPrototypeOf, Wt = Object.isExtensible;
12
- function gr(t) {
5
+ var ui = (t, e, n) => e in t ? ai(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
6
+ var p = (t, e, n) => ui(t, typeof e != "symbol" ? e + "" : e, n), Tt = (t, e, n) => e.has(t) || Kt("Cannot " + n);
7
+ var l = (t, e, n) => (Tt(t, e, "read from private field"), n ? n.call(t) : e.get(t)), b = (t, e, n) => e.has(t) ? Kt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), m = (t, e, n, i) => (Tt(t, e, "write to private field"), i ? i.call(t, n) : e.set(t, n), n), k = (t, e, n) => (Tt(t, e, "access private method"), n);
8
+ var an;
9
+ typeof window < "u" && ((an = window.__svelte ?? (window.__svelte = {})).v ?? (an.v = /* @__PURE__ */ new Set())).add("5");
10
+ const un = "[", cn = "[!", fn = "]", mt = {}, O = /* @__PURE__ */ Symbol(), ci = "http://www.w3.org/1999/xhtml", Ot = !1;
11
+ var fi = Array.isArray, hi = Array.prototype.indexOf, ze = Array.prototype.includes, di = Array.from, vt = Object.keys, _t = Object.defineProperty, Le = Object.getOwnPropertyDescriptor, gi = Object.prototype, pi = Array.prototype, mi = Object.getPrototypeOf, Wt = Object.isExtensible;
12
+ const vi = () => {
13
+ };
14
+ function _i(t) {
13
15
  for (var e = 0; e < t.length; e++)
14
16
  t[e]();
15
17
  }
16
- function _r() {
17
- var t, e, n = new Promise((r, i) => {
18
- t = r, e = i;
18
+ function yi() {
19
+ var t, e, n = new Promise((i, r) => {
20
+ t = i, e = r;
19
21
  });
20
22
  return { promise: n, resolve: t, reject: e };
21
23
  }
22
- const x = 2, Ot = 4, cn = 8, fn = 1 << 24, ce = 16, fe = 32, be = 64, Ht = 128, z = 512, O = 1024, F = 2048, he = 4096, pe = 8192, ge = 16384, Et = 32768, vt = 65536, Kt = 1 << 17, hn = 1 << 18, Ye = 1 << 19, vr = 1 << 20, Re = 32768, It = 1 << 21, dn = 1 << 22, Je = 1 << 23, Tt = /* @__PURE__ */ Symbol("$state"), mr = /* @__PURE__ */ Symbol("legacy props"), pn = new class extends Error {
24
+ const R = 2, yt = 4, hn = 8, dn = 1 << 24, ge = 16, pe = 32, Ce = 64, gn = 128, G = 512, N = 1024, I = 2048, Q = 4096, ve = 8192, _e = 16384, Ye = 32768, bt = 65536, Qt = 1 << 17, pn = 1 << 18, Ve = 1 << 19, bi = 1 << 20, Ne = 65536, Nt = 1 << 21, mn = 1 << 22, Ze = 1 << 23, Rt = /* @__PURE__ */ Symbol("$state"), wi = /* @__PURE__ */ Symbol("legacy props"), Ht = new class extends Error {
23
25
  constructor() {
24
26
  super(...arguments);
25
- g(this, "name", "StaleReactionError");
26
- g(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
27
+ p(this, "name", "StaleReactionError");
28
+ p(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
27
29
  }
28
- }(), $t = 8;
29
- function yr(t) {
30
+ }(), Et = 8;
31
+ function Ci(t) {
30
32
  throw new Error("https://svelte.dev/e/lifecycle_outside_component");
31
33
  }
32
- function br(t) {
34
+ function Si(t) {
33
35
  throw new Error("https://svelte.dev/e/effect_in_teardown");
34
36
  }
35
- function wr() {
37
+ function Ei() {
36
38
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
37
39
  }
38
- function Er(t) {
40
+ function $i(t) {
39
41
  throw new Error("https://svelte.dev/e/effect_orphan");
40
42
  }
41
- function $r() {
43
+ function Ai() {
42
44
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
43
45
  }
44
- function Sr() {
46
+ function ki() {
45
47
  throw new Error("https://svelte.dev/e/hydration_failed");
46
48
  }
47
- function Cr() {
49
+ function xi() {
48
50
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
49
51
  }
50
- function Ar() {
52
+ function Ti() {
51
53
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
52
54
  }
53
- function kr() {
55
+ function Ri() {
54
56
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
55
57
  }
56
- function xr() {
58
+ function Oi() {
57
59
  throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
58
60
  }
59
- function gn(t) {
61
+ function vn(t) {
60
62
  console.warn("https://svelte.dev/e/hydration_mismatch");
61
63
  }
62
- function Tr() {
64
+ function Ni() {
63
65
  console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
64
66
  }
65
- let ee = !1;
66
- function st(t) {
67
- ee = t;
67
+ let te = !1;
68
+ function lt(t) {
69
+ te = t;
68
70
  }
69
- let M;
70
- function Xe(t) {
71
+ let q;
72
+ function et(t) {
71
73
  if (t === null)
72
- throw gn(), pt;
73
- return M = t;
74
+ throw vn(), mt;
75
+ return q = t;
74
76
  }
75
77
  function _n() {
76
- return Xe(/* @__PURE__ */ ze(M));
78
+ return et(/* @__PURE__ */ Ue(q));
77
79
  }
78
- function Rr(t = 1) {
79
- if (ee) {
80
- for (var e = t, n = M; e--; )
80
+ function Ii(t = 1) {
81
+ if (te) {
82
+ for (var e = t, n = q; e--; )
81
83
  n = /** @type {TemplateNode} */
82
- /* @__PURE__ */ ze(n);
83
- M = n;
84
+ /* @__PURE__ */ Ue(n);
85
+ q = n;
84
86
  }
85
87
  }
86
- function Or(t = !0) {
87
- for (var e = 0, n = M; ; ) {
88
- if (n.nodeType === $t) {
89
- var r = (
88
+ function Li(t = !0) {
89
+ for (var e = 0, n = q; ; ) {
90
+ if (n.nodeType === Et) {
91
+ var i = (
90
92
  /** @type {Comment} */
91
93
  n.data
92
94
  );
93
- if (r === un) {
95
+ if (i === fn) {
94
96
  if (e === 0) return n;
95
97
  e -= 1;
96
- } else (r === on || r === an) && (e += 1);
98
+ } else (i === un || i === cn || // "[1", "[2", etc. for if blocks
99
+ i[0] === "[" && !isNaN(Number(i.slice(1)))) && (e += 1);
97
100
  }
98
- var i = (
101
+ var r = (
99
102
  /** @type {TemplateNode} */
100
- /* @__PURE__ */ ze(n)
103
+ /* @__PURE__ */ Ue(n)
101
104
  );
102
- t && n.remove(), n = i;
105
+ t && n.remove(), n = r;
103
106
  }
104
107
  }
105
- function vn(t) {
108
+ function yn(t) {
106
109
  return t === this.v;
107
110
  }
108
- function Ir(t, e) {
111
+ function Fi(t, e) {
109
112
  return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function";
110
113
  }
111
- function Nr(t) {
112
- return !Ir(t, this.v);
114
+ function Bi(t) {
115
+ return !Fi(t, this.v);
113
116
  }
114
- let Lr = !1, U = null;
115
- function mt(t) {
116
- U = t;
117
+ let Di = !1, V = null;
118
+ function wt(t) {
119
+ V = t;
117
120
  }
118
- function mn(t, e = !1, n) {
119
- U = {
120
- p: U,
121
+ function bn(t, e = !1, n) {
122
+ V = {
123
+ p: V,
121
124
  i: !1,
122
125
  c: null,
123
126
  e: null,
@@ -126,166 +129,190 @@ function mn(t, e = !1, n) {
126
129
  l: null
127
130
  };
128
131
  }
129
- function yn(t) {
132
+ function wn(t) {
130
133
  var e = (
131
134
  /** @type {ComponentContext} */
132
- U
135
+ V
133
136
  ), n = e.e;
134
137
  if (n !== null) {
135
138
  e.e = null;
136
- for (var r of n)
137
- Hn(r);
139
+ for (var i of n)
140
+ Gn(i);
138
141
  }
139
- return t !== void 0 && (e.x = t), e.i = !0, U = e.p, t ?? /** @type {T} */
142
+ return t !== void 0 && (e.x = t), e.i = !0, V = e.p, t ?? /** @type {T} */
140
143
  {};
141
144
  }
142
- function bn() {
145
+ function Cn() {
143
146
  return !0;
144
147
  }
145
148
  let Ee = [];
146
- function wn() {
149
+ function Sn() {
147
150
  var t = Ee;
148
- Ee = [], gr(t);
151
+ Ee = [], _i(t);
149
152
  }
150
- function Le(t) {
151
- if (Ee.length === 0 && !Ke) {
153
+ function Fe(t) {
154
+ if (Ee.length === 0 && !Je) {
152
155
  var e = Ee;
153
156
  queueMicrotask(() => {
154
- e === Ee && wn();
157
+ e === Ee && Sn();
155
158
  });
156
159
  }
157
160
  Ee.push(t);
158
161
  }
159
- function Fr() {
162
+ function Mi() {
160
163
  for (; Ee.length > 0; )
161
- wn();
164
+ Sn();
162
165
  }
163
166
  function En(t) {
164
167
  var e = w;
165
168
  if (e === null)
166
- return v.f |= Je, t;
167
- if ((e.f & Et) === 0) {
168
- if ((e.f & Ht) === 0)
169
- throw t;
170
- e.b.error(t);
171
- } else
172
- yt(t, e);
169
+ return _.f |= Ze, t;
170
+ if ((e.f & Ye) === 0 && (e.f & yt) === 0)
171
+ throw t;
172
+ Ct(t, e);
173
173
  }
174
- function yt(t, e) {
174
+ function Ct(t, e) {
175
175
  for (; e !== null; ) {
176
- if ((e.f & Ht) !== 0)
176
+ if ((e.f & gn) !== 0) {
177
+ if ((e.f & Ye) === 0)
178
+ throw t;
177
179
  try {
178
180
  e.b.error(t);
179
181
  return;
180
182
  } catch (n) {
181
183
  t = n;
182
184
  }
185
+ }
183
186
  e = e.parent;
184
187
  }
185
188
  throw t;
186
189
  }
187
- const Br = -7169;
188
- function T(t, e) {
189
- t.f = t.f & Br | e;
190
+ const qi = -7169;
191
+ function A(t, e) {
192
+ t.f = t.f & qi | e;
190
193
  }
191
- function Yt(t) {
192
- (t.f & z) !== 0 || t.deps === null ? T(t, O) : T(t, he);
194
+ function zt(t) {
195
+ (t.f & G) !== 0 || t.deps === null ? A(t, N) : A(t, Q);
193
196
  }
194
197
  function $n(t) {
195
198
  if (t !== null)
196
199
  for (const e of t)
197
- (e.f & x) === 0 || (e.f & Re) === 0 || (e.f ^= Re, $n(
200
+ (e.f & R) === 0 || (e.f & Ne) === 0 || (e.f ^= Ne, $n(
198
201
  /** @type {Derived} */
199
202
  e.deps
200
203
  ));
201
204
  }
202
- function Sn(t, e, n) {
203
- (t.f & F) !== 0 ? e.add(t) : (t.f & he) !== 0 && n.add(t), $n(t.deps), T(t, O);
205
+ function An(t, e, n) {
206
+ (t.f & I) !== 0 ? e.add(t) : (t.f & Q) !== 0 && n.add(t), $n(t.deps), A(t, N);
204
207
  }
205
- const lt = /* @__PURE__ */ new Set();
206
- let A = null, V = null, D = [], St = null, Nt = !1, Ke = !1;
207
- var Fe, Be, Se, qe, et, tt, Ce, De, ne, Lt, Ft, Cn;
208
+ const at = /* @__PURE__ */ new Set();
209
+ let x = null, U = null, F = [], $t = null, It = !1, Je = !1;
210
+ var Be, De, Ae, Me, nt, it, ke, ae, qe, re, Lt, Ft, kn;
208
211
  const Ut = class Ut {
209
212
  constructor() {
210
- b(this, ne);
211
- g(this, "committed", !1);
213
+ b(this, re);
214
+ p(this, "committed", !1);
212
215
  /**
213
216
  * The current values of any sources that are updated in this batch
214
217
  * They keys of this map are identical to `this.#previous`
215
218
  * @type {Map<Source, any>}
216
219
  */
217
- g(this, "current", /* @__PURE__ */ new Map());
220
+ p(this, "current", /* @__PURE__ */ new Map());
218
221
  /**
219
222
  * The values of any sources that are updated in this batch _before_ those updates took place.
220
223
  * They keys of this map are identical to `this.#current`
221
224
  * @type {Map<Source, any>}
222
225
  */
223
- g(this, "previous", /* @__PURE__ */ new Map());
226
+ p(this, "previous", /* @__PURE__ */ new Map());
224
227
  /**
225
228
  * When the batch is committed (and the DOM is updated), we need to remove old branches
226
229
  * and append new ones by calling the functions added inside (if/each/key/etc) blocks
227
230
  * @type {Set<() => void>}
228
231
  */
229
- b(this, Fe, /* @__PURE__ */ new Set());
232
+ b(this, Be, /* @__PURE__ */ new Set());
230
233
  /**
231
234
  * If a fork is discarded, we need to destroy any effects that are no longer needed
232
235
  * @type {Set<(batch: Batch) => void>}
233
236
  */
234
- b(this, Be, /* @__PURE__ */ new Set());
237
+ b(this, De, /* @__PURE__ */ new Set());
235
238
  /**
236
239
  * The number of async effects that are currently in flight
237
240
  */
238
- b(this, Se, 0);
241
+ b(this, Ae, 0);
239
242
  /**
240
243
  * The number of async effects that are currently in flight, _not_ inside a pending boundary
241
244
  */
242
- b(this, qe, 0);
245
+ b(this, Me, 0);
243
246
  /**
244
247
  * A deferred that resolves when the batch is committed, used with `settled()`
245
248
  * TODO replace with Promise.withResolvers once supported widely enough
246
249
  * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
247
250
  */
248
- b(this, et, null);
251
+ b(this, nt, null);
249
252
  /**
250
253
  * Deferred effects (which run after async work has completed) that are DIRTY
251
254
  * @type {Set<Effect>}
252
255
  */
253
- b(this, tt, /* @__PURE__ */ new Set());
256
+ b(this, it, /* @__PURE__ */ new Set());
254
257
  /**
255
258
  * Deferred effects that are MAYBE_DIRTY
256
259
  * @type {Set<Effect>}
257
260
  */
258
- b(this, Ce, /* @__PURE__ */ new Set());
261
+ b(this, ke, /* @__PURE__ */ new Set());
259
262
  /**
260
- * A set of branches that still exist, but will be destroyed when this batch
261
- * is committed — we skip over these during `process`
262
- * @type {Set<Effect>}
263
+ * A map of branches that still exist, but will be destroyed when this batch
264
+ * is committed — we skip over these during `process`.
265
+ * The value contains child effects that were dirty/maybe_dirty before being reset,
266
+ * so they can be rescheduled if the branch survives.
267
+ * @type {Map<Effect, { d: Effect[], m: Effect[] }>}
263
268
  */
264
- g(this, "skipped_effects", /* @__PURE__ */ new Set());
265
- g(this, "is_fork", !1);
266
- b(this, De, !1);
269
+ b(this, ae, /* @__PURE__ */ new Map());
270
+ p(this, "is_fork", !1);
271
+ b(this, qe, !1);
267
272
  }
268
273
  is_deferred() {
269
- return this.is_fork || o(this, qe) > 0;
274
+ return this.is_fork || l(this, Me) > 0;
275
+ }
276
+ /**
277
+ * Add an effect to the #skipped_branches map and reset its children
278
+ * @param {Effect} effect
279
+ */
280
+ skip_effect(e) {
281
+ l(this, ae).has(e) || l(this, ae).set(e, { d: [], m: [] });
282
+ }
283
+ /**
284
+ * Remove an effect from the #skipped_branches map and reschedule
285
+ * any tracked dirty/maybe_dirty child effects
286
+ * @param {Effect} effect
287
+ */
288
+ unskip_effect(e) {
289
+ var n = l(this, ae).get(e);
290
+ if (n) {
291
+ l(this, ae).delete(e);
292
+ for (var i of n.d)
293
+ A(i, I), ne(i);
294
+ for (i of n.m)
295
+ A(i, Q), ne(i);
296
+ }
270
297
  }
271
298
  /**
272
299
  *
273
300
  * @param {Effect[]} root_effects
274
301
  */
275
302
  process(e) {
276
- D = [], this.apply();
277
- var n = [], r = [];
278
- for (const i of e)
279
- C(this, ne, Lt).call(this, i, n, r);
303
+ F = [], this.apply();
304
+ var n = [], i = [];
305
+ for (const r of e)
306
+ k(this, re, Lt).call(this, r, n, i);
280
307
  if (this.is_deferred()) {
281
- C(this, ne, Ft).call(this, r), C(this, ne, Ft).call(this, n);
282
- for (const i of this.skipped_effects)
283
- Tn(i);
308
+ k(this, re, Ft).call(this, i), k(this, re, Ft).call(this, n);
309
+ for (const [r, s] of l(this, ae))
310
+ On(r, s);
284
311
  } else {
285
- for (const i of o(this, Fe)) i();
286
- o(this, Fe).clear(), o(this, Se) === 0 && C(this, ne, Cn).call(this), A = null, Qt(r), Qt(n), o(this, et)?.resolve();
312
+ for (const r of l(this, Be)) r();
313
+ l(this, Be).clear(), l(this, Ae) === 0 && k(this, re, kn).call(this), x = null, Jt(i), Jt(n), l(this, nt)?.resolve();
287
314
  }
288
- V = null;
315
+ U = null;
289
316
  }
290
317
  /**
291
318
  * Associate a change to a given source with the current
@@ -294,315 +321,315 @@ const Ut = class Ut {
294
321
  * @param {any} value
295
322
  */
296
323
  capture(e, n) {
297
- n !== R && !this.previous.has(e) && this.previous.set(e, n), (e.f & Je) === 0 && (this.current.set(e, e.v), V?.set(e, e.v));
324
+ n !== O && !this.previous.has(e) && this.previous.set(e, n), (e.f & Ze) === 0 && (this.current.set(e, e.v), U?.set(e, e.v));
298
325
  }
299
326
  activate() {
300
- A = this, this.apply();
327
+ x = this, this.apply();
301
328
  }
302
329
  deactivate() {
303
- A === this && (A = null, V = null);
330
+ x === this && (x = null, U = null);
304
331
  }
305
332
  flush() {
306
- if (this.activate(), D.length > 0) {
307
- if (An(), A !== null && A !== this)
333
+ if (this.activate(), F.length > 0) {
334
+ if (xn(), x !== null && x !== this)
308
335
  return;
309
- } else o(this, Se) === 0 && this.process([]);
336
+ } else l(this, Ae) === 0 && this.process([]);
310
337
  this.deactivate();
311
338
  }
312
339
  discard() {
313
- for (const e of o(this, Be)) e(this);
314
- o(this, Be).clear();
340
+ for (const e of l(this, De)) e(this);
341
+ l(this, De).clear();
315
342
  }
316
343
  /**
317
344
  *
318
345
  * @param {boolean} blocking
319
346
  */
320
347
  increment(e) {
321
- _(this, Se, o(this, Se) + 1), e && _(this, qe, o(this, qe) + 1);
348
+ m(this, Ae, l(this, Ae) + 1), e && m(this, Me, l(this, Me) + 1);
322
349
  }
323
350
  /**
324
351
  *
325
352
  * @param {boolean} blocking
326
353
  */
327
354
  decrement(e) {
328
- _(this, Se, o(this, Se) - 1), e && _(this, qe, o(this, qe) - 1), !o(this, De) && (_(this, De, !0), Le(() => {
329
- _(this, De, !1), this.is_deferred() ? D.length > 0 && this.flush() : this.revive();
355
+ m(this, Ae, l(this, Ae) - 1), e && m(this, Me, l(this, Me) - 1), !l(this, qe) && (m(this, qe, !0), Fe(() => {
356
+ m(this, qe, !1), this.is_deferred() ? F.length > 0 && this.flush() : this.revive();
330
357
  }));
331
358
  }
332
359
  revive() {
333
- for (const e of o(this, tt))
334
- o(this, Ce).delete(e), T(e, F), ve(e);
335
- for (const e of o(this, Ce))
336
- T(e, he), ve(e);
360
+ for (const e of l(this, it))
361
+ l(this, ke).delete(e), A(e, I), ne(e);
362
+ for (const e of l(this, ke))
363
+ A(e, Q), ne(e);
337
364
  this.flush();
338
365
  }
339
366
  /** @param {() => void} fn */
340
367
  oncommit(e) {
341
- o(this, Fe).add(e);
368
+ l(this, Be).add(e);
342
369
  }
343
370
  /** @param {(batch: Batch) => void} fn */
344
371
  ondiscard(e) {
345
- o(this, Be).add(e);
372
+ l(this, De).add(e);
346
373
  }
347
374
  settled() {
348
- return (o(this, et) ?? _(this, et, _r())).promise;
375
+ return (l(this, nt) ?? m(this, nt, yi())).promise;
349
376
  }
350
377
  static ensure() {
351
- if (A === null) {
352
- const e = A = new Ut();
353
- lt.add(A), Ke || Le(() => {
354
- A === e && e.flush();
378
+ if (x === null) {
379
+ const e = x = new Ut();
380
+ at.add(x), Je || Fe(() => {
381
+ x === e && e.flush();
355
382
  });
356
383
  }
357
- return A;
384
+ return x;
358
385
  }
359
386
  apply() {
360
387
  }
361
388
  };
362
- Fe = new WeakMap(), Be = new WeakMap(), Se = new WeakMap(), qe = new WeakMap(), et = new WeakMap(), tt = new WeakMap(), Ce = new WeakMap(), De = new WeakMap(), ne = new WeakSet(), /**
389
+ Be = new WeakMap(), De = new WeakMap(), Ae = new WeakMap(), Me = new WeakMap(), nt = new WeakMap(), it = new WeakMap(), ke = new WeakMap(), ae = new WeakMap(), qe = new WeakMap(), re = new WeakSet(), /**
363
390
  * Traverse the effect tree, executing effects or stashing
364
391
  * them for later execution as appropriate
365
392
  * @param {Effect} root
366
393
  * @param {Effect[]} effects
367
394
  * @param {Effect[]} render_effects
368
395
  */
369
- Lt = function(e, n, r) {
370
- e.f ^= O;
371
- for (var i = e.first, s = null; i !== null; ) {
372
- var l = i.f, a = (l & (fe | be)) !== 0, u = a && (l & O) !== 0, c = u || (l & pe) !== 0 || this.skipped_effects.has(i);
373
- if (!c && i.fn !== null) {
374
- a ? i.f ^= O : s !== null && (l & (Ot | cn | fn)) !== 0 ? s.b.defer_effect(i) : (l & Ot) !== 0 ? n.push(i) : rt(i) && ((l & ce) !== 0 && o(this, Ce).add(i), Ze(i));
375
- var h = i.first;
396
+ Lt = function(e, n, i) {
397
+ e.f ^= N;
398
+ for (var r = e.first, s = null; r !== null; ) {
399
+ var o = r.f, a = (o & (pe | Ce)) !== 0, u = a && (o & N) !== 0, c = u || (o & ve) !== 0 || l(this, ae).has(r);
400
+ if (!c && r.fn !== null) {
401
+ a ? r.f ^= N : s !== null && (o & (yt | hn | dn)) !== 0 ? s.b.defer_effect(r) : (o & yt) !== 0 ? n.push(r) : st(r) && ((o & ge) !== 0 && l(this, ke).add(r), Ge(r));
402
+ var h = r.first;
376
403
  if (h !== null) {
377
- i = h;
404
+ r = h;
378
405
  continue;
379
406
  }
380
407
  }
381
- var f = i.parent;
382
- for (i = i.next; i === null && f !== null; )
383
- f === s && (s = null), i = f.next, f = f.parent;
408
+ var f = r.parent;
409
+ for (r = r.next; r === null && f !== null; )
410
+ f === s && (s = null), r = f.next, f = f.parent;
384
411
  }
385
412
  }, /**
386
413
  * @param {Effect[]} effects
387
414
  */
388
415
  Ft = function(e) {
389
416
  for (var n = 0; n < e.length; n += 1)
390
- Sn(e[n], o(this, tt), o(this, Ce));
391
- }, Cn = function() {
392
- var i;
393
- if (lt.size > 1) {
417
+ An(e[n], l(this, it), l(this, ke));
418
+ }, kn = function() {
419
+ var r;
420
+ if (at.size > 1) {
394
421
  this.previous.clear();
395
- var e = V, n = !0;
396
- for (const s of lt) {
422
+ var e = U, n = !0;
423
+ for (const s of at) {
397
424
  if (s === this) {
398
425
  n = !1;
399
426
  continue;
400
427
  }
401
- const l = [];
428
+ const o = [];
402
429
  for (const [u, c] of this.current) {
403
430
  if (s.current.has(u))
404
431
  if (n && c !== s.current.get(u))
405
432
  s.current.set(u, c);
406
433
  else
407
434
  continue;
408
- l.push(u);
435
+ o.push(u);
409
436
  }
410
- if (l.length === 0)
437
+ if (o.length === 0)
411
438
  continue;
412
439
  const a = [...s.current.keys()].filter((u) => !this.current.has(u));
413
440
  if (a.length > 0) {
414
- var r = D;
415
- D = [];
441
+ var i = F;
442
+ F = [];
416
443
  const u = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
417
- for (const h of l)
418
- kn(h, a, u, c);
419
- if (D.length > 0) {
420
- A = s, s.apply();
421
- for (const h of D)
422
- C(i = s, ne, Lt).call(i, h, [], []);
444
+ for (const h of o)
445
+ Tn(h, a, u, c);
446
+ if (F.length > 0) {
447
+ x = s, s.apply();
448
+ for (const h of F)
449
+ k(r = s, re, Lt).call(r, h, [], []);
423
450
  s.deactivate();
424
451
  }
425
- D = r;
452
+ F = i;
426
453
  }
427
454
  }
428
- A = null, V = e;
455
+ x = null, U = e;
429
456
  }
430
- this.committed = !0, lt.delete(this);
457
+ this.committed = !0, at.delete(this);
431
458
  };
432
- let ue = Ut;
433
- function Q(t) {
434
- var e = Ke;
435
- Ke = !0;
459
+ let de = Ut;
460
+ function J(t) {
461
+ var e = Je;
462
+ Je = !0;
436
463
  try {
437
464
  for (var n; ; ) {
438
- if (Fr(), D.length === 0 && (A?.flush(), D.length === 0))
439
- return St = null, /** @type {T} */
465
+ if (Mi(), F.length === 0 && (x?.flush(), F.length === 0))
466
+ return $t = null, /** @type {T} */
440
467
  n;
441
- An();
468
+ xn();
442
469
  }
443
470
  } finally {
444
- Ke = e;
471
+ Je = e;
445
472
  }
446
473
  }
447
- function An() {
448
- Nt = !0;
474
+ function xn() {
475
+ It = !0;
449
476
  var t = null;
450
477
  try {
451
- for (var e = 0; D.length > 0; ) {
452
- var n = ue.ensure();
478
+ for (var e = 0; F.length > 0; ) {
479
+ var n = de.ensure();
453
480
  if (e++ > 1e3) {
454
- var r, i;
455
- qr();
481
+ var i, r;
482
+ ji();
456
483
  }
457
- n.process(D), _e.clear();
484
+ n.process(F), ye.clear();
458
485
  }
459
486
  } finally {
460
- Nt = !1, St = null;
487
+ F = [], It = !1, $t = null;
461
488
  }
462
489
  }
463
- function qr() {
490
+ function ji() {
464
491
  try {
465
- $r();
492
+ Ai();
466
493
  } catch (t) {
467
- yt(t, St);
494
+ Ct(t, $t);
468
495
  }
469
496
  }
470
- let ie = null;
471
- function Qt(t) {
497
+ let le = null;
498
+ function Jt(t) {
472
499
  var e = t.length;
473
500
  if (e !== 0) {
474
501
  for (var n = 0; n < e; ) {
475
- var r = t[n++];
476
- if ((r.f & (ge | pe)) === 0 && rt(r) && (ie = /* @__PURE__ */ new Set(), Ze(r), r.deps === null && r.first === null && r.nodes === null && (r.teardown === null && r.ac === null ? Un(r) : r.fn = null), ie?.size > 0)) {
477
- _e.clear();
478
- for (const i of ie) {
479
- if ((i.f & (ge | pe)) !== 0) continue;
480
- const s = [i];
481
- let l = i.parent;
482
- for (; l !== null; )
483
- ie.has(l) && (ie.delete(l), s.push(l)), l = l.parent;
502
+ var i = t[n++];
503
+ if ((i.f & (_e | ve)) === 0 && st(i) && (le = /* @__PURE__ */ new Set(), Ge(i), i.deps === null && i.first === null && i.nodes === null && i.teardown === null && i.ac === null && Un(i), le?.size > 0)) {
504
+ ye.clear();
505
+ for (const r of le) {
506
+ if ((r.f & (_e | ve)) !== 0) continue;
507
+ const s = [r];
508
+ let o = r.parent;
509
+ for (; o !== null; )
510
+ le.has(o) && (le.delete(o), s.push(o)), o = o.parent;
484
511
  for (let a = s.length - 1; a >= 0; a--) {
485
512
  const u = s[a];
486
- (u.f & (ge | pe)) === 0 && Ze(u);
513
+ (u.f & (_e | ve)) === 0 && Ge(u);
487
514
  }
488
515
  }
489
- ie.clear();
516
+ le.clear();
490
517
  }
491
518
  }
492
- ie = null;
519
+ le = null;
493
520
  }
494
521
  }
495
- function kn(t, e, n, r) {
522
+ function Tn(t, e, n, i) {
496
523
  if (!n.has(t) && (n.add(t), t.reactions !== null))
497
- for (const i of t.reactions) {
498
- const s = i.f;
499
- (s & x) !== 0 ? kn(
524
+ for (const r of t.reactions) {
525
+ const s = r.f;
526
+ (s & R) !== 0 ? Tn(
500
527
  /** @type {Derived} */
501
- i,
528
+ r,
502
529
  e,
503
530
  n,
504
- r
505
- ) : (s & (dn | ce)) !== 0 && (s & F) === 0 && xn(i, e, r) && (T(i, F), ve(
506
- /** @type {Effect} */
507
531
  i
532
+ ) : (s & (mn | ge)) !== 0 && (s & I) === 0 && Rn(r, e, i) && (A(r, I), ne(
533
+ /** @type {Effect} */
534
+ r
508
535
  ));
509
536
  }
510
537
  }
511
- function xn(t, e, n) {
512
- const r = n.get(t);
513
- if (r !== void 0) return r;
538
+ function Rn(t, e, n) {
539
+ const i = n.get(t);
540
+ if (i !== void 0) return i;
514
541
  if (t.deps !== null)
515
- for (const i of t.deps) {
516
- if (He.call(e, i))
542
+ for (const r of t.deps) {
543
+ if (ze.call(e, r))
517
544
  return !0;
518
- if ((i.f & x) !== 0 && xn(
545
+ if ((r.f & R) !== 0 && Rn(
519
546
  /** @type {Derived} */
520
- i,
547
+ r,
521
548
  e,
522
549
  n
523
550
  ))
524
551
  return n.set(
525
552
  /** @type {Derived} */
526
- i,
553
+ r,
527
554
  !0
528
555
  ), !0;
529
556
  }
530
557
  return n.set(t, !1), !1;
531
558
  }
532
- function ve(t) {
533
- for (var e = St = t; e.parent !== null; ) {
559
+ function ne(t) {
560
+ for (var e = $t = t; e.parent !== null; ) {
534
561
  e = e.parent;
535
562
  var n = e.f;
536
- if (Nt && e === w && (n & ce) !== 0 && (n & hn) === 0)
563
+ if (It && e === w && (n & ge) !== 0 && (n & pn) === 0)
537
564
  return;
538
- if ((n & (be | fe)) !== 0) {
539
- if ((n & O) === 0) return;
540
- e.f ^= O;
565
+ if ((n & (Ce | pe)) !== 0) {
566
+ if ((n & N) === 0) return;
567
+ e.f ^= N;
541
568
  }
542
569
  }
543
- D.push(e);
570
+ F.push(e);
544
571
  }
545
- function Tn(t) {
546
- if (!((t.f & fe) !== 0 && (t.f & O) !== 0)) {
547
- T(t, O);
548
- for (var e = t.first; e !== null; )
549
- Tn(e), e = e.next;
572
+ function On(t, e) {
573
+ if (!((t.f & pe) !== 0 && (t.f & N) !== 0)) {
574
+ (t.f & I) !== 0 ? e.d.push(t) : (t.f & Q) !== 0 && e.m.push(t), A(t, N);
575
+ for (var n = t.first; n !== null; )
576
+ On(n, e), n = n.next;
550
577
  }
551
578
  }
552
- function Dr(t) {
553
- let e = 0, n = Ct(0), r;
579
+ function Pi(t) {
580
+ let e = 0, n = At(0), i;
554
581
  return () => {
555
- Gt() && (y(n), Yn(() => (e === 0 && (r = tr(() => t(() => Qe(n)))), e += 1, () => {
556
- Le(() => {
557
- e -= 1, e === 0 && (r?.(), r = void 0, Qe(n));
582
+ Yt() && (y(n), Yn(() => (e === 0 && (i = ni(() => t(() => Xe(n)))), e += 1, () => {
583
+ Fe(() => {
584
+ e -= 1, e === 0 && (i?.(), i = void 0, Xe(n));
558
585
  });
559
586
  })));
560
587
  };
561
588
  }
562
- var Mr = vt | Ye | Ht;
563
- function Pr(t, e, n) {
564
- new jr(t, e, n);
589
+ var Hi = bt | Ve | gn;
590
+ function zi(t, e, n) {
591
+ new Gi(t, e, n);
565
592
  }
566
- var q, nt, J, Ae, X, j, N, Z, se, de, ke, le, Me, xe, Pe, je, oe, wt, $, Rn, On, Bt, at, ut, qt;
567
- class jr {
593
+ var M, rt, X, xe, Z, P, L, ee, ue, me, Te, ce, je, Re, Pe, He, fe, St, $, Nn, In, Bt, ct, ft, Dt;
594
+ class Gi {
568
595
  /**
569
596
  * @param {TemplateNode} node
570
597
  * @param {BoundaryProps} props
571
598
  * @param {((anchor: Node) => void)} children
572
599
  */
573
- constructor(e, n, r) {
600
+ constructor(e, n, i) {
574
601
  b(this, $);
575
602
  /** @type {Boundary | null} */
576
- g(this, "parent");
577
- g(this, "is_pending", !1);
603
+ p(this, "parent");
604
+ p(this, "is_pending", !1);
578
605
  /** @type {TemplateNode} */
579
- b(this, q);
606
+ b(this, M);
580
607
  /** @type {TemplateNode | null} */
581
- b(this, nt, ee ? M : null);
608
+ b(this, rt, te ? q : null);
582
609
  /** @type {BoundaryProps} */
583
- b(this, J);
610
+ b(this, X);
584
611
  /** @type {((anchor: Node) => void)} */
585
- b(this, Ae);
612
+ b(this, xe);
586
613
  /** @type {Effect} */
587
- b(this, X);
614
+ b(this, Z);
588
615
  /** @type {Effect | null} */
589
- b(this, j, null);
616
+ b(this, P, null);
590
617
  /** @type {Effect | null} */
591
- b(this, N, null);
618
+ b(this, L, null);
592
619
  /** @type {Effect | null} */
593
- b(this, Z, null);
620
+ b(this, ee, null);
594
621
  /** @type {DocumentFragment | null} */
595
- b(this, se, null);
622
+ b(this, ue, null);
596
623
  /** @type {TemplateNode | null} */
597
- b(this, de, null);
598
- b(this, ke, 0);
599
- b(this, le, 0);
600
- b(this, Me, !1);
601
- b(this, xe, !1);
624
+ b(this, me, null);
625
+ b(this, Te, 0);
626
+ b(this, ce, 0);
627
+ b(this, je, !1);
628
+ b(this, Re, !1);
602
629
  /** @type {Set<Effect>} */
603
630
  b(this, Pe, /* @__PURE__ */ new Set());
604
631
  /** @type {Set<Effect>} */
605
- b(this, je, /* @__PURE__ */ new Set());
632
+ b(this, He, /* @__PURE__ */ new Set());
606
633
  /**
607
634
  * A source containing the number of pending async deriveds/expressions.
608
635
  * Only created if `$effect.pending()` is used inside the boundary,
@@ -610,37 +637,37 @@ class jr {
610
637
  * calls followed by no-op flushes
611
638
  * @type {Source<number> | null}
612
639
  */
613
- b(this, oe, null);
614
- b(this, wt, Dr(() => (_(this, oe, Ct(o(this, ke))), () => {
615
- _(this, oe, null);
640
+ b(this, fe, null);
641
+ b(this, St, Pi(() => (m(this, fe, At(l(this, Te))), () => {
642
+ m(this, fe, null);
616
643
  })));
617
- _(this, q, e), _(this, J, n), _(this, Ae, r), this.parent = /** @type {Effect} */
618
- w.b, this.is_pending = !!o(this, J).pending, _(this, X, Xr(() => {
619
- if (w.b = this, ee) {
620
- const s = o(this, nt);
644
+ m(this, M, e), m(this, X, n), m(this, xe, i), this.parent = /** @type {Effect} */
645
+ w.b, this.is_pending = !!l(this, X).pending, m(this, Z, rr(() => {
646
+ if (w.b = this, te) {
647
+ const s = l(this, rt);
621
648
  _n(), /** @type {Comment} */
622
- s.nodeType === $t && /** @type {Comment} */
623
- s.data === an ? C(this, $, On).call(this) : (C(this, $, Rn).call(this), o(this, le) === 0 && (this.is_pending = !1));
649
+ s.nodeType === Et && /** @type {Comment} */
650
+ s.data === cn ? k(this, $, In).call(this) : (k(this, $, Nn).call(this), l(this, ce) === 0 && (this.is_pending = !1));
624
651
  } else {
625
- var i = C(this, $, Bt).call(this);
652
+ var r = k(this, $, Bt).call(this);
626
653
  try {
627
- _(this, j, we(() => r(i)));
654
+ m(this, P, Se(() => i(r)));
628
655
  } catch (s) {
629
656
  this.error(s);
630
657
  }
631
- o(this, le) > 0 ? C(this, $, ut).call(this) : this.is_pending = !1;
658
+ l(this, ce) > 0 ? k(this, $, ft).call(this) : this.is_pending = !1;
632
659
  }
633
660
  return () => {
634
- o(this, de)?.remove();
661
+ l(this, me)?.remove();
635
662
  };
636
- }, Mr)), ee && _(this, q, M);
663
+ }, Hi)), te && m(this, M, q);
637
664
  }
638
665
  /**
639
666
  * Defer an effect inside a pending boundary until the boundary resolves
640
667
  * @param {Effect} effect
641
668
  */
642
669
  defer_effect(e) {
643
- Sn(e, o(this, Pe), o(this, je));
670
+ An(e, l(this, Pe), l(this, He));
644
671
  }
645
672
  /**
646
673
  * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
@@ -650,7 +677,7 @@ class jr {
650
677
  return !this.is_pending && (!this.parent || this.parent.is_rendered());
651
678
  }
652
679
  has_pending_snippet() {
653
- return !!o(this, J).pending;
680
+ return !!l(this, X).pending;
654
681
  }
655
682
  /**
656
683
  * Update the source that powers `$effect.pending()` inside this boundary,
@@ -659,148 +686,148 @@ class jr {
659
686
  * @param {1 | -1} d
660
687
  */
661
688
  update_pending_count(e) {
662
- C(this, $, qt).call(this, e), _(this, ke, o(this, ke) + e), !(!o(this, oe) || o(this, Me)) && (_(this, Me, !0), Le(() => {
663
- _(this, Me, !1), o(this, oe) && Bn(o(this, oe), o(this, ke));
689
+ k(this, $, Dt).call(this, e), m(this, Te, l(this, Te) + e), !(!l(this, fe) || l(this, je)) && (m(this, je, !0), Fe(() => {
690
+ m(this, je, !1), l(this, fe) && Mn(l(this, fe), l(this, Te));
664
691
  }));
665
692
  }
666
693
  get_effect_pending() {
667
- return o(this, wt).call(this), y(
694
+ return l(this, St).call(this), y(
668
695
  /** @type {Source<number>} */
669
- o(this, oe)
696
+ l(this, fe)
670
697
  );
671
698
  }
672
699
  /** @param {unknown} error */
673
700
  error(e) {
674
- var n = o(this, J).onerror;
675
- let r = o(this, J).failed;
676
- if (o(this, xe) || !n && !r)
701
+ var n = l(this, X).onerror;
702
+ let i = l(this, X).failed;
703
+ if (l(this, Re) || !n && !i)
677
704
  throw e;
678
- o(this, j) && (K(o(this, j)), _(this, j, null)), o(this, N) && (K(o(this, N)), _(this, N, null)), o(this, Z) && (K(o(this, Z)), _(this, Z, null)), ee && (Xe(
705
+ l(this, P) && (W(l(this, P)), m(this, P, null)), l(this, L) && (W(l(this, L)), m(this, L, null)), l(this, ee) && (W(l(this, ee)), m(this, ee, null)), te && (et(
679
706
  /** @type {TemplateNode} */
680
- o(this, nt)
681
- ), Rr(), Xe(Or()));
682
- var i = !1, s = !1;
683
- const l = () => {
684
- if (i) {
685
- Tr();
707
+ l(this, rt)
708
+ ), Ii(), et(Li()));
709
+ var r = !1, s = !1;
710
+ const o = () => {
711
+ if (r) {
712
+ Ni();
686
713
  return;
687
714
  }
688
- i = !0, s && xr(), ue.ensure(), _(this, ke, 0), o(this, Z) !== null && ft(o(this, Z), () => {
689
- _(this, Z, null);
690
- }), this.is_pending = this.has_pending_snippet(), _(this, j, C(this, $, at).call(this, () => (_(this, xe, !1), we(() => o(this, Ae).call(this, o(this, q)))))), o(this, le) > 0 ? C(this, $, ut).call(this) : this.is_pending = !1;
715
+ r = !0, s && Oi(), de.ensure(), m(this, Te, 0), l(this, ee) !== null && dt(l(this, ee), () => {
716
+ m(this, ee, null);
717
+ }), this.is_pending = this.has_pending_snippet(), m(this, P, k(this, $, ct).call(this, () => (m(this, Re, !1), Se(() => l(this, xe).call(this, l(this, M)))))), l(this, ce) > 0 ? k(this, $, ft).call(this) : this.is_pending = !1;
691
718
  };
692
- Le(() => {
719
+ Fe(() => {
693
720
  try {
694
- s = !0, n?.(e, l), s = !1;
721
+ s = !0, n?.(e, o), s = !1;
695
722
  } catch (a) {
696
- yt(a, o(this, X) && o(this, X).parent);
723
+ Ct(a, l(this, Z) && l(this, Z).parent);
697
724
  }
698
- r && _(this, Z, C(this, $, at).call(this, () => {
699
- ue.ensure(), _(this, xe, !0);
725
+ i && m(this, ee, k(this, $, ct).call(this, () => {
726
+ de.ensure(), m(this, Re, !0);
700
727
  try {
701
- return we(() => {
702
- r(
703
- o(this, q),
728
+ return Se(() => {
729
+ i(
730
+ l(this, M),
704
731
  () => e,
705
- () => l
732
+ () => o
706
733
  );
707
734
  });
708
735
  } catch (a) {
709
- return yt(
736
+ return Ct(
710
737
  a,
711
738
  /** @type {Effect} */
712
- o(this, X).parent
739
+ l(this, Z).parent
713
740
  ), null;
714
741
  } finally {
715
- _(this, xe, !1);
742
+ m(this, Re, !1);
716
743
  }
717
744
  }));
718
745
  });
719
746
  }
720
747
  }
721
- q = new WeakMap(), nt = new WeakMap(), J = new WeakMap(), Ae = new WeakMap(), X = new WeakMap(), j = new WeakMap(), N = new WeakMap(), Z = new WeakMap(), se = new WeakMap(), de = new WeakMap(), ke = new WeakMap(), le = new WeakMap(), Me = new WeakMap(), xe = new WeakMap(), Pe = new WeakMap(), je = new WeakMap(), oe = new WeakMap(), wt = new WeakMap(), $ = new WeakSet(), Rn = function() {
748
+ M = new WeakMap(), rt = new WeakMap(), X = new WeakMap(), xe = new WeakMap(), Z = new WeakMap(), P = new WeakMap(), L = new WeakMap(), ee = new WeakMap(), ue = new WeakMap(), me = new WeakMap(), Te = new WeakMap(), ce = new WeakMap(), je = new WeakMap(), Re = new WeakMap(), Pe = new WeakMap(), He = new WeakMap(), fe = new WeakMap(), St = new WeakMap(), $ = new WeakSet(), Nn = function() {
722
749
  try {
723
- _(this, j, we(() => o(this, Ae).call(this, o(this, q))));
750
+ m(this, P, Se(() => l(this, xe).call(this, l(this, M))));
724
751
  } catch (e) {
725
752
  this.error(e);
726
753
  }
727
- }, On = function() {
728
- const e = o(this, J).pending;
729
- e && (_(this, N, we(() => e(o(this, q)))), Le(() => {
730
- var n = C(this, $, Bt).call(this);
731
- _(this, j, C(this, $, at).call(this, () => (ue.ensure(), we(() => o(this, Ae).call(this, n))))), o(this, le) > 0 ? C(this, $, ut).call(this) : (ft(
754
+ }, In = function() {
755
+ const e = l(this, X).pending;
756
+ e && (m(this, L, Se(() => e(l(this, M)))), Fe(() => {
757
+ var n = k(this, $, Bt).call(this);
758
+ m(this, P, k(this, $, ct).call(this, () => (de.ensure(), Se(() => l(this, xe).call(this, n))))), l(this, ce) > 0 ? k(this, $, ft).call(this) : (dt(
732
759
  /** @type {Effect} */
733
- o(this, N),
760
+ l(this, L),
734
761
  () => {
735
- _(this, N, null);
762
+ m(this, L, null);
736
763
  }
737
764
  ), this.is_pending = !1);
738
765
  }));
739
766
  }, Bt = function() {
740
- var e = o(this, q);
741
- return this.is_pending && (_(this, de, Pn()), o(this, q).before(o(this, de)), e = o(this, de)), e;
767
+ var e = l(this, M);
768
+ return this.is_pending && (m(this, me, Hn()), l(this, M).before(l(this, me)), e = l(this, me)), e;
742
769
  }, /**
743
770
  * @param {() => Effect | null} fn
744
771
  */
745
- at = function(e) {
746
- var n = w, r = v, i = U;
747
- ye(o(this, X)), te(o(this, X)), mt(o(this, X).ctx);
772
+ ct = function(e) {
773
+ var n = w, i = _, r = V;
774
+ we(l(this, Z)), ie(l(this, Z)), wt(l(this, Z).ctx);
748
775
  try {
749
776
  return e();
750
777
  } catch (s) {
751
778
  return En(s), null;
752
779
  } finally {
753
- ye(n), te(r), mt(i);
780
+ we(n), ie(i), wt(r);
754
781
  }
755
- }, ut = function() {
782
+ }, ft = function() {
756
783
  const e = (
757
784
  /** @type {(anchor: Node) => void} */
758
- o(this, J).pending
785
+ l(this, X).pending
759
786
  );
760
- o(this, j) !== null && (_(this, se, document.createDocumentFragment()), o(this, se).append(
787
+ l(this, P) !== null && (m(this, ue, document.createDocumentFragment()), l(this, ue).append(
761
788
  /** @type {TemplateNode} */
762
- o(this, de)
763
- ), ti(o(this, j), o(this, se))), o(this, N) === null && _(this, N, we(() => e(o(this, q))));
789
+ l(this, me)
790
+ ), lr(l(this, P), l(this, ue))), l(this, L) === null && m(this, L, Se(() => e(l(this, M))));
764
791
  }, /**
765
792
  * Updates the pending count associated with the currently visible pending snippet,
766
793
  * if any, such that we can replace the snippet with content once work is done
767
794
  * @param {1 | -1} d
768
795
  */
769
- qt = function(e) {
796
+ Dt = function(e) {
770
797
  var n;
771
798
  if (!this.has_pending_snippet()) {
772
- this.parent && C(n = this.parent, $, qt).call(n, e);
799
+ this.parent && k(n = this.parent, $, Dt).call(n, e);
773
800
  return;
774
801
  }
775
- if (_(this, le, o(this, le) + e), o(this, le) === 0) {
802
+ if (m(this, ce, l(this, ce) + e), l(this, ce) === 0) {
776
803
  this.is_pending = !1;
777
- for (const r of o(this, Pe))
778
- T(r, F), ve(r);
779
- for (const r of o(this, je))
780
- T(r, he), ve(r);
781
- o(this, Pe).clear(), o(this, je).clear(), o(this, N) && ft(o(this, N), () => {
782
- _(this, N, null);
783
- }), o(this, se) && (o(this, q).before(o(this, se)), _(this, se, null));
804
+ for (const i of l(this, Pe))
805
+ A(i, I), ne(i);
806
+ for (const i of l(this, He))
807
+ A(i, Q), ne(i);
808
+ l(this, Pe).clear(), l(this, He).clear(), l(this, L) && dt(l(this, L), () => {
809
+ m(this, L, null);
810
+ }), l(this, ue) && (l(this, M).before(l(this, ue)), m(this, ue, null));
784
811
  }
785
812
  };
786
813
  // @__NO_SIDE_EFFECTS__
787
- function In(t) {
788
- var e = x | F, n = v !== null && (v.f & x) !== 0 ? (
814
+ function Ln(t) {
815
+ var e = R | I, n = _ !== null && (_.f & R) !== 0 ? (
789
816
  /** @type {Derived} */
790
- v
817
+ _
791
818
  ) : null;
792
- return w !== null && (w.f |= Ye), {
793
- ctx: U,
819
+ return w !== null && (w.f |= Ve), {
820
+ ctx: V,
794
821
  deps: null,
795
822
  effects: null,
796
- equals: vn,
823
+ equals: yn,
797
824
  f: e,
798
825
  fn: t,
799
826
  reactions: null,
800
827
  rv: 0,
801
828
  v: (
802
829
  /** @type {V} */
803
- R
830
+ O
804
831
  ),
805
832
  wv: 0,
806
833
  parent: n ?? w,
@@ -808,25 +835,25 @@ function In(t) {
808
835
  };
809
836
  }
810
837
  // @__NO_SIDE_EFFECTS__
811
- function Hr(t) {
812
- const e = /* @__PURE__ */ In(t);
838
+ function Yi(t) {
839
+ const e = /* @__PURE__ */ Ln(t);
813
840
  return Wn(e), e;
814
841
  }
815
- function Nn(t) {
842
+ function Vi(t) {
816
843
  var e = t.effects;
817
844
  if (e !== null) {
818
845
  t.effects = null;
819
846
  for (var n = 0; n < e.length; n += 1)
820
- K(
847
+ W(
821
848
  /** @type {Effect} */
822
849
  e[n]
823
850
  );
824
851
  }
825
852
  }
826
- function Yr(t) {
853
+ function Ui(t) {
827
854
  for (var e = t.parent; e !== null; ) {
828
- if ((e.f & x) === 0)
829
- return (e.f & ge) === 0 ? (
855
+ if ((e.f & R) === 0)
856
+ return (e.f & _e) === 0 ? (
830
857
  /** @type {Effect} */
831
858
  e
832
859
  ) : null;
@@ -834,116 +861,126 @@ function Yr(t) {
834
861
  }
835
862
  return null;
836
863
  }
837
- function zt(t) {
864
+ function Gt(t) {
838
865
  var e, n = w;
839
- ye(Yr(t));
866
+ we(Ui(t));
840
867
  try {
841
- t.f &= ~Re, Nn(t), e = Xn(t);
868
+ t.f &= ~Ne, Vi(t), e = Zn(t);
842
869
  } finally {
843
- ye(n);
870
+ we(n);
844
871
  }
845
872
  return e;
846
873
  }
847
- function Ln(t) {
848
- var e = zt(t);
849
- if (!t.equals(e) && (t.wv = Qn(), (!A?.is_fork || t.deps === null) && (t.v = e, t.deps === null))) {
850
- T(t, O);
874
+ function Fn(t) {
875
+ var e = Gt(t);
876
+ if (!t.equals(e) && (t.wv = Jn(), (!x?.is_fork || t.deps === null) && (t.v = e, t.deps === null))) {
877
+ A(t, N);
851
878
  return;
852
879
  }
853
- me || (V !== null ? (Gt() || A?.is_fork) && V.set(t, e) : Yt(t));
880
+ be || (U !== null ? (Yt() || x?.is_fork) && U.set(t, e) : zt(t));
854
881
  }
855
- let Dt = /* @__PURE__ */ new Set();
856
- const _e = /* @__PURE__ */ new Map();
857
- let Fn = !1;
858
- function Ct(t, e) {
882
+ function Ki(t) {
883
+ if (t.effects !== null)
884
+ for (const e of t.effects)
885
+ (e.teardown || e.ac) && (e.teardown?.(), e.ac?.abort(Ht), e.teardown = vi, e.ac = null, tt(e, 0), Vt(e));
886
+ }
887
+ function Bn(t) {
888
+ if (t.effects !== null)
889
+ for (const e of t.effects)
890
+ e.teardown && Ge(e);
891
+ }
892
+ let Mt = /* @__PURE__ */ new Set();
893
+ const ye = /* @__PURE__ */ new Map();
894
+ let Dn = !1;
895
+ function At(t, e) {
859
896
  var n = {
860
897
  f: 0,
861
898
  // TODO ideally we could skip this altogether, but it causes type errors
862
899
  v: t,
863
900
  reactions: null,
864
- equals: vn,
901
+ equals: yn,
865
902
  rv: 0,
866
903
  wv: 0
867
904
  };
868
905
  return n;
869
906
  }
870
907
  // @__NO_SIDE_EFFECTS__
871
- function Y(t, e) {
872
- const n = Ct(t);
908
+ function z(t, e) {
909
+ const n = At(t);
873
910
  return Wn(n), n;
874
911
  }
875
912
  // @__NO_SIDE_EFFECTS__
876
- function zr(t, e = !1, n = !0) {
877
- const r = Ct(t);
878
- return e || (r.equals = Nr), r;
913
+ function Wi(t, e = !1, n = !0) {
914
+ const i = At(t);
915
+ return e || (i.equals = Bi), i;
879
916
  }
880
- function k(t, e, n = !1) {
881
- v !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
917
+ function T(t, e, n = !1) {
918
+ _ !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
882
919
  // to ensure we error if state is set inside an inspect effect
883
- (!W || (v.f & Kt) !== 0) && bn() && (v.f & (x | ce | dn | Kt)) !== 0 && (G === null || !He.call(G, t)) && kr();
884
- let r = n ? We(e) : e;
885
- return Bn(t, r);
920
+ (!K || (_.f & Qt) !== 0) && Cn() && (_.f & (R | ge | mn | Qt)) !== 0 && (Y === null || !ze.call(Y, t)) && Ri();
921
+ let i = n ? Qe(e) : e;
922
+ return Mn(t, i);
886
923
  }
887
- function Bn(t, e) {
924
+ function Mn(t, e) {
888
925
  if (!t.equals(e)) {
889
926
  var n = t.v;
890
- me ? _e.set(t, e) : _e.set(t, n), t.v = e;
891
- var r = ue.ensure();
892
- if (r.capture(t, n), (t.f & x) !== 0) {
893
- const i = (
927
+ be ? ye.set(t, e) : ye.set(t, n), t.v = e;
928
+ var i = de.ensure();
929
+ if (i.capture(t, n), (t.f & R) !== 0) {
930
+ const r = (
894
931
  /** @type {Derived} */
895
932
  t
896
933
  );
897
- (t.f & F) !== 0 && zt(i), Yt(i);
934
+ (t.f & I) !== 0 && Gt(r), zt(r);
898
935
  }
899
- t.wv = Qn(), qn(t, F), w !== null && (w.f & O) !== 0 && (w.f & (fe | be)) === 0 && (P === null ? ni([t]) : P.push(t)), !r.is_fork && Dt.size > 0 && !Fn && Gr();
936
+ t.wv = Jn(), qn(t, I), w !== null && (w.f & N) !== 0 && (w.f & (pe | Ce)) === 0 && (j === null ? ar([t]) : j.push(t)), !i.is_fork && Mt.size > 0 && !Dn && Qi();
900
937
  }
901
938
  return e;
902
939
  }
903
- function Gr() {
904
- Fn = !1;
905
- for (const t of Dt)
906
- (t.f & O) !== 0 && T(t, he), rt(t) && Ze(t);
907
- Dt.clear();
940
+ function Qi() {
941
+ Dn = !1;
942
+ for (const t of Mt)
943
+ (t.f & N) !== 0 && A(t, Q), st(t) && Ge(t);
944
+ Mt.clear();
908
945
  }
909
- function Qe(t) {
910
- k(t, t.v + 1);
946
+ function Xe(t) {
947
+ T(t, t.v + 1);
911
948
  }
912
949
  function qn(t, e) {
913
950
  var n = t.reactions;
914
951
  if (n !== null)
915
- for (var r = n.length, i = 0; i < r; i++) {
916
- var s = n[i], l = s.f, a = (l & F) === 0;
917
- if (a && T(s, e), (l & x) !== 0) {
952
+ for (var i = n.length, r = 0; r < i; r++) {
953
+ var s = n[r], o = s.f, a = (o & I) === 0;
954
+ if (a && A(s, e), (o & R) !== 0) {
918
955
  var u = (
919
956
  /** @type {Derived} */
920
957
  s
921
958
  );
922
- V?.delete(u), (l & Re) === 0 && (l & z && (s.f |= Re), qn(u, he));
923
- } else a && ((l & ce) !== 0 && ie !== null && ie.add(
959
+ U?.delete(u), (o & Ne) === 0 && (o & G && (s.f |= Ne), qn(u, Q));
960
+ } else a && ((o & ge) !== 0 && le !== null && le.add(
924
961
  /** @type {Effect} */
925
962
  s
926
- ), ve(
963
+ ), ne(
927
964
  /** @type {Effect} */
928
965
  s
929
966
  ));
930
967
  }
931
968
  }
932
- function We(t) {
933
- if (typeof t != "object" || t === null || Tt in t)
969
+ function Qe(t) {
970
+ if (typeof t != "object" || t === null || Rt in t)
934
971
  return t;
935
- const e = pr(t);
936
- if (e !== hr && e !== dr)
972
+ const e = mi(t);
973
+ if (e !== gi && e !== pi)
937
974
  return t;
938
- var n = /* @__PURE__ */ new Map(), r = ur(t), i = /* @__PURE__ */ Y(0), s = Te, l = (a) => {
939
- if (Te === s)
975
+ var n = /* @__PURE__ */ new Map(), i = fi(t), r = /* @__PURE__ */ z(0), s = Oe, o = (a) => {
976
+ if (Oe === s)
940
977
  return a();
941
- var u = v, c = Te;
942
- te(null), Zt(s);
978
+ var u = _, c = Oe;
979
+ ie(null), en(s);
943
980
  var h = a();
944
- return te(u), Zt(c), h;
981
+ return ie(u), en(c), h;
945
982
  };
946
- return r && n.set("length", /* @__PURE__ */ Y(
983
+ return i && n.set("length", /* @__PURE__ */ z(
947
984
  /** @type {any[]} */
948
985
  t.length
949
986
  )), new Proxy(
@@ -951,34 +988,34 @@ function We(t) {
951
988
  t,
952
989
  {
953
990
  defineProperty(a, u, c) {
954
- (!("value" in c) || c.configurable === !1 || c.enumerable === !1 || c.writable === !1) && Cr();
991
+ (!("value" in c) || c.configurable === !1 || c.enumerable === !1 || c.writable === !1) && xi();
955
992
  var h = n.get(u);
956
- return h === void 0 ? h = l(() => {
957
- var f = /* @__PURE__ */ Y(c.value);
993
+ return h === void 0 ? o(() => {
994
+ var f = /* @__PURE__ */ z(c.value);
958
995
  return n.set(u, f), f;
959
- }) : k(h, c.value, !0), !0;
996
+ }) : T(h, c.value, !0), !0;
960
997
  },
961
998
  deleteProperty(a, u) {
962
999
  var c = n.get(u);
963
1000
  if (c === void 0) {
964
1001
  if (u in a) {
965
- const h = l(() => /* @__PURE__ */ Y(R));
966
- n.set(u, h), Qe(i);
1002
+ const h = o(() => /* @__PURE__ */ z(O));
1003
+ n.set(u, h), Xe(r);
967
1004
  }
968
1005
  } else
969
- k(c, R), Qe(i);
1006
+ T(c, O), Xe(r);
970
1007
  return !0;
971
1008
  },
972
1009
  get(a, u, c) {
973
- if (u === Tt)
1010
+ if (u === Rt)
974
1011
  return t;
975
1012
  var h = n.get(u), f = u in a;
976
- if (h === void 0 && (!f || Ne(a, u)?.writable) && (h = l(() => {
977
- var p = We(f ? a[u] : R), m = /* @__PURE__ */ Y(p);
978
- return m;
1013
+ if (h === void 0 && (!f || Le(a, u)?.writable) && (h = o(() => {
1014
+ var g = Qe(f ? a[u] : O), v = /* @__PURE__ */ z(g);
1015
+ return v;
979
1016
  }), n.set(u, h)), h !== void 0) {
980
1017
  var d = y(h);
981
- return d === R ? void 0 : d;
1018
+ return d === O ? void 0 : d;
982
1019
  }
983
1020
  return Reflect.get(a, u, c);
984
1021
  },
@@ -989,7 +1026,7 @@ function We(t) {
989
1026
  h && (c.value = y(h));
990
1027
  } else if (c === void 0) {
991
1028
  var f = n.get(u), d = f?.v;
992
- if (f !== void 0 && d !== R)
1029
+ if (f !== void 0 && d !== O)
993
1030
  return {
994
1031
  enumerable: !0,
995
1032
  configurable: !0,
@@ -1000,122 +1037,128 @@ function We(t) {
1000
1037
  return c;
1001
1038
  },
1002
1039
  has(a, u) {
1003
- if (u === Tt)
1040
+ if (u === Rt)
1004
1041
  return !0;
1005
- var c = n.get(u), h = c !== void 0 && c.v !== R || Reflect.has(a, u);
1006
- if (c !== void 0 || w !== null && (!h || Ne(a, u)?.writable)) {
1007
- c === void 0 && (c = l(() => {
1008
- var d = h ? We(a[u]) : R, p = /* @__PURE__ */ Y(d);
1009
- return p;
1042
+ var c = n.get(u), h = c !== void 0 && c.v !== O || Reflect.has(a, u);
1043
+ if (c !== void 0 || w !== null && (!h || Le(a, u)?.writable)) {
1044
+ c === void 0 && (c = o(() => {
1045
+ var d = h ? Qe(a[u]) : O, g = /* @__PURE__ */ z(d);
1046
+ return g;
1010
1047
  }), n.set(u, c));
1011
1048
  var f = y(c);
1012
- if (f === R)
1049
+ if (f === O)
1013
1050
  return !1;
1014
1051
  }
1015
1052
  return h;
1016
1053
  },
1017
1054
  set(a, u, c, h) {
1018
1055
  var f = n.get(u), d = u in a;
1019
- if (r && u === "length")
1020
- for (var p = c; p < /** @type {Source<number>} */
1021
- f.v; p += 1) {
1022
- var m = n.get(p + "");
1023
- m !== void 0 ? k(m, R) : p in a && (m = l(() => /* @__PURE__ */ Y(R)), n.set(p + "", m));
1056
+ if (i && u === "length")
1057
+ for (var g = c; g < /** @type {Source<number>} */
1058
+ f.v; g += 1) {
1059
+ var v = n.get(g + "");
1060
+ v !== void 0 ? T(v, O) : g in a && (v = o(() => /* @__PURE__ */ z(O)), n.set(g + "", v));
1024
1061
  }
1025
1062
  if (f === void 0)
1026
- (!d || Ne(a, u)?.writable) && (f = l(() => /* @__PURE__ */ Y(void 0)), k(f, We(c)), n.set(u, f));
1063
+ (!d || Le(a, u)?.writable) && (f = o(() => /* @__PURE__ */ z(void 0)), T(f, Qe(c)), n.set(u, f));
1027
1064
  else {
1028
- d = f.v !== R;
1029
- var I = l(() => We(c));
1030
- k(f, I);
1065
+ d = f.v !== O;
1066
+ var S = o(() => Qe(c));
1067
+ T(f, S);
1031
1068
  }
1032
- var S = Reflect.getOwnPropertyDescriptor(a, u);
1033
- if (S?.set && S.set.call(h, c), !d) {
1034
- if (r && typeof u == "string") {
1035
- var Ue = (
1069
+ var E = Reflect.getOwnPropertyDescriptor(a, u);
1070
+ if (E?.set && E.set.call(h, c), !d) {
1071
+ if (i && typeof u == "string") {
1072
+ var se = (
1036
1073
  /** @type {Source<number>} */
1037
1074
  n.get("length")
1038
- ), Oe = Number(u);
1039
- Number.isInteger(Oe) && Oe >= Ue.v && k(Ue, Oe + 1);
1075
+ ), Ie = Number(u);
1076
+ Number.isInteger(Ie) && Ie >= se.v && T(se, Ie + 1);
1040
1077
  }
1041
- Qe(i);
1078
+ Xe(r);
1042
1079
  }
1043
1080
  return !0;
1044
1081
  },
1045
1082
  ownKeys(a) {
1046
- y(i);
1083
+ y(r);
1047
1084
  var u = Reflect.ownKeys(a).filter((f) => {
1048
1085
  var d = n.get(f);
1049
- return d === void 0 || d.v !== R;
1086
+ return d === void 0 || d.v !== O;
1050
1087
  });
1051
1088
  for (var [c, h] of n)
1052
- h.v !== R && !(c in a) && u.push(c);
1089
+ h.v !== O && !(c in a) && u.push(c);
1053
1090
  return u;
1054
1091
  },
1055
1092
  setPrototypeOf() {
1056
- Ar();
1093
+ Ti();
1057
1094
  }
1058
1095
  }
1059
1096
  );
1060
1097
  }
1061
- var Jt, Dn, Mn;
1062
- function Mt() {
1063
- if (Jt === void 0) {
1064
- Jt = window;
1098
+ var Xt, jn, Pn;
1099
+ function qt() {
1100
+ if (Xt === void 0) {
1101
+ Xt = window;
1065
1102
  var t = Element.prototype, e = Node.prototype, n = Text.prototype;
1066
- Dn = Ne(e, "firstChild").get, Mn = Ne(e, "nextSibling").get, Wt(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Wt(n) && (n.__t = void 0);
1103
+ jn = Le(e, "firstChild").get, Pn = Le(e, "nextSibling").get, Wt(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Wt(n) && (n.__t = void 0);
1067
1104
  }
1068
1105
  }
1069
- function Pn(t = "") {
1106
+ function Hn(t = "") {
1070
1107
  return document.createTextNode(t);
1071
1108
  }
1072
1109
  // @__NO_SIDE_EFFECTS__
1073
- function Ur(t) {
1110
+ function Ji(t) {
1074
1111
  return (
1075
1112
  /** @type {TemplateNode | null} */
1076
- Dn.call(t)
1113
+ jn.call(t)
1077
1114
  );
1078
1115
  }
1079
1116
  // @__NO_SIDE_EFFECTS__
1080
- function ze(t) {
1117
+ function Ue(t) {
1081
1118
  return (
1082
1119
  /** @type {TemplateNode | null} */
1083
- Mn.call(t)
1120
+ Pn.call(t)
1084
1121
  );
1085
1122
  }
1086
- function Vr(t) {
1123
+ function Xi(t) {
1087
1124
  t.textContent = "";
1088
1125
  }
1089
- function jn(t) {
1090
- var e = v, n = w;
1091
- te(null), ye(null);
1126
+ function Zi(t, e, n) {
1127
+ return (
1128
+ /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */
1129
+ document.createElementNS(ci, t, void 0)
1130
+ );
1131
+ }
1132
+ function zn(t) {
1133
+ var e = _, n = w;
1134
+ ie(null), we(null);
1092
1135
  try {
1093
1136
  return t();
1094
1137
  } finally {
1095
- te(e), ye(n);
1138
+ ie(e), we(n);
1096
1139
  }
1097
1140
  }
1098
- function Wr(t) {
1099
- w === null && (v === null && Er(), wr()), me && br();
1141
+ function er(t) {
1142
+ w === null && (_ === null && $i(), Ei()), be && Si();
1100
1143
  }
1101
- function Kr(t, e) {
1144
+ function tr(t, e) {
1102
1145
  var n = e.last;
1103
1146
  n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t);
1104
1147
  }
1105
- function Ge(t, e, n) {
1106
- var r = w;
1107
- r !== null && (r.f & pe) !== 0 && (t |= pe);
1108
- var i = {
1109
- ctx: U,
1148
+ function Ke(t, e, n) {
1149
+ var i = w;
1150
+ i !== null && (i.f & ve) !== 0 && (t |= ve);
1151
+ var r = {
1152
+ ctx: V,
1110
1153
  deps: null,
1111
1154
  nodes: null,
1112
- f: t | F | z,
1155
+ f: t | I | G,
1113
1156
  first: null,
1114
1157
  fn: e,
1115
1158
  last: null,
1116
1159
  next: null,
1117
- parent: r,
1118
- b: r && r.b,
1160
+ parent: i,
1161
+ b: i && i.b,
1119
1162
  prev: null,
1120
1163
  teardown: null,
1121
1164
  wv: 0,
@@ -1123,460 +1166,463 @@ function Ge(t, e, n) {
1123
1166
  };
1124
1167
  if (n)
1125
1168
  try {
1126
- Ze(i), i.f |= Et;
1169
+ Ge(r);
1127
1170
  } catch (a) {
1128
- throw K(i), a;
1171
+ throw W(r), a;
1129
1172
  }
1130
- else e !== null && ve(i);
1131
- var s = i;
1173
+ else e !== null && ne(r);
1174
+ var s = r;
1132
1175
  if (n && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child
1133
- (s.f & Ye) === 0 && (s = s.first, (t & ce) !== 0 && (t & vt) !== 0 && s !== null && (s.f |= vt)), s !== null && (s.parent = r, r !== null && Kr(s, r), v !== null && (v.f & x) !== 0 && (t & be) === 0)) {
1134
- var l = (
1176
+ (s.f & Ve) === 0 && (s = s.first, (t & ge) !== 0 && (t & bt) !== 0 && s !== null && (s.f |= bt)), s !== null && (s.parent = i, i !== null && tr(s, i), _ !== null && (_.f & R) !== 0 && (t & Ce) === 0)) {
1177
+ var o = (
1135
1178
  /** @type {Derived} */
1136
- v
1179
+ _
1137
1180
  );
1138
- (l.effects ?? (l.effects = [])).push(s);
1181
+ (o.effects ?? (o.effects = [])).push(s);
1139
1182
  }
1140
- return i;
1183
+ return r;
1141
1184
  }
1142
- function Gt() {
1143
- return v !== null && !W;
1185
+ function Yt() {
1186
+ return _ !== null && !K;
1144
1187
  }
1145
- function ct(t) {
1146
- Wr();
1188
+ function ht(t) {
1189
+ er();
1147
1190
  var e = (
1148
1191
  /** @type {Effect} */
1149
1192
  w.f
1150
- ), n = !v && (e & fe) !== 0 && (e & Et) === 0;
1193
+ ), n = !_ && (e & pe) !== 0 && (e & Ye) === 0;
1151
1194
  if (n) {
1152
- var r = (
1195
+ var i = (
1153
1196
  /** @type {ComponentContext} */
1154
- U
1197
+ V
1155
1198
  );
1156
- (r.e ?? (r.e = [])).push(t);
1199
+ (i.e ?? (i.e = [])).push(t);
1157
1200
  } else
1158
- return Hn(t);
1201
+ return Gn(t);
1159
1202
  }
1160
- function Hn(t) {
1161
- return Ge(Ot | vr, t, !1);
1203
+ function Gn(t) {
1204
+ return Ke(yt | bi, t, !1);
1162
1205
  }
1163
- function Qr(t) {
1164
- ue.ensure();
1165
- const e = Ge(be | Ye, t, !0);
1206
+ function nr(t) {
1207
+ de.ensure();
1208
+ const e = Ke(Ce | Ve, t, !0);
1166
1209
  return () => {
1167
- K(e);
1210
+ W(e);
1168
1211
  };
1169
1212
  }
1170
- function Jr(t) {
1171
- ue.ensure();
1172
- const e = Ge(be | Ye, t, !0);
1173
- return (n = {}) => new Promise((r) => {
1174
- n.outro ? ft(e, () => {
1175
- K(e), r(void 0);
1176
- }) : (K(e), r(void 0));
1213
+ function ir(t) {
1214
+ de.ensure();
1215
+ const e = Ke(Ce | Ve, t, !0);
1216
+ return (n = {}) => new Promise((i) => {
1217
+ n.outro ? dt(e, () => {
1218
+ W(e), i(void 0);
1219
+ }) : (W(e), i(void 0));
1177
1220
  });
1178
1221
  }
1179
1222
  function Yn(t, e = 0) {
1180
- return Ge(cn | e, t, !0);
1223
+ return Ke(hn | e, t, !0);
1181
1224
  }
1182
- function Xr(t, e = 0) {
1183
- var n = Ge(ce | e, t, !0);
1225
+ function rr(t, e = 0) {
1226
+ var n = Ke(ge | e, t, !0);
1184
1227
  return n;
1185
1228
  }
1186
- function we(t) {
1187
- return Ge(fe | Ye, t, !0);
1229
+ function Se(t) {
1230
+ return Ke(pe | Ve, t, !0);
1188
1231
  }
1189
- function zn(t) {
1232
+ function Vn(t) {
1190
1233
  var e = t.teardown;
1191
1234
  if (e !== null) {
1192
- const n = me, r = v;
1193
- Xt(!0), te(null);
1235
+ const n = be, i = _;
1236
+ Zt(!0), ie(null);
1194
1237
  try {
1195
1238
  e.call(null);
1196
1239
  } finally {
1197
- Xt(n), te(r);
1240
+ Zt(n), ie(i);
1198
1241
  }
1199
1242
  }
1200
1243
  }
1201
- function Gn(t, e = !1) {
1244
+ function Vt(t, e = !1) {
1202
1245
  var n = t.first;
1203
1246
  for (t.first = t.last = null; n !== null; ) {
1204
- const i = n.ac;
1205
- i !== null && jn(() => {
1206
- i.abort(pn);
1247
+ const r = n.ac;
1248
+ r !== null && zn(() => {
1249
+ r.abort(Ht);
1207
1250
  });
1208
- var r = n.next;
1209
- (n.f & be) !== 0 ? n.parent = null : K(n, e), n = r;
1251
+ var i = n.next;
1252
+ (n.f & Ce) !== 0 ? n.parent = null : W(n, e), n = i;
1210
1253
  }
1211
1254
  }
1212
- function Zr(t) {
1255
+ function sr(t) {
1213
1256
  for (var e = t.first; e !== null; ) {
1214
1257
  var n = e.next;
1215
- (e.f & fe) === 0 && K(e), e = n;
1258
+ (e.f & pe) === 0 && W(e), e = n;
1216
1259
  }
1217
1260
  }
1218
- function K(t, e = !0) {
1261
+ function W(t, e = !0) {
1219
1262
  var n = !1;
1220
- (e || (t.f & hn) !== 0) && t.nodes !== null && t.nodes.end !== null && (ei(
1263
+ (e || (t.f & pn) !== 0) && t.nodes !== null && t.nodes.end !== null && (or(
1221
1264
  t.nodes.start,
1222
1265
  /** @type {TemplateNode} */
1223
1266
  t.nodes.end
1224
- ), n = !0), Gn(t, e && !n), bt(t, 0), T(t, ge);
1225
- var r = t.nodes && t.nodes.t;
1226
- if (r !== null)
1227
- for (const s of r)
1267
+ ), n = !0), Vt(t, e && !n), tt(t, 0), A(t, _e);
1268
+ var i = t.nodes && t.nodes.t;
1269
+ if (i !== null)
1270
+ for (const s of i)
1228
1271
  s.stop();
1229
- zn(t);
1230
- var i = t.parent;
1231
- i !== null && i.first !== null && Un(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null;
1272
+ Vn(t);
1273
+ var r = t.parent;
1274
+ r !== null && r.first !== null && Un(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null;
1232
1275
  }
1233
- function ei(t, e) {
1276
+ function or(t, e) {
1234
1277
  for (; t !== null; ) {
1235
- var n = t === e ? null : /* @__PURE__ */ ze(t);
1278
+ var n = t === e ? null : /* @__PURE__ */ Ue(t);
1236
1279
  t.remove(), t = n;
1237
1280
  }
1238
1281
  }
1239
1282
  function Un(t) {
1240
- var e = t.parent, n = t.prev, r = t.next;
1241
- n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n));
1242
- }
1243
- function ft(t, e, n = !0) {
1244
- var r = [];
1245
- Vn(t, r, !0);
1246
- var i = () => {
1247
- n && K(t), e && e();
1248
- }, s = r.length;
1283
+ var e = t.parent, n = t.prev, i = t.next;
1284
+ n !== null && (n.next = i), i !== null && (i.prev = n), e !== null && (e.first === t && (e.first = i), e.last === t && (e.last = n));
1285
+ }
1286
+ function dt(t, e, n = !0) {
1287
+ var i = [];
1288
+ Kn(t, i, !0);
1289
+ var r = () => {
1290
+ n && W(t), e && e();
1291
+ }, s = i.length;
1249
1292
  if (s > 0) {
1250
- var l = () => --s || i();
1251
- for (var a of r)
1252
- a.out(l);
1293
+ var o = () => --s || r();
1294
+ for (var a of i)
1295
+ a.out(o);
1253
1296
  } else
1254
- i();
1255
- }
1256
- function Vn(t, e, n) {
1257
- if ((t.f & pe) === 0) {
1258
- t.f ^= pe;
1259
- var r = t.nodes && t.nodes.t;
1260
- if (r !== null)
1261
- for (const a of r)
1297
+ r();
1298
+ }
1299
+ function Kn(t, e, n) {
1300
+ if ((t.f & ve) === 0) {
1301
+ t.f ^= ve;
1302
+ var i = t.nodes && t.nodes.t;
1303
+ if (i !== null)
1304
+ for (const a of i)
1262
1305
  (a.is_global || n) && e.push(a);
1263
- for (var i = t.first; i !== null; ) {
1264
- var s = i.next, l = (i.f & vt) !== 0 || // If this is a branch effect without a block effect parent,
1306
+ for (var r = t.first; r !== null; ) {
1307
+ var s = r.next, o = (r.f & bt) !== 0 || // If this is a branch effect without a block effect parent,
1265
1308
  // it means the parent block effect was pruned. In that case,
1266
1309
  // transparency information was transferred to the branch effect.
1267
- (i.f & fe) !== 0 && (t.f & ce) !== 0;
1268
- Vn(i, e, l ? n : !1), i = s;
1310
+ (r.f & pe) !== 0 && (t.f & ge) !== 0;
1311
+ Kn(r, e, o ? n : !1), r = s;
1269
1312
  }
1270
1313
  }
1271
1314
  }
1272
- function ti(t, e) {
1315
+ function lr(t, e) {
1273
1316
  if (t.nodes)
1274
- for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) {
1275
- var i = n === r ? null : /* @__PURE__ */ ze(n);
1276
- e.append(n), n = i;
1317
+ for (var n = t.nodes.start, i = t.nodes.end; n !== null; ) {
1318
+ var r = n === i ? null : /* @__PURE__ */ Ue(n);
1319
+ e.append(n), n = r;
1277
1320
  }
1278
1321
  }
1279
- let ht = !1, me = !1;
1280
- function Xt(t) {
1281
- me = t;
1322
+ let gt = !1, be = !1;
1323
+ function Zt(t) {
1324
+ be = t;
1282
1325
  }
1283
- let v = null, W = !1;
1284
- function te(t) {
1285
- v = t;
1326
+ let _ = null, K = !1;
1327
+ function ie(t) {
1328
+ _ = t;
1286
1329
  }
1287
1330
  let w = null;
1288
- function ye(t) {
1331
+ function we(t) {
1289
1332
  w = t;
1290
1333
  }
1291
- let G = null;
1334
+ let Y = null;
1292
1335
  function Wn(t) {
1293
- v !== null && (G === null ? G = [t] : G.push(t));
1336
+ _ !== null && (Y === null ? Y = [t] : Y.push(t));
1294
1337
  }
1295
- let L = null, B = 0, P = null;
1296
- function ni(t) {
1297
- P = t;
1338
+ let B = null, D = 0, j = null;
1339
+ function ar(t) {
1340
+ j = t;
1298
1341
  }
1299
- let Kn = 1, $e = 0, Te = $e;
1300
- function Zt(t) {
1301
- Te = t;
1342
+ let Qn = 1, $e = 0, Oe = $e;
1343
+ function en(t) {
1344
+ Oe = t;
1302
1345
  }
1303
- function Qn() {
1304
- return ++Kn;
1346
+ function Jn() {
1347
+ return ++Qn;
1305
1348
  }
1306
- function rt(t) {
1349
+ function st(t) {
1307
1350
  var e = t.f;
1308
- if ((e & F) !== 0)
1351
+ if ((e & I) !== 0)
1309
1352
  return !0;
1310
- if (e & x && (t.f &= ~Re), (e & he) !== 0) {
1353
+ if (e & R && (t.f &= ~Ne), (e & Q) !== 0) {
1311
1354
  for (var n = (
1312
1355
  /** @type {Value[]} */
1313
1356
  t.deps
1314
- ), r = n.length, i = 0; i < r; i++) {
1315
- var s = n[i];
1316
- if (rt(
1357
+ ), i = n.length, r = 0; r < i; r++) {
1358
+ var s = n[r];
1359
+ if (st(
1317
1360
  /** @type {Derived} */
1318
1361
  s
1319
- ) && Ln(
1362
+ ) && Fn(
1320
1363
  /** @type {Derived} */
1321
1364
  s
1322
1365
  ), s.wv > t.wv)
1323
1366
  return !0;
1324
1367
  }
1325
- (e & z) !== 0 && // During time traveling we don't want to reset the status so that
1368
+ (e & G) !== 0 && // During time traveling we don't want to reset the status so that
1326
1369
  // traversal of the graph in the other batches still happens
1327
- V === null && T(t, O);
1370
+ U === null && A(t, N);
1328
1371
  }
1329
1372
  return !1;
1330
1373
  }
1331
- function Jn(t, e, n = !0) {
1332
- var r = t.reactions;
1333
- if (r !== null && !(G !== null && He.call(G, t)))
1334
- for (var i = 0; i < r.length; i++) {
1335
- var s = r[i];
1336
- (s.f & x) !== 0 ? Jn(
1374
+ function Xn(t, e, n = !0) {
1375
+ var i = t.reactions;
1376
+ if (i !== null && !(Y !== null && ze.call(Y, t)))
1377
+ for (var r = 0; r < i.length; r++) {
1378
+ var s = i[r];
1379
+ (s.f & R) !== 0 ? Xn(
1337
1380
  /** @type {Derived} */
1338
1381
  s,
1339
1382
  e,
1340
1383
  !1
1341
- ) : e === s && (n ? T(s, F) : (s.f & O) !== 0 && T(s, he), ve(
1384
+ ) : e === s && (n ? A(s, I) : (s.f & N) !== 0 && A(s, Q), ne(
1342
1385
  /** @type {Effect} */
1343
1386
  s
1344
1387
  ));
1345
1388
  }
1346
1389
  }
1347
- function Xn(t) {
1348
- var I;
1349
- var e = L, n = B, r = P, i = v, s = G, l = U, a = W, u = Te, c = t.f;
1350
- L = /** @type {null | Value[]} */
1351
- null, B = 0, P = null, v = (c & (fe | be)) === 0 ? t : null, G = null, mt(t.ctx), W = !1, Te = ++$e, t.ac !== null && (jn(() => {
1352
- t.ac.abort(pn);
1390
+ function Zn(t) {
1391
+ var S;
1392
+ var e = B, n = D, i = j, r = _, s = Y, o = V, a = K, u = Oe, c = t.f;
1393
+ B = /** @type {null | Value[]} */
1394
+ null, D = 0, j = null, _ = (c & (pe | Ce)) === 0 ? t : null, Y = null, wt(t.ctx), K = !1, Oe = ++$e, t.ac !== null && (zn(() => {
1395
+ t.ac.abort(Ht);
1353
1396
  }), t.ac = null);
1354
1397
  try {
1355
- t.f |= It;
1398
+ t.f |= Nt;
1356
1399
  var h = (
1357
1400
  /** @type {Function} */
1358
1401
  t.fn
1359
- ), f = h(), d = t.deps, p = A?.is_fork;
1360
- if (L !== null) {
1361
- var m;
1362
- if (p || bt(t, B), d !== null && B > 0)
1363
- for (d.length = B + L.length, m = 0; m < L.length; m++)
1364
- d[B + m] = L[m];
1402
+ ), f = h();
1403
+ t.f |= Ye;
1404
+ var d = t.deps, g = x?.is_fork;
1405
+ if (B !== null) {
1406
+ var v;
1407
+ if (g || tt(t, D), d !== null && D > 0)
1408
+ for (d.length = D + B.length, v = 0; v < B.length; v++)
1409
+ d[D + v] = B[v];
1365
1410
  else
1366
- t.deps = d = L;
1367
- if (Gt() && (t.f & z) !== 0)
1368
- for (m = B; m < d.length; m++)
1369
- ((I = d[m]).reactions ?? (I.reactions = [])).push(t);
1370
- } else !p && d !== null && B < d.length && (bt(t, B), d.length = B);
1371
- if (bn() && P !== null && !W && d !== null && (t.f & (x | he | F)) === 0)
1372
- for (m = 0; m < /** @type {Source[]} */
1373
- P.length; m++)
1374
- Jn(
1375
- P[m],
1411
+ t.deps = d = B;
1412
+ if (Yt() && (t.f & G) !== 0)
1413
+ for (v = D; v < d.length; v++)
1414
+ ((S = d[v]).reactions ?? (S.reactions = [])).push(t);
1415
+ } else !g && d !== null && D < d.length && (tt(t, D), d.length = D);
1416
+ if (Cn() && j !== null && !K && d !== null && (t.f & (R | Q | I)) === 0)
1417
+ for (v = 0; v < /** @type {Source[]} */
1418
+ j.length; v++)
1419
+ Xn(
1420
+ j[v],
1376
1421
  /** @type {Effect} */
1377
1422
  t
1378
1423
  );
1379
- if (i !== null && i !== t) {
1380
- if ($e++, i.deps !== null)
1381
- for (let S = 0; S < n; S += 1)
1382
- i.deps[S].rv = $e;
1424
+ if (r !== null && r !== t) {
1425
+ if ($e++, r.deps !== null)
1426
+ for (let E = 0; E < n; E += 1)
1427
+ r.deps[E].rv = $e;
1383
1428
  if (e !== null)
1384
- for (const S of e)
1385
- S.rv = $e;
1386
- P !== null && (r === null ? r = P : r.push(.../** @type {Source[]} */
1387
- P));
1429
+ for (const E of e)
1430
+ E.rv = $e;
1431
+ j !== null && (i === null ? i = j : i.push(.../** @type {Source[]} */
1432
+ j));
1388
1433
  }
1389
- return (t.f & Je) !== 0 && (t.f ^= Je), f;
1390
- } catch (S) {
1391
- return En(S);
1434
+ return (t.f & Ze) !== 0 && (t.f ^= Ze), f;
1435
+ } catch (E) {
1436
+ return En(E);
1392
1437
  } finally {
1393
- t.f ^= It, L = e, B = n, P = r, v = i, G = s, mt(l), W = a, Te = u;
1438
+ t.f ^= Nt, B = e, D = n, j = i, _ = r, Y = s, wt(o), K = a, Oe = u;
1394
1439
  }
1395
1440
  }
1396
- function ri(t, e) {
1441
+ function ur(t, e) {
1397
1442
  let n = e.reactions;
1398
1443
  if (n !== null) {
1399
- var r = cr.call(n, t);
1400
- if (r !== -1) {
1401
- var i = n.length - 1;
1402
- i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop());
1444
+ var i = hi.call(n, t);
1445
+ if (i !== -1) {
1446
+ var r = n.length - 1;
1447
+ r === 0 ? n = e.reactions = null : (n[i] = n[r], n.pop());
1403
1448
  }
1404
1449
  }
1405
- if (n === null && (e.f & x) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1450
+ if (n === null && (e.f & R) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1406
1451
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1407
1452
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1408
- (L === null || !He.call(L, e))) {
1453
+ (B === null || !ze.call(B, e))) {
1409
1454
  var s = (
1410
1455
  /** @type {Derived} */
1411
1456
  e
1412
1457
  );
1413
- (s.f & z) !== 0 && (s.f ^= z, s.f &= ~Re), Yt(s), Nn(s), bt(s, 0);
1458
+ (s.f & G) !== 0 && (s.f ^= G, s.f &= ~Ne), zt(s), Ki(s), tt(s, 0);
1414
1459
  }
1415
1460
  }
1416
- function bt(t, e) {
1461
+ function tt(t, e) {
1417
1462
  var n = t.deps;
1418
1463
  if (n !== null)
1419
- for (var r = e; r < n.length; r++)
1420
- ri(t, n[r]);
1464
+ for (var i = e; i < n.length; i++)
1465
+ ur(t, n[i]);
1421
1466
  }
1422
- function Ze(t) {
1467
+ function Ge(t) {
1423
1468
  var e = t.f;
1424
- if ((e & ge) === 0) {
1425
- T(t, O);
1426
- var n = w, r = ht;
1427
- w = t, ht = !0;
1469
+ if ((e & _e) === 0) {
1470
+ A(t, N);
1471
+ var n = w, i = gt;
1472
+ w = t, gt = !0;
1428
1473
  try {
1429
- (e & (ce | fn)) !== 0 ? Zr(t) : Gn(t), zn(t);
1430
- var i = Xn(t);
1431
- t.teardown = typeof i == "function" ? i : null, t.wv = Kn;
1474
+ (e & (ge | dn)) !== 0 ? sr(t) : Vt(t), Vn(t);
1475
+ var r = Zn(t);
1476
+ t.teardown = typeof r == "function" ? r : null, t.wv = Qn;
1432
1477
  var s;
1433
- Rt && Lr && (t.f & F) !== 0 && t.deps;
1478
+ Ot && Di && (t.f & I) !== 0 && t.deps;
1434
1479
  } finally {
1435
- ht = r, w = n;
1480
+ gt = i, w = n;
1436
1481
  }
1437
1482
  }
1438
1483
  }
1439
1484
  function y(t) {
1440
- var e = t.f, n = (e & x) !== 0;
1441
- if (v !== null && !W) {
1442
- var r = w !== null && (w.f & ge) !== 0;
1443
- if (!r && (G === null || !He.call(G, t))) {
1444
- var i = v.deps;
1445
- if ((v.f & It) !== 0)
1446
- t.rv < $e && (t.rv = $e, L === null && i !== null && i[B] === t ? B++ : L === null ? L = [t] : L.push(t));
1485
+ var e = t.f, n = (e & R) !== 0;
1486
+ if (_ !== null && !K) {
1487
+ var i = w !== null && (w.f & _e) !== 0;
1488
+ if (!i && (Y === null || !ze.call(Y, t))) {
1489
+ var r = _.deps;
1490
+ if ((_.f & Nt) !== 0)
1491
+ t.rv < $e && (t.rv = $e, B === null && r !== null && r[D] === t ? D++ : B === null ? B = [t] : B.push(t));
1447
1492
  else {
1448
- (v.deps ?? (v.deps = [])).push(t);
1493
+ (_.deps ?? (_.deps = [])).push(t);
1449
1494
  var s = t.reactions;
1450
- s === null ? t.reactions = [v] : He.call(s, v) || s.push(v);
1495
+ s === null ? t.reactions = [_] : ze.call(s, _) || s.push(_);
1451
1496
  }
1452
1497
  }
1453
1498
  }
1454
- if (me && _e.has(t))
1455
- return _e.get(t);
1499
+ if (be && ye.has(t))
1500
+ return ye.get(t);
1456
1501
  if (n) {
1457
- var l = (
1502
+ var o = (
1458
1503
  /** @type {Derived} */
1459
1504
  t
1460
1505
  );
1461
- if (me) {
1462
- var a = l.v;
1463
- return ((l.f & O) === 0 && l.reactions !== null || er(l)) && (a = zt(l)), _e.set(l, a), a;
1506
+ if (be) {
1507
+ var a = o.v;
1508
+ return ((o.f & N) === 0 && o.reactions !== null || ti(o)) && (a = Gt(o)), ye.set(o, a), a;
1464
1509
  }
1465
- var u = (l.f & z) === 0 && !W && v !== null && (ht || (v.f & z) !== 0), c = l.deps === null;
1466
- rt(l) && (u && (l.f |= z), Ln(l)), u && !c && Zn(l);
1510
+ var u = (o.f & G) === 0 && !K && _ !== null && (gt || (_.f & G) !== 0), c = (o.f & Ye) === 0;
1511
+ st(o) && (u && (o.f |= G), Fn(o)), u && !c && (Bn(o), ei(o));
1467
1512
  }
1468
- if (V?.has(t))
1469
- return V.get(t);
1470
- if ((t.f & Je) !== 0)
1513
+ if (U?.has(t))
1514
+ return U.get(t);
1515
+ if ((t.f & Ze) !== 0)
1471
1516
  throw t.v;
1472
1517
  return t.v;
1473
1518
  }
1474
- function Zn(t) {
1475
- if (t.deps !== null) {
1476
- t.f |= z;
1519
+ function ei(t) {
1520
+ if (t.f |= G, t.deps !== null)
1477
1521
  for (const e of t.deps)
1478
- (e.reactions ?? (e.reactions = [])).push(t), (e.f & x) !== 0 && (e.f & z) === 0 && Zn(
1522
+ (e.reactions ?? (e.reactions = [])).push(t), (e.f & R) !== 0 && (e.f & G) === 0 && (Bn(
1479
1523
  /** @type {Derived} */
1480
1524
  e
1481
- );
1482
- }
1525
+ ), ei(
1526
+ /** @type {Derived} */
1527
+ e
1528
+ ));
1483
1529
  }
1484
- function er(t) {
1485
- if (t.v === R) return !0;
1530
+ function ti(t) {
1531
+ if (t.v === O) return !0;
1486
1532
  if (t.deps === null) return !1;
1487
1533
  for (const e of t.deps)
1488
- if (_e.has(e) || (e.f & x) !== 0 && er(
1534
+ if (ye.has(e) || (e.f & R) !== 0 && ti(
1489
1535
  /** @type {Derived} */
1490
1536
  e
1491
1537
  ))
1492
1538
  return !0;
1493
1539
  return !1;
1494
1540
  }
1495
- function tr(t) {
1496
- var e = W;
1541
+ function ni(t) {
1542
+ var e = K;
1497
1543
  try {
1498
- return W = !0, t();
1544
+ return K = !0, t();
1499
1545
  } finally {
1500
- W = e;
1546
+ K = e;
1501
1547
  }
1502
1548
  }
1503
- const ii = /* @__PURE__ */ new Set(), en = /* @__PURE__ */ new Set();
1504
- let tn = null;
1505
- function ot(t) {
1549
+ const cr = /* @__PURE__ */ new Set(), tn = /* @__PURE__ */ new Set();
1550
+ let nn = null;
1551
+ function rn(t) {
1506
1552
  var e = this, n = (
1507
1553
  /** @type {Node} */
1508
1554
  e.ownerDocument
1509
- ), r = t.type, i = t.composedPath?.() || [], s = (
1555
+ ), i = t.type, r = t.composedPath?.() || [], s = (
1510
1556
  /** @type {null | Element} */
1511
- i[0] || t.target
1557
+ r[0] || t.target
1512
1558
  );
1513
- tn = t;
1514
- var l = 0, a = tn === t && t.__root;
1559
+ nn = t;
1560
+ var o = 0, a = nn === t && t.__root;
1515
1561
  if (a) {
1516
- var u = i.indexOf(a);
1562
+ var u = r.indexOf(a);
1517
1563
  if (u !== -1 && (e === document || e === /** @type {any} */
1518
1564
  window)) {
1519
1565
  t.__root = e;
1520
1566
  return;
1521
1567
  }
1522
- var c = i.indexOf(e);
1568
+ var c = r.indexOf(e);
1523
1569
  if (c === -1)
1524
1570
  return;
1525
- u <= c && (l = u);
1571
+ u <= c && (o = u);
1526
1572
  }
1527
1573
  if (s = /** @type {Element} */
1528
- i[l] || t.target, s !== e) {
1574
+ r[o] || t.target, s !== e) {
1529
1575
  _t(t, "currentTarget", {
1530
1576
  configurable: !0,
1531
1577
  get() {
1532
1578
  return s || n;
1533
1579
  }
1534
1580
  });
1535
- var h = v, f = w;
1536
- te(null), ye(null);
1581
+ var h = _, f = w;
1582
+ ie(null), we(null);
1537
1583
  try {
1538
- for (var d, p = []; s !== null; ) {
1539
- var m = s.assignedSlot || s.parentNode || /** @type {any} */
1584
+ for (var d, g = []; s !== null; ) {
1585
+ var v = s.assignedSlot || s.parentNode || /** @type {any} */
1540
1586
  s.host || null;
1541
1587
  try {
1542
- var I = s["__" + r];
1543
- I != null && (!/** @type {any} */
1588
+ var S = s["__" + i];
1589
+ S != null && (!/** @type {any} */
1544
1590
  s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1545
1591
  // -> the target could not have been disabled because it emits the event in the first place
1546
- t.target === s) && I.call(s, t);
1547
- } catch (S) {
1548
- d ? p.push(S) : d = S;
1592
+ t.target === s) && S.call(s, t);
1593
+ } catch (E) {
1594
+ d ? g.push(E) : d = E;
1549
1595
  }
1550
- if (t.cancelBubble || m === e || m === null)
1596
+ if (t.cancelBubble || v === e || v === null)
1551
1597
  break;
1552
- s = m;
1598
+ s = v;
1553
1599
  }
1554
1600
  if (d) {
1555
- for (let S of p)
1601
+ for (let E of g)
1556
1602
  queueMicrotask(() => {
1557
- throw S;
1603
+ throw E;
1558
1604
  });
1559
1605
  throw d;
1560
1606
  }
1561
1607
  } finally {
1562
- t.__root = e, delete t.currentTarget, te(h), ye(f);
1608
+ t.__root = e, delete t.currentTarget, ie(h), we(f);
1563
1609
  }
1564
1610
  }
1565
1611
  }
1566
- function si(t, e) {
1612
+ function fr(t, e) {
1567
1613
  var n = (
1568
1614
  /** @type {Effect} */
1569
1615
  w
1570
1616
  );
1571
1617
  n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null });
1572
1618
  }
1573
- function li(t, e) {
1574
- if (ee) {
1619
+ function hr(t, e) {
1620
+ if (te) {
1575
1621
  var n = (
1576
1622
  /** @type {Effect & { nodes: EffectNodes }} */
1577
1623
  w
1578
1624
  );
1579
- ((n.f & Et) === 0 || n.nodes.end === null) && (n.nodes.end = M), _n();
1625
+ ((n.f & Ye) === 0 || n.nodes.end === null) && (n.nodes.end = q), _n();
1580
1626
  return;
1581
1627
  }
1582
1628
  t !== null && t.before(
@@ -1584,57 +1630,60 @@ function li(t, e) {
1584
1630
  e
1585
1631
  );
1586
1632
  }
1587
- const oi = ["touchstart", "touchmove"];
1588
- function ai(t) {
1589
- return oi.includes(t);
1633
+ const dr = ["touchstart", "touchmove"];
1634
+ function gr(t) {
1635
+ return dr.includes(t);
1590
1636
  }
1591
- function nr(t, e) {
1592
- return rr(t, e);
1637
+ function ii(t, e) {
1638
+ return ri(t, e);
1593
1639
  }
1594
- function ui(t, e) {
1595
- Mt(), e.intro = e.intro ?? !1;
1596
- const n = e.target, r = ee, i = M;
1640
+ function pr(t, e) {
1641
+ qt(), e.intro = e.intro ?? !1;
1642
+ const n = e.target, i = te, r = q;
1597
1643
  try {
1598
- for (var s = /* @__PURE__ */ Ur(n); s && (s.nodeType !== $t || /** @type {Comment} */
1599
- s.data !== on); )
1600
- s = /* @__PURE__ */ ze(s);
1644
+ for (var s = /* @__PURE__ */ Ji(n); s && (s.nodeType !== Et || /** @type {Comment} */
1645
+ s.data !== un); )
1646
+ s = /* @__PURE__ */ Ue(s);
1601
1647
  if (!s)
1602
- throw pt;
1603
- st(!0), Xe(
1648
+ throw mt;
1649
+ lt(!0), et(
1604
1650
  /** @type {Comment} */
1605
1651
  s
1606
1652
  );
1607
- const l = rr(t, { ...e, anchor: s });
1608
- return st(!1), /** @type {Exports} */
1609
- l;
1610
- } catch (l) {
1611
- if (l instanceof Error && l.message.split(`
1653
+ const o = ri(t, { ...e, anchor: s });
1654
+ return lt(!1), /** @type {Exports} */
1655
+ o;
1656
+ } catch (o) {
1657
+ if (o instanceof Error && o.message.split(`
1612
1658
  `).some((a) => a.startsWith("https://svelte.dev/e/")))
1613
- throw l;
1614
- return l !== pt && console.warn("Failed to hydrate: ", l), e.recover === !1 && Sr(), Mt(), Vr(n), st(!1), nr(t, e);
1659
+ throw o;
1660
+ return o !== mt && console.warn("Failed to hydrate: ", o), e.recover === !1 && ki(), qt(), Xi(n), lt(!1), ii(t, e);
1615
1661
  } finally {
1616
- st(r), Xe(i);
1662
+ lt(i), et(r);
1617
1663
  }
1618
1664
  }
1619
- const Ie = /* @__PURE__ */ new Map();
1620
- function rr(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: l = !0 }) {
1621
- Mt();
1665
+ const ut = /* @__PURE__ */ new Map();
1666
+ function ri(t, { target: e, anchor: n, props: i = {}, events: r, context: s, intro: o = !0 }) {
1667
+ qt();
1622
1668
  var a = /* @__PURE__ */ new Set(), u = (f) => {
1623
1669
  for (var d = 0; d < f.length; d++) {
1624
- var p = f[d];
1625
- if (!a.has(p)) {
1626
- a.add(p);
1627
- var m = ai(p);
1628
- e.addEventListener(p, ot, { passive: m });
1629
- var I = Ie.get(p);
1630
- I === void 0 ? (document.addEventListener(p, ot, { passive: m }), Ie.set(p, 1)) : Ie.set(p, I + 1);
1670
+ var g = f[d];
1671
+ if (!a.has(g)) {
1672
+ a.add(g);
1673
+ var v = gr(g);
1674
+ for (const se of [e, document]) {
1675
+ var S = ut.get(se);
1676
+ S === void 0 && (S = /* @__PURE__ */ new Map(), ut.set(se, S));
1677
+ var E = S.get(g);
1678
+ E === void 0 ? (se.addEventListener(g, rn, { passive: v }), S.set(g, 1)) : S.set(g, E + 1);
1679
+ }
1631
1680
  }
1632
1681
  }
1633
1682
  };
1634
- u(fr(ii)), en.add(u);
1635
- var c = void 0, h = Jr(() => {
1636
- var f = n ?? e.appendChild(Pn());
1637
- return Pr(
1683
+ u(di(cr)), tn.add(u);
1684
+ var c = void 0, h = ir(() => {
1685
+ var f = n ?? e.appendChild(Hn());
1686
+ return zi(
1638
1687
  /** @type {TemplateNode} */
1639
1688
  f,
1640
1689
  {
@@ -1642,87 +1691,87 @@ function rr(t, { target: e, anchor: n, props: r = {}, events: i, context: s, int
1642
1691
  }
1643
1692
  },
1644
1693
  (d) => {
1645
- if (s) {
1646
- mn({});
1647
- var p = (
1648
- /** @type {ComponentContext} */
1649
- U
1650
- );
1651
- p.c = s;
1652
- }
1653
- if (i && (r.$$events = i), ee && si(
1694
+ bn({});
1695
+ var g = (
1696
+ /** @type {ComponentContext} */
1697
+ V
1698
+ );
1699
+ if (s && (g.c = s), r && (i.$$events = r), te && fr(
1654
1700
  /** @type {TemplateNode} */
1655
1701
  d,
1656
1702
  null
1657
- ), c = t(d, r) || {}, ee && (w.nodes.end = M, M === null || M.nodeType !== $t || /** @type {Comment} */
1658
- M.data !== un))
1659
- throw gn(), pt;
1660
- s && yn();
1703
+ ), c = t(d, i) || {}, te && (w.nodes.end = q, q === null || q.nodeType !== Et || /** @type {Comment} */
1704
+ q.data !== fn))
1705
+ throw vn(), mt;
1706
+ wn();
1661
1707
  }
1662
1708
  ), () => {
1663
- for (var d of a) {
1664
- e.removeEventListener(d, ot);
1665
- var p = (
1666
- /** @type {number} */
1667
- Ie.get(d)
1668
- );
1669
- --p === 0 ? (document.removeEventListener(d, ot), Ie.delete(d)) : Ie.set(d, p);
1670
- }
1671
- en.delete(u), f !== n && f.parentNode?.removeChild(f);
1709
+ for (var d of a)
1710
+ for (const S of [e, document]) {
1711
+ var g = (
1712
+ /** @type {Map<string, number>} */
1713
+ ut.get(S)
1714
+ ), v = (
1715
+ /** @type {number} */
1716
+ g.get(d)
1717
+ );
1718
+ --v == 0 ? (S.removeEventListener(d, rn), g.delete(d), g.size === 0 && ut.delete(S)) : g.set(d, v);
1719
+ }
1720
+ tn.delete(u), f !== n && f.parentNode?.removeChild(f);
1672
1721
  };
1673
1722
  });
1674
- return Pt.set(c, h), c;
1723
+ return jt.set(c, h), c;
1675
1724
  }
1676
- let Pt = /* @__PURE__ */ new WeakMap();
1677
- function ci(t, e) {
1678
- const n = Pt.get(t);
1679
- return n ? (Pt.delete(t), n(e)) : Promise.resolve();
1725
+ let jt = /* @__PURE__ */ new WeakMap();
1726
+ function mr(t, e) {
1727
+ const n = jt.get(t);
1728
+ return n ? (jt.delete(t), n(e)) : Promise.resolve();
1680
1729
  }
1681
- function fi(t) {
1682
- U === null && yr(), ct(() => {
1683
- const e = tr(t);
1730
+ function vr(t) {
1731
+ V === null && Ci(), ht(() => {
1732
+ const e = ni(t);
1684
1733
  if (typeof e == "function") return (
1685
1734
  /** @type {() => void} */
1686
1735
  e
1687
1736
  );
1688
1737
  });
1689
1738
  }
1690
- function re(t, e, n, r) {
1691
- var i = (
1739
+ function oe(t, e, n, i) {
1740
+ var r = (
1692
1741
  /** @type {V} */
1693
- r
1694
- ), s = !0, l = () => (s && (s = !1, i = /** @type {V} */
1695
- r), i), a;
1742
+ i
1743
+ ), s = !0, o = () => (s && (s = !1, r = /** @type {V} */
1744
+ i), r), a;
1696
1745
  a = /** @type {V} */
1697
- t[e], a === void 0 && r !== void 0 && (a = l());
1746
+ t[e], a === void 0 && i !== void 0 && (a = o());
1698
1747
  var u;
1699
1748
  u = () => {
1700
1749
  var d = (
1701
1750
  /** @type {V} */
1702
1751
  t[e]
1703
1752
  );
1704
- return d === void 0 ? l() : (s = !0, d);
1753
+ return d === void 0 ? o() : (s = !0, d);
1705
1754
  };
1706
- var c = !1, h = /* @__PURE__ */ In(() => (c = !1, u())), f = (
1755
+ var c = !1, h = /* @__PURE__ */ Ln(() => (c = !1, u())), f = (
1707
1756
  /** @type {Effect} */
1708
1757
  w
1709
1758
  );
1710
1759
  return (
1711
1760
  /** @type {() => V} */
1712
- (function(d, p) {
1761
+ (function(d, g) {
1713
1762
  if (arguments.length > 0) {
1714
- const m = p ? y(h) : d;
1715
- return k(h, m), c = !0, i !== void 0 && (i = m), d;
1763
+ const v = g ? y(h) : d;
1764
+ return T(h, v), c = !0, r !== void 0 && (r = v), d;
1716
1765
  }
1717
- return me && c || (f.f & ge) !== 0 ? h.v : y(h);
1766
+ return be && c || (f.f & _e) !== 0 ? h.v : y(h);
1718
1767
  })
1719
1768
  );
1720
1769
  }
1721
- function hi(t) {
1722
- return new di(t);
1770
+ function _r(t) {
1771
+ return new yr(t);
1723
1772
  }
1724
- var ae, H;
1725
- class di {
1773
+ var he, H;
1774
+ class yr {
1726
1775
  /**
1727
1776
  * @param {ComponentConstructorOptions & {
1728
1777
  * component: any;
@@ -1730,56 +1779,56 @@ class di {
1730
1779
  */
1731
1780
  constructor(e) {
1732
1781
  /** @type {any} */
1733
- b(this, ae);
1782
+ b(this, he);
1734
1783
  /** @type {Record<string, any>} */
1735
1784
  b(this, H);
1736
- var n = /* @__PURE__ */ new Map(), r = (s, l) => {
1737
- var a = /* @__PURE__ */ zr(l, !1, !1);
1785
+ var n = /* @__PURE__ */ new Map(), i = (s, o) => {
1786
+ var a = /* @__PURE__ */ Wi(o, !1, !1);
1738
1787
  return n.set(s, a), a;
1739
1788
  };
1740
- const i = new Proxy(
1789
+ const r = new Proxy(
1741
1790
  { ...e.props || {}, $$events: {} },
1742
1791
  {
1743
- get(s, l) {
1744
- return y(n.get(l) ?? r(l, Reflect.get(s, l)));
1792
+ get(s, o) {
1793
+ return y(n.get(o) ?? i(o, Reflect.get(s, o)));
1745
1794
  },
1746
- has(s, l) {
1747
- return l === mr ? !0 : (y(n.get(l) ?? r(l, Reflect.get(s, l))), Reflect.has(s, l));
1795
+ has(s, o) {
1796
+ return o === wi ? !0 : (y(n.get(o) ?? i(o, Reflect.get(s, o))), Reflect.has(s, o));
1748
1797
  },
1749
- set(s, l, a) {
1750
- return k(n.get(l) ?? r(l, a), a), Reflect.set(s, l, a);
1798
+ set(s, o, a) {
1799
+ return T(n.get(o) ?? i(o, a), a), Reflect.set(s, o, a);
1751
1800
  }
1752
1801
  }
1753
1802
  );
1754
- _(this, H, (e.hydrate ? ui : nr)(e.component, {
1803
+ m(this, H, (e.hydrate ? pr : ii)(e.component, {
1755
1804
  target: e.target,
1756
1805
  anchor: e.anchor,
1757
- props: i,
1806
+ props: r,
1758
1807
  context: e.context,
1759
1808
  intro: e.intro ?? !1,
1760
1809
  recover: e.recover
1761
- })), (!e?.props?.$$host || e.sync === !1) && Q(), _(this, ae, i.$$events);
1762
- for (const s of Object.keys(o(this, H)))
1810
+ })), (!e?.props?.$$host || e.sync === !1) && J(), m(this, he, r.$$events);
1811
+ for (const s of Object.keys(l(this, H)))
1763
1812
  s === "$set" || s === "$destroy" || s === "$on" || _t(this, s, {
1764
1813
  get() {
1765
- return o(this, H)[s];
1814
+ return l(this, H)[s];
1766
1815
  },
1767
1816
  /** @param {any} value */
1768
- set(l) {
1769
- o(this, H)[s] = l;
1817
+ set(o) {
1818
+ l(this, H)[s] = o;
1770
1819
  },
1771
1820
  enumerable: !0
1772
1821
  });
1773
- o(this, H).$set = /** @param {Record<string, any>} next */
1822
+ l(this, H).$set = /** @param {Record<string, any>} next */
1774
1823
  (s) => {
1775
- Object.assign(i, s);
1776
- }, o(this, H).$destroy = () => {
1777
- ci(o(this, H));
1824
+ Object.assign(r, s);
1825
+ }, l(this, H).$destroy = () => {
1826
+ mr(l(this, H));
1778
1827
  };
1779
1828
  }
1780
1829
  /** @param {Record<string, any>} props */
1781
1830
  $set(e) {
1782
- o(this, H).$set(e);
1831
+ l(this, H).$set(e);
1783
1832
  }
1784
1833
  /**
1785
1834
  * @param {string} event
@@ -1787,96 +1836,96 @@ class di {
1787
1836
  * @returns {any}
1788
1837
  */
1789
1838
  $on(e, n) {
1790
- o(this, ae)[e] = o(this, ae)[e] || [];
1791
- const r = (...i) => n.call(this, ...i);
1792
- return o(this, ae)[e].push(r), () => {
1793
- o(this, ae)[e] = o(this, ae)[e].filter(
1839
+ l(this, he)[e] = l(this, he)[e] || [];
1840
+ const i = (...r) => n.call(this, ...r);
1841
+ return l(this, he)[e].push(i), () => {
1842
+ l(this, he)[e] = l(this, he)[e].filter(
1794
1843
  /** @param {any} fn */
1795
- (i) => i !== r
1844
+ (r) => r !== i
1796
1845
  );
1797
1846
  };
1798
1847
  }
1799
1848
  $destroy() {
1800
- o(this, H).$destroy();
1849
+ l(this, H).$destroy();
1801
1850
  }
1802
1851
  }
1803
- ae = new WeakMap(), H = new WeakMap();
1804
- let ir;
1805
- typeof HTMLElement == "function" && (ir = class extends HTMLElement {
1852
+ he = new WeakMap(), H = new WeakMap();
1853
+ let si;
1854
+ typeof HTMLElement == "function" && (si = class extends HTMLElement {
1806
1855
  /**
1807
1856
  * @param {*} $$componentCtor
1808
1857
  * @param {*} $$slots
1809
1858
  * @param {ShadowRootInit | undefined} shadow_root_init
1810
1859
  */
1811
- constructor(e, n, r) {
1860
+ constructor(e, n, i) {
1812
1861
  super();
1813
1862
  /** The Svelte component constructor */
1814
- g(this, "$$ctor");
1863
+ p(this, "$$ctor");
1815
1864
  /** Slots */
1816
- g(this, "$$s");
1865
+ p(this, "$$s");
1817
1866
  /** @type {any} The Svelte component instance */
1818
- g(this, "$$c");
1867
+ p(this, "$$c");
1819
1868
  /** Whether or not the custom element is connected */
1820
- g(this, "$$cn", !1);
1869
+ p(this, "$$cn", !1);
1821
1870
  /** @type {Record<string, any>} Component props data */
1822
- g(this, "$$d", {});
1871
+ p(this, "$$d", {});
1823
1872
  /** `true` if currently in the process of reflecting component props back to attributes */
1824
- g(this, "$$r", !1);
1873
+ p(this, "$$r", !1);
1825
1874
  /** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
1826
- g(this, "$$p_d", {});
1875
+ p(this, "$$p_d", {});
1827
1876
  /** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */
1828
- g(this, "$$l", {});
1877
+ p(this, "$$l", {});
1829
1878
  /** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */
1830
- g(this, "$$l_u", /* @__PURE__ */ new Map());
1879
+ p(this, "$$l_u", /* @__PURE__ */ new Map());
1831
1880
  /** @type {any} The managed render effect for reflecting attributes */
1832
- g(this, "$$me");
1881
+ p(this, "$$me");
1833
1882
  /** @type {ShadowRoot | null} The ShadowRoot of the custom element */
1834
- g(this, "$$shadowRoot", null);
1835
- this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r));
1883
+ p(this, "$$shadowRoot", null);
1884
+ this.$$ctor = e, this.$$s = n, i && (this.$$shadowRoot = this.attachShadow(i));
1836
1885
  }
1837
1886
  /**
1838
1887
  * @param {string} type
1839
1888
  * @param {EventListenerOrEventListenerObject} listener
1840
1889
  * @param {boolean | AddEventListenerOptions} [options]
1841
1890
  */
1842
- addEventListener(e, n, r) {
1891
+ addEventListener(e, n, i) {
1843
1892
  if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(n), this.$$c) {
1844
- const i = this.$$c.$on(e, n);
1845
- this.$$l_u.set(n, i);
1893
+ const r = this.$$c.$on(e, n);
1894
+ this.$$l_u.set(n, r);
1846
1895
  }
1847
- super.addEventListener(e, n, r);
1896
+ super.addEventListener(e, n, i);
1848
1897
  }
1849
1898
  /**
1850
1899
  * @param {string} type
1851
1900
  * @param {EventListenerOrEventListenerObject} listener
1852
1901
  * @param {boolean | AddEventListenerOptions} [options]
1853
1902
  */
1854
- removeEventListener(e, n, r) {
1855
- if (super.removeEventListener(e, n, r), this.$$c) {
1856
- const i = this.$$l_u.get(n);
1857
- i && (i(), this.$$l_u.delete(n));
1903
+ removeEventListener(e, n, i) {
1904
+ if (super.removeEventListener(e, n, i), this.$$c) {
1905
+ const r = this.$$l_u.get(n);
1906
+ r && (r(), this.$$l_u.delete(n));
1858
1907
  }
1859
1908
  }
1860
1909
  async connectedCallback() {
1861
1910
  if (this.$$cn = !0, !this.$$c) {
1862
- let e = function(i) {
1911
+ let e = function(r) {
1863
1912
  return (s) => {
1864
- const l = document.createElement("slot");
1865
- i !== "default" && (l.name = i), li(s, l);
1913
+ const o = Zi("slot");
1914
+ r !== "default" && (o.name = r), hr(s, o);
1866
1915
  };
1867
1916
  };
1868
1917
  if (await Promise.resolve(), !this.$$cn || this.$$c)
1869
1918
  return;
1870
- const n = {}, r = pi(this);
1871
- for (const i of this.$$s)
1872
- i in r && (i === "default" && !this.$$d.children ? (this.$$d.children = e(i), n.default = !0) : n[i] = e(i));
1873
- for (const i of this.attributes) {
1874
- const s = this.$$g_p(i.name);
1875
- s in this.$$d || (this.$$d[s] = dt(s, i.value, this.$$p_d, "toProp"));
1919
+ const n = {}, i = br(this);
1920
+ for (const r of this.$$s)
1921
+ r in i && (r === "default" && !this.$$d.children ? (this.$$d.children = e(r), n.default = !0) : n[r] = e(r));
1922
+ for (const r of this.attributes) {
1923
+ const s = this.$$g_p(r.name);
1924
+ s in this.$$d || (this.$$d[s] = pt(s, r.value, this.$$p_d, "toProp"));
1876
1925
  }
1877
- for (const i in this.$$p_d)
1878
- !(i in this.$$d) && this[i] !== void 0 && (this.$$d[i] = this[i], delete this[i]);
1879
- this.$$c = hi({
1926
+ for (const r in this.$$p_d)
1927
+ !(r in this.$$d) && this[r] !== void 0 && (this.$$d[r] = this[r], delete this[r]);
1928
+ this.$$c = _r({
1880
1929
  component: this.$$ctor,
1881
1930
  target: this.$$shadowRoot || this,
1882
1931
  props: {
@@ -1884,27 +1933,27 @@ typeof HTMLElement == "function" && (ir = class extends HTMLElement {
1884
1933
  $$slots: n,
1885
1934
  $$host: this
1886
1935
  }
1887
- }), this.$$me = Qr(() => {
1936
+ }), this.$$me = nr(() => {
1888
1937
  Yn(() => {
1889
1938
  this.$$r = !0;
1890
- for (const i of gt(this.$$c)) {
1891
- if (!this.$$p_d[i]?.reflect) continue;
1892
- this.$$d[i] = this.$$c[i];
1893
- const s = dt(
1894
- i,
1895
- this.$$d[i],
1939
+ for (const r of vt(this.$$c)) {
1940
+ if (!this.$$p_d[r]?.reflect) continue;
1941
+ this.$$d[r] = this.$$c[r];
1942
+ const s = pt(
1943
+ r,
1944
+ this.$$d[r],
1896
1945
  this.$$p_d,
1897
1946
  "toAttribute"
1898
1947
  );
1899
- s == null ? this.removeAttribute(this.$$p_d[i].attribute || i) : this.setAttribute(this.$$p_d[i].attribute || i, s);
1948
+ s == null ? this.removeAttribute(this.$$p_d[r].attribute || r) : this.setAttribute(this.$$p_d[r].attribute || r, s);
1900
1949
  }
1901
1950
  this.$$r = !1;
1902
1951
  });
1903
1952
  });
1904
- for (const i in this.$$l)
1905
- for (const s of this.$$l[i]) {
1906
- const l = this.$$c.$on(i, s);
1907
- this.$$l_u.set(s, l);
1953
+ for (const r in this.$$l)
1954
+ for (const s of this.$$l[r]) {
1955
+ const o = this.$$c.$on(r, s);
1956
+ this.$$l_u.set(s, o);
1908
1957
  }
1909
1958
  this.$$l = {};
1910
1959
  }
@@ -1916,8 +1965,8 @@ typeof HTMLElement == "function" && (ir = class extends HTMLElement {
1916
1965
  * @param {string} _oldValue
1917
1966
  * @param {string} newValue
1918
1967
  */
1919
- attributeChangedCallback(e, n, r) {
1920
- this.$$r || (e = this.$$g_p(e), this.$$d[e] = dt(e, r, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
1968
+ attributeChangedCallback(e, n, i) {
1969
+ this.$$r || (e = this.$$g_p(e), this.$$d[e] = pt(e, i, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
1921
1970
  }
1922
1971
  disconnectedCallback() {
1923
1972
  this.$$cn = !1, Promise.resolve().then(() => {
@@ -1928,17 +1977,17 @@ typeof HTMLElement == "function" && (ir = class extends HTMLElement {
1928
1977
  * @param {string} attribute_name
1929
1978
  */
1930
1979
  $$g_p(e) {
1931
- return gt(this.$$p_d).find(
1980
+ return vt(this.$$p_d).find(
1932
1981
  (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e
1933
1982
  ) || e;
1934
1983
  }
1935
1984
  });
1936
- function dt(t, e, n, r) {
1937
- const i = n[t]?.type;
1938
- if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t])
1985
+ function pt(t, e, n, i) {
1986
+ const r = n[t]?.type;
1987
+ if (e = r === "Boolean" && typeof e != "boolean" ? e != null : e, !i || !n[t])
1939
1988
  return e;
1940
- if (r === "toAttribute")
1941
- switch (i) {
1989
+ if (i === "toAttribute")
1990
+ switch (r) {
1942
1991
  case "Object":
1943
1992
  case "Array":
1944
1993
  return e == null ? null : JSON.stringify(e);
@@ -1950,7 +1999,7 @@ function dt(t, e, n, r) {
1950
1999
  return e;
1951
2000
  }
1952
2001
  else
1953
- switch (i) {
2002
+ switch (r) {
1954
2003
  case "Object":
1955
2004
  case "Array":
1956
2005
  return e && JSON.parse(e);
@@ -1963,7 +2012,7 @@ function dt(t, e, n, r) {
1963
2012
  return e;
1964
2013
  }
1965
2014
  }
1966
- function pi(t) {
2015
+ function br(t) {
1967
2016
  const e = {};
1968
2017
  return t.childNodes.forEach((n) => {
1969
2018
  e[
@@ -1972,78 +2021,233 @@ function pi(t) {
1972
2021
  ] = !0;
1973
2022
  }), e;
1974
2023
  }
1975
- function gi(t, e, n, r, i, s) {
1976
- let l = class extends ir {
2024
+ function wr(t, e, n, i, r, s) {
2025
+ let o = class extends si {
1977
2026
  constructor() {
1978
- super(t, n, i), this.$$p_d = e;
2027
+ super(t, n, r), this.$$p_d = e;
1979
2028
  }
1980
2029
  static get observedAttributes() {
1981
- return gt(e).map(
2030
+ return vt(e).map(
1982
2031
  (a) => (e[a].attribute || a).toLowerCase()
1983
2032
  );
1984
2033
  }
1985
2034
  };
1986
- return gt(e).forEach((a) => {
1987
- _t(l.prototype, a, {
2035
+ return vt(e).forEach((a) => {
2036
+ _t(o.prototype, a, {
1988
2037
  get() {
1989
2038
  return this.$$c && a in this.$$c ? this.$$c[a] : this.$$d[a];
1990
2039
  },
1991
2040
  set(u) {
1992
- u = dt(a, u, e), this.$$d[a] = u;
2041
+ u = pt(a, u, e), this.$$d[a] = u;
1993
2042
  var c = this.$$c;
1994
2043
  if (c) {
1995
- var h = Ne(c, a)?.get;
2044
+ var h = Le(c, a)?.get;
1996
2045
  h ? c[a] = u : c.$set({ [a]: u });
1997
2046
  }
1998
2047
  }
1999
2048
  });
2000
- }), r.forEach((a) => {
2001
- _t(l.prototype, a, {
2049
+ }), i.forEach((a) => {
2050
+ _t(o.prototype, a, {
2002
2051
  get() {
2003
2052
  return this.$$c?.[a];
2004
2053
  }
2005
2054
  });
2006
2055
  }), t.element = /** @type {any} */
2007
- l, l;
2056
+ o, o;
2008
2057
  }
2009
- var nn;
2058
+ var sn;
2010
2059
  (function(t) {
2011
2060
  t.TTS_WORD = "tts-word", t.TTS_SENTENCE = "tts-sentence", t.ANNOTATION = "annotation";
2012
- })(nn || (nn = {}));
2013
- var rn;
2061
+ })(sn || (sn = {}));
2062
+ var on;
2014
2063
  (function(t) {
2015
- t.YELLOW = "yellow", t.GREEN = "green", t.BLUE = "blue", t.PINK = "pink", t.ORANGE = "orange";
2016
- })(rn || (rn = {}));
2017
- const _i = {
2018
- // Standard QTI 3.0 PNP supports
2019
- textToSpeech: "pie-tool-text-to-speech",
2020
- calculator: "pie-tool-calculator",
2021
- ruler: "pie-tool-ruler",
2022
- protractor: "pie-tool-protractor",
2023
- highlighter: "pie-tool-annotation-toolbar",
2024
- lineReader: "pie-tool-line-reader",
2025
- magnifier: "pie-tool-magnifier",
2026
- colorContrast: "pie-theme-contrast",
2027
- answerMasking: "pie-tool-answer-eliminator",
2028
- dictionaryLookup: "pie-tool-dictionary",
2029
- // Common extensions (not in QTI standard but widely used)
2030
- graphingCalculator: "pie-tool-calculator",
2031
- scientificCalculator: "pie-tool-calculator",
2032
- basicCalculator: "pie-tool-calculator"
2064
+ t.YELLOW = "yellow", t.GREEN = "green", t.BLUE = "blue", t.PINK = "pink", t.ORANGE = "orange", t.UNDERLINE = "underline";
2065
+ })(on || (on = {}));
2066
+ const Cr = {
2067
+ /**
2068
+ * Visual accessibility features
2069
+ * For students with low vision, color blindness, or visual processing needs
2070
+ */
2071
+ visual: {
2072
+ // Magnification and zoom
2073
+ magnification: "magnification",
2074
+ screenMagnifier: "screenMagnifier",
2075
+ zoomable: "zoomable",
2076
+ // Color and contrast
2077
+ highContrastDisplay: "highContrastDisplay",
2078
+ highContrastAudio: "highContrastAudio",
2079
+ colorContrast: "colorContrast",
2080
+ invertColors: "invertColors",
2081
+ // Display customization
2082
+ displayTransformability: "displayTransformability",
2083
+ largePrint: "largePrint",
2084
+ fontEnlargement: "fontEnlargement",
2085
+ resizeText: "resizeText",
2086
+ // Visual alternatives
2087
+ alternativeText: "alternativeText",
2088
+ longDescription: "longDescription",
2089
+ describedMath: "describedMath",
2090
+ tactileGraphic: "tactileGraphic",
2091
+ tactileObject: "tactileObject"
2092
+ },
2093
+ /**
2094
+ * Auditory accessibility features
2095
+ * For students who are deaf, hard of hearing, or benefit from audio
2096
+ */
2097
+ auditory: {
2098
+ // Audio output
2099
+ audioDescription: "audioDescription",
2100
+ textToSpeech: "textToSpeech",
2101
+ readAloud: "readAloud",
2102
+ humanVoice: "humanVoice",
2103
+ syntheticVoice: "syntheticVoice",
2104
+ // Speech control
2105
+ speechRate: "speechRate",
2106
+ speechVolume: "speechVolume",
2107
+ voicePitch: "voicePitch",
2108
+ // Visual alternatives for audio
2109
+ captions: "captions",
2110
+ closedCaptions: "closedCaptions",
2111
+ openCaptions: "openCaptions",
2112
+ transcript: "transcript",
2113
+ signLanguage: "signLanguage",
2114
+ subtitles: "subtitles",
2115
+ // Audio adjustments
2116
+ audioControl: "audioControl",
2117
+ noBackgroundAudio: "noBackgroundAudio"
2118
+ },
2119
+ /**
2120
+ * Motor/physical accessibility features
2121
+ * For students with limited mobility or motor control
2122
+ */
2123
+ motor: {
2124
+ // Input alternatives
2125
+ keyboardControl: "keyboardControl",
2126
+ mouseControl: "mouseControl",
2127
+ touchControl: "touchControl",
2128
+ voiceControl: "voiceControl",
2129
+ switchControl: "switchControl",
2130
+ eyeGazeControl: "eyeGazeControl",
2131
+ // Keyboard features
2132
+ singleSwitchAccess: "singleSwitchAccess",
2133
+ stickyKeys: "stickyKeys",
2134
+ keyboardShortcuts: "keyboardShortcuts",
2135
+ // Timing
2136
+ timingControl: "timingControl",
2137
+ unlimitedTime: "unlimitedTime",
2138
+ extendedTime: "extendedTime",
2139
+ pauseControl: "pauseControl"
2140
+ },
2141
+ /**
2142
+ * Cognitive/learning accessibility features
2143
+ * For students with learning disabilities, ADHD, autism, etc.
2144
+ */
2145
+ cognitive: {
2146
+ // Content simplification
2147
+ simplifiedLanguage: "simplifiedLanguage",
2148
+ reducedComplexity: "reducedComplexity",
2149
+ structuralNavigation: "structuralNavigation",
2150
+ tableOfContents: "tableOfContents",
2151
+ // Focus and attention
2152
+ reducedDistraction: "reducedDistraction",
2153
+ noFlashing: "noFlashing",
2154
+ pauseAnimation: "pauseAnimation",
2155
+ // Organization and support
2156
+ annotations: "annotations",
2157
+ bookmarking: "bookmarking",
2158
+ highlighting: "highlighting",
2159
+ guidedNavigation: "guidedNavigation",
2160
+ // Tools
2161
+ calculator: "calculator",
2162
+ dictionary: "dictionary",
2163
+ thesaurus: "thesaurus",
2164
+ spellingAssistance: "spellingAssistance",
2165
+ grammarAssistance: "grammarAssistance"
2166
+ },
2167
+ /**
2168
+ * Reading support features
2169
+ * For students with dyslexia or reading challenges
2170
+ */
2171
+ reading: {
2172
+ // Text presentation
2173
+ lineSpacing: "lineSpacing",
2174
+ wordSpacing: "wordSpacing",
2175
+ letterSpacing: "letterSpacing",
2176
+ fontFamily: "fontFamily",
2177
+ readingMask: "readingMask",
2178
+ readingGuide: "readingGuide",
2179
+ readingRuler: "readingRuler",
2180
+ // Highlighting and emphasis
2181
+ wordHighlighting: "wordHighlighting",
2182
+ lineHighlighting: "lineHighlighting",
2183
+ focusIndicator: "focusIndicator",
2184
+ // Content support
2185
+ printableResource: "printableResource",
2186
+ braille: "braille",
2187
+ nemeth: "nemeth",
2188
+ refreshableBraille: "refreshableBraille"
2189
+ },
2190
+ /**
2191
+ * Navigation features
2192
+ * For efficient content navigation
2193
+ */
2194
+ navigation: {
2195
+ // Structure
2196
+ index: "index",
2197
+ pageNavigation: "pageNavigation",
2198
+ skipContent: "skipContent",
2199
+ breadcrumbs: "breadcrumbs",
2200
+ // Search
2201
+ searchable: "searchable",
2202
+ fullTextSearch: "fullTextSearch"
2203
+ },
2204
+ /**
2205
+ * Linguistic features
2206
+ * For language support
2207
+ */
2208
+ linguistic: {
2209
+ // Languages
2210
+ multilingualText: "multilingualText",
2211
+ translatedText: "translatedText",
2212
+ glossary: "glossary",
2213
+ // Sign language
2214
+ signLanguageInterpretation: "signLanguageInterpretation",
2215
+ visualLanguage: "visualLanguage"
2216
+ },
2217
+ /**
2218
+ * Assessment-specific features
2219
+ * Features specific to test-taking environments
2220
+ */
2221
+ assessment: {
2222
+ // Tools
2223
+ protractor: "protractor",
2224
+ ruler: "ruler",
2225
+ graph: "graph",
2226
+ graphingCalculator: "graphingCalculator",
2227
+ periodicTable: "periodicTable",
2228
+ formulaSheet: "formulaSheet",
2229
+ // Answer support
2230
+ answerMasking: "answerMasking",
2231
+ answerEliminator: "answerEliminator",
2232
+ strikethrough: "strikethrough",
2233
+ // Item features
2234
+ itemGlossary: "itemGlossary",
2235
+ tutorialAvailable: "tutorialAvailable"
2236
+ }
2033
2237
  };
2034
- Object.fromEntries(Object.entries(_i).map(([t, e]) => [e, t]));
2035
- var jt;
2238
+ Object.values(Cr).flatMap((t) => Object.values(t));
2239
+ var Pt;
2036
2240
  (function(t) {
2037
2241
  t[t.BASE = 0] = "BASE", t[t.TOOL = 1e3] = "TOOL", t[t.MODAL = 2e3] = "MODAL", t[t.CONTROL = 3e3] = "CONTROL", t[t.HIGHLIGHT = 4e3] = "HIGHLIGHT";
2038
- })(jt || (jt = {}));
2039
- var sn;
2242
+ })(Pt || (Pt = {}));
2243
+ var ln;
2040
2244
  (function(t) {
2041
2245
  t.IDLE = "idle", t.LOADING = "loading", t.PLAYING = "playing", t.PAUSED = "paused", t.ERROR = "error";
2042
- })(sn || (sn = {}));
2043
- class sr {
2246
+ })(ln || (ln = {}));
2247
+ class oi {
2044
2248
  constructor() {
2045
- g(this, "elementType", "multiple-choice");
2046
- g(this, "priority", 100);
2249
+ p(this, "elementType", "multiple-choice");
2250
+ p(this, "priority", 100);
2047
2251
  }
2048
2252
  canHandle(e) {
2049
2253
  return e.tagName.toLowerCase() === "multiple-choice" || e.classList.contains("multiple-choice");
@@ -2059,8 +2263,8 @@ class sr {
2059
2263
  const n = e.querySelector(".label") || e.querySelector("label") || e.querySelector('[class*="label"]') || e.querySelector("span");
2060
2264
  if (!n)
2061
2265
  return null;
2062
- const r = document.createRange();
2063
- return r.selectNodeContents(n), r;
2266
+ const i = document.createRange();
2267
+ return i.selectNodeContents(n), i;
2064
2268
  }
2065
2269
  getChoiceId(e) {
2066
2270
  const n = e.querySelector(
@@ -2081,30 +2285,30 @@ class sr {
2081
2285
  return e;
2082
2286
  }
2083
2287
  generateFallbackId(e) {
2084
- const r = e.closest(".multiple-choice")?.querySelectorAll(".choice-input") || [];
2085
- return `choice-${Array.from(r).indexOf(e)}`;
2288
+ const i = e.closest(".multiple-choice")?.querySelectorAll(".choice-input") || [];
2289
+ return `choice-${Array.from(i).indexOf(e)}`;
2086
2290
  }
2087
2291
  }
2088
- class vi {
2292
+ class Sr {
2089
2293
  constructor() {
2090
- g(this, "elementType", "ebsr");
2091
- g(this, "priority", 95);
2092
- g(this, "mcAdapter", new sr());
2294
+ p(this, "elementType", "ebsr");
2295
+ p(this, "priority", 95);
2296
+ p(this, "mcAdapter", new oi());
2093
2297
  }
2094
2298
  canHandle(e) {
2095
2299
  return e.tagName.toLowerCase() === "ebsr" || e.querySelector("ebsr-multiple-choice") !== null;
2096
2300
  }
2097
2301
  findChoices(e) {
2098
- const n = e.querySelector('ebsr-multiple-choice[id="a"]'), r = e.querySelector('ebsr-multiple-choice[id="b"]'), i = [];
2099
- return n && i.push(...this.mcAdapter.findChoices(n)), r && i.push(...this.mcAdapter.findChoices(r)), i;
2302
+ const n = e.querySelector('ebsr-multiple-choice[id="a"]'), i = e.querySelector('ebsr-multiple-choice[id="b"]'), r = [];
2303
+ return n && r.push(...this.mcAdapter.findChoices(n)), i && r.push(...this.mcAdapter.findChoices(i)), r;
2100
2304
  }
2101
2305
  // Delegate all other methods to MultipleChoiceAdapter
2102
2306
  createChoiceRange(e) {
2103
2307
  return this.mcAdapter.createChoiceRange(e);
2104
2308
  }
2105
2309
  getChoiceId(e) {
2106
- const n = e.closest("ebsr-multiple-choice")?.id || "unknown", r = this.mcAdapter.getChoiceId(e);
2107
- return `${n}-${r}`;
2310
+ const n = e.closest("ebsr-multiple-choice")?.id || "unknown", i = this.mcAdapter.getChoiceId(e);
2311
+ return `${n}-${i}`;
2108
2312
  }
2109
2313
  getChoiceLabel(e) {
2110
2314
  return this.mcAdapter.getChoiceLabel(e);
@@ -2116,10 +2320,10 @@ class vi {
2116
2320
  return this.mcAdapter.getButtonContainer(e);
2117
2321
  }
2118
2322
  }
2119
- class mi {
2323
+ class Er {
2120
2324
  constructor() {
2121
- g(this, "elementType", "inline-dropdown");
2122
- g(this, "priority", 90);
2325
+ p(this, "elementType", "inline-dropdown");
2326
+ p(this, "priority", 90);
2123
2327
  }
2124
2328
  canHandle(e) {
2125
2329
  return e.tagName.toLowerCase() === "inline-dropdown" || e.querySelector('[role="combobox"]') !== null;
@@ -2144,13 +2348,13 @@ class mi {
2144
2348
  return e;
2145
2349
  }
2146
2350
  }
2147
- class yi {
2351
+ class $r {
2148
2352
  constructor() {
2149
- g(this, "adapters");
2353
+ p(this, "adapters");
2150
2354
  this.adapters = [
2151
- new sr(),
2152
- new vi(),
2153
- new mi()
2355
+ new oi(),
2356
+ new Sr(),
2357
+ new Er()
2154
2358
  ].sort((e, n) => n.priority - e.priority);
2155
2359
  }
2156
2360
  /**
@@ -2163,11 +2367,11 @@ class yi {
2163
2367
  * Find all choices with their adapters within a root element
2164
2368
  */
2165
2369
  findAllChoicesWithAdapters(e) {
2166
- const n = [], r = /* @__PURE__ */ new Set();
2167
- for (const i of this.adapters) {
2168
- const s = i.findChoices(e);
2169
- for (const l of s)
2170
- r.has(l) || (r.add(l), n.push({ choice: l, adapter: i }));
2370
+ const n = [], i = /* @__PURE__ */ new Set();
2371
+ for (const r of this.adapters) {
2372
+ const s = r.findChoices(e);
2373
+ for (const o of s)
2374
+ i.has(o) || (i.add(o), n.push({ choice: o, adapter: r }));
2171
2375
  }
2172
2376
  return n;
2173
2377
  }
@@ -2175,14 +2379,14 @@ class yi {
2175
2379
  * Register a custom adapter
2176
2380
  */
2177
2381
  registerAdapter(e) {
2178
- this.adapters.push(e), this.adapters.sort((n, r) => r.priority - n.priority);
2382
+ this.adapters.push(e), this.adapters.sort((n, i) => i.priority - n.priority);
2179
2383
  }
2180
2384
  }
2181
- class bi {
2385
+ class Ar {
2182
2386
  constructor() {
2183
- g(this, "name", "mask");
2184
- g(this, "highlights", /* @__PURE__ */ new Map());
2185
- g(this, "ranges", /* @__PURE__ */ new Map());
2387
+ p(this, "name", "mask");
2388
+ p(this, "highlights", /* @__PURE__ */ new Map());
2389
+ p(this, "ranges", /* @__PURE__ */ new Map());
2186
2390
  }
2187
2391
  initialize() {
2188
2392
  this.injectCSS();
@@ -2196,8 +2400,8 @@ class bi {
2196
2400
  return;
2197
2401
  }
2198
2402
  this.injectHighlightCSS(e);
2199
- const r = new Highlight(n);
2200
- CSS.highlights.set(`answer-masked-${e}`, r), this.highlights.set(e, r), this.ranges.set(e, n), this.addAriaAttributes(n);
2403
+ const i = new Highlight(n);
2404
+ CSS.highlights.set(`answer-masked-${e}`, i), this.highlights.set(e, i), this.ranges.set(e, n), this.addAriaAttributes(n);
2201
2405
  }
2202
2406
  remove(e) {
2203
2407
  if (!this.isSupported()) {
@@ -2236,13 +2440,13 @@ class bi {
2236
2440
  injectHighlightCSS(e) {
2237
2441
  const n = `answer-eliminator-mask-highlight-${e}`;
2238
2442
  if (document.getElementById(n)) return;
2239
- const r = document.createElement("style");
2240
- r.id = n, r.textContent = `
2443
+ const i = document.createElement("style");
2444
+ i.id = n, i.textContent = `
2241
2445
  ::highlight(answer-masked-${e}) {
2242
2446
  opacity: 0.2;
2243
2447
  filter: blur(2px);
2244
2448
  }
2245
- `, document.head.appendChild(r);
2449
+ `, document.head.appendChild(i);
2246
2450
  }
2247
2451
  removeHighlightCSS(e) {
2248
2452
  document.getElementById(`answer-eliminator-mask-highlight-${e}`)?.remove();
@@ -2268,8 +2472,8 @@ class bi {
2268
2472
  return null;
2269
2473
  }
2270
2474
  applyFallback(e, n) {
2271
- const r = this.findChoiceContainer(n);
2272
- r && (r.classList.add("answer-masked-fallback"), r.setAttribute("data-eliminated", "true"), r.setAttribute("data-eliminated-id", e), this.addAriaAttributes(n));
2475
+ const i = this.findChoiceContainer(n);
2476
+ i && (i.classList.add("answer-masked-fallback"), i.setAttribute("data-eliminated", "true"), i.setAttribute("data-eliminated-id", e), this.addAriaAttributes(n));
2273
2477
  }
2274
2478
  removeFallback(e) {
2275
2479
  const n = document.querySelector(
@@ -2277,15 +2481,15 @@ class bi {
2277
2481
  );
2278
2482
  if (!n) return;
2279
2483
  n.classList.remove("answer-masked-fallback"), n.removeAttribute("data-eliminated"), n.removeAttribute("data-eliminated-id");
2280
- const r = document.createRange();
2281
- r.selectNodeContents(n), this.removeAriaAttributes(r);
2484
+ const i = document.createRange();
2485
+ i.selectNodeContents(n), this.removeAriaAttributes(i);
2282
2486
  }
2283
2487
  }
2284
- class wi {
2488
+ class kr {
2285
2489
  constructor() {
2286
- g(this, "name", "strikethrough");
2287
- g(this, "highlights", /* @__PURE__ */ new Map());
2288
- g(this, "ranges", /* @__PURE__ */ new Map());
2490
+ p(this, "name", "strikethrough");
2491
+ p(this, "highlights", /* @__PURE__ */ new Map());
2492
+ p(this, "ranges", /* @__PURE__ */ new Map());
2289
2493
  }
2290
2494
  initialize() {
2291
2495
  if (!this.isSupported()) {
@@ -2303,8 +2507,8 @@ class wi {
2303
2507
  return;
2304
2508
  }
2305
2509
  this.injectHighlightCSS(e);
2306
- const r = new Highlight(n);
2307
- CSS.highlights.set(`answer-eliminated-${e}`, r), this.highlights.set(e, r), this.ranges.set(e, n), this.addAriaAttributes(n);
2510
+ const i = new Highlight(n);
2511
+ CSS.highlights.set(`answer-eliminated-${e}`, i), this.highlights.set(e, i), this.ranges.set(e, n), this.addAriaAttributes(n);
2308
2512
  }
2309
2513
  remove(e) {
2310
2514
  if (!this.isSupported()) {
@@ -2354,15 +2558,15 @@ class wi {
2354
2558
  injectHighlightCSS(e) {
2355
2559
  const n = `answer-eliminator-highlight-${e}`;
2356
2560
  if (document.getElementById(n)) return;
2357
- const r = document.createElement("style");
2358
- r.id = n, r.textContent = `
2561
+ const i = document.createElement("style");
2562
+ i.id = n, i.textContent = `
2359
2563
  ::highlight(answer-eliminated-${e}) {
2360
2564
  text-decoration: line-through;
2361
2565
  text-decoration-thickness: 2px;
2362
2566
  text-decoration-color: var(--pie-incorrect, #ff9800);
2363
2567
  opacity: 0.6;
2364
2568
  }
2365
- `, document.head.appendChild(r);
2569
+ `, document.head.appendChild(i);
2366
2570
  }
2367
2571
  removeHighlightCSS(e) {
2368
2572
  document.getElementById(`answer-eliminator-highlight-${e}`)?.remove();
@@ -2376,10 +2580,10 @@ class wi {
2376
2580
  const n = this.findChoiceContainer(e);
2377
2581
  if (!n) return;
2378
2582
  n.setAttribute("data-eliminated", "true"), n.setAttribute("aria-disabled", "true");
2379
- const r = n.querySelector(".label");
2380
- if (r && !r.querySelector(".sr-announcement")) {
2381
- const i = document.createElement("span");
2382
- i.className = "sr-announcement", i.textContent = " (eliminated)", r.appendChild(i);
2583
+ const i = n.querySelector(".label");
2584
+ if (i && !i.querySelector(".sr-announcement")) {
2585
+ const r = document.createElement("span");
2586
+ r.className = "sr-announcement", r.textContent = " (eliminated)", i.appendChild(r);
2383
2587
  }
2384
2588
  }
2385
2589
  removeAriaAttributes(e) {
@@ -2398,8 +2602,8 @@ class wi {
2398
2602
  }
2399
2603
  // Fallback for browsers without CSS Highlight API
2400
2604
  applyFallback(e, n) {
2401
- const r = this.findChoiceContainer(n);
2402
- r && (r.classList.add("answer-eliminated-fallback"), r.setAttribute("data-eliminated", "true"), r.setAttribute("data-eliminated-id", e), this.addAriaAttributes(n));
2605
+ const i = this.findChoiceContainer(n);
2606
+ i && (i.classList.add("answer-eliminated-fallback"), i.setAttribute("data-eliminated", "true"), i.setAttribute("data-eliminated-id", e), this.addAriaAttributes(n));
2403
2607
  }
2404
2608
  removeFallback(e) {
2405
2609
  const n = document.querySelector(
@@ -2407,29 +2611,29 @@ class wi {
2407
2611
  );
2408
2612
  if (!n) return;
2409
2613
  n.classList.remove("answer-eliminated-fallback"), n.removeAttribute("data-eliminated"), n.removeAttribute("data-eliminated-id");
2410
- const r = document.createRange();
2411
- r.selectNodeContents(n), this.removeAriaAttributes(r);
2614
+ const i = document.createRange();
2615
+ i.selectNodeContents(n), this.removeAriaAttributes(i);
2412
2616
  }
2413
2617
  }
2414
- class Ei {
2618
+ class xr {
2415
2619
  constructor(e = "strikethrough", n = "right") {
2416
- g(this, "registry");
2417
- g(this, "strategy");
2418
- g(this, "eliminatedChoices", /* @__PURE__ */ new Set());
2620
+ p(this, "registry");
2621
+ p(this, "strategy");
2622
+ p(this, "eliminatedChoices", /* @__PURE__ */ new Set());
2419
2623
  // Set<choiceId> for current element
2420
- g(this, "choiceElements", /* @__PURE__ */ new Map());
2624
+ p(this, "choiceElements", /* @__PURE__ */ new Map());
2421
2625
  // choiceId -> element
2422
- g(this, "choiceButtons", /* @__PURE__ */ new Map());
2626
+ p(this, "choiceButtons", /* @__PURE__ */ new Map());
2423
2627
  // choiceId -> button
2424
- g(this, "buttonAlignment", "right");
2425
- g(this, "shouldRestoreState", !0);
2628
+ p(this, "buttonAlignment", "right");
2629
+ p(this, "shouldRestoreState", !0);
2426
2630
  // Whether to restore eliminations from state storage
2427
2631
  // Store integration (replaces session/localStorage)
2428
- g(this, "storeIntegration", null);
2429
- this.registry = new yi(), this.strategy = this.createStrategy(e), this.strategy.initialize(), this.buttonAlignment = n;
2632
+ p(this, "storeIntegration", null);
2633
+ this.registry = new $r(), this.strategy = this.createStrategy(e), this.strategy.initialize(), this.buttonAlignment = n;
2430
2634
  }
2431
2635
  createStrategy(e) {
2432
- return e === "mask" ? new bi() : new wi();
2636
+ return e === "mask" ? new Ar() : new kr();
2433
2637
  }
2434
2638
  /**
2435
2639
  * Initialize eliminator for a question
@@ -2437,28 +2641,28 @@ class Ei {
2437
2641
  initializeForQuestion(e) {
2438
2642
  this.cleanupButtons();
2439
2643
  const n = this.registry.findAllChoicesWithAdapters(e);
2440
- for (const { choice: r, adapter: i } of n)
2441
- this.initializeChoice(r, i);
2644
+ for (const { choice: i, adapter: r } of n)
2645
+ this.initializeChoice(i, r);
2442
2646
  this.shouldRestoreState && this.restoreState();
2443
2647
  }
2444
2648
  /**
2445
2649
  * Initialize a single choice
2446
2650
  */
2447
2651
  initializeChoice(e, n) {
2448
- const r = n.getChoiceId(e);
2449
- this.choiceElements.set(r, e);
2450
- const i = this.createToggleButton(e, n);
2451
- if (!i) return;
2452
- this.choiceButtons.set(r, i);
2652
+ const i = n.getChoiceId(e);
2653
+ this.choiceElements.set(i, e);
2654
+ const r = this.createToggleButton(e, n);
2655
+ if (!r) return;
2656
+ this.choiceButtons.set(i, r);
2453
2657
  const s = n.getButtonContainer(e);
2454
- s && (s.style.position = "relative", s.appendChild(i));
2658
+ s && (s.style.position = "relative", s.appendChild(r));
2455
2659
  }
2456
2660
  /**
2457
2661
  * Create elimination toggle button
2458
2662
  */
2459
2663
  createToggleButton(e, n) {
2460
- const r = n.getChoiceId(e), i = n.getChoiceLabel(e), s = document.createElement("button");
2461
- return s.type = "button", s.className = "answer-eliminator-toggle", s.setAttribute("aria-label", `Toggle elimination for ${i}`), s.setAttribute("data-choice-id", r), s.textContent = "⊗", this.applyButtonAlignment(s), Object.assign(s.style, {
2664
+ const i = n.getChoiceId(e), r = n.getChoiceLabel(e), s = document.createElement("button");
2665
+ return s.type = "button", s.className = "answer-eliminator-toggle", s.setAttribute("aria-label", `Toggle elimination for ${r}`), s.setAttribute("data-choice-id", i), s.textContent = "⊗", this.applyButtonAlignment(s), Object.assign(s.style, {
2462
2666
  width: "28px",
2463
2667
  height: "28px",
2464
2668
  padding: "0",
@@ -2477,18 +2681,18 @@ class Ei {
2477
2681
  }), s.addEventListener("mouseenter", () => {
2478
2682
  s.style.background = "#f0f0f0", s.style.borderColor = "#999", s.style.color = "#333";
2479
2683
  }), s.addEventListener("mouseleave", () => {
2480
- this.strategy.isEliminated(r) || (s.style.background = "white", s.style.borderColor = "#ccc", s.style.color = "#666");
2481
- }), s.addEventListener("click", (l) => {
2482
- l.preventDefault(), l.stopPropagation(), this.toggleElimination(e, n);
2684
+ this.strategy.isEliminated(i) || (s.style.background = "white", s.style.borderColor = "#ccc", s.style.color = "#666");
2685
+ }), s.addEventListener("click", (o) => {
2686
+ o.preventDefault(), o.stopPropagation(), this.toggleElimination(e, n);
2483
2687
  }), s;
2484
2688
  }
2485
2689
  /**
2486
2690
  * Toggle elimination for a choice
2487
2691
  */
2488
2692
  toggleElimination(e, n) {
2489
- const r = n.getChoiceId(e);
2490
- if (this.strategy.isEliminated(r))
2491
- this.restoreChoice(r);
2693
+ const i = n.getChoiceId(e);
2694
+ if (this.strategy.isEliminated(i))
2695
+ this.restoreChoice(i);
2492
2696
  else {
2493
2697
  if (!n.canEliminate(e)) {
2494
2698
  console.warn(
@@ -2504,13 +2708,13 @@ class Ei {
2504
2708
  * Eliminate a choice
2505
2709
  */
2506
2710
  eliminateChoice(e, n) {
2507
- const r = n.getChoiceId(e), i = n.createChoiceRange(e);
2508
- if (!i) {
2711
+ const i = n.getChoiceId(e), r = n.createChoiceRange(e);
2712
+ if (!r) {
2509
2713
  console.error("Failed to create range for choice");
2510
2714
  return;
2511
2715
  }
2512
- this.strategy.apply(r, i), this.eliminatedChoices.add(r);
2513
- const s = this.choiceButtons.get(r);
2716
+ this.strategy.apply(i, r), this.eliminatedChoices.add(i);
2717
+ const s = this.choiceButtons.get(i);
2514
2718
  s && (s.classList.add("active"), s.setAttribute("aria-pressed", "true"), s.style.background = "#ff9800", s.style.borderColor = "#ff9800", s.style.color = "white"), this.saveState();
2515
2719
  }
2516
2720
  /**
@@ -2572,15 +2776,15 @@ class Ei {
2572
2776
  try {
2573
2777
  const n = e.eliminatedChoices;
2574
2778
  if (!n || n.length === 0) return;
2575
- for (const r of n) {
2576
- const i = this.choiceElements.get(r);
2577
- if (!i) continue;
2578
- const s = this.findAdapterForChoice(i);
2779
+ for (const i of n) {
2780
+ const r = this.choiceElements.get(i);
2781
+ if (!r) continue;
2782
+ const s = this.findAdapterForChoice(r);
2579
2783
  if (!s) continue;
2580
- const l = s.createChoiceRange(i);
2581
- if (l) {
2582
- this.strategy.apply(r, l), this.eliminatedChoices.add(r);
2583
- const a = this.choiceButtons.get(r);
2784
+ const o = s.createChoiceRange(r);
2785
+ if (o) {
2786
+ this.strategy.apply(i, o), this.eliminatedChoices.add(i);
2787
+ const a = this.choiceButtons.get(i);
2584
2788
  a && (a.classList.add("active"), a.setAttribute("aria-pressed", "true"), a.style.background = "#ff9800", a.style.borderColor = "#ff9800", a.style.color = "white");
2585
2789
  }
2586
2790
  }
@@ -2594,8 +2798,8 @@ class Ei {
2594
2798
  findAdapterForChoice(e) {
2595
2799
  let n = e;
2596
2800
  for (; n && n !== document.body; ) {
2597
- const r = this.registry.findAdapter(n);
2598
- if (r) return r;
2801
+ const i = this.registry.findAdapter(n);
2802
+ if (i) return i;
2599
2803
  n = n.parentElement;
2600
2804
  }
2601
2805
  return null;
@@ -2679,144 +2883,144 @@ class Ei {
2679
2883
  this.cleanupButtons(), this.strategy.destroy();
2680
2884
  }
2681
2885
  }
2682
- function $i(t, e) {
2683
- mn(e, !0);
2684
- let n = re(e, "visible", 7, !1), r = re(e, "toolId", 7, "answerEliminator"), i = re(e, "strategy", 7, "strikethrough"), s = re(
2886
+ function Tr(t, e) {
2887
+ bn(e, !0);
2888
+ let n = oe(e, "visible", 7, !1), i = oe(e, "toolId", 7, "answerEliminator"), r = oe(e, "strategy", 7, "strikethrough"), s = oe(
2685
2889
  e,
2686
2890
  "alwaysOn",
2687
2891
  7,
2688
2892
  !1
2689
2893
  // Set true for profile-based accommodation
2690
- ), l = re(
2894
+ ), o = oe(
2691
2895
  e,
2692
2896
  "buttonAlignment",
2693
2897
  7,
2694
2898
  "right"
2695
2899
  // Button placement: left, right, or inline with checkbox
2696
- ), a = re(e, "coordinator"), u = re(
2900
+ ), a = oe(e, "coordinator"), u = oe(
2697
2901
  e,
2698
2902
  "scopeElement",
2699
2903
  7,
2700
2904
  null
2701
2905
  // Container element to limit DOM queries (for multi-item pages)
2702
- ), c = re(
2906
+ ), c = oe(
2703
2907
  e,
2704
2908
  "elementToolStateStore",
2705
2909
  7,
2706
2910
  null
2707
2911
  // ElementToolStateStore instance
2708
- ), h = re(
2912
+ ), h = oe(
2709
2913
  e,
2710
2914
  "globalElementId",
2711
2915
  7,
2712
2916
  ""
2713
2917
  // Composite key: "assessmentId:sectionId:itemId:elementId"
2714
- ), f = /* @__PURE__ */ Y(null), d = /* @__PURE__ */ Y(0), p = /* @__PURE__ */ Y(null), m = /* @__PURE__ */ Y(!1), I = /* @__PURE__ */ Hr(() => s() || n());
2715
- function S() {
2716
- if (!y(I) || !y(f)) return;
2717
- const E = u() || document.body, it = E.querySelector("pie-player") || E.querySelector("multiple-choice") || E.querySelector("ebsr") || E.querySelector("[data-pie-element]") || E;
2718
- if (!it) {
2918
+ ), f = /* @__PURE__ */ z(null), d = /* @__PURE__ */ z(0), g = /* @__PURE__ */ z(null), v = /* @__PURE__ */ z(!1), S = /* @__PURE__ */ Yi(() => s() || n());
2919
+ function E() {
2920
+ if (!y(S) || !y(f)) return;
2921
+ const C = u() || document.body, ot = C.querySelector("pie-player") || C.querySelector("multiple-choice") || C.querySelector("ebsr") || C.querySelector("[data-pie-element]") || C;
2922
+ if (!ot) {
2719
2923
  console.warn("[AnswerEliminator] Could not find question root within scope");
2720
2924
  return;
2721
2925
  }
2722
- y(f).initializeForQuestion(it), At();
2926
+ y(f).initializeForQuestion(ot), kt();
2723
2927
  }
2724
- function Ue(E, it = 5e3) {
2725
- const Ve = u() || document.body, kt = () => Ve.querySelector("pie-player") || Ve.querySelector("multiple-choice") || Ve.querySelector("ebsr") || Ve.querySelector("[data-pie-element]") ? (y(p) && (y(p).disconnect(), k(p, null)), E(), !0) : !1;
2726
- kt() || (k(
2727
- p,
2928
+ function se(C, ot = 5e3) {
2929
+ const We = u() || document.body, xt = () => We.querySelector("pie-player") || We.querySelector("multiple-choice") || We.querySelector("ebsr") || We.querySelector("[data-pie-element]") ? (y(g) && (y(g).disconnect(), T(g, null)), C(), !0) : !1;
2930
+ xt() || (T(
2931
+ g,
2728
2932
  new MutationObserver(() => {
2729
- kt();
2933
+ xt();
2730
2934
  }),
2731
2935
  !0
2732
- ), y(p).observe(Ve, { childList: !0, subtree: !0 }), setTimeout(
2936
+ ), y(g).observe(We, { childList: !0, subtree: !0 }), setTimeout(
2733
2937
  () => {
2734
- y(p) && (y(p).disconnect(), k(p, null), kt());
2938
+ y(g) && (y(g).disconnect(), T(g, null), xt());
2735
2939
  },
2736
- it
2940
+ ot
2737
2941
  ));
2738
2942
  }
2739
- function Oe() {
2740
- Ue(() => {
2741
- S();
2943
+ function Ie() {
2944
+ se(() => {
2945
+ E();
2742
2946
  });
2743
2947
  }
2744
- function At() {
2745
- k(d, y(f)?.getEliminatedCount() || 0, !0);
2948
+ function kt() {
2949
+ T(d, y(f)?.getEliminatedCount() || 0, !0);
2746
2950
  }
2747
- ct(() => {
2748
- a() && r() && !y(m) && (a().registerTool(r(), "Answer Eliminator", void 0, jt.MODAL), k(m, !0));
2749
- }), ct(() => {
2951
+ ht(() => {
2952
+ a() && i() && !y(v) && (a().registerTool(i(), "Answer Eliminator", void 0, Pt.MODAL), T(v, !0));
2953
+ }), ht(() => {
2750
2954
  y(f) && c() && h() && y(f).setStoreIntegration(c(), h());
2751
- }), fi(() => (k(f, new Ei(i(), l()), !0), y(f) && c() && h() && y(f).setStoreIntegration(c(), h()), document.addEventListener("pie-item-changed", Oe), document.addEventListener("answer-eliminator-state-change", () => {
2752
- At();
2753
- }), y(I) ? Ue(() => {
2754
- S();
2955
+ }), vr(() => (T(f, new xr(r(), o()), !0), y(f) && c() && h() && y(f).setStoreIntegration(c(), h()), document.addEventListener("pie-item-changed", Ie), document.addEventListener("answer-eliminator-state-change", () => {
2956
+ kt();
2957
+ }), y(S) ? se(() => {
2958
+ E();
2755
2959
  }) : y(f).cleanup(), () => {
2756
- y(p) && (y(p).disconnect(), k(p, null)), y(f)?.destroy(), k(f, null), a() && r() && a().unregisterTool(r()), document.removeEventListener("pie-item-changed", Oe), document.removeEventListener("answer-eliminator-state-change", At);
2757
- })), ct(() => {
2758
- y(f) && (y(I) ? (y(f).enableStateRestoration(), S()) : y(f).cleanup());
2960
+ y(g) && (y(g).disconnect(), T(g, null)), y(f)?.destroy(), T(f, null), a() && i() && a().unregisterTool(i()), document.removeEventListener("pie-item-changed", Ie), document.removeEventListener("answer-eliminator-state-change", kt);
2961
+ })), ht(() => {
2962
+ y(f) && (y(S) ? (y(f).enableStateRestoration(), E()) : y(f).cleanup());
2759
2963
  });
2760
- var lr = {
2964
+ var li = {
2761
2965
  get visible() {
2762
2966
  return n();
2763
2967
  },
2764
- set visible(E = !1) {
2765
- n(E), Q();
2968
+ set visible(C = !1) {
2969
+ n(C), J();
2766
2970
  },
2767
2971
  get toolId() {
2768
- return r();
2972
+ return i();
2769
2973
  },
2770
- set toolId(E = "answerEliminator") {
2771
- r(E), Q();
2974
+ set toolId(C = "answerEliminator") {
2975
+ i(C), J();
2772
2976
  },
2773
2977
  get strategy() {
2774
- return i();
2978
+ return r();
2775
2979
  },
2776
- set strategy(E = "strikethrough") {
2777
- i(E), Q();
2980
+ set strategy(C = "strikethrough") {
2981
+ r(C), J();
2778
2982
  },
2779
2983
  get alwaysOn() {
2780
2984
  return s();
2781
2985
  },
2782
- set alwaysOn(E = !1) {
2783
- s(E), Q();
2986
+ set alwaysOn(C = !1) {
2987
+ s(C), J();
2784
2988
  },
2785
2989
  get buttonAlignment() {
2786
- return l();
2990
+ return o();
2787
2991
  },
2788
- set buttonAlignment(E = "right") {
2789
- l(E), Q();
2992
+ set buttonAlignment(C = "right") {
2993
+ o(C), J();
2790
2994
  },
2791
2995
  get coordinator() {
2792
2996
  return a();
2793
2997
  },
2794
- set coordinator(E) {
2795
- a(E), Q();
2998
+ set coordinator(C) {
2999
+ a(C), J();
2796
3000
  },
2797
3001
  get scopeElement() {
2798
3002
  return u();
2799
3003
  },
2800
- set scopeElement(E = null) {
2801
- u(E), Q();
3004
+ set scopeElement(C = null) {
3005
+ u(C), J();
2802
3006
  },
2803
3007
  get elementToolStateStore() {
2804
3008
  return c();
2805
3009
  },
2806
- set elementToolStateStore(E = null) {
2807
- c(E), Q();
3010
+ set elementToolStateStore(C = null) {
3011
+ c(C), J();
2808
3012
  },
2809
3013
  get globalElementId() {
2810
3014
  return h();
2811
3015
  },
2812
- set globalElementId(E = "") {
2813
- h(E), Q();
3016
+ set globalElementId(C = "") {
3017
+ h(C), J();
2814
3018
  }
2815
3019
  };
2816
- return yn(lr);
3020
+ return wn(li);
2817
3021
  }
2818
- customElements.define("pie-tool-answer-eliminator", gi(
2819
- $i,
3022
+ customElements.define("pie-tool-answer-eliminator", wr(
3023
+ Tr,
2820
3024
  {
2821
3025
  visible: { attribute: "visible", type: "Boolean" },
2822
3026
  toolId: { attribute: "tool-id", type: "String" },
@@ -2832,6 +3036,6 @@ customElements.define("pie-tool-answer-eliminator", gi(
2832
3036
  []
2833
3037
  ));
2834
3038
  export {
2835
- $i as default
3039
+ Tr as default
2836
3040
  };
2837
3041
  //# sourceMappingURL=tool-answer-eliminator.js.map