@pie-players/pie-tool-answer-eliminator 0.3.49 → 0.3.50

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,30 +1,30 @@
1
1
  import { t as p } from "./defineProperty-Dt7ri80W.js";
2
- var Uo = Object.create, ti = Object.defineProperty, Ko = Object.getOwnPropertyDescriptor, Xo = Object.getOwnPropertyNames, Yo = Object.getPrototypeOf, Jo = Object.prototype.hasOwnProperty, Xu = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), Qo = (e, t, n, r) => {
2
+ var Yo = Object.create, ri = Object.defineProperty, Jo = Object.getOwnPropertyDescriptor, Qo = Object.getOwnPropertyNames, Zo = Object.getPrototypeOf, es = Object.prototype.hasOwnProperty, eh = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), ts = (e, t, n, r) => {
3
3
  if (t && typeof t == "object" || typeof t == "function")
4
- for (var i = Xo(t), o = 0, s = i.length, a; o < s; o++)
5
- a = i[o], !Jo.call(e, a) && a !== n && ti(e, a, {
4
+ for (var i = Qo(t), o = 0, s = i.length, a; o < s; o++)
5
+ a = i[o], !es.call(e, a) && a !== n && ri(e, a, {
6
6
  get: ((l) => t[l]).bind(null, a),
7
- enumerable: !(r = Ko(t, a)) || r.enumerable
7
+ enumerable: !(r = Jo(t, a)) || r.enumerable
8
8
  });
9
9
  return e;
10
- }, Zo = (e, t, n) => (n = e != null ? Uo(Yo(e)) : {}, Qo(t || !e || !e.__esModule ? ti(n, "default", {
10
+ }, ns = (e, t, n) => (n = e != null ? Yo(Zo(e)) : {}, ts(t || !e || !e.__esModule ? ri(n, "default", {
11
11
  value: e,
12
12
  enumerable: !0
13
- }) : n, e)), Yu = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, n) => (typeof require < "u" ? require : t)[n] }) : e)(function(e) {
13
+ }) : n, e)), th = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, n) => (typeof require < "u" ? require : t)[n] }) : 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
  });
17
17
  if (typeof window < "u") {
18
- var gr, mr;
19
- ((gr = (mr = window).__svelte ?? (mr.__svelte = {})).v ?? (gr.v = /* @__PURE__ */ new Set())).add("5");
18
+ var mr, vr;
19
+ ((mr = (vr = window).__svelte ?? (vr.__svelte = {})).v ?? (mr.v = /* @__PURE__ */ new Set())).add("5");
20
20
  }
21
21
  var qt = {}, H = /* @__PURE__ */ Symbol("uninitialized");
