@pie-players/pie-tool-theme 0.3.47 → 0.3.49

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,16 +1,16 @@
1
1
  import { t as m } from "./defineProperty-Dt7ri80W.js";
2
- var Ac = Object.create, pa = Object.defineProperty, xc = Object.getOwnPropertyDescriptor, Cc = Object.getOwnPropertyNames, Mc = Object.getPrototypeOf, Oc = Object.prototype.hasOwnProperty, Ig = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), Ic = (e, t, r, n) => {
2
+ var xc = Object.create, pa = Object.defineProperty, Cc = Object.getOwnPropertyDescriptor, Mc = Object.getOwnPropertyNames, Oc = Object.getPrototypeOf, Ic = Object.prototype.hasOwnProperty, Ng = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), Rc = (e, t, r, n) => {
3
3
  if (t && typeof t == "object" || typeof t == "function")
4
- for (var i = Cc(t), o = 0, s = i.length, a; o < s; o++)
5
- a = i[o], !Oc.call(e, a) && a !== r && pa(e, a, {
4
+ for (var i = Mc(t), o = 0, s = i.length, a; o < s; o++)
5
+ a = i[o], !Ic.call(e, a) && a !== r && pa(e, a, {
6
6
  get: ((l) => t[l]).bind(null, a),
7
- enumerable: !(n = xc(t, a)) || n.enumerable
7
+ enumerable: !(n = Cc(t, a)) || n.enumerable
8
8
  });
9
9
  return e;
10
- }, Rc = (e, t, r) => (r = e != null ? Ac(Mc(e)) : {}, Ic(t || !e || !e.__esModule ? pa(r, "default", {
10
+ }, Lc = (e, t, r) => (r = e != null ? xc(Oc(e)) : {}, Rc(t || !e || !e.__esModule ? pa(r, "default", {
11
11
  value: e,
12
12
  enumerable: !0
13
- }) : r, e)), Rg = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, r) => (typeof require < "u" ? require : t)[r] }) : e)(function(e) {
13
+ }) : r, e)), $g = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, r) => (typeof require < "u" ? require : t)[r] }) : e)(function(e) {
14
14
  if (typeof require < "u") return require.apply(this, arguments);
15
15
  throw Error('Calling `require` for "' + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
16
16
  });
@@ -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 ga = Array.isArray, Lc = Array.prototype.indexOf, zn = Array.prototype.includes, ni = Array.from, Wn = Object.keys, Fn = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, Pc = Object.getOwnPropertyDescriptors, Nc = Object.prototype, $c = Array.prototype, ma = Object.getPrototypeOf, ds = Object.isExtensible, Dc = () => {
22
+ var ga = Array.isArray, Pc = Array.prototype.indexOf, zn = Array.prototype.includes, ni = Array.from, Wn = Object.keys, Fn = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, Nc = Object.getOwnPropertyDescriptors, $c = Object.prototype, Dc = Array.prototype, ma = Object.getPrototypeOf, ds = Object.isExtensible, Hc = () => {
23
23
  };
24
- function Hc(e) {
24
+ function zc(e) {
25
25
  for (var t = 0; t < e.length; t++) e[t]();
26
26
  }
27
27
  function va() {
@@ -34,58 +34,58 @@ function va() {
34
34
  reject: t
35
35
  };
36
36
  }
37
- var Lg = 1 << 24, Pe = 1024, He = 2048, nr = 4096, ko = 8192, zc = 16384, Eo = 32768, hs = 1 << 25, Ao = 65536, Pg = 1 << 17, Ng = 1 << 18, Pr = 1 << 19, Wc = 1 << 20, tn = 1 << 25, cn = 65536, ps = 1 << 21, Fc = 1 << 22, Bn = 1 << 23, rn = /* @__PURE__ */ Symbol("$state"), ba = /* @__PURE__ */ Symbol("legacy props"), Bc = /* @__PURE__ */ Symbol(""), Uc = /* @__PURE__ */ Symbol("proxy path"), Bi = /* @__PURE__ */ Symbol("attributes"), Ui = /* @__PURE__ */ Symbol("class"), ji = /* @__PURE__ */ Symbol("style"), In = /* @__PURE__ */ Symbol("text");
37
+ var Dg = 1 << 24, Pe = 1024, He = 2048, nr = 4096, ko = 8192, Wc = 16384, Eo = 32768, hs = 1 << 25, Ao = 65536, Hg = 1 << 17, zg = 1 << 18, Pr = 1 << 19, Fc = 1 << 20, tn = 1 << 25, cn = 65536, ps = 1 << 21, Bc = 1 << 22, Bn = 1 << 23, rn = /* @__PURE__ */ Symbol("$state"), ba = /* @__PURE__ */ Symbol("legacy props"), Uc = /* @__PURE__ */ Symbol(""), jc = /* @__PURE__ */ Symbol("proxy path"), Bi = /* @__PURE__ */ Symbol("attributes"), Ui = /* @__PURE__ */ Symbol("class"), ji = /* @__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
- }(), jc = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
43
- function qc(e) {
42
+ }(), qc = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
43
+ function Vc(e) {
44
44
  throw new Error("https://svelte.dev/e/lifecycle_outside_component");
45
45
  }
46
- function Vc() {
46
+ function Gc() {
47
47
  throw new Error("https://svelte.dev/e/async_derived_orphan");
48
48
  }
49
- function Gc(e, t, r) {
49
+ function Yc(e, t, r) {
50
50
  throw new Error("https://svelte.dev/e/each_key_duplicate");
51
51
  }
52
- function Yc(e) {
52
+ function Kc(e) {
53
53
  throw new Error("https://svelte.dev/e/effect_in_teardown");
54
54
  }
55
- function Kc() {
55
+ function Xc() {
56
56
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
57
57
  }
58
- function Xc(e) {
58
+ function Jc(e) {
59
59
  throw new Error("https://svelte.dev/e/effect_orphan");
60
60
  }
61
- function Jc() {
61
+ function Qc() {
62
62
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
63
63
  }
64
- function Qc() {
64
+ function Zc() {
65
65
  throw new Error("https://svelte.dev/e/hydration_failed");
66
66
  }
67
- function Zc(e) {
67
+ function eu(e) {
68
68
  throw new Error("https://svelte.dev/e/props_invalid_value");
69
69
  }
70
- function eu() {
70
+ function tu() {
71
71
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
72
72
  }
73
- function tu() {
73
+ function ru() {
74
74
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
75
75
  }
76
- function ru() {
76
+ function nu() {
77
77
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
78
78
  }
79
- function nu() {
79
+ function iu() {
80
80
  throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
81
81
  }
82
- function iu() {
82
+ function ou() {
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 ou() {
88
+ function su() {
89
89
  console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
90
90
  }
91
91
  var H = !1;
@@ -135,18 +135,18 @@ function _a(e) {
135
135
  function Ta(e) {
136
136
  return e === this.v;
137
137
  }
138
- function su(e, t) {
138
+ function au(e, t) {
139
139
  return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
140
140
  }
141
141
  function wa(e) {
142
- return !su(e, this.v);
142
+ return !au(e, this.v);
143
143
  }
144
144
  var gt = !1, un = !1;
145
145
  function gs(e, t) {
146
- return e.label = t, au(e.v, t), e;
146
+ return e.label = t, lu(e.v, t), e;
147
147
  }
148
- function au(e, t) {
149
- return e?.[Uc]?.(t), e;
148
+ function lu(e, t) {
149
+ return e?.[jc]?.(t), e;
150
150
  }
151
151
  var q = null;
152
152
  function Mr(e) {
@@ -182,7 +182,7 @@ function fn() {
182
182
  var Wt = [];
183
183
  function Ea() {
184
184
  var e = Wt;
185
- Wt = [], Hc(e);
185
+ Wt = [], zc(e);
186
186
  }
187
187
  function Qt(e) {
188
188
  if (Wt.length === 0 && !nn) {
@@ -193,7 +193,7 @@ function Qt(e) {
193
193
  }
194
194
  Wt.push(e);
195
195
  }
196
- function lu() {
196
+ function cu() {
197
197
  for (; Wt.length > 0; ) Ea();
198
198
  }
199
199
  function Aa(e) {
@@ -219,9 +219,9 @@ function Rt(e, t) {
219
219
  }
220
220
  throw e;
221
221
  }
222
- var cu = ~(He | nr | Pe);
222
+ var uu = ~(He | nr | Pe);
223
223
  function G(e, t) {
224
- e.f = e.f & cu | t;
224
+ e.f = e.f & uu | t;
225
225
  }
226
226
  function xo(e) {
227
227
  (e.f & 512) !== 0 || e.deps === null ? G(e, Pe) : G(e, nr);
@@ -234,8 +234,8 @@ function xa(e) {
234
234
  function Ca(e, t, r) {
235
235
  (e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && r.add(e), xa(e.deps), G(e, Pe);
236
236
  }
237
- var uu = !1, wn = !1;
238
- function fu(e) {
237
+ var fu = !1, wn = !1;
238
+ function du(e) {
239
239
  var t = wn;
240
240
  try {
241
241
  return wn = !1, [e(), wn];
@@ -263,9 +263,9 @@ function p(e, t) {
263
263
  return e.get(L(e, t));
264
264
  }
265
265
  var Oa, jn = null, yr = null, P = null, qi = null, pe = null, Vi = null, nn = !1, yi = !1, Or = null, qn = null, Ia = 0;
266
- var du = 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(), Gi = /* @__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 Ra {
266
+ var hu = 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(), Gi = /* @__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 Ra {
267
267
  constructor() {
268
- Co(this, K), m(this, "id", du++), 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, Gi, []), 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", hu++), 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, Gi, []), 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, {
@@ -374,7 +374,7 @@ var du = 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) && !uu))
377
+ if (Or !== null && r === O && (gt || ($ === null || ($.f & 2) === 0) && !fu))
378
378
  return;
379
379
  if ((n & 96) !== 0) {
380
380
  if ((n & 1024) === 0) return;
@@ -400,7 +400,7 @@ function ms() {
400
400
  return !1;
401
401
  }
402
402
  function Yn() {
403
- C(Vn, this, !0), Ia++ > 1e3 && (L(K, this, Kn).call(this), mu());
403
+ C(Vn, this, !0), Ia++ > 1e3 && (L(K, this, Kn).call(this), vu());
404
404
  for (const a of p(Zt, this))
405
405
  p(ht, this).delete(a), G(a, He), this.schedule(a);
406
406
  for (const a of p(ht, this))
@@ -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, hu).call(this);
426
+ const o = L(K, this, pu).call(this);
427
427
  if (o) {
428
- L(K, this, Xr).call(this, r), L(K, this, Xr).call(this, t), L(K, o, pu).call(o, this);
428
+ L(K, this, Xr).call(this, r), L(K, this, Xr).call(this, t), L(K, o, gu).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(), qi = this, vs(r), vs(t), qi = 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, gu).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, mu).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 La(e, t, r) {
460
460
  }
461
461
  }
462
462
  }
463
- function hu() {
463
+ function pu() {
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 hu() {
469
469
  }
470
470
  return null;
471
471
  }
472
- function pu(e) {
472
+ function gu(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 pu(e) {
495
495
  function Xr(e) {
496
496
  for (var t = 0; t < e.length; t += 1) Ca(e[t], p(Zt, this), p(ht, this));
497
497
  }
498
- function gu() {
498
+ function mu() {
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 (lu(), P === null) return r;
553
+ if (cu(), P === null) return r;
554
554
  P.flush();
555
555
  }
556
556
  } finally {
557
557
  nn = t;
558
558
  }
559
559
  }
560
- function mu() {
560
+ function vu() {
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
- Jc();
567
+ Qc();
568
568
  } catch (r) {
569
569
  Rt(r, Vi);
570
570
  }
@@ -626,7 +626,7 @@ function $a(e) {
626
626
  for (var t = e.first; t !== null; )
627
627
  $a(t), t = t.next;
628
628
  }
629
- function vu(e) {
629
+ function bu(e) {
630
630
  let t = 0, r = er(0), n;
631
631
  return () => {
632
632
  $o() && (S(r), Do(() => (t === 0 && (n = ai(() => e(() => on(r)))), t += 1, () => {
@@ -636,13 +636,13 @@ function vu(e) {
636
636
  })));
637
637
  };
638
638
  }
639
- var bu = Ao | Pr;
640
- function yu(e, t, r, n) {
641
- new _u(e, t, r, n);
639
+ var yu = Ao | Pr;
640
+ function _u(e, t, r, n) {
641
+ new Tu(e, t, r, n);
642
642
  }
643
- var je = /* @__PURE__ */ new WeakMap(), Yi = /* @__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(), Ki = /* @__PURE__ */ new WeakMap(), Xi = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakMap(), bs = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakSet(), _u = class {
643
+ var je = /* @__PURE__ */ new WeakMap(), Yi = /* @__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(), Ki = /* @__PURE__ */ new WeakMap(), Xi = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakMap(), bs = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakSet(), Tu = class {
644
644
  constructor(e, t, r, n) {
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, Yi, H ? 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, Ki, /* @__PURE__ */ new Set()), M(this, Xi, /* @__PURE__ */ new Set()), M(this, Dt, null), M(this, bs, vu(() => (C(Dt, this, er(p(Tr, this))), () => {
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, Yi, H ? 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, Ki, /* @__PURE__ */ new Set()), M(this, Xi, /* @__PURE__ */ new Set()), M(this, Dt, null), M(this, bs, bu(() => (C(Dt, this, er(p(Tr, this))), () => {
646
646
  C(Dt, this, null);
647
647
  }))), C(je, this, e), C(Qe, this, t), C(sn, this, (i) => {
648
648
  var o = O;
@@ -654,10 +654,10 @@ var je = /* @__PURE__ */ new WeakMap(), Yi = /* @__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, wu).call(this, s);
658
- } else o ? L(ue, this, Su).call(this) : L(ue, this, Tu).call(this);
657
+ L(ue, this, Su).call(this, s);
658
+ } else o ? L(ue, this, ku).call(this) : L(ue, this, wu).call(this);
659
659
  } else L(ue, this, Da).call(this);
660
- }, bu)), H && C(je, this, D);
660
+ }, yu)), H && C(je, this, D);
661
661
  }
662
662
  defer_effect(e) {
663
663
  Ca(e, p(Ki, this), p(Xi, this));
@@ -683,21 +683,21 @@ var je = /* @__PURE__ */ new WeakMap(), Yi = /* @__PURE__ */ new WeakMap(), Qe =
683
683
  })) : L(ue, this, ys).call(this, e);
684
684
  }
685
685
  };
686
- function Tu() {
686
+ function wu() {
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 wu(e) {
693
+ function Su(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 Su() {
700
+ function ku() {
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();
@@ -753,10 +753,10 @@ function ys(e) {
753
753
  var n = !1, i = !1;
754
754
  const o = () => {
755
755
  if (n) {
756
- ou();
756
+ su();
757
757
  return;
758
758
  }
759
- n = !0, i && nu(), p(Be, this) !== null && or(p(Be, this), () => {
759
+ n = !0, i && iu(), p(Be, this) !== null && or(p(Be, this), () => {
760
760
  C(Be, this, null);
761
761
  }), L(ue, this, Ji).call(this, () => {
762
762
  L(ue, this, Da).call(this);
@@ -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 ku(e, t, r, n) {
792
+ function Eu(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 = Eu(), l = o.length === 1 ? o[0].promise : o.length > 1 ? Promise.all(o.map((h) => h.promise)) : null;
799
+ var s = O, a = Au(), 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 ku(e, t, r, n) {
814
814
  return;
815
815
  }
816
816
  function f() {
817
- Promise.all(r.map((h) => /* @__PURE__ */ Au(h))).then((h) => c([...t.map(i), ...h])).catch((h) => Rt(h, s)).finally(u);
817
+ Promise.all(r.map((h) => /* @__PURE__ */ xu(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 Eu() {
823
+ function Au() {
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 Au(e, t, r) {
859
+ function xu(e, t, r) {
860
860
  let n = O;
861
- n === null && Vc();
861
+ n === null && Gc();
862
862
  var i = void 0, o = er(re), s = !$, a = /* @__PURE__ */ new Set();
863
- return zu(() => {
863
+ return Wu(() => {
864
864
  var l = O, c = va();
865
865
  i = c.promise;
866
866
  try {
@@ -877,11 +877,11 @@ function Au(e, t, r) {
877
877
  else for (const g of a.values()) g.reject(En);
878
878
  a.add(c), u.async_deriveds.set(l, c);
879
879
  }
880
- const h = (g, b = void 0) => {
881
- f?.(), a.delete(c), b !== En && (u.activate(), b ? (o.f |= Bn, Ir(o, b)) : ((o.f & 8388608) !== 0 && (o.f ^= Bn), Ir(o, g)), u.deactivate());
880
+ const h = (g, v = void 0) => {
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
- }), $u(() => {
884
+ }), Du(() => {
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 = wa, t;
905
905
  }
906
- function xu(e) {
906
+ function Cu(e) {
907
907
  var t = e.effects;
908
908
  if (t !== null) {
909
909
  e.effects = null;
@@ -913,10 +913,10 @@ function xu(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 iu(), e.v;
916
+ return ou(), e.v;
917
917
  et(n);
918
918
  try {
919
- e.f &= ~cn, xu(e), t = al(e);
919
+ e.f &= ~cn, Cu(e), t = al(e);
920
920
  } finally {
921
921
  et(r);
922
922
  }
@@ -930,9 +930,9 @@ function Wa(e) {
930
930
  }
931
931
  mt || (pe !== null ? ($o() || P?.is_fork) && pe.set(e, t) : xo(e));
932
932
  }
933
- function Cu(e) {
933
+ function Mu(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 = Dc), 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 = Hc), t.ac = null, ln(t, 0), zo(t));
936
936
  }
937
937
  function Fa(e) {
938
938
  if (e.effects !== null)
@@ -966,7 +966,7 @@ function Ua(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)) && ru();
969
+ $ !== null && (!Ue || ($.f & 131072) !== 0) && fn() && ($.f & 4325394) !== 0 && (qe === null || !qe.has(e)) && nu();
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 = ol(), ja(e, He, r), fn() && O !== null && (O.f & 1024) !== 0 && (O.f & 96) === 0 && (Me === null ? Uu([e]) : Me.push(e)), !n.is_fork && Jn.size > 0 && !Ba && Mu();
981
+ e.wv = ol(), ja(e, He, r), fn() && O !== null && (O.f & 1024) !== 0 && (O.f & 96) === 0 && (Me === null ? ju([e]) : Me.push(e)), !n.is_fork && Jn.size > 0 && !Ba && Ou();
982
982
  }
983
983
  return t;
984
984
  }
985
- function Mu() {
985
+ function Ou() {
986
986
  Ba = !1;
987
987
  for (const e of Jn) {
988
988
  (e.f & 1024) !== 0 && G(e, nr);
@@ -1017,17 +1017,17 @@ function ja(e, t, r) {
1017
1017
  }
1018
1018
  }
1019
1019
  }
1020
- var Ou = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
1020
+ var Iu = /^[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 = ma(e);
1024
- if (t !== Nc && t !== $c) return e;
1024
+ if (t !== $c && t !== Dc) return e;
1025
1025
  var r = /* @__PURE__ */ new Map(), n = ga(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
1028
  $e(null), Ss(s);
1029
- var b = f();
1030
- return $e(h), Ss(g), b;
1029
+ var v = f();
1030
+ return $e(h), Ss(g), v;
1031
1031
  };
1032
1032
  n && r.set("length", /* @__PURE__ */ ke(e.length, o));
1033
1033
  var l = "";
@@ -1035,25 +1035,25 @@ 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, Iu(l, h));
1038
+ for (const [h, g] of r) gs(g, Ru(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) && eu();
1045
- var b = r.get(h);
1046
- return b === void 0 ? a(() => {
1044
+ (!("value" in g) || g.configurable === !1 || g.enumerable === !1 || g.writable === !1) && tu();
1045
+ var v = r.get(h);
1046
+ return v === void 0 ? a(() => {
1047
1047
  var _ = /* @__PURE__ */ ke(g.value, o);
1048
1048
  return r.set(h, _), _;
1049
- }) : oe(b, g.value, !0), !0;
1049
+ }) : oe(v, g.value, !0), !0;
1050
1050
  },
1051
1051
  deleteProperty(f, h) {
1052
1052
  var g = r.get(h);
1053
1053
  if (g === void 0) {
1054
1054
  if (h in f) {
1055
- const b = a(() => /* @__PURE__ */ ke(re, o));
1056
- r.set(h, b), on(i);
1055
+ const v = a(() => /* @__PURE__ */ ke(re, o));
1056
+ r.set(h, v), on(i);
1057
1057
  }
1058
1058
  } else
1059
1059
  oe(g, re), on(i);
@@ -1061,27 +1061,27 @@ function Er(e) {
1061
1061
  },
1062
1062
  get(f, h, g) {
1063
1063
  if (h === rn) return e;
1064
- var b = r.get(h), _ = h in f;
1065
- if (b === void 0 && (!_ || jt(f, h)?.writable) && (b = a(() => {
1064
+ var v = r.get(h), _ = h in f;
1065
+ if (v === void 0 && (!_ || jt(f, h)?.writable) && (v = a(() => {
1066
1066
  var T = /* @__PURE__ */ ke(Er(_ ? f[h] : re), o);
1067
1067
  return T;
1068
- }), r.set(h, b)), b !== void 0) {
1069
- var v = S(b);
1070
- return v === re ? void 0 : v;
1068
+ }), r.set(h, v)), v !== void 0) {
1069
+ var b = S(v);
1070
+ return b === re ? void 0 : b;
1071
1071
  }
1072
1072
  return Reflect.get(f, h, g);
1073
1073
  },
1074
1074
  getOwnPropertyDescriptor(f, h) {
1075
1075
  var g = Reflect.getOwnPropertyDescriptor(f, h);
1076
1076
  if (g && "value" in g) {
1077
- var b = r.get(h);
1078
- b && (g.value = S(b));
1077
+ var v = r.get(h);
1078
+ v && (g.value = S(v));
1079
1079
  } else if (g === void 0) {
1080
- var _ = r.get(h), v = _?.v;
1081
- if (_ !== void 0 && v !== re) return {
1080
+ var _ = r.get(h), b = _?.v;
1081
+ if (_ !== void 0 && b !== re) return {
1082
1082
  enumerable: !0,
1083
1083
  configurable: !0,
1084
- value: v,
1084
+ value: b,
1085
1085
  writable: !0
1086
1086
  };
1087
1087
  }
@@ -1089,27 +1089,27 @@ function Er(e) {
1089
1089
  },
1090
1090
  has(f, h) {
1091
1091
  if (h === rn) return !0;
1092
- var g = r.get(h), b = g !== void 0 && g.v !== re || Reflect.has(f, h);
1093
- return (g !== void 0 || O !== null && (!b || jt(f, h)?.writable)) && (g === void 0 && (g = a(() => {
1094
- var _ = /* @__PURE__ */ ke(b ? Er(f[h]) : re, o);
1092
+ var g = r.get(h), v = g !== void 0 && g.v !== re || Reflect.has(f, h);
1093
+ return (g !== void 0 || O !== null && (!v || jt(f, h)?.writable)) && (g === void 0 && (g = a(() => {
1094
+ var _ = /* @__PURE__ */ ke(v ? Er(f[h]) : re, o);
1095
1095
  return _;
1096
- }), r.set(h, g)), S(g) === re) ? !1 : b;
1096
+ }), r.set(h, g)), S(g) === re) ? !1 : v;
1097
1097
  },
1098
- set(f, h, g, b) {
1099
- var _ = r.get(h), v = h in f;
1098
+ set(f, h, g, v) {
1099
+ var _ = r.get(h), b = h in f;
1100
1100
  if (n && h === "length") for (var T = g; T < _.v; T += 1) {
1101
1101
  var I = r.get(T + "");
1102
1102
  I !== void 0 ? oe(I, re) : T in f && (I = a(() => /* @__PURE__ */ ke(re, o)), r.set(T + "", I));
1103
1103
  }
1104
1104
  if (_ === void 0)
1105
- (!v || jt(f, h)?.writable) && (_ = a(() => /* @__PURE__ */ ke(void 0, o)), oe(_, Er(g)), r.set(h, _));
1105
+ (!b || jt(f, h)?.writable) && (_ = a(() => /* @__PURE__ */ ke(void 0, o)), oe(_, Er(g)), r.set(h, _));
1106
1106
  else {
1107
- v = _.v !== re;
1107
+ b = _.v !== re;
1108
1108
  var N = a(() => Er(g));
1109
1109
  oe(_, N);
1110
1110
  }
1111
1111
  var w = Reflect.getOwnPropertyDescriptor(f, h);
1112
- if (w?.set && w.set.call(b, g), !v) {
1112
+ if (w?.set && w.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);
@@ -1121,24 +1121,24 @@ function Er(e) {
1121
1121
  ownKeys(f) {
1122
1122
  S(i);
1123
1123
  var h = Reflect.ownKeys(f).filter((_) => {
1124
- var v = r.get(_);
1125
- return v === void 0 || v.v !== re;
1124
+ var b = r.get(_);
1125
+ return b === void 0 || b.v !== re;
1126
1126
  });
1127
- for (var [g, b] of r) b.v !== re && !(g in f) && h.push(g);
1127
+ for (var [g, v] of r) v.v !== re && !(g in f) && h.push(g);
1128
1128
  return h;
1129
1129
  },
1130
1130
  setPrototypeOf() {
1131
- tu();
1131
+ ru();
1132
1132
  }
1133
1133
  });
1134
1134
  }
1135
- function Iu(e, t) {
1136
- return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : Ou.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
1135
+ function Ru(e, t) {
1136
+ return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : Iu.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
1137
1137
  }
1138
- var _s, Ru, qa, Va, Ga;
1138
+ var _s, Lu, qa, Va, Ga;
1139
1139
  function Qi() {
1140
1140
  if (_s === void 0) {
1141
- _s = window, Ru = document, qa = /Firefox/.test(navigator.userAgent);
1141
+ _s = window, Lu = document, qa = /Firefox/.test(navigator.userAgent);
1142
1142
  var e = Element.prototype, t = Node.prototype, r = Text.prototype;
1143
1143
  Va = jt(t, "firstChild").get, Ga = jt(t, "nextSibling").get, ds(e) && (e[Ui] = void 0, e[Bi] = null, e[ji] = 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 Lu(e, t = !1) {
1167
+ function Pu(e, t = !1) {
1168
1168
  if (!H) {
1169
1169
  var r = /* @__PURE__ */ Re(e);
1170
1170
  return r instanceof Comment && r.data === "" ? /* @__PURE__ */ tt(r) : r;
@@ -1216,10 +1216,10 @@ function Xa(e) {
1216
1216
  $e(t), et(r);
1217
1217
  }
1218
1218
  }
1219
- function Pu(e) {
1220
- O === null && ($ === null && Xc(e), Kc()), mt && Yc(e);
1219
+ function Nu(e) {
1220
+ O === null && ($ === null && Jc(e), Xc()), mt && Kc(e);
1221
1221
  }
1222
- function Nu(e, t) {
1222
+ function $u(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 && Nu(i, r), $ !== null && ($.f & 2) !== 0 && (e & 64) === 0)) {
1256
+ if (i !== null && (i.parent = r, r !== null && $u(i, r), $ !== null && ($.f & 2) !== 0 && (e & 64) === 0)) {
1257
1257
  var o = $;
1258
1258
  (o.effects ?? (o.effects = [])).push(i);
1259
1259
  }
@@ -1262,12 +1262,12 @@ function rt(e, t) {
1262
1262
  function $o() {
1263
1263
  return $ !== null && !Ue;
1264
1264
  }
1265
- function $u(e) {
1265
+ function Du(e) {
1266
1266
  const t = rt(8, null);
1267
1267
  return G(t, Pe), t.teardown = e, t;
1268
1268
  }
1269
1269
  function wr(e) {
1270
- Pu("$effect");
1270
+ Nu("$effect");
1271
1271
  var t = O.f;
1272
1272
  if (!$ && (t & 32) !== 0 && q !== null && !q.i) {
1273
1273
  var r = q;
@@ -1275,16 +1275,16 @@ function wr(e) {
1275
1275
  } else return Ja(e);
1276
1276
  }
1277
1277
  function Ja(e) {
1278
- return rt(4 | Wc, e);
1278
+ return rt(4 | Fc, e);
1279
1279
  }
1280
- function Du(e) {
1280
+ function Hu(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 Hu(e) {
1287
+ function zu(e) {
1288
1288
  ir.ensure();
1289
1289
  const t = rt(64 | Pr, e);
1290
1290
  return (r = {}) => new Promise((n) => {
@@ -1296,14 +1296,14 @@ function Hu(e) {
1296
1296
  function Qa(e) {
1297
1297
  return rt(4, e);
1298
1298
  }
1299
- function zu(e) {
1300
- return rt(Fc | Pr, e);
1299
+ function Wu(e) {
1300
+ return rt(Bc | 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
- ku(n, t, r, (i) => {
1306
+ Eu(n, t, r, (i) => {
1307
1307
  rt(8, () => e(...i.map(S)));
1308
1308
  });
1309
1309
  }
@@ -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 Wu(e) {
1340
+ function Fu(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 Wu(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 && (Fu(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 && (Bu(e.nodes.start, e.nodes.end), r = !0), G(e, hs), zo(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
- Za(e), e.f ^= hs, e.f |= zc;
1351
+ Za(e), e.f ^= hs, e.f |= Wc;
1352
1352
  var i = e.parent;
1353
1353
  i !== null && i.first !== null && el(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
1354
1354
  }
1355
- function Fu(e, t) {
1355
+ function Bu(e, t) {
1356
1356
  for (; e !== null; ) {
1357
1357
  var r = e === t ? null : /* @__PURE__ */ tt(e);
1358
1358
  e.remove(), e = r;
@@ -1411,7 +1411,7 @@ function Wo(e, t) {
1411
1411
  t.append(r), r = i;
1412
1412
  }
1413
1413
  }
1414
- var Bu = null, Ln = !1, mt = !1;
1414
+ var Uu = null, Ln = !1, mt = !1;
1415
1415
  function ws(e) {
1416
1416
  mt = e;
1417
1417
  }
@@ -1428,7 +1428,7 @@ function nl(e) {
1428
1428
  $ !== null && (!gt || ($.f & 2) !== 0) && (qe ?? (qe = /* @__PURE__ */ new Set())).add(e);
1429
1429
  }
1430
1430
  var _e = null, Se = 0, Me = null;
1431
- function Uu(e) {
1431
+ function ju(e) {
1432
1432
  Me = e;
1433
1433
  }
1434
1434
  var il = 1, Bt = 0, Kt = Bt;
@@ -1469,32 +1469,32 @@ function al(e) {
1469
1469
  e.f |= Eo;
1470
1470
  var h = e.deps, g = P?.is_fork;
1471
1471
  if (_e !== null) {
1472
- var b;
1472
+ var v;
1473
1473
  if (g || ln(e, Se), h !== null && Se > 0)
1474
- for (h.length = Se + _e.length, b = 0; b < _e.length; b++) h[Se + b] = _e[b];
1474
+ for (h.length = Se + _e.length, v = 0; v < _e.length; v++) h[Se + v] = _e[v];
1475
1475
  else e.deps = h = _e;
1476
- if ($o() && (e.f & 512) !== 0) for (b = Se; b < h.length; b++) {
1476
+ if ($o() && (e.f & 512) !== 0) for (v = Se; v < h.length; v++) {
1477
1477
  var _;
1478
- ((_ = h[b]).reactions ?? (_.reactions = [])).push(e);
1478
+ ((_ = h[v]).reactions ?? (_.reactions = [])).push(e);
1479
1479
  }
1480
1480
  } else !g && h !== null && Se < h.length && (ln(e, Se), h.length = Se);
1481
- if (fn() && Me !== null && !Ue && h !== null && (e.f & 6146) === 0) for (b = 0; b < Me.length; b++) sl(Me[b], e);
1481
+ if (fn() && Me !== null && !Ue && h !== null && (e.f & 6146) === 0) for (v = 0; v < Me.length; v++) sl(Me[v], e);
1482
1482
  if (i !== null && i !== e) {
1483
- if (Bt++, i.deps !== null) for (let v = 0; v < r; v += 1) i.deps[v].rv = Bt;
1484
- if (t !== null) for (const v of t) v.rv = Bt;
1483
+ if (Bt++, i.deps !== null) for (let b = 0; b < r; b += 1) i.deps[b].rv = Bt;
1484
+ if (t !== null) for (const b of t) b.rv = Bt;
1485
1485
  Me !== null && (n === null ? n = Me : n.push(...Me));
1486
1486
  }
1487
1487
  return (e.f & 8388608) !== 0 && (e.f ^= Bn), f;
1488
- } catch (v) {
1489
- return Aa(v);
1488
+ } catch (b) {
1489
+ return Aa(b);
1490
1490
  } finally {
1491
1491
  e.f ^= ps, _e = t, Se = r, Me = n, $ = i, qe = o, Mr(s), Ue = a, Kt = l;
1492
1492
  }
1493
1493
  }
1494
- function ju(e, t) {
1494
+ function qu(e, t) {
1495
1495
  let r = t.reactions;
1496
1496
  if (r !== null) {
1497
- var n = Lc.call(r, e);
1497
+ var n = Pc.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());
@@ -1502,13 +1502,13 @@ function ju(e, t) {
1502
1502
  }
1503
1503
  if (r === null && (t.f & 2) !== 0 && (_e === null || !zn.call(_e, t))) {
1504
1504
  var o = t;
1505
- (o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~cn), o.v !== re && xo(o), Cu(o), ln(o, 0);
1505
+ (o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~cn), o.v !== re && xo(o), Mu(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++) ju(e, r[n]);
1511
+ for (var n = t; n < r.length; n++) qu(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 ? Wu(e) : zo(e), Za(e);
1521
+ (t & 16777232) !== 0 ? Fu(e) : zo(e), Za(e);
1522
1522
  var s = al(e);
1523
1523
  if (e.teardown = typeof s == "function" ? s : null, e.wv = il, 0)
1524
1524
  for (var a of e.deps) ;
@@ -1529,7 +1529,7 @@ function Rr(e) {
1529
1529
  }
1530
1530
  function S(e) {
1531
1531
  var t = (e.f & 2) !== 0;
1532
- if (Bu?.add(e), $ !== null && !Ue && !(O !== null && (O.f & 16384) !== 0) && (qe === null || !qe.has(e))) {
1532
+ if (Uu?.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
1535
  e.rv < Bt && (e.rv = Bt, _e === null && r !== null && r[Se] === e ? Se++ : _e === null ? _e = [e] : _e.push(e));
@@ -1586,7 +1586,7 @@ var Ar = /* @__PURE__ */ Symbol("events"), ul = /* @__PURE__ */ new Set(), Zi =
1586
1586
  function Ti(e, t, r) {
1587
1587
  (t[Ar] ?? (t[Ar] = {}))[e] = r;
1588
1588
  }
1589
- function qu(e) {
1589
+ function Vu(e) {
1590
1590
  for (var t = 0; t < e.length; t++) ul.add(e[t]);
1591
1591
  for (var r of Zi) r(e);
1592
1592
  }
@@ -1617,8 +1617,8 @@ function Es(e) {
1617
1617
  try {
1618
1618
  for (var h, g = []; o !== null && o !== t; ) {
1619
1619
  try {
1620
- var b = o[Ar]?.[n];
1621
- b != null && (!o.disabled || e.target === o) && b.call(o, e);
1620
+ var v = o[Ar]?.[n];
1621
+ v != null && (!o.disabled || e.target === o) && v.call(o, e);
1622
1622
  } catch (_) {
1623
1623
  h ? g.push(_) : h = _;
1624
1624
  }
@@ -1636,13 +1636,13 @@ function Es(e) {
1636
1636
  }
1637
1637
  }
1638
1638
  }
1639
- var Vu = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
1640
- function Gu(e) {
1641
- return Vu?.createHTML(e) ?? e;
1639
+ var Gu = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
1640
+ function Yu(e) {
1641
+ return Gu?.createHTML(e) ?? e;
1642
1642
  }
1643
1643
  function fl(e) {
1644
1644
  var t = Po("template");
1645
- return t.innerHTML = Gu(e.replaceAll("<!>", "<!---->")), t.content;
1645
+ return t.innerHTML = Yu(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 Yu(e, t, r = "svg") {
1672
+ function Ku(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 (H)
@@ -1689,10 +1689,10 @@ function Yu(e, t, r = "svg") {
1689
1689
  };
1690
1690
  }
1691
1691
  // @__NO_SIDE_EFFECTS__
1692
- function Ku(e, t) {
1693
- return /* @__PURE__ */ Yu(e, t, "svg");
1692
+ function Xu(e, t) {
1693
+ return /* @__PURE__ */ Ku(e, t, "svg");
1694
1694
  }
1695
- function Xu() {
1695
+ function Ju() {
1696
1696
  if (H)
1697
1697
  return pt(D, null), D;
1698
1698
  var e = document.createDocumentFragment(), t = document.createComment(""), r = Le();
@@ -1706,7 +1706,7 @@ function Sr(e, t) {
1706
1706
  }
1707
1707
  e !== null && e.before(t);
1708
1708
  }
1709
- var Ju = [
1709
+ var Qu = [
1710
1710
  "allowfullscreen",
1711
1711
  "async",
1712
1712
  "autofocus",
@@ -1735,8 +1735,8 @@ var Ju = [
1735
1735
  "defer",
1736
1736
  "disablepictureinpicture",
1737
1737
  "disableremoteplayback"
1738
- ], Dg = [
1739
- ...Ju,
1738
+ ], Fg = [
1739
+ ...Qu,
1740
1740
  "formNoValidate",
1741
1741
  "isMap",
1742
1742
  "noModule",
@@ -1751,17 +1751,17 @@ var Ju = [
1751
1751
  "allowFullscreen",
1752
1752
  "disablePictureInPicture",
1753
1753
  "disableRemotePlayback"
1754
- ], Qu = ["touchstart", "touchmove"];
1755
- function Zu(e) {
1756
- return Qu.includes(e);
1754
+ ], Zu = ["touchstart", "touchmove"];
1755
+ function ef(e) {
1756
+ return Zu.includes(e);
1757
1757
  }
1758
- var ef = [
1758
+ var tf = [
1759
1759
  "$state",
1760
1760
  "$state.raw",
1761
1761
  "$derived",
1762
1762
  "$derived.by"
1763
- ], Hg = [
1764
- ...ef,
1763
+ ], Bg = [
1764
+ ...tf,
1765
1765
  "$state.eager",
1766
1766
  "$state.snapshot",
1767
1767
  "$props",
@@ -1784,7 +1784,7 @@ function An(e, t) {
1784
1784
  function dl(e, t) {
1785
1785
  return hl(e, t);
1786
1786
  }
1787
- function tf(e, t) {
1787
+ function rf(e, t) {
1788
1788
  Qi(), t.intro = t.intro ?? !1;
1789
1789
  const r = t.target, n = H, i = D;
1790
1790
  try {
@@ -1799,7 +1799,7 @@ function tf(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 && Qc(), Qi(), Ya(r), dt(!1), dl(e, t);
1802
+ return s !== Cr && console.warn("Failed to hydrate: ", s), t.recover === !1 && Zc(), Qi(), Ya(r), dt(!1), dl(e, t);
1803
1803
  } finally {
1804
1804
  dt(n), Te(i);
1805
1805
  }
@@ -1807,35 +1807,35 @@ function tf(e, t) {
1807
1807
  var xn = /* @__PURE__ */ new Map();
1808
1808
  function hl(e, { target: t, anchor: r, props: n = {}, events: i, context: o, intro: s = !0, transformError: a }) {
1809
1809
  Qi();
1810
- var l = void 0, c = Hu(() => {
1810
+ var l = void 0, c = zu(() => {
1811
1811
  var u = r ?? t.appendChild(Le());
1812
- yu(u, { pending: () => {
1812
+ _u(u, { pending: () => {
1813
1813
  } }, (g) => {
1814
1814
  Sa({});
1815
- var b = q;
1816
- if (o && (b.c = o), i && (n.$$events = i), H && pt(g, null), As = s, l = e(g, n) || {}, As = !0, H && (O.nodes.end = D, D === null || D.nodeType !== 8 || D.data !== "]"))
1815
+ var v = q;
1816
+ if (o && (v.c = o), i && (n.$$events = i), H && pt(g, null), As = s, l = e(g, n) || {}, As = !0, H && (O.nodes.end = D, D === null || D.nodeType !== 8 || D.data !== "]"))
1817
1817
  throw oi(), Cr;
1818
1818
  ka();
1819
1819
  }, a);
1820
1820
  var f = /* @__PURE__ */ new Set(), h = (g) => {
1821
- for (var b = 0; b < g.length; b++) {
1822
- var _ = g[b];
1821
+ for (var v = 0; v < g.length; v++) {
1822
+ var _ = g[v];
1823
1823
  if (!f.has(_)) {
1824
1824
  f.add(_);
1825
- var v = Zu(_);
1825
+ var b = ef(_);
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));
1829
1829
  var I = T.get(_);
1830
- I === void 0 ? (N.addEventListener(_, Es, { passive: v }), T.set(_, 1)) : T.set(_, I + 1);
1830
+ I === void 0 ? (N.addEventListener(_, Es, { passive: b }), T.set(_, 1)) : T.set(_, I + 1);
1831
1831
  }
1832
1832
  }
1833
1833
  }
1834
1834
  };
1835
1835
  return h(ni(ul)), Zi.add(h), () => {
1836
- for (var g of f) for (const v of [t, document]) {
1837
- var b = xn.get(v), _ = b.get(g);
1838
- --_ == 0 ? (v.removeEventListener(g, Es), b.delete(g), b.size === 0 && xn.delete(v)) : b.set(g, _);
1836
+ for (var g of f) for (const b of [t, document]) {
1837
+ var v = xn.get(b), _ = v.get(g);
1838
+ --_ == 0 ? (b.removeEventListener(g, Es), v.delete(g), v.size === 0 && xn.delete(b)) : v.set(g, _);
1839
1839
  }
1840
1840
  Zi.delete(h), u !== r && u.parentNode?.removeChild(u);
1841
1841
  };
@@ -1843,11 +1843,11 @@ function hl(e, { target: t, anchor: r, props: n = {}, events: i, context: o, int
1843
1843
  return eo.set(l, c), l;
1844
1844
  }
1845
1845
  var eo = /* @__PURE__ */ new WeakMap();
1846
- function rf(e, t) {
1846
+ function nf(e, t) {
1847
1847
  const r = eo.get(e);
1848
1848
  return r ? (eo.delete(e), r(t)) : Promise.resolve();
1849
1849
  }
1850
- var ut = /* @__PURE__ */ new WeakMap(), xt = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap(), Wr = /* @__PURE__ */ new WeakMap(), wi = /* @__PURE__ */ new WeakMap(), Si = /* @__PURE__ */ new WeakMap(), xs = /* @__PURE__ */ new WeakMap(), nf = class {
1850
+ var ut = /* @__PURE__ */ new WeakMap(), xt = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap(), Wr = /* @__PURE__ */ new WeakMap(), wi = /* @__PURE__ */ new WeakMap(), Si = /* @__PURE__ */ new WeakMap(), xs = /* @__PURE__ */ new WeakMap(), of = class {
1851
1851
  constructor(e, t = !0) {
1852
1852
  m(this, "anchor", void 0), M(this, ut, /* @__PURE__ */ new Map()), M(this, xt, /* @__PURE__ */ new Map()), M(this, We, /* @__PURE__ */ new Map()), M(this, Wr, /* @__PURE__ */ new Set()), M(this, wi, !0), M(this, Si, (r) => {
1853
1853
  if (p(ut, this).has(r)) {
@@ -1901,13 +1901,13 @@ var ut = /* @__PURE__ */ new WeakMap(), xt = /* @__PURE__ */ new WeakMap(), We =
1901
1901
  H && (this.anchor = D), p(Si, this).call(this, r);
1902
1902
  }
1903
1903
  };
1904
- function of(e) {
1905
- q === null && qc("onMount"), un && q.l !== null ? sf(q).m.push(e) : wr(() => {
1904
+ function sf(e) {
1905
+ q === null && Vc("onMount"), un && q.l !== null ? af(q).m.push(e) : wr(() => {
1906
1906
  const t = ai(e);
1907
1907
  if (typeof t == "function") return t;
1908
1908
  });
1909
1909
  }
1910
- function sf(e) {
1910
+ function af(e) {
1911
1911
  var t = e.l;
1912
1912
  return t.u ?? (t.u = {
1913
1913
  a: [],
@@ -1918,7 +1918,7 @@ function sf(e) {
1918
1918
  function ki(e, t, r = !1) {
1919
1919
  var n;
1920
1920
  H && (n = D, si());
1921
- var i = new nf(e), o = r ? Ao : 0;
1921
+ var i = new of(e), o = r ? Ao : 0;
1922
1922
  function s(a, l) {
1923
1923
  if (H) {
1924
1924
  var c = _a(n);
@@ -1937,7 +1937,7 @@ function ki(e, t, r = !1) {
1937
1937
  }), a || s(-1, null);
1938
1938
  }, o);
1939
1939
  }
1940
- function af(e, t, r) {
1940
+ function lf(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, () => {
@@ -1974,7 +1974,7 @@ function to(e, t, r = !0) {
1974
1974
  }
1975
1975
  }
1976
1976
  var Cn;
1977
- function lf(e, t, r, n, i, o = null) {
1977
+ function cf(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;
@@ -1985,15 +1985,15 @@ function lf(e, t, r, n, i, o = null) {
1985
1985
  var T = r();
1986
1986
  return ga(T) ? T : T == null ? [] : ni(T);
1987
1987
  }), f, h = /* @__PURE__ */ new Map(), g = !0;
1988
- function b(T) {
1989
- (v.effect.f & 16384) === 0 && (v.pending.delete(T), v.fallback = c, cf(v, f, s, t, n), c !== null && (f.length === 0 ? (c.f & 33554432) === 0 ? Qn(c) : (c.f ^= tn, Qr(c, null, s)) : or(c, () => {
1988
+ function v(T) {
1989
+ (b.effect.f & 16384) === 0 && (b.pending.delete(T), b.fallback = c, uf(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
  }
1993
1993
  function _(T) {
1994
- v.pending.delete(T);
1994
+ b.pending.delete(T);
1995
1995
  }
1996
- var v = {
1996
+ var b = {
1997
1997
  effect: Ho(() => {
1998
1998
  f = S(u);
1999
1999
  var T = f.length;
@@ -2005,13 +2005,13 @@ function lf(e, t, r, n, i, o = null) {
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 = uf(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 && w.unskip_effect(J.e)) : (J = ff(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 && Gc("", "", ""), H && T > 0 && Te(Un()), !g)
2010
+ if (T === 0 && o && !c && (g ? c = Ne(() => o(s)) : (c = Ne(() => o(Cn ?? (Cn = Le()))), c.f |= tn)), T > N.size && Yc("", "", ""), H && T > 0 && Te(Un()), !g)
2011
2011
  if (h.set(w, N), F) {
2012
2012
  for (const [Q, St] of a) N.has(Q) || w.skip_effect(St.e);
2013
- w.oncommit(b), w.ondiscard(_);
2014
- } else b(w);
2013
+ w.oncommit(v), w.ondiscard(_);
2014
+ } else v(w);
2015
2015
  I && dt(!0), S(u);
2016
2016
  }),
2017
2017
  flags: t,
@@ -2026,22 +2026,22 @@ function Fr(e) {
2026
2026
  for (; e !== null && (e.f & 32) === 0; ) e = e.next;
2027
2027
  return e;
2028
2028
  }
2029
- function cf(e, t, r, n, i) {
2030
- var o = (n & 8) !== 0, s = t.length, a = e.items, l = Fr(e.effect.first), c, u = null, f, h = [], g = [], b, _, v, T;
2029
+ function uf(e, t, r, n, i) {
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
- b = t[T], _ = i(b, T), v = a.get(_).e, (v.f & 33554432) === 0 && (v.nodes?.a?.measure(), (f ?? (f = /* @__PURE__ */ new Set())).add(v));
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));
2033
2033
  for (T = 0; T < s; T += 1) {
2034
- if (b = t[T], _ = i(b, T), v = a.get(_).e, e.outrogroups !== null) for (const J of e.outrogroups)
2035
- J.pending.delete(v), J.done.delete(v);
2036
- if ((v.f & 8192) !== 0 && (Qn(v), o && (v.nodes?.a?.unfix(), (f ?? (f = /* @__PURE__ */ new Set())).delete(v))), (v.f & 33554432) !== 0)
2037
- if (v.f ^= tn, v === l) Qr(v, null, r);
2034
+ if (v = t[T], _ = i(v, T), b = a.get(_).e, e.outrogroups !== null) for (const J of e.outrogroups)
2035
+ J.pending.delete(b), J.done.delete(b);
2036
+ if ((b.f & 8192) !== 0 && (Qn(b), o && (b.nodes?.a?.unfix(), (f ?? (f = /* @__PURE__ */ new Set())).delete(b))), (b.f & 33554432) !== 0)
2037
+ if (b.f ^= tn, b === l) Qr(b, null, r);
2038
2038
  else {
2039
2039
  var I = u ? u.next : l;
2040
- v === e.effect.last && (e.effect.last = v.prev), v.prev && (v.prev.next = v.next), v.next && (v.next.prev = v.prev), Ct(e, u, v), Ct(e, v, I), Qr(v, I, r), u = v, h = [], g = [], l = Fr(u.next);
2040
+ b === e.effect.last && (e.effect.last = b.prev), b.prev && (b.prev.next = b.next), b.next && (b.next.prev = b.prev), Ct(e, u, b), Ct(e, b, I), Qr(b, I, r), u = b, h = [], g = [], l = Fr(u.next);
2041
2041
  continue;
2042
2042
  }
2043
- if (v !== l) {
2044
- if (c !== void 0 && c.has(v)) {
2043
+ if (b !== l) {
2044
+ if (c !== void 0 && c.has(b)) {
2045
2045
  if (h.length < g.length) {
2046
2046
  var N = g[0], w;
2047
2047
  u = N.prev;
@@ -2050,14 +2050,14 @@ function cf(e, t, r, n, i) {
2050
2050
  for (w = 0; w < g.length; w += 1) c.delete(g[w]);
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
- c.delete(v), Qr(v, l, r), Ct(e, v.prev, v.next), Ct(e, v, u === null ? e.effect.first : u.next), Ct(e, u, v), u = v;
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;
2054
2054
  continue;
2055
2055
  }
2056
- for (h = [], g = []; l !== null && l !== v; )
2056
+ for (h = [], g = []; l !== null && l !== b; )
2057
2057
  (c ?? (c = /* @__PURE__ */ new Set())).add(l), g.push(l), l = Fr(l.next);
2058
2058
  if (l === null) continue;
2059
2059
  }
2060
- (v.f & 33554432) === 0 && h.push(v), u = v, l = Fr(v.next);
2060
+ (b.f & 33554432) === 0 && h.push(b), u = b, l = Fr(b.next);
2061
2061
  }
2062
2062
  if (e.outrogroups !== null) {
2063
2063
  for (const J of e.outrogroups) J.pending.size === 0 && (to(e, ni(J.done)), e.outrogroups?.delete(J));
@@ -2066,7 +2066,7 @@ function cf(e, t, r, n, i) {
2066
2066
  if (l !== null || c !== void 0) {
2067
2067
  var se = [];
2068
2068
  if (c !== void 0)
2069
- for (v of c) (v.f & 8192) === 0 && se.push(v);
2069
+ for (b of c) (b.f & 8192) === 0 && se.push(b);
2070
2070
  for (; l !== null; )
2071
2071
  (l.f & 8192) === 0 && l !== e.fallback && se.push(l), l = Fr(l.next);
2072
2072
  var ee = se.length;
@@ -2076,15 +2076,15 @@ function cf(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
- af(e, se, it);
2079
+ lf(e, se, it);
2080
2080
  }
2081
2081
  }
2082
2082
  o && Qt(() => {
2083
2083
  if (f !== void 0)
2084
- for (v of f) v.nodes?.a?.apply();
2084
+ for (b of f) b.nodes?.a?.apply();
2085
2085
  });
2086
2086
  }
2087
- function uf(e, t, r, n, i, o, s, a) {
2087
+ function ff(e, t, r, n, i, o, s, a) {
2088
2088
  var l = (s & 1) !== 0 ? (s & 16) === 0 ? /* @__PURE__ */ Ua(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 ff(e, t) {
2108
+ function df(e, t) {
2109
2109
  Qa(() => {
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 ff(e, t) {
2116
2116
  }
2117
2117
  var Cs = [...`
2118
2118
  \r\f \v\uFEFF`];
2119
- function df(e, t, r) {
2119
+ function hf(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 hf(e, t) {
2142
+ function pf(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) {
@@ -2157,8 +2157,8 @@ function hf(e, t) {
2157
2157
  var g = Ei(e.substring(c, u).trim());
2158
2158
  if (!l.includes(g)) {
2159
2159
  h !== ";" && f++;
2160
- var b = e.substring(c, f).trim();
2161
- r += " " + b + ";";
2160
+ var v = e.substring(c, f).trim();
2161
+ r += " " + v + ";";
2162
2162
  }
2163
2163
  }
2164
2164
  c = f + 1, u = -1;
@@ -2170,10 +2170,10 @@ function hf(e, t) {
2170
2170
  }
2171
2171
  return e == null ? null : String(e);
2172
2172
  }
2173
- function pf(e, t, r, n, i, o) {
2173
+ function gf(e, t, r, n, i, o) {
2174
2174
  var s = e[Ui];
2175
2175
  if (H || s !== r || s === void 0) {
2176
- var a = df(r, n, o);
2176
+ var a = hf(r, n, o);
2177
2177
  (!H || a !== e.getAttribute("class")) && (a == null ? e.removeAttribute("class") : t ? e.className = a : e.setAttribute("class", a)), e[Ui] = r;
2178
2178
  } else if (o && i !== o) for (var l in o) {
2179
2179
  var c = !!o[l];
@@ -2190,34 +2190,34 @@ function Ai(e, t = {}, r, n) {
2190
2190
  function mr(e, t, r, n) {
2191
2191
  var i = e[ji];
2192
2192
  if (H || i !== t) {
2193
- var o = hf(t, n);
2193
+ var o = pf(t, n);
2194
2194
  (!H || o !== e.getAttribute("style")) && (o == null ? e.removeAttribute("style") : e.style.cssText = o), e[ji] = 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 gf = /* @__PURE__ */ Symbol("is custom element"), mf = /* @__PURE__ */ Symbol("is html"), vf = jc ? "link" : "LINK";
2198
+ var mf = /* @__PURE__ */ Symbol("is custom element"), vf = /* @__PURE__ */ Symbol("is html"), bf = qc ? "link" : "LINK";
2199
2199
  function xi(e, t, r, n) {
2200
- var i = bf(e);
2201
- if (H && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === vf)) {
2200
+ var i = yf(e);
2201
+ if (H && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === bf)) {
2202
2202
  n || void 0;
2203
2203
  return;
2204
2204
  }
2205
- i[t] !== (i[t] = r) && (t === "loading" && (e[Bc] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && yf(e).includes(t) ? e[t] = r : e.setAttribute(t, r));
2205
+ i[t] !== (i[t] = r) && (t === "loading" && (e[Uc] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && _f(e).includes(t) ? e[t] = r : e.setAttribute(t, r));
2206
2206
  }
2207
- function bf(e) {
2207
+ function yf(e) {
2208
2208
  var t;
2209
2209
  return (t = e)[Bi] ?? (t[Bi] = {
2210
- [gf]: e.nodeName.includes("-"),
2211
- [mf]: e.namespaceURI === "http://www.w3.org/1999/xhtml"
2210
+ [mf]: e.nodeName.includes("-"),
2211
+ [vf]: e.namespaceURI === "http://www.w3.org/1999/xhtml"
2212
2212
  });
2213
2213
  }
2214
2214
  var Os = /* @__PURE__ */ new Map();
2215
- function yf(e) {
2215
+ function _f(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 = []);
2219
2219
  for (var n, i = e, o = Element.prototype; o !== i; ) {
2220
- n = Pc(i);
2220
+ n = Nc(i);
2221
2221
  for (var s in n) n[s].set && s !== "innerHTML" && s !== "textContent" && s !== "innerText" && r.push(s);
2222
2222
  i = ma(i);
2223
2223
  }
@@ -2229,14 +2229,14 @@ var pl, 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, _f).call(this).observe(e, p(Ci, this)), () => {
2232
+ return r.add(t), p(kr, this).set(e, r), L(Is, this, Tf).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
  pl = gl;
2239
- function _f() {
2239
+ function Tf() {
2240
2240
  return p(Zn, this) ?? C(Zn, this, new ResizeObserver((e) => {
2241
2241
  for (var t of e) {
2242
2242
  pl.entries.set(t.target, t);
@@ -2248,7 +2248,7 @@ m(gl, "entries", /* @__PURE__ */ new WeakMap());
2248
2248
  function Mi(e, t) {
2249
2249
  return e === t || e?.[rn] === t;
2250
2250
  }
2251
- function Tf(e = {}, t, r, n) {
2251
+ function wf(e = {}, t, r, n) {
2252
2252
  var i = q.r, o = O;
2253
2253
  return Qa(() => {
2254
2254
  var s, a;
@@ -2275,8 +2275,8 @@ function Mn(e, t, r, n) {
2275
2275
  var h = rn in e || ba in e;
2276
2276
  f = jt(e, t)?.set ?? (h && t in e ? (w) => e[t] = w : void 0);
2277
2277
  }
2278
- var g, b = !1;
2279
- o ? [g, b] = fu(() => e[t]) : g = e[t], g === void 0 && n !== void 0 && (g = u(), f && (i && Zc(t), f(g)));
2278
+ var g, v = !1;
2279
+ o ? [g, v] = du(() => e[t]) : g = e[t], g === void 0 && n !== void 0 && (g = u(), f && (i && eu(t), f(g)));
2280
2280
  var _;
2281
2281
  if (i ? _ = () => {
2282
2282
  var w = e[t];
@@ -2286,9 +2286,9 @@ function Mn(e, t, r, n) {
2286
2286
  return w !== void 0 && (a = void 0), w === void 0 ? a : w;
2287
2287
  }, i && (r & 4) === 0) return _;
2288
2288
  if (f) {
2289
- var v = e.$$legacy;
2289
+ var b = e.$$legacy;
2290
2290
  return (function(w, F) {
2291
- return arguments.length > 0 ? ((!i || !F || v || b) && f(F ? _() : w), w) : _();
2291
+ return arguments.length > 0 ? ((!i || !F || b || v) && f(F ? _() : w), w) : _();
2292
2292
  });
2293
2293
  }
2294
2294
  var T = !1, I = ((r & 1) !== 0 ? an : Ro)(() => (T = !1, _()));
@@ -2302,10 +2302,10 @@ function Mn(e, t, r, n) {
2302
2302
  return mt && T || (N.f & 16384) !== 0 ? I.v : S(I);
2303
2303
  });
2304
2304
  }
2305
- function wf(e) {
2306
- return new Sf(e);
2305
+ function Sf(e) {
2306
+ return new kf(e);
2307
2307
  }
2308
- var Ht = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), Sf = class {
2308
+ var Ht = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), kf = class {
2309
2309
  constructor(e) {
2310
2310
  M(this, Ht, void 0), M(this, Ke, void 0);
2311
2311
  var t = /* @__PURE__ */ new Map(), r = (i, o) => {
@@ -2326,7 +2326,7 @@ var Ht = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), Sf =
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 ? tf : dl)(e.component, {
2329
+ C(Ke, this, (e.hydrate ? rf : dl)(e.component, {
2330
2330
  target: e.target,
2331
2331
  anchor: e.anchor,
2332
2332
  props: n,
@@ -2348,7 +2348,7 @@ var Ht = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), Sf =
2348
2348
  p(Ke, this).$set = (i) => {
2349
2349
  Object.assign(n, i);
2350
2350
  }, p(Ke, this).$destroy = () => {
2351
- rf(p(Ke, this));
2351
+ nf(p(Ke, this));
2352
2352
  };
2353
2353
  }
2354
2354
  $set(e) {
@@ -2391,14 +2391,14 @@ typeof HTMLElement == "function" && (ml = class extends HTMLElement {
2391
2391
  };
2392
2392
  };
2393
2393
  if (await Promise.resolve(), !this.$$cn || this.$$c) return;
2394
- const t = {}, r = kf(this);
2394
+ const t = {}, r = Ef(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 = wf({
2401
+ this.$$c = Sf({
2402
2402
  component: this.$$ctor,
2403
2403
  target: this.$$shadowRoot || this,
2404
2404
  props: {
@@ -2406,7 +2406,7 @@ typeof HTMLElement == "function" && (ml = class extends HTMLElement {
2406
2406
  $$slots: t,
2407
2407
  $$host: this
2408
2408
  }
2409
- }), this.$$me = Du(() => {
2409
+ }), this.$$me = Hu(() => {
2410
2410
  Do(() => {
2411
2411
  this.$$r = !0;
2412
2412
  for (const n of Wn(this.$$c)) {
@@ -2463,13 +2463,13 @@ function Pn(e, t, r, n) {
2463
2463
  return t;
2464
2464
  }
2465
2465
  }
2466
- function kf(e) {
2466
+ function Ef(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 Ef(e, t, r, n, i, o) {
2472
+ function Af(e, t, r, n, i, o) {
2473
2473
  let s = class extends ml {
2474
2474
  constructor() {
2475
2475
  super(e, r, i), this.$$p_d = t;
@@ -2495,14 +2495,14 @@ function Ef(e, t, r, n, i, o) {
2495
2495
  } });
2496
2496
  }), o && (s = o(s)), e.element = s, s;
2497
2497
  }
2498
- var Af = class extends Event {
2498
+ var xf = 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
- }, xf = class {
2505
+ }, Cf = 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 Af = class extends Event {
2518
2518
  return this.currentValue;
2519
2519
  }
2520
2520
  requestValue() {
2521
- this.host.dispatchEvent(new Af(this.context, this.host, this.handleValue, this.subscribe));
2521
+ this.host.dispatchEvent(new xf(this.context, this.host, this.handleValue, this.subscribe));
2522
2522
  }
2523
- }, li = (e) => e, Cf = li(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), zg = li(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), Wg = li(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), Fg = li(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
2524
- function Mf(e, t, r) {
2523
+ }, li = (e) => e, Mf = li(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), Ug = 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 Of(e, t, r) {
2525
2525
  let n = !1;
2526
- const i = new xf(e, {
2526
+ const i = new Cf(e, {
2527
2527
  context: t,
2528
2528
  subscribe: !0,
2529
2529
  onValue: (c) => {
@@ -2547,13 +2547,13 @@ function Mf(e, t, r) {
2547
2547
  globalThis.clearInterval(l), e.removeEventListener("context-provider", o), i.disconnect();
2548
2548
  };
2549
2549
  }
2550
- function Of(e, t) {
2551
- return Mf(e, Cf, t);
2552
- }
2553
2550
  function If(e, t) {
2554
- return Of(e, t);
2551
+ return Of(e, Mf, t);
2555
2552
  }
2556
- var Rf = class {
2553
+ function Rf(e, t) {
2554
+ return If(e, t);
2555
+ }
2556
+ var Lf = 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 vl = class ro {
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 Rf(), 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 Lf(), 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
  }
@@ -2745,7 +2745,7 @@ var vl = class ro {
2745
2745
  }
2746
2746
  it > h && (h = it, f = F);
2747
2747
  }
2748
- const g = Math.max(0.24, Math.min(0.85, f * 0.55)), b = Math.max(0.55, Math.min(0.95, f + 0.2)), _ = Math.max(0.22, Math.min(0.6, f * 0.45)), v = l, T = this.blend(v, a, b), I = this.contrastRatio(T, a), N = this.relativeLuminance(a) > 0.45 ? [
2748
+ const g = Math.max(0.24, Math.min(0.85, f * 0.55)), v = Math.max(0.55, Math.min(0.95, f + 0.2)), _ = Math.max(0.22, Math.min(0.6, f * 0.45)), b = l, T = this.blend(b, a, v), I = this.contrastRatio(T, a), N = this.relativeLuminance(a) > 0.45 ? [
2749
2749
  0,
2750
2750
  0,
2751
2751
  0
@@ -2753,11 +2753,11 @@ var vl = class ro {
2753
2753
  255,
2754
2754
  255,
2755
2755
  255
2756
- ], w = I >= 1.35 ? v : N;
2756
+ ], w = 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]}, ${b})`,
2760
+ wordUnderline: `rgba(${w[0]}, ${w[1]}, ${w[2]}, ${v})`,
2761
2761
  wordShadow: `rgba(${w[0]}, ${w[1]}, ${w[2]}, ${_})`
2762
2762
  };
2763
2763
  }
@@ -3038,7 +3038,7 @@ function bl(e) {
3038
3038
  console.debug(`[${e}]`, ...t);
3039
3039
  };
3040
3040
  }
3041
- var Bg = bl("I18nService"), Oi = {
3041
+ var Vg = bl("I18nService"), Oi = {
3042
3042
  assessment: [],
3043
3043
  section: [],
3044
3044
  item: [],
@@ -3059,19 +3059,19 @@ function Mt(e, t) {
3059
3059
  if (e.find((r) => typeof r != "string") !== void 0) throw new Error(`Invalid tools config at "${t}": all entries must be strings.`);
3060
3060
  return e;
3061
3061
  }
3062
- function Lf(e) {
3062
+ function Pf(e) {
3063
3063
  if (e != null) {
3064
3064
  if (!Xt(e)) throw new Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');
3065
3065
  return e;
3066
3066
  }
3067
3067
  }
3068
- function Pf(e) {
3068
+ function Nf(e) {
3069
3069
  if (e != null) {
3070
3070
  if (!Xt(e)) throw new Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');
3071
3071
  return e;
3072
3072
  }
3073
3073
  }
3074
- function Nf(e, t) {
3074
+ function $f(e, t) {
3075
3075
  if (t == null) return;
3076
3076
  if (!Xt(t)) throw new Error(`Invalid tools config at "providers.${e}": expected an object.`);
3077
3077
  const r = t, n = (i) => i === "polly" || i === "google" || i === "custom";
@@ -3080,11 +3080,11 @@ function Nf(e, t) {
3080
3080
  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
3081
  return r;
3082
3082
  }
3083
- function $f(e) {
3083
+ function Df(e) {
3084
3084
  if (e == null) return {};
3085
3085
  if (!Xt(e)) throw new Error('Invalid tools config at "providers": expected an object keyed by tool id.');
3086
3086
  const t = {};
3087
- for (const [r, n] of Object.entries(e)) t[r] = Nf(r, n);
3087
+ for (const [r, n] of Object.entries(e)) t[r] = $f(r, n);
3088
3088
  return t;
3089
3089
  }
3090
3090
  function yl(e) {
@@ -3101,15 +3101,15 @@ function Ot(e) {
3101
3101
  }
3102
3102
  return Array.from(t);
3103
3103
  }
3104
- function Df(e, t) {
3104
+ function Hf(e, t) {
3105
3105
  if (e != null) {
3106
3106
  if (e === "on" || e === "off") return e;
3107
3107
  throw new Error(`Invalid tools config at "${t}": expected "on" or "off", got ${JSON.stringify(e)}.`);
3108
3108
  }
3109
3109
  }
3110
- function Hf(e) {
3110
+ function zf(e) {
3111
3111
  if (e != null && !Xt(e)) throw new Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');
3112
- const t = Pf(e?.policy), r = Lf(e?.placement), n = $f(e?.providers), i = Df(e?.pnpEnforcement, "pnpEnforcement"), o = {
3112
+ const t = Nf(e?.policy), r = Pf(e?.placement), n = Df(e?.providers), i = Hf(e?.pnpEnforcement, "pnpEnforcement"), o = {
3113
3113
  policy: {
3114
3114
  allowed: Ot(Mt(t?.allowed, "policy.allowed")),
3115
3115
  blocked: Ot(Mt(t?.blocked, "policy.blocked"))
@@ -3123,7 +3123,7 @@ function Hf(e) {
3123
3123
  };
3124
3124
  return i && (o.pnpEnforcement = i), o;
3125
3125
  }
3126
- var zf = [
3126
+ var Wf = [
3127
3127
  "assessment",
3128
3128
  "section",
3129
3129
  "item",
@@ -3134,7 +3134,7 @@ var zf = [
3134
3134
  function Nn(e, t) {
3135
3135
  if (typeof e != "string" || e.trim().length === 0) throw new Error(`Invalid tool registration: "${t}" must be a non-empty string.`);
3136
3136
  }
3137
- var Wf = [
3137
+ var Ff = [
3138
3138
  {
3139
3139
  pattern: /<script\b/i,
3140
3140
  reason: "contains a <script> tag"
@@ -3152,17 +3152,17 @@ var Wf = [
3152
3152
  reason: "contains a <foreignObject> element"
3153
3153
  }
3154
3154
  ];
3155
- function Ff(e, t, r) {
3155
+ function Bf(e, t, r) {
3156
3156
  const n = t.trimStart(), i = n.toLowerCase().startsWith("<svg"), o = /^https?:/i.test(n);
3157
3157
  if (/^data:/i.test(n)) throw new Error(`Invalid tool registration "${e}": "${r}" may not be a data: URL.`);
3158
3158
  if (!(!i && !o)) {
3159
- for (const { pattern: s, reason: a } of Wf) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${r}" ${a}. Inline SVG icons must not include scriptable content.`);
3159
+ for (const { pattern: s, reason: a } of Ff) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${r}" ${a}. Inline SVG icons must not include scriptable content.`);
3160
3160
  }
3161
3161
  }
3162
3162
  function Rs(e) {
3163
3163
  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" && Ff(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) => !zf.includes(r));
3164
+ if (typeof e.icon == "string" && Bf(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) => !Wf.includes(r));
3166
3166
  if (t) throw new Error(`Invalid tool registration "${e.toolId}": unsupported level "${t}".`);
3167
3167
  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
3168
  if (e.singletonScope !== void 0 && e.singletonScope !== "section") throw new Error(`Invalid tool registration "${e.toolId}": unsupported singletonScope "${String(e.singletonScope)}".`);
@@ -3171,7 +3171,7 @@ function Rs(e) {
3171
3171
  if (typeof e.isVisibleInContext != "function") throw new Error(`Invalid tool registration "${e.toolId}": "isVisibleInContext" must be a function.`);
3172
3172
  if (typeof e.renderToolbar != "function") throw new Error(`Invalid tool registration "${e.toolId}": "renderToolbar" must be a function.`);
3173
3173
  }
3174
- var Bf = class {
3174
+ var Uf = class {
3175
3175
  constructor() {
3176
3176
  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
3177
  }
@@ -3317,10 +3317,10 @@ var Bf = class {
3317
3317
  function _l(e) {
3318
3318
  return e.level === "item";
3319
3319
  }
3320
- function Uf(e) {
3320
+ function jf(e) {
3321
3321
  return e.level === "passage";
3322
3322
  }
3323
- function jf(e) {
3323
+ function qf(e) {
3324
3324
  return e.level === "rubric";
3325
3325
  }
3326
3326
  function Tl(e) {
@@ -3361,7 +3361,7 @@ function Bo(e) {
3361
3361
  }
3362
3362
  return n.filter(Boolean).join(" ").trim();
3363
3363
  }
3364
- if (Uf(e)) {
3364
+ if (jf(e)) {
3365
3365
  const t = e.passage;
3366
3366
  if (!t?.config) return "";
3367
3367
  const r = t.config, n = [], i = (l) => l.replace(/<[^>]*>/g, " ").trim();
@@ -3380,7 +3380,7 @@ function Bo(e) {
3380
3380
  }
3381
3381
  return n.filter(Boolean).join(" ").trim();
3382
3382
  }
3383
- if (jf(e)) {
3383
+ if (qf(e)) {
3384
3384
  const t = e.rubricBlock;
3385
3385
  return t.passage?.config ? (t.passage.config.markup || "").replace(/<[^>]*>/g, " ").trim() : (t.content || "").replace(/<[^>]*>/g, " ").trim();
3386
3386
  }
@@ -3397,7 +3397,7 @@ function ci(e) {
3397
3397
  /\d+\s*[+\-*/=]\s*\d+/
3398
3398
  ].some((r) => r.test(t));
3399
3399
  }
3400
- function qf(e) {
3400
+ function Vf(e) {
3401
3401
  const t = [
3402
3402
  "pie-multiple-choice",
3403
3403
  "pie-inline-choice",
@@ -3427,7 +3427,7 @@ function qf(e) {
3427
3427
  function ui(e) {
3428
3428
  return Bo(e).trim().length >= 10;
3429
3429
  }
3430
- function Vf(e) {
3430
+ function Gf(e) {
3431
3431
  const t = Bo(e);
3432
3432
  return [
3433
3433
  /chemistry|chemical|element|atom|molecule|compound/i,
@@ -3438,23 +3438,23 @@ function Vf(e) {
3438
3438
  /physics|force|energy|velocity|acceleration/i
3439
3439
  ].some((r) => r.test(t));
3440
3440
  }
3441
- var Gf = [
3441
+ var Yf = [
3442
3442
  "assessment",
3443
3443
  "section",
3444
3444
  "item",
3445
3445
  "passage",
3446
3446
  "rubric"
3447
- ], Yf = new Set(Gf);
3448
- function Kf(e) {
3449
- return Yf.has(e);
3447
+ ], Kf = new Set(Yf);
3448
+ function Xf(e) {
3449
+ return Kf.has(e);
3450
3450
  }
3451
3451
  function Uo(e, t, r) {
3452
3452
  const n = e.trim(), i = r.trim();
3453
3453
  if (!n || !i) throw new Error("Tool instance ids require non-empty tool and scope ids");
3454
- if (!Kf(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
3454
+ if (!Xf(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
3455
3455
  return `${n}:${t}:${i}`;
3456
3456
  }
3457
- var Xf = class {
3457
+ var Jf = class {
3458
3458
  constructor() {
3459
3459
  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
3460
  }
@@ -3558,14 +3558,34 @@ var Xf = class {
3558
3558
  text: e,
3559
3559
  offset: 0
3560
3560
  }];
3561
- }, wl = class {
3561
+ }, wl = (e) => String(e || "").trim().toLowerCase(), Qf = () => wl((typeof navigator < "u" ? navigator.language || navigator.languages?.[0] : "") || "en-US"), Zf = (e, t) => {
3562
+ if (t) {
3563
+ const s = e.find((a) => a.name === t);
3564
+ if (s) return s;
3565
+ }
3566
+ const r = Qf(), n = r.split("-")[0] || "en", i = (s) => {
3567
+ const a = wl(s.lang);
3568
+ return a === r || a.startsWith(`${n}-`);
3569
+ }, o = [
3570
+ (s) => s.localService && i(s),
3571
+ (s) => s.default && i(s),
3572
+ (s) => i(s),
3573
+ (s) => s.localService,
3574
+ (s) => s.default
3575
+ ];
3576
+ for (const s of o) {
3577
+ const a = e.find(s);
3578
+ if (a) return a;
3579
+ }
3580
+ return e[0] || null;
3581
+ }, ed = (e) => !e.default, Sl = class {
3562
3582
  constructor() {
3563
3583
  m(this, "providerId", "browser"), m(this, "providerName", "Browser Speech Synthesis"), m(this, "version", "1.0.0");
3564
3584
  }
3565
3585
  async initialize(e) {
3566
3586
  if (typeof window > "u") throw new Error("BrowserTTSProvider requires browser environment");
3567
3587
  if (!("speechSynthesis" in window)) throw new Error("Browser does not support Speech Synthesis API");
3568
- return new Jf(e);
3588
+ return new td(e);
3569
3589
  }
3570
3590
  supportsFeature(e) {
3571
3591
  return !0;
@@ -3583,7 +3603,7 @@ var Xf = class {
3583
3603
  }
3584
3604
  destroy() {
3585
3605
  }
3586
- }, Jf = class {
3606
+ }, td = class {
3587
3607
  constructor(e) {
3588
3608
  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;
3589
3609
  }
@@ -3668,37 +3688,40 @@ var Xf = class {
3668
3688
  n(!1);
3669
3689
  return;
3670
3690
  }
3671
- if (this.utterance = new SpeechSynthesisUtterance(e), this.config?.voice) {
3672
- const o = speechSynthesis.getVoices().find((s) => s.name === this.config.voice);
3673
- o && (this.utterance.voice = o);
3674
- }
3675
- this.config?.rate && (this.utterance.rate = this.config.rate), this.config?.pitch && (this.utterance.pitch = this.config.pitch), this.utterance.onstart = () => {
3691
+ const o = new SpeechSynthesisUtterance(e);
3692
+ this.utterance = o;
3693
+ const s = Zf(speechSynthesis.getVoices(), this.config?.voice);
3694
+ s && ed(s) && (o.voice = s), this.config?.rate && (o.rate = this.config.rate), this.config?.pitch && (o.pitch = this.config.pitch);
3695
+ const a = () => {
3696
+ this.utterance === o && (this.utterance = null);
3697
+ };
3698
+ o.onstart = () => {
3676
3699
  r === this.speakRunId && (this._isPlaying = !0, this._isPaused = !1);
3677
- }, this.utterance.onend = () => {
3678
- if (r !== this.speakRunId) {
3700
+ }, o.onend = () => {
3701
+ if (a(), r !== this.speakRunId) {
3679
3702
  n(!1);
3680
3703
  return;
3681
3704
  }
3682
3705
  this._isPlaying = !1, this._isPaused = !1, n(!0);
3683
- }, this.utterance.onerror = (o) => {
3684
- if (r !== this.speakRunId) {
3706
+ }, o.onerror = (l) => {
3707
+ if (a(), r !== this.speakRunId) {
3685
3708
  n(!1);
3686
3709
  return;
3687
3710
  }
3688
- if (this._isPlaying = !1, this._isPaused = !1, o.error === "interrupted" || o.error === "canceled") {
3711
+ if (this._isPlaying = !1, this._isPaused = !1, l.error === "interrupted" || l.error === "canceled") {
3689
3712
  n(!1);
3690
3713
  return;
3691
3714
  }
3692
- i(/* @__PURE__ */ new Error(`Speech synthesis error: ${o.error}`));
3693
- }, this.utterance.onpause = () => {
3715
+ i(/* @__PURE__ */ new Error(`Speech synthesis error: ${l.error}`));
3716
+ }, o.onpause = () => {
3694
3717
  r === this.speakRunId && (this._isPaused = !0);
3695
- }, this.utterance.onresume = () => {
3718
+ }, o.onresume = () => {
3696
3719
  r === this.speakRunId && (this._isPaused = !1);
3697
- }, this.utterance.onboundary = (o) => {
3698
- if (r !== this.speakRunId || (console.log("[BrowserProvider] Boundary event:", o.name, "charIndex:", o.charIndex, "charLength:", o.charLength), o.name !== "word" || !this.onWordBoundary) || this.getHighlightMode() === "sentence") return;
3699
- const s = Math.max(0, Math.min(o.charIndex, Math.max(0, e.length - 1))), a = Number(o.charLength || 0), l = this.inferWordLength(e, s), c = Number.isFinite(a) && a > 0 && a <= 80 && s + a <= e.length ? a : l, u = e.substring(s, Math.min(e.length, s + c)).trim(), f = t + s;
3700
- console.log("[BrowserProvider] Calling onWordBoundary with word:", u, "at position:", f), this.onWordBoundary(u, f, c);
3701
- }, speechSynthesis.speak(this.utterance);
3720
+ }, o.onboundary = (l) => {
3721
+ if (r !== this.speakRunId || (console.log("[BrowserProvider] Boundary event:", l.name, "charIndex:", l.charIndex, "charLength:", l.charLength), l.name !== "word" || !this.onWordBoundary) || this.getHighlightMode() === "sentence") return;
3722
+ const c = Math.max(0, Math.min(l.charIndex, Math.max(0, e.length - 1))), u = Number(l.charLength || 0), f = this.inferWordLength(e, c), h = Number.isFinite(u) && u > 0 && u <= 80 && c + u <= e.length ? u : f, g = e.substring(c, Math.min(e.length, c + h)).trim(), v = t + c;
3723
+ console.log("[BrowserProvider] Calling onWordBoundary with word:", g, "at position:", v), this.onWordBoundary(g, v, h);
3724
+ }, speechSynthesis.speak(o);
3702
3725
  });
3703
3726
  }
3704
3727
  pause() {
@@ -3708,7 +3731,7 @@ var Xf = class {
3708
3731
  this._isPlaying && this._isPaused && speechSynthesis.resume();
3709
3732
  }
3710
3733
  stop() {
3711
- this.speakRunId += 1, this._isPlaying && speechSynthesis.cancel(), this._isPlaying = !1, this._isPaused = !1;
3734
+ this.speakRunId += 1, (this._isPlaying || this.utterance) && speechSynthesis.cancel(), this.utterance = null, this._isPlaying = !1, this._isPaused = !1;
3712
3735
  }
3713
3736
  isPlaying() {
3714
3737
  return this._isPlaying && !this._isPaused;
@@ -3722,7 +3745,7 @@ var Xf = class {
3722
3745
  ...e.providerOptions || {}
3723
3746
  });
3724
3747
  }
3725
- }, Qf = class {
3748
+ }, rd = class {
3726
3749
  async emitTelemetry(e, t) {
3727
3750
  try {
3728
3751
  await this.config?.onTelemetry?.(e, t);
@@ -3754,7 +3777,7 @@ var Xf = class {
3754
3777
  }
3755
3778
  async _initializeBrowserTTS(e) {
3756
3779
  if (typeof window > "u" || !("speechSynthesis" in window)) throw new Error("[TTSToolProvider] Browser TTS not supported (Web Speech API not available)");
3757
- this.ttsProvider = new wl(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
3780
+ this.ttsProvider = new Sl(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
3758
3781
  }
3759
3782
  async _initializeServerTTS(e) {
3760
3783
  if (!e.apiEndpoint) throw new Error("[TTSToolProvider] apiEndpoint required for server-based TTS backends");
@@ -3812,7 +3835,7 @@ var Xf = class {
3812
3835
  destroy() {
3813
3836
  this.ttsProvider && (this.ttsProvider.destroy(), this.ttsProvider = null), this.config = null, console.log("[TTSToolProvider] Destroyed");
3814
3837
  }
3815
- }, Zf = /* @__PURE__ */ new Set([
3838
+ }, nd = /* @__PURE__ */ new Set([
3816
3839
  "annotation-xml",
3817
3840
  "color-profile",
3818
3841
  "font-face",
@@ -3821,16 +3844,16 @@ var Xf = class {
3821
3844
  "font-face-format",
3822
3845
  "font-face-name",
3823
3846
  "missing-glyph"
3824
- ]), ed = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, td = (e, t = "custom element tag") => {
3847
+ ]), id = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, od = (e, t = "custom element tag") => {
3825
3848
  if (!e || typeof e != "string") throw new Error(`Invalid ${t}: expected a non-empty string`);
3826
3849
  const r = e.trim();
3827
3850
  if (!r) throw new Error(`Invalid ${t}: tag is empty`);
3828
3851
  if (r !== r.toLowerCase()) throw new Error(`Invalid ${t} "${r}": custom element names must be lowercase`);
3829
3852
  if (!r.includes("-")) throw new Error(`Invalid ${t} "${r}": custom element names must include a hyphen`);
3830
- if (Zf.has(r)) throw new Error(`Invalid ${t} "${r}": this name is reserved by the HTML spec`);
3831
- if (!ed.test(r)) throw new Error(`Invalid ${t} "${r}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
3853
+ if (nd.has(r)) throw new Error(`Invalid ${t} "${r}": this name is reserved by the HTML spec`);
3854
+ if (!id.test(r)) throw new Error(`Invalid ${t} "${r}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
3832
3855
  return r;
3833
- }, Sl = {
3856
+ }, kl = {
3834
3857
  calculator: "pie-tool-calculator",
3835
3858
  textToSpeech: "pie-tool-text-to-speech",
3836
3859
  ruler: "pie-tool-ruler",
@@ -3842,21 +3865,21 @@ var Xf = class {
3842
3865
  annotationToolbar: "pie-tool-annotation-toolbar",
3843
3866
  graph: "pie-tool-graph",
3844
3867
  periodicTable: "pie-tool-periodic-table"
3845
- }, rd = (e, t) => td(t?.toolTagMap?.[e] ?? Sl[e] ?? e, `tool component tag for "${e}"`), nd = (e) => document.createElement(e), nt = (e, t, r, n) => {
3846
- const i = rd(e, n), o = n?.toolComponentFactories?.[e] ?? n?.toolComponentFactory;
3868
+ }, sd = (e, t) => od(t?.toolTagMap?.[e] ?? kl[e] ?? e, `tool component tag for "${e}"`), ad = (e) => document.createElement(e), nt = (e, t, r, n) => {
3869
+ const i = sd(e, n), o = n?.toolComponentFactories?.[e] ?? n?.toolComponentFactory;
3847
3870
  return o ? o({
3848
3871
  toolId: e,
3849
3872
  tagName: i,
3850
3873
  context: t,
3851
3874
  toolbarContext: r
3852
- }) : nd(i);
3875
+ }) : ad(i);
3853
3876
  }, no = /* @__PURE__ */ new WeakMap();
3854
- function id(e, t) {
3877
+ function ld(e, t) {
3855
3878
  if (!e) return null;
3856
3879
  const r = no.get(e), n = r?.get(t);
3857
3880
  return n ? n.isConnected ? n : (r?.delete(t), null) : null;
3858
3881
  }
3859
- function od(e, t, r) {
3882
+ function cd(e, t, r) {
3860
3883
  if (!e) return;
3861
3884
  let n = no.get(e);
3862
3885
  n || (n = /* @__PURE__ */ new Map(), no.set(e, n)), n.set(t, r);
@@ -3864,7 +3887,7 @@ function od(e, t, r) {
3864
3887
  function Ls(e) {
3865
3888
  return e === "basic" || e === "scientific" ? e : null;
3866
3889
  }
3867
- function sd(e) {
3890
+ function ud(e) {
3868
3891
  const t = e.getToolRenderParams?.("calculator") ?? {}, r = Ls(t.calculatorType), n = t.availableTypes;
3869
3892
  return {
3870
3893
  calculatorType: r,
@@ -3876,14 +3899,14 @@ function Ps(e, t, r) {
3876
3899
  const n = e;
3877
3900
  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;
3878
3901
  }
3879
- var ad = {
3902
+ var fd = {
3880
3903
  toolId: "calculator",
3881
3904
  name: "Calculator",
3882
3905
  description: "Multi-type calculator (basic, scientific, graphing)",
3883
3906
  icon: "calculator",
3884
3907
  provider: {
3885
3908
  getProviderId: (e) => typeof e?.provider?.id == "string" && e.provider.id.length > 0 ? e.provider.id : "calculator-desmos",
3886
- createProvider: () => new Xf(),
3909
+ createProvider: () => new Jf(),
3887
3910
  getInitConfig: (e) => e?.provider?.init ?? {},
3888
3911
  getAuthFetcher: (e) => {
3889
3912
  const t = e?.provider?.runtime?.authFetcher;
@@ -3909,8 +3932,8 @@ var ad = {
3909
3932
  return ci(e);
3910
3933
  },
3911
3934
  renderToolbar(e, t) {
3912
- const { calculatorType: r, availableTypes: n, displayName: i } = sd(t), o = Uo(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = id(t.toolCoordinator, o), l = a ?? nt(this.toolId, e, t, s);
3913
- a || od(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Ps(l, r, n);
3935
+ const { calculatorType: r, availableTypes: n, displayName: i } = ud(t), o = Uo(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = ld(t.toolCoordinator, o), l = a ?? nt(this.toolId, e, t, s);
3936
+ a || cd(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Ps(l, r, n);
3914
3937
  const c = r === null ? "Open scientific calculator" : `Open ${i.toLowerCase()}`, u = r === null ? "Close scientific calculator" : `Close ${i.toLowerCase()}`, f = {
3915
3938
  toolId: this.toolId,
3916
3939
  label: i,
@@ -3951,7 +3974,7 @@ var ad = {
3951
3974
  }
3952
3975
  };
3953
3976
  }
3954
- }, X = (e) => e.trim().replace(/\s+/g, " "), kl = () => /[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu, El = (e) => {
3977
+ }, X = (e) => e.trim().replace(/\s+/g, " "), El = () => /[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu, Al = (e) => {
3955
3978
  if (e.hidden || e.tagName?.toLowerCase() === "mjx-assistive-mml" || e.getAttribute("aria-hidden") === "true" || e.hasAttribute("inert")) return !0;
3956
3979
  const t = e.classList;
3957
3980
  if (t?.contains("sr-only") || t?.contains("pie-sr-only") || t?.contains("visually-hidden")) return !0;
@@ -3965,12 +3988,12 @@ var ad = {
3965
3988
  }, Nr = (e, t) => {
3966
3989
  let r = e.nodeType === 1 ? e : e.parentElement;
3967
3990
  for (; r; ) {
3968
- if (El(r)) return !0;
3991
+ if (Al(r)) return !0;
3969
3992
  if (t && r === t) break;
3970
3993
  r = r.parentElement;
3971
3994
  }
3972
3995
  return !1;
3973
- }, Al = (e, t, r) => {
3996
+ }, xl = (e, t, r) => {
3974
3997
  if (!e || !t || /\s/.test(e) || /\s/.test(t)) return !1;
3975
3998
  const n = r?.boundarySpacingMode ?? "segmenterPreferred";
3976
3999
  if (n === "none") return !1;
@@ -3997,28 +4020,28 @@ var ad = {
3997
4020
  for (; u; ) {
3998
4021
  const h = u;
3999
4022
  if (h.parentElement && !Nr(h, e)) {
4000
- const g = h.textContent || "", b = g.match(/\S/), _ = b ? b[0] : null;
4001
- !o && !s && Al(l, _, t) && (n.push(" "), a && r.set(i, a), i++, s = !0);
4002
- for (let v = 0; v < g.length; v++) {
4003
- const T = g[v], I = /\s/.test(T);
4023
+ const g = h.textContent || "", v = g.match(/\S/), _ = v ? v[0] : null;
4024
+ !o && !s && xl(l, _, t) && (n.push(" "), a && r.set(i, a), i++, s = !0);
4025
+ for (let b = 0; b < g.length; b++) {
4026
+ const T = g[b], I = /\s/.test(T);
4004
4027
  o ? I || (o = !1, n.push(T), r.set(i, {
4005
4028
  node: h,
4006
- offset: v
4029
+ offset: b
4007
4030
  }), a = {
4008
4031
  node: h,
4009
- offset: v
4032
+ offset: b
4010
4033
  }, i++, s = !1, l = T) : I ? (s || (n.push(" "), r.set(i, {
4011
4034
  node: h,
4012
- offset: v
4035
+ offset: b
4013
4036
  }), a = {
4014
4037
  node: h,
4015
- offset: v
4038
+ offset: b
4016
4039
  }, i++), s = !0) : (n.push(T), r.set(i, {
4017
4040
  node: h,
4018
- offset: v
4041
+ offset: b
4019
4042
  }), a = {
4020
4043
  node: h,
4021
- offset: v
4044
+ offset: b
4022
4045
  }, i++, s = !1, l = T);
4023
4046
  }
4024
4047
  }
@@ -4030,11 +4053,11 @@ var ad = {
4030
4053
  text: f,
4031
4054
  map: r
4032
4055
  };
4033
- }, Ri = null, Ns = Promise.resolve(), ld = (e) => (e || "en").split("-")[0].toLowerCase() || "en", cd = async () => (Ri || (Ri = import("./sre-9f9M4fxI.js").then((e) => /* @__PURE__ */ Rc(e.default, 1)).then((e) => {
4056
+ }, Ri = null, Ns = Promise.resolve(), dd = (e) => (e || "en").split("-")[0].toLowerCase() || "en", hd = async () => (Ri || (Ri = import("./sre-9f9M4fxI.js").then((e) => /* @__PURE__ */ Lc(e.default, 1)).then((e) => {
4034
4057
  const t = e.default || e;
4035
4058
  if (!t || typeof t.toSpeech != "function") throw new Error("speech-rule-engine did not expose toSpeech");
4036
4059
  return t;
4037
- })), Ri), ud = (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) => {
4060
+ })), Ri), pd = (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) => {
4038
4061
  if (!$s(e)) return;
4039
4062
  const t = Ds(e.domain), r = Ds(e.style), n = $s(e.engineOptions) ? e.engineOptions : void 0;
4040
4063
  if (!(!t && !r && !n))
@@ -4043,36 +4066,36 @@ var ad = {
4043
4066
  ...r ? { style: r } : {},
4044
4067
  ...n ? { engineOptions: n } : {}
4045
4068
  };
4046
- }, fd = async (e, t, r, n) => {
4047
- const i = ld(t), o = fi(n);
4069
+ }, gd = async (e, t, r, n) => {
4070
+ const i = dd(t), o = fi(n);
4048
4071
  await e.setupEngine?.({
4049
4072
  ...o?.engineOptions || {},
4050
4073
  locale: i,
4051
- domain: o?.domain || ud(i),
4074
+ domain: o?.domain || pd(i),
4052
4075
  ...o?.style ? { style: o.style } : {},
4053
4076
  modality: "speech",
4054
4077
  markup: r
4055
4078
  }), await e.engineReady?.();
4056
- }, dd = async (e) => {
4079
+ }, md = async (e) => {
4057
4080
  const t = Ns.then(e, e);
4058
4081
  return Ns = t.then(() => {
4059
4082
  }, () => {
4060
4083
  }), t;
4061
- }, xl = async (e, t, r, n, i) => dd(async () => (await fd(e, r, n, i), e.toSpeech(t))), hd = (e) => e.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), pd = async (e, t, r, n) => {
4084
+ }, Cl = async (e, t, r, n, i) => md(async () => (await gd(e, r, n, i), e.toSpeech(t))), vd = (e) => e.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), bd = async (e, t, r, n) => {
4062
4085
  try {
4063
- const i = hd(await xl(e, t, r, "ssml", n));
4086
+ const i = vd(await Cl(e, t, r, "ssml", n));
4064
4087
  return i.includes("<speak") ? i : null;
4065
4088
  } catch (i) {
4066
4089
  return console.debug("[TTSService] Math SSML generation failed; using plain", { message: i instanceof Error ? i.message : String(i) }), null;
4067
4090
  }
4068
- }, Cl = async (e, t = {}) => {
4091
+ }, Ml = async (e, t = {}) => {
4069
4092
  if (!e.some((c) => c.type === "math")) return {
4070
4093
  speechText: X(e.map((c) => c.type === "text" ? c.text : c.fallbackText).join(" ")),
4071
4094
  usedMathSpeech: !1,
4072
4095
  usedFallback: !1
4073
4096
  };
4074
4097
  let r = null, n = !1, i = !1;
4075
- const o = t.loadSre || cd, s = [];
4098
+ const o = t.loadSre || hd, s = [];
4076
4099
  for (const c of e) {
4077
4100
  if (c.type === "text") {
4078
4101
  s.push(c.text);
@@ -4080,7 +4103,7 @@ var ad = {
4080
4103
  }
4081
4104
  try {
4082
4105
  r || (r = await o());
4083
- const u = X(await xl(r, c.mathml, t.language, "none", t.mathSpeech));
4106
+ const u = X(await Cl(r, c.mathml, t.language, "none", t.mathSpeech));
4084
4107
  if (u) {
4085
4108
  s.push(u), n = !0;
4086
4109
  continue;
@@ -4092,18 +4115,18 @@ var ad = {
4092
4115
  }
4093
4116
  const a = X(s.join(" "));
4094
4117
  let l;
4095
- return t.produceSsml && r && n && e.length === 1 && e[0].type === "math" && (l = await pd(r, e[0].mathml, t.language, t.mathSpeech) ?? void 0), {
4118
+ return t.produceSsml && r && n && e.length === 1 && e[0].type === "math" && (l = await bd(r, e[0].mathml, t.language, t.mathSpeech) ?? void 0), {
4096
4119
  speechText: a,
4097
4120
  usedMathSpeech: n,
4098
4121
  usedFallback: i,
4099
4122
  ssml: l
4100
4123
  };
4101
- }, gd = /* @__PURE__ */ new Set([
4124
+ }, yd = /* @__PURE__ */ new Set([
4102
4125
  "reserved-row",
4103
4126
  "expanding-row",
4104
4127
  "floating-overlay",
4105
4128
  "left-aligned"
4106
- ]), Hs = (e) => e && typeof e == "object" ? e : {}, md = (e) => e === "polly" || e === "google" || e === "server", Ce = (e, t) => e === void 0 ? t : e, ti = (e, t = "left-aligned") => typeof e == "string" && gd.has(e) ? e : t, zs = Object.freeze([0.8, 1.25]), Li = (e) => {
4129
+ ]), Hs = (e) => e && typeof e == "object" ? e : {}, _d = (e) => e === "polly" || e === "google" || e === "server", Ce = (e, t) => e === void 0 ? t : e, ti = (e, t = "left-aligned") => typeof e == "string" && yd.has(e) ? e : t, zs = Object.freeze([0.8, 1.25]), Li = (e) => {
4107
4130
  if (!Array.isArray(e)) return [...zs];
4108
4131
  if (e.length === 0) return [];
4109
4132
  const t = /* @__PURE__ */ new Set();
@@ -4113,12 +4136,12 @@ var ad = {
4113
4136
  n !== 1 && t.add(n);
4114
4137
  }
4115
4138
  return t.size ? Array.from(t) : [...zs];
4116
- }, vd = (e) => {
4139
+ }, Td = (e) => {
4117
4140
  const t = {
4118
4141
  ...e,
4119
4142
  layoutMode: ti(e.layoutMode)
4120
4143
  }, r = e.backend || "browser";
4121
- if (!md(r)) return t;
4144
+ if (!_d(r)) return t;
4122
4145
  const n = {
4123
4146
  ...t,
4124
4147
  apiEndpoint: Ce(t.apiEndpoint, "/api/tts"),
@@ -4141,12 +4164,12 @@ var ad = {
4141
4164
  } : n;
4142
4165
  }, Pi = (e) => {
4143
4166
  const t = Hs(e), r = Hs(t.settings);
4144
- return vd({
4167
+ return Td({
4145
4168
  ...t,
4146
4169
  ...r
4147
4170
  });
4148
- }, io = (e) => e.backend || "browser", Ml = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, Ol = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), bd = (e) => {
4149
- const t = io(e), r = Ml(e, t), n = Ol(e, r), i = fi(e.mathSpeech);
4171
+ }, io = (e) => e.backend || "browser", Ol = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, Il = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), wd = (e) => {
4172
+ const t = io(e), r = Ol(e, t), n = Il(e, r), i = fi(e.mathSpeech);
4150
4173
  return {
4151
4174
  voice: e.defaultVoice,
4152
4175
  rate: e.rate,
@@ -4172,8 +4195,8 @@ var ad = {
4172
4195
  validateEndpoint: e.validateEndpoint,
4173
4196
  ...typeof e.mathTokenHighlighting == "boolean" ? { mathTokenHighlighting: e.mathTokenHighlighting } : {}
4174
4197
  };
4175
- }, Il = (e) => ti(e.layoutMode), yd = (e) => {
4176
- switch (Il(e)) {
4198
+ }, Rl = (e) => ti(e.layoutMode), Sd = (e) => {
4199
+ switch (Rl(e)) {
4177
4200
  case "reserved-row":
4178
4201
  return {
4179
4202
  mount: "before-buttons",
@@ -4199,21 +4222,21 @@ var ad = {
4199
4222
  }
4200
4223
  };
4201
4224
  }
4202
- }, Br = /* @__PURE__ */ new Map(), _d = "__pieToolElementUnmount", Ws = "pie-tool-active-change", Td = {
4225
+ }, Br = /* @__PURE__ */ new Map(), kd = "__pieToolElementUnmount", Ws = "pie-tool-active-change", Ed = {
4203
4226
  toolId: "textToSpeech",
4204
4227
  name: "Text to Speech",
4205
4228
  description: "Read content aloud",
4206
4229
  icon: "volume-up",
4207
4230
  provider: {
4208
4231
  getProviderId: () => "tts",
4209
- createProvider: (e) => new Qf(io(Pi(e))),
4232
+ createProvider: (e) => new rd(io(Pi(e))),
4210
4233
  getInitConfig: (e) => {
4211
- const t = Pi(e), r = io(t), n = Ml(t, r);
4234
+ const t = Pi(e), r = io(t), n = Ol(t, r);
4212
4235
  return {
4213
4236
  backend: r,
4214
4237
  serverProvider: n,
4215
- transportMode: Ol(t, n),
4216
- ...bd(t)
4238
+ transportMode: Il(t, n),
4239
+ ...wd(t)
4217
4240
  };
4218
4241
  },
4219
4242
  getAuthFetcher: (e) => {
@@ -4239,12 +4262,12 @@ var ad = {
4239
4262
  return ui(e);
4240
4263
  },
4241
4264
  renderToolbar(e, t) {
4242
- const r = () => Pi(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), n = () => Li(r().speedOptions), i = () => Il(r()), o = () => yd(r()), s = Uo(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
4265
+ const r = () => Pi(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), n = () => Li(r().speedOptions), i = () => Rl(r()), o = () => Sd(r()), s = Uo(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
4243
4266
  const u = t.ui?.size;
4244
4267
  return u === "sm" || u === "lg" ? u : "md";
4245
4268
  }, l = () => {
4246
4269
  let u = Br.get(s);
4247
- return u && typeof u.isConnected == "boolean" && !u.isConnected && (Br.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[_d] = () => {
4270
+ return u && typeof u.isConnected == "boolean" && !u.isConnected && (Br.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[kd] = () => {
4248
4271
  Br.get(s) === u && Br.delete(s);
4249
4272
  }, 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;
4250
4273
  }, c = o();
@@ -4261,8 +4284,8 @@ var ad = {
4261
4284
  }],
4262
4285
  subscribeActive: (u) => {
4263
4286
  const f = l(), h = (g) => {
4264
- const b = g.detail;
4265
- u(b?.active === !0);
4287
+ const v = g.detail;
4288
+ u(v?.active === !0);
4266
4289
  };
4267
4290
  return f.addEventListener(Ws, h), () => {
4268
4291
  f.removeEventListener(Ws, h);
@@ -4293,7 +4316,7 @@ function _t(e) {
4293
4316
  function qo(e, t) {
4294
4317
  e.setAttribute("data-pie-tool-surface", t);
4295
4318
  }
4296
- var wd = {
4319
+ var Ad = {
4297
4320
  toolId: "ruler",
4298
4321
  name: "Ruler",
4299
4322
  description: "On-screen ruler for measurements",
@@ -4335,7 +4358,7 @@ var wd = {
4335
4358
  subscribeActive: r.subscribeActive
4336
4359
  };
4337
4360
  }
4338
- }, Sd = {
4361
+ }, xd = {
4339
4362
  toolId: "protractor",
4340
4363
  name: "Protractor",
4341
4364
  description: "On-screen protractor for angle measurements",
@@ -4377,7 +4400,7 @@ var wd = {
4377
4400
  subscribeActive: r.subscribeActive
4378
4401
  };
4379
4402
  }
4380
- }, kd = {
4403
+ }, Cd = {
4381
4404
  toolId: "answerEliminator",
4382
4405
  name: "Answer Eliminator",
4383
4406
  description: "Strike through answer choices",
@@ -4390,7 +4413,7 @@ var wd = {
4390
4413
  "choiceMasking"
4391
4414
  ],
4392
4415
  isVisibleInContext(e) {
4393
- return qf(e);
4416
+ return Vf(e);
4394
4417
  },
4395
4418
  renderToolbar(e, t) {
4396
4419
  const r = yt(this.toolId, t), n = t.componentOverrides ?? {}, i = nt(this.toolId, e, t, n);
@@ -4424,7 +4447,7 @@ var wd = {
4424
4447
  subscribeActive: r.subscribeActive
4425
4448
  };
4426
4449
  }
4427
- }, Ed = {
4450
+ }, Md = {
4428
4451
  toolId: "highlighter",
4429
4452
  name: "Highlighter",
4430
4453
  description: "Highlight text",
@@ -4475,7 +4498,7 @@ var wd = {
4475
4498
  subscribeActive: r.subscribeActive
4476
4499
  };
4477
4500
  }
4478
- }, Ad = {
4501
+ }, Od = {
4479
4502
  toolId: "lineReader",
4480
4503
  name: "Line Reader",
4481
4504
  description: "Reading guide overlay",
@@ -4524,7 +4547,7 @@ var wd = {
4524
4547
  subscribeActive: r.subscribeActive
4525
4548
  };
4526
4549
  }
4527
- }, xd = {
4550
+ }, Id = {
4528
4551
  toolId: "theme",
4529
4552
  name: "Theme",
4530
4553
  description: "Accessible themes and contrast",
@@ -4579,7 +4602,7 @@ var wd = {
4579
4602
  subscribeActive: r.subscribeActive
4580
4603
  };
4581
4604
  }
4582
- }, Cd = {
4605
+ }, Rd = {
4583
4606
  toolId: "annotationToolbar",
4584
4607
  name: "Highlighter",
4585
4608
  description: "Highlight and annotate text",
@@ -4630,7 +4653,7 @@ var wd = {
4630
4653
  subscribeActive: r.subscribeActive
4631
4654
  };
4632
4655
  }
4633
- }, Md = {
4656
+ }, Ld = {
4634
4657
  toolId: "graph",
4635
4658
  name: "Graph",
4636
4659
  description: "Graphing calculator and coordinate plane",
@@ -4683,7 +4706,7 @@ var wd = {
4683
4706
  subscribeActive: r.subscribeActive
4684
4707
  };
4685
4708
  }
4686
- }, Od = {
4709
+ }, Pd = {
4687
4710
  toolId: "periodicTable",
4688
4711
  name: "Periodic Table",
4689
4712
  description: "Chemistry periodic table reference",
@@ -4695,7 +4718,7 @@ var wd = {
4695
4718
  "elementReference"
4696
4719
  ],
4697
4720
  isVisibleInContext(e) {
4698
- return Vf(e);
4721
+ return Gf(e);
4699
4722
  },
4700
4723
  renderToolbar(e, t) {
4701
4724
  const r = yt(this.toolId, t), n = {
@@ -4735,54 +4758,54 @@ var wd = {
4735
4758
  subscribeActive: r.subscribeActive
4736
4759
  };
4737
4760
  }
4738
- }, Id = [
4739
- ad,
4740
- Td,
4741
- wd,
4742
- Sd,
4743
- kd,
4761
+ }, Nd = [
4762
+ fd,
4744
4763
  Ed,
4745
4764
  Ad,
4746
4765
  xd,
4747
4766
  Cd,
4748
4767
  Md,
4749
- Od
4768
+ Od,
4769
+ Id,
4770
+ Rd,
4771
+ Ld,
4772
+ Pd
4750
4773
  ];
4751
- function Rd(e = {}) {
4752
- const t = new Bf(), r = {
4774
+ function $d(e = {}) {
4775
+ const t = new Uf(), r = {
4753
4776
  toolTagMap: {
4754
- ...Sl,
4777
+ ...kl,
4755
4778
  ...e.toolTagMap || {}
4756
4779
  },
4757
4780
  toolComponentFactory: e.toolComponentFactory,
4758
4781
  toolComponentFactories: e.toolComponentFactories
4759
4782
  }, n = (i) => e.overrides?.[i.toolId] || i;
4760
- return e.includePackagedTools && Ld(t, {
4783
+ return e.includePackagedTools && Dd(t, {
4761
4784
  toolIds: e.toolIds,
4762
4785
  applyOverrides: n
4763
4786
  }), e.toolModuleLoaders && Object.keys(e.toolModuleLoaders).length > 0 && t.setToolModuleLoaders(e.toolModuleLoaders), t.setComponentOverrides(r), t;
4764
4787
  }
4765
- function Ld(e, t = {}) {
4788
+ function Dd(e, t = {}) {
4766
4789
  const r = t.toolIds && t.toolIds.length > 0 ? new Set(t.toolIds) : null, n = t.applyOverrides || ((i) => i);
4767
- for (const i of Id)
4790
+ for (const i of Nd)
4768
4791
  r && !r.has(i.toolId) || e.register(n(i));
4769
4792
  }
4770
- function Pd(e = {}) {
4771
- return Rd({
4793
+ function Hd(e = {}) {
4794
+ return $d({
4772
4795
  ...e,
4773
4796
  includePackagedTools: !0
4774
4797
  });
4775
4798
  }
4776
- function Nd() {
4777
- const e = Pd(), t = /* @__PURE__ */ new Set();
4799
+ function zd() {
4800
+ const e = Hd(), t = /* @__PURE__ */ new Set();
4778
4801
  for (const r of e.getAllTools()) for (const n of r.pnpSupportIds || []) t.add(n);
4779
4802
  return [...t].sort();
4780
4803
  }
4781
- var $d = Nd(), Ug = {
4782
- supports: [...$d],
4804
+ var Wd = zd(), Gg = {
4805
+ supports: [...Wd],
4783
4806
  prohibitedSupports: [],
4784
4807
  activateAtInit: []
4785
- }, Dd = {
4808
+ }, Fd = {
4786
4809
  visual: {
4787
4810
  magnification: "magnification",
4788
4811
  screenMagnifier: "screenMagnifier",
@@ -4895,11 +4918,11 @@ var $d = Nd(), Ug = {
4895
4918
  itemGlossary: "itemGlossary",
4896
4919
  tutorialAvailable: "tutorialAvailable"
4897
4920
  }
4898
- }, jg = Object.values(Dd).flatMap((e) => Object.values(e)), qg = bl("ToolCoordinator"), oo;
4921
+ }, Yg = Object.values(Fd).flatMap((e) => Object.values(e)), Kg = bl("ToolCoordinator"), oo;
4899
4922
  (function(e) {
4900
4923
  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";
4901
4924
  })(oo || (oo = {}));
4902
- var Hd = /* @__PURE__ */ new Set([
4925
+ var Bd = /* @__PURE__ */ new Set([
4903
4926
  "speak",
4904
4927
  "p",
4905
4928
  "s",
@@ -4908,20 +4931,20 @@ var Hd = /* @__PURE__ */ new Set([
4908
4931
  "say-as",
4909
4932
  "voice",
4910
4933
  "lang"
4911
- ]), Fs = /* @__PURE__ */ new Set(["audio", "phoneme"]), Rl = (e) => e.replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&nbsp;/g, " ").replace(/&#160;/g, " ").replace(/&amp;/g, "&"), $n = (e, t, r) => {
4934
+ ]), Fs = /* @__PURE__ */ new Set(["audio", "phoneme"]), Ll = (e) => e.replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&nbsp;/g, " ").replace(/&#160;/g, " ").replace(/&amp;/g, "&"), $n = (e, t, r) => {
4912
4935
  for (let n = 0; n < t.length; n++) e.push({
4913
4936
  char: t[n],
4914
4937
  rawOffset: r === null ? null : r + n
4915
4938
  });
4916
- }, zd = (e, t, r) => {
4939
+ }, Ud = (e, t, r) => {
4917
4940
  const n = t.slice(r).match(/^&(quot|apos|lt|gt|nbsp|amp|#160);/i);
4918
- return n ? ($n(e, Rl(n[0]), r), n[0].length) : 0;
4941
+ return n ? ($n(e, Ll(n[0]), r), n[0].length) : 0;
4919
4942
  }, Bs = (e) => {
4920
4943
  e.push({
4921
4944
  char: " ",
4922
4945
  rawOffset: null
4923
4946
  });
4924
- }, Wd = (e) => {
4947
+ }, jd = (e) => {
4925
4948
  const t = /* @__PURE__ */ new Map(), r = [];
4926
4949
  let n = !0;
4927
4950
  for (const i of e) {
@@ -4937,17 +4960,17 @@ var Hd = /* @__PURE__ */ new Set([
4937
4960
  text: r.join(""),
4938
4961
  rawToSpokenOffsetMap: t
4939
4962
  };
4940
- }, Fd = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", Bd = (e, t) => {
4963
+ }, qd = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", Vd = (e, t) => {
4941
4964
  const r = new RegExp(`${t}\\s*=\\s*("([^"]*)"|'([^']*)')`, "i"), n = e.match(r);
4942
- return Rl(n?.[2] ?? n?.[3] ?? "") || null;
4943
- }, Ll = (e) => {
4965
+ return Ll(n?.[2] ?? n?.[3] ?? "") || null;
4966
+ }, Pl = (e) => {
4944
4967
  const t = [];
4945
4968
  let r = !1, n = !1, i = 0;
4946
4969
  for (; i < e.length; ) {
4947
4970
  const s = e[i];
4948
4971
  if (s !== "<") {
4949
4972
  if (s === "&") {
4950
- const h = zd(t, e, i);
4973
+ const h = Ud(t, e, i);
4951
4974
  if (h > 0) {
4952
4975
  i += h;
4953
4976
  continue;
@@ -4962,9 +4985,9 @@ var Hd = /* @__PURE__ */ new Set([
4962
4985
  continue;
4963
4986
  }
4964
4987
  n = !0;
4965
- const l = e.slice(i, a + 1), c = Fd(l), u = /^<\s*\//.test(l), f = /\/\s*>$/.test(l);
4988
+ const l = e.slice(i, a + 1), c = qd(l), u = /^<\s*\//.test(l), f = /\/\s*>$/.test(l);
4966
4989
  if (!u && c === "sub") {
4967
- const h = Bd(l, "alias");
4990
+ const h = Vd(l, "alias");
4968
4991
  if (!h) {
4969
4992
  r = !0, i = a + 1;
4970
4993
  continue;
@@ -4982,16 +5005,16 @@ var Hd = /* @__PURE__ */ new Set([
4982
5005
  i = a + 1;
4983
5006
  continue;
4984
5007
  }
4985
- c && !Hd.has(c) && !Fs.has(c) && c !== "break" && c !== "sub" && (r = !0), !u && (c === "p" || c === "s") && Bs(t), i = a + 1;
5008
+ c && !Bd.has(c) && !Fs.has(c) && c !== "break" && c !== "sub" && (r = !0), !u && (c === "p" || c === "s") && Bs(t), i = a + 1;
4986
5009
  }
4987
- const o = Wd(t);
5010
+ const o = jd(t);
4988
5011
  return {
4989
5012
  spokenText: X(o.text),
4990
5013
  rawToSpokenOffsetMap: o.rawToSpokenOffsetMap,
4991
5014
  unsupportedSemantic: r,
4992
5015
  hasMarkup: n
4993
5016
  };
4994
- }, Ud = kl(), Pl = /* @__PURE__ */ new Map([
5017
+ }, Gd = El(), Nl = /* @__PURE__ */ new Map([
4995
5018
  ["zero", "0"],
4996
5019
  ["one", "1"],
4997
5020
  ["two", "2"],
@@ -5003,7 +5026,7 @@ var Hd = /* @__PURE__ */ new Set([
5003
5026
  ["eight", "8"],
5004
5027
  ["nine", "9"],
5005
5028
  ["ten", "10"]
5006
- ]), jd = [
5029
+ ]), Yd = [
5007
5030
  {
5008
5031
  phrase: [
5009
5032
  "plus",
@@ -5080,7 +5103,7 @@ var Hd = /* @__PURE__ */ new Set([
5080
5103
  }
5081
5104
  ], so = (e) => {
5082
5105
  const t = [];
5083
- for (const r of e.matchAll(Ud)) {
5106
+ for (const r of e.matchAll(Gd)) {
5084
5107
  const n = r[0], i = r.index ?? 0;
5085
5108
  t.push({
5086
5109
  text: n,
@@ -5090,7 +5113,7 @@ var Hd = /* @__PURE__ */ new Set([
5090
5113
  });
5091
5114
  }
5092
5115
  return t;
5093
- }, ao = (e) => Pl.get(e.normalized) || e.normalized, qd = (e, t) => {
5116
+ }, ao = (e) => Nl.get(e.normalized) || e.normalized, Kd = (e, t) => {
5094
5117
  const r = [];
5095
5118
  for (let n = 0; n < e.length; n++) {
5096
5119
  for (let i = 0; i < t.length; i++) ao(e[n]) === ao(t[i]) && r.push({
@@ -5099,7 +5122,7 @@ var Hd = /* @__PURE__ */ new Set([
5099
5122
  visibleToken: i,
5100
5123
  score: 10
5101
5124
  });
5102
- for (const i of jd) {
5125
+ for (const i of Yd) {
5103
5126
  const o = e.slice(n, n + i.phrase.length);
5104
5127
  if (o.length === i.phrase.length && o.every((s, a) => s.normalized === i.phrase[a]))
5105
5128
  for (let s = 0; s < t.length; s++)
@@ -5112,15 +5135,15 @@ var Hd = /* @__PURE__ */ new Set([
5112
5135
  }
5113
5136
  }
5114
5137
  return r;
5115
- }, Vd = (e, t) => {
5116
- const r = qd(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);
5138
+ }, Xd = (e, t) => {
5139
+ const r = Kd(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);
5117
5140
  for (let l = 0; l < r.length; l++) {
5118
5141
  const c = r[l];
5119
5142
  n[l] = c.score;
5120
5143
  for (let u = 0; u < l; u++) {
5121
5144
  const f = r[u];
5122
5145
  if (f.spokenEndToken <= c.spokenStartToken && f.visibleToken < c.visibleToken) {
5123
- const h = c.spokenStartToken - f.spokenEndToken, g = c.visibleToken - f.visibleToken - 1, b = Math.max(0, Math.abs(h - g) - 2), _ = n[u] + c.score - b;
5146
+ const h = c.spokenStartToken - f.spokenEndToken, g = c.visibleToken - f.visibleToken - 1, v = Math.max(0, Math.abs(h - g) - 2), _ = n[u] + c.score - v;
5124
5147
  _ > n[l] && (n[l] = _, i[l] = u);
5125
5148
  }
5126
5149
  }
@@ -5142,12 +5165,12 @@ var Hd = /* @__PURE__ */ new Set([
5142
5165
  score: l.score
5143
5166
  };
5144
5167
  });
5145
- }, Gd = (e, t, r) => {
5168
+ }, Jd = (e, t, r) => {
5146
5169
  if (e.length === 0) return 0;
5147
5170
  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;
5148
5171
  return Math.min(1, n * i);
5149
- }, Nl = (e) => {
5150
- const t = Ll(e.speechText), r = X(e.visibleText), n = t.spokenText, i = so(n), o = so(r), s = t.unsupportedSemantic ? [] : Vd(i, o), a = Gd(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";
5172
+ }, $l = (e) => {
5173
+ const t = Pl(e.speechText), r = X(e.visibleText), n = t.spokenText, i = so(n), o = so(r), s = t.unsupportedSemantic ? [] : Xd(i, o), a = Jd(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";
5151
5174
  return {
5152
5175
  speechText: e.speechText,
5153
5176
  spokenText: n,
@@ -5160,12 +5183,12 @@ var Hd = /* @__PURE__ */ new Set([
5160
5183
  visibleTokens: o,
5161
5184
  rawToSpokenOffsetMap: t.rawToSpokenOffsetMap
5162
5185
  };
5163
- }, Vo = (e, t) => e.find((r) => r.start <= t && t < r.end) || null, $l = (e) => {
5186
+ }, Vo = (e, t) => e.find((r) => r.start <= t && t < r.end) || null, Dl = (e) => {
5164
5187
  if (!e || /^<[^>]+>$/.test(e.trim())) return null;
5165
5188
  const t = so(e)[0];
5166
- return t ? Pl.get(t.normalized) || t.normalized : null;
5189
+ return t ? Nl.get(t.normalized) || t.normalized : null;
5167
5190
  }, Us = (e, t, r) => {
5168
- const n = $l(r);
5191
+ const n = Dl(r);
5169
5192
  if (!t || !n) return !1;
5170
5193
  const i = Vo(e.spokenTokens, t.start);
5171
5194
  return i ? ao(i) === n : !1;
@@ -5193,7 +5216,7 @@ var Hd = /* @__PURE__ */ new Set([
5193
5216
  start: t,
5194
5217
  length: Math.min(r, n.end - t)
5195
5218
  } : null;
5196
- }, Yd = (e, t, r = 1, n) => {
5219
+ }, Qd = (e, t, r = 1, n) => {
5197
5220
  if (e.boundaryOffsetMode === "unsupported" || !Number.isFinite(t)) return null;
5198
5221
  const i = Math.max(1, Number.isFinite(r) ? r : 1);
5199
5222
  if (n && /^<[^>]+>$/.test(n.trim())) return null;
@@ -5202,12 +5225,12 @@ var Hd = /* @__PURE__ */ new Set([
5202
5225
  if (n) {
5203
5226
  if (Us(e, o, n)) return o;
5204
5227
  if (Us(e, s, n)) return s;
5205
- if ($l(n)) return null;
5228
+ if (Dl(n)) return null;
5206
5229
  }
5207
5230
  return o || s;
5208
5231
  }
5209
5232
  return Vs(e, t, i) || qs(e, t, i);
5210
- }, Kd = (e, t) => {
5233
+ }, Zd = (e, t) => {
5211
5234
  if (e.playbackMode === "region-fallback") return null;
5212
5235
  const r = e.anchors.find((o) => o.spokenStart <= t && t < o.spokenEnd);
5213
5236
  if (r) return {
@@ -5229,7 +5252,7 @@ var Hd = /* @__PURE__ */ new Set([
5229
5252
  start: Math.min(n.visibleStart, i.visibleStart),
5230
5253
  end: Math.max(n.visibleEnd, i.visibleEnd)
5231
5254
  } : null;
5232
- }, Xd = /* @__PURE__ */ new Map([
5255
+ }, eh = /* @__PURE__ */ new Map([
5233
5256
  ["+", ["plus"]],
5234
5257
  ["-", ["minus", "negative"]],
5235
5258
  ["−", ["minus", "negative"]],
@@ -5253,12 +5276,12 @@ var Hd = /* @__PURE__ */ new Set([
5253
5276
  ["•", ["times"]],
5254
5277
  ["·", ["times"]],
5255
5278
  ["⁢", ["times", "multiplied by"]]
5256
- ]), Jd = /* @__PURE__ */ new Map([
5279
+ ]), th = /* @__PURE__ */ new Map([
5257
5280
  ["⁡", "function-application"],
5258
5281
  ["⁢", "implicit-multiply"],
5259
5282
  ["⁣", "invisible-separator"],
5260
5283
  ["⁤", "invisible-plus"]
5261
- ]), Dl = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), Qd = /* @__PURE__ */ new Map([
5284
+ ]), Hl = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), rh = /* @__PURE__ */ new Map([
5262
5285
  ["msqrt", "radical"],
5263
5286
  ["mroot", "radical"],
5264
5287
  ["msub", "subscript"],
@@ -5268,11 +5291,11 @@ var Hd = /* @__PURE__ */ new Set([
5268
5291
  ["munderover", "underoverscript"],
5269
5292
  ["mmultiscripts", "multiscript"],
5270
5293
  ["menclose", "enclosure"]
5271
- ]), Zd = (e) => e.replace(/\s+/g, " ").trim(), Jt = (e) => (e.localName || e.tagName || "").toLowerCase(), eh = (e) => e.nodeType === Node.ELEMENT_NODE, Lr = (e) => Array.from(e.childNodes).filter(eh), Go = (e) => Zd(e.textContent || ""), vt = (e, t) => ({
5294
+ ]), nh = (e) => e.replace(/\s+/g, " ").trim(), Jt = (e) => (e.localName || e.tagName || "").toLowerCase(), ih = (e) => e.nodeType === Node.ELEMENT_NODE, Lr = (e) => Array.from(e.childNodes).filter(ih), Go = (e) => nh(e.textContent || ""), vt = (e, t) => ({
5272
5295
  type: "element-range",
5273
5296
  quality: t,
5274
5297
  element: e
5275
- }), th = (e) => {
5298
+ }), oh = (e) => {
5276
5299
  switch (e) {
5277
5300
  case "mi":
5278
5301
  return "identifier";
@@ -5288,15 +5311,15 @@ var Hd = /* @__PURE__ */ new Set([
5288
5311
  default:
5289
5312
  return "unknown";
5290
5313
  }
5291
- }, rh = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), nh = (e, t, r) => r === "fraction" ? ["over", "divided by"] : r === "superscript" ? Dl.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? Xd.get(e) || [] : [], tr = (e) => {
5292
- const t = e.normalized ?? rh(e.text, e.kind || "unknown");
5314
+ }, sh = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), ah = (e, t, r) => r === "fraction" ? ["over", "divided by"] : r === "superscript" ? Hl.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? eh.get(e) || [] : [], tr = (e) => {
5315
+ const t = e.normalized ?? sh(e.text, e.kind || "unknown");
5293
5316
  return {
5294
5317
  id: `math-token-${e.state.nextId++}`,
5295
5318
  kind: e.kind,
5296
5319
  role: e.role,
5297
5320
  text: e.text,
5298
5321
  normalized: t,
5299
- spokenAliases: nh(e.text, e.kind, e.role),
5322
+ spokenAliases: ah(e.text, e.kind, e.role),
5300
5323
  sourceElement: e.sourceElement,
5301
5324
  path: e.path,
5302
5325
  target: e.target || vt(e.sourceElement, "element-range"),
@@ -5304,9 +5327,9 @@ var Hd = /* @__PURE__ */ new Set([
5304
5327
  };
5305
5328
  }, rr = (e, t, r = "tokens") => {
5306
5329
  e[r].push(t);
5307
- }, Hl = (e, t, r) => {
5330
+ }, zl = (e, t, r) => {
5308
5331
  Lr(e).forEach((n, i) => bt(n, t, `${r}/${Jt(n)}[${i}]`));
5309
- }, ih = (e, t, r) => {
5332
+ }, lh = (e, t, r) => {
5310
5333
  const n = Lr(e);
5311
5334
  n[0] && bt(n[0], t, `${r}/numerator`), rr(t, tr({
5312
5335
  state: t,
@@ -5317,7 +5340,7 @@ var Hd = /* @__PURE__ */ new Set([
5317
5340
  path: r,
5318
5341
  target: vt(e, "element-range")
5319
5342
  })), n[1] && bt(n[1], t, `${r}/denominator`);
5320
- }, oh = (e, t, r) => {
5343
+ }, ch = (e, t, r) => {
5321
5344
  const n = e.getAttribute("open") || "(", i = e.getAttribute("close") || ")";
5322
5345
  rr(t, tr({
5323
5346
  state: t,
@@ -5327,7 +5350,7 @@ var Hd = /* @__PURE__ */ new Set([
5327
5350
  sourceElement: e,
5328
5351
  path: `${r}/open`,
5329
5352
  target: vt(e, "element-range")
5330
- })), Hl(e, t, r), rr(t, tr({
5353
+ })), zl(e, t, r), rr(t, tr({
5331
5354
  state: t,
5332
5355
  kind: "operator",
5333
5356
  role: i === "|" ? "absolute-value-fence" : "close-fence",
@@ -5336,13 +5359,13 @@ var Hd = /* @__PURE__ */ new Set([
5336
5359
  path: `${r}/close`,
5337
5360
  target: vt(e, "element-range")
5338
5361
  }));
5339
- }, sh = (e, t, r) => {
5362
+ }, uh = (e, t, r) => {
5340
5363
  const n = Lr(e);
5341
5364
  n[0] && bt(n[0], t, `${r}/base`);
5342
5365
  const i = n[1];
5343
5366
  if (!i) return;
5344
5367
  const o = Go(i);
5345
- if (Dl.has(o)) {
5368
+ if (Hl.has(o)) {
5346
5369
  rr(t, tr({
5347
5370
  state: t,
5348
5371
  kind: "structure",
@@ -5356,7 +5379,7 @@ var Hd = /* @__PURE__ */ new Set([
5356
5379
  return;
5357
5380
  }
5358
5381
  bt(i, t, `${r}/exponent`);
5359
- }, ah = (e, t, r, n) => {
5382
+ }, fh = (e, t, r, n) => {
5360
5383
  rr(t, tr({
5361
5384
  state: t,
5362
5385
  kind: "structure",
@@ -5367,7 +5390,7 @@ var Hd = /* @__PURE__ */ new Set([
5367
5390
  path: r,
5368
5391
  target: vt(e, "element-range")
5369
5392
  }));
5370
- }, lh = (e, t, r) => {
5393
+ }, dh = (e, t, r) => {
5371
5394
  let n = 0;
5372
5395
  for (const i of Lr(e))
5373
5396
  (Jt(i) === "mtr" || Jt(i) === "mlabeledtr") && (n++, rr(t, tr({
@@ -5380,10 +5403,10 @@ var Hd = /* @__PURE__ */ new Set([
5380
5403
  path: `${r}/row[${n}]`,
5381
5404
  target: vt(i, "region-fallback")
5382
5405
  }), "layoutTargets")), bt(i, t, `${r}/${Jt(i)}[${n}]`);
5383
- }, ch = (e, t, r) => {
5406
+ }, hh = (e, t, r) => {
5384
5407
  const n = Go(e);
5385
5408
  if (!n) return;
5386
- const i = th(Jt(e)), o = i === "operator" ? Jd.get(n) : void 0, s = o ?? (i === "operator" && (n === "(" || n === ")") ? "grouping-fence" : i);
5409
+ const i = oh(Jt(e)), o = i === "operator" ? th.get(n) : void 0, s = o ?? (i === "operator" && (n === "(" || n === ")") ? "grouping-fence" : i);
5387
5410
  rr(t, tr({
5388
5411
  state: t,
5389
5412
  kind: i,
@@ -5414,19 +5437,19 @@ var Hd = /* @__PURE__ */ new Set([
5414
5437
  case "mtext":
5415
5438
  case "ms":
5416
5439
  case "mspace":
5417
- ch(e, t, r);
5440
+ hh(e, t, r);
5418
5441
  return;
5419
5442
  case "mfrac":
5420
- ih(e, t, r);
5443
+ lh(e, t, r);
5421
5444
  return;
5422
5445
  case "msup":
5423
- sh(e, t, r);
5446
+ uh(e, t, r);
5424
5447
  return;
5425
5448
  case "mfenced":
5426
- oh(e, t, r);
5449
+ ch(e, t, r);
5427
5450
  return;
5428
5451
  case "mtable":
5429
- lh(e, t, r);
5452
+ dh(e, t, r);
5430
5453
  return;
5431
5454
  case "mphantom":
5432
5455
  return;
@@ -5436,15 +5459,15 @@ var Hd = /* @__PURE__ */ new Set([
5436
5459
  return;
5437
5460
  }
5438
5461
  default: {
5439
- const i = Qd.get(n);
5462
+ const i = rh.get(n);
5440
5463
  if (i) {
5441
- ah(e, t, r, i);
5464
+ fh(e, t, r, i);
5442
5465
  return;
5443
5466
  }
5444
- Hl(e, t, r);
5467
+ zl(e, t, r);
5445
5468
  }
5446
5469
  }
5447
- }, uh = (e) => {
5470
+ }, ph = (e) => {
5448
5471
  const t = {
5449
5472
  tokens: [],
5450
5473
  layoutTargets: [],
@@ -5455,7 +5478,7 @@ var Hd = /* @__PURE__ */ new Set([
5455
5478
  layoutTargets: t.layoutTargets,
5456
5479
  expressionTarget: vt(e, "region-fallback")
5457
5480
  };
5458
- }, fh = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, dh = 0.95, hh = (e) => {
5481
+ }, gh = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, mh = 0.95, vh = (e) => {
5459
5482
  const t = [], r = /* @__PURE__ */ new Set(), n = (i) => {
5460
5483
  const o = i.toLowerCase().trim().split(/\s+/).filter(Boolean);
5461
5484
  if (o.length === 0) return;
@@ -5480,11 +5503,11 @@ var Hd = /* @__PURE__ */ new Set([
5480
5503
  o && (n = i.length);
5481
5504
  }
5482
5505
  return n;
5483
- }, ph = (e, t) => {
5506
+ }, bh = (e, t) => {
5484
5507
  const r = [];
5485
5508
  let n = 0;
5486
5509
  for (const i of t) {
5487
- const o = hh(i);
5510
+ const o = vh(i);
5488
5511
  if (i.optional) {
5489
5512
  const s = Gs(e, n, o);
5490
5513
  s > 0 && (r.push({
@@ -5506,23 +5529,23 @@ var Hd = /* @__PURE__ */ new Set([
5506
5529
  }
5507
5530
  }
5508
5531
  return r;
5509
- }, gh = (e, t, r) => {
5532
+ }, yh = (e, t, r) => {
5510
5533
  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);
5511
5534
  return n > 0 && i === n && o === t.length;
5512
- }, mh = (e) => e.map(({ speechTokens: t, math: r }) => ({
5535
+ }, _h = (e) => e.map(({ speechTokens: t, math: r }) => ({
5513
5536
  speechTokenIds: t.map((n) => n.id),
5514
5537
  mathTokenIds: [r.id],
5515
5538
  score: 1,
5516
5539
  confidence: 1,
5517
5540
  target: r.target
5518
- })), vh = (e) => {
5519
- const t = e.minExactWordConfidence ?? dh, r = ph(e.speech.tokens, e.math.tokens), n = gh(r, e.speech.tokens, e.math.tokens) ? 1 : 0;
5541
+ })), Th = (e) => {
5542
+ const t = e.minExactWordConfidence ?? mh, r = bh(e.speech.tokens, e.math.tokens), n = yh(r, e.speech.tokens, e.math.tokens) ? 1 : 0;
5520
5543
  return {
5521
- segments: n >= t ? mh(r) : [],
5544
+ segments: n >= t ? _h(r) : [],
5522
5545
  confidence: n,
5523
5546
  fallbackTarget: e.math.expressionTarget
5524
5547
  };
5525
- }, zl = kl(), bh = /* @__PURE__ */ new Map([
5548
+ }, Wl = El(), wh = /* @__PURE__ */ new Map([
5526
5549
  ["zero", "0"],
5527
5550
  ["one", "1"],
5528
5551
  ["two", "2"],
@@ -5534,17 +5557,17 @@ var Hd = /* @__PURE__ */ new Set([
5534
5557
  ["eight", "8"],
5535
5558
  ["nine", "9"],
5536
5559
  ["ten", "10"]
5537
- ]), Wl = (e) => {
5560
+ ]), Fl = (e) => {
5538
5561
  const t = e.toLowerCase();
5539
- return bh.get(t) || t;
5540
- }, yh = (e) => {
5562
+ return wh.get(t) || t;
5563
+ }, Sh = (e) => {
5541
5564
  const t = [];
5542
- for (const r of e.matchAll(zl)) {
5565
+ for (const r of e.matchAll(Wl)) {
5543
5566
  const n = r[0], i = r.index ?? 0;
5544
5567
  t.push({
5545
5568
  id: `speech-token-${t.length}`,
5546
5569
  text: n,
5547
- normalized: Wl(n),
5570
+ normalized: Fl(n),
5548
5571
  start: i,
5549
5572
  end: i + n.length,
5550
5573
  sourceStart: i,
@@ -5554,11 +5577,11 @@ var Hd = /* @__PURE__ */ new Set([
5554
5577
  }
5555
5578
  return t;
5556
5579
  }, hn = (e) => {
5557
- const t = Ll(e.speechText);
5580
+ const t = Pl(e.speechText);
5558
5581
  return {
5559
5582
  speechText: e.speechText,
5560
5583
  spokenText: t.spokenText,
5561
- tokens: yh(t.spokenText),
5584
+ tokens: Sh(t.spokenText),
5562
5585
  rawToSpokenOffsetMap: t.rawToSpokenOffsetMap,
5563
5586
  boundaryOffsetSpace: t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text",
5564
5587
  unsupportedSemantic: t.unsupportedSemantic,
@@ -5566,9 +5589,9 @@ var Hd = /* @__PURE__ */ new Set([
5566
5589
  };
5567
5590
  }, Yo = (e) => {
5568
5591
  if (!e || /^<[^>]+>$/.test(e.trim())) return null;
5569
- const t = e.match(zl);
5570
- return t?.[0] ? Wl(t[0]) : null;
5571
- }, _h = (e, t) => e.find((r) => r.start <= t && t < r.end) || null, Th = (e, t) => {
5592
+ const t = e.match(Wl);
5593
+ return t?.[0] ? Fl(t[0]) : null;
5594
+ }, kh = (e, t) => e.find((r) => r.start <= t && t < r.end) || null, Eh = (e, t) => {
5572
5595
  const r = e.rawToSpokenOffsetMap.get(t);
5573
5596
  if (r !== void 0) return r;
5574
5597
  for (let n = t; n < e.speechText.length; n++) {
@@ -5579,7 +5602,7 @@ var Hd = /* @__PURE__ */ new Set([
5579
5602
  return null;
5580
5603
  }, lo = (e, t, r) => {
5581
5604
  if (t === null) return null;
5582
- const n = _h(e.tokens, t);
5605
+ const n = kh(e.tokens, t);
5583
5606
  return n ? {
5584
5607
  token: n,
5585
5608
  start: t,
@@ -5589,9 +5612,9 @@ var Hd = /* @__PURE__ */ new Set([
5589
5612
  }, co = (e, t) => {
5590
5613
  const r = Yo(t);
5591
5614
  return !!(e && r && e.token.normalized === r);
5592
- }, wh = (e) => {
5615
+ }, Ah = (e) => {
5593
5616
  if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
5594
- const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), r = lo(e.tokenization, Th(e.tokenization, e.position), t), n = lo(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5617
+ const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), r = lo(e.tokenization, Eh(e.tokenization, e.position), t), n = lo(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5595
5618
  return co(r, e.boundaryWord) ? {
5596
5619
  ...r,
5597
5620
  confidence: 1
@@ -5599,7 +5622,7 @@ var Hd = /* @__PURE__ */ new Set([
5599
5622
  ...n,
5600
5623
  confidence: 1
5601
5624
  } : e.boundaryWord && Yo(e.boundaryWord) ? null : e.tokenization.boundaryOffsetSpace === "raw-ssml" ? r || n : n || r;
5602
- }, Sh = (e) => {
5625
+ }, xh = (e) => {
5603
5626
  if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
5604
5627
  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);
5605
5628
  return co(r, e.boundaryWord) ? {
@@ -5607,27 +5630,27 @@ var Hd = /* @__PURE__ */ new Set([
5607
5630
  confidence: 1
5608
5631
  } : e.boundaryWord && Yo(e.boundaryWord) ? null : r;
5609
5632
  }, ri = (e) => {
5610
- const t = hn({ speechText: e.speechText }), r = uh(e.mathElement);
5633
+ const t = hn({ speechText: e.speechText }), r = ph(e.mathElement);
5611
5634
  return {
5612
5635
  speech: t,
5613
5636
  math: r,
5614
- result: vh({
5637
+ result: Th({
5615
5638
  speech: t,
5616
5639
  math: r
5617
5640
  })
5618
5641
  };
5619
- }, kh = (e, t) => {
5620
- const r = Sh({
5642
+ }, Ch = (e, t) => {
5643
+ const r = xh({
5621
5644
  tokenization: e.speech,
5622
5645
  position: t.position,
5623
5646
  length: t.length,
5624
5647
  boundaryWord: t.boundaryWord
5625
5648
  });
5626
- return fh({
5649
+ return gh({
5627
5650
  alignment: e.result,
5628
5651
  boundary: r
5629
5652
  });
5630
- }, Eh = (e, t) => {
5653
+ }, Mh = (e, t) => {
5631
5654
  if (!t.boundaryWord || /^<[^>]+>$/.test(t.boundaryWord.trim())) return null;
5632
5655
  const r = hn({ speechText: t.boundaryWord }).tokens[0];
5633
5656
  if (!r) return null;
@@ -5636,7 +5659,7 @@ var Hd = /* @__PURE__ */ new Set([
5636
5659
  return i.normalized.toLowerCase() === o || i.spokenAliases.some((s) => s.toLowerCase() === o);
5637
5660
  });
5638
5661
  return n.length === 1 ? n[0].target : null;
5639
- }, uo = "http://www.w3.org/1998/Math/MathML", Ah = /* @__PURE__ */ new Set([
5662
+ }, uo = "http://www.w3.org/1998/Math/MathML", Oh = /* @__PURE__ */ new Set([
5640
5663
  "math",
5641
5664
  "maction",
5642
5665
  "menclose",
@@ -5670,7 +5693,7 @@ var Hd = /* @__PURE__ */ new Set([
5670
5693
  "semantics",
5671
5694
  "annotation",
5672
5695
  "annotation-xml"
5673
- ]), xh = /* @__PURE__ */ new Set([
5696
+ ]), Ih = /* @__PURE__ */ new Set([
5674
5697
  "accent",
5675
5698
  "accentunder",
5676
5699
  "align",
@@ -5722,44 +5745,44 @@ var Hd = /* @__PURE__ */ new Set([
5722
5745
  "width",
5723
5746
  "xmlns",
5724
5747
  "xml:lang"
5725
- ]), Fl = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Ch = (e) => Fl(e).replace(/"/g, "&quot;"), Mh = (e, t) => {
5748
+ ]), Bl = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Rh = (e) => Bl(e).replace(/"/g, "&quot;"), Lh = (e, t) => {
5726
5749
  const r = e.toLowerCase(), n = t.trim().toLowerCase();
5727
- return !!(r.startsWith("on") || !xh.has(r) || n.includes("javascript:") || n.includes("data:text/html"));
5728
- }, Oh = (e) => {
5750
+ return !!(r.startsWith("on") || !Ih.has(r) || n.includes("javascript:") || n.includes("data:text/html"));
5751
+ }, Ph = (e) => {
5729
5752
  const t = e.localName.toLowerCase();
5730
- if (!Ah.has(t)) return !1;
5753
+ if (!Oh.has(t)) return !1;
5731
5754
  const r = e.namespaceURI;
5732
5755
  return !r || r === uo || r === "http://www.w3.org/1999/xhtml";
5733
- }, Bl = (e) => {
5734
- if (e.nodeType === Node.TEXT_NODE) return Fl(e.textContent || "");
5756
+ }, Ul = (e) => {
5757
+ if (e.nodeType === Node.TEXT_NODE) return Bl(e.textContent || "");
5735
5758
  if (e.nodeType === Node.COMMENT_NODE) return "";
5736
5759
  if (e.nodeType !== Node.ELEMENT_NODE) return null;
5737
5760
  const t = e;
5738
- if (!Oh(t)) return null;
5761
+ if (!Ph(t)) return null;
5739
5762
  const r = t.localName.toLowerCase(), n = [];
5740
5763
  for (const o of Array.from(t.attributes)) {
5741
5764
  const s = o.name.toLowerCase();
5742
- if (!Mh(s, o.value)) {
5765
+ if (!Lh(s, o.value)) {
5743
5766
  if (s === "xmlns" && o.value !== uo) return null;
5744
- n.push(`${s}="${Ch(o.value)}"`);
5767
+ n.push(`${s}="${Rh(o.value)}"`);
5745
5768
  }
5746
5769
  }
5747
5770
  r === "math" && !n.some((o) => o.startsWith("xmlns=")) && n.unshift(`xmlns="${uo}"`);
5748
5771
  const i = [];
5749
5772
  for (const o of Array.from(t.childNodes)) {
5750
- const s = Bl(o);
5773
+ const s = Ul(o);
5751
5774
  if (s === null) return null;
5752
5775
  i.push(s);
5753
5776
  }
5754
5777
  return `<${r}${n.length > 0 ? ` ${n.join(" ")}` : ""}>${i.join("")}</${r}>`;
5755
- }, Ih = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, Ni = (e) => {
5778
+ }, Nh = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, Ni = (e) => {
5756
5779
  const t = String(e || "").trim();
5757
5780
  if (!t) return null;
5758
- const r = Ih(t);
5781
+ const r = Nh(t);
5759
5782
  if (!r || r.getElementsByTagName("parsererror").length > 0) return null;
5760
5783
  const n = r.documentElement;
5761
- return !n || n.localName.toLowerCase() !== "math" ? null : Bl(n);
5762
- }, Ul = (e) => ({
5784
+ return !n || n.localName.toLowerCase() !== "math" ? null : Ul(n);
5785
+ }, jl = (e) => ({
5763
5786
  chars: [],
5764
5787
  map: /* @__PURE__ */ new Map(),
5765
5788
  position: 0,
@@ -5767,28 +5790,28 @@ var Hd = /* @__PURE__ */ new Set([
5767
5790
  lastCharWasWhitespace: !1,
5768
5791
  lastMapped: null,
5769
5792
  options: e
5770
- }), jl = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container", ql = (e) => e.tagName?.toLowerCase() === "mjx-assistive-mml", Vl = (e) => {
5793
+ }), ql = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container", Vl = (e) => e.tagName?.toLowerCase() === "mjx-assistive-mml", Gl = (e) => {
5771
5794
  const t = e.tagName?.toLowerCase();
5772
5795
  return t === "annotation" || t === "annotation-xml";
5773
- }, Rh = (e) => {
5796
+ }, $h = (e) => {
5774
5797
  const t = e.getAttribute("data-mathml");
5775
5798
  return t && t.trim() ? t : null;
5776
- }, Lh = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, Ph = (e) => {
5799
+ }, Dh = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, Hh = (e) => {
5777
5800
  if (e.tagName.toLowerCase() === "math") return Ni(e.outerHTML);
5778
- const t = Rh(e);
5801
+ const t = $h(e);
5779
5802
  if (t) {
5780
5803
  const r = Ni(t);
5781
5804
  if (r) return r;
5782
5805
  }
5783
- if (jl(e)) {
5784
- const r = Lh(e);
5806
+ if (ql(e)) {
5807
+ const r = Dh(e);
5785
5808
  if (r) {
5786
5809
  const n = Ni(r);
5787
5810
  if (n) return n;
5788
5811
  }
5789
5812
  }
5790
5813
  return null;
5791
- }, Nh = /* @__PURE__ */ new Set([
5814
+ }, zh = /* @__PURE__ */ new Set([
5792
5815
  "P",
5793
5816
  "H1",
5794
5817
  "H2",
@@ -5804,7 +5827,7 @@ var Hd = /* @__PURE__ */ new Set([
5804
5827
  "FIGCAPTION",
5805
5828
  "LABEL",
5806
5829
  "BUTTON"
5807
- ]), $h = /* @__PURE__ */ new Set([
5830
+ ]), Wh = /* @__PURE__ */ new Set([
5808
5831
  "heading",
5809
5832
  "listitem",
5810
5833
  "option",
@@ -5813,24 +5836,24 @@ var Hd = /* @__PURE__ */ new Set([
5813
5836
  "cell",
5814
5837
  "columnheader",
5815
5838
  "rowheader"
5816
- ]), Dh = (e, t) => {
5839
+ ]), Fh = (e, t) => {
5817
5840
  let r = e.parentElement, n = null;
5818
5841
  for (; r && r !== t; ) {
5819
5842
  const i = (r.getAttribute("role") || "").toLowerCase(), o = r.tagName.toUpperCase();
5820
- if (Nh.has(o) || $h.has(i)) {
5843
+ if (zh.has(o) || Wh.has(i)) {
5821
5844
  n = r;
5822
5845
  break;
5823
5846
  }
5824
5847
  r = r.parentElement;
5825
5848
  }
5826
5849
  return n || t;
5827
- }, Hh = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || jl(e), Ut = (e, t, r) => {
5850
+ }, Bh = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || ql(e), Ut = (e, t, r) => {
5828
5851
  /[.,;:!?]/.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++;
5829
- }, Gl = (e, t) => {
5852
+ }, Yl = (e, t) => {
5830
5853
  if (e.inLeadingWhitespace || e.lastCharWasWhitespace || e.chars.length === 0) return !1;
5831
5854
  const r = e.chars[e.chars.length - 1];
5832
- return Al(r, t, e.options);
5833
- }, Yl = (e, t) => {
5855
+ return xl(r, t, e.options);
5856
+ }, Kl = (e, t) => {
5834
5857
  const r = t.textContent || "";
5835
5858
  let n = !1;
5836
5859
  for (let i = 0; i < r.length; i++) {
@@ -5849,7 +5872,7 @@ var Hd = /* @__PURE__ */ new Set([
5849
5872
  }), e.lastCharWasWhitespace = !0;
5850
5873
  continue;
5851
5874
  }
5852
- !n && Gl(e, o) && Ut(e, " ", {
5875
+ !n && Yl(e, o) && Ut(e, " ", {
5853
5876
  node: t,
5854
5877
  offset: i
5855
5878
  }), Ut(e, o, {
@@ -5857,7 +5880,7 @@ var Hd = /* @__PURE__ */ new Set([
5857
5880
  offset: i
5858
5881
  }), n = !0, e.lastCharWasWhitespace = !1;
5859
5882
  }
5860
- }, zh = (e, t) => {
5883
+ }, Uh = (e, t) => {
5861
5884
  for (let r = 0; r < t.text.length; r++) {
5862
5885
  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 ? {
5863
5886
  node: o.node,
@@ -5874,7 +5897,7 @@ var Hd = /* @__PURE__ */ new Set([
5874
5897
  e.lastCharWasWhitespace || Ut(e, " ", l), e.lastCharWasWhitespace = !0;
5875
5898
  continue;
5876
5899
  }
5877
- r === 0 && Gl(e, n) && Ut(e, " ", l), Ut(e, n, l), e.lastCharWasWhitespace = !1, o ? (e.map.set(e.position - 1, {
5900
+ r === 0 && Yl(e, n) && Ut(e, " ", l), Ut(e, n, l), e.lastCharWasWhitespace = !1, o ? (e.map.set(e.position - 1, {
5878
5901
  node: o.node,
5879
5902
  offset: o.offset
5880
5903
  }), e.lastMapped = {
@@ -5885,7 +5908,7 @@ var Hd = /* @__PURE__ */ new Set([
5885
5908
  offset: a
5886
5909
  });
5887
5910
  }
5888
- }, Wh = (e) => {
5911
+ }, jh = (e) => {
5889
5912
  if (typeof DOMParser > "u") return "";
5890
5913
  const t = new DOMParser().parseFromString(e, "application/xml");
5891
5914
  if (t.getElementsByTagName("parsererror").length > 0) return "";
@@ -5897,38 +5920,38 @@ var Hd = /* @__PURE__ */ new Set([
5897
5920
  }
5898
5921
  if (i.nodeType !== 1) return;
5899
5922
  const o = i;
5900
- if (!Vl(o))
5923
+ if (!Gl(o))
5901
5924
  for (const s of Array.from(o.childNodes)) n(s);
5902
5925
  };
5903
5926
  return n(t.documentElement), X(r.join(" "));
5904
- }, Fh = (e, t, r) => {
5905
- const n = Ul(r), i = (a) => {
5927
+ }, qh = (e, t, r) => {
5928
+ const n = jl(r), i = (a) => {
5906
5929
  if (Nr(a, e)) return;
5907
5930
  if (a.nodeType === 3) {
5908
- Yl(n, a);
5931
+ Kl(n, a);
5909
5932
  return;
5910
5933
  }
5911
5934
  if (a.nodeType !== 1) return;
5912
5935
  const l = a;
5913
- if (!(ql(l) || Vl(l)))
5936
+ if (!(Vl(l) || Gl(l)))
5914
5937
  for (const c of Array.from(l.childNodes)) i(c);
5915
5938
  };
5916
- i(e), Kl(n);
5939
+ i(e), Xl(n);
5917
5940
  const o = X(n.chars.join(""));
5918
5941
  if (o) return {
5919
5942
  text: o,
5920
5943
  map: n.map
5921
5944
  };
5922
- const s = Wh(t);
5945
+ const s = jh(t);
5923
5946
  return s ? {
5924
5947
  text: s,
5925
5948
  map: /* @__PURE__ */ new Map()
5926
5949
  } : ei(e, r);
5927
- }, Kl = (e) => {
5950
+ }, Xl = (e) => {
5928
5951
  for (; e.chars.length > 0 && /\s/.test(e.chars[e.chars.length - 1]); )
5929
5952
  e.chars.pop(), e.position--, e.map.delete(e.position);
5930
- }, Bh = (e, t) => {
5931
- const r = Ul(t), n = [];
5953
+ }, Vh = (e, t) => {
5954
+ const r = jl(t), n = [];
5932
5955
  let i = 0, o, s = !1;
5933
5956
  const a = () => {
5934
5957
  const u = X(r.chars.slice(i, r.chars.length).join(""));
@@ -5940,23 +5963,23 @@ var Hd = /* @__PURE__ */ new Set([
5940
5963
  }, l = (u) => {
5941
5964
  if (Nr(u, e)) return;
5942
5965
  if (u.nodeType === Node.TEXT_NODE) {
5943
- const g = Dh(u, e);
5944
- o && g !== o && a(), o = g, Yl(r, u);
5966
+ const g = Fh(u, e);
5967
+ o && g !== o && a(), o = g, Kl(r, u);
5945
5968
  return;
5946
5969
  }
5947
5970
  if (u.nodeType !== Node.ELEMENT_NODE) return;
5948
5971
  const f = u;
5949
- if (ql(f)) return;
5950
- const h = Ph(f);
5972
+ if (Vl(f)) return;
5973
+ const h = Hh(f);
5951
5974
  if (h) {
5952
5975
  a();
5953
- const g = Fh(f, h, t);
5954
- zh(r, g);
5955
- const b = X(g.text);
5976
+ const g = qh(f, h, t);
5977
+ Uh(r, g);
5978
+ const v = X(g.text);
5956
5979
  n.push({
5957
5980
  type: "math",
5958
5981
  mathml: h,
5959
- fallbackText: b,
5982
+ fallbackText: v,
5960
5983
  sourceElement: f
5961
5984
  }), i = r.chars.length, s = !0;
5962
5985
  return;
@@ -5964,7 +5987,7 @@ var Hd = /* @__PURE__ */ new Set([
5964
5987
  for (const g of Array.from(f.childNodes)) l(g);
5965
5988
  };
5966
5989
  for (const u of Array.from(e.childNodes)) l(u);
5967
- Kl(r), a();
5990
+ Xl(r), a();
5968
5991
  const c = r.chars.join("");
5969
5992
  for (; r.map.has(c.length); ) r.map.delete(c.length);
5970
5993
  return {
@@ -5974,7 +5997,7 @@ var Hd = /* @__PURE__ */ new Set([
5974
5997
  containsMathMarkup: s
5975
5998
  };
5976
5999
  }, Zr = (e, t) => {
5977
- if (!Hh(e)) {
6000
+ if (!Bh(e)) {
5978
6001
  const { text: r, map: n } = ei(e, t);
5979
6002
  return {
5980
6003
  visibleText: r,
@@ -5986,8 +6009,8 @@ var Hd = /* @__PURE__ */ new Set([
5986
6009
  containsMathMarkup: !1
5987
6010
  };
5988
6011
  }
5989
- return Bh(e, t);
5990
- }, Uh = (e, t) => Cl([e], t), jh = (e) => (e || "en").split("-")[0].toLowerCase() || "en", qh = /* @__PURE__ */ new Set([
6012
+ return Vh(e, t);
6013
+ }, Gh = (e, t) => Ml([e], t), Yh = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Kh = /* @__PURE__ */ new Set([
5991
6014
  "H1",
5992
6015
  "H2",
5993
6016
  "H3",
@@ -5997,17 +6020,17 @@ var Hd = /* @__PURE__ */ new Set([
5997
6020
  "LI",
5998
6021
  "LABEL",
5999
6022
  "BUTTON"
6000
- ]), Vh = /* @__PURE__ */ new Set([
6023
+ ]), Xh = /* @__PURE__ */ new Set([
6001
6024
  "heading",
6002
6025
  "listitem",
6003
6026
  "option",
6004
6027
  "radio"
6005
- ]), Gh = (e) => {
6028
+ ]), Jh = (e) => {
6006
6029
  if (e.type !== "text" || !e.sourceElement) return !1;
6007
6030
  const t = e.sourceElement.tagName.toUpperCase(), r = (e.sourceElement.getAttribute("role") || "").toLowerCase();
6008
- return qh.has(t) || Vh.has(r);
6009
- }, Yh = async (e) => {
6010
- const t = e.resolveMathSpeech ?? Uh, { visibleText: r } = e, n = [];
6031
+ return Kh.has(t) || Xh.has(r);
6032
+ }, Qh = async (e) => {
6033
+ const t = e.resolveMathSpeech ?? Gh, { visibleText: r } = e, n = [];
6011
6034
  let i = 0;
6012
6035
  const o = (a) => {
6013
6036
  const l = X(a), c = r.indexOf(l, i), u = c >= 0 ? c : i, f = u + l.length;
@@ -6019,21 +6042,21 @@ var Hd = /* @__PURE__ */ new Set([
6019
6042
  for (let a = 0; a < e.chunks.length; a++) {
6020
6043
  const l = e.chunks[a];
6021
6044
  if (l.type === "text") {
6022
- const g = Gh(l) ? [{
6045
+ const g = Jh(l) ? [{
6023
6046
  text: l.text,
6024
6047
  offset: 0
6025
6048
  }] : jo(l.text, { locale: e.language });
6026
- for (const b of g) {
6027
- const _ = X(b.text);
6049
+ for (const v of g) {
6050
+ const _ = X(v.text);
6028
6051
  if (!_) continue;
6029
- const v = o(_);
6052
+ const b = o(_);
6030
6053
  n.push({
6031
6054
  sourceChunkIndex: a,
6032
6055
  segment: {
6033
6056
  kind: "prose",
6034
6057
  spokenText: _,
6035
6058
  visibleText: _,
6036
- visibleSpan: v
6059
+ visibleSpan: b
6037
6060
  }
6038
6061
  }), s.push(_);
6039
6062
  }
@@ -6059,12 +6082,12 @@ var Hd = /* @__PURE__ */ new Set([
6059
6082
  }
6060
6083
  return {
6061
6084
  segments: n,
6062
- locale: jh(e.language),
6085
+ locale: Yh(e.language),
6063
6086
  visibleText: r,
6064
6087
  plainSpeechText: X(s.join(" "))
6065
6088
  };
6066
- }, Kh = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Xh = "sre-v1", Jh = 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)}`, Ys = (e, t, r, n) => `${Xh}\0${Kh(e)}\0${t ? "ssml" : "plain"}\0${fo(r ?? null)}\0${n}`, Qh = (e = {}) => {
6067
- const t = Math.max(1, e.maxEntries ?? Jh), r = e.resolve ?? ((o, s) => Cl([o], s)), n = /* @__PURE__ */ new Map(), i = (o, s) => {
6089
+ }, Zh = (e) => (e || "en").split("-")[0].toLowerCase() || "en", ep = "sre-v1", tp = 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)}`, Ys = (e, t, r, n) => `${ep}\0${Zh(e)}\0${t ? "ssml" : "plain"}\0${fo(r ?? null)}\0${n}`, rp = (e = {}) => {
6090
+ const t = Math.max(1, e.maxEntries ?? tp), r = e.resolve ?? ((o, s) => Ml([o], s)), n = /* @__PURE__ */ new Map(), i = (o, s) => {
6068
6091
  for (n.delete(o), n.set(o, s); n.size > t; ) {
6069
6092
  const a = n.keys().next().value;
6070
6093
  a !== void 0 && n.delete(a);
@@ -6084,13 +6107,13 @@ var Hd = /* @__PURE__ */ new Set([
6084
6107
  usedFallback: f.usedFallback
6085
6108
  }), i(c, f), f;
6086
6109
  };
6087
- }, Zh = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : hn({ speechText: e }).tokens[0]?.normalized || null, ep = (e, t) => {
6110
+ }, np = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : hn({ speechText: e }).tokens[0]?.normalized || null, ip = (e, t) => {
6088
6111
  const r = hn({ speechText: e.speechText });
6089
6112
  if (!Number.isFinite(t.position)) return {
6090
6113
  boundary: null,
6091
6114
  spokenText: r.spokenText
6092
6115
  };
6093
- const n = wh({
6116
+ const n = Ah({
6094
6117
  tokenization: r,
6095
6118
  position: t.position,
6096
6119
  length: t.length,
@@ -6103,8 +6126,8 @@ var Hd = /* @__PURE__ */ new Set([
6103
6126
  } : null,
6104
6127
  spokenText: r.spokenText
6105
6128
  };
6106
- }, tp = (e, t, r) => r ? hn({ speechText: e }).tokens.find((n) => n.start <= t && t < n.end)?.normalized === r : !0, rp = (e, t) => {
6107
- const r = Zh(t.word);
6129
+ }, op = (e, t, r) => r ? hn({ speechText: e }).tokens.find((n) => n.start <= t && t < n.end)?.normalized === r : !0, sp = (e, t) => {
6130
+ const r = np(t.word);
6108
6131
  if (e.id !== t.chunkId) return {
6109
6132
  chunkId: t.chunkId,
6110
6133
  normalizedWord: r,
@@ -6123,12 +6146,12 @@ var Hd = /* @__PURE__ */ new Set([
6123
6146
  };
6124
6147
  let n, i;
6125
6148
  if (e.catalogAlignment)
6126
- n = Yd(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
6149
+ n = Qd(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
6127
6150
  else {
6128
- const o = ep(e, t);
6151
+ const o = ip(e, t);
6129
6152
  n = o.boundary, i = o.spokenText;
6130
6153
  }
6131
- return n ? tp(i, n.start, r) ? {
6154
+ return n ? op(i, n.start, r) ? {
6132
6155
  chunkId: e.id,
6133
6156
  normalizedWord: r,
6134
6157
  chunkSpokenStart: n.start,
@@ -6168,12 +6191,12 @@ var Hd = /* @__PURE__ */ new Set([
6168
6191
  quality: "region",
6169
6192
  confidence: e.confidence,
6170
6193
  reason: e.reason
6171
- }, Xl = /* @__PURE__ */ new Map([
6194
+ }, Jl = /* @__PURE__ */ new Map([
6172
6195
  ["mi", "mjx-mi"],
6173
6196
  ["mn", "mjx-mn"],
6174
6197
  ["mo", "mjx-mo"],
6175
6198
  ["mtext", "mjx-mtext"]
6176
- ]), ho = "mi,mn,mo,mtext", Jl = "mjx-mi,mjx-mn,mjx-mo,mjx-mtext", Ql = [
6199
+ ]), ho = "mi,mn,mo,mtext", Ql = "mjx-mi,mjx-mn,mjx-mo,mjx-mtext", Zl = [
6177
6200
  "mjx-mfrac",
6178
6201
  "mjx-msqrt",
6179
6202
  "mjx-mroot",
@@ -6181,14 +6204,14 @@ var Hd = /* @__PURE__ */ new Set([
6181
6204
  "mjx-munder",
6182
6205
  "mjx-mover",
6183
6206
  "mjx-munderover"
6184
- ].join(","), Zl = (e) => e.type === "text-range" ? e.node.parentElement : e.element, di = (e) => {
6207
+ ].join(","), ec = (e) => e.type === "text-range" ? e.node.parentElement : e.element, di = (e) => {
6185
6208
  let t = e;
6186
6209
  for (; t; ) {
6187
6210
  if (t.localName?.toLowerCase() === "mjx-container") return t;
6188
6211
  t = t.parentElement;
6189
6212
  }
6190
6213
  return null;
6191
- }, Ks = (e) => !e || di(e) ? !1 : !Nr(e), ec = (e) => {
6214
+ }, Ks = (e) => !e || di(e) ? !1 : !Nr(e), tc = (e) => {
6192
6215
  const t = e.getBoundingClientRect?.();
6193
6216
  return !!(t && t.width > 0 && t.height > 0);
6194
6217
  }, po = (e) => {
@@ -6198,38 +6221,38 @@ var Hd = /* @__PURE__ */ new Set([
6198
6221
  t = t.parentElement;
6199
6222
  }
6200
6223
  return null;
6201
- }, tc = (e, t) => {
6224
+ }, rc = (e, t) => {
6202
6225
  if (e.length === 0 || e.length !== t.length) return !1;
6203
6226
  for (let r = 0; r < e.length; r += 1) {
6204
- const n = Xl.get(e[r].localName.toLowerCase());
6227
+ const n = Jl.get(e[r].localName.toLowerCase());
6205
6228
  if (!n || t[r].localName.toLowerCase() !== n) return !1;
6206
6229
  }
6207
6230
  return !0;
6208
- }, np = (e, t) => {
6209
- if (!e || !Xl.has(e.localName.toLowerCase()) || t.querySelector(Ql)) return null;
6231
+ }, ap = (e, t) => {
6232
+ if (!e || !Jl.has(e.localName.toLowerCase()) || t.querySelector(Zl)) return null;
6210
6233
  const r = po(e), n = t.querySelector("mjx-math");
6211
6234
  if (!r || !n) return null;
6212
6235
  const i = Array.from(r.querySelectorAll(ho)), o = i.indexOf(e);
6213
6236
  if (o < 0) return null;
6214
- const s = Array.from(n.querySelectorAll(Jl));
6215
- if (!tc(i, s)) return null;
6237
+ const s = Array.from(n.querySelectorAll(Ql));
6238
+ if (!rc(i, s)) return null;
6216
6239
  const a = s[o];
6217
- return !a || !ec(a) ? null : a;
6218
- }, ip = (e) => {
6240
+ return !a || !tc(a) ? null : a;
6241
+ }, lp = (e) => {
6219
6242
  const t = di(e);
6220
6243
  if (t) {
6221
- if (t.querySelector(Ql)) return "expression";
6244
+ if (t.querySelector(Zl)) return "expression";
6222
6245
  const n = po(e) ?? e, i = t.querySelector("mjx-math");
6223
6246
  if (!i) return "expression";
6224
- const o = Array.from(n.querySelectorAll(ho)), s = Array.from(i.querySelectorAll(Jl));
6225
- return tc(o, s) && s.some((a) => ec(a)) ? "token" : "expression";
6247
+ const o = Array.from(n.querySelectorAll(ho)), s = Array.from(i.querySelectorAll(Ql));
6248
+ return rc(o, s) && s.some((a) => tc(a)) ? "token" : "expression";
6226
6249
  }
6227
6250
  const r = po(e) ?? e;
6228
6251
  return Array.from(r.querySelectorAll(ho)).some((n) => !Nr(n)) ? "token" : "expression";
6229
6252
  }, go = (e) => {
6230
- const t = Zl(e), r = di(t);
6253
+ const t = ec(e), r = di(t);
6231
6254
  if (r) {
6232
- const n = np(t, r);
6255
+ const n = ap(t, r);
6233
6256
  return n ? {
6234
6257
  type: "element",
6235
6258
  quality: "semantic-token",
@@ -6251,24 +6274,24 @@ var Hd = /* @__PURE__ */ new Set([
6251
6274
  quality: e.quality === "region-fallback" ? "expression" : "semantic-token",
6252
6275
  element: e.element
6253
6276
  } : null;
6254
- }, op = go, sp = () => {
6277
+ }, cp = go, up = () => {
6255
6278
  const e = /* @__PURE__ */ new WeakMap();
6256
6279
  return (t) => {
6257
- const r = Zl(t), n = di(r);
6280
+ const r = ec(t), n = di(r);
6258
6281
  if (!r || !n) return go(t);
6259
6282
  if (e.has(r)) return e.get(r) ?? null;
6260
6283
  const i = go(t);
6261
6284
  return e.set(r, i), i;
6262
6285
  };
6263
- }, ap = (e, t, r, n = e.mathAlignments, i = op) => {
6286
+ }, fp = (e, t, r, n = e.mathAlignments, i = cp) => {
6264
6287
  if (t.chunkSpokenStart === null || t.chunkSpokenEnd === null) return null;
6265
6288
  let o = null;
6266
6289
  for (const s of n) {
6267
- const a = kh(s.alignment, {
6290
+ const a = Ch(s.alignment, {
6268
6291
  position: t.chunkSpokenStart,
6269
6292
  length: Math.max(1, t.chunkSpokenEnd - t.chunkSpokenStart),
6270
6293
  boundaryWord: r.word
6271
- }) || Eh(s.alignment, { boundaryWord: r.word });
6294
+ }) || Mh(s.alignment, { boundaryWord: r.word });
6272
6295
  if (!a) continue;
6273
6296
  const l = i(a);
6274
6297
  if (l) {
@@ -6277,7 +6300,7 @@ var Hd = /* @__PURE__ */ new Set([
6277
6300
  }
6278
6301
  }
6279
6302
  return o;
6280
- }, rc = (e, t, r) => {
6303
+ }, nc = (e, t, r) => {
6281
6304
  if (!e || typeof document > "u" || r <= t) return null;
6282
6305
  const n = e.get(t);
6283
6306
  let i = e.get(Math.max(t, r - 1));
@@ -6289,17 +6312,17 @@ var Hd = /* @__PURE__ */ new Set([
6289
6312
  } catch {
6290
6313
  return null;
6291
6314
  }
6292
- }, lp = (e, t) => {
6315
+ }, dp = (e, t) => {
6293
6316
  if (!e.catalogAlignment || t.chunkSpokenStart === null) return null;
6294
- const r = Kd(e.catalogAlignment, t.chunkSpokenStart);
6317
+ const r = Zd(e.catalogAlignment, t.chunkSpokenStart);
6295
6318
  if (!r) return null;
6296
- const n = rc(e.visibleMap, r.start, r.end);
6319
+ const n = nc(e.visibleMap, r.start, r.end);
6297
6320
  return n ? {
6298
6321
  type: "range",
6299
6322
  quality: e.catalogAlignment.playbackMode === "exact-word" ? "exact-word" : "semantic-token",
6300
6323
  range: n
6301
6324
  } : null;
6302
- }, cp = (e) => e.regionRange ? {
6325
+ }, hp = (e) => e.regionRange ? {
6303
6326
  type: "range",
6304
6327
  quality: "region",
6305
6328
  range: e.regionRange
@@ -6311,7 +6334,7 @@ var Hd = /* @__PURE__ */ new Set([
6311
6334
  if (t.length !== 1) return null;
6312
6335
  const r = t[0]?.alignment.result.fallbackTarget;
6313
6336
  return r ? e.renderedMathTargetResolver(r) : null;
6314
- }, up = (e, t) => e ? t.mathAlignments.filter(({ element: r }) => {
6337
+ }, pp = (e, t) => e ? t.mathAlignments.filter(({ element: r }) => {
6315
6338
  try {
6316
6339
  return e.type === "range" ? e.range.intersectsNode(r) : e.type === "element" ? e.element === r || e.element.contains(r) : e.node.parentElement?.contains(r) || !1;
6317
6340
  } catch {
@@ -6323,18 +6346,18 @@ var Hd = /* @__PURE__ */ new Set([
6323
6346
  quality: "region",
6324
6347
  confidence: 0,
6325
6348
  reason: "boundary chunk id was not found"
6326
- }), Qs = (e) => e.length === 1 ? e[0].element : null, fp = (e, t) => t.length > 0 && t.every(({ element: r }) => e.mathCapabilityByElement.get(r) === "token"), dp = 3, hp = (e, t, r) => {
6349
+ }), Qs = (e) => e.length === 1 ? e[0].element : null, gp = (e, t) => t.length > 0 && t.every(({ element: r }) => e.mathCapabilityByElement.get(r) === "token"), mp = 3, vp = (e, t, r) => {
6327
6350
  if (!t || t.type !== "range") return !1;
6328
6351
  const { startContainer: n, endContainer: i } = t.range;
6329
- return n === i && n.nodeType === dp ? !1 : r.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(n) && o.contains(i));
6330
- }, pp = (e, t) => ({
6352
+ return n === i && n.nodeType === mp ? !1 : r.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(n) && o.contains(i));
6353
+ }, bp = (e, t) => ({
6331
6354
  chunk: e,
6332
- regionTarget: cp(e),
6333
- renderedMathTargetResolver: sp(),
6334
- mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: r }) => [r, t ? ip(r) : "expression"])),
6355
+ regionTarget: hp(e),
6356
+ renderedMathTargetResolver: up(),
6357
+ mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: r }) => [r, t ? lp(r) : "expression"])),
6335
6358
  heldTokenByElement: /* @__PURE__ */ new Map()
6336
- }), gp = (e) => {
6337
- const t = e.mathTokenHighlighting !== !1, r = new Map(e.chunks.map((n) => [n.id, pp(n, t)]));
6359
+ }), yp = (e) => {
6360
+ const t = e.mathTokenHighlighting !== !1, r = new Map(e.chunks.map((n) => [n.id, bp(n, t)]));
6338
6361
  return {
6339
6362
  chunks: e.chunks,
6340
6363
  resolveInitial(n) {
@@ -6358,7 +6381,7 @@ var Hd = /* @__PURE__ */ new Set([
6358
6381
  resolveBoundary(n) {
6359
6382
  const i = r.get(n.chunkId);
6360
6383
  if (!i) return Js();
6361
- const { chunk: o } = i, s = rp(o, n), a = lp(o, s), l = up(a, o), c = (!a || l.length > 0 ? ap(o, s, n, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, f = c && c.quality === "expression" ? c : null;
6384
+ const { chunk: o } = i, s = sp(o, n), a = dp(o, s), l = pp(a, o), c = (!a || l.length > 0 ? fp(o, s, n, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, f = c && c.quality === "expression" ? c : null;
6362
6385
  if (u) {
6363
6386
  const h = Qs(l);
6364
6387
  return h && i.heldTokenByElement.set(h, u), vr({
@@ -6369,14 +6392,14 @@ var Hd = /* @__PURE__ */ new Set([
6369
6392
  reason: s.reason
6370
6393
  });
6371
6394
  }
6372
- if (a && (t ? !hp(i, a, l) : l.length === 0)) return vr({
6395
+ if (a && (t ? !vp(i, a, l) : l.length === 0)) return vr({
6373
6396
  semanticTarget: a,
6374
6397
  expressionTarget: null,
6375
6398
  regionTarget: i.regionTarget,
6376
6399
  confidence: s.confidence,
6377
6400
  reason: s.reason
6378
6401
  });
6379
- if (fp(i, l)) {
6402
+ if (gp(i, l)) {
6380
6403
  const h = Qs(l), g = h ? i.heldTokenByElement.get(h) ?? null : null;
6381
6404
  return vr({
6382
6405
  semanticTarget: g,
@@ -6395,14 +6418,14 @@ var Hd = /* @__PURE__ */ new Set([
6395
6418
  });
6396
6419
  }
6397
6420
  };
6398
- }, mp = (e) => {
6421
+ }, _p = (e) => {
6399
6422
  if (e.alignment?.boundaryOffsetMode) return e.alignment.boundaryOffsetMode;
6400
6423
  const t = e.mathAlignment?.speech.boundaryOffsetSpace;
6401
6424
  return t || "plain-spoken-text";
6402
- }, vp = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
6425
+ }, Tp = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
6403
6426
  element: e.sourceElement,
6404
6427
  alignment: e.mathAlignment
6405
- }] : [], bp = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
6428
+ }] : [], wp = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
6406
6429
  speechText: e.speechText || "",
6407
6430
  visibleText: e.visibleText || e.speechText || "",
6408
6431
  sourceElement: e.sourceElement || e.contentRoot,
@@ -6419,9 +6442,9 @@ var Hd = /* @__PURE__ */ new Set([
6419
6442
  regionRange: t.regionRange,
6420
6443
  visibleMap: t.visibleMap,
6421
6444
  catalogAlignment: t.alignment,
6422
- mathAlignments: vp(t),
6423
- offsetSpace: mp(t)
6424
- })), yp = [
6445
+ mathAlignments: Tp(t),
6446
+ offsetSpace: _p(t)
6447
+ })), Sp = [
6425
6448
  "[data-pie-tts-region]",
6426
6449
  "[data-catalog-region]",
6427
6450
  "li",
@@ -6431,18 +6454,18 @@ var Hd = /* @__PURE__ */ new Set([
6431
6454
  "[role='group']",
6432
6455
  "[role='region']",
6433
6456
  "div"
6434
- ].join(","), nc = (e, t) => {
6435
- const r = e.closest(yp);
6457
+ ].join(","), ic = (e, t) => {
6458
+ const r = e.closest(Sp);
6436
6459
  return r && t.contains(r) ? r : e;
6437
- }, _p = (e, t, r) => {
6460
+ }, kp = (e, t, r) => {
6438
6461
  const n = /* @__PURE__ */ new Map();
6439
6462
  for (let i = t; i < r; i++) {
6440
6463
  const o = e.get(i);
6441
6464
  o && n.set(i - t, o);
6442
6465
  }
6443
6466
  return n;
6444
- }, Tp = async (e) => {
6445
- const t = Zr(e.contentRoot, e.textProcessingOptions), r = await Yh({
6467
+ }, Ep = async (e) => {
6468
+ const t = Zr(e.contentRoot, e.textProcessingOptions), r = await Qh({
6446
6469
  chunks: t.chunks,
6447
6470
  visibleText: t.visibleText,
6448
6471
  language: e.language,
@@ -6460,8 +6483,8 @@ var Hd = /* @__PURE__ */ new Set([
6460
6483
  segment: n,
6461
6484
  anchor: {
6462
6485
  sourceElement: a,
6463
- regionElement: nc(a, e.contentRoot),
6464
- visibleMap: _p(t.map, n.visibleSpan.start, n.visibleSpan.end)
6486
+ regionElement: ic(a, e.contentRoot),
6487
+ visibleMap: kp(t.map, n.visibleSpan.start, n.visibleSpan.end)
6465
6488
  }
6466
6489
  };
6467
6490
  }
@@ -6481,8 +6504,8 @@ var Hd = /* @__PURE__ */ new Set([
6481
6504
  containsMathMarkup: t.containsMathMarkup,
6482
6505
  visibleText: t.visibleText
6483
6506
  };
6484
- }, wp = (e, t) => {
6485
- const r = Nl({
6507
+ }, Ap = (e, t) => {
6508
+ const r = $l({
6486
6509
  speechText: e.spokenText,
6487
6510
  visibleText: e.spokenText
6488
6511
  });
@@ -6491,13 +6514,13 @@ var Hd = /* @__PURE__ */ new Set([
6491
6514
  visibleText: e.visibleText,
6492
6515
  sourceElement: t.sourceElement,
6493
6516
  regionElement: t.regionElement,
6494
- regionRange: rc(t.visibleMap, 0, e.visibleText.length) ?? void 0,
6517
+ regionRange: nc(t.visibleMap, 0, e.visibleText.length) ?? void 0,
6495
6518
  speechMatchesVisibleText: !0,
6496
6519
  playbackMode: r.playbackMode,
6497
6520
  alignment: r,
6498
6521
  visibleMap: t.visibleMap
6499
6522
  };
6500
- }, ic = (e, t) => {
6523
+ }, oc = (e, t) => {
6501
6524
  const r = t.sourceElement;
6502
6525
  return {
6503
6526
  speechText: e.spokenText,
@@ -6510,7 +6533,7 @@ var Hd = /* @__PURE__ */ new Set([
6510
6533
  speechText: e.spokenText
6511
6534
  }) : void 0
6512
6535
  };
6513
- }, Sp = (e, t, r) => {
6536
+ }, xp = (e, t, r) => {
6514
6537
  const n = t.sourceElement;
6515
6538
  return {
6516
6539
  speechText: r,
@@ -6522,15 +6545,15 @@ var Hd = /* @__PURE__ */ new Set([
6522
6545
  mathElement: n,
6523
6546
  speechText: r
6524
6547
  }) : void 0,
6525
- plainFallback: ic(e, t)
6548
+ plainFallback: oc(e, t)
6526
6549
  };
6527
- }, kp = (e, t = {}) => e.items.map(({ segment: r, anchor: n }) => r.kind === "prose" ? wp(r, n) : t.format === "ssml" && r.ssml ? Sp(r, n, r.ssml) : ic(r, n)), Ep = "pie-tts-control-handoff", W;
6550
+ }, Cp = (e, t = {}) => e.items.map(({ segment: r, anchor: n }) => r.kind === "prose" ? Ap(r, n) : t.format === "ssml" && r.ssml ? xp(r, n, r.ssml) : oc(r, n)), Mp = "pie-tts-control-handoff", W;
6528
6551
  (function(e) {
6529
6552
  e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
6530
6553
  })(W || (W = {}));
6531
- var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, xp = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? Ap(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, Cp = class mo {
6554
+ var Op = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, Ip = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? Op(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, Rp = class mo {
6532
6555
  constructor() {
6533
- m(this, "currentProvider", null), m(this, "provider", null), m(this, "highlightCoordinator", null), m(this, "catalogResolver", null), m(this, "state", W.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, "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", Qh());
6556
+ m(this, "currentProvider", null), m(this, "provider", null), m(this, "highlightCoordinator", null), m(this, "catalogResolver", null), m(this, "state", W.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, "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", rp());
6534
6557
  }
6535
6558
  debugLog(t, r) {
6536
6559
  mo.debugEnabled && (r === void 0 ? console.debug(t) : console.debug(t, r));
@@ -6653,7 +6676,7 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6653
6676
  return t.includes("<") ? /<\s*break\b|<\s*speak\b|<\s*prosody\b|<\s*p\b|<\s*s\b/i.test(t) : !1;
6654
6677
  }
6655
6678
  isElementHidden(t) {
6656
- return El(t);
6679
+ return Al(t);
6657
6680
  }
6658
6681
  getBoundaryStrength(t) {
6659
6682
  const r = Number(t.getAttribute("data-tts-break-ms"));
@@ -6724,9 +6747,9 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6724
6747
  for (const l of n) {
6725
6748
  const c = t.substring(o, l), u = c.match(/^\s*/)?.[0].length || 0, f = c.match(/\s*$/)?.[0].length || 0, h = o + u, g = l - f;
6726
6749
  if (g > h) {
6727
- const b = t.substring(h, g);
6750
+ const v = t.substring(h, g);
6728
6751
  i.push({
6729
- text: b,
6752
+ text: v,
6730
6753
  startOffset: h,
6731
6754
  pauseMsAfter: this.resolvePauseMsFromUnits(r.get(l) || 0)
6732
6755
  });
@@ -6766,9 +6789,9 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6766
6789
  }
6767
6790
  let u = a;
6768
6791
  for (const f of [...c, l]) {
6769
- const h = n.substring(u, f), g = h.match(/^\s*/)?.[0].length || 0, b = h.match(/\s*$/)?.[0].length || 0, _ = u + g, v = f - b;
6770
- v > _ && o.push({
6771
- text: n.substring(_, v),
6792
+ const h = n.substring(u, f), g = h.match(/^\s*/)?.[0].length || 0, v = h.match(/\s*$/)?.[0].length || 0, _ = u + g, b = f - v;
6793
+ b > _ && o.push({
6794
+ text: n.substring(_, b),
6772
6795
  startOffset: _,
6773
6796
  pauseMsAfter: 0
6774
6797
  }), u = f;
@@ -6876,8 +6899,8 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6876
6899
  }), this.initializeSpeakTracking(a, r);
6877
6900
  const g = r?.highlightModeOverride || (f ? this.resolveHighlightMode() : "sentence");
6878
6901
  this.activeHighlightMode = g;
6879
- const b = this.hasExplicitBreakSemantics(o), _ = !!this.currentContentElement && !c && !b && f;
6880
- if (this.seekSegments = b || !f ? [] : _ && this.currentContentElement ? this.createSpeechPlan(this.currentContentElement, l) : this.createSeekSegmentsFromText(a), this.sentenceHighlightSegments = b ? [] : this.createSentenceHighlightSegments({
6902
+ const v = this.hasExplicitBreakSemantics(o), _ = !!this.currentContentElement && !c && !v && f;
6903
+ if (this.seekSegments = v || !f ? [] : _ && this.currentContentElement ? this.createSpeechPlan(this.currentContentElement, l) : this.createSeekSegmentsFromText(a), this.sentenceHighlightSegments = v ? [] : this.createSentenceHighlightSegments({
6881
6904
  contentToSpeak: a,
6882
6905
  shouldUsePlan: _,
6883
6906
  playbackSegments: this.seekSegments
@@ -6905,7 +6928,7 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6905
6928
  }
6906
6929
  async switchProviderToBrowser(t, r) {
6907
6930
  if (!this.currentProvider) return !1;
6908
- const n = new wl(), i = this.currentProvider.providerId, o = { ...this.ttsConfig }, s = r?.operation || "tts-initialize", a = r?.contentToSpeak ?? "", l = a.replace(/\s+/g, " ").trim().slice(0, 120), c = a.length > 0 ? {
6931
+ const n = new Sl(), i = this.currentProvider.providerId, o = { ...this.ttsConfig }, s = r?.operation || "tts-initialize", a = r?.contentToSpeak ?? "", l = a.replace(/\s+/g, " ").trim().slice(0, 120), c = a.length > 0 ? {
6909
6932
  textLength: a.length,
6910
6933
  textPreview: l.length < a.length ? `${l}…` : l
6911
6934
  } : {};
@@ -7046,8 +7069,8 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7046
7069
  }, a = (u, f) => {
7047
7070
  const h = l(u);
7048
7071
  if (h.length !== 1) return null;
7049
- const g = h[0], b = Zr(g, this.getTextProcessingOptions(r.language)).visibleText || X(g.textContent || ""), _ = (v) => X(v).replace(/\s+/g, "");
7050
- return _(b) === _(f) ? g : null;
7072
+ const g = h[0], v = Zr(g, this.getTextProcessingOptions(r.language)).visibleText || X(g.textContent || ""), _ = (b) => X(b).replace(/\s+/g, "");
7073
+ return _(v) === _(f) ? g : null;
7051
7074
  }, l = (u) => {
7052
7075
  const f = Array.from(u.querySelectorAll("math"));
7053
7076
  return u.localName?.toLowerCase() === "math" ? [u, ...f] : f;
@@ -7061,11 +7084,11 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7061
7084
  const f = u, h = s(f);
7062
7085
  if (h) {
7063
7086
  o();
7064
- const g = Zr(f, this.getTextProcessingOptions(r.language)), b = g.visibleText || X(f.textContent || ""), _ = Nl({
7087
+ const g = Zr(f, this.getTextProcessingOptions(r.language)), v = g.visibleText || X(f.textContent || ""), _ = $l({
7065
7088
  speechText: h.content,
7066
- visibleText: b
7067
- }), v = a(f, b), T = v ? ri({
7068
- mathElement: v,
7089
+ visibleText: v
7090
+ }), b = a(f, v), T = b ? ri({
7091
+ mathElement: b,
7069
7092
  speechText: h.content
7070
7093
  }) : void 0, I = T ? void 0 : l(f).map((w) => ({
7071
7094
  element: w,
@@ -7076,10 +7099,10 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7076
7099
  })), N = X(h.content);
7077
7100
  n.push({
7078
7101
  speechText: h.content,
7079
- visibleText: b,
7102
+ visibleText: v,
7080
7103
  sourceElement: f,
7081
- regionElement: nc(f, t),
7082
- speechMatchesVisibleText: N === b,
7104
+ regionElement: ic(f, t),
7105
+ speechMatchesVisibleText: N === v,
7083
7106
  playbackMode: _.playbackMode,
7084
7107
  alignment: _,
7085
7108
  mathAlignment: T,
@@ -7097,7 +7120,7 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7097
7120
  return !t || t.providerId?.toLowerCase() === "browser" ? "plain" : t.getCapabilities?.().supportsSSML ? "ssml" : "plain";
7098
7121
  }
7099
7122
  async resolveGeneratedSpeechContent(t, r, n) {
7100
- const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await Tp({
7123
+ const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await Ep({
7101
7124
  contentRoot: t,
7102
7125
  language: n,
7103
7126
  mathSpeech: this.getMathSpeechOptions(),
@@ -7114,7 +7137,7 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7114
7137
  containsMathMarkup: !1,
7115
7138
  speechMatchesVisibleText: !0
7116
7139
  };
7117
- const c = kp(o, { format: i }), u = o.plainSpeechText;
7140
+ const c = Cp(o, { format: i }), u = o.plainSpeechText;
7118
7141
  return {
7119
7142
  contentToSpeak: u,
7120
7143
  speechText: u,
@@ -7187,7 +7210,7 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7187
7210
  }
7188
7211
  }
7189
7212
  highlightRenderableRegionTarget(t) {
7190
- if (!(!this.highlightCoordinator || !t || typeof document > "u") && !xp(this.lastRenderedRegionTarget, t))
7213
+ if (!(!this.highlightCoordinator || !t || typeof document > "u") && !Ip(this.lastRenderedRegionTarget, t))
7191
7214
  try {
7192
7215
  const r = document.createRange();
7193
7216
  if (t.type === "element") r.selectNodeContents(t.element);
@@ -7238,10 +7261,10 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7238
7261
  async speakCatalogChunkOnce(t, r) {
7239
7262
  if (!this.provider) return;
7240
7263
  this.lastRenderedRegionTarget = null;
7241
- const n = t.regionElement || t.sourceElement || this.currentContentElement, i = n ? bp({
7264
+ const n = t.regionElement || t.sourceElement || this.currentContentElement, i = n ? wp({
7242
7265
  contentRoot: n,
7243
7266
  chunks: [t]
7244
- })[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? gp({
7267
+ })[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? yp({
7245
7268
  chunks: [i],
7246
7269
  mathTokenHighlighting: o
7247
7270
  }) : null;
@@ -7352,7 +7375,7 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7352
7375
  this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.setState(W.IDLE), this.currentText = null, this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
7353
7376
  }
7354
7377
  requestControlHandoff() {
7355
- typeof window > "u" || window.dispatchEvent(new CustomEvent(Ep, { detail: { source: "host" } }));
7378
+ typeof window > "u" || window.dispatchEvent(new CustomEvent(Mp, { detail: { source: "host" } }));
7356
7379
  }
7357
7380
  isPlaying() {
7358
7381
  return this.state === W.PLAYING;
@@ -7423,14 +7446,14 @@ var Ap = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
7423
7446
  });
7424
7447
  }
7425
7448
  };
7426
- m(Cp, "debugEnabled", (() => {
7449
+ m(Rp, "debugEnabled", (() => {
7427
7450
  try {
7428
7451
  if (typeof process < "u" && process.env?.PIE_TTS_DEBUG === "1") return !0;
7429
7452
  } catch {
7430
7453
  }
7431
7454
  return globalThis.__PIE_TTS_DEBUG__ === !0;
7432
7455
  })());
7433
- var Vg = Hf({
7456
+ var Xg = zf({
7434
7457
  policy: {
7435
7458
  allowed: [],
7436
7459
  blocked: []
@@ -7442,10 +7465,10 @@ var Vg = Hf({
7442
7465
  },
7443
7466
  providers: {}
7444
7467
  });
7445
- function Mp(e) {
7468
+ function Lp(e) {
7446
7469
  return e === "light" || e === "dark" || e === "auto";
7447
7470
  }
7448
- function Op(e) {
7471
+ function Pp(e) {
7449
7472
  return e === "self" || e === "document";
7450
7473
  }
7451
7474
  function vo(e) {
@@ -7459,7 +7482,7 @@ function vo(e) {
7459
7482
  } else typeof n == "number" && (t[r] = String(n));
7460
7483
  return t;
7461
7484
  }
7462
- var Ip = [
7485
+ var Np = [
7463
7486
  {
7464
7487
  id: "default",
7465
7488
  name: "Default",
@@ -7681,17 +7704,17 @@ var Ip = [
7681
7704
  primary: "#aaaaaa"
7682
7705
  }
7683
7706
  }
7684
- ], bo = new Map(Ip.map((e) => [e.id, e])), oc = /* @__PURE__ */ new Map();
7685
- function Rp() {
7686
- return [...bo.values(), ...oc.values()];
7707
+ ], bo = new Map(Np.map((e) => [e.id, e])), sc = /* @__PURE__ */ new Map();
7708
+ function $p() {
7709
+ return [...bo.values(), ...sc.values()];
7687
7710
  }
7688
- function Lp(e) {
7689
- return e ? oc.get(e) ?? bo.get(e) : bo.get("default");
7711
+ function Dp(e) {
7712
+ return e ? sc.get(e) ?? bo.get(e) : bo.get("default");
7690
7713
  }
7691
- function Pp(e) {
7692
- return Lp(e)?.variables ?? {};
7714
+ function Hp(e) {
7715
+ return Dp(e)?.variables ?? {};
7693
7716
  }
7694
- var Np = {
7717
+ var zp = {
7695
7718
  "--pie-text": "black",
7696
7719
  "--pie-disabled": "grey",
7697
7720
  "--pie-disabled-secondary": "#ababab",
@@ -7740,7 +7763,7 @@ var Np = {
7740
7763
  "--pie-button-hover-color": "#111827",
7741
7764
  "--pie-button-active-bg": "#f3f4f6",
7742
7765
  "--pie-button-focus-outline": "#3b82f6"
7743
- }, $p = {
7766
+ }, Wp = {
7744
7767
  "--pie-text": "#ffffff",
7745
7768
  "--pie-disabled": "#999999",
7746
7769
  "--pie-disabled-secondary": "#777777",
@@ -7798,7 +7821,7 @@ function ft(e) {
7798
7821
  if (!(!e.left || !e.right))
7799
7822
  return `color-mix(in srgb, ${e.left} ${e.leftWeight}, ${e.right})`;
7800
7823
  }
7801
- function Dp(e) {
7824
+ function Fp(e) {
7802
7825
  const t = (r) => Dn(e.getPropertyValue(r));
7803
7826
  return vo({
7804
7827
  "--pie-background": t("--color-base-100"),
@@ -7893,11 +7916,11 @@ var Zs = {
7893
7916
  return !!(Dn(t.getPropertyValue("--color-base-100")) || Dn(t.getPropertyValue("--color-base-content")) || Dn(t.getPropertyValue("--color-primary")));
7894
7917
  },
7895
7918
  read(e) {
7896
- return Dp(getComputedStyle(e));
7919
+ return Fp(getComputedStyle(e));
7897
7920
  }
7898
7921
  };
7899
7922
  yo.set(Zs.id, Zs);
7900
- function Hp(e) {
7923
+ function Bp(e) {
7901
7924
  const t = e.provider?.trim() || "auto", r = (i) => {
7902
7925
  if (t && t !== "auto") {
7903
7926
  const o = yo.get(t);
@@ -7910,9 +7933,9 @@ function Hp(e) {
7910
7933
  }, n = r(e.target);
7911
7934
  return Object.keys(n).length > 0 ? n : typeof document < "u" && e.target !== document.documentElement ? r(document.documentElement) : {};
7912
7935
  }
7913
- var zp = typeof HTMLElement > "u" ? class {
7936
+ var Up = typeof HTMLElement > "u" ? class {
7914
7937
  } : HTMLElement;
7915
- function Wp(e, t) {
7938
+ function jp(e, t) {
7916
7939
  if (!customElements.get(e))
7917
7940
  try {
7918
7941
  customElements.define(e, t);
@@ -7933,7 +7956,7 @@ function _o(e) {
7933
7956
  r.startsWith("--") && (typeof n == "string" ? t[r] = n : typeof n == "number" && (t[r] = String(n)));
7934
7957
  return t;
7935
7958
  }
7936
- var Fp = class extends zp {
7959
+ var qp = class extends Up {
7937
7960
  constructor(...e) {
7938
7961
  super(...e), m(this, "mediaQuery", null), m(this, "onMediaChange", () => this.applyTheme()), m(this, "previousKeys", /* @__PURE__ */ new Set()), m(this, "variablesOverride", {});
7939
7962
  }
@@ -7948,14 +7971,14 @@ var Fp = class extends zp {
7948
7971
  }
7949
7972
  get theme() {
7950
7973
  const e = this.getAttribute("theme");
7951
- return Mp(e) ? e : "light";
7974
+ return Lp(e) ? e : "light";
7952
7975
  }
7953
7976
  set theme(e) {
7954
7977
  this.setAttribute("theme", e);
7955
7978
  }
7956
7979
  get scope() {
7957
7980
  const e = this.getAttribute("scope");
7958
- return Op(e) ? e : "self";
7981
+ return Pp(e) ? e : "self";
7959
7982
  }
7960
7983
  set scope(e) {
7961
7984
  this.setAttribute("scope", e);
@@ -7994,10 +8017,10 @@ var Fp = class extends zp {
7994
8017
  if (typeof document > "u" || typeof window > "u") return;
7995
8018
  const { effectiveTheme: e, dataTheme: t } = this.resolveThemeState(), r = this.getTarget();
7996
8019
  r.setAttribute("data-theme", t), this.scheme && this.scheme !== "default" ? r.setAttribute("data-color-scheme", this.scheme) : r.removeAttribute("data-color-scheme");
7997
- const n = e === "dark" ? $p : Np, i = Hp({
8020
+ const n = e === "dark" ? Wp : zp, i = Bp({
7998
8021
  target: r,
7999
8022
  provider: this.provider
8000
- }), o = Pp(this.scheme), s = {
8023
+ }), o = Hp(this.scheme), s = {
8001
8024
  ...n,
8002
8025
  ...i,
8003
8026
  ...o,
@@ -8034,12 +8057,12 @@ var Fp = class extends zp {
8034
8057
  typeof window > "u" || (this.mediaQuery && (this.mediaQuery.removeEventListener("change", this.onMediaChange), this.mediaQuery = null), this.getAttribute("theme")?.trim() === "auto" && (this.mediaQuery = window.matchMedia("(prefers-color-scheme: dark)"), this.mediaQuery.addEventListener("change", this.onMediaChange)));
8035
8058
  }
8036
8059
  };
8037
- function Bp(e = "pie-theme") {
8038
- typeof customElements > "u" || Wp(e, Fp);
8060
+ function Vp(e = "pie-theme") {
8061
+ typeof customElements > "u" || jp(e, qp);
8039
8062
  }
8040
- Bp();
8041
- var sc = "https://proxy.pie-api.com", Up = `${sc}/bundles/`;
8042
- function ac(e) {
8063
+ Vp();
8064
+ var ac = "https://proxy.pie-api.com", Gp = `${ac}/bundles/`;
8065
+ function lc(e) {
8043
8066
  try {
8044
8067
  const t = {
8045
8068
  BASE_URL: "/",
@@ -8052,10 +8075,10 @@ function ac(e) {
8052
8075
  } catch {
8053
8076
  }
8054
8077
  }
8055
- var Gg = typeof window < "u" && window.PIE_BUILDER_ORIGIN_URL || ac("PUBLIC_BUILDER_ORIGIN_URL") || sc, jp = typeof window < "u" && window.PIE_BUILDER_BUNDLE_URL || ac("PUBLIC_BUILDER_BUNDLE_URL") || Up, qp = {
8078
+ var Jg = typeof window < "u" && window.PIE_BUILDER_ORIGIN_URL || lc("PUBLIC_BUILDER_ORIGIN_URL") || ac, Yp = typeof window < "u" && window.PIE_BUILDER_BUNDLE_URL || lc("PUBLIC_BUILDER_BUNDLE_URL") || Gp, Kp = {
8056
8079
  retryDelayMs: 3e3,
8057
8080
  timeoutMs: 12e4
8058
- }, { entries: lc, setPrototypeOf: ea, isFrozen: Vp, getPrototypeOf: Gp, getOwnPropertyDescriptor: Yp } = Object, { freeze: me, seal: De, create: en } = Object, { apply: To, construct: wo } = typeof Reflect < "u" && Reflect;
8081
+ }, { entries: cc, setPrototypeOf: ea, isFrozen: Xp, getPrototypeOf: Jp, getOwnPropertyDescriptor: Qp } = Object, { freeze: me, seal: De, create: en } = Object, { apply: To, construct: wo } = typeof Reflect < "u" && Reflect;
8059
8082
  me || (me = function(t) {
8060
8083
  return t;
8061
8084
  });
@@ -8070,7 +8093,7 @@ wo || (wo = function(t) {
8070
8093
  for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++) n[i - 1] = arguments[i];
8071
8094
  return new t(...n);
8072
8095
  });
8073
- var Ur = ve(Array.prototype.forEach), Kp = ve(Array.prototype.lastIndexOf), ta = ve(Array.prototype.pop), jr = ve(Array.prototype.push), Xp = ve(Array.prototype.splice), Hn = ve(String.prototype.toLowerCase), $i = ve(String.prototype.toString), Di = ve(String.prototype.match), br = ve(String.prototype.replace), Jp = ve(String.prototype.indexOf), Qp = ve(String.prototype.trim), Fe = ve(Object.prototype.hasOwnProperty), de = ve(RegExp.prototype.test), qr = Zp(TypeError);
8096
+ var Ur = ve(Array.prototype.forEach), Zp = ve(Array.prototype.lastIndexOf), ta = ve(Array.prototype.pop), jr = ve(Array.prototype.push), eg = ve(Array.prototype.splice), Hn = ve(String.prototype.toLowerCase), $i = ve(String.prototype.toString), Di = ve(String.prototype.match), br = ve(String.prototype.replace), tg = ve(String.prototype.indexOf), rg = ve(String.prototype.trim), Fe = ve(Object.prototype.hasOwnProperty), de = ve(RegExp.prototype.test), qr = ng(TypeError);
8074
8097
  function ve(e) {
8075
8098
  return function(t) {
8076
8099
  t instanceof RegExp && (t.lastIndex = 0);
@@ -8078,7 +8101,7 @@ function ve(e) {
8078
8101
  return To(e, t, n);
8079
8102
  };
8080
8103
  }
8081
- function Zp(e) {
8104
+ function ng(e) {
8082
8105
  return function() {
8083
8106
  for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++) r[n] = arguments[n];
8084
8107
  return wo(e, r);
@@ -8092,29 +8115,29 @@ function R(e, t) {
8092
8115
  let i = t[n];
8093
8116
  if (typeof i == "string") {
8094
8117
  const o = r(i);
8095
- o !== i && (Vp(t) || (t[n] = o), i = o);
8118
+ o !== i && (Xp(t) || (t[n] = o), i = o);
8096
8119
  }
8097
8120
  e[i] = !0;
8098
8121
  }
8099
8122
  return e;
8100
8123
  }
8101
- function eg(e) {
8124
+ function ig(e) {
8102
8125
  for (let t = 0; t < e.length; t++) Fe(e, t) || (e[t] = null);
8103
8126
  return e;
8104
8127
  }
8105
8128
  function Xe(e) {
8106
8129
  const t = en(null);
8107
- for (const [r, n] of lc(e)) Fe(e, r) && (Array.isArray(n) ? t[r] = eg(n) : n && typeof n == "object" && n.constructor === Object ? t[r] = Xe(n) : t[r] = n);
8130
+ for (const [r, n] of cc(e)) Fe(e, r) && (Array.isArray(n) ? t[r] = ig(n) : n && typeof n == "object" && n.constructor === Object ? t[r] = Xe(n) : t[r] = n);
8108
8131
  return t;
8109
8132
  }
8110
8133
  function Vr(e, t) {
8111
8134
  for (; e !== null; ) {
8112
- const n = Yp(e, t);
8135
+ const n = Qp(e, t);
8113
8136
  if (n) {
8114
8137
  if (n.get) return ve(n.get);
8115
8138
  if (typeof n.value == "function") return ve(n.value);
8116
8139
  }
8117
- e = Gp(e);
8140
+ e = Jp(e);
8118
8141
  }
8119
8142
  function r() {
8120
8143
  return null;
@@ -8315,7 +8338,7 @@ var ra = me([
8315
8338
  "feSpotLight",
8316
8339
  "feTile",
8317
8340
  "feTurbulence"
8318
- ]), tg = me([
8341
+ ]), og = me([
8319
8342
  "animate",
8320
8343
  "color-profile",
8321
8344
  "cursor",
@@ -8369,7 +8392,7 @@ var ra = me([
8369
8392
  "munder",
8370
8393
  "munderover",
8371
8394
  "mprescripts"
8372
- ]), rg = me([
8395
+ ]), sg = me([
8373
8396
  "maction",
8374
8397
  "maligngroup",
8375
8398
  "malignmark",
@@ -8753,27 +8776,27 @@ var ra = me([
8753
8776
  "xlink:title",
8754
8777
  "xml:space",
8755
8778
  "xmlns:xlink"
8756
- ]), ng = De(/\{\{[\w\W]*|[\w\W]*\}\}/gm), ig = De(/<%[\w\W]*|[\w\W]*%>/gm), og = De(/\$\{[\w\W]*/gm), sg = De(/^data-[\-\w.\u00B7-\uFFFF]+$/), ag = De(/^aria-[\-\w]+$/), cc = De(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), lg = De(/^(?:\w+script|data):/i), cg = De(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), uc = De(/^html$/i), ug = De(/^[a-z][.\w]*(-[.\w]+)+$/i), sa = /* @__PURE__ */ Object.freeze({
8779
+ ]), ag = De(/\{\{[\w\W]*|[\w\W]*\}\}/gm), lg = De(/<%[\w\W]*|[\w\W]*%>/gm), cg = De(/\$\{[\w\W]*/gm), ug = De(/^data-[\-\w.\u00B7-\uFFFF]+$/), fg = De(/^aria-[\-\w]+$/), uc = De(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), dg = De(/^(?:\w+script|data):/i), hg = De(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), fc = De(/^html$/i), pg = De(/^[a-z][.\w]*(-[.\w]+)+$/i), sa = /* @__PURE__ */ Object.freeze({
8757
8780
  __proto__: null,
8758
- ARIA_ATTR: ag,
8759
- ATTR_WHITESPACE: cg,
8760
- CUSTOM_ELEMENT: ug,
8761
- DATA_ATTR: sg,
8762
- DOCTYPE_NAME: uc,
8763
- ERB_EXPR: ig,
8764
- IS_ALLOWED_URI: cc,
8765
- IS_SCRIPT_OR_DATA: lg,
8766
- MUSTACHE_EXPR: ng,
8767
- TMPLIT_EXPR: og
8781
+ ARIA_ATTR: fg,
8782
+ ATTR_WHITESPACE: hg,
8783
+ CUSTOM_ELEMENT: pg,
8784
+ DATA_ATTR: ug,
8785
+ DOCTYPE_NAME: fc,
8786
+ ERB_EXPR: lg,
8787
+ IS_ALLOWED_URI: uc,
8788
+ IS_SCRIPT_OR_DATA: dg,
8789
+ MUSTACHE_EXPR: ag,
8790
+ TMPLIT_EXPR: cg
8768
8791
  }), Gr = {
8769
8792
  element: 1,
8770
8793
  text: 3,
8771
8794
  progressingInstruction: 7,
8772
8795
  comment: 8,
8773
8796
  document: 9
8774
- }, fg = function() {
8797
+ }, gg = function() {
8775
8798
  return typeof window > "u" ? null : window;
8776
- }, dg = function(t, r) {
8799
+ }, mg = function(t, r) {
8777
8800
  if (typeof t != "object" || typeof t.createPolicy != "function") return null;
8778
8801
  let n = null;
8779
8802
  const i = "data-tt-policy-suffix";
@@ -8804,13 +8827,13 @@ var ra = me([
8804
8827
  uponSanitizeShadowNode: []
8805
8828
  };
8806
8829
  };
8807
- function fc() {
8808
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : fg();
8809
- const t = (A) => fc(A);
8830
+ function dc() {
8831
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : gg();
8832
+ const t = (A) => dc(A);
8810
8833
  if (t.version = "3.4.0", t.removed = [], !e || !e.document || e.document.nodeType !== Gr.document || !e.Element)
8811
8834
  return t.isSupported = !1, t;
8812
8835
  let { document: r } = e;
8813
- const n = r, i = n.currentScript, { DocumentFragment: o, HTMLTemplateElement: s, Node: a, Element: l, NodeFilter: c, NamedNodeMap: u = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: f, DOMParser: h, trustedTypes: g } = e, b = l.prototype, _ = Vr(b, "cloneNode"), v = Vr(b, "remove"), T = Vr(b, "nextSibling"), I = Vr(b, "childNodes"), N = Vr(b, "parentNode");
8836
+ const n = r, i = n.currentScript, { DocumentFragment: o, HTMLTemplateElement: s, Node: a, Element: l, NodeFilter: c, NamedNodeMap: u = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: f, DOMParser: h, trustedTypes: g } = e, v = l.prototype, _ = Vr(v, "cloneNode"), b = Vr(v, "remove"), T = Vr(v, "nextSibling"), I = Vr(v, "childNodes"), N = Vr(v, "parentNode");
8814
8837
  if (typeof s == "function") {
8815
8838
  const A = r.createElement("template");
8816
8839
  A.content && A.content.ownerDocument && (r = A.content.ownerDocument);
@@ -8818,7 +8841,7 @@ function fc() {
8818
8841
  let w, F = "";
8819
8842
  const { implementation: B, createNodeIterator: se, createDocumentFragment: ee, getElementsByTagName: it } = r, { importNode: J } = n;
8820
8843
  let Q = aa();
8821
- t.isSupported = typeof lc == "function" && typeof N == "function" && B && B.createHTMLDocument !== void 0;
8844
+ t.isSupported = typeof cc == "function" && typeof N == "function" && B && B.createHTMLDocument !== void 0;
8822
8845
  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 } = sa;
8823
8846
  let { IS_ALLOWED_URI: ar } = sa, Y = null;
8824
8847
  const pn = R({}, [
@@ -8926,7 +8949,7 @@ function fc() {
8926
8949
  "xmlns"
8927
8950
  ]), bn = "http://www.w3.org/1998/Math/MathML", yn = "http://www.w3.org/2000/svg", Ye = "http://www.w3.org/1999/xhtml";
8928
8951
  let pr = Ye, pi = !1, gi = null;
8929
- const _c = R({}, [
8952
+ const Tc = R({}, [
8930
8953
  bn,
8931
8954
  yn,
8932
8955
  Ye
@@ -8938,7 +8961,7 @@ function fc() {
8938
8961
  "ms",
8939
8962
  "mtext"
8940
8963
  ]), Tn = R({}, ["annotation-xml"]);
8941
- const Tc = R({}, [
8964
+ const wc = R({}, [
8942
8965
  "title",
8943
8966
  "style",
8944
8967
  "font",
@@ -8946,14 +8969,14 @@ function fc() {
8946
8969
  "script"
8947
8970
  ]);
8948
8971
  let Hr = null;
8949
- const wc = ["application/xhtml+xml", "text/html"], Sc = "text/html";
8972
+ const Sc = ["application/xhtml+xml", "text/html"], kc = "text/html";
8950
8973
  let te = null, gr = null;
8951
- const kc = r.createElement("form"), Qo = function(d) {
8974
+ const Ec = r.createElement("form"), Qo = function(d) {
8952
8975
  return d instanceof RegExp || d instanceof Function;
8953
8976
  }, mi = function() {
8954
8977
  let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
8955
8978
  if (!(gr && gr === d)) {
8956
- if ((!d || typeof d != "object") && (d = {}), d = Xe(d), Hr = wc.indexOf(d.PARSER_MEDIA_TYPE) === -1 ? Sc : d.PARSER_MEDIA_TYPE, te = Hr === "application/xhtml+xml" ? $i : Hn, 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, $i) : _c, 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 || cc, 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({}, na), Z = en(null), At.html === !0 && (R(Y, ra), R(Z, ia)), At.svg === !0 && (R(Y, Hi), R(Z, Fi), R(Z, On)), At.svgFilters === !0 && (R(Y, zi), R(Z, Fi), R(Z, On)), At.mathMl === !0 && (R(Y, Wi), R(Z, oa), 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, [
8979
+ if ((!d || typeof d != "object") && (d = {}), d = Xe(d), Hr = Sc.indexOf(d.PARSER_MEDIA_TYPE) === -1 ? kc : d.PARSER_MEDIA_TYPE, te = Hr === "application/xhtml+xml" ? $i : Hn, 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, $i) : Tc, 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 || uc, 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({}, na), Z = en(null), At.html === !0 && (R(Y, ra), R(Z, ia)), At.svg === !0 && (R(Y, Hi), R(Z, Fi), R(Z, On)), At.svgFilters === !0 && (R(Y, zi), R(Z, Fi), R(Z, On)), At.mathMl === !0 && (R(Y, Wi), R(Z, oa), 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, [
8957
8980
  "html",
8958
8981
  "head",
8959
8982
  "body"
@@ -8962,27 +8985,27 @@ function fc() {
8962
8985
  if (typeof d.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw qr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
8963
8986
  w = d.TRUSTED_TYPES_POLICY, F = w.createHTML("");
8964
8987
  } else
8965
- w === void 0 && (w = dg(g, i)), w !== null && typeof F == "string" && (F = w.createHTML(""));
8988
+ w === void 0 && (w = mg(g, i)), w !== null && typeof F == "string" && (F = w.createHTML(""));
8966
8989
  me && me(d), gr = d;
8967
8990
  }
8968
8991
  }, Zo = R({}, [
8969
8992
  ...Hi,
8970
8993
  ...zi,
8971
- ...tg
8972
- ]), es = R({}, [...Wi, ...rg]), Ec = function(d) {
8994
+ ...og
8995
+ ]), es = R({}, [...Wi, ...sg]), Ac = function(d) {
8973
8996
  let y = N(d);
8974
8997
  (!y || !y.tagName) && (y = {
8975
8998
  namespaceURI: pr,
8976
8999
  tagName: "template"
8977
9000
  });
8978
9001
  const E = Hn(d.tagName), V = Hn(y.tagName);
8979
- 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] && (Tc[E] || !Zo[E]) : !!(Hr === "application/xhtml+xml" && gi[d.namespaceURI]) : !1;
9002
+ 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] && (wc[E] || !Zo[E]) : !!(Hr === "application/xhtml+xml" && gi[d.namespaceURI]) : !1;
8980
9003
  }, ze = function(d) {
8981
9004
  jr(t.removed, { element: d });
8982
9005
  try {
8983
9006
  N(d).removeChild(d);
8984
9007
  } catch {
8985
- v(d);
9008
+ b(d);
8986
9009
  }
8987
9010
  }, $t = function(d, y) {
8988
9011
  try {
@@ -9063,7 +9086,7 @@ function fc() {
9063
9086
  }
9064
9087
  return ze(d), !0;
9065
9088
  }
9066
- return d instanceof l && !Ec(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([
9089
+ return d instanceof l && !Ac(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([
9067
9090
  St,
9068
9091
  sr,
9069
9092
  k
@@ -9071,7 +9094,7 @@ function fc() {
9071
9094
  y = br(y, V, " ");
9072
9095
  }), d.textContent !== y && (jr(t.removed, { element: d.cloneNode() }), d.textContent = y)), lt(Q.afterSanitizeElements, d, null), !1);
9073
9096
  }, is = function(d, y, E) {
9074
- if (cr[y] || hr && (y === "id" || y === "name") && (E in r || E in kc)) return !1;
9097
+ if (cr[y] || hr && (y === "id" || y === "name") && (E in r || E in Ec)) return !1;
9075
9098
  if (!(st && !cr[y] && de(x, y))) {
9076
9099
  if (!(gn && de(z, y))) {
9077
9100
  if (!(Ve.attributeCheck instanceof Function && Ve.attributeCheck(y, d))) {
@@ -9079,7 +9102,7 @@ function fc() {
9079
9102
  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;
9080
9103
  } else if (!hi[y]) {
9081
9104
  if (!de(ar, br(E, ot, ""))) {
9082
- if (!((y === "src" || y === "xlink:href" || y === "href") && d !== "script" && Jp(E, "data:") === 0 && Ko[d])) {
9105
+ if (!((y === "src" || y === "xlink:href" || y === "href") && d !== "script" && tg(E, "data:") === 0 && Ko[d])) {
9083
9106
  if (!(ur && !de(ae, br(E, ot, "")))) {
9084
9107
  if (E) return !1;
9085
9108
  }
@@ -9106,7 +9129,7 @@ function fc() {
9106
9129
  let V = y.length;
9107
9130
  for (; V--; ) {
9108
9131
  const { name: U, namespaceURI: Ae, value: xe } = y[V], ie = te(U), zr = xe;
9109
- let le = U === "value" ? zr : Qp(zr);
9132
+ let le = U === "value" ? zr : rg(zr);
9110
9133
  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)) {
9111
9134
  $t(U, d);
9112
9135
  continue;
@@ -9198,7 +9221,7 @@ function fc() {
9198
9221
  return (Z.shadowroot || Z.shadowrootmode) && (U = J.call(n, U, !0)), U;
9199
9222
  }
9200
9223
  let xe = Ge ? y.outerHTML : y.innerHTML;
9201
- return Ge && Y["!doctype"] && y.ownerDocument && y.ownerDocument.doctype && y.ownerDocument.doctype.name && de(uc, y.ownerDocument.doctype.name) && (xe = "<!DOCTYPE " + y.ownerDocument.doctype.name + `>
9224
+ return Ge && Y["!doctype"] && y.ownerDocument && y.ownerDocument.doctype && y.ownerDocument.doctype.name && de(fc, y.ownerDocument.doctype.name) && (xe = "<!DOCTYPE " + y.ownerDocument.doctype.name + `>
9202
9225
  ` + xe), ne && Ur([
9203
9226
  St,
9204
9227
  sr,
@@ -9216,8 +9239,8 @@ function fc() {
9216
9239
  typeof d == "function" && jr(Q[A], d);
9217
9240
  }, t.removeHook = function(A, d) {
9218
9241
  if (d !== void 0) {
9219
- const y = Kp(Q[A], d);
9220
- return y === -1 ? void 0 : Xp(Q[A], y, 1)[0];
9242
+ const y = Zp(Q[A], d);
9243
+ return y === -1 ? void 0 : eg(Q[A], y, 1)[0];
9221
9244
  }
9222
9245
  return ta(Q[A]);
9223
9246
  }, t.removeHooks = function(A) {
@@ -9226,7 +9249,7 @@ function fc() {
9226
9249
  Q = aa();
9227
9250
  }, t;
9228
9251
  }
9229
- var Yg = fc(), So;
9252
+ var Qg = dc(), So;
9230
9253
  (function(e) {
9231
9254
  e.player = "player.js", e.clientPlayer = "client-player.js", e.editor = "editor.js";
9232
9255
  })(So || (So = {}));
@@ -9234,7 +9257,7 @@ var la;
9234
9257
  (function(e) {
9235
9258
  e.loading = "loading", e.loaded = "loaded";
9236
9259
  })(la || (la = {}));
9237
- var Kg = qp.timeoutMs, ca;
9260
+ var Zg = Kp.timeoutMs, ca;
9238
9261
  (function(e) {
9239
9262
  e.SAVE = "save", e.MODEL = "model", e.SCORE = "score", e.MANUAL_SCORE = "manual-score";
9240
9263
  })(ca || (ca = {}));
@@ -9250,9 +9273,9 @@ var da;
9250
9273
  (function(e) {
9251
9274
  e.PENDING = "pending", e.IN_PROGRESS = "in_progress", e.COMPLETED = "completed", e.FAILED = "failed";
9252
9275
  })(da || (da = {}));
9253
- var hg = class dc extends CustomEvent {
9276
+ var vg = class hc extends CustomEvent {
9254
9277
  constructor(t, r = !1) {
9255
- super(dc.TYPE, {
9278
+ super(hc.TYPE, {
9256
9279
  bubbles: !0,
9257
9280
  detail: {
9258
9281
  update: t,
@@ -9261,10 +9284,10 @@ var hg = class dc extends CustomEvent {
9261
9284
  }), m(this, "update", void 0), m(this, "reset", void 0), this.update = t, this.reset = r;
9262
9285
  }
9263
9286
  };
9264
- m(hg, "TYPE", "model.updated");
9265
- var pg = class hc extends CustomEvent {
9287
+ m(vg, "TYPE", "model.updated");
9288
+ var bg = class pc extends CustomEvent {
9266
9289
  constructor(t, r) {
9267
- super(hc.TYPE, {
9290
+ super(pc.TYPE, {
9268
9291
  bubbles: !0,
9269
9292
  detail: {
9270
9293
  src: t,
@@ -9273,19 +9296,19 @@ var pg = class hc extends CustomEvent {
9273
9296
  }), m(this, "src", void 0), m(this, "done", void 0), this.src = t, this.done = r;
9274
9297
  }
9275
9298
  };
9276
- m(pg, "TYPE", "delete.image");
9277
- var gg = class pc extends CustomEvent {
9299
+ m(bg, "TYPE", "delete.image");
9300
+ var yg = class gc extends CustomEvent {
9278
9301
  constructor(t) {
9279
- super(pc.TYPE, {
9302
+ super(gc.TYPE, {
9280
9303
  bubbles: !0,
9281
9304
  detail: t
9282
9305
  }), m(this, "handler", void 0), this.handler = t;
9283
9306
  }
9284
9307
  };
9285
- m(gg, "TYPE", "insert.image");
9286
- var mg = class gc extends CustomEvent {
9308
+ m(yg, "TYPE", "insert.image");
9309
+ var _g = class mc extends CustomEvent {
9287
9310
  constructor(t, r) {
9288
- super(gc.TYPE, {
9311
+ super(mc.TYPE, {
9289
9312
  bubbles: !0,
9290
9313
  detail: {
9291
9314
  src: t,
@@ -9294,19 +9317,19 @@ var mg = class gc extends CustomEvent {
9294
9317
  }), m(this, "src", void 0), m(this, "done", void 0), this.src = t, this.done = r;
9295
9318
  }
9296
9319
  };
9297
- m(mg, "TYPE", "delete.sound");
9298
- var vg = class mc extends CustomEvent {
9320
+ m(_g, "TYPE", "delete.sound");
9321
+ var Tg = class vc extends CustomEvent {
9299
9322
  constructor(t) {
9300
- super(mc.TYPE, {
9323
+ super(vc.TYPE, {
9301
9324
  bubbles: !0,
9302
9325
  detail: t
9303
9326
  }), m(this, "handler", void 0), this.handler = t;
9304
9327
  }
9305
9328
  };
9306
- m(vg, "TYPE", "insert.sound");
9307
- var bg = class vc extends CustomEvent {
9329
+ m(Tg, "TYPE", "insert.sound");
9330
+ var wg = class bc extends CustomEvent {
9308
9331
  constructor(t, r) {
9309
- super(vc.TYPE, {
9332
+ super(bc.TYPE, {
9310
9333
  bubbles: !0,
9311
9334
  composed: !0,
9312
9335
  detail: {
@@ -9316,7 +9339,7 @@ var bg = class vc extends CustomEvent {
9316
9339
  }), m(this, "component", void 0), m(this, "complete", void 0), this.component = t, this.complete = r;
9317
9340
  }
9318
9341
  };
9319
- m(bg, "TYPE", "session-changed");
9342
+ m(wg, "TYPE", "session-changed");
9320
9343
  var ha;
9321
9344
  (function(e) {
9322
9345
  e[e.ROOT = 0] = "ROOT", e[e.SUBJECT = 1] = "SUBJECT", e[e.LEVEL = 2] = "LEVEL", e[e.STANDARD = 3] = "STANDARD";
@@ -9335,19 +9358,19 @@ function Tt(e, t) {
9335
9358
  function wt() {
9336
9359
  return typeof window < "u" && window.PIE_DEBUG === !0;
9337
9360
  }
9338
- var Xg = Tt("math-rendering", () => wt()), Jg = Tt("pie-scoring", () => wt()), Qg = Tt("pie-updates", () => wt()), Zg = Tt("pie-initialization", () => wt()), em = {
9339
- buildServiceBase: jp,
9361
+ var em = Tt("math-rendering", () => wt()), tm = Tt("pie-scoring", () => wt()), rm = Tt("pie-updates", () => wt()), nm = Tt("pie-initialization", () => wt()), im = {
9362
+ buildServiceBase: Yp,
9340
9363
  bundleType: So.player,
9341
9364
  env: {
9342
9365
  mode: "gather",
9343
9366
  role: "student"
9344
9367
  }
9345
- }, tm = Tt("asset-handler", () => wt()), rm = Tt("authoring", () => wt()), nm = Tt("instrumentation-event-bridge", () => wt()), im = Tt("instrumentation-provider-resolution", () => wt()), om = Object.freeze([
9368
+ }, om = Tt("asset-handler", () => wt()), sm = Tt("authoring", () => wt()), am = Tt("instrumentation-event-bridge", () => wt()), lm = Tt("instrumentation-provider-resolution", () => wt()), cm = Object.freeze([
9346
9369
  "composed",
9347
9370
  "engine-ready",
9348
9371
  "interactive",
9349
9372
  "disposed"
9350
- ]), sm = Tt("pie-overrides", () => wt()), bc = [
9373
+ ]), um = Tt("pie-overrides", () => wt()), yc = [
9351
9374
  "a[href]",
9352
9375
  "button:not([disabled])",
9353
9376
  "input:not([disabled]):not([type='hidden'])",
@@ -9356,19 +9379,19 @@ var Xg = Tt("math-rendering", () => wt()), Jg = Tt("pie-scoring", () => wt()), Q
9356
9379
  "[contenteditable]:not([contenteditable='false'])",
9357
9380
  "[tabindex]:not([tabindex='-1'])"
9358
9381
  ].join(",");
9359
- function yg(e) {
9360
- return !e.matches(bc) || e.hasAttribute("disabled") || e.closest("[inert]") ? !1 : e.offsetParent !== null || e.getClientRects().length > 0;
9382
+ function Sg(e) {
9383
+ return !e.matches(yc) || e.hasAttribute("disabled") || e.closest("[inert]") ? !1 : e.offsetParent !== null || e.getClientRects().length > 0;
9361
9384
  }
9362
- function yc(e) {
9363
- return Array.from(e.querySelectorAll(bc)).filter((t) => yg(t));
9385
+ function _c(e) {
9386
+ return Array.from(e.querySelectorAll(yc)).filter((t) => Sg(t));
9364
9387
  }
9365
- function _g(e, t) {
9388
+ function kg(e, t) {
9366
9389
  try {
9367
9390
  if (t && e.contains(t)) {
9368
9391
  t.focus();
9369
9392
  return;
9370
9393
  }
9371
- const r = yc(e);
9394
+ const r = _c(e);
9372
9395
  if (r.length > 0) {
9373
9396
  r[0].focus();
9374
9397
  return;
@@ -9377,14 +9400,14 @@ function _g(e, t) {
9377
9400
  } catch {
9378
9401
  }
9379
9402
  }
9380
- function Tg(e, t = {}) {
9403
+ function Eg(e, t = {}) {
9381
9404
  const r = typeof document < "u" ? document.activeElement : null, n = t.wrap ?? !0, i = (o) => {
9382
9405
  if (o.key === "Escape") {
9383
9406
  t.onEscape?.();
9384
9407
  return;
9385
9408
  }
9386
9409
  if (o.key !== "Tab") return;
9387
- const s = yc(e);
9410
+ const s = _c(e);
9388
9411
  if (!s.length) {
9389
9412
  if (!n) return;
9390
9413
  o.preventDefault(), e.focus?.();
@@ -9397,7 +9420,7 @@ function Tg(e, t = {}) {
9397
9420
  }
9398
9421
  l === s.length - 1 && (n ? (o.preventDefault(), s[0].focus()) : t.onTabExit?.("forward", o));
9399
9422
  };
9400
- return queueMicrotask(() => _g(e, t.initialFocus)), e.addEventListener("keydown", i), () => {
9423
+ return queueMicrotask(() => kg(e, t.initialFocus)), e.addEventListener("keydown", i), () => {
9401
9424
  e.removeEventListener("keydown", i);
9402
9425
  try {
9403
9426
  r?.focus?.();
@@ -9405,36 +9428,36 @@ function Tg(e, t = {}) {
9405
9428
  }
9406
9429
  };
9407
9430
  }
9408
- function wg(e) {
9431
+ function Ag(e) {
9409
9432
  try {
9410
9433
  return typeof localStorage > "u" ? null : localStorage.getItem(e);
9411
9434
  } catch {
9412
9435
  return null;
9413
9436
  }
9414
9437
  }
9415
- function Sg(e, t) {
9438
+ function xg(e, t) {
9416
9439
  try {
9417
9440
  if (typeof localStorage > "u") return;
9418
9441
  localStorage.setItem(e, t);
9419
9442
  } catch {
9420
9443
  }
9421
9444
  }
9422
- var kg = /* @__PURE__ */ Ku('<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>'), Eg = /* @__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>'), Ag = /* @__PURE__ */ Fo('<div class="pie-tool-color-scheme__dropdown svelte-17qy4wk" role="menu"></div>'), xg = /* @__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>'), Cg = {
9445
+ var Cg = /* @__PURE__ */ Xu('<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>'), Mg = /* @__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>'), Og = /* @__PURE__ */ Fo('<div class="pie-tool-color-scheme__dropdown svelte-17qy4wk" role="menu"></div>'), Ig = /* @__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>'), Rg = {
9423
9446
  hash: "svelte-17qy4wk",
9424
9447
  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);}
9425
9448
 
9426
9449
  /* Keyboard focus styling */.pie-tool-color-scheme__dropdown-trigger.svelte-17qy4wk:focus-visible,
9427
9450
  .pie-tool-color-scheme__option.svelte-17qy4wk:focus-visible {outline:2px solid var(--pie-primary, #3f51b5);outline-offset:2px;}`
9428
9451
  };
9429
- function Mg(e, t) {
9430
- Sa(t, !0), ff(e, Cg);
9452
+ function Lg(e, t) {
9453
+ Sa(t, !0), df(e, Rg);
9431
9454
  const r = typeof window < "u";
9432
9455
  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);
9433
9456
  const c = /* @__PURE__ */ _i(() => S(l)?.toolCoordinator);
9434
9457
  let u = /* @__PURE__ */ ke(!1);
9435
9458
  wr(() => {
9436
9459
  if (S(a))
9437
- return If(S(a), (k) => {
9460
+ return Rf(S(a), (k) => {
9438
9461
  oe(l, k, !0);
9439
9462
  });
9440
9463
  });
@@ -9466,7 +9489,7 @@ function Mg(e, t) {
9466
9489
  } : h(typeof x.variables == "object" && x.variables ? x.variables : void 0, f)
9467
9490
  };
9468
9491
  }
9469
- function b(k) {
9492
+ function v(k) {
9470
9493
  if (!k?.trim()) return [];
9471
9494
  try {
9472
9495
  const x = JSON.parse(k);
@@ -9481,8 +9504,8 @@ function Mg(e, t) {
9481
9504
  const x = document.querySelector('pie-theme[scope="document"]');
9482
9505
  return x || document.querySelector("pie-theme");
9483
9506
  }
9484
- function v() {
9485
- return Rp().map((k) => ({
9507
+ function b() {
9508
+ return $p().map((k) => ({
9486
9509
  id: k.id,
9487
9510
  name: k.name || k.id,
9488
9511
  description: k.description || "",
@@ -9494,9 +9517,9 @@ function Mg(e, t) {
9494
9517
  const z = s().map((ae) => g(ae)).filter((ae) => !!ae);
9495
9518
  if (z.length > 0) return z;
9496
9519
  }
9497
- const k = b(o());
9520
+ const k = v(o());
9498
9521
  if (k.length > 0) return k;
9499
- const x = v();
9522
+ const x = b();
9500
9523
  return x.length > 0 ? x : [{
9501
9524
  id: "default",
9502
9525
  name: "Default",
@@ -9513,7 +9536,7 @@ function Mg(e, t) {
9513
9536
  const z = document.documentElement;
9514
9537
  k === "default" ? z.removeAttribute("data-color-scheme") : z.setAttribute("data-color-scheme", k);
9515
9538
  }
9516
- Sg("pie-color-scheme", k);
9539
+ xg("pie-color-scheme", k);
9517
9540
  }
9518
9541
  function B(k) {
9519
9542
  oe(I, k, !0), F(k), S(c)?.hideTool(i());
@@ -9547,10 +9570,10 @@ function Mg(e, t) {
9547
9570
  }), wr(() => {
9548
9571
  S(c) && S(a) && i() && S(c).updateToolElement(i(), S(a));
9549
9572
  }), wr(() => {
9550
- !n() && w ? (w(), w = null) : n() && S(a) && !w && (w = Tg(S(a)));
9551
- }), of(() => {
9573
+ !n() && w ? (w(), w = null) : n() && S(a) && !w && (w = Eg(S(a)));
9574
+ }), sf(() => {
9552
9575
  if (r) {
9553
- const x = _()?.getAttribute("scheme"), z = wg("pie-color-scheme") ?? x ?? "default";
9576
+ const x = _()?.getAttribute("scheme"), z = Ag("pie-color-scheme") ?? x ?? "default";
9554
9577
  oe(I, z, !0), z && requestAnimationFrame(() => {
9555
9578
  F(z);
9556
9579
  });
@@ -9589,17 +9612,17 @@ function Mg(e, t) {
9589
9612
  set schemeCatalog(k = null) {
9590
9613
  s(k), Jr();
9591
9614
  }
9592
- }, Q = Xu(), St = Lu(Q), sr = (k) => {
9593
- var x = xg(), z = fe(x), ae = ct(fe(z), 2), ot = fe(ae), be = fe(ot), ar = fe(be), Y = fe(ar), pn = ct(Y, 2);
9615
+ }, Q = Ju(), St = Pu(Q), sr = (k) => {
9616
+ var x = Ig(), z = fe(x), ae = ct(fe(z), 2), ot = fe(ae), be = fe(ot), ar = fe(be), Y = fe(ar), pn = ct(Y, 2);
9594
9617
  ce(ar), ce(be);
9595
9618
  var Z = ct(be, 2), lr = fe(Z), j = fe(lr, !0);
9596
9619
  ce(lr);
9597
9620
  var kt = ct(lr, 2), cr = fe(kt, !0);
9598
9621
  ce(kt), ce(Z), ya(2), ce(ot), ce(ae);
9599
9622
  var Ve = ct(ae, 2), gn = (st) => {
9600
- var ur = Ag();
9601
- lf(ur, 21, () => S(T), (fr) => fr.id, (fr, ne) => {
9602
- var we = Eg();
9623
+ var ur = Og();
9624
+ cf(ur, 21, () => S(T), (fr) => fr.id, (fr, ne) => {
9625
+ var we = Mg();
9603
9626
  let Ge;
9604
9627
  var Lt = fe(we), Pt = fe(Lt), at = fe(Pt), dr = ct(at, 2);
9605
9628
  ce(Pt), ce(Lt);
@@ -9608,19 +9631,19 @@ function Mg(e, t) {
9608
9631
  var vn = ct(hr, 2), $r = fe(vn, !0);
9609
9632
  ce(vn), ce(Et);
9610
9633
  var Nt = ct(Et, 2), At = (ye) => {
9611
- var Dr = kg();
9634
+ var Dr = Cg();
9612
9635
  Sr(ye, Dr);
9613
9636
  };
9614
9637
  ki(Nt, (ye) => {
9615
9638
  S(I) === S(ne).id && ye(At);
9616
9639
  }), ce(we), Ts(() => {
9617
- Ge = pf(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);
9640
+ Ge = gf(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);
9618
9641
  }), Ti("click", we, () => B(S(ne).id)), Sr(fr, we);
9619
9642
  }), ce(ur), Sr(st, ur);
9620
9643
  };
9621
9644
  ki(Ve, (st) => {
9622
9645
  S(N) && st(gn);
9623
- }), ce(z), ce(x), Tf(x, (st) => oe(a, st), () => S(a)), Ts(() => {
9646
+ }), ce(z), ce(x), wf(x, (st) => oe(a, st), () => S(a)), Ts(() => {
9624
9647
  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);
9625
9648
  }), Ti("keydown", x, it), Ti("click", ae, se), Sr(k, x);
9626
9649
  };
@@ -9628,8 +9651,8 @@ function Mg(e, t) {
9628
9651
  n() && k(sr);
9629
9652
  }), Sr(e, Q), ka(J);
9630
9653
  }
9631
- qu(["keydown", "click"]);
9632
- customElements.define("pie-tool-theme", Ef(Mg, {
9654
+ Vu(["keydown", "click"]);
9655
+ customElements.define("pie-tool-theme", Af(Lg, {
9633
9656
  visible: {
9634
9657
  attribute: "visible",
9635
9658
  type: "Boolean"
@@ -9645,7 +9668,7 @@ customElements.define("pie-tool-theme", Ef(Mg, {
9645
9668
  schemeCatalog: { type: "Object" }
9646
9669
  }, [], [], { mode: "open" }));
9647
9670
  export {
9648
- Mg as default,
9649
- Rg as n,
9650
- Ig as t
9671
+ Lg as default,
9672
+ $g as n,
9673
+ Ng as t
9651
9674
  };