@pie-players/pie-tool-theme 0.3.51 → 0.3.52

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,13 +1,13 @@
1
1
  import { t as m } from "./defineProperty-Dt7ri80W.js";
2
- var Ic = Object.create, va = Object.defineProperty, Rc = Object.getOwnPropertyDescriptor, Lc = Object.getOwnPropertyNames, Pc = Object.getPrototypeOf, Nc = Object.prototype.hasOwnProperty, Bg = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), $c = (e, t, r, n) => {
2
+ var Rc = Object.create, va = Object.defineProperty, Lc = Object.getOwnPropertyDescriptor, Pc = Object.getOwnPropertyNames, Nc = Object.getPrototypeOf, $c = Object.prototype.hasOwnProperty, Bg = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), Dc = (e, t, r, n) => {
3
3
  if (t && typeof t == "object" || typeof t == "function")
4
- for (var i = Lc(t), o = 0, s = i.length, a; o < s; o++)
5
- a = i[o], !Nc.call(e, a) && a !== r && va(e, a, {
4
+ for (var i = Pc(t), o = 0, s = i.length, a; o < s; o++)
5
+ a = i[o], !$c.call(e, a) && a !== r && va(e, a, {
6
6
  get: ((l) => t[l]).bind(null, a),
7
- enumerable: !(n = Rc(t, a)) || n.enumerable
7
+ enumerable: !(n = Lc(t, a)) || n.enumerable
8
8
  });
9
9
  return e;
10
- }, Dc = (e, t, r) => (r = e != null ? Ic(Pc(e)) : {}, $c(t || !e || !e.__esModule ? va(r, "default", {
10
+ }, Wc = (e, t, r) => (r = e != null ? Rc(Nc(e)) : {}, Dc(t || !e || !e.__esModule ? va(r, "default", {
11
11
  value: e,
12
12
  enumerable: !0
13
13
  }) : r, e)), Ug = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, r) => (typeof require < "u" ? require : t)[r] }) : e)(function(e) {
@@ -19,9 +19,9 @@ if (typeof window < "u") {
19
19
  ((us = (fs = window).__svelte ?? (fs.__svelte = {})).v ?? (us.v = /* @__PURE__ */ new Set())).add("5");
20
20
  }
21
21
  var Cr = {}, re = /* @__PURE__ */ Symbol("uninitialized");
22
- var ba = Array.isArray, Wc = Array.prototype.indexOf, zn = Array.prototype.includes, ni = Array.from, Hn = Object.keys, Fn = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, zc = Object.getOwnPropertyDescriptors, Hc = Object.prototype, Fc = Array.prototype, ya = Object.getPrototypeOf, ds = Object.isExtensible, Bc = () => {
22
+ var ba = Array.isArray, Hc = Array.prototype.indexOf, Hn = Array.prototype.includes, ni = Array.from, zn = Object.keys, Fn = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, zc = Object.getOwnPropertyDescriptors, Fc = Object.prototype, Bc = Array.prototype, ya = Object.getPrototypeOf, ds = Object.isExtensible, Uc = () => {
23
23
  };
24
- function Uc(e) {
24
+ function jc(e) {
25
25
  for (var t = 0; t < e.length; t++) e[t]();
26
26
  }
27
27
  function _a() {
@@ -34,58 +34,58 @@ function _a() {
34
34
  reject: t
35
35
  };
36
36
  }
37
- var jg = 1 << 24, Pe = 1024, We = 2048, nr = 4096, ko = 8192, jc = 16384, Eo = 32768, hs = 1 << 25, Ao = 65536, qg = 1 << 17, Vg = 1 << 18, Pr = 1 << 19, qc = 1 << 20, tn = 1 << 25, cn = 65536, ps = 1 << 21, Vc = 1 << 22, Bn = 1 << 23, rn = /* @__PURE__ */ Symbol("$state"), Ta = /* @__PURE__ */ Symbol("legacy props"), Gc = /* @__PURE__ */ Symbol(""), Yc = /* @__PURE__ */ Symbol("proxy path"), Fi = /* @__PURE__ */ Symbol("attributes"), Bi = /* @__PURE__ */ Symbol("class"), Ui = /* @__PURE__ */ Symbol("style"), In = /* @__PURE__ */ Symbol("text");
37
+ var jg = 1 << 24, Pe = 1024, We = 2048, nr = 4096, ko = 8192, qc = 16384, Eo = 32768, hs = 1 << 25, Ao = 65536, qg = 1 << 17, Vg = 1 << 18, Pr = 1 << 19, Vc = 1 << 20, tn = 1 << 25, cn = 65536, ps = 1 << 21, Gc = 1 << 22, Bn = 1 << 23, rn = /* @__PURE__ */ Symbol("$state"), Ta = /* @__PURE__ */ Symbol("legacy props"), Yc = /* @__PURE__ */ Symbol(""), Kc = /* @__PURE__ */ Symbol("proxy path"), Fi = /* @__PURE__ */ Symbol("attributes"), Bi = /* @__PURE__ */ Symbol("class"), Ui = /* @__PURE__ */ Symbol("style"), In = /* @__PURE__ */ Symbol("text");
38
38
  var ii = new class extends Error {
39
39
  constructor(...t) {
40
40
  super(...t), m(this, "name", "StaleReactionError"), m(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
41
41
  }
42
- }(), Kc = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
43
- function Xc(e) {
42
+ }(), Xc = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
43
+ function Jc(e) {
44
44
  throw new Error("https://svelte.dev/e/lifecycle_outside_component");
45
45
  }
46
- function Jc() {
46
+ function Qc() {
47
47
  throw new Error("https://svelte.dev/e/async_derived_orphan");
48
48
  }
49
- function Qc(e, t, r) {
49
+ function Zc(e, t, r) {
50
50
  throw new Error("https://svelte.dev/e/each_key_duplicate");
51
51
  }
52
- function Zc(e) {
52
+ function eu(e) {
53
53
  throw new Error("https://svelte.dev/e/effect_in_teardown");
54
54
  }
55
- function eu() {
55
+ function tu() {
56
56
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
57
57
  }
58
- function tu(e) {
58
+ function ru(e) {
59
59
  throw new Error("https://svelte.dev/e/effect_orphan");
60
60
  }
61
- function ru() {
61
+ function nu() {
62
62
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
63
63
  }
64
- function nu() {
64
+ function iu() {
65
65
  throw new Error("https://svelte.dev/e/hydration_failed");
66
66
  }
67
- function iu(e) {
67
+ function ou(e) {
68
68
  throw new Error("https://svelte.dev/e/props_invalid_value");
69
69
  }
70
- function ou() {
70
+ function su() {
71
71
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
72
72
  }
73
- function su() {
73
+ function au() {
74
74
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
75
75
  }
76
- function au() {
76
+ function lu() {
77
77
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
78
78
  }
79
- function lu() {
79
+ function cu() {
80
80
  throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
81
81
  }
82
- function cu() {
82
+ function uu() {
83
83
  console.warn("https://svelte.dev/e/derived_inert");
84
84
  }
85
85
  function oi(e) {
86
86
  console.warn("https://svelte.dev/e/hydration_mismatch");
87
87
  }
88
- function uu() {
88
+ function fu() {
89
89
  console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
90
90
  }
91
91
  var W = !1;
@@ -108,7 +108,7 @@ function ce(e) {
108
108
  D = e;
109
109
  }
110
110
  }
111
- function wa(e = 1) {
111
+ function Sa(e = 1) {
112
112
  if (W) {
113
113
  for (var t = e, r = D; t--; ) r = /* @__PURE__ */ tt(r);
114
114
  D = r;
@@ -127,7 +127,7 @@ function Un(e = !0) {
127
127
  e && r.remove(), r = i;
128
128
  }
129
129
  }
130
- function Sa(e) {
130
+ function wa(e) {
131
131
  if (!e || e.nodeType !== 8)
132
132
  throw oi(), Cr;
133
133
  return e.data;
@@ -135,18 +135,18 @@ function Sa(e) {
135
135
  function ka(e) {
136
136
  return e === this.v;
137
137
  }
138
- function fu(e, t) {
138
+ function du(e, t) {
139
139
  return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
140
140
  }
141
141
  function Ea(e) {
142
- return !fu(e, this.v);
142
+ return !du(e, this.v);
143
143
  }
144
144
  var gt = !1, un = !1;
145
145
  function gs(e, t) {
146
- return e.label = t, du(e.v, t), e;
146
+ return e.label = t, hu(e.v, t), e;
147
147
  }
148
- function du(e, t) {
149
- return e?.[Yc]?.(t), e;
148
+ function hu(e, t) {
149
+ return e?.[Kc]?.(t), e;
150
150
  }
151
151
  var q = null;
152
152
  function Mr(e) {
@@ -179,22 +179,22 @@ function xa(e) {
179
179
  function fn() {
180
180
  return !un || q !== null && q.l === null;
181
181
  }
182
- var Ht = [];
182
+ var zt = [];
183
183
  function Ca() {
184
- var e = Ht;
185
- Ht = [], Uc(e);
184
+ var e = zt;
185
+ zt = [], jc(e);
186
186
  }
187
187
  function Qt(e) {
188
- if (Ht.length === 0 && !nn) {
189
- var t = Ht;
188
+ if (zt.length === 0 && !nn) {
189
+ var t = zt;
190
190
  queueMicrotask(() => {
191
- t === Ht && Ca();
191
+ t === zt && Ca();
192
192
  });
193
193
  }
194
- Ht.push(e);
194
+ zt.push(e);
195
195
  }
196
- function hu() {
197
- for (; Ht.length > 0; ) Ca();
196
+ function pu() {
197
+ for (; zt.length > 0; ) Ca();
198
198
  }
199
199
  function Ma(e) {
200
200
  var t = O;
@@ -219,9 +219,9 @@ function Rt(e, t) {
219
219
  }
220
220
  throw e;
221
221
  }
222
- var pu = ~(We | nr | Pe);
222
+ var gu = ~(We | nr | Pe);
223
223
  function G(e, t) {
224
- e.f = e.f & pu | t;
224
+ e.f = e.f & gu | t;
225
225
  }
226
226
  function xo(e) {
227
227
  (e.f & 512) !== 0 || e.deps === null ? G(e, Pe) : G(e, nr);
@@ -234,13 +234,13 @@ function Oa(e) {
234
234
  function Ia(e, t, r) {
235
235
  (e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && r.add(e), Oa(e.deps), G(e, Pe);
236
236
  }
237
- var gu = !1, wn = !1;
238
- function mu(e) {
239
- var t = wn;
237
+ var mu = !1, Sn = !1;
238
+ function vu(e) {
239
+ var t = Sn;
240
240
  try {
241
- return wn = !1, [e(), wn];
241
+ return Sn = !1, [e(), Sn];
242
242
  } finally {
243
- wn = t;
243
+ Sn = t;
244
244
  }
245
245
  }
246
246
  function Ra(e, t) {
@@ -263,9 +263,9 @@ function p(e, t) {
263
263
  return e.get(L(e, t));
264
264
  }
265
265
  var La, jn = null, yr = null, P = null, ji = null, pe = null, qi = null, nn = !1, yi = !1, Or = null, qn = null, Pa = 0;
266
- var vu = 1, Vn = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), Sn = /* @__PURE__ */ new WeakMap(), _r = /* @__PURE__ */ new WeakMap(), zt = /* @__PURE__ */ new WeakMap(), Yr = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), Vi = /* @__PURE__ */ new WeakMap(), Zt = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), Rn = /* @__PURE__ */ new WeakMap(), Kr = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakSet(), ir = class Na {
266
+ var bu = 1, Vn = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakMap(), Gn = /* @__PURE__ */ new WeakMap(), wn = /* @__PURE__ */ new WeakMap(), _r = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), Yr = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), Vi = /* @__PURE__ */ new WeakMap(), Zt = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), Rn = /* @__PURE__ */ new WeakMap(), Kr = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakSet(), ir = class Na {
267
267
  constructor() {
268
- Co(this, K), m(this, "id", vu++), M(this, Vn, !1), m(this, "linked", !0), M(this, qt, null), M(this, Ft, null), m(this, "async_deriveds", /* @__PURE__ */ new Map()), m(this, "current", /* @__PURE__ */ new Map()), m(this, "previous", /* @__PURE__ */ new Map()), M(this, Gn, /* @__PURE__ */ new Set()), M(this, Sn, /* @__PURE__ */ new Set()), M(this, _r, 0), M(this, zt, /* @__PURE__ */ new Map()), M(this, Yr, null), M(this, Oe, []), M(this, Vi, []), M(this, Zt, /* @__PURE__ */ new Set()), M(this, ht, /* @__PURE__ */ new Set()), M(this, It, /* @__PURE__ */ new Map()), M(this, Rn, /* @__PURE__ */ new Set()), m(this, "is_fork", !1), M(this, Kr, !1), yr === null ? jn = yr = this : (C(Ft, yr, this), C(qt, this, yr)), yr = this;
268
+ Co(this, K), m(this, "id", bu++), M(this, Vn, !1), m(this, "linked", !0), M(this, qt, null), M(this, Ft, null), m(this, "async_deriveds", /* @__PURE__ */ new Map()), m(this, "current", /* @__PURE__ */ new Map()), m(this, "previous", /* @__PURE__ */ new Map()), M(this, Gn, /* @__PURE__ */ new Set()), M(this, wn, /* @__PURE__ */ new Set()), M(this, _r, 0), M(this, Ht, /* @__PURE__ */ new Map()), M(this, Yr, null), M(this, Oe, []), M(this, Vi, []), M(this, Zt, /* @__PURE__ */ new Set()), M(this, ht, /* @__PURE__ */ new Set()), M(this, It, /* @__PURE__ */ new Map()), M(this, Rn, /* @__PURE__ */ new Set()), m(this, "is_fork", !1), M(this, Kr, !1), yr === null ? jn = yr = this : (C(Ft, yr, this), C(qt, this, yr)), yr = this;
269
269
  }
270
270
  skip_effect(t) {
271
271
  p(It, this).has(t) || p(It, this).set(t, {
@@ -301,22 +301,22 @@ var vu = 1, Vn = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap
301
301
  }
302
302
  }
303
303
  discard() {
304
- for (const t of p(Sn, this)) t(this);
305
- p(Sn, this).clear(), L(K, this, Kn).call(this), p(Yr, this)?.resolve();
304
+ for (const t of p(wn, this)) t(this);
305
+ p(wn, this).clear(), L(K, this, Kn).call(this), p(Yr, this)?.resolve();
306
306
  }
307
307
  register_created_effect(t) {
308
308
  p(Vi, this).push(t);
309
309
  }
310
310
  increment(t, r) {
311
311
  if (C(_r, this, p(_r, this) + 1), t) {
312
- let n = p(zt, this).get(r) ?? 0;
313
- p(zt, this).set(r, n + 1);
312
+ let n = p(Ht, this).get(r) ?? 0;
313
+ p(Ht, this).set(r, n + 1);
314
314
  }
315
315
  }
316
316
  decrement(t, r) {
317
317
  if (C(_r, this, p(_r, this) - 1), t) {
318
- let n = p(zt, this).get(r) ?? 0;
319
- n === 1 ? p(zt, this).delete(r) : p(zt, this).set(r, n - 1);
318
+ let n = p(Ht, this).get(r) ?? 0;
319
+ n === 1 ? p(Ht, this).delete(r) : p(Ht, this).set(r, n - 1);
320
320
  }
321
321
  p(Kr, this) || (C(Kr, this, !0), Qt(() => {
322
322
  C(Kr, this, !1), this.linked && this.flush();
@@ -331,7 +331,7 @@ var vu = 1, Vn = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap
331
331
  p(Gn, this).add(t);
332
332
  }
333
333
  ondiscard(t) {
334
- p(Sn, this).add(t);
334
+ p(wn, this).add(t);
335
335
  }
336
336
  settled() {
337
337
  return (p(Yr, this) ?? C(Yr, this, _a())).promise;
@@ -374,7 +374,7 @@ var vu = 1, Vn = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap
374
374
  for (var r = t; r.parent !== null; ) {
375
375
  r = r.parent;
376
376
  var n = r.f;
377
- if (Or !== null && r === O && (gt || ($ === null || ($.f & 2) === 0) && !gu))
377
+ if (Or !== null && r === O && (gt || ($ === null || ($.f & 2) === 0) && !mu))
378
378
  return;
379
379
  if ((n & 96) !== 0) {
380
380
  if ((n & 1024) === 0) return;
@@ -387,7 +387,7 @@ var vu = 1, Vn = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap
387
387
  La = ir;
388
388
  function ms() {
389
389
  if (this.is_fork) return !0;
390
- for (const r of p(zt, this).keys()) {
390
+ for (const r of p(Ht, this).keys()) {
391
391
  for (var e = r, t = !1; e.parent !== null; ) {
392
392
  if (p(It, this).has(e)) {
393
393
  t = !0;
@@ -400,7 +400,7 @@ function ms() {
400
400
  return !1;
401
401
  }
402
402
  function Yn() {
403
- C(Vn, this, !0), Pa++ > 1e3 && (L(K, this, Kn).call(this), Tu());
403
+ C(Vn, this, !0), Pa++ > 1e3 && (L(K, this, Kn).call(this), Su());
404
404
  for (const a of p(Zt, this))
405
405
  p(ht, this).delete(a), G(a, We), this.schedule(a);
406
406
  for (const a of p(ht, this))
@@ -411,7 +411,7 @@ function Yn() {
411
411
  for (const a of e) try {
412
412
  L(K, this, $a).call(this, a, t, r);
413
413
  } catch (l) {
414
- throw za(a), L(K, this, ms).call(this) || this.discard(), l;
414
+ throw Ha(a), L(K, this, ms).call(this) || this.discard(), l;
415
415
  }
416
416
  if (P = null, n.length > 0) {
417
417
  var i = La.ensure();
@@ -423,16 +423,16 @@ function Yn() {
423
423
  n.length > 0 && L(K, P, Yn).call(P);
424
424
  return;
425
425
  }
426
- const o = L(K, this, bu).call(this);
426
+ const o = L(K, this, yu).call(this);
427
427
  if (o) {
428
- L(K, this, Xr).call(this, r), L(K, this, Xr).call(this, t), L(K, o, yu).call(o, this);
428
+ L(K, this, Xr).call(this, r), L(K, this, Xr).call(this, t), L(K, o, _u).call(o, this);
429
429
  return;
430
430
  }
431
431
  p(Zt, this).clear(), p(ht, this).clear();
432
432
  for (const a of p(Gn, this)) a(this);
433
433
  p(Gn, this).clear(), ji = this, vs(r), vs(t), ji = null, p(Yr, this)?.resolve();
434
434
  var s = P;
435
- if (p(_r, this) === 0 && (p(Oe, this).length === 0 || s !== null) && (L(K, this, Kn).call(this), gt && (L(K, this, _u).call(this), P = s)), p(Oe, this).length > 0) if (s !== null) {
435
+ if (p(_r, this) === 0 && (p(Oe, this).length === 0 || s !== null) && (L(K, this, Kn).call(this), gt && (L(K, this, Tu).call(this), P = s)), p(Oe, this).length > 0) if (s !== null) {
436
436
  const a = s;
437
437
  p(Oe, a).push(...p(Oe, this).filter((l) => !p(Oe, a).includes(l)));
438
438
  } else s = this;
@@ -460,7 +460,7 @@ function $a(e, t, r) {
460
460
  }
461
461
  }
462
462
  }
463
- function bu() {
463
+ function yu() {
464
464
  for (var e = p(qt, this); e !== null; ) {
465
465
  if (!e.is_fork) {
466
466
  for (const [t, [, r]] of this.current) if (e.current.has(t) && !r) return e;
@@ -469,7 +469,7 @@ function bu() {
469
469
  }
470
470
  return null;
471
471
  }
472
- function yu(e) {
472
+ function _u(e) {
473
473
  for (const [r, n] of e.current)
474
474
  !this.previous.has(r) && e.previous.has(r) && this.previous.set(r, e.previous.get(r)), this.current.set(r, n);
475
475
  for (const [r, n] of e.async_deriveds) {
@@ -495,7 +495,7 @@ function yu(e) {
495
495
  function Xr(e) {
496
496
  for (var t = 0; t < e.length; t += 1) Ia(e[t], p(Zt, this), p(ht, this));
497
497
  }
498
- function _u() {
498
+ function Tu() {
499
499
  for (let c = jn; c !== null; c = p(Ft, c)) {
500
500
  var e = c.id < this.id, t = [];
501
501
  for (const [u, [f, h]] of this.current) {
@@ -550,21 +550,21 @@ function Jr(e) {
550
550
  try {
551
551
  var r;
552
552
  for (e && (P !== null && !P.is_fork && P.flush(), r = e()); ; ) {
553
- if (hu(), P === null) return r;
553
+ if (pu(), P === null) return r;
554
554
  P.flush();
555
555
  }
556
556
  } finally {
557
557
  nn = t;
558
558
  }
559
559
  }
560
- function Tu() {
560
+ function Su() {
561
561
  if (0) {
562
562
  var e;
563
563
  for (const r of P.current.keys()) for (const [n, i] of r.updated ?? [])
564
564
  var t;
565
565
  }
566
566
  try {
567
- ru();
567
+ nu();
568
568
  } catch (r) {
569
569
  Rt(r, qi);
570
570
  }
@@ -605,7 +605,7 @@ function Mo(e, t, r) {
605
605
  const n = r.get(e);
606
606
  if (n !== void 0) return n;
607
607
  if (e.deps !== null) for (const i of e.deps) {
608
- if (zn.call(t, i)) return !0;
608
+ if (Hn.call(t, i)) return !0;
609
609
  if ((i.f & 2) !== 0 && Mo(i, t, r))
610
610
  return r.set(i, !0), !0;
611
611
  }
@@ -621,26 +621,26 @@ function Wa(e, t) {
621
621
  Wa(r, t), r = r.next;
622
622
  }
623
623
  }
624
- function za(e) {
624
+ function Ha(e) {
625
625
  G(e, Pe);
626
626
  for (var t = e.first; t !== null; )
627
- za(t), t = t.next;
627
+ Ha(t), t = t.next;
628
628
  }
629
629
  function wu(e) {
630
630
  let t = 0, r = er(0), n;
631
631
  return () => {
632
- $o() && (S(r), Do(() => (t === 0 && (n = ai(() => e(() => on(r)))), t += 1, () => {
632
+ $o() && (w(r), Do(() => (t === 0 && (n = ai(() => e(() => on(r)))), t += 1, () => {
633
633
  Qt(() => {
634
634
  t -= 1, t === 0 && (n?.(), n = void 0, on(r));
635
635
  });
636
636
  })));
637
637
  };
638
638
  }
639
- var Su = Ao | Pr;
640
- function ku(e, t, r, n) {
641
- new Eu(e, t, r, n);
639
+ var ku = Ao | Pr;
640
+ function Eu(e, t, r, n) {
641
+ new Au(e, t, r, n);
642
642
  }
643
- var je = /* @__PURE__ */ new WeakMap(), Gi = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), sn = /* @__PURE__ */ new WeakMap(), Ie = /* @__PURE__ */ new WeakMap(), Ze = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), Vt = /* @__PURE__ */ new WeakMap(), Tr = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakMap(), kn = /* @__PURE__ */ new WeakMap(), Yi = /* @__PURE__ */ new WeakMap(), Ki = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakMap(), bs = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakSet(), Eu = class {
643
+ var je = /* @__PURE__ */ new WeakMap(), Gi = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), sn = /* @__PURE__ */ new WeakMap(), Ie = /* @__PURE__ */ new WeakMap(), Ze = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), Vt = /* @__PURE__ */ new WeakMap(), Tr = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakMap(), kn = /* @__PURE__ */ new WeakMap(), Yi = /* @__PURE__ */ new WeakMap(), Ki = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakMap(), bs = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakSet(), Au = class {
644
644
  constructor(e, t, r, n) {
645
645
  Co(this, ue), m(this, "parent", void 0), m(this, "is_pending", !1), m(this, "transform_error", void 0), M(this, je, void 0), M(this, Gi, W ? D : null), M(this, Qe, void 0), M(this, sn, void 0), M(this, Ie, void 0), M(this, Ze, null), M(this, Ee, null), M(this, Be, null), M(this, Vt, null), M(this, Tr, 0), M(this, Gt, 0), M(this, kn, !1), M(this, Yi, /* @__PURE__ */ new Set()), M(this, Ki, /* @__PURE__ */ new Set()), M(this, Dt, null), M(this, bs, wu(() => (C(Dt, this, er(p(Tr, this))), () => {
646
646
  C(Dt, this, null);
@@ -654,10 +654,10 @@ var je = /* @__PURE__ */ new WeakMap(), Gi = /* @__PURE__ */ new WeakMap(), Qe =
654
654
  const o = i.data === "[!";
655
655
  if (i.data.startsWith("[?")) {
656
656
  const s = JSON.parse(i.data.slice(2));
657
- L(ue, this, xu).call(this, s);
658
- } else o ? L(ue, this, Cu).call(this) : L(ue, this, Au).call(this);
659
- } else L(ue, this, Ha).call(this);
660
- }, Su)), W && C(je, this, D);
657
+ L(ue, this, Cu).call(this, s);
658
+ } else o ? L(ue, this, Mu).call(this) : L(ue, this, xu).call(this);
659
+ } else L(ue, this, za).call(this);
660
+ }, ku)), W && C(je, this, D);
661
661
  }
662
662
  defer_effect(e) {
663
663
  Ia(e, p(Yi, this), p(Ki, this));
@@ -674,7 +674,7 @@ var je = /* @__PURE__ */ new WeakMap(), Gi = /* @__PURE__ */ new WeakMap(), Qe =
674
674
  }));
675
675
  }
676
676
  get_effect_pending() {
677
- return p(bs, this).call(this), S(p(Dt, this));
677
+ return p(bs, this).call(this), w(p(Dt, this));
678
678
  }
679
679
  error(e) {
680
680
  if (!p(Qe, this).onerror && !p(Qe, this).failed) throw e;
@@ -683,21 +683,21 @@ var je = /* @__PURE__ */ new WeakMap(), Gi = /* @__PURE__ */ new WeakMap(), Qe =
683
683
  })) : L(ue, this, ys).call(this, e);
684
684
  }
685
685
  };
686
- function Au() {
686
+ function xu() {
687
687
  try {
688
688
  C(Ze, this, Ne(() => p(sn, this).call(this, p(je, this))));
689
689
  } catch (e) {
690
690
  this.error(e);
691
691
  }
692
692
  }
693
- function xu(e) {
693
+ function Cu(e) {
694
694
  const t = p(Qe, this).failed;
695
695
  t && C(Be, this, Ne(() => {
696
696
  t(p(je, this), () => e, () => () => {
697
697
  });
698
698
  }));
699
699
  }
700
- function Cu() {
700
+ function Mu() {
701
701
  const e = p(Qe, this).pending;
702
702
  e && (this.is_pending = !0, C(Ee, this, Ne(() => e(p(je, this)))), Qt(() => {
703
703
  var t = C(Vt, this, document.createDocumentFragment()), r = Le();
@@ -706,13 +706,13 @@ function Cu() {
706
706
  }), L(ue, this, Io).call(this, P));
707
707
  }));
708
708
  }
709
- function Ha() {
709
+ function za() {
710
710
  try {
711
711
  if (this.is_pending = this.has_pending_snippet(), C(Gt, this, 0), C(Tr, this, 0), C(Ze, this, Ne(() => {
712
712
  p(sn, this).call(this, p(je, this));
713
713
  })), p(Gt, this) > 0) {
714
714
  var e = C(Vt, this, document.createDocumentFragment());
715
- Ho(p(Ze, this), e);
715
+ zo(p(Ze, this), e);
716
716
  const t = p(Qe, this).pending;
717
717
  C(Ee, this, Ne(() => t(p(je, this))));
718
718
  } else L(ue, this, Io).call(this, P);
@@ -747,19 +747,19 @@ function Fa(e, t) {
747
747
  }), p(Vt, this) && (p(je, this).before(p(Vt, this)), C(Vt, this, null)));
748
748
  }
749
749
  function ys(e) {
750
- p(Ze, this) && (ge(p(Ze, this)), C(Ze, this, null)), p(Ee, this) && (ge(p(Ee, this)), C(Ee, this, null)), p(Be, this) && (ge(p(Be, this)), C(Be, this, null)), W && (Te(p(Gi, this)), wa(), Te(Un()));
750
+ p(Ze, this) && (ge(p(Ze, this)), C(Ze, this, null)), p(Ee, this) && (ge(p(Ee, this)), C(Ee, this, null)), p(Be, this) && (ge(p(Be, this)), C(Be, this, null)), W && (Te(p(Gi, this)), Sa(), Te(Un()));
751
751
  var t = p(Qe, this).onerror;
752
752
  let r = p(Qe, this).failed;
753
753
  var n = !1, i = !1;
754
754
  const o = () => {
755
755
  if (n) {
756
- uu();
756
+ fu();
757
757
  return;
758
758
  }
759
- n = !0, i && lu(), p(Be, this) !== null && or(p(Be, this), () => {
759
+ n = !0, i && cu(), p(Be, this) !== null && or(p(Be, this), () => {
760
760
  C(Be, this, null);
761
761
  }), L(ue, this, Xi).call(this, () => {
762
- L(ue, this, Ha).call(this);
762
+ L(ue, this, za).call(this);
763
763
  });
764
764
  }, s = (a) => {
765
765
  try {
@@ -789,14 +789,14 @@ function ys(e) {
789
789
  a !== null && typeof a == "object" && typeof a.then == "function" ? a.then(s, (l) => Rt(l, p(Ie, this) && p(Ie, this).parent)) : s(a);
790
790
  });
791
791
  }
792
- function Mu(e, t, r, n) {
792
+ function Ou(e, t, r, n) {
793
793
  const i = fn() ? an : Ro;
794
794
  var o = e.filter((h) => !h.settled);
795
795
  if (r.length === 0 && o.length === 0) {
796
796
  n(t.map(i));
797
797
  return;
798
798
  }
799
- var s = O, a = Ou(), l = o.length === 1 ? o[0].promise : o.length > 1 ? Promise.all(o.map((h) => h.promise)) : null;
799
+ var s = O, a = Iu(), l = o.length === 1 ? o[0].promise : o.length > 1 ? Promise.all(o.map((h) => h.promise)) : null;
800
800
  function c(h) {
801
801
  if ((s.f & 16384) === 0) {
802
802
  a();
@@ -814,13 +814,13 @@ function Mu(e, t, r, n) {
814
814
  return;
815
815
  }
816
816
  function f() {
817
- Promise.all(r.map((h) => /* @__PURE__ */ Iu(h))).then((h) => c([...t.map(i), ...h])).catch((h) => Rt(h, s)).finally(u);
817
+ Promise.all(r.map((h) => /* @__PURE__ */ Ru(h))).then((h) => c([...t.map(i), ...h])).catch((h) => Rt(h, s)).finally(u);
818
818
  }
819
819
  l ? l.then(() => {
820
820
  a(), f(), Xn();
821
821
  }) : f();
822
822
  }
823
- function Ou() {
823
+ function Iu() {
824
824
  var e = O, t = $, r = q, n = P;
825
825
  if (0) var i;
826
826
  return function(s = !0) {
@@ -856,11 +856,11 @@ function an(e) {
856
856
  }
857
857
  var En = /* @__PURE__ */ Symbol("obsolete");
858
858
  // @__NO_SIDE_EFFECTS__
859
- function Iu(e, t, r) {
859
+ function Ru(e, t, r) {
860
860
  let n = O;
861
- n === null && Jc();
861
+ n === null && Qc();
862
862
  var i = void 0, o = er(re), s = !$, a = /* @__PURE__ */ new Set();
863
- return ju(() => {
863
+ return qu(() => {
864
864
  var l = O, c = _a();
865
865
  i = c.promise;
866
866
  try {
@@ -881,7 +881,7 @@ function Iu(e, t, r) {
881
881
  f?.(), a.delete(c), v !== En && (u.activate(), v ? (o.f |= Bn, Ir(o, v)) : ((o.f & 8388608) !== 0 && (o.f ^= Bn), Ir(o, g)), u.deactivate());
882
882
  };
883
883
  c.promise.then(h, (g) => h(null, g || "unknown"));
884
- }), Fu(() => {
884
+ }), Bu(() => {
885
885
  for (const l of a) l.reject(En);
886
886
  }), new Promise((l) => {
887
887
  function c(u) {
@@ -903,7 +903,7 @@ function Ro(e) {
903
903
  const t = /* @__PURE__ */ an(e);
904
904
  return t.equals = Ea, t;
905
905
  }
906
- function Ru(e) {
906
+ function Lu(e) {
907
907
  var t = e.effects;
908
908
  if (t !== null) {
909
909
  e.effects = null;
@@ -913,10 +913,10 @@ function Ru(e) {
913
913
  function Lo(e) {
914
914
  var t, r = O, n = e.parent;
915
915
  if (!mt && n !== null && e.v !== re && (n.f & 24576) !== 0)
916
- return cu(), e.v;
916
+ return uu(), e.v;
917
917
  et(n);
918
918
  try {
919
- e.f &= ~cn, Ru(e), t = ul(e);
919
+ e.f &= ~cn, Lu(e), t = ul(e);
920
920
  } finally {
921
921
  et(r);
922
922
  }
@@ -930,9 +930,9 @@ function Ua(e) {
930
930
  }
931
931
  mt || (pe !== null ? ($o() || P?.is_fork) && pe.set(e, t) : xo(e));
932
932
  }
933
- function Lu(e) {
933
+ function Pu(e) {
934
934
  if (e.effects !== null)
935
- for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(ii), t.fn !== null && (t.teardown = Bc), t.ac = null, ln(t, 0), zo(t));
935
+ for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(ii), t.fn !== null && (t.teardown = Uc), t.ac = null, ln(t, 0), Ho(t));
936
936
  }
937
937
  function ja(e) {
938
938
  if (e.effects !== null)
@@ -966,7 +966,7 @@ function Va(e, t = !1, r = !0) {
966
966
  return n;
967
967
  }
968
968
  function oe(e, t, r = !1) {
969
- $ !== null && (!Ue || ($.f & 131072) !== 0) && fn() && ($.f & 4325394) !== 0 && (qe === null || !qe.has(e)) && au();
969
+ $ !== null && (!Ue || ($.f & 131072) !== 0) && fn() && ($.f & 4325394) !== 0 && (qe === null || !qe.has(e)) && lu();
970
970
  let n = r ? Er(t) : t;
971
971
  return Ir(e, n, qn);
972
972
  }
@@ -978,11 +978,11 @@ function Ir(e, t, r = null) {
978
978
  const i = e;
979
979
  (e.f & 2048) !== 0 && Lo(i), pe === null && xo(i);
980
980
  }
981
- e.wv = ll(), Ga(e, We, r), fn() && O !== null && (O.f & 1024) !== 0 && (O.f & 96) === 0 && (Me === null ? Yu([e]) : Me.push(e)), !n.is_fork && Jn.size > 0 && !qa && Pu();
981
+ e.wv = ll(), Ga(e, We, r), fn() && O !== null && (O.f & 1024) !== 0 && (O.f & 96) === 0 && (Me === null ? Ku([e]) : Me.push(e)), !n.is_fork && Jn.size > 0 && !qa && Nu();
982
982
  }
983
983
  return t;
984
984
  }
985
- function Pu() {
985
+ function Nu() {
986
986
  qa = !1;
987
987
  for (const e of Jn) {
988
988
  (e.f & 1024) !== 0 && G(e, nr);
@@ -1017,17 +1017,17 @@ function Ga(e, t, r) {
1017
1017
  }
1018
1018
  }
1019
1019
  }
1020
- var Nu = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
1020
+ var $u = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
1021
1021
  function Er(e) {
1022
1022
  if (typeof e != "object" || e === null || rn in e) return e;
1023
1023
  const t = ya(e);
1024
- if (t !== Hc && t !== Fc) return e;
1024
+ if (t !== Fc && t !== Bc) return e;
1025
1025
  var r = /* @__PURE__ */ new Map(), n = ba(e), i = /* @__PURE__ */ ke(0), o = null, s = Kt, a = (f) => {
1026
1026
  if (Kt === s) return f();
1027
1027
  var h = $, g = Kt;
1028
- $e(null), Ss(s);
1028
+ $e(null), ws(s);
1029
1029
  var v = f();
1030
- return $e(h), Ss(g), v;
1030
+ return $e(h), ws(g), v;
1031
1031
  };
1032
1032
  n && r.set("length", /* @__PURE__ */ ke(e.length, o));
1033
1033
  var l = "";
@@ -1035,13 +1035,13 @@ function Er(e) {
1035
1035
  function u(f) {
1036
1036
  if (!c) {
1037
1037
  c = !0, l = f, gs(i, `${l} version`);
1038
- for (const [h, g] of r) gs(g, $u(l, h));
1038
+ for (const [h, g] of r) gs(g, Du(l, h));
1039
1039
  c = !1;
1040
1040
  }
1041
1041
  }
1042
1042
  return new Proxy(e, {
1043
1043
  defineProperty(f, h, g) {
1044
- (!("value" in g) || g.configurable === !1 || g.enumerable === !1 || g.writable === !1) && ou();
1044
+ (!("value" in g) || g.configurable === !1 || g.enumerable === !1 || g.writable === !1) && su();
1045
1045
  var v = r.get(h);
1046
1046
  return v === void 0 ? a(() => {
1047
1047
  var _ = /* @__PURE__ */ ke(g.value, o);
@@ -1066,7 +1066,7 @@ function Er(e) {
1066
1066
  var T = /* @__PURE__ */ ke(Er(_ ? f[h] : re), o);
1067
1067
  return T;
1068
1068
  }), r.set(h, v)), v !== void 0) {
1069
- var b = S(v);
1069
+ var b = w(v);
1070
1070
  return b === re ? void 0 : b;
1071
1071
  }
1072
1072
  return Reflect.get(f, h, g);
@@ -1075,7 +1075,7 @@ function Er(e) {
1075
1075
  var g = Reflect.getOwnPropertyDescriptor(f, h);
1076
1076
  if (g && "value" in g) {
1077
1077
  var v = r.get(h);
1078
- v && (g.value = S(v));
1078
+ v && (g.value = w(v));
1079
1079
  } else if (g === void 0) {
1080
1080
  var _ = r.get(h), b = _?.v;
1081
1081
  if (_ !== void 0 && b !== re) return {
@@ -1093,7 +1093,7 @@ function Er(e) {
1093
1093
  return (g !== void 0 || O !== null && (!v || jt(f, h)?.writable)) && (g === void 0 && (g = a(() => {
1094
1094
  var _ = /* @__PURE__ */ ke(v ? Er(f[h]) : re, o);
1095
1095
  return _;
1096
- }), r.set(h, g)), S(g) === re) ? !1 : v;
1096
+ }), r.set(h, g)), w(g) === re) ? !1 : v;
1097
1097
  },
1098
1098
  set(f, h, g, v) {
1099
1099
  var _ = r.get(h), b = h in f;
@@ -1108,8 +1108,8 @@ function Er(e) {
1108
1108
  var N = a(() => Er(g));
1109
1109
  oe(_, N);
1110
1110
  }
1111
- var w = Reflect.getOwnPropertyDescriptor(f, h);
1112
- if (w?.set && w.set.call(v, g), !b) {
1111
+ var S = Reflect.getOwnPropertyDescriptor(f, h);
1112
+ if (S?.set && S.set.call(v, g), !b) {
1113
1113
  if (n && typeof h == "string") {
1114
1114
  var F = r.get("length"), B = Number(h);
1115
1115
  Number.isInteger(B) && B >= F.v && oe(F, B + 1);
@@ -1119,7 +1119,7 @@ function Er(e) {
1119
1119
  return !0;
1120
1120
  },
1121
1121
  ownKeys(f) {
1122
- S(i);
1122
+ w(i);
1123
1123
  var h = Reflect.ownKeys(f).filter((_) => {
1124
1124
  var b = r.get(_);
1125
1125
  return b === void 0 || b.v !== re;
@@ -1128,17 +1128,17 @@ function Er(e) {
1128
1128
  return h;
1129
1129
  },
1130
1130
  setPrototypeOf() {
1131
- su();
1131
+ au();
1132
1132
  }
1133
1133
  });
1134
1134
  }
1135
- function $u(e, t) {
1136
- return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : Nu.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
1135
+ function Du(e, t) {
1136
+ return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : $u.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
1137
1137
  }
1138
- var _s, Du, Ya, Ka, Xa;
1138
+ var _s, Wu, Ya, Ka, Xa;
1139
1139
  function Ji() {
1140
1140
  if (_s === void 0) {
1141
- _s = window, Du = document, Ya = /Firefox/.test(navigator.userAgent);
1141
+ _s = window, Wu = document, Ya = /Firefox/.test(navigator.userAgent);
1142
1142
  var e = Element.prototype, t = Node.prototype, r = Text.prototype;
1143
1143
  Ka = jt(t, "firstChild").get, Xa = jt(t, "nextSibling").get, ds(e) && (e[Bi] = void 0, e[Fi] = null, e[Ui] = void 0, e.__e = void 0), ds(r) && (r[In] = void 0);
1144
1144
  }
@@ -1164,7 +1164,7 @@ function fe(e, t) {
1164
1164
  }
1165
1165
  return t && No(r), Te(r), r;
1166
1166
  }
1167
- function Wu(e, t = !1) {
1167
+ function Hu(e, t = !1) {
1168
1168
  if (!W) {
1169
1169
  var r = /* @__PURE__ */ Re(e);
1170
1170
  return r instanceof Comment && r.data === "" ? /* @__PURE__ */ tt(r) : r;
@@ -1217,9 +1217,9 @@ function Za(e) {
1217
1217
  }
1218
1218
  }
1219
1219
  function zu(e) {
1220
- O === null && ($ === null && tu(e), eu()), mt && Zc(e);
1220
+ O === null && ($ === null && ru(e), tu()), mt && eu(e);
1221
1221
  }
1222
- function Hu(e, t) {
1222
+ function Fu(e, t) {
1223
1223
  var r = t.last;
1224
1224
  r === null ? t.last = t.first = e : (r.next = e, e.prev = r, t.last = e);
1225
1225
  }
@@ -1253,7 +1253,7 @@ function rt(e, t) {
1253
1253
  }
1254
1254
  i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && (i.f & 524288) === 0 && (i = i.first, (e & 16) !== 0 && (e & 65536) !== 0 && i !== null && (i.f |= Ao));
1255
1255
  }
1256
- if (i !== null && (i.parent = r, r !== null && Hu(i, r), $ !== null && ($.f & 2) !== 0 && (e & 64) === 0)) {
1256
+ if (i !== null && (i.parent = r, r !== null && Fu(i, r), $ !== null && ($.f & 2) !== 0 && (e & 64) === 0)) {
1257
1257
  var o = $;
1258
1258
  (o.effects ?? (o.effects = [])).push(i);
1259
1259
  }
@@ -1262,11 +1262,11 @@ function rt(e, t) {
1262
1262
  function $o() {
1263
1263
  return $ !== null && !Ue;
1264
1264
  }
1265
- function Fu(e) {
1265
+ function Bu(e) {
1266
1266
  const t = rt(8, null);
1267
1267
  return G(t, Pe), t.teardown = e, t;
1268
1268
  }
1269
- function wr(e) {
1269
+ function Sr(e) {
1270
1270
  zu("$effect");
1271
1271
  var t = O.f;
1272
1272
  if (!$ && (t & 32) !== 0 && q !== null && !q.i) {
@@ -1275,16 +1275,16 @@ function wr(e) {
1275
1275
  } else return el(e);
1276
1276
  }
1277
1277
  function el(e) {
1278
- return rt(4 | qc, e);
1278
+ return rt(4 | Vc, e);
1279
1279
  }
1280
- function Bu(e) {
1280
+ function Uu(e) {
1281
1281
  ir.ensure();
1282
1282
  const t = rt(64 | Pr, e);
1283
1283
  return () => {
1284
1284
  ge(t);
1285
1285
  };
1286
1286
  }
1287
- function Uu(e) {
1287
+ function ju(e) {
1288
1288
  ir.ensure();
1289
1289
  const t = rt(64 | Pr, e);
1290
1290
  return (r = {}) => new Promise((n) => {
@@ -1296,15 +1296,15 @@ function Uu(e) {
1296
1296
  function tl(e) {
1297
1297
  return rt(4, e);
1298
1298
  }
1299
- function ju(e) {
1300
- return rt(Vc | Pr, e);
1299
+ function qu(e) {
1300
+ return rt(Gc | Pr, e);
1301
1301
  }
1302
1302
  function Do(e, t = 0) {
1303
1303
  return rt(8 | t, e);
1304
1304
  }
1305
1305
  function Ts(e, t = [], r = [], n = []) {
1306
- Mu(n, t, r, (i) => {
1307
- rt(8, () => e(...i.map(S)));
1306
+ Ou(n, t, r, (i) => {
1307
+ rt(8, () => e(...i.map(w)));
1308
1308
  });
1309
1309
  }
1310
1310
  function Wo(e, t = 0) {
@@ -1318,15 +1318,15 @@ function rl(e) {
1318
1318
  var t = e.teardown;
1319
1319
  if (t !== null) {
1320
1320
  const r = mt, n = $;
1321
- ws(!0), $e(null);
1321
+ Ss(!0), $e(null);
1322
1322
  try {
1323
1323
  t.call(null);
1324
1324
  } finally {
1325
- ws(r), $e(n);
1325
+ Ss(r), $e(n);
1326
1326
  }
1327
1327
  }
1328
1328
  }
1329
- function zo(e, t = !1) {
1329
+ function Ho(e, t = !1) {
1330
1330
  var r = e.first;
1331
1331
  for (e.first = e.last = null; r !== null; ) {
1332
1332
  const i = r.ac;
@@ -1337,7 +1337,7 @@ function zo(e, t = !1) {
1337
1337
  (r.f & 64) !== 0 ? r.parent = null : ge(r, t), r = n;
1338
1338
  }
1339
1339
  }
1340
- function qu(e) {
1340
+ function Vu(e) {
1341
1341
  for (var t = e.first; t !== null; ) {
1342
1342
  var r = t.next;
1343
1343
  (t.f & 32) === 0 && ge(t), t = r;
@@ -1345,14 +1345,14 @@ function qu(e) {
1345
1345
  }
1346
1346
  function ge(e, t = !0) {
1347
1347
  var r = !1;
1348
- (t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (Vu(e.nodes.start, e.nodes.end), r = !0), G(e, hs), zo(e, t && !r), ln(e, 0);
1348
+ (t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (Gu(e.nodes.start, e.nodes.end), r = !0), G(e, hs), Ho(e, t && !r), ln(e, 0);
1349
1349
  var n = e.nodes && e.nodes.t;
1350
1350
  if (n !== null) for (const o of n) o.stop();
1351
- rl(e), e.f ^= hs, e.f |= jc;
1351
+ rl(e), e.f ^= hs, e.f |= qc;
1352
1352
  var i = e.parent;
1353
1353
  i !== null && i.first !== null && nl(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
1354
1354
  }
1355
- function Vu(e, t) {
1355
+ function Gu(e, t) {
1356
1356
  for (; e !== null; ) {
1357
1357
  var r = e === t ? null : /* @__PURE__ */ tt(e);
1358
1358
  e.remove(), e = r;
@@ -1404,15 +1404,15 @@ function ol(e, t) {
1404
1404
  for (const s of o) (s.is_global || t) && s.in();
1405
1405
  }
1406
1406
  }
1407
- function Ho(e, t) {
1407
+ function zo(e, t) {
1408
1408
  if (e.nodes)
1409
1409
  for (var r = e.nodes.start, n = e.nodes.end; r !== null; ) {
1410
1410
  var i = r === n ? null : /* @__PURE__ */ tt(r);
1411
1411
  t.append(r), r = i;
1412
1412
  }
1413
1413
  }
1414
- var Gu = null, Ln = !1, mt = !1;
1415
- function ws(e) {
1414
+ var Yu = null, Ln = !1, mt = !1;
1415
+ function Ss(e) {
1416
1416
  mt = e;
1417
1417
  }
1418
1418
  var $ = null, Ue = !1;
@@ -1427,12 +1427,12 @@ var qe = null;
1427
1427
  function sl(e) {
1428
1428
  $ !== null && (!gt || ($.f & 2) !== 0) && (qe ?? (qe = /* @__PURE__ */ new Set())).add(e);
1429
1429
  }
1430
- var _e = null, Se = 0, Me = null;
1431
- function Yu(e) {
1430
+ var _e = null, we = 0, Me = null;
1431
+ function Ku(e) {
1432
1432
  Me = e;
1433
1433
  }
1434
1434
  var al = 1, Bt = 0, Kt = Bt;
1435
- function Ss(e) {
1435
+ function ws(e) {
1436
1436
  Kt = e;
1437
1437
  }
1438
1438
  function ll() {
@@ -1459,8 +1459,8 @@ function cl(e, t, r = !0) {
1459
1459
  }
1460
1460
  }
1461
1461
  function ul(e) {
1462
- var t = _e, r = Se, n = Me, i = $, o = qe, s = q, a = Ue, l = Kt, c = e.f;
1463
- _e = null, Se = 0, Me = null, $ = (c & 96) === 0 ? e : null, qe = null, Mr(e.ctx), Ue = !1, Kt = ++Bt, e.ac !== null && (Za(() => {
1462
+ var t = _e, r = we, n = Me, i = $, o = qe, s = q, a = Ue, l = Kt, c = e.f;
1463
+ _e = null, we = 0, Me = null, $ = (c & 96) === 0 ? e : null, qe = null, Mr(e.ctx), Ue = !1, Kt = ++Bt, e.ac !== null && (Za(() => {
1464
1464
  e.ac.abort(ii);
1465
1465
  }), e.ac = null);
1466
1466
  try {
@@ -1470,14 +1470,14 @@ function ul(e) {
1470
1470
  var h = e.deps, g = P?.is_fork;
1471
1471
  if (_e !== null) {
1472
1472
  var v;
1473
- if (g || ln(e, Se), h !== null && Se > 0)
1474
- for (h.length = Se + _e.length, v = 0; v < _e.length; v++) h[Se + v] = _e[v];
1473
+ if (g || ln(e, we), h !== null && we > 0)
1474
+ for (h.length = we + _e.length, v = 0; v < _e.length; v++) h[we + v] = _e[v];
1475
1475
  else e.deps = h = _e;
1476
- if ($o() && (e.f & 512) !== 0) for (v = Se; v < h.length; v++) {
1476
+ if ($o() && (e.f & 512) !== 0) for (v = we; v < h.length; v++) {
1477
1477
  var _;
1478
1478
  ((_ = h[v]).reactions ?? (_.reactions = [])).push(e);
1479
1479
  }
1480
- } else !g && h !== null && Se < h.length && (ln(e, Se), h.length = Se);
1480
+ } else !g && h !== null && we < h.length && (ln(e, we), h.length = we);
1481
1481
  if (fn() && Me !== null && !Ue && h !== null && (e.f & 6146) === 0) for (v = 0; v < Me.length; v++) cl(Me[v], e);
1482
1482
  if (i !== null && i !== e) {
1483
1483
  if (Bt++, i.deps !== null) for (let b = 0; b < r; b += 1) i.deps[b].rv = Bt;
@@ -1488,27 +1488,27 @@ function ul(e) {
1488
1488
  } catch (b) {
1489
1489
  return Ma(b);
1490
1490
  } finally {
1491
- e.f ^= ps, _e = t, Se = r, Me = n, $ = i, qe = o, Mr(s), Ue = a, Kt = l;
1491
+ e.f ^= ps, _e = t, we = r, Me = n, $ = i, qe = o, Mr(s), Ue = a, Kt = l;
1492
1492
  }
1493
1493
  }
1494
- function Ku(e, t) {
1494
+ function Xu(e, t) {
1495
1495
  let r = t.reactions;
1496
1496
  if (r !== null) {
1497
- var n = Wc.call(r, e);
1497
+ var n = Hc.call(r, e);
1498
1498
  if (n !== -1) {
1499
1499
  var i = r.length - 1;
1500
1500
  i === 0 ? r = t.reactions = null : (r[n] = r[i], r.pop());
1501
1501
  }
1502
1502
  }
1503
- if (r === null && (t.f & 2) !== 0 && (_e === null || !zn.call(_e, t))) {
1503
+ if (r === null && (t.f & 2) !== 0 && (_e === null || !Hn.call(_e, t))) {
1504
1504
  var o = t;
1505
- (o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~cn), o.v !== re && xo(o), Lu(o), ln(o, 0);
1505
+ (o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~cn), o.v !== re && xo(o), Pu(o), ln(o, 0);
1506
1506
  }
1507
1507
  }
1508
1508
  function ln(e, t) {
1509
1509
  var r = e.deps;
1510
1510
  if (r !== null)
1511
- for (var n = t; n < r.length; n++) Ku(e, r[n]);
1511
+ for (var n = t; n < r.length; n++) Xu(e, r[n]);
1512
1512
  }
1513
1513
  function Rr(e) {
1514
1514
  var t = e.f;
@@ -1518,7 +1518,7 @@ function Rr(e) {
1518
1518
  if (O = e, Ln = !0, 0)
1519
1519
  var i, o;
1520
1520
  try {
1521
- (t & 16777232) !== 0 ? qu(e) : zo(e), rl(e);
1521
+ (t & 16777232) !== 0 ? Vu(e) : Ho(e), rl(e);
1522
1522
  var s = ul(e);
1523
1523
  if (e.teardown = typeof s == "function" ? s : null, e.wv = al, 0)
1524
1524
  for (var a of e.deps) ;
@@ -1527,17 +1527,17 @@ function Rr(e) {
1527
1527
  }
1528
1528
  }
1529
1529
  }
1530
- function S(e) {
1530
+ function w(e) {
1531
1531
  var t = (e.f & 2) !== 0;
1532
- if (Gu?.add(e), $ !== null && !Ue && !(O !== null && (O.f & 16384) !== 0) && (qe === null || !qe.has(e))) {
1532
+ if (Yu?.add(e), $ !== null && !Ue && !(O !== null && (O.f & 16384) !== 0) && (qe === null || !qe.has(e))) {
1533
1533
  var r = $.deps;
1534
1534
  if (($.f & 2097152) !== 0)
1535
- e.rv < Bt && (e.rv = Bt, _e === null && r !== null && r[Se] === e ? Se++ : _e === null ? _e = [e] : _e.push(e));
1535
+ e.rv < Bt && (e.rv = Bt, _e === null && r !== null && r[we] === e ? we++ : _e === null ? _e = [e] : _e.push(e));
1536
1536
  else {
1537
1537
  var n;
1538
- (n = $).deps ?? (n.deps = []), zn.call($.deps, e) || $.deps.push(e);
1538
+ (n = $).deps ?? (n.deps = []), Hn.call($.deps, e) || $.deps.push(e);
1539
1539
  var i = e.reactions;
1540
- i === null ? e.reactions = [$] : zn.call(i, $) || i.push($);
1540
+ i === null ? e.reactions = [$] : Hn.call(i, $) || i.push($);
1541
1541
  }
1542
1542
  }
1543
1543
  if (0) {
@@ -1586,7 +1586,7 @@ var Ar = /* @__PURE__ */ Symbol("events"), hl = /* @__PURE__ */ new Set(), Qi =
1586
1586
  function Ti(e, t, r) {
1587
1587
  (t[Ar] ?? (t[Ar] = {}))[e] = r;
1588
1588
  }
1589
- function Xu(e) {
1589
+ function Ju(e) {
1590
1590
  for (var t = 0; t < e.length; t++) hl.add(e[t]);
1591
1591
  for (var r of Qi) r(e);
1592
1592
  }
@@ -1636,13 +1636,13 @@ function Es(e) {
1636
1636
  }
1637
1637
  }
1638
1638
  }
1639
- var Ju = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
1640
- function Qu(e) {
1641
- return Ju?.createHTML(e) ?? e;
1639
+ var Qu = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
1640
+ function Zu(e) {
1641
+ return Qu?.createHTML(e) ?? e;
1642
1642
  }
1643
1643
  function pl(e) {
1644
1644
  var t = Po("template");
1645
- return t.innerHTML = Qu(e.replaceAll("<!>", "<!---->")), t.content;
1645
+ return t.innerHTML = Zu(e.replaceAll("<!>", "<!---->")), t.content;
1646
1646
  }
1647
1647
  function pt(e, t) {
1648
1648
  var r = O;
@@ -1669,7 +1669,7 @@ function Fo(e, t) {
1669
1669
  };
1670
1670
  }
1671
1671
  // @__NO_SIDE_EFFECTS__
1672
- function Zu(e, t, r = "svg") {
1672
+ function ef(e, t, r = "svg") {
1673
1673
  var n = !e.startsWith("<!>"), i = (t & 1) !== 0, o = `<${r}>${n ? e : "<!>" + e}</${r}>`, s;
1674
1674
  return () => {
1675
1675
  if (W)
@@ -1689,16 +1689,16 @@ function Zu(e, t, r = "svg") {
1689
1689
  };
1690
1690
  }
1691
1691
  // @__NO_SIDE_EFFECTS__
1692
- function ef(e, t) {
1693
- return /* @__PURE__ */ Zu(e, t, "svg");
1692
+ function tf(e, t) {
1693
+ return /* @__PURE__ */ ef(e, t, "svg");
1694
1694
  }
1695
- function tf() {
1695
+ function rf() {
1696
1696
  if (W)
1697
1697
  return pt(D, null), D;
1698
1698
  var e = document.createDocumentFragment(), t = document.createComment(""), r = Le();
1699
1699
  return e.append(t, r), pt(t, r), e;
1700
1700
  }
1701
- function Sr(e, t) {
1701
+ function wr(e, t) {
1702
1702
  if (W) {
1703
1703
  var r = O;
1704
1704
  ((r.f & 32768) === 0 || r.nodes.end === null) && (r.nodes.end = D), si();
@@ -1706,7 +1706,7 @@ function Sr(e, t) {
1706
1706
  }
1707
1707
  e !== null && e.before(t);
1708
1708
  }
1709
- var rf = [
1709
+ var nf = [
1710
1710
  "allowfullscreen",
1711
1711
  "async",
1712
1712
  "autofocus",
@@ -1736,7 +1736,7 @@ var rf = [
1736
1736
  "disablepictureinpicture",
1737
1737
  "disableremoteplayback"
1738
1738
  ], Yg = [
1739
- ...rf,
1739
+ ...nf,
1740
1740
  "formNoValidate",
1741
1741
  "isMap",
1742
1742
  "noModule",
@@ -1751,17 +1751,17 @@ var rf = [
1751
1751
  "allowFullscreen",
1752
1752
  "disablePictureInPicture",
1753
1753
  "disableRemotePlayback"
1754
- ], nf = ["touchstart", "touchmove"];
1755
- function of(e) {
1756
- return nf.includes(e);
1754
+ ], of = ["touchstart", "touchmove"];
1755
+ function sf(e) {
1756
+ return of.includes(e);
1757
1757
  }
1758
- var sf = [
1758
+ var af = [
1759
1759
  "$state",
1760
1760
  "$state.raw",
1761
1761
  "$derived",
1762
1762
  "$derived.by"
1763
1763
  ], Kg = [
1764
- ...sf,
1764
+ ...af,
1765
1765
  "$state.eager",
1766
1766
  "$state.snapshot",
1767
1767
  "$props",
@@ -1784,7 +1784,7 @@ function An(e, t) {
1784
1784
  function gl(e, t) {
1785
1785
  return ml(e, t);
1786
1786
  }
1787
- function af(e, t) {
1787
+ function lf(e, t) {
1788
1788
  Ji(), t.intro = t.intro ?? !1;
1789
1789
  const r = t.target, n = W, i = D;
1790
1790
  try {
@@ -1799,7 +1799,7 @@ function af(e, t) {
1799
1799
  } catch (s) {
1800
1800
  if (s instanceof Error && s.message.split(`
1801
1801
  `).some((a) => a.startsWith("https://svelte.dev/e/"))) throw s;
1802
- return s !== Cr && console.warn("Failed to hydrate: ", s), t.recover === !1 && nu(), Ji(), Ja(r), dt(!1), gl(e, t);
1802
+ return s !== Cr && console.warn("Failed to hydrate: ", s), t.recover === !1 && iu(), Ji(), Ja(r), dt(!1), gl(e, t);
1803
1803
  } finally {
1804
1804
  dt(n), Te(i);
1805
1805
  }
@@ -1807,9 +1807,9 @@ function af(e, t) {
1807
1807
  var xn = /* @__PURE__ */ new Map();
1808
1808
  function ml(e, { target: t, anchor: r, props: n = {}, events: i, context: o, intro: s = !0, transformError: a }) {
1809
1809
  Ji();
1810
- var l = void 0, c = Uu(() => {
1810
+ var l = void 0, c = ju(() => {
1811
1811
  var u = r ?? t.appendChild(Le());
1812
- ku(u, { pending: () => {
1812
+ Eu(u, { pending: () => {
1813
1813
  } }, (g) => {
1814
1814
  Aa({});
1815
1815
  var v = q;
@@ -1822,7 +1822,7 @@ function ml(e, { target: t, anchor: r, props: n = {}, events: i, context: o, int
1822
1822
  var _ = g[v];
1823
1823
  if (!f.has(_)) {
1824
1824
  f.add(_);
1825
- var b = of(_);
1825
+ var b = sf(_);
1826
1826
  for (const N of [t, document]) {
1827
1827
  var T = xn.get(N);
1828
1828
  T === void 0 && (T = /* @__PURE__ */ new Map(), xn.set(N, T));
@@ -1843,71 +1843,71 @@ function ml(e, { target: t, anchor: r, props: n = {}, events: i, context: o, int
1843
1843
  return Zi.set(l, c), l;
1844
1844
  }
1845
1845
  var Zi = /* @__PURE__ */ new WeakMap();
1846
- function lf(e, t) {
1846
+ function cf(e, t) {
1847
1847
  const r = Zi.get(e);
1848
1848
  return r ? (Zi.delete(e), r(t)) : Promise.resolve();
1849
1849
  }
1850
- var ut = /* @__PURE__ */ new WeakMap(), xt = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), Hr = /* @__PURE__ */ new WeakMap(), wi = /* @__PURE__ */ new WeakMap(), Si = /* @__PURE__ */ new WeakMap(), xs = /* @__PURE__ */ new WeakMap(), cf = class {
1850
+ var ut = /* @__PURE__ */ new WeakMap(), xt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap(), zr = /* @__PURE__ */ new WeakMap(), Si = /* @__PURE__ */ new WeakMap(), wi = /* @__PURE__ */ new WeakMap(), xs = /* @__PURE__ */ new WeakMap(), uf = class {
1851
1851
  constructor(e, t = !0) {
1852
- m(this, "anchor", void 0), M(this, ut, /* @__PURE__ */ new Map()), M(this, xt, /* @__PURE__ */ new Map()), M(this, He, /* @__PURE__ */ new Map()), M(this, Hr, /* @__PURE__ */ new Set()), M(this, wi, !0), M(this, Si, (r) => {
1852
+ m(this, "anchor", void 0), M(this, ut, /* @__PURE__ */ new Map()), M(this, xt, /* @__PURE__ */ new Map()), M(this, ze, /* @__PURE__ */ new Map()), M(this, zr, /* @__PURE__ */ new Set()), M(this, Si, !0), M(this, wi, (r) => {
1853
1853
  if (p(ut, this).has(r)) {
1854
1854
  var n = p(ut, this).get(r), i = p(xt, this).get(n);
1855
1855
  if (i)
1856
- Qn(i), p(Hr, this).delete(n);
1856
+ Qn(i), p(zr, this).delete(n);
1857
1857
  else {
1858
- var o = p(He, this).get(n);
1859
- o && (Qn(o.effect), p(xt, this).set(n, o.effect), p(He, this).delete(n), o.fragment.lastChild.remove(), this.anchor.before(o.fragment), i = o.effect);
1858
+ var o = p(ze, this).get(n);
1859
+ o && (Qn(o.effect), p(xt, this).set(n, o.effect), p(ze, this).delete(n), o.fragment.lastChild.remove(), this.anchor.before(o.fragment), i = o.effect);
1860
1860
  }
1861
1861
  for (const [s, a] of p(ut, this)) {
1862
1862
  if (p(ut, this).delete(s), s === r) break;
1863
- const l = p(He, this).get(a);
1864
- l && (ge(l.effect), p(He, this).delete(a));
1863
+ const l = p(ze, this).get(a);
1864
+ l && (ge(l.effect), p(ze, this).delete(a));
1865
1865
  }
1866
1866
  for (const [s, a] of p(xt, this)) {
1867
- if (s === n || p(Hr, this).has(s)) continue;
1867
+ if (s === n || p(zr, this).has(s)) continue;
1868
1868
  const l = () => {
1869
1869
  if (Array.from(p(ut, this).values()).includes(s)) {
1870
1870
  var c = document.createDocumentFragment();
1871
- Ho(a, c), c.append(Le()), p(He, this).set(s, {
1871
+ zo(a, c), c.append(Le()), p(ze, this).set(s, {
1872
1872
  effect: a,
1873
1873
  fragment: c
1874
1874
  });
1875
1875
  } else ge(a);
1876
- p(Hr, this).delete(s), p(xt, this).delete(s);
1876
+ p(zr, this).delete(s), p(xt, this).delete(s);
1877
1877
  };
1878
- p(wi, this) || !i ? (p(Hr, this).add(s), or(a, l, !1)) : l();
1878
+ p(Si, this) || !i ? (p(zr, this).add(s), or(a, l, !1)) : l();
1879
1879
  }
1880
1880
  }
1881
1881
  }), M(this, xs, (r) => {
1882
1882
  p(ut, this).delete(r);
1883
1883
  const n = Array.from(p(ut, this).values());
1884
- for (const [i, o] of p(He, this)) n.includes(i) || (ge(o.effect), p(He, this).delete(i));
1885
- }), this.anchor = e, C(wi, this, t);
1884
+ for (const [i, o] of p(ze, this)) n.includes(i) || (ge(o.effect), p(ze, this).delete(i));
1885
+ }), this.anchor = e, C(Si, this, t);
1886
1886
  }
1887
1887
  ensure(e, t) {
1888
1888
  var r = P, n = Qa();
1889
- if (t && !p(xt, this).has(e) && !p(He, this).has(e)) if (n) {
1889
+ if (t && !p(xt, this).has(e) && !p(ze, this).has(e)) if (n) {
1890
1890
  var i = document.createDocumentFragment(), o = Le();
1891
- i.append(o), p(He, this).set(e, {
1891
+ i.append(o), p(ze, this).set(e, {
1892
1892
  effect: Ne(() => t(o)),
1893
1893
  fragment: i
1894
1894
  });
1895
1895
  } else p(xt, this).set(e, Ne(() => t(this.anchor)));
1896
1896
  if (p(ut, this).set(r, e), n) {
1897
1897
  for (const [s, a] of p(xt, this)) s === e ? r.unskip_effect(a) : r.skip_effect(a);
1898
- for (const [s, a] of p(He, this)) s === e ? r.unskip_effect(a.effect) : r.skip_effect(a.effect);
1899
- r.oncommit(p(Si, this)), r.ondiscard(p(xs, this));
1898
+ for (const [s, a] of p(ze, this)) s === e ? r.unskip_effect(a.effect) : r.skip_effect(a.effect);
1899
+ r.oncommit(p(wi, this)), r.ondiscard(p(xs, this));
1900
1900
  } else
1901
- W && (this.anchor = D), p(Si, this).call(this, r);
1901
+ W && (this.anchor = D), p(wi, this).call(this, r);
1902
1902
  }
1903
1903
  };
1904
- function uf(e) {
1905
- q === null && Xc("onMount"), un && q.l !== null ? ff(q).m.push(e) : wr(() => {
1904
+ function ff(e) {
1905
+ q === null && Jc("onMount"), un && q.l !== null ? df(q).m.push(e) : Sr(() => {
1906
1906
  const t = ai(e);
1907
1907
  if (typeof t == "function") return t;
1908
1908
  });
1909
1909
  }
1910
- function ff(e) {
1910
+ function df(e) {
1911
1911
  var t = e.l;
1912
1912
  return t.u ?? (t.u = {
1913
1913
  a: [],
@@ -1918,10 +1918,10 @@ function ff(e) {
1918
1918
  function ki(e, t, r = !1) {
1919
1919
  var n;
1920
1920
  W && (n = D, si());
1921
- var i = new cf(e), o = r ? Ao : 0;
1921
+ var i = new uf(e), o = r ? Ao : 0;
1922
1922
  function s(a, l) {
1923
1923
  if (W) {
1924
- var c = Sa(n);
1924
+ var c = wa(n);
1925
1925
  if (a !== parseInt(c.substring(1))) {
1926
1926
  var u = Un();
1927
1927
  Te(u), i.anchor = u, dt(!1), i.ensure(a, l), dt(!0);
@@ -1937,7 +1937,7 @@ function ki(e, t, r = !1) {
1937
1937
  }), a || s(-1, null);
1938
1938
  }, o);
1939
1939
  }
1940
- function df(e, t, r) {
1940
+ function hf(e, t, r) {
1941
1941
  for (var n = [], i = t.length, o, s = t.length, a = 0; a < i; a++) {
1942
1942
  let f = t[a];
1943
1943
  or(f, () => {
@@ -1970,11 +1970,11 @@ function eo(e, t, r = !0) {
1970
1970
  }
1971
1971
  for (var i = 0; i < t.length; i++) {
1972
1972
  var o = t[i];
1973
- n?.has(o) ? (o.f |= tn, Ho(o, document.createDocumentFragment())) : ge(t[i], r);
1973
+ n?.has(o) ? (o.f |= tn, zo(o, document.createDocumentFragment())) : ge(t[i], r);
1974
1974
  }
1975
1975
  }
1976
1976
  var Cn;
1977
- function hf(e, t, r, n, i, o = null) {
1977
+ function pf(e, t, r, n, i, o = null) {
1978
1978
  var s = e, a = /* @__PURE__ */ new Map();
1979
1979
  if ((t & 4) !== 0) {
1980
1980
  var l = e;
@@ -1986,7 +1986,7 @@ function hf(e, t, r, n, i, o = null) {
1986
1986
  return ba(T) ? T : T == null ? [] : ni(T);
1987
1987
  }), f, h = /* @__PURE__ */ new Map(), g = !0;
1988
1988
  function v(T) {
1989
- (b.effect.f & 16384) === 0 && (b.pending.delete(T), b.fallback = c, pf(b, f, s, t, n), c !== null && (f.length === 0 ? (c.f & 33554432) === 0 ? Qn(c) : (c.f ^= tn, Qr(c, null, s)) : or(c, () => {
1989
+ (b.effect.f & 16384) === 0 && (b.pending.delete(T), b.fallback = c, gf(b, f, s, t, n), c !== null && (f.length === 0 ? (c.f & 33554432) === 0 ? Qn(c) : (c.f ^= tn, Qr(c, null, s)) : or(c, () => {
1990
1990
  c = null;
1991
1991
  })));
1992
1992
  }
@@ -1995,24 +1995,24 @@ function hf(e, t, r, n, i, o = null) {
1995
1995
  }
1996
1996
  var b = {
1997
1997
  effect: Wo(() => {
1998
- f = S(u);
1998
+ f = w(u);
1999
1999
  var T = f.length;
2000
2000
  let I = !1;
2001
- W && Sa(s) === "[!" != (T === 0) && (s = Un(), Te(s), dt(!1), I = !0);
2002
- for (var N = /* @__PURE__ */ new Set(), w = P, F = Qa(), B = 0; B < T; B += 1) {
2001
+ W && wa(s) === "[!" != (T === 0) && (s = Un(), Te(s), dt(!1), I = !0);
2002
+ for (var N = /* @__PURE__ */ new Set(), S = P, F = Qa(), B = 0; B < T; B += 1) {
2003
2003
  W && D.nodeType === 8 && D.data === "]" && (s = D, I = !0, dt(!1));
2004
2004
  var se = f[B], ee = n(se, B);
2005
2005
  if (0)
2006
2006
  var it;
2007
2007
  var J = g ? null : a.get(ee);
2008
- J ? (J.v && Ir(J.v, se), J.i && Ir(J.i, B), F && w.unskip_effect(J.e)) : (J = gf(a, g ? s : Cn ?? (Cn = Le()), se, ee, B, i, t, r), g || (J.e.f |= tn), a.set(ee, J)), N.add(ee);
2008
+ J ? (J.v && Ir(J.v, se), J.i && Ir(J.i, B), F && S.unskip_effect(J.e)) : (J = mf(a, g ? s : Cn ?? (Cn = Le()), se, ee, B, i, t, r), g || (J.e.f |= tn), a.set(ee, J)), N.add(ee);
2009
2009
  }
2010
- if (T === 0 && o && !c && (g ? c = Ne(() => o(s)) : (c = Ne(() => o(Cn ?? (Cn = Le()))), c.f |= tn)), T > N.size && Qc("", "", ""), W && T > 0 && Te(Un()), !g)
2011
- if (h.set(w, N), F) {
2012
- for (const [Q, St] of a) N.has(Q) || w.skip_effect(St.e);
2013
- w.oncommit(v), w.ondiscard(_);
2014
- } else v(w);
2015
- I && dt(!0), S(u);
2010
+ if (T === 0 && o && !c && (g ? c = Ne(() => o(s)) : (c = Ne(() => o(Cn ?? (Cn = Le()))), c.f |= tn)), T > N.size && Zc("", "", ""), W && T > 0 && Te(Un()), !g)
2011
+ if (h.set(S, N), F) {
2012
+ for (const [Q, wt] of a) N.has(Q) || S.skip_effect(wt.e);
2013
+ S.oncommit(v), S.ondiscard(_);
2014
+ } else v(S);
2015
+ I && dt(!0), w(u);
2016
2016
  }),
2017
2017
  flags: t,
2018
2018
  items: a,
@@ -2026,7 +2026,7 @@ function Fr(e) {
2026
2026
  for (; e !== null && (e.f & 32) === 0; ) e = e.next;
2027
2027
  return e;
2028
2028
  }
2029
- function pf(e, t, r, n, i) {
2029
+ function gf(e, t, r, n, i) {
2030
2030
  var o = (n & 8) !== 0, s = t.length, a = e.items, l = Fr(e.effect.first), c, u = null, f, h = [], g = [], v, _, b, T;
2031
2031
  if (o) for (T = 0; T < s; T += 1)
2032
2032
  v = t[T], _ = i(v, T), b = a.get(_).e, (b.f & 33554432) === 0 && (b.nodes?.a?.measure(), (f ?? (f = /* @__PURE__ */ new Set())).add(b));
@@ -2043,11 +2043,11 @@ function pf(e, t, r, n, i) {
2043
2043
  if (b !== l) {
2044
2044
  if (c !== void 0 && c.has(b)) {
2045
2045
  if (h.length < g.length) {
2046
- var N = g[0], w;
2046
+ var N = g[0], S;
2047
2047
  u = N.prev;
2048
2048
  var F = h[0], B = h[h.length - 1];
2049
- for (w = 0; w < h.length; w += 1) Qr(h[w], N, r);
2050
- for (w = 0; w < g.length; w += 1) c.delete(g[w]);
2049
+ for (S = 0; S < h.length; S += 1) Qr(h[S], N, r);
2050
+ for (S = 0; S < g.length; S += 1) c.delete(g[S]);
2051
2051
  Ct(e, F.prev, B.next), Ct(e, u, F), Ct(e, B, N), l = N, u = B, T -= 1, h = [], g = [];
2052
2052
  } else
2053
2053
  c.delete(b), Qr(b, l, r), Ct(e, b.prev, b.next), Ct(e, b, u === null ? e.effect.first : u.next), Ct(e, u, b), u = b;
@@ -2076,7 +2076,7 @@ function pf(e, t, r, n, i) {
2076
2076
  for (T = 0; T < ee; T += 1) se[T].nodes?.a?.measure();
2077
2077
  for (T = 0; T < ee; T += 1) se[T].nodes?.a?.fix();
2078
2078
  }
2079
- df(e, se, it);
2079
+ hf(e, se, it);
2080
2080
  }
2081
2081
  }
2082
2082
  o && Qt(() => {
@@ -2084,7 +2084,7 @@ function pf(e, t, r, n, i) {
2084
2084
  for (b of f) b.nodes?.a?.apply();
2085
2085
  });
2086
2086
  }
2087
- function gf(e, t, r, n, i, o, s, a) {
2087
+ function mf(e, t, r, n, i, o, s, a) {
2088
2088
  var l = (s & 1) !== 0 ? (s & 16) === 0 ? /* @__PURE__ */ Va(r, !1, !1) : er(r) : null, c = (s & 2) !== 0 ? er(i) : null;
2089
2089
  return {
2090
2090
  v: l,
@@ -2105,7 +2105,7 @@ function Qr(e, t, r) {
2105
2105
  function Ct(e, t, r) {
2106
2106
  t === null ? e.effect.first = r : t.next = r, r === null ? e.effect.last = t : r.prev = t;
2107
2107
  }
2108
- function mf(e, t) {
2108
+ function vf(e, t) {
2109
2109
  tl(() => {
2110
2110
  var r = e.getRootNode(), n = r.host ? r : r.head ?? r.ownerDocument.head;
2111
2111
  if (!n.querySelector("#" + t.hash)) {
@@ -2116,7 +2116,7 @@ function mf(e, t) {
2116
2116
  }
2117
2117
  var Cs = [...`
2118
2118
  \r\f \v\uFEFF`];
2119
- function vf(e, t, r) {
2119
+ function bf(e, t, r) {
2120
2120
  var n = e == null ? "" : "" + e;
2121
2121
  if (t && (n = n ? n + " " + t : t), r) {
2122
2122
  for (var i of Object.keys(r)) if (r[i]) n = n ? n + " " + i : i;
@@ -2139,7 +2139,7 @@ function Ms(e, t = !1) {
2139
2139
  function Ei(e) {
2140
2140
  return e[0] !== "-" || e[1] !== "-" ? e.toLowerCase() : e;
2141
2141
  }
2142
- function bf(e, t) {
2142
+ function yf(e, t) {
2143
2143
  if (t) {
2144
2144
  var r = "", n, i;
2145
2145
  if (Array.isArray(t) ? (n = t[0], i = t[1]) : n = t, e) {
@@ -2170,10 +2170,10 @@ function bf(e, t) {
2170
2170
  }
2171
2171
  return e == null ? null : String(e);
2172
2172
  }
2173
- function yf(e, t, r, n, i, o) {
2173
+ function _f(e, t, r, n, i, o) {
2174
2174
  var s = e[Bi];
2175
2175
  if (W || s !== r || s === void 0) {
2176
- var a = vf(r, n, o);
2176
+ var a = bf(r, n, o);
2177
2177
  (!W || a !== e.getAttribute("class")) && (a == null ? e.removeAttribute("class") : t ? e.className = a : e.setAttribute("class", a)), e[Bi] = r;
2178
2178
  } else if (o && i !== o) for (var l in o) {
2179
2179
  var c = !!o[l];
@@ -2190,29 +2190,29 @@ function Ai(e, t = {}, r, n) {
2190
2190
  function mr(e, t, r, n) {
2191
2191
  var i = e[Ui];
2192
2192
  if (W || i !== t) {
2193
- var o = bf(t, n);
2193
+ var o = yf(t, n);
2194
2194
  (!W || o !== e.getAttribute("style")) && (o == null ? e.removeAttribute("style") : e.style.cssText = o), e[Ui] = t;
2195
2195
  } else n && (Array.isArray(n) ? (Ai(e, r?.[0], n[0]), Ai(e, r?.[1], n[1], "important")) : Ai(e, r, n));
2196
2196
  return n;
2197
2197
  }
2198
- var _f = /* @__PURE__ */ Symbol("is custom element"), Tf = /* @__PURE__ */ Symbol("is html"), wf = Kc ? "link" : "LINK";
2198
+ var Tf = /* @__PURE__ */ Symbol("is custom element"), Sf = /* @__PURE__ */ Symbol("is html"), wf = Xc ? "link" : "LINK";
2199
2199
  function xi(e, t, r, n) {
2200
- var i = Sf(e);
2200
+ var i = kf(e);
2201
2201
  if (W && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === wf)) {
2202
2202
  n || void 0;
2203
2203
  return;
2204
2204
  }
2205
- i[t] !== (i[t] = r) && (t === "loading" && (e[Gc] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && kf(e).includes(t) ? e[t] = r : e.setAttribute(t, r));
2205
+ i[t] !== (i[t] = r) && (t === "loading" && (e[Yc] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && Ef(e).includes(t) ? e[t] = r : e.setAttribute(t, r));
2206
2206
  }
2207
- function Sf(e) {
2207
+ function kf(e) {
2208
2208
  var t;
2209
2209
  return (t = e)[Fi] ?? (t[Fi] = {
2210
- [_f]: e.nodeName.includes("-"),
2211
- [Tf]: e.namespaceURI === "http://www.w3.org/1999/xhtml"
2210
+ [Tf]: e.nodeName.includes("-"),
2211
+ [Sf]: e.namespaceURI === "http://www.w3.org/1999/xhtml"
2212
2212
  });
2213
2213
  }
2214
2214
  var Os = /* @__PURE__ */ new Map();
2215
- function kf(e) {
2215
+ function Ef(e) {
2216
2216
  var t = e.getAttribute("is") || e.nodeName, r = Os.get(t);
2217
2217
  if (r) return r;
2218
2218
  Os.set(t, r = []);
@@ -2229,14 +2229,14 @@ var vl, kr = /* @__PURE__ */ new WeakMap(), Zn = /* @__PURE__ */ new WeakMap(),
2229
2229
  }
2230
2230
  observe(e, t) {
2231
2231
  var r = p(kr, this).get(e) || /* @__PURE__ */ new Set();
2232
- return r.add(t), p(kr, this).set(e, r), L(Is, this, Ef).call(this).observe(e, p(Ci, this)), () => {
2232
+ return r.add(t), p(kr, this).set(e, r), L(Is, this, Af).call(this).observe(e, p(Ci, this)), () => {
2233
2233
  var n = p(kr, this).get(e);
2234
2234
  n.delete(t), n.size === 0 && (p(kr, this).delete(e), p(Zn, this).unobserve(e));
2235
2235
  };
2236
2236
  }
2237
2237
  };
2238
2238
  vl = bl;
2239
- function Ef() {
2239
+ function Af() {
2240
2240
  return p(Zn, this) ?? C(Zn, this, new ResizeObserver((e) => {
2241
2241
  for (var t of e) {
2242
2242
  vl.entries.set(t.target, t);
@@ -2248,7 +2248,7 @@ m(bl, "entries", /* @__PURE__ */ new WeakMap());
2248
2248
  function Mi(e, t) {
2249
2249
  return e === t || e?.[rn] === t;
2250
2250
  }
2251
- function Af(e = {}, t, r, n) {
2251
+ function xf(e = {}, t, r, n) {
2252
2252
  var i = q.r, o = O;
2253
2253
  return tl(() => {
2254
2254
  var s, a;
@@ -2269,43 +2269,43 @@ function Af(e = {}, t, r, n) {
2269
2269
  }), e;
2270
2270
  }
2271
2271
  function Mn(e, t, r, n) {
2272
- var i = !un || (r & 2) !== 0, o = (r & 8) !== 0, s = (r & 16) !== 0, a = n, l = !0, c = void 0, u = () => s && i ? (c ?? (c = /* @__PURE__ */ an(n)), S(c)) : (l && (l = !1, a = s ? ai(n) : n), a);
2272
+ var i = !un || (r & 2) !== 0, o = (r & 8) !== 0, s = (r & 16) !== 0, a = n, l = !0, c = void 0, u = () => s && i ? (c ?? (c = /* @__PURE__ */ an(n)), w(c)) : (l && (l = !1, a = s ? ai(n) : n), a);
2273
2273
  let f;
2274
2274
  if (o) {
2275
2275
  var h = rn in e || Ta in e;
2276
- f = jt(e, t)?.set ?? (h && t in e ? (w) => e[t] = w : void 0);
2276
+ f = jt(e, t)?.set ?? (h && t in e ? (S) => e[t] = S : void 0);
2277
2277
  }
2278
2278
  var g, v = !1;
2279
- o ? [g, v] = mu(() => e[t]) : g = e[t], g === void 0 && n !== void 0 && (g = u(), f && (i && iu(t), f(g)));
2279
+ o ? [g, v] = vu(() => e[t]) : g = e[t], g === void 0 && n !== void 0 && (g = u(), f && (i && ou(t), f(g)));
2280
2280
  var _;
2281
2281
  if (i ? _ = () => {
2282
- var w = e[t];
2283
- return w === void 0 ? u() : (l = !0, w);
2282
+ var S = e[t];
2283
+ return S === void 0 ? u() : (l = !0, S);
2284
2284
  } : _ = () => {
2285
- var w = e[t];
2286
- return w !== void 0 && (a = void 0), w === void 0 ? a : w;
2285
+ var S = e[t];
2286
+ return S !== void 0 && (a = void 0), S === void 0 ? a : S;
2287
2287
  }, i && (r & 4) === 0) return _;
2288
2288
  if (f) {
2289
2289
  var b = e.$$legacy;
2290
- return (function(w, F) {
2291
- return arguments.length > 0 ? ((!i || !F || b || v) && f(F ? _() : w), w) : _();
2290
+ return (function(S, F) {
2291
+ return arguments.length > 0 ? ((!i || !F || b || v) && f(F ? _() : S), S) : _();
2292
2292
  });
2293
2293
  }
2294
2294
  var T = !1, I = ((r & 1) !== 0 ? an : Ro)(() => (T = !1, _()));
2295
- o && S(I);
2295
+ o && w(I);
2296
2296
  var N = O;
2297
- return (function(w, F) {
2297
+ return (function(S, F) {
2298
2298
  if (arguments.length > 0) {
2299
- const B = F ? S(I) : i && o ? Er(w) : w;
2300
- return oe(I, B), T = !0, a !== void 0 && (a = B), w;
2299
+ const B = F ? w(I) : i && o ? Er(S) : S;
2300
+ return oe(I, B), T = !0, a !== void 0 && (a = B), S;
2301
2301
  }
2302
- return mt && T || (N.f & 16384) !== 0 ? I.v : S(I);
2302
+ return mt && T || (N.f & 16384) !== 0 ? I.v : w(I);
2303
2303
  });
2304
2304
  }
2305
- function xf(e) {
2306
- return new Cf(e);
2305
+ function Cf(e) {
2306
+ return new Mf(e);
2307
2307
  }
2308
- var Wt = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), Cf = class {
2308
+ var Wt = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), Mf = class {
2309
2309
  constructor(e) {
2310
2310
  M(this, Wt, void 0), M(this, Ke, void 0);
2311
2311
  var t = /* @__PURE__ */ new Map(), r = (i, o) => {
@@ -2317,16 +2317,16 @@ var Wt = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), Cf =
2317
2317
  $$events: {}
2318
2318
  }, {
2319
2319
  get(i, o) {
2320
- return S(t.get(o) ?? r(o, Reflect.get(i, o)));
2320
+ return w(t.get(o) ?? r(o, Reflect.get(i, o)));
2321
2321
  },
2322
2322
  has(i, o) {
2323
- return o === Ta ? !0 : (S(t.get(o) ?? r(o, Reflect.get(i, o))), Reflect.has(i, o));
2323
+ return o === Ta ? !0 : (w(t.get(o) ?? r(o, Reflect.get(i, o))), Reflect.has(i, o));
2324
2324
  },
2325
2325
  set(i, o, s) {
2326
2326
  return oe(t.get(o) ?? r(o, s), s), Reflect.set(i, o, s);
2327
2327
  }
2328
2328
  });
2329
- C(Ke, this, (e.hydrate ? af : gl)(e.component, {
2329
+ C(Ke, this, (e.hydrate ? lf : gl)(e.component, {
2330
2330
  target: e.target,
2331
2331
  anchor: e.anchor,
2332
2332
  props: n,
@@ -2348,7 +2348,7 @@ var Wt = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), Cf =
2348
2348
  p(Ke, this).$set = (i) => {
2349
2349
  Object.assign(n, i);
2350
2350
  }, p(Ke, this).$destroy = () => {
2351
- lf(p(Ke, this));
2351
+ cf(p(Ke, this));
2352
2352
  };
2353
2353
  }
2354
2354
  $set(e) {
@@ -2387,18 +2387,18 @@ typeof HTMLElement == "function" && (yl = class extends HTMLElement {
2387
2387
  let e = function(n) {
2388
2388
  return (i) => {
2389
2389
  const o = Po("slot");
2390
- n !== "default" && (o.name = n), Sr(i, o);
2390
+ n !== "default" && (o.name = n), wr(i, o);
2391
2391
  };
2392
2392
  };
2393
2393
  if (await Promise.resolve(), !this.$$cn || this.$$c) return;
2394
- const t = {}, r = Mf(this);
2394
+ const t = {}, r = Of(this);
2395
2395
  for (const n of this.$$s) n in r && (n === "default" && !this.$$d.children ? (this.$$d.children = e(n), t.default = !0) : t[n] = e(n));
2396
2396
  for (const n of this.attributes) {
2397
2397
  const i = this.$$g_p(n.name);
2398
2398
  i in this.$$d || (this.$$d[i] = Pn(i, n.value, this.$$p_d, "toProp"));
2399
2399
  }
2400
2400
  for (const n in this.$$p_d) !(n in this.$$d) && this[n] !== void 0 && (this.$$d[n] = this[n], delete this[n]);
2401
- this.$$c = xf({
2401
+ this.$$c = Cf({
2402
2402
  component: this.$$ctor,
2403
2403
  target: this.$$shadowRoot || this,
2404
2404
  props: {
@@ -2406,10 +2406,10 @@ typeof HTMLElement == "function" && (yl = class extends HTMLElement {
2406
2406
  $$slots: t,
2407
2407
  $$host: this
2408
2408
  }
2409
- }), this.$$me = Bu(() => {
2409
+ }), this.$$me = Uu(() => {
2410
2410
  Do(() => {
2411
2411
  this.$$r = !0;
2412
- for (const n of Hn(this.$$c)) {
2412
+ for (const n of zn(this.$$c)) {
2413
2413
  if (!this.$$p_d[n]?.reflect) continue;
2414
2414
  this.$$d[n] = this.$$c[n];
2415
2415
  const i = Pn(n, this.$$d[n], this.$$p_d, "toAttribute");
@@ -2434,7 +2434,7 @@ typeof HTMLElement == "function" && (yl = class extends HTMLElement {
2434
2434
  });
2435
2435
  }
2436
2436
  $$g_p(e) {
2437
- return Hn(this.$$p_d).find((t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e) || e;
2437
+ return zn(this.$$p_d).find((t) => this.$$p_d[t].attribute === e || !this.$$p_d[t].attribute && t.toLowerCase() === e) || e;
2438
2438
  }
2439
2439
  });
2440
2440
  function Pn(e, t, r, n) {
@@ -2463,22 +2463,22 @@ function Pn(e, t, r, n) {
2463
2463
  return t;
2464
2464
  }
2465
2465
  }
2466
- function Mf(e) {
2466
+ function Of(e) {
2467
2467
  const t = {};
2468
2468
  return e.childNodes.forEach((r) => {
2469
2469
  t[r.slot || "default"] = !0;
2470
2470
  }), t;
2471
2471
  }
2472
- function Of(e, t, r, n, i, o) {
2472
+ function If(e, t, r, n, i, o) {
2473
2473
  let s = class extends yl {
2474
2474
  constructor() {
2475
2475
  super(e, r, i), this.$$p_d = t;
2476
2476
  }
2477
2477
  static get observedAttributes() {
2478
- return Hn(t).map((a) => (t[a].attribute || a).toLowerCase());
2478
+ return zn(t).map((a) => (t[a].attribute || a).toLowerCase());
2479
2479
  }
2480
2480
  };
2481
- return Hn(t).forEach((a) => {
2481
+ return zn(t).forEach((a) => {
2482
2482
  Fn(s.prototype, a, {
2483
2483
  get() {
2484
2484
  return this.$$c && a in this.$$c ? this.$$c[a] : this.$$d[a];
@@ -2495,14 +2495,14 @@ function Of(e, t, r, n, i, o) {
2495
2495
  } });
2496
2496
  }), o && (s = o(s)), e.element = s, s;
2497
2497
  }
2498
- var If = class extends Event {
2498
+ var Rf = class extends Event {
2499
2499
  constructor(e, t, r, n) {
2500
2500
  super("context-request", {
2501
2501
  bubbles: !0,
2502
2502
  composed: !0
2503
2503
  }), m(this, "context", void 0), m(this, "contextTarget", void 0), m(this, "callback", void 0), m(this, "subscribe", void 0), this.context = e, this.contextTarget = t, this.callback = r, this.subscribe = n ?? !1;
2504
2504
  }
2505
- }, Rf = class {
2505
+ }, Lf = class {
2506
2506
  constructor(e, t) {
2507
2507
  m(this, "host", void 0), m(this, "context", void 0), m(this, "subscribe", void 0), m(this, "onValue", void 0), m(this, "isConnected", !1), m(this, "unsubscribe", void 0), m(this, "currentValue", void 0), m(this, "handleValue", (r, n) => {
2508
2508
  n !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = n), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = r, this.onValue?.(r);
@@ -2518,12 +2518,12 @@ var If = class extends Event {
2518
2518
  return this.currentValue;
2519
2519
  }
2520
2520
  requestValue() {
2521
- this.host.dispatchEvent(new If(this.context, this.host, this.handleValue, this.subscribe));
2521
+ this.host.dispatchEvent(new Rf(this.context, this.host, this.handleValue, this.subscribe));
2522
2522
  }
2523
- }, li = (e) => e, Lf = li(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), Xg = li(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), Jg = li(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), Qg = li(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
2524
- function Pf(e, t, r) {
2523
+ }, li = (e) => e, Pf = li(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), Xg = li(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), Jg = li(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), Qg = li(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
2524
+ function Nf(e, t, r) {
2525
2525
  let n = !1;
2526
- const i = new Rf(e, {
2526
+ const i = new Lf(e, {
2527
2527
  context: t,
2528
2528
  subscribe: !0,
2529
2529
  onValue: (c) => {
@@ -2547,13 +2547,13 @@ function Pf(e, t, r) {
2547
2547
  globalThis.clearInterval(l), e.removeEventListener("context-provider", o), i.disconnect();
2548
2548
  };
2549
2549
  }
2550
- function Nf(e, t) {
2551
- return Pf(e, Lf, t);
2552
- }
2553
2550
  function $f(e, t) {
2554
- return Nf(e, t);
2551
+ return Nf(e, Pf, t);
2552
+ }
2553
+ function Df(e, t) {
2554
+ return $f(e, t);
2555
2555
  }
2556
- var Df = class {
2556
+ var Wf = class {
2557
2557
  serialize(e, t) {
2558
2558
  return {
2559
2559
  startContainer: this.getNodePath(e.startContainer, t),
@@ -2628,7 +2628,7 @@ var xr;
2628
2628
  })(xr || (xr = {}));
2629
2629
  var _l = class to {
2630
2630
  constructor(t = {}) {
2631
- if (m(this, "config", void 0), m(this, "ttsWordHighlight", null), m(this, "ttsSentenceHighlight", null), m(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), m(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), m(this, "annotations", /* @__PURE__ */ new Map()), m(this, "colorHighlights", /* @__PURE__ */ new Map()), m(this, "nextAnnotationId", 1), m(this, "supported", !1), m(this, "rangeSerializer", void 0), m(this, "themeObserver", null), m(this, "explicitTTSColorOverride", null), this.config = t, this.rangeSerializer = new Df(), typeof CSS > "u" || !("highlights" in CSS)) {
2631
+ if (m(this, "config", void 0), m(this, "ttsWordHighlight", null), m(this, "ttsSentenceHighlight", null), m(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), m(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), m(this, "annotations", /* @__PURE__ */ new Map()), m(this, "colorHighlights", /* @__PURE__ */ new Map()), m(this, "nextAnnotationId", 1), m(this, "supported", !1), m(this, "rangeSerializer", void 0), m(this, "themeObserver", null), m(this, "explicitTTSColorOverride", null), this.config = t, this.rangeSerializer = new Wf(), typeof CSS > "u" || !("highlights" in CSS)) {
2632
2632
  console.warn("CSS Custom Highlight API not supported (SSR or unsupported browser)");
2633
2633
  return;
2634
2634
  }
@@ -2753,12 +2753,12 @@ var _l = class to {
2753
2753
  255,
2754
2754
  255,
2755
2755
  255
2756
- ], w = I >= 1.35 ? b : N;
2756
+ ], S = I >= 1.35 ? b : N;
2757
2757
  return {
2758
2758
  wordHighlight: `rgba(${c[0]}, ${c[1]}, ${c[2]}, ${f})`,
2759
2759
  sentenceHighlight: `rgba(${c[0]}, ${c[1]}, ${c[2]}, ${g})`,
2760
- wordUnderline: `rgba(${w[0]}, ${w[1]}, ${w[2]}, ${v})`,
2761
- wordShadow: `rgba(${w[0]}, ${w[1]}, ${w[2]}, ${_})`
2760
+ wordUnderline: `rgba(${S[0]}, ${S[1]}, ${S[2]}, ${v})`,
2761
+ wordShadow: `rgba(${S[0]}, ${S[1]}, ${S[2]}, ${_})`
2762
2762
  };
2763
2763
  }
2764
2764
  applyAdaptiveTTSStyle(t) {
@@ -2815,27 +2815,27 @@ var _l = class to {
2815
2815
 
2816
2816
  /* Annotation highlights - persistent */
2817
2817
  ::highlight(annotation-yellow) {
2818
- background-color: color-mix(in srgb, var(--pie-missing, #ffff00) 35%, transparent);
2818
+ background-color: var(--pie-annotation-yellow-highlight, rgba(253, 233, 149, 0.5));
2819
2819
  color: inherit;
2820
2820
  }
2821
2821
 
2822
2822
  ::highlight(annotation-green) {
2823
- background-color: color-mix(in srgb, var(--pie-correct, #90ee90) 35%, transparent);
2823
+ background-color: var(--pie-annotation-green-highlight, rgba(166, 225, 197, 0.5));
2824
2824
  color: inherit;
2825
2825
  }
2826
2826
 
2827
2827
  ::highlight(annotation-blue) {
2828
- background-color: color-mix(in srgb, var(--pie-tertiary, #add8e6) 35%, transparent);
2828
+ background-color: var(--pie-annotation-blue-highlight, rgba(167, 224, 246, 0.5));
2829
2829
  color: inherit;
2830
2830
  }
2831
2831
 
2832
2832
  ::highlight(annotation-pink) {
2833
- background-color: color-mix(in srgb, var(--pie-secondary-light, #ffb6c1) 35%, transparent);
2833
+ background-color: var(--pie-annotation-pink-highlight, rgba(255, 159, 174, 0.5));
2834
2834
  color: inherit;
2835
2835
  }
2836
2836
 
2837
2837
  ::highlight(annotation-orange) {
2838
- background-color: color-mix(in srgb, var(--pie-incorrect, #ffa500) 35%, transparent);
2838
+ background-color: var(--pie-annotation-orange-highlight, rgba(255, 165, 0, 0.5));
2839
2839
  color: inherit;
2840
2840
  }
2841
2841
 
@@ -2863,6 +2863,13 @@ var _l = class to {
2863
2863
  for (const i of t) this.ttsSentenceHighlight.add(i);
2864
2864
  this.highlightTTSElementFallbacks(t);
2865
2865
  }
2866
+ highlightTTSSentenceElements(t) {
2867
+ if (this.ttsSentenceHighlight) {
2868
+ this.applyAdaptiveTTSStyle(t[0] || null), this.clearTTSSentence();
2869
+ for (const r of t)
2870
+ r.setAttribute("data-pie-tts-sentence-element", "true"), this.ttsSentenceElementHighlights.add(r);
2871
+ }
2872
+ }
2866
2873
  highlightTTSElementFallbacks(t) {
2867
2874
  typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-sentence-element", this.ttsSentenceElementHighlights, to.SENTENCE_FALLBACK_SELECTOR);
2868
2875
  }
@@ -3059,7 +3066,7 @@ function Mt(e, t) {
3059
3066
  if (e.find((r) => typeof r != "string") !== void 0) throw new Error(`Invalid tools config at "${t}": all entries must be strings.`);
3060
3067
  return e;
3061
3068
  }
3062
- function Wf(e) {
3069
+ function Hf(e) {
3063
3070
  if (e != null) {
3064
3071
  if (!Xt(e)) throw new Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');
3065
3072
  return e;
@@ -3071,7 +3078,7 @@ function zf(e) {
3071
3078
  return e;
3072
3079
  }
3073
3080
  }
3074
- function Hf(e, t) {
3081
+ function Ff(e, t) {
3075
3082
  if (t == null) return;
3076
3083
  if (!Xt(t)) throw new Error(`Invalid tools config at "providers.${e}": expected an object.`);
3077
3084
  const r = t, n = (i) => i === "polly" || i === "google" || i === "custom";
@@ -3080,14 +3087,14 @@ function Hf(e, t) {
3080
3087
  if ("provider" in r && r.provider !== void 0 && !Xt(r.provider) && !(e === "textToSpeech" && n(r.provider))) throw new Error(`Invalid tools config at "providers.${e}.provider": expected an object.`);
3081
3088
  return r;
3082
3089
  }
3083
- function Ff(e) {
3090
+ function Bf(e) {
3084
3091
  if (e == null) return {};
3085
3092
  if (!Xt(e)) throw new Error('Invalid tools config at "providers": expected an object keyed by tool id.');
3086
3093
  const t = {};
3087
- for (const [r, n] of Object.entries(e)) t[r] = Hf(r, n);
3094
+ for (const [r, n] of Object.entries(e)) t[r] = Ff(r, n);
3088
3095
  return t;
3089
3096
  }
3090
- function wl(e) {
3097
+ function Sl(e) {
3091
3098
  const t = e.trim();
3092
3099
  return t || "";
3093
3100
  }
@@ -3096,20 +3103,20 @@ function Ot(e) {
3096
3103
  const t = /* @__PURE__ */ new Set();
3097
3104
  for (const r of e) {
3098
3105
  if (typeof r != "string") throw new Error("Invalid tools config: tool list entries must be strings.");
3099
- const n = wl(r);
3106
+ const n = Sl(r);
3100
3107
  n && t.add(n);
3101
3108
  }
3102
3109
  return Array.from(t);
3103
3110
  }
3104
- function Bf(e, t) {
3111
+ function Uf(e, t) {
3105
3112
  if (e != null) {
3106
3113
  if (e === "on" || e === "off") return e;
3107
3114
  throw new Error(`Invalid tools config at "${t}": expected "on" or "off", got ${JSON.stringify(e)}.`);
3108
3115
  }
3109
3116
  }
3110
- function Uf(e) {
3117
+ function jf(e) {
3111
3118
  if (e != null && !Xt(e)) throw new Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');
3112
- const t = zf(e?.policy), r = Wf(e?.placement), n = Ff(e?.providers), i = Bf(e?.pnpEnforcement, "pnpEnforcement"), o = {
3119
+ const t = zf(e?.policy), r = Hf(e?.placement), n = Bf(e?.providers), i = Uf(e?.pnpEnforcement, "pnpEnforcement"), o = {
3113
3120
  policy: {
3114
3121
  allowed: Ot(Mt(t?.allowed, "policy.allowed")),
3115
3122
  blocked: Ot(Mt(t?.blocked, "policy.blocked"))
@@ -3123,7 +3130,7 @@ function Uf(e) {
3123
3130
  };
3124
3131
  return i && (o.pnpEnforcement = i), o;
3125
3132
  }
3126
- var jf = [
3133
+ var qf = [
3127
3134
  "assessment",
3128
3135
  "section",
3129
3136
  "item",
@@ -3134,7 +3141,7 @@ var jf = [
3134
3141
  function Nn(e, t) {
3135
3142
  if (typeof e != "string" || e.trim().length === 0) throw new Error(`Invalid tool registration: "${t}" must be a non-empty string.`);
3136
3143
  }
3137
- var qf = [
3144
+ var Vf = [
3138
3145
  {
3139
3146
  pattern: /<script\b/i,
3140
3147
  reason: "contains a <script> tag"
@@ -3152,17 +3159,17 @@ var qf = [
3152
3159
  reason: "contains a <foreignObject> element"
3153
3160
  }
3154
3161
  ];
3155
- function Vf(e, t, r) {
3162
+ function Gf(e, t, r) {
3156
3163
  const n = t.trimStart(), i = n.toLowerCase().startsWith("<svg"), o = /^https?:/i.test(n);
3157
3164
  if (/^data:/i.test(n)) throw new Error(`Invalid tool registration "${e}": "${r}" may not be a data: URL.`);
3158
3165
  if (!(!i && !o)) {
3159
- for (const { pattern: s, reason: a } of qf) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${r}" ${a}. Inline SVG icons must not include scriptable content.`);
3166
+ for (const { pattern: s, reason: a } of Vf) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${r}" ${a}. Inline SVG icons must not include scriptable content.`);
3160
3167
  }
3161
3168
  }
3162
3169
  function Rs(e) {
3163
3170
  if (Nn(e.toolId, "toolId"), Nn(e.name, "name"), Nn(e.description, "description"), typeof e.icon != "string" && typeof e.icon != "function") throw new Error(`Invalid tool registration "${e.toolId}": "icon" must be a string or function.`);
3164
- if (typeof e.icon == "string" && Vf(e.toolId, e.icon, "icon"), !Array.isArray(e.supportedLevels) || e.supportedLevels.length === 0) throw new Error(`Invalid tool registration "${e.toolId}": "supportedLevels" must be a non-empty array.`);
3165
- const t = e.supportedLevels.find((r) => !jf.includes(r));
3171
+ if (typeof e.icon == "string" && Gf(e.toolId, e.icon, "icon"), !Array.isArray(e.supportedLevels) || e.supportedLevels.length === 0) throw new Error(`Invalid tool registration "${e.toolId}": "supportedLevels" must be a non-empty array.`);
3172
+ const t = e.supportedLevels.find((r) => !qf.includes(r));
3166
3173
  if (t) throw new Error(`Invalid tool registration "${e.toolId}": unsupported level "${t}".`);
3167
3174
  if (e.activation !== void 0 && e.activation !== "toolbar-toggle" && e.activation !== "selection-gateway") throw new Error(`Invalid tool registration "${e.toolId}": unsupported activation "${String(e.activation)}".`);
3168
3175
  if (e.singletonScope !== void 0 && e.singletonScope !== "section") throw new Error(`Invalid tool registration "${e.toolId}": unsupported singletonScope "${String(e.singletonScope)}".`);
@@ -3171,12 +3178,12 @@ function Rs(e) {
3171
3178
  if (typeof e.isVisibleInContext != "function") throw new Error(`Invalid tool registration "${e.toolId}": "isVisibleInContext" must be a function.`);
3172
3179
  if (typeof e.renderToolbar != "function") throw new Error(`Invalid tool registration "${e.toolId}": "renderToolbar" must be a function.`);
3173
3180
  }
3174
- var Gf = class {
3181
+ var Yf = class {
3175
3182
  constructor() {
3176
3183
  m(this, "tools", /* @__PURE__ */ new Map()), m(this, "pnpIndex", /* @__PURE__ */ new Map()), m(this, "componentOverrides", {}), m(this, "moduleLoaders", /* @__PURE__ */ new Map()), m(this, "loadedToolModules", /* @__PURE__ */ new Set()), m(this, "moduleLoadPromises", /* @__PURE__ */ new Map());
3177
3184
  }
3178
3185
  normalizeToolId(e) {
3179
- return wl(e);
3186
+ return Sl(e);
3180
3187
  }
3181
3188
  normalizeToolIds(e) {
3182
3189
  return e.map((t) => this.normalizeToolId(t));
@@ -3314,13 +3321,13 @@ var Gf = class {
3314
3321
  return n.renderToolbar(t, i);
3315
3322
  }
3316
3323
  };
3317
- function Sl(e) {
3324
+ function wl(e) {
3318
3325
  return e.level === "item";
3319
3326
  }
3320
- function Yf(e) {
3327
+ function Kf(e) {
3321
3328
  return e.level === "passage";
3322
3329
  }
3323
- function Kf(e) {
3330
+ function Xf(e) {
3324
3331
  return e.level === "rubric";
3325
3332
  }
3326
3333
  function kl(e) {
@@ -3342,7 +3349,7 @@ function Bo(e) {
3342
3349
  }
3343
3350
  return r.filter(Boolean).join(" ").trim();
3344
3351
  }
3345
- if (Sl(e)) {
3352
+ if (wl(e)) {
3346
3353
  const t = e.item;
3347
3354
  if (!t?.config) return "";
3348
3355
  const r = t.config, n = [], i = (l) => l.replace(/<[^>]*>/g, " ").trim();
@@ -3361,7 +3368,7 @@ function Bo(e) {
3361
3368
  }
3362
3369
  return n.filter(Boolean).join(" ").trim();
3363
3370
  }
3364
- if (Yf(e)) {
3371
+ if (Kf(e)) {
3365
3372
  const t = e.passage;
3366
3373
  if (!t?.config) return "";
3367
3374
  const r = t.config, n = [], i = (l) => l.replace(/<[^>]*>/g, " ").trim();
@@ -3380,7 +3387,7 @@ function Bo(e) {
3380
3387
  }
3381
3388
  return n.filter(Boolean).join(" ").trim();
3382
3389
  }
3383
- if (Kf(e)) {
3390
+ if (Xf(e)) {
3384
3391
  const t = e.rubricBlock;
3385
3392
  return t.passage?.config ? (t.passage.config.markup || "").replace(/<[^>]*>/g, " ").trim() : (t.content || "").replace(/<[^>]*>/g, " ").trim();
3386
3393
  }
@@ -3397,7 +3404,7 @@ function ci(e) {
3397
3404
  /\d+\s*[+\-*/=]\s*\d+/
3398
3405
  ].some((r) => r.test(t));
3399
3406
  }
3400
- function Xf(e) {
3407
+ function Jf(e) {
3401
3408
  const t = [
3402
3409
  "pie-multiple-choice",
3403
3410
  "pie-inline-choice",
@@ -3414,7 +3421,7 @@ function Xf(e) {
3414
3421
  const i = n.element || "";
3415
3422
  return t.includes(i);
3416
3423
  }
3417
- if (Sl(e)) {
3424
+ if (wl(e)) {
3418
3425
  const r = e.item.config?.models;
3419
3426
  return (Array.isArray(r) ? r : r && typeof r == "object" ? Object.values(r) : []).some((n) => {
3420
3427
  if (!n || typeof n != "object") return !1;
@@ -3427,7 +3434,7 @@ function Xf(e) {
3427
3434
  function ui(e) {
3428
3435
  return Bo(e).trim().length >= 10;
3429
3436
  }
3430
- function Jf(e) {
3437
+ function Qf(e) {
3431
3438
  const t = Bo(e);
3432
3439
  return [
3433
3440
  /chemistry|chemical|element|atom|molecule|compound/i,
@@ -3438,23 +3445,23 @@ function Jf(e) {
3438
3445
  /physics|force|energy|velocity|acceleration/i
3439
3446
  ].some((r) => r.test(t));
3440
3447
  }
3441
- var Qf = [
3448
+ var Zf = [
3442
3449
  "assessment",
3443
3450
  "section",
3444
3451
  "item",
3445
3452
  "passage",
3446
3453
  "rubric"
3447
- ], Zf = new Set(Qf);
3448
- function ed(e) {
3449
- return Zf.has(e);
3454
+ ], ed = new Set(Zf);
3455
+ function td(e) {
3456
+ return ed.has(e);
3450
3457
  }
3451
3458
  function Uo(e, t, r) {
3452
3459
  const n = e.trim(), i = r.trim();
3453
3460
  if (!n || !i) throw new Error("Tool instance ids require non-empty tool and scope ids");
3454
- if (!ed(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
3461
+ if (!td(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
3455
3462
  return `${n}:${t}:${i}`;
3456
3463
  }
3457
- var td = class {
3464
+ var rd = class {
3458
3465
  constructor() {
3459
3466
  m(this, "providerId", "desmos-calculator"), m(this, "providerName", "Desmos Calculator"), m(this, "category", "calculator"), m(this, "version", "1.10"), m(this, "requiresAuth", !0), m(this, "desmosProvider", null), m(this, "config", null);
3460
3467
  }
@@ -3558,12 +3565,12 @@ var td = class {
3558
3565
  text: e,
3559
3566
  offset: 0
3560
3567
  }];
3561
- }, El = (e) => String(e || "").trim().toLowerCase(), rd = () => El((typeof navigator < "u" ? navigator.language || navigator.languages?.[0] : "") || "en-US"), nd = (e, t) => {
3568
+ }, El = (e) => String(e || "").trim().toLowerCase(), nd = () => El((typeof navigator < "u" ? navigator.language || navigator.languages?.[0] : "") || "en-US"), id = (e, t) => {
3562
3569
  if (t) {
3563
3570
  const s = e.find((a) => a.name === t);
3564
3571
  if (s) return s;
3565
3572
  }
3566
- const r = rd(), n = r.split("-")[0] || "en", i = (s) => {
3573
+ const r = nd(), n = r.split("-")[0] || "en", i = (s) => {
3567
3574
  const a = El(s.lang);
3568
3575
  return a === r || a.startsWith(`${n}-`);
3569
3576
  }, o = [
@@ -3578,14 +3585,14 @@ var td = class {
3578
3585
  if (a) return a;
3579
3586
  }
3580
3587
  return e[0] || null;
3581
- }, id = (e) => !e.default, Al = class {
3588
+ }, od = (e) => !e.default, Al = class {
3582
3589
  constructor() {
3583
3590
  m(this, "providerId", "browser"), m(this, "providerName", "Browser Speech Synthesis"), m(this, "version", "1.0.0");
3584
3591
  }
3585
3592
  async initialize(e) {
3586
3593
  if (typeof window > "u") throw new Error("BrowserTTSProvider requires browser environment");
3587
3594
  if (!("speechSynthesis" in window)) throw new Error("Browser does not support Speech Synthesis API");
3588
- return new od(e);
3595
+ return new sd(e);
3589
3596
  }
3590
3597
  supportsFeature(e) {
3591
3598
  return !0;
@@ -3603,7 +3610,7 @@ var td = class {
3603
3610
  }
3604
3611
  destroy() {
3605
3612
  }
3606
- }, od = class {
3613
+ }, sd = class {
3607
3614
  constructor(e) {
3608
3615
  m(this, "utterance", null), m(this, "config", null), m(this, "_isPlaying", !1), m(this, "_isPaused", !1), m(this, "speakRunId", 0), m(this, "onWordBoundary", void 0), this.config = e;
3609
3616
  }
@@ -3690,8 +3697,8 @@ var td = class {
3690
3697
  }
3691
3698
  const o = new SpeechSynthesisUtterance(e);
3692
3699
  this.utterance = o;
3693
- const s = nd(speechSynthesis.getVoices(), this.config?.voice);
3694
- s && id(s) && (o.voice = s), this.config?.rate && (o.rate = this.config.rate), this.config?.pitch && (o.pitch = this.config.pitch);
3700
+ const s = id(speechSynthesis.getVoices(), this.config?.voice);
3701
+ s && od(s) && (o.voice = s), this.config?.rate && (o.rate = this.config.rate), this.config?.pitch && (o.pitch = this.config.pitch);
3695
3702
  const a = () => {
3696
3703
  this.utterance === o && (this.utterance = null);
3697
3704
  };
@@ -3745,7 +3752,7 @@ var td = class {
3745
3752
  ...e.providerOptions || {}
3746
3753
  });
3747
3754
  }
3748
- }, sd = class {
3755
+ }, ad = class {
3749
3756
  async emitTelemetry(e, t) {
3750
3757
  try {
3751
3758
  await this.config?.onTelemetry?.(e, t);
@@ -3835,7 +3842,7 @@ var td = class {
3835
3842
  destroy() {
3836
3843
  this.ttsProvider && (this.ttsProvider.destroy(), this.ttsProvider = null), this.config = null, console.log("[TTSToolProvider] Destroyed");
3837
3844
  }
3838
- }, ad = /* @__PURE__ */ new Set([
3845
+ }, ld = /* @__PURE__ */ new Set([
3839
3846
  "annotation-xml",
3840
3847
  "color-profile",
3841
3848
  "font-face",
@@ -3844,14 +3851,14 @@ var td = class {
3844
3851
  "font-face-format",
3845
3852
  "font-face-name",
3846
3853
  "missing-glyph"
3847
- ]), ld = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, cd = (e, t = "custom element tag") => {
3854
+ ]), cd = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, ud = (e, t = "custom element tag") => {
3848
3855
  if (!e || typeof e != "string") throw new Error(`Invalid ${t}: expected a non-empty string`);
3849
3856
  const r = e.trim();
3850
3857
  if (!r) throw new Error(`Invalid ${t}: tag is empty`);
3851
3858
  if (r !== r.toLowerCase()) throw new Error(`Invalid ${t} "${r}": custom element names must be lowercase`);
3852
3859
  if (!r.includes("-")) throw new Error(`Invalid ${t} "${r}": custom element names must include a hyphen`);
3853
- if (ad.has(r)) throw new Error(`Invalid ${t} "${r}": this name is reserved by the HTML spec`);
3854
- if (!ld.test(r)) throw new Error(`Invalid ${t} "${r}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
3860
+ if (ld.has(r)) throw new Error(`Invalid ${t} "${r}": this name is reserved by the HTML spec`);
3861
+ if (!cd.test(r)) throw new Error(`Invalid ${t} "${r}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
3855
3862
  return r;
3856
3863
  }, xl = {
3857
3864
  calculator: "pie-tool-calculator",
@@ -3865,21 +3872,21 @@ var td = class {
3865
3872
  annotationToolbar: "pie-tool-annotation-toolbar",
3866
3873
  graph: "pie-tool-graph",
3867
3874
  periodicTable: "pie-tool-periodic-table"
3868
- }, ud = (e, t) => cd(t?.toolTagMap?.[e] ?? xl[e] ?? e, `tool component tag for "${e}"`), fd = (e) => document.createElement(e), nt = (e, t, r, n) => {
3869
- const i = ud(e, n), o = n?.toolComponentFactories?.[e] ?? n?.toolComponentFactory;
3875
+ }, fd = (e, t) => ud(t?.toolTagMap?.[e] ?? xl[e] ?? e, `tool component tag for "${e}"`), dd = (e) => document.createElement(e), nt = (e, t, r, n) => {
3876
+ const i = fd(e, n), o = n?.toolComponentFactories?.[e] ?? n?.toolComponentFactory;
3870
3877
  return o ? o({
3871
3878
  toolId: e,
3872
3879
  tagName: i,
3873
3880
  context: t,
3874
3881
  toolbarContext: r
3875
- }) : fd(i);
3882
+ }) : dd(i);
3876
3883
  }, ro = /* @__PURE__ */ new WeakMap();
3877
- function dd(e, t) {
3884
+ function hd(e, t) {
3878
3885
  if (!e) return null;
3879
3886
  const r = ro.get(e), n = r?.get(t);
3880
3887
  return n ? n.isConnected ? n : (r?.delete(t), null) : null;
3881
3888
  }
3882
- function hd(e, t, r) {
3889
+ function pd(e, t, r) {
3883
3890
  if (!e) return;
3884
3891
  let n = ro.get(e);
3885
3892
  n || (n = /* @__PURE__ */ new Map(), ro.set(e, n)), n.set(t, r);
@@ -3887,7 +3894,7 @@ function hd(e, t, r) {
3887
3894
  function Ls(e) {
3888
3895
  return e === "basic" || e === "scientific" ? e : null;
3889
3896
  }
3890
- function pd(e) {
3897
+ function gd(e) {
3891
3898
  const t = e.getToolRenderParams?.("calculator") ?? {}, r = Ls(t.calculatorType), n = t.availableTypes;
3892
3899
  return {
3893
3900
  calculatorType: r,
@@ -3899,14 +3906,14 @@ function Ps(e, t, r) {
3899
3906
  const n = e;
3900
3907
  t ? (n.calculatorType = t, e.setAttribute("calculator-type", t)) : (delete n.calculatorType, e.removeAttribute("calculator-type")), r && r.length > 0 ? n.availableTypes = r : delete n.availableTypes;
3901
3908
  }
3902
- var gd = {
3909
+ var md = {
3903
3910
  toolId: "calculator",
3904
3911
  name: "Calculator",
3905
3912
  description: "Multi-type calculator (basic, scientific, graphing)",
3906
3913
  icon: "calculator",
3907
3914
  provider: {
3908
3915
  getProviderId: (e) => typeof e?.provider?.id == "string" && e.provider.id.length > 0 ? e.provider.id : "calculator-desmos",
3909
- createProvider: () => new td(),
3916
+ createProvider: () => new rd(),
3910
3917
  getInitConfig: (e) => e?.provider?.init ?? {},
3911
3918
  getAuthFetcher: (e) => {
3912
3919
  const t = e?.provider?.runtime?.authFetcher;
@@ -3932,8 +3939,8 @@ var gd = {
3932
3939
  return ci(e);
3933
3940
  },
3934
3941
  renderToolbar(e, t) {
3935
- const { calculatorType: r, availableTypes: n, displayName: i } = pd(t), o = Uo(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = dd(t.toolCoordinator, o), l = a ?? nt(this.toolId, e, t, s);
3936
- a || hd(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Ps(l, r, n);
3942
+ const { calculatorType: r, availableTypes: n, displayName: i } = gd(t), o = Uo(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = hd(t.toolCoordinator, o), l = a ?? nt(this.toolId, e, t, s);
3943
+ a || pd(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Ps(l, r, n);
3937
3944
  const c = r === null ? "Open scientific calculator" : `Open ${i.toLowerCase()}`, u = r === null ? "Close scientific calculator" : `Close ${i.toLowerCase()}`, f = {
3938
3945
  toolId: this.toolId,
3939
3946
  label: i,
@@ -4053,11 +4060,11 @@ var gd = {
4053
4060
  text: f,
4054
4061
  map: r
4055
4062
  };
4056
- }, Ri = null, Ns = Promise.resolve(), md = (e) => (e || "en").split("-")[0].toLowerCase() || "en", vd = async () => (Ri || (Ri = import("./sre-9f9M4fxI.js").then((e) => /* @__PURE__ */ Dc(e.default, 1)).then((e) => {
4063
+ }, Ri = null, Ns = Promise.resolve(), vd = (e) => (e || "en").split("-")[0].toLowerCase() || "en", bd = async () => (Ri || (Ri = import("./sre-9f9M4fxI.js").then((e) => /* @__PURE__ */ Wc(e.default, 1)).then((e) => {
4057
4064
  const t = e.default || e;
4058
4065
  if (!t || typeof t.toSpeech != "function") throw new Error("speech-rule-engine did not expose toSpeech");
4059
4066
  return t;
4060
- })), Ri), bd = (e) => e === "en" ? "clearspeak" : "mathspeak", $s = (e) => !!e && typeof e == "object" && !Array.isArray(e), Ds = (e) => typeof e == "string" && e.trim() ? e.trim() : void 0, fi = (e) => {
4067
+ })), Ri), yd = (e) => e === "en" ? "clearspeak" : "mathspeak", $s = (e) => !!e && typeof e == "object" && !Array.isArray(e), Ds = (e) => typeof e == "string" && e.trim() ? e.trim() : void 0, fi = (e) => {
4061
4068
  if (!$s(e)) return;
4062
4069
  const t = Ds(e.domain), r = Ds(e.style), n = $s(e.engineOptions) ? e.engineOptions : void 0;
4063
4070
  if (!(!t && !r && !n))
@@ -4066,24 +4073,24 @@ var gd = {
4066
4073
  ...r ? { style: r } : {},
4067
4074
  ...n ? { engineOptions: n } : {}
4068
4075
  };
4069
- }, yd = async (e, t, r, n) => {
4070
- const i = md(t), o = fi(n);
4076
+ }, _d = async (e, t, r, n) => {
4077
+ const i = vd(t), o = fi(n);
4071
4078
  await e.setupEngine?.({
4072
4079
  ...o?.engineOptions || {},
4073
4080
  locale: i,
4074
- domain: o?.domain || bd(i),
4081
+ domain: o?.domain || yd(i),
4075
4082
  ...o?.style ? { style: o.style } : {},
4076
4083
  modality: "speech",
4077
4084
  markup: r
4078
4085
  }), await e.engineReady?.();
4079
- }, _d = async (e) => {
4086
+ }, Td = async (e) => {
4080
4087
  const t = Ns.then(e, e);
4081
4088
  return Ns = t.then(() => {
4082
4089
  }, () => {
4083
4090
  }), t;
4084
- }, Il = async (e, t, r, n, i) => _d(async () => (await yd(e, r, n, i), e.toSpeech(t))), Td = (e) => e.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), wd = async (e, t, r, n) => {
4091
+ }, Il = async (e, t, r, n, i) => Td(async () => (await _d(e, r, n, i), e.toSpeech(t))), Sd = (e) => e.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), wd = async (e, t, r, n) => {
4085
4092
  try {
4086
- const i = Td(await Il(e, t, r, "ssml", n));
4093
+ const i = Sd(await Il(e, t, r, "ssml", n));
4087
4094
  return i.includes("<speak") ? i : null;
4088
4095
  } catch (i) {
4089
4096
  return console.debug("[TTSService] Math SSML generation failed; using plain", { message: i instanceof Error ? i.message : String(i) }), null;
@@ -4095,7 +4102,7 @@ var gd = {
4095
4102
  usedFallback: !1
4096
4103
  };
4097
4104
  let r = null, n = !1, i = !1;
4098
- const o = t.loadSre || vd, s = [];
4105
+ const o = t.loadSre || bd, s = [];
4099
4106
  for (const c of e) {
4100
4107
  if (c.type === "text") {
4101
4108
  s.push(c.text);
@@ -4121,12 +4128,12 @@ var gd = {
4121
4128
  usedFallback: i,
4122
4129
  ssml: l
4123
4130
  };
4124
- }, Sd = /* @__PURE__ */ new Set([
4131
+ }, kd = /* @__PURE__ */ new Set([
4125
4132
  "reserved-row",
4126
4133
  "expanding-row",
4127
4134
  "floating-overlay",
4128
4135
  "left-aligned"
4129
- ]), Ws = (e) => e && typeof e == "object" ? e : {}, kd = (e) => e === "polly" || e === "google" || e === "server", Ce = (e, t) => e === void 0 ? t : e, ti = (e, t = "left-aligned") => typeof e == "string" && Sd.has(e) ? e : t, zs = Object.freeze([0.8, 1.25]), Hs = (e) => {
4136
+ ]), Ws = (e) => e && typeof e == "object" ? e : {}, Ed = (e) => e === "polly" || e === "google" || e === "server", Ce = (e, t) => e === void 0 ? t : e, ti = (e, t = "left-aligned") => typeof e == "string" && kd.has(e) ? e : t, Hs = Object.freeze([0.8, 1.25]), zs = (e) => {
4130
4137
  if (typeof e != "number" || !Number.isFinite(e) || e <= 0) return;
4131
4138
  const t = Math.round(e * 100) / 100;
4132
4139
  return t === 1 ? void 0 : t;
@@ -4134,10 +4141,10 @@ var gd = {
4134
4141
  if (typeof e != "string") return;
4135
4142
  const t = e.trim();
4136
4143
  return t.length ? t : void 0;
4137
- }, Bs = (e) => `${e}x`, Ll = (e, t) => t ? `Speed ${e}` : `${e} speed`, Ed = (e, t, r) => t ? t.toLowerCase().includes(e.toLowerCase()) ? t : `${e} ${t}` : Ll(e, r), Ad = (e) => {
4138
- if (typeof e == "number") return Hs(e);
4144
+ }, Bs = (e) => `${e}x`, Ll = (e, t) => t ? `Speed ${e}` : `${e} speed`, Ad = (e, t, r) => t ? t.toLowerCase().includes(e.toLowerCase()) ? t : `${e} ${t}` : Ll(e, r), xd = (e) => {
4145
+ if (typeof e == "number") return zs(e);
4139
4146
  if (!e || typeof e != "object" || Array.isArray(e)) return;
4140
- const t = e, r = Hs(t.rate);
4147
+ const t = e, r = zs(t.rate);
4141
4148
  if (r === void 0) return;
4142
4149
  const n = Fs(t.label), i = Fs(t.ariaLabel);
4143
4150
  return {
@@ -4146,17 +4153,17 @@ var gd = {
4146
4153
  ...i ? { ariaLabel: i } : {}
4147
4154
  };
4148
4155
  }, no = (e) => {
4149
- if (!Array.isArray(e)) return [...zs];
4156
+ if (!Array.isArray(e)) return [...Hs];
4150
4157
  if (e.length === 0) return [];
4151
4158
  const t = /* @__PURE__ */ new Set(), r = [];
4152
4159
  for (const n of e) {
4153
- const i = Ad(n);
4160
+ const i = xd(n);
4154
4161
  if (i === void 0) continue;
4155
4162
  const o = typeof i == "number" ? i : i.rate;
4156
4163
  t.has(o) || (t.add(o), r.push(i));
4157
4164
  }
4158
- return r.length ? r : [...zs];
4159
- }, xd = (e) => no(e).map((t) => {
4165
+ return r.length ? r : [...Hs];
4166
+ }, Cd = (e) => no(e).map((t) => {
4160
4167
  if (typeof t == "number") {
4161
4168
  const i = Bs(t);
4162
4169
  return {
@@ -4169,14 +4176,14 @@ var gd = {
4169
4176
  return {
4170
4177
  rate: t.rate,
4171
4178
  label: n,
4172
- ariaLabel: Ed(n, t.ariaLabel, n === r)
4179
+ ariaLabel: Ad(n, t.ariaLabel, n === r)
4173
4180
  };
4174
- }), Cd = (e) => {
4181
+ }), Md = (e) => {
4175
4182
  const t = {
4176
4183
  ...e,
4177
4184
  layoutMode: ti(e.layoutMode)
4178
4185
  }, r = e.backend || "browser";
4179
- if (!kd(r)) return t;
4186
+ if (!Ed(r)) return t;
4180
4187
  const n = {
4181
4188
  ...t,
4182
4189
  apiEndpoint: Ce(t.apiEndpoint, "/api/tts"),
@@ -4199,11 +4206,11 @@ var gd = {
4199
4206
  } : n;
4200
4207
  }, Li = (e) => {
4201
4208
  const t = Ws(e), r = Ws(t.settings);
4202
- return Cd({
4209
+ return Md({
4203
4210
  ...t,
4204
4211
  ...r
4205
4212
  });
4206
- }, io = (e) => e.backend || "browser", Pl = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, Nl = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), Md = (e) => {
4213
+ }, io = (e) => e.backend || "browser", Pl = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, Nl = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), Od = (e) => {
4207
4214
  const t = io(e), r = Pl(e, t), n = Nl(e, r), i = fi(e.mathSpeech);
4208
4215
  return {
4209
4216
  voice: e.defaultVoice,
@@ -4230,7 +4237,7 @@ var gd = {
4230
4237
  validateEndpoint: e.validateEndpoint,
4231
4238
  ...typeof e.mathTokenHighlighting == "boolean" ? { mathTokenHighlighting: e.mathTokenHighlighting } : {}
4232
4239
  };
4233
- }, $l = (e) => ti(e.layoutMode), Od = (e) => {
4240
+ }, $l = (e) => ti(e.layoutMode), Id = (e) => {
4234
4241
  switch ($l(e)) {
4235
4242
  case "reserved-row":
4236
4243
  return {
@@ -4257,21 +4264,21 @@ var gd = {
4257
4264
  }
4258
4265
  };
4259
4266
  }
4260
- }, Br = /* @__PURE__ */ new Map(), Id = "__pieToolElementUnmount", Us = "pie-tool-active-change", Rd = {
4267
+ }, Br = /* @__PURE__ */ new Map(), Rd = "__pieToolElementUnmount", Us = "pie-tool-active-change", Ld = {
4261
4268
  toolId: "textToSpeech",
4262
4269
  name: "Text to Speech",
4263
4270
  description: "Read content aloud",
4264
4271
  icon: "volume-up",
4265
4272
  provider: {
4266
4273
  getProviderId: () => "tts",
4267
- createProvider: (e) => new sd(io(Li(e))),
4274
+ createProvider: (e) => new ad(io(Li(e))),
4268
4275
  getInitConfig: (e) => {
4269
4276
  const t = Li(e), r = io(t), n = Pl(t, r);
4270
4277
  return {
4271
4278
  backend: r,
4272
4279
  serverProvider: n,
4273
4280
  transportMode: Nl(t, n),
4274
- ...Md(t)
4281
+ ...Od(t)
4275
4282
  };
4276
4283
  },
4277
4284
  getAuthFetcher: (e) => {
@@ -4297,12 +4304,12 @@ var gd = {
4297
4304
  return ui(e);
4298
4305
  },
4299
4306
  renderToolbar(e, t) {
4300
- const r = () => Li(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), n = () => xd(r().speedOptions), i = () => $l(r()), o = () => Od(r()), s = Uo(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
4307
+ const r = () => Li(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), n = () => Cd(r().speedOptions), i = () => $l(r()), o = () => Id(r()), s = Uo(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
4301
4308
  const u = t.ui?.size;
4302
4309
  return u === "sm" || u === "lg" ? u : "md";
4303
4310
  }, l = () => {
4304
4311
  let u = Br.get(s);
4305
- return u && typeof u.isConnected == "boolean" && !u.isConnected && (Br.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[Id] = () => {
4312
+ return u && typeof u.isConnected == "boolean" && !u.isConnected && (Br.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[Rd] = () => {
4306
4313
  Br.get(s) === u && Br.delete(s);
4307
4314
  }, Br.set(s, u)), u.setAttribute("tool-id", s), u.setAttribute("catalog-id", t.catalogId || t.itemId), u.setAttribute("language", t.language || "en-US"), u.setAttribute("size", a()), u.setAttribute("layout-mode", i()), u.speedOptions = n(), u;
4308
4315
  }, c = o();
@@ -4351,7 +4358,7 @@ function _t(e) {
4351
4358
  function qo(e, t) {
4352
4359
  e.setAttribute("data-pie-tool-surface", t);
4353
4360
  }
4354
- var Ld = {
4361
+ var Pd = {
4355
4362
  toolId: "ruler",
4356
4363
  name: "Ruler",
4357
4364
  description: "On-screen ruler for measurements",
@@ -4393,7 +4400,7 @@ var Ld = {
4393
4400
  subscribeActive: r.subscribeActive
4394
4401
  };
4395
4402
  }
4396
- }, Pd = {
4403
+ }, Nd = {
4397
4404
  toolId: "protractor",
4398
4405
  name: "Protractor",
4399
4406
  description: "On-screen protractor for angle measurements",
@@ -4435,7 +4442,7 @@ var Ld = {
4435
4442
  subscribeActive: r.subscribeActive
4436
4443
  };
4437
4444
  }
4438
- }, Nd = {
4445
+ }, $d = {
4439
4446
  toolId: "answerEliminator",
4440
4447
  name: "Answer Eliminator",
4441
4448
  description: "Strike through answer choices",
@@ -4448,7 +4455,7 @@ var Ld = {
4448
4455
  "choiceMasking"
4449
4456
  ],
4450
4457
  isVisibleInContext(e) {
4451
- return Xf(e);
4458
+ return Jf(e);
4452
4459
  },
4453
4460
  renderToolbar(e, t) {
4454
4461
  const r = yt(this.toolId, t), n = t.componentOverrides ?? {}, i = nt(this.toolId, e, t, n);
@@ -4482,7 +4489,7 @@ var Ld = {
4482
4489
  subscribeActive: r.subscribeActive
4483
4490
  };
4484
4491
  }
4485
- }, $d = {
4492
+ }, Dd = {
4486
4493
  toolId: "highlighter",
4487
4494
  name: "Highlighter",
4488
4495
  description: "Highlight text",
@@ -4533,7 +4540,7 @@ var Ld = {
4533
4540
  subscribeActive: r.subscribeActive
4534
4541
  };
4535
4542
  }
4536
- }, Dd = {
4543
+ }, Wd = {
4537
4544
  toolId: "lineReader",
4538
4545
  name: "Line Reader",
4539
4546
  description: "Reading guide overlay",
@@ -4582,7 +4589,7 @@ var Ld = {
4582
4589
  subscribeActive: r.subscribeActive
4583
4590
  };
4584
4591
  }
4585
- }, Wd = {
4592
+ }, Hd = {
4586
4593
  toolId: "theme",
4587
4594
  name: "Theme",
4588
4595
  description: "Accessible themes and contrast",
@@ -4688,7 +4695,7 @@ var Ld = {
4688
4695
  subscribeActive: r.subscribeActive
4689
4696
  };
4690
4697
  }
4691
- }, Hd = {
4698
+ }, Fd = {
4692
4699
  toolId: "graph",
4693
4700
  name: "Graph",
4694
4701
  description: "Graphing calculator and coordinate plane",
@@ -4741,7 +4748,7 @@ var Ld = {
4741
4748
  subscribeActive: r.subscribeActive
4742
4749
  };
4743
4750
  }
4744
- }, Fd = {
4751
+ }, Bd = {
4745
4752
  toolId: "periodicTable",
4746
4753
  name: "Periodic Table",
4747
4754
  description: "Chemistry periodic table reference",
@@ -4753,7 +4760,7 @@ var Ld = {
4753
4760
  "elementReference"
4754
4761
  ],
4755
4762
  isVisibleInContext(e) {
4756
- return Jf(e);
4763
+ return Qf(e);
4757
4764
  },
4758
4765
  renderToolbar(e, t) {
4759
4766
  const r = yt(this.toolId, t), n = {
@@ -4793,21 +4800,21 @@ var Ld = {
4793
4800
  subscribeActive: r.subscribeActive
4794
4801
  };
4795
4802
  }
4796
- }, Bd = [
4797
- gd,
4798
- Rd,
4803
+ }, Ud = [
4804
+ md,
4799
4805
  Ld,
4800
4806
  Pd,
4801
4807
  Nd,
4802
4808
  $d,
4803
4809
  Dd,
4804
4810
  Wd,
4805
- zd,
4806
4811
  Hd,
4807
- Fd
4812
+ zd,
4813
+ Fd,
4814
+ Bd
4808
4815
  ];
4809
- function Ud(e = {}) {
4810
- const t = new Gf(), r = {
4816
+ function jd(e = {}) {
4817
+ const t = new Yf(), r = {
4811
4818
  toolTagMap: {
4812
4819
  ...xl,
4813
4820
  ...e.toolTagMap || {}
@@ -4815,32 +4822,32 @@ function Ud(e = {}) {
4815
4822
  toolComponentFactory: e.toolComponentFactory,
4816
4823
  toolComponentFactories: e.toolComponentFactories
4817
4824
  }, n = (i) => e.overrides?.[i.toolId] || i;
4818
- return e.includePackagedTools && jd(t, {
4825
+ return e.includePackagedTools && qd(t, {
4819
4826
  toolIds: e.toolIds,
4820
4827
  applyOverrides: n
4821
4828
  }), e.toolModuleLoaders && Object.keys(e.toolModuleLoaders).length > 0 && t.setToolModuleLoaders(e.toolModuleLoaders), t.setComponentOverrides(r), t;
4822
4829
  }
4823
- function jd(e, t = {}) {
4830
+ function qd(e, t = {}) {
4824
4831
  const r = t.toolIds && t.toolIds.length > 0 ? new Set(t.toolIds) : null, n = t.applyOverrides || ((i) => i);
4825
- for (const i of Bd)
4832
+ for (const i of Ud)
4826
4833
  r && !r.has(i.toolId) || e.register(n(i));
4827
4834
  }
4828
- function qd(e = {}) {
4829
- return Ud({
4835
+ function Vd(e = {}) {
4836
+ return jd({
4830
4837
  ...e,
4831
4838
  includePackagedTools: !0
4832
4839
  });
4833
4840
  }
4834
- function Vd() {
4835
- const e = qd(), t = /* @__PURE__ */ new Set();
4841
+ function Gd() {
4842
+ const e = Vd(), t = /* @__PURE__ */ new Set();
4836
4843
  for (const r of e.getAllTools()) for (const n of r.pnpSupportIds || []) t.add(n);
4837
4844
  return [...t].sort();
4838
4845
  }
4839
- var Gd = Vd(), em = {
4840
- supports: [...Gd],
4846
+ var Yd = Gd(), em = {
4847
+ supports: [...Yd],
4841
4848
  prohibitedSupports: [],
4842
4849
  activateAtInit: []
4843
- }, Yd = {
4850
+ }, Kd = {
4844
4851
  visual: {
4845
4852
  magnification: "magnification",
4846
4853
  screenMagnifier: "screenMagnifier",
@@ -4953,11 +4960,11 @@ var Gd = Vd(), em = {
4953
4960
  itemGlossary: "itemGlossary",
4954
4961
  tutorialAvailable: "tutorialAvailable"
4955
4962
  }
4956
- }, tm = Object.values(Yd).flatMap((e) => Object.values(e)), rm = Tl("ToolCoordinator"), oo;
4963
+ }, tm = Object.values(Kd).flatMap((e) => Object.values(e)), rm = Tl("ToolCoordinator"), oo;
4957
4964
  (function(e) {
4958
4965
  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";
4959
4966
  })(oo || (oo = {}));
4960
- var Kd = /* @__PURE__ */ new Set([
4967
+ var Xd = /* @__PURE__ */ new Set([
4961
4968
  "speak",
4962
4969
  "p",
4963
4970
  "s",
@@ -4971,7 +4978,7 @@ var Kd = /* @__PURE__ */ new Set([
4971
4978
  char: t[n],
4972
4979
  rawOffset: r === null ? null : r + n
4973
4980
  });
4974
- }, Xd = (e, t, r) => {
4981
+ }, Jd = (e, t, r) => {
4975
4982
  const n = t.slice(r).match(/^&(quot|apos|lt|gt|nbsp|amp|#160);/i);
4976
4983
  return n ? ($n(e, Dl(n[0]), r), n[0].length) : 0;
4977
4984
  }, qs = (e) => {
@@ -4979,7 +4986,7 @@ var Kd = /* @__PURE__ */ new Set([
4979
4986
  char: " ",
4980
4987
  rawOffset: null
4981
4988
  });
4982
- }, Jd = (e) => {
4989
+ }, Qd = (e) => {
4983
4990
  const t = /* @__PURE__ */ new Map(), r = [];
4984
4991
  let n = !0;
4985
4992
  for (const i of e) {
@@ -4995,7 +5002,7 @@ var Kd = /* @__PURE__ */ new Set([
4995
5002
  text: r.join(""),
4996
5003
  rawToSpokenOffsetMap: t
4997
5004
  };
4998
- }, Qd = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", Zd = (e, t) => {
5005
+ }, Zd = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", eh = (e, t) => {
4999
5006
  const r = new RegExp(`${t}\\s*=\\s*("([^"]*)"|'([^']*)')`, "i"), n = e.match(r);
5000
5007
  return Dl(n?.[2] ?? n?.[3] ?? "") || null;
5001
5008
  }, Wl = (e) => {
@@ -5005,7 +5012,7 @@ var Kd = /* @__PURE__ */ new Set([
5005
5012
  const s = e[i];
5006
5013
  if (s !== "<") {
5007
5014
  if (s === "&") {
5008
- const h = Xd(t, e, i);
5015
+ const h = Jd(t, e, i);
5009
5016
  if (h > 0) {
5010
5017
  i += h;
5011
5018
  continue;
@@ -5020,9 +5027,9 @@ var Kd = /* @__PURE__ */ new Set([
5020
5027
  continue;
5021
5028
  }
5022
5029
  n = !0;
5023
- const l = e.slice(i, a + 1), c = Qd(l), u = /^<\s*\//.test(l), f = /\/\s*>$/.test(l);
5030
+ const l = e.slice(i, a + 1), c = Zd(l), u = /^<\s*\//.test(l), f = /\/\s*>$/.test(l);
5024
5031
  if (!u && c === "sub") {
5025
- const h = Zd(l, "alias");
5032
+ const h = eh(l, "alias");
5026
5033
  if (!h) {
5027
5034
  r = !0, i = a + 1;
5028
5035
  continue;
@@ -5040,16 +5047,16 @@ var Kd = /* @__PURE__ */ new Set([
5040
5047
  i = a + 1;
5041
5048
  continue;
5042
5049
  }
5043
- c && !Kd.has(c) && !js.has(c) && c !== "break" && c !== "sub" && (r = !0), !u && (c === "p" || c === "s") && qs(t), i = a + 1;
5050
+ c && !Xd.has(c) && !js.has(c) && c !== "break" && c !== "sub" && (r = !0), !u && (c === "p" || c === "s") && qs(t), i = a + 1;
5044
5051
  }
5045
- const o = Jd(t);
5052
+ const o = Qd(t);
5046
5053
  return {
5047
5054
  spokenText: X(o.text),
5048
5055
  rawToSpokenOffsetMap: o.rawToSpokenOffsetMap,
5049
5056
  unsupportedSemantic: r,
5050
5057
  hasMarkup: n
5051
5058
  };
5052
- }, eh = Cl(), zl = /* @__PURE__ */ new Map([
5059
+ }, th = Cl(), Hl = /* @__PURE__ */ new Map([
5053
5060
  ["zero", "0"],
5054
5061
  ["one", "1"],
5055
5062
  ["two", "2"],
@@ -5061,7 +5068,7 @@ var Kd = /* @__PURE__ */ new Set([
5061
5068
  ["eight", "8"],
5062
5069
  ["nine", "9"],
5063
5070
  ["ten", "10"]
5064
- ]), th = [
5071
+ ]), rh = [
5065
5072
  {
5066
5073
  phrase: [
5067
5074
  "plus",
@@ -5138,7 +5145,7 @@ var Kd = /* @__PURE__ */ new Set([
5138
5145
  }
5139
5146
  ], so = (e) => {
5140
5147
  const t = [];
5141
- for (const r of e.matchAll(eh)) {
5148
+ for (const r of e.matchAll(th)) {
5142
5149
  const n = r[0], i = r.index ?? 0;
5143
5150
  t.push({
5144
5151
  text: n,
@@ -5148,7 +5155,7 @@ var Kd = /* @__PURE__ */ new Set([
5148
5155
  });
5149
5156
  }
5150
5157
  return t;
5151
- }, ao = (e) => zl.get(e.normalized) || e.normalized, rh = (e, t) => {
5158
+ }, ao = (e) => Hl.get(e.normalized) || e.normalized, nh = (e, t) => {
5152
5159
  const r = [];
5153
5160
  for (let n = 0; n < e.length; n++) {
5154
5161
  for (let i = 0; i < t.length; i++) ao(e[n]) === ao(t[i]) && r.push({
@@ -5157,7 +5164,7 @@ var Kd = /* @__PURE__ */ new Set([
5157
5164
  visibleToken: i,
5158
5165
  score: 10
5159
5166
  });
5160
- for (const i of th) {
5167
+ for (const i of rh) {
5161
5168
  const o = e.slice(n, n + i.phrase.length);
5162
5169
  if (o.length === i.phrase.length && o.every((s, a) => s.normalized === i.phrase[a]))
5163
5170
  for (let s = 0; s < t.length; s++)
@@ -5170,8 +5177,8 @@ var Kd = /* @__PURE__ */ new Set([
5170
5177
  }
5171
5178
  }
5172
5179
  return r;
5173
- }, nh = (e, t) => {
5174
- const r = rh(e, t).sort((l, c) => e[l.spokenStartToken].start - e[c.spokenStartToken].start || t[l.visibleToken].start - t[c.visibleToken].start), n = new Array(r.length).fill(0), i = new Array(r.length).fill(-1);
5180
+ }, ih = (e, t) => {
5181
+ const r = nh(e, t).sort((l, c) => e[l.spokenStartToken].start - e[c.spokenStartToken].start || t[l.visibleToken].start - t[c.visibleToken].start), n = new Array(r.length).fill(0), i = new Array(r.length).fill(-1);
5175
5182
  for (let l = 0; l < r.length; l++) {
5176
5183
  const c = r[l];
5177
5184
  n[l] = c.score;
@@ -5200,12 +5207,12 @@ var Kd = /* @__PURE__ */ new Set([
5200
5207
  score: l.score
5201
5208
  };
5202
5209
  });
5203
- }, ih = (e, t, r) => {
5210
+ }, oh = (e, t, r) => {
5204
5211
  if (e.length === 0) return 0;
5205
5212
  const n = e.length / Math.max(1, Math.min(t.length, r.length)), i = e.reduce((o, s) => o + s.score, 0) / e.length / 10;
5206
5213
  return Math.min(1, n * i);
5207
- }, Hl = (e) => {
5208
- const t = Wl(e.speechText), r = X(e.visibleText), n = t.spokenText, i = so(n), o = so(r), s = t.unsupportedSemantic ? [] : nh(i, o), a = ih(s, i, o), l = n === r && n.length > 0, c = s.length === 1 && s[0].score === 10 && i.length <= 2 && o.length <= 2, u = t.unsupportedSemantic ? "region-fallback" : l ? "exact-word" : (s.length >= 2 || c) && a >= 0.12 ? "anchor-span" : "region-fallback", f = t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text";
5214
+ }, zl = (e) => {
5215
+ const t = Wl(e.speechText), r = X(e.visibleText), n = t.spokenText, i = so(n), o = so(r), s = t.unsupportedSemantic ? [] : ih(i, o), a = oh(s, i, o), l = n === r && n.length > 0, c = s.length === 1 && s[0].score === 10 && i.length <= 2 && o.length <= 2, u = t.unsupportedSemantic ? "region-fallback" : l ? "exact-word" : (s.length >= 2 || c) && a >= 0.12 ? "anchor-span" : "region-fallback", f = t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text";
5209
5216
  return {
5210
5217
  speechText: e.speechText,
5211
5218
  spokenText: n,
@@ -5221,7 +5228,7 @@ var Kd = /* @__PURE__ */ new Set([
5221
5228
  }, Vo = (e, t) => e.find((r) => r.start <= t && t < r.end) || null, Fl = (e) => {
5222
5229
  if (!e || /^<[^>]+>$/.test(e.trim())) return null;
5223
5230
  const t = so(e)[0];
5224
- return t ? zl.get(t.normalized) || t.normalized : null;
5231
+ return t ? Hl.get(t.normalized) || t.normalized : null;
5225
5232
  }, Vs = (e, t, r) => {
5226
5233
  const n = Fl(r);
5227
5234
  if (!t || !n) return !1;
@@ -5251,7 +5258,7 @@ var Kd = /* @__PURE__ */ new Set([
5251
5258
  start: t,
5252
5259
  length: Math.min(r, n.end - t)
5253
5260
  } : null;
5254
- }, oh = (e, t, r = 1, n) => {
5261
+ }, sh = (e, t, r = 1, n) => {
5255
5262
  if (e.boundaryOffsetMode === "unsupported" || !Number.isFinite(t)) return null;
5256
5263
  const i = Math.max(1, Number.isFinite(r) ? r : 1);
5257
5264
  if (n && /^<[^>]+>$/.test(n.trim())) return null;
@@ -5265,7 +5272,7 @@ var Kd = /* @__PURE__ */ new Set([
5265
5272
  return o || s;
5266
5273
  }
5267
5274
  return Ks(e, t, i) || Ys(e, t, i);
5268
- }, sh = (e, t) => {
5275
+ }, ah = (e, t) => {
5269
5276
  if (e.playbackMode === "region-fallback") return null;
5270
5277
  const r = e.anchors.find((o) => o.spokenStart <= t && t < o.spokenEnd);
5271
5278
  if (r) return {
@@ -5287,7 +5294,7 @@ var Kd = /* @__PURE__ */ new Set([
5287
5294
  start: Math.min(n.visibleStart, i.visibleStart),
5288
5295
  end: Math.max(n.visibleEnd, i.visibleEnd)
5289
5296
  } : null;
5290
- }, ah = /* @__PURE__ */ new Map([
5297
+ }, lh = /* @__PURE__ */ new Map([
5291
5298
  ["+", ["plus"]],
5292
5299
  ["-", ["minus", "negative"]],
5293
5300
  ["−", ["minus", "negative"]],
@@ -5311,12 +5318,12 @@ var Kd = /* @__PURE__ */ new Set([
5311
5318
  ["•", ["times"]],
5312
5319
  ["·", ["times"]],
5313
5320
  ["⁢", ["times", "multiplied by"]]
5314
- ]), lh = /* @__PURE__ */ new Map([
5321
+ ]), ch = /* @__PURE__ */ new Map([
5315
5322
  ["⁡", "function-application"],
5316
5323
  ["⁢", "implicit-multiply"],
5317
5324
  ["⁣", "invisible-separator"],
5318
5325
  ["⁤", "invisible-plus"]
5319
- ]), Bl = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), ch = /* @__PURE__ */ new Map([
5326
+ ]), Bl = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), uh = /* @__PURE__ */ new Map([
5320
5327
  ["msqrt", "radical"],
5321
5328
  ["mroot", "radical"],
5322
5329
  ["msub", "subscript"],
@@ -5326,11 +5333,11 @@ var Kd = /* @__PURE__ */ new Set([
5326
5333
  ["munderover", "underoverscript"],
5327
5334
  ["mmultiscripts", "multiscript"],
5328
5335
  ["menclose", "enclosure"]
5329
- ]), uh = (e) => e.replace(/\s+/g, " ").trim(), Jt = (e) => (e.localName || e.tagName || "").toLowerCase(), fh = (e) => e.nodeType === Node.ELEMENT_NODE, Lr = (e) => Array.from(e.childNodes).filter(fh), Go = (e) => uh(e.textContent || ""), vt = (e, t) => ({
5336
+ ]), fh = (e) => e.replace(/\s+/g, " ").trim(), Jt = (e) => (e.localName || e.tagName || "").toLowerCase(), dh = (e) => e.nodeType === Node.ELEMENT_NODE, Lr = (e) => Array.from(e.childNodes).filter(dh), Go = (e) => fh(e.textContent || ""), vt = (e, t) => ({
5330
5337
  type: "element-range",
5331
5338
  quality: t,
5332
5339
  element: e
5333
- }), dh = (e) => {
5340
+ }), hh = (e) => {
5334
5341
  switch (e) {
5335
5342
  case "mi":
5336
5343
  return "identifier";
@@ -5346,15 +5353,15 @@ var Kd = /* @__PURE__ */ new Set([
5346
5353
  default:
5347
5354
  return "unknown";
5348
5355
  }
5349
- }, hh = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), ph = (e, t, r) => r === "fraction" ? ["over", "divided by"] : r === "superscript" ? Bl.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? ah.get(e) || [] : [], tr = (e) => {
5350
- const t = e.normalized ?? hh(e.text, e.kind || "unknown");
5356
+ }, ph = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), gh = (e, t, r) => r === "fraction" ? ["over", "divided by"] : r === "superscript" ? Bl.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? lh.get(e) || [] : [], tr = (e) => {
5357
+ const t = e.normalized ?? ph(e.text, e.kind || "unknown");
5351
5358
  return {
5352
5359
  id: `math-token-${e.state.nextId++}`,
5353
5360
  kind: e.kind,
5354
5361
  role: e.role,
5355
5362
  text: e.text,
5356
5363
  normalized: t,
5357
- spokenAliases: ph(e.text, e.kind, e.role),
5364
+ spokenAliases: gh(e.text, e.kind, e.role),
5358
5365
  sourceElement: e.sourceElement,
5359
5366
  path: e.path,
5360
5367
  target: e.target || vt(e.sourceElement, "element-range"),
@@ -5364,7 +5371,7 @@ var Kd = /* @__PURE__ */ new Set([
5364
5371
  e[r].push(t);
5365
5372
  }, Ul = (e, t, r) => {
5366
5373
  Lr(e).forEach((n, i) => bt(n, t, `${r}/${Jt(n)}[${i}]`));
5367
- }, gh = (e, t, r) => {
5374
+ }, mh = (e, t, r) => {
5368
5375
  const n = Lr(e);
5369
5376
  n[0] && bt(n[0], t, `${r}/numerator`), rr(t, tr({
5370
5377
  state: t,
@@ -5375,7 +5382,7 @@ var Kd = /* @__PURE__ */ new Set([
5375
5382
  path: r,
5376
5383
  target: vt(e, "element-range")
5377
5384
  })), n[1] && bt(n[1], t, `${r}/denominator`);
5378
- }, mh = (e, t, r) => {
5385
+ }, vh = (e, t, r) => {
5379
5386
  const n = e.getAttribute("open") || "(", i = e.getAttribute("close") || ")";
5380
5387
  rr(t, tr({
5381
5388
  state: t,
@@ -5394,7 +5401,7 @@ var Kd = /* @__PURE__ */ new Set([
5394
5401
  path: `${r}/close`,
5395
5402
  target: vt(e, "element-range")
5396
5403
  }));
5397
- }, vh = (e, t, r) => {
5404
+ }, bh = (e, t, r) => {
5398
5405
  const n = Lr(e);
5399
5406
  n[0] && bt(n[0], t, `${r}/base`);
5400
5407
  const i = n[1];
@@ -5414,7 +5421,7 @@ var Kd = /* @__PURE__ */ new Set([
5414
5421
  return;
5415
5422
  }
5416
5423
  bt(i, t, `${r}/exponent`);
5417
- }, bh = (e, t, r, n) => {
5424
+ }, yh = (e, t, r, n) => {
5418
5425
  rr(t, tr({
5419
5426
  state: t,
5420
5427
  kind: "structure",
@@ -5425,7 +5432,7 @@ var Kd = /* @__PURE__ */ new Set([
5425
5432
  path: r,
5426
5433
  target: vt(e, "element-range")
5427
5434
  }));
5428
- }, yh = (e, t, r) => {
5435
+ }, _h = (e, t, r) => {
5429
5436
  let n = 0;
5430
5437
  for (const i of Lr(e))
5431
5438
  (Jt(i) === "mtr" || Jt(i) === "mlabeledtr") && (n++, rr(t, tr({
@@ -5438,10 +5445,10 @@ var Kd = /* @__PURE__ */ new Set([
5438
5445
  path: `${r}/row[${n}]`,
5439
5446
  target: vt(i, "region-fallback")
5440
5447
  }), "layoutTargets")), bt(i, t, `${r}/${Jt(i)}[${n}]`);
5441
- }, _h = (e, t, r) => {
5448
+ }, Th = (e, t, r) => {
5442
5449
  const n = Go(e);
5443
5450
  if (!n) return;
5444
- const i = dh(Jt(e)), o = i === "operator" ? lh.get(n) : void 0, s = o ?? (i === "operator" && (n === "(" || n === ")") ? "grouping-fence" : i);
5451
+ const i = hh(Jt(e)), o = i === "operator" ? ch.get(n) : void 0, s = o ?? (i === "operator" && (n === "(" || n === ")") ? "grouping-fence" : i);
5445
5452
  rr(t, tr({
5446
5453
  state: t,
5447
5454
  kind: i,
@@ -5472,19 +5479,19 @@ var Kd = /* @__PURE__ */ new Set([
5472
5479
  case "mtext":
5473
5480
  case "ms":
5474
5481
  case "mspace":
5475
- _h(e, t, r);
5482
+ Th(e, t, r);
5476
5483
  return;
5477
5484
  case "mfrac":
5478
- gh(e, t, r);
5485
+ mh(e, t, r);
5479
5486
  return;
5480
5487
  case "msup":
5481
- vh(e, t, r);
5488
+ bh(e, t, r);
5482
5489
  return;
5483
5490
  case "mfenced":
5484
- mh(e, t, r);
5491
+ vh(e, t, r);
5485
5492
  return;
5486
5493
  case "mtable":
5487
- yh(e, t, r);
5494
+ _h(e, t, r);
5488
5495
  return;
5489
5496
  case "mphantom":
5490
5497
  return;
@@ -5494,15 +5501,15 @@ var Kd = /* @__PURE__ */ new Set([
5494
5501
  return;
5495
5502
  }
5496
5503
  default: {
5497
- const i = ch.get(n);
5504
+ const i = uh.get(n);
5498
5505
  if (i) {
5499
- bh(e, t, r, i);
5506
+ yh(e, t, r, i);
5500
5507
  return;
5501
5508
  }
5502
5509
  Ul(e, t, r);
5503
5510
  }
5504
5511
  }
5505
- }, Th = (e) => {
5512
+ }, Sh = (e) => {
5506
5513
  const t = {
5507
5514
  tokens: [],
5508
5515
  layoutTargets: [],
@@ -5513,7 +5520,7 @@ var Kd = /* @__PURE__ */ new Set([
5513
5520
  layoutTargets: t.layoutTargets,
5514
5521
  expressionTarget: vt(e, "region-fallback")
5515
5522
  };
5516
- }, wh = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, Sh = 0.95, kh = (e) => {
5523
+ }, wh = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, kh = 0.95, Eh = (e) => {
5517
5524
  const t = [], r = /* @__PURE__ */ new Set(), n = (i) => {
5518
5525
  const o = i.toLowerCase().trim().split(/\s+/).filter(Boolean);
5519
5526
  if (o.length === 0) return;
@@ -5538,11 +5545,11 @@ var Kd = /* @__PURE__ */ new Set([
5538
5545
  o && (n = i.length);
5539
5546
  }
5540
5547
  return n;
5541
- }, Eh = (e, t) => {
5548
+ }, Ah = (e, t) => {
5542
5549
  const r = [];
5543
5550
  let n = 0;
5544
5551
  for (const i of t) {
5545
- const o = kh(i);
5552
+ const o = Eh(i);
5546
5553
  if (i.optional) {
5547
5554
  const s = Xs(e, n, o);
5548
5555
  s > 0 && (r.push({
@@ -5564,23 +5571,23 @@ var Kd = /* @__PURE__ */ new Set([
5564
5571
  }
5565
5572
  }
5566
5573
  return r;
5567
- }, Ah = (e, t, r) => {
5574
+ }, xh = (e, t, r) => {
5568
5575
  const n = r.filter((s) => !s.optional).length, i = e.filter((s) => !s.math.optional).length, o = e.reduce((s, a) => s + a.speechTokens.length, 0);
5569
5576
  return n > 0 && i === n && o === t.length;
5570
- }, xh = (e) => e.map(({ speechTokens: t, math: r }) => ({
5577
+ }, Ch = (e) => e.map(({ speechTokens: t, math: r }) => ({
5571
5578
  speechTokenIds: t.map((n) => n.id),
5572
5579
  mathTokenIds: [r.id],
5573
5580
  score: 1,
5574
5581
  confidence: 1,
5575
5582
  target: r.target
5576
- })), Ch = (e) => {
5577
- const t = e.minExactWordConfidence ?? Sh, r = Eh(e.speech.tokens, e.math.tokens), n = Ah(r, e.speech.tokens, e.math.tokens) ? 1 : 0;
5583
+ })), Mh = (e) => {
5584
+ const t = e.minExactWordConfidence ?? kh, r = Ah(e.speech.tokens, e.math.tokens), n = xh(r, e.speech.tokens, e.math.tokens) ? 1 : 0;
5578
5585
  return {
5579
- segments: n >= t ? xh(r) : [],
5586
+ segments: n >= t ? Ch(r) : [],
5580
5587
  confidence: n,
5581
5588
  fallbackTarget: e.math.expressionTarget
5582
5589
  };
5583
- }, jl = Cl(), Mh = /* @__PURE__ */ new Map([
5590
+ }, jl = Cl(), Oh = /* @__PURE__ */ new Map([
5584
5591
  ["zero", "0"],
5585
5592
  ["one", "1"],
5586
5593
  ["two", "2"],
@@ -5594,8 +5601,8 @@ var Kd = /* @__PURE__ */ new Set([
5594
5601
  ["ten", "10"]
5595
5602
  ]), ql = (e) => {
5596
5603
  const t = e.toLowerCase();
5597
- return Mh.get(t) || t;
5598
- }, Oh = (e) => {
5604
+ return Oh.get(t) || t;
5605
+ }, Ih = (e) => {
5599
5606
  const t = [];
5600
5607
  for (const r of e.matchAll(jl)) {
5601
5608
  const n = r[0], i = r.index ?? 0;
@@ -5616,7 +5623,7 @@ var Kd = /* @__PURE__ */ new Set([
5616
5623
  return {
5617
5624
  speechText: e.speechText,
5618
5625
  spokenText: t.spokenText,
5619
- tokens: Oh(t.spokenText),
5626
+ tokens: Ih(t.spokenText),
5620
5627
  rawToSpokenOffsetMap: t.rawToSpokenOffsetMap,
5621
5628
  boundaryOffsetSpace: t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text",
5622
5629
  unsupportedSemantic: t.unsupportedSemantic,
@@ -5626,7 +5633,7 @@ var Kd = /* @__PURE__ */ new Set([
5626
5633
  if (!e || /^<[^>]+>$/.test(e.trim())) return null;
5627
5634
  const t = e.match(jl);
5628
5635
  return t?.[0] ? ql(t[0]) : null;
5629
- }, Ih = (e, t) => e.find((r) => r.start <= t && t < r.end) || null, Rh = (e, t) => {
5636
+ }, Rh = (e, t) => e.find((r) => r.start <= t && t < r.end) || null, Lh = (e, t) => {
5630
5637
  const r = e.rawToSpokenOffsetMap.get(t);
5631
5638
  if (r !== void 0) return r;
5632
5639
  for (let n = t; n < e.speechText.length; n++) {
@@ -5637,7 +5644,7 @@ var Kd = /* @__PURE__ */ new Set([
5637
5644
  return null;
5638
5645
  }, lo = (e, t, r) => {
5639
5646
  if (t === null) return null;
5640
- const n = Ih(e.tokens, t);
5647
+ const n = Rh(e.tokens, t);
5641
5648
  return n ? {
5642
5649
  token: n,
5643
5650
  start: t,
@@ -5647,9 +5654,9 @@ var Kd = /* @__PURE__ */ new Set([
5647
5654
  }, co = (e, t) => {
5648
5655
  const r = Yo(t);
5649
5656
  return !!(e && r && e.token.normalized === r);
5650
- }, Lh = (e) => {
5657
+ }, Ph = (e) => {
5651
5658
  if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
5652
- const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), r = lo(e.tokenization, Rh(e.tokenization, e.position), t), n = lo(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5659
+ const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), r = lo(e.tokenization, Lh(e.tokenization, e.position), t), n = lo(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5653
5660
  return co(r, e.boundaryWord) ? {
5654
5661
  ...r,
5655
5662
  confidence: 1
@@ -5657,7 +5664,7 @@ var Kd = /* @__PURE__ */ new Set([
5657
5664
  ...n,
5658
5665
  confidence: 1
5659
5666
  } : e.boundaryWord && Yo(e.boundaryWord) ? null : e.tokenization.boundaryOffsetSpace === "raw-ssml" ? r || n : n || r;
5660
- }, Ph = (e) => {
5667
+ }, Nh = (e) => {
5661
5668
  if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
5662
5669
  const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), r = lo(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5663
5670
  return co(r, e.boundaryWord) ? {
@@ -5665,17 +5672,17 @@ var Kd = /* @__PURE__ */ new Set([
5665
5672
  confidence: 1
5666
5673
  } : e.boundaryWord && Yo(e.boundaryWord) ? null : r;
5667
5674
  }, ri = (e) => {
5668
- const t = hn({ speechText: e.speechText }), r = Th(e.mathElement);
5675
+ const t = hn({ speechText: e.speechText }), r = Sh(e.mathElement);
5669
5676
  return {
5670
5677
  speech: t,
5671
5678
  math: r,
5672
- result: Ch({
5679
+ result: Mh({
5673
5680
  speech: t,
5674
5681
  math: r
5675
5682
  })
5676
5683
  };
5677
- }, Nh = (e, t) => {
5678
- const r = Ph({
5684
+ }, $h = (e, t) => {
5685
+ const r = Nh({
5679
5686
  tokenization: e.speech,
5680
5687
  position: t.position,
5681
5688
  length: t.length,
@@ -5685,7 +5692,7 @@ var Kd = /* @__PURE__ */ new Set([
5685
5692
  alignment: e.result,
5686
5693
  boundary: r
5687
5694
  });
5688
- }, $h = (e, t) => {
5695
+ }, Dh = (e, t) => {
5689
5696
  if (!t.boundaryWord || /^<[^>]+>$/.test(t.boundaryWord.trim())) return null;
5690
5697
  const r = hn({ speechText: t.boundaryWord }).tokens[0];
5691
5698
  if (!r) return null;
@@ -5694,7 +5701,7 @@ var Kd = /* @__PURE__ */ new Set([
5694
5701
  return i.normalized.toLowerCase() === o || i.spokenAliases.some((s) => s.toLowerCase() === o);
5695
5702
  });
5696
5703
  return n.length === 1 ? n[0].target : null;
5697
- }, uo = "http://www.w3.org/1998/Math/MathML", Dh = /* @__PURE__ */ new Set([
5704
+ }, uo = "http://www.w3.org/1998/Math/MathML", Wh = /* @__PURE__ */ new Set([
5698
5705
  "math",
5699
5706
  "maction",
5700
5707
  "menclose",
@@ -5728,7 +5735,7 @@ var Kd = /* @__PURE__ */ new Set([
5728
5735
  "semantics",
5729
5736
  "annotation",
5730
5737
  "annotation-xml"
5731
- ]), Wh = /* @__PURE__ */ new Set([
5738
+ ]), Hh = /* @__PURE__ */ new Set([
5732
5739
  "accent",
5733
5740
  "accentunder",
5734
5741
  "align",
@@ -5780,12 +5787,12 @@ var Kd = /* @__PURE__ */ new Set([
5780
5787
  "width",
5781
5788
  "xmlns",
5782
5789
  "xml:lang"
5783
- ]), Vl = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), zh = (e) => Vl(e).replace(/"/g, "&quot;"), Hh = (e, t) => {
5790
+ ]), Vl = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), zh = (e) => Vl(e).replace(/"/g, "&quot;"), Fh = (e, t) => {
5784
5791
  const r = e.toLowerCase(), n = t.trim().toLowerCase();
5785
- return !!(r.startsWith("on") || !Wh.has(r) || n.includes("javascript:") || n.includes("data:text/html"));
5786
- }, Fh = (e) => {
5792
+ return !!(r.startsWith("on") || !Hh.has(r) || n.includes("javascript:") || n.includes("data:text/html"));
5793
+ }, Bh = (e) => {
5787
5794
  const t = e.localName.toLowerCase();
5788
- if (!Dh.has(t)) return !1;
5795
+ if (!Wh.has(t)) return !1;
5789
5796
  const r = e.namespaceURI;
5790
5797
  return !r || r === uo || r === "http://www.w3.org/1999/xhtml";
5791
5798
  }, Gl = (e) => {
@@ -5793,11 +5800,11 @@ var Kd = /* @__PURE__ */ new Set([
5793
5800
  if (e.nodeType === Node.COMMENT_NODE) return "";
5794
5801
  if (e.nodeType !== Node.ELEMENT_NODE) return null;
5795
5802
  const t = e;
5796
- if (!Fh(t)) return null;
5803
+ if (!Bh(t)) return null;
5797
5804
  const r = t.localName.toLowerCase(), n = [];
5798
5805
  for (const o of Array.from(t.attributes)) {
5799
5806
  const s = o.name.toLowerCase();
5800
- if (!Hh(s, o.value)) {
5807
+ if (!Fh(s, o.value)) {
5801
5808
  if (s === "xmlns" && o.value !== uo) return null;
5802
5809
  n.push(`${s}="${zh(o.value)}"`);
5803
5810
  }
@@ -5810,10 +5817,10 @@ var Kd = /* @__PURE__ */ new Set([
5810
5817
  i.push(s);
5811
5818
  }
5812
5819
  return `<${r}${n.length > 0 ? ` ${n.join(" ")}` : ""}>${i.join("")}</${r}>`;
5813
- }, Bh = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, Pi = (e) => {
5820
+ }, Uh = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, Pi = (e) => {
5814
5821
  const t = String(e || "").trim();
5815
5822
  if (!t) return null;
5816
- const r = Bh(t);
5823
+ const r = Uh(t);
5817
5824
  if (!r || r.getElementsByTagName("parsererror").length > 0) return null;
5818
5825
  const n = r.documentElement;
5819
5826
  return !n || n.localName.toLowerCase() !== "math" ? null : Gl(n);
@@ -5828,25 +5835,25 @@ var Kd = /* @__PURE__ */ new Set([
5828
5835
  }), Kl = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container", Xl = (e) => e.tagName?.toLowerCase() === "mjx-assistive-mml", Jl = (e) => {
5829
5836
  const t = e.tagName?.toLowerCase();
5830
5837
  return t === "annotation" || t === "annotation-xml";
5831
- }, Uh = (e) => {
5838
+ }, jh = (e) => {
5832
5839
  const t = e.getAttribute("data-mathml");
5833
5840
  return t && t.trim() ? t : null;
5834
- }, jh = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, qh = (e) => {
5841
+ }, qh = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, Vh = (e) => {
5835
5842
  if (e.tagName.toLowerCase() === "math") return Pi(e.outerHTML);
5836
- const t = Uh(e);
5843
+ const t = jh(e);
5837
5844
  if (t) {
5838
5845
  const r = Pi(t);
5839
5846
  if (r) return r;
5840
5847
  }
5841
5848
  if (Kl(e)) {
5842
- const r = jh(e);
5849
+ const r = qh(e);
5843
5850
  if (r) {
5844
5851
  const n = Pi(r);
5845
5852
  if (n) return n;
5846
5853
  }
5847
5854
  }
5848
5855
  return null;
5849
- }, Vh = /* @__PURE__ */ new Set([
5856
+ }, Gh = /* @__PURE__ */ new Set([
5850
5857
  "P",
5851
5858
  "H1",
5852
5859
  "H2",
@@ -5862,7 +5869,7 @@ var Kd = /* @__PURE__ */ new Set([
5862
5869
  "FIGCAPTION",
5863
5870
  "LABEL",
5864
5871
  "BUTTON"
5865
- ]), Gh = /* @__PURE__ */ new Set([
5872
+ ]), Yh = /* @__PURE__ */ new Set([
5866
5873
  "heading",
5867
5874
  "listitem",
5868
5875
  "option",
@@ -5871,18 +5878,18 @@ var Kd = /* @__PURE__ */ new Set([
5871
5878
  "cell",
5872
5879
  "columnheader",
5873
5880
  "rowheader"
5874
- ]), Yh = (e, t) => {
5881
+ ]), Kh = (e, t) => {
5875
5882
  let r = e.parentElement, n = null;
5876
5883
  for (; r && r !== t; ) {
5877
5884
  const i = (r.getAttribute("role") || "").toLowerCase(), o = r.tagName.toUpperCase();
5878
- if (Vh.has(o) || Gh.has(i)) {
5885
+ if (Gh.has(o) || Yh.has(i)) {
5879
5886
  n = r;
5880
5887
  break;
5881
5888
  }
5882
5889
  r = r.parentElement;
5883
5890
  }
5884
5891
  return n || t;
5885
- }, Kh = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || Kl(e), Ut = (e, t, r) => {
5892
+ }, Xh = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || Kl(e), Ut = (e, t, r) => {
5886
5893
  /[.,;:!?]/.test(t) && e.chars.length > 0 && e.chars[e.chars.length - 1] === " " && (e.chars.pop(), e.position--, e.map.delete(e.position)), e.chars.push(t), r ? (e.map.set(e.position, r), e.lastMapped = r) : e.lastMapped && e.map.set(e.position, e.lastMapped), e.position++;
5887
5894
  }, Ql = (e, t) => {
5888
5895
  if (e.inLeadingWhitespace || e.lastCharWasWhitespace || e.chars.length === 0) return !1;
@@ -5915,7 +5922,7 @@ var Kd = /* @__PURE__ */ new Set([
5915
5922
  offset: i
5916
5923
  }), n = !0, e.lastCharWasWhitespace = !1;
5917
5924
  }
5918
- }, Xh = (e, t) => {
5925
+ }, Jh = (e, t) => {
5919
5926
  for (let r = 0; r < t.text.length; r++) {
5920
5927
  const n = t.text[r], i = /\s/.test(n), o = t.map.get(r) || null, s = o?.node || e.lastMapped?.node || null, a = o?.offset ?? e.lastMapped?.offset ?? 0, l = o ? {
5921
5928
  node: o.node,
@@ -5943,7 +5950,7 @@ var Kd = /* @__PURE__ */ new Set([
5943
5950
  offset: a
5944
5951
  });
5945
5952
  }
5946
- }, Jh = (e) => {
5953
+ }, Qh = (e) => {
5947
5954
  if (typeof DOMParser > "u") return "";
5948
5955
  const t = new DOMParser().parseFromString(e, "application/xml");
5949
5956
  if (t.getElementsByTagName("parsererror").length > 0) return "";
@@ -5959,7 +5966,7 @@ var Kd = /* @__PURE__ */ new Set([
5959
5966
  for (const s of Array.from(o.childNodes)) n(s);
5960
5967
  };
5961
5968
  return n(t.documentElement), X(r.join(" "));
5962
- }, Qh = (e, t, r) => {
5969
+ }, Zh = (e, t, r) => {
5963
5970
  const n = Yl(r), i = (a) => {
5964
5971
  if (Nr(a, e)) return;
5965
5972
  if (a.nodeType === 3) {
@@ -5977,7 +5984,7 @@ var Kd = /* @__PURE__ */ new Set([
5977
5984
  text: o,
5978
5985
  map: n.map
5979
5986
  };
5980
- const s = Jh(t);
5987
+ const s = Qh(t);
5981
5988
  return s ? {
5982
5989
  text: s,
5983
5990
  map: /* @__PURE__ */ new Map()
@@ -5985,7 +5992,7 @@ var Kd = /* @__PURE__ */ new Set([
5985
5992
  }, ec = (e) => {
5986
5993
  for (; e.chars.length > 0 && /\s/.test(e.chars[e.chars.length - 1]); )
5987
5994
  e.chars.pop(), e.position--, e.map.delete(e.position);
5988
- }, Zh = (e, t) => {
5995
+ }, ep = (e, t) => {
5989
5996
  const r = Yl(t), n = [];
5990
5997
  let i = 0, o, s = !1;
5991
5998
  const a = () => {
@@ -5998,18 +6005,18 @@ var Kd = /* @__PURE__ */ new Set([
5998
6005
  }, l = (u) => {
5999
6006
  if (Nr(u, e)) return;
6000
6007
  if (u.nodeType === Node.TEXT_NODE) {
6001
- const g = Yh(u, e);
6008
+ const g = Kh(u, e);
6002
6009
  o && g !== o && a(), o = g, Zl(r, u);
6003
6010
  return;
6004
6011
  }
6005
6012
  if (u.nodeType !== Node.ELEMENT_NODE) return;
6006
6013
  const f = u;
6007
6014
  if (Xl(f)) return;
6008
- const h = qh(f);
6015
+ const h = Vh(f);
6009
6016
  if (h) {
6010
6017
  a();
6011
- const g = Qh(f, h, t);
6012
- Xh(r, g);
6018
+ const g = Zh(f, h, t);
6019
+ Jh(r, g);
6013
6020
  const v = X(g.text);
6014
6021
  n.push({
6015
6022
  type: "math",
@@ -6032,7 +6039,7 @@ var Kd = /* @__PURE__ */ new Set([
6032
6039
  containsMathMarkup: s
6033
6040
  };
6034
6041
  }, Zr = (e, t) => {
6035
- if (!Kh(e)) {
6042
+ if (!Xh(e)) {
6036
6043
  const { text: r, map: n } = ei(e, t);
6037
6044
  return {
6038
6045
  visibleText: r,
@@ -6044,8 +6051,8 @@ var Kd = /* @__PURE__ */ new Set([
6044
6051
  containsMathMarkup: !1
6045
6052
  };
6046
6053
  }
6047
- return Zh(e, t);
6048
- }, ep = (e, t) => Rl([e], t), tp = (e) => (e || "en").split("-")[0].toLowerCase() || "en", rp = /* @__PURE__ */ new Set([
6054
+ return ep(e, t);
6055
+ }, tp = (e, t) => Rl([e], t), rp = (e) => (e || "en").split("-")[0].toLowerCase() || "en", np = /* @__PURE__ */ new Set([
6049
6056
  "H1",
6050
6057
  "H2",
6051
6058
  "H3",
@@ -6055,17 +6062,17 @@ var Kd = /* @__PURE__ */ new Set([
6055
6062
  "LI",
6056
6063
  "LABEL",
6057
6064
  "BUTTON"
6058
- ]), np = /* @__PURE__ */ new Set([
6065
+ ]), ip = /* @__PURE__ */ new Set([
6059
6066
  "heading",
6060
6067
  "listitem",
6061
6068
  "option",
6062
6069
  "radio"
6063
- ]), ip = (e) => {
6070
+ ]), op = (e) => {
6064
6071
  if (e.type !== "text" || !e.sourceElement) return !1;
6065
6072
  const t = e.sourceElement.tagName.toUpperCase(), r = (e.sourceElement.getAttribute("role") || "").toLowerCase();
6066
- return rp.has(t) || np.has(r);
6067
- }, op = async (e) => {
6068
- const t = e.resolveMathSpeech ?? ep, { visibleText: r } = e, n = [];
6073
+ return np.has(t) || ip.has(r);
6074
+ }, sp = async (e) => {
6075
+ const t = e.resolveMathSpeech ?? tp, { visibleText: r } = e, n = [];
6069
6076
  let i = 0;
6070
6077
  const o = (a) => {
6071
6078
  const l = X(a), c = r.indexOf(l, i), u = c >= 0 ? c : i, f = u + l.length;
@@ -6077,7 +6084,7 @@ var Kd = /* @__PURE__ */ new Set([
6077
6084
  for (let a = 0; a < e.chunks.length; a++) {
6078
6085
  const l = e.chunks[a];
6079
6086
  if (l.type === "text") {
6080
- const g = ip(l) ? [{
6087
+ const g = op(l) ? [{
6081
6088
  text: l.text,
6082
6089
  offset: 0
6083
6090
  }] : jo(l.text, { locale: e.language });
@@ -6117,12 +6124,12 @@ var Kd = /* @__PURE__ */ new Set([
6117
6124
  }
6118
6125
  return {
6119
6126
  segments: n,
6120
- locale: tp(e.language),
6127
+ locale: rp(e.language),
6121
6128
  visibleText: r,
6122
6129
  plainSpeechText: X(s.join(" "))
6123
6130
  };
6124
- }, sp = (e) => (e || "en").split("-")[0].toLowerCase() || "en", ap = "sre-v1", lp = 256, fo = (e) => Array.isArray(e) ? `array:[${e.map(fo).join(",")}]` : e && typeof e == "object" ? `object:{${Object.entries(e).sort(([t], [r]) => t.localeCompare(r)).map(([t, r]) => `${JSON.stringify(t)}:${fo(r)}`).join(",")}}` : e === null ? "null:null" : typeof e > "u" ? "undefined:" : typeof e == "function" ? `function:${e.name || "anonymous"}` : typeof e == "symbol" ? `symbol:${String(e)}` : typeof e == "bigint" ? `bigint:${e.toString()}` : typeof e == "number" ? Number.isFinite(e) ? `number:${e}` : `number:${String(e)}` : `${typeof e}:${JSON.stringify(e)}`, Js = (e, t, r, n) => `${ap}\0${sp(e)}\0${t ? "ssml" : "plain"}\0${fo(r ?? null)}\0${n}`, cp = (e = {}) => {
6125
- const t = Math.max(1, e.maxEntries ?? lp), r = e.resolve ?? ((o, s) => Rl([o], s)), n = /* @__PURE__ */ new Map(), i = (o, s) => {
6131
+ }, ap = (e) => (e || "en").split("-")[0].toLowerCase() || "en", lp = "sre-v1", cp = 256, fo = (e) => Array.isArray(e) ? `array:[${e.map(fo).join(",")}]` : e && typeof e == "object" ? `object:{${Object.entries(e).sort(([t], [r]) => t.localeCompare(r)).map(([t, r]) => `${JSON.stringify(t)}:${fo(r)}`).join(",")}}` : e === null ? "null:null" : typeof e > "u" ? "undefined:" : typeof e == "function" ? `function:${e.name || "anonymous"}` : typeof e == "symbol" ? `symbol:${String(e)}` : typeof e == "bigint" ? `bigint:${e.toString()}` : typeof e == "number" ? Number.isFinite(e) ? `number:${e}` : `number:${String(e)}` : `${typeof e}:${JSON.stringify(e)}`, Js = (e, t, r, n) => `${lp}\0${ap(e)}\0${t ? "ssml" : "plain"}\0${fo(r ?? null)}\0${n}`, up = (e = {}) => {
6132
+ const t = Math.max(1, e.maxEntries ?? cp), r = e.resolve ?? ((o, s) => Rl([o], s)), n = /* @__PURE__ */ new Map(), i = (o, s) => {
6126
6133
  for (n.delete(o), n.set(o, s); n.size > t; ) {
6127
6134
  const a = n.keys().next().value;
6128
6135
  a !== void 0 && n.delete(a);
@@ -6142,13 +6149,13 @@ var Kd = /* @__PURE__ */ new Set([
6142
6149
  usedFallback: f.usedFallback
6143
6150
  }), i(c, f), f;
6144
6151
  };
6145
- }, up = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : hn({ speechText: e }).tokens[0]?.normalized || null, fp = (e, t) => {
6152
+ }, fp = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : hn({ speechText: e }).tokens[0]?.normalized || null, dp = (e, t) => {
6146
6153
  const r = hn({ speechText: e.speechText });
6147
6154
  if (!Number.isFinite(t.position)) return {
6148
6155
  boundary: null,
6149
6156
  spokenText: r.spokenText
6150
6157
  };
6151
- const n = Lh({
6158
+ const n = Ph({
6152
6159
  tokenization: r,
6153
6160
  position: t.position,
6154
6161
  length: t.length,
@@ -6161,8 +6168,8 @@ var Kd = /* @__PURE__ */ new Set([
6161
6168
  } : null,
6162
6169
  spokenText: r.spokenText
6163
6170
  };
6164
- }, dp = (e, t, r) => r ? hn({ speechText: e }).tokens.find((n) => n.start <= t && t < n.end)?.normalized === r : !0, hp = (e, t) => {
6165
- const r = up(t.word);
6171
+ }, hp = (e, t, r) => r ? hn({ speechText: e }).tokens.find((n) => n.start <= t && t < n.end)?.normalized === r : !0, pp = (e, t) => {
6172
+ const r = fp(t.word);
6166
6173
  if (e.id !== t.chunkId) return {
6167
6174
  chunkId: t.chunkId,
6168
6175
  normalizedWord: r,
@@ -6181,12 +6188,12 @@ var Kd = /* @__PURE__ */ new Set([
6181
6188
  };
6182
6189
  let n, i;
6183
6190
  if (e.catalogAlignment)
6184
- n = oh(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
6191
+ n = sh(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
6185
6192
  else {
6186
- const o = fp(e, t);
6193
+ const o = dp(e, t);
6187
6194
  n = o.boundary, i = o.spokenText;
6188
6195
  }
6189
- return n ? dp(i, n.start, r) ? {
6196
+ return n ? hp(i, n.start, r) ? {
6190
6197
  chunkId: e.id,
6191
6198
  normalizedWord: r,
6192
6199
  chunkSpokenStart: n.start,
@@ -6263,7 +6270,7 @@ var Kd = /* @__PURE__ */ new Set([
6263
6270
  if (!n || t[r].localName.toLowerCase() !== n) return !1;
6264
6271
  }
6265
6272
  return !0;
6266
- }, pp = (e, t) => {
6273
+ }, gp = (e, t) => {
6267
6274
  if (!e || !tc.has(e.localName.toLowerCase()) || t.querySelector(nc)) return null;
6268
6275
  const r = po(e), n = t.querySelector("mjx-math");
6269
6276
  if (!r || !n) return null;
@@ -6273,7 +6280,7 @@ var Kd = /* @__PURE__ */ new Set([
6273
6280
  if (!sc(i, s)) return null;
6274
6281
  const a = s[o];
6275
6282
  return !a || !oc(a) ? null : a;
6276
- }, gp = (e) => {
6283
+ }, mp = (e) => {
6277
6284
  const t = di(e);
6278
6285
  if (t) {
6279
6286
  if (t.querySelector(nc)) return "expression";
@@ -6287,7 +6294,7 @@ var Kd = /* @__PURE__ */ new Set([
6287
6294
  }, go = (e) => {
6288
6295
  const t = ic(e), r = di(t);
6289
6296
  if (r) {
6290
- const n = pp(t, r);
6297
+ const n = gp(t, r);
6291
6298
  return n ? {
6292
6299
  type: "element",
6293
6300
  quality: "semantic-token",
@@ -6309,7 +6316,7 @@ var Kd = /* @__PURE__ */ new Set([
6309
6316
  quality: e.quality === "region-fallback" ? "expression" : "semantic-token",
6310
6317
  element: e.element
6311
6318
  } : null;
6312
- }, mp = go, vp = () => {
6319
+ }, vp = go, bp = () => {
6313
6320
  const e = /* @__PURE__ */ new WeakMap();
6314
6321
  return (t) => {
6315
6322
  const r = ic(t), n = di(r);
@@ -6318,15 +6325,15 @@ var Kd = /* @__PURE__ */ new Set([
6318
6325
  const i = go(t);
6319
6326
  return e.set(r, i), i;
6320
6327
  };
6321
- }, bp = (e, t, r, n = e.mathAlignments, i = mp) => {
6328
+ }, yp = (e, t, r, n = e.mathAlignments, i = vp) => {
6322
6329
  if (t.chunkSpokenStart === null || t.chunkSpokenEnd === null) return null;
6323
6330
  let o = null;
6324
6331
  for (const s of n) {
6325
- const a = Nh(s.alignment, {
6332
+ const a = $h(s.alignment, {
6326
6333
  position: t.chunkSpokenStart,
6327
6334
  length: Math.max(1, t.chunkSpokenEnd - t.chunkSpokenStart),
6328
6335
  boundaryWord: r.word
6329
- }) || $h(s.alignment, { boundaryWord: r.word });
6336
+ }) || Dh(s.alignment, { boundaryWord: r.word });
6330
6337
  if (!a) continue;
6331
6338
  const l = i(a);
6332
6339
  if (l) {
@@ -6347,9 +6354,9 @@ var Kd = /* @__PURE__ */ new Set([
6347
6354
  } catch {
6348
6355
  return null;
6349
6356
  }
6350
- }, yp = (e, t) => {
6357
+ }, _p = (e, t) => {
6351
6358
  if (!e.catalogAlignment || t.chunkSpokenStart === null) return null;
6352
- const r = sh(e.catalogAlignment, t.chunkSpokenStart);
6359
+ const r = ah(e.catalogAlignment, t.chunkSpokenStart);
6353
6360
  if (!r) return null;
6354
6361
  const n = ac(e.visibleMap, r.start, r.end);
6355
6362
  return n ? {
@@ -6357,7 +6364,7 @@ var Kd = /* @__PURE__ */ new Set([
6357
6364
  quality: e.catalogAlignment.playbackMode === "exact-word" ? "exact-word" : "semantic-token",
6358
6365
  range: n
6359
6366
  } : null;
6360
- }, _p = (e) => e.regionRange ? {
6367
+ }, Tp = (e) => e.regionRange ? {
6361
6368
  type: "range",
6362
6369
  quality: "region",
6363
6370
  range: e.regionRange
@@ -6369,7 +6376,7 @@ var Kd = /* @__PURE__ */ new Set([
6369
6376
  if (t.length !== 1) return null;
6370
6377
  const r = t[0]?.alignment.result.fallbackTarget;
6371
6378
  return r ? e.renderedMathTargetResolver(r) : null;
6372
- }, Tp = (e, t) => e ? t.mathAlignments.filter(({ element: r }) => {
6379
+ }, Sp = (e, t) => e ? t.mathAlignments.filter(({ element: r }) => {
6373
6380
  try {
6374
6381
  return e.type === "range" ? e.range.intersectsNode(r) : e.type === "element" ? e.element === r || e.element.contains(r) : e.node.parentElement?.contains(r) || !1;
6375
6382
  } catch {
@@ -6381,18 +6388,18 @@ var Kd = /* @__PURE__ */ new Set([
6381
6388
  quality: "region",
6382
6389
  confidence: 0,
6383
6390
  reason: "boundary chunk id was not found"
6384
- }), ta = (e) => e.length === 1 ? e[0].element : null, wp = (e, t) => t.length > 0 && t.every(({ element: r }) => e.mathCapabilityByElement.get(r) === "token"), Sp = 3, kp = (e, t, r) => {
6391
+ }), ta = (e) => e.length === 1 ? e[0].element : null, wp = (e, t) => t.length > 0 && t.every(({ element: r }) => e.mathCapabilityByElement.get(r) === "token"), kp = 3, Ep = (e, t, r) => {
6385
6392
  if (!t || t.type !== "range") return !1;
6386
6393
  const { startContainer: n, endContainer: i } = t.range;
6387
- return n === i && n.nodeType === Sp ? !1 : r.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(n) && o.contains(i));
6388
- }, Ep = (e, t) => ({
6394
+ return n === i && n.nodeType === kp ? !1 : r.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(n) && o.contains(i));
6395
+ }, Ap = (e, t) => ({
6389
6396
  chunk: e,
6390
- regionTarget: _p(e),
6391
- renderedMathTargetResolver: vp(),
6392
- mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: r }) => [r, t ? gp(r) : "expression"])),
6397
+ regionTarget: Tp(e),
6398
+ renderedMathTargetResolver: bp(),
6399
+ mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: r }) => [r, t ? mp(r) : "expression"])),
6393
6400
  heldTokenByElement: /* @__PURE__ */ new Map()
6394
- }), Ap = (e) => {
6395
- const t = e.mathTokenHighlighting !== !1, r = new Map(e.chunks.map((n) => [n.id, Ep(n, t)]));
6401
+ }), xp = (e) => {
6402
+ const t = e.mathTokenHighlighting !== !1, r = new Map(e.chunks.map((n) => [n.id, Ap(n, t)]));
6396
6403
  return {
6397
6404
  chunks: e.chunks,
6398
6405
  resolveInitial(n) {
@@ -6416,7 +6423,7 @@ var Kd = /* @__PURE__ */ new Set([
6416
6423
  resolveBoundary(n) {
6417
6424
  const i = r.get(n.chunkId);
6418
6425
  if (!i) return ea();
6419
- const { chunk: o } = i, s = hp(o, n), a = yp(o, s), l = Tp(a, o), c = (!a || l.length > 0 ? bp(o, s, n, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, f = c && c.quality === "expression" ? c : null;
6426
+ const { chunk: o } = i, s = pp(o, n), a = _p(o, s), l = Sp(a, o), c = (!a || l.length > 0 ? yp(o, s, n, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, f = c && c.quality === "expression" ? c : null;
6420
6427
  if (u) {
6421
6428
  const h = ta(l);
6422
6429
  return h && i.heldTokenByElement.set(h, u), vr({
@@ -6427,7 +6434,7 @@ var Kd = /* @__PURE__ */ new Set([
6427
6434
  reason: s.reason
6428
6435
  });
6429
6436
  }
6430
- if (a && (t ? !kp(i, a, l) : l.length === 0)) return vr({
6437
+ if (a && (t ? !Ep(i, a, l) : l.length === 0)) return vr({
6431
6438
  semanticTarget: a,
6432
6439
  expressionTarget: null,
6433
6440
  regionTarget: i.regionTarget,
@@ -6453,14 +6460,14 @@ var Kd = /* @__PURE__ */ new Set([
6453
6460
  });
6454
6461
  }
6455
6462
  };
6456
- }, xp = (e) => {
6463
+ }, Cp = (e) => {
6457
6464
  if (e.alignment?.boundaryOffsetMode) return e.alignment.boundaryOffsetMode;
6458
6465
  const t = e.mathAlignment?.speech.boundaryOffsetSpace;
6459
6466
  return t || "plain-spoken-text";
6460
- }, Cp = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
6467
+ }, Mp = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
6461
6468
  element: e.sourceElement,
6462
6469
  alignment: e.mathAlignment
6463
- }] : [], Mp = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
6470
+ }] : [], Op = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
6464
6471
  speechText: e.speechText || "",
6465
6472
  visibleText: e.visibleText || e.speechText || "",
6466
6473
  sourceElement: e.sourceElement || e.contentRoot,
@@ -6477,9 +6484,9 @@ var Kd = /* @__PURE__ */ new Set([
6477
6484
  regionRange: t.regionRange,
6478
6485
  visibleMap: t.visibleMap,
6479
6486
  catalogAlignment: t.alignment,
6480
- mathAlignments: Cp(t),
6481
- offsetSpace: xp(t)
6482
- })), Op = [
6487
+ mathAlignments: Mp(t),
6488
+ offsetSpace: Cp(t)
6489
+ })), Ip = [
6483
6490
  "[data-pie-tts-region]",
6484
6491
  "[data-catalog-region]",
6485
6492
  "li",
@@ -6490,17 +6497,17 @@ var Kd = /* @__PURE__ */ new Set([
6490
6497
  "[role='region']",
6491
6498
  "div"
6492
6499
  ].join(","), lc = (e, t) => {
6493
- const r = e.closest(Op);
6500
+ const r = e.closest(Ip);
6494
6501
  return r && t.contains(r) ? r : e;
6495
- }, Ip = (e, t, r) => {
6502
+ }, Rp = (e, t, r) => {
6496
6503
  const n = /* @__PURE__ */ new Map();
6497
6504
  for (let i = t; i < r; i++) {
6498
6505
  const o = e.get(i);
6499
6506
  o && n.set(i - t, o);
6500
6507
  }
6501
6508
  return n;
6502
- }, Rp = async (e) => {
6503
- const t = Zr(e.contentRoot, e.textProcessingOptions), r = await op({
6509
+ }, Lp = async (e) => {
6510
+ const t = Zr(e.contentRoot, e.textProcessingOptions), r = await sp({
6504
6511
  chunks: t.chunks,
6505
6512
  visibleText: t.visibleText,
6506
6513
  language: e.language,
@@ -6519,7 +6526,7 @@ var Kd = /* @__PURE__ */ new Set([
6519
6526
  anchor: {
6520
6527
  sourceElement: a,
6521
6528
  regionElement: lc(a, e.contentRoot),
6522
- visibleMap: Ip(t.map, n.visibleSpan.start, n.visibleSpan.end)
6529
+ visibleMap: Rp(t.map, n.visibleSpan.start, n.visibleSpan.end)
6523
6530
  }
6524
6531
  };
6525
6532
  }
@@ -6539,8 +6546,8 @@ var Kd = /* @__PURE__ */ new Set([
6539
6546
  containsMathMarkup: t.containsMathMarkup,
6540
6547
  visibleText: t.visibleText
6541
6548
  };
6542
- }, Lp = (e, t) => {
6543
- const r = Hl({
6549
+ }, Pp = (e, t) => {
6550
+ const r = zl({
6544
6551
  speechText: e.spokenText,
6545
6552
  visibleText: e.spokenText
6546
6553
  });
@@ -6568,7 +6575,7 @@ var Kd = /* @__PURE__ */ new Set([
6568
6575
  speechText: e.spokenText
6569
6576
  }) : void 0
6570
6577
  };
6571
- }, Pp = (e, t, r) => {
6578
+ }, Np = (e, t, r) => {
6572
6579
  const n = t.sourceElement;
6573
6580
  return {
6574
6581
  speechText: r,
@@ -6582,13 +6589,13 @@ var Kd = /* @__PURE__ */ new Set([
6582
6589
  }) : void 0,
6583
6590
  plainFallback: cc(e, t)
6584
6591
  };
6585
- }, Np = (e, t = {}) => e.items.map(({ segment: r, anchor: n }) => r.kind === "prose" ? Lp(r, n) : t.format === "ssml" && r.ssml ? Pp(r, n, r.ssml) : cc(r, n)), $p = "pie-tts-control-handoff", H;
6592
+ }, $p = (e, t = {}) => e.items.map(({ segment: r, anchor: n }) => r.kind === "prose" ? Pp(r, n) : t.format === "ssml" && r.ssml ? Np(r, n, r.ssml) : cc(r, n)), Dp = "pie-tts-control-handoff", z;
6586
6593
  (function(e) {
6587
6594
  e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
6588
- })(H || (H = {}));
6589
- var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, Wp = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? Dp(e.range, t.range) : e.type === "element" && t.type === "element" ? e.element === t.element : e.type === "text-range" && t.type === "text-range" ? e.node === t.node && e.startOffset === t.startOffset && e.endOffset === t.endOffset : !1, zp = class mo {
6595
+ })(z || (z = {}));
6596
+ var uc = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, Wp = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? uc(e.range, t.range) : e.type === "element" && t.type === "element" ? e.element === t.element : e.type === "text-range" && t.type === "text-range" ? e.node === t.node && e.startOffset === t.startOffset && e.endOffset === t.endOffset : !1, Hp = class mo {
6590
6597
  constructor() {
6591
- m(this, "currentProvider", null), m(this, "provider", null), m(this, "highlightCoordinator", null), m(this, "catalogResolver", null), m(this, "state", H.IDLE), m(this, "ttsConfig", {}), m(this, "currentText", null), m(this, "currentContentElement", null), m(this, "normalizedToDOM", /* @__PURE__ */ new Map()), m(this, "listeners", /* @__PURE__ */ new Map()), m(this, "lastError", null), m(this, "speakRunId", 0), m(this, "currentBoundaryOffset", 0), m(this, "activeWordBoundaryOffset", 0), m(this, "seekSegments", []), m(this, "sentenceHighlightSegments", []), m(this, "currentSeekSegmentIndex", 0), m(this, "activeSentenceStartOffset", null), m(this, "activeHighlightMode", "word"), m(this, "lastRenderedRegionTarget", null), m(this, "telemetryReporter", null), m(this, "generatedMathSpeechResolver", cp());
6598
+ m(this, "currentProvider", null), m(this, "provider", null), m(this, "highlightCoordinator", null), m(this, "highlightTargetResolverProvider", null), m(this, "catalogResolver", null), m(this, "state", z.IDLE), m(this, "ttsConfig", {}), m(this, "currentText", null), m(this, "currentContentElement", null), m(this, "normalizedToDOM", /* @__PURE__ */ new Map()), m(this, "listeners", /* @__PURE__ */ new Map()), m(this, "lastError", null), m(this, "speakRunId", 0), m(this, "currentBoundaryOffset", 0), m(this, "activeWordBoundaryOffset", 0), m(this, "seekSegments", []), m(this, "sentenceHighlightSegments", []), m(this, "currentSeekSegmentIndex", 0), m(this, "activeSentenceStartOffset", null), m(this, "activeHighlightMode", "word"), m(this, "lastRenderedRegionTarget", null), m(this, "telemetryReporter", null), m(this, "generatedMathSpeechResolver", up());
6592
6599
  }
6593
6600
  debugLog(t, r) {
6594
6601
  mo.debugEnabled && (r === void 0 ? console.debug(t) : console.debug(t, r));
@@ -6630,9 +6637,132 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6630
6637
  setHighlightCoordinator(t) {
6631
6638
  this.highlightCoordinator = t;
6632
6639
  }
6640
+ setHighlightTargetResolverProvider(t) {
6641
+ return this.highlightTargetResolverProvider = t, () => {
6642
+ this.highlightTargetResolverProvider === t && (this.highlightTargetResolverProvider = null);
6643
+ };
6644
+ }
6633
6645
  setCatalogResolver(t) {
6634
6646
  this.catalogResolver = t;
6635
6647
  }
6648
+ getHighlightResolverRuntime() {
6649
+ let t = null;
6650
+ try {
6651
+ t = this.highlightTargetResolverProvider?.() ?? null;
6652
+ } catch {
6653
+ t = null;
6654
+ }
6655
+ const r = t?.context ?? {}, n = typeof HTMLElement < "u" && this.currentContentElement instanceof HTMLElement ? this.currentContentElement : null;
6656
+ return {
6657
+ context: {
6658
+ ...r,
6659
+ scopeElement: r.scopeElement ?? n
6660
+ },
6661
+ resolver: t?.resolver ?? null
6662
+ };
6663
+ }
6664
+ getNodeElement(t) {
6665
+ return t ? t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement : null;
6666
+ }
6667
+ isElementWithinScope(t, r) {
6668
+ return r ? t === r || r.contains(t) : !0;
6669
+ }
6670
+ isRangeWithinScope(t, r) {
6671
+ const n = this.getNodeElement(t.startContainer), i = this.getNodeElement(t.endContainer);
6672
+ return !n || !i ? !1 : this.isElementWithinScope(n, r) && this.isElementWithinScope(i, r);
6673
+ }
6674
+ resolveWordHighlightRange(t) {
6675
+ const { context: r, resolver: n } = this.getHighlightResolverRuntime(), i = r.scopeElement ?? this.currentContentElement;
6676
+ try {
6677
+ const o = n?.resolveWordRange?.(t, r);
6678
+ if (o && this.isRangeWithinScope(o, i)) return {
6679
+ range: o,
6680
+ remapped: !uc(t, o)
6681
+ };
6682
+ } catch {
6683
+ }
6684
+ return {
6685
+ range: t,
6686
+ remapped: !1
6687
+ };
6688
+ }
6689
+ resolveSentenceHighlightTargets(t) {
6690
+ const { context: r, resolver: n } = this.getHighlightResolverRuntime(), i = r.scopeElement ?? this.currentContentElement;
6691
+ try {
6692
+ const o = n?.resolveSentenceRanges?.(t, r);
6693
+ if (!o) return {
6694
+ ranges: t,
6695
+ elements: []
6696
+ };
6697
+ const s = [], a = [];
6698
+ for (const l of o) {
6699
+ if (typeof Range < "u" && l instanceof Range) {
6700
+ if (!this.isRangeWithinScope(l, i)) return {
6701
+ ranges: t,
6702
+ elements: []
6703
+ };
6704
+ s.push(l);
6705
+ continue;
6706
+ }
6707
+ if (typeof Element < "u" && l instanceof Element) {
6708
+ if (!this.isElementWithinScope(l, i)) return {
6709
+ ranges: t,
6710
+ elements: []
6711
+ };
6712
+ a.push(l);
6713
+ continue;
6714
+ }
6715
+ return {
6716
+ ranges: t,
6717
+ elements: []
6718
+ };
6719
+ }
6720
+ return {
6721
+ ranges: s,
6722
+ elements: a
6723
+ };
6724
+ } catch {
6725
+ return {
6726
+ ranges: t,
6727
+ elements: []
6728
+ };
6729
+ }
6730
+ }
6731
+ createTextRange(t, r, n) {
6732
+ if (typeof document > "u" || typeof document.createRange != "function") return null;
6733
+ try {
6734
+ const i = document.createRange();
6735
+ return i.setStart(t, r), i.setEnd(t, n), i.startContainer !== t || i.endContainer !== t ? null : i;
6736
+ } catch {
6737
+ return null;
6738
+ }
6739
+ }
6740
+ paintTTSWordRange(t) {
6741
+ if (this.highlightCoordinator) {
6742
+ try {
6743
+ if (t.startContainer === t.endContainer && t.startContainer.nodeType === Node.TEXT_NODE) {
6744
+ this.highlightCoordinator.highlightTTSWord(t.startContainer, t.startOffset, t.endOffset);
6745
+ return;
6746
+ }
6747
+ } catch {
6748
+ }
6749
+ this.highlightCoordinator.highlightRange(t, he.TTS_WORD, xr.YELLOW);
6750
+ }
6751
+ }
6752
+ paintTTSSentenceRanges(t) {
6753
+ if (!this.highlightCoordinator) return;
6754
+ const { ranges: r, elements: n } = this.resolveSentenceHighlightTargets(t);
6755
+ if (n.length > 0 && r.length === 0 && this.highlightCoordinator.highlightTTSSentenceElements) {
6756
+ this.highlightCoordinator.highlightTTSSentenceElements(n);
6757
+ return;
6758
+ }
6759
+ const i = [...r];
6760
+ for (const o of n) {
6761
+ const s = document.createRange();
6762
+ s.selectNodeContents(o), i.push(s);
6763
+ }
6764
+ this.highlightCoordinator.highlightTTSSentence(i);
6765
+ }
6636
6766
  getCapabilities() {
6637
6767
  return this.currentProvider?.getCapabilities() || null;
6638
6768
  }
@@ -6881,7 +7011,7 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6881
7011
  const i = this.normalizedToDOM.get(t), o = this.normalizedToDOM.get(t + n - 1);
6882
7012
  if (!i || !o) return;
6883
7013
  const s = document.createRange();
6884
- s.setStart(i.node, i.offset), s.setEnd(o.node, o.offset + 1), this.highlightCoordinator.highlightTTSSentence([s]), this.activeSentenceStartOffset = t;
7014
+ s.setStart(i.node, i.offset), s.setEnd(o.node, o.offset + 1), this.paintTTSSentenceRanges([s]), this.activeSentenceStartOffset = t;
6885
7015
  }
6886
7016
  getSegmentIndexForOffset(t, r) {
6887
7017
  if (t.length === 0) return -1;
@@ -6943,7 +7073,7 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6943
7073
  contentToSpeak: a,
6944
7074
  shouldUsePlan: _,
6945
7075
  playbackSegments: this.seekSegments
6946
- }), this.setState(H.LOADING), this.prepareHighlightsForSpeak({
7076
+ }), this.setState(z.LOADING), this.prepareHighlightsForSpeak({
6947
7077
  contentToSpeak: a,
6948
7078
  options: r,
6949
7079
  highlightMode: g,
@@ -6951,18 +7081,18 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6951
7081
  }), f ? this.configureWordBoundaryHighlighting({
6952
7082
  highlightMode: g,
6953
7083
  wordBoundaryOffset: r?.wordBoundaryOffset || 0
6954
- }) : this.clearWordBoundaryHighlighting(), this.setState(H.PLAYING), await this.executeSpeakPlayback({
7084
+ }) : this.clearWordBoundaryHighlighting(), this.setState(z.PLAYING), await this.executeSpeakPlayback({
6955
7085
  shouldUsePlan: _,
6956
7086
  runId: n,
6957
7087
  highlightMode: g,
6958
7088
  contentToSpeak: s,
6959
7089
  speechChunks: h
6960
7090
  }), n !== this.speakRunId) return;
6961
- this.setState(H.IDLE), this.clearHighlightsAndTracking();
7091
+ this.setState(z.IDLE), this.clearHighlightsAndTracking();
6962
7092
  } catch (i) {
6963
7093
  let o = i;
6964
7094
  if (console.error("TTS error:", o), this.lastError = o instanceof Error ? o.message : String(o), n !== this.speakRunId) return;
6965
- throw this.setState(H.ERROR), this.clearHighlightsAndTracking(), o;
7095
+ throw this.setState(z.ERROR), this.clearHighlightsAndTracking(), o;
6966
7096
  }
6967
7097
  }
6968
7098
  async switchProviderToBrowser(t, r) {
@@ -7123,16 +7253,16 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7123
7253
  const f = u, h = s(f);
7124
7254
  if (h) {
7125
7255
  o();
7126
- const g = Zr(f, this.getTextProcessingOptions(r.language)), v = g.visibleText || X(f.textContent || ""), _ = Hl({
7256
+ const g = Zr(f, this.getTextProcessingOptions(r.language)), v = g.visibleText || X(f.textContent || ""), _ = zl({
7127
7257
  speechText: h.content,
7128
7258
  visibleText: v
7129
7259
  }), b = a(f, v), T = b ? ri({
7130
7260
  mathElement: b,
7131
7261
  speechText: h.content
7132
- }) : void 0, I = T ? void 0 : l(f).map((w) => ({
7133
- element: w,
7262
+ }) : void 0, I = T ? void 0 : l(f).map((S) => ({
7263
+ element: S,
7134
7264
  alignment: ri({
7135
- mathElement: w,
7265
+ mathElement: S,
7136
7266
  speechText: h.content
7137
7267
  })
7138
7268
  })), N = X(h.content);
@@ -7159,7 +7289,7 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7159
7289
  return !t || t.providerId?.toLowerCase() === "browser" ? "plain" : t.getCapabilities?.().supportsSSML ? "ssml" : "plain";
7160
7290
  }
7161
7291
  async resolveGeneratedSpeechContent(t, r, n) {
7162
- const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await Rp({
7292
+ const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await Lp({
7163
7293
  contentRoot: t,
7164
7294
  language: n,
7165
7295
  mathSpeech: this.getMathSpeechOptions(),
@@ -7176,7 +7306,7 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7176
7306
  containsMathMarkup: !1,
7177
7307
  speechMatchesVisibleText: !0
7178
7308
  };
7179
- const c = Np(o, { format: i }), u = o.plainSpeechText;
7309
+ const c = $p(o, { format: i }), u = o.plainSpeechText;
7180
7310
  return {
7181
7311
  contentToSpeak: u,
7182
7312
  speechText: u,
@@ -7207,7 +7337,7 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7207
7337
  this.highlightSentenceSegment(r.startOffset, r.text), this.debugLog("[TTSService] Applied initial sentence highlighting");
7208
7338
  else try {
7209
7339
  const n = document.createRange();
7210
- n.selectNodeContents(this.currentContentElement), this.highlightCoordinator.highlightTTSSentence([n]);
7340
+ n.selectNodeContents(this.currentContentElement), this.paintTTSSentenceRanges([n]);
7211
7341
  } catch {
7212
7342
  }
7213
7343
  }
@@ -7218,7 +7348,9 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7218
7348
  const a = this.findHighlightRange(s, o);
7219
7349
  if (a && this.highlightCoordinator) {
7220
7350
  const l = a.node.textContent?.substring(a.start, a.end) || "";
7221
- this.debugLog(`[TTSService] Highlighting "${l}" (word: "${r}") at position ${s}`), this.highlightCoordinator.highlightTTSWord(a.node, a.start, a.end);
7351
+ this.debugLog(`[TTSService] Highlighting "${l}" (word: "${r}") at position ${s}`);
7352
+ const c = this.createTextRange(a.node, a.start, a.end);
7353
+ c ? this.paintTTSWordRange(this.resolveWordHighlightRange(c).range) : this.highlightCoordinator.highlightTTSWord(a.node, a.start, a.end);
7222
7354
  } else console.warn(`[TTSService] Could not find highlight range for position ${s}, length ${o}`);
7223
7355
  });
7224
7356
  }
@@ -7230,35 +7362,29 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7230
7362
  if (!(!r && !t.regionRange || !this.highlightCoordinator))
7231
7363
  try {
7232
7364
  if (this.lastRenderedRegionTarget = null, t.regionRange) {
7233
- this.highlightCoordinator.clearHighlights?.(he.TTS_WORD), this.highlightCoordinator.highlightTTSSentence([t.regionRange]);
7365
+ this.highlightCoordinator.clearHighlights?.(he.TTS_WORD), this.paintTTSSentenceRanges([t.regionRange]);
7234
7366
  return;
7235
7367
  }
7236
7368
  if (!r) return;
7237
7369
  const n = document.createRange();
7238
- n.selectNodeContents(r), this.highlightCoordinator.clearHighlights?.(he.TTS_WORD), this.highlightCoordinator.highlightTTSSentence([n]);
7370
+ n.selectNodeContents(r), this.highlightCoordinator.clearHighlights?.(he.TTS_WORD), this.paintTTSSentenceRanges([n]);
7239
7371
  } catch {
7240
7372
  }
7241
7373
  }
7242
7374
  highlightCatalogActiveRange(t) {
7243
- if (this.highlightCoordinator) {
7244
- if (t.startContainer === t.endContainer && t.startContainer.nodeType === Node.TEXT_NODE) {
7245
- this.highlightCoordinator.highlightTTSWord(t.startContainer, t.startOffset, t.endOffset);
7246
- return;
7247
- }
7248
- this.highlightCoordinator.highlightRange(t, he.TTS_WORD, xr.YELLOW);
7249
- }
7375
+ this.highlightCoordinator && this.paintTTSWordRange(this.resolveWordHighlightRange(t).range);
7250
7376
  }
7251
7377
  highlightRenderableRegionTarget(t) {
7252
- if (!(!this.highlightCoordinator || !t || typeof document > "u") && !Wp(this.lastRenderedRegionTarget, t))
7378
+ if (!(!this.highlightCoordinator || !t || typeof document > "u") && !(!this.highlightTargetResolverProvider && Wp(this.lastRenderedRegionTarget, t)))
7253
7379
  try {
7254
7380
  const r = document.createRange();
7255
7381
  if (t.type === "element") r.selectNodeContents(t.element);
7256
7382
  else if (t.type === "range") {
7257
- this.highlightCoordinator.highlightTTSSentence([t.range]), this.lastRenderedRegionTarget = t;
7383
+ this.paintTTSSentenceRanges([t.range]), this.lastRenderedRegionTarget = t;
7258
7384
  return;
7259
7385
  } else
7260
7386
  r.setStart(t.node, t.startOffset), r.setEnd(t.node, t.endOffset);
7261
- this.highlightCoordinator.highlightTTSSentence([r]), this.lastRenderedRegionTarget = t;
7387
+ this.paintTTSSentenceRanges([r]), this.lastRenderedRegionTarget = t;
7262
7388
  } catch {
7263
7389
  }
7264
7390
  }
@@ -7269,16 +7395,24 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7269
7395
  return;
7270
7396
  }
7271
7397
  if (t.type === "text-range") {
7272
- this.highlightCoordinator.highlightTTSWord(t.node, t.startOffset, t.endOffset);
7398
+ const o = this.createTextRange(t.node, t.startOffset, t.endOffset);
7399
+ o ? this.paintTTSWordRange(this.resolveWordHighlightRange(o).range) : this.highlightCoordinator.highlightTTSWord(t.node, t.startOffset, t.endOffset);
7273
7400
  return;
7274
7401
  }
7275
7402
  if (t.type === "range") {
7276
7403
  this.highlightCatalogActiveRange(t.range);
7277
7404
  return;
7278
7405
  }
7279
- const r = t.element.childNodes.length === 1 ? t.element.firstChild : null;
7280
- if (t.quality === "semantic-token" && r?.nodeType === Node.TEXT_NODE) {
7281
- this.highlightCoordinator.highlightTTSWord(r, 0, r.textContent?.length || 0);
7406
+ const r = document.createRange();
7407
+ r.selectNodeContents(t.element);
7408
+ const n = this.resolveWordHighlightRange(r);
7409
+ if (n.remapped) {
7410
+ this.paintTTSWordRange(n.range);
7411
+ return;
7412
+ }
7413
+ const i = t.element.childNodes.length === 1 ? t.element.firstChild : null;
7414
+ if (t.quality === "semantic-token" && i?.nodeType === Node.TEXT_NODE) {
7415
+ this.highlightCoordinator.highlightTTSWord(i, 0, i.textContent?.length || 0);
7282
7416
  return;
7283
7417
  }
7284
7418
  this.highlightCoordinator.highlightTTSWordElement?.(t.element);
@@ -7300,10 +7434,10 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7300
7434
  async speakCatalogChunkOnce(t, r) {
7301
7435
  if (!this.provider) return;
7302
7436
  this.lastRenderedRegionTarget = null;
7303
- const n = t.regionElement || t.sourceElement || this.currentContentElement, i = n ? Mp({
7437
+ const n = t.regionElement || t.sourceElement || this.currentContentElement, i = n ? Op({
7304
7438
  contentRoot: n,
7305
7439
  chunks: [t]
7306
- })[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? Ap({
7440
+ })[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? xp({
7307
7441
  chunks: [i],
7308
7442
  mathTokenHighlighting: o
7309
7443
  }) : null;
@@ -7380,10 +7514,10 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7380
7514
  });
7381
7515
  }
7382
7516
  pause() {
7383
- this.provider && this.state === H.PLAYING && (this.provider.pause(), this.setState(H.PAUSED));
7517
+ this.provider && this.state === z.PLAYING && (this.provider.pause(), this.setState(z.PAUSED));
7384
7518
  }
7385
7519
  resume() {
7386
- this.provider && this.state === H.PAUSED && (this.provider.resume(), this.setState(H.PLAYING));
7520
+ this.provider && this.state === z.PAUSED && (this.provider.resume(), this.setState(z.PLAYING));
7387
7521
  }
7388
7522
  normalizePlaybackRate(t) {
7389
7523
  return Number.isFinite(t) ? Math.max(0.25, Math.min(4, t)) : 1;
@@ -7393,24 +7527,24 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7393
7527
  const r = Math.max(0, Math.min(this.seekSegments.length - 1, t));
7394
7528
  this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.currentSeekSegmentIndex = r;
7395
7529
  const n = ++this.speakRunId, i = this.seekSegments.slice(r);
7396
- this.setState(H.PLAYING);
7530
+ this.setState(z.PLAYING);
7397
7531
  try {
7398
7532
  if (this.configureWordBoundaryHighlighting({
7399
7533
  highlightMode: this.activeHighlightMode,
7400
7534
  wordBoundaryOffset: this.activeWordBoundaryOffset
7401
7535
  }), await this.speakWithPlan(i, n, { highlightMode: this.activeHighlightMode }), n !== this.speakRunId) return;
7402
- this.setState(H.IDLE), this.clearHighlightsAndTracking();
7536
+ this.setState(z.IDLE), this.clearHighlightsAndTracking(), this.highlightTargetResolverProvider = null;
7403
7537
  } catch (o) {
7404
7538
  if (n !== this.speakRunId) return;
7405
- throw this.lastError = o instanceof Error ? o.message : String(o), this.setState(H.ERROR), this.clearHighlightsAndTracking(), o;
7539
+ throw this.lastError = o instanceof Error ? o.message : String(o), this.setState(z.ERROR), this.clearHighlightsAndTracking(), this.highlightTargetResolverProvider = null, o;
7406
7540
  }
7407
7541
  }
7408
7542
  async setPlaybackRate(t) {
7409
7543
  const r = this.normalizePlaybackRate(t);
7410
- await this.updateSettings({ rate: r }), !(this.state !== H.PLAYING || !this.currentText || this.seekSegments.length === 0 || this.hasExplicitBreakSemantics(this.currentText)) && await this.restartFromSeekIndex(this.getCurrentSeekSegmentIndex());
7544
+ await this.updateSettings({ rate: r }), !(this.state !== z.PLAYING || !this.currentText || this.seekSegments.length === 0 || this.hasExplicitBreakSemantics(this.currentText)) && await this.restartFromSeekIndex(this.getCurrentSeekSegmentIndex());
7411
7545
  }
7412
7546
  async seekBy(t) {
7413
- if (!this.provider || !this.currentText || this.state !== H.PLAYING && this.state !== H.PAUSED || this.hasExplicitBreakSemantics(this.currentText) || this.seekSegments.length === 0) return;
7547
+ if (!this.provider || !this.currentText || this.state !== z.PLAYING && this.state !== z.PAUSED || this.hasExplicitBreakSemantics(this.currentText) || this.seekSegments.length === 0) return;
7414
7548
  const r = Number.isFinite(t) ? Math.trunc(t) : 0;
7415
7549
  if (r === 0) return;
7416
7550
  const n = this.getCurrentSeekSegmentIndex(), i = Math.max(0, Math.min(this.seekSegments.length - 1, n + r));
@@ -7425,16 +7559,16 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7425
7559
  await this.seekBy(-r);
7426
7560
  }
7427
7561
  stop() {
7428
- this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.setState(H.IDLE), this.currentText = null, this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.activeWordBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
7562
+ this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.highlightTargetResolverProvider = null, this.setState(z.IDLE), this.currentText = null, this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.activeWordBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
7429
7563
  }
7430
7564
  requestControlHandoff() {
7431
- typeof window > "u" || window.dispatchEvent(new CustomEvent($p, { detail: { source: "host" } }));
7565
+ typeof window > "u" || window.dispatchEvent(new CustomEvent(Dp, { detail: { source: "host" } }));
7432
7566
  }
7433
7567
  isPlaying() {
7434
- return this.state === H.PLAYING;
7568
+ return this.state === z.PLAYING;
7435
7569
  }
7436
7570
  isPaused() {
7437
- return this.state === H.PAUSED;
7571
+ return this.state === z.PAUSED;
7438
7572
  }
7439
7573
  getState() {
7440
7574
  return this.state;
@@ -7462,8 +7596,8 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7462
7596
  providerId: "tts",
7463
7597
  previousState: r,
7464
7598
  state: t
7465
- }), t === H.PLAYING) {
7466
- const n = r === H.PAUSED ? "pie-tool-playback-resume" : "pie-tool-playback-start";
7599
+ }), t === z.PLAYING) {
7600
+ const n = r === z.PAUSED ? "pie-tool-playback-resume" : "pie-tool-playback-start";
7467
7601
  this.emitTelemetry(n, {
7468
7602
  toolId: "textToSpeech",
7469
7603
  providerId: "tts",
@@ -7472,7 +7606,7 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7472
7606
  });
7473
7607
  return;
7474
7608
  }
7475
- if (t === H.PAUSED) {
7609
+ if (t === z.PAUSED) {
7476
7610
  this.emitTelemetry("pie-tool-playback-pause", {
7477
7611
  toolId: "textToSpeech",
7478
7612
  providerId: "tts",
@@ -7481,7 +7615,7 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7481
7615
  });
7482
7616
  return;
7483
7617
  }
7484
- if (t === H.ERROR) {
7618
+ if (t === z.ERROR) {
7485
7619
  this.emitTelemetry("pie-tool-playback-error", {
7486
7620
  toolId: "textToSpeech",
7487
7621
  providerId: "tts",
@@ -7491,7 +7625,7 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7491
7625
  });
7492
7626
  return;
7493
7627
  }
7494
- t === H.IDLE && (r === H.PLAYING || r === H.PAUSED || r === H.LOADING) && this.emitTelemetry("pie-tool-playback-stop", {
7628
+ t === z.IDLE && (r === z.PLAYING || r === z.PAUSED || r === z.LOADING) && this.emitTelemetry("pie-tool-playback-stop", {
7495
7629
  toolId: "textToSpeech",
7496
7630
  providerId: "tts",
7497
7631
  previousState: r,
@@ -7499,14 +7633,14 @@ var Dp = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7499
7633
  });
7500
7634
  }
7501
7635
  };
7502
- m(zp, "debugEnabled", (() => {
7636
+ m(Hp, "debugEnabled", (() => {
7503
7637
  try {
7504
7638
  if (typeof process < "u" && process.env?.PIE_TTS_DEBUG === "1") return !0;
7505
7639
  } catch {
7506
7640
  }
7507
7641
  return globalThis.__PIE_TTS_DEBUG__ === !0;
7508
7642
  })());
7509
- var nm = Uf({
7643
+ var nm = jf({
7510
7644
  policy: {
7511
7645
  allowed: [],
7512
7646
  blocked: []
@@ -7518,7 +7652,7 @@ var nm = Uf({
7518
7652
  },
7519
7653
  providers: {}
7520
7654
  });
7521
- function Hp(e) {
7655
+ function zp(e) {
7522
7656
  return e === "light" || e === "dark" || e === "auto";
7523
7657
  }
7524
7658
  function Fp(e) {
@@ -7757,12 +7891,12 @@ var Bp = [
7757
7891
  primary: "#aaaaaa"
7758
7892
  }
7759
7893
  }
7760
- ], bo = new Map(Bp.map((e) => [e.id, e])), uc = /* @__PURE__ */ new Map();
7894
+ ], bo = new Map(Bp.map((e) => [e.id, e])), fc = /* @__PURE__ */ new Map();
7761
7895
  function Up() {
7762
- return [...bo.values(), ...uc.values()];
7896
+ return [...bo.values(), ...fc.values()];
7763
7897
  }
7764
7898
  function jp(e) {
7765
- return e ? uc.get(e) ?? bo.get(e) : bo.get("default");
7899
+ return e ? fc.get(e) ?? bo.get(e) : bo.get("default");
7766
7900
  }
7767
7901
  function qp(e) {
7768
7902
  return jp(e)?.variables ?? {};
@@ -8024,7 +8158,7 @@ var Qp = class extends Xp {
8024
8158
  }
8025
8159
  get theme() {
8026
8160
  const e = this.getAttribute("theme");
8027
- return Hp(e) ? e : "light";
8161
+ return zp(e) ? e : "light";
8028
8162
  }
8029
8163
  set theme(e) {
8030
8164
  this.setAttribute("theme", e);
@@ -8114,8 +8248,8 @@ function Zp(e = "pie-theme") {
8114
8248
  typeof customElements > "u" || Jp(e, Qp);
8115
8249
  }
8116
8250
  Zp();
8117
- var fc = "https://proxy.pie-api.com", eg = `${fc}/bundles/`;
8118
- function dc(e) {
8251
+ var dc = "https://proxy.pie-api.com", eg = `${dc}/bundles/`;
8252
+ function hc(e) {
8119
8253
  try {
8120
8254
  const t = {
8121
8255
  BASE_URL: "/",
@@ -8128,10 +8262,10 @@ function dc(e) {
8128
8262
  } catch {
8129
8263
  }
8130
8264
  }
8131
- var im = typeof window < "u" && window.PIE_BUILDER_ORIGIN_URL || dc("PUBLIC_BUILDER_ORIGIN_URL") || fc, tg = typeof window < "u" && window.PIE_BUILDER_BUNDLE_URL || dc("PUBLIC_BUILDER_BUNDLE_URL") || eg, rg = {
8265
+ var im = typeof window < "u" && window.PIE_BUILDER_ORIGIN_URL || hc("PUBLIC_BUILDER_ORIGIN_URL") || dc, tg = typeof window < "u" && window.PIE_BUILDER_BUNDLE_URL || hc("PUBLIC_BUILDER_BUNDLE_URL") || eg, rg = {
8132
8266
  retryDelayMs: 3e3,
8133
8267
  timeoutMs: 12e4
8134
- }, { entries: hc, setPrototypeOf: na, isFrozen: ng, getPrototypeOf: ig, getOwnPropertyDescriptor: og } = Object, { freeze: me, seal: De, create: en } = Object, { apply: To, construct: wo } = typeof Reflect < "u" && Reflect;
8268
+ }, { entries: pc, setPrototypeOf: na, isFrozen: ng, getPrototypeOf: ig, getOwnPropertyDescriptor: og } = Object, { freeze: me, seal: De, create: en } = Object, { apply: To, construct: So } = typeof Reflect < "u" && Reflect;
8135
8269
  me || (me = function(t) {
8136
8270
  return t;
8137
8271
  });
@@ -8142,7 +8276,7 @@ To || (To = function(t, r) {
8142
8276
  for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), o = 2; o < n; o++) i[o - 2] = arguments[o];
8143
8277
  return t.apply(r, i);
8144
8278
  });
8145
- wo || (wo = function(t) {
8279
+ So || (So = function(t) {
8146
8280
  for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++) n[i - 1] = arguments[i];
8147
8281
  return new t(...n);
8148
8282
  });
@@ -8157,7 +8291,7 @@ function ve(e) {
8157
8291
  function ug(e) {
8158
8292
  return function() {
8159
8293
  for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++) r[n] = arguments[n];
8160
- return wo(e, r);
8294
+ return So(e, r);
8161
8295
  };
8162
8296
  }
8163
8297
  function R(e, t) {
@@ -8180,7 +8314,7 @@ function fg(e) {
8180
8314
  }
8181
8315
  function Xe(e) {
8182
8316
  const t = en(null);
8183
- for (const [r, n] of hc(e)) Fe(e, r) && (Array.isArray(n) ? t[r] = fg(n) : n && typeof n == "object" && n.constructor === Object ? t[r] = Xe(n) : t[r] = n);
8317
+ for (const [r, n] of pc(e)) Fe(e, r) && (Array.isArray(n) ? t[r] = fg(n) : n && typeof n == "object" && n.constructor === Object ? t[r] = Xe(n) : t[r] = n);
8184
8318
  return t;
8185
8319
  }
8186
8320
  function Vr(e, t) {
@@ -8414,7 +8548,7 @@ var oa = me([
8414
8548
  "solidcolor",
8415
8549
  "unknown",
8416
8550
  "use"
8417
- ]), zi = me([
8551
+ ]), Hi = me([
8418
8552
  "math",
8419
8553
  "menclose",
8420
8554
  "merror",
@@ -8579,7 +8713,7 @@ var oa = me([
8579
8713
  "wrap",
8580
8714
  "xmlns",
8581
8715
  "slot"
8582
- ]), Hi = me([
8716
+ ]), zi = me([
8583
8717
  "accent-height",
8584
8718
  "accumulate",
8585
8719
  "additive",
@@ -8829,15 +8963,15 @@ var oa = me([
8829
8963
  "xlink:title",
8830
8964
  "xml:space",
8831
8965
  "xmlns:xlink"
8832
- ]), pg = De(/\{\{[\w\W]*|[\w\W]*\}\}/gm), gg = De(/<%[\w\W]*|[\w\W]*%>/gm), mg = De(/\$\{[\w\W]*/gm), vg = De(/^data-[\-\w.\u00B7-\uFFFF]+$/), bg = De(/^aria-[\-\w]+$/), pc = De(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), yg = De(/^(?:\w+script|data):/i), _g = De(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), gc = De(/^html$/i), Tg = De(/^[a-z][.\w]*(-[.\w]+)+$/i), ca = /* @__PURE__ */ Object.freeze({
8966
+ ]), pg = De(/\{\{[\w\W]*|[\w\W]*\}\}/gm), gg = De(/<%[\w\W]*|[\w\W]*%>/gm), mg = De(/\$\{[\w\W]*/gm), vg = De(/^data-[\-\w.\u00B7-\uFFFF]+$/), bg = De(/^aria-[\-\w]+$/), gc = De(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), yg = De(/^(?:\w+script|data):/i), _g = De(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), mc = De(/^html$/i), Tg = De(/^[a-z][.\w]*(-[.\w]+)+$/i), ca = /* @__PURE__ */ Object.freeze({
8833
8967
  __proto__: null,
8834
8968
  ARIA_ATTR: bg,
8835
8969
  ATTR_WHITESPACE: _g,
8836
8970
  CUSTOM_ELEMENT: Tg,
8837
8971
  DATA_ATTR: vg,
8838
- DOCTYPE_NAME: gc,
8972
+ DOCTYPE_NAME: mc,
8839
8973
  ERB_EXPR: gg,
8840
- IS_ALLOWED_URI: pc,
8974
+ IS_ALLOWED_URI: gc,
8841
8975
  IS_SCRIPT_OR_DATA: yg,
8842
8976
  MUSTACHE_EXPR: pg,
8843
8977
  TMPLIT_EXPR: mg
@@ -8847,9 +8981,9 @@ var oa = me([
8847
8981
  progressingInstruction: 7,
8848
8982
  comment: 8,
8849
8983
  document: 9
8850
- }, wg = function() {
8984
+ }, Sg = function() {
8851
8985
  return typeof window > "u" ? null : window;
8852
- }, Sg = function(t, r) {
8986
+ }, wg = function(t, r) {
8853
8987
  if (typeof t != "object" || typeof t.createPolicy != "function") return null;
8854
8988
  let n = null;
8855
8989
  const i = "data-tt-policy-suffix";
@@ -8880,9 +9014,9 @@ var oa = me([
8880
9014
  uponSanitizeShadowNode: []
8881
9015
  };
8882
9016
  };
8883
- function mc() {
8884
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : wg();
8885
- const t = (A) => mc(A);
9017
+ function vc() {
9018
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Sg();
9019
+ const t = (A) => vc(A);
8886
9020
  if (t.version = "3.4.0", t.removed = [], !e || !e.document || e.document.nodeType !== Gr.document || !e.Element)
8887
9021
  return t.isSupported = !1, t;
8888
9022
  let { document: r } = e;
@@ -8891,23 +9025,23 @@ function mc() {
8891
9025
  const A = r.createElement("template");
8892
9026
  A.content && A.content.ownerDocument && (r = A.content.ownerDocument);
8893
9027
  }
8894
- let w, F = "";
9028
+ let S, F = "";
8895
9029
  const { implementation: B, createNodeIterator: se, createDocumentFragment: ee, getElementsByTagName: it } = r, { importNode: J } = n;
8896
9030
  let Q = ua();
8897
- t.isSupported = typeof hc == "function" && typeof N == "function" && B && B.createHTMLDocument !== void 0;
8898
- const { MUSTACHE_EXPR: St, ERB_EXPR: sr, TMPLIT_EXPR: k, DATA_ATTR: x, ARIA_ATTR: z, IS_SCRIPT_OR_DATA: ae, ATTR_WHITESPACE: ot, CUSTOM_ELEMENT: be } = ca;
9031
+ t.isSupported = typeof pc == "function" && typeof N == "function" && B && B.createHTMLDocument !== void 0;
9032
+ const { MUSTACHE_EXPR: wt, ERB_EXPR: sr, TMPLIT_EXPR: k, DATA_ATTR: x, ARIA_ATTR: H, IS_SCRIPT_OR_DATA: ae, ATTR_WHITESPACE: ot, CUSTOM_ELEMENT: be } = ca;
8899
9033
  let { IS_ALLOWED_URI: ar } = ca, Y = null;
8900
9034
  const pn = R({}, [
8901
9035
  ...oa,
8902
9036
  ...Di,
8903
9037
  ...Wi,
8904
- ...zi,
9038
+ ...Hi,
8905
9039
  ...sa
8906
9040
  ]);
8907
9041
  let Z = null;
8908
9042
  const lr = R({}, [
8909
9043
  ...aa,
8910
- ...Hi,
9044
+ ...zi,
8911
9045
  ...la,
8912
9046
  ...On
8913
9047
  ]);
@@ -8945,7 +9079,7 @@ function mc() {
8945
9079
  value: null
8946
9080
  }
8947
9081
  }));
8948
- let gn = !0, st = !0, ur = !1, fr = !0, ne = !1, we = !0, Ge = !1, Lt = !1, Pt = !1, at = !1, dr = !1, Et = !1, hr = !0, mn = !1;
9082
+ let gn = !0, st = !0, ur = !1, fr = !0, ne = !1, Se = !0, Ge = !1, Lt = !1, Pt = !1, at = !1, dr = !1, Et = !1, hr = !0, mn = !1;
8949
9083
  const vn = "user-content-";
8950
9084
  let $r = !0, Nt = !1, At = {}, ye = null;
8951
9085
  const Dr = R({}, [
@@ -9002,7 +9136,7 @@ function mc() {
9002
9136
  "xmlns"
9003
9137
  ]), bn = "http://www.w3.org/1998/Math/MathML", yn = "http://www.w3.org/2000/svg", Ye = "http://www.w3.org/1999/xhtml";
9004
9138
  let pr = Ye, pi = !1, gi = null;
9005
- const Ec = R({}, [
9139
+ const Ac = R({}, [
9006
9140
  bn,
9007
9141
  yn,
9008
9142
  Ye
@@ -9014,7 +9148,7 @@ function mc() {
9014
9148
  "ms",
9015
9149
  "mtext"
9016
9150
  ]), Tn = R({}, ["annotation-xml"]);
9017
- const Ac = R({}, [
9151
+ const xc = R({}, [
9018
9152
  "title",
9019
9153
  "style",
9020
9154
  "font",
@@ -9022,38 +9156,38 @@ function mc() {
9022
9156
  "script"
9023
9157
  ]);
9024
9158
  let Wr = null;
9025
- const xc = ["application/xhtml+xml", "text/html"], Cc = "text/html";
9159
+ const Cc = ["application/xhtml+xml", "text/html"], Mc = "text/html";
9026
9160
  let te = null, gr = null;
9027
- const Mc = r.createElement("form"), Qo = function(d) {
9161
+ const Oc = r.createElement("form"), Qo = function(d) {
9028
9162
  return d instanceof RegExp || d instanceof Function;
9029
9163
  }, mi = function() {
9030
9164
  let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
9031
9165
  if (!(gr && gr === d)) {
9032
- if ((!d || typeof d != "object") && (d = {}), d = Xe(d), Wr = xc.indexOf(d.PARSER_MEDIA_TYPE) === -1 ? Cc : d.PARSER_MEDIA_TYPE, te = Wr === "application/xhtml+xml" ? Ni : Wn, Y = Fe(d, "ALLOWED_TAGS") ? R({}, d.ALLOWED_TAGS, te) : pn, Z = Fe(d, "ALLOWED_ATTR") ? R({}, d.ALLOWED_ATTR, te) : lr, gi = Fe(d, "ALLOWED_NAMESPACES") ? R({}, d.ALLOWED_NAMESPACES, Ni) : Ec, hi = Fe(d, "ADD_URI_SAFE_ATTR") ? R(Xe(Jo), d.ADD_URI_SAFE_ATTR, te) : Jo, Ko = Fe(d, "ADD_DATA_URI_TAGS") ? R(Xe(Xo), d.ADD_DATA_URI_TAGS, te) : Xo, ye = Fe(d, "FORBID_CONTENTS") ? R({}, d.FORBID_CONTENTS, te) : Dr, kt = Fe(d, "FORBID_TAGS") ? R({}, d.FORBID_TAGS, te) : Xe({}), cr = Fe(d, "FORBID_ATTR") ? R({}, d.FORBID_ATTR, te) : Xe({}), At = Fe(d, "USE_PROFILES") ? d.USE_PROFILES : !1, gn = d.ALLOW_ARIA_ATTR !== !1, st = d.ALLOW_DATA_ATTR !== !1, ur = d.ALLOW_UNKNOWN_PROTOCOLS || !1, fr = d.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ne = d.SAFE_FOR_TEMPLATES || !1, we = d.SAFE_FOR_XML !== !1, Ge = d.WHOLE_DOCUMENT || !1, at = d.RETURN_DOM || !1, dr = d.RETURN_DOM_FRAGMENT || !1, Et = d.RETURN_TRUSTED_TYPE || !1, Pt = d.FORCE_BODY || !1, hr = d.SANITIZE_DOM !== !1, mn = d.SANITIZE_NAMED_PROPS || !1, $r = d.KEEP_CONTENT !== !1, Nt = d.IN_PLACE || !1, ar = d.ALLOWED_URI_REGEXP || pc, pr = d.NAMESPACE || Ye, _n = d.MATHML_TEXT_INTEGRATION_POINTS || _n, Tn = d.HTML_INTEGRATION_POINTS || Tn, j = d.CUSTOM_ELEMENT_HANDLING || en(null), d.CUSTOM_ELEMENT_HANDLING && Qo(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (j.tagNameCheck = d.CUSTOM_ELEMENT_HANDLING.tagNameCheck), d.CUSTOM_ELEMENT_HANDLING && Qo(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (j.attributeNameCheck = d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), d.CUSTOM_ELEMENT_HANDLING && typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (j.allowCustomizedBuiltInElements = d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), ne && (st = !1), dr && (at = !0), At && (Y = R({}, sa), Z = en(null), At.html === !0 && (R(Y, oa), R(Z, aa)), At.svg === !0 && (R(Y, Di), R(Z, Hi), R(Z, On)), At.svgFilters === !0 && (R(Y, Wi), R(Z, Hi), R(Z, On)), At.mathMl === !0 && (R(Y, zi), R(Z, la), R(Z, On))), Ve.tagCheck = null, Ve.attributeCheck = null, d.ADD_TAGS && (typeof d.ADD_TAGS == "function" ? Ve.tagCheck = d.ADD_TAGS : (Y === pn && (Y = Xe(Y)), R(Y, d.ADD_TAGS, te))), d.ADD_ATTR && (typeof d.ADD_ATTR == "function" ? Ve.attributeCheck = d.ADD_ATTR : (Z === lr && (Z = Xe(Z)), R(Z, d.ADD_ATTR, te))), d.ADD_URI_SAFE_ATTR && R(hi, d.ADD_URI_SAFE_ATTR, te), d.FORBID_CONTENTS && (ye === Dr && (ye = Xe(ye)), R(ye, d.FORBID_CONTENTS, te)), d.ADD_FORBID_CONTENTS && (ye === Dr && (ye = Xe(ye)), R(ye, d.ADD_FORBID_CONTENTS, te)), $r && (Y["#text"] = !0), Ge && R(Y, [
9166
+ if ((!d || typeof d != "object") && (d = {}), d = Xe(d), Wr = Cc.indexOf(d.PARSER_MEDIA_TYPE) === -1 ? Mc : d.PARSER_MEDIA_TYPE, te = Wr === "application/xhtml+xml" ? Ni : Wn, Y = Fe(d, "ALLOWED_TAGS") ? R({}, d.ALLOWED_TAGS, te) : pn, Z = Fe(d, "ALLOWED_ATTR") ? R({}, d.ALLOWED_ATTR, te) : lr, gi = Fe(d, "ALLOWED_NAMESPACES") ? R({}, d.ALLOWED_NAMESPACES, Ni) : Ac, hi = Fe(d, "ADD_URI_SAFE_ATTR") ? R(Xe(Jo), d.ADD_URI_SAFE_ATTR, te) : Jo, Ko = Fe(d, "ADD_DATA_URI_TAGS") ? R(Xe(Xo), d.ADD_DATA_URI_TAGS, te) : Xo, ye = Fe(d, "FORBID_CONTENTS") ? R({}, d.FORBID_CONTENTS, te) : Dr, kt = Fe(d, "FORBID_TAGS") ? R({}, d.FORBID_TAGS, te) : Xe({}), cr = Fe(d, "FORBID_ATTR") ? R({}, d.FORBID_ATTR, te) : Xe({}), At = Fe(d, "USE_PROFILES") ? d.USE_PROFILES : !1, gn = d.ALLOW_ARIA_ATTR !== !1, st = d.ALLOW_DATA_ATTR !== !1, ur = d.ALLOW_UNKNOWN_PROTOCOLS || !1, fr = d.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ne = d.SAFE_FOR_TEMPLATES || !1, Se = d.SAFE_FOR_XML !== !1, Ge = d.WHOLE_DOCUMENT || !1, at = d.RETURN_DOM || !1, dr = d.RETURN_DOM_FRAGMENT || !1, Et = d.RETURN_TRUSTED_TYPE || !1, Pt = d.FORCE_BODY || !1, hr = d.SANITIZE_DOM !== !1, mn = d.SANITIZE_NAMED_PROPS || !1, $r = d.KEEP_CONTENT !== !1, Nt = d.IN_PLACE || !1, ar = d.ALLOWED_URI_REGEXP || gc, pr = d.NAMESPACE || Ye, _n = d.MATHML_TEXT_INTEGRATION_POINTS || _n, Tn = d.HTML_INTEGRATION_POINTS || Tn, j = d.CUSTOM_ELEMENT_HANDLING || en(null), d.CUSTOM_ELEMENT_HANDLING && Qo(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (j.tagNameCheck = d.CUSTOM_ELEMENT_HANDLING.tagNameCheck), d.CUSTOM_ELEMENT_HANDLING && Qo(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (j.attributeNameCheck = d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), d.CUSTOM_ELEMENT_HANDLING && typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (j.allowCustomizedBuiltInElements = d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), ne && (st = !1), dr && (at = !0), At && (Y = R({}, sa), Z = en(null), At.html === !0 && (R(Y, oa), R(Z, aa)), At.svg === !0 && (R(Y, Di), R(Z, zi), R(Z, On)), At.svgFilters === !0 && (R(Y, Wi), R(Z, zi), R(Z, On)), At.mathMl === !0 && (R(Y, Hi), R(Z, la), R(Z, On))), Ve.tagCheck = null, Ve.attributeCheck = null, d.ADD_TAGS && (typeof d.ADD_TAGS == "function" ? Ve.tagCheck = d.ADD_TAGS : (Y === pn && (Y = Xe(Y)), R(Y, d.ADD_TAGS, te))), d.ADD_ATTR && (typeof d.ADD_ATTR == "function" ? Ve.attributeCheck = d.ADD_ATTR : (Z === lr && (Z = Xe(Z)), R(Z, d.ADD_ATTR, te))), d.ADD_URI_SAFE_ATTR && R(hi, d.ADD_URI_SAFE_ATTR, te), d.FORBID_CONTENTS && (ye === Dr && (ye = Xe(ye)), R(ye, d.FORBID_CONTENTS, te)), d.ADD_FORBID_CONTENTS && (ye === Dr && (ye = Xe(ye)), R(ye, d.ADD_FORBID_CONTENTS, te)), $r && (Y["#text"] = !0), Ge && R(Y, [
9033
9167
  "html",
9034
9168
  "head",
9035
9169
  "body"
9036
9170
  ]), Y.table && (R(Y, ["tbody"]), delete kt.tbody), d.TRUSTED_TYPES_POLICY) {
9037
9171
  if (typeof d.TRUSTED_TYPES_POLICY.createHTML != "function") throw qr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
9038
9172
  if (typeof d.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw qr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
9039
- w = d.TRUSTED_TYPES_POLICY, F = w.createHTML("");
9173
+ S = d.TRUSTED_TYPES_POLICY, F = S.createHTML("");
9040
9174
  } else
9041
- w === void 0 && (w = Sg(g, i)), w !== null && typeof F == "string" && (F = w.createHTML(""));
9175
+ S === void 0 && (S = wg(g, i)), S !== null && typeof F == "string" && (F = S.createHTML(""));
9042
9176
  me && me(d), gr = d;
9043
9177
  }
9044
9178
  }, Zo = R({}, [
9045
9179
  ...Di,
9046
9180
  ...Wi,
9047
9181
  ...dg
9048
- ]), es = R({}, [...zi, ...hg]), Oc = function(d) {
9182
+ ]), es = R({}, [...Hi, ...hg]), Ic = function(d) {
9049
9183
  let y = N(d);
9050
9184
  (!y || !y.tagName) && (y = {
9051
9185
  namespaceURI: pr,
9052
9186
  tagName: "template"
9053
9187
  });
9054
9188
  const E = Wn(d.tagName), V = Wn(y.tagName);
9055
- return gi[d.namespaceURI] ? d.namespaceURI === yn ? y.namespaceURI === Ye ? E === "svg" : y.namespaceURI === bn ? E === "svg" && (V === "annotation-xml" || _n[V]) : !!Zo[E] : d.namespaceURI === bn ? y.namespaceURI === Ye ? E === "math" : y.namespaceURI === yn ? E === "math" && Tn[V] : !!es[E] : d.namespaceURI === Ye ? y.namespaceURI === yn && !Tn[V] || y.namespaceURI === bn && !_n[V] ? !1 : !es[E] && (Ac[E] || !Zo[E]) : !!(Wr === "application/xhtml+xml" && gi[d.namespaceURI]) : !1;
9056
- }, ze = function(d) {
9189
+ return gi[d.namespaceURI] ? d.namespaceURI === yn ? y.namespaceURI === Ye ? E === "svg" : y.namespaceURI === bn ? E === "svg" && (V === "annotation-xml" || _n[V]) : !!Zo[E] : d.namespaceURI === bn ? y.namespaceURI === Ye ? E === "math" : y.namespaceURI === yn ? E === "math" && Tn[V] : !!es[E] : d.namespaceURI === Ye ? y.namespaceURI === yn && !Tn[V] || y.namespaceURI === bn && !_n[V] ? !1 : !es[E] && (xc[E] || !Zo[E]) : !!(Wr === "application/xhtml+xml" && gi[d.namespaceURI]) : !1;
9190
+ }, He = function(d) {
9057
9191
  jr(t.removed, { element: d });
9058
9192
  try {
9059
9193
  N(d).removeChild(d);
@@ -9073,7 +9207,7 @@ function mc() {
9073
9207
  });
9074
9208
  }
9075
9209
  if (y.removeAttribute(d), d === "is") if (at || dr) try {
9076
- ze(y);
9210
+ He(y);
9077
9211
  } catch {
9078
9212
  }
9079
9213
  else try {
@@ -9088,7 +9222,7 @@ function mc() {
9088
9222
  E = Ae && Ae[0];
9089
9223
  }
9090
9224
  Wr === "application/xhtml+xml" && pr === Ye && (d = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + d + "</body></html>");
9091
- const V = w ? w.createHTML(d) : d;
9225
+ const V = S ? S.createHTML(d) : d;
9092
9226
  if (pr === Ye) try {
9093
9227
  y = new h().parseFromString(V, Wr);
9094
9228
  } catch {
@@ -9117,13 +9251,13 @@ function mc() {
9117
9251
  const ns = function(d) {
9118
9252
  let y = null;
9119
9253
  if (lt(Q.beforeSanitizeElements, d, null), vi(d))
9120
- return ze(d), !0;
9254
+ return He(d), !0;
9121
9255
  const E = te(d.nodeName);
9122
9256
  if (lt(Q.uponSanitizeElement, d, {
9123
9257
  tagName: E,
9124
9258
  allowedTags: Y
9125
- }), we && d.hasChildNodes() && !bi(d.firstElementChild) && de(/<[/\w!]/g, d.innerHTML) && de(/<[/\w!]/g, d.textContent) || we && d.namespaceURI === Ye && E === "style" && bi(d.firstElementChild) || d.nodeType === Gr.progressingInstruction || we && d.nodeType === Gr.comment && de(/<[/\w]/g, d.data))
9126
- return ze(d), !0;
9259
+ }), Se && d.hasChildNodes() && !bi(d.firstElementChild) && de(/<[/\w!]/g, d.innerHTML) && de(/<[/\w!]/g, d.textContent) || Se && d.namespaceURI === Ye && E === "style" && bi(d.firstElementChild) || d.nodeType === Gr.progressingInstruction || Se && d.nodeType === Gr.comment && de(/<[/\w]/g, d.data))
9260
+ return He(d), !0;
9127
9261
  if (kt[E] || !(Ve.tagCheck instanceof Function && Ve.tagCheck(E)) && !Y[E]) {
9128
9262
  if (!kt[E] && os(E) && (j.tagNameCheck instanceof RegExp && de(j.tagNameCheck, E) || j.tagNameCheck instanceof Function && j.tagNameCheck(E)))
9129
9263
  return !1;
@@ -9137,19 +9271,19 @@ function mc() {
9137
9271
  }
9138
9272
  }
9139
9273
  }
9140
- return ze(d), !0;
9274
+ return He(d), !0;
9141
9275
  }
9142
- return d instanceof l && !Oc(d) || (E === "noscript" || E === "noembed" || E === "noframes") && de(/<\/no(script|embed|frames)/i, d.innerHTML) ? (ze(d), !0) : (ne && d.nodeType === Gr.text && (y = d.textContent, Ur([
9143
- St,
9276
+ return d instanceof l && !Ic(d) || (E === "noscript" || E === "noembed" || E === "noframes") && de(/<\/no(script|embed|frames)/i, d.innerHTML) ? (He(d), !0) : (ne && d.nodeType === Gr.text && (y = d.textContent, Ur([
9277
+ wt,
9144
9278
  sr,
9145
9279
  k
9146
9280
  ], (V) => {
9147
9281
  y = br(y, V, " ");
9148
9282
  }), d.textContent !== y && (jr(t.removed, { element: d.cloneNode() }), d.textContent = y)), lt(Q.afterSanitizeElements, d, null), !1);
9149
9283
  }, is = function(d, y, E) {
9150
- if (cr[y] || hr && (y === "id" || y === "name") && (E in r || E in Mc)) return !1;
9284
+ if (cr[y] || hr && (y === "id" || y === "name") && (E in r || E in Oc)) return !1;
9151
9285
  if (!(st && !cr[y] && de(x, y))) {
9152
- if (!(gn && de(z, y))) {
9286
+ if (!(gn && de(H, y))) {
9153
9287
  if (!(Ve.attributeCheck instanceof Function && Ve.attributeCheck(y, d))) {
9154
9288
  if (!Z[y] || cr[y]) {
9155
9289
  if (!(os(d) && (j.tagNameCheck instanceof RegExp && de(j.tagNameCheck, d) || j.tagNameCheck instanceof Function && j.tagNameCheck(d)) && (j.attributeNameCheck instanceof RegExp && de(j.attributeNameCheck, y) || j.attributeNameCheck instanceof Function && j.attributeNameCheck(y, d)) || y === "is" && j.allowCustomizedBuiltInElements && (j.tagNameCheck instanceof RegExp && de(j.tagNameCheck, E) || j.tagNameCheck instanceof Function && j.tagNameCheck(E)))) return !1;
@@ -9181,9 +9315,9 @@ function mc() {
9181
9315
  };
9182
9316
  let V = y.length;
9183
9317
  for (; V--; ) {
9184
- const { name: U, namespaceURI: Ae, value: xe } = y[V], ie = te(U), zr = xe;
9185
- let le = U === "value" ? zr : cg(zr);
9186
- if (E.attrName = ie, E.attrValue = le, E.keepAttr = !0, E.forceKeepAttr = void 0, lt(Q.uponSanitizeAttribute, d, E), le = E.attrValue, mn && (ie === "id" || ie === "name") && ($t(U, d), le = vn + le), we && de(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, le)) {
9318
+ const { name: U, namespaceURI: Ae, value: xe } = y[V], ie = te(U), Hr = xe;
9319
+ let le = U === "value" ? Hr : cg(Hr);
9320
+ if (E.attrName = ie, E.attrValue = le, E.keepAttr = !0, E.forceKeepAttr = void 0, lt(Q.uponSanitizeAttribute, d, E), le = E.attrValue, mn && (ie === "id" || ie === "name") && ($t(U, d), le = vn + le), Se && de(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, le)) {
9187
9321
  $t(U, d);
9188
9322
  continue;
9189
9323
  }
@@ -9201,7 +9335,7 @@ function mc() {
9201
9335
  continue;
9202
9336
  }
9203
9337
  ne && Ur([
9204
- St,
9338
+ wt,
9205
9339
  sr,
9206
9340
  k
9207
9341
  ], (cs) => {
@@ -9212,16 +9346,16 @@ function mc() {
9212
9346
  $t(U, d);
9213
9347
  continue;
9214
9348
  }
9215
- if (w && typeof g == "object" && typeof g.getAttributeType == "function" && !Ae) switch (g.getAttributeType(ls, ie)) {
9349
+ if (S && typeof g == "object" && typeof g.getAttributeType == "function" && !Ae) switch (g.getAttributeType(ls, ie)) {
9216
9350
  case "TrustedHTML":
9217
- le = w.createHTML(le);
9351
+ le = S.createHTML(le);
9218
9352
  break;
9219
9353
  case "TrustedScriptURL":
9220
- le = w.createScriptURL(le);
9354
+ le = S.createScriptURL(le);
9221
9355
  break;
9222
9356
  }
9223
- if (le !== zr) try {
9224
- Ae ? d.setAttributeNS(Ae, U, le) : d.setAttribute(U, le), vi(d) ? ze(d) : ia(t.removed);
9357
+ if (le !== Hr) try {
9358
+ Ae ? d.setAttributeNS(Ae, U, le) : d.setAttribute(U, le), vi(d) ? He(d) : ia(t.removed);
9225
9359
  } catch {
9226
9360
  $t(U, d);
9227
9361
  }
@@ -9248,10 +9382,10 @@ function mc() {
9248
9382
  } else if (A instanceof a)
9249
9383
  y = ts("<!---->"), E = y.ownerDocument.importNode(A, !0), E.nodeType === Gr.element && E.nodeName === "BODY" || E.nodeName === "HTML" ? y = E : y.appendChild(E);
9250
9384
  else {
9251
- if (!at && !ne && !Ge && A.indexOf("<") === -1) return w && Et ? w.createHTML(A) : A;
9385
+ if (!at && !ne && !Ge && A.indexOf("<") === -1) return S && Et ? S.createHTML(A) : A;
9252
9386
  if (y = ts(A), !y) return at ? null : Et ? F : "";
9253
9387
  }
9254
- y && Pt && ze(y.firstChild);
9388
+ y && Pt && He(y.firstChild);
9255
9389
  const Ae = rs(Nt ? A : y);
9256
9390
  for (; V = Ae.nextNode(); )
9257
9391
  ns(V), ss(V), V.content instanceof o && as(V.content);
@@ -9261,11 +9395,11 @@ function mc() {
9261
9395
  y.normalize();
9262
9396
  let ie = y.innerHTML;
9263
9397
  Ur([
9264
- St,
9398
+ wt,
9265
9399
  sr,
9266
9400
  k
9267
- ], (zr) => {
9268
- ie = br(ie, zr, " ");
9401
+ ], (Hr) => {
9402
+ ie = br(ie, Hr, " ");
9269
9403
  }), y.innerHTML = ie;
9270
9404
  }
9271
9405
  if (dr)
@@ -9274,14 +9408,14 @@ function mc() {
9274
9408
  return (Z.shadowroot || Z.shadowrootmode) && (U = J.call(n, U, !0)), U;
9275
9409
  }
9276
9410
  let xe = Ge ? y.outerHTML : y.innerHTML;
9277
- return Ge && Y["!doctype"] && y.ownerDocument && y.ownerDocument.doctype && y.ownerDocument.doctype.name && de(gc, y.ownerDocument.doctype.name) && (xe = "<!DOCTYPE " + y.ownerDocument.doctype.name + `>
9411
+ return Ge && Y["!doctype"] && y.ownerDocument && y.ownerDocument.doctype && y.ownerDocument.doctype.name && de(mc, y.ownerDocument.doctype.name) && (xe = "<!DOCTYPE " + y.ownerDocument.doctype.name + `>
9278
9412
  ` + xe), ne && Ur([
9279
- St,
9413
+ wt,
9280
9414
  sr,
9281
9415
  k
9282
9416
  ], (ie) => {
9283
9417
  xe = br(xe, ie, " ");
9284
- }), w && Et ? w.createHTML(xe) : xe;
9418
+ }), S && Et ? S.createHTML(xe) : xe;
9285
9419
  }, t.setConfig = function() {
9286
9420
  mi(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), Lt = !0;
9287
9421
  }, t.clearConfig = function() {
@@ -9302,10 +9436,10 @@ function mc() {
9302
9436
  Q = ua();
9303
9437
  }, t;
9304
9438
  }
9305
- var om = mc(), So;
9439
+ var om = vc(), wo;
9306
9440
  (function(e) {
9307
9441
  e.player = "player.js", e.clientPlayer = "client-player.js", e.editor = "editor.js";
9308
- })(So || (So = {}));
9442
+ })(wo || (wo = {}));
9309
9443
  var fa;
9310
9444
  (function(e) {
9311
9445
  e.loading = "loading", e.loaded = "loaded";
@@ -9326,9 +9460,9 @@ var ga;
9326
9460
  (function(e) {
9327
9461
  e.PENDING = "pending", e.IN_PROGRESS = "in_progress", e.COMPLETED = "completed", e.FAILED = "failed";
9328
9462
  })(ga || (ga = {}));
9329
- var kg = class vc extends CustomEvent {
9463
+ var kg = class bc extends CustomEvent {
9330
9464
  constructor(t, r = !1) {
9331
- super(vc.TYPE, {
9465
+ super(bc.TYPE, {
9332
9466
  bubbles: !0,
9333
9467
  detail: {
9334
9468
  update: t,
@@ -9338,9 +9472,9 @@ var kg = class vc extends CustomEvent {
9338
9472
  }
9339
9473
  };
9340
9474
  m(kg, "TYPE", "model.updated");
9341
- var Eg = class bc extends CustomEvent {
9475
+ var Eg = class yc extends CustomEvent {
9342
9476
  constructor(t, r) {
9343
- super(bc.TYPE, {
9477
+ super(yc.TYPE, {
9344
9478
  bubbles: !0,
9345
9479
  detail: {
9346
9480
  src: t,
@@ -9350,18 +9484,18 @@ var Eg = class bc extends CustomEvent {
9350
9484
  }
9351
9485
  };
9352
9486
  m(Eg, "TYPE", "delete.image");
9353
- var Ag = class yc extends CustomEvent {
9487
+ var Ag = class _c extends CustomEvent {
9354
9488
  constructor(t) {
9355
- super(yc.TYPE, {
9489
+ super(_c.TYPE, {
9356
9490
  bubbles: !0,
9357
9491
  detail: t
9358
9492
  }), m(this, "handler", void 0), this.handler = t;
9359
9493
  }
9360
9494
  };
9361
9495
  m(Ag, "TYPE", "insert.image");
9362
- var xg = class _c extends CustomEvent {
9496
+ var xg = class Tc extends CustomEvent {
9363
9497
  constructor(t, r) {
9364
- super(_c.TYPE, {
9498
+ super(Tc.TYPE, {
9365
9499
  bubbles: !0,
9366
9500
  detail: {
9367
9501
  src: t,
@@ -9371,9 +9505,9 @@ var xg = class _c extends CustomEvent {
9371
9505
  }
9372
9506
  };
9373
9507
  m(xg, "TYPE", "delete.sound");
9374
- var Cg = class Tc extends CustomEvent {
9508
+ var Cg = class Sc extends CustomEvent {
9375
9509
  constructor(t) {
9376
- super(Tc.TYPE, {
9510
+ super(Sc.TYPE, {
9377
9511
  bubbles: !0,
9378
9512
  detail: t
9379
9513
  }), m(this, "handler", void 0), this.handler = t;
@@ -9408,22 +9542,31 @@ function Tt(e, t) {
9408
9542
  error: (n, ...i) => console.error(r, n, ...i)
9409
9543
  };
9410
9544
  }
9411
- function wt() {
9545
+ function St() {
9412
9546
  return typeof window < "u" && window.PIE_DEBUG === !0;
9413
9547
  }
9414
- var am = Tt("math-rendering", () => wt()), lm = Tt("pie-scoring", () => wt()), cm = Tt("pie-updates", () => wt()), um = Tt("pie-initialization", () => wt()), fm = {
9548
+ var am = Tt("math-rendering", () => St()), lm = Tt("pie-scoring", () => St()), cm = Tt("pie-updates", () => St()), um = Tt("pie-initialization", () => St()), fm = {
9415
9549
  buildServiceBase: tg,
9416
- bundleType: So.player,
9550
+ bundleType: wo.player,
9417
9551
  env: {
9418
9552
  mode: "gather",
9419
9553
  role: "student"
9420
9554
  }
9421
- }, dm = Tt("asset-handler", () => wt()), hm = Tt("authoring", () => wt()), pm = Tt("instrumentation-event-bridge", () => wt()), gm = Tt("instrumentation-provider-resolution", () => wt()), mm = Object.freeze([
9555
+ }, dm = Tt("asset-handler", () => St()), hm = Tt("authoring", () => St()), pm = Tt("instrumentation-event-bridge", () => St()), gm = Tt("instrumentation-provider-resolution", () => St()), mm = Object.freeze([
9422
9556
  "composed",
9423
9557
  "engine-ready",
9424
9558
  "interactive",
9425
9559
  "disposed"
9426
- ]), vm = Tt("pie-overrides", () => wt()), Sc = [
9560
+ ]), vm = /* @__PURE__ */ new Set([
9561
+ "id",
9562
+ "element",
9563
+ .../* @__PURE__ */ new Set([
9564
+ "complete",
9565
+ "component",
9566
+ "timestamp",
9567
+ "sourceRuntimeId"
9568
+ ])
9569
+ ]), bm = Tt("pie-overrides", () => St()), kc = [
9427
9570
  "a[href]",
9428
9571
  "button:not([disabled])",
9429
9572
  "input:not([disabled]):not([type='hidden'])",
@@ -9433,10 +9576,10 @@ var am = Tt("math-rendering", () => wt()), lm = Tt("pie-scoring", () => wt()), c
9433
9576
  "[tabindex]:not([tabindex='-1'])"
9434
9577
  ].join(",");
9435
9578
  function Og(e) {
9436
- return !e.matches(Sc) || e.hasAttribute("disabled") || e.closest("[inert]") ? !1 : e.offsetParent !== null || e.getClientRects().length > 0;
9579
+ return !e.matches(kc) || e.hasAttribute("disabled") || e.closest("[inert]") ? !1 : e.offsetParent !== null || e.getClientRects().length > 0;
9437
9580
  }
9438
- function kc(e) {
9439
- return Array.from(e.querySelectorAll(Sc)).filter((t) => Og(t));
9581
+ function Ec(e) {
9582
+ return Array.from(e.querySelectorAll(kc)).filter((t) => Og(t));
9440
9583
  }
9441
9584
  function Ig(e, t) {
9442
9585
  try {
@@ -9444,7 +9587,7 @@ function Ig(e, t) {
9444
9587
  t.focus();
9445
9588
  return;
9446
9589
  }
9447
- const r = kc(e);
9590
+ const r = Ec(e);
9448
9591
  if (r.length > 0) {
9449
9592
  r[0].focus();
9450
9593
  return;
@@ -9460,7 +9603,7 @@ function Rg(e, t = {}) {
9460
9603
  return;
9461
9604
  }
9462
9605
  if (o.key !== "Tab") return;
9463
- const s = kc(e);
9606
+ const s = Ec(e);
9464
9607
  if (!s.length) {
9465
9608
  if (!n) return;
9466
9609
  o.preventDefault(), e.focus?.();
@@ -9495,22 +9638,22 @@ function Pg(e, t) {
9495
9638
  } catch {
9496
9639
  }
9497
9640
  }
9498
- var Ng = /* @__PURE__ */ ef('<svg xmlns="http://www.w3.org/2000/svg" class="pie-tool-color-scheme__check svelte-17qy4wk" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="20 6 9 17 4 12"></polyline></svg>'), $g = /* @__PURE__ */ Fo('<button type="button" role="menuitem"><div class="pie-tool-color-scheme__preview svelte-17qy4wk"><div class="pie-tool-color-scheme__preview-bg svelte-17qy4wk"><div class="pie-tool-color-scheme__preview-text svelte-17qy4wk">A</div> <div class="pie-tool-color-scheme__preview-primary svelte-17qy4wk"></div></div></div> <div class="pie-tool-color-scheme__info svelte-17qy4wk"><div class="pie-tool-color-scheme__name svelte-17qy4wk"> </div> <div class="pie-tool-color-scheme__description svelte-17qy4wk"> </div></div> <!></button>'), Dg = /* @__PURE__ */ Fo('<div class="pie-tool-color-scheme__dropdown svelte-17qy4wk" role="menu"></div>'), Wg = /* @__PURE__ */ Fo('<div class="pie-tool-color-scheme svelte-17qy4wk" role="dialog" tabindex="-1" aria-label="Theme selector"><div class="pie-tool-color-scheme__content svelte-17qy4wk"><p class="pie-tool-color-scheme__description svelte-17qy4wk">Select a theme to improve readability and reduce eye strain.</p> <button type="button" class="pie-tool-color-scheme__dropdown-trigger svelte-17qy4wk" aria-label="Select theme"><div class="pie-tool-color-scheme__current svelte-17qy4wk"><div class="pie-tool-color-scheme__preview svelte-17qy4wk"><div class="pie-tool-color-scheme__preview-bg svelte-17qy4wk"><div class="pie-tool-color-scheme__preview-text svelte-17qy4wk">A</div> <div class="pie-tool-color-scheme__preview-primary svelte-17qy4wk"></div></div></div> <div class="pie-tool-color-scheme__current-info svelte-17qy4wk"><div class="pie-tool-color-scheme__current-name svelte-17qy4wk"> </div> <div class="pie-tool-color-scheme__current-description svelte-17qy4wk"> </div></div> <svg class="pie-tool-color-scheme__dropdown-arrow svelte-17qy4wk" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M7,10L12,15L17,10H7Z"></path></svg></div></button> <!></div></div>'), zg = {
9641
+ var Ng = /* @__PURE__ */ tf('<svg xmlns="http://www.w3.org/2000/svg" class="pie-tool-color-scheme__check svelte-17qy4wk" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="20 6 9 17 4 12"></polyline></svg>'), $g = /* @__PURE__ */ Fo('<button type="button" role="menuitem"><div class="pie-tool-color-scheme__preview svelte-17qy4wk"><div class="pie-tool-color-scheme__preview-bg svelte-17qy4wk"><div class="pie-tool-color-scheme__preview-text svelte-17qy4wk">A</div> <div class="pie-tool-color-scheme__preview-primary svelte-17qy4wk"></div></div></div> <div class="pie-tool-color-scheme__info svelte-17qy4wk"><div class="pie-tool-color-scheme__name svelte-17qy4wk"> </div> <div class="pie-tool-color-scheme__description svelte-17qy4wk"> </div></div> <!></button>'), Dg = /* @__PURE__ */ Fo('<div class="pie-tool-color-scheme__dropdown svelte-17qy4wk" role="menu"></div>'), Wg = /* @__PURE__ */ Fo('<div class="pie-tool-color-scheme svelte-17qy4wk" role="dialog" tabindex="-1" aria-label="Theme selector"><div class="pie-tool-color-scheme__content svelte-17qy4wk"><p class="pie-tool-color-scheme__description svelte-17qy4wk">Select a theme to improve readability and reduce eye strain.</p> <button type="button" class="pie-tool-color-scheme__dropdown-trigger svelte-17qy4wk" aria-label="Select theme"><div class="pie-tool-color-scheme__current svelte-17qy4wk"><div class="pie-tool-color-scheme__preview svelte-17qy4wk"><div class="pie-tool-color-scheme__preview-bg svelte-17qy4wk"><div class="pie-tool-color-scheme__preview-text svelte-17qy4wk">A</div> <div class="pie-tool-color-scheme__preview-primary svelte-17qy4wk"></div></div></div> <div class="pie-tool-color-scheme__current-info svelte-17qy4wk"><div class="pie-tool-color-scheme__current-name svelte-17qy4wk"> </div> <div class="pie-tool-color-scheme__current-description svelte-17qy4wk"> </div></div> <svg class="pie-tool-color-scheme__dropdown-arrow svelte-17qy4wk" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M7,10L12,15L17,10H7Z"></path></svg></div></button> <!></div></div>'), Hg = {
9499
9642
  hash: "svelte-17qy4wk",
9500
9643
  code: `.pie-tool-color-scheme.svelte-17qy4wk {position:relative;width:100%;height:100%;min-height:0;background-color:var(--pie-background, white);display:flex;flex-direction:column;}.pie-tool-color-scheme__content.svelte-17qy4wk {padding:1rem;position:relative;display:flex;flex-direction:column;gap:1rem;min-height:0;overflow:auto;}.pie-tool-color-scheme__description.svelte-17qy4wk {margin:0 0 1rem 0;color:var(--pie-text, black);opacity:0.7;font-size:0.875rem;}.pie-tool-color-scheme__dropdown-trigger.svelte-17qy4wk {width:100%;padding:0.75rem;border:2px solid var(--pie-border, #ccc);border-radius:0.5rem;background-color:var(--pie-background, white);color:var(--pie-text, black);cursor:pointer;transition:all 0.15s ease;}.pie-tool-color-scheme__dropdown-trigger.svelte-17qy4wk:hover {background-color:var(--pie-secondary-background, #f0f0f0);}.pie-tool-color-scheme__current.svelte-17qy4wk {display:flex;align-items:center;gap:0.75rem;}.pie-tool-color-scheme__current-info.svelte-17qy4wk {flex:1;text-align:left;}.pie-tool-color-scheme__current-name.svelte-17qy4wk {font-size:0.875rem;font-weight:600;color:var(--pie-text, black);}.pie-tool-color-scheme__current-description.svelte-17qy4wk {font-size:0.75rem;color:var(--pie-text, black);opacity:0.6;}.pie-tool-color-scheme__dropdown-arrow.svelte-17qy4wk {width:1.5rem;height:1.5rem;flex-shrink:0;}.pie-tool-color-scheme__dropdown.svelte-17qy4wk {position:relative;width:100%;max-height:24rem;background-color:var(--pie-background, white);border:2px solid var(--pie-border, #ccc);border-radius:0.5rem;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);overflow-y:auto;overflow-x:hidden;margin-top:0.5rem;}.pie-tool-color-scheme__option.svelte-17qy4wk {display:flex;align-items:center;gap:0.75rem;width:100%;padding:0.75rem 1rem;border:none;background-color:transparent;color:var(--pie-text, black);cursor:pointer;text-align:left;transition:background-color 0.15s ease;}.pie-tool-color-scheme__option.svelte-17qy4wk:hover {background-color:var(--pie-secondary-background, rgba(0, 0, 0, 0.05));}.pie-tool-color-scheme__option--active.svelte-17qy4wk {background-color:var(--pie-primary-light, rgba(63, 81, 181, 0.1));}.pie-tool-color-scheme__preview.svelte-17qy4wk {flex-shrink:0;width:2.5rem;height:2.5rem;border:2px solid var(--pie-border, #ccc);border-radius:0.25rem;overflow:hidden;}.pie-tool-color-scheme__preview-bg.svelte-17qy4wk {width:100%;height:100%;position:relative;display:flex;align-items:center;justify-content:center;}.pie-tool-color-scheme__preview-text.svelte-17qy4wk {font-weight:700;font-size:1.25rem;}.pie-tool-color-scheme__preview-primary.svelte-17qy4wk {position:absolute;bottom:0;right:0;width:0.75rem;height:0.75rem;border-radius:50%;}.pie-tool-color-scheme__info.svelte-17qy4wk {flex:1;}.pie-tool-color-scheme__name.svelte-17qy4wk {font-size:0.875rem;font-weight:600;color:var(--pie-text, black);line-height:1.25;}.pie-tool-color-scheme__description.svelte-17qy4wk {font-size:0.75rem;color:var(--pie-text, black);opacity:0.6;}.pie-tool-color-scheme__check.svelte-17qy4wk {flex-shrink:0;width:1rem;height:1rem;color:var(--pie-primary, #3f51b5);}
9501
9644
 
9502
9645
  /* Keyboard focus styling */.pie-tool-color-scheme__dropdown-trigger.svelte-17qy4wk:focus-visible,
9503
9646
  .pie-tool-color-scheme__option.svelte-17qy4wk:focus-visible {outline:2px solid var(--pie-primary, #3f51b5);outline-offset:2px;}`
9504
9647
  };
9505
- function Hg(e, t) {
9506
- Aa(t, !0), mf(e, zg);
9648
+ function zg(e, t) {
9649
+ Aa(t, !0), vf(e, Hg);
9507
9650
  const r = typeof window < "u";
9508
9651
  let n = Mn(t, "visible", 7, !1), i = Mn(t, "toolId", 7, "theme"), o = Mn(t, "schemes", 7, ""), s = Mn(t, "schemeCatalog", 7, null), a = /* @__PURE__ */ ke(void 0), l = /* @__PURE__ */ ke(null);
9509
- const c = /* @__PURE__ */ _i(() => S(l)?.toolCoordinator);
9652
+ const c = /* @__PURE__ */ _i(() => w(l)?.toolCoordinator);
9510
9653
  let u = /* @__PURE__ */ ke(!1);
9511
- wr(() => {
9512
- if (S(a))
9513
- return $f(S(a), (k) => {
9654
+ Sr(() => {
9655
+ if (w(a))
9656
+ return Df(w(a), (k) => {
9514
9657
  oe(l, k, !0);
9515
9658
  });
9516
9659
  });
@@ -9528,11 +9671,11 @@ function Hg(e, t) {
9528
9671
  }
9529
9672
  function g(k) {
9530
9673
  if (!k || typeof k != "object") return null;
9531
- const x = k, z = typeof x.id == "string" ? x.id.trim() : "";
9532
- if (!z) return null;
9533
- const ae = typeof x.name == "string" && x.name.trim() ? x.name.trim() : z, ot = typeof x.description == "string" ? x.description : "", be = x.preview;
9674
+ const x = k, H = typeof x.id == "string" ? x.id.trim() : "";
9675
+ if (!H) return null;
9676
+ const ae = typeof x.name == "string" && x.name.trim() ? x.name.trim() : H, ot = typeof x.description == "string" ? x.description : "", be = x.preview;
9534
9677
  return {
9535
- id: z,
9678
+ id: H,
9536
9679
  name: ae,
9537
9680
  description: ot,
9538
9681
  preview: be && typeof be == "object" && typeof be.bg == "string" && typeof be.text == "string" && typeof be.primary == "string" ? {
@@ -9546,13 +9689,13 @@ function Hg(e, t) {
9546
9689
  if (!k?.trim()) return [];
9547
9690
  try {
9548
9691
  const x = JSON.parse(k);
9549
- return Array.isArray(x) ? x.map((z) => g(z)).filter((z) => !!z) : [];
9692
+ return Array.isArray(x) ? x.map((H) => g(H)).filter((H) => !!H) : [];
9550
9693
  } catch {
9551
9694
  return [];
9552
9695
  }
9553
9696
  }
9554
9697
  function _() {
9555
- const k = S(a)?.closest("pie-theme");
9698
+ const k = w(a)?.closest("pie-theme");
9556
9699
  if (k) return k;
9557
9700
  const x = document.querySelector('pie-theme[scope="document"]');
9558
9701
  return x || document.querySelector("pie-theme");
@@ -9567,8 +9710,8 @@ function Hg(e, t) {
9567
9710
  }
9568
9711
  const T = /* @__PURE__ */ _i(() => {
9569
9712
  if (Array.isArray(s()) && s().length > 0) {
9570
- const z = s().map((ae) => g(ae)).filter((ae) => !!ae);
9571
- if (z.length > 0) return z;
9713
+ const H = s().map((ae) => g(ae)).filter((ae) => !!ae);
9714
+ if (H.length > 0) return H;
9572
9715
  }
9573
9716
  const k = v(o());
9574
9717
  if (k.length > 0) return k;
@@ -9580,64 +9723,64 @@ function Hg(e, t) {
9580
9723
  preview: f
9581
9724
  }];
9582
9725
  });
9583
- let I = /* @__PURE__ */ ke("default"), N = /* @__PURE__ */ ke(!1), w = null;
9726
+ let I = /* @__PURE__ */ ke("default"), N = /* @__PURE__ */ ke(!1), S = null;
9584
9727
  function F(k) {
9585
9728
  if (!r) return;
9586
9729
  const x = _();
9587
9730
  if (x) x.setAttribute("scheme", k || "default");
9588
9731
  else {
9589
- const z = document.documentElement;
9590
- k === "default" ? z.removeAttribute("data-color-scheme") : z.setAttribute("data-color-scheme", k);
9732
+ const H = document.documentElement;
9733
+ k === "default" ? H.removeAttribute("data-color-scheme") : H.setAttribute("data-color-scheme", k);
9591
9734
  }
9592
9735
  Pg("pie-color-scheme", k);
9593
9736
  }
9594
9737
  function B(k) {
9595
- oe(I, k, !0), F(k), S(c)?.hideTool(i());
9738
+ oe(I, k, !0), F(k), w(c)?.hideTool(i());
9596
9739
  }
9597
9740
  function se() {
9598
- oe(N, !S(N));
9741
+ oe(N, !w(N));
9599
9742
  }
9600
- let ee = /* @__PURE__ */ _i(() => S(T).find((k) => k.id === S(I)) || S(T)[0] || {
9743
+ let ee = /* @__PURE__ */ _i(() => w(T).find((k) => k.id === w(I)) || w(T)[0] || {
9601
9744
  id: "default",
9602
9745
  name: "Default",
9603
9746
  description: "",
9604
9747
  preview: f
9605
9748
  });
9606
- wr(() => {
9607
- S(T).find((k) => k.id === S(I)) || oe(I, S(T)[0]?.id || "default", !0);
9749
+ Sr(() => {
9750
+ w(T).find((k) => k.id === w(I)) || oe(I, w(T)[0]?.id || "default", !0);
9608
9751
  });
9609
9752
  function it(k) {
9610
9753
  if (k.key === "Escape")
9611
- S(N) && oe(N, !1);
9612
- else if (S(N) && (k.key === "ArrowDown" || k.key === "ArrowUp")) {
9754
+ w(N) && oe(N, !1);
9755
+ else if (w(N) && (k.key === "ArrowDown" || k.key === "ArrowUp")) {
9613
9756
  k.preventDefault();
9614
- const x = S(a)?.querySelectorAll(".pie-tool-color-scheme__option:not([disabled])");
9757
+ const x = w(a)?.querySelectorAll(".pie-tool-color-scheme__option:not([disabled])");
9615
9758
  if (!x || x.length === 0) return;
9616
- const z = Array.from(x).findIndex((ot) => ot === document.activeElement);
9759
+ const H = Array.from(x).findIndex((ot) => ot === document.activeElement);
9617
9760
  let ae;
9618
- k.key === "ArrowDown" ? ae = z === -1 ? 0 : (z + 1) % x.length : ae = z === -1 ? x.length - 1 : (z - 1 + x.length) % x.length, x[ae]?.focus();
9761
+ k.key === "ArrowDown" ? ae = H === -1 ? 0 : (H + 1) % x.length : ae = H === -1 ? x.length - 1 : (H - 1 + x.length) % x.length, x[ae]?.focus();
9619
9762
  }
9620
9763
  }
9621
- wr(() => {
9622
- S(c) && i() && !S(u) && (S(c).registerTool(i(), "Theme", void 0, oo.MODAL), oe(u, !0));
9623
- }), wr(() => {
9624
- S(c) && S(a) && i() && S(c).updateToolElement(i(), S(a));
9625
- }), wr(() => {
9626
- !n() && w ? (w(), w = null) : n() && S(a) && !w && (w = Rg(S(a)));
9627
- }), uf(() => {
9764
+ Sr(() => {
9765
+ w(c) && i() && !w(u) && (w(c).registerTool(i(), "Theme", void 0, oo.MODAL), oe(u, !0));
9766
+ }), Sr(() => {
9767
+ w(c) && w(a) && i() && w(c).updateToolElement(i(), w(a));
9768
+ }), Sr(() => {
9769
+ !n() && S ? (S(), S = null) : n() && w(a) && !S && (S = Rg(w(a)));
9770
+ }), ff(() => {
9628
9771
  if (r) {
9629
- const x = _()?.getAttribute("scheme"), z = Lg("pie-color-scheme") ?? x ?? "default";
9630
- oe(I, z, !0), z && requestAnimationFrame(() => {
9631
- F(z);
9772
+ const x = _()?.getAttribute("scheme"), H = Lg("pie-color-scheme") ?? x ?? "default";
9773
+ oe(I, H, !0), H && requestAnimationFrame(() => {
9774
+ F(H);
9632
9775
  });
9633
9776
  }
9634
9777
  function k(x) {
9635
- if (!S(N)) return;
9636
- const z = x.composedPath();
9637
- (!S(a) || !z.includes(S(a))) && oe(N, !1);
9778
+ if (!w(N)) return;
9779
+ const H = x.composedPath();
9780
+ (!w(a) || !H.includes(w(a))) && oe(N, !1);
9638
9781
  }
9639
9782
  return document.addEventListener("click", k), () => {
9640
- document.removeEventListener("click", k), S(c) && i() && S(c).unregisterTool(i());
9783
+ document.removeEventListener("click", k), w(c) && i() && w(c).unregisterTool(i());
9641
9784
  };
9642
9785
  });
9643
9786
  var J = {
@@ -9665,19 +9808,19 @@ function Hg(e, t) {
9665
9808
  set schemeCatalog(k = null) {
9666
9809
  s(k), Jr();
9667
9810
  }
9668
- }, Q = tf(), St = Wu(Q), sr = (k) => {
9669
- var x = Wg(), z = fe(x), ae = ct(fe(z), 2), ot = fe(ae), be = fe(ot), ar = fe(be), Y = fe(ar), pn = ct(Y, 2);
9811
+ }, Q = rf(), wt = Hu(Q), sr = (k) => {
9812
+ var x = Wg(), H = fe(x), ae = ct(fe(H), 2), ot = fe(ae), be = fe(ot), ar = fe(be), Y = fe(ar), pn = ct(Y, 2);
9670
9813
  ce(ar), ce(be);
9671
9814
  var Z = ct(be, 2), lr = fe(Z), j = fe(lr, !0);
9672
9815
  ce(lr);
9673
9816
  var kt = ct(lr, 2), cr = fe(kt, !0);
9674
- ce(kt), ce(Z), wa(2), ce(ot), ce(ae);
9817
+ ce(kt), ce(Z), Sa(2), ce(ot), ce(ae);
9675
9818
  var Ve = ct(ae, 2), gn = (st) => {
9676
9819
  var ur = Dg();
9677
- hf(ur, 21, () => S(T), (fr) => fr.id, (fr, ne) => {
9678
- var we = $g();
9820
+ pf(ur, 21, () => w(T), (fr) => fr.id, (fr, ne) => {
9821
+ var Se = $g();
9679
9822
  let Ge;
9680
- var Lt = fe(we), Pt = fe(Lt), at = fe(Pt), dr = ct(at, 2);
9823
+ var Lt = fe(Se), Pt = fe(Lt), at = fe(Pt), dr = ct(at, 2);
9681
9824
  ce(Pt), ce(Lt);
9682
9825
  var Et = ct(Lt, 2), hr = fe(Et), mn = fe(hr, !0);
9683
9826
  ce(hr);
@@ -9685,27 +9828,27 @@ function Hg(e, t) {
9685
9828
  ce(vn), ce(Et);
9686
9829
  var Nt = ct(Et, 2), At = (ye) => {
9687
9830
  var Dr = Ng();
9688
- Sr(ye, Dr);
9831
+ wr(ye, Dr);
9689
9832
  };
9690
9833
  ki(Nt, (ye) => {
9691
- S(I) === S(ne).id && ye(At);
9692
- }), ce(we), Ts(() => {
9693
- Ge = yf(we, 1, "pie-tool-color-scheme__option svelte-17qy4wk", null, Ge, { "pie-tool-color-scheme__option--active": S(I) === S(ne).id }), xi(we, "aria-label", S(ne).name), xi(we, "aria-current", S(I) === S(ne).id), mr(Pt, `background-color: ${S(ne).preview.bg ?? ""}`), mr(at, `color: ${S(ne).preview.text ?? ""}`), mr(dr, `background-color: ${S(ne).preview.primary ?? ""}`), An(mn, S(ne).name), An($r, S(ne).description);
9694
- }), Ti("click", we, () => B(S(ne).id)), Sr(fr, we);
9695
- }), ce(ur), Sr(st, ur);
9834
+ w(I) === w(ne).id && ye(At);
9835
+ }), ce(Se), Ts(() => {
9836
+ Ge = _f(Se, 1, "pie-tool-color-scheme__option svelte-17qy4wk", null, Ge, { "pie-tool-color-scheme__option--active": w(I) === w(ne).id }), xi(Se, "aria-label", w(ne).name), xi(Se, "aria-current", w(I) === w(ne).id), mr(Pt, `background-color: ${w(ne).preview.bg ?? ""}`), mr(at, `color: ${w(ne).preview.text ?? ""}`), mr(dr, `background-color: ${w(ne).preview.primary ?? ""}`), An(mn, w(ne).name), An($r, w(ne).description);
9837
+ }), Ti("click", Se, () => B(w(ne).id)), wr(fr, Se);
9838
+ }), ce(ur), wr(st, ur);
9696
9839
  };
9697
9840
  ki(Ve, (st) => {
9698
- S(N) && st(gn);
9699
- }), ce(z), ce(x), Af(x, (st) => oe(a, st), () => S(a)), Ts(() => {
9700
- xi(ae, "aria-expanded", S(N)), mr(ar, `background-color: ${S(ee).preview.bg ?? ""}`), mr(Y, `color: ${S(ee).preview.text ?? ""}`), mr(pn, `background-color: ${S(ee).preview.primary ?? ""}`), An(j, S(ee).name), An(cr, S(ee).description);
9701
- }), Ti("keydown", x, it), Ti("click", ae, se), Sr(k, x);
9841
+ w(N) && st(gn);
9842
+ }), ce(H), ce(x), xf(x, (st) => oe(a, st), () => w(a)), Ts(() => {
9843
+ xi(ae, "aria-expanded", w(N)), mr(ar, `background-color: ${w(ee).preview.bg ?? ""}`), mr(Y, `color: ${w(ee).preview.text ?? ""}`), mr(pn, `background-color: ${w(ee).preview.primary ?? ""}`), An(j, w(ee).name), An(cr, w(ee).description);
9844
+ }), Ti("keydown", x, it), Ti("click", ae, se), wr(k, x);
9702
9845
  };
9703
- return ki(St, (k) => {
9846
+ return ki(wt, (k) => {
9704
9847
  n() && k(sr);
9705
- }), Sr(e, Q), xa(J);
9848
+ }), wr(e, Q), xa(J);
9706
9849
  }
9707
- Xu(["keydown", "click"]);
9708
- customElements.define("pie-tool-theme", Of(Hg, {
9850
+ Ju(["keydown", "click"]);
9851
+ customElements.define("pie-tool-theme", If(zg, {
9709
9852
  visible: {
9710
9853
  attribute: "visible",
9711
9854
  type: "Boolean"
@@ -9721,7 +9864,7 @@ customElements.define("pie-tool-theme", Of(Hg, {
9721
9864
  schemeCatalog: { type: "Object" }
9722
9865
  }, [], [], { mode: "open" }));
9723
9866
  export {
9724
- Hg as default,
9867
+ zg as default,
9725
9868
  Ug as n,
9726
9869
  Bg as t
9727
9870
  };