22
- var es = Array.isArray, ts = Array.prototype.indexOf, Vt = Array.prototype.includes, ns = Array.from, Gt = Object.keys, Ut = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, rs = Object.prototype, is = Array.prototype, os = Object.getPrototypeOf, vr = Object.isExtensible, ss = () => {
22
+ var rs = Array.isArray, is = Array.prototype.indexOf, Vt = Array.prototype.includes, os = Array.from, Gt = Object.keys, Ut = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, ss = Object.prototype, as = Array.prototype, ls = Object.getPrototypeOf, yr = Object.isExtensible, cs = () => {
23
23
  };
24
- function as(e) {
24
+ function us(e) {
25
25
  for (var t = 0; t < e.length; t++) e[t]();
26
26
  }
27
- function ls() {
27
+ function hs() {
28
28
  var e, t;
29
29
  return {
30
30
  promise: new Promise((n, r) => {
@@ -34,51 +34,51 @@ function ls() {
34
34
  reject: t
35
35
  };
36
36
  }
37
- var Ju = 1 << 24, ae = 1024, le = 2048, Ye = 4096, ni = 8192, cs = 16384, ri = 32768, yr = 1 << 25, ii = 65536, Qu = 1 << 17, Zu = 1 << 18, Ct = 1 << 19, us = 1 << 20, xt = 65536, br = 1 << 21, eh = 1 << 22, oi = 1 << 23, St = /* @__PURE__ */ Symbol("$state"), si = /* @__PURE__ */ Symbol("legacy props"), hs = /* @__PURE__ */ Symbol("proxy path"), ds = /* @__PURE__ */ Symbol("attributes"), fs = /* @__PURE__ */ Symbol("class"), ps = /* @__PURE__ */ Symbol("style"), gs = /* @__PURE__ */ Symbol("text"), Yn = new class extends Error {
37
+ var nh = 1 << 24, ae = 1024, le = 2048, Ye = 4096, ii = 8192, ds = 16384, oi = 32768, br = 1 << 25, si = 65536, rh = 1 << 17, ih = 1 << 18, Ct = 1 << 19, fs = 1 << 20, xt = 65536, Tr = 1 << 21, oh = 1 << 22, ai = 1 << 23, St = /* @__PURE__ */ Symbol("$state"), li = /* @__PURE__ */ Symbol("legacy props"), ps = /* @__PURE__ */ Symbol("proxy path"), gs = /* @__PURE__ */ Symbol("attributes"), ms = /* @__PURE__ */ Symbol("class"), vs = /* @__PURE__ */ Symbol("style"), ys = /* @__PURE__ */ Symbol("text"), Yn = new class extends Error {
38
38
  constructor(...t) {
39
39
  super(...t), p(this, "name", "StaleReactionError"), p(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
40
40
  }
41
- }(), nh = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
42
- function ms(e) {
41
+ }(), ah = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
42
+ function bs(e) {
43
43
  throw new Error("https://svelte.dev/e/lifecycle_outside_component");
44
44
  }
45
- function vs(e) {
45
+ function Ts(e) {
46
46
  throw new Error("https://svelte.dev/e/effect_in_teardown");
47
47
  }
48
- function ys() {
48
+ function Ss() {
49
49
  throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
50
50
  }
51
- function bs(e) {
51
+ function _s(e) {
52
52
  throw new Error("https://svelte.dev/e/effect_orphan");
53
53
  }
54
- function Ts() {
54
+ function ws() {
55
55
  throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
56
56
  }
57
- function Ss() {
57
+ function ks() {
58
58
  throw new Error("https://svelte.dev/e/hydration_failed");
59
59
  }
60
- function _s(e) {
60
+ function Es(e) {
61
61
  throw new Error("https://svelte.dev/e/props_invalid_value");
62
62
  }
63
- function ws() {
63
+ function As() {
64
64
  throw new Error("https://svelte.dev/e/state_descriptors_fixed");
65
65
  }
66
- function ks() {
66
+ function Cs() {
67
67
  throw new Error("https://svelte.dev/e/state_prototype_fixed");
68
68
  }
69
- function Es() {
69
+ function xs() {
70
70
  throw new Error("https://svelte.dev/e/state_unsafe_mutation");
71
71
  }
72
- function As() {
72
+ function Is() {
73
73
  throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
74
74
  }
75
- function Cs() {
75
+ function Os() {
76
76
  console.warn("https://svelte.dev/e/derived_inert");
77
77
  }
78
- function ai(e) {
78
+ function ci(e) {
79
79
  console.warn("https://svelte.dev/e/hydration_mismatch");
80
80
  }
81
- function xs() {
81
+ function Ms() {
82
82
  console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
83
83
  }
84
84
  var re = !1;
@@ -88,19 +88,19 @@ function Lt(e) {
88
88
  var D;
89
89
  function kt(e) {
90
90
  if (e === null)
91
- throw ai(), qt;
91
+ throw ci(), qt;
92
92
  return D = e;
93
93
  }
94
- function li() {
94
+ function ui() {
95
95
  return kt(/* @__PURE__ */ dt(D));
96
96
  }
97
- function Is(e = 1) {
97
+ function Ls(e = 1) {
98
98
  if (re) {
99
99
  for (var t = e, n = D; t--; ) n = /* @__PURE__ */ dt(n);
100
100
  D = n;
101
101
  }
102
102
  }
103
- function Os(e = !0) {
103
+ function Rs(e = !0) {
104
104
  for (var t = 0, n = D; ; ) {
105
105
  if (n.nodeType === 8) {
106
106
  var r = n.data;
@@ -113,27 +113,27 @@ function Os(e = !0) {
113
113
  e && n.remove(), n = i;
114
114
  }
115
115
  }
116
- function ci(e) {
116
+ function hi(e) {
117
117
  return e === this.v;
118
118
  }
119
- function Ms(e, t) {
119
+ function $s(e, t) {
120
120
  return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
121
121
  }
122
- function ui(e) {
123
- return !Ms(e, this.v);
122
+ function di(e) {
123
+ return !$s(e, this.v);
124
124
  }
125
125
  var Ce = !1, It = !1;
126
- function Tr(e, t) {
127
- return e.label = t, Ls(e.v, t), e;
126
+ function Sr(e, t) {
127
+ return e.label = t, Ps(e.v, t), e;
128
128
  }
129
- function Ls(e, t) {
130
- return e?.[hs]?.(t), e;
129
+ function Ps(e, t) {
130
+ return e?.[ps]?.(t), e;
131
131
  }
132
132
  var L = null;
133
133
  function Kt(e) {
134
134
  L = e;
135
135
  }
136
- function hi(e, t = !1, n) {
136
+ function fi(e, t = !1, n) {
137
137
  L = {
138
138
  p: L,
139
139
  i: !1,
@@ -149,11 +149,11 @@ function hi(e, t = !1, n) {
149
149
  } : null
150
150
  };
151
151
  }
152
- function di(e) {
152
+ function pi(e) {
153
153
  var t = L, n = t.e;
154
154
  if (n !== null) {
155
155
  t.e = null;
156
- for (var r of n) Bi(r);
156
+ for (var r of n) Wi(r);
157
157
  }
158
158
  return e !== void 0 && (t.x = e), t.i = !0, L = t.p, e ?? {};
159
159
  }
@@ -161,26 +161,26 @@ function ln() {
161
161
  return !It || L !== null && L.l === null;
162
162
  }
163
163
  var $e = [];
164
- function fi() {
164
+ function gi() {
165
165
  var e = $e;
166
- $e = [], as(e);
166
+ $e = [], us(e);
167
167
  }
168
168
  function at(e) {
169
169
  if ($e.length === 0 && !_t) {
170
170
  var t = $e;
171
171
  queueMicrotask(() => {
172
- t === $e && fi();
172
+ t === $e && gi();
173
173
  });
174
174
  }
175
175
  $e.push(e);
176
176
  }
177
- function Rs() {
178
- for (; $e.length > 0; ) fi();
177
+ function Ns() {
178
+ for (; $e.length > 0; ) gi();
179
179
  }
180
- function pi(e) {
180
+ function mi(e) {
181
181
  var t = E;
182
182
  if (t === null)
183
- return k.f |= oi, e;
183
+ return k.f |= ai, e;
184
184
  if ((t.f & 32768) === 0 && (t.f & 4) === 0)
185
185
  throw e;
186
186
  it(e, t);
@@ -200,23 +200,23 @@ function it(e, t) {
200
200
  }
201
201
  throw e;
202
202
  }
203
- var $s = ~(le | Ye | ae);
203
+ var Hs = ~(le | Ye | ae);
204
204
  function P(e, t) {
205
- e.f = e.f & $s | t;
205
+ e.f = e.f & Hs | t;
206
206
  }
207
207
  function Jn(e) {
208
208
  (e.f & 512) !== 0 || e.deps === null ? P(e, ae) : P(e, Ye);
209
209
  }
210
- function gi(e) {
210
+ function vi(e) {
211
211
  if (e !== null)
212
212
  for (const t of e)
213
- (t.f & 2) === 0 || (t.f & 65536) === 0 || (t.f ^= xt, gi(t.deps));
213
+ (t.f & 2) === 0 || (t.f & 65536) === 0 || (t.f ^= xt, vi(t.deps));
214
214
  }
215
- function mi(e, t, n) {
216
- (e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && n.add(e), gi(e.deps), P(e, ae);
215
+ function yi(e, t, n) {
216
+ (e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && n.add(e), vi(e.deps), P(e, ae);
217
217
  }
218
- var Ps = !1, Rt = !1;
219
- function Ns(e) {
218
+ var Bs = !1, Rt = !1;
219
+ function zs(e) {
220
220
  var t = Rt;
221
221
  try {
222
222
  return Rt = !1, [e(), Rt];
@@ -224,14 +224,14 @@ function Ns(e) {
224
224
  Rt = t;
225
225
  }
226
226
  }
227
- function vi(e, t) {
227
+ function bi(e, t) {
228
228
  if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
229
229
  }
230
230
  function Qn(e, t) {
231
- vi(e, t), t.add(e);
231
+ bi(e, t), t.add(e);
232
232
  }
233
233
  function w(e, t, n) {
234
- vi(e, t), t.set(e, n);
234
+ bi(e, t), t.set(e, n);
235
235
  }
236
236
  function _(e, t, n) {
237
237
  if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
@@ -243,10 +243,10 @@ function T(e, t, n) {
243
243
  function d(e, t) {
244
244
  return e.get(_(e, t));
245
245
  }
246
- var yi, Xt = null, et = null, x = null, An = null, W = null, Cn = null, _t = !1, vn = !1, lt = null, Yt = null, bi = 0;
247
- var Hs = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap(), Bt = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakSet(), ht = class Ti {
246
+ var Ti, Xt = null, et = null, x = null, An = null, W = null, Cn = null, _t = !1, vn = !1, lt = null, Yt = null, Si = 0;
247
+ var Ws = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap(), Bt = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakSet(), ht = class _i {
248
248
  constructor() {
249
- Qn(this, R), p(this, "id", Hs++), w(this, Jt, !1), p(this, "linked", !0), w(this, ze, null), w(this, Pe, null), p(this, "async_deriveds", /* @__PURE__ */ new Map()), p(this, "current", /* @__PURE__ */ new Map()), p(this, "previous", /* @__PURE__ */ new Map()), w(this, Qt, /* @__PURE__ */ new Set()), w(this, $t, /* @__PURE__ */ new Set()), w(this, tt, 0), w(this, Le, /* @__PURE__ */ new Map()), w(this, mt, null), w(this, J, []), w(this, xn, []), w(this, Ge, /* @__PURE__ */ new Set()), w(this, me, /* @__PURE__ */ new Set()), w(this, Ae, /* @__PURE__ */ new Map()), w(this, Bt, /* @__PURE__ */ new Set()), p(this, "is_fork", !1), w(this, vt, !1), et === null ? Xt = et = this : (T(Pe, et, this), T(ze, this, et)), et = this;
249
+ Qn(this, R), p(this, "id", Ws++), w(this, Jt, !1), p(this, "linked", !0), w(this, ze, null), w(this, Pe, null), p(this, "async_deriveds", /* @__PURE__ */ new Map()), p(this, "current", /* @__PURE__ */ new Map()), p(this, "previous", /* @__PURE__ */ new Map()), w(this, Qt, /* @__PURE__ */ new Set()), w(this, $t, /* @__PURE__ */ new Set()), w(this, tt, 0), w(this, Le, /* @__PURE__ */ new Map()), w(this, mt, null), w(this, J, []), w(this, xn, []), w(this, Ge, /* @__PURE__ */ new Set()), w(this, me, /* @__PURE__ */ new Set()), w(this, Ae, /* @__PURE__ */ new Map()), w(this, Bt, /* @__PURE__ */ new Set()), p(this, "is_fork", !1), w(this, vt, !1), et === null ? Xt = et = this : (T(Pe, et, this), T(ze, this, et)), et = this;
250
250
  }
251
251
  skip_effect(t) {
252
252
  d(Ae, this).has(t) || d(Ae, this).set(t, {
@@ -278,7 +278,7 @@ var Hs = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap
278
278
  try {
279
279
  vn = !0, x = this, _(R, this, Zt).call(this);
280
280
  } finally {
281
- bi = 0, Cn = null, lt = null, Yt = null, vn = !1, x = null, W = null, De.clear();
281
+ Si = 0, Cn = null, lt = null, Yt = null, vn = !1, x = null, W = null, De.clear();
282
282
  }
283
283
  }
284
284
  discard() {
@@ -315,11 +315,11 @@ var Hs = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap
315
315
  d($t, this).add(t);
316
316
  }
317
317
  settled() {
318
- return (d(mt, this) ?? T(mt, this, ls())).promise;
318
+ return (d(mt, this) ?? T(mt, this, hs())).promise;
319
319
  }
320
320
  static ensure() {
321
321
  if (x === null) {
322
- const t = x = new Ti();
322
+ const t = x = new _i();
323
323
  !vn && !_t && at(() => {
324
324
  d(Jt, t) || t.flush();
325
325
  });
@@ -355,7 +355,7 @@ var Hs = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap
355
355
  for (var n = t; n.parent !== null; ) {
356
356
  n = n.parent;
357
357
  var r = n.f;
358
- if (lt !== null && n === E && (Ce || (k === null || (k.f & 2) === 0) && !Ps))
358
+ if (lt !== null && n === E && (Ce || (k === null || (k.f & 2) === 0) && !Bs))
359
359
  return;
360
360
  if ((r & 96) !== 0) {
361
361
  if ((r & 1024) === 0) return;
@@ -365,8 +365,8 @@ var Hs = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap
365
365
  d(J, this).push(n);
366
366
  }
367
367
  };
368
- yi = ht;
369
- function Sr() {
368
+ Ti = ht;
369
+ function _r() {
370
370
  if (this.is_fork) return !0;
371
371
  for (const n of d(Le, this).keys()) {
372
372
  for (var e = n, t = !1; e.parent !== null; ) {
@@ -381,7 +381,7 @@ function Sr() {
381
381
  return !1;
382
382
  }
383
383
  function Zt() {
384
- T(Jt, this, !0), bi++ > 1e3 && (_(R, this, en).call(this), Fs());
384
+ T(Jt, this, !0), Si++ > 1e3 && (_(R, this, en).call(this), qs());
385
385
  for (const a of d(Ge, this))
386
386
  d(me, this).delete(a), P(a, le), this.schedule(a);
387
387
  for (const a of d(me, this))
@@ -390,36 +390,36 @@ function Zt() {
390
390
  T(J, this, []), this.apply();
391
391
  var t = lt = [], n = [], r = Yt = [];
392
392
  for (const a of e) try {
393
- _(R, this, Si).call(this, a, t, n);
393
+ _(R, this, wi).call(this, a, t, n);
394
394
  } catch (l) {
395
- throw ki(a), _(R, this, Sr).call(this) || this.discard(), l;
395
+ throw Ai(a), _(R, this, _r).call(this) || this.discard(), l;
396
396
  }
397
397
  if (x = null, r.length > 0) {
398
- var i = yi.ensure();
398
+ var i = Ti.ensure();
399
399
  for (const a of r) i.schedule(a);
400
400
  }
401
- if (lt = null, Yt = null, _(R, this, Sr).call(this)) {
401
+ if (lt = null, Yt = null, _(R, this, _r).call(this)) {
402
402
  _(R, this, yt).call(this, n), _(R, this, yt).call(this, t);
403
- for (const [a, l] of d(Ae, this)) wi(a, l);
403
+ for (const [a, l] of d(Ae, this)) Ei(a, l);
404
404
  r.length > 0 && _(R, x, Zt).call(x);
405
405
  return;
406
406
  }
407
- const o = _(R, this, Bs).call(this);
407
+ const o = _(R, this, Fs).call(this);
408
408
  if (o) {
409
- _(R, this, yt).call(this, n), _(R, this, yt).call(this, t), _(R, o, zs).call(o, this);
409
+ _(R, this, yt).call(this, n), _(R, this, yt).call(this, t), _(R, o, Ds).call(o, this);
410
410
  return;
411
411
  }
412
412
  d(Ge, this).clear(), d(me, this).clear();
413
413
  for (const a of d(Qt, this)) a(this);
414
- d(Qt, this).clear(), An = this, _r(n), _r(t), An = null, d(mt, this)?.resolve();
414
+ d(Qt, this).clear(), An = this, wr(n), wr(t), An = null, d(mt, this)?.resolve();
415
415
  var s = x;
416
- if (d(tt, this) === 0 && (d(J, this).length === 0 || s !== null) && (_(R, this, en).call(this), Ce && (_(R, this, Ws).call(this), x = s)), d(J, this).length > 0) if (s !== null) {
416
+ if (d(tt, this) === 0 && (d(J, this).length === 0 || s !== null) && (_(R, this, en).call(this), Ce && (_(R, this, js).call(this), x = s)), d(J, this).length > 0) if (s !== null) {
417
417
  const a = s;
418
418
  d(J, a).push(...d(J, this).filter((l) => !d(J, a).includes(l)));
419
419
  } else s = this;
420
420
  s !== null && _(R, s, Zt).call(s);
421
421
  }
422
- function Si(e, t, n) {
422
+ function wi(e, t, n) {
423
423
  e.f ^= ae;
424
424
  for (var r = e.first; r !== null; ) {
425
425
  var i = r.f, o = (i & 96) !== 0;
@@ -441,7 +441,7 @@ function Si(e, t, n) {
441
441
  }
442
442
  }
443
443
  }
444
- function Bs() {
444
+ function Fs() {
445
445
  for (var e = d(ze, this); e !== null; ) {
446
446
  if (!e.is_fork) {
447
447
  for (const [t, [, n]] of this.current) if (e.current.has(t) && !n) return e;
@@ -450,7 +450,7 @@ function Bs() {
450
450
  }
451
451
  return null;
452
452
  }
453
- function zs(e) {
453
+ function Ds(e) {
454
454
  for (const [n, r] of e.current)
455
455
  !this.previous.has(n) && e.previous.has(n) && this.previous.set(n, e.previous.get(n)), this.current.set(n, r);
456
456
  for (const [n, r] of e.async_deriveds) {
@@ -474,9 +474,9 @@ function zs(e) {
474
474
  this.oncommit(() => e.discard()), _(R, e, en).call(e), x = this, _(R, this, Zt).call(this);
475
475
  }
476
476
  function yt(e) {
477
- for (var t = 0; t < e.length; t += 1) mi(e[t], d(Ge, this), d(me, this));
477
+ for (var t = 0; t < e.length; t += 1) yi(e[t], d(Ge, this), d(me, this));
478
478
  }
479
- function Ws() {
479
+ function js() {
480
480
  for (let c = Xt; c !== null; c = d(Pe, c)) {
481
481
  var e = c.id < this.id, t = [];
482
482
  for (const [u, [h, f]] of this.current) {
@@ -501,7 +501,7 @@ function Ws() {
501
501
  });
502
502
  c.activate();
503
503
  var i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
504
- for (var s of t) _i(s, r, i, o);
504
+ for (var s of t) ki(s, r, i, o);
505
505
  o = /* @__PURE__ */ new Map();
506
506
  var a = [...c.current].filter(([u, h]) => {
507
507
  const f = this.current.get(u);
@@ -511,7 +511,7 @@ function Ws() {
511
511
  for (const u of d(xn, this)) (u.f & 155648) === 0 && Zn(u, a, o) && ((u.f & 4194320) !== 0 ? (P(u, le), c.schedule(u)) : d(Ge, c).add(u));
512
512
  if (d(J, c).length > 0 && !d(vt, c)) {
513
513
  c.apply();
514
- for (var l of d(J, c)) _(R, c, Si).call(c, l, [], []);
514
+ for (var l of d(J, c)) _(R, c, wi).call(c, l, [], []);
515
515
  T(J, c, []);
516
516
  }
517
517
  c.deactivate();
@@ -531,32 +531,32 @@ function pe(e) {
531
531
  try {
532
532
  var n;
533
533
  for (e && (x !== null && !x.is_fork && x.flush(), n = e()); ; ) {
534
- if (Rs(), x === null) return n;
534
+ if (Ns(), x === null) return n;
535
535
  x.flush();
536
536
  }
537
537
  } finally {
538
538
  _t = t;
539
539
  }
540
540
  }
541
- function Fs() {
541
+ function qs() {
542
542
  if (0) {
543
543
  var e;
544
544
  for (const n of x.current.keys()) for (const [r, i] of n.updated ?? [])
545
545
  var t;
546
546
  }
547
547
  try {
548
- Ts();
548
+ ws();
549
549
  } catch (n) {
550
550
  it(n, Cn);
551
551
  }
552
552
  }
553
553
  var ge = null;
554
- function _r(e) {
554
+ function wr(e) {
555
555
  var t = e.length;
556
556
  if (t !== 0) {
557
557
  for (var n = 0; n < t; ) {
558
558
  var r = e[n++];
559
- if ((r.f & 24576) === 0 && Ot(r) && (ge = /* @__PURE__ */ new Set(), ct(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Wi(r), ge?.size > 0)) {
559
+ if ((r.f & 24576) === 0 && Ot(r) && (ge = /* @__PURE__ */ new Set(), ct(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Di(r), ge?.size > 0)) {
560
560
  De.clear();
561
561
  for (const i of ge) {
562
562
  if ((i.f & 24576) !== 0) continue;
@@ -575,11 +575,11 @@ function _r(e) {
575
575
  ge = null;
576
576
  }
577
577
  }
578
- function _i(e, t, n, r) {
578
+ function ki(e, t, n, r) {
579
579
  if (!n.has(e) && (n.add(e), e.reactions !== null))
580
580
  for (const i of e.reactions) {
581
581
  const o = i.f;
582
- (o & 2) !== 0 ? _i(i, t, n, r) : (o & 4194320) !== 0 && (o & 2048) === 0 && Zn(i, t, r) && (P(i, le), er(i));
582
+ (o & 2) !== 0 ? ki(i, t, n, r) : (o & 4194320) !== 0 && (o & 2048) === 0 && Zn(i, t, r) && (P(i, le), er(i));
583
583
  }
584
584
  }
585
585
  function Zn(e, t, n) {
@@ -595,19 +595,19 @@ function Zn(e, t, n) {
595
595
  function er(e) {
596
596
  x.schedule(e);
597
597
  }
598
- function wi(e, t) {
598
+ function Ei(e, t) {
599
599
  if (!((e.f & 32) !== 0 && (e.f & 1024) !== 0)) {
600
600
  (e.f & 2048) !== 0 ? t.d.push(e) : (e.f & 4096) !== 0 && t.m.push(e), P(e, ae);
601
601
  for (var n = e.first; n !== null; )
602
- wi(n, t), n = n.next;
602
+ Ei(n, t), n = n.next;
603
603
  }
604
604
  }
605
- function ki(e) {
605
+ function Ai(e) {
606
606
  P(e, ae);
607
607
  for (var t = e.first; t !== null; )
608
- ki(t), t = t.next;
608
+ Ai(t), t = t.next;
609
609
  }
610
- function Ds(e) {
610
+ function Vs(e) {
611
611
  let t = 0, n = cn(0), r;
612
612
  return () => {
613
613
  rr() && (b(n), ir(() => (t === 0 && (r = hn(() => e(() => wt(n)))), t += 1, () => {
@@ -617,31 +617,31 @@ function Ds(e) {
617
617
  })));
618
618
  };
619
619
  }
620
- var js = ii | Ct;
621
- function qs(e, t, n, r) {
622
- new Vs(e, t, n, r);
620
+ var Gs = si | Ct;
621
+ function Us(e, t, n, r) {
622
+ new Ks(e, t, n, r);
623
623
  }
624
- var ie = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), Mn = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), wr = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakSet(), Vs = class {
624
+ var ie = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), Mn = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), kr = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakSet(), Ks = class {
625
625
  constructor(e, t, n, r) {
626
- Qn(this, B), p(this, "parent", void 0), p(this, "is_pending", !1), p(this, "transform_error", void 0), w(this, ie, void 0), w(this, In, re ? D : null), w(this, ue, void 0), w(this, Et, void 0), w(this, Q, void 0), w(this, he, null), w(this, K, null), w(this, te, null), w(this, We, null), w(this, nt, 0), w(this, Fe, 0), w(this, Pt, !1), w(this, On, /* @__PURE__ */ new Set()), w(this, Mn, /* @__PURE__ */ new Set()), w(this, Oe, null), w(this, wr, Ds(() => (T(Oe, this, cn(d(nt, this))), () => {
626
+ Qn(this, B), p(this, "parent", void 0), p(this, "is_pending", !1), p(this, "transform_error", void 0), w(this, ie, void 0), w(this, In, re ? D : null), w(this, ue, void 0), w(this, Et, void 0), w(this, Q, void 0), w(this, he, null), w(this, K, null), w(this, te, null), w(this, We, null), w(this, nt, 0), w(this, Fe, 0), w(this, Pt, !1), w(this, On, /* @__PURE__ */ new Set()), w(this, Mn, /* @__PURE__ */ new Set()), w(this, Oe, null), w(this, kr, Vs(() => (T(Oe, this, cn(d(nt, this))), () => {
627
627
  T(Oe, this, null);
628
628
  }))), T(ie, this, e), T(ue, this, t), T(Et, this, (i) => {
629
629
  var o = E;
630
630
  o.b = this, o.f |= 128, n(i);
631
- }), this.parent = E.b, this.transform_error = r ?? this.parent?.transform_error ?? ((i) => i), T(Q, this, ca(() => {
631
+ }), this.parent = E.b, this.transform_error = r ?? this.parent?.transform_error ?? ((i) => i), T(Q, this, da(() => {
632
632
  if (re) {
633
633
  const i = d(In, this);
634
- li();
634
+ ui();
635
635
  const o = i.data === "[!";
636
636
  if (i.data.startsWith("[?")) {
637
637
  const s = JSON.parse(i.data.slice(2));
638
- _(B, this, Us).call(this, s);
639
- } else o ? _(B, this, Ks).call(this) : _(B, this, Gs).call(this);
640
- } else _(B, this, Ei).call(this);
641
- }, js)), re && T(ie, this, D);
638
+ _(B, this, Ys).call(this, s);
639
+ } else o ? _(B, this, Js).call(this) : _(B, this, Xs).call(this);
640
+ } else _(B, this, Ci).call(this);
641
+ }, Gs)), re && T(ie, this, D);
642
642
  }
643
643
  defer_effect(e) {
644
- mi(e, d(On, this), d(Mn, this));
644
+ yi(e, d(On, this), d(Mn, this));
645
645
  }
646
646
  is_rendered() {
647
647
  return !this.is_pending && (!this.parent || this.parent.is_rendered());
@@ -650,50 +650,50 @@ var ie = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), ue =
650
650
  return !!d(ue, this).pending;
651
651
  }
652
652
  update_pending_count(e, t) {
653
- _(B, this, Ai).call(this, e, t), T(nt, this, d(nt, this) + e), !(!d(Oe, this) || d(Pt, this)) && (T(Pt, this, !0), at(() => {
654
- T(Pt, this, !1), d(Oe, this) && Oi(d(Oe, this), d(nt, this));
653
+ _(B, this, xi).call(this, e, t), T(nt, this, d(nt, this) + e), !(!d(Oe, this) || d(Pt, this)) && (T(Pt, this, !0), at(() => {
654
+ T(Pt, this, !1), d(Oe, this) && Li(d(Oe, this), d(nt, this));
655
655
  }));
656
656
  }
657
657
  get_effect_pending() {
658
- return d(wr, this).call(this), b(d(Oe, this));
658
+ return d(kr, this).call(this), b(d(Oe, this));
659
659
  }
660
660
  error(e) {
661
661
  if (!d(ue, this).onerror && !d(ue, this).failed) throw e;
662
662
  x?.is_fork ? (d(he, this) && x.skip_effect(d(he, this)), d(K, this) && x.skip_effect(d(K, this)), d(te, this) && x.skip_effect(d(te, this)), x.oncommit(() => {
663
- _(B, this, kr).call(this, e);
664
- })) : _(B, this, kr).call(this, e);
663
+ _(B, this, Er).call(this, e);
664
+ })) : _(B, this, Er).call(this, e);
665
665
  }
666
666
  };
667
- function Gs() {
667
+ function Xs() {
668
668
  try {
669
669
  T(he, this, Ue(() => d(Et, this).call(this, d(ie, this))));
670
670
  } catch (e) {
671
671
  this.error(e);
672
672
  }
673
673
  }
674
- function Us(e) {
674
+ function Ys(e) {
675
675
  const t = d(ue, this).failed;
676
676
  t && T(te, this, Ue(() => {
677
677
  t(d(ie, this), () => e, () => () => {
678
678
  });
679
679
  }));
680
680
  }
681
- function Ks() {
681
+ function Js() {
682
682
  const e = d(ue, this).pending;
683
683
  e && (this.is_pending = !0, T(K, this, Ue(() => e(d(ie, this)))), at(() => {
684
- var t = T(We, this, document.createDocumentFragment()), n = Pi();
684
+ var t = T(We, this, document.createDocumentFragment()), n = Hi();
685
685
  t.append(n), T(he, this, _(B, this, Ln).call(this, () => Ue(() => d(Et, this).call(this, n)))), d(Fe, this) === 0 && (d(ie, this).before(t), T(We, this, null), un(d(K, this), () => {
686
686
  T(K, this, null);
687
687
  }), _(B, this, tr).call(this, x));
688
688
  }));
689
689
  }
690
- function Ei() {
690
+ function Ci() {
691
691
  try {
692
692
  if (this.is_pending = this.has_pending_snippet(), T(Fe, this, 0), T(nt, this, 0), T(he, this, Ue(() => {
693
693
  d(Et, this).call(this, d(ie, this));
694
694
  })), d(Fe, this) > 0) {
695
695
  var e = T(We, this, document.createDocumentFragment());
696
- da(d(he, this), e);
696
+ ga(d(he, this), e);
697
697
  const t = d(ue, this).pending;
698
698
  T(K, this, Ue(() => t(d(ie, this))));
699
699
  } else _(B, this, tr).call(this, x);
@@ -710,16 +710,16 @@ function Ln(e) {
710
710
  try {
711
711
  return ht.ensure(), e();
712
712
  } catch (i) {
713
- return pi(i), null;
713
+ return mi(i), null;
714
714
  } finally {
715
715
  xe(t), de(n), Kt(r);
716
716
  }
717
717
  }
718
- function Ai(e, t) {
718
+ function xi(e, t) {
719
719
  if (!this.has_pending_snippet()) {
720
720
  if (this.parent) {
721
721
  var n;
722
- _(B, n = this.parent, Ai).call(n, e, t);
722
+ _(B, n = this.parent, xi).call(n, e, t);
723
723
  }
724
724
  return;
725
725
  }
@@ -727,20 +727,20 @@ function Ai(e, t) {
727
727
  T(K, this, null);
728
728
  }), d(We, this) && (d(ie, this).before(d(We, this)), T(We, this, null)));
729
729
  }
730
- function kr(e) {
731
- d(he, this) && (oe(d(he, this)), T(he, this, null)), d(K, this) && (oe(d(K, this)), T(K, this, null)), d(te, this) && (oe(d(te, this)), T(te, this, null)), re && (kt(d(In, this)), Is(), kt(Os()));
730
+ function Er(e) {
731
+ d(he, this) && (oe(d(he, this)), T(he, this, null)), d(K, this) && (oe(d(K, this)), T(K, this, null)), d(te, this) && (oe(d(te, this)), T(te, this, null)), re && (kt(d(In, this)), Ls(), kt(Rs()));
732
732
  var t = d(ue, this).onerror;
733
733
  let n = d(ue, this).failed;
734
734
  var r = !1, i = !1;
735
735
  const o = () => {
736
736
  if (r) {
737
- xs();
737
+ Ms();
738
738
  return;
739
739
  }
740
- r = !0, i && As(), d(te, this) !== null && un(d(te, this), () => {
740
+ r = !0, i && Is(), d(te, this) !== null && un(d(te, this), () => {
741
741
  T(te, this, null);
742
742
  }), _(B, this, Ln).call(this, () => {
743
- _(B, this, Ei).call(this);
743
+ _(B, this, Ci).call(this);
744
744
  });
745
745
  }, s = (a) => {
746
746
  try {
@@ -777,7 +777,7 @@ function tn(e) {
777
777
  ctx: L,
778
778
  deps: null,
779
779
  effects: null,
780
- equals: ci,
780
+ equals: hi,
781
781
  f: t,
782
782
  fn: e,
783
783
  reactions: null,
@@ -789,16 +789,16 @@ function tn(e) {
789
789
  };
790
790
  }
791
791
  // @__NO_SIDE_EFFECTS__
792
- function Er(e) {
792
+ function Ar(e) {
793
793
  const t = /* @__PURE__ */ tn(e);
794
- return Ce || Di(t), t;
794
+ return Ce || qi(t), t;
795
795
  }
796
796
  // @__NO_SIDE_EFFECTS__
797
- function Xs(e) {
797
+ function Qs(e) {
798
798
  const t = /* @__PURE__ */ tn(e);
799
- return t.equals = ui, t;
799
+ return t.equals = di, t;
800
800
  }
801
- function Ys(e) {
801
+ function Zs(e) {
802
802
  var t = e.effects;
803
803
  if (t !== null) {
804
804
  e.effects = null;
@@ -808,39 +808,39 @@ function Ys(e) {
808
808
  function nr(e) {
809
809
  var t, n = E, r = e.parent;
810
810
  if (!ve && r !== null && e.v !== H && (r.f & 24576) !== 0)
811
- return Cs(), e.v;
811
+ return Os(), e.v;
812
812
  xe(r);
813
813
  try {
814
- e.f &= ~xt, Ys(e), t = Gi(e);
814
+ e.f &= ~xt, Zs(e), t = Ki(e);
815
815
  } finally {
816
816
  xe(n);
817
817
  }
818
818
  return t;
819
819
  }
820
- function Ci(e) {
820
+ function Ii(e) {
821
821
  var t = nr(e);
822
- if (!e.equals(t) && (e.wv = qi(), (!x?.is_fork || e.deps === null) && (x !== null ? (x.capture(e, t, !0), An?.capture(e, t, !0)) : e.v = t, e.deps === null))) {
822
+ if (!e.equals(t) && (e.wv = Gi(), (!x?.is_fork || e.deps === null) && (x !== null ? (x.capture(e, t, !0), An?.capture(e, t, !0)) : e.v = t, e.deps === null))) {
823
823
  P(e, ae);
824
824
  return;
825
825
  }
826
826
  ve || (W !== null ? (rr() || x?.is_fork) && W.set(e, t) : Jn(e));
827
827
  }
828
- function Js(e) {
828
+ function ea(e) {
829
829
  if (e.effects !== null)
830
- for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(Yn), t.fn !== null && (t.teardown = ss), t.ac = null, At(t, 0), or(t));
830
+ for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(Yn), t.fn !== null && (t.teardown = cs), t.ac = null, At(t, 0), or(t));
831
831
  }
832
- function xi(e) {
832
+ function Oi(e) {
833
833
  if (e.effects !== null)
834
834
  for (const t of e.effects) t.teardown && t.fn !== null && ct(t);
835
835
  }
836
836
  var nn = /* @__PURE__ */ new Set(), De = /* @__PURE__ */ new Map();
837
- var Ii = !1;
837
+ var Mi = !1;
838
838
  function cn(e, t) {
839
839
  var n = {
840
840
  f: 0,
841
841
  v: e,
842
842
  reactions: null,
843
- equals: ci,
843
+ equals: hi,
844
844
  rv: 0,
845
845
  wv: 0
846
846
  };
@@ -849,23 +849,23 @@ function cn(e, t) {
849
849
  // @__NO_SIDE_EFFECTS__
850
850
  function F(e, t) {
851
851
  const n = cn(e, t);
852
- return Di(n), n;
852
+ return qi(n), n;
853
853
  }
854
854
  // @__NO_SIDE_EFFECTS__
855
- function Qs(e, t = !1, n = !0) {
855
+ function ta(e, t = !1, n = !0) {
856
856
  const r = cn(e);
857
- if (t || (r.equals = ui), It && n && L !== null && L.l !== null) {
857
+ if (t || (r.equals = di), It && n && L !== null && L.l !== null) {
858
858
  var i;
859
859
  ((i = L.l).s ?? (i.s = [])).push(r);
860
860
  }
861
861
  return r;
862
862
  }
863
863
  function M(e, t, n = !1) {
864
- k !== null && (!ne || (k.f & 131072) !== 0) && ln() && (k.f & 4325394) !== 0 && (se === null || !se.has(e)) && Es();
864
+ k !== null && (!ne || (k.f & 131072) !== 0) && ln() && (k.f & 4325394) !== 0 && (se === null || !se.has(e)) && xs();
865
865
  let r = n ? ot(t) : t;
866
- return Oi(e, r, Yt);
866
+ return Li(e, r, Yt);
867
867
  }
868
- function Oi(e, t, n = null) {
868
+ function Li(e, t, n = null) {
869
869
  if (!e.equals(t)) {
870
870
  De.set(e, ve ? t : e.v);
871
871
  var r = ht.ensure();
@@ -873,12 +873,12 @@ function Oi(e, t, n = null) {
873
873
  const i = e;
874
874
  (e.f & 2048) !== 0 && nr(i), W === null && Jn(i);
875
875
  }
876
- e.wv = qi(), Mi(e, le, n), ln() && E !== null && (E.f & 1024) !== 0 && (E.f & 96) === 0 && (Y === null ? pa([e]) : Y.push(e)), !r.is_fork && nn.size > 0 && !Ii && Zs();
876
+ e.wv = Gi(), Ri(e, le, n), ln() && E !== null && (E.f & 1024) !== 0 && (E.f & 96) === 0 && (Y === null ? va([e]) : Y.push(e)), !r.is_fork && nn.size > 0 && !Mi && na();
877
877
  }
878
878
  return t;
879
879
  }
880
- function Zs() {
881
- Ii = !1;
880
+ function na() {
881
+ Mi = !1;
882
882
  for (const e of nn) {
883
883
  (e.f & 1024) !== 0 && P(e, Ye);
884
884
  let t;
@@ -894,7 +894,7 @@ function Zs() {
894
894
  function wt(e) {
895
895
  M(e, e.v + 1);
896
896
  }
897
- function Mi(e, t, n) {
897
+ function Ri(e, t, n) {
898
898
  var r = e.reactions;
899
899
  if (r !== null)
900
900
  for (var i = ln(), o = r.length, s = 0; s < o; s++) {
@@ -904,7 +904,7 @@ function Mi(e, t, n) {
904
904
  if (c && P(a, t), (l & 131072) !== 0) nn.add(a);
905
905
  else if ((l & 2) !== 0) {
906
906
  var u = a;
907
- W?.delete(u), (l & 65536) === 0 && (l & 512 && (E === null || (E.f & 2097152) === 0) && (a.f |= xt), Mi(u, Ye, n));
907
+ W?.delete(u), (l & 65536) === 0 && (l & 512 && (E === null || (E.f & 2097152) === 0) && (a.f |= xt), Ri(u, Ye, n));
908
908
  } else if (c) {
909
909
  var h = a;
910
910
  (l & 16) !== 0 && ge !== null && ge.add(h), n !== null ? n.push(h) : er(h);
@@ -912,31 +912,31 @@ function Mi(e, t, n) {
912
912
  }
913
913
  }
914
914
  }
915
- var ea = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
915
+ var ra = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
916
916
  function ot(e) {
917
917
  if (typeof e != "object" || e === null || St in e) return e;
918
- const t = os(e);
919
- if (t !== rs && t !== is) return e;
920
- var n = /* @__PURE__ */ new Map(), r = es(e), i = /* @__PURE__ */ F(0), o = null, s = je, a = (h) => {
918
+ const t = ls(e);
919
+ if (t !== ss && t !== as) return e;
920
+ var n = /* @__PURE__ */ new Map(), r = rs(e), i = /* @__PURE__ */ F(0), o = null, s = je, a = (h) => {
921
921
  if (je === s) return h();
922
922
  var f = k, g = je;
923
- de(null), xr(s);
923
+ de(null), Ir(s);
924
924
  var m = h();
925
- return de(f), xr(g), m;
925
+ return de(f), Ir(g), m;
926
926
  };
927
927
  r && n.set("length", /* @__PURE__ */ F(e.length, o));
928
928
  var l = "";
929
929
  let c = !1;
930
930
  function u(h) {
931
931
  if (!c) {
932
- c = !0, l = h, Tr(i, `${l} version`);
933
- for (const [f, g] of n) Tr(g, ta(l, f));
932
+ c = !0, l = h, Sr(i, `${l} version`);
933
+ for (const [f, g] of n) Sr(g, ia(l, f));
934
934
  c = !1;
935
935
  }
936
936
  }
937
937
  return new Proxy(e, {
938
938
  defineProperty(h, f, g) {
939
- (!("value" in g) || g.configurable === !1 || g.enumerable === !1 || g.writable === !1) && ws();
939
+ (!("value" in g) || g.configurable === !1 || g.enumerable === !1 || g.writable === !1) && As();
940
940
  var m = n.get(f);
941
941
  return m === void 0 ? a(() => {
942
942
  var v = /* @__PURE__ */ F(g.value, o);
@@ -1023,39 +1023,39 @@ function ot(e) {
1023
1023
  return f;
1024
1024
  },
1025
1025
  setPrototypeOf() {
1026
- ks();
1026
+ Cs();
1027
1027
  }
1028
1028
  });
1029
1029
  }
1030
- function ta(e, t) {
1031
- return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : ea.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
1030
+ function ia(e, t) {
1031
+ return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : ra.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
1032
1032
  }
1033
- var Ar, na, Li, Ri, $i;
1033
+ var Cr, oa, $i, Pi, Ni;
1034
1034
  function Rn() {
1035
- if (Ar === void 0) {
1036
- Ar = window, na = document, Li = /Firefox/.test(navigator.userAgent);
1035
+ if (Cr === void 0) {
1036
+ Cr = window, oa = document, $i = /Firefox/.test(navigator.userAgent);
1037
1037
  var e = Element.prototype, t = Node.prototype, n = Text.prototype;
1038
- Ri = Be(t, "firstChild").get, $i = Be(t, "nextSibling").get, vr(e) && (e[fs] = void 0, e[ds] = null, e[ps] = void 0, e.__e = void 0), vr(n) && (n[gs] = void 0);
1038
+ Pi = Be(t, "firstChild").get, Ni = Be(t, "nextSibling").get, yr(e) && (e[ms] = void 0, e[gs] = null, e[vs] = void 0, e.__e = void 0), yr(n) && (n[ys] = void 0);
1039
1039
  }
1040
1040
  }
1041
- function Pi(e = "") {
1041
+ function Hi(e = "") {
1042
1042
  return document.createTextNode(e);
1043
1043
  }
1044
1044
  // @__NO_SIDE_EFFECTS__
1045
1045
  function $n(e) {
1046
- return Ri.call(e);
1046
+ return Pi.call(e);
1047
1047
  }
1048
1048
  // @__NO_SIDE_EFFECTS__
1049
1049
  function dt(e) {
1050
- return $i.call(e);
1050
+ return Ni.call(e);
1051
1051
  }
1052
- function ra(e) {
1052
+ function sa(e) {
1053
1053
  e.textContent = "";
1054
1054
  }
1055
- function Ni(e, t, n) {
1055
+ function Bi(e, t, n) {
1056
1056
  return t == null || t === "http://www.w3.org/1999/xhtml" ? n ? document.createElement(e, { is: n }) : document.createElement(e) : n ? document.createElementNS(t, e, { is: n }) : document.createElementNS(t, e);
1057
1057
  }
1058
- function Hi(e) {
1058
+ function zi(e) {
1059
1059
  var t = k, n = E;
1060
1060
  de(null), xe(null);
1061
1061
  try {
@@ -1064,16 +1064,16 @@ function Hi(e) {
1064
1064
  de(t), xe(n);
1065
1065
  }
1066
1066
  }
1067
- function ia(e) {
1068
- E === null && (k === null && bs(e), ys()), ve && vs(e);
1067
+ function aa(e) {
1068
+ E === null && (k === null && _s(e), Ss()), ve && Ts(e);
1069
1069
  }
1070
- function oa(e, t) {
1070
+ function la(e, t) {
1071
1071
  var n = t.last;
1072
1072
  n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
1073
1073
  }
1074
1074
  function Je(e, t) {
1075
1075
  var n = E;
1076
- n !== null && (n.f & 8192) !== 0 && (e |= ni);
1076
+ n !== null && (n.f & 8192) !== 0 && (e |= ii);
1077
1077
  var r = {
1078
1078
  ctx: L,
1079
1079
  deps: null,
@@ -1099,9 +1099,9 @@ function Je(e, t) {
1099
1099
  } catch (s) {
1100
1100
  throw oe(r), s;
1101
1101
  }
1102
- 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 |= ii));
1102
+ 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 |= si));
1103
1103
  }
1104
- if (i !== null && (i.parent = n, n !== null && oa(i, n), k !== null && (k.f & 2) !== 0 && (e & 64) === 0)) {
1104
+ if (i !== null && (i.parent = n, n !== null && la(i, n), k !== null && (k.f & 2) !== 0 && (e & 64) === 0)) {
1105
1105
  var o = k;
1106
1106
  (o.effects ?? (o.effects = [])).push(i);
1107
1107
  }
@@ -1111,24 +1111,24 @@ function rr() {
1111
1111
  return k !== null && !ne;
1112
1112
  }
1113
1113
  function Re(e) {
1114
- ia("$effect");
1114
+ aa("$effect");
1115
1115
  var t = E.f;
1116
1116
  if (!k && (t & 32) !== 0 && L !== null && !L.i) {
1117
1117
  var n = L;
1118
1118
  (n.e ?? (n.e = [])).push(e);
1119
- } else return Bi(e);
1119
+ } else return Wi(e);
1120
1120
  }
1121
- function Bi(e) {
1122
- return Je(4 | us, e);
1121
+ function Wi(e) {
1122
+ return Je(4 | fs, e);
1123
1123
  }
1124
- function sa(e) {
1124
+ function ca(e) {
1125
1125
  ht.ensure();
1126
1126
  const t = Je(64 | Ct, e);
1127
1127
  return () => {
1128
1128
  oe(t);
1129
1129
  };
1130
1130
  }
1131
- function aa(e) {
1131
+ function ua(e) {
1132
1132
  ht.ensure();
1133
1133
  const t = Je(64 | Ct, e);
1134
1134
  return (n = {}) => new Promise((r) => {
@@ -1137,28 +1137,28 @@ function aa(e) {
1137
1137
  }) : (oe(t), r(void 0));
1138
1138
  });
1139
1139
  }
1140
- function la(e) {
1140
+ function ha(e) {
1141
1141
  return Je(4, e);
1142
1142
  }
1143
1143
  function ir(e, t = 0) {
1144
1144
  return Je(8 | t, e);
1145
1145
  }
1146
- function ca(e, t = 0) {
1146
+ function da(e, t = 0) {
1147
1147
  var n = Je(16 | t, e);
1148
1148
  return n;
1149
1149
  }
1150
1150
  function Ue(e) {
1151
1151
  return Je(32 | Ct, e);
1152
1152
  }
1153
- function zi(e) {
1153
+ function Fi(e) {
1154
1154
  var t = e.teardown;
1155
1155
  if (t !== null) {
1156
1156
  const n = ve, r = k;
1157
- Cr(!0), de(null);
1157
+ xr(!0), de(null);
1158
1158
  try {
1159
1159
  t.call(null);
1160
1160
  } finally {
1161
- Cr(n), de(r);
1161
+ xr(n), de(r);
1162
1162
  }
1163
1163
  }
1164
1164
  }
@@ -1166,14 +1166,14 @@ function or(e, t = !1) {
1166
1166
  var n = e.first;
1167
1167
  for (e.first = e.last = null; n !== null; ) {
1168
1168
  const i = n.ac;
1169
- i !== null && Hi(() => {
1169
+ i !== null && zi(() => {
1170
1170
  i.abort(Yn);
1171
1171
  });
1172
1172
  var r = n.next;
1173
1173
  (n.f & 64) !== 0 ? n.parent = null : oe(n, t), n = r;
1174
1174
  }
1175
1175
  }
1176
- function ua(e) {
1176
+ function fa(e) {
1177
1177
  for (var t = e.first; t !== null; ) {
1178
1178
  var n = t.next;
1179
1179
  (t.f & 32) === 0 && oe(t), t = n;
@@ -1181,26 +1181,26 @@ function ua(e) {
1181
1181
  }
1182
1182
  function oe(e, t = !0) {
1183
1183
  var n = !1;
1184
- (t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (ha(e.nodes.start, e.nodes.end), n = !0), P(e, yr), or(e, t && !n), At(e, 0);
1184
+ (t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (pa(e.nodes.start, e.nodes.end), n = !0), P(e, br), or(e, t && !n), At(e, 0);
1185
1185
  var r = e.nodes && e.nodes.t;
1186
1186
  if (r !== null) for (const o of r) o.stop();
1187
- zi(e), e.f ^= yr, e.f |= cs;
1187
+ Fi(e), e.f ^= br, e.f |= ds;
1188
1188
  var i = e.parent;
1189
- i !== null && i.first !== null && Wi(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
1189
+ i !== null && i.first !== null && Di(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
1190
1190
  }
1191
- function ha(e, t) {
1191
+ function pa(e, t) {
1192
1192
  for (; e !== null; ) {
1193
1193
  var n = e === t ? null : /* @__PURE__ */ dt(e);
1194
1194
  e.remove(), e = n;
1195
1195
  }
1196
1196
  }
1197
- function Wi(e) {
1197
+ function Di(e) {
1198
1198
  var t = e.parent, n = e.prev, r = e.next;
1199
1199
  n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
1200
1200
  }
1201
1201
  function un(e, t, n = !0) {
1202
1202
  var r = [];
1203
- Fi(e, r, !0);
1203
+ ji(e, r, !0);
1204
1204
  var i = () => {
1205
1205
  n && oe(e), t && t();
1206
1206
  }, o = r.length;
@@ -1209,9 +1209,9 @@ function un(e, t, n = !0) {
1209
1209
  for (var a of r) a.out(s);
1210
1210
  } else i();
1211
1211
  }
1212
- function Fi(e, t, n) {
1212
+ function ji(e, t, n) {
1213
1213
  if ((e.f & 8192) === 0) {
1214
- e.f ^= ni;
1214
+ e.f ^= ii;
1215
1215
  var r = e.nodes && e.nodes.t;
1216
1216
  if (r !== null)
1217
1217
  for (const a of r) (a.is_global || n) && t.push(a);
@@ -1219,21 +1219,21 @@ function Fi(e, t, n) {
1219
1219
  var o = i.next;
1220
1220
  if ((i.f & 64) === 0) {
1221
1221
  var s = (i.f & 65536) !== 0 || (i.f & 32) !== 0 && (e.f & 16) !== 0;
1222
- Fi(i, t, s ? n : !1);
1222
+ ji(i, t, s ? n : !1);
1223
1223
  }
1224
1224
  i = o;
1225
1225
  }
1226
1226
  }
1227
1227
  }
1228
- function da(e, t) {
1228
+ function ga(e, t) {
1229
1229
  if (e.nodes)
1230
1230
  for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) {
1231
1231
  var i = n === r ? null : /* @__PURE__ */ dt(n);
1232
1232
  t.append(n), n = i;
1233
1233
  }
1234
1234
  }
1235
- var fa = null, zt = !1, ve = !1;
1236
- function Cr(e) {
1235
+ var ma = null, zt = !1, ve = !1;
1236
+ function xr(e) {
1237
1237
  ve = e;
1238
1238
  }
1239
1239
  var k = null, ne = !1;
@@ -1245,19 +1245,19 @@ function xe(e) {
1245
1245
  E = e;
1246
1246
  }
1247
1247
  var se = null;
1248
- function Di(e) {
1248
+ function qi(e) {
1249
1249
  k !== null && (!Ce || (k.f & 2) !== 0) && (se ?? (se = /* @__PURE__ */ new Set())).add(e);
1250
1250
  }
1251
1251
  var q = null, U = 0, Y = null;
1252
- function pa(e) {
1252
+ function va(e) {
1253
1253
  Y = e;
1254
1254
  }
1255
- var ji = 1, Ne = 0, je = Ne;
1256
- function xr(e) {
1255
+ var Vi = 1, Ne = 0, je = Ne;
1256
+ function Ir(e) {
1257
1257
  je = e;
1258
1258
  }
1259
- function qi() {
1260
- return ++ji;
1259
+ function Gi() {
1260
+ return ++Vi;
1261
1261
  }
1262
1262
  function Ot(e) {
1263
1263
  var t = e.f;
@@ -1265,29 +1265,29 @@ function Ot(e) {
1265
1265
  if (t & 2 && (e.f &= ~xt), (t & 4096) !== 0) {
1266
1266
  for (var n = e.deps, r = n.length, i = 0; i < r; i++) {
1267
1267
  var o = n[i];
1268
- if (Ot(o) && Ci(o), o.wv > e.wv) return !0;
1268
+ if (Ot(o) && Ii(o), o.wv > e.wv) return !0;
1269
1269
  }
1270
1270
  (t & 512) !== 0 && W === null && P(e, ae);
1271
1271
  }
1272
1272
  return !1;
1273
1273
  }
1274
- function Vi(e, t, n = !0) {
1274
+ function Ui(e, t, n = !0) {
1275
1275
  var r = e.reactions;
1276
1276
  if (r !== null && !(!Ce && se !== null && se.has(e)))
1277
1277
  for (var i = 0; i < r.length; i++) {
1278
1278
  var o = r[i];
1279
- (o.f & 2) !== 0 ? Vi(o, t, !1) : t === o && (n ? P(o, le) : (o.f & 1024) !== 0 && P(o, Ye), er(o));
1279
+ (o.f & 2) !== 0 ? Ui(o, t, !1) : t === o && (n ? P(o, le) : (o.f & 1024) !== 0 && P(o, Ye), er(o));
1280
1280
  }
1281
1281
  }
1282
- function Gi(e) {
1282
+ function Ki(e) {
1283
1283
  var t = q, n = U, r = Y, i = k, o = se, s = L, a = ne, l = je, c = e.f;
1284
- q = null, U = 0, Y = null, k = (c & 96) === 0 ? e : null, se = null, Kt(e.ctx), ne = !1, je = ++Ne, e.ac !== null && (Hi(() => {
1284
+ q = null, U = 0, Y = null, k = (c & 96) === 0 ? e : null, se = null, Kt(e.ctx), ne = !1, je = ++Ne, e.ac !== null && (zi(() => {
1285
1285
  e.ac.abort(Yn);
1286
1286
  }), e.ac = null);
1287
1287
  try {
1288
- e.f |= br;
1288
+ e.f |= Tr;
1289
1289
  var u = e.fn, h = u();
1290
- e.f |= ri;
1290
+ e.f |= oi;
1291
1291
  var f = e.deps, g = x?.is_fork;
1292
1292
  if (q !== null) {
1293
1293
  var m;
@@ -1299,23 +1299,23 @@ function Gi(e) {
1299
1299
  ((v = f[m]).reactions ?? (v.reactions = [])).push(e);
1300
1300
  }
1301
1301
  } else !g && f !== null && U < f.length && (At(e, U), f.length = U);
1302
- if (ln() && Y !== null && !ne && f !== null && (e.f & 6146) === 0) for (m = 0; m < Y.length; m++) Vi(Y[m], e);
1302
+ if (ln() && Y !== null && !ne && f !== null && (e.f & 6146) === 0) for (m = 0; m < Y.length; m++) Ui(Y[m], e);
1303
1303
  if (i !== null && i !== e) {
1304
1304
  if (Ne++, i.deps !== null) for (let y = 0; y < n; y += 1) i.deps[y].rv = Ne;
1305
1305
  if (t !== null) for (const y of t) y.rv = Ne;
1306
1306
  Y !== null && (r === null ? r = Y : r.push(...Y));
1307
1307
  }
1308
- return (e.f & 8388608) !== 0 && (e.f ^= oi), h;
1308
+ return (e.f & 8388608) !== 0 && (e.f ^= ai), h;
1309
1309
  } catch (y) {
1310
- return pi(y);
1310
+ return mi(y);
1311
1311
  } finally {
1312
- e.f ^= br, q = t, U = n, Y = r, k = i, se = o, Kt(s), ne = a, je = l;
1312
+ e.f ^= Tr, q = t, U = n, Y = r, k = i, se = o, Kt(s), ne = a, je = l;
1313
1313
  }
1314
1314
  }
1315
- function ga(e, t) {
1315
+ function ya(e, t) {
1316
1316
  let n = t.reactions;
1317
1317
  if (n !== null) {
1318
- var r = ts.call(n, e);
1318
+ var r = is.call(n, e);
1319
1319
  if (r !== -1) {
1320
1320
  var i = n.length - 1;
1321
1321
  i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop());
@@ -1323,13 +1323,13 @@ function ga(e, t) {
1323
1323
  }
1324
1324
  if (n === null && (t.f & 2) !== 0 && (q === null || !Vt.call(q, t))) {
1325
1325
  var o = t;
1326
- (o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~xt), o.v !== H && Jn(o), Js(o), At(o, 0);
1326
+ (o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~xt), o.v !== H && Jn(o), ea(o), At(o, 0);
1327
1327
  }
1328
1328
  }
1329
1329
  function At(e, t) {
1330
1330
  var n = e.deps;
1331
1331
  if (n !== null)
1332
- for (var r = t; r < n.length; r++) ga(e, n[r]);
1332
+ for (var r = t; r < n.length; r++) ya(e, n[r]);
1333
1333
  }
1334
1334
  function ct(e) {
1335
1335
  var t = e.f;
@@ -1339,9 +1339,9 @@ function ct(e) {
1339
1339
  if (E = e, zt = !0, 0)
1340
1340
  var i, o;
1341
1341
  try {
1342
- (t & 16777232) !== 0 ? ua(e) : or(e), zi(e);
1343
- var s = Gi(e);
1344
- if (e.teardown = typeof s == "function" ? s : null, e.wv = ji, 0)
1342
+ (t & 16777232) !== 0 ? fa(e) : or(e), Fi(e);
1343
+ var s = Ki(e);
1344
+ if (e.teardown = typeof s == "function" ? s : null, e.wv = Vi, 0)
1345
1345
  for (var a of e.deps) ;
1346
1346
  } finally {
1347
1347
  zt = r, E = n;
@@ -1350,7 +1350,7 @@ function ct(e) {
1350
1350
  }
1351
1351
  function b(e) {
1352
1352
  var t = (e.f & 2) !== 0;
1353
- if (fa?.add(e), k !== null && !ne && !(E !== null && (E.f & 16384) !== 0) && (se === null || !se.has(e))) {
1353
+ if (ma?.add(e), k !== null && !ne && !(E !== null && (E.f & 16384) !== 0) && (se === null || !se.has(e))) {
1354
1354
  var n = k.deps;
1355
1355
  if ((k.f & 2097152) !== 0)
1356
1356
  e.rv < Ne && (e.rv = Ne, q === null && n !== null && n[U] === e ? U++ : q === null ? q = [e] : q.push(e));
@@ -1374,25 +1374,25 @@ function b(e) {
1374
1374
  var l = e;
1375
1375
  if (ve) {
1376
1376
  var c = l.v;
1377
- return ((l.f & 1024) === 0 && l.reactions !== null || Ki(l)) && (c = nr(l)), De.set(l, c), c;
1377
+ return ((l.f & 1024) === 0 && l.reactions !== null || Yi(l)) && (c = nr(l)), De.set(l, c), c;
1378
1378
  }
1379
- var u = (l.f & 512) === 0 && !ne && k !== null && (zt || (k.f & 512) !== 0), h = (l.f & ri) === 0;
1380
- Ot(l) && (u && (l.f |= 512), Ci(l)), u && !h && (xi(l), Ui(l));
1379
+ var u = (l.f & 512) === 0 && !ne && k !== null && (zt || (k.f & 512) !== 0), h = (l.f & oi) === 0;
1380
+ Ot(l) && (u && (l.f |= 512), Ii(l)), u && !h && (Oi(l), Xi(l));
1381
1381
  }
1382
1382
  if (W?.has(e)) return W.get(e);
1383
1383
  if ((e.f & 8388608) !== 0) throw e.v;
1384
1384
  return e.v;
1385
1385
  }
1386
- function Ui(e) {
1386
+ function Xi(e) {
1387
1387
  if (e.f |= 512, e.deps !== null)
1388
1388
  for (const t of e.deps)
1389
- (t.reactions ?? (t.reactions = [])).push(e), (t.f & 2) !== 0 && (t.f & 512) === 0 && (xi(t), Ui(t));
1389
+ (t.reactions ?? (t.reactions = [])).push(e), (t.f & 2) !== 0 && (t.f & 512) === 0 && (Oi(t), Xi(t));
1390
1390
  }
1391
- function Ki(e) {
1391
+ function Yi(e) {
1392
1392
  if (e.v === H) return !0;
1393
1393
  if (e.deps === null) return !1;
1394
1394
  for (const t of e.deps)
1395
- if (De.has(t) || (t.f & 2) !== 0 && Ki(t)) return !0;
1395
+ if (De.has(t) || (t.f & 2) !== 0 && Yi(t)) return !0;
1396
1396
  return !1;
1397
1397
  }
1398
1398
  function hn(e) {
@@ -1403,11 +1403,11 @@ function hn(e) {
1403
1403
  ne = t;
1404
1404
  }
1405
1405
  }
1406
- var Nt = /* @__PURE__ */ Symbol("events"), ma = /* @__PURE__ */ new Set(), Ir = /* @__PURE__ */ new Set(), Or = null;
1407
- function Mr(e) {
1406
+ var Nt = /* @__PURE__ */ Symbol("events"), ba = /* @__PURE__ */ new Set(), Or = /* @__PURE__ */ new Set(), Mr = null;
1407
+ function Lr(e) {
1408
1408
  var t = this, n = t.ownerDocument, r = e.type, i = e.composedPath?.() || [], o = i[0] || e.target;
1409
- Or = e;
1410
- var s = 0, a = Or === e && e[Nt];
1409
+ Mr = e;
1410
+ var s = 0, a = Mr === e && e[Nt];
1411
1411
  if (a) {
1412
1412
  var l = i.indexOf(a);
1413
1413
  if (l !== -1 && (t === document || t === window)) {
@@ -1449,13 +1449,13 @@ function Mr(e) {
1449
1449
  }
1450
1450
  }
1451
1451
  }
1452
- var va = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
1453
- function ya(e) {
1454
- return va?.createHTML(e) ?? e;
1452
+ var Ta = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
1453
+ function Sa(e) {
1454
+ return Ta?.createHTML(e) ?? e;
1455
1455
  }
1456
- function ba(e) {
1457
- var t = Ni("template");
1458
- return t.innerHTML = ya(e.replaceAll("<!>", "<!---->")), t.content;
1456
+ function _a(e) {
1457
+ var t = Bi("template");
1458
+ return t.innerHTML = Sa(e.replaceAll("<!>", "<!---->")), t.content;
1459
1459
  }
1460
1460
  function Wt(e, t) {
1461
1461
  var n = E;
@@ -1467,13 +1467,13 @@ function Wt(e, t) {
1467
1467
  });
1468
1468
  }
1469
1469
  // @__NO_SIDE_EFFECTS__
1470
- function Ta(e, t) {
1470
+ function wa(e, t) {
1471
1471
  var n = (t & 1) !== 0, r = (t & 2) !== 0, i, o = !e.startsWith("<!>");
1472
1472
  return () => {
1473
1473
  if (re)
1474
1474
  return Wt(D, null), D;
1475
- i === void 0 && (i = ba(o ? e : "<!>" + e), n || (i = /* @__PURE__ */ $n(i)));
1476
- var s = r || Li ? document.importNode(i, !0) : i.cloneNode(!0);
1475
+ i === void 0 && (i = _a(o ? e : "<!>" + e), n || (i = /* @__PURE__ */ $n(i)));
1476
+ var s = r || $i ? document.importNode(i, !0) : i.cloneNode(!0);
1477
1477
  if (n) {
1478
1478
  var a = /* @__PURE__ */ $n(s), l = s.lastChild;
1479
1479
  Wt(a, l);
@@ -1481,15 +1481,15 @@ function Ta(e, t) {
1481
1481
  return s;
1482
1482
  };
1483
1483
  }
1484
- function Xi(e, t) {
1484
+ function Ji(e, t) {
1485
1485
  if (re) {
1486
1486
  var n = E;
1487
- ((n.f & 32768) === 0 || n.nodes.end === null) && (n.nodes.end = D), li();
1487
+ ((n.f & 32768) === 0 || n.nodes.end === null) && (n.nodes.end = D), ui();
1488
1488
  return;
1489
1489
  }
1490
1490
  e !== null && e.before(t);
1491
1491
  }
1492
- var Sa = [
1492
+ var ka = [
1493
1493
  "allowfullscreen",
1494
1494
  "async",
1495
1495
  "autofocus",
@@ -1518,8 +1518,8 @@ var Sa = [
1518
1518
  "defer",
1519
1519
  "disablepictureinpicture",
1520
1520
  "disableremoteplayback"
1521
- ], rh = [
1522
- ...Sa,
1521
+ ], lh = [
1522
+ ...ka,
1523
1523
  "formNoValidate",
1524
1524
  "isMap",
1525
1525
  "noModule",
@@ -1534,17 +1534,17 @@ var Sa = [
1534
1534
  "allowFullscreen",
1535
1535
  "disablePictureInPicture",
1536
1536
  "disableRemotePlayback"
1537
- ], _a = ["touchstart", "touchmove"];
1538
- function wa(e) {
1539
- return _a.includes(e);
1537
+ ], Ea = ["touchstart", "touchmove"];
1538
+ function Aa(e) {
1539
+ return Ea.includes(e);
1540
1540
  }
1541
- var ka = [
1541
+ var Ca = [
1542
1542
  "$state",
1543
1543
  "$state.raw",
1544
1544
  "$derived",
1545
1545
  "$derived.by"
1546
- ], ih = [
1547
- ...ka,
1546
+ ], ch = [
1547
+ ...Ca,
1548
1548
  "$state.eager",
1549
1549
  "$state.snapshot",
1550
1550
  "$props",
@@ -1559,18 +1559,18 @@ var ka = [
1559
1559
  "$inspect().with",
1560
1560
  "$inspect.trace",
1561
1561
  "$host"
1562
- ], Lr = !0;
1563
- function Yi(e, t) {
1564
- return Ji(e, t);
1562
+ ], Rr = !0;
1563
+ function Qi(e, t) {
1564
+ return Zi(e, t);
1565
1565
  }
1566
- function Ea(e, t) {
1566
+ function xa(e, t) {
1567
1567
  Rn(), t.intro = t.intro ?? !1;
1568
1568
  const n = t.target, r = re, i = D;
1569
1569
  try {
1570
1570
  for (var o = /* @__PURE__ */ $n(n); o && (o.nodeType !== 8 || o.data !== "["); ) o = /* @__PURE__ */ dt(o);
1571
1571
  if (!o) throw qt;
1572
1572
  Lt(!0), kt(o);
1573
- const s = Ji(e, {
1573
+ const s = Zi(e, {
1574
1574
  ...t,
1575
1575
  anchor: o
1576
1576
  });
@@ -1578,61 +1578,61 @@ function Ea(e, t) {
1578
1578
  } catch (s) {
1579
1579
  if (s instanceof Error && s.message.split(`
1580
1580
  `).some((a) => a.startsWith("https://svelte.dev/e/"))) throw s;
1581
- return s !== qt && console.warn("Failed to hydrate: ", s), t.recover === !1 && Ss(), Rn(), ra(n), Lt(!1), Yi(e, t);
1581
+ return s !== qt && console.warn("Failed to hydrate: ", s), t.recover === !1 && ks(), Rn(), sa(n), Lt(!1), Qi(e, t);
1582
1582
  } finally {
1583
1583
  Lt(r), kt(i);
1584
1584
  }
1585
1585
  }
1586
1586
  var Ht = /* @__PURE__ */ new Map();
1587
- function Ji(e, { target: t, anchor: n, props: r = {}, events: i, context: o, intro: s = !0, transformError: a }) {
1587
+ function Zi(e, { target: t, anchor: n, props: r = {}, events: i, context: o, intro: s = !0, transformError: a }) {
1588
1588
  Rn();
1589
- var l = void 0, c = aa(() => {
1590
- var u = n ?? t.appendChild(Pi());
1591
- qs(u, { pending: () => {
1589
+ var l = void 0, c = ua(() => {
1590
+ var u = n ?? t.appendChild(Hi());
1591
+ Us(u, { pending: () => {
1592
1592
  } }, (g) => {
1593
- hi({});
1593
+ fi({});
1594
1594
  var m = L;
1595
- if (o && (m.c = o), i && (r.$$events = i), re && Wt(g, null), Lr = s, l = e(g, r) || {}, Lr = !0, re && (E.nodes.end = D, D === null || D.nodeType !== 8 || D.data !== "]"))
1596
- throw ai(), qt;
1597
- di();
1595
+ if (o && (m.c = o), i && (r.$$events = i), re && Wt(g, null), Rr = s, l = e(g, r) || {}, Rr = !0, re && (E.nodes.end = D, D === null || D.nodeType !== 8 || D.data !== "]"))
1596
+ throw ci(), qt;
1597
+ pi();
1598
1598
  }, a);
1599
1599
  var h = /* @__PURE__ */ new Set(), f = (g) => {
1600
1600
  for (var m = 0; m < g.length; m++) {
1601
1601
  var v = g[m];
1602
1602
  if (!h.has(v)) {
1603
1603
  h.add(v);
1604
- var y = wa(v);
1604
+ var y = Aa(v);
1605
1605
  for (const V of [t, document]) {
1606
1606
  var S = Ht.get(V);
1607
1607
  S === void 0 && (S = /* @__PURE__ */ new Map(), Ht.set(V, S));
1608
1608
  var O = S.get(v);
1609
- O === void 0 ? (V.addEventListener(v, Mr, { passive: y }), S.set(v, 1)) : S.set(v, O + 1);
1609
+ O === void 0 ? (V.addEventListener(v, Lr, { passive: y }), S.set(v, 1)) : S.set(v, O + 1);
1610
1610
  }
1611
1611
  }
1612
1612
  }
1613
1613
  };
1614
- return f(ns(ma)), Ir.add(f), () => {
1614
+ return f(os(ba)), Or.add(f), () => {
1615
1615
  for (var g of h) for (const y of [t, document]) {
1616
1616
  var m = Ht.get(y), v = m.get(g);
1617
- --v == 0 ? (y.removeEventListener(g, Mr), m.delete(g), m.size === 0 && Ht.delete(y)) : m.set(g, v);
1617
+ --v == 0 ? (y.removeEventListener(g, Lr), m.delete(g), m.size === 0 && Ht.delete(y)) : m.set(g, v);
1618
1618
  }
1619
- Ir.delete(f), u !== n && u.parentNode?.removeChild(u);
1619
+ Or.delete(f), u !== n && u.parentNode?.removeChild(u);
1620
1620
  };
1621
1621
  });
1622
1622
  return Pn.set(l, c), l;
1623
1623
  }
1624
1624
  var Pn = /* @__PURE__ */ new WeakMap();
1625
- function Aa(e, t) {
1625
+ function Ia(e, t) {
1626
1626
  const n = Pn.get(e);
1627
1627
  return n ? (Pn.delete(e), n(t)) : Promise.resolve();
1628
1628
  }
1629
- function Ca(e) {
1630
- L === null && ms("onMount"), It && L.l !== null ? xa(L).m.push(e) : Re(() => {
1629
+ function Oa(e) {
1630
+ L === null && bs("onMount"), It && L.l !== null ? Ma(L).m.push(e) : Re(() => {
1631
1631
  const t = hn(e);
1632
1632
  if (typeof t == "function") return t;
1633
1633
  });
1634
1634
  }
1635
- function xa(e) {
1635
+ function Ma(e) {
1636
1636
  var t = e.l;
1637
1637
  return t.u ?? (t.u = {
1638
1638
  a: [],
@@ -1640,34 +1640,34 @@ function xa(e) {
1640
1640
  m: []
1641
1641
  });
1642
1642
  }
1643
- var Qi, rt = /* @__PURE__ */ new WeakMap(), rn = /* @__PURE__ */ new WeakMap(), yn = /* @__PURE__ */ new WeakMap(), Rr = /* @__PURE__ */ new WeakSet(), Zi = class {
1643
+ var eo, rt = /* @__PURE__ */ new WeakMap(), rn = /* @__PURE__ */ new WeakMap(), yn = /* @__PURE__ */ new WeakMap(), $r = /* @__PURE__ */ new WeakSet(), to = class {
1644
1644
  constructor(e) {
1645
- Qn(this, Rr), w(this, rt, /* @__PURE__ */ new WeakMap()), w(this, rn, void 0), w(this, yn, void 0), T(yn, this, e);
1645
+ Qn(this, $r), w(this, rt, /* @__PURE__ */ new WeakMap()), w(this, rn, void 0), w(this, yn, void 0), T(yn, this, e);
1646
1646
  }
1647
1647
  observe(e, t) {
1648
1648
  var n = d(rt, this).get(e) || /* @__PURE__ */ new Set();
1649
- return n.add(t), d(rt, this).set(e, n), _(Rr, this, Ia).call(this).observe(e, d(yn, this)), () => {
1649
+ return n.add(t), d(rt, this).set(e, n), _($r, this, La).call(this).observe(e, d(yn, this)), () => {
1650
1650
  var r = d(rt, this).get(e);
1651
1651
  r.delete(t), r.size === 0 && (d(rt, this).delete(e), d(rn, this).unobserve(e));
1652
1652
  };
1653
1653
  }
1654
1654
  };
1655
- Qi = Zi;
1656
- function Ia() {
1655
+ eo = to;
1656
+ function La() {
1657
1657
  return d(rn, this) ?? T(rn, this, new ResizeObserver((e) => {
1658
1658
  for (var t of e) {
1659
- Qi.entries.set(t.target, t);
1659
+ eo.entries.set(t.target, t);
1660
1660
  for (var n of d(rt, this).get(t.target) || []) n(t);
1661
1661
  }
1662
1662
  }));
1663
1663
  }
1664
- p(Zi, "entries", /* @__PURE__ */ new WeakMap());
1664
+ p(to, "entries", /* @__PURE__ */ new WeakMap());
1665
1665
  function bn(e, t) {
1666
1666
  return e === t || e?.[St] === t;
1667
1667
  }
1668
- function Oa(e = {}, t, n, r) {
1668
+ function Ra(e = {}, t, n, r) {
1669
1669
  var i = L.r, o = E;
1670
- return la(() => {
1670
+ return ha(() => {
1671
1671
  var s, a;
1672
1672
  return ir(() => {
1673
1673
  s = a, a = r?.() || [], hn(() => {
@@ -1689,11 +1689,11 @@ function we(e, t, n, r) {
1689
1689
  var i = !It || (n & 2) !== 0, o = (n & 8) !== 0, s = (n & 16) !== 0, a = r, l = !0, c = void 0, u = () => s && i ? (c ?? (c = /* @__PURE__ */ tn(r)), b(c)) : (l && (l = !1, a = s ? hn(r) : r), a);
1690
1690
  let h;
1691
1691
  if (o) {
1692
- var f = St in e || si in e;
1692
+ var f = St in e || li in e;
1693
1693
  h = Be(e, t)?.set ?? (f && t in e ? (A) => e[t] = A : void 0);
1694
1694
  }
1695
1695
  var g, m = !1;
1696
- o ? [g, m] = Ns(() => e[t]) : g = e[t], g === void 0 && r !== void 0 && (g = u(), h && (i && _s(t), h(g)));
1696
+ o ? [g, m] = zs(() => e[t]) : g = e[t], g === void 0 && r !== void 0 && (g = u(), h && (i && Es(t), h(g)));
1697
1697
  var v;
1698
1698
  if (i ? v = () => {
1699
1699
  var A = e[t];
@@ -1708,7 +1708,7 @@ function we(e, t, n, r) {
1708
1708
  return arguments.length > 0 ? ((!i || !G || y || m) && h(G ? v() : A), A) : v();
1709
1709
  });
1710
1710
  }
1711
- var S = !1, O = ((n & 1) !== 0 ? tn : Xs)(() => (S = !1, v()));
1711
+ var S = !1, O = ((n & 1) !== 0 ? tn : Qs)(() => (S = !1, v()));
1712
1712
  o && b(O);
1713
1713
  var V = E;
1714
1714
  return (function(A, G) {
@@ -1719,14 +1719,14 @@ function we(e, t, n, r) {
1719
1719
  return ve && S || (V.f & 16384) !== 0 ? O.v : b(O);
1720
1720
  });
1721
1721
  }
1722
- function Ma(e) {
1723
- return new La(e);
1722
+ function $a(e) {
1723
+ return new Pa(e);
1724
1724
  }
1725
- var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), La = class {
1725
+ var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), Pa = class {
1726
1726
  constructor(e) {
1727
1727
  w(this, Me, void 0), w(this, ce, void 0);
1728
1728
  var t = /* @__PURE__ */ new Map(), n = (i, o) => {
1729
- var s = /* @__PURE__ */ Qs(o, !1, !1);
1729
+ var s = /* @__PURE__ */ ta(o, !1, !1);
1730
1730
  return t.set(i, s), s;
1731
1731
  };
1732
1732
  const r = new Proxy({
@@ -1737,13 +1737,13 @@ var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), La =
1737
1737
  return b(t.get(o) ?? n(o, Reflect.get(i, o)));
1738
1738
  },
1739
1739
  has(i, o) {
1740
- return o === si ? !0 : (b(t.get(o) ?? n(o, Reflect.get(i, o))), Reflect.has(i, o));
1740
+ return o === li ? !0 : (b(t.get(o) ?? n(o, Reflect.get(i, o))), Reflect.has(i, o));
1741
1741
  },
1742
1742
  set(i, o, s) {
1743
1743
  return M(t.get(o) ?? n(o, s), s), Reflect.set(i, o, s);
1744
1744
  }
1745
1745
  });
1746
- T(ce, this, (e.hydrate ? Ea : Yi)(e.component, {
1746
+ T(ce, this, (e.hydrate ? xa : Qi)(e.component, {
1747
1747
  target: e.target,
1748
1748
  anchor: e.anchor,
1749
1749
  props: r,
@@ -1765,7 +1765,7 @@ var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), La =
1765
1765
  d(ce, this).$set = (i) => {
1766
1766
  Object.assign(r, i);
1767
1767
  }, d(ce, this).$destroy = () => {
1768
- Aa(d(ce, this));
1768
+ Ia(d(ce, this));
1769
1769
  };
1770
1770
  }
1771
1771
  $set(e) {
@@ -1781,8 +1781,8 @@ var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), La =
1781
1781
  $destroy() {
1782
1782
  d(ce, this).$destroy();
1783
1783
  }
1784
- }, eo;
1785
- typeof HTMLElement == "function" && (eo = class extends HTMLElement {
1784
+ }, no;
1785
+ typeof HTMLElement == "function" && (no = class extends HTMLElement {
1786
1786
  constructor(e, t, n) {
1787
1787
  super(), p(this, "$$ctor", void 0), p(this, "$$s", void 0), p(this, "$$c", void 0), p(this, "$$cn", !1), p(this, "$$d", {}), p(this, "$$r", !1), p(this, "$$p_d", {}), p(this, "$$l", {}), p(this, "$$l_u", /* @__PURE__ */ new Map()), p(this, "$$me", void 0), p(this, "$$shadowRoot", null), this.$$ctor = e, this.$$s = t, n && (this.$$shadowRoot = this.attachShadow(n));
1788
1788
  }
@@ -1803,19 +1803,19 @@ typeof HTMLElement == "function" && (eo = class extends HTMLElement {
1803
1803
  if (this.$$cn = !0, !this.$$c) {
1804
1804
  let e = function(r) {
1805
1805
  return (i) => {
1806
- const o = Ni("slot");
1807
- r !== "default" && (o.name = r), Xi(i, o);
1806
+ const o = Bi("slot");
1807
+ r !== "default" && (o.name = r), Ji(i, o);
1808
1808
  };
1809
1809
  };
1810
1810
  if (await Promise.resolve(), !this.$$cn || this.$$c) return;
1811
- const t = {}, n = Ra(this);
1811
+ const t = {}, n = Na(this);
1812
1812
  for (const r of this.$$s) r in n && (r === "default" && !this.$$d.children ? (this.$$d.children = e(r), t.default = !0) : t[r] = e(r));
1813
1813
  for (const r of this.attributes) {
1814
1814
  const i = this.$$g_p(r.name);
1815
1815
  i in this.$$d || (this.$$d[i] = Ft(i, r.value, this.$$p_d, "toProp"));
1816
1816
  }
1817
1817
  for (const r in this.$$p_d) !(r in this.$$d) && this[r] !== void 0 && (this.$$d[r] = this[r], delete this[r]);
1818
- this.$$c = Ma({
1818
+ this.$$c = $a({
1819
1819
  component: this.$$ctor,
1820
1820
  target: this.$$shadowRoot || this,
1821
1821
  props: {
@@ -1823,7 +1823,7 @@ typeof HTMLElement == "function" && (eo = class extends HTMLElement {
1823
1823
  $$slots: t,
1824
1824
  $$host: this
1825
1825
  }
1826
- }), this.$$me = sa(() => {
1826
+ }), this.$$me = ca(() => {
1827
1827
  ir(() => {
1828
1828
  this.$$r = !0;
1829
1829
  for (const r of Gt(this.$$c)) {
@@ -1880,14 +1880,14 @@ function Ft(e, t, n, r) {
1880
1880
  return t;
1881
1881
  }
1882
1882
  }
1883
- function Ra(e) {
1883
+ function Na(e) {
1884
1884
  const t = {};
1885
1885
  return e.childNodes.forEach((n) => {
1886
1886
  t[n.slot || "default"] = !0;
1887
1887
  }), t;
1888
1888
  }
1889
- function $a(e, t, n, r, i, o) {
1890
- let s = class extends eo {
1889
+ function Ha(e, t, n, r, i, o) {
1890
+ let s = class extends no {
1891
1891
  constructor() {
1892
1892
  super(e, n, i), this.$$p_d = t;
1893
1893
  }
@@ -1912,14 +1912,14 @@ function $a(e, t, n, r, i, o) {
1912
1912
  } });
1913
1913
  }), o && (s = o(s)), e.element = s, s;
1914
1914
  }
1915
- var Pa = class extends Event {
1915
+ var Ba = class extends Event {
1916
1916
  constructor(e, t, n, r) {
1917
1917
  super("context-request", {
1918
1918
  bubbles: !0,
1919
1919
  composed: !0
1920
1920
  }), p(this, "context", void 0), p(this, "contextTarget", void 0), p(this, "callback", void 0), p(this, "subscribe", void 0), this.context = e, this.contextTarget = t, this.callback = n, this.subscribe = r ?? !1;
1921
1921
  }
1922
- }, Na = class {
1922
+ }, za = class {
1923
1923
  constructor(e, t) {
1924
1924
  p(this, "host", void 0), p(this, "context", void 0), p(this, "subscribe", void 0), p(this, "onValue", void 0), p(this, "isConnected", !1), p(this, "unsubscribe", void 0), p(this, "currentValue", void 0), p(this, "handleValue", (n, r) => {
1925
1925
  r !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = r), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = n, this.onValue?.(n);
@@ -1935,12 +1935,12 @@ var Pa = class extends Event {
1935
1935
  return this.currentValue;
1936
1936
  }
1937
1937
  requestValue() {
1938
- this.host.dispatchEvent(new Pa(this.context, this.host, this.handleValue, this.subscribe));
1938
+ this.host.dispatchEvent(new Ba(this.context, this.host, this.handleValue, this.subscribe));
1939
1939
  }
1940
- }, dn = (e) => e, Ha = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), oh = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), Ba = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), sh = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
1941
- function to(e, t, n) {
1940
+ }, dn = (e) => e, Wa = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), uh = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), Fa = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), hh = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
1941
+ function ro(e, t, n) {
1942
1942
  let r = !1;
1943
- const i = new Na(e, {
1943
+ const i = new za(e, {
1944
1944
  context: t,
1945
1945
  subscribe: !0,
1946
1946
  onValue: (c) => {
@@ -1964,19 +1964,19 @@ function to(e, t, n) {
1964
1964
  globalThis.clearInterval(l), e.removeEventListener("context-provider", o), i.disconnect();
1965
1965
  };
1966
1966
  }
1967
- function za(e, t) {
1968
- return to(e, Ha, t);
1967
+ function Da(e, t) {
1968
+ return ro(e, Wa, t);
1969
1969
  }
1970
- function Wa(e, t) {
1971
- return to(e, Ba, t);
1970
+ function ja(e, t) {
1971
+ return ro(e, Fa, t);
1972
1972
  }
1973
- function Fa(e, t) {
1974
- return za(e, t);
1973
+ function qa(e, t) {
1974
+ return Da(e, t);
1975
1975
  }
1976
- function Da(e, t) {
1977
- return Wa(e, t);
1976
+ function Va(e, t) {
1977
+ return ja(e, t);
1978
1978
  }
1979
- var ja = class {
1979
+ var Ga = class {
1980
1980
  serialize(e, t) {
1981
1981
  return {
1982
1982
  startContainer: this.getNodePath(e.startContainer, t),
@@ -2049,9 +2049,9 @@ var st;
2049
2049
  (function(e) {
2050
2050
  e.YELLOW = "yellow", e.GREEN = "green", e.BLUE = "blue", e.PINK = "pink", e.ORANGE = "orange", e.UNDERLINE = "underline";
2051
2051
  })(st || (st = {}));
2052
- var no = class Nn {
2052
+ var io = class Nn {
2053
2053
  constructor(t = {}) {
2054
- if (p(this, "config", void 0), p(this, "ttsWordHighlight", null), p(this, "ttsSentenceHighlight", null), p(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), p(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), p(this, "annotations", /* @__PURE__ */ new Map()), p(this, "colorHighlights", /* @__PURE__ */ new Map()), p(this, "nextAnnotationId", 1), p(this, "supported", !1), p(this, "rangeSerializer", void 0), p(this, "themeObserver", null), p(this, "explicitTTSColorOverride", null), this.config = t, this.rangeSerializer = new ja(), typeof CSS > "u" || !("highlights" in CSS)) {
2054
+ if (p(this, "config", void 0), p(this, "ttsWordHighlight", null), p(this, "ttsSentenceHighlight", null), p(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), p(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), p(this, "annotations", /* @__PURE__ */ new Map()), p(this, "colorHighlights", /* @__PURE__ */ new Map()), p(this, "nextAnnotationId", 1), p(this, "supported", !1), p(this, "rangeSerializer", void 0), p(this, "themeObserver", null), p(this, "explicitTTSColorOverride", null), this.config = t, this.rangeSerializer = new Ga(), typeof CSS > "u" || !("highlights" in CSS)) {
2055
2055
  console.warn("CSS Custom Highlight API not supported (SSR or unsupported browser)");
2056
2056
  return;
2057
2057
  }
@@ -2161,12 +2161,12 @@ var no = class Nn {
2161
2161
  ];
2162
2162
  let h = u[u.length - 1], f = -1 / 0;
2163
2163
  for (const G of u) {
2164
- const Z = this.blend(c, a, G), pt = this.contrastRatio(Z, a), C = this.contrastRatio(Z, l), pr = pt * 1.2 + C * 0.8;
2164
+ const Z = this.blend(c, a, G), pt = this.contrastRatio(Z, a), C = this.contrastRatio(Z, l), gr = pt * 1.2 + C * 0.8;
2165
2165
  if (pt >= 1.25 && C >= 2.4) {
2166
2166
  h = G;
2167
2167
  break;
2168
2168
  }
2169
- pr > f && (f = pr, h = G);
2169
+ gr > f && (f = gr, h = G);
2170
2170
  }
2171
2171
  const g = Math.max(0.24, Math.min(0.85, h * 0.55)), m = Math.max(0.55, Math.min(0.95, h + 0.2)), v = Math.max(0.22, Math.min(0.6, h * 0.45)), y = l, S = this.blend(y, a, m), O = this.contrastRatio(S, a), V = this.relativeLuminance(a) > 0.45 ? [
2172
2172
  0,
@@ -2454,14 +2454,14 @@ var no = class Nn {
2454
2454
  }
2455
2455
  }
2456
2456
  };
2457
- p(no, "SENTENCE_FALLBACK_SELECTOR", "math, mjx-container, svg, img, canvas, [role='img']");
2458
- p(no, "WORD_FALLBACK_SELECTOR", "svg, img, canvas, [role='img']");
2459
- function ro(e) {
2457
+ p(io, "SENTENCE_FALLBACK_SELECTOR", "math, mjx-container, svg, img, canvas, [role='img']");
2458
+ p(io, "WORD_FALLBACK_SELECTOR", "svg, img, canvas, [role='img']");
2459
+ function oo(e) {
2460
2460
  return (...t) => {
2461
2461
  console.debug(`[${e}]`, ...t);
2462
2462
  };
2463
2463
  }
2464
- var ah = ro("I18nService"), Tn = {
2464
+ var dh = oo("I18nService"), Tn = {
2465
2465
  assessment: [],
2466
2466
  section: [],
2467
2467
  item: [],
@@ -2482,19 +2482,19 @@ function ke(e, t) {
2482
2482
  if (e.find((n) => typeof n != "string") !== void 0) throw new Error(`Invalid tools config at "${t}": all entries must be strings.`);
2483
2483
  return e;
2484
2484
  }
2485
- function qa(e) {
2485
+ function Ua(e) {
2486
2486
  if (e != null) {
2487
2487
  if (!qe(e)) throw new Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');
2488
2488
  return e;
2489
2489
  }
2490
2490
  }
2491
- function Va(e) {
2491
+ function Ka(e) {
2492
2492
  if (e != null) {
2493
2493
  if (!qe(e)) throw new Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');
2494
2494
  return e;
2495
2495
  }
2496
2496
  }
2497
- function Ga(e, t) {
2497
+ function Xa(e, t) {
2498
2498
  if (t == null) return;
2499
2499
  if (!qe(t)) throw new Error(`Invalid tools config at "providers.${e}": expected an object.`);
2500
2500
  const n = t, r = (i) => i === "polly" || i === "google" || i === "custom";
@@ -2503,14 +2503,14 @@ function Ga(e, t) {
2503
2503
  if ("provider" in n && n.provider !== void 0 && !qe(n.provider) && !(e === "textToSpeech" && r(n.provider))) throw new Error(`Invalid tools config at "providers.${e}.provider": expected an object.`);
2504
2504
  return n;
2505
2505
  }
2506
- function Ua(e) {
2506
+ function Ya(e) {
2507
2507
  if (e == null) return {};
2508
2508
  if (!qe(e)) throw new Error('Invalid tools config at "providers": expected an object keyed by tool id.');
2509
2509
  const t = {};
2510
- for (const [n, r] of Object.entries(e)) t[n] = Ga(n, r);
2510
+ for (const [n, r] of Object.entries(e)) t[n] = Xa(n, r);
2511
2511
  return t;
2512
2512
  }
2513
- function io(e) {
2513
+ function so(e) {
2514
2514
  const t = e.trim();
2515
2515
  return t || "";
2516
2516
  }
@@ -2519,20 +2519,20 @@ function Ee(e) {
2519
2519
  const t = /* @__PURE__ */ new Set();
2520
2520
  for (const n of e) {
2521
2521
  if (typeof n != "string") throw new Error("Invalid tools config: tool list entries must be strings.");
2522
- const r = io(n);
2522
+ const r = so(n);
2523
2523
  r && t.add(r);
2524
2524
  }
2525
2525
  return Array.from(t);
2526
2526
  }
2527
- function Ka(e, t) {
2527
+ function Ja(e, t) {
2528
2528
  if (e != null) {
2529
2529
  if (e === "on" || e === "off") return e;
2530
2530
  throw new Error(`Invalid tools config at "${t}": expected "on" or "off", got ${JSON.stringify(e)}.`);
2531
2531
  }
2532
2532
  }
2533
- function Xa(e) {
2533
+ function Qa(e) {
2534
2534
  if (e != null && !qe(e)) throw new Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');
2535
- const t = Va(e?.policy), n = qa(e?.placement), r = Ua(e?.providers), i = Ka(e?.pnpEnforcement, "pnpEnforcement"), o = {
2535
+ const t = Ka(e?.policy), n = Ua(e?.placement), r = Ya(e?.providers), i = Ja(e?.pnpEnforcement, "pnpEnforcement"), o = {
2536
2536
  policy: {
2537
2537
  allowed: Ee(ke(t?.allowed, "policy.allowed")),
2538
2538
  blocked: Ee(ke(t?.blocked, "policy.blocked"))
@@ -2546,7 +2546,7 @@ function Xa(e) {
2546
2546
  };
2547
2547
  return i && (o.pnpEnforcement = i), o;
2548
2548
  }
2549
- var Ya = [
2549
+ var Za = [
2550
2550
  "assessment",
2551
2551
  "section",
2552
2552
  "item",
@@ -2557,7 +2557,7 @@ var Ya = [
2557
2557
  function Dt(e, t) {
2558
2558
  if (typeof e != "string" || e.trim().length === 0) throw new Error(`Invalid tool registration: "${t}" must be a non-empty string.`);
2559
2559
  }
2560
- var Ja = [
2560
+ var el = [
2561
2561
  {
2562
2562
  pattern: /<script\b/i,
2563
2563
  reason: "contains a <script> tag"
@@ -2575,17 +2575,17 @@ var Ja = [
2575
2575
  reason: "contains a <foreignObject> element"
2576
2576
  }
2577
2577
  ];
2578
- function Qa(e, t, n) {
2578
+ function tl(e, t, n) {
2579
2579
  const r = t.trimStart(), i = r.toLowerCase().startsWith("<svg"), o = /^https?:/i.test(r);
2580
2580
  if (/^data:/i.test(r)) throw new Error(`Invalid tool registration "${e}": "${n}" may not be a data: URL.`);
2581
2581
  if (!(!i && !o)) {
2582
- for (const { pattern: s, reason: a } of Ja) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${n}" ${a}. Inline SVG icons must not include scriptable content.`);
2582
+ for (const { pattern: s, reason: a } of el) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${n}" ${a}. Inline SVG icons must not include scriptable content.`);
2583
2583
  }
2584
2584
  }
2585
- function $r(e) {
2585
+ function Pr(e) {
2586
2586
  if (Dt(e.toolId, "toolId"), Dt(e.name, "name"), Dt(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.`);
2587
- if (typeof e.icon == "string" && Qa(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.`);
2588
- const t = e.supportedLevels.find((n) => !Ya.includes(n));
2587
+ if (typeof e.icon == "string" && tl(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.`);
2588
+ const t = e.supportedLevels.find((n) => !Za.includes(n));
2589
2589
  if (t) throw new Error(`Invalid tool registration "${e.toolId}": unsupported level "${t}".`);
2590
2590
  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)}".`);
2591
2591
  if (e.singletonScope !== void 0 && e.singletonScope !== "section") throw new Error(`Invalid tool registration "${e.toolId}": unsupported singletonScope "${String(e.singletonScope)}".`);
@@ -2594,23 +2594,23 @@ function $r(e) {
2594
2594
  if (typeof e.isVisibleInContext != "function") throw new Error(`Invalid tool registration "${e.toolId}": "isVisibleInContext" must be a function.`);
2595
2595
  if (typeof e.renderToolbar != "function") throw new Error(`Invalid tool registration "${e.toolId}": "renderToolbar" must be a function.`);
2596
2596
  }
2597
- var Za = class {
2597
+ var nl = class {
2598
2598
  constructor() {
2599
2599
  p(this, "tools", /* @__PURE__ */ new Map()), p(this, "pnpIndex", /* @__PURE__ */ new Map()), p(this, "componentOverrides", {}), p(this, "moduleLoaders", /* @__PURE__ */ new Map()), p(this, "loadedToolModules", /* @__PURE__ */ new Set()), p(this, "moduleLoadPromises", /* @__PURE__ */ new Map());
2600
2600
  }
2601
2601
  normalizeToolId(e) {
2602
- return io(e);
2602
+ return so(e);
2603
2603
  }
2604
2604
  normalizeToolIds(e) {
2605
2605
  return e.map((t) => this.normalizeToolId(t));
2606
2606
  }
2607
2607
  register(e) {
2608
- if ($r(e), this.tools.has(e.toolId)) throw new Error(`Tool '${e.toolId}' is already registered`);
2608
+ if (Pr(e), this.tools.has(e.toolId)) throw new Error(`Tool '${e.toolId}' is already registered`);
2609
2609
  if (this.tools.set(e.toolId, e), e.pnpSupportIds) for (const t of e.pnpSupportIds)
2610
2610
  this.pnpIndex.has(t) || this.pnpIndex.set(t, /* @__PURE__ */ new Set()), this.pnpIndex.get(t).add(e.toolId);
2611
2611
  }
2612
2612
  override(e) {
2613
- if ($r(e), !this.tools.has(e.toolId)) throw new Error(`Cannot override non-existent tool '${e.toolId}'`);
2613
+ if (Pr(e), !this.tools.has(e.toolId)) throw new Error(`Cannot override non-existent tool '${e.toolId}'`);
2614
2614
  const t = this.tools.get(e.toolId);
2615
2615
  if (t.pnpSupportIds) for (const n of t.pnpSupportIds) this.pnpIndex.get(n)?.delete(e.toolId);
2616
2616
  if (this.tools.set(e.toolId, e), e.pnpSupportIds) for (const n of e.pnpSupportIds)
@@ -2737,20 +2737,20 @@ var Za = class {
2737
2737
  return r.renderToolbar(t, i);
2738
2738
  }
2739
2739
  };
2740
- function oo(e) {
2740
+ function ao(e) {
2741
2741
  return e.level === "item";
2742
2742
  }
2743
- function el(e) {
2743
+ function rl(e) {
2744
2744
  return e.level === "passage";
2745
2745
  }
2746
- function tl(e) {
2746
+ function il(e) {
2747
2747
  return e.level === "rubric";
2748
2748
  }
2749
- function so(e) {
2749
+ function lo(e) {
2750
2750
  return e.level === "element";
2751
2751
  }
2752
2752
  function sr(e) {
2753
- if (so(e)) {
2753
+ if (lo(e)) {
2754
2754
  const t = e.item.config;
2755
2755
  if (!t) return "";
2756
2756
  const n = [], r = (a) => a.replace(/<[^>]*>/g, " ").trim(), i = t.elements?.[e.elementId];
@@ -2765,7 +2765,7 @@ function sr(e) {
2765
2765
  }
2766
2766
  return n.filter(Boolean).join(" ").trim();
2767
2767
  }
2768
- if (oo(e)) {
2768
+ if (ao(e)) {
2769
2769
  const t = e.item;
2770
2770
  if (!t?.config) return "";
2771
2771
  const n = t.config, r = [], i = (l) => l.replace(/<[^>]*>/g, " ").trim();
@@ -2784,7 +2784,7 @@ function sr(e) {
2784
2784
  }
2785
2785
  return r.filter(Boolean).join(" ").trim();
2786
2786
  }
2787
- if (el(e)) {
2787
+ if (rl(e)) {
2788
2788
  const t = e.passage;
2789
2789
  if (!t?.config) return "";
2790
2790
  const n = t.config, r = [], i = (l) => l.replace(/<[^>]*>/g, " ").trim();
@@ -2803,7 +2803,7 @@ function sr(e) {
2803
2803
  }
2804
2804
  return r.filter(Boolean).join(" ").trim();
2805
2805
  }
2806
- if (tl(e)) {
2806
+ if (il(e)) {
2807
2807
  const t = e.rubricBlock;
2808
2808
  return t.passage?.config ? (t.passage.config.markup || "").replace(/<[^>]*>/g, " ").trim() : (t.content || "").replace(/<[^>]*>/g, " ").trim();
2809
2809
  }
@@ -2820,7 +2820,7 @@ function fn(e) {
2820
2820
  /\d+\s*[+\-*/=]\s*\d+/
2821
2821
  ].some((n) => n.test(t));
2822
2822
  }
2823
- function nl(e) {
2823
+ function ol(e) {
2824
2824
  const t = [
2825
2825
  "pie-multiple-choice",
2826
2826
  "pie-inline-choice",
@@ -2829,7 +2829,7 @@ function nl(e) {
2829
2829
  "inline-choice",
2830
2830
  "select-text"
2831
2831
  ];
2832
- if (so(e)) {
2832
+ if (lo(e)) {
2833
2833
  const n = e.item.config;
2834
2834
  if (!n?.models) return !1;
2835
2835
  const r = (Array.isArray(n.models) ? n.models : Object.values(n.models)).find((o) => o && typeof o == "object" && o.id === e.elementId);
@@ -2837,7 +2837,7 @@ function nl(e) {
2837
2837
  const i = r.element || "";
2838
2838
  return t.includes(i);
2839
2839
  }
2840
- if (oo(e)) {
2840
+ if (ao(e)) {
2841
2841
  const n = e.item.config?.models;
2842
2842
  return (Array.isArray(n) ? n : n && typeof n == "object" ? Object.values(n) : []).some((r) => {
2843
2843
  if (!r || typeof r != "object") return !1;
@@ -2850,7 +2850,7 @@ function nl(e) {
2850
2850
  function pn(e) {
2851
2851
  return sr(e).trim().length >= 10;
2852
2852
  }
2853
- function rl(e) {
2853
+ function sl(e) {
2854
2854
  const t = sr(e);
2855
2855
  return [
2856
2856
  /chemistry|chemical|element|atom|molecule|compound/i,
@@ -2861,23 +2861,23 @@ function rl(e) {
2861
2861
  /physics|force|energy|velocity|acceleration/i
2862
2862
  ].some((n) => n.test(t));
2863
2863
  }
2864
- var il = [
2864
+ var al = [
2865
2865
  "assessment",
2866
2866
  "section",
2867
2867
  "item",
2868
2868
  "passage",
2869
2869
  "rubric"
2870
- ], ol = new Set(il);
2871
- function sl(e) {
2872
- return ol.has(e);
2870
+ ], ll = new Set(al);
2871
+ function cl(e) {
2872
+ return ll.has(e);
2873
2873
  }
2874
2874
  function ar(e, t, n) {
2875
2875
  const r = e.trim(), i = n.trim();
2876
2876
  if (!r || !i) throw new Error("Tool instance ids require non-empty tool and scope ids");
2877
- if (!sl(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
2877
+ if (!cl(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
2878
2878
  return `${r}:${t}:${i}`;
2879
2879
  }
2880
- var al = class {
2880
+ var ul = class {
2881
2881
  constructor() {
2882
2882
  p(this, "providerId", "desmos-calculator"), p(this, "providerName", "Desmos Calculator"), p(this, "category", "calculator"), p(this, "version", "1.10"), p(this, "requiresAuth", !0), p(this, "desmosProvider", null), p(this, "config", null);
2883
2883
  }
@@ -2981,13 +2981,13 @@ var al = class {
2981
2981
  text: e,
2982
2982
  offset: 0
2983
2983
  }];
2984
- }, ao = (e) => String(e || "").trim().toLowerCase(), ll = () => ao((typeof navigator < "u" ? navigator.language || navigator.languages?.[0] : "") || "en-US"), cl = (e, t) => {
2984
+ }, co = (e) => String(e || "").trim().toLowerCase(), hl = () => co((typeof navigator < "u" ? navigator.language || navigator.languages?.[0] : "") || "en-US"), dl = (e, t) => {
2985
2985
  if (t) {
2986
2986
  const s = e.find((a) => a.name === t);
2987
2987
  if (s) return s;
2988
2988
  }
2989
- const n = ll(), r = n.split("-")[0] || "en", i = (s) => {
2990
- const a = ao(s.lang);
2989
+ const n = hl(), r = n.split("-")[0] || "en", i = (s) => {
2990
+ const a = co(s.lang);
2991
2991
  return a === n || a.startsWith(`${r}-`);
2992
2992
  }, o = [
2993
2993
  (s) => s.localService && i(s),
@@ -3001,14 +3001,14 @@ var al = class {
3001
3001
  if (a) return a;
3002
3002
  }
3003
3003
  return e[0] || null;
3004
- }, ul = (e) => !e.default, lo = class {
3004
+ }, fl = (e) => !e.default, uo = class {
3005
3005
  constructor() {
3006
3006
  p(this, "providerId", "browser"), p(this, "providerName", "Browser Speech Synthesis"), p(this, "version", "1.0.0");
3007
3007
  }
3008
3008
  async initialize(e) {
3009
3009
  if (typeof window > "u") throw new Error("BrowserTTSProvider requires browser environment");
3010
3010
  if (!("speechSynthesis" in window)) throw new Error("Browser does not support Speech Synthesis API");
3011
- return new hl(e);
3011
+ return new pl(e);
3012
3012
  }
3013
3013
  supportsFeature(e) {
3014
3014
  return !0;
@@ -3026,7 +3026,7 @@ var al = class {
3026
3026
  }
3027
3027
  destroy() {
3028
3028
  }
3029
- }, hl = class {
3029
+ }, pl = class {
3030
3030
  constructor(e) {
3031
3031
  p(this, "utterance", null), p(this, "config", null), p(this, "_isPlaying", !1), p(this, "_isPaused", !1), p(this, "speakRunId", 0), p(this, "onWordBoundary", void 0), this.config = e;
3032
3032
  }
@@ -3113,8 +3113,8 @@ var al = class {
3113
3113
  }
3114
3114
  const o = new SpeechSynthesisUtterance(e);
3115
3115
  this.utterance = o;
3116
- const s = cl(speechSynthesis.getVoices(), this.config?.voice);
3117
- s && ul(s) && (o.voice = s), this.config?.rate && (o.rate = this.config.rate), this.config?.pitch && (o.pitch = this.config.pitch);
3116
+ const s = dl(speechSynthesis.getVoices(), this.config?.voice);
3117
+ s && fl(s) && (o.voice = s), this.config?.rate && (o.rate = this.config.rate), this.config?.pitch && (o.pitch = this.config.pitch);
3118
3118
  const a = () => {
3119
3119
  this.utterance === o && (this.utterance = null);
3120
3120
  };
@@ -3168,7 +3168,7 @@ var al = class {
3168
3168
  ...e.providerOptions || {}
3169
3169
  });
3170
3170
  }
3171
- }, dl = class {
3171
+ }, gl = class {
3172
3172
  async emitTelemetry(e, t) {
3173
3173
  try {
3174
3174
  await this.config?.onTelemetry?.(e, t);
@@ -3200,7 +3200,7 @@ var al = class {
3200
3200
  }
3201
3201
  async _initializeBrowserTTS(e) {
3202
3202
  if (typeof window > "u" || !("speechSynthesis" in window)) throw new Error("[TTSToolProvider] Browser TTS not supported (Web Speech API not available)");
3203
- this.ttsProvider = new lo(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
3203
+ this.ttsProvider = new uo(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
3204
3204
  }
3205
3205
  async _initializeServerTTS(e) {
3206
3206
  if (!e.apiEndpoint) throw new Error("[TTSToolProvider] apiEndpoint required for server-based TTS backends");
@@ -3258,7 +3258,7 @@ var al = class {
3258
3258
  destroy() {
3259
3259
  this.ttsProvider && (this.ttsProvider.destroy(), this.ttsProvider = null), this.config = null, console.log("[TTSToolProvider] Destroyed");
3260
3260
  }
3261
- }, fl = /* @__PURE__ */ new Set([
3261
+ }, ml = /* @__PURE__ */ new Set([
3262
3262
  "annotation-xml",
3263
3263
  "color-profile",
3264
3264
  "font-face",
@@ -3267,16 +3267,16 @@ var al = class {
3267
3267
  "font-face-format",
3268
3268
  "font-face-name",
3269
3269
  "missing-glyph"
3270
- ]), pl = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, gl = (e, t = "custom element tag") => {
3270
+ ]), vl = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, yl = (e, t = "custom element tag") => {
3271
3271
  if (!e || typeof e != "string") throw new Error(`Invalid ${t}: expected a non-empty string`);
3272
3272
  const n = e.trim();
3273
3273
  if (!n) throw new Error(`Invalid ${t}: tag is empty`);
3274
3274
  if (n !== n.toLowerCase()) throw new Error(`Invalid ${t} "${n}": custom element names must be lowercase`);
3275
3275
  if (!n.includes("-")) throw new Error(`Invalid ${t} "${n}": custom element names must include a hyphen`);
3276
- if (fl.has(n)) throw new Error(`Invalid ${t} "${n}": this name is reserved by the HTML spec`);
3277
- if (!pl.test(n)) throw new Error(`Invalid ${t} "${n}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
3276
+ if (ml.has(n)) throw new Error(`Invalid ${t} "${n}": this name is reserved by the HTML spec`);
3277
+ if (!vl.test(n)) throw new Error(`Invalid ${t} "${n}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
3278
3278
  return n;
3279
- }, co = {
3279
+ }, ho = {
3280
3280
  calculator: "pie-tool-calculator",
3281
3281
  textToSpeech: "pie-tool-text-to-speech",
3282
3282
  ruler: "pie-tool-ruler",
@@ -3288,48 +3288,48 @@ var al = class {
3288
3288
  annotationToolbar: "pie-tool-annotation-toolbar",
3289
3289
  graph: "pie-tool-graph",
3290
3290
  periodicTable: "pie-tool-periodic-table"
3291
- }, ml = (e, t) => gl(t?.toolTagMap?.[e] ?? co[e] ?? e, `tool component tag for "${e}"`), vl = (e) => document.createElement(e), fe = (e, t, n, r) => {
3292
- const i = ml(e, r), o = r?.toolComponentFactories?.[e] ?? r?.toolComponentFactory;
3291
+ }, bl = (e, t) => yl(t?.toolTagMap?.[e] ?? ho[e] ?? e, `tool component tag for "${e}"`), Tl = (e) => document.createElement(e), fe = (e, t, n, r) => {
3292
+ const i = bl(e, r), o = r?.toolComponentFactories?.[e] ?? r?.toolComponentFactory;
3293
3293
  return o ? o({
3294
3294
  toolId: e,
3295
3295
  tagName: i,
3296
3296
  context: t,
3297
3297
  toolbarContext: n
3298
- }) : vl(i);
3298
+ }) : Tl(i);
3299
3299
  }, Hn = /* @__PURE__ */ new WeakMap();
3300
- function yl(e, t) {
3300
+ function Sl(e, t) {
3301
3301
  if (!e) return null;
3302
3302
  const n = Hn.get(e), r = n?.get(t);
3303
3303
  return r ? r.isConnected ? r : (n?.delete(t), null) : null;
3304
3304
  }
3305
- function bl(e, t, n) {
3305
+ function _l(e, t, n) {
3306
3306
  if (!e) return;
3307
3307
  let r = Hn.get(e);
3308
3308
  r || (r = /* @__PURE__ */ new Map(), Hn.set(e, r)), r.set(t, n);
3309
3309
  }
3310
- function Pr(e) {
3310
+ function Nr(e) {
3311
3311
  return e === "basic" || e === "scientific" ? e : null;
3312
3312
  }
3313
- function Tl(e) {
3314
- const t = e.getToolRenderParams?.("calculator") ?? {}, n = Pr(t.calculatorType), r = t.availableTypes;
3313
+ function wl(e) {
3314
+ const t = e.getToolRenderParams?.("calculator") ?? {}, n = Nr(t.calculatorType), r = t.availableTypes;
3315
3315
  return {
3316
3316
  calculatorType: n,
3317
- availableTypes: Array.isArray(r) ? r.map((i) => Pr(i)).filter((i) => i !== null) : n ? [n] : null,
3317
+ availableTypes: Array.isArray(r) ? r.map((i) => Nr(i)).filter((i) => i !== null) : n ? [n] : null,
3318
3318
  displayName: n === "scientific" ? "Scientific Calculator" : n === "basic" ? "Basic Calculator" : "Calculator"
3319
3319
  };
3320
3320
  }
3321
- function Nr(e, t, n) {
3321
+ function Hr(e, t, n) {
3322
3322
  const r = e;
3323
3323
  t ? (r.calculatorType = t, e.setAttribute("calculator-type", t)) : (delete r.calculatorType, e.removeAttribute("calculator-type")), n && n.length > 0 ? r.availableTypes = n : delete r.availableTypes;
3324
3324
  }
3325
- var Sl = {
3325
+ var kl = {
3326
3326
  toolId: "calculator",
3327
3327
  name: "Calculator",
3328
3328
  description: "Multi-type calculator (basic, scientific, graphing)",
3329
3329
  icon: "calculator",
3330
3330
  provider: {
3331
3331
  getProviderId: (e) => typeof e?.provider?.id == "string" && e.provider.id.length > 0 ? e.provider.id : "calculator-desmos",
3332
- createProvider: () => new al(),
3332
+ createProvider: () => new ul(),
3333
3333
  getInitConfig: (e) => e?.provider?.init ?? {},
3334
3334
  getAuthFetcher: (e) => {
3335
3335
  const t = e?.provider?.runtime?.authFetcher;
@@ -3355,8 +3355,8 @@ var Sl = {
3355
3355
  return fn(e);
3356
3356
  },
3357
3357
  renderToolbar(e, t) {
3358
- const { calculatorType: n, availableTypes: r, displayName: i } = Tl(t), o = ar(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = yl(t.toolCoordinator, o), l = a ?? fe(this.toolId, e, t, s);
3359
- a || bl(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Nr(l, n, r);
3358
+ const { calculatorType: n, availableTypes: r, displayName: i } = wl(t), o = ar(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = Sl(t.toolCoordinator, o), l = a ?? fe(this.toolId, e, t, s);
3359
+ a || _l(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Hr(l, n, r);
3360
3360
  const c = n === null ? "Open scientific calculator" : `Open ${i.toLowerCase()}`, u = n === null ? "Close scientific calculator" : `Close ${i.toLowerCase()}`, h = {
3361
3361
  toolId: this.toolId,
3362
3362
  label: i,
@@ -3389,7 +3389,7 @@ var Sl = {
3389
3389
  button: h,
3390
3390
  sync: () => {
3391
3391
  const g = t.isToolVisible(o);
3392
- h.active = g, h.label = i, h.ariaLabel = g ? u : c, h.tooltip = g ? `Close ${i.toLowerCase()}` : i, f !== g && (l.visible = g, f = g), l.toolkitCoordinator !== t.toolkitCoordinator && (l.toolkitCoordinator = t.toolkitCoordinator), Nr(l, n, r);
3392
+ h.active = g, h.label = i, h.ariaLabel = g ? u : c, h.tooltip = g ? `Close ${i.toLowerCase()}` : i, f !== g && (l.visible = g, f = g), l.toolkitCoordinator !== t.toolkitCoordinator && (l.toolkitCoordinator = t.toolkitCoordinator), Hr(l, n, r);
3393
3393
  },
3394
3394
  subscribeActive: (g) => t.subscribeVisibility ? t.subscribeVisibility(() => {
3395
3395
  g(t.isToolVisible(o));
@@ -3397,7 +3397,7 @@ var Sl = {
3397
3397
  }
3398
3398
  };
3399
3399
  }
3400
- }, $ = (e) => e.trim().replace(/\s+/g, " "), uo = () => /[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu, ho = (e) => {
3400
+ }, $ = (e) => e.trim().replace(/\s+/g, " "), fo = () => /[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu, po = (e) => {
3401
3401
  if (e.hidden || e.tagName?.toLowerCase() === "mjx-assistive-mml" || e.getAttribute("aria-hidden") === "true" || e.hasAttribute("inert")) return !0;
3402
3402
  const t = e.classList;
3403
3403
  if (t?.contains("sr-only") || t?.contains("pie-sr-only") || t?.contains("visually-hidden")) return !0;
@@ -3411,12 +3411,12 @@ var Sl = {
3411
3411
  }, ft = (e, t) => {
3412
3412
  let n = e.nodeType === 1 ? e : e.parentElement;
3413
3413
  for (; n; ) {
3414
- if (ho(n)) return !0;
3414
+ if (po(n)) return !0;
3415
3415
  if (t && n === t) break;
3416
3416
  n = n.parentElement;
3417
3417
  }
3418
3418
  return !1;
3419
- }, fo = (e, t, n) => {
3419
+ }, go = (e, t, n) => {
3420
3420
  if (!e || !t || /\s/.test(e) || /\s/.test(t)) return !1;
3421
3421
  const r = n?.boundarySpacingMode ?? "segmenterPreferred";
3422
3422
  if (r === "none") return !1;
@@ -3444,7 +3444,7 @@ var Sl = {
3444
3444
  const f = u;
3445
3445
  if (f.parentElement && !ft(f, e)) {
3446
3446
  const g = f.textContent || "", m = g.match(/\S/), v = m ? m[0] : null;
3447
- !o && !s && fo(l, v, t) && (r.push(" "), a && n.set(i, a), i++, s = !0);
3447
+ !o && !s && go(l, v, t) && (r.push(" "), a && n.set(i, a), i++, s = !0);
3448
3448
  for (let y = 0; y < g.length; y++) {
3449
3449
  const S = g[y], O = /\s/.test(S);
3450
3450
  o ? O || (o = !1, r.push(S), n.set(i, {
@@ -3476,49 +3476,49 @@ var Sl = {
3476
3476
  text: h,
3477
3477
  map: n
3478
3478
  };
3479
- }, _n = null, Hr = Promise.resolve(), _l = (e) => (e || "en").split("-")[0].toLowerCase() || "en", wl = async () => (_n || (_n = import("./sre-Dddi65jB.js").then((e) => /* @__PURE__ */ Zo(e.default, 1)).then((e) => {
3479
+ }, _n = null, Br = Promise.resolve(), El = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Al = async () => (_n || (_n = import("./sre-Dddi65jB.js").then((e) => /* @__PURE__ */ ns(e.default, 1)).then((e) => {
3480
3480
  const t = e.default || e;
3481
3481
  if (!t || typeof t.toSpeech != "function") throw new Error("speech-rule-engine did not expose toSpeech");
3482
3482
  return t;
3483
- })), _n), kl = (e) => e === "en" ? "clearspeak" : "mathspeak", Br = (e) => !!e && typeof e == "object" && !Array.isArray(e), zr = (e) => typeof e == "string" && e.trim() ? e.trim() : void 0, gn = (e) => {
3484
- if (!Br(e)) return;
3485
- const t = zr(e.domain), n = zr(e.style), r = Br(e.engineOptions) ? e.engineOptions : void 0;
3483
+ })), _n), Cl = (e) => e === "en" ? "clearspeak" : "mathspeak", zr = (e) => !!e && typeof e == "object" && !Array.isArray(e), Wr = (e) => typeof e == "string" && e.trim() ? e.trim() : void 0, gn = (e) => {
3484
+ if (!zr(e)) return;
3485
+ const t = Wr(e.domain), n = Wr(e.style), r = zr(e.engineOptions) ? e.engineOptions : void 0;
3486
3486
  if (!(!t && !n && !r))
3487
3487
  return {
3488
3488
  ...t ? { domain: t } : {},
3489
3489
  ...n ? { style: n } : {},
3490
3490
  ...r ? { engineOptions: r } : {}
3491
3491
  };
3492
- }, El = async (e, t, n, r) => {
3493
- const i = _l(t), o = gn(r);
3492
+ }, xl = async (e, t, n, r) => {
3493
+ const i = El(t), o = gn(r);
3494
3494
  await e.setupEngine?.({
3495
3495
  ...o?.engineOptions || {},
3496
3496
  locale: i,
3497
- domain: o?.domain || kl(i),
3497
+ domain: o?.domain || Cl(i),
3498
3498
  ...o?.style ? { style: o.style } : {},
3499
3499
  modality: "speech",
3500
3500
  markup: n
3501
3501
  }), await e.engineReady?.();
3502
- }, Al = async (e) => {
3503
- const t = Hr.then(e, e);
3504
- return Hr = t.then(() => {
3502
+ }, Il = async (e) => {
3503
+ const t = Br.then(e, e);
3504
+ return Br = t.then(() => {
3505
3505
  }, () => {
3506
3506
  }), t;
3507
- }, po = async (e, t, n, r, i) => Al(async () => (await El(e, n, r, i), e.toSpeech(t))), Cl = (e) => e.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), xl = async (e, t, n, r) => {
3507
+ }, mo = async (e, t, n, r, i) => Il(async () => (await xl(e, n, r, i), e.toSpeech(t))), Ol = (e) => e.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), Ml = async (e, t, n, r) => {
3508
3508
  try {
3509
- const i = Cl(await po(e, t, n, "ssml", r));
3509
+ const i = Ol(await mo(e, t, n, "ssml", r));
3510
3510
  return i.includes("<speak") ? i : null;
3511
3511
  } catch (i) {
3512
3512
  return console.debug("[TTSService] Math SSML generation failed; using plain", { message: i instanceof Error ? i.message : String(i) }), null;
3513
3513
  }
3514
- }, go = async (e, t = {}) => {
3514
+ }, vo = async (e, t = {}) => {
3515
3515
  if (!e.some((c) => c.type === "math")) return {
3516
3516
  speechText: $(e.map((c) => c.type === "text" ? c.text : c.fallbackText).join(" ")),
3517
3517
  usedMathSpeech: !1,
3518
3518
  usedFallback: !1
3519
3519
  };
3520
3520
  let n = null, r = !1, i = !1;
3521
- const o = t.loadSre || wl, s = [];
3521
+ const o = t.loadSre || Al, s = [];
3522
3522
  for (const c of e) {
3523
3523
  if (c.type === "text") {
3524
3524
  s.push(c.text);
@@ -3526,7 +3526,7 @@ var Sl = {
3526
3526
  }
3527
3527
  try {
3528
3528
  n || (n = await o());
3529
- const u = $(await po(n, c.mathml, t.language, "none", t.mathSpeech));
3529
+ const u = $(await mo(n, c.mathml, t.language, "none", t.mathSpeech));
3530
3530
  if (u) {
3531
3531
  s.push(u), r = !0;
3532
3532
  continue;
@@ -3538,19 +3538,19 @@ var Sl = {
3538
3538
  }
3539
3539
  const a = $(s.join(" "));
3540
3540
  let l;
3541
- return t.produceSsml && n && r && e.length === 1 && e[0].type === "math" && (l = await xl(n, e[0].mathml, t.language, t.mathSpeech) ?? void 0), {
3541
+ return t.produceSsml && n && r && e.length === 1 && e[0].type === "math" && (l = await Ml(n, e[0].mathml, t.language, t.mathSpeech) ?? void 0), {
3542
3542
  speechText: a,
3543
3543
  usedMathSpeech: r,
3544
3544
  usedFallback: i,
3545
3545
  ssml: l
3546
3546
  };
3547
- }, Il = /* @__PURE__ */ new Set([
3547
+ }, Ll = /* @__PURE__ */ new Set([
3548
3548
  "reserved-row",
3549
3549
  "expanding-row",
3550
3550
  "floating-overlay",
3551
3551
  "left-aligned"
3552
- ]), Wr = (e) => e && typeof e == "object" ? e : {}, Ol = (e) => e === "polly" || e === "google" || e === "server", X = (e, t) => e === void 0 ? t : e, sn = (e, t = "left-aligned") => typeof e == "string" && Il.has(e) ? e : t, Fr = Object.freeze([0.8, 1.25]), wn = (e) => {
3553
- if (!Array.isArray(e)) return [...Fr];
3552
+ ]), Fr = (e) => e && typeof e == "object" ? e : {}, Rl = (e) => e === "polly" || e === "google" || e === "server", X = (e, t) => e === void 0 ? t : e, sn = (e, t = "left-aligned") => typeof e == "string" && Ll.has(e) ? e : t, Dr = Object.freeze([0.8, 1.25]), wn = (e) => {
3553
+ if (!Array.isArray(e)) return [...Dr];
3554
3554
  if (e.length === 0) return [];
3555
3555
  const t = /* @__PURE__ */ new Set();
3556
3556
  for (const n of e) {
@@ -3558,13 +3558,13 @@ var Sl = {
3558
3558
  const r = Math.round(n * 100) / 100;
3559
3559
  r !== 1 && t.add(r);
3560
3560
  }
3561
- return t.size ? Array.from(t) : [...Fr];
3562
- }, Ml = (e) => {
3561
+ return t.size ? Array.from(t) : [...Dr];
3562
+ }, $l = (e) => {
3563
3563
  const t = {
3564
3564
  ...e,
3565
3565
  layoutMode: sn(e.layoutMode)
3566
3566
  }, n = e.backend || "browser";
3567
- if (!Ol(n)) return t;
3567
+ if (!Rl(n)) return t;
3568
3568
  const r = {
3569
3569
  ...t,
3570
3570
  apiEndpoint: X(t.apiEndpoint, "/api/tts"),
@@ -3586,13 +3586,13 @@ var Sl = {
3586
3586
  defaultVoice: X(r.defaultVoice, "en-US-Wavenet-A")
3587
3587
  } : r;
3588
3588
  }, kn = (e) => {
3589
- const t = Wr(e), n = Wr(t.settings);
3590
- return Ml({
3589
+ const t = Fr(e), n = Fr(t.settings);
3590
+ return $l({
3591
3591
  ...t,
3592
3592
  ...n
3593
3593
  });
3594
- }, Bn = (e) => e.backend || "browser", mo = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, vo = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), Ll = (e) => {
3595
- const t = Bn(e), n = mo(e, t), r = vo(e, n), i = gn(e.mathSpeech);
3594
+ }, Bn = (e) => e.backend || "browser", yo = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, bo = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), Pl = (e) => {
3595
+ const t = Bn(e), n = yo(e, t), r = bo(e, n), i = gn(e.mathSpeech);
3596
3596
  return {
3597
3597
  voice: e.defaultVoice,
3598
3598
  rate: e.rate,
@@ -3618,8 +3618,8 @@ var Sl = {
3618
3618
  validateEndpoint: e.validateEndpoint,
3619
3619
  ...typeof e.mathTokenHighlighting == "boolean" ? { mathTokenHighlighting: e.mathTokenHighlighting } : {}
3620
3620
  };
3621
- }, yo = (e) => sn(e.layoutMode), Rl = (e) => {
3622
- switch (yo(e)) {
3621
+ }, To = (e) => sn(e.layoutMode), Nl = (e) => {
3622
+ switch (To(e)) {
3623
3623
  case "reserved-row":
3624
3624
  return {
3625
3625
  mount: "before-buttons",
@@ -3645,21 +3645,21 @@ var Sl = {
3645
3645
  }
3646
3646
  };
3647
3647
  }
3648
- }, gt = /* @__PURE__ */ new Map(), $l = "__pieToolElementUnmount", Dr = "pie-tool-active-change", Pl = {
3648
+ }, gt = /* @__PURE__ */ new Map(), Hl = "__pieToolElementUnmount", jr = "pie-tool-active-change", Bl = {
3649
3649
  toolId: "textToSpeech",
3650
3650
  name: "Text to Speech",
3651
3651
  description: "Read content aloud",
3652
3652
  icon: "volume-up",
3653
3653
  provider: {
3654
3654
  getProviderId: () => "tts",
3655
- createProvider: (e) => new dl(Bn(kn(e))),
3655
+ createProvider: (e) => new gl(Bn(kn(e))),
3656
3656
  getInitConfig: (e) => {
3657
- const t = kn(e), n = Bn(t), r = mo(t, n);
3657
+ const t = kn(e), n = Bn(t), r = yo(t, n);
3658
3658
  return {
3659
3659
  backend: n,
3660
3660
  serverProvider: r,
3661
- transportMode: vo(t, r),
3662
- ...Ll(t)
3661
+ transportMode: bo(t, r),
3662
+ ...Pl(t)
3663
3663
  };
3664
3664
  },
3665
3665
  getAuthFetcher: (e) => {
@@ -3685,12 +3685,12 @@ var Sl = {
3685
3685
  return pn(e);
3686
3686
  },
3687
3687
  renderToolbar(e, t) {
3688
- const n = () => kn(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), r = () => wn(n().speedOptions), i = () => yo(n()), o = () => Rl(n()), s = ar(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
3688
+ const n = () => kn(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), r = () => wn(n().speedOptions), i = () => To(n()), o = () => Nl(n()), s = ar(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
3689
3689
  const u = t.ui?.size;
3690
3690
  return u === "sm" || u === "lg" ? u : "md";
3691
3691
  }, l = () => {
3692
3692
  let u = gt.get(s);
3693
- return u && typeof u.isConnected == "boolean" && !u.isConnected && (gt.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[$l] = () => {
3693
+ return u && typeof u.isConnected == "boolean" && !u.isConnected && (gt.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[Hl] = () => {
3694
3694
  gt.get(s) === u && gt.delete(s);
3695
3695
  }, gt.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 = r(), u;
3696
3696
  }, c = o();
@@ -3710,8 +3710,8 @@ var Sl = {
3710
3710
  const m = g.detail;
3711
3711
  u(m?.active === !0);
3712
3712
  };
3713
- return h.addEventListener(Dr, f), () => {
3714
- h.removeEventListener(Dr, f);
3713
+ return h.addEventListener(jr, f), () => {
3714
+ h.removeEventListener(jr, f);
3715
3715
  };
3716
3716
  },
3717
3717
  sync: () => {
@@ -3739,7 +3739,7 @@ function Se(e) {
3739
3739
  function cr(e, t) {
3740
3740
  e.setAttribute("data-pie-tool-surface", t);
3741
3741
  }
3742
- var Nl = {
3742
+ var zl = {
3743
3743
  toolId: "ruler",
3744
3744
  name: "Ruler",
3745
3745
  description: "On-screen ruler for measurements",
@@ -3781,7 +3781,7 @@ var Nl = {
3781
3781
  subscribeActive: n.subscribeActive
3782
3782
  };
3783
3783
  }
3784
- }, Hl = {
3784
+ }, Wl = {
3785
3785
  toolId: "protractor",
3786
3786
  name: "Protractor",
3787
3787
  description: "On-screen protractor for angle measurements",
@@ -3823,7 +3823,7 @@ var Nl = {
3823
3823
  subscribeActive: n.subscribeActive
3824
3824
  };
3825
3825
  }
3826
- }, Bl = {
3826
+ }, Fl = {
3827
3827
  toolId: "answerEliminator",
3828
3828
  name: "Answer Eliminator",
3829
3829
  description: "Strike through answer choices",
@@ -3836,7 +3836,7 @@ var Nl = {
3836
3836
  "choiceMasking"
3837
3837
  ],
3838
3838
  isVisibleInContext(e) {
3839
- return nl(e);
3839
+ return ol(e);
3840
3840
  },
3841
3841
  renderToolbar(e, t) {
3842
3842
  const n = Te(this.toolId, t), r = t.componentOverrides ?? {}, i = fe(this.toolId, e, t, r);
@@ -3870,7 +3870,7 @@ var Nl = {
3870
3870
  subscribeActive: n.subscribeActive
3871
3871
  };
3872
3872
  }
3873
- }, zl = {
3873
+ }, Dl = {
3874
3874
  toolId: "highlighter",
3875
3875
  name: "Highlighter",
3876
3876
  description: "Highlight text",
@@ -3921,7 +3921,7 @@ var Nl = {
3921
3921
  subscribeActive: n.subscribeActive
3922
3922
  };
3923
3923
  }
3924
- }, Wl = {
3924
+ }, jl = {
3925
3925
  toolId: "lineReader",
3926
3926
  name: "Line Reader",
3927
3927
  description: "Reading guide overlay",
@@ -3970,7 +3970,7 @@ var Nl = {
3970
3970
  subscribeActive: n.subscribeActive
3971
3971
  };
3972
3972
  }
3973
- }, Fl = {
3973
+ }, ql = {
3974
3974
  toolId: "theme",
3975
3975
  name: "Theme",
3976
3976
  description: "Accessible themes and contrast",
@@ -4025,7 +4025,7 @@ var Nl = {
4025
4025
  subscribeActive: n.subscribeActive
4026
4026
  };
4027
4027
  }
4028
- }, Dl = {
4028
+ }, Vl = {
4029
4029
  toolId: "annotationToolbar",
4030
4030
  name: "Highlighter",
4031
4031
  description: "Highlight and annotate text",
@@ -4076,7 +4076,7 @@ var Nl = {
4076
4076
  subscribeActive: n.subscribeActive
4077
4077
  };
4078
4078
  }
4079
- }, jl = {
4079
+ }, Gl = {
4080
4080
  toolId: "graph",
4081
4081
  name: "Graph",
4082
4082
  description: "Graphing calculator and coordinate plane",
@@ -4129,7 +4129,7 @@ var Nl = {
4129
4129
  subscribeActive: n.subscribeActive
4130
4130
  };
4131
4131
  }
4132
- }, ql = {
4132
+ }, Ul = {
4133
4133
  toolId: "periodicTable",
4134
4134
  name: "Periodic Table",
4135
4135
  description: "Chemistry periodic table reference",
@@ -4141,7 +4141,7 @@ var Nl = {
4141
4141
  "elementReference"
4142
4142
  ],
4143
4143
  isVisibleInContext(e) {
4144
- return rl(e);
4144
+ return sl(e);
4145
4145
  },
4146
4146
  renderToolbar(e, t) {
4147
4147
  const n = Te(this.toolId, t), r = {
@@ -4181,54 +4181,54 @@ var Nl = {
4181
4181
  subscribeActive: n.subscribeActive
4182
4182
  };
4183
4183
  }
4184
- }, Vl = [
4185
- Sl,
4186
- Pl,
4187
- Nl,
4188
- Hl,
4184
+ }, Kl = [
4185
+ kl,
4189
4186
  Bl,
4190
4187
  zl,
4191
4188
  Wl,
4192
4189
  Fl,
4193
4190
  Dl,
4194
4191
  jl,
4195
- ql
4192
+ ql,
4193
+ Vl,
4194
+ Gl,
4195
+ Ul
4196
4196
  ];
4197
- function Gl(e = {}) {
4198
- const t = new Za(), n = {
4197
+ function Xl(e = {}) {
4198
+ const t = new nl(), n = {
4199
4199
  toolTagMap: {
4200
- ...co,
4200
+ ...ho,
4201
4201
  ...e.toolTagMap || {}
4202
4202
  },
4203
4203
  toolComponentFactory: e.toolComponentFactory,
4204
4204
  toolComponentFactories: e.toolComponentFactories
4205
4205
  }, r = (i) => e.overrides?.[i.toolId] || i;
4206
- return e.includePackagedTools && Ul(t, {
4206
+ return e.includePackagedTools && Yl(t, {
4207
4207
  toolIds: e.toolIds,
4208
4208
  applyOverrides: r
4209
4209
  }), e.toolModuleLoaders && Object.keys(e.toolModuleLoaders).length > 0 && t.setToolModuleLoaders(e.toolModuleLoaders), t.setComponentOverrides(n), t;
4210
4210
  }
4211
- function Ul(e, t = {}) {
4211
+ function Yl(e, t = {}) {
4212
4212
  const n = t.toolIds && t.toolIds.length > 0 ? new Set(t.toolIds) : null, r = t.applyOverrides || ((i) => i);
4213
- for (const i of Vl)
4213
+ for (const i of Kl)
4214
4214
  n && !n.has(i.toolId) || e.register(r(i));
4215
4215
  }
4216
- function Kl(e = {}) {
4217
- return Gl({
4216
+ function Jl(e = {}) {
4217
+ return Xl({
4218
4218
  ...e,
4219
4219
  includePackagedTools: !0
4220
4220
  });
4221
4221
  }
4222
- function Xl() {
4223
- const e = Kl(), t = /* @__PURE__ */ new Set();
4222
+ function Ql() {
4223
+ const e = Jl(), t = /* @__PURE__ */ new Set();
4224
4224
  for (const n of e.getAllTools()) for (const r of n.pnpSupportIds || []) t.add(r);
4225
4225
  return [...t].sort();
4226
4226
  }
4227
- var Yl = Xl(), lh = {
4228
- supports: [...Yl],
4227
+ var Zl = Ql(), fh = {
4228
+ supports: [...Zl],
4229
4229
  prohibitedSupports: [],
4230
4230
  activateAtInit: []
4231
- }, Jl = {
4231
+ }, ec = {
4232
4232
  visual: {
4233
4233
  magnification: "magnification",
4234
4234
  screenMagnifier: "screenMagnifier",
@@ -4341,11 +4341,11 @@ var Yl = Xl(), lh = {
4341
4341
  itemGlossary: "itemGlossary",
4342
4342
  tutorialAvailable: "tutorialAvailable"
4343
4343
  }
4344
- }, ch = Object.values(Jl).flatMap((e) => Object.values(e)), uh = ro("ToolCoordinator"), zn;
4344
+ }, ph = Object.values(ec).flatMap((e) => Object.values(e)), gh = oo("ToolCoordinator"), zn;
4345
4345
  (function(e) {
4346
4346
  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";
4347
4347
  })(zn || (zn = {}));
4348
- var Ql = /* @__PURE__ */ new Set([
4348
+ var tc = /* @__PURE__ */ new Set([
4349
4349
  "speak",
4350
4350
  "p",
4351
4351
  "s",
@@ -4354,20 +4354,20 @@ var Ql = /* @__PURE__ */ new Set([
4354
4354
  "say-as",
4355
4355
  "voice",
4356
4356
  "lang"
4357
- ]), jr = /* @__PURE__ */ new Set(["audio", "phoneme"]), bo = (e) => e.replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&nbsp;/g, " ").replace(/&#160;/g, " ").replace(/&amp;/g, "&"), jt = (e, t, n) => {
4357
+ ]), qr = /* @__PURE__ */ new Set(["audio", "phoneme"]), So = (e) => e.replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&nbsp;/g, " ").replace(/&#160;/g, " ").replace(/&amp;/g, "&"), jt = (e, t, n) => {
4358
4358
  for (let r = 0; r < t.length; r++) e.push({
4359
4359
  char: t[r],
4360
4360
  rawOffset: n === null ? null : n + r
4361
4361
  });
4362
- }, Zl = (e, t, n) => {
4362
+ }, nc = (e, t, n) => {
4363
4363
  const r = t.slice(n).match(/^&(quot|apos|lt|gt|nbsp|amp|#160);/i);
4364
- return r ? (jt(e, bo(r[0]), n), r[0].length) : 0;
4365
- }, qr = (e) => {
4364
+ return r ? (jt(e, So(r[0]), n), r[0].length) : 0;
4365
+ }, Vr = (e) => {
4366
4366
  e.push({
4367
4367
  char: " ",
4368
4368
  rawOffset: null
4369
4369
  });
4370
- }, ec = (e) => {
4370
+ }, rc = (e) => {
4371
4371
  const t = /* @__PURE__ */ new Map(), n = [];
4372
4372
  let r = !0;
4373
4373
  for (const i of e) {
@@ -4383,17 +4383,17 @@ var Ql = /* @__PURE__ */ new Set([
4383
4383
  text: n.join(""),
4384
4384
  rawToSpokenOffsetMap: t
4385
4385
  };
4386
- }, tc = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", nc = (e, t) => {
4386
+ }, ic = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", oc = (e, t) => {
4387
4387
  const n = new RegExp(`${t}\\s*=\\s*("([^"]*)"|'([^']*)')`, "i"), r = e.match(n);
4388
- return bo(r?.[2] ?? r?.[3] ?? "") || null;
4389
- }, To = (e) => {
4388
+ return So(r?.[2] ?? r?.[3] ?? "") || null;
4389
+ }, _o = (e) => {
4390
4390
  const t = [];
4391
4391
  let n = !1, r = !1, i = 0;
4392
4392
  for (; i < e.length; ) {
4393
4393
  const s = e[i];
4394
4394
  if (s !== "<") {
4395
4395
  if (s === "&") {
4396
- const f = Zl(t, e, i);
4396
+ const f = nc(t, e, i);
4397
4397
  if (f > 0) {
4398
4398
  i += f;
4399
4399
  continue;
@@ -4408,9 +4408,9 @@ var Ql = /* @__PURE__ */ new Set([
4408
4408
  continue;
4409
4409
  }
4410
4410
  r = !0;
4411
- const l = e.slice(i, a + 1), c = tc(l), u = /^<\s*\//.test(l), h = /\/\s*>$/.test(l);
4411
+ const l = e.slice(i, a + 1), c = ic(l), u = /^<\s*\//.test(l), h = /\/\s*>$/.test(l);
4412
4412
  if (!u && c === "sub") {
4413
- const f = nc(l, "alias");
4413
+ const f = oc(l, "alias");
4414
4414
  if (!f) {
4415
4415
  n = !0, i = a + 1;
4416
4416
  continue;
@@ -4421,23 +4421,23 @@ var Ql = /* @__PURE__ */ new Set([
4421
4421
  continue;
4422
4422
  }
4423
4423
  if (!u && c === "break") {
4424
- qr(t), i = a + 1;
4424
+ Vr(t), i = a + 1;
4425
4425
  continue;
4426
4426
  }
4427
- if (!u && jr.has(c) && (n = !0, h)) {
4427
+ if (!u && qr.has(c) && (n = !0, h)) {
4428
4428
  i = a + 1;
4429
4429
  continue;
4430
4430
  }
4431
- c && !Ql.has(c) && !jr.has(c) && c !== "break" && c !== "sub" && (n = !0), !u && (c === "p" || c === "s") && qr(t), i = a + 1;
4431
+ c && !tc.has(c) && !qr.has(c) && c !== "break" && c !== "sub" && (n = !0), !u && (c === "p" || c === "s") && Vr(t), i = a + 1;
4432
4432
  }
4433
- const o = ec(t);
4433
+ const o = rc(t);
4434
4434
  return {
4435
4435
  spokenText: $(o.text),
4436
4436
  rawToSpokenOffsetMap: o.rawToSpokenOffsetMap,
4437
4437
  unsupportedSemantic: n,
4438
4438
  hasMarkup: r
4439
4439
  };
4440
- }, rc = uo(), So = /* @__PURE__ */ new Map([
4440
+ }, sc = fo(), wo = /* @__PURE__ */ new Map([
4441
4441
  ["zero", "0"],
4442
4442
  ["one", "1"],
4443
4443
  ["two", "2"],
@@ -4449,7 +4449,7 @@ var Ql = /* @__PURE__ */ new Set([
4449
4449
  ["eight", "8"],
4450
4450
  ["nine", "9"],
4451
4451
  ["ten", "10"]
4452
- ]), ic = [
4452
+ ]), ac = [
4453
4453
  {
4454
4454
  phrase: [
4455
4455
  "plus",
@@ -4526,7 +4526,7 @@ var Ql = /* @__PURE__ */ new Set([
4526
4526
  }
4527
4527
  ], Wn = (e) => {
4528
4528
  const t = [];
4529
- for (const n of e.matchAll(rc)) {
4529
+ for (const n of e.matchAll(sc)) {
4530
4530
  const r = n[0], i = n.index ?? 0;
4531
4531
  t.push({
4532
4532
  text: r,
@@ -4536,7 +4536,7 @@ var Ql = /* @__PURE__ */ new Set([
4536
4536
  });
4537
4537
  }
4538
4538
  return t;
4539
- }, Fn = (e) => So.get(e.normalized) || e.normalized, oc = (e, t) => {
4539
+ }, Fn = (e) => wo.get(e.normalized) || e.normalized, lc = (e, t) => {
4540
4540
  const n = [];
4541
4541
  for (let r = 0; r < e.length; r++) {
4542
4542
  for (let i = 0; i < t.length; i++) Fn(e[r]) === Fn(t[i]) && n.push({
@@ -4545,7 +4545,7 @@ var Ql = /* @__PURE__ */ new Set([
4545
4545
  visibleToken: i,
4546
4546
  score: 10
4547
4547
  });
4548
- for (const i of ic) {
4548
+ for (const i of ac) {
4549
4549
  const o = e.slice(r, r + i.phrase.length);
4550
4550
  if (o.length === i.phrase.length && o.every((s, a) => s.normalized === i.phrase[a]))
4551
4551
  for (let s = 0; s < t.length; s++)
@@ -4558,8 +4558,8 @@ var Ql = /* @__PURE__ */ new Set([
4558
4558
  }
4559
4559
  }
4560
4560
  return n;
4561
- }, sc = (e, t) => {
4562
- const n = oc(e, t).sort((l, c) => e[l.spokenStartToken].start - e[c.spokenStartToken].start || t[l.visibleToken].start - t[c.visibleToken].start), r = new Array(n.length).fill(0), i = new Array(n.length).fill(-1);
4561
+ }, cc = (e, t) => {
4562
+ const n = lc(e, t).sort((l, c) => e[l.spokenStartToken].start - e[c.spokenStartToken].start || t[l.visibleToken].start - t[c.visibleToken].start), r = new Array(n.length).fill(0), i = new Array(n.length).fill(-1);
4563
4563
  for (let l = 0; l < n.length; l++) {
4564
4564
  const c = n[l];
4565
4565
  r[l] = c.score;
@@ -4588,12 +4588,12 @@ var Ql = /* @__PURE__ */ new Set([
4588
4588
  score: l.score
4589
4589
  };
4590
4590
  });
4591
- }, ac = (e, t, n) => {
4591
+ }, uc = (e, t, n) => {
4592
4592
  if (e.length === 0) return 0;
4593
4593
  const r = e.length / Math.max(1, Math.min(t.length, n.length)), i = e.reduce((o, s) => o + s.score, 0) / e.length / 10;
4594
4594
  return Math.min(1, r * i);
4595
- }, _o = (e) => {
4596
- const t = To(e.speechText), n = $(e.visibleText), r = t.spokenText, i = Wn(r), o = Wn(n), s = t.unsupportedSemantic ? [] : sc(i, o), a = ac(s, i, o), l = r === n && r.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", h = t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text";
4595
+ }, ko = (e) => {
4596
+ const t = _o(e.speechText), n = $(e.visibleText), r = t.spokenText, i = Wn(r), o = Wn(n), s = t.unsupportedSemantic ? [] : cc(i, o), a = uc(s, i, o), l = r === n && r.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", h = t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text";
4597
4597
  return {
4598
4598
  speechText: e.speechText,
4599
4599
  spokenText: r,
@@ -4606,16 +4606,16 @@ var Ql = /* @__PURE__ */ new Set([
4606
4606
  visibleTokens: o,
4607
4607
  rawToSpokenOffsetMap: t.rawToSpokenOffsetMap
4608
4608
  };
4609
- }, ur = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, wo = (e) => {
4609
+ }, ur = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, Eo = (e) => {
4610
4610
  if (!e || /^<[^>]+>$/.test(e.trim())) return null;
4611
4611
  const t = Wn(e)[0];
4612
- return t ? So.get(t.normalized) || t.normalized : null;
4613
- }, Vr = (e, t, n) => {
4614
- const r = wo(n);
4612
+ return t ? wo.get(t.normalized) || t.normalized : null;
4613
+ }, Gr = (e, t, n) => {
4614
+ const r = Eo(n);
4615
4615
  if (!t || !r) return !1;
4616
4616
  const i = ur(e.spokenTokens, t.start);
4617
4617
  return i ? Fn(i) === r : !1;
4618
- }, Gr = (e, t) => {
4618
+ }, Ur = (e, t) => {
4619
4619
  const n = e.rawToSpokenOffsetMap.get(t);
4620
4620
  if (n !== void 0) return n;
4621
4621
  for (let r = t; r < e.speechText.length; r++) {
@@ -4624,36 +4624,36 @@ var Ql = /* @__PURE__ */ new Set([
4624
4624
  if (e.speechText[r] === ">") break;
4625
4625
  }
4626
4626
  return null;
4627
- }, Ur = (e, t, n) => {
4628
- const r = Gr(e, t);
4627
+ }, Kr = (e, t, n) => {
4628
+ const r = Ur(e, t);
4629
4629
  if (r === null) return null;
4630
- const i = Gr(e, Math.max(t, t + n - 1)), o = ur(e.spokenTokens, r), s = i !== null && i >= r ? i - r + 1 : o ? o.end - r : n;
4630
+ const i = Ur(e, Math.max(t, t + n - 1)), o = ur(e.spokenTokens, r), s = i !== null && i >= r ? i - r + 1 : o ? o.end - r : n;
4631
4631
  return {
4632
4632
  start: r,
4633
4633
  length: Math.max(1, s)
4634
4634
  };
4635
- }, Kr = (e, t, n) => {
4635
+ }, Xr = (e, t, n) => {
4636
4636
  if (t < 0 || t >= e.spokenText.length) return null;
4637
4637
  const r = ur(e.spokenTokens, t);
4638
4638
  return r ? {
4639
4639
  start: t,
4640
4640
  length: Math.min(n, r.end - t)
4641
4641
  } : null;
4642
- }, lc = (e, t, n = 1, r) => {
4642
+ }, hc = (e, t, n = 1, r) => {
4643
4643
  if (e.boundaryOffsetMode === "unsupported" || !Number.isFinite(t)) return null;
4644
4644
  const i = Math.max(1, Number.isFinite(n) ? n : 1);
4645
4645
  if (r && /^<[^>]+>$/.test(r.trim())) return null;
4646
4646
  if (e.boundaryOffsetMode === "raw-ssml") {
4647
- const o = Ur(e, t, i), s = Kr(e, t, i);
4647
+ const o = Kr(e, t, i), s = Xr(e, t, i);
4648
4648
  if (r) {
4649
- if (Vr(e, o, r)) return o;
4650
- if (Vr(e, s, r)) return s;
4651
- if (wo(r)) return null;
4649
+ if (Gr(e, o, r)) return o;
4650
+ if (Gr(e, s, r)) return s;
4651
+ if (Eo(r)) return null;
4652
4652
  }
4653
4653
  return o || s;
4654
4654
  }
4655
- return Kr(e, t, i) || Ur(e, t, i);
4656
- }, cc = (e, t) => {
4655
+ return Xr(e, t, i) || Kr(e, t, i);
4656
+ }, dc = (e, t) => {
4657
4657
  if (e.playbackMode === "region-fallback") return null;
4658
4658
  const n = e.anchors.find((o) => o.spokenStart <= t && t < o.spokenEnd);
4659
4659
  if (n) return {
@@ -4675,7 +4675,7 @@ var Ql = /* @__PURE__ */ new Set([
4675
4675
  start: Math.min(r.visibleStart, i.visibleStart),
4676
4676
  end: Math.max(r.visibleEnd, i.visibleEnd)
4677
4677
  } : null;
4678
- }, uc = /* @__PURE__ */ new Map([
4678
+ }, fc = /* @__PURE__ */ new Map([
4679
4679
  ["+", ["plus"]],
4680
4680
  ["-", ["minus", "negative"]],
4681
4681
  ["−", ["minus", "negative"]],
@@ -4699,12 +4699,12 @@ var Ql = /* @__PURE__ */ new Set([
4699
4699
  ["•", ["times"]],
4700
4700
  ["·", ["times"]],
4701
4701
  ["⁢", ["times", "multiplied by"]]
4702
- ]), hc = /* @__PURE__ */ new Map([
4702
+ ]), pc = /* @__PURE__ */ new Map([
4703
4703
  ["⁡", "function-application"],
4704
4704
  ["⁢", "implicit-multiply"],
4705
4705
  ["⁣", "invisible-separator"],
4706
4706
  ["⁤", "invisible-plus"]
4707
- ]), ko = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), dc = /* @__PURE__ */ new Map([
4707
+ ]), Ao = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), gc = /* @__PURE__ */ new Map([
4708
4708
  ["msqrt", "radical"],
4709
4709
  ["mroot", "radical"],
4710
4710
  ["msub", "subscript"],
@@ -4714,11 +4714,11 @@ var Ql = /* @__PURE__ */ new Set([
4714
4714
  ["munderover", "underoverscript"],
4715
4715
  ["mmultiscripts", "multiscript"],
4716
4716
  ["menclose", "enclosure"]
4717
- ]), fc = (e) => e.replace(/\s+/g, " ").trim(), Ve = (e) => (e.localName || e.tagName || "").toLowerCase(), pc = (e) => e.nodeType === Node.ELEMENT_NODE, ut = (e) => Array.from(e.childNodes).filter(pc), hr = (e) => fc(e.textContent || ""), ye = (e, t) => ({
4717
+ ]), mc = (e) => e.replace(/\s+/g, " ").trim(), Ve = (e) => (e.localName || e.tagName || "").toLowerCase(), vc = (e) => e.nodeType === Node.ELEMENT_NODE, ut = (e) => Array.from(e.childNodes).filter(vc), hr = (e) => mc(e.textContent || ""), ye = (e, t) => ({
4718
4718
  type: "element-range",
4719
4719
  quality: t,
4720
4720
  element: e
4721
- }), gc = (e) => {
4721
+ }), yc = (e) => {
4722
4722
  switch (e) {
4723
4723
  case "mi":
4724
4724
  return "identifier";
@@ -4734,15 +4734,15 @@ var Ql = /* @__PURE__ */ new Set([
4734
4734
  default:
4735
4735
  return "unknown";
4736
4736
  }
4737
- }, mc = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), vc = (e, t, n) => n === "fraction" ? ["over", "divided by"] : n === "superscript" ? ko.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? uc.get(e) || [] : [], Ke = (e) => {
4738
- const t = e.normalized ?? mc(e.text, e.kind || "unknown");
4737
+ }, bc = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), Tc = (e, t, n) => n === "fraction" ? ["over", "divided by"] : n === "superscript" ? Ao.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? fc.get(e) || [] : [], Ke = (e) => {
4738
+ const t = e.normalized ?? bc(e.text, e.kind || "unknown");
4739
4739
  return {
4740
4740
  id: `math-token-${e.state.nextId++}`,
4741
4741
  kind: e.kind,
4742
4742
  role: e.role,
4743
4743
  text: e.text,
4744
4744
  normalized: t,
4745
- spokenAliases: vc(e.text, e.kind, e.role),
4745
+ spokenAliases: Tc(e.text, e.kind, e.role),
4746
4746
  sourceElement: e.sourceElement,
4747
4747
  path: e.path,
4748
4748
  target: e.target || ye(e.sourceElement, "element-range"),
@@ -4750,9 +4750,9 @@ var Ql = /* @__PURE__ */ new Set([
4750
4750
  };
4751
4751
  }, Xe = (e, t, n = "tokens") => {
4752
4752
  e[n].push(t);
4753
- }, Eo = (e, t, n) => {
4753
+ }, Co = (e, t, n) => {
4754
4754
  ut(e).forEach((r, i) => be(r, t, `${n}/${Ve(r)}[${i}]`));
4755
- }, yc = (e, t, n) => {
4755
+ }, Sc = (e, t, n) => {
4756
4756
  const r = ut(e);
4757
4757
  r[0] && be(r[0], t, `${n}/numerator`), Xe(t, Ke({
4758
4758
  state: t,
@@ -4763,7 +4763,7 @@ var Ql = /* @__PURE__ */ new Set([
4763
4763
  path: n,
4764
4764
  target: ye(e, "element-range")
4765
4765
  })), r[1] && be(r[1], t, `${n}/denominator`);
4766
- }, bc = (e, t, n) => {
4766
+ }, _c = (e, t, n) => {
4767
4767
  const r = e.getAttribute("open") || "(", i = e.getAttribute("close") || ")";
4768
4768
  Xe(t, Ke({
4769
4769
  state: t,
@@ -4773,7 +4773,7 @@ var Ql = /* @__PURE__ */ new Set([
4773
4773
  sourceElement: e,
4774
4774
  path: `${n}/open`,
4775
4775
  target: ye(e, "element-range")
4776
- })), Eo(e, t, n), Xe(t, Ke({
4776
+ })), Co(e, t, n), Xe(t, Ke({
4777
4777
  state: t,
4778
4778
  kind: "operator",
4779
4779
  role: i === "|" ? "absolute-value-fence" : "close-fence",
@@ -4782,13 +4782,13 @@ var Ql = /* @__PURE__ */ new Set([
4782
4782
  path: `${n}/close`,
4783
4783
  target: ye(e, "element-range")
4784
4784
  }));
4785
- }, Tc = (e, t, n) => {
4785
+ }, wc = (e, t, n) => {
4786
4786
  const r = ut(e);
4787
4787
  r[0] && be(r[0], t, `${n}/base`);
4788
4788
  const i = r[1];
4789
4789
  if (!i) return;
4790
4790
  const o = hr(i);
4791
- if (ko.has(o)) {
4791
+ if (Ao.has(o)) {
4792
4792
  Xe(t, Ke({
4793
4793
  state: t,
4794
4794
  kind: "structure",
@@ -4802,7 +4802,7 @@ var Ql = /* @__PURE__ */ new Set([
4802
4802
  return;
4803
4803
  }
4804
4804
  be(i, t, `${n}/exponent`);
4805
- }, Sc = (e, t, n, r) => {
4805
+ }, kc = (e, t, n, r) => {
4806
4806
  Xe(t, Ke({
4807
4807
  state: t,
4808
4808
  kind: "structure",
@@ -4813,7 +4813,7 @@ var Ql = /* @__PURE__ */ new Set([
4813
4813
  path: n,
4814
4814
  target: ye(e, "element-range")
4815
4815
  }));
4816
- }, _c = (e, t, n) => {
4816
+ }, Ec = (e, t, n) => {
4817
4817
  let r = 0;
4818
4818
  for (const i of ut(e))
4819
4819
  (Ve(i) === "mtr" || Ve(i) === "mlabeledtr") && (r++, Xe(t, Ke({
@@ -4826,10 +4826,10 @@ var Ql = /* @__PURE__ */ new Set([
4826
4826
  path: `${n}/row[${r}]`,
4827
4827
  target: ye(i, "region-fallback")
4828
4828
  }), "layoutTargets")), be(i, t, `${n}/${Ve(i)}[${r}]`);
4829
- }, wc = (e, t, n) => {
4829
+ }, Ac = (e, t, n) => {
4830
4830
  const r = hr(e);
4831
4831
  if (!r) return;
4832
- const i = gc(Ve(e)), o = i === "operator" ? hc.get(r) : void 0, s = o ?? (i === "operator" && (r === "(" || r === ")") ? "grouping-fence" : i);
4832
+ const i = yc(Ve(e)), o = i === "operator" ? pc.get(r) : void 0, s = o ?? (i === "operator" && (r === "(" || r === ")") ? "grouping-fence" : i);
4833
4833
  Xe(t, Ke({
4834
4834
  state: t,
4835
4835
  kind: i,
@@ -4860,19 +4860,19 @@ var Ql = /* @__PURE__ */ new Set([
4860
4860
  case "mtext":
4861
4861
  case "ms":
4862
4862
  case "mspace":
4863
- wc(e, t, n);
4863
+ Ac(e, t, n);
4864
4864
  return;
4865
4865
  case "mfrac":
4866
- yc(e, t, n);
4866
+ Sc(e, t, n);
4867
4867
  return;
4868
4868
  case "msup":
4869
- Tc(e, t, n);
4869
+ wc(e, t, n);
4870
4870
  return;
4871
4871
  case "mfenced":
4872
- bc(e, t, n);
4872
+ _c(e, t, n);
4873
4873
  return;
4874
4874
  case "mtable":
4875
- _c(e, t, n);
4875
+ Ec(e, t, n);
4876
4876
  return;
4877
4877
  case "mphantom":
4878
4878
  return;
@@ -4882,15 +4882,15 @@ var Ql = /* @__PURE__ */ new Set([
4882
4882
  return;
4883
4883
  }
4884
4884
  default: {
4885
- const i = dc.get(r);
4885
+ const i = gc.get(r);
4886
4886
  if (i) {
4887
- Sc(e, t, n, i);
4887
+ kc(e, t, n, i);
4888
4888
  return;
4889
4889
  }
4890
- Eo(e, t, n);
4890
+ Co(e, t, n);
4891
4891
  }
4892
4892
  }
4893
- }, kc = (e) => {
4893
+ }, Cc = (e) => {
4894
4894
  const t = {
4895
4895
  tokens: [],
4896
4896
  layoutTargets: [],
@@ -4901,7 +4901,7 @@ var Ql = /* @__PURE__ */ new Set([
4901
4901
  layoutTargets: t.layoutTargets,
4902
4902
  expressionTarget: ye(e, "region-fallback")
4903
4903
  };
4904
- }, Ec = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, Ac = 0.95, Cc = (e) => {
4904
+ }, xc = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, Ic = 0.95, Oc = (e) => {
4905
4905
  const t = [], n = /* @__PURE__ */ new Set(), r = (i) => {
4906
4906
  const o = i.toLowerCase().trim().split(/\s+/).filter(Boolean);
4907
4907
  if (o.length === 0) return;
@@ -4911,7 +4911,7 @@ var Ql = /* @__PURE__ */ new Set([
4911
4911
  r(e.normalized);
4912
4912
  for (const i of e.spokenAliases) r(i);
4913
4913
  return t;
4914
- }, Xr = (e, t, n) => {
4914
+ }, Yr = (e, t, n) => {
4915
4915
  let r = 0;
4916
4916
  for (const i of n) {
4917
4917
  if (i.length <= r) continue;
@@ -4926,13 +4926,13 @@ var Ql = /* @__PURE__ */ new Set([
4926
4926
  o && (r = i.length);
4927
4927
  }
4928
4928
  return r;
4929
- }, xc = (e, t) => {
4929
+ }, Mc = (e, t) => {
4930
4930
  const n = [];
4931
4931
  let r = 0;
4932
4932
  for (const i of t) {
4933
- const o = Cc(i);
4933
+ const o = Oc(i);
4934
4934
  if (i.optional) {
4935
- const s = Xr(e, r, o);
4935
+ const s = Yr(e, r, o);
4936
4936
  s > 0 && (n.push({
4937
4937
  speechTokens: e.slice(r, r + s),
4938
4938
  math: i
@@ -4940,7 +4940,7 @@ var Ql = /* @__PURE__ */ new Set([
4940
4940
  continue;
4941
4941
  }
4942
4942
  for (; r < e.length; ) {
4943
- const s = Xr(e, r, o);
4943
+ const s = Yr(e, r, o);
4944
4944
  if (s > 0) {
4945
4945
  n.push({
4946
4946
  speechTokens: e.slice(r, r + s),
@@ -4952,23 +4952,23 @@ var Ql = /* @__PURE__ */ new Set([
4952
4952
  }
4953
4953
  }
4954
4954
  return n;
4955
- }, Ic = (e, t, n) => {
4955
+ }, Lc = (e, t, n) => {
4956
4956
  const r = n.filter((s) => !s.optional).length, i = e.filter((s) => !s.math.optional).length, o = e.reduce((s, a) => s + a.speechTokens.length, 0);
4957
4957
  return r > 0 && i === r && o === t.length;
4958
- }, Oc = (e) => e.map(({ speechTokens: t, math: n }) => ({
4958
+ }, Rc = (e) => e.map(({ speechTokens: t, math: n }) => ({
4959
4959
  speechTokenIds: t.map((r) => r.id),
4960
4960
  mathTokenIds: [n.id],
4961
4961
  score: 1,
4962
4962
  confidence: 1,
4963
4963
  target: n.target
4964
- })), Mc = (e) => {
4965
- const t = e.minExactWordConfidence ?? Ac, n = xc(e.speech.tokens, e.math.tokens), r = Ic(n, e.speech.tokens, e.math.tokens) ? 1 : 0;
4964
+ })), $c = (e) => {
4965
+ const t = e.minExactWordConfidence ?? Ic, n = Mc(e.speech.tokens, e.math.tokens), r = Lc(n, e.speech.tokens, e.math.tokens) ? 1 : 0;
4966
4966
  return {
4967
- segments: r >= t ? Oc(n) : [],
4967
+ segments: r >= t ? Rc(n) : [],
4968
4968
  confidence: r,
4969
4969
  fallbackTarget: e.math.expressionTarget
4970
4970
  };
4971
- }, Ao = uo(), Lc = /* @__PURE__ */ new Map([
4971
+ }, xo = fo(), Pc = /* @__PURE__ */ new Map([
4972
4972
  ["zero", "0"],
4973
4973
  ["one", "1"],
4974
4974
  ["two", "2"],
@@ -4980,17 +4980,17 @@ var Ql = /* @__PURE__ */ new Set([
4980
4980
  ["eight", "8"],
4981
4981
  ["nine", "9"],
4982
4982
  ["ten", "10"]
4983
- ]), Co = (e) => {
4983
+ ]), Io = (e) => {
4984
4984
  const t = e.toLowerCase();
4985
- return Lc.get(t) || t;
4986
- }, Rc = (e) => {
4985
+ return Pc.get(t) || t;
4986
+ }, Nc = (e) => {
4987
4987
  const t = [];
4988
- for (const n of e.matchAll(Ao)) {
4988
+ for (const n of e.matchAll(xo)) {
4989
4989
  const r = n[0], i = n.index ?? 0;
4990
4990
  t.push({
4991
4991
  id: `speech-token-${t.length}`,
4992
4992
  text: r,
4993
- normalized: Co(r),
4993
+ normalized: Io(r),
4994
4994
  start: i,
4995
4995
  end: i + r.length,
4996
4996
  sourceStart: i,
@@ -5000,11 +5000,11 @@ var Ql = /* @__PURE__ */ new Set([
5000
5000
  }
5001
5001
  return t;
5002
5002
  }, Mt = (e) => {
5003
- const t = To(e.speechText);
5003
+ const t = _o(e.speechText);
5004
5004
  return {
5005
5005
  speechText: e.speechText,
5006
5006
  spokenText: t.spokenText,
5007
- tokens: Rc(t.spokenText),
5007
+ tokens: Nc(t.spokenText),
5008
5008
  rawToSpokenOffsetMap: t.rawToSpokenOffsetMap,
5009
5009
  boundaryOffsetSpace: t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text",
5010
5010
  unsupportedSemantic: t.unsupportedSemantic,
@@ -5012,9 +5012,9 @@ var Ql = /* @__PURE__ */ new Set([
5012
5012
  };
5013
5013
  }, dr = (e) => {
5014
5014
  if (!e || /^<[^>]+>$/.test(e.trim())) return null;
5015
- const t = e.match(Ao);
5016
- return t?.[0] ? Co(t[0]) : null;
5017
- }, $c = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, Pc = (e, t) => {
5015
+ const t = e.match(xo);
5016
+ return t?.[0] ? Io(t[0]) : null;
5017
+ }, Hc = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, Bc = (e, t) => {
5018
5018
  const n = e.rawToSpokenOffsetMap.get(t);
5019
5019
  if (n !== void 0) return n;
5020
5020
  for (let r = t; r < e.speechText.length; r++) {
@@ -5025,7 +5025,7 @@ var Ql = /* @__PURE__ */ new Set([
5025
5025
  return null;
5026
5026
  }, Dn = (e, t, n) => {
5027
5027
  if (t === null) return null;
5028
- const r = $c(e.tokens, t);
5028
+ const r = Hc(e.tokens, t);
5029
5029
  return r ? {
5030
5030
  token: r,
5031
5031
  start: t,
@@ -5035,9 +5035,9 @@ var Ql = /* @__PURE__ */ new Set([
5035
5035
  }, jn = (e, t) => {
5036
5036
  const n = dr(t);
5037
5037
  return !!(e && n && e.token.normalized === n);
5038
- }, Nc = (e) => {
5038
+ }, zc = (e) => {
5039
5039
  if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
5040
- const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = Dn(e.tokenization, Pc(e.tokenization, e.position), t), r = Dn(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5040
+ const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = Dn(e.tokenization, Bc(e.tokenization, e.position), t), r = Dn(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5041
5041
  return jn(n, e.boundaryWord) ? {
5042
5042
  ...n,
5043
5043
  confidence: 1
@@ -5045,7 +5045,7 @@ var Ql = /* @__PURE__ */ new Set([
5045
5045
  ...r,
5046
5046
  confidence: 1
5047
5047
  } : e.boundaryWord && dr(e.boundaryWord) ? null : e.tokenization.boundaryOffsetSpace === "raw-ssml" ? n || r : r || n;
5048
- }, Hc = (e) => {
5048
+ }, Wc = (e) => {
5049
5049
  if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
5050
5050
  const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = Dn(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
5051
5051
  return jn(n, e.boundaryWord) ? {
@@ -5053,27 +5053,27 @@ var Ql = /* @__PURE__ */ new Set([
5053
5053
  confidence: 1
5054
5054
  } : e.boundaryWord && dr(e.boundaryWord) ? null : n;
5055
5055
  }, an = (e) => {
5056
- const t = Mt({ speechText: e.speechText }), n = kc(e.mathElement);
5056
+ const t = Mt({ speechText: e.speechText }), n = Cc(e.mathElement);
5057
5057
  return {
5058
5058
  speech: t,
5059
5059
  math: n,
5060
- result: Mc({
5060
+ result: $c({
5061
5061
  speech: t,
5062
5062
  math: n
5063
5063
  })
5064
5064
  };
5065
- }, Bc = (e, t) => {
5066
- const n = Hc({
5065
+ }, Fc = (e, t) => {
5066
+ const n = Wc({
5067
5067
  tokenization: e.speech,
5068
5068
  position: t.position,
5069
5069
  length: t.length,
5070
5070
  boundaryWord: t.boundaryWord
5071
5071
  });
5072
- return Ec({
5072
+ return xc({
5073
5073
  alignment: e.result,
5074
5074
  boundary: n
5075
5075
  });
5076
- }, zc = (e, t) => {
5076
+ }, Dc = (e, t) => {
5077
5077
  if (!t.boundaryWord || /^<[^>]+>$/.test(t.boundaryWord.trim())) return null;
5078
5078
  const n = Mt({ speechText: t.boundaryWord }).tokens[0];
5079
5079
  if (!n) return null;
@@ -5082,7 +5082,7 @@ var Ql = /* @__PURE__ */ new Set([
5082
5082
  return i.normalized.toLowerCase() === o || i.spokenAliases.some((s) => s.toLowerCase() === o);
5083
5083
  });
5084
5084
  return r.length === 1 ? r[0].target : null;
5085
- }, qn = "http://www.w3.org/1998/Math/MathML", Wc = /* @__PURE__ */ new Set([
5085
+ }, qn = "http://www.w3.org/1998/Math/MathML", jc = /* @__PURE__ */ new Set([
5086
5086
  "math",
5087
5087
  "maction",
5088
5088
  "menclose",
@@ -5116,7 +5116,7 @@ var Ql = /* @__PURE__ */ new Set([
5116
5116
  "semantics",
5117
5117
  "annotation",
5118
5118
  "annotation-xml"
5119
- ]), Fc = /* @__PURE__ */ new Set([
5119
+ ]), qc = /* @__PURE__ */ new Set([
5120
5120
  "accent",
5121
5121
  "accentunder",
5122
5122
  "align",
@@ -5168,44 +5168,44 @@ var Ql = /* @__PURE__ */ new Set([
5168
5168
  "width",
5169
5169
  "xmlns",
5170
5170
  "xml:lang"
5171
- ]), xo = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Dc = (e) => xo(e).replace(/"/g, "&quot;"), jc = (e, t) => {
5171
+ ]), Oo = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Vc = (e) => Oo(e).replace(/"/g, "&quot;"), Gc = (e, t) => {
5172
5172
  const n = e.toLowerCase(), r = t.trim().toLowerCase();
5173
- return !!(n.startsWith("on") || !Fc.has(n) || r.includes("javascript:") || r.includes("data:text/html"));
5174
- }, qc = (e) => {
5173
+ return !!(n.startsWith("on") || !qc.has(n) || r.includes("javascript:") || r.includes("data:text/html"));
5174
+ }, Uc = (e) => {
5175
5175
  const t = e.localName.toLowerCase();
5176
- if (!Wc.has(t)) return !1;
5176
+ if (!jc.has(t)) return !1;
5177
5177
  const n = e.namespaceURI;
5178
5178
  return !n || n === qn || n === "http://www.w3.org/1999/xhtml";
5179
- }, Io = (e) => {
5180
- if (e.nodeType === Node.TEXT_NODE) return xo(e.textContent || "");
5179
+ }, Mo = (e) => {
5180
+ if (e.nodeType === Node.TEXT_NODE) return Oo(e.textContent || "");
5181
5181
  if (e.nodeType === Node.COMMENT_NODE) return "";
5182
5182
  if (e.nodeType !== Node.ELEMENT_NODE) return null;
5183
5183
  const t = e;
5184
- if (!qc(t)) return null;
5184
+ if (!Uc(t)) return null;
5185
5185
  const n = t.localName.toLowerCase(), r = [];
5186
5186
  for (const o of Array.from(t.attributes)) {
5187
5187
  const s = o.name.toLowerCase();
5188
- if (!jc(s, o.value)) {
5188
+ if (!Gc(s, o.value)) {
5189
5189
  if (s === "xmlns" && o.value !== qn) return null;
5190
- r.push(`${s}="${Dc(o.value)}"`);
5190
+ r.push(`${s}="${Vc(o.value)}"`);
5191
5191
  }
5192
5192
  }
5193
5193
  n === "math" && !r.some((o) => o.startsWith("xmlns=")) && r.unshift(`xmlns="${qn}"`);
5194
5194
  const i = [];
5195
5195
  for (const o of Array.from(t.childNodes)) {
5196
- const s = Io(o);
5196
+ const s = Mo(o);
5197
5197
  if (s === null) return null;
5198
5198
  i.push(s);
5199
5199
  }
5200
5200
  return `<${n}${r.length > 0 ? ` ${r.join(" ")}` : ""}>${i.join("")}</${n}>`;
5201
- }, Vc = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, En = (e) => {
5201
+ }, Kc = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, En = (e) => {
5202
5202
  const t = String(e || "").trim();
5203
5203
  if (!t) return null;
5204
- const n = Vc(t);
5204
+ const n = Kc(t);
5205
5205
  if (!n || n.getElementsByTagName("parsererror").length > 0) return null;
5206
5206
  const r = n.documentElement;
5207
- return !r || r.localName.toLowerCase() !== "math" ? null : Io(r);
5208
- }, Oo = (e) => ({
5207
+ return !r || r.localName.toLowerCase() !== "math" ? null : Mo(r);
5208
+ }, Lo = (e) => ({
5209
5209
  chars: [],
5210
5210
  map: /* @__PURE__ */ new Map(),
5211
5211
  position: 0,
@@ -5213,28 +5213,28 @@ var Ql = /* @__PURE__ */ new Set([
5213
5213
  lastCharWasWhitespace: !1,
5214
5214
  lastMapped: null,
5215
5215
  options: e
5216
- }), Mo = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container", Lo = (e) => e.tagName?.toLowerCase() === "mjx-assistive-mml", Ro = (e) => {
5216
+ }), Ro = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container", $o = (e) => e.tagName?.toLowerCase() === "mjx-assistive-mml", Po = (e) => {
5217
5217
  const t = e.tagName?.toLowerCase();
5218
5218
  return t === "annotation" || t === "annotation-xml";
5219
- }, Gc = (e) => {
5219
+ }, Xc = (e) => {
5220
5220
  const t = e.getAttribute("data-mathml");
5221
5221
  return t && t.trim() ? t : null;
5222
- }, Uc = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, Kc = (e) => {
5222
+ }, Yc = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, Jc = (e) => {
5223
5223
  if (e.tagName.toLowerCase() === "math") return En(e.outerHTML);
5224
- const t = Gc(e);
5224
+ const t = Xc(e);
5225
5225
  if (t) {
5226
5226
  const n = En(t);
5227
5227
  if (n) return n;
5228
5228
  }
5229
- if (Mo(e)) {
5230
- const n = Uc(e);
5229
+ if (Ro(e)) {
5230
+ const n = Yc(e);
5231
5231
  if (n) {
5232
5232
  const r = En(n);
5233
5233
  if (r) return r;
5234
5234
  }
5235
5235
  }
5236
5236
  return null;
5237
- }, Xc = /* @__PURE__ */ new Set([
5237
+ }, Qc = /* @__PURE__ */ new Set([
5238
5238
  "P",
5239
5239
  "H1",
5240
5240
  "H2",
@@ -5250,7 +5250,7 @@ var Ql = /* @__PURE__ */ new Set([
5250
5250
  "FIGCAPTION",
5251
5251
  "LABEL",
5252
5252
  "BUTTON"
5253
- ]), Yc = /* @__PURE__ */ new Set([
5253
+ ]), Zc = /* @__PURE__ */ new Set([
5254
5254
  "heading",
5255
5255
  "listitem",
5256
5256
  "option",
@@ -5259,24 +5259,24 @@ var Ql = /* @__PURE__ */ new Set([
5259
5259
  "cell",
5260
5260
  "columnheader",
5261
5261
  "rowheader"
5262
- ]), Jc = (e, t) => {
5262
+ ]), eu = (e, t) => {
5263
5263
  let n = e.parentElement, r = null;
5264
5264
  for (; n && n !== t; ) {
5265
5265
  const i = (n.getAttribute("role") || "").toLowerCase(), o = n.tagName.toUpperCase();
5266
- if (Xc.has(o) || Yc.has(i)) {
5266
+ if (Qc.has(o) || Zc.has(i)) {
5267
5267
  r = n;
5268
5268
  break;
5269
5269
  }
5270
5270
  n = n.parentElement;
5271
5271
  }
5272
5272
  return r || t;
5273
- }, Qc = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || Mo(e), He = (e, t, n) => {
5273
+ }, tu = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || Ro(e), He = (e, t, n) => {
5274
5274
  /[.,;:!?]/.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), n ? (e.map.set(e.position, n), e.lastMapped = n) : e.lastMapped && e.map.set(e.position, e.lastMapped), e.position++;
5275
- }, $o = (e, t) => {
5275
+ }, No = (e, t) => {
5276
5276
  if (e.inLeadingWhitespace || e.lastCharWasWhitespace || e.chars.length === 0) return !1;
5277
5277
  const n = e.chars[e.chars.length - 1];
5278
- return fo(n, t, e.options);
5279
- }, Po = (e, t) => {
5278
+ return go(n, t, e.options);
5279
+ }, Ho = (e, t) => {
5280
5280
  const n = t.textContent || "";
5281
5281
  let r = !1;
5282
5282
  for (let i = 0; i < n.length; i++) {
@@ -5295,7 +5295,7 @@ var Ql = /* @__PURE__ */ new Set([
5295
5295
  }), e.lastCharWasWhitespace = !0;
5296
5296
  continue;
5297
5297
  }
5298
- !r && $o(e, o) && He(e, " ", {
5298
+ !r && No(e, o) && He(e, " ", {
5299
5299
  node: t,
5300
5300
  offset: i
5301
5301
  }), He(e, o, {
@@ -5303,7 +5303,7 @@ var Ql = /* @__PURE__ */ new Set([
5303
5303
  offset: i
5304
5304
  }), r = !0, e.lastCharWasWhitespace = !1;
5305
5305
  }
5306
- }, Zc = (e, t) => {
5306
+ }, nu = (e, t) => {
5307
5307
  for (let n = 0; n < t.text.length; n++) {
5308
5308
  const r = t.text[n], i = /\s/.test(r), o = t.map.get(n) || null, s = o?.node || e.lastMapped?.node || null, a = o?.offset ?? e.lastMapped?.offset ?? 0, l = o ? {
5309
5309
  node: o.node,
@@ -5320,7 +5320,7 @@ var Ql = /* @__PURE__ */ new Set([
5320
5320
  e.lastCharWasWhitespace || He(e, " ", l), e.lastCharWasWhitespace = !0;
5321
5321
  continue;
5322
5322
  }
5323
- n === 0 && $o(e, r) && He(e, " ", l), He(e, r, l), e.lastCharWasWhitespace = !1, o ? (e.map.set(e.position - 1, {
5323
+ n === 0 && No(e, r) && He(e, " ", l), He(e, r, l), e.lastCharWasWhitespace = !1, o ? (e.map.set(e.position - 1, {
5324
5324
  node: o.node,
5325
5325
  offset: o.offset
5326
5326
  }), e.lastMapped = {
@@ -5331,7 +5331,7 @@ var Ql = /* @__PURE__ */ new Set([
5331
5331
  offset: a
5332
5332
  });
5333
5333
  }
5334
- }, eu = (e) => {
5334
+ }, ru = (e) => {
5335
5335
  if (typeof DOMParser > "u") return "";
5336
5336
  const t = new DOMParser().parseFromString(e, "application/xml");
5337
5337
  if (t.getElementsByTagName("parsererror").length > 0) return "";
@@ -5343,38 +5343,38 @@ var Ql = /* @__PURE__ */ new Set([
5343
5343
  }
5344
5344
  if (i.nodeType !== 1) return;
5345
5345
  const o = i;
5346
- if (!Ro(o))
5346
+ if (!Po(o))
5347
5347
  for (const s of Array.from(o.childNodes)) r(s);
5348
5348
  };
5349
5349
  return r(t.documentElement), $(n.join(" "));
5350
- }, tu = (e, t, n) => {
5351
- const r = Oo(n), i = (a) => {
5350
+ }, iu = (e, t, n) => {
5351
+ const r = Lo(n), i = (a) => {
5352
5352
  if (ft(a, e)) return;
5353
5353
  if (a.nodeType === 3) {
5354
- Po(r, a);
5354
+ Ho(r, a);
5355
5355
  return;
5356
5356
  }
5357
5357
  if (a.nodeType !== 1) return;
5358
5358
  const l = a;
5359
- if (!(Lo(l) || Ro(l)))
5359
+ if (!($o(l) || Po(l)))
5360
5360
  for (const c of Array.from(l.childNodes)) i(c);
5361
5361
  };
5362
- i(e), No(r);
5362
+ i(e), Bo(r);
5363
5363
  const o = $(r.chars.join(""));
5364
5364
  if (o) return {
5365
5365
  text: o,
5366
5366
  map: r.map
5367
5367
  };
5368
- const s = eu(t);
5368
+ const s = ru(t);
5369
5369
  return s ? {
5370
5370
  text: s,
5371
5371
  map: /* @__PURE__ */ new Map()
5372
5372
  } : on(e, n);
5373
- }, No = (e) => {
5373
+ }, Bo = (e) => {
5374
5374
  for (; e.chars.length > 0 && /\s/.test(e.chars[e.chars.length - 1]); )
5375
5375
  e.chars.pop(), e.position--, e.map.delete(e.position);
5376
- }, nu = (e, t) => {
5377
- const n = Oo(t), r = [];
5376
+ }, ou = (e, t) => {
5377
+ const n = Lo(t), r = [];
5378
5378
  let i = 0, o, s = !1;
5379
5379
  const a = () => {
5380
5380
  const u = $(n.chars.slice(i, n.chars.length).join(""));
@@ -5386,18 +5386,18 @@ var Ql = /* @__PURE__ */ new Set([
5386
5386
  }, l = (u) => {
5387
5387
  if (ft(u, e)) return;
5388
5388
  if (u.nodeType === Node.TEXT_NODE) {
5389
- const g = Jc(u, e);
5390
- o && g !== o && a(), o = g, Po(n, u);
5389
+ const g = eu(u, e);
5390
+ o && g !== o && a(), o = g, Ho(n, u);
5391
5391
  return;
5392
5392
  }
5393
5393
  if (u.nodeType !== Node.ELEMENT_NODE) return;
5394
5394
  const h = u;
5395
- if (Lo(h)) return;
5396
- const f = Kc(h);
5395
+ if ($o(h)) return;
5396
+ const f = Jc(h);
5397
5397
  if (f) {
5398
5398
  a();
5399
- const g = tu(h, f, t);
5400
- Zc(n, g);
5399
+ const g = iu(h, f, t);
5400
+ nu(n, g);
5401
5401
  const m = $(g.text);
5402
5402
  r.push({
5403
5403
  type: "math",
@@ -5410,7 +5410,7 @@ var Ql = /* @__PURE__ */ new Set([
5410
5410
  for (const g of Array.from(h.childNodes)) l(g);
5411
5411
  };
5412
5412
  for (const u of Array.from(e.childNodes)) l(u);
5413
- No(n), a();
5413
+ Bo(n), a();
5414
5414
  const c = n.chars.join("");
5415
5415
  for (; n.map.has(c.length); ) n.map.delete(c.length);
5416
5416
  return {
@@ -5420,7 +5420,7 @@ var Ql = /* @__PURE__ */ new Set([
5420
5420
  containsMathMarkup: s
5421
5421
  };
5422
5422
  }, bt = (e, t) => {
5423
- if (!Qc(e)) {
5423
+ if (!tu(e)) {
5424
5424
  const { text: n, map: r } = on(e, t);
5425
5425
  return {
5426
5426
  visibleText: n,
@@ -5432,8 +5432,8 @@ var Ql = /* @__PURE__ */ new Set([
5432
5432
  containsMathMarkup: !1
5433
5433
  };
5434
5434
  }
5435
- return nu(e, t);
5436
- }, ru = (e, t) => go([e], t), iu = (e) => (e || "en").split("-")[0].toLowerCase() || "en", ou = /* @__PURE__ */ new Set([
5435
+ return ou(e, t);
5436
+ }, su = (e, t) => vo([e], t), au = (e) => (e || "en").split("-")[0].toLowerCase() || "en", lu = /* @__PURE__ */ new Set([
5437
5437
  "H1",
5438
5438
  "H2",
5439
5439
  "H3",
@@ -5443,17 +5443,17 @@ var Ql = /* @__PURE__ */ new Set([
5443
5443
  "LI",
5444
5444
  "LABEL",
5445
5445
  "BUTTON"
5446
- ]), su = /* @__PURE__ */ new Set([
5446
+ ]), cu = /* @__PURE__ */ new Set([
5447
5447
  "heading",
5448
5448
  "listitem",
5449
5449
  "option",
5450
5450
  "radio"
5451
- ]), au = (e) => {
5451
+ ]), uu = (e) => {
5452
5452
  if (e.type !== "text" || !e.sourceElement) return !1;
5453
5453
  const t = e.sourceElement.tagName.toUpperCase(), n = (e.sourceElement.getAttribute("role") || "").toLowerCase();
5454
- return ou.has(t) || su.has(n);
5455
- }, lu = async (e) => {
5456
- const t = e.resolveMathSpeech ?? ru, { visibleText: n } = e, r = [];
5454
+ return lu.has(t) || cu.has(n);
5455
+ }, hu = async (e) => {
5456
+ const t = e.resolveMathSpeech ?? su, { visibleText: n } = e, r = [];
5457
5457
  let i = 0;
5458
5458
  const o = (a) => {
5459
5459
  const l = $(a), c = n.indexOf(l, i), u = c >= 0 ? c : i, h = u + l.length;
@@ -5465,7 +5465,7 @@ var Ql = /* @__PURE__ */ new Set([
5465
5465
  for (let a = 0; a < e.chunks.length; a++) {
5466
5466
  const l = e.chunks[a];
5467
5467
  if (l.type === "text") {
5468
- const g = au(l) ? [{
5468
+ const g = uu(l) ? [{
5469
5469
  text: l.text,
5470
5470
  offset: 0
5471
5471
  }] : lr(l.text, { locale: e.language });
@@ -5505,38 +5505,38 @@ var Ql = /* @__PURE__ */ new Set([
5505
5505
  }
5506
5506
  return {
5507
5507
  segments: r,
5508
- locale: iu(e.language),
5508
+ locale: au(e.language),
5509
5509
  visibleText: n,
5510
5510
  plainSpeechText: $(s.join(" "))
5511
5511
  };
5512
- }, cu = (e) => (e || "en").split("-")[0].toLowerCase() || "en", uu = "sre-v1", hu = 256, Vn = (e) => Array.isArray(e) ? `array:[${e.map(Vn).join(",")}]` : e && typeof e == "object" ? `object:{${Object.entries(e).sort(([t], [n]) => t.localeCompare(n)).map(([t, n]) => `${JSON.stringify(t)}:${Vn(n)}`).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)}`, Yr = (e, t, n, r) => `${uu}\0${cu(e)}\0${t ? "ssml" : "plain"}\0${Vn(n ?? null)}\0${r}`, du = (e = {}) => {
5513
- const t = Math.max(1, e.maxEntries ?? hu), n = e.resolve ?? ((o, s) => go([o], s)), r = /* @__PURE__ */ new Map(), i = (o, s) => {
5512
+ }, du = (e) => (e || "en").split("-")[0].toLowerCase() || "en", fu = "sre-v1", pu = 256, Vn = (e) => Array.isArray(e) ? `array:[${e.map(Vn).join(",")}]` : e && typeof e == "object" ? `object:{${Object.entries(e).sort(([t], [n]) => t.localeCompare(n)).map(([t, n]) => `${JSON.stringify(t)}:${Vn(n)}`).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)}`, Jr = (e, t, n, r) => `${fu}\0${du(e)}\0${t ? "ssml" : "plain"}\0${Vn(n ?? null)}\0${r}`, gu = (e = {}) => {
5513
+ const t = Math.max(1, e.maxEntries ?? pu), n = e.resolve ?? ((o, s) => vo([o], s)), r = /* @__PURE__ */ new Map(), i = (o, s) => {
5514
5514
  for (r.delete(o), r.set(o, s); r.size > t; ) {
5515
5515
  const a = r.keys().next().value;
5516
5516
  a !== void 0 && r.delete(a);
5517
5517
  }
5518
5518
  };
5519
5519
  return async (o, s) => {
5520
- const a = gn(s.mathSpeech), l = s.produceSsml === !0, c = Yr(s.language, l, a, o.mathml), u = r.get(c);
5520
+ const a = gn(s.mathSpeech), l = s.produceSsml === !0, c = Jr(s.language, l, a, o.mathml), u = r.get(c);
5521
5521
  if (u)
5522
5522
  return r.delete(c), r.set(c, u), u;
5523
5523
  const h = await n(o, {
5524
5524
  ...s,
5525
5525
  mathSpeech: a
5526
5526
  });
5527
- return l && h.ssml && t > 1 && i(Yr(s.language, !1, a, o.mathml), {
5527
+ return l && h.ssml && t > 1 && i(Jr(s.language, !1, a, o.mathml), {
5528
5528
  speechText: h.speechText,
5529
5529
  usedMathSpeech: h.usedMathSpeech,
5530
5530
  usedFallback: h.usedFallback
5531
5531
  }), i(c, h), h;
5532
5532
  };
5533
- }, fu = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : Mt({ speechText: e }).tokens[0]?.normalized || null, pu = (e, t) => {
5533
+ }, mu = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : Mt({ speechText: e }).tokens[0]?.normalized || null, vu = (e, t) => {
5534
5534
  const n = Mt({ speechText: e.speechText });
5535
5535
  if (!Number.isFinite(t.position)) return {
5536
5536
  boundary: null,
5537
5537
  spokenText: n.spokenText
5538
5538
  };
5539
- const r = Nc({
5539
+ const r = zc({
5540
5540
  tokenization: n,
5541
5541
  position: t.position,
5542
5542
  length: t.length,
@@ -5549,8 +5549,8 @@ var Ql = /* @__PURE__ */ new Set([
5549
5549
  } : null,
5550
5550
  spokenText: n.spokenText
5551
5551
  };
5552
- }, gu = (e, t, n) => n ? Mt({ speechText: e }).tokens.find((r) => r.start <= t && t < r.end)?.normalized === n : !0, mu = (e, t) => {
5553
- const n = fu(t.word);
5552
+ }, yu = (e, t, n) => n ? Mt({ speechText: e }).tokens.find((r) => r.start <= t && t < r.end)?.normalized === n : !0, bu = (e, t) => {
5553
+ const n = mu(t.word);
5554
5554
  if (e.id !== t.chunkId) return {
5555
5555
  chunkId: t.chunkId,
5556
5556
  normalizedWord: n,
@@ -5569,12 +5569,12 @@ var Ql = /* @__PURE__ */ new Set([
5569
5569
  };
5570
5570
  let r, i;
5571
5571
  if (e.catalogAlignment)
5572
- r = lc(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
5572
+ r = hc(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
5573
5573
  else {
5574
- const o = pu(e, t);
5574
+ const o = vu(e, t);
5575
5575
  r = o.boundary, i = o.spokenText;
5576
5576
  }
5577
- return r ? gu(i, r.start, n) ? {
5577
+ return r ? yu(i, r.start, n) ? {
5578
5578
  chunkId: e.id,
5579
5579
  normalizedWord: n,
5580
5580
  chunkSpokenStart: r.start,
@@ -5614,12 +5614,12 @@ var Ql = /* @__PURE__ */ new Set([
5614
5614
  quality: "region",
5615
5615
  confidence: e.confidence,
5616
5616
  reason: e.reason
5617
- }, Ho = /* @__PURE__ */ new Map([
5617
+ }, zo = /* @__PURE__ */ new Map([
5618
5618
  ["mi", "mjx-mi"],
5619
5619
  ["mn", "mjx-mn"],
5620
5620
  ["mo", "mjx-mo"],
5621
5621
  ["mtext", "mjx-mtext"]
5622
- ]), Gn = "mi,mn,mo,mtext", Bo = "mjx-mi,mjx-mn,mjx-mo,mjx-mtext", zo = [
5622
+ ]), Gn = "mi,mn,mo,mtext", Wo = "mjx-mi,mjx-mn,mjx-mo,mjx-mtext", Fo = [
5623
5623
  "mjx-mfrac",
5624
5624
  "mjx-msqrt",
5625
5625
  "mjx-mroot",
@@ -5627,14 +5627,14 @@ var Ql = /* @__PURE__ */ new Set([
5627
5627
  "mjx-munder",
5628
5628
  "mjx-mover",
5629
5629
  "mjx-munderover"
5630
- ].join(","), Wo = (e) => e.type === "text-range" ? e.node.parentElement : e.element, mn = (e) => {
5630
+ ].join(","), Do = (e) => e.type === "text-range" ? e.node.parentElement : e.element, mn = (e) => {
5631
5631
  let t = e;
5632
5632
  for (; t; ) {
5633
5633
  if (t.localName?.toLowerCase() === "mjx-container") return t;
5634
5634
  t = t.parentElement;
5635
5635
  }
5636
5636
  return null;
5637
- }, Jr = (e) => !e || mn(e) ? !1 : !ft(e), Fo = (e) => {
5637
+ }, Qr = (e) => !e || mn(e) ? !1 : !ft(e), jo = (e) => {
5638
5638
  const t = e.getBoundingClientRect?.();
5639
5639
  return !!(t && t.width > 0 && t.height > 0);
5640
5640
  }, Un = (e) => {
@@ -5644,38 +5644,38 @@ var Ql = /* @__PURE__ */ new Set([
5644
5644
  t = t.parentElement;
5645
5645
  }
5646
5646
  return null;
5647
- }, Do = (e, t) => {
5647
+ }, qo = (e, t) => {
5648
5648
  if (e.length === 0 || e.length !== t.length) return !1;
5649
5649
  for (let n = 0; n < e.length; n += 1) {
5650
- const r = Ho.get(e[n].localName.toLowerCase());
5650
+ const r = zo.get(e[n].localName.toLowerCase());
5651
5651
  if (!r || t[n].localName.toLowerCase() !== r) return !1;
5652
5652
  }
5653
5653
  return !0;
5654
- }, vu = (e, t) => {
5655
- if (!e || !Ho.has(e.localName.toLowerCase()) || t.querySelector(zo)) return null;
5654
+ }, Tu = (e, t) => {
5655
+ if (!e || !zo.has(e.localName.toLowerCase()) || t.querySelector(Fo)) return null;
5656
5656
  const n = Un(e), r = t.querySelector("mjx-math");
5657
5657
  if (!n || !r) return null;
5658
5658
  const i = Array.from(n.querySelectorAll(Gn)), o = i.indexOf(e);
5659
5659
  if (o < 0) return null;
5660
- const s = Array.from(r.querySelectorAll(Bo));
5661
- if (!Do(i, s)) return null;
5660
+ const s = Array.from(r.querySelectorAll(Wo));
5661
+ if (!qo(i, s)) return null;
5662
5662
  const a = s[o];
5663
- return !a || !Fo(a) ? null : a;
5664
- }, yu = (e) => {
5663
+ return !a || !jo(a) ? null : a;
5664
+ }, Su = (e) => {
5665
5665
  const t = mn(e);
5666
5666
  if (t) {
5667
- if (t.querySelector(zo)) return "expression";
5667
+ if (t.querySelector(Fo)) return "expression";
5668
5668
  const r = Un(e) ?? e, i = t.querySelector("mjx-math");
5669
5669
  if (!i) return "expression";
5670
- const o = Array.from(r.querySelectorAll(Gn)), s = Array.from(i.querySelectorAll(Bo));
5671
- return Do(o, s) && s.some((a) => Fo(a)) ? "token" : "expression";
5670
+ const o = Array.from(r.querySelectorAll(Gn)), s = Array.from(i.querySelectorAll(Wo));
5671
+ return qo(o, s) && s.some((a) => jo(a)) ? "token" : "expression";
5672
5672
  }
5673
5673
  const n = Un(e) ?? e;
5674
5674
  return Array.from(n.querySelectorAll(Gn)).some((r) => !ft(r)) ? "token" : "expression";
5675
5675
  }, Kn = (e) => {
5676
- const t = Wo(e), n = mn(t);
5676
+ const t = Do(e), n = mn(t);
5677
5677
  if (n) {
5678
- const r = vu(t, n);
5678
+ const r = Tu(t, n);
5679
5679
  return r ? {
5680
5680
  type: "element",
5681
5681
  quality: "semantic-token",
@@ -5686,35 +5686,35 @@ var Ql = /* @__PURE__ */ new Set([
5686
5686
  element: n
5687
5687
  };
5688
5688
  }
5689
- return e.type === "text-range" ? Jr(e.node.parentElement) ? {
5689
+ return e.type === "text-range" ? Qr(e.node.parentElement) ? {
5690
5690
  type: "text-range",
5691
5691
  quality: "semantic-token",
5692
5692
  node: e.node,
5693
5693
  startOffset: e.startOffset,
5694
5694
  endOffset: e.endOffset
5695
- } : null : Jr(e.element) ? {
5695
+ } : null : Qr(e.element) ? {
5696
5696
  type: "element",
5697
5697
  quality: e.quality === "region-fallback" ? "expression" : "semantic-token",
5698
5698
  element: e.element
5699
5699
  } : null;
5700
- }, bu = Kn, Tu = () => {
5700
+ }, _u = Kn, wu = () => {
5701
5701
  const e = /* @__PURE__ */ new WeakMap();
5702
5702
  return (t) => {
5703
- const n = Wo(t), r = mn(n);
5703
+ const n = Do(t), r = mn(n);
5704
5704
  if (!n || !r) return Kn(t);
5705
5705
  if (e.has(n)) return e.get(n) ?? null;
5706
5706
  const i = Kn(t);
5707
5707
  return e.set(n, i), i;
5708
5708
  };
5709
- }, Su = (e, t, n, r = e.mathAlignments, i = bu) => {
5709
+ }, ku = (e, t, n, r = e.mathAlignments, i = _u) => {
5710
5710
  if (t.chunkSpokenStart === null || t.chunkSpokenEnd === null) return null;
5711
5711
  let o = null;
5712
5712
  for (const s of r) {
5713
- const a = Bc(s.alignment, {
5713
+ const a = Fc(s.alignment, {
5714
5714
  position: t.chunkSpokenStart,
5715
5715
  length: Math.max(1, t.chunkSpokenEnd - t.chunkSpokenStart),
5716
5716
  boundaryWord: n.word
5717
- }) || zc(s.alignment, { boundaryWord: n.word });
5717
+ }) || Dc(s.alignment, { boundaryWord: n.word });
5718
5718
  if (!a) continue;
5719
5719
  const l = i(a);
5720
5720
  if (l) {
@@ -5723,7 +5723,7 @@ var Ql = /* @__PURE__ */ new Set([
5723
5723
  }
5724
5724
  }
5725
5725
  return o;
5726
- }, jo = (e, t, n) => {
5726
+ }, Vo = (e, t, n) => {
5727
5727
  if (!e || typeof document > "u" || n <= t) return null;
5728
5728
  const r = e.get(t);
5729
5729
  let i = e.get(Math.max(t, n - 1));
@@ -5735,17 +5735,17 @@ var Ql = /* @__PURE__ */ new Set([
5735
5735
  } catch {
5736
5736
  return null;
5737
5737
  }
5738
- }, _u = (e, t) => {
5738
+ }, Eu = (e, t) => {
5739
5739
  if (!e.catalogAlignment || t.chunkSpokenStart === null) return null;
5740
- const n = cc(e.catalogAlignment, t.chunkSpokenStart);
5740
+ const n = dc(e.catalogAlignment, t.chunkSpokenStart);
5741
5741
  if (!n) return null;
5742
- const r = jo(e.visibleMap, n.start, n.end);
5742
+ const r = Vo(e.visibleMap, n.start, n.end);
5743
5743
  return r ? {
5744
5744
  type: "range",
5745
5745
  quality: e.catalogAlignment.playbackMode === "exact-word" ? "exact-word" : "semantic-token",
5746
5746
  range: r
5747
5747
  } : null;
5748
- }, wu = (e) => e.regionRange ? {
5748
+ }, Au = (e) => e.regionRange ? {
5749
5749
  type: "range",
5750
5750
  quality: "region",
5751
5751
  range: e.regionRange
@@ -5753,43 +5753,43 @@ var Ql = /* @__PURE__ */ new Set([
5753
5753
  type: "element",
5754
5754
  quality: "region",
5755
5755
  element: e.regionElement
5756
- } : null, Qr = (e, t = e.chunk.mathAlignments) => {
5756
+ } : null, Zr = (e, t = e.chunk.mathAlignments) => {
5757
5757
  if (t.length !== 1) return null;
5758
5758
  const n = t[0]?.alignment.result.fallbackTarget;
5759
5759
  return n ? e.renderedMathTargetResolver(n) : null;
5760
- }, ku = (e, t) => e ? t.mathAlignments.filter(({ element: n }) => {
5760
+ }, Cu = (e, t) => e ? t.mathAlignments.filter(({ element: n }) => {
5761
5761
  try {
5762
5762
  return e.type === "range" ? e.range.intersectsNode(n) : e.type === "element" ? e.element === n || e.element.contains(n) : e.node.parentElement?.contains(n) || !1;
5763
5763
  } catch {
5764
5764
  return !1;
5765
5765
  }
5766
- }) : t.mathAlignments, Zr = () => ({
5766
+ }) : t.mathAlignments, ei = () => ({
5767
5767
  activeTarget: null,
5768
5768
  regionTarget: null,
5769
5769
  quality: "region",
5770
5770
  confidence: 0,
5771
5771
  reason: "boundary chunk id was not found"
5772
- }), ei = (e) => e.length === 1 ? e[0].element : null, Eu = (e, t) => t.length > 0 && t.every(({ element: n }) => e.mathCapabilityByElement.get(n) === "token"), Au = 3, Cu = (e, t, n) => {
5772
+ }), ti = (e) => e.length === 1 ? e[0].element : null, xu = (e, t) => t.length > 0 && t.every(({ element: n }) => e.mathCapabilityByElement.get(n) === "token"), Iu = 3, Ou = (e, t, n) => {
5773
5773
  if (!t || t.type !== "range") return !1;
5774
5774
  const { startContainer: r, endContainer: i } = t.range;
5775
- return r === i && r.nodeType === Au ? !1 : n.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(r) && o.contains(i));
5776
- }, xu = (e, t) => ({
5775
+ return r === i && r.nodeType === Iu ? !1 : n.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(r) && o.contains(i));
5776
+ }, Mu = (e, t) => ({
5777
5777
  chunk: e,
5778
- regionTarget: wu(e),
5779
- renderedMathTargetResolver: Tu(),
5780
- mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: n }) => [n, t ? yu(n) : "expression"])),
5778
+ regionTarget: Au(e),
5779
+ renderedMathTargetResolver: wu(),
5780
+ mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: n }) => [n, t ? Su(n) : "expression"])),
5781
5781
  heldTokenByElement: /* @__PURE__ */ new Map()
5782
- }), Iu = (e) => {
5783
- const t = e.mathTokenHighlighting !== !1, n = new Map(e.chunks.map((r) => [r.id, xu(r, t)]));
5782
+ }), Lu = (e) => {
5783
+ const t = e.mathTokenHighlighting !== !1, n = new Map(e.chunks.map((r) => [r.id, Mu(r, t)]));
5784
5784
  return {
5785
5785
  chunks: e.chunks,
5786
5786
  resolveInitial(r) {
5787
5787
  const i = n.get(r);
5788
- if (!i) return Zr();
5788
+ if (!i) return ei();
5789
5789
  const o = i.chunk.mathAlignments, s = o.length === 1 ? o[0].element : null, a = s ? i.mathCapabilityByElement.get(s) : null;
5790
5790
  return Ze(a === "expression" ? {
5791
5791
  semanticTarget: null,
5792
- expressionTarget: Qr(i),
5792
+ expressionTarget: Zr(i),
5793
5793
  regionTarget: i.regionTarget,
5794
5794
  confidence: 0.5,
5795
5795
  reason: "initial expression (sticky expression mode)"
@@ -5803,10 +5803,10 @@ var Ql = /* @__PURE__ */ new Set([
5803
5803
  },
5804
5804
  resolveBoundary(r) {
5805
5805
  const i = n.get(r.chunkId);
5806
- if (!i) return Zr();
5807
- const { chunk: o } = i, s = mu(o, r), a = _u(o, s), l = ku(a, o), c = (!a || l.length > 0 ? Su(o, s, r, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, h = c && c.quality === "expression" ? c : null;
5806
+ if (!i) return ei();
5807
+ const { chunk: o } = i, s = bu(o, r), a = Eu(o, s), l = Cu(a, o), c = (!a || l.length > 0 ? ku(o, s, r, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, h = c && c.quality === "expression" ? c : null;
5808
5808
  if (u) {
5809
- const f = ei(l);
5809
+ const f = ti(l);
5810
5810
  return f && i.heldTokenByElement.set(f, u), Ze({
5811
5811
  semanticTarget: u,
5812
5812
  expressionTarget: null,
@@ -5815,15 +5815,15 @@ var Ql = /* @__PURE__ */ new Set([
5815
5815
  reason: s.reason
5816
5816
  });
5817
5817
  }
5818
- if (a && (t ? !Cu(i, a, l) : l.length === 0)) return Ze({
5818
+ if (a && (t ? !Ou(i, a, l) : l.length === 0)) return Ze({
5819
5819
  semanticTarget: a,
5820
5820
  expressionTarget: null,
5821
5821
  regionTarget: i.regionTarget,
5822
5822
  confidence: s.confidence,
5823
5823
  reason: s.reason
5824
5824
  });
5825
- if (Eu(i, l)) {
5826
- const f = ei(l), g = f ? i.heldTokenByElement.get(f) ?? null : null;
5825
+ if (xu(i, l)) {
5826
+ const f = ti(l), g = f ? i.heldTokenByElement.get(f) ?? null : null;
5827
5827
  return Ze({
5828
5828
  semanticTarget: g,
5829
5829
  expressionTarget: null,
@@ -5834,21 +5834,21 @@ var Ql = /* @__PURE__ */ new Set([
5834
5834
  }
5835
5835
  return Ze({
5836
5836
  semanticTarget: null,
5837
- expressionTarget: h ?? Qr(i, l),
5837
+ expressionTarget: h ?? Zr(i, l),
5838
5838
  regionTarget: i.regionTarget,
5839
5839
  confidence: s.confidence,
5840
5840
  reason: s.reason
5841
5841
  });
5842
5842
  }
5843
5843
  };
5844
- }, Ou = (e) => {
5844
+ }, Ru = (e) => {
5845
5845
  if (e.alignment?.boundaryOffsetMode) return e.alignment.boundaryOffsetMode;
5846
5846
  const t = e.mathAlignment?.speech.boundaryOffsetSpace;
5847
5847
  return t || "plain-spoken-text";
5848
- }, Mu = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
5848
+ }, $u = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
5849
5849
  element: e.sourceElement,
5850
5850
  alignment: e.mathAlignment
5851
- }] : [], Lu = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
5851
+ }] : [], Pu = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
5852
5852
  speechText: e.speechText || "",
5853
5853
  visibleText: e.visibleText || e.speechText || "",
5854
5854
  sourceElement: e.sourceElement || e.contentRoot,
@@ -5865,9 +5865,9 @@ var Ql = /* @__PURE__ */ new Set([
5865
5865
  regionRange: t.regionRange,
5866
5866
  visibleMap: t.visibleMap,
5867
5867
  catalogAlignment: t.alignment,
5868
- mathAlignments: Mu(t),
5869
- offsetSpace: Ou(t)
5870
- })), Ru = [
5868
+ mathAlignments: $u(t),
5869
+ offsetSpace: Ru(t)
5870
+ })), Nu = [
5871
5871
  "[data-pie-tts-region]",
5872
5872
  "[data-catalog-region]",
5873
5873
  "li",
@@ -5877,18 +5877,18 @@ var Ql = /* @__PURE__ */ new Set([
5877
5877
  "[role='group']",
5878
5878
  "[role='region']",
5879
5879
  "div"
5880
- ].join(","), qo = (e, t) => {
5881
- const n = e.closest(Ru);
5880
+ ].join(","), Go = (e, t) => {
5881
+ const n = e.closest(Nu);
5882
5882
  return n && t.contains(n) ? n : e;
5883
- }, $u = (e, t, n) => {
5883
+ }, Hu = (e, t, n) => {
5884
5884
  const r = /* @__PURE__ */ new Map();
5885
5885
  for (let i = t; i < n; i++) {
5886
5886
  const o = e.get(i);
5887
5887
  o && r.set(i - t, o);
5888
5888
  }
5889
5889
  return r;
5890
- }, Pu = async (e) => {
5891
- const t = bt(e.contentRoot, e.textProcessingOptions), n = await lu({
5890
+ }, Bu = async (e) => {
5891
+ const t = bt(e.contentRoot, e.textProcessingOptions), n = await hu({
5892
5892
  chunks: t.chunks,
5893
5893
  visibleText: t.visibleText,
5894
5894
  language: e.language,
@@ -5906,8 +5906,8 @@ var Ql = /* @__PURE__ */ new Set([
5906
5906
  segment: r,
5907
5907
  anchor: {
5908
5908
  sourceElement: a,
5909
- regionElement: qo(a, e.contentRoot),
5910
- visibleMap: $u(t.map, r.visibleSpan.start, r.visibleSpan.end)
5909
+ regionElement: Go(a, e.contentRoot),
5910
+ visibleMap: Hu(t.map, r.visibleSpan.start, r.visibleSpan.end)
5911
5911
  }
5912
5912
  };
5913
5913
  }
@@ -5927,8 +5927,8 @@ var Ql = /* @__PURE__ */ new Set([
5927
5927
  containsMathMarkup: t.containsMathMarkup,
5928
5928
  visibleText: t.visibleText
5929
5929
  };
5930
- }, Nu = (e, t) => {
5931
- const n = _o({
5930
+ }, zu = (e, t) => {
5931
+ const n = ko({
5932
5932
  speechText: e.spokenText,
5933
5933
  visibleText: e.spokenText
5934
5934
  });
@@ -5937,13 +5937,13 @@ var Ql = /* @__PURE__ */ new Set([
5937
5937
  visibleText: e.visibleText,
5938
5938
  sourceElement: t.sourceElement,
5939
5939
  regionElement: t.regionElement,
5940
- regionRange: jo(t.visibleMap, 0, e.visibleText.length) ?? void 0,
5940
+ regionRange: Vo(t.visibleMap, 0, e.visibleText.length) ?? void 0,
5941
5941
  speechMatchesVisibleText: !0,
5942
5942
  playbackMode: n.playbackMode,
5943
5943
  alignment: n,
5944
5944
  visibleMap: t.visibleMap
5945
5945
  };
5946
- }, Vo = (e, t) => {
5946
+ }, Uo = (e, t) => {
5947
5947
  const n = t.sourceElement;
5948
5948
  return {
5949
5949
  speechText: e.spokenText,
@@ -5956,7 +5956,7 @@ var Ql = /* @__PURE__ */ new Set([
5956
5956
  speechText: e.spokenText
5957
5957
  }) : void 0
5958
5958
  };
5959
- }, Hu = (e, t, n) => {
5959
+ }, Wu = (e, t, n) => {
5960
5960
  const r = t.sourceElement;
5961
5961
  return {
5962
5962
  speechText: n,
@@ -5968,15 +5968,15 @@ var Ql = /* @__PURE__ */ new Set([
5968
5968
  mathElement: r,
5969
5969
  speechText: n
5970
5970
  }) : void 0,
5971
- plainFallback: Vo(e, t)
5971
+ plainFallback: Uo(e, t)
5972
5972
  };
5973
- }, Bu = (e, t = {}) => e.items.map(({ segment: n, anchor: r }) => n.kind === "prose" ? Nu(n, r) : t.format === "ssml" && n.ssml ? Hu(n, r, n.ssml) : Vo(n, r)), zu = "pie-tts-control-handoff", I;
5973
+ }, Fu = (e, t = {}) => e.items.map(({ segment: n, anchor: r }) => n.kind === "prose" ? zu(n, r) : t.format === "ssml" && n.ssml ? Wu(n, r, n.ssml) : Uo(n, r)), Du = "pie-tts-control-handoff", I;
5974
5974
  (function(e) {
5975
5975
  e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
5976
5976
  })(I || (I = {}));
5977
- var Wu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, Fu = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? Wu(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, Du = class Xn {
5977
+ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, qu = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? ju(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, Vu = class Xn {
5978
5978
  constructor() {
5979
- p(this, "currentProvider", null), p(this, "provider", null), p(this, "highlightCoordinator", null), p(this, "catalogResolver", null), p(this, "state", I.IDLE), p(this, "ttsConfig", {}), p(this, "currentText", null), p(this, "currentContentElement", null), p(this, "normalizedToDOM", /* @__PURE__ */ new Map()), p(this, "listeners", /* @__PURE__ */ new Map()), p(this, "lastError", null), p(this, "speakRunId", 0), p(this, "currentBoundaryOffset", 0), p(this, "seekSegments", []), p(this, "sentenceHighlightSegments", []), p(this, "currentSeekSegmentIndex", 0), p(this, "activeSentenceStartOffset", null), p(this, "activeHighlightMode", "word"), p(this, "lastRenderedRegionTarget", null), p(this, "telemetryReporter", null), p(this, "generatedMathSpeechResolver", du());
5979
+ p(this, "currentProvider", null), p(this, "provider", null), p(this, "highlightCoordinator", null), p(this, "catalogResolver", null), p(this, "state", I.IDLE), p(this, "ttsConfig", {}), p(this, "currentText", null), p(this, "currentContentElement", null), p(this, "normalizedToDOM", /* @__PURE__ */ new Map()), p(this, "listeners", /* @__PURE__ */ new Map()), p(this, "lastError", null), p(this, "speakRunId", 0), p(this, "currentBoundaryOffset", 0), p(this, "seekSegments", []), p(this, "sentenceHighlightSegments", []), p(this, "currentSeekSegmentIndex", 0), p(this, "activeSentenceStartOffset", null), p(this, "activeHighlightMode", "word"), p(this, "lastRenderedRegionTarget", null), p(this, "telemetryReporter", null), p(this, "generatedMathSpeechResolver", gu());
5980
5980
  }
5981
5981
  debugLog(t, n) {
5982
5982
  Xn.debugEnabled && (n === void 0 ? console.debug(t) : console.debug(t, n));
@@ -6099,7 +6099,7 @@ var Wu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6099
6099
  return t.includes("<") ? /<\s*break\b|<\s*speak\b|<\s*prosody\b|<\s*p\b|<\s*s\b/i.test(t) : !1;
6100
6100
  }
6101
6101
  isElementHidden(t) {
6102
- return ho(t);
6102
+ return po(t);
6103
6103
  }
6104
6104
  getBoundaryStrength(t) {
6105
6105
  const n = Number(t.getAttribute("data-tts-break-ms"));
@@ -6351,7 +6351,7 @@ var Wu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6351
6351
  }
6352
6352
  async switchProviderToBrowser(t, n) {
6353
6353
  if (!this.currentProvider) return !1;
6354
- const r = new lo(), i = this.currentProvider.providerId, o = { ...this.ttsConfig }, s = n?.operation || "tts-initialize", a = n?.contentToSpeak ?? "", l = a.replace(/\s+/g, " ").trim().slice(0, 120), c = a.length > 0 ? {
6354
+ const r = new uo(), i = this.currentProvider.providerId, o = { ...this.ttsConfig }, s = n?.operation || "tts-initialize", a = n?.contentToSpeak ?? "", l = a.replace(/\s+/g, " ").trim().slice(0, 120), c = a.length > 0 ? {
6355
6355
  textLength: a.length,
6356
6356
  textPreview: l.length < a.length ? `${l}…` : l
6357
6357
  } : {};
@@ -6507,7 +6507,7 @@ var Wu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6507
6507
  const h = u, f = s(h);
6508
6508
  if (f) {
6509
6509
  o();
6510
- const g = bt(h, this.getTextProcessingOptions(n.language)), m = g.visibleText || $(h.textContent || ""), v = _o({
6510
+ const g = bt(h, this.getTextProcessingOptions(n.language)), m = g.visibleText || $(h.textContent || ""), v = ko({
6511
6511
  speechText: f.content,
6512
6512
  visibleText: m
6513
6513
  }), y = a(h, m), S = y ? an({
@@ -6524,7 +6524,7 @@ var Wu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6524
6524
  speechText: f.content,
6525
6525
  visibleText: m,
6526
6526
  sourceElement: h,
6527
- regionElement: qo(h, t),
6527
+ regionElement: Go(h, t),
6528
6528
  speechMatchesVisibleText: V === m,
6529
6529
  playbackMode: v.playbackMode,
6530
6530
  alignment: v,
@@ -6543,7 +6543,7 @@ var Wu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6543
6543
  return !t || t.providerId?.toLowerCase() === "browser" ? "plain" : t.getCapabilities?.().supportsSSML ? "ssml" : "plain";
6544
6544
  }
6545
6545
  async resolveGeneratedSpeechContent(t, n, r) {
6546
- const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await Pu({
6546
+ const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await Bu({
6547
6547
  contentRoot: t,
6548
6548
  language: r,
6549
6549
  mathSpeech: this.getMathSpeechOptions(),
@@ -6560,7 +6560,7 @@ var Wu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6560
6560
  containsMathMarkup: !1,
6561
6561
  speechMatchesVisibleText: !0
6562
6562
  };
6563
- const c = Bu(o, { format: i }), u = o.plainSpeechText;
6563
+ const c = Fu(o, { format: i }), u = o.plainSpeechText;
6564
6564
  return {
6565
6565
  contentToSpeak: u,
6566
6566
  speechText: u,
@@ -6633,7 +6633,7 @@ var Wu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6633
6633
  }
6634
6634
  }
6635
6635
  highlightRenderableRegionTarget(t) {
6636
- if (!(!this.highlightCoordinator || !t || typeof document > "u") && !Fu(this.lastRenderedRegionTarget, t))
6636
+ if (!(!this.highlightCoordinator || !t || typeof document > "u") && !qu(this.lastRenderedRegionTarget, t))
6637
6637
  try {
6638
6638
  const n = document.createRange();
6639
6639
  if (t.type === "element") n.selectNodeContents(t.element);
@@ -6684,10 +6684,10 @@ var Wu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6684
6684
  async speakCatalogChunkOnce(t, n) {
6685
6685
  if (!this.provider) return;
6686
6686
  this.lastRenderedRegionTarget = null;
6687
- const r = t.regionElement || t.sourceElement || this.currentContentElement, i = r ? Lu({
6687
+ const r = t.regionElement || t.sourceElement || this.currentContentElement, i = r ? Pu({
6688
6688
  contentRoot: r,
6689
6689
  chunks: [t]
6690
- })[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? Iu({
6690
+ })[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? Lu({
6691
6691
  chunks: [i],
6692
6692
  mathTokenHighlighting: o
6693
6693
  }) : null;
@@ -6798,7 +6798,7 @@ var Wu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6798
6798
  this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.setState(I.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);
6799
6799
  }
6800
6800
  requestControlHandoff() {
6801
- typeof window > "u" || window.dispatchEvent(new CustomEvent(zu, { detail: { source: "host" } }));
6801
+ typeof window > "u" || window.dispatchEvent(new CustomEvent(Du, { detail: { source: "host" } }));
6802
6802
  }
6803
6803
  isPlaying() {
6804
6804
  return this.state === I.PLAYING;
@@ -6869,14 +6869,14 @@ var Wu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
6869
6869
  });
6870
6870
  }
6871
6871
  };
6872
- p(Du, "debugEnabled", (() => {
6872
+ p(Vu, "debugEnabled", (() => {
6873
6873
  try {
6874
6874
  if (typeof process < "u" && process.env?.PIE_TTS_DEBUG === "1") return !0;
6875
6875
  } catch {
6876
6876
  }
6877
6877
  return globalThis.__PIE_TTS_DEBUG__ === !0;
6878
6878
  })());
6879
- var hh = Xa({
6879
+ var mh = Qa({
6880
6880
  policy: {
6881
6881
  allowed: [],
6882
6882
  blocked: []
@@ -6887,7 +6887,7 @@ var hh = Xa({
6887
6887
  passage: []
6888
6888
  },
6889
6889
  providers: {}
6890
- }), Go, Ie = class ee {
6890
+ }), Ko, Ie = class ee {
6891
6891
  constructor() {
6892
6892
  p(this, "elementType", "multiple-choice"), p(this, "priority", 100);
6893
6893
  }
@@ -6936,28 +6936,39 @@ var hh = Xa({
6936
6936
  for (const n of t.querySelectorAll(".feedback-tick")) n.setAttribute(ee.FEEDBACK_HOOK_ATTR, "true");
6937
6937
  }
6938
6938
  };
6939
- Go = Ie;
6939
+ Ko = Ie;
6940
6940
  p(Ie, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
6941
6941
  p(Ie, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label");
6942
6942
  p(Ie, "ROOT_HOOK_ATTR", "data-pie-answer-eliminator-root");
6943
6943
  p(Ie, "FEEDBACK_HOOK_ATTR", "data-pie-answer-eliminator-feedback-tick");
6944
- p(Ie, "CHOICE_SELECTOR", `[${Go.CHOICE_HOOK_ATTR}="true"], .corespring-checkbox, .corespring-radio-button`);
6945
- var ju = class {
6944
+ p(Ie, "CHOICE_SELECTOR", `[${Ko.CHOICE_HOOK_ATTR}="true"], .corespring-checkbox, .corespring-radio-button`);
6945
+ var Xo = "ebsr-multiple-choice", Gu = `${Xo}--version-`, fr = (e) => {
6946
+ if (!(e instanceof HTMLElement)) return !1;
6947
+ const t = e.tagName.toLowerCase();
6948
+ return t === Xo || t.startsWith(Gu);
6949
+ }, ni = (e, t) => Array.from(e.querySelectorAll(`[id="${t}"]`)).find(fr) ?? null, Uu = (e) => {
6950
+ let t = e.parentElement;
6951
+ for (; t !== null; ) {
6952
+ if (fr(t)) return t;
6953
+ t = t.parentElement;
6954
+ }
6955
+ return null;
6956
+ }, Ku = class {
6946
6957
  constructor() {
6947
- p(this, "elementType", "ebsr"), p(this, "priority", 95), p(this, "mcAdapter", new Ie());
6958
+ p(this, "elementType", "ebsr"), p(this, "priority", 110), p(this, "mcAdapter", new Ie());
6948
6959
  }
6949
6960
  canHandle(e) {
6950
- return e.tagName.toLowerCase() === "ebsr" || e.querySelector("ebsr-multiple-choice") !== null;
6961
+ return e.tagName.toLowerCase() === "ebsr" || Array.from(e.querySelectorAll("*")).some(fr);
6951
6962
  }
6952
6963
  findChoices(e) {
6953
- const t = e.querySelector('ebsr-multiple-choice[id="a"]'), n = e.querySelector('ebsr-multiple-choice[id="b"]'), r = [];
6964
+ const t = ni(e, "a"), n = ni(e, "b"), r = [];
6954
6965
  return t && r.push(...this.mcAdapter.findChoices(t)), n && r.push(...this.mcAdapter.findChoices(n)), r;
6955
6966
  }
6956
6967
  createChoiceRange(e) {
6957
6968
  return this.mcAdapter.createChoiceRange(e);
6958
6969
  }
6959
6970
  getChoiceId(e) {
6960
- return `${e.closest("ebsr-multiple-choice")?.id || "unknown"}-${this.mcAdapter.getChoiceId(e)}`;
6971
+ return `${Uu(e)?.id || "unknown"}-${this.mcAdapter.getChoiceId(e)}`;
6961
6972
  }
6962
6973
  getChoiceLabel(e) {
6963
6974
  return this.mcAdapter.getChoiceLabel(e);
@@ -6968,7 +6979,7 @@ var ju = class {
6968
6979
  getButtonContainer(e) {
6969
6980
  return this.mcAdapter.getButtonContainer(e);
6970
6981
  }
6971
- }, qu = class {
6982
+ }, Xu = class {
6972
6983
  constructor() {
6973
6984
  p(this, "elementType", "inline-dropdown"), p(this, "priority", 90);
6974
6985
  }
@@ -6994,12 +7005,12 @@ var ju = class {
6994
7005
  getButtonContainer(e) {
6995
7006
  return e;
6996
7007
  }
6997
- }, Vu = class {
7008
+ }, Yu = class {
6998
7009
  constructor() {
6999
7010
  p(this, "adapters", void 0), this.adapters = [
7000
7011
  new Ie(),
7001
- new ju(),
7002
- new qu()
7012
+ new Ku(),
7013
+ new Xu()
7003
7014
  ].sort((e, t) => t.priority - e.priority);
7004
7015
  }
7005
7016
  findAdapter(e) {
@@ -7210,9 +7221,9 @@ p(_e, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
7210
7221
  p(_e, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label");
7211
7222
  p(_e, "ELIMINATED_ATTR", "data-pie-answer-eliminated");
7212
7223
  p(_e, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
7213
- var fr = class Tt {
7224
+ var pr = class Tt {
7214
7225
  constructor(t = "strikethrough", n = "right") {
7215
- p(this, "registry", void 0), p(this, "strategy", void 0), p(this, "eliminatedChoices", /* @__PURE__ */ new Set()), p(this, "choiceElements", /* @__PURE__ */ new Map()), p(this, "choiceButtons", /* @__PURE__ */ new Map()), p(this, "choiceAdapters", /* @__PURE__ */ new Map()), p(this, "buttonAlignment", "right"), p(this, "shouldRestoreState", !0), p(this, "storeIntegration", null), this.registry = new Vu(), this.strategy = this.createStrategy(t), this.strategy.initialize(), this.buttonAlignment = n;
7226
+ p(this, "registry", void 0), p(this, "strategy", void 0), p(this, "eliminatedChoices", /* @__PURE__ */ new Set()), p(this, "choiceElements", /* @__PURE__ */ new Map()), p(this, "choiceButtons", /* @__PURE__ */ new Map()), p(this, "choiceAdapters", /* @__PURE__ */ new Map()), p(this, "buttonAlignment", "right"), p(this, "shouldRestoreState", !0), p(this, "storeIntegration", null), this.registry = new Yu(), this.strategy = this.createStrategy(t), this.strategy.initialize(), this.buttonAlignment = n;
7216
7227
  }
7217
7228
  createStrategy(t) {
7218
7229
  return t === "mask" ? new Qe() : new _e();
@@ -7354,22 +7365,22 @@ var fr = class Tt {
7354
7365
  this.cleanupButtons(), this.strategy.destroy();
7355
7366
  }
7356
7367
  };
7357
- p(fr, "TOGGLE_CLASS", "pie-answer-eliminator-toggle");
7358
- p(fr, "TOGGLE_ACTIVE_CLASS", "pie-answer-eliminator-toggle--active");
7359
- var Gu = /* @__PURE__ */ Ta('<div style="display: none;" aria-hidden="true"></div>');
7360
- function Uu(e, t) {
7361
- hi(t, !0);
7368
+ p(pr, "TOGGLE_CLASS", "pie-answer-eliminator-toggle");
7369
+ p(pr, "TOGGLE_ACTIVE_CLASS", "pie-answer-eliminator-toggle--active");
7370
+ var Ju = /* @__PURE__ */ wa('<div style="display: none;" aria-hidden="true"></div>');
7371
+ function Qu(e, t) {
7372
+ fi(t, !0);
7362
7373
  let n = we(t, "visible", 7, !1), r = we(t, "toolId", 7, "answerEliminator"), i = we(t, "strategy", 7, "strikethrough"), o = we(t, "alwaysOn", 7, !1), s = we(t, "buttonAlignment", 7, "right"), a = we(t, "scopeElement", 7, null), l = we(t, "elementToolStateStore", 7, null), c = we(t, "globalElementId", 7, ""), u = /* @__PURE__ */ F(null), h = /* @__PURE__ */ F(null), f = /* @__PURE__ */ F(null);
7363
- const g = /* @__PURE__ */ Er(() => b(h)?.toolCoordinator);
7364
- let m = /* @__PURE__ */ F(null), v = /* @__PURE__ */ F(null), y = /* @__PURE__ */ F(null), S = /* @__PURE__ */ F(null), O = /* @__PURE__ */ Er(() => o() || n());
7374
+ const g = /* @__PURE__ */ Ar(() => b(h)?.toolCoordinator);
7375
+ let m = /* @__PURE__ */ F(null), v = /* @__PURE__ */ F(null), y = /* @__PURE__ */ F(null), S = /* @__PURE__ */ F(null), O = /* @__PURE__ */ Ar(() => o() || n());
7365
7376
  Re(() => {
7366
7377
  if (b(u))
7367
- return Fa(b(u), (C) => {
7378
+ return qa(b(u), (C) => {
7368
7379
  M(h, C, !0);
7369
7380
  });
7370
7381
  }), Re(() => {
7371
7382
  if (b(u))
7372
- return Da(b(u), (C) => {
7383
+ return Va(b(u), (C) => {
7373
7384
  M(f, C, !0);
7374
7385
  });
7375
7386
  });
@@ -7396,7 +7407,7 @@ function Uu(e, t) {
7396
7407
  !b(g) || !r() || (b(S) && b(y) && (b(S) !== b(g) || b(y) !== r()) && (b(S).unregisterTool(b(y)), M(S, null), M(y, null)), b(y) || (b(g).registerTool(r(), "Answer Eliminator", void 0, zn.MODAL), M(S, b(g), !0), M(y, r())));
7397
7408
  }), Re(() => {
7398
7409
  b(m) && l() && c() && b(m).setStoreIntegration(l(), c());
7399
- }), Ca(() => (M(m, new fr(i(), s()), !0), b(m) && l() && c() && b(m).setStoreIntegration(l(), c()), b(O) ? A() : b(m).cleanup(), () => {
7410
+ }), Oa(() => (M(m, new pr(i(), s()), !0), b(m) && l() && c() && b(m).setStoreIntegration(l(), c()), b(O) ? A() : b(m).cleanup(), () => {
7400
7411
  b(m)?.destroy(), M(m, null), b(S) && b(y) && (b(S).unregisterTool(b(y)), M(S, null), M(y, null));
7401
7412
  })), Re(() => {
7402
7413
  const C = b(f)?.contextVersion ?? null;
@@ -7459,10 +7470,10 @@ function Uu(e, t) {
7459
7470
  set globalElementId(C = "") {
7460
7471
  c(C), pe();
7461
7472
  }
7462
- }, pt = Gu();
7463
- return Oa(pt, (C) => M(u, C), () => b(u)), Xi(e, pt), di(Z);
7473
+ }, pt = Ju();
7474
+ return Ra(pt, (C) => M(u, C), () => b(u)), Ji(e, pt), pi(Z);
7464
7475
  }
7465
- customElements.define("pie-tool-answer-eliminator", $a(Uu, {
7476
+ customElements.define("pie-tool-answer-eliminator", Ha(Qu, {
7466
7477
  visible: {
7467
7478
  attribute: "visible",
7468
7479
  type: "Boolean"
@@ -7488,7 +7499,7 @@ customElements.define("pie-tool-answer-eliminator", $a(Uu, {
7488
7499
  globalElementId: { type: "String" }
7489
7500
  }, [], [], { mode: "open" }));
7490
7501
  export {
7491
- Uu as default,
7492
- Yu as n,
7493
- Xu as t
7502
+ Qu as default,
7503
+ th as n,
7504
+ eh as t
7494
7505
  };