@pie-players/pie-tool-annotation-toolbar 0.1.4 → 0.1.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,141 +1,144 @@
1
- var Ar = Object.defineProperty;
2
- var wn = (e) => {
1
+ var Pi = Object.defineProperty;
2
+ var or = (e) => {
3
3
  throw TypeError(e);
4
4
  };
5
- var Or = (e, t, n) => t in e ? Ar(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
6
- var y = (e, t, n) => Or(e, typeof t != "symbol" ? t + "" : t, n), Yt = (e, t, n) => t.has(e) || wn("Cannot " + n);
7
- var l = (e, t, n) => (Yt(e, t, "read from private field"), n ? n.call(e) : t.get(e)), p = (e, t, n) => t.has(e) ? wn("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), _ = (e, t, n, r) => (Yt(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), A = (e, t, n) => (Yt(e, t, "access private method"), n);
8
- var On;
9
- typeof window < "u" && ((On = window.__svelte ?? (window.__svelte = {})).v ?? (On.v = /* @__PURE__ */ new Set())).add("5");
10
- const Rr = 2, Rn = "[", sn = "[!", Cn = "]", it = {}, R = /* @__PURE__ */ Symbol(), Ut = !1;
11
- var Cr = Array.isArray, Nr = Array.prototype.indexOf, st = Array.prototype.includes, Lr = Array.from, Ct = Object.keys, Nt = Object.defineProperty, ze = Object.getOwnPropertyDescriptor, Dr = Object.prototype, Ir = Array.prototype, Br = Object.getPrototypeOf, yn = Object.isExtensible;
12
- function Fr(e) {
5
+ var Hi = (e, t, n) => t in e ? Pi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
6
+ var O = (e, t, n) => Hi(e, typeof t != "symbol" ? t + "" : t, n), xn = (e, t, n) => t.has(e) || or("Cannot " + n);
7
+ var a = (e, t, n) => (xn(e, t, "read from private field"), n ? n.call(e) : t.get(e)), w = (e, t, n) => t.has(e) ? or("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), b = (e, t, n, r) => (xn(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), P = (e, t, n) => (xn(e, t, "access private method"), n);
8
+ var Tr;
9
+ typeof window < "u" && ((Tr = window.__svelte ?? (window.__svelte = {})).v ?? (Tr.v = /* @__PURE__ */ new Set())).add("5");
10
+ const Vi = 1, Fi = 2, Bi = 16, Gi = 1, ji = 2, Bn = "[", gn = "[!", Gn = "]", kt = {}, V = /* @__PURE__ */ Symbol(), Ar = "http://www.w3.org/1999/xhtml", kn = !1;
11
+ var xr = Array.isArray, zi = Array.prototype.indexOf, Rt = Array.prototype.includes, pn = Array.from, cn = Object.keys, hn = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, Ui = Object.getOwnPropertyDescriptors, Yi = Object.prototype, Ki = Array.prototype, Cr = Object.getPrototypeOf, lr = Object.isExtensible;
12
+ const Wi = () => {
13
+ };
14
+ function Xi(e) {
13
15
  for (var t = 0; t < e.length; t++)
14
16
  e[t]();
15
17
  }
16
- function Nn() {
18
+ function Sr() {
17
19
  var e, t, n = new Promise((r, i) => {
18
20
  e = r, t = i;
19
21
  });
20
22
  return { promise: n, resolve: e, reject: t };
21
23
  }
22
- const C = 2, Vt = 4, Ft = 8, Ln = 1 << 24, we = 16, le = 32, Ae = 64, on = 128, H = 512, O = 1024, L = 2048, ye = 4096, re = 8192, pe = 16384, Mt = 32768, ot = 65536, mn = 1 << 17, Dn = 1 << 18, qe = 1 << 19, Mr = 1 << 20, je = 32768, Ht = 1 << 21, ln = 1 << 22, Se = 1 << 23, Gt = /* @__PURE__ */ Symbol("$state"), jr = /* @__PURE__ */ Symbol("legacy props"), Ve = new class extends Error {
24
+ const F = 2, Gt = 4, mn = 8, kr = 1 << 24, He = 16, we = 32, Je = 64, Rr = 128, ae = 512, H = 1024, B = 2048, me = 4096, ne = 8192, Ie = 16384, qt = 32768, Lt = 65536, ar = 1 << 17, jn = 1 << 18, _t = 1 << 19, Ji = 1 << 20, Ye = 1 << 25, ht = 65536, Rn = 1 << 21, zn = 1 << 22, Ke = 1 << 23, Cn = /* @__PURE__ */ Symbol("$state"), Qi = /* @__PURE__ */ Symbol("legacy props"), Zi = /* @__PURE__ */ Symbol(""), tt = new class extends Error {
23
25
  constructor() {
24
26
  super(...arguments);
25
- y(this, "name", "StaleReactionError");
26
- y(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
27
+ O(this, "name", "StaleReactionError");
28
+ O(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
27
29
  }
28
- }(), un = 3, $t = 8;
29
- function qr(e) {
30
- throw new Error("https://svelte.dev/e/lifecycle_outside_component");
31
- }
32
- function Yr() {
30
+ }(), es = /* @__PURE__ */ globalThis.document?.contentType.includes("xml") ?? !1, bn = 3, gt = 8;
31
+ function ts() {
33
32
  throw new Error("https://svelte.dev/e/async_derived_orphan");
34
33
  }
35
- function Gr(e) {
34
+ function ns(e, t, n) {
35
+ throw new Error("https://svelte.dev/e/each_key_duplicate");
36
+ }
37
+ function rs(e) {
36
38
  throw new Error("https://svelte.dev/e/effect_in_teardown");
37
39
  }
38
- function Ur() {
40
+ function is() {
39
41
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
40
42
  }
41
- function Vr(e) {
43
+ function ss(e) {
42
44
  throw new Error("https://svelte.dev/e/effect_orphan");
43
45
  }
44
- function Hr() {
46
+ function os() {
45
47
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
46
48
  }
47
- function Wr() {
49
+ function ls() {
48
50
  throw new Error("https://svelte.dev/e/hydration_failed");
49
51
  }
50
- function Kr() {
52
+ function as() {
51
53
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
52
54
  }
53
- function zr() {
55
+ function us() {
54
56
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
55
57
  }
56
- function Jr() {
58
+ function fs() {
57
59
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
58
60
  }
59
- function Xr() {
61
+ function cs() {
60
62
  throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
61
63
  }
62
- function jt(e) {
64
+ function wn(e) {
63
65
  console.warn("https://svelte.dev/e/hydration_mismatch");
64
66
  }
65
- function Qr() {
67
+ function hs() {
66
68
  console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
67
69
  }
68
- let S = !1;
69
- function He(e) {
70
- S = e;
70
+ let A = !1;
71
+ function _e(e) {
72
+ A = e;
71
73
  }
72
- let $;
73
- function ie(e) {
74
+ let x;
75
+ function z(e) {
74
76
  if (e === null)
75
- throw jt(), it;
76
- return $ = e;
77
+ throw wn(), kt;
78
+ return x = e;
77
79
  }
78
- function an() {
79
- return ie(/* @__PURE__ */ me($));
80
+ function yn() {
81
+ return z(/* @__PURE__ */ ce(x));
80
82
  }
81
- function Zr(e) {
82
- if (S) {
83
- if (/* @__PURE__ */ me($) !== null)
84
- throw jt(), it;
85
- $ = e;
83
+ function en(e) {
84
+ if (A) {
85
+ if (/* @__PURE__ */ ce(x) !== null)
86
+ throw wn(), kt;
87
+ x = e;
86
88
  }
87
89
  }
88
- function ei(e = 1) {
89
- if (S) {
90
- for (var t = e, n = $; t--; )
90
+ function ds(e = 1) {
91
+ if (A) {
92
+ for (var t = e, n = x; t--; )
91
93
  n = /** @type {TemplateNode} */
92
- /* @__PURE__ */ me(n);
93
- $ = n;
94
+ /* @__PURE__ */ ce(n);
95
+ x = n;
94
96
  }
95
97
  }
96
- function In(e = !0) {
97
- for (var t = 0, n = $; ; ) {
98
- if (n.nodeType === $t) {
98
+ function dn(e = !0) {
99
+ for (var t = 0, n = x; ; ) {
100
+ if (n.nodeType === gt) {
99
101
  var r = (
100
102
  /** @type {Comment} */
101
103
  n.data
102
104
  );
103
- if (r === Cn) {
105
+ if (r === Gn) {
104
106
  if (t === 0) return n;
105
107
  t -= 1;
106
- } else (r === Rn || r === sn) && (t += 1);
108
+ } else (r === Bn || r === gn || // "[1", "[2", etc. for if blocks
109
+ r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1);
107
110
  }
108
111
  var i = (
109
112
  /** @type {TemplateNode} */
110
- /* @__PURE__ */ me(n)
113
+ /* @__PURE__ */ ce(n)
111
114
  );
112
115
  e && n.remove(), n = i;
113
116
  }
114
117
  }
115
- function ti(e) {
116
- if (!e || e.nodeType !== $t)
117
- throw jt(), it;
118
+ function Lr(e) {
119
+ if (!e || e.nodeType !== gt)
120
+ throw wn(), kt;
118
121
  return (
119
122
  /** @type {Comment} */
120
123
  e.data
121
124
  );
122
125
  }
123
- function Bn(e) {
126
+ function Nr(e) {
124
127
  return e === this.v;
125
128
  }
126
- function ni(e, t) {
129
+ function vs(e, t) {
127
130
  return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
128
131
  }
129
- function ri(e) {
130
- return !ni(e, this.v);
132
+ function Or(e) {
133
+ return !vs(e, this.v);
131
134
  }
132
- let ii = !1, Y = null;
133
- function lt(e) {
134
- Y = e;
135
+ let _s = !1, fe = null;
136
+ function Nt(e) {
137
+ fe = e;
135
138
  }
136
- function Fn(e, t = !1, n) {
137
- Y = {
138
- p: Y,
139
+ function Dr(e, t = !1, n) {
140
+ fe = {
141
+ p: fe,
139
142
  i: !1,
140
143
  c: null,
141
144
  e: null,
@@ -144,166 +147,190 @@ function Fn(e, t = !1, n) {
144
147
  l: null
145
148
  };
146
149
  }
147
- function Mn(e) {
150
+ function Mr(e) {
148
151
  var t = (
149
152
  /** @type {ComponentContext} */
150
- Y
153
+ fe
151
154
  ), n = t.e;
152
155
  if (n !== null) {
153
156
  t.e = null;
154
157
  for (var r of n)
155
- ur(r);
158
+ si(r);
156
159
  }
157
- return e !== void 0 && (t.x = e), t.i = !0, Y = t.p, e ?? /** @type {T} */
160
+ return e !== void 0 && (t.x = e), t.i = !0, fe = t.p, e ?? /** @type {T} */
158
161
  {};
159
162
  }
160
- function jn() {
163
+ function qr() {
161
164
  return !0;
162
165
  }
163
- let Re = [];
164
- function qn() {
165
- var e = Re;
166
- Re = [], Fr(e);
166
+ let nt = [];
167
+ function Ir() {
168
+ var e = nt;
169
+ nt = [], Xi(e);
167
170
  }
168
- function Je(e) {
169
- if (Re.length === 0 && !ct) {
170
- var t = Re;
171
+ function yt(e) {
172
+ if (nt.length === 0 && !Ft) {
173
+ var t = nt;
171
174
  queueMicrotask(() => {
172
- t === Re && qn();
175
+ t === nt && Ir();
173
176
  });
174
177
  }
175
- Re.push(e);
178
+ nt.push(e);
176
179
  }
177
- function si() {
178
- for (; Re.length > 0; )
179
- qn();
180
+ function gs() {
181
+ for (; nt.length > 0; )
182
+ Ir();
180
183
  }
181
- function Yn(e) {
182
- var t = w;
184
+ function Pr(e) {
185
+ var t = T;
183
186
  if (t === null)
184
- return b.f |= Se, e;
185
- if ((t.f & Mt) === 0) {
186
- if ((t.f & on) === 0)
187
- throw e;
188
- t.b.error(e);
189
- } else
190
- ut(e, t);
187
+ return y.f |= Ke, e;
188
+ if ((t.f & qt) === 0 && (t.f & Gt) === 0)
189
+ throw e;
190
+ Ot(e, t);
191
191
  }
192
- function ut(e, t) {
192
+ function Ot(e, t) {
193
193
  for (; t !== null; ) {
194
- if ((t.f & on) !== 0)
194
+ if ((t.f & Rr) !== 0) {
195
+ if ((t.f & qt) === 0)
196
+ throw e;
195
197
  try {
196
198
  t.b.error(e);
197
199
  return;
198
200
  } catch (n) {
199
201
  e = n;
200
202
  }
203
+ }
201
204
  t = t.parent;
202
205
  }
203
206
  throw e;
204
207
  }
205
- const oi = -7169;
206
- function P(e, t) {
207
- e.f = e.f & oi | t;
208
+ const ps = -7169;
209
+ function D(e, t) {
210
+ e.f = e.f & ps | t;
208
211
  }
209
- function fn(e) {
210
- (e.f & H) !== 0 || e.deps === null ? P(e, O) : P(e, ye);
212
+ function Un(e) {
213
+ (e.f & ae) !== 0 || e.deps === null ? D(e, H) : D(e, me);
211
214
  }
212
- function Gn(e) {
215
+ function Hr(e) {
213
216
  if (e !== null)
214
217
  for (const t of e)
215
- (t.f & C) === 0 || (t.f & je) === 0 || (t.f ^= je, Gn(
218
+ (t.f & F) === 0 || (t.f & ht) === 0 || (t.f ^= ht, Hr(
216
219
  /** @type {Derived} */
217
220
  t.deps
218
221
  ));
219
222
  }
220
- function Un(e, t, n) {
221
- (e.f & L) !== 0 ? t.add(e) : (e.f & ye) !== 0 && n.add(e), Gn(e.deps), P(e, O);
223
+ function Vr(e, t, n) {
224
+ (e.f & B) !== 0 ? t.add(e) : (e.f & me) !== 0 && n.add(e), Hr(e.deps), D(e, H);
222
225
  }
223
- const xt = /* @__PURE__ */ new Set();
224
- let T = null, J = null, q = [], qt = null, Wt = !1, ct = !1;
225
- var Xe, Qe, Ne, Ze, gt, bt, Le, et, oe, Kt, zt, Vn;
226
- const dn = class dn {
226
+ const tn = /* @__PURE__ */ new Set();
227
+ let S = null, ve = null, K = [], $n = null, Ln = !1, Ft = !1;
228
+ var $t, Et, it, Tt, zt, Ut, st, Ne, At, ke, Nn, On, Fr;
229
+ const Zn = class Zn {
227
230
  constructor() {
228
- p(this, oe);
229
- y(this, "committed", !1);
231
+ w(this, ke);
232
+ O(this, "committed", !1);
230
233
  /**
231
234
  * The current values of any sources that are updated in this batch
232
235
  * They keys of this map are identical to `this.#previous`
233
236
  * @type {Map<Source, any>}
234
237
  */
235
- y(this, "current", /* @__PURE__ */ new Map());
238
+ O(this, "current", /* @__PURE__ */ new Map());
236
239
  /**
237
240
  * The values of any sources that are updated in this batch _before_ those updates took place.
238
241
  * They keys of this map are identical to `this.#current`
239
242
  * @type {Map<Source, any>}
240
243
  */
241
- y(this, "previous", /* @__PURE__ */ new Map());
244
+ O(this, "previous", /* @__PURE__ */ new Map());
242
245
  /**
243
246
  * When the batch is committed (and the DOM is updated), we need to remove old branches
244
247
  * and append new ones by calling the functions added inside (if/each/key/etc) blocks
245
248
  * @type {Set<() => void>}
246
249
  */
247
- p(this, Xe, /* @__PURE__ */ new Set());
250
+ w(this, $t, /* @__PURE__ */ new Set());
248
251
  /**
249
252
  * If a fork is discarded, we need to destroy any effects that are no longer needed
250
253
  * @type {Set<(batch: Batch) => void>}
251
254
  */
252
- p(this, Qe, /* @__PURE__ */ new Set());
255
+ w(this, Et, /* @__PURE__ */ new Set());
253
256
  /**
254
257
  * The number of async effects that are currently in flight
255
258
  */
256
- p(this, Ne, 0);
259
+ w(this, it, 0);
257
260
  /**
258
261
  * The number of async effects that are currently in flight, _not_ inside a pending boundary
259
262
  */
260
- p(this, Ze, 0);
263
+ w(this, Tt, 0);
261
264
  /**
262
265
  * A deferred that resolves when the batch is committed, used with `settled()`
263
266
  * TODO replace with Promise.withResolvers once supported widely enough
264
267
  * @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
265
268
  */
266
- p(this, gt, null);
269
+ w(this, zt, null);
267
270
  /**
268
271
  * Deferred effects (which run after async work has completed) that are DIRTY
269
272
  * @type {Set<Effect>}
270
273
  */
271
- p(this, bt, /* @__PURE__ */ new Set());
274
+ w(this, Ut, /* @__PURE__ */ new Set());
272
275
  /**
273
276
  * Deferred effects that are MAYBE_DIRTY
274
277
  * @type {Set<Effect>}
275
278
  */
276
- p(this, Le, /* @__PURE__ */ new Set());
279
+ w(this, st, /* @__PURE__ */ new Set());
277
280
  /**
278
- * A set of branches that still exist, but will be destroyed when this batch
279
- * is committed — we skip over these during `process`
280
- * @type {Set<Effect>}
281
+ * A map of branches that still exist, but will be destroyed when this batch
282
+ * is committed — we skip over these during `process`.
283
+ * The value contains child effects that were dirty/maybe_dirty before being reset,
284
+ * so they can be rescheduled if the branch survives.
285
+ * @type {Map<Effect, { d: Effect[], m: Effect[] }>}
281
286
  */
282
- y(this, "skipped_effects", /* @__PURE__ */ new Set());
283
- y(this, "is_fork", !1);
284
- p(this, et, !1);
287
+ w(this, Ne, /* @__PURE__ */ new Map());
288
+ O(this, "is_fork", !1);
289
+ w(this, At, !1);
285
290
  }
286
291
  is_deferred() {
287
- return this.is_fork || l(this, Ze) > 0;
292
+ return this.is_fork || a(this, Tt) > 0;
293
+ }
294
+ /**
295
+ * Add an effect to the #skipped_branches map and reset its children
296
+ * @param {Effect} effect
297
+ */
298
+ skip_effect(t) {
299
+ a(this, Ne).has(t) || a(this, Ne).set(t, { d: [], m: [] });
300
+ }
301
+ /**
302
+ * Remove an effect from the #skipped_branches map and reschedule
303
+ * any tracked dirty/maybe_dirty child effects
304
+ * @param {Effect} effect
305
+ */
306
+ unskip_effect(t) {
307
+ var n = a(this, Ne).get(t);
308
+ if (n) {
309
+ a(this, Ne).delete(t);
310
+ for (var r of n.d)
311
+ D(r, B), ge(r);
312
+ for (r of n.m)
313
+ D(r, me), ge(r);
314
+ }
288
315
  }
289
316
  /**
290
317
  *
291
318
  * @param {Effect[]} root_effects
292
319
  */
293
320
  process(t) {
294
- q = [], this.apply();
321
+ K = [], this.apply();
295
322
  var n = [], r = [];
296
323
  for (const i of t)
297
- A(this, oe, Kt).call(this, i, n, r);
324
+ P(this, ke, Nn).call(this, i, n, r);
298
325
  if (this.is_deferred()) {
299
- A(this, oe, zt).call(this, r), A(this, oe, zt).call(this, n);
300
- for (const i of this.skipped_effects)
301
- zn(i);
326
+ P(this, ke, On).call(this, r), P(this, ke, On).call(this, n);
327
+ for (const [i, s] of a(this, Ne))
328
+ zr(i, s);
302
329
  } else {
303
- for (const i of l(this, Xe)) i();
304
- l(this, Xe).clear(), l(this, Ne) === 0 && A(this, oe, Vn).call(this), T = null, $n(r), $n(n), l(this, gt)?.resolve();
330
+ for (const i of a(this, $t)) i();
331
+ a(this, $t).clear(), a(this, it) === 0 && P(this, ke, Fr).call(this), S = null, ur(r), ur(n), a(this, zt)?.resolve();
305
332
  }
306
- J = null;
333
+ ve = null;
307
334
  }
308
335
  /**
309
336
  * Associate a change to a given source with the current
@@ -312,228 +339,228 @@ const dn = class dn {
312
339
  * @param {any} value
313
340
  */
314
341
  capture(t, n) {
315
- n !== R && !this.previous.has(t) && this.previous.set(t, n), (t.f & Se) === 0 && (this.current.set(t, t.v), J?.set(t, t.v));
342
+ n !== V && !this.previous.has(t) && this.previous.set(t, n), (t.f & Ke) === 0 && (this.current.set(t, t.v), ve?.set(t, t.v));
316
343
  }
317
344
  activate() {
318
- T = this, this.apply();
345
+ S = this, this.apply();
319
346
  }
320
347
  deactivate() {
321
- T === this && (T = null, J = null);
348
+ S === this && (S = null, ve = null);
322
349
  }
323
350
  flush() {
324
- if (this.activate(), q.length > 0) {
325
- if (Hn(), T !== null && T !== this)
351
+ if (this.activate(), K.length > 0) {
352
+ if (Br(), S !== null && S !== this)
326
353
  return;
327
- } else l(this, Ne) === 0 && this.process([]);
354
+ } else a(this, it) === 0 && this.process([]);
328
355
  this.deactivate();
329
356
  }
330
357
  discard() {
331
- for (const t of l(this, Qe)) t(this);
332
- l(this, Qe).clear();
358
+ for (const t of a(this, Et)) t(this);
359
+ a(this, Et).clear();
333
360
  }
334
361
  /**
335
362
  *
336
363
  * @param {boolean} blocking
337
364
  */
338
365
  increment(t) {
339
- _(this, Ne, l(this, Ne) + 1), t && _(this, Ze, l(this, Ze) + 1);
366
+ b(this, it, a(this, it) + 1), t && b(this, Tt, a(this, Tt) + 1);
340
367
  }
341
368
  /**
342
369
  *
343
370
  * @param {boolean} blocking
344
371
  */
345
372
  decrement(t) {
346
- _(this, Ne, l(this, Ne) - 1), t && _(this, Ze, l(this, Ze) - 1), !l(this, et) && (_(this, et, !0), Je(() => {
347
- _(this, et, !1), this.is_deferred() ? q.length > 0 && this.flush() : this.revive();
373
+ b(this, it, a(this, it) - 1), t && b(this, Tt, a(this, Tt) - 1), !a(this, At) && (b(this, At, !0), yt(() => {
374
+ b(this, At, !1), this.is_deferred() ? K.length > 0 && this.flush() : this.revive();
348
375
  }));
349
376
  }
350
377
  revive() {
351
- for (const t of l(this, bt))
352
- l(this, Le).delete(t), P(t, L), be(t);
353
- for (const t of l(this, Le))
354
- P(t, ye), be(t);
378
+ for (const t of a(this, Ut))
379
+ a(this, st).delete(t), D(t, B), ge(t);
380
+ for (const t of a(this, st))
381
+ D(t, me), ge(t);
355
382
  this.flush();
356
383
  }
357
384
  /** @param {() => void} fn */
358
385
  oncommit(t) {
359
- l(this, Xe).add(t);
386
+ a(this, $t).add(t);
360
387
  }
361
388
  /** @param {(batch: Batch) => void} fn */
362
389
  ondiscard(t) {
363
- l(this, Qe).add(t);
390
+ a(this, Et).add(t);
364
391
  }
365
392
  settled() {
366
- return (l(this, gt) ?? _(this, gt, Nn())).promise;
393
+ return (a(this, zt) ?? b(this, zt, Sr())).promise;
367
394
  }
368
395
  static ensure() {
369
- if (T === null) {
370
- const t = T = new dn();
371
- xt.add(T), ct || Je(() => {
372
- T === t && t.flush();
396
+ if (S === null) {
397
+ const t = S = new Zn();
398
+ tn.add(S), Ft || yt(() => {
399
+ S === t && t.flush();
373
400
  });
374
401
  }
375
- return T;
402
+ return S;
376
403
  }
377
404
  apply() {
378
405
  }
379
406
  };
380
- Xe = new WeakMap(), Qe = new WeakMap(), Ne = new WeakMap(), Ze = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), Le = new WeakMap(), et = new WeakMap(), oe = new WeakSet(), /**
407
+ $t = new WeakMap(), Et = new WeakMap(), it = new WeakMap(), Tt = new WeakMap(), zt = new WeakMap(), Ut = new WeakMap(), st = new WeakMap(), Ne = new WeakMap(), At = new WeakMap(), ke = new WeakSet(), /**
381
408
  * Traverse the effect tree, executing effects or stashing
382
409
  * them for later execution as appropriate
383
410
  * @param {Effect} root
384
411
  * @param {Effect[]} effects
385
412
  * @param {Effect[]} render_effects
386
413
  */
387
- Kt = function(t, n, r) {
388
- t.f ^= O;
414
+ Nn = function(t, n, r) {
415
+ t.f ^= H;
389
416
  for (var i = t.first, s = null; i !== null; ) {
390
- var o = i.f, u = (o & (le | Ae)) !== 0, a = u && (o & O) !== 0, f = a || (o & re) !== 0 || this.skipped_effects.has(i);
417
+ var o = i.f, l = (o & (we | Je)) !== 0, u = l && (o & H) !== 0, f = u || (o & ne) !== 0 || a(this, Ne).has(i);
391
418
  if (!f && i.fn !== null) {
392
- u ? i.f ^= O : s !== null && (o & (Vt | Ft | Ln)) !== 0 ? s.b.defer_effect(i) : (o & Vt) !== 0 ? n.push(i) : Tt(i) && ((o & we) !== 0 && l(this, Le).add(i), vt(i));
419
+ l ? i.f ^= H : s !== null && (o & (Gt | mn | kr)) !== 0 ? s.b.defer_effect(i) : (o & Gt) !== 0 ? n.push(i) : Xt(i) && ((o & He) !== 0 && a(this, st).add(i), Mt(i));
393
420
  var h = i.first;
394
421
  if (h !== null) {
395
422
  i = h;
396
423
  continue;
397
424
  }
398
425
  }
399
- var d = i.parent;
400
- for (i = i.next; i === null && d !== null; )
401
- d === s && (s = null), i = d.next, d = d.parent;
426
+ var v = i.parent;
427
+ for (i = i.next; i === null && v !== null; )
428
+ v === s && (s = null), i = v.next, v = v.parent;
402
429
  }
403
430
  }, /**
404
431
  * @param {Effect[]} effects
405
432
  */
406
- zt = function(t) {
433
+ On = function(t) {
407
434
  for (var n = 0; n < t.length; n += 1)
408
- Un(t[n], l(this, bt), l(this, Le));
409
- }, Vn = function() {
435
+ Vr(t[n], a(this, Ut), a(this, st));
436
+ }, Fr = function() {
410
437
  var i;
411
- if (xt.size > 1) {
438
+ if (tn.size > 1) {
412
439
  this.previous.clear();
413
- var t = J, n = !0;
414
- for (const s of xt) {
440
+ var t = ve, n = !0;
441
+ for (const s of tn) {
415
442
  if (s === this) {
416
443
  n = !1;
417
444
  continue;
418
445
  }
419
446
  const o = [];
420
- for (const [a, f] of this.current) {
421
- if (s.current.has(a))
422
- if (n && f !== s.current.get(a))
423
- s.current.set(a, f);
447
+ for (const [u, f] of this.current) {
448
+ if (s.current.has(u))
449
+ if (n && f !== s.current.get(u))
450
+ s.current.set(u, f);
424
451
  else
425
452
  continue;
426
- o.push(a);
453
+ o.push(u);
427
454
  }
428
455
  if (o.length === 0)
429
456
  continue;
430
- const u = [...s.current.keys()].filter((a) => !this.current.has(a));
431
- if (u.length > 0) {
432
- var r = q;
433
- q = [];
434
- const a = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Map();
457
+ const l = [...s.current.keys()].filter((u) => !this.current.has(u));
458
+ if (l.length > 0) {
459
+ var r = K;
460
+ K = [];
461
+ const u = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Map();
435
462
  for (const h of o)
436
- Wn(h, u, a, f);
437
- if (q.length > 0) {
438
- T = s, s.apply();
439
- for (const h of q)
440
- A(i = s, oe, Kt).call(i, h, [], []);
463
+ Gr(h, l, u, f);
464
+ if (K.length > 0) {
465
+ S = s, s.apply();
466
+ for (const h of K)
467
+ P(i = s, ke, Nn).call(i, h, [], []);
441
468
  s.deactivate();
442
469
  }
443
- q = r;
470
+ K = r;
444
471
  }
445
472
  }
446
- T = null, J = t;
473
+ S = null, ve = t;
447
474
  }
448
- this.committed = !0, xt.delete(this);
475
+ this.committed = !0, tn.delete(this);
449
476
  };
450
- let ge = dn;
451
- function Ue(e) {
452
- var t = ct;
453
- ct = !0;
477
+ let Pe = Zn;
478
+ function et(e) {
479
+ var t = Ft;
480
+ Ft = !0;
454
481
  try {
455
482
  for (var n; ; ) {
456
- if (si(), q.length === 0 && (T?.flush(), q.length === 0))
457
- return qt = null, /** @type {T} */
483
+ if (gs(), K.length === 0 && (S?.flush(), K.length === 0))
484
+ return $n = null, /** @type {T} */
458
485
  n;
459
- Hn();
486
+ Br();
460
487
  }
461
488
  } finally {
462
- ct = t;
489
+ Ft = t;
463
490
  }
464
491
  }
465
- function Hn() {
466
- Wt = !0;
492
+ function Br() {
493
+ Ln = !0;
467
494
  var e = null;
468
495
  try {
469
- for (var t = 0; q.length > 0; ) {
470
- var n = ge.ensure();
496
+ for (var t = 0; K.length > 0; ) {
497
+ var n = Pe.ensure();
471
498
  if (t++ > 1e3) {
472
499
  var r, i;
473
- li();
500
+ ms();
474
501
  }
475
- n.process(q), xe.clear();
502
+ n.process(K), We.clear();
476
503
  }
477
504
  } finally {
478
- Wt = !1, qt = null;
505
+ K = [], Ln = !1, $n = null;
479
506
  }
480
507
  }
481
- function li() {
508
+ function ms() {
482
509
  try {
483
- Hr();
510
+ os();
484
511
  } catch (e) {
485
- ut(e, qt);
512
+ Ot(e, $n);
486
513
  }
487
514
  }
488
- let ae = null;
489
- function $n(e) {
515
+ let Le = null;
516
+ function ur(e) {
490
517
  var t = e.length;
491
518
  if (t !== 0) {
492
519
  for (var n = 0; n < t; ) {
493
520
  var r = e[n++];
494
- if ((r.f & (pe | re)) === 0 && Tt(r) && (ae = /* @__PURE__ */ new Set(), vt(r), r.deps === null && r.first === null && r.nodes === null && (r.teardown === null && r.ac === null ? dr(r) : r.fn = null), ae?.size > 0)) {
495
- xe.clear();
496
- for (const i of ae) {
497
- if ((i.f & (pe | re)) !== 0) continue;
521
+ if ((r.f & (Ie | ne)) === 0 && Xt(r) && (Le = /* @__PURE__ */ new Set(), Mt(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && ai(r), Le?.size > 0)) {
522
+ We.clear();
523
+ for (const i of Le) {
524
+ if ((i.f & (Ie | ne)) !== 0) continue;
498
525
  const s = [i];
499
526
  let o = i.parent;
500
527
  for (; o !== null; )
501
- ae.has(o) && (ae.delete(o), s.push(o)), o = o.parent;
502
- for (let u = s.length - 1; u >= 0; u--) {
503
- const a = s[u];
504
- (a.f & (pe | re)) === 0 && vt(a);
528
+ Le.has(o) && (Le.delete(o), s.push(o)), o = o.parent;
529
+ for (let l = s.length - 1; l >= 0; l--) {
530
+ const u = s[l];
531
+ (u.f & (Ie | ne)) === 0 && Mt(u);
505
532
  }
506
533
  }
507
- ae.clear();
534
+ Le.clear();
508
535
  }
509
536
  }
510
- ae = null;
537
+ Le = null;
511
538
  }
512
539
  }
513
- function Wn(e, t, n, r) {
540
+ function Gr(e, t, n, r) {
514
541
  if (!n.has(e) && (n.add(e), e.reactions !== null))
515
542
  for (const i of e.reactions) {
516
543
  const s = i.f;
517
- (s & C) !== 0 ? Wn(
544
+ (s & F) !== 0 ? Gr(
518
545
  /** @type {Derived} */
519
546
  i,
520
547
  t,
521
548
  n,
522
549
  r
523
- ) : (s & (ln | we)) !== 0 && (s & L) === 0 && Kn(i, t, r) && (P(i, L), be(
550
+ ) : (s & (zn | He)) !== 0 && (s & B) === 0 && jr(i, t, r) && (D(i, B), ge(
524
551
  /** @type {Effect} */
525
552
  i
526
553
  ));
527
554
  }
528
555
  }
529
- function Kn(e, t, n) {
556
+ function jr(e, t, n) {
530
557
  const r = n.get(e);
531
558
  if (r !== void 0) return r;
532
559
  if (e.deps !== null)
533
560
  for (const i of e.deps) {
534
- if (st.call(t, i))
561
+ if (Rt.call(t, i))
535
562
  return !0;
536
- if ((i.f & C) !== 0 && Kn(
563
+ if ((i.f & F) !== 0 && jr(
537
564
  /** @type {Derived} */
538
565
  i,
539
566
  t,
@@ -547,80 +574,80 @@ function Kn(e, t, n) {
547
574
  }
548
575
  return n.set(e, !1), !1;
549
576
  }
550
- function be(e) {
551
- for (var t = qt = e; t.parent !== null; ) {
577
+ function ge(e) {
578
+ for (var t = $n = e; t.parent !== null; ) {
552
579
  t = t.parent;
553
580
  var n = t.f;
554
- if (Wt && t === w && (n & we) !== 0 && (n & Dn) === 0)
581
+ if (Ln && t === T && (n & He) !== 0 && (n & jn) === 0)
555
582
  return;
556
- if ((n & (Ae | le)) !== 0) {
557
- if ((n & O) === 0) return;
558
- t.f ^= O;
583
+ if ((n & (Je | we)) !== 0) {
584
+ if ((n & H) === 0) return;
585
+ t.f ^= H;
559
586
  }
560
587
  }
561
- q.push(t);
588
+ K.push(t);
562
589
  }
563
- function zn(e) {
564
- if (!((e.f & le) !== 0 && (e.f & O) !== 0)) {
565
- P(e, O);
566
- for (var t = e.first; t !== null; )
567
- zn(t), t = t.next;
590
+ function zr(e, t) {
591
+ if (!((e.f & we) !== 0 && (e.f & H) !== 0)) {
592
+ (e.f & B) !== 0 ? t.d.push(e) : (e.f & me) !== 0 && t.m.push(e), D(e, H);
593
+ for (var n = e.first; n !== null; )
594
+ zr(n, t), n = n.next;
568
595
  }
569
596
  }
570
- function ui(e) {
571
- let t = 0, n = Et(0), r;
597
+ function bs(e) {
598
+ let t = 0, n = dt(0), r;
572
599
  return () => {
573
- hn() && (m(n), ar(() => (t === 0 && (r = Er(() => e(() => ht(n)))), t += 1, () => {
574
- Je(() => {
575
- t -= 1, t === 0 && (r?.(), r = void 0, ht(n));
600
+ Xn() && (g(n), oi(() => (t === 0 && (r = Gs(() => e(() => Bt(n)))), t += 1, () => {
601
+ yt(() => {
602
+ t -= 1, t === 0 && (r?.(), r = void 0, Bt(n));
576
603
  });
577
604
  })));
578
605
  };
579
606
  }
580
- var ai = ot | qe | on;
581
- function fi(e, t, n) {
582
- new ci(e, t, n);
607
+ var ws = Lt | _t | Rr;
608
+ function ys(e, t, n) {
609
+ new $s(e, t, n);
583
610
  }
584
- var M, wt, Z, De, ee, U, D, te, he, Te, Ie, de, tt, Be, nt, rt, _e, It, k, Jn, Xn, Jt, Pt, At, Xt;
585
- class ci {
611
+ var ee, Yt, Te, ot, Ae, se, Y, xe, Oe, Ue, lt, De, xt, at, Ct, St, Me, vn, q, Ur, Yr, Dn, on, ln, Mn;
612
+ class $s {
586
613
  /**
587
614
  * @param {TemplateNode} node
588
615
  * @param {BoundaryProps} props
589
616
  * @param {((anchor: Node) => void)} children
590
617
  */
591
618
  constructor(t, n, r) {
592
- p(this, k);
619
+ w(this, q);
593
620
  /** @type {Boundary | null} */
594
- y(this, "parent");
595
- y(this, "is_pending", !1);
621
+ O(this, "parent");
622
+ O(this, "is_pending", !1);
596
623
  /** @type {TemplateNode} */
597
- p(this, M);
624
+ w(this, ee);
598
625
  /** @type {TemplateNode | null} */
599
- p(this, wt, S ? $ : null);
626
+ w(this, Yt, A ? x : null);
600
627
  /** @type {BoundaryProps} */
601
- p(this, Z);
628
+ w(this, Te);
602
629
  /** @type {((anchor: Node) => void)} */
603
- p(this, De);
630
+ w(this, ot);
604
631
  /** @type {Effect} */
605
- p(this, ee);
632
+ w(this, Ae);
606
633
  /** @type {Effect | null} */
607
- p(this, U, null);
634
+ w(this, se, null);
608
635
  /** @type {Effect | null} */
609
- p(this, D, null);
636
+ w(this, Y, null);
610
637
  /** @type {Effect | null} */
611
- p(this, te, null);
638
+ w(this, xe, null);
612
639
  /** @type {DocumentFragment | null} */
613
- p(this, he, null);
640
+ w(this, Oe, null);
614
641
  /** @type {TemplateNode | null} */
615
- p(this, Te, null);
616
- p(this, Ie, 0);
617
- p(this, de, 0);
618
- p(this, tt, !1);
619
- p(this, Be, !1);
642
+ w(this, Ue, null);
643
+ w(this, lt, 0);
644
+ w(this, De, 0);
645
+ w(this, xt, !1);
646
+ w(this, at, !1);
620
647
  /** @type {Set<Effect>} */
621
- p(this, nt, /* @__PURE__ */ new Set());
648
+ w(this, Ct, /* @__PURE__ */ new Set());
622
649
  /** @type {Set<Effect>} */
623
- p(this, rt, /* @__PURE__ */ new Set());
650
+ w(this, St, /* @__PURE__ */ new Set());
624
651
  /**
625
652
  * A source containing the number of pending async deriveds/expressions.
626
653
  * Only created if `$effect.pending()` is used inside the boundary,
@@ -628,37 +655,37 @@ class ci {
628
655
  * calls followed by no-op flushes
629
656
  * @type {Source<number> | null}
630
657
  */
631
- p(this, _e, null);
632
- p(this, It, ui(() => (_(this, _e, Et(l(this, Ie))), () => {
633
- _(this, _e, null);
658
+ w(this, Me, null);
659
+ w(this, vn, bs(() => (b(this, Me, dt(a(this, lt))), () => {
660
+ b(this, Me, null);
634
661
  })));
635
- _(this, M, t), _(this, Z, n), _(this, De, r), this.parent = /** @type {Effect} */
636
- w.b, this.is_pending = !!l(this, Z).pending, _(this, ee, fr(() => {
637
- if (w.b = this, S) {
638
- const s = l(this, wt);
639
- an(), /** @type {Comment} */
640
- s.nodeType === $t && /** @type {Comment} */
641
- s.data === sn ? A(this, k, Xn).call(this) : (A(this, k, Jn).call(this), l(this, de) === 0 && (this.is_pending = !1));
662
+ b(this, ee, t), b(this, Te, n), b(this, ot, r), this.parent = /** @type {Effect} */
663
+ T.b, this.is_pending = !!a(this, Te).pending, b(this, Ae, Tn(() => {
664
+ if (T.b = this, A) {
665
+ const s = a(this, Yt);
666
+ yn(), /** @type {Comment} */
667
+ s.nodeType === gt && /** @type {Comment} */
668
+ s.data === gn ? P(this, q, Yr).call(this) : (P(this, q, Ur).call(this), a(this, De) === 0 && (this.is_pending = !1));
642
669
  } else {
643
- var i = A(this, k, Jt).call(this);
670
+ var i = P(this, q, Dn).call(this);
644
671
  try {
645
- _(this, U, fe(() => r(i)));
672
+ b(this, se, le(() => r(i)));
646
673
  } catch (s) {
647
674
  this.error(s);
648
675
  }
649
- l(this, de) > 0 ? A(this, k, At).call(this) : this.is_pending = !1;
676
+ a(this, De) > 0 ? P(this, q, ln).call(this) : this.is_pending = !1;
650
677
  }
651
678
  return () => {
652
- l(this, Te)?.remove();
679
+ a(this, Ue)?.remove();
653
680
  };
654
- }, ai)), S && _(this, M, $);
681
+ }, ws)), A && b(this, ee, x);
655
682
  }
656
683
  /**
657
684
  * Defer an effect inside a pending boundary until the boundary resolves
658
685
  * @param {Effect} effect
659
686
  */
660
687
  defer_effect(t) {
661
- Un(t, l(this, nt), l(this, rt));
688
+ Vr(t, a(this, Ct), a(this, St));
662
689
  }
663
690
  /**
664
691
  * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
@@ -668,7 +695,7 @@ class ci {
668
695
  return !this.is_pending && (!this.parent || this.parent.is_rendered());
669
696
  }
670
697
  has_pending_snippet() {
671
- return !!l(this, Z).pending;
698
+ return !!a(this, Te).pending;
672
699
  }
673
700
  /**
674
701
  * Update the source that powers `$effect.pending()` inside this boundary,
@@ -677,199 +704,199 @@ class ci {
677
704
  * @param {1 | -1} d
678
705
  */
679
706
  update_pending_count(t) {
680
- A(this, k, Xt).call(this, t), _(this, Ie, l(this, Ie) + t), !(!l(this, _e) || l(this, tt)) && (_(this, tt, !0), Je(() => {
681
- _(this, tt, !1), l(this, _e) && Lt(l(this, _e), l(this, Ie));
707
+ P(this, q, Mn).call(this, t), b(this, lt, a(this, lt) + t), !(!a(this, Me) || a(this, xt)) && (b(this, xt, !0), yt(() => {
708
+ b(this, xt, !1), a(this, Me) && Dt(a(this, Me), a(this, lt));
682
709
  }));
683
710
  }
684
711
  get_effect_pending() {
685
- return l(this, It).call(this), m(
712
+ return a(this, vn).call(this), g(
686
713
  /** @type {Source<number>} */
687
- l(this, _e)
714
+ a(this, Me)
688
715
  );
689
716
  }
690
717
  /** @param {unknown} error */
691
718
  error(t) {
692
- var n = l(this, Z).onerror;
693
- let r = l(this, Z).failed;
694
- if (l(this, Be) || !n && !r)
719
+ var n = a(this, Te).onerror;
720
+ let r = a(this, Te).failed;
721
+ if (a(this, at) || !n && !r)
695
722
  throw t;
696
- l(this, U) && (B(l(this, U)), _(this, U, null)), l(this, D) && (B(l(this, D)), _(this, D, null)), l(this, te) && (B(l(this, te)), _(this, te, null)), S && (ie(
723
+ a(this, se) && (j(a(this, se)), b(this, se, null)), a(this, Y) && (j(a(this, Y)), b(this, Y, null)), a(this, xe) && (j(a(this, xe)), b(this, xe, null)), A && (z(
697
724
  /** @type {TemplateNode} */
698
- l(this, wt)
699
- ), ei(), ie(In()));
725
+ a(this, Yt)
726
+ ), ds(), z(dn()));
700
727
  var i = !1, s = !1;
701
728
  const o = () => {
702
729
  if (i) {
703
- Qr();
730
+ hs();
704
731
  return;
705
732
  }
706
- i = !0, s && Xr(), ge.ensure(), _(this, Ie, 0), l(this, te) !== null && dt(l(this, te), () => {
707
- _(this, te, null);
708
- }), this.is_pending = this.has_pending_snippet(), _(this, U, A(this, k, Pt).call(this, () => (_(this, Be, !1), fe(() => l(this, De).call(this, l(this, M)))))), l(this, de) > 0 ? A(this, k, At).call(this) : this.is_pending = !1;
733
+ i = !0, s && cs(), Pe.ensure(), b(this, lt, 0), a(this, xe) !== null && ft(a(this, xe), () => {
734
+ b(this, xe, null);
735
+ }), this.is_pending = this.has_pending_snippet(), b(this, se, P(this, q, on).call(this, () => (b(this, at, !1), le(() => a(this, ot).call(this, a(this, ee)))))), a(this, De) > 0 ? P(this, q, ln).call(this) : this.is_pending = !1;
709
736
  };
710
- Je(() => {
737
+ yt(() => {
711
738
  try {
712
739
  s = !0, n?.(t, o), s = !1;
713
- } catch (u) {
714
- ut(u, l(this, ee) && l(this, ee).parent);
740
+ } catch (l) {
741
+ Ot(l, a(this, Ae) && a(this, Ae).parent);
715
742
  }
716
- r && _(this, te, A(this, k, Pt).call(this, () => {
717
- ge.ensure(), _(this, Be, !0);
743
+ r && b(this, xe, P(this, q, on).call(this, () => {
744
+ Pe.ensure(), b(this, at, !0);
718
745
  try {
719
- return fe(() => {
746
+ return le(() => {
720
747
  r(
721
- l(this, M),
748
+ a(this, ee),
722
749
  () => t,
723
750
  () => o
724
751
  );
725
752
  });
726
- } catch (u) {
727
- return ut(
728
- u,
753
+ } catch (l) {
754
+ return Ot(
755
+ l,
729
756
  /** @type {Effect} */
730
- l(this, ee).parent
757
+ a(this, Ae).parent
731
758
  ), null;
732
759
  } finally {
733
- _(this, Be, !1);
760
+ b(this, at, !1);
734
761
  }
735
762
  }));
736
763
  });
737
764
  }
738
765
  }
739
- M = new WeakMap(), wt = new WeakMap(), Z = new WeakMap(), De = new WeakMap(), ee = new WeakMap(), U = new WeakMap(), D = new WeakMap(), te = new WeakMap(), he = new WeakMap(), Te = new WeakMap(), Ie = new WeakMap(), de = new WeakMap(), tt = new WeakMap(), Be = new WeakMap(), nt = new WeakMap(), rt = new WeakMap(), _e = new WeakMap(), It = new WeakMap(), k = new WeakSet(), Jn = function() {
766
+ ee = new WeakMap(), Yt = new WeakMap(), Te = new WeakMap(), ot = new WeakMap(), Ae = new WeakMap(), se = new WeakMap(), Y = new WeakMap(), xe = new WeakMap(), Oe = new WeakMap(), Ue = new WeakMap(), lt = new WeakMap(), De = new WeakMap(), xt = new WeakMap(), at = new WeakMap(), Ct = new WeakMap(), St = new WeakMap(), Me = new WeakMap(), vn = new WeakMap(), q = new WeakSet(), Ur = function() {
740
767
  try {
741
- _(this, U, fe(() => l(this, De).call(this, l(this, M))));
768
+ b(this, se, le(() => a(this, ot).call(this, a(this, ee))));
742
769
  } catch (t) {
743
770
  this.error(t);
744
771
  }
745
- }, Xn = function() {
746
- const t = l(this, Z).pending;
747
- t && (_(this, D, fe(() => t(l(this, M)))), Je(() => {
748
- var n = A(this, k, Jt).call(this);
749
- _(this, U, A(this, k, Pt).call(this, () => (ge.ensure(), fe(() => l(this, De).call(this, n))))), l(this, de) > 0 ? A(this, k, At).call(this) : (dt(
772
+ }, Yr = function() {
773
+ const t = a(this, Te).pending;
774
+ t && (b(this, Y, le(() => t(a(this, ee)))), yt(() => {
775
+ var n = P(this, q, Dn).call(this);
776
+ b(this, se, P(this, q, on).call(this, () => (Pe.ensure(), le(() => a(this, ot).call(this, n))))), a(this, De) > 0 ? P(this, q, ln).call(this) : (ft(
750
777
  /** @type {Effect} */
751
- l(this, D),
778
+ a(this, Y),
752
779
  () => {
753
- _(this, D, null);
780
+ b(this, Y, null);
754
781
  }
755
782
  ), this.is_pending = !1);
756
783
  }));
757
- }, Jt = function() {
758
- var t = l(this, M);
759
- return this.is_pending && (_(this, Te, ke()), l(this, M).before(l(this, Te)), t = l(this, Te)), t;
784
+ }, Dn = function() {
785
+ var t = a(this, ee);
786
+ return this.is_pending && (b(this, Ue, be()), a(this, ee).before(a(this, Ue)), t = a(this, Ue)), t;
760
787
  }, /**
761
788
  * @param {() => Effect | null} fn
762
789
  */
763
- Pt = function(t) {
764
- var n = w, r = b, i = Y;
765
- se(l(this, ee)), K(l(this, ee)), lt(l(this, ee).ctx);
790
+ on = function(t) {
791
+ var n = T, r = y, i = fe;
792
+ Se(a(this, Ae)), he(a(this, Ae)), Nt(a(this, Ae).ctx);
766
793
  try {
767
794
  return t();
768
795
  } catch (s) {
769
- return Yn(s), null;
796
+ return Pr(s), null;
770
797
  } finally {
771
- se(n), K(r), lt(i);
798
+ Se(n), he(r), Nt(i);
772
799
  }
773
- }, At = function() {
800
+ }, ln = function() {
774
801
  const t = (
775
802
  /** @type {(anchor: Node) => void} */
776
- l(this, Z).pending
803
+ a(this, Te).pending
777
804
  );
778
- l(this, U) !== null && (_(this, he, document.createDocumentFragment()), l(this, he).append(
805
+ a(this, se) !== null && (b(this, Oe, document.createDocumentFragment()), a(this, Oe).append(
779
806
  /** @type {TemplateNode} */
780
- l(this, Te)
781
- ), pr(l(this, U), l(this, he))), l(this, D) === null && _(this, D, fe(() => t(l(this, M))));
807
+ a(this, Ue)
808
+ ), ci(a(this, se), a(this, Oe))), a(this, Y) === null && b(this, Y, le(() => t(a(this, ee))));
782
809
  }, /**
783
810
  * Updates the pending count associated with the currently visible pending snippet,
784
811
  * if any, such that we can replace the snippet with content once work is done
785
812
  * @param {1 | -1} d
786
813
  */
787
- Xt = function(t) {
814
+ Mn = function(t) {
788
815
  var n;
789
816
  if (!this.has_pending_snippet()) {
790
- this.parent && A(n = this.parent, k, Xt).call(n, t);
817
+ this.parent && P(n = this.parent, q, Mn).call(n, t);
791
818
  return;
792
819
  }
793
- if (_(this, de, l(this, de) + t), l(this, de) === 0) {
820
+ if (b(this, De, a(this, De) + t), a(this, De) === 0) {
794
821
  this.is_pending = !1;
795
- for (const r of l(this, nt))
796
- P(r, L), be(r);
797
- for (const r of l(this, rt))
798
- P(r, ye), be(r);
799
- l(this, nt).clear(), l(this, rt).clear(), l(this, D) && dt(l(this, D), () => {
800
- _(this, D, null);
801
- }), l(this, he) && (l(this, M).before(l(this, he)), _(this, he, null));
822
+ for (const r of a(this, Ct))
823
+ D(r, B), ge(r);
824
+ for (const r of a(this, St))
825
+ D(r, me), ge(r);
826
+ a(this, Ct).clear(), a(this, St).clear(), a(this, Y) && ft(a(this, Y), () => {
827
+ b(this, Y, null);
828
+ }), a(this, Oe) && (a(this, ee).before(a(this, Oe)), b(this, Oe, null));
802
829
  }
803
830
  };
804
- function hi(e, t, n, r) {
805
- const i = Qn;
831
+ function Es(e, t, n, r) {
832
+ const i = En;
806
833
  var s = e.filter((c) => !c.settled);
807
834
  if (n.length === 0 && s.length === 0) {
808
835
  r(t.map(i));
809
836
  return;
810
837
  }
811
- var o = T, u = (
838
+ var o = S, l = (
812
839
  /** @type {Effect} */
813
- w
814
- ), a = di(), f = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null;
840
+ T
841
+ ), u = Ts(), f = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null;
815
842
  function h(c) {
816
- a();
843
+ u();
817
844
  try {
818
845
  r(c);
819
- } catch (v) {
820
- (u.f & pe) === 0 && ut(v, u);
846
+ } catch (p) {
847
+ (l.f & Ie) === 0 && Ot(p, l);
821
848
  }
822
- o?.deactivate(), Qt();
849
+ o?.deactivate(), qn();
823
850
  }
824
851
  if (n.length === 0) {
825
852
  f.then(() => h(t.map(i)));
826
853
  return;
827
854
  }
828
- function d() {
829
- a(), Promise.all(n.map((c) => /* @__PURE__ */ _i(c))).then((c) => h([...t.map(i), ...c])).catch((c) => ut(c, u));
855
+ function v() {
856
+ u(), Promise.all(n.map((c) => /* @__PURE__ */ As(c))).then((c) => h([...t.map(i), ...c])).catch((c) => Ot(c, l));
830
857
  }
831
- f ? f.then(d) : d();
858
+ f ? f.then(v) : v();
832
859
  }
833
- function di() {
834
- var e = w, t = b, n = Y, r = T;
860
+ function Ts() {
861
+ var e = T, t = y, n = fe, r = S;
835
862
  return function(s = !0) {
836
- se(e), K(t), lt(n), s && r?.activate();
863
+ Se(e), he(t), Nt(n), s && r?.activate();
837
864
  };
838
865
  }
839
- function Qt() {
840
- se(null), K(null), lt(null);
866
+ function qn() {
867
+ Se(null), he(null), Nt(null);
841
868
  }
842
869
  // @__NO_SIDE_EFFECTS__
843
- function Qn(e) {
844
- var t = C | L, n = b !== null && (b.f & C) !== 0 ? (
870
+ function En(e) {
871
+ var t = F | B, n = y !== null && (y.f & F) !== 0 ? (
845
872
  /** @type {Derived} */
846
- b
873
+ y
847
874
  ) : null;
848
- return w !== null && (w.f |= qe), {
849
- ctx: Y,
875
+ return T !== null && (T.f |= _t), {
876
+ ctx: fe,
850
877
  deps: null,
851
878
  effects: null,
852
- equals: Bn,
879
+ equals: Nr,
853
880
  f: t,
854
881
  fn: e,
855
882
  reactions: null,
856
883
  rv: 0,
857
884
  v: (
858
885
  /** @type {V} */
859
- R
886
+ V
860
887
  ),
861
888
  wv: 0,
862
- parent: n ?? w,
889
+ parent: n ?? T,
863
890
  ac: null
864
891
  };
865
892
  }
866
893
  // @__NO_SIDE_EFFECTS__
867
- function _i(e, t, n) {
894
+ function As(e, t, n) {
868
895
  let r = (
869
896
  /** @type {Effect | null} */
870
- w
897
+ T
871
898
  );
872
- r === null && Yr();
899
+ r === null && ts();
873
900
  var i = (
874
901
  /** @type {Boundary} */
875
902
  r.b
@@ -877,69 +904,79 @@ function _i(e, t, n) {
877
904
  /** @type {Promise<V>} */
878
905
  /** @type {unknown} */
879
906
  void 0
880
- ), o = Et(
907
+ ), o = dt(
881
908
  /** @type {V} */
882
- R
883
- ), u = !b, a = /* @__PURE__ */ new Map();
884
- return Pi(() => {
885
- var f = Nn();
909
+ V
910
+ ), l = !y, u = /* @__PURE__ */ new Map();
911
+ return Ps(() => {
912
+ var f = Sr();
886
913
  s = f.promise;
887
914
  try {
888
915
  Promise.resolve(e()).then(f.resolve, f.reject).then(() => {
889
- h === T && h.committed && h.deactivate(), Qt();
916
+ h === S && h.committed && h.deactivate(), qn();
890
917
  });
891
- } catch (v) {
892
- f.reject(v), Qt();
918
+ } catch (p) {
919
+ f.reject(p), qn();
893
920
  }
894
921
  var h = (
895
922
  /** @type {Batch} */
896
- T
923
+ S
897
924
  );
898
- if (u) {
899
- var d = i.is_rendered();
900
- i.update_pending_count(1), h.increment(d), a.get(h)?.reject(Ve), a.delete(h), a.set(h, f);
925
+ if (l) {
926
+ var v = i.is_rendered();
927
+ i.update_pending_count(1), h.increment(v), u.get(h)?.reject(tt), u.delete(h), u.set(h, f);
901
928
  }
902
- const c = (v, g = void 0) => {
903
- if (h.activate(), g)
904
- g !== Ve && (o.f |= Se, Lt(o, g));
929
+ const c = (p, d = void 0) => {
930
+ if (h.activate(), d)
931
+ d !== tt && (o.f |= Ke, Dt(o, d));
905
932
  else {
906
- (o.f & Se) !== 0 && (o.f ^= Se), Lt(o, v);
907
- for (const [N, x] of a) {
908
- if (a.delete(N), N === h) break;
909
- x.reject(Ve);
933
+ (o.f & Ke) !== 0 && (o.f ^= Ke), Dt(o, p);
934
+ for (const [m, $] of u) {
935
+ if (u.delete(m), m === h) break;
936
+ $.reject(tt);
910
937
  }
911
938
  }
912
- u && (i.update_pending_count(-1), h.decrement(d));
939
+ l && (i.update_pending_count(-1), h.decrement(v));
913
940
  };
914
- f.promise.then(c, (v) => c(null, v || "unknown"));
915
- }), Ti(() => {
916
- for (const f of a.values())
917
- f.reject(Ve);
941
+ f.promise.then(c, (p) => c(null, p || "unknown"));
942
+ }), Os(() => {
943
+ for (const f of u.values())
944
+ f.reject(tt);
918
945
  }), new Promise((f) => {
919
- function h(d) {
946
+ function h(v) {
920
947
  function c() {
921
- d === s ? f(o) : h(s);
948
+ v === s ? f(o) : h(s);
922
949
  }
923
- d.then(c, c);
950
+ v.then(c, c);
924
951
  }
925
952
  h(s);
926
953
  });
927
954
  }
928
- function Zn(e) {
955
+ // @__NO_SIDE_EFFECTS__
956
+ function fr(e) {
957
+ const t = /* @__PURE__ */ En(e);
958
+ return hi(t), t;
959
+ }
960
+ // @__NO_SIDE_EFFECTS__
961
+ function xs(e) {
962
+ const t = /* @__PURE__ */ En(e);
963
+ return t.equals = Or, t;
964
+ }
965
+ function Cs(e) {
929
966
  var t = e.effects;
930
967
  if (t !== null) {
931
968
  e.effects = null;
932
969
  for (var n = 0; n < t.length; n += 1)
933
- B(
970
+ j(
934
971
  /** @type {Effect} */
935
972
  t[n]
936
973
  );
937
974
  }
938
975
  }
939
- function vi(e) {
976
+ function Ss(e) {
940
977
  for (var t = e.parent; t !== null; ) {
941
- if ((t.f & C) === 0)
942
- return (t.f & pe) === 0 ? (
978
+ if ((t.f & F) === 0)
979
+ return (t.f & Ie) === 0 ? (
943
980
  /** @type {Effect} */
944
981
  t
945
982
  ) : null;
@@ -947,162 +984,172 @@ function vi(e) {
947
984
  }
948
985
  return null;
949
986
  }
950
- function cn(e) {
951
- var t, n = w;
952
- se(vi(e));
987
+ function Yn(e) {
988
+ var t, n = T;
989
+ Se(Ss(e));
953
990
  try {
954
- e.f &= ~je, Zn(e), t = yr(e);
991
+ e.f &= ~ht, Cs(e), t = gi(e);
955
992
  } finally {
956
- se(n);
993
+ Se(n);
957
994
  }
958
995
  return t;
959
996
  }
960
- function er(e) {
961
- var t = cn(e);
962
- if (!e.equals(t) && (e.wv = br(), (!T?.is_fork || e.deps === null) && (e.v = t, e.deps === null))) {
963
- P(e, O);
997
+ function Kr(e) {
998
+ var t = Yn(e);
999
+ if (!e.equals(t) && (e.wv = vi(), (!S?.is_fork || e.deps === null) && (e.v = t, e.deps === null))) {
1000
+ D(e, H);
964
1001
  return;
965
1002
  }
966
- Pe || (J !== null ? (hn() || T?.is_fork) && J.set(e, t) : fn(e));
1003
+ Xe || (ve !== null ? (Xn() || S?.is_fork) && ve.set(e, t) : Un(e));
1004
+ }
1005
+ function ks(e) {
1006
+ if (e.effects !== null)
1007
+ for (const t of e.effects)
1008
+ (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(tt), t.teardown = Wi, t.ac = null, jt(t, 0), Jn(t));
967
1009
  }
968
- let Zt = /* @__PURE__ */ new Set();
969
- const xe = /* @__PURE__ */ new Map();
970
- let tr = !1;
971
- function Et(e, t) {
1010
+ function Wr(e) {
1011
+ if (e.effects !== null)
1012
+ for (const t of e.effects)
1013
+ t.teardown && Mt(t);
1014
+ }
1015
+ let In = /* @__PURE__ */ new Set();
1016
+ const We = /* @__PURE__ */ new Map();
1017
+ let Xr = !1;
1018
+ function dt(e, t) {
972
1019
  var n = {
973
1020
  f: 0,
974
1021
  // TODO ideally we could skip this altogether, but it causes type errors
975
1022
  v: e,
976
1023
  reactions: null,
977
- equals: Bn,
1024
+ equals: Nr,
978
1025
  rv: 0,
979
1026
  wv: 0
980
1027
  };
981
1028
  return n;
982
1029
  }
983
1030
  // @__NO_SIDE_EFFECTS__
984
- function ue(e, t) {
985
- const n = Et(e);
986
- return Ni(n), n;
1031
+ function W(e, t) {
1032
+ const n = dt(e);
1033
+ return hi(n), n;
987
1034
  }
988
1035
  // @__NO_SIDE_EFFECTS__
989
- function pi(e, t = !1, n = !0) {
990
- const r = Et(e);
991
- return t || (r.equals = ri), r;
1036
+ function Jr(e, t = !1, n = !0) {
1037
+ const r = dt(e);
1038
+ return t || (r.equals = Or), r;
992
1039
  }
993
- function ce(e, t, n = !1) {
994
- b !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
1040
+ function C(e, t, n = !1) {
1041
+ y !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
995
1042
  // to ensure we error if state is set inside an inspect effect
996
- (!X || (b.f & mn) !== 0) && jn() && (b.f & (C | we | ln | mn)) !== 0 && (W === null || !st.call(W, e)) && Jr();
997
- let r = n ? We(t) : t;
998
- return Lt(e, r);
1043
+ (!pe || (y.f & ar) !== 0) && qr() && (y.f & (F | He | zn | ar)) !== 0 && (ue === null || !Rt.call(ue, e)) && fs();
1044
+ let r = n ? bt(t) : t;
1045
+ return Dt(e, r);
999
1046
  }
1000
- function Lt(e, t) {
1047
+ function Dt(e, t) {
1001
1048
  if (!e.equals(t)) {
1002
1049
  var n = e.v;
1003
- Pe ? xe.set(e, t) : xe.set(e, n), e.v = t;
1004
- var r = ge.ensure();
1005
- if (r.capture(e, n), (e.f & C) !== 0) {
1050
+ Xe ? We.set(e, t) : We.set(e, n), e.v = t;
1051
+ var r = Pe.ensure();
1052
+ if (r.capture(e, n), (e.f & F) !== 0) {
1006
1053
  const i = (
1007
1054
  /** @type {Derived} */
1008
1055
  e
1009
1056
  );
1010
- (e.f & L) !== 0 && cn(i), fn(i);
1057
+ (e.f & B) !== 0 && Yn(i), Un(i);
1011
1058
  }
1012
- e.wv = br(), nr(e, L), w !== null && (w.f & O) !== 0 && (w.f & (le | Ae)) === 0 && (G === null ? Li([e]) : G.push(e)), !r.is_fork && Zt.size > 0 && !tr && gi();
1059
+ e.wv = vi(), Qr(e, B), T !== null && (T.f & H) !== 0 && (T.f & (we | Je)) === 0 && (ie === null ? Fs([e]) : ie.push(e)), !r.is_fork && In.size > 0 && !Xr && Rs();
1013
1060
  }
1014
1061
  return t;
1015
1062
  }
1016
- function gi() {
1017
- tr = !1;
1018
- for (const e of Zt)
1019
- (e.f & O) !== 0 && P(e, ye), Tt(e) && vt(e);
1020
- Zt.clear();
1063
+ function Rs() {
1064
+ Xr = !1;
1065
+ for (const e of In)
1066
+ (e.f & H) !== 0 && D(e, me), Xt(e) && Mt(e);
1067
+ In.clear();
1021
1068
  }
1022
- function ht(e) {
1023
- ce(e, e.v + 1);
1069
+ function Bt(e) {
1070
+ C(e, e.v + 1);
1024
1071
  }
1025
- function nr(e, t) {
1072
+ function Qr(e, t) {
1026
1073
  var n = e.reactions;
1027
1074
  if (n !== null)
1028
1075
  for (var r = n.length, i = 0; i < r; i++) {
1029
- var s = n[i], o = s.f, u = (o & L) === 0;
1030
- if (u && P(s, t), (o & C) !== 0) {
1031
- var a = (
1076
+ var s = n[i], o = s.f, l = (o & B) === 0;
1077
+ if (l && D(s, t), (o & F) !== 0) {
1078
+ var u = (
1032
1079
  /** @type {Derived} */
1033
1080
  s
1034
1081
  );
1035
- J?.delete(a), (o & je) === 0 && (o & H && (s.f |= je), nr(a, ye));
1036
- } else u && ((o & we) !== 0 && ae !== null && ae.add(
1082
+ ve?.delete(u), (o & ht) === 0 && (o & ae && (s.f |= ht), Qr(u, me));
1083
+ } else l && ((o & He) !== 0 && Le !== null && Le.add(
1037
1084
  /** @type {Effect} */
1038
1085
  s
1039
- ), be(
1086
+ ), ge(
1040
1087
  /** @type {Effect} */
1041
1088
  s
1042
1089
  ));
1043
1090
  }
1044
1091
  }
1045
- function We(e) {
1046
- if (typeof e != "object" || e === null || Gt in e)
1092
+ function bt(e) {
1093
+ if (typeof e != "object" || e === null || Cn in e)
1047
1094
  return e;
1048
- const t = Br(e);
1049
- if (t !== Dr && t !== Ir)
1095
+ const t = Cr(e);
1096
+ if (t !== Yi && t !== Ki)
1050
1097
  return e;
1051
- var n = /* @__PURE__ */ new Map(), r = Cr(e), i = /* @__PURE__ */ ue(0), s = Me, o = (u) => {
1052
- if (Me === s)
1053
- return u();
1054
- var a = b, f = Me;
1055
- K(null), Sn(s);
1056
- var h = u();
1057
- return K(a), Sn(f), h;
1098
+ var n = /* @__PURE__ */ new Map(), r = xr(e), i = /* @__PURE__ */ W(0), s = ct, o = (l) => {
1099
+ if (ct === s)
1100
+ return l();
1101
+ var u = y, f = ct;
1102
+ he(null), dr(s);
1103
+ var h = l();
1104
+ return he(u), dr(f), h;
1058
1105
  };
1059
- return r && n.set("length", /* @__PURE__ */ ue(
1106
+ return r && n.set("length", /* @__PURE__ */ W(
1060
1107
  /** @type {any[]} */
1061
1108
  e.length
1062
1109
  )), new Proxy(
1063
1110
  /** @type {any} */
1064
1111
  e,
1065
1112
  {
1066
- defineProperty(u, a, f) {
1067
- (!("value" in f) || f.configurable === !1 || f.enumerable === !1 || f.writable === !1) && Kr();
1068
- var h = n.get(a);
1069
- return h === void 0 ? h = o(() => {
1070
- var d = /* @__PURE__ */ ue(f.value);
1071
- return n.set(a, d), d;
1072
- }) : ce(h, f.value, !0), !0;
1113
+ defineProperty(l, u, f) {
1114
+ (!("value" in f) || f.configurable === !1 || f.enumerable === !1 || f.writable === !1) && as();
1115
+ var h = n.get(u);
1116
+ return h === void 0 ? o(() => {
1117
+ var v = /* @__PURE__ */ W(f.value);
1118
+ return n.set(u, v), v;
1119
+ }) : C(h, f.value, !0), !0;
1073
1120
  },
1074
- deleteProperty(u, a) {
1075
- var f = n.get(a);
1121
+ deleteProperty(l, u) {
1122
+ var f = n.get(u);
1076
1123
  if (f === void 0) {
1077
- if (a in u) {
1078
- const h = o(() => /* @__PURE__ */ ue(R));
1079
- n.set(a, h), ht(i);
1124
+ if (u in l) {
1125
+ const h = o(() => /* @__PURE__ */ W(V));
1126
+ n.set(u, h), Bt(i);
1080
1127
  }
1081
1128
  } else
1082
- ce(f, R), ht(i);
1129
+ C(f, V), Bt(i);
1083
1130
  return !0;
1084
1131
  },
1085
- get(u, a, f) {
1086
- if (a === Gt)
1132
+ get(l, u, f) {
1133
+ if (u === Cn)
1087
1134
  return e;
1088
- var h = n.get(a), d = a in u;
1089
- if (h === void 0 && (!d || ze(u, a)?.writable) && (h = o(() => {
1090
- var v = We(d ? u[a] : R), g = /* @__PURE__ */ ue(v);
1091
- return g;
1092
- }), n.set(a, h)), h !== void 0) {
1093
- var c = m(h);
1094
- return c === R ? void 0 : c;
1135
+ var h = n.get(u), v = u in l;
1136
+ if (h === void 0 && (!v || wt(l, u)?.writable) && (h = o(() => {
1137
+ var p = bt(v ? l[u] : V), d = /* @__PURE__ */ W(p);
1138
+ return d;
1139
+ }), n.set(u, h)), h !== void 0) {
1140
+ var c = g(h);
1141
+ return c === V ? void 0 : c;
1095
1142
  }
1096
- return Reflect.get(u, a, f);
1143
+ return Reflect.get(l, u, f);
1097
1144
  },
1098
- getOwnPropertyDescriptor(u, a) {
1099
- var f = Reflect.getOwnPropertyDescriptor(u, a);
1145
+ getOwnPropertyDescriptor(l, u) {
1146
+ var f = Reflect.getOwnPropertyDescriptor(l, u);
1100
1147
  if (f && "value" in f) {
1101
- var h = n.get(a);
1102
- h && (f.value = m(h));
1148
+ var h = n.get(u);
1149
+ h && (f.value = g(h));
1103
1150
  } else if (f === void 0) {
1104
- var d = n.get(a), c = d?.v;
1105
- if (d !== void 0 && c !== R)
1151
+ var v = n.get(u), c = v?.v;
1152
+ if (v !== void 0 && c !== V)
1106
1153
  return {
1107
1154
  enumerable: !0,
1108
1155
  configurable: !0,
@@ -1112,173 +1159,188 @@ function We(e) {
1112
1159
  }
1113
1160
  return f;
1114
1161
  },
1115
- has(u, a) {
1116
- if (a === Gt)
1162
+ has(l, u) {
1163
+ if (u === Cn)
1117
1164
  return !0;
1118
- var f = n.get(a), h = f !== void 0 && f.v !== R || Reflect.has(u, a);
1119
- if (f !== void 0 || w !== null && (!h || ze(u, a)?.writable)) {
1165
+ var f = n.get(u), h = f !== void 0 && f.v !== V || Reflect.has(l, u);
1166
+ if (f !== void 0 || T !== null && (!h || wt(l, u)?.writable)) {
1120
1167
  f === void 0 && (f = o(() => {
1121
- var c = h ? We(u[a]) : R, v = /* @__PURE__ */ ue(c);
1122
- return v;
1123
- }), n.set(a, f));
1124
- var d = m(f);
1125
- if (d === R)
1168
+ var c = h ? bt(l[u]) : V, p = /* @__PURE__ */ W(c);
1169
+ return p;
1170
+ }), n.set(u, f));
1171
+ var v = g(f);
1172
+ if (v === V)
1126
1173
  return !1;
1127
1174
  }
1128
1175
  return h;
1129
1176
  },
1130
- set(u, a, f, h) {
1131
- var d = n.get(a), c = a in u;
1132
- if (r && a === "length")
1133
- for (var v = f; v < /** @type {Source<number>} */
1134
- d.v; v += 1) {
1135
- var g = n.get(v + "");
1136
- g !== void 0 ? ce(g, R) : v in u && (g = o(() => /* @__PURE__ */ ue(R)), n.set(v + "", g));
1177
+ set(l, u, f, h) {
1178
+ var v = n.get(u), c = u in l;
1179
+ if (r && u === "length")
1180
+ for (var p = f; p < /** @type {Source<number>} */
1181
+ v.v; p += 1) {
1182
+ var d = n.get(p + "");
1183
+ d !== void 0 ? C(d, V) : p in l && (d = o(() => /* @__PURE__ */ W(V)), n.set(p + "", d));
1137
1184
  }
1138
- if (d === void 0)
1139
- (!c || ze(u, a)?.writable) && (d = o(() => /* @__PURE__ */ ue(void 0)), ce(d, We(f)), n.set(a, d));
1185
+ if (v === void 0)
1186
+ (!c || wt(l, u)?.writable) && (v = o(() => /* @__PURE__ */ W(void 0)), C(v, bt(f)), n.set(u, v));
1140
1187
  else {
1141
- c = d.v !== R;
1142
- var N = o(() => We(f));
1143
- ce(d, N);
1188
+ c = v.v !== V;
1189
+ var m = o(() => bt(f));
1190
+ C(v, m);
1144
1191
  }
1145
- var x = Reflect.getOwnPropertyDescriptor(u, a);
1146
- if (x?.set && x.set.call(h, f), !c) {
1147
- if (r && typeof a == "string") {
1148
- var St = (
1192
+ var $ = Reflect.getOwnPropertyDescriptor(l, u);
1193
+ if ($?.set && $.set.call(h, f), !c) {
1194
+ if (r && typeof u == "string") {
1195
+ var R = (
1149
1196
  /** @type {Source<number>} */
1150
1197
  n.get("length")
1151
- ), at = Number(a);
1152
- Number.isInteger(at) && at >= St.v && ce(St, at + 1);
1198
+ ), I = Number(u);
1199
+ Number.isInteger(I) && I >= R.v && C(R, I + 1);
1153
1200
  }
1154
- ht(i);
1201
+ Bt(i);
1155
1202
  }
1156
1203
  return !0;
1157
1204
  },
1158
- ownKeys(u) {
1159
- m(i);
1160
- var a = Reflect.ownKeys(u).filter((d) => {
1161
- var c = n.get(d);
1162
- return c === void 0 || c.v !== R;
1205
+ ownKeys(l) {
1206
+ g(i);
1207
+ var u = Reflect.ownKeys(l).filter((v) => {
1208
+ var c = n.get(v);
1209
+ return c === void 0 || c.v !== V;
1163
1210
  });
1164
1211
  for (var [f, h] of n)
1165
- h.v !== R && !(f in u) && a.push(f);
1166
- return a;
1212
+ h.v !== V && !(f in l) && u.push(f);
1213
+ return u;
1167
1214
  },
1168
1215
  setPrototypeOf() {
1169
- zr();
1216
+ us();
1170
1217
  }
1171
1218
  }
1172
1219
  );
1173
1220
  }
1174
- var En, rr, ir, sr;
1175
- function en() {
1176
- if (En === void 0) {
1177
- En = window, rr = /Firefox/.test(navigator.userAgent);
1221
+ var cr, Zr, ei, ti;
1222
+ function Pn() {
1223
+ if (cr === void 0) {
1224
+ cr = window, Zr = /Firefox/.test(navigator.userAgent);
1178
1225
  var e = Element.prototype, t = Node.prototype, n = Text.prototype;
1179
- ir = ze(t, "firstChild").get, sr = ze(t, "nextSibling").get, yn(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), yn(n) && (n.__t = void 0);
1226
+ ei = wt(t, "firstChild").get, ti = wt(t, "nextSibling").get, lr(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), lr(n) && (n.__t = void 0);
1180
1227
  }
1181
1228
  }
1182
- function ke(e = "") {
1229
+ function be(e = "") {
1183
1230
  return document.createTextNode(e);
1184
1231
  }
1185
1232
  // @__NO_SIDE_EFFECTS__
1186
- function _t(e) {
1233
+ function vt(e) {
1187
1234
  return (
1188
1235
  /** @type {TemplateNode | null} */
1189
- ir.call(e)
1236
+ ei.call(e)
1190
1237
  );
1191
1238
  }
1192
1239
  // @__NO_SIDE_EFFECTS__
1193
- function me(e) {
1240
+ function ce(e) {
1194
1241
  return (
1195
1242
  /** @type {TemplateNode | null} */
1196
- sr.call(e)
1243
+ ti.call(e)
1197
1244
  );
1198
1245
  }
1199
- function bi(e, t) {
1200
- if (!S)
1201
- return /* @__PURE__ */ _t(e);
1202
- var n = /* @__PURE__ */ _t($);
1203
- return n === null && (n = $.appendChild(ke())), ie(n), n;
1204
- }
1205
- function wi(e, t = !1) {
1206
- if (!S) {
1207
- var n = /* @__PURE__ */ _t(e);
1208
- return n instanceof Comment && n.data === "" ? /* @__PURE__ */ me(n) : n;
1246
+ function nn(e, t) {
1247
+ if (!A)
1248
+ return /* @__PURE__ */ vt(e);
1249
+ var n = /* @__PURE__ */ vt(x);
1250
+ if (n === null)
1251
+ n = x.appendChild(be());
1252
+ else if (t && n.nodeType !== bn) {
1253
+ var r = be();
1254
+ return n?.before(r), z(r), r;
1255
+ }
1256
+ return t && Wn(
1257
+ /** @type {Text} */
1258
+ n
1259
+ ), z(n), n;
1260
+ }
1261
+ function Sn(e, t = !1) {
1262
+ if (!A) {
1263
+ var n = /* @__PURE__ */ vt(e);
1264
+ return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ce(n) : n;
1209
1265
  }
1210
1266
  if (t) {
1211
- if ($?.nodeType !== un) {
1212
- var r = ke();
1213
- return $?.before(r), ie(r), r;
1267
+ if (x?.nodeType !== bn) {
1268
+ var r = be();
1269
+ return x?.before(r), z(r), r;
1214
1270
  }
1215
- or(
1271
+ Wn(
1216
1272
  /** @type {Text} */
1217
- $
1273
+ x
1218
1274
  );
1219
1275
  }
1220
- return $;
1276
+ return x;
1221
1277
  }
1222
- function Oe(e, t = 1, n = !1) {
1223
- let r = S ? $ : e;
1278
+ function Ee(e, t = 1, n = !1) {
1279
+ let r = A ? x : e;
1224
1280
  for (var i; t--; )
1225
1281
  i = r, r = /** @type {TemplateNode} */
1226
- /* @__PURE__ */ me(r);
1227
- if (!S)
1282
+ /* @__PURE__ */ ce(r);
1283
+ if (!A)
1228
1284
  return r;
1229
1285
  if (n) {
1230
- if (r?.nodeType !== un) {
1231
- var s = ke();
1232
- return r === null ? i?.after(s) : r.before(s), ie(s), s;
1286
+ if (r?.nodeType !== bn) {
1287
+ var s = be();
1288
+ return r === null ? i?.after(s) : r.before(s), z(s), s;
1233
1289
  }
1234
- or(
1290
+ Wn(
1235
1291
  /** @type {Text} */
1236
1292
  r
1237
1293
  );
1238
1294
  }
1239
- return ie(r), r;
1295
+ return z(r), r;
1240
1296
  }
1241
- function yi(e) {
1297
+ function ni(e) {
1242
1298
  e.textContent = "";
1243
1299
  }
1244
- function mi() {
1300
+ function ri() {
1245
1301
  return !1;
1246
1302
  }
1247
- function or(e) {
1303
+ function Kn(e, t, n) {
1304
+ return (
1305
+ /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */
1306
+ document.createElementNS(Ar, e, void 0)
1307
+ );
1308
+ }
1309
+ function Wn(e) {
1248
1310
  if (
1249
1311
  /** @type {string} */
1250
1312
  e.nodeValue.length < 65536
1251
1313
  )
1252
1314
  return;
1253
1315
  let t = e.nextSibling;
1254
- for (; t !== null && t.nodeType === un; )
1316
+ for (; t !== null && t.nodeType === bn; )
1255
1317
  t.remove(), e.nodeValue += /** @type {string} */
1256
1318
  t.nodeValue, t = e.nextSibling;
1257
1319
  }
1258
- function lr(e) {
1259
- var t = b, n = w;
1260
- K(null), se(null);
1320
+ function ii(e) {
1321
+ var t = y, n = T;
1322
+ he(null), Se(null);
1261
1323
  try {
1262
1324
  return e();
1263
1325
  } finally {
1264
- K(t), se(n);
1326
+ he(t), Se(n);
1265
1327
  }
1266
1328
  }
1267
- function $i(e) {
1268
- w === null && (b === null && Vr(), Ur()), Pe && Gr();
1329
+ function Ls(e) {
1330
+ T === null && (y === null && ss(), is()), Xe && rs();
1269
1331
  }
1270
- function Ei(e, t) {
1332
+ function Ns(e, t) {
1271
1333
  var n = t.last;
1272
1334
  n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
1273
1335
  }
1274
- function $e(e, t, n) {
1275
- var r = w;
1276
- r !== null && (r.f & re) !== 0 && (e |= re);
1336
+ function Re(e, t, n) {
1337
+ var r = T;
1338
+ r !== null && (r.f & ne) !== 0 && (e |= ne);
1277
1339
  var i = {
1278
- ctx: Y,
1340
+ ctx: fe,
1279
1341
  deps: null,
1280
1342
  nodes: null,
1281
- f: e | L | H,
1343
+ f: e | B | ae,
1282
1344
  first: null,
1283
1345
  fn: t,
1284
1346
  last: null,
@@ -1292,173 +1354,176 @@ function $e(e, t, n) {
1292
1354
  };
1293
1355
  if (n)
1294
1356
  try {
1295
- vt(i), i.f |= Mt;
1296
- } catch (u) {
1297
- throw B(i), u;
1357
+ Mt(i);
1358
+ } catch (l) {
1359
+ throw j(i), l;
1298
1360
  }
1299
- else t !== null && be(i);
1361
+ else t !== null && ge(i);
1300
1362
  var s = i;
1301
1363
  if (n && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child
1302
- (s.f & qe) === 0 && (s = s.first, (e & we) !== 0 && (e & ot) !== 0 && s !== null && (s.f |= ot)), s !== null && (s.parent = r, r !== null && Ei(s, r), b !== null && (b.f & C) !== 0 && (e & Ae) === 0)) {
1364
+ (s.f & _t) === 0 && (s = s.first, (e & He) !== 0 && (e & Lt) !== 0 && s !== null && (s.f |= Lt)), s !== null && (s.parent = r, r !== null && Ns(s, r), y !== null && (y.f & F) !== 0 && (e & Je) === 0)) {
1303
1365
  var o = (
1304
1366
  /** @type {Derived} */
1305
- b
1367
+ y
1306
1368
  );
1307
1369
  (o.effects ?? (o.effects = [])).push(s);
1308
1370
  }
1309
1371
  return i;
1310
1372
  }
1311
- function hn() {
1312
- return b !== null && !X;
1373
+ function Xn() {
1374
+ return y !== null && !pe;
1313
1375
  }
1314
- function Ti(e) {
1315
- const t = $e(Ft, null, !1);
1316
- return P(t, O), t.teardown = e, t;
1376
+ function Os(e) {
1377
+ const t = Re(mn, null, !1);
1378
+ return D(t, H), t.teardown = e, t;
1317
1379
  }
1318
- function Si(e) {
1319
- $i();
1380
+ function Ds(e) {
1381
+ Ls();
1320
1382
  var t = (
1321
1383
  /** @type {Effect} */
1322
- w.f
1323
- ), n = !b && (t & le) !== 0 && (t & Mt) === 0;
1384
+ T.f
1385
+ ), n = !y && (t & we) !== 0 && (t & qt) === 0;
1324
1386
  if (n) {
1325
1387
  var r = (
1326
1388
  /** @type {ComponentContext} */
1327
- Y
1389
+ fe
1328
1390
  );
1329
1391
  (r.e ?? (r.e = [])).push(e);
1330
1392
  } else
1331
- return ur(e);
1393
+ return si(e);
1332
1394
  }
1333
- function ur(e) {
1334
- return $e(Vt | Mr, e, !1);
1395
+ function si(e) {
1396
+ return Re(Gt | Ji, e, !1);
1335
1397
  }
1336
- function xi(e) {
1337
- ge.ensure();
1338
- const t = $e(Ae | qe, e, !0);
1398
+ function Ms(e) {
1399
+ Pe.ensure();
1400
+ const t = Re(Je | _t, e, !0);
1339
1401
  return () => {
1340
- B(t);
1402
+ j(t);
1341
1403
  };
1342
1404
  }
1343
- function ki(e) {
1344
- ge.ensure();
1345
- const t = $e(Ae | qe, e, !0);
1405
+ function qs(e) {
1406
+ Pe.ensure();
1407
+ const t = Re(Je | _t, e, !0);
1346
1408
  return (n = {}) => new Promise((r) => {
1347
- n.outro ? dt(t, () => {
1348
- B(t), r(void 0);
1349
- }) : (B(t), r(void 0));
1409
+ n.outro ? ft(t, () => {
1410
+ j(t), r(void 0);
1411
+ }) : (j(t), r(void 0));
1350
1412
  });
1351
1413
  }
1352
- function Pi(e) {
1353
- return $e(ln | qe, e, !0);
1414
+ function Is(e) {
1415
+ return Re(Gt, e, !1);
1354
1416
  }
1355
- function ar(e, t = 0) {
1356
- return $e(Ft | t, e, !0);
1417
+ function Ps(e) {
1418
+ return Re(zn | _t, e, !0);
1357
1419
  }
1358
- function Ai(e, t = [], n = [], r = []) {
1359
- hi(r, t, n, (i) => {
1360
- $e(Ft, () => e(...i.map(m)), !0);
1420
+ function oi(e, t = 0) {
1421
+ return Re(mn | t, e, !0);
1422
+ }
1423
+ function rn(e, t = [], n = [], r = []) {
1424
+ Es(r, t, n, (i) => {
1425
+ Re(mn, () => e(...i.map(g)), !0);
1361
1426
  });
1362
1427
  }
1363
- function fr(e, t = 0) {
1364
- var n = $e(we | t, e, !0);
1428
+ function Tn(e, t = 0) {
1429
+ var n = Re(He | t, e, !0);
1365
1430
  return n;
1366
1431
  }
1367
- function fe(e) {
1368
- return $e(le | qe, e, !0);
1432
+ function le(e) {
1433
+ return Re(we | _t, e, !0);
1369
1434
  }
1370
- function cr(e) {
1435
+ function li(e) {
1371
1436
  var t = e.teardown;
1372
1437
  if (t !== null) {
1373
- const n = Pe, r = b;
1374
- Tn(!0), K(null);
1438
+ const n = Xe, r = y;
1439
+ hr(!0), he(null);
1375
1440
  try {
1376
1441
  t.call(null);
1377
1442
  } finally {
1378
- Tn(n), K(r);
1443
+ hr(n), he(r);
1379
1444
  }
1380
1445
  }
1381
1446
  }
1382
- function hr(e, t = !1) {
1447
+ function Jn(e, t = !1) {
1383
1448
  var n = e.first;
1384
1449
  for (e.first = e.last = null; n !== null; ) {
1385
1450
  const i = n.ac;
1386
- i !== null && lr(() => {
1387
- i.abort(Ve);
1451
+ i !== null && ii(() => {
1452
+ i.abort(tt);
1388
1453
  });
1389
1454
  var r = n.next;
1390
- (n.f & Ae) !== 0 ? n.parent = null : B(n, t), n = r;
1455
+ (n.f & Je) !== 0 ? n.parent = null : j(n, t), n = r;
1391
1456
  }
1392
1457
  }
1393
- function Oi(e) {
1458
+ function Hs(e) {
1394
1459
  for (var t = e.first; t !== null; ) {
1395
1460
  var n = t.next;
1396
- (t.f & le) === 0 && B(t), t = n;
1461
+ (t.f & we) === 0 && j(t), t = n;
1397
1462
  }
1398
1463
  }
1399
- function B(e, t = !0) {
1464
+ function j(e, t = !0) {
1400
1465
  var n = !1;
1401
- (t || (e.f & Dn) !== 0) && e.nodes !== null && e.nodes.end !== null && (Ri(
1466
+ (t || (e.f & jn) !== 0) && e.nodes !== null && e.nodes.end !== null && (Vs(
1402
1467
  e.nodes.start,
1403
1468
  /** @type {TemplateNode} */
1404
1469
  e.nodes.end
1405
- ), n = !0), hr(e, t && !n), Dt(e, 0), P(e, pe);
1470
+ ), n = !0), Jn(e, t && !n), jt(e, 0), D(e, Ie);
1406
1471
  var r = e.nodes && e.nodes.t;
1407
1472
  if (r !== null)
1408
1473
  for (const s of r)
1409
1474
  s.stop();
1410
- cr(e);
1475
+ li(e);
1411
1476
  var i = e.parent;
1412
- i !== null && i.first !== null && dr(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1477
+ i !== null && i.first !== null && ai(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
1413
1478
  }
1414
- function Ri(e, t) {
1479
+ function Vs(e, t) {
1415
1480
  for (; e !== null; ) {
1416
- var n = e === t ? null : /* @__PURE__ */ me(e);
1481
+ var n = e === t ? null : /* @__PURE__ */ ce(e);
1417
1482
  e.remove(), e = n;
1418
1483
  }
1419
1484
  }
1420
- function dr(e) {
1485
+ function ai(e) {
1421
1486
  var t = e.parent, n = e.prev, r = e.next;
1422
1487
  n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
1423
1488
  }
1424
- function dt(e, t, n = !0) {
1489
+ function ft(e, t, n = !0) {
1425
1490
  var r = [];
1426
- _r(e, r, !0);
1491
+ ui(e, r, !0);
1427
1492
  var i = () => {
1428
- n && B(e), t && t();
1493
+ n && j(e), t && t();
1429
1494
  }, s = r.length;
1430
1495
  if (s > 0) {
1431
1496
  var o = () => --s || i();
1432
- for (var u of r)
1433
- u.out(o);
1497
+ for (var l of r)
1498
+ l.out(o);
1434
1499
  } else
1435
1500
  i();
1436
1501
  }
1437
- function _r(e, t, n) {
1438
- if ((e.f & re) === 0) {
1439
- e.f ^= re;
1502
+ function ui(e, t, n) {
1503
+ if ((e.f & ne) === 0) {
1504
+ e.f ^= ne;
1440
1505
  var r = e.nodes && e.nodes.t;
1441
1506
  if (r !== null)
1442
- for (const u of r)
1443
- (u.is_global || n) && t.push(u);
1507
+ for (const l of r)
1508
+ (l.is_global || n) && t.push(l);
1444
1509
  for (var i = e.first; i !== null; ) {
1445
- var s = i.next, o = (i.f & ot) !== 0 || // If this is a branch effect without a block effect parent,
1510
+ var s = i.next, o = (i.f & Lt) !== 0 || // If this is a branch effect without a block effect parent,
1446
1511
  // it means the parent block effect was pruned. In that case,
1447
1512
  // transparency information was transferred to the branch effect.
1448
- (i.f & le) !== 0 && (e.f & we) !== 0;
1449
- _r(i, t, o ? n : !1), i = s;
1513
+ (i.f & we) !== 0 && (e.f & He) !== 0;
1514
+ ui(i, t, o ? n : !1), i = s;
1450
1515
  }
1451
1516
  }
1452
1517
  }
1453
- function Ci(e) {
1454
- vr(e, !0);
1518
+ function Qn(e) {
1519
+ fi(e, !0);
1455
1520
  }
1456
- function vr(e, t) {
1457
- if ((e.f & re) !== 0) {
1458
- e.f ^= re, (e.f & O) === 0 && (P(e, L), be(e));
1521
+ function fi(e, t) {
1522
+ if ((e.f & ne) !== 0) {
1523
+ e.f ^= ne, (e.f & H) === 0 && (D(e, B), ge(e));
1459
1524
  for (var n = e.first; n !== null; ) {
1460
- var r = n.next, i = (n.f & ot) !== 0 || (n.f & le) !== 0;
1461
- vr(n, i ? t : !1), n = r;
1525
+ var r = n.next, i = (n.f & Lt) !== 0 || (n.f & we) !== 0;
1526
+ fi(n, i ? t : !1), n = r;
1462
1527
  }
1463
1528
  var s = e.nodes && e.nodes.t;
1464
1529
  if (s !== null)
@@ -1466,246 +1531,249 @@ function vr(e, t) {
1466
1531
  (o.is_global || t) && o.in();
1467
1532
  }
1468
1533
  }
1469
- function pr(e, t) {
1534
+ function ci(e, t) {
1470
1535
  if (e.nodes)
1471
1536
  for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) {
1472
- var i = n === r ? null : /* @__PURE__ */ me(n);
1537
+ var i = n === r ? null : /* @__PURE__ */ ce(n);
1473
1538
  t.append(n), n = i;
1474
1539
  }
1475
1540
  }
1476
- let Ot = !1, Pe = !1;
1477
- function Tn(e) {
1478
- Pe = e;
1541
+ let an = !1, Xe = !1;
1542
+ function hr(e) {
1543
+ Xe = e;
1479
1544
  }
1480
- let b = null, X = !1;
1481
- function K(e) {
1482
- b = e;
1545
+ let y = null, pe = !1;
1546
+ function he(e) {
1547
+ y = e;
1483
1548
  }
1484
- let w = null;
1485
- function se(e) {
1486
- w = e;
1549
+ let T = null;
1550
+ function Se(e) {
1551
+ T = e;
1487
1552
  }
1488
- let W = null;
1489
- function Ni(e) {
1490
- b !== null && (W === null ? W = [e] : W.push(e));
1553
+ let ue = null;
1554
+ function hi(e) {
1555
+ y !== null && (ue === null ? ue = [e] : ue.push(e));
1491
1556
  }
1492
- let I = null, F = 0, G = null;
1493
- function Li(e) {
1494
- G = e;
1557
+ let X = null, Z = 0, ie = null;
1558
+ function Fs(e) {
1559
+ ie = e;
1495
1560
  }
1496
- let gr = 1, Ce = 0, Me = Ce;
1497
- function Sn(e) {
1498
- Me = e;
1561
+ let di = 1, rt = 0, ct = rt;
1562
+ function dr(e) {
1563
+ ct = e;
1499
1564
  }
1500
- function br() {
1501
- return ++gr;
1565
+ function vi() {
1566
+ return ++di;
1502
1567
  }
1503
- function Tt(e) {
1568
+ function Xt(e) {
1504
1569
  var t = e.f;
1505
- if ((t & L) !== 0)
1570
+ if ((t & B) !== 0)
1506
1571
  return !0;
1507
- if (t & C && (e.f &= ~je), (t & ye) !== 0) {
1572
+ if (t & F && (e.f &= ~ht), (t & me) !== 0) {
1508
1573
  for (var n = (
1509
1574
  /** @type {Value[]} */
1510
1575
  e.deps
1511
1576
  ), r = n.length, i = 0; i < r; i++) {
1512
1577
  var s = n[i];
1513
- if (Tt(
1578
+ if (Xt(
1514
1579
  /** @type {Derived} */
1515
1580
  s
1516
- ) && er(
1581
+ ) && Kr(
1517
1582
  /** @type {Derived} */
1518
1583
  s
1519
1584
  ), s.wv > e.wv)
1520
1585
  return !0;
1521
1586
  }
1522
- (t & H) !== 0 && // During time traveling we don't want to reset the status so that
1587
+ (t & ae) !== 0 && // During time traveling we don't want to reset the status so that
1523
1588
  // traversal of the graph in the other batches still happens
1524
- J === null && P(e, O);
1589
+ ve === null && D(e, H);
1525
1590
  }
1526
1591
  return !1;
1527
1592
  }
1528
- function wr(e, t, n = !0) {
1593
+ function _i(e, t, n = !0) {
1529
1594
  var r = e.reactions;
1530
- if (r !== null && !(W !== null && st.call(W, e)))
1595
+ if (r !== null && !(ue !== null && Rt.call(ue, e)))
1531
1596
  for (var i = 0; i < r.length; i++) {
1532
1597
  var s = r[i];
1533
- (s.f & C) !== 0 ? wr(
1598
+ (s.f & F) !== 0 ? _i(
1534
1599
  /** @type {Derived} */
1535
1600
  s,
1536
1601
  t,
1537
1602
  !1
1538
- ) : t === s && (n ? P(s, L) : (s.f & O) !== 0 && P(s, ye), be(
1603
+ ) : t === s && (n ? D(s, B) : (s.f & H) !== 0 && D(s, me), ge(
1539
1604
  /** @type {Effect} */
1540
1605
  s
1541
1606
  ));
1542
1607
  }
1543
1608
  }
1544
- function yr(e) {
1545
- var N;
1546
- var t = I, n = F, r = G, i = b, s = W, o = Y, u = X, a = Me, f = e.f;
1547
- I = /** @type {null | Value[]} */
1548
- null, F = 0, G = null, b = (f & (le | Ae)) === 0 ? e : null, W = null, lt(e.ctx), X = !1, Me = ++Ce, e.ac !== null && (lr(() => {
1549
- e.ac.abort(Ve);
1609
+ function gi(e) {
1610
+ var m;
1611
+ var t = X, n = Z, r = ie, i = y, s = ue, o = fe, l = pe, u = ct, f = e.f;
1612
+ X = /** @type {null | Value[]} */
1613
+ null, Z = 0, ie = null, y = (f & (we | Je)) === 0 ? e : null, ue = null, Nt(e.ctx), pe = !1, ct = ++rt, e.ac !== null && (ii(() => {
1614
+ e.ac.abort(tt);
1550
1615
  }), e.ac = null);
1551
1616
  try {
1552
- e.f |= Ht;
1617
+ e.f |= Rn;
1553
1618
  var h = (
1554
1619
  /** @type {Function} */
1555
1620
  e.fn
1556
- ), d = h(), c = e.deps, v = T?.is_fork;
1557
- if (I !== null) {
1558
- var g;
1559
- if (v || Dt(e, F), c !== null && F > 0)
1560
- for (c.length = F + I.length, g = 0; g < I.length; g++)
1561
- c[F + g] = I[g];
1621
+ ), v = h();
1622
+ e.f |= qt;
1623
+ var c = e.deps, p = S?.is_fork;
1624
+ if (X !== null) {
1625
+ var d;
1626
+ if (p || jt(e, Z), c !== null && Z > 0)
1627
+ for (c.length = Z + X.length, d = 0; d < X.length; d++)
1628
+ c[Z + d] = X[d];
1562
1629
  else
1563
- e.deps = c = I;
1564
- if (hn() && (e.f & H) !== 0)
1565
- for (g = F; g < c.length; g++)
1566
- ((N = c[g]).reactions ?? (N.reactions = [])).push(e);
1567
- } else !v && c !== null && F < c.length && (Dt(e, F), c.length = F);
1568
- if (jn() && G !== null && !X && c !== null && (e.f & (C | ye | L)) === 0)
1569
- for (g = 0; g < /** @type {Source[]} */
1570
- G.length; g++)
1571
- wr(
1572
- G[g],
1630
+ e.deps = c = X;
1631
+ if (Xn() && (e.f & ae) !== 0)
1632
+ for (d = Z; d < c.length; d++)
1633
+ ((m = c[d]).reactions ?? (m.reactions = [])).push(e);
1634
+ } else !p && c !== null && Z < c.length && (jt(e, Z), c.length = Z);
1635
+ if (qr() && ie !== null && !pe && c !== null && (e.f & (F | me | B)) === 0)
1636
+ for (d = 0; d < /** @type {Source[]} */
1637
+ ie.length; d++)
1638
+ _i(
1639
+ ie[d],
1573
1640
  /** @type {Effect} */
1574
1641
  e
1575
1642
  );
1576
1643
  if (i !== null && i !== e) {
1577
- if (Ce++, i.deps !== null)
1578
- for (let x = 0; x < n; x += 1)
1579
- i.deps[x].rv = Ce;
1644
+ if (rt++, i.deps !== null)
1645
+ for (let $ = 0; $ < n; $ += 1)
1646
+ i.deps[$].rv = rt;
1580
1647
  if (t !== null)
1581
- for (const x of t)
1582
- x.rv = Ce;
1583
- G !== null && (r === null ? r = G : r.push(.../** @type {Source[]} */
1584
- G));
1648
+ for (const $ of t)
1649
+ $.rv = rt;
1650
+ ie !== null && (r === null ? r = ie : r.push(.../** @type {Source[]} */
1651
+ ie));
1585
1652
  }
1586
- return (e.f & Se) !== 0 && (e.f ^= Se), d;
1587
- } catch (x) {
1588
- return Yn(x);
1653
+ return (e.f & Ke) !== 0 && (e.f ^= Ke), v;
1654
+ } catch ($) {
1655
+ return Pr($);
1589
1656
  } finally {
1590
- e.f ^= Ht, I = t, F = n, G = r, b = i, W = s, lt(o), X = u, Me = a;
1657
+ e.f ^= Rn, X = t, Z = n, ie = r, y = i, ue = s, Nt(o), pe = l, ct = u;
1591
1658
  }
1592
1659
  }
1593
- function Di(e, t) {
1660
+ function Bs(e, t) {
1594
1661
  let n = t.reactions;
1595
1662
  if (n !== null) {
1596
- var r = Nr.call(n, e);
1663
+ var r = zi.call(n, e);
1597
1664
  if (r !== -1) {
1598
1665
  var i = n.length - 1;
1599
1666
  i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop());
1600
1667
  }
1601
1668
  }
1602
- if (n === null && (t.f & C) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1669
+ if (n === null && (t.f & F) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
1603
1670
  // to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
1604
1671
  // allows us to skip the expensive work of disconnecting and immediately reconnecting it
1605
- (I === null || !st.call(I, t))) {
1672
+ (X === null || !Rt.call(X, t))) {
1606
1673
  var s = (
1607
1674
  /** @type {Derived} */
1608
1675
  t
1609
1676
  );
1610
- (s.f & H) !== 0 && (s.f ^= H, s.f &= ~je), fn(s), Zn(s), Dt(s, 0);
1677
+ (s.f & ae) !== 0 && (s.f ^= ae, s.f &= ~ht), Un(s), ks(s), jt(s, 0);
1611
1678
  }
1612
1679
  }
1613
- function Dt(e, t) {
1680
+ function jt(e, t) {
1614
1681
  var n = e.deps;
1615
1682
  if (n !== null)
1616
1683
  for (var r = t; r < n.length; r++)
1617
- Di(e, n[r]);
1684
+ Bs(e, n[r]);
1618
1685
  }
1619
- function vt(e) {
1686
+ function Mt(e) {
1620
1687
  var t = e.f;
1621
- if ((t & pe) === 0) {
1622
- P(e, O);
1623
- var n = w, r = Ot;
1624
- w = e, Ot = !0;
1688
+ if ((t & Ie) === 0) {
1689
+ D(e, H);
1690
+ var n = T, r = an;
1691
+ T = e, an = !0;
1625
1692
  try {
1626
- (t & (we | Ln)) !== 0 ? Oi(e) : hr(e), cr(e);
1627
- var i = yr(e);
1628
- e.teardown = typeof i == "function" ? i : null, e.wv = gr;
1693
+ (t & (He | kr)) !== 0 ? Hs(e) : Jn(e), li(e);
1694
+ var i = gi(e);
1695
+ e.teardown = typeof i == "function" ? i : null, e.wv = di;
1629
1696
  var s;
1630
- Ut && ii && (e.f & L) !== 0 && e.deps;
1697
+ kn && _s && (e.f & B) !== 0 && e.deps;
1631
1698
  } finally {
1632
- Ot = r, w = n;
1699
+ an = r, T = n;
1633
1700
  }
1634
1701
  }
1635
1702
  }
1636
- function m(e) {
1637
- var t = e.f, n = (t & C) !== 0;
1638
- if (b !== null && !X) {
1639
- var r = w !== null && (w.f & pe) !== 0;
1640
- if (!r && (W === null || !st.call(W, e))) {
1641
- var i = b.deps;
1642
- if ((b.f & Ht) !== 0)
1643
- e.rv < Ce && (e.rv = Ce, I === null && i !== null && i[F] === e ? F++ : I === null ? I = [e] : I.push(e));
1703
+ function g(e) {
1704
+ var t = e.f, n = (t & F) !== 0;
1705
+ if (y !== null && !pe) {
1706
+ var r = T !== null && (T.f & Ie) !== 0;
1707
+ if (!r && (ue === null || !Rt.call(ue, e))) {
1708
+ var i = y.deps;
1709
+ if ((y.f & Rn) !== 0)
1710
+ e.rv < rt && (e.rv = rt, X === null && i !== null && i[Z] === e ? Z++ : X === null ? X = [e] : X.push(e));
1644
1711
  else {
1645
- (b.deps ?? (b.deps = [])).push(e);
1712
+ (y.deps ?? (y.deps = [])).push(e);
1646
1713
  var s = e.reactions;
1647
- s === null ? e.reactions = [b] : st.call(s, b) || s.push(b);
1714
+ s === null ? e.reactions = [y] : Rt.call(s, y) || s.push(y);
1648
1715
  }
1649
1716
  }
1650
1717
  }
1651
- if (Pe && xe.has(e))
1652
- return xe.get(e);
1718
+ if (Xe && We.has(e))
1719
+ return We.get(e);
1653
1720
  if (n) {
1654
1721
  var o = (
1655
1722
  /** @type {Derived} */
1656
1723
  e
1657
1724
  );
1658
- if (Pe) {
1659
- var u = o.v;
1660
- return ((o.f & O) === 0 && o.reactions !== null || $r(o)) && (u = cn(o)), xe.set(o, u), u;
1725
+ if (Xe) {
1726
+ var l = o.v;
1727
+ return ((o.f & H) === 0 && o.reactions !== null || mi(o)) && (l = Yn(o)), We.set(o, l), l;
1661
1728
  }
1662
- var a = (o.f & H) === 0 && !X && b !== null && (Ot || (b.f & H) !== 0), f = o.deps === null;
1663
- Tt(o) && (a && (o.f |= H), er(o)), a && !f && mr(o);
1729
+ var u = (o.f & ae) === 0 && !pe && y !== null && (an || (y.f & ae) !== 0), f = (o.f & qt) === 0;
1730
+ Xt(o) && (u && (o.f |= ae), Kr(o)), u && !f && (Wr(o), pi(o));
1664
1731
  }
1665
- if (J?.has(e))
1666
- return J.get(e);
1667
- if ((e.f & Se) !== 0)
1732
+ if (ve?.has(e))
1733
+ return ve.get(e);
1734
+ if ((e.f & Ke) !== 0)
1668
1735
  throw e.v;
1669
1736
  return e.v;
1670
1737
  }
1671
- function mr(e) {
1672
- if (e.deps !== null) {
1673
- e.f |= H;
1738
+ function pi(e) {
1739
+ if (e.f |= ae, e.deps !== null)
1674
1740
  for (const t of e.deps)
1675
- (t.reactions ?? (t.reactions = [])).push(e), (t.f & C) !== 0 && (t.f & H) === 0 && mr(
1741
+ (t.reactions ?? (t.reactions = [])).push(e), (t.f & F) !== 0 && (t.f & ae) === 0 && (Wr(
1676
1742
  /** @type {Derived} */
1677
1743
  t
1678
- );
1679
- }
1744
+ ), pi(
1745
+ /** @type {Derived} */
1746
+ t
1747
+ ));
1680
1748
  }
1681
- function $r(e) {
1682
- if (e.v === R) return !0;
1749
+ function mi(e) {
1750
+ if (e.v === V) return !0;
1683
1751
  if (e.deps === null) return !1;
1684
1752
  for (const t of e.deps)
1685
- if (xe.has(t) || (t.f & C) !== 0 && $r(
1753
+ if (We.has(t) || (t.f & F) !== 0 && mi(
1686
1754
  /** @type {Derived} */
1687
1755
  t
1688
1756
  ))
1689
1757
  return !0;
1690
1758
  return !1;
1691
1759
  }
1692
- function Er(e) {
1693
- var t = X;
1760
+ function Gs(e) {
1761
+ var t = pe;
1694
1762
  try {
1695
- return X = !0, e();
1763
+ return pe = !0, e();
1696
1764
  } finally {
1697
- X = t;
1765
+ pe = t;
1698
1766
  }
1699
1767
  }
1700
- const Tr = /* @__PURE__ */ new Set(), tn = /* @__PURE__ */ new Set();
1701
- function Ii(e) {
1768
+ const bi = /* @__PURE__ */ new Set(), Hn = /* @__PURE__ */ new Set();
1769
+ function js(e) {
1702
1770
  for (var t = 0; t < e.length; t++)
1703
- Tr.add(e[t]);
1704
- for (var n of tn)
1771
+ bi.add(e[t]);
1772
+ for (var n of Hn)
1705
1773
  n(e);
1706
1774
  }
1707
- let xn = null;
1708
- function kt(e) {
1775
+ let vr = null;
1776
+ function _r(e) {
1709
1777
  var t = this, n = (
1710
1778
  /** @type {Node} */
1711
1779
  t.ownerDocument
@@ -1713,11 +1781,11 @@ function kt(e) {
1713
1781
  /** @type {null | Element} */
1714
1782
  i[0] || e.target
1715
1783
  );
1716
- xn = e;
1717
- var o = 0, u = xn === e && e.__root;
1718
- if (u) {
1719
- var a = i.indexOf(u);
1720
- if (a !== -1 && (t === document || t === /** @type {any} */
1784
+ vr = e;
1785
+ var o = 0, l = vr === e && e.__root;
1786
+ if (l) {
1787
+ var u = i.indexOf(l);
1788
+ if (u !== -1 && (t === document || t === /** @type {any} */
1721
1789
  window)) {
1722
1790
  e.__root = t;
1723
1791
  return;
@@ -1725,86 +1793,104 @@ function kt(e) {
1725
1793
  var f = i.indexOf(t);
1726
1794
  if (f === -1)
1727
1795
  return;
1728
- a <= f && (o = a);
1796
+ u <= f && (o = u);
1729
1797
  }
1730
1798
  if (s = /** @type {Element} */
1731
1799
  i[o] || e.target, s !== t) {
1732
- Nt(e, "currentTarget", {
1800
+ hn(e, "currentTarget", {
1733
1801
  configurable: !0,
1734
1802
  get() {
1735
1803
  return s || n;
1736
1804
  }
1737
1805
  });
1738
- var h = b, d = w;
1739
- K(null), se(null);
1806
+ var h = y, v = T;
1807
+ he(null), Se(null);
1740
1808
  try {
1741
- for (var c, v = []; s !== null; ) {
1742
- var g = s.assignedSlot || s.parentNode || /** @type {any} */
1809
+ for (var c, p = []; s !== null; ) {
1810
+ var d = s.assignedSlot || s.parentNode || /** @type {any} */
1743
1811
  s.host || null;
1744
1812
  try {
1745
- var N = s["__" + r];
1746
- N != null && (!/** @type {any} */
1813
+ var m = s["__" + r];
1814
+ m != null && (!/** @type {any} */
1747
1815
  s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
1748
1816
  // -> the target could not have been disabled because it emits the event in the first place
1749
- e.target === s) && N.call(s, e);
1750
- } catch (x) {
1751
- c ? v.push(x) : c = x;
1817
+ e.target === s) && m.call(s, e);
1818
+ } catch ($) {
1819
+ c ? p.push($) : c = $;
1752
1820
  }
1753
- if (e.cancelBubble || g === t || g === null)
1821
+ if (e.cancelBubble || d === t || d === null)
1754
1822
  break;
1755
- s = g;
1823
+ s = d;
1756
1824
  }
1757
1825
  if (c) {
1758
- for (let x of v)
1826
+ for (let $ of p)
1759
1827
  queueMicrotask(() => {
1760
- throw x;
1828
+ throw $;
1761
1829
  });
1762
1830
  throw c;
1763
1831
  }
1764
1832
  } finally {
1765
- e.__root = t, delete e.currentTarget, K(h), se(d);
1833
+ e.__root = t, delete e.currentTarget, he(h), Se(v);
1766
1834
  }
1767
1835
  }
1768
1836
  }
1769
- function Bi(e) {
1770
- var t = document.createElement("template");
1771
- return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
1837
+ const zs = /* @__PURE__ */ globalThis?.window?.trustedTypes?.createPolicy(
1838
+ "svelte-trusted-html",
1839
+ {
1840
+ /** @param {string} html */
1841
+ createHTML: (e) => e
1842
+ }
1843
+ );
1844
+ function Us(e) {
1845
+ return (
1846
+ /** @type {string} */
1847
+ zs?.createHTML(e) ?? e
1848
+ );
1849
+ }
1850
+ function Ys(e, t = !1) {
1851
+ var n = Kn("template");
1852
+ return e = e.replaceAll("<!>", "<!---->"), n.innerHTML = t ? Us(e) : e, n.content;
1772
1853
  }
1773
- function pt(e, t) {
1854
+ function un(e, t) {
1774
1855
  var n = (
1775
1856
  /** @type {Effect} */
1776
- w
1857
+ T
1777
1858
  );
1778
1859
  n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null });
1779
1860
  }
1780
1861
  // @__NO_SIDE_EFFECTS__
1781
- function Fi(e, t) {
1782
- var n = (t & Rr) !== 0, r, i = !e.startsWith("<!>");
1862
+ function ye(e, t) {
1863
+ var n = (t & Gi) !== 0, r = (t & ji) !== 0, i, s = !e.startsWith("<!>");
1783
1864
  return () => {
1784
- if (S)
1785
- return pt($, null), $;
1786
- r === void 0 && (r = Bi(i ? e : "<!>" + e), r = /** @type {TemplateNode} */
1787
- /* @__PURE__ */ _t(r));
1788
- var s = (
1865
+ if (A)
1866
+ return un(x, null), x;
1867
+ i === void 0 && (i = Ys(s ? e : "<!>" + e, !0), n || (i = /** @type {TemplateNode} */
1868
+ /* @__PURE__ */ vt(i)));
1869
+ var o = (
1789
1870
  /** @type {TemplateNode} */
1790
- n || rr ? document.importNode(r, !0) : r.cloneNode(!0)
1871
+ r || Zr ? document.importNode(i, !0) : i.cloneNode(!0)
1791
1872
  );
1792
- return pt(s, s), s;
1873
+ if (n) {
1874
+ var l = (
1875
+ /** @type {TemplateNode} */
1876
+ /* @__PURE__ */ vt(o)
1877
+ ), u = (
1878
+ /** @type {TemplateNode} */
1879
+ o.lastChild
1880
+ );
1881
+ un(l, u);
1882
+ } else
1883
+ un(o, o);
1884
+ return o;
1793
1885
  };
1794
1886
  }
1795
- function Mi() {
1796
- if (S)
1797
- return pt($, null), $;
1798
- var e = document.createDocumentFragment(), t = document.createComment(""), n = ke();
1799
- return e.append(t, n), pt(t, n), e;
1800
- }
1801
- function nn(e, t) {
1802
- if (S) {
1887
+ function re(e, t) {
1888
+ if (A) {
1803
1889
  var n = (
1804
1890
  /** @type {Effect & { nodes: EffectNodes }} */
1805
- w
1891
+ T
1806
1892
  );
1807
- ((n.f & Mt) === 0 || n.nodes.end === null) && (n.nodes.end = $), an();
1893
+ ((n.f & qt) === 0 || n.nodes.end === null) && (n.nodes.end = x), yn();
1808
1894
  return;
1809
1895
  }
1810
1896
  e !== null && e.before(
@@ -1812,111 +1898,118 @@ function nn(e, t) {
1812
1898
  t
1813
1899
  );
1814
1900
  }
1815
- const ji = ["touchstart", "touchmove"];
1816
- function qi(e) {
1817
- return ji.includes(e);
1901
+ const Ks = ["touchstart", "touchmove"];
1902
+ function Ws(e) {
1903
+ return Ks.includes(e);
1818
1904
  }
1819
- function Sr(e, t) {
1820
- return xr(e, t);
1905
+ function gr(e, t) {
1906
+ var n = t == null ? "" : typeof t == "object" ? t + "" : t;
1907
+ n !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = n, e.nodeValue = n + "");
1821
1908
  }
1822
- function Yi(e, t) {
1823
- en(), t.intro = t.intro ?? !1;
1824
- const n = t.target, r = S, i = $;
1909
+ function wi(e, t) {
1910
+ return yi(e, t);
1911
+ }
1912
+ function Xs(e, t) {
1913
+ Pn(), t.intro = t.intro ?? !1;
1914
+ const n = t.target, r = A, i = x;
1825
1915
  try {
1826
- for (var s = /* @__PURE__ */ _t(n); s && (s.nodeType !== $t || /** @type {Comment} */
1827
- s.data !== Rn); )
1828
- s = /* @__PURE__ */ me(s);
1916
+ for (var s = /* @__PURE__ */ vt(n); s && (s.nodeType !== gt || /** @type {Comment} */
1917
+ s.data !== Bn); )
1918
+ s = /* @__PURE__ */ ce(s);
1829
1919
  if (!s)
1830
- throw it;
1831
- He(!0), ie(
1920
+ throw kt;
1921
+ _e(!0), z(
1832
1922
  /** @type {Comment} */
1833
1923
  s
1834
1924
  );
1835
- const o = xr(e, { ...t, anchor: s });
1836
- return He(!1), /** @type {Exports} */
1925
+ const o = yi(e, { ...t, anchor: s });
1926
+ return _e(!1), /** @type {Exports} */
1837
1927
  o;
1838
1928
  } catch (o) {
1839
1929
  if (o instanceof Error && o.message.split(`
1840
- `).some((u) => u.startsWith("https://svelte.dev/e/")))
1930
+ `).some((l) => l.startsWith("https://svelte.dev/e/")))
1841
1931
  throw o;
1842
- return o !== it && console.warn("Failed to hydrate: ", o), t.recover === !1 && Wr(), en(), yi(n), He(!1), Sr(e, t);
1932
+ return o !== kt && console.warn("Failed to hydrate: ", o), t.recover === !1 && ls(), Pn(), ni(n), _e(!1), wi(e, t);
1843
1933
  } finally {
1844
- He(r), ie(i);
1845
- }
1846
- }
1847
- const Ge = /* @__PURE__ */ new Map();
1848
- function xr(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: o = !0 }) {
1849
- en();
1850
- var u = /* @__PURE__ */ new Set(), a = (d) => {
1851
- for (var c = 0; c < d.length; c++) {
1852
- var v = d[c];
1853
- if (!u.has(v)) {
1854
- u.add(v);
1855
- var g = qi(v);
1856
- t.addEventListener(v, kt, { passive: g });
1857
- var N = Ge.get(v);
1858
- N === void 0 ? (document.addEventListener(v, kt, { passive: g }), Ge.set(v, 1)) : Ge.set(v, N + 1);
1934
+ _e(r), z(i);
1935
+ }
1936
+ }
1937
+ const sn = /* @__PURE__ */ new Map();
1938
+ function yi(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: o = !0 }) {
1939
+ Pn();
1940
+ var l = /* @__PURE__ */ new Set(), u = (v) => {
1941
+ for (var c = 0; c < v.length; c++) {
1942
+ var p = v[c];
1943
+ if (!l.has(p)) {
1944
+ l.add(p);
1945
+ var d = Ws(p);
1946
+ for (const R of [t, document]) {
1947
+ var m = sn.get(R);
1948
+ m === void 0 && (m = /* @__PURE__ */ new Map(), sn.set(R, m));
1949
+ var $ = m.get(p);
1950
+ $ === void 0 ? (R.addEventListener(p, _r, { passive: d }), m.set(p, 1)) : m.set(p, $ + 1);
1951
+ }
1859
1952
  }
1860
1953
  }
1861
1954
  };
1862
- a(Lr(Tr)), tn.add(a);
1863
- var f = void 0, h = ki(() => {
1864
- var d = n ?? t.appendChild(ke());
1865
- return fi(
1955
+ u(pn(bi)), Hn.add(u);
1956
+ var f = void 0, h = qs(() => {
1957
+ var v = n ?? t.appendChild(be());
1958
+ return ys(
1866
1959
  /** @type {TemplateNode} */
1867
- d,
1960
+ v,
1868
1961
  {
1869
1962
  pending: () => {
1870
1963
  }
1871
1964
  },
1872
1965
  (c) => {
1873
- if (s) {
1874
- Fn({});
1875
- var v = (
1876
- /** @type {ComponentContext} */
1877
- Y
1878
- );
1879
- v.c = s;
1880
- }
1881
- if (i && (r.$$events = i), S && pt(
1966
+ Dr({});
1967
+ var p = (
1968
+ /** @type {ComponentContext} */
1969
+ fe
1970
+ );
1971
+ if (s && (p.c = s), i && (r.$$events = i), A && un(
1882
1972
  /** @type {TemplateNode} */
1883
1973
  c,
1884
1974
  null
1885
- ), f = e(c, r) || {}, S && (w.nodes.end = $, $ === null || $.nodeType !== $t || /** @type {Comment} */
1886
- $.data !== Cn))
1887
- throw jt(), it;
1888
- s && Mn();
1975
+ ), f = e(c, r) || {}, A && (T.nodes.end = x, x === null || x.nodeType !== gt || /** @type {Comment} */
1976
+ x.data !== Gn))
1977
+ throw wn(), kt;
1978
+ Mr();
1889
1979
  }
1890
1980
  ), () => {
1891
- for (var c of u) {
1892
- t.removeEventListener(c, kt);
1893
- var v = (
1894
- /** @type {number} */
1895
- Ge.get(c)
1896
- );
1897
- --v === 0 ? (document.removeEventListener(c, kt), Ge.delete(c)) : Ge.set(c, v);
1898
- }
1899
- tn.delete(a), d !== n && d.parentNode?.removeChild(d);
1981
+ for (var c of l)
1982
+ for (const m of [t, document]) {
1983
+ var p = (
1984
+ /** @type {Map<string, number>} */
1985
+ sn.get(m)
1986
+ ), d = (
1987
+ /** @type {number} */
1988
+ p.get(c)
1989
+ );
1990
+ --d == 0 ? (m.removeEventListener(c, _r), p.delete(c), p.size === 0 && sn.delete(m)) : p.set(c, d);
1991
+ }
1992
+ Hn.delete(u), v !== n && v.parentNode?.removeChild(v);
1900
1993
  };
1901
1994
  });
1902
- return rn.set(f, h), f;
1995
+ return Vn.set(f, h), f;
1903
1996
  }
1904
- let rn = /* @__PURE__ */ new WeakMap();
1905
- function Gi(e, t) {
1906
- const n = rn.get(e);
1907
- return n ? (rn.delete(e), n(t)) : Promise.resolve();
1997
+ let Vn = /* @__PURE__ */ new WeakMap();
1998
+ function Js(e, t) {
1999
+ const n = Vn.get(e);
2000
+ return n ? (Vn.delete(e), n(t)) : Promise.resolve();
1908
2001
  }
1909
- var z, ne, j, Fe, yt, mt, Bt;
1910
- class Ui {
2002
+ var de, Ce, te, ut, Kt, Wt, _n;
2003
+ class Qs {
1911
2004
  /**
1912
2005
  * @param {TemplateNode} anchor
1913
2006
  * @param {boolean} transition
1914
2007
  */
1915
2008
  constructor(t, n = !0) {
1916
2009
  /** @type {TemplateNode} */
1917
- y(this, "anchor");
2010
+ O(this, "anchor");
1918
2011
  /** @type {Map<Batch, Key>} */
1919
- p(this, z, /* @__PURE__ */ new Map());
2012
+ w(this, de, /* @__PURE__ */ new Map());
1920
2013
  /**
1921
2014
  * Map of keys to effects that are currently rendered in the DOM.
1922
2015
  * These effects are visible and actively part of the document tree.
@@ -1931,69 +2024,69 @@ class Ui {
1931
2024
  * Can result in the entries `true->Effect` and `false->Effect`
1932
2025
  * @type {Map<Key, Effect>}
1933
2026
  */
1934
- p(this, ne, /* @__PURE__ */ new Map());
2027
+ w(this, Ce, /* @__PURE__ */ new Map());
1935
2028
  /**
1936
2029
  * Similar to #onscreen with respect to the keys, but contains branches that are not yet
1937
2030
  * in the DOM, because their insertion is deferred.
1938
2031
  * @type {Map<Key, Branch>}
1939
2032
  */
1940
- p(this, j, /* @__PURE__ */ new Map());
2033
+ w(this, te, /* @__PURE__ */ new Map());
1941
2034
  /**
1942
2035
  * Keys of effects that are currently outroing
1943
2036
  * @type {Set<Key>}
1944
2037
  */
1945
- p(this, Fe, /* @__PURE__ */ new Set());
2038
+ w(this, ut, /* @__PURE__ */ new Set());
1946
2039
  /**
1947
2040
  * Whether to pause (i.e. outro) on change, or destroy immediately.
1948
2041
  * This is necessary for `<svelte:element>`
1949
2042
  */
1950
- p(this, yt, !0);
1951
- p(this, mt, () => {
2043
+ w(this, Kt, !0);
2044
+ w(this, Wt, () => {
1952
2045
  var t = (
1953
2046
  /** @type {Batch} */
1954
- T
2047
+ S
1955
2048
  );
1956
- if (l(this, z).has(t)) {
2049
+ if (a(this, de).has(t)) {
1957
2050
  var n = (
1958
2051
  /** @type {Key} */
1959
- l(this, z).get(t)
1960
- ), r = l(this, ne).get(n);
2052
+ a(this, de).get(t)
2053
+ ), r = a(this, Ce).get(n);
1961
2054
  if (r)
1962
- Ci(r), l(this, Fe).delete(n);
2055
+ Qn(r), a(this, ut).delete(n);
1963
2056
  else {
1964
- var i = l(this, j).get(n);
1965
- i && (l(this, ne).set(n, i.effect), l(this, j).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect);
2057
+ var i = a(this, te).get(n);
2058
+ i && (a(this, Ce).set(n, i.effect), a(this, te).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect);
1966
2059
  }
1967
- for (const [s, o] of l(this, z)) {
1968
- if (l(this, z).delete(s), s === t)
2060
+ for (const [s, o] of a(this, de)) {
2061
+ if (a(this, de).delete(s), s === t)
1969
2062
  break;
1970
- const u = l(this, j).get(o);
1971
- u && (B(u.effect), l(this, j).delete(o));
2063
+ const l = a(this, te).get(o);
2064
+ l && (j(l.effect), a(this, te).delete(o));
1972
2065
  }
1973
- for (const [s, o] of l(this, ne)) {
1974
- if (s === n || l(this, Fe).has(s)) continue;
1975
- const u = () => {
1976
- if (Array.from(l(this, z).values()).includes(s)) {
2066
+ for (const [s, o] of a(this, Ce)) {
2067
+ if (s === n || a(this, ut).has(s)) continue;
2068
+ const l = () => {
2069
+ if (Array.from(a(this, de).values()).includes(s)) {
1977
2070
  var f = document.createDocumentFragment();
1978
- pr(o, f), f.append(ke()), l(this, j).set(s, { effect: o, fragment: f });
2071
+ ci(o, f), f.append(be()), a(this, te).set(s, { effect: o, fragment: f });
1979
2072
  } else
1980
- B(o);
1981
- l(this, Fe).delete(s), l(this, ne).delete(s);
2073
+ j(o);
2074
+ a(this, ut).delete(s), a(this, Ce).delete(s);
1982
2075
  };
1983
- l(this, yt) || !r ? (l(this, Fe).add(s), dt(o, u, !1)) : u();
2076
+ a(this, Kt) || !r ? (a(this, ut).add(s), ft(o, l, !1)) : l();
1984
2077
  }
1985
2078
  }
1986
2079
  });
1987
2080
  /**
1988
2081
  * @param {Batch} batch
1989
2082
  */
1990
- p(this, Bt, (t) => {
1991
- l(this, z).delete(t);
1992
- const n = Array.from(l(this, z).values());
1993
- for (const [r, i] of l(this, j))
1994
- n.includes(r) || (B(i.effect), l(this, j).delete(r));
2083
+ w(this, _n, (t) => {
2084
+ a(this, de).delete(t);
2085
+ const n = Array.from(a(this, de).values());
2086
+ for (const [r, i] of a(this, te))
2087
+ n.includes(r) || (j(i.effect), a(this, te).delete(r));
1995
2088
  });
1996
- this.anchor = t, _(this, yt, n);
2089
+ this.anchor = t, b(this, Kt, n);
1997
2090
  }
1998
2091
  /**
1999
2092
  *
@@ -2003,108 +2096,363 @@ class Ui {
2003
2096
  ensure(t, n) {
2004
2097
  var r = (
2005
2098
  /** @type {Batch} */
2006
- T
2007
- ), i = mi();
2008
- if (n && !l(this, ne).has(t) && !l(this, j).has(t))
2099
+ S
2100
+ ), i = ri();
2101
+ if (n && !a(this, Ce).has(t) && !a(this, te).has(t))
2009
2102
  if (i) {
2010
- var s = document.createDocumentFragment(), o = ke();
2011
- s.append(o), l(this, j).set(t, {
2012
- effect: fe(() => n(o)),
2103
+ var s = document.createDocumentFragment(), o = be();
2104
+ s.append(o), a(this, te).set(t, {
2105
+ effect: le(() => n(o)),
2013
2106
  fragment: s
2014
2107
  });
2015
2108
  } else
2016
- l(this, ne).set(
2109
+ a(this, Ce).set(
2017
2110
  t,
2018
- fe(() => n(this.anchor))
2111
+ le(() => n(this.anchor))
2019
2112
  );
2020
- if (l(this, z).set(r, t), i) {
2021
- for (const [u, a] of l(this, ne))
2022
- u === t ? r.skipped_effects.delete(a) : r.skipped_effects.add(a);
2023
- for (const [u, a] of l(this, j))
2024
- u === t ? r.skipped_effects.delete(a.effect) : r.skipped_effects.add(a.effect);
2025
- r.oncommit(l(this, mt)), r.ondiscard(l(this, Bt));
2113
+ if (a(this, de).set(r, t), i) {
2114
+ for (const [l, u] of a(this, Ce))
2115
+ l === t ? r.unskip_effect(u) : r.skip_effect(u);
2116
+ for (const [l, u] of a(this, te))
2117
+ l === t ? r.unskip_effect(u.effect) : r.skip_effect(u.effect);
2118
+ r.oncommit(a(this, Wt)), r.ondiscard(a(this, _n));
2026
2119
  } else
2027
- S && (this.anchor = $), l(this, mt).call(this);
2028
- }
2029
- }
2030
- z = new WeakMap(), ne = new WeakMap(), j = new WeakMap(), Fe = new WeakMap(), yt = new WeakMap(), mt = new WeakMap(), Bt = new WeakMap();
2031
- function Vi(e) {
2032
- Y === null && qr(), Si(() => {
2033
- const t = Er(e);
2034
- if (typeof t == "function") return (
2035
- /** @type {() => void} */
2036
- t
2037
- );
2038
- });
2039
- }
2040
- function Hi(e, t, n = !1) {
2041
- S && an();
2042
- var r = new Ui(e), i = n ? ot : 0;
2043
- function s(o, u) {
2044
- if (S) {
2045
- const f = ti(e) === sn;
2046
- if (o === f) {
2047
- var a = In();
2048
- ie(a), r.anchor = a, He(!1), r.ensure(o, u), He(!0);
2120
+ A && (this.anchor = x), a(this, Wt).call(this);
2121
+ }
2122
+ }
2123
+ de = new WeakMap(), Ce = new WeakMap(), te = new WeakMap(), ut = new WeakMap(), Kt = new WeakMap(), Wt = new WeakMap(), _n = new WeakMap();
2124
+ function Ge(e, t, n = !1) {
2125
+ A && yn();
2126
+ var r = new Qs(e), i = n ? Lt : 0;
2127
+ function s(o, l) {
2128
+ if (A) {
2129
+ const h = Lr(e);
2130
+ var u;
2131
+ if (h === Bn ? u = 0 : h === gn ? u = !1 : u = parseInt(h.substring(1)), o !== u) {
2132
+ var f = dn();
2133
+ z(f), r.anchor = f, _e(!1), r.ensure(o, l), _e(!0);
2049
2134
  return;
2050
2135
  }
2051
2136
  }
2052
- r.ensure(o, u);
2137
+ r.ensure(o, l);
2053
2138
  }
2054
- fr(() => {
2139
+ Tn(() => {
2055
2140
  var o = !1;
2056
- t((u, a = !0) => {
2057
- o = !0, s(a, u);
2141
+ t((l, u = 0) => {
2142
+ o = !0, s(u, l);
2058
2143
  }), o || s(!1, null);
2059
2144
  }, i);
2060
2145
  }
2061
- function Wi(e, t) {
2146
+ function Zs(e, t) {
2147
+ return t;
2148
+ }
2149
+ function eo(e, t, n) {
2150
+ for (var r = [], i = t.length, s, o = t.length, l = 0; l < i; l++) {
2151
+ let v = t[l];
2152
+ ft(
2153
+ v,
2154
+ () => {
2155
+ if (s) {
2156
+ if (s.pending.delete(v), s.done.add(v), s.pending.size === 0) {
2157
+ var c = (
2158
+ /** @type {Set<EachOutroGroup>} */
2159
+ e.outrogroups
2160
+ );
2161
+ Fn(pn(s.done)), c.delete(s), c.size === 0 && (e.outrogroups = null);
2162
+ }
2163
+ } else
2164
+ o -= 1;
2165
+ },
2166
+ !1
2167
+ );
2168
+ }
2169
+ if (o === 0) {
2170
+ var u = r.length === 0 && n !== null;
2171
+ if (u) {
2172
+ var f = (
2173
+ /** @type {Element} */
2174
+ n
2175
+ ), h = (
2176
+ /** @type {Element} */
2177
+ f.parentNode
2178
+ );
2179
+ ni(h), h.append(f), e.items.clear();
2180
+ }
2181
+ Fn(t, !u);
2182
+ } else
2183
+ s = {
2184
+ pending: new Set(t),
2185
+ done: /* @__PURE__ */ new Set()
2186
+ }, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(s);
2187
+ }
2188
+ function Fn(e, t = !0) {
2189
+ for (var n = 0; n < e.length; n++)
2190
+ j(e[n], t);
2191
+ }
2192
+ var pr;
2193
+ function to(e, t, n, r, i, s = null) {
2194
+ var o = e, l = /* @__PURE__ */ new Map();
2195
+ A && yn();
2196
+ var u = null, f = /* @__PURE__ */ xs(() => {
2197
+ var m = n();
2198
+ return xr(m) ? m : m == null ? [] : pn(m);
2199
+ }), h, v = !0;
2200
+ function c() {
2201
+ d.fallback = u, no(d, h, o, t, r), u !== null && (h.length === 0 ? (u.f & Ye) === 0 ? Qn(u) : (u.f ^= Ye, Vt(u, null, o)) : ft(u, () => {
2202
+ u = null;
2203
+ }));
2204
+ }
2205
+ var p = Tn(() => {
2206
+ h = /** @type {V[]} */
2207
+ g(f);
2208
+ var m = h.length;
2209
+ let $ = !1;
2210
+ if (A) {
2211
+ var R = Lr(o) === gn;
2212
+ R !== (m === 0) && (o = dn(), z(o), _e(!1), $ = !0);
2213
+ }
2214
+ for (var I = /* @__PURE__ */ new Set(), $e = (
2215
+ /** @type {Batch} */
2216
+ S
2217
+ ), Ve = ri(), J = 0; J < m; J += 1) {
2218
+ A && x.nodeType === gt && /** @type {Comment} */
2219
+ x.data === Gn && (o = /** @type {Comment} */
2220
+ x, $ = !0, _e(!1));
2221
+ var Fe = h[J], Be = r(Fe, J), L = v ? null : l.get(Be);
2222
+ L ? (L.v && Dt(L.v, Fe), L.i && Dt(L.i, J), Ve && $e.unskip_effect(L.e)) : (L = ro(
2223
+ l,
2224
+ v ? o : pr ?? (pr = be()),
2225
+ Fe,
2226
+ Be,
2227
+ J,
2228
+ i,
2229
+ t,
2230
+ n
2231
+ ), v || (L.e.f |= Ye), l.set(Be, L)), I.add(Be);
2232
+ }
2233
+ if (m === 0 && s && !u && (v ? u = le(() => s(o)) : (u = le(() => s(pr ?? (pr = be()))), u.f |= Ye)), m > I.size && ns(), A && m > 0 && z(dn()), !v)
2234
+ if (Ve) {
2235
+ for (const [U, Jt] of l)
2236
+ I.has(U) || $e.skip_effect(Jt.e);
2237
+ $e.oncommit(c), $e.ondiscard(() => {
2238
+ });
2239
+ } else
2240
+ c();
2241
+ $ && _e(!0), g(f);
2242
+ }), d = { effect: p, items: l, outrogroups: null, fallback: u };
2243
+ v = !1, A && (o = x);
2244
+ }
2245
+ function Ht(e) {
2246
+ for (; e !== null && (e.f & we) === 0; )
2247
+ e = e.next;
2248
+ return e;
2249
+ }
2250
+ function no(e, t, n, r, i) {
2251
+ var s = t.length, o = e.items, l = Ht(e.effect.first), u, f = null, h = [], v = [], c, p, d, m;
2252
+ for (m = 0; m < s; m += 1) {
2253
+ if (c = t[m], p = i(c, m), d = /** @type {EachItem} */
2254
+ o.get(p).e, e.outrogroups !== null)
2255
+ for (const L of e.outrogroups)
2256
+ L.pending.delete(d), L.done.delete(d);
2257
+ if ((d.f & Ye) !== 0)
2258
+ if (d.f ^= Ye, d === l)
2259
+ Vt(d, null, n);
2260
+ else {
2261
+ var $ = f ? f.next : l;
2262
+ d === e.effect.last && (e.effect.last = d.prev), d.prev && (d.prev.next = d.next), d.next && (d.next.prev = d.prev), je(e, f, d), je(e, d, $), Vt(d, $, n), f = d, h = [], v = [], l = Ht(f.next);
2263
+ continue;
2264
+ }
2265
+ if ((d.f & ne) !== 0 && Qn(d), d !== l) {
2266
+ if (u !== void 0 && u.has(d)) {
2267
+ if (h.length < v.length) {
2268
+ var R = v[0], I;
2269
+ f = R.prev;
2270
+ var $e = h[0], Ve = h[h.length - 1];
2271
+ for (I = 0; I < h.length; I += 1)
2272
+ Vt(h[I], R, n);
2273
+ for (I = 0; I < v.length; I += 1)
2274
+ u.delete(v[I]);
2275
+ je(e, $e.prev, Ve.next), je(e, f, $e), je(e, Ve, R), l = R, f = Ve, m -= 1, h = [], v = [];
2276
+ } else
2277
+ u.delete(d), Vt(d, l, n), je(e, d.prev, d.next), je(e, d, f === null ? e.effect.first : f.next), je(e, f, d), f = d;
2278
+ continue;
2279
+ }
2280
+ for (h = [], v = []; l !== null && l !== d; )
2281
+ (u ?? (u = /* @__PURE__ */ new Set())).add(l), v.push(l), l = Ht(l.next);
2282
+ if (l === null)
2283
+ continue;
2284
+ }
2285
+ (d.f & Ye) === 0 && h.push(d), f = d, l = Ht(d.next);
2286
+ }
2287
+ if (e.outrogroups !== null) {
2288
+ for (const L of e.outrogroups)
2289
+ L.pending.size === 0 && (Fn(pn(L.done)), e.outrogroups?.delete(L));
2290
+ e.outrogroups.size === 0 && (e.outrogroups = null);
2291
+ }
2292
+ if (l !== null || u !== void 0) {
2293
+ var J = [];
2294
+ if (u !== void 0)
2295
+ for (d of u)
2296
+ (d.f & ne) === 0 && J.push(d);
2297
+ for (; l !== null; )
2298
+ (l.f & ne) === 0 && l !== e.fallback && J.push(l), l = Ht(l.next);
2299
+ var Fe = J.length;
2300
+ if (Fe > 0) {
2301
+ var Be = null;
2302
+ eo(e, J, Be);
2303
+ }
2304
+ }
2305
+ }
2306
+ function ro(e, t, n, r, i, s, o, l) {
2307
+ var u = (o & Vi) !== 0 ? (o & Bi) === 0 ? /* @__PURE__ */ Jr(n, !1, !1) : dt(n) : null, f = (o & Fi) !== 0 ? dt(i) : null;
2308
+ return {
2309
+ v: u,
2310
+ i: f,
2311
+ e: le(() => (s(t, u ?? n, f ?? i, l), () => {
2312
+ e.delete(r);
2313
+ }))
2314
+ };
2315
+ }
2316
+ function Vt(e, t, n) {
2317
+ if (e.nodes)
2318
+ for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & Ye) === 0 ? (
2319
+ /** @type {EffectNodes} */
2320
+ t.nodes.start
2321
+ ) : n; r !== null; ) {
2322
+ var o = (
2323
+ /** @type {TemplateNode} */
2324
+ /* @__PURE__ */ ce(r)
2325
+ );
2326
+ if (s.before(r), r === i)
2327
+ return;
2328
+ r = o;
2329
+ }
2330
+ }
2331
+ function je(e, t, n) {
2332
+ t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t;
2333
+ }
2334
+ function io(e, t) {
2335
+ let n = null, r = A;
2336
+ var i;
2337
+ if (A) {
2338
+ n = x;
2339
+ for (var s = /* @__PURE__ */ vt(document.head); s !== null && (s.nodeType !== gt || /** @type {Comment} */
2340
+ s.data !== e); )
2341
+ s = /* @__PURE__ */ ce(s);
2342
+ if (s === null)
2343
+ _e(!1);
2344
+ else {
2345
+ var o = (
2346
+ /** @type {TemplateNode} */
2347
+ /* @__PURE__ */ ce(s)
2348
+ );
2349
+ s.remove(), z(o);
2350
+ }
2351
+ }
2352
+ A || (i = document.head.appendChild(be()));
2353
+ try {
2354
+ Tn(() => t(i), jn);
2355
+ } finally {
2356
+ r && (_e(!0), z(
2357
+ /** @type {TemplateNode} */
2358
+ n
2359
+ ));
2360
+ }
2361
+ }
2362
+ function so(e, t) {
2363
+ Is(() => {
2364
+ var n = e.getRootNode(), r = (
2365
+ /** @type {ShadowRoot} */
2366
+ n.host ? (
2367
+ /** @type {ShadowRoot} */
2368
+ n
2369
+ ) : (
2370
+ /** @type {Document} */
2371
+ n.head ?? /** @type {Document} */
2372
+ n.ownerDocument.head
2373
+ )
2374
+ );
2375
+ if (!r.querySelector("#" + t.hash)) {
2376
+ const i = Kn("style");
2377
+ i.id = t.hash, i.textContent = t.code, r.appendChild(i);
2378
+ }
2379
+ });
2380
+ }
2381
+ function oo(e, t) {
2062
2382
  return e == null ? null : String(e);
2063
2383
  }
2064
- function Ki(e, t, n, r) {
2384
+ function mr(e, t, n, r) {
2065
2385
  var i = e.__style;
2066
- if (S || i !== t) {
2067
- var s = Wi(t);
2068
- (!S || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t;
2386
+ if (A || i !== t) {
2387
+ var s = oo(t);
2388
+ (!A || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t;
2069
2389
  }
2070
2390
  return r;
2071
2391
  }
2072
- function ft(e, t, n, r) {
2392
+ const lo = /* @__PURE__ */ Symbol("is custom element"), ao = /* @__PURE__ */ Symbol("is html"), uo = es ? "link" : "LINK";
2393
+ function br(e, t, n, r) {
2394
+ var i = fo(e);
2395
+ A && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === uo) || i[t] !== (i[t] = n) && (t === "loading" && (e[Zi] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && co(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
2396
+ }
2397
+ function fo(e) {
2398
+ return (
2399
+ /** @type {Record<string | symbol, unknown>} **/
2400
+ // @ts-expect-error
2401
+ e.__attributes ?? (e.__attributes = {
2402
+ [lo]: e.nodeName.includes("-"),
2403
+ [ao]: e.namespaceURI === Ar
2404
+ })
2405
+ );
2406
+ }
2407
+ var wr = /* @__PURE__ */ new Map();
2408
+ function co(e) {
2409
+ var t = e.getAttribute("is") || e.nodeName, n = wr.get(t);
2410
+ if (n) return n;
2411
+ wr.set(t, n = []);
2412
+ for (var r, i = e, s = Element.prototype; s !== i; ) {
2413
+ r = Ui(i);
2414
+ for (var o in r)
2415
+ r[o].set && n.push(o);
2416
+ i = Cr(i);
2417
+ }
2418
+ return n;
2419
+ }
2420
+ function mt(e, t, n, r) {
2073
2421
  var i = (
2074
2422
  /** @type {V} */
2075
2423
  r
2076
2424
  ), s = !0, o = () => (s && (s = !1, i = /** @type {V} */
2077
- r), i), u;
2078
- u = /** @type {V} */
2079
- e[t], u === void 0 && r !== void 0 && (u = o());
2080
- var a;
2081
- a = () => {
2425
+ r), i), l;
2426
+ l = /** @type {V} */
2427
+ e[t], l === void 0 && r !== void 0 && (l = o());
2428
+ var u;
2429
+ u = () => {
2082
2430
  var c = (
2083
2431
  /** @type {V} */
2084
2432
  e[t]
2085
2433
  );
2086
2434
  return c === void 0 ? o() : (s = !0, c);
2087
2435
  };
2088
- var f = !1, h = /* @__PURE__ */ Qn(() => (f = !1, a())), d = (
2436
+ var f = !1, h = /* @__PURE__ */ En(() => (f = !1, u())), v = (
2089
2437
  /** @type {Effect} */
2090
- w
2438
+ T
2091
2439
  );
2092
2440
  return (
2093
2441
  /** @type {() => V} */
2094
- (function(c, v) {
2442
+ (function(c, p) {
2095
2443
  if (arguments.length > 0) {
2096
- const g = v ? m(h) : c;
2097
- return ce(h, g), f = !0, i !== void 0 && (i = g), c;
2444
+ const d = p ? g(h) : c;
2445
+ return C(h, d), f = !0, i !== void 0 && (i = d), c;
2098
2446
  }
2099
- return Pe && f || (d.f & pe) !== 0 ? h.v : m(h);
2447
+ return Xe && f || (v.f & Ie) !== 0 ? h.v : g(h);
2100
2448
  })
2101
2449
  );
2102
2450
  }
2103
- function zi(e) {
2104
- return new Ji(e);
2451
+ function ho(e) {
2452
+ return new vo(e);
2105
2453
  }
2106
- var ve, V;
2107
- class Ji {
2454
+ var qe, oe;
2455
+ class vo {
2108
2456
  /**
2109
2457
  * @param {ComponentConstructorOptions & {
2110
2458
  * component: any;
@@ -2112,56 +2460,56 @@ class Ji {
2112
2460
  */
2113
2461
  constructor(t) {
2114
2462
  /** @type {any} */
2115
- p(this, ve);
2463
+ w(this, qe);
2116
2464
  /** @type {Record<string, any>} */
2117
- p(this, V);
2465
+ w(this, oe);
2118
2466
  var n = /* @__PURE__ */ new Map(), r = (s, o) => {
2119
- var u = /* @__PURE__ */ pi(o, !1, !1);
2120
- return n.set(s, u), u;
2467
+ var l = /* @__PURE__ */ Jr(o, !1, !1);
2468
+ return n.set(s, l), l;
2121
2469
  };
2122
2470
  const i = new Proxy(
2123
2471
  { ...t.props || {}, $$events: {} },
2124
2472
  {
2125
2473
  get(s, o) {
2126
- return m(n.get(o) ?? r(o, Reflect.get(s, o)));
2474
+ return g(n.get(o) ?? r(o, Reflect.get(s, o)));
2127
2475
  },
2128
2476
  has(s, o) {
2129
- return o === jr ? !0 : (m(n.get(o) ?? r(o, Reflect.get(s, o))), Reflect.has(s, o));
2477
+ return o === Qi ? !0 : (g(n.get(o) ?? r(o, Reflect.get(s, o))), Reflect.has(s, o));
2130
2478
  },
2131
- set(s, o, u) {
2132
- return ce(n.get(o) ?? r(o, u), u), Reflect.set(s, o, u);
2479
+ set(s, o, l) {
2480
+ return C(n.get(o) ?? r(o, l), l), Reflect.set(s, o, l);
2133
2481
  }
2134
2482
  }
2135
2483
  );
2136
- _(this, V, (t.hydrate ? Yi : Sr)(t.component, {
2484
+ b(this, oe, (t.hydrate ? Xs : wi)(t.component, {
2137
2485
  target: t.target,
2138
2486
  anchor: t.anchor,
2139
2487
  props: i,
2140
2488
  context: t.context,
2141
2489
  intro: t.intro ?? !1,
2142
2490
  recover: t.recover
2143
- })), (!t?.props?.$$host || t.sync === !1) && Ue(), _(this, ve, i.$$events);
2144
- for (const s of Object.keys(l(this, V)))
2145
- s === "$set" || s === "$destroy" || s === "$on" || Nt(this, s, {
2491
+ })), (!t?.props?.$$host || t.sync === !1) && et(), b(this, qe, i.$$events);
2492
+ for (const s of Object.keys(a(this, oe)))
2493
+ s === "$set" || s === "$destroy" || s === "$on" || hn(this, s, {
2146
2494
  get() {
2147
- return l(this, V)[s];
2495
+ return a(this, oe)[s];
2148
2496
  },
2149
2497
  /** @param {any} value */
2150
2498
  set(o) {
2151
- l(this, V)[s] = o;
2499
+ a(this, oe)[s] = o;
2152
2500
  },
2153
2501
  enumerable: !0
2154
2502
  });
2155
- l(this, V).$set = /** @param {Record<string, any>} next */
2503
+ a(this, oe).$set = /** @param {Record<string, any>} next */
2156
2504
  (s) => {
2157
2505
  Object.assign(i, s);
2158
- }, l(this, V).$destroy = () => {
2159
- Gi(l(this, V));
2506
+ }, a(this, oe).$destroy = () => {
2507
+ Js(a(this, oe));
2160
2508
  };
2161
2509
  }
2162
2510
  /** @param {Record<string, any>} props */
2163
2511
  $set(t) {
2164
- l(this, V).$set(t);
2512
+ a(this, oe).$set(t);
2165
2513
  }
2166
2514
  /**
2167
2515
  * @param {string} event
@@ -2169,22 +2517,22 @@ class Ji {
2169
2517
  * @returns {any}
2170
2518
  */
2171
2519
  $on(t, n) {
2172
- l(this, ve)[t] = l(this, ve)[t] || [];
2520
+ a(this, qe)[t] = a(this, qe)[t] || [];
2173
2521
  const r = (...i) => n.call(this, ...i);
2174
- return l(this, ve)[t].push(r), () => {
2175
- l(this, ve)[t] = l(this, ve)[t].filter(
2522
+ return a(this, qe)[t].push(r), () => {
2523
+ a(this, qe)[t] = a(this, qe)[t].filter(
2176
2524
  /** @param {any} fn */
2177
2525
  (i) => i !== r
2178
2526
  );
2179
2527
  };
2180
2528
  }
2181
2529
  $destroy() {
2182
- l(this, V).$destroy();
2530
+ a(this, oe).$destroy();
2183
2531
  }
2184
2532
  }
2185
- ve = new WeakMap(), V = new WeakMap();
2186
- let kr;
2187
- typeof HTMLElement == "function" && (kr = class extends HTMLElement {
2533
+ qe = new WeakMap(), oe = new WeakMap();
2534
+ let $i;
2535
+ typeof HTMLElement == "function" && ($i = class extends HTMLElement {
2188
2536
  /**
2189
2537
  * @param {*} $$componentCtor
2190
2538
  * @param {*} $$slots
@@ -2193,27 +2541,27 @@ typeof HTMLElement == "function" && (kr = class extends HTMLElement {
2193
2541
  constructor(t, n, r) {
2194
2542
  super();
2195
2543
  /** The Svelte component constructor */
2196
- y(this, "$$ctor");
2544
+ O(this, "$$ctor");
2197
2545
  /** Slots */
2198
- y(this, "$$s");
2546
+ O(this, "$$s");
2199
2547
  /** @type {any} The Svelte component instance */
2200
- y(this, "$$c");
2548
+ O(this, "$$c");
2201
2549
  /** Whether or not the custom element is connected */
2202
- y(this, "$$cn", !1);
2550
+ O(this, "$$cn", !1);
2203
2551
  /** @type {Record<string, any>} Component props data */
2204
- y(this, "$$d", {});
2552
+ O(this, "$$d", {});
2205
2553
  /** `true` if currently in the process of reflecting component props back to attributes */
2206
- y(this, "$$r", !1);
2554
+ O(this, "$$r", !1);
2207
2555
  /** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
2208
- y(this, "$$p_d", {});
2556
+ O(this, "$$p_d", {});
2209
2557
  /** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */
2210
- y(this, "$$l", {});
2558
+ O(this, "$$l", {});
2211
2559
  /** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */
2212
- y(this, "$$l_u", /* @__PURE__ */ new Map());
2560
+ O(this, "$$l_u", /* @__PURE__ */ new Map());
2213
2561
  /** @type {any} The managed render effect for reflecting attributes */
2214
- y(this, "$$me");
2562
+ O(this, "$$me");
2215
2563
  /** @type {ShadowRoot | null} The ShadowRoot of the custom element */
2216
- y(this, "$$shadowRoot", null);
2564
+ O(this, "$$shadowRoot", null);
2217
2565
  this.$$ctor = t, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r));
2218
2566
  }
2219
2567
  /**
@@ -2243,22 +2591,22 @@ typeof HTMLElement == "function" && (kr = class extends HTMLElement {
2243
2591
  if (this.$$cn = !0, !this.$$c) {
2244
2592
  let t = function(i) {
2245
2593
  return (s) => {
2246
- const o = document.createElement("slot");
2247
- i !== "default" && (o.name = i), nn(s, o);
2594
+ const o = Kn("slot");
2595
+ i !== "default" && (o.name = i), re(s, o);
2248
2596
  };
2249
2597
  };
2250
2598
  if (await Promise.resolve(), !this.$$cn || this.$$c)
2251
2599
  return;
2252
- const n = {}, r = Xi(this);
2600
+ const n = {}, r = _o(this);
2253
2601
  for (const i of this.$$s)
2254
2602
  i in r && (i === "default" && !this.$$d.children ? (this.$$d.children = t(i), n.default = !0) : n[i] = t(i));
2255
2603
  for (const i of this.attributes) {
2256
2604
  const s = this.$$g_p(i.name);
2257
- s in this.$$d || (this.$$d[s] = Rt(s, i.value, this.$$p_d, "toProp"));
2605
+ s in this.$$d || (this.$$d[s] = fn(s, i.value, this.$$p_d, "toProp"));
2258
2606
  }
2259
2607
  for (const i in this.$$p_d)
2260
2608
  !(i in this.$$d) && this[i] !== void 0 && (this.$$d[i] = this[i], delete this[i]);
2261
- this.$$c = zi({
2609
+ this.$$c = ho({
2262
2610
  component: this.$$ctor,
2263
2611
  target: this.$$shadowRoot || this,
2264
2612
  props: {
@@ -2266,13 +2614,13 @@ typeof HTMLElement == "function" && (kr = class extends HTMLElement {
2266
2614
  $$slots: n,
2267
2615
  $$host: this
2268
2616
  }
2269
- }), this.$$me = xi(() => {
2270
- ar(() => {
2617
+ }), this.$$me = Ms(() => {
2618
+ oi(() => {
2271
2619
  this.$$r = !0;
2272
- for (const i of Ct(this.$$c)) {
2620
+ for (const i of cn(this.$$c)) {
2273
2621
  if (!this.$$p_d[i]?.reflect) continue;
2274
2622
  this.$$d[i] = this.$$c[i];
2275
- const s = Rt(
2623
+ const s = fn(
2276
2624
  i,
2277
2625
  this.$$d[i],
2278
2626
  this.$$p_d,
@@ -2299,7 +2647,7 @@ typeof HTMLElement == "function" && (kr = class extends HTMLElement {
2299
2647
  * @param {string} newValue
2300
2648
  */
2301
2649
  attributeChangedCallback(t, n, r) {
2302
- this.$$r || (t = this.$$g_p(t), this.$$d[t] = Rt(t, r, this.$$p_d, "toProp"), this.$$c?.$set({ [t]: this.$$d[t] }));
2650
+ this.$$r || (t = this.$$g_p(t), this.$$d[t] = fn(t, r, this.$$p_d, "toProp"), this.$$c?.$set({ [t]: this.$$d[t] }));
2303
2651
  }
2304
2652
  disconnectedCallback() {
2305
2653
  this.$$cn = !1, Promise.resolve().then(() => {
@@ -2310,12 +2658,12 @@ typeof HTMLElement == "function" && (kr = class extends HTMLElement {
2310
2658
  * @param {string} attribute_name
2311
2659
  */
2312
2660
  $$g_p(t) {
2313
- return Ct(this.$$p_d).find(
2661
+ return cn(this.$$p_d).find(
2314
2662
  (n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t
2315
2663
  ) || t;
2316
2664
  }
2317
2665
  });
2318
- function Rt(e, t, n, r) {
2666
+ function fn(e, t, n, r) {
2319
2667
  const i = n[e]?.type;
2320
2668
  if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e])
2321
2669
  return t;
@@ -2345,7 +2693,7 @@ function Rt(e, t, n, r) {
2345
2693
  return t;
2346
2694
  }
2347
2695
  }
2348
- function Xi(e) {
2696
+ function _o(e) {
2349
2697
  const t = {};
2350
2698
  return e.childNodes.forEach((n) => {
2351
2699
  t[
@@ -2354,285 +2702,588 @@ function Xi(e) {
2354
2702
  ] = !0;
2355
2703
  }), t;
2356
2704
  }
2357
- function Qi(e, t, n, r, i, s) {
2358
- let o = class extends kr {
2705
+ function go(e, t, n, r, i, s) {
2706
+ let o = class extends $i {
2359
2707
  constructor() {
2360
2708
  super(e, n, i), this.$$p_d = t;
2361
2709
  }
2362
2710
  static get observedAttributes() {
2363
- return Ct(t).map(
2364
- (u) => (t[u].attribute || u).toLowerCase()
2711
+ return cn(t).map(
2712
+ (l) => (t[l].attribute || l).toLowerCase()
2365
2713
  );
2366
2714
  }
2367
2715
  };
2368
- return Ct(t).forEach((u) => {
2369
- Nt(o.prototype, u, {
2716
+ return cn(t).forEach((l) => {
2717
+ hn(o.prototype, l, {
2370
2718
  get() {
2371
- return this.$$c && u in this.$$c ? this.$$c[u] : this.$$d[u];
2719
+ return this.$$c && l in this.$$c ? this.$$c[l] : this.$$d[l];
2372
2720
  },
2373
- set(a) {
2374
- a = Rt(u, a, t), this.$$d[u] = a;
2721
+ set(u) {
2722
+ u = fn(l, u, t), this.$$d[l] = u;
2375
2723
  var f = this.$$c;
2376
2724
  if (f) {
2377
- var h = ze(f, u)?.get;
2378
- h ? f[u] = a : f.$set({ [u]: a });
2725
+ var h = wt(f, l)?.get;
2726
+ h ? f[l] = u : f.$set({ [l]: u });
2379
2727
  }
2380
2728
  }
2381
2729
  });
2382
- }), r.forEach((u) => {
2383
- Nt(o.prototype, u, {
2730
+ }), r.forEach((l) => {
2731
+ hn(o.prototype, l, {
2384
2732
  get() {
2385
- return this.$$c?.[u];
2733
+ return this.$$c?.[l];
2386
2734
  }
2387
2735
  });
2388
2736
  }), e.element = /** @type {any} */
2389
2737
  o, o;
2390
2738
  }
2391
- var kn;
2739
+ var yr;
2392
2740
  (function(e) {
2393
2741
  e.TTS_WORD = "tts-word", e.TTS_SENTENCE = "tts-sentence", e.ANNOTATION = "annotation";
2394
- })(kn || (kn = {}));
2395
- var Ke;
2742
+ })(yr || (yr = {}));
2743
+ var ze;
2396
2744
  (function(e) {
2397
- e.YELLOW = "yellow", e.GREEN = "green", e.BLUE = "blue", e.PINK = "pink", e.ORANGE = "orange";
2398
- })(Ke || (Ke = {}));
2399
- const Zi = {
2400
- // Standard QTI 3.0 PNP supports
2401
- textToSpeech: "pie-tool-text-to-speech",
2402
- calculator: "pie-tool-calculator",
2403
- ruler: "pie-tool-ruler",
2404
- protractor: "pie-tool-protractor",
2405
- highlighter: "pie-tool-annotation-toolbar",
2406
- lineReader: "pie-tool-line-reader",
2407
- magnifier: "pie-tool-magnifier",
2408
- colorContrast: "pie-theme-contrast",
2409
- answerMasking: "pie-tool-answer-eliminator",
2410
- dictionaryLookup: "pie-tool-dictionary",
2411
- // Common extensions (not in QTI standard but widely used)
2412
- graphingCalculator: "pie-tool-calculator",
2413
- scientificCalculator: "pie-tool-calculator",
2414
- basicCalculator: "pie-tool-calculator"
2745
+ e.YELLOW = "yellow", e.GREEN = "green", e.BLUE = "blue", e.PINK = "pink", e.ORANGE = "orange", e.UNDERLINE = "underline";
2746
+ })(ze || (ze = {}));
2747
+ const po = {
2748
+ /**
2749
+ * Visual accessibility features
2750
+ * For students with low vision, color blindness, or visual processing needs
2751
+ */
2752
+ visual: {
2753
+ // Magnification and zoom
2754
+ magnification: "magnification",
2755
+ screenMagnifier: "screenMagnifier",
2756
+ zoomable: "zoomable",
2757
+ // Color and contrast
2758
+ highContrastDisplay: "highContrastDisplay",
2759
+ highContrastAudio: "highContrastAudio",
2760
+ colorContrast: "colorContrast",
2761
+ invertColors: "invertColors",
2762
+ // Display customization
2763
+ displayTransformability: "displayTransformability",
2764
+ largePrint: "largePrint",
2765
+ fontEnlargement: "fontEnlargement",
2766
+ resizeText: "resizeText",
2767
+ // Visual alternatives
2768
+ alternativeText: "alternativeText",
2769
+ longDescription: "longDescription",
2770
+ describedMath: "describedMath",
2771
+ tactileGraphic: "tactileGraphic",
2772
+ tactileObject: "tactileObject"
2773
+ },
2774
+ /**
2775
+ * Auditory accessibility features
2776
+ * For students who are deaf, hard of hearing, or benefit from audio
2777
+ */
2778
+ auditory: {
2779
+ // Audio output
2780
+ audioDescription: "audioDescription",
2781
+ textToSpeech: "textToSpeech",
2782
+ readAloud: "readAloud",
2783
+ humanVoice: "humanVoice",
2784
+ syntheticVoice: "syntheticVoice",
2785
+ // Speech control
2786
+ speechRate: "speechRate",
2787
+ speechVolume: "speechVolume",
2788
+ voicePitch: "voicePitch",
2789
+ // Visual alternatives for audio
2790
+ captions: "captions",
2791
+ closedCaptions: "closedCaptions",
2792
+ openCaptions: "openCaptions",
2793
+ transcript: "transcript",
2794
+ signLanguage: "signLanguage",
2795
+ subtitles: "subtitles",
2796
+ // Audio adjustments
2797
+ audioControl: "audioControl",
2798
+ noBackgroundAudio: "noBackgroundAudio"
2799
+ },
2800
+ /**
2801
+ * Motor/physical accessibility features
2802
+ * For students with limited mobility or motor control
2803
+ */
2804
+ motor: {
2805
+ // Input alternatives
2806
+ keyboardControl: "keyboardControl",
2807
+ mouseControl: "mouseControl",
2808
+ touchControl: "touchControl",
2809
+ voiceControl: "voiceControl",
2810
+ switchControl: "switchControl",
2811
+ eyeGazeControl: "eyeGazeControl",
2812
+ // Keyboard features
2813
+ singleSwitchAccess: "singleSwitchAccess",
2814
+ stickyKeys: "stickyKeys",
2815
+ keyboardShortcuts: "keyboardShortcuts",
2816
+ // Timing
2817
+ timingControl: "timingControl",
2818
+ unlimitedTime: "unlimitedTime",
2819
+ extendedTime: "extendedTime",
2820
+ pauseControl: "pauseControl"
2821
+ },
2822
+ /**
2823
+ * Cognitive/learning accessibility features
2824
+ * For students with learning disabilities, ADHD, autism, etc.
2825
+ */
2826
+ cognitive: {
2827
+ // Content simplification
2828
+ simplifiedLanguage: "simplifiedLanguage",
2829
+ reducedComplexity: "reducedComplexity",
2830
+ structuralNavigation: "structuralNavigation",
2831
+ tableOfContents: "tableOfContents",
2832
+ // Focus and attention
2833
+ reducedDistraction: "reducedDistraction",
2834
+ noFlashing: "noFlashing",
2835
+ pauseAnimation: "pauseAnimation",
2836
+ // Organization and support
2837
+ annotations: "annotations",
2838
+ bookmarking: "bookmarking",
2839
+ highlighting: "highlighting",
2840
+ guidedNavigation: "guidedNavigation",
2841
+ // Tools
2842
+ calculator: "calculator",
2843
+ dictionary: "dictionary",
2844
+ thesaurus: "thesaurus",
2845
+ spellingAssistance: "spellingAssistance",
2846
+ grammarAssistance: "grammarAssistance"
2847
+ },
2848
+ /**
2849
+ * Reading support features
2850
+ * For students with dyslexia or reading challenges
2851
+ */
2852
+ reading: {
2853
+ // Text presentation
2854
+ lineSpacing: "lineSpacing",
2855
+ wordSpacing: "wordSpacing",
2856
+ letterSpacing: "letterSpacing",
2857
+ fontFamily: "fontFamily",
2858
+ readingMask: "readingMask",
2859
+ readingGuide: "readingGuide",
2860
+ readingRuler: "readingRuler",
2861
+ // Highlighting and emphasis
2862
+ wordHighlighting: "wordHighlighting",
2863
+ lineHighlighting: "lineHighlighting",
2864
+ focusIndicator: "focusIndicator",
2865
+ // Content support
2866
+ printableResource: "printableResource",
2867
+ braille: "braille",
2868
+ nemeth: "nemeth",
2869
+ refreshableBraille: "refreshableBraille"
2870
+ },
2871
+ /**
2872
+ * Navigation features
2873
+ * For efficient content navigation
2874
+ */
2875
+ navigation: {
2876
+ // Structure
2877
+ index: "index",
2878
+ pageNavigation: "pageNavigation",
2879
+ skipContent: "skipContent",
2880
+ breadcrumbs: "breadcrumbs",
2881
+ // Search
2882
+ searchable: "searchable",
2883
+ fullTextSearch: "fullTextSearch"
2884
+ },
2885
+ /**
2886
+ * Linguistic features
2887
+ * For language support
2888
+ */
2889
+ linguistic: {
2890
+ // Languages
2891
+ multilingualText: "multilingualText",
2892
+ translatedText: "translatedText",
2893
+ glossary: "glossary",
2894
+ // Sign language
2895
+ signLanguageInterpretation: "signLanguageInterpretation",
2896
+ visualLanguage: "visualLanguage"
2897
+ },
2898
+ /**
2899
+ * Assessment-specific features
2900
+ * Features specific to test-taking environments
2901
+ */
2902
+ assessment: {
2903
+ // Tools
2904
+ protractor: "protractor",
2905
+ ruler: "ruler",
2906
+ graph: "graph",
2907
+ graphingCalculator: "graphingCalculator",
2908
+ periodicTable: "periodicTable",
2909
+ formulaSheet: "formulaSheet",
2910
+ // Answer support
2911
+ answerMasking: "answerMasking",
2912
+ answerEliminator: "answerEliminator",
2913
+ strikethrough: "strikethrough",
2914
+ // Item features
2915
+ itemGlossary: "itemGlossary",
2916
+ tutorialAvailable: "tutorialAvailable"
2917
+ }
2415
2918
  };
2416
- Object.fromEntries(Object.entries(Zi).map(([e, t]) => [t, e]));
2417
- var Pn;
2919
+ Object.values(po).flatMap((e) => Object.values(e));
2920
+ var $r;
2418
2921
  (function(e) {
2419
2922
  e[e.BASE = 0] = "BASE", e[e.TOOL = 1e3] = "TOOL", e[e.MODAL = 2e3] = "MODAL", e[e.CONTROL = 3e3] = "CONTROL", e[e.HIGHLIGHT = 4e3] = "HIGHLIGHT";
2420
- })(Pn || (Pn = {}));
2421
- var An;
2923
+ })($r || ($r = {}));
2924
+ var Er;
2422
2925
  (function(e) {
2423
2926
  e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
2424
- })(An || (An = {}));
2425
- class es {
2426
- constructor() {
2427
- y(this, "providerId", "browser");
2428
- y(this, "providerName", "Browser Speech Synthesis");
2429
- y(this, "version", "1.0.0");
2430
- }
2431
- async initialize(t) {
2432
- if (typeof window > "u")
2433
- throw new Error("BrowserTTSProvider requires browser environment");
2434
- if (!("speechSynthesis" in window))
2435
- throw new Error("Browser does not support Speech Synthesis API");
2436
- return new ts(t);
2437
- }
2438
- supportsFeature(t) {
2439
- return !0;
2440
- }
2441
- getCapabilities() {
2442
- return {
2443
- supportsPause: !0,
2444
- supportsResume: !0,
2445
- supportsWordBoundary: !0,
2446
- supportsVoiceSelection: !0,
2447
- supportsRateControl: !0,
2448
- supportsPitchControl: !0
2449
- };
2450
- }
2451
- destroy() {
2927
+ })(Er || (Er = {}));
2928
+ var mo = /* @__PURE__ */ ye('<link rel="stylesheet" href="./highlights.css"/>'), bo = /* @__PURE__ */ ye('<button class="highlight-swatch svelte-g8qu62"><span class="sr-only svelte-g8qu62"> </span></button>'), wo = /* @__PURE__ */ ye('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <button class="btn btn-sm btn-square svelte-g8qu62" aria-label="Read selected text aloud" title="Read Aloud"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z"></path></svg></button>', 1), yo = /* @__PURE__ */ ye('<button class="btn btn-sm btn-square svelte-g8qu62" aria-label="Look up selected text in dictionary" title="Dictionary"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M18,22A2,2 0 0,0 20,20V4C20,2.89 19.1,2 18,2H12V9L9.5,7.5L7,9V2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18Z"></path></svg></button>'), $o = /* @__PURE__ */ ye('<button class="btn btn-sm btn-square svelte-g8qu62" aria-label="Look up selected text in picture dictionary" title="Picture Dictionary"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z"></path></svg></button>'), Eo = /* @__PURE__ */ ye('<button class="btn btn-sm btn-square svelte-g8qu62" aria-label="Translate selected text" title="Translation"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M12.87,15.07L10.33,12.56L10.36,12.53C12.1,10.59 13.34,8.36 14.07,6H17V4H10V2H8V4H1V6H12.17C11.5,7.92 10.44,9.75 9,11.35C8.07,10.32 7.3,9.19 6.69,8H4.69C5.42,9.63 6.42,11.17 7.67,12.56L2.58,17.58L4,19L9,14L12.11,17.11L12.87,15.07M18.5,10H16.5L12,22H14L15.12,19H19.87L21,22H23L18.5,10M15.88,17L17.5,12.67L19.12,17H15.88Z"></path></svg></button>'), To = /* @__PURE__ */ ye('<button class="btn btn-sm btn-ghost text-warning" aria-label="Remove this annotation" title="Remove"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path></svg></button>'), Ao = /* @__PURE__ */ ye('<button class="btn btn-sm btn-ghost text-error" aria-label="Clear all annotations from document" title="Clear All">Clear All</button>'), xo = /* @__PURE__ */ ye('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <!> <!>', 1), Co = /* @__PURE__ */ ye('<div class="annotation-toolbar notranslate fixed z-[4200] flex gap-1 bg-base-100 shadow-lg rounded-lg p-2 border border-base-300 svelte-g8qu62" role="toolbar" aria-label="Text annotation toolbar" translate="no"><!> <button class="btn btn-sm btn-square svelte-g8qu62" aria-label="Underline selected text" title="Underline"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z"></path></svg></button> <!> <!> <!> <!> <!></div>'), So = /* @__PURE__ */ ye('<!> <div role="status" aria-live="polite" aria-atomic="true" class="sr-only svelte-g8qu62"> </div>', 1);
2929
+ const ko = {
2930
+ hash: "svelte-g8qu62",
2931
+ code: `.annotation-toolbar.svelte-g8qu62 {user-select:none;}.highlight-swatch.svelte-g8qu62 {width:2.5rem;height:2rem;border:2px solid rgba(0, 0, 0, 0.2);border-radius:0.375rem;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;padding:0;}.highlight-swatch.svelte-g8qu62:hover {transform:scale(1.1);border-color:rgba(0, 0, 0, 0.4);box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);}.highlight-swatch.svelte-g8qu62:focus-visible {outline:2px solid hsl(var(--p));outline-offset:2px;}.divider-horizontal.svelte-g8qu62 {height:auto;background-color:hsl(var(--bc) / 0.2);}
2932
+
2933
+ /* Screen reader only content */.sr-only.svelte-g8qu62 {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;}
2934
+
2935
+ /* Button styling */.btn-square.svelte-g8qu62 {padding:0.5rem;}.btn-square.svelte-g8qu62 svg:where(.svelte-g8qu62) {width:18px;height:18px;}`
2936
+ };
2937
+ function Ro(e, t) {
2938
+ Dr(t, !0), so(e, ko);
2939
+ let n = mt(t, "enabled", 7, !0), r = mt(t, "highlightCoordinator", 7, null), i = mt(t, "ttsService", 7, null), s = mt(t, "ondictionarylookup"), o = mt(t, "ontranslationrequest"), l = mt(t, "onpicturedictionarylookup");
2940
+ const u = typeof window < "u", f = "pie-annotations", h = [
2941
+ {
2942
+ name: ze.YELLOW,
2943
+ hex: "#fde995",
2944
+ label: "Yellow highlight"
2945
+ },
2946
+ {
2947
+ name: ze.PINK,
2948
+ hex: "#ff9fae",
2949
+ label: "Pink highlight"
2950
+ },
2951
+ {
2952
+ name: ze.BLUE,
2953
+ hex: "#a7e0f6",
2954
+ label: "Blue highlight"
2955
+ },
2956
+ {
2957
+ name: ze.GREEN,
2958
+ hex: "#a6e1c5",
2959
+ label: "Green highlight"
2960
+ }
2961
+ ], v = [
2962
+ "button",
2963
+ "input",
2964
+ "select",
2965
+ "textarea",
2966
+ '[contenteditable="true"]',
2967
+ ".annotation-toolbar",
2968
+ ".tool-toolbar",
2969
+ '[role="button"]',
2970
+ '[role="textbox"]'
2971
+ ];
2972
+ let c = /* @__PURE__ */ W(bt({
2973
+ isVisible: !1,
2974
+ selectedText: "",
2975
+ selectedRange: null,
2976
+ toolbarPosition: { x: 0, y: 0 }
2977
+ })), p = /* @__PURE__ */ W(!1), d = /* @__PURE__ */ W(
2978
+ !1
2979
+ // Flag to prevent immediate hiding after showing
2980
+ ), m = /* @__PURE__ */ W(
2981
+ ""
2982
+ // For screen readers when toolbar is repositioned
2983
+ ), $ = /* @__PURE__ */ W(0), R = /* @__PURE__ */ W(null), I = /* @__PURE__ */ fr(() => g($) > 0), $e = /* @__PURE__ */ fr(() => g(R) !== null);
2984
+ function Ve(_) {
2985
+ if (!r()) return null;
2986
+ const E = r().getAnnotations();
2987
+ for (const k of E) {
2988
+ const G = _.compareBoundaryPoints(Range.START_TO_START, k.range), Qe = _.compareBoundaryPoints(Range.END_TO_END, k.range), It = _.compareBoundaryPoints(Range.START_TO_END, k.range), pt = _.compareBoundaryPoints(Range.END_TO_START, k.range);
2989
+ if (G >= 0 && Qe <= 0 || // selection inside annotation
2990
+ G <= 0 && Qe >= 0 || // annotation inside selection
2991
+ It > 0 && pt < 0)
2992
+ return k.id;
2993
+ }
2994
+ return null;
2452
2995
  }
2453
- }
2454
- class ts {
2455
- constructor(t) {
2456
- y(this, "utterance", null);
2457
- y(this, "config", null);
2458
- y(this, "_isPlaying", !1);
2459
- y(this, "_isPaused", !1);
2460
- y(this, "onWordBoundary");
2461
- this.config = t;
2462
- }
2463
- async speak(t) {
2464
- return new Promise((n, r) => {
2465
- if (!this.config) {
2466
- r(new Error("TTS not initialized"));
2467
- return;
2996
+ function J(_) {
2997
+ if (_.nodeType !== Node.ELEMENT_NODE && _.nodeType !== Node.TEXT_NODE)
2998
+ return !1;
2999
+ const E = _.nodeType === Node.TEXT_NODE ? _.parentElement : _;
3000
+ return E ? !v.some((k) => {
3001
+ try {
3002
+ return E.closest(k) !== null;
3003
+ } catch {
3004
+ return !1;
2468
3005
  }
2469
- this.stop(), this.utterance = new SpeechSynthesisUtterance(t);
2470
- let i = -1, s = 0;
2471
- if (this.config.voice) {
2472
- const u = speechSynthesis.getVoices().find((a) => a.name === this.config.voice);
2473
- u && (this.utterance.voice = u);
3006
+ }) : !1;
3007
+ }
3008
+ function Fe() {
3009
+ if (!(!u || !r()))
3010
+ try {
3011
+ const _ = document.body, E = r().exportAnnotations(_);
3012
+ sessionStorage.setItem(f, JSON.stringify(E));
3013
+ } catch (_) {
3014
+ console.error("[AnnotationToolbar] Failed to save annotations:", _);
2474
3015
  }
2475
- this.config.rate && (this.utterance.rate = this.config.rate), this.config.pitch && (this.utterance.pitch = this.config.pitch), this.utterance.onstart = () => {
2476
- this._isPlaying = !0, this._isPaused = !1;
2477
- }, this.utterance.onend = () => {
2478
- this._isPlaying = !1, this._isPaused = !1, n();
2479
- }, this.utterance.onerror = (o) => {
2480
- if (this._isPlaying = !1, this._isPaused = !1, o.error === "interrupted" || o.error === "canceled") {
2481
- n();
2482
- return;
2483
- }
2484
- r(new Error(`Speech synthesis error: ${o.error}`));
2485
- }, this.utterance.onpause = () => {
2486
- this._isPaused = !0;
2487
- }, this.utterance.onresume = () => {
2488
- this._isPaused = !1;
2489
- }, this.utterance.onboundary = (o) => {
2490
- if (console.log("[BrowserProvider] Boundary event:", o.name, "charIndex:", o.charIndex, "charLength:", o.charLength), o.name === "word" && this.onWordBoundary) {
2491
- if (s++, o.charIndex === i && s > 2) {
2492
- console.warn("[BrowserProvider] Browser word boundaries broken - disabling word highlighting"), this.utterance && (this.utterance.onboundary = null);
2493
- return;
2494
- }
2495
- i = o.charIndex;
2496
- const u = t.substring(o.charIndex, o.charIndex + (o.charLength || 0));
2497
- console.log("[BrowserProvider] Calling onWordBoundary with word:", u, "at position:", o.charIndex), this.onWordBoundary(u, o.charIndex);
2498
- }
2499
- }, speechSynthesis.speak(this.utterance);
2500
- });
2501
3016
  }
2502
- pause() {
2503
- this._isPlaying && !this._isPaused && speechSynthesis.pause();
3017
+ function Be() {
3018
+ if (!(!u || !r()))
3019
+ try {
3020
+ const _ = sessionStorage.getItem(f);
3021
+ if (!_) return;
3022
+ const E = JSON.parse(_), k = document.body, G = r().importAnnotations(E, k);
3023
+ console.log(`[AnnotationToolbar] Restored ${G} annotations`), C($, r().getAnnotations().length, !0);
3024
+ } catch (_) {
3025
+ console.error("[AnnotationToolbar] Failed to load annotations:", _);
3026
+ }
2504
3027
  }
2505
- resume() {
2506
- this._isPlaying && this._isPaused && speechSynthesis.resume();
3028
+ function L() {
3029
+ if (!n() || !u) return;
3030
+ const _ = window.getSelection();
3031
+ if (!_ || _.rangeCount === 0) return U();
3032
+ const E = _.getRangeAt(0), k = _.toString().trim();
3033
+ if (!k || !J(E.commonAncestorContainer))
3034
+ return U();
3035
+ const G = E.getBoundingClientRect(), Qe = G.left + G.width / 2, It = G.top - 8;
3036
+ C(R, Ve(E), !0), g(c).isVisible = !0, g(c).selectedText = k, g(c).selectedRange = E.cloneRange(), g(c).toolbarPosition = { x: Qe, y: It };
3037
+ const pt = k.length > 30 ? k.substring(0, 30) + "..." : k;
3038
+ C(m, `Annotation toolbar opened for "${pt}"`), setTimeout(
3039
+ () => {
3040
+ C(m, "");
3041
+ },
3042
+ 2e3
3043
+ ), C(d, !0), setTimeout(
3044
+ () => {
3045
+ C(d, !1);
3046
+ },
3047
+ 100
3048
+ );
2507
3049
  }
2508
- stop() {
2509
- this._isPlaying && (speechSynthesis.cancel(), this._isPlaying = !1, this._isPaused = !1);
3050
+ function U() {
3051
+ g(p) && (i().stop(), C(p, !1)), g(c).isVisible = !1, g(c).selectedText = "", g(c).selectedRange = null;
2510
3052
  }
2511
- isPlaying() {
2512
- return this._isPlaying && !this._isPaused;
3053
+ function Jt(_) {
3054
+ if (!g(c).selectedRange || !r()) return;
3055
+ const E = g(c).selectedText;
3056
+ r().addAnnotation(g(c).selectedRange, _), C($, r().getAnnotations().length, !0), Fe();
3057
+ const k = _ === ze.UNDERLINE ? "underlined" : `highlighted in ${_}`, G = E.length > 30 ? E.substring(0, 30) + "..." : E;
3058
+ C(m, `"${G}" ${k}`), setTimeout(
3059
+ () => {
3060
+ C(m, "");
3061
+ },
3062
+ 3e3
3063
+ ), U();
2513
3064
  }
2514
- isPaused() {
2515
- return this._isPaused;
3065
+ function Ei() {
3066
+ if (!g(R) || !r()) {
3067
+ console.warn("[AnnotationToolbar] No overlapping annotation to remove");
3068
+ return;
3069
+ }
3070
+ console.log("[AnnotationToolbar] Removing annotation:", g(R));
3071
+ const _ = r().getAnnotation(g(R));
3072
+ if (!_) {
3073
+ console.warn("[AnnotationToolbar] Annotation not found:", g(R));
3074
+ return;
3075
+ }
3076
+ const E = _.range.toString();
3077
+ r().removeAnnotation(g(R));
3078
+ const k = r().getAnnotations().length;
3079
+ C($, k, !0), console.log("[AnnotationToolbar] Annotations remaining:", k), Fe();
3080
+ const G = E.length > 30 ? E.substring(0, 30) + "..." : E;
3081
+ C(m, `Removed annotation from "${G}"`), setTimeout(
3082
+ () => {
3083
+ C(m, "");
3084
+ },
3085
+ 3e3
3086
+ ), U();
2516
3087
  }
2517
- /**
2518
- * Update settings dynamically (rate, pitch, voice)
2519
- * Changes take effect on the next speak() call
2520
- */
2521
- updateSettings(t) {
2522
- this.config || (this.config = {}), t.rate !== void 0 && (this.config.rate = t.rate), t.pitch !== void 0 && (this.config.pitch = t.pitch), t.voice !== void 0 && (this.config.voice = t.voice);
3088
+ function Ti() {
3089
+ const _ = g($);
3090
+ r()?.clearAnnotations(), C($, 0), sessionStorage.removeItem(f), C(m, `${_} annotation${_ === 1 ? "" : "s"} cleared`), setTimeout(
3091
+ () => {
3092
+ C(m, "");
3093
+ },
3094
+ 3e3
3095
+ ), U();
2523
3096
  }
2524
- }
2525
- var ns = /* @__PURE__ */ Fi('<div class="annotation-toolbar fixed z-[4200] flex gap-1 bg-base-100 shadow rounded-box p-1" role="toolbar" aria-label="Annotation toolbar"><button class="btn btn-xs" aria-label="Yellow highlight">Y</button> <button class="btn btn-xs" aria-label="Pink highlight">P</button> <button class="btn btn-xs" aria-label="Blue highlight">B</button> <button class="btn btn-xs" aria-label="Green highlight">G</button> <button class="btn btn-xs" aria-label="Read selection">TTS</button> <button class="btn btn-xs" aria-label="Dictionary lookup">Dict</button> <button class="btn btn-xs" aria-label="Translation request">Trans</button> <button class="btn btn-xs btn-ghost" aria-label="Clear highlights">Clear</button></div>');
2526
- function rs(e, t) {
2527
- Fn(t, !0);
2528
- let n = ft(t, "enabled", 7, !0), r = ft(t, "highlightCoordinator", 7, null), i = ft(t, "ttsService"), s = ft(t, "ondictionarylookup"), o = ft(t, "ontranslationrequest");
2529
- const u = typeof window < "u";
2530
- let a = /* @__PURE__ */ ue(We({ visible: !1, text: "", range: null, pos: { x: 0, y: 0 } }));
2531
- async function f() {
2532
- try {
2533
- const E = new es();
2534
- await i().initialize(E);
2535
- } catch {
2536
- }
3097
+ function Ai() {
3098
+ g(c).selectedText && (s()?.({ text: g(c).selectedText }), U());
2537
3099
  }
2538
- function h() {
2539
- m(a).visible = !1, m(a).text = "", m(a).range = null;
3100
+ function xi() {
3101
+ g(c).selectedText && (o()?.({ text: g(c).selectedText }), U());
2540
3102
  }
2541
- function d() {
2542
- if (!n() || !u) return;
2543
- const E = window.getSelection();
2544
- if (!E || E.rangeCount === 0) return h();
2545
- const Q = E.getRangeAt(0), Ee = E.toString().trim();
2546
- if (!Ee) return h();
2547
- const Ye = Q.getBoundingClientRect();
2548
- m(a).visible = !0, m(a).text = Ee, m(a).range = Q.cloneRange(), m(a).pos = { x: Ye.left + Ye.width / 2, y: Ye.top - 8 };
3103
+ function Ci() {
3104
+ g(c).selectedText && (l()?.({ text: g(c).selectedText }), U());
2549
3105
  }
2550
- function c(E) {
2551
- !m(a).range || !r() || (r().addAnnotation(m(a).range, E), h());
3106
+ async function Si() {
3107
+ if (!(!g(c).selectedRange || !i())) {
3108
+ C(p, !0);
3109
+ try {
3110
+ console.log("[AnnotationToolbar] Speaking range:", g(c).selectedRange.toString().substring(0, 50)), await i().speakRange(g(c).selectedRange), console.log("[AnnotationToolbar] TTS completed successfully");
3111
+ } catch (_) {
3112
+ console.error("[AnnotationToolbar] TTS error:", _), alert(`TTS failed: ${_ instanceof Error ? _.message : String(_)}`);
3113
+ } finally {
3114
+ C(p, !1);
3115
+ }
3116
+ }
2552
3117
  }
2553
- function v() {
2554
- r()?.clearAnnotations(), h();
3118
+ function er(_) {
3119
+ _.key === "Escape" && g(c).isVisible && (_.preventDefault(), U());
2555
3120
  }
2556
- async function g() {
2557
- m(a).text && (await f(), await i().speak(m(a).text));
3121
+ function Qt(_) {
3122
+ if (!g(c).isVisible || g(d)) return;
3123
+ const E = document.querySelector(".annotation-toolbar");
3124
+ E && !E.contains(_.target) && U();
2558
3125
  }
2559
- Vi(() => {
2560
- const E = () => d(), Q = () => d(), Ee = () => h();
2561
- return document.addEventListener("mouseup", E), document.addEventListener("keyup", Q), window.addEventListener("scroll", Ee, !0), () => {
2562
- document.removeEventListener("mouseup", E), document.removeEventListener("keyup", Q), window.removeEventListener("scroll", Ee, !0);
3126
+ Ds(() => {
3127
+ if (!u) return;
3128
+ const _ = setTimeout(
3129
+ () => {
3130
+ Be();
3131
+ },
3132
+ 2e3
3133
+ );
3134
+ return document.addEventListener("mouseup", L), document.addEventListener("click", Qt), document.addEventListener("touchend", L), document.addEventListener("touchstart", Qt), document.addEventListener("keydown", er), window.addEventListener("scroll", U, !0), () => {
3135
+ clearTimeout(_), document.removeEventListener("mouseup", L), document.removeEventListener("click", Qt), document.removeEventListener("touchend", L), document.removeEventListener("touchstart", Qt), document.removeEventListener("keydown", er), window.removeEventListener("scroll", U, !0);
2563
3136
  };
2564
3137
  });
2565
- var N = {
3138
+ var ki = {
2566
3139
  get enabled() {
2567
3140
  return n();
2568
3141
  },
2569
- set enabled(E = !0) {
2570
- n(E), Ue();
3142
+ set enabled(_ = !0) {
3143
+ n(_), et();
2571
3144
  },
2572
3145
  get highlightCoordinator() {
2573
3146
  return r();
2574
3147
  },
2575
- set highlightCoordinator(E = null) {
2576
- r(E), Ue();
3148
+ set highlightCoordinator(_ = null) {
3149
+ r(_), et();
2577
3150
  },
2578
3151
  get ttsService() {
2579
3152
  return i();
2580
3153
  },
2581
- set ttsService(E) {
2582
- i(E), Ue();
3154
+ set ttsService(_ = null) {
3155
+ i(_), et();
2583
3156
  },
2584
3157
  get ondictionarylookup() {
2585
3158
  return s();
2586
3159
  },
2587
- set ondictionarylookup(E) {
2588
- s(E), Ue();
3160
+ set ondictionarylookup(_) {
3161
+ s(_), et();
2589
3162
  },
2590
3163
  get ontranslationrequest() {
2591
3164
  return o();
2592
3165
  },
2593
- set ontranslationrequest(E) {
2594
- o(E), Ue();
3166
+ set ontranslationrequest(_) {
3167
+ o(_), et();
3168
+ },
3169
+ get onpicturedictionarylookup() {
3170
+ return l();
3171
+ },
3172
+ set onpicturedictionarylookup(_) {
3173
+ l(_), et();
2595
3174
  }
2596
- }, x = Mi(), St = wi(x);
3175
+ }, tr = So();
3176
+ io("g8qu62", (_) => {
3177
+ var E = mo();
3178
+ re(_, E);
3179
+ });
3180
+ var nr = Sn(tr);
2597
3181
  {
2598
- var at = (E) => {
2599
- var Q = ns(), Ee = bi(Q);
2600
- Ee.__click = () => c(Ke.YELLOW);
2601
- var Ye = Oe(Ee, 2);
2602
- Ye.__click = () => c(Ke.PINK);
2603
- var _n = Oe(Ye, 2);
2604
- _n.__click = () => c(Ke.BLUE);
2605
- var vn = Oe(_n, 2);
2606
- vn.__click = () => c(Ke.GREEN);
2607
- var pn = Oe(vn, 2);
2608
- pn.__click = g;
2609
- var gn = Oe(pn, 2);
2610
- gn.__click = () => s()?.({ text: m(a).text });
2611
- var bn = Oe(gn, 2);
2612
- bn.__click = () => o()?.({ text: m(a).text });
2613
- var Pr = Oe(bn, 2);
2614
- Pr.__click = v, Zr(Q), Ai(() => Ki(Q, `left:${m(a).pos.x}px; top:${m(a).pos.y}px; transform: translate(-50%, -100%);`)), nn(E, Q);
3182
+ var Ri = (_) => {
3183
+ var E = Co(), k = nn(E);
3184
+ to(k, 17, () => h, Zs, (N, M) => {
3185
+ var Q = bo();
3186
+ Q.__click = () => Jt(g(M).name);
3187
+ var Zt = nn(Q), An = nn(Zt, !0);
3188
+ en(Zt), en(Q), rn(() => {
3189
+ mr(Q, `background-color: ${g(M).hex ?? ""};`), br(Q, "aria-label", g(M).label), br(Q, "title", g(M).label), gr(An, g(M).label);
3190
+ }), re(N, Q);
3191
+ });
3192
+ var G = Ee(k, 2);
3193
+ G.__click = () => Jt(ze.UNDERLINE);
3194
+ var Qe = Ee(G, 2);
3195
+ {
3196
+ var It = (N) => {
3197
+ var M = wo(), Q = Ee(Sn(M), 2);
3198
+ Q.__click = Si, rn(() => Q.disabled = g(p)), re(N, M);
3199
+ };
3200
+ Ge(Qe, (N) => {
3201
+ i() && N(It);
3202
+ });
3203
+ }
3204
+ var pt = Ee(Qe, 2);
3205
+ {
3206
+ var Ni = (N) => {
3207
+ var M = yo();
3208
+ M.__click = Ai, re(N, M);
3209
+ };
3210
+ Ge(pt, (N) => {
3211
+ s() && N(Ni);
3212
+ });
3213
+ }
3214
+ var ir = Ee(pt, 2);
3215
+ {
3216
+ var Oi = (N) => {
3217
+ var M = $o();
3218
+ M.__click = Ci, re(N, M);
3219
+ };
3220
+ Ge(ir, (N) => {
3221
+ l() && N(Oi);
3222
+ });
3223
+ }
3224
+ var sr = Ee(ir, 2);
3225
+ {
3226
+ var Di = (N) => {
3227
+ var M = Eo();
3228
+ M.__click = xi, re(N, M);
3229
+ };
3230
+ Ge(sr, (N) => {
3231
+ o() && N(Di);
3232
+ });
3233
+ }
3234
+ var Mi = Ee(sr, 2);
3235
+ {
3236
+ var qi = (N) => {
3237
+ var M = xo(), Q = Ee(Sn(M), 2);
3238
+ {
3239
+ var Zt = (Ze) => {
3240
+ var Pt = To();
3241
+ Pt.__click = Ei, re(Ze, Pt);
3242
+ };
3243
+ Ge(Q, (Ze) => {
3244
+ g($e) && Ze(Zt);
3245
+ });
3246
+ }
3247
+ var An = Ee(Q, 2);
3248
+ {
3249
+ var Ii = (Ze) => {
3250
+ var Pt = Ao();
3251
+ Pt.__click = Ti, re(Ze, Pt);
3252
+ };
3253
+ Ge(An, (Ze) => {
3254
+ g(I) && Ze(Ii);
3255
+ });
3256
+ }
3257
+ re(N, M);
3258
+ };
3259
+ Ge(Mi, (N) => {
3260
+ (g($e) || g(I)) && N(qi);
3261
+ });
3262
+ }
3263
+ en(E), rn(() => mr(E, `left:${g(c).toolbarPosition.x}px; top:${g(c).toolbarPosition.y}px; transform: translate(-50%, -100%);`)), re(_, E);
2615
3264
  };
2616
- Hi(St, (E) => {
2617
- m(a).visible && E(at);
3265
+ Ge(nr, (_) => {
3266
+ g(c).isVisible && _(Ri);
2618
3267
  });
2619
3268
  }
2620
- return nn(e, x), Mn(N);
3269
+ var rr = Ee(nr, 2), Li = nn(rr, !0);
3270
+ return en(rr), rn(() => gr(Li, g(m))), re(e, tr), Mr(ki);
2621
3271
  }
2622
- Ii(["click"]);
2623
- customElements.define("pie-tool-annotation-toolbar", Qi(
2624
- rs,
3272
+ js(["click"]);
3273
+ customElements.define("pie-tool-annotation-toolbar", go(
3274
+ Ro,
2625
3275
  {
2626
3276
  enabled: { attribute: "enabled", type: "Boolean" },
2627
- highlightCoordinator: { attribute: "highlight-coordinator", type: "Object" },
2628
- ttsService: {},
3277
+ highlightCoordinator: { type: "Object" },
3278
+ ttsService: { type: "Object" },
2629
3279
  ondictionarylookup: {},
2630
- ontranslationrequest: {}
3280
+ ontranslationrequest: {},
3281
+ onpicturedictionarylookup: {}
2631
3282
  },
2632
3283
  [],
2633
3284
  []
2634
3285
  ));
2635
3286
  export {
2636
- rs as default
3287
+ Ro as default
2637
3288
  };
2638
3289
  //# sourceMappingURL=tool-annotation-toolbar.js.map