@pie-players/pie-tool-answer-eliminator 0.3.51 → 0.3.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -26
- package/dist/tool-answer-eliminator.js +760 -626
- package/package.json +4 -4
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as f } from "./defineProperty-Dt7ri80W.js";
|
|
2
|
-
var
|
|
2
|
+
var ts = Object.create, si = Object.defineProperty, ns = Object.getOwnPropertyDescriptor, rs = Object.getOwnPropertyNames, is = Object.getPrototypeOf, os = Object.prototype.hasOwnProperty, ah = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), ss = (e, t, n, r) => {
|
|
3
3
|
if (t && typeof t == "object" || typeof t == "function")
|
|
4
|
-
for (var i =
|
|
5
|
-
a = i[o], !
|
|
4
|
+
for (var i = rs(t), o = 0, s = i.length, a; o < s; o++)
|
|
5
|
+
a = i[o], !os.call(e, a) && a !== n && si(e, a, {
|
|
6
6
|
get: ((l) => t[l]).bind(null, a),
|
|
7
|
-
enumerable: !(r =
|
|
7
|
+
enumerable: !(r = ns(t, a)) || r.enumerable
|
|
8
8
|
});
|
|
9
9
|
return e;
|
|
10
|
-
},
|
|
10
|
+
}, as = (e, t, n) => (n = e != null ? ts(is(e)) : {}, ss(t || !e || !e.__esModule ? si(n, "default", {
|
|
11
11
|
value: e,
|
|
12
12
|
enumerable: !0
|
|
13
13
|
}) : n, e)), lh = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, n) => (typeof require < "u" ? require : t)[n] }) : e)(function(e) {
|
|
@@ -19,12 +19,12 @@ if (typeof window < "u") {
|
|
|
19
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
|
|
22
|
+
var ls = Array.isArray, cs = Array.prototype.indexOf, Vt = Array.prototype.includes, us = Array.from, Gt = Object.keys, Ut = Object.defineProperty, We = Object.getOwnPropertyDescriptor, hs = Object.prototype, ds = Array.prototype, fs = Object.getPrototypeOf, yr = Object.isExtensible, ps = () => {
|
|
23
23
|
};
|
|
24
|
-
function
|
|
24
|
+
function gs(e) {
|
|
25
25
|
for (var t = 0; t < e.length; t++) e[t]();
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function ms() {
|
|
28
28
|
var e, t;
|
|
29
29
|
return {
|
|
30
30
|
promise: new Promise((n, r) => {
|
|
@@ -34,73 +34,73 @@ function gs() {
|
|
|
34
34
|
reject: t
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
var ch = 1 << 24, ae = 1024, le = 2048, Ye = 4096, ai = 8192,
|
|
37
|
+
var ch = 1 << 24, ae = 1024, le = 2048, Ye = 4096, ai = 8192, vs = 16384, li = 32768, br = 1 << 25, ci = 65536, uh = 1 << 17, hh = 1 << 18, Ct = 1 << 19, ys = 1 << 20, xt = 65536, Tr = 1 << 21, dh = 1 << 22, ui = 1 << 23, St = /* @__PURE__ */ Symbol("$state"), hi = /* @__PURE__ */ Symbol("legacy props"), bs = /* @__PURE__ */ Symbol("proxy path"), Ts = /* @__PURE__ */ Symbol("attributes"), Ss = /* @__PURE__ */ Symbol("class"), _s = /* @__PURE__ */ Symbol("style"), ws = /* @__PURE__ */ Symbol("text"), Yn = new class extends Error {
|
|
38
38
|
constructor(...t) {
|
|
39
39
|
super(...t), f(this, "name", "StaleReactionError"), f(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
40
40
|
}
|
|
41
41
|
}(), ph = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
|
|
42
|
-
function
|
|
42
|
+
function Es(e) {
|
|
43
43
|
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
|
|
44
44
|
}
|
|
45
45
|
function ks(e) {
|
|
46
46
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function As() {
|
|
49
49
|
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function Cs(e) {
|
|
52
52
|
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function xs() {
|
|
55
55
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Is() {
|
|
58
58
|
throw new Error("https://svelte.dev/e/hydration_failed");
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Os(e) {
|
|
61
61
|
throw new Error("https://svelte.dev/e/props_invalid_value");
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Ms() {
|
|
64
64
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Rs() {
|
|
67
67
|
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
68
68
|
}
|
|
69
69
|
function Ls() {
|
|
70
70
|
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function $s() {
|
|
73
73
|
throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Ps() {
|
|
76
76
|
console.warn("https://svelte.dev/e/derived_inert");
|
|
77
77
|
}
|
|
78
78
|
function di(e) {
|
|
79
79
|
console.warn("https://svelte.dev/e/hydration_mismatch");
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function Ns() {
|
|
82
82
|
console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
|
|
83
83
|
}
|
|
84
84
|
var re = !1;
|
|
85
|
-
function
|
|
85
|
+
function Rt(e) {
|
|
86
86
|
re = e;
|
|
87
87
|
}
|
|
88
88
|
var D;
|
|
89
|
-
function
|
|
89
|
+
function Et(e) {
|
|
90
90
|
if (e === null)
|
|
91
91
|
throw di(), qt;
|
|
92
92
|
return D = e;
|
|
93
93
|
}
|
|
94
94
|
function fi() {
|
|
95
|
-
return
|
|
95
|
+
return Et(/* @__PURE__ */ dt(D));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Hs(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
|
|
103
|
+
function Ws(e = !0) {
|
|
104
104
|
for (var t = 0, n = D; ; ) {
|
|
105
105
|
if (n.nodeType === 8) {
|
|
106
106
|
var r = n.data;
|
|
@@ -124,24 +124,24 @@ function gi(e) {
|
|
|
124
124
|
}
|
|
125
125
|
var Ce = !1, It = !1;
|
|
126
126
|
function Sr(e, t) {
|
|
127
|
-
return e.label = t,
|
|
127
|
+
return e.label = t, zs(e.v, t), e;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
return e?.[
|
|
129
|
+
function zs(e, t) {
|
|
130
|
+
return e?.[bs]?.(t), e;
|
|
131
131
|
}
|
|
132
|
-
var
|
|
132
|
+
var R = null;
|
|
133
133
|
function Kt(e) {
|
|
134
|
-
|
|
134
|
+
R = e;
|
|
135
135
|
}
|
|
136
136
|
function mi(e, t = !1, n) {
|
|
137
|
-
|
|
138
|
-
p:
|
|
137
|
+
R = {
|
|
138
|
+
p: R,
|
|
139
139
|
i: !1,
|
|
140
140
|
c: null,
|
|
141
141
|
e: null,
|
|
142
142
|
s: e,
|
|
143
143
|
x: null,
|
|
144
|
-
r:
|
|
144
|
+
r: k,
|
|
145
145
|
l: It && !t ? {
|
|
146
146
|
s: null,
|
|
147
147
|
u: null,
|
|
@@ -150,20 +150,20 @@ function mi(e, t = !1, n) {
|
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
function vi(e) {
|
|
153
|
-
var t =
|
|
153
|
+
var t = R, n = t.e;
|
|
154
154
|
if (n !== null) {
|
|
155
155
|
t.e = null;
|
|
156
156
|
for (var r of n) ji(r);
|
|
157
157
|
}
|
|
158
|
-
return e !== void 0 && (t.x = e), t.i = !0,
|
|
158
|
+
return e !== void 0 && (t.x = e), t.i = !0, R = t.p, e ?? {};
|
|
159
159
|
}
|
|
160
160
|
function ln() {
|
|
161
|
-
return !It ||
|
|
161
|
+
return !It || R !== null && R.l === null;
|
|
162
162
|
}
|
|
163
163
|
var $e = [];
|
|
164
164
|
function yi() {
|
|
165
165
|
var e = $e;
|
|
166
|
-
$e = [],
|
|
166
|
+
$e = [], gs(e);
|
|
167
167
|
}
|
|
168
168
|
function at(e) {
|
|
169
169
|
if ($e.length === 0 && !_t) {
|
|
@@ -174,13 +174,13 @@ function at(e) {
|
|
|
174
174
|
}
|
|
175
175
|
$e.push(e);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function Fs() {
|
|
178
178
|
for (; $e.length > 0; ) yi();
|
|
179
179
|
}
|
|
180
180
|
function bi(e) {
|
|
181
|
-
var t =
|
|
181
|
+
var t = k;
|
|
182
182
|
if (t === null)
|
|
183
|
-
return
|
|
183
|
+
return E.f |= ui, e;
|
|
184
184
|
if ((t.f & 32768) === 0 && (t.f & 4) === 0)
|
|
185
185
|
throw e;
|
|
186
186
|
it(e, t);
|
|
@@ -200,9 +200,9 @@ function it(e, t) {
|
|
|
200
200
|
}
|
|
201
201
|
throw e;
|
|
202
202
|
}
|
|
203
|
-
var
|
|
203
|
+
var Ds = ~(le | Ye | ae);
|
|
204
204
|
function P(e, t) {
|
|
205
|
-
e.f = e.f &
|
|
205
|
+
e.f = e.f & Ds | t;
|
|
206
206
|
}
|
|
207
207
|
function Jn(e) {
|
|
208
208
|
(e.f & 512) !== 0 || e.deps === null ? P(e, ae) : P(e, Ye);
|
|
@@ -215,13 +215,13 @@ function Ti(e) {
|
|
|
215
215
|
function Si(e, t, n) {
|
|
216
216
|
(e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && n.add(e), Ti(e.deps), P(e, ae);
|
|
217
217
|
}
|
|
218
|
-
var
|
|
219
|
-
function
|
|
220
|
-
var t =
|
|
218
|
+
var js = !1, Lt = !1;
|
|
219
|
+
function qs(e) {
|
|
220
|
+
var t = Lt;
|
|
221
221
|
try {
|
|
222
|
-
return
|
|
222
|
+
return Lt = !1, [e(), Lt];
|
|
223
223
|
} finally {
|
|
224
|
-
|
|
224
|
+
Lt = t;
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
function _i(e, t) {
|
|
@@ -243,16 +243,16 @@ function T(e, t, n) {
|
|
|
243
243
|
function d(e, t) {
|
|
244
244
|
return e.get(_(e, t));
|
|
245
245
|
}
|
|
246
|
-
var wi, Xt = null, et = null, x = null,
|
|
247
|
-
var
|
|
246
|
+
var wi, Xt = null, et = null, x = null, kn = null, z = null, An = null, _t = !1, vn = !1, lt = null, Yt = null, Ei = 0;
|
|
247
|
+
var Vs = 1, Jt = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Cn = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakSet(), ht = class ki {
|
|
248
248
|
constructor() {
|
|
249
|
-
Qn(this,
|
|
249
|
+
Qn(this, L), f(this, "id", Vs++), w(this, Jt, !1), f(this, "linked", !0), w(this, Be, null), w(this, Pe, null), f(this, "async_deriveds", /* @__PURE__ */ new Map()), f(this, "current", /* @__PURE__ */ new Map()), f(this, "previous", /* @__PURE__ */ new Map()), w(this, Qt, /* @__PURE__ */ new Set()), w(this, $t, /* @__PURE__ */ new Set()), w(this, tt, 0), w(this, Re, /* @__PURE__ */ new Map()), w(this, mt, null), w(this, J, []), w(this, Cn, []), w(this, Ge, /* @__PURE__ */ new Set()), w(this, me, /* @__PURE__ */ new Set()), w(this, Ae, /* @__PURE__ */ new Map()), w(this, Wt, /* @__PURE__ */ new Set()), f(this, "is_fork", !1), w(this, vt, !1), et === null ? Xt = et = this : (T(Pe, et, this), T(Be, this, et)), et = this;
|
|
250
250
|
}
|
|
251
251
|
skip_effect(t) {
|
|
252
252
|
d(Ae, this).has(t) || d(Ae, this).set(t, {
|
|
253
253
|
d: [],
|
|
254
254
|
m: []
|
|
255
|
-
}), d(
|
|
255
|
+
}), d(Wt, this).delete(t);
|
|
256
256
|
}
|
|
257
257
|
unskip_effect(t, n = (r) => this.schedule(r)) {
|
|
258
258
|
var r = d(Ae, this).get(t);
|
|
@@ -263,7 +263,7 @@ var qs = 1, Jt = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap
|
|
|
263
263
|
for (i of r.m)
|
|
264
264
|
P(i, Ye), n(i);
|
|
265
265
|
}
|
|
266
|
-
d(
|
|
266
|
+
d(Wt, this).add(t);
|
|
267
267
|
}
|
|
268
268
|
capture(t, n, r = !1) {
|
|
269
269
|
t.v !== H && !this.previous.has(t) && this.previous.set(t, t.v), (t.f & 8388608) === 0 && (this.current.set(t, [n, r]), z?.set(t, n)), this.is_fork || (t.v = n);
|
|
@@ -276,28 +276,28 @@ var qs = 1, Jt = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap
|
|
|
276
276
|
}
|
|
277
277
|
flush() {
|
|
278
278
|
try {
|
|
279
|
-
vn = !0, x = this, _(
|
|
279
|
+
vn = !0, x = this, _(L, this, Zt).call(this);
|
|
280
280
|
} finally {
|
|
281
|
-
|
|
281
|
+
Ei = 0, An = null, lt = null, Yt = null, vn = !1, x = null, z = null, De.clear();
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
discard() {
|
|
285
285
|
for (const t of d($t, this)) t(this);
|
|
286
|
-
d($t, this).clear(), _(
|
|
286
|
+
d($t, this).clear(), _(L, this, en).call(this), d(mt, this)?.resolve();
|
|
287
287
|
}
|
|
288
288
|
register_created_effect(t) {
|
|
289
289
|
d(Cn, this).push(t);
|
|
290
290
|
}
|
|
291
291
|
increment(t, n) {
|
|
292
292
|
if (T(tt, this, d(tt, this) + 1), t) {
|
|
293
|
-
let r = d(
|
|
294
|
-
d(
|
|
293
|
+
let r = d(Re, this).get(n) ?? 0;
|
|
294
|
+
d(Re, this).set(n, r + 1);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
decrement(t, n) {
|
|
298
298
|
if (T(tt, this, d(tt, this) - 1), t) {
|
|
299
|
-
let r = d(
|
|
300
|
-
r === 1 ? d(
|
|
299
|
+
let r = d(Re, this).get(n) ?? 0;
|
|
300
|
+
r === 1 ? d(Re, this).delete(n) : d(Re, this).set(n, r - 1);
|
|
301
301
|
}
|
|
302
302
|
d(vt, this) || (T(vt, this, !0), at(() => {
|
|
303
303
|
T(vt, this, !1), this.linked && this.flush();
|
|
@@ -315,11 +315,11 @@ var qs = 1, Jt = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap
|
|
|
315
315
|
d($t, this).add(t);
|
|
316
316
|
}
|
|
317
317
|
settled() {
|
|
318
|
-
return (d(mt, this) ?? T(mt, this,
|
|
318
|
+
return (d(mt, this) ?? T(mt, this, ms())).promise;
|
|
319
319
|
}
|
|
320
320
|
static ensure() {
|
|
321
321
|
if (x === null) {
|
|
322
|
-
const t = x = new
|
|
322
|
+
const t = x = new ki();
|
|
323
323
|
!vn && !_t && at(() => {
|
|
324
324
|
d(Jt, t) || t.flush();
|
|
325
325
|
});
|
|
@@ -327,7 +327,7 @@ var qs = 1, Jt = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap
|
|
|
327
327
|
return x;
|
|
328
328
|
}
|
|
329
329
|
apply() {
|
|
330
|
-
if (!Ce || !this.is_fork && d(
|
|
330
|
+
if (!Ce || !this.is_fork && d(Be, this) === null && d(Pe, this) === null) {
|
|
331
331
|
z = null;
|
|
332
332
|
return;
|
|
333
333
|
}
|
|
@@ -355,7 +355,7 @@ var qs = 1, Jt = /* @__PURE__ */ new WeakMap(), We = /* @__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 ===
|
|
358
|
+
if (lt !== null && n === k && (Ce || (E === null || (E.f & 2) === 0) && !js))
|
|
359
359
|
return;
|
|
360
360
|
if ((r & 96) !== 0) {
|
|
361
361
|
if ((r & 1024) === 0) return;
|
|
@@ -368,7 +368,7 @@ var qs = 1, Jt = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap
|
|
|
368
368
|
wi = ht;
|
|
369
369
|
function _r() {
|
|
370
370
|
if (this.is_fork) return !0;
|
|
371
|
-
for (const n of d(
|
|
371
|
+
for (const n of d(Re, this).keys()) {
|
|
372
372
|
for (var e = n, t = !1; e.parent !== null; ) {
|
|
373
373
|
if (d(Ae, this).has(e)) {
|
|
374
374
|
t = !0;
|
|
@@ -381,7 +381,7 @@ function _r() {
|
|
|
381
381
|
return !1;
|
|
382
382
|
}
|
|
383
383
|
function Zt() {
|
|
384
|
-
T(Jt, this, !0),
|
|
384
|
+
T(Jt, this, !0), Ei++ > 1e3 && (_(L, this, en).call(this), Xs());
|
|
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,34 +390,34 @@ 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
|
-
_(
|
|
393
|
+
_(L, this, Ai).call(this, a, t, n);
|
|
394
394
|
} catch (l) {
|
|
395
|
-
throw Ii(a), _(
|
|
395
|
+
throw Ii(a), _(L, this, _r).call(this) || this.discard(), l;
|
|
396
396
|
}
|
|
397
397
|
if (x = null, r.length > 0) {
|
|
398
398
|
var i = wi.ensure();
|
|
399
399
|
for (const a of r) i.schedule(a);
|
|
400
400
|
}
|
|
401
|
-
if (lt = null, Yt = null, _(
|
|
402
|
-
_(
|
|
401
|
+
if (lt = null, Yt = null, _(L, this, _r).call(this)) {
|
|
402
|
+
_(L, this, yt).call(this, n), _(L, this, yt).call(this, t);
|
|
403
403
|
for (const [a, l] of d(Ae, this)) xi(a, l);
|
|
404
|
-
r.length > 0 && _(
|
|
404
|
+
r.length > 0 && _(L, x, Zt).call(x);
|
|
405
405
|
return;
|
|
406
406
|
}
|
|
407
|
-
const o = _(
|
|
407
|
+
const o = _(L, this, Gs).call(this);
|
|
408
408
|
if (o) {
|
|
409
|
-
_(
|
|
409
|
+
_(L, this, yt).call(this, n), _(L, this, yt).call(this, t), _(L, o, Us).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(),
|
|
414
|
+
d(Qt, this).clear(), kn = this, wr(n), wr(t), kn = null, d(mt, this)?.resolve();
|
|
415
415
|
var s = x;
|
|
416
|
-
if (d(tt, this) === 0 && (d(J, this).length === 0 || s !== null) && (_(
|
|
416
|
+
if (d(tt, this) === 0 && (d(J, this).length === 0 || s !== null) && (_(L, this, en).call(this), Ce && (_(L, this, Ks).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
|
-
s !== null && _(
|
|
420
|
+
s !== null && _(L, s, Zt).call(s);
|
|
421
421
|
}
|
|
422
422
|
function Ai(e, t, n) {
|
|
423
423
|
e.f ^= ae;
|
|
@@ -441,16 +441,16 @@ function Ai(e, t, n) {
|
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
function
|
|
445
|
-
for (var e = d(
|
|
444
|
+
function Gs() {
|
|
445
|
+
for (var e = d(Be, 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;
|
|
448
448
|
}
|
|
449
|
-
e = d(
|
|
449
|
+
e = d(Be, e);
|
|
450
450
|
}
|
|
451
451
|
return null;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function Us(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) {
|
|
@@ -471,12 +471,12 @@ function Gs(e) {
|
|
|
471
471
|
}
|
|
472
472
|
};
|
|
473
473
|
for (const n of this.current.keys()) t(n);
|
|
474
|
-
this.oncommit(() => e.discard()), _(
|
|
474
|
+
this.oncommit(() => e.discard()), _(L, e, en).call(e), x = this, _(L, this, Zt).call(this);
|
|
475
475
|
}
|
|
476
476
|
function yt(e) {
|
|
477
477
|
for (var t = 0; t < e.length; t += 1) Si(e[t], d(Ge, this), d(me, this));
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function Ks() {
|
|
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, p]] of this.current) {
|
|
@@ -496,8 +496,8 @@ function Us() {
|
|
|
496
496
|
if (r.length === 0)
|
|
497
497
|
e && c.discard();
|
|
498
498
|
else if (t.length > 0) {
|
|
499
|
-
if (e) for (const u of d(
|
|
500
|
-
(h.f & 4194320) !== 0 ? c.schedule(h) : _(
|
|
499
|
+
if (e) for (const u of d(Wt, this)) c.unskip_effect(u, (h) => {
|
|
500
|
+
(h.f & 4194320) !== 0 ? c.schedule(h) : _(L, c, yt).call(c, [h]);
|
|
501
501
|
});
|
|
502
502
|
c.activate();
|
|
503
503
|
var i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
@@ -511,7 +511,7 @@ function Us() {
|
|
|
511
511
|
for (const u of d(Cn, 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)) _(
|
|
514
|
+
for (var l of d(J, c)) _(L, c, Ai).call(c, l, [], []);
|
|
515
515
|
T(J, c, []);
|
|
516
516
|
}
|
|
517
517
|
c.deactivate();
|
|
@@ -521,8 +521,8 @@ function Us() {
|
|
|
521
521
|
}
|
|
522
522
|
function en() {
|
|
523
523
|
if (this.linked) {
|
|
524
|
-
var e = d(
|
|
525
|
-
e === null ? Xt = t : T(Pe, e, t), t === null ? et = e : T(
|
|
524
|
+
var e = d(Be, this), t = d(Pe, this);
|
|
525
|
+
e === null ? Xt = t : T(Pe, e, t), t === null ? et = e : T(Be, t, e), this.linked = !1;
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
function pe(e) {
|
|
@@ -531,21 +531,21 @@ 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 (
|
|
534
|
+
if (Fs(), x === null) return n;
|
|
535
535
|
x.flush();
|
|
536
536
|
}
|
|
537
537
|
} finally {
|
|
538
538
|
_t = t;
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function Xs() {
|
|
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
|
-
|
|
548
|
+
xs();
|
|
549
549
|
} catch (n) {
|
|
550
550
|
it(n, An);
|
|
551
551
|
}
|
|
@@ -607,7 +607,7 @@ function Ii(e) {
|
|
|
607
607
|
for (var t = e.first; t !== null; )
|
|
608
608
|
Ii(t), t = t.next;
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function Ys(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,28 +617,28 @@ function Xs(e) {
|
|
|
617
617
|
})));
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
|
-
var
|
|
621
|
-
function
|
|
622
|
-
new
|
|
620
|
+
var Js = ci | Ct;
|
|
621
|
+
function Qs(e, t, n, r) {
|
|
622
|
+
new Zs(e, t, n, r);
|
|
623
623
|
}
|
|
624
|
-
var ie = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(),
|
|
624
|
+
var ie = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), Er = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakSet(), Zs = class {
|
|
625
625
|
constructor(e, t, n, r) {
|
|
626
|
-
Qn(this,
|
|
626
|
+
Qn(this, W), f(this, "parent", void 0), f(this, "is_pending", !1), f(this, "transform_error", void 0), w(this, ie, void 0), w(this, xn, re ? D : null), w(this, ue, void 0), w(this, kt, void 0), w(this, Q, void 0), w(this, he, null), w(this, K, null), w(this, te, null), w(this, ze, null), w(this, nt, 0), w(this, Fe, 0), w(this, Pt, !1), w(this, In, /* @__PURE__ */ new Set()), w(this, On, /* @__PURE__ */ new Set()), w(this, Oe, null), w(this, Er, Ys(() => (T(Oe, this, cn(d(nt, this))), () => {
|
|
627
627
|
T(Oe, this, null);
|
|
628
|
-
}))), T(ie, this, e), T(ue, this, t), T(
|
|
629
|
-
var o =
|
|
628
|
+
}))), T(ie, this, e), T(ue, this, t), T(kt, this, (i) => {
|
|
629
|
+
var o = k;
|
|
630
630
|
o.b = this, o.f |= 128, n(i);
|
|
631
|
-
}), this.parent =
|
|
631
|
+
}), this.parent = k.b, this.transform_error = r ?? this.parent?.transform_error ?? ((i) => i), T(Q, this, va(() => {
|
|
632
632
|
if (re) {
|
|
633
633
|
const i = d(xn, this);
|
|
634
634
|
fi();
|
|
635
635
|
const o = i.data === "[!";
|
|
636
636
|
if (i.data.startsWith("[?")) {
|
|
637
637
|
const s = JSON.parse(i.data.slice(2));
|
|
638
|
-
_(
|
|
639
|
-
} else o ? _(
|
|
640
|
-
} else _(
|
|
641
|
-
},
|
|
638
|
+
_(W, this, ta).call(this, s);
|
|
639
|
+
} else o ? _(W, this, na).call(this) : _(W, this, ea).call(this);
|
|
640
|
+
} else _(W, this, Oi).call(this);
|
|
641
|
+
}, Js)), re && T(ie, this, D);
|
|
642
642
|
}
|
|
643
643
|
defer_effect(e) {
|
|
644
644
|
Si(e, d(In, this), d(On, this));
|
|
@@ -650,53 +650,53 @@ var ie = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), ue =
|
|
|
650
650
|
return !!d(ue, this).pending;
|
|
651
651
|
}
|
|
652
652
|
update_pending_count(e, t) {
|
|
653
|
-
_(
|
|
653
|
+
_(W, this, Mi).call(this, e, t), T(nt, this, d(nt, this) + e), !(!d(Oe, this) || d(Pt, this)) && (T(Pt, this, !0), at(() => {
|
|
654
654
|
T(Pt, this, !1), d(Oe, this) && Pi(d(Oe, this), d(nt, this));
|
|
655
655
|
}));
|
|
656
656
|
}
|
|
657
657
|
get_effect_pending() {
|
|
658
|
-
return d(
|
|
658
|
+
return d(Er, 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
|
-
_(
|
|
664
|
-
})) : _(
|
|
663
|
+
_(W, this, kr).call(this, e);
|
|
664
|
+
})) : _(W, this, kr).call(this, e);
|
|
665
665
|
}
|
|
666
666
|
};
|
|
667
|
-
function
|
|
667
|
+
function ea() {
|
|
668
668
|
try {
|
|
669
|
-
T(he, this, Ue(() => d(
|
|
669
|
+
T(he, this, Ue(() => d(kt, this).call(this, d(ie, this))));
|
|
670
670
|
} catch (e) {
|
|
671
671
|
this.error(e);
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function ta(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
|
|
681
|
+
function na() {
|
|
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
684
|
var t = T(ze, this, document.createDocumentFragment()), n = zi();
|
|
685
|
-
t.append(n), T(he, this, _(
|
|
685
|
+
t.append(n), T(he, this, _(W, this, Mn).call(this, () => Ue(() => d(kt, this).call(this, n)))), d(Fe, this) === 0 && (d(ie, this).before(t), T(ze, this, null), un(d(K, this), () => {
|
|
686
686
|
T(K, this, null);
|
|
687
|
-
}), _(
|
|
687
|
+
}), _(W, this, tr).call(this, x));
|
|
688
688
|
}));
|
|
689
689
|
}
|
|
690
690
|
function Oi() {
|
|
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
|
-
d(
|
|
693
|
+
d(kt, this).call(this, d(ie, this));
|
|
694
694
|
})), d(Fe, this) > 0) {
|
|
695
695
|
var e = T(ze, this, document.createDocumentFragment());
|
|
696
|
-
|
|
696
|
+
Ta(d(he, this), e);
|
|
697
697
|
const t = d(ue, this).pending;
|
|
698
698
|
T(K, this, Ue(() => t(d(ie, this))));
|
|
699
|
-
} else _(
|
|
699
|
+
} else _(W, this, tr).call(this, x);
|
|
700
700
|
} catch (t) {
|
|
701
701
|
this.error(t);
|
|
702
702
|
}
|
|
@@ -705,7 +705,7 @@ function tr(e) {
|
|
|
705
705
|
this.is_pending = !1, e.transfer_effects(d(In, this), d(On, this));
|
|
706
706
|
}
|
|
707
707
|
function Mn(e) {
|
|
708
|
-
var t =
|
|
708
|
+
var t = k, n = E, r = R;
|
|
709
709
|
xe(d(Q, this)), de(d(Q, this)), Kt(d(Q, this).ctx);
|
|
710
710
|
try {
|
|
711
711
|
return ht.ensure(), e();
|
|
@@ -719,28 +719,28 @@ function Mi(e, t) {
|
|
|
719
719
|
if (!this.has_pending_snippet()) {
|
|
720
720
|
if (this.parent) {
|
|
721
721
|
var n;
|
|
722
|
-
_(
|
|
722
|
+
_(W, n = this.parent, Mi).call(n, e, t);
|
|
723
723
|
}
|
|
724
724
|
return;
|
|
725
725
|
}
|
|
726
|
-
T(Fe, this, d(Fe, this) + e), d(Fe, this) === 0 && (_(
|
|
726
|
+
T(Fe, this, d(Fe, this) + e), d(Fe, this) === 0 && (_(W, this, tr).call(this, t), d(K, this) && un(d(K, this), () => {
|
|
727
727
|
T(K, this, null);
|
|
728
728
|
}), d(ze, this) && (d(ie, this).before(d(ze, this)), T(ze, this, null)));
|
|
729
729
|
}
|
|
730
|
-
function
|
|
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 && (
|
|
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 && (Et(d(xn, this)), Hs(), Et(Ws()));
|
|
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
|
-
|
|
737
|
+
Ns();
|
|
738
738
|
return;
|
|
739
739
|
}
|
|
740
|
-
r = !0, i &&
|
|
740
|
+
r = !0, i && $s(), d(te, this) !== null && un(d(te, this), () => {
|
|
741
741
|
T(te, this, null);
|
|
742
|
-
}), _(
|
|
743
|
-
_(
|
|
742
|
+
}), _(W, this, Mn).call(this, () => {
|
|
743
|
+
_(W, this, Oi).call(this);
|
|
744
744
|
});
|
|
745
745
|
}, s = (a) => {
|
|
746
746
|
try {
|
|
@@ -748,10 +748,10 @@ function Er(e) {
|
|
|
748
748
|
} catch (l) {
|
|
749
749
|
it(l, d(Q, this) && d(Q, this).parent);
|
|
750
750
|
}
|
|
751
|
-
n && T(te, this, _(
|
|
751
|
+
n && T(te, this, _(W, this, Mn).call(this, () => {
|
|
752
752
|
try {
|
|
753
753
|
return Ue(() => {
|
|
754
|
-
var l =
|
|
754
|
+
var l = k;
|
|
755
755
|
l.b = this, l.f |= 128, n(d(ie, this), () => a, () => o);
|
|
756
756
|
});
|
|
757
757
|
} catch (l) {
|
|
@@ -773,8 +773,8 @@ function Er(e) {
|
|
|
773
773
|
// @__NO_SIDE_EFFECTS__
|
|
774
774
|
function tn(e) {
|
|
775
775
|
var t = 2 | le;
|
|
776
|
-
return
|
|
777
|
-
ctx:
|
|
776
|
+
return k !== null && (k.f |= Ct), {
|
|
777
|
+
ctx: R,
|
|
778
778
|
deps: null,
|
|
779
779
|
effects: null,
|
|
780
780
|
equals: pi,
|
|
@@ -784,7 +784,7 @@ function tn(e) {
|
|
|
784
784
|
rv: 0,
|
|
785
785
|
v: H,
|
|
786
786
|
wv: 0,
|
|
787
|
-
parent:
|
|
787
|
+
parent: k,
|
|
788
788
|
ac: null
|
|
789
789
|
};
|
|
790
790
|
}
|
|
@@ -794,11 +794,11 @@ function Ar(e) {
|
|
|
794
794
|
return Ce || Ui(t), t;
|
|
795
795
|
}
|
|
796
796
|
// @__NO_SIDE_EFFECTS__
|
|
797
|
-
function
|
|
797
|
+
function ra(e) {
|
|
798
798
|
const t = /* @__PURE__ */ tn(e);
|
|
799
799
|
return t.equals = gi, t;
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function ia(e) {
|
|
802
802
|
var t = e.effects;
|
|
803
803
|
if (t !== null) {
|
|
804
804
|
e.effects = null;
|
|
@@ -806,30 +806,30 @@ function ra(e) {
|
|
|
806
806
|
}
|
|
807
807
|
}
|
|
808
808
|
function nr(e) {
|
|
809
|
-
var t, n =
|
|
809
|
+
var t, n = k, r = e.parent;
|
|
810
810
|
if (!ve && r !== null && e.v !== H && (r.f & 24576) !== 0)
|
|
811
|
-
return
|
|
811
|
+
return Ps(), e.v;
|
|
812
812
|
xe(r);
|
|
813
813
|
try {
|
|
814
|
-
e.f &= ~xt,
|
|
814
|
+
e.f &= ~xt, ia(e), t = Ji(e);
|
|
815
815
|
} finally {
|
|
816
816
|
xe(n);
|
|
817
817
|
}
|
|
818
818
|
return t;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function Ri(e) {
|
|
821
821
|
var t = nr(e);
|
|
822
|
-
if (!e.equals(t) && (e.wv = Xi(), (!x?.is_fork || e.deps === null) && (x !== null ? (x.capture(e, t, !0),
|
|
822
|
+
if (!e.equals(t) && (e.wv = Xi(), (!x?.is_fork || e.deps === null) && (x !== null ? (x.capture(e, t, !0), kn?.capture(e, t, !0)) : e.v = t, e.deps === null))) {
|
|
823
823
|
P(e, ae);
|
|
824
824
|
return;
|
|
825
825
|
}
|
|
826
826
|
ve || (z !== null ? (rr() || x?.is_fork) && z.set(e, t) : Jn(e));
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function oa(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 =
|
|
830
|
+
for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(Yn), t.fn !== null && (t.teardown = ps), t.ac = null, At(t, 0), or(t));
|
|
831
831
|
}
|
|
832
|
-
function
|
|
832
|
+
function Li(e) {
|
|
833
833
|
if (e.effects !== null)
|
|
834
834
|
for (const t of e.effects) t.teardown && t.fn !== null && ct(t);
|
|
835
835
|
}
|
|
@@ -852,16 +852,16 @@ function F(e, t) {
|
|
|
852
852
|
return Ui(n), n;
|
|
853
853
|
}
|
|
854
854
|
// @__NO_SIDE_EFFECTS__
|
|
855
|
-
function
|
|
855
|
+
function sa(e, t = !1, n = !0) {
|
|
856
856
|
const r = cn(e);
|
|
857
|
-
if (t || (r.equals = gi), It && n &&
|
|
857
|
+
if (t || (r.equals = gi), It && n && R !== null && R.l !== null) {
|
|
858
858
|
var i;
|
|
859
|
-
((i =
|
|
859
|
+
((i = R.l).s ?? (i.s = [])).push(r);
|
|
860
860
|
}
|
|
861
861
|
return r;
|
|
862
862
|
}
|
|
863
863
|
function M(e, t, n = !1) {
|
|
864
|
-
|
|
864
|
+
E !== null && (!ne || (E.f & 131072) !== 0) && ln() && (E.f & 4325394) !== 0 && (se === null || !se.has(e)) && Ls();
|
|
865
865
|
let r = n ? ot(t) : t;
|
|
866
866
|
return Pi(e, r, Yt);
|
|
867
867
|
}
|
|
@@ -873,11 +873,11 @@ function Pi(e, t, n = null) {
|
|
|
873
873
|
const i = e;
|
|
874
874
|
(e.f & 2048) !== 0 && nr(i), z === null && Jn(i);
|
|
875
875
|
}
|
|
876
|
-
e.wv = Xi(), Ni(e, le, n), ln() &&
|
|
876
|
+
e.wv = Xi(), Ni(e, le, n), ln() && k !== null && (k.f & 1024) !== 0 && (k.f & 96) === 0 && (Y === null ? _a([e]) : Y.push(e)), !r.is_fork && nn.size > 0 && !$i && aa();
|
|
877
877
|
}
|
|
878
878
|
return t;
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function aa() {
|
|
881
881
|
$i = !1;
|
|
882
882
|
for (const e of nn) {
|
|
883
883
|
(e.f & 1024) !== 0 && P(e, Ye);
|
|
@@ -899,12 +899,12 @@ function Ni(e, t, n) {
|
|
|
899
899
|
if (r !== null)
|
|
900
900
|
for (var i = ln(), o = r.length, s = 0; s < o; s++) {
|
|
901
901
|
var a = r[s], l = a.f;
|
|
902
|
-
if (!(!i && a ===
|
|
902
|
+
if (!(!i && a === k)) {
|
|
903
903
|
var c = (l & le) === 0;
|
|
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
|
-
z?.delete(u), (l & 65536) === 0 && (l & 512 && (
|
|
907
|
+
z?.delete(u), (l & 65536) === 0 && (l & 512 && (k === null || (k.f & 2097152) === 0) && (a.f |= xt), Ni(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,14 +912,14 @@ function Ni(e, t, n) {
|
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
|
-
var
|
|
915
|
+
var la = /^[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 =
|
|
919
|
-
if (t !==
|
|
920
|
-
var n = /* @__PURE__ */ new Map(), r =
|
|
918
|
+
const t = fs(e);
|
|
919
|
+
if (t !== hs && t !== ds) return e;
|
|
920
|
+
var n = /* @__PURE__ */ new Map(), r = ls(e), i = /* @__PURE__ */ F(0), o = null, s = je, a = (h) => {
|
|
921
921
|
if (je === s) return h();
|
|
922
|
-
var p =
|
|
922
|
+
var p = E, g = je;
|
|
923
923
|
de(null), Ir(s);
|
|
924
924
|
var m = h();
|
|
925
925
|
return de(p), Ir(g), m;
|
|
@@ -930,13 +930,13 @@ function ot(e) {
|
|
|
930
930
|
function u(h) {
|
|
931
931
|
if (!c) {
|
|
932
932
|
c = !0, l = h, Sr(i, `${l} version`);
|
|
933
|
-
for (const [p, g] of n) Sr(g,
|
|
933
|
+
for (const [p, g] of n) Sr(g, ca(l, p));
|
|
934
934
|
c = !1;
|
|
935
935
|
}
|
|
936
936
|
}
|
|
937
937
|
return new Proxy(e, {
|
|
938
938
|
defineProperty(h, p, g) {
|
|
939
|
-
(!("value" in g) || g.configurable === !1 || g.enumerable === !1 || g.writable === !1) &&
|
|
939
|
+
(!("value" in g) || g.configurable === !1 || g.enumerable === !1 || g.writable === !1) && Ms();
|
|
940
940
|
var m = n.get(p);
|
|
941
941
|
return m === void 0 ? a(() => {
|
|
942
942
|
var v = /* @__PURE__ */ F(g.value, o);
|
|
@@ -957,7 +957,7 @@ function ot(e) {
|
|
|
957
957
|
get(h, p, g) {
|
|
958
958
|
if (p === St) return e;
|
|
959
959
|
var m = n.get(p), v = p in h;
|
|
960
|
-
if (m === void 0 && (!v ||
|
|
960
|
+
if (m === void 0 && (!v || We(h, p)?.writable) && (m = a(() => {
|
|
961
961
|
var S = /* @__PURE__ */ F(ot(v ? h[p] : H), o);
|
|
962
962
|
return S;
|
|
963
963
|
}), n.set(p, m)), m !== void 0) {
|
|
@@ -985,7 +985,7 @@ function ot(e) {
|
|
|
985
985
|
has(h, p) {
|
|
986
986
|
if (p === St) return !0;
|
|
987
987
|
var g = n.get(p), m = g !== void 0 && g.v !== H || Reflect.has(h, p);
|
|
988
|
-
return (g !== void 0 ||
|
|
988
|
+
return (g !== void 0 || k !== null && (!m || We(h, p)?.writable)) && (g === void 0 && (g = a(() => {
|
|
989
989
|
var v = /* @__PURE__ */ F(m ? ot(h[p]) : H, o);
|
|
990
990
|
return v;
|
|
991
991
|
}), n.set(p, g)), b(g) === H) ? !1 : m;
|
|
@@ -997,7 +997,7 @@ function ot(e) {
|
|
|
997
997
|
O !== void 0 ? M(O, H) : S in h && (O = a(() => /* @__PURE__ */ F(H, o)), n.set(S + "", O));
|
|
998
998
|
}
|
|
999
999
|
if (v === void 0)
|
|
1000
|
-
(!y ||
|
|
1000
|
+
(!y || We(h, p)?.writable) && (v = a(() => /* @__PURE__ */ F(void 0, o)), M(v, ot(g)), n.set(p, v));
|
|
1001
1001
|
else {
|
|
1002
1002
|
y = v.v !== H;
|
|
1003
1003
|
var V = a(() => ot(g));
|
|
@@ -1023,40 +1023,40 @@ function ot(e) {
|
|
|
1023
1023
|
return p;
|
|
1024
1024
|
},
|
|
1025
1025
|
setPrototypeOf() {
|
|
1026
|
-
|
|
1026
|
+
Rs();
|
|
1027
1027
|
}
|
|
1028
1028
|
});
|
|
1029
1029
|
}
|
|
1030
|
-
function
|
|
1031
|
-
return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` :
|
|
1030
|
+
function ca(e, t) {
|
|
1031
|
+
return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : la.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
|
|
1032
1032
|
}
|
|
1033
|
-
var Cr,
|
|
1034
|
-
function
|
|
1033
|
+
var Cr, ua, Hi, Wi, Bi;
|
|
1034
|
+
function Rn() {
|
|
1035
1035
|
if (Cr === void 0) {
|
|
1036
|
-
Cr = window,
|
|
1036
|
+
Cr = window, ua = document, Hi = /Firefox/.test(navigator.userAgent);
|
|
1037
1037
|
var e = Element.prototype, t = Node.prototype, n = Text.prototype;
|
|
1038
|
-
|
|
1038
|
+
Wi = We(t, "firstChild").get, Bi = We(t, "nextSibling").get, yr(e) && (e[Ss] = void 0, e[Ts] = null, e[_s] = void 0, e.__e = void 0), yr(n) && (n[ws] = void 0);
|
|
1039
1039
|
}
|
|
1040
1040
|
}
|
|
1041
1041
|
function zi(e = "") {
|
|
1042
1042
|
return document.createTextNode(e);
|
|
1043
1043
|
}
|
|
1044
1044
|
// @__NO_SIDE_EFFECTS__
|
|
1045
|
-
function
|
|
1046
|
-
return
|
|
1045
|
+
function Ln(e) {
|
|
1046
|
+
return Wi.call(e);
|
|
1047
1047
|
}
|
|
1048
1048
|
// @__NO_SIDE_EFFECTS__
|
|
1049
1049
|
function dt(e) {
|
|
1050
|
-
return
|
|
1050
|
+
return Bi.call(e);
|
|
1051
1051
|
}
|
|
1052
|
-
function
|
|
1052
|
+
function ha(e) {
|
|
1053
1053
|
e.textContent = "";
|
|
1054
1054
|
}
|
|
1055
1055
|
function Fi(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
1058
|
function Di(e) {
|
|
1059
|
-
var t =
|
|
1059
|
+
var t = E, n = k;
|
|
1060
1060
|
de(null), xe(null);
|
|
1061
1061
|
try {
|
|
1062
1062
|
return e();
|
|
@@ -1064,18 +1064,18 @@ function Di(e) {
|
|
|
1064
1064
|
de(t), xe(n);
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1068
|
-
|
|
1067
|
+
function da(e) {
|
|
1068
|
+
k === null && (E === null && Cs(e), As()), ve && ks(e);
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function fa(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
|
-
var n =
|
|
1075
|
+
var n = k;
|
|
1076
1076
|
n !== null && (n.f & 8192) !== 0 && (e |= ai);
|
|
1077
1077
|
var r = {
|
|
1078
|
-
ctx:
|
|
1078
|
+
ctx: R,
|
|
1079
1079
|
deps: null,
|
|
1080
1080
|
nodes: null,
|
|
1081
1081
|
f: e | le | 512,
|
|
@@ -1101,34 +1101,34 @@ function Je(e, t) {
|
|
|
1101
1101
|
}
|
|
1102
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 |= ci));
|
|
1103
1103
|
}
|
|
1104
|
-
if (i !== null && (i.parent = n, n !== null &&
|
|
1105
|
-
var o =
|
|
1104
|
+
if (i !== null && (i.parent = n, n !== null && fa(i, n), E !== null && (E.f & 2) !== 0 && (e & 64) === 0)) {
|
|
1105
|
+
var o = E;
|
|
1106
1106
|
(o.effects ?? (o.effects = [])).push(i);
|
|
1107
1107
|
}
|
|
1108
1108
|
return r;
|
|
1109
1109
|
}
|
|
1110
1110
|
function rr() {
|
|
1111
|
-
return
|
|
1111
|
+
return E !== null && !ne;
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1114
|
-
|
|
1115
|
-
var t =
|
|
1116
|
-
if (!
|
|
1117
|
-
var n =
|
|
1113
|
+
function Le(e) {
|
|
1114
|
+
da("$effect");
|
|
1115
|
+
var t = k.f;
|
|
1116
|
+
if (!E && (t & 32) !== 0 && R !== null && !R.i) {
|
|
1117
|
+
var n = R;
|
|
1118
1118
|
(n.e ?? (n.e = [])).push(e);
|
|
1119
1119
|
} else return ji(e);
|
|
1120
1120
|
}
|
|
1121
1121
|
function ji(e) {
|
|
1122
|
-
return Je(4 |
|
|
1122
|
+
return Je(4 | ys, e);
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1124
|
+
function pa(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
|
|
1131
|
+
function ga(e) {
|
|
1132
1132
|
ht.ensure();
|
|
1133
1133
|
const t = Je(64 | Ct, e);
|
|
1134
1134
|
return (n = {}) => new Promise((r) => {
|
|
@@ -1137,13 +1137,13 @@ function pa(e) {
|
|
|
1137
1137
|
}) : (oe(t), r(void 0));
|
|
1138
1138
|
});
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1140
|
+
function ma(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
|
|
1146
|
+
function va(e, t = 0) {
|
|
1147
1147
|
var n = Je(16 | t, e);
|
|
1148
1148
|
return n;
|
|
1149
1149
|
}
|
|
@@ -1153,7 +1153,7 @@ function Ue(e) {
|
|
|
1153
1153
|
function qi(e) {
|
|
1154
1154
|
var t = e.teardown;
|
|
1155
1155
|
if (t !== null) {
|
|
1156
|
-
const n = ve, r =
|
|
1156
|
+
const n = ve, r = E;
|
|
1157
1157
|
xr(!0), de(null);
|
|
1158
1158
|
try {
|
|
1159
1159
|
t.call(null);
|
|
@@ -1173,7 +1173,7 @@ function or(e, t = !1) {
|
|
|
1173
1173
|
(n.f & 64) !== 0 ? n.parent = null : oe(n, t), n = r;
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1176
|
+
function ya(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,14 +1181,14 @@ function va(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 && (
|
|
1184
|
+
(t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (ba(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
|
-
qi(e), e.f ^= br, e.f |=
|
|
1187
|
+
qi(e), e.f ^= br, e.f |= vs;
|
|
1188
1188
|
var i = e.parent;
|
|
1189
1189
|
i !== null && i.first !== null && Vi(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1191
|
+
function ba(e, t) {
|
|
1192
1192
|
for (; e !== null; ) {
|
|
1193
1193
|
var n = e === t ? null : /* @__PURE__ */ dt(e);
|
|
1194
1194
|
e.remove(), e = n;
|
|
@@ -1225,31 +1225,31 @@ function Gi(e, t, n) {
|
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1228
|
+
function Ta(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
|
|
1235
|
+
var Sa = null, Bt = !1, ve = !1;
|
|
1236
1236
|
function xr(e) {
|
|
1237
1237
|
ve = e;
|
|
1238
1238
|
}
|
|
1239
|
-
var
|
|
1239
|
+
var E = null, ne = !1;
|
|
1240
1240
|
function de(e) {
|
|
1241
|
-
|
|
1241
|
+
E = e;
|
|
1242
1242
|
}
|
|
1243
|
-
var
|
|
1243
|
+
var k = null;
|
|
1244
1244
|
function xe(e) {
|
|
1245
|
-
|
|
1245
|
+
k = e;
|
|
1246
1246
|
}
|
|
1247
1247
|
var se = null;
|
|
1248
1248
|
function Ui(e) {
|
|
1249
|
-
|
|
1249
|
+
E !== null && (!Ce || (E.f & 2) !== 0) && (se ?? (se = /* @__PURE__ */ new Set())).add(e);
|
|
1250
1250
|
}
|
|
1251
1251
|
var q = null, U = 0, Y = null;
|
|
1252
|
-
function
|
|
1252
|
+
function _a(e) {
|
|
1253
1253
|
Y = e;
|
|
1254
1254
|
}
|
|
1255
1255
|
var Ki = 1, Ne = 0, je = Ne;
|
|
@@ -1265,7 +1265,7 @@ 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) &&
|
|
1268
|
+
if (Ot(o) && Ri(o), o.wv > e.wv) return !0;
|
|
1269
1269
|
}
|
|
1270
1270
|
(t & 512) !== 0 && z === null && P(e, ae);
|
|
1271
1271
|
}
|
|
@@ -1280,8 +1280,8 @@ function Yi(e, t, n = !0) {
|
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
1282
|
function Ji(e) {
|
|
1283
|
-
var t = q, n = U, r = Y, i =
|
|
1284
|
-
q = null, U = 0, Y = null,
|
|
1283
|
+
var t = q, n = U, r = Y, i = E, o = se, s = R, a = ne, l = je, c = e.f;
|
|
1284
|
+
q = null, U = 0, Y = null, E = (c & 96) === 0 ? e : null, se = null, Kt(e.ctx), ne = !1, je = ++Ne, e.ac !== null && (Di(() => {
|
|
1285
1285
|
e.ac.abort(Yn);
|
|
1286
1286
|
}), e.ac = null);
|
|
1287
1287
|
try {
|
|
@@ -1309,13 +1309,13 @@ function Ji(e) {
|
|
|
1309
1309
|
} catch (y) {
|
|
1310
1310
|
return bi(y);
|
|
1311
1311
|
} finally {
|
|
1312
|
-
e.f ^= Tr, q = t, U = n, Y = r,
|
|
1312
|
+
e.f ^= Tr, q = t, U = n, Y = r, E = i, se = o, Kt(s), ne = a, je = l;
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function wa(e, t) {
|
|
1316
1316
|
let n = t.reactions;
|
|
1317
1317
|
if (n !== null) {
|
|
1318
|
-
var r =
|
|
1318
|
+
var r = cs.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,48 +1323,48 @@ function _a(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),
|
|
1326
|
+
(o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~xt), o.v !== H && Jn(o), oa(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++)
|
|
1332
|
+
for (var r = t; r < n.length; r++) wa(e, n[r]);
|
|
1333
1333
|
}
|
|
1334
1334
|
function ct(e) {
|
|
1335
1335
|
var t = e.f;
|
|
1336
1336
|
if ((t & 16384) === 0) {
|
|
1337
1337
|
P(e, ae);
|
|
1338
|
-
var n =
|
|
1339
|
-
if (
|
|
1338
|
+
var n = k, r = Bt;
|
|
1339
|
+
if (k = e, Bt = !0, 0)
|
|
1340
1340
|
var i, o;
|
|
1341
1341
|
try {
|
|
1342
|
-
(t & 16777232) !== 0 ?
|
|
1342
|
+
(t & 16777232) !== 0 ? ya(e) : or(e), qi(e);
|
|
1343
1343
|
var s = Ji(e);
|
|
1344
1344
|
if (e.teardown = typeof s == "function" ? s : null, e.wv = Ki, 0)
|
|
1345
1345
|
for (var a of e.deps) ;
|
|
1346
1346
|
} finally {
|
|
1347
|
-
|
|
1347
|
+
Bt = r, k = n;
|
|
1348
1348
|
}
|
|
1349
1349
|
}
|
|
1350
1350
|
}
|
|
1351
1351
|
function b(e) {
|
|
1352
1352
|
var t = (e.f & 2) !== 0;
|
|
1353
|
-
if (
|
|
1354
|
-
var n =
|
|
1355
|
-
if ((
|
|
1353
|
+
if (Sa?.add(e), E !== null && !ne && !(k !== null && (k.f & 16384) !== 0) && (se === null || !se.has(e))) {
|
|
1354
|
+
var n = E.deps;
|
|
1355
|
+
if ((E.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));
|
|
1357
1357
|
else {
|
|
1358
1358
|
var r;
|
|
1359
|
-
(r =
|
|
1359
|
+
(r = E).deps ?? (r.deps = []), Vt.call(E.deps, e) || E.deps.push(e);
|
|
1360
1360
|
var i = e.reactions;
|
|
1361
|
-
i === null ? e.reactions = [
|
|
1361
|
+
i === null ? e.reactions = [E] : Vt.call(i, E) || i.push(E);
|
|
1362
1362
|
}
|
|
1363
1363
|
}
|
|
1364
1364
|
if (0) {
|
|
1365
1365
|
if (!ne && reactivity_loss_tracker && !reactivity_loss_tracker.warned && (reactivity_loss_tracker.effect.f & 2097152) === 0 && !reactivity_loss_tracker.effect_deps.has(e))
|
|
1366
1366
|
var o;
|
|
1367
|
-
if (tracing_mode_flag && !ne && tracing_expressions !== null &&
|
|
1367
|
+
if (tracing_mode_flag && !ne && tracing_expressions !== null && E !== null && tracing_expressions.reaction === E && !e.trace) {
|
|
1368
1368
|
if (o)
|
|
1369
1369
|
var s, a;
|
|
1370
1370
|
}
|
|
@@ -1376,8 +1376,8 @@ function b(e) {
|
|
|
1376
1376
|
var c = l.v;
|
|
1377
1377
|
return ((l.f & 1024) === 0 && l.reactions !== null || Zi(l)) && (c = nr(l)), De.set(l, c), c;
|
|
1378
1378
|
}
|
|
1379
|
-
var u = (l.f & 512) === 0 && !ne &&
|
|
1380
|
-
Ot(l) && (u && (l.f |= 512),
|
|
1379
|
+
var u = (l.f & 512) === 0 && !ne && E !== null && (Bt || (E.f & 512) !== 0), h = (l.f & li) === 0;
|
|
1380
|
+
Ot(l) && (u && (l.f |= 512), Ri(l)), u && !h && (Li(l), Qi(l));
|
|
1381
1381
|
}
|
|
1382
1382
|
if (z?.has(e)) return z.get(e);
|
|
1383
1383
|
if ((e.f & 8388608) !== 0) throw e.v;
|
|
@@ -1386,7 +1386,7 @@ function b(e) {
|
|
|
1386
1386
|
function Qi(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 && (
|
|
1389
|
+
(t.reactions ?? (t.reactions = [])).push(e), (t.f & 2) !== 0 && (t.f & 512) === 0 && (Li(t), Qi(t));
|
|
1390
1390
|
}
|
|
1391
1391
|
function Zi(e) {
|
|
1392
1392
|
if (e.v === H) return !0;
|
|
@@ -1403,8 +1403,8 @@ function hn(e) {
|
|
|
1403
1403
|
ne = t;
|
|
1404
1404
|
}
|
|
1405
1405
|
}
|
|
1406
|
-
var Nt = /* @__PURE__ */ Symbol("events"),
|
|
1407
|
-
function
|
|
1406
|
+
var Nt = /* @__PURE__ */ Symbol("events"), Ea = /* @__PURE__ */ new Set(), Or = /* @__PURE__ */ new Set(), Mr = null;
|
|
1407
|
+
function Rr(e) {
|
|
1408
1408
|
var t = this, n = t.ownerDocument, r = e.type, i = e.composedPath?.() || [], o = i[0] || e.target;
|
|
1409
1409
|
Mr = e;
|
|
1410
1410
|
var s = 0, a = Mr === e && e[Nt];
|
|
@@ -1425,7 +1425,7 @@ function Lr(e) {
|
|
|
1425
1425
|
return o || n;
|
|
1426
1426
|
}
|
|
1427
1427
|
});
|
|
1428
|
-
var u =
|
|
1428
|
+
var u = E, h = k;
|
|
1429
1429
|
de(null), xe(null);
|
|
1430
1430
|
try {
|
|
1431
1431
|
for (var p, g = []; o !== null && o !== t; ) {
|
|
@@ -1450,15 +1450,15 @@ function Lr(e) {
|
|
|
1450
1450
|
}
|
|
1451
1451
|
}
|
|
1452
1452
|
var ka = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
|
|
1453
|
-
function
|
|
1453
|
+
function Aa(e) {
|
|
1454
1454
|
return ka?.createHTML(e) ?? e;
|
|
1455
1455
|
}
|
|
1456
|
-
function
|
|
1456
|
+
function Ca(e) {
|
|
1457
1457
|
var t = Fi("template");
|
|
1458
|
-
return t.innerHTML =
|
|
1458
|
+
return t.innerHTML = Aa(e.replaceAll("<!>", "<!---->")), t.content;
|
|
1459
1459
|
}
|
|
1460
1460
|
function zt(e, t) {
|
|
1461
|
-
var n =
|
|
1461
|
+
var n = k;
|
|
1462
1462
|
n.nodes === null && (n.nodes = {
|
|
1463
1463
|
start: e,
|
|
1464
1464
|
end: t,
|
|
@@ -1467,15 +1467,15 @@ function zt(e, t) {
|
|
|
1467
1467
|
});
|
|
1468
1468
|
}
|
|
1469
1469
|
// @__NO_SIDE_EFFECTS__
|
|
1470
|
-
function
|
|
1470
|
+
function xa(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 zt(D, null), D;
|
|
1475
|
-
i === void 0 && (i =
|
|
1475
|
+
i === void 0 && (i = Ca(o ? e : "<!>" + e), n || (i = /* @__PURE__ */ Ln(i)));
|
|
1476
1476
|
var s = r || Hi ? document.importNode(i, !0) : i.cloneNode(!0);
|
|
1477
1477
|
if (n) {
|
|
1478
|
-
var a = /* @__PURE__ */
|
|
1478
|
+
var a = /* @__PURE__ */ Ln(s), l = s.lastChild;
|
|
1479
1479
|
zt(a, l);
|
|
1480
1480
|
} else zt(s, s);
|
|
1481
1481
|
return s;
|
|
@@ -1483,13 +1483,13 @@ function Ca(e, t) {
|
|
|
1483
1483
|
}
|
|
1484
1484
|
function eo(e, t) {
|
|
1485
1485
|
if (re) {
|
|
1486
|
-
var n =
|
|
1486
|
+
var n = k;
|
|
1487
1487
|
((n.f & 32768) === 0 || n.nodes.end === null) && (n.nodes.end = D), fi();
|
|
1488
1488
|
return;
|
|
1489
1489
|
}
|
|
1490
1490
|
e !== null && e.before(t);
|
|
1491
1491
|
}
|
|
1492
|
-
var
|
|
1492
|
+
var Ia = [
|
|
1493
1493
|
"allowfullscreen",
|
|
1494
1494
|
"async",
|
|
1495
1495
|
"autofocus",
|
|
@@ -1519,7 +1519,7 @@ var xa = [
|
|
|
1519
1519
|
"disablepictureinpicture",
|
|
1520
1520
|
"disableremoteplayback"
|
|
1521
1521
|
], gh = [
|
|
1522
|
-
...
|
|
1522
|
+
...Ia,
|
|
1523
1523
|
"formNoValidate",
|
|
1524
1524
|
"isMap",
|
|
1525
1525
|
"noModule",
|
|
@@ -1534,17 +1534,17 @@ var xa = [
|
|
|
1534
1534
|
"allowFullscreen",
|
|
1535
1535
|
"disablePictureInPicture",
|
|
1536
1536
|
"disableRemotePlayback"
|
|
1537
|
-
],
|
|
1538
|
-
function
|
|
1539
|
-
return
|
|
1537
|
+
], Oa = ["touchstart", "touchmove"];
|
|
1538
|
+
function Ma(e) {
|
|
1539
|
+
return Oa.includes(e);
|
|
1540
1540
|
}
|
|
1541
|
-
var
|
|
1541
|
+
var Ra = [
|
|
1542
1542
|
"$state",
|
|
1543
1543
|
"$state.raw",
|
|
1544
1544
|
"$derived",
|
|
1545
1545
|
"$derived.by"
|
|
1546
1546
|
], mh = [
|
|
1547
|
-
...
|
|
1547
|
+
...Ra,
|
|
1548
1548
|
"$state.eager",
|
|
1549
1549
|
"$state.snapshot",
|
|
1550
1550
|
"$props",
|
|
@@ -1559,40 +1559,40 @@ var Ma = [
|
|
|
1559
1559
|
"$inspect().with",
|
|
1560
1560
|
"$inspect.trace",
|
|
1561
1561
|
"$host"
|
|
1562
|
-
],
|
|
1562
|
+
], Lr = !0;
|
|
1563
1563
|
function to(e, t) {
|
|
1564
1564
|
return no(e, t);
|
|
1565
1565
|
}
|
|
1566
1566
|
function La(e, t) {
|
|
1567
|
-
|
|
1567
|
+
Rn(), t.intro = t.intro ?? !1;
|
|
1568
1568
|
const n = t.target, r = re, i = D;
|
|
1569
1569
|
try {
|
|
1570
|
-
for (var o = /* @__PURE__ */
|
|
1570
|
+
for (var o = /* @__PURE__ */ Ln(n); o && (o.nodeType !== 8 || o.data !== "["); ) o = /* @__PURE__ */ dt(o);
|
|
1571
1571
|
if (!o) throw qt;
|
|
1572
|
-
|
|
1572
|
+
Rt(!0), Et(o);
|
|
1573
1573
|
const s = no(e, {
|
|
1574
1574
|
...t,
|
|
1575
1575
|
anchor: o
|
|
1576
1576
|
});
|
|
1577
|
-
return
|
|
1577
|
+
return Rt(!1), s;
|
|
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 &&
|
|
1581
|
+
return s !== qt && console.warn("Failed to hydrate: ", s), t.recover === !1 && Is(), Rn(), ha(n), Rt(!1), to(e, t);
|
|
1582
1582
|
} finally {
|
|
1583
|
-
|
|
1583
|
+
Rt(r), Et(i);
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
1586
|
var Ht = /* @__PURE__ */ new Map();
|
|
1587
1587
|
function no(e, { target: t, anchor: n, props: r = {}, events: i, context: o, intro: s = !0, transformError: a }) {
|
|
1588
|
-
|
|
1589
|
-
var l = void 0, c =
|
|
1588
|
+
Rn();
|
|
1589
|
+
var l = void 0, c = ga(() => {
|
|
1590
1590
|
var u = n ?? t.appendChild(zi());
|
|
1591
|
-
|
|
1591
|
+
Qs(u, { pending: () => {
|
|
1592
1592
|
} }, (g) => {
|
|
1593
1593
|
mi({});
|
|
1594
|
-
var m =
|
|
1595
|
-
if (o && (m.c = o), i && (r.$$events = i), re && zt(g, null),
|
|
1594
|
+
var m = R;
|
|
1595
|
+
if (o && (m.c = o), i && (r.$$events = i), re && zt(g, null), Lr = s, l = e(g, r) || {}, Lr = !0, re && (k.nodes.end = D, D === null || D.nodeType !== 8 || D.data !== "]"))
|
|
1596
1596
|
throw di(), qt;
|
|
1597
1597
|
vi();
|
|
1598
1598
|
}, a);
|
|
@@ -1601,20 +1601,20 @@ function no(e, { target: t, anchor: n, props: r = {}, events: i, context: o, int
|
|
|
1601
1601
|
var v = g[m];
|
|
1602
1602
|
if (!h.has(v)) {
|
|
1603
1603
|
h.add(v);
|
|
1604
|
-
var y =
|
|
1604
|
+
var y = Ma(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,
|
|
1609
|
+
O === void 0 ? (V.addEventListener(v, Rr, { passive: y }), S.set(v, 1)) : S.set(v, O + 1);
|
|
1610
1610
|
}
|
|
1611
1611
|
}
|
|
1612
1612
|
}
|
|
1613
1613
|
};
|
|
1614
|
-
return p(
|
|
1614
|
+
return p(us(Ea)), Or.add(p), () => {
|
|
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,
|
|
1617
|
+
--v == 0 ? (y.removeEventListener(g, Rr), m.delete(g), m.size === 0 && Ht.delete(y)) : m.set(g, v);
|
|
1618
1618
|
}
|
|
1619
1619
|
Or.delete(p), u !== n && u.parentNode?.removeChild(u);
|
|
1620
1620
|
};
|
|
@@ -1622,17 +1622,17 @@ function no(e, { target: t, anchor: n, props: r = {}, events: i, context: o, int
|
|
|
1622
1622
|
return $n.set(l, c), l;
|
|
1623
1623
|
}
|
|
1624
1624
|
var $n = /* @__PURE__ */ new WeakMap();
|
|
1625
|
-
function
|
|
1625
|
+
function $a(e, t) {
|
|
1626
1626
|
const n = $n.get(e);
|
|
1627
1627
|
return n ? ($n.delete(e), n(t)) : Promise.resolve();
|
|
1628
1628
|
}
|
|
1629
|
-
function
|
|
1630
|
-
|
|
1629
|
+
function Pa(e) {
|
|
1630
|
+
R === null && Es("onMount"), It && R.l !== null ? Na(R).m.push(e) : Le(() => {
|
|
1631
1631
|
const t = hn(e);
|
|
1632
1632
|
if (typeof t == "function") return t;
|
|
1633
1633
|
});
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1635
|
+
function Na(e) {
|
|
1636
1636
|
var t = e.l;
|
|
1637
1637
|
return t.u ?? (t.u = {
|
|
1638
1638
|
a: [],
|
|
@@ -1646,14 +1646,14 @@ var ro, rt = /* @__PURE__ */ new WeakMap(), rn = /* @__PURE__ */ new WeakMap(),
|
|
|
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), _($r, this,
|
|
1649
|
+
return n.add(t), d(rt, this).set(e, n), _($r, this, Ha).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
1655
|
ro = io;
|
|
1656
|
-
function
|
|
1656
|
+
function Ha() {
|
|
1657
1657
|
return d(rn, this) ?? T(rn, this, new ResizeObserver((e) => {
|
|
1658
1658
|
for (var t of e) {
|
|
1659
1659
|
ro.entries.set(t.target, t);
|
|
@@ -1665,9 +1665,9 @@ f(io, "entries", /* @__PURE__ */ new WeakMap());
|
|
|
1665
1665
|
function bn(e, t) {
|
|
1666
1666
|
return e === t || e?.[St] === t;
|
|
1667
1667
|
}
|
|
1668
|
-
function
|
|
1669
|
-
var i =
|
|
1670
|
-
return
|
|
1668
|
+
function Wa(e = {}, t, n, r) {
|
|
1669
|
+
var i = R.r, o = k;
|
|
1670
|
+
return ma(() => {
|
|
1671
1671
|
var s, a;
|
|
1672
1672
|
return ir(() => {
|
|
1673
1673
|
s = a, a = r?.() || [], hn(() => {
|
|
@@ -1690,10 +1690,10 @@ function we(e, t, n, r) {
|
|
|
1690
1690
|
let h;
|
|
1691
1691
|
if (o) {
|
|
1692
1692
|
var p = St in e || hi in e;
|
|
1693
|
-
h =
|
|
1693
|
+
h = We(e, t)?.set ?? (p && t in e ? (A) => e[t] = A : void 0);
|
|
1694
1694
|
}
|
|
1695
1695
|
var g, m = !1;
|
|
1696
|
-
o ? [g, m] =
|
|
1696
|
+
o ? [g, m] = qs(() => e[t]) : g = e[t], g === void 0 && r !== void 0 && (g = u(), h && (i && Os(t), h(g)));
|
|
1697
1697
|
var v;
|
|
1698
1698
|
if (i ? v = () => {
|
|
1699
1699
|
var A = e[t];
|
|
@@ -1708,9 +1708,9 @@ 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 :
|
|
1711
|
+
var S = !1, O = ((n & 1) !== 0 ? tn : ra)(() => (S = !1, v()));
|
|
1712
1712
|
o && b(O);
|
|
1713
|
-
var V =
|
|
1713
|
+
var V = k;
|
|
1714
1714
|
return (function(A, G) {
|
|
1715
1715
|
if (arguments.length > 0) {
|
|
1716
1716
|
const Z = G ? b(O) : i && o ? ot(A) : A;
|
|
@@ -1720,13 +1720,13 @@ function we(e, t, n, r) {
|
|
|
1720
1720
|
});
|
|
1721
1721
|
}
|
|
1722
1722
|
function Ba(e) {
|
|
1723
|
-
return new
|
|
1723
|
+
return new za(e);
|
|
1724
1724
|
}
|
|
1725
|
-
var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(),
|
|
1725
|
+
var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), za = 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__ */
|
|
1729
|
+
var s = /* @__PURE__ */ sa(o, !1, !1);
|
|
1730
1730
|
return t.set(i, s), s;
|
|
1731
1731
|
};
|
|
1732
1732
|
const r = new Proxy({
|
|
@@ -1765,7 +1765,7 @@ var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), Wa =
|
|
|
1765
1765
|
d(ce, this).$set = (i) => {
|
|
1766
1766
|
Object.assign(r, i);
|
|
1767
1767
|
}, d(ce, this).$destroy = () => {
|
|
1768
|
-
|
|
1768
|
+
$a(d(ce, this));
|
|
1769
1769
|
};
|
|
1770
1770
|
}
|
|
1771
1771
|
$set(e) {
|
|
@@ -1808,7 +1808,7 @@ typeof HTMLElement == "function" && (oo = class extends HTMLElement {
|
|
|
1808
1808
|
};
|
|
1809
1809
|
};
|
|
1810
1810
|
if (await Promise.resolve(), !this.$$cn || this.$$c) return;
|
|
1811
|
-
const t = {}, n =
|
|
1811
|
+
const t = {}, n = Fa(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);
|
|
@@ -1823,7 +1823,7 @@ typeof HTMLElement == "function" && (oo = class extends HTMLElement {
|
|
|
1823
1823
|
$$slots: t,
|
|
1824
1824
|
$$host: this
|
|
1825
1825
|
}
|
|
1826
|
-
}), this.$$me =
|
|
1826
|
+
}), this.$$me = pa(() => {
|
|
1827
1827
|
ir(() => {
|
|
1828
1828
|
this.$$r = !0;
|
|
1829
1829
|
for (const r of Gt(this.$$c)) {
|
|
@@ -1880,13 +1880,13 @@ function Ft(e, t, n, r) {
|
|
|
1880
1880
|
return t;
|
|
1881
1881
|
}
|
|
1882
1882
|
}
|
|
1883
|
-
function
|
|
1883
|
+
function Fa(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
|
|
1889
|
+
function Da(e, t, n, r, i, o) {
|
|
1890
1890
|
let s = class extends oo {
|
|
1891
1891
|
constructor() {
|
|
1892
1892
|
super(e, n, i), this.$$p_d = t;
|
|
@@ -1903,7 +1903,7 @@ function Fa(e, t, n, r, i, o) {
|
|
|
1903
1903
|
set(l) {
|
|
1904
1904
|
l = Ft(a, l, t), this.$$d[a] = l;
|
|
1905
1905
|
var c = this.$$c;
|
|
1906
|
-
c && (
|
|
1906
|
+
c && (We(c, a)?.get ? c[a] = l : c.$set({ [a]: l }));
|
|
1907
1907
|
}
|
|
1908
1908
|
});
|
|
1909
1909
|
}), r.forEach((a) => {
|
|
@@ -1912,14 +1912,14 @@ function Fa(e, t, n, r, i, o) {
|
|
|
1912
1912
|
} });
|
|
1913
1913
|
}), o && (s = o(s)), e.element = s, s;
|
|
1914
1914
|
}
|
|
1915
|
-
var
|
|
1915
|
+
var ja = 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
|
}), f(this, "context", void 0), f(this, "contextTarget", void 0), f(this, "callback", void 0), f(this, "subscribe", void 0), this.context = e, this.contextTarget = t, this.callback = n, this.subscribe = r ?? !1;
|
|
1921
1921
|
}
|
|
1922
|
-
},
|
|
1922
|
+
}, qa = class {
|
|
1923
1923
|
constructor(e, t) {
|
|
1924
1924
|
f(this, "host", void 0), f(this, "context", void 0), f(this, "subscribe", void 0), f(this, "onValue", void 0), f(this, "isConnected", !1), f(this, "unsubscribe", void 0), f(this, "currentValue", void 0), f(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 Da = class extends Event {
|
|
|
1935
1935
|
return this.currentValue;
|
|
1936
1936
|
}
|
|
1937
1937
|
requestValue() {
|
|
1938
|
-
this.host.dispatchEvent(new
|
|
1938
|
+
this.host.dispatchEvent(new ja(this.context, this.host, this.handleValue, this.subscribe));
|
|
1939
1939
|
}
|
|
1940
|
-
}, dn = (e) => e,
|
|
1940
|
+
}, dn = (e) => e, Va = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), vh = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), Ga = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), yh = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
|
|
1941
1941
|
function so(e, t, n) {
|
|
1942
1942
|
let r = !1;
|
|
1943
|
-
const i = new
|
|
1943
|
+
const i = new qa(e, {
|
|
1944
1944
|
context: t,
|
|
1945
1945
|
subscribe: !0,
|
|
1946
1946
|
onValue: (c) => {
|
|
@@ -1964,19 +1964,19 @@ function so(e, t, n) {
|
|
|
1964
1964
|
globalThis.clearInterval(l), e.removeEventListener("context-provider", o), i.disconnect();
|
|
1965
1965
|
};
|
|
1966
1966
|
}
|
|
1967
|
-
function Ga(e, t) {
|
|
1968
|
-
return so(e, qa, t);
|
|
1969
|
-
}
|
|
1970
1967
|
function Ua(e, t) {
|
|
1971
1968
|
return so(e, Va, t);
|
|
1972
1969
|
}
|
|
1973
1970
|
function Ka(e, t) {
|
|
1974
|
-
return
|
|
1971
|
+
return so(e, Ga, t);
|
|
1975
1972
|
}
|
|
1976
1973
|
function Xa(e, t) {
|
|
1977
1974
|
return Ua(e, t);
|
|
1978
1975
|
}
|
|
1979
|
-
|
|
1976
|
+
function Ya(e, t) {
|
|
1977
|
+
return Ka(e, t);
|
|
1978
|
+
}
|
|
1979
|
+
var Ja = class {
|
|
1980
1980
|
serialize(e, t) {
|
|
1981
1981
|
return {
|
|
1982
1982
|
startContainer: this.getNodePath(e.startContainer, t),
|
|
@@ -2041,17 +2041,17 @@ var Ya = class {
|
|
|
2041
2041
|
deserializeMany(e, t) {
|
|
2042
2042
|
return e.map((n) => this.deserialize(n, t));
|
|
2043
2043
|
}
|
|
2044
|
-
},
|
|
2044
|
+
}, B;
|
|
2045
2045
|
(function(e) {
|
|
2046
2046
|
e.TTS_WORD = "tts-word", e.TTS_SENTENCE = "tts-sentence", e.ANNOTATION = "annotation";
|
|
2047
|
-
})(
|
|
2047
|
+
})(B || (B = {}));
|
|
2048
2048
|
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
2052
|
var ao = class Pn {
|
|
2053
2053
|
constructor(t = {}) {
|
|
2054
|
-
if (f(this, "config", void 0), f(this, "ttsWordHighlight", null), f(this, "ttsSentenceHighlight", null), f(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), f(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), f(this, "annotations", /* @__PURE__ */ new Map()), f(this, "colorHighlights", /* @__PURE__ */ new Map()), f(this, "nextAnnotationId", 1), f(this, "supported", !1), f(this, "rangeSerializer", void 0), f(this, "themeObserver", null), f(this, "explicitTTSColorOverride", null), this.config = t, this.rangeSerializer = new
|
|
2054
|
+
if (f(this, "config", void 0), f(this, "ttsWordHighlight", null), f(this, "ttsSentenceHighlight", null), f(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), f(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), f(this, "annotations", /* @__PURE__ */ new Map()), f(this, "colorHighlights", /* @__PURE__ */ new Map()), f(this, "nextAnnotationId", 1), f(this, "supported", !1), f(this, "rangeSerializer", void 0), f(this, "themeObserver", null), f(this, "explicitTTSColorOverride", null), this.config = t, this.rangeSerializer = new Ja(), 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
|
}
|
|
@@ -2238,27 +2238,27 @@ var ao = class Pn {
|
|
|
2238
2238
|
|
|
2239
2239
|
/* Annotation highlights - persistent */
|
|
2240
2240
|
::highlight(annotation-yellow) {
|
|
2241
|
-
background-color:
|
|
2241
|
+
background-color: var(--pie-annotation-yellow-highlight, rgba(253, 233, 149, 0.5));
|
|
2242
2242
|
color: inherit;
|
|
2243
2243
|
}
|
|
2244
2244
|
|
|
2245
2245
|
::highlight(annotation-green) {
|
|
2246
|
-
background-color:
|
|
2246
|
+
background-color: var(--pie-annotation-green-highlight, rgba(166, 225, 197, 0.5));
|
|
2247
2247
|
color: inherit;
|
|
2248
2248
|
}
|
|
2249
2249
|
|
|
2250
2250
|
::highlight(annotation-blue) {
|
|
2251
|
-
background-color:
|
|
2251
|
+
background-color: var(--pie-annotation-blue-highlight, rgba(167, 224, 246, 0.5));
|
|
2252
2252
|
color: inherit;
|
|
2253
2253
|
}
|
|
2254
2254
|
|
|
2255
2255
|
::highlight(annotation-pink) {
|
|
2256
|
-
background-color:
|
|
2256
|
+
background-color: var(--pie-annotation-pink-highlight, rgba(255, 159, 174, 0.5));
|
|
2257
2257
|
color: inherit;
|
|
2258
2258
|
}
|
|
2259
2259
|
|
|
2260
2260
|
::highlight(annotation-orange) {
|
|
2261
|
-
background-color:
|
|
2261
|
+
background-color: var(--pie-annotation-orange-highlight, rgba(255, 165, 0, 0.5));
|
|
2262
2262
|
color: inherit;
|
|
2263
2263
|
}
|
|
2264
2264
|
|
|
@@ -2286,6 +2286,13 @@ var ao = class Pn {
|
|
|
2286
2286
|
for (const i of t) this.ttsSentenceHighlight.add(i);
|
|
2287
2287
|
this.highlightTTSElementFallbacks(t);
|
|
2288
2288
|
}
|
|
2289
|
+
highlightTTSSentenceElements(t) {
|
|
2290
|
+
if (this.ttsSentenceHighlight) {
|
|
2291
|
+
this.applyAdaptiveTTSStyle(t[0] || null), this.clearTTSSentence();
|
|
2292
|
+
for (const n of t)
|
|
2293
|
+
n.setAttribute("data-pie-tts-sentence-element", "true"), this.ttsSentenceElementHighlights.add(n);
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2289
2296
|
highlightTTSElementFallbacks(t) {
|
|
2290
2297
|
typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-sentence-element", this.ttsSentenceElementHighlights, Pn.SENTENCE_FALLBACK_SELECTOR);
|
|
2291
2298
|
}
|
|
@@ -2334,7 +2341,7 @@ var ao = class Pn {
|
|
|
2334
2341
|
const r = `annotation-${this.nextAnnotationId++}`, i = t.cloneRange(), o = {
|
|
2335
2342
|
id: r,
|
|
2336
2343
|
range: i,
|
|
2337
|
-
type:
|
|
2344
|
+
type: B.ANNOTATION,
|
|
2338
2345
|
color: n,
|
|
2339
2346
|
timestamp: Date.now()
|
|
2340
2347
|
};
|
|
@@ -2395,16 +2402,16 @@ var ao = class Pn {
|
|
|
2395
2402
|
highlightRange(t, n, r = st.YELLOW) {
|
|
2396
2403
|
if (this.supported)
|
|
2397
2404
|
switch (n) {
|
|
2398
|
-
case
|
|
2399
|
-
case
|
|
2400
|
-
const i = n ===
|
|
2401
|
-
if (i && (i.clear(), i.add(t), n ===
|
|
2405
|
+
case B.TTS_WORD:
|
|
2406
|
+
case B.TTS_SENTENCE: {
|
|
2407
|
+
const i = n === B.TTS_WORD ? this.ttsWordHighlight : this.ttsSentenceHighlight;
|
|
2408
|
+
if (i && (i.clear(), i.add(t), n === B.TTS_WORD)) {
|
|
2402
2409
|
for (const o of this.ttsWordElementHighlights) o.removeAttribute("data-pie-tts-word-element");
|
|
2403
2410
|
this.ttsWordElementHighlights.clear(), this.highlightTTSWordElementFallbacks([t]);
|
|
2404
2411
|
}
|
|
2405
2412
|
break;
|
|
2406
2413
|
}
|
|
2407
|
-
case
|
|
2414
|
+
case B.ANNOTATION:
|
|
2408
2415
|
this.addAnnotation(t, r);
|
|
2409
2416
|
break;
|
|
2410
2417
|
}
|
|
@@ -2412,13 +2419,13 @@ var ao = class Pn {
|
|
|
2412
2419
|
clearHighlights(t) {
|
|
2413
2420
|
if (this.supported)
|
|
2414
2421
|
switch (t) {
|
|
2415
|
-
case
|
|
2422
|
+
case B.TTS_WORD:
|
|
2416
2423
|
this.clearTTSWord();
|
|
2417
2424
|
break;
|
|
2418
|
-
case
|
|
2425
|
+
case B.TTS_SENTENCE:
|
|
2419
2426
|
this.clearTTSSentence();
|
|
2420
2427
|
break;
|
|
2421
|
-
case
|
|
2428
|
+
case B.ANNOTATION:
|
|
2422
2429
|
this.clearAnnotations();
|
|
2423
2430
|
break;
|
|
2424
2431
|
}
|
|
@@ -2476,25 +2483,25 @@ var bh = lo("I18nService"), Tn = {
|
|
|
2476
2483
|
function qe(e) {
|
|
2477
2484
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
2478
2485
|
}
|
|
2479
|
-
function
|
|
2486
|
+
function Ee(e, t) {
|
|
2480
2487
|
if (e == null) return [];
|
|
2481
2488
|
if (!Array.isArray(e)) throw new Error(`Invalid tools config at "${t}": expected an array of tool ids.`);
|
|
2482
2489
|
if (e.find((n) => typeof n != "string") !== void 0) throw new Error(`Invalid tools config at "${t}": all entries must be strings.`);
|
|
2483
2490
|
return e;
|
|
2484
2491
|
}
|
|
2485
|
-
function
|
|
2492
|
+
function Qa(e) {
|
|
2486
2493
|
if (e != null) {
|
|
2487
2494
|
if (!qe(e)) throw new Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');
|
|
2488
2495
|
return e;
|
|
2489
2496
|
}
|
|
2490
2497
|
}
|
|
2491
|
-
function
|
|
2498
|
+
function Za(e) {
|
|
2492
2499
|
if (e != null) {
|
|
2493
2500
|
if (!qe(e)) throw new Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');
|
|
2494
2501
|
return e;
|
|
2495
2502
|
}
|
|
2496
2503
|
}
|
|
2497
|
-
function
|
|
2504
|
+
function el(e, t) {
|
|
2498
2505
|
if (t == null) return;
|
|
2499
2506
|
if (!qe(t)) throw new Error(`Invalid tools config at "providers.${e}": expected an object.`);
|
|
2500
2507
|
const n = t, r = (i) => i === "polly" || i === "google" || i === "custom";
|
|
@@ -2503,18 +2510,18 @@ function Za(e, t) {
|
|
|
2503
2510
|
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
2511
|
return n;
|
|
2505
2512
|
}
|
|
2506
|
-
function
|
|
2513
|
+
function tl(e) {
|
|
2507
2514
|
if (e == null) return {};
|
|
2508
2515
|
if (!qe(e)) throw new Error('Invalid tools config at "providers": expected an object keyed by tool id.');
|
|
2509
2516
|
const t = {};
|
|
2510
|
-
for (const [n, r] of Object.entries(e)) t[n] =
|
|
2517
|
+
for (const [n, r] of Object.entries(e)) t[n] = el(n, r);
|
|
2511
2518
|
return t;
|
|
2512
2519
|
}
|
|
2513
2520
|
function co(e) {
|
|
2514
2521
|
const t = e.trim();
|
|
2515
2522
|
return t || "";
|
|
2516
2523
|
}
|
|
2517
|
-
function
|
|
2524
|
+
function ke(e) {
|
|
2518
2525
|
if (!e || e.length === 0) return [];
|
|
2519
2526
|
const t = /* @__PURE__ */ new Set();
|
|
2520
2527
|
for (const n of e) {
|
|
@@ -2524,29 +2531,29 @@ function Ee(e) {
|
|
|
2524
2531
|
}
|
|
2525
2532
|
return Array.from(t);
|
|
2526
2533
|
}
|
|
2527
|
-
function
|
|
2534
|
+
function nl(e, t) {
|
|
2528
2535
|
if (e != null) {
|
|
2529
2536
|
if (e === "on" || e === "off") return e;
|
|
2530
2537
|
throw new Error(`Invalid tools config at "${t}": expected "on" or "off", got ${JSON.stringify(e)}.`);
|
|
2531
2538
|
}
|
|
2532
2539
|
}
|
|
2533
|
-
function
|
|
2540
|
+
function rl(e) {
|
|
2534
2541
|
if (e != null && !qe(e)) throw new Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');
|
|
2535
|
-
const t =
|
|
2542
|
+
const t = Za(e?.policy), n = Qa(e?.placement), r = tl(e?.providers), i = nl(e?.pnpEnforcement, "pnpEnforcement"), o = {
|
|
2536
2543
|
policy: {
|
|
2537
|
-
allowed: Ee(
|
|
2538
|
-
blocked: Ee(
|
|
2544
|
+
allowed: ke(Ee(t?.allowed, "policy.allowed")),
|
|
2545
|
+
blocked: ke(Ee(t?.blocked, "policy.blocked"))
|
|
2539
2546
|
},
|
|
2540
2547
|
placement: {
|
|
2541
|
-
section: Ee(
|
|
2542
|
-
item: Ee(
|
|
2543
|
-
passage: Ee(
|
|
2548
|
+
section: ke(Ee(n?.section, "placement.section")).length ? ke(Ee(n?.section, "placement.section")) : [...Sn.section],
|
|
2549
|
+
item: ke(Ee(n?.item, "placement.item")).length ? ke(Ee(n?.item, "placement.item")) : [...Sn.item],
|
|
2550
|
+
passage: ke(Ee(n?.passage, "placement.passage")).length ? ke(Ee(n?.passage, "placement.passage")) : [...Sn.passage]
|
|
2544
2551
|
},
|
|
2545
2552
|
providers: r
|
|
2546
2553
|
};
|
|
2547
2554
|
return i && (o.pnpEnforcement = i), o;
|
|
2548
2555
|
}
|
|
2549
|
-
var
|
|
2556
|
+
var il = [
|
|
2550
2557
|
"assessment",
|
|
2551
2558
|
"section",
|
|
2552
2559
|
"item",
|
|
@@ -2557,7 +2564,7 @@ var rl = [
|
|
|
2557
2564
|
function Dt(e, t) {
|
|
2558
2565
|
if (typeof e != "string" || e.trim().length === 0) throw new Error(`Invalid tool registration: "${t}" must be a non-empty string.`);
|
|
2559
2566
|
}
|
|
2560
|
-
var
|
|
2567
|
+
var ol = [
|
|
2561
2568
|
{
|
|
2562
2569
|
pattern: /<script\b/i,
|
|
2563
2570
|
reason: "contains a <script> tag"
|
|
@@ -2575,17 +2582,17 @@ var il = [
|
|
|
2575
2582
|
reason: "contains a <foreignObject> element"
|
|
2576
2583
|
}
|
|
2577
2584
|
];
|
|
2578
|
-
function
|
|
2585
|
+
function sl(e, t, n) {
|
|
2579
2586
|
const r = t.trimStart(), i = r.toLowerCase().startsWith("<svg"), o = /^https?:/i.test(r);
|
|
2580
2587
|
if (/^data:/i.test(r)) throw new Error(`Invalid tool registration "${e}": "${n}" may not be a data: URL.`);
|
|
2581
2588
|
if (!(!i && !o)) {
|
|
2582
|
-
for (const { pattern: s, reason: a } of
|
|
2589
|
+
for (const { pattern: s, reason: a } of ol) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${n}" ${a}. Inline SVG icons must not include scriptable content.`);
|
|
2583
2590
|
}
|
|
2584
2591
|
}
|
|
2585
2592
|
function Pr(e) {
|
|
2586
2593
|
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" &&
|
|
2588
|
-
const t = e.supportedLevels.find((n) => !
|
|
2594
|
+
if (typeof e.icon == "string" && sl(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.`);
|
|
2595
|
+
const t = e.supportedLevels.find((n) => !il.includes(n));
|
|
2589
2596
|
if (t) throw new Error(`Invalid tool registration "${e.toolId}": unsupported level "${t}".`);
|
|
2590
2597
|
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
2598
|
if (e.singletonScope !== void 0 && e.singletonScope !== "section") throw new Error(`Invalid tool registration "${e.toolId}": unsupported singletonScope "${String(e.singletonScope)}".`);
|
|
@@ -2594,7 +2601,7 @@ function Pr(e) {
|
|
|
2594
2601
|
if (typeof e.isVisibleInContext != "function") throw new Error(`Invalid tool registration "${e.toolId}": "isVisibleInContext" must be a function.`);
|
|
2595
2602
|
if (typeof e.renderToolbar != "function") throw new Error(`Invalid tool registration "${e.toolId}": "renderToolbar" must be a function.`);
|
|
2596
2603
|
}
|
|
2597
|
-
var
|
|
2604
|
+
var al = class {
|
|
2598
2605
|
constructor() {
|
|
2599
2606
|
f(this, "tools", /* @__PURE__ */ new Map()), f(this, "pnpIndex", /* @__PURE__ */ new Map()), f(this, "componentOverrides", {}), f(this, "moduleLoaders", /* @__PURE__ */ new Map()), f(this, "loadedToolModules", /* @__PURE__ */ new Set()), f(this, "moduleLoadPromises", /* @__PURE__ */ new Map());
|
|
2600
2607
|
}
|
|
@@ -2740,10 +2747,10 @@ var sl = class {
|
|
|
2740
2747
|
function uo(e) {
|
|
2741
2748
|
return e.level === "item";
|
|
2742
2749
|
}
|
|
2743
|
-
function
|
|
2750
|
+
function ll(e) {
|
|
2744
2751
|
return e.level === "passage";
|
|
2745
2752
|
}
|
|
2746
|
-
function
|
|
2753
|
+
function cl(e) {
|
|
2747
2754
|
return e.level === "rubric";
|
|
2748
2755
|
}
|
|
2749
2756
|
function ho(e) {
|
|
@@ -2784,7 +2791,7 @@ function sr(e) {
|
|
|
2784
2791
|
}
|
|
2785
2792
|
return r.filter(Boolean).join(" ").trim();
|
|
2786
2793
|
}
|
|
2787
|
-
if (
|
|
2794
|
+
if (ll(e)) {
|
|
2788
2795
|
const t = e.passage;
|
|
2789
2796
|
if (!t?.config) return "";
|
|
2790
2797
|
const n = t.config, r = [], i = (l) => l.replace(/<[^>]*>/g, " ").trim();
|
|
@@ -2803,7 +2810,7 @@ function sr(e) {
|
|
|
2803
2810
|
}
|
|
2804
2811
|
return r.filter(Boolean).join(" ").trim();
|
|
2805
2812
|
}
|
|
2806
|
-
if (
|
|
2813
|
+
if (cl(e)) {
|
|
2807
2814
|
const t = e.rubricBlock;
|
|
2808
2815
|
return t.passage?.config ? (t.passage.config.markup || "").replace(/<[^>]*>/g, " ").trim() : (t.content || "").replace(/<[^>]*>/g, " ").trim();
|
|
2809
2816
|
}
|
|
@@ -2820,7 +2827,7 @@ function fn(e) {
|
|
|
2820
2827
|
/\d+\s*[+\-*/=]\s*\d+/
|
|
2821
2828
|
].some((n) => n.test(t));
|
|
2822
2829
|
}
|
|
2823
|
-
function
|
|
2830
|
+
function ul(e) {
|
|
2824
2831
|
const t = [
|
|
2825
2832
|
"pie-multiple-choice",
|
|
2826
2833
|
"pie-inline-choice",
|
|
@@ -2850,7 +2857,7 @@ function cl(e) {
|
|
|
2850
2857
|
function pn(e) {
|
|
2851
2858
|
return sr(e).trim().length >= 10;
|
|
2852
2859
|
}
|
|
2853
|
-
function
|
|
2860
|
+
function hl(e) {
|
|
2854
2861
|
const t = sr(e);
|
|
2855
2862
|
return [
|
|
2856
2863
|
/chemistry|chemical|element|atom|molecule|compound/i,
|
|
@@ -2861,23 +2868,23 @@ function ul(e) {
|
|
|
2861
2868
|
/physics|force|energy|velocity|acceleration/i
|
|
2862
2869
|
].some((n) => n.test(t));
|
|
2863
2870
|
}
|
|
2864
|
-
var
|
|
2871
|
+
var dl = [
|
|
2865
2872
|
"assessment",
|
|
2866
2873
|
"section",
|
|
2867
2874
|
"item",
|
|
2868
2875
|
"passage",
|
|
2869
2876
|
"rubric"
|
|
2870
|
-
],
|
|
2871
|
-
function
|
|
2872
|
-
return
|
|
2877
|
+
], fl = new Set(dl);
|
|
2878
|
+
function pl(e) {
|
|
2879
|
+
return fl.has(e);
|
|
2873
2880
|
}
|
|
2874
2881
|
function ar(e, t, n) {
|
|
2875
2882
|
const r = e.trim(), i = n.trim();
|
|
2876
2883
|
if (!r || !i) throw new Error("Tool instance ids require non-empty tool and scope ids");
|
|
2877
|
-
if (!
|
|
2884
|
+
if (!pl(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
|
|
2878
2885
|
return `${r}:${t}:${i}`;
|
|
2879
2886
|
}
|
|
2880
|
-
var
|
|
2887
|
+
var gl = class {
|
|
2881
2888
|
constructor() {
|
|
2882
2889
|
f(this, "providerId", "desmos-calculator"), f(this, "providerName", "Desmos Calculator"), f(this, "category", "calculator"), f(this, "version", "1.10"), f(this, "requiresAuth", !0), f(this, "desmosProvider", null), f(this, "config", null);
|
|
2883
2890
|
}
|
|
@@ -2981,12 +2988,12 @@ var pl = class {
|
|
|
2981
2988
|
text: e,
|
|
2982
2989
|
offset: 0
|
|
2983
2990
|
}];
|
|
2984
|
-
}, fo = (e) => String(e || "").trim().toLowerCase(),
|
|
2991
|
+
}, fo = (e) => String(e || "").trim().toLowerCase(), ml = () => fo((typeof navigator < "u" ? navigator.language || navigator.languages?.[0] : "") || "en-US"), vl = (e, t) => {
|
|
2985
2992
|
if (t) {
|
|
2986
2993
|
const s = e.find((a) => a.name === t);
|
|
2987
2994
|
if (s) return s;
|
|
2988
2995
|
}
|
|
2989
|
-
const n =
|
|
2996
|
+
const n = ml(), r = n.split("-")[0] || "en", i = (s) => {
|
|
2990
2997
|
const a = fo(s.lang);
|
|
2991
2998
|
return a === n || a.startsWith(`${r}-`);
|
|
2992
2999
|
}, o = [
|
|
@@ -3001,14 +3008,14 @@ var pl = class {
|
|
|
3001
3008
|
if (a) return a;
|
|
3002
3009
|
}
|
|
3003
3010
|
return e[0] || null;
|
|
3004
|
-
},
|
|
3011
|
+
}, yl = (e) => !e.default, po = class {
|
|
3005
3012
|
constructor() {
|
|
3006
3013
|
f(this, "providerId", "browser"), f(this, "providerName", "Browser Speech Synthesis"), f(this, "version", "1.0.0");
|
|
3007
3014
|
}
|
|
3008
3015
|
async initialize(e) {
|
|
3009
3016
|
if (typeof window > "u") throw new Error("BrowserTTSProvider requires browser environment");
|
|
3010
3017
|
if (!("speechSynthesis" in window)) throw new Error("Browser does not support Speech Synthesis API");
|
|
3011
|
-
return new
|
|
3018
|
+
return new bl(e);
|
|
3012
3019
|
}
|
|
3013
3020
|
supportsFeature(e) {
|
|
3014
3021
|
return !0;
|
|
@@ -3026,7 +3033,7 @@ var pl = class {
|
|
|
3026
3033
|
}
|
|
3027
3034
|
destroy() {
|
|
3028
3035
|
}
|
|
3029
|
-
},
|
|
3036
|
+
}, bl = class {
|
|
3030
3037
|
constructor(e) {
|
|
3031
3038
|
f(this, "utterance", null), f(this, "config", null), f(this, "_isPlaying", !1), f(this, "_isPaused", !1), f(this, "speakRunId", 0), f(this, "onWordBoundary", void 0), this.config = e;
|
|
3032
3039
|
}
|
|
@@ -3113,8 +3120,8 @@ var pl = class {
|
|
|
3113
3120
|
}
|
|
3114
3121
|
const o = new SpeechSynthesisUtterance(e);
|
|
3115
3122
|
this.utterance = o;
|
|
3116
|
-
const s =
|
|
3117
|
-
s &&
|
|
3123
|
+
const s = vl(speechSynthesis.getVoices(), this.config?.voice);
|
|
3124
|
+
s && yl(s) && (o.voice = s), this.config?.rate && (o.rate = this.config.rate), this.config?.pitch && (o.pitch = this.config.pitch);
|
|
3118
3125
|
const a = () => {
|
|
3119
3126
|
this.utterance === o && (this.utterance = null);
|
|
3120
3127
|
};
|
|
@@ -3168,7 +3175,7 @@ var pl = class {
|
|
|
3168
3175
|
...e.providerOptions || {}
|
|
3169
3176
|
});
|
|
3170
3177
|
}
|
|
3171
|
-
},
|
|
3178
|
+
}, Tl = class {
|
|
3172
3179
|
async emitTelemetry(e, t) {
|
|
3173
3180
|
try {
|
|
3174
3181
|
await this.config?.onTelemetry?.(e, t);
|
|
@@ -3258,7 +3265,7 @@ var pl = class {
|
|
|
3258
3265
|
destroy() {
|
|
3259
3266
|
this.ttsProvider && (this.ttsProvider.destroy(), this.ttsProvider = null), this.config = null, console.log("[TTSToolProvider] Destroyed");
|
|
3260
3267
|
}
|
|
3261
|
-
},
|
|
3268
|
+
}, Sl = /* @__PURE__ */ new Set([
|
|
3262
3269
|
"annotation-xml",
|
|
3263
3270
|
"color-profile",
|
|
3264
3271
|
"font-face",
|
|
@@ -3267,14 +3274,14 @@ var pl = class {
|
|
|
3267
3274
|
"font-face-format",
|
|
3268
3275
|
"font-face-name",
|
|
3269
3276
|
"missing-glyph"
|
|
3270
|
-
]),
|
|
3277
|
+
]), _l = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, wl = (e, t = "custom element tag") => {
|
|
3271
3278
|
if (!e || typeof e != "string") throw new Error(`Invalid ${t}: expected a non-empty string`);
|
|
3272
3279
|
const n = e.trim();
|
|
3273
3280
|
if (!n) throw new Error(`Invalid ${t}: tag is empty`);
|
|
3274
3281
|
if (n !== n.toLowerCase()) throw new Error(`Invalid ${t} "${n}": custom element names must be lowercase`);
|
|
3275
3282
|
if (!n.includes("-")) throw new Error(`Invalid ${t} "${n}": custom element names must include a hyphen`);
|
|
3276
|
-
if (
|
|
3277
|
-
if (!
|
|
3283
|
+
if (Sl.has(n)) throw new Error(`Invalid ${t} "${n}": this name is reserved by the HTML spec`);
|
|
3284
|
+
if (!_l.test(n)) throw new Error(`Invalid ${t} "${n}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
|
|
3278
3285
|
return n;
|
|
3279
3286
|
}, go = {
|
|
3280
3287
|
calculator: "pie-tool-calculator",
|
|
@@ -3288,8 +3295,8 @@ var pl = class {
|
|
|
3288
3295
|
annotationToolbar: "pie-tool-annotation-toolbar",
|
|
3289
3296
|
graph: "pie-tool-graph",
|
|
3290
3297
|
periodicTable: "pie-tool-periodic-table"
|
|
3291
|
-
},
|
|
3292
|
-
const i =
|
|
3298
|
+
}, El = (e, t) => wl(t?.toolTagMap?.[e] ?? go[e] ?? e, `tool component tag for "${e}"`), kl = (e) => document.createElement(e), fe = (e, t, n, r) => {
|
|
3299
|
+
const i = El(e, r), o = r?.toolComponentFactories?.[e] ?? r?.toolComponentFactory;
|
|
3293
3300
|
return o ? o({
|
|
3294
3301
|
toolId: e,
|
|
3295
3302
|
tagName: i,
|
|
@@ -3297,12 +3304,12 @@ var pl = class {
|
|
|
3297
3304
|
toolbarContext: n
|
|
3298
3305
|
}) : kl(i);
|
|
3299
3306
|
}, Nn = /* @__PURE__ */ new WeakMap();
|
|
3300
|
-
function
|
|
3307
|
+
function Al(e, t) {
|
|
3301
3308
|
if (!e) return null;
|
|
3302
3309
|
const n = Nn.get(e), r = n?.get(t);
|
|
3303
3310
|
return r ? r.isConnected ? r : (n?.delete(t), null) : null;
|
|
3304
3311
|
}
|
|
3305
|
-
function
|
|
3312
|
+
function Cl(e, t, n) {
|
|
3306
3313
|
if (!e) return;
|
|
3307
3314
|
let r = Nn.get(e);
|
|
3308
3315
|
r || (r = /* @__PURE__ */ new Map(), Nn.set(e, r)), r.set(t, n);
|
|
@@ -3310,7 +3317,7 @@ function Al(e, t, n) {
|
|
|
3310
3317
|
function Nr(e) {
|
|
3311
3318
|
return e === "basic" || e === "scientific" ? e : null;
|
|
3312
3319
|
}
|
|
3313
|
-
function
|
|
3320
|
+
function xl(e) {
|
|
3314
3321
|
const t = e.getToolRenderParams?.("calculator") ?? {}, n = Nr(t.calculatorType), r = t.availableTypes;
|
|
3315
3322
|
return {
|
|
3316
3323
|
calculatorType: n,
|
|
@@ -3322,14 +3329,14 @@ function Hr(e, t, n) {
|
|
|
3322
3329
|
const r = e;
|
|
3323
3330
|
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
3331
|
}
|
|
3325
|
-
var
|
|
3332
|
+
var Il = {
|
|
3326
3333
|
toolId: "calculator",
|
|
3327
3334
|
name: "Calculator",
|
|
3328
3335
|
description: "Multi-type calculator (basic, scientific, graphing)",
|
|
3329
3336
|
icon: "calculator",
|
|
3330
3337
|
provider: {
|
|
3331
3338
|
getProviderId: (e) => typeof e?.provider?.id == "string" && e.provider.id.length > 0 ? e.provider.id : "calculator-desmos",
|
|
3332
|
-
createProvider: () => new
|
|
3339
|
+
createProvider: () => new gl(),
|
|
3333
3340
|
getInitConfig: (e) => e?.provider?.init ?? {},
|
|
3334
3341
|
getAuthFetcher: (e) => {
|
|
3335
3342
|
const t = e?.provider?.runtime?.authFetcher;
|
|
@@ -3355,8 +3362,8 @@ var xl = {
|
|
|
3355
3362
|
return fn(e);
|
|
3356
3363
|
},
|
|
3357
3364
|
renderToolbar(e, t) {
|
|
3358
|
-
const { calculatorType: n, availableTypes: r, displayName: i } =
|
|
3359
|
-
a ||
|
|
3365
|
+
const { calculatorType: n, availableTypes: r, displayName: i } = xl(t), o = ar(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = Al(t.toolCoordinator, o), l = a ?? fe(this.toolId, e, t, s);
|
|
3366
|
+
a || Cl(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Hr(l, n, r);
|
|
3360
3367
|
const c = n === null ? "Open scientific calculator" : `Open ${i.toLowerCase()}`, u = n === null ? "Close scientific calculator" : `Close ${i.toLowerCase()}`, h = {
|
|
3361
3368
|
toolId: this.toolId,
|
|
3362
3369
|
label: i,
|
|
@@ -3476,13 +3483,13 @@ var xl = {
|
|
|
3476
3483
|
text: h,
|
|
3477
3484
|
map: n
|
|
3478
3485
|
};
|
|
3479
|
-
}, _n = null,
|
|
3486
|
+
}, _n = null, Wr = Promise.resolve(), Ol = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Ml = async () => (_n || (_n = import("./sre-Dddi65jB.js").then((e) => /* @__PURE__ */ as(e.default, 1)).then((e) => {
|
|
3480
3487
|
const t = e.default || e;
|
|
3481
3488
|
if (!t || typeof t.toSpeech != "function") throw new Error("speech-rule-engine did not expose toSpeech");
|
|
3482
3489
|
return t;
|
|
3483
|
-
})), _n),
|
|
3484
|
-
if (!
|
|
3485
|
-
const t = zr(e.domain), n = zr(e.style), r =
|
|
3490
|
+
})), _n), Rl = (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) => {
|
|
3491
|
+
if (!Br(e)) return;
|
|
3492
|
+
const t = zr(e.domain), n = zr(e.style), r = Br(e.engineOptions) ? e.engineOptions : void 0;
|
|
3486
3493
|
if (!(!t && !n && !r))
|
|
3487
3494
|
return {
|
|
3488
3495
|
...t ? { domain: t } : {},
|
|
@@ -3490,23 +3497,23 @@ var xl = {
|
|
|
3490
3497
|
...r ? { engineOptions: r } : {}
|
|
3491
3498
|
};
|
|
3492
3499
|
}, Ll = async (e, t, n, r) => {
|
|
3493
|
-
const i =
|
|
3500
|
+
const i = Ol(t), o = gn(r);
|
|
3494
3501
|
await e.setupEngine?.({
|
|
3495
3502
|
...o?.engineOptions || {},
|
|
3496
3503
|
locale: i,
|
|
3497
|
-
domain: o?.domain ||
|
|
3504
|
+
domain: o?.domain || Rl(i),
|
|
3498
3505
|
...o?.style ? { style: o.style } : {},
|
|
3499
3506
|
modality: "speech",
|
|
3500
3507
|
markup: n
|
|
3501
3508
|
}), await e.engineReady?.();
|
|
3502
|
-
},
|
|
3503
|
-
const t =
|
|
3504
|
-
return
|
|
3509
|
+
}, $l = async (e) => {
|
|
3510
|
+
const t = Wr.then(e, e);
|
|
3511
|
+
return Wr = t.then(() => {
|
|
3505
3512
|
}, () => {
|
|
3506
3513
|
}), t;
|
|
3507
|
-
}, bo = async (e, t, n, r, i) =>
|
|
3514
|
+
}, bo = async (e, t, n, r, i) => $l(async () => (await Ll(e, n, r, i), e.toSpeech(t))), Pl = (e) => e.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), Nl = async (e, t, n, r) => {
|
|
3508
3515
|
try {
|
|
3509
|
-
const i =
|
|
3516
|
+
const i = Pl(await bo(e, t, n, "ssml", r));
|
|
3510
3517
|
return i.includes("<speak") ? i : null;
|
|
3511
3518
|
} catch (i) {
|
|
3512
3519
|
return console.debug("[TTSService] Math SSML generation failed; using plain", { message: i instanceof Error ? i.message : String(i) }), null;
|
|
@@ -3518,7 +3525,7 @@ var xl = {
|
|
|
3518
3525
|
usedFallback: !1
|
|
3519
3526
|
};
|
|
3520
3527
|
let n = null, r = !1, i = !1;
|
|
3521
|
-
const o = t.loadSre ||
|
|
3528
|
+
const o = t.loadSre || Ml, s = [];
|
|
3522
3529
|
for (const c of e) {
|
|
3523
3530
|
if (c.type === "text") {
|
|
3524
3531
|
s.push(c.text);
|
|
@@ -3538,18 +3545,18 @@ var xl = {
|
|
|
3538
3545
|
}
|
|
3539
3546
|
const a = $(s.join(" "));
|
|
3540
3547
|
let l;
|
|
3541
|
-
return t.produceSsml && n && r && e.length === 1 && e[0].type === "math" && (l = await
|
|
3548
|
+
return t.produceSsml && n && r && e.length === 1 && e[0].type === "math" && (l = await Nl(n, e[0].mathml, t.language, t.mathSpeech) ?? void 0), {
|
|
3542
3549
|
speechText: a,
|
|
3543
3550
|
usedMathSpeech: r,
|
|
3544
3551
|
usedFallback: i,
|
|
3545
3552
|
ssml: l
|
|
3546
3553
|
};
|
|
3547
|
-
},
|
|
3554
|
+
}, Hl = /* @__PURE__ */ new Set([
|
|
3548
3555
|
"reserved-row",
|
|
3549
3556
|
"expanding-row",
|
|
3550
3557
|
"floating-overlay",
|
|
3551
3558
|
"left-aligned"
|
|
3552
|
-
]), Fr = (e) => e && typeof e == "object" ? e : {},
|
|
3559
|
+
]), Fr = (e) => e && typeof e == "object" ? e : {}, Wl = (e) => e === "polly" || e === "google" || e === "server", X = (e, t) => e === void 0 ? t : e, sn = (e, t = "left-aligned") => typeof e == "string" && Hl.has(e) ? e : t, Dr = Object.freeze([0.8, 1.25]), jr = (e) => {
|
|
3553
3560
|
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) return;
|
|
3554
3561
|
const t = Math.round(e * 100) / 100;
|
|
3555
3562
|
return t === 1 ? void 0 : t;
|
|
@@ -3557,7 +3564,7 @@ var xl = {
|
|
|
3557
3564
|
if (typeof e != "string") return;
|
|
3558
3565
|
const t = e.trim();
|
|
3559
3566
|
return t.length ? t : void 0;
|
|
3560
|
-
}, Vr = (e) => `${e}x`, So = (e, t) => t ? `Speed ${e}` : `${e} speed`, Bl = (e, t, n) => t ? t.toLowerCase().includes(e.toLowerCase()) ? t : `${e} ${t}` : So(e, n),
|
|
3567
|
+
}, Vr = (e) => `${e}x`, So = (e, t) => t ? `Speed ${e}` : `${e} speed`, Bl = (e, t, n) => t ? t.toLowerCase().includes(e.toLowerCase()) ? t : `${e} ${t}` : So(e, n), zl = (e) => {
|
|
3561
3568
|
if (typeof e == "number") return jr(e);
|
|
3562
3569
|
if (!e || typeof e != "object" || Array.isArray(e)) return;
|
|
3563
3570
|
const t = e, n = jr(t.rate);
|
|
@@ -3573,13 +3580,13 @@ var xl = {
|
|
|
3573
3580
|
if (e.length === 0) return [];
|
|
3574
3581
|
const t = /* @__PURE__ */ new Set(), n = [];
|
|
3575
3582
|
for (const r of e) {
|
|
3576
|
-
const i =
|
|
3583
|
+
const i = zl(r);
|
|
3577
3584
|
if (i === void 0) continue;
|
|
3578
3585
|
const o = typeof i == "number" ? i : i.rate;
|
|
3579
3586
|
t.has(o) || (t.add(o), n.push(i));
|
|
3580
3587
|
}
|
|
3581
3588
|
return n.length ? n : [...Dr];
|
|
3582
|
-
},
|
|
3589
|
+
}, Fl = (e) => Hn(e).map((t) => {
|
|
3583
3590
|
if (typeof t == "number") {
|
|
3584
3591
|
const i = Vr(t);
|
|
3585
3592
|
return {
|
|
@@ -3594,12 +3601,12 @@ var xl = {
|
|
|
3594
3601
|
label: r,
|
|
3595
3602
|
ariaLabel: Bl(r, t.ariaLabel, r === n)
|
|
3596
3603
|
};
|
|
3597
|
-
}),
|
|
3604
|
+
}), Dl = (e) => {
|
|
3598
3605
|
const t = {
|
|
3599
3606
|
...e,
|
|
3600
3607
|
layoutMode: sn(e.layoutMode)
|
|
3601
3608
|
}, n = e.backend || "browser";
|
|
3602
|
-
if (!
|
|
3609
|
+
if (!Wl(n)) return t;
|
|
3603
3610
|
const r = {
|
|
3604
3611
|
...t,
|
|
3605
3612
|
apiEndpoint: X(t.apiEndpoint, "/api/tts"),
|
|
@@ -3622,12 +3629,12 @@ var xl = {
|
|
|
3622
3629
|
} : r;
|
|
3623
3630
|
}, wn = (e) => {
|
|
3624
3631
|
const t = Fr(e), n = Fr(t.settings);
|
|
3625
|
-
return
|
|
3632
|
+
return Dl({
|
|
3626
3633
|
...t,
|
|
3627
3634
|
...n
|
|
3628
3635
|
});
|
|
3629
|
-
},
|
|
3630
|
-
const t =
|
|
3636
|
+
}, Wn = (e) => e.backend || "browser", _o = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, wo = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), jl = (e) => {
|
|
3637
|
+
const t = Wn(e), n = _o(e, t), r = wo(e, n), i = gn(e.mathSpeech);
|
|
3631
3638
|
return {
|
|
3632
3639
|
voice: e.defaultVoice,
|
|
3633
3640
|
rate: e.rate,
|
|
@@ -3653,8 +3660,8 @@ var xl = {
|
|
|
3653
3660
|
validateEndpoint: e.validateEndpoint,
|
|
3654
3661
|
...typeof e.mathTokenHighlighting == "boolean" ? { mathTokenHighlighting: e.mathTokenHighlighting } : {}
|
|
3655
3662
|
};
|
|
3656
|
-
},
|
|
3657
|
-
switch (
|
|
3663
|
+
}, Eo = (e) => sn(e.layoutMode), ql = (e) => {
|
|
3664
|
+
switch (Eo(e)) {
|
|
3658
3665
|
case "reserved-row":
|
|
3659
3666
|
return {
|
|
3660
3667
|
mount: "before-buttons",
|
|
@@ -3680,21 +3687,21 @@ var xl = {
|
|
|
3680
3687
|
}
|
|
3681
3688
|
};
|
|
3682
3689
|
}
|
|
3683
|
-
}, gt = /* @__PURE__ */ new Map(),
|
|
3690
|
+
}, gt = /* @__PURE__ */ new Map(), Vl = "__pieToolElementUnmount", Gr = "pie-tool-active-change", Gl = {
|
|
3684
3691
|
toolId: "textToSpeech",
|
|
3685
3692
|
name: "Text to Speech",
|
|
3686
3693
|
description: "Read content aloud",
|
|
3687
3694
|
icon: "volume-up",
|
|
3688
3695
|
provider: {
|
|
3689
3696
|
getProviderId: () => "tts",
|
|
3690
|
-
createProvider: (e) => new
|
|
3697
|
+
createProvider: (e) => new Tl(Wn(wn(e))),
|
|
3691
3698
|
getInitConfig: (e) => {
|
|
3692
|
-
const t = wn(e), n =
|
|
3699
|
+
const t = wn(e), n = Wn(t), r = _o(t, n);
|
|
3693
3700
|
return {
|
|
3694
3701
|
backend: n,
|
|
3695
3702
|
serverProvider: r,
|
|
3696
3703
|
transportMode: wo(t, r),
|
|
3697
|
-
...
|
|
3704
|
+
...jl(t)
|
|
3698
3705
|
};
|
|
3699
3706
|
},
|
|
3700
3707
|
getAuthFetcher: (e) => {
|
|
@@ -3720,12 +3727,12 @@ var xl = {
|
|
|
3720
3727
|
return pn(e);
|
|
3721
3728
|
},
|
|
3722
3729
|
renderToolbar(e, t) {
|
|
3723
|
-
const n = () => wn(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), r = () =>
|
|
3730
|
+
const n = () => wn(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), r = () => Fl(n().speedOptions), i = () => Eo(n()), o = () => ql(n()), s = ar(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
|
|
3724
3731
|
const u = t.ui?.size;
|
|
3725
3732
|
return u === "sm" || u === "lg" ? u : "md";
|
|
3726
3733
|
}, l = () => {
|
|
3727
3734
|
let u = gt.get(s);
|
|
3728
|
-
return u && typeof u.isConnected == "boolean" && !u.isConnected && (gt.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[
|
|
3735
|
+
return u && typeof u.isConnected == "boolean" && !u.isConnected && (gt.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[Vl] = () => {
|
|
3729
3736
|
gt.get(s) === u && gt.delete(s);
|
|
3730
3737
|
}, 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;
|
|
3731
3738
|
}, c = o();
|
|
@@ -3774,7 +3781,7 @@ function Se(e) {
|
|
|
3774
3781
|
function cr(e, t) {
|
|
3775
3782
|
e.setAttribute("data-pie-tool-surface", t);
|
|
3776
3783
|
}
|
|
3777
|
-
var
|
|
3784
|
+
var Ul = {
|
|
3778
3785
|
toolId: "ruler",
|
|
3779
3786
|
name: "Ruler",
|
|
3780
3787
|
description: "On-screen ruler for measurements",
|
|
@@ -3816,7 +3823,7 @@ var Gl = {
|
|
|
3816
3823
|
subscribeActive: n.subscribeActive
|
|
3817
3824
|
};
|
|
3818
3825
|
}
|
|
3819
|
-
},
|
|
3826
|
+
}, Kl = {
|
|
3820
3827
|
toolId: "protractor",
|
|
3821
3828
|
name: "Protractor",
|
|
3822
3829
|
description: "On-screen protractor for angle measurements",
|
|
@@ -3858,7 +3865,7 @@ var Gl = {
|
|
|
3858
3865
|
subscribeActive: n.subscribeActive
|
|
3859
3866
|
};
|
|
3860
3867
|
}
|
|
3861
|
-
},
|
|
3868
|
+
}, Xl = {
|
|
3862
3869
|
toolId: "answerEliminator",
|
|
3863
3870
|
name: "Answer Eliminator",
|
|
3864
3871
|
description: "Strike through answer choices",
|
|
@@ -3871,7 +3878,7 @@ var Gl = {
|
|
|
3871
3878
|
"choiceMasking"
|
|
3872
3879
|
],
|
|
3873
3880
|
isVisibleInContext(e) {
|
|
3874
|
-
return
|
|
3881
|
+
return ul(e);
|
|
3875
3882
|
},
|
|
3876
3883
|
renderToolbar(e, t) {
|
|
3877
3884
|
const n = Te(this.toolId, t), r = t.componentOverrides ?? {}, i = fe(this.toolId, e, t, r);
|
|
@@ -3905,7 +3912,7 @@ var Gl = {
|
|
|
3905
3912
|
subscribeActive: n.subscribeActive
|
|
3906
3913
|
};
|
|
3907
3914
|
}
|
|
3908
|
-
},
|
|
3915
|
+
}, Yl = {
|
|
3909
3916
|
toolId: "highlighter",
|
|
3910
3917
|
name: "Highlighter",
|
|
3911
3918
|
description: "Highlight text",
|
|
@@ -3956,7 +3963,7 @@ var Gl = {
|
|
|
3956
3963
|
subscribeActive: n.subscribeActive
|
|
3957
3964
|
};
|
|
3958
3965
|
}
|
|
3959
|
-
},
|
|
3966
|
+
}, Jl = {
|
|
3960
3967
|
toolId: "lineReader",
|
|
3961
3968
|
name: "Line Reader",
|
|
3962
3969
|
description: "Reading guide overlay",
|
|
@@ -4005,7 +4012,7 @@ var Gl = {
|
|
|
4005
4012
|
subscribeActive: n.subscribeActive
|
|
4006
4013
|
};
|
|
4007
4014
|
}
|
|
4008
|
-
},
|
|
4015
|
+
}, Ql = {
|
|
4009
4016
|
toolId: "theme",
|
|
4010
4017
|
name: "Theme",
|
|
4011
4018
|
description: "Accessible themes and contrast",
|
|
@@ -4060,7 +4067,7 @@ var Gl = {
|
|
|
4060
4067
|
subscribeActive: n.subscribeActive
|
|
4061
4068
|
};
|
|
4062
4069
|
}
|
|
4063
|
-
},
|
|
4070
|
+
}, Zl = {
|
|
4064
4071
|
toolId: "annotationToolbar",
|
|
4065
4072
|
name: "Highlighter",
|
|
4066
4073
|
description: "Highlight and annotate text",
|
|
@@ -4111,7 +4118,7 @@ var Gl = {
|
|
|
4111
4118
|
subscribeActive: n.subscribeActive
|
|
4112
4119
|
};
|
|
4113
4120
|
}
|
|
4114
|
-
},
|
|
4121
|
+
}, ec = {
|
|
4115
4122
|
toolId: "graph",
|
|
4116
4123
|
name: "Graph",
|
|
4117
4124
|
description: "Graphing calculator and coordinate plane",
|
|
@@ -4164,7 +4171,7 @@ var Gl = {
|
|
|
4164
4171
|
subscribeActive: n.subscribeActive
|
|
4165
4172
|
};
|
|
4166
4173
|
}
|
|
4167
|
-
},
|
|
4174
|
+
}, tc = {
|
|
4168
4175
|
toolId: "periodicTable",
|
|
4169
4176
|
name: "Periodic Table",
|
|
4170
4177
|
description: "Chemistry periodic table reference",
|
|
@@ -4176,7 +4183,7 @@ var Gl = {
|
|
|
4176
4183
|
"elementReference"
|
|
4177
4184
|
],
|
|
4178
4185
|
isVisibleInContext(e) {
|
|
4179
|
-
return
|
|
4186
|
+
return hl(e);
|
|
4180
4187
|
},
|
|
4181
4188
|
renderToolbar(e, t) {
|
|
4182
4189
|
const n = Te(this.toolId, t), r = {
|
|
@@ -4216,9 +4223,8 @@ var Gl = {
|
|
|
4216
4223
|
subscribeActive: n.subscribeActive
|
|
4217
4224
|
};
|
|
4218
4225
|
}
|
|
4219
|
-
},
|
|
4220
|
-
|
|
4221
|
-
Vl,
|
|
4226
|
+
}, nc = [
|
|
4227
|
+
Il,
|
|
4222
4228
|
Gl,
|
|
4223
4229
|
Ul,
|
|
4224
4230
|
Kl,
|
|
@@ -4227,10 +4233,11 @@ var Gl = {
|
|
|
4227
4233
|
Jl,
|
|
4228
4234
|
Ql,
|
|
4229
4235
|
Zl,
|
|
4230
|
-
ec
|
|
4236
|
+
ec,
|
|
4237
|
+
tc
|
|
4231
4238
|
];
|
|
4232
|
-
function
|
|
4233
|
-
const t = new
|
|
4239
|
+
function rc(e = {}) {
|
|
4240
|
+
const t = new al(), n = {
|
|
4234
4241
|
toolTagMap: {
|
|
4235
4242
|
...go,
|
|
4236
4243
|
...e.toolTagMap || {}
|
|
@@ -4238,32 +4245,32 @@ function nc(e = {}) {
|
|
|
4238
4245
|
toolComponentFactory: e.toolComponentFactory,
|
|
4239
4246
|
toolComponentFactories: e.toolComponentFactories
|
|
4240
4247
|
}, r = (i) => e.overrides?.[i.toolId] || i;
|
|
4241
|
-
return e.includePackagedTools &&
|
|
4248
|
+
return e.includePackagedTools && ic(t, {
|
|
4242
4249
|
toolIds: e.toolIds,
|
|
4243
4250
|
applyOverrides: r
|
|
4244
4251
|
}), e.toolModuleLoaders && Object.keys(e.toolModuleLoaders).length > 0 && t.setToolModuleLoaders(e.toolModuleLoaders), t.setComponentOverrides(n), t;
|
|
4245
4252
|
}
|
|
4246
|
-
function
|
|
4253
|
+
function ic(e, t = {}) {
|
|
4247
4254
|
const n = t.toolIds && t.toolIds.length > 0 ? new Set(t.toolIds) : null, r = t.applyOverrides || ((i) => i);
|
|
4248
|
-
for (const i of
|
|
4255
|
+
for (const i of nc)
|
|
4249
4256
|
n && !n.has(i.toolId) || e.register(r(i));
|
|
4250
4257
|
}
|
|
4251
|
-
function
|
|
4252
|
-
return
|
|
4258
|
+
function oc(e = {}) {
|
|
4259
|
+
return rc({
|
|
4253
4260
|
...e,
|
|
4254
4261
|
includePackagedTools: !0
|
|
4255
4262
|
});
|
|
4256
4263
|
}
|
|
4257
|
-
function
|
|
4258
|
-
const e =
|
|
4264
|
+
function sc() {
|
|
4265
|
+
const e = oc(), t = /* @__PURE__ */ new Set();
|
|
4259
4266
|
for (const n of e.getAllTools()) for (const r of n.pnpSupportIds || []) t.add(r);
|
|
4260
4267
|
return [...t].sort();
|
|
4261
4268
|
}
|
|
4262
|
-
var
|
|
4263
|
-
supports: [...
|
|
4269
|
+
var ac = sc(), Th = {
|
|
4270
|
+
supports: [...ac],
|
|
4264
4271
|
prohibitedSupports: [],
|
|
4265
4272
|
activateAtInit: []
|
|
4266
|
-
},
|
|
4273
|
+
}, lc = {
|
|
4267
4274
|
visual: {
|
|
4268
4275
|
magnification: "magnification",
|
|
4269
4276
|
screenMagnifier: "screenMagnifier",
|
|
@@ -4376,11 +4383,11 @@ var sc = oc(), Th = {
|
|
|
4376
4383
|
itemGlossary: "itemGlossary",
|
|
4377
4384
|
tutorialAvailable: "tutorialAvailable"
|
|
4378
4385
|
}
|
|
4379
|
-
}, Sh = Object.values(
|
|
4386
|
+
}, Sh = Object.values(lc).flatMap((e) => Object.values(e)), _h = lo("ToolCoordinator"), Bn;
|
|
4380
4387
|
(function(e) {
|
|
4381
4388
|
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";
|
|
4382
|
-
})(
|
|
4383
|
-
var
|
|
4389
|
+
})(Bn || (Bn = {}));
|
|
4390
|
+
var cc = /* @__PURE__ */ new Set([
|
|
4384
4391
|
"speak",
|
|
4385
4392
|
"p",
|
|
4386
4393
|
"s",
|
|
@@ -4389,20 +4396,20 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4389
4396
|
"say-as",
|
|
4390
4397
|
"voice",
|
|
4391
4398
|
"lang"
|
|
4392
|
-
]), Ur = /* @__PURE__ */ new Set(["audio", "phoneme"]),
|
|
4399
|
+
]), Ur = /* @__PURE__ */ new Set(["audio", "phoneme"]), ko = (e) => e.replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/ /g, " ").replace(/ /g, " ").replace(/&/g, "&"), jt = (e, t, n) => {
|
|
4393
4400
|
for (let r = 0; r < t.length; r++) e.push({
|
|
4394
4401
|
char: t[r],
|
|
4395
4402
|
rawOffset: n === null ? null : n + r
|
|
4396
4403
|
});
|
|
4397
|
-
},
|
|
4404
|
+
}, uc = (e, t, n) => {
|
|
4398
4405
|
const r = t.slice(n).match(/^&(quot|apos|lt|gt|nbsp|amp|#160);/i);
|
|
4399
|
-
return r ? (jt(e,
|
|
4406
|
+
return r ? (jt(e, ko(r[0]), n), r[0].length) : 0;
|
|
4400
4407
|
}, Kr = (e) => {
|
|
4401
4408
|
e.push({
|
|
4402
4409
|
char: " ",
|
|
4403
4410
|
rawOffset: null
|
|
4404
4411
|
});
|
|
4405
|
-
},
|
|
4412
|
+
}, hc = (e) => {
|
|
4406
4413
|
const t = /* @__PURE__ */ new Map(), n = [];
|
|
4407
4414
|
let r = !0;
|
|
4408
4415
|
for (const i of e) {
|
|
@@ -4418,9 +4425,9 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4418
4425
|
text: n.join(""),
|
|
4419
4426
|
rawToSpokenOffsetMap: t
|
|
4420
4427
|
};
|
|
4421
|
-
},
|
|
4428
|
+
}, dc = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", fc = (e, t) => {
|
|
4422
4429
|
const n = new RegExp(`${t}\\s*=\\s*("([^"]*)"|'([^']*)')`, "i"), r = e.match(n);
|
|
4423
|
-
return
|
|
4430
|
+
return ko(r?.[2] ?? r?.[3] ?? "") || null;
|
|
4424
4431
|
}, Ao = (e) => {
|
|
4425
4432
|
const t = [];
|
|
4426
4433
|
let n = !1, r = !1, i = 0;
|
|
@@ -4428,7 +4435,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4428
4435
|
const s = e[i];
|
|
4429
4436
|
if (s !== "<") {
|
|
4430
4437
|
if (s === "&") {
|
|
4431
|
-
const p =
|
|
4438
|
+
const p = uc(t, e, i);
|
|
4432
4439
|
if (p > 0) {
|
|
4433
4440
|
i += p;
|
|
4434
4441
|
continue;
|
|
@@ -4443,9 +4450,9 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4443
4450
|
continue;
|
|
4444
4451
|
}
|
|
4445
4452
|
r = !0;
|
|
4446
|
-
const l = e.slice(i, a + 1), c =
|
|
4453
|
+
const l = e.slice(i, a + 1), c = dc(l), u = /^<\s*\//.test(l), h = /\/\s*>$/.test(l);
|
|
4447
4454
|
if (!u && c === "sub") {
|
|
4448
|
-
const p =
|
|
4455
|
+
const p = fc(l, "alias");
|
|
4449
4456
|
if (!p) {
|
|
4450
4457
|
n = !0, i = a + 1;
|
|
4451
4458
|
continue;
|
|
@@ -4463,16 +4470,16 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4463
4470
|
i = a + 1;
|
|
4464
4471
|
continue;
|
|
4465
4472
|
}
|
|
4466
|
-
c && !
|
|
4473
|
+
c && !cc.has(c) && !Ur.has(c) && c !== "break" && c !== "sub" && (n = !0), !u && (c === "p" || c === "s") && Kr(t), i = a + 1;
|
|
4467
4474
|
}
|
|
4468
|
-
const o =
|
|
4475
|
+
const o = hc(t);
|
|
4469
4476
|
return {
|
|
4470
4477
|
spokenText: $(o.text),
|
|
4471
4478
|
rawToSpokenOffsetMap: o.rawToSpokenOffsetMap,
|
|
4472
4479
|
unsupportedSemantic: n,
|
|
4473
4480
|
hasMarkup: r
|
|
4474
4481
|
};
|
|
4475
|
-
},
|
|
4482
|
+
}, pc = mo(), Co = /* @__PURE__ */ new Map([
|
|
4476
4483
|
["zero", "0"],
|
|
4477
4484
|
["one", "1"],
|
|
4478
4485
|
["two", "2"],
|
|
@@ -4484,7 +4491,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4484
4491
|
["eight", "8"],
|
|
4485
4492
|
["nine", "9"],
|
|
4486
4493
|
["ten", "10"]
|
|
4487
|
-
]),
|
|
4494
|
+
]), gc = [
|
|
4488
4495
|
{
|
|
4489
4496
|
phrase: [
|
|
4490
4497
|
"plus",
|
|
@@ -4561,7 +4568,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4561
4568
|
}
|
|
4562
4569
|
], zn = (e) => {
|
|
4563
4570
|
const t = [];
|
|
4564
|
-
for (const n of e.matchAll(
|
|
4571
|
+
for (const n of e.matchAll(pc)) {
|
|
4565
4572
|
const r = n[0], i = n.index ?? 0;
|
|
4566
4573
|
t.push({
|
|
4567
4574
|
text: r,
|
|
@@ -4571,7 +4578,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4571
4578
|
});
|
|
4572
4579
|
}
|
|
4573
4580
|
return t;
|
|
4574
|
-
}, Fn = (e) => Co.get(e.normalized) || e.normalized,
|
|
4581
|
+
}, Fn = (e) => Co.get(e.normalized) || e.normalized, mc = (e, t) => {
|
|
4575
4582
|
const n = [];
|
|
4576
4583
|
for (let r = 0; r < e.length; r++) {
|
|
4577
4584
|
for (let i = 0; i < t.length; i++) Fn(e[r]) === Fn(t[i]) && n.push({
|
|
@@ -4580,7 +4587,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4580
4587
|
visibleToken: i,
|
|
4581
4588
|
score: 10
|
|
4582
4589
|
});
|
|
4583
|
-
for (const i of
|
|
4590
|
+
for (const i of gc) {
|
|
4584
4591
|
const o = e.slice(r, r + i.phrase.length);
|
|
4585
4592
|
if (o.length === i.phrase.length && o.every((s, a) => s.normalized === i.phrase[a]))
|
|
4586
4593
|
for (let s = 0; s < t.length; s++)
|
|
@@ -4593,8 +4600,8 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4593
4600
|
}
|
|
4594
4601
|
}
|
|
4595
4602
|
return n;
|
|
4596
|
-
},
|
|
4597
|
-
const n =
|
|
4603
|
+
}, vc = (e, t) => {
|
|
4604
|
+
const n = mc(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);
|
|
4598
4605
|
for (let l = 0; l < n.length; l++) {
|
|
4599
4606
|
const c = n[l];
|
|
4600
4607
|
r[l] = c.score;
|
|
@@ -4623,12 +4630,12 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4623
4630
|
score: l.score
|
|
4624
4631
|
};
|
|
4625
4632
|
});
|
|
4626
|
-
},
|
|
4633
|
+
}, yc = (e, t, n) => {
|
|
4627
4634
|
if (e.length === 0) return 0;
|
|
4628
4635
|
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;
|
|
4629
4636
|
return Math.min(1, r * i);
|
|
4630
4637
|
}, xo = (e) => {
|
|
4631
|
-
const t = Ao(e.speechText), n = $(e.visibleText), r = t.spokenText, i = zn(r), o = zn(n), s = t.unsupportedSemantic ? [] :
|
|
4638
|
+
const t = Ao(e.speechText), n = $(e.visibleText), r = t.spokenText, i = zn(r), o = zn(n), s = t.unsupportedSemantic ? [] : vc(i, o), a = yc(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";
|
|
4632
4639
|
return {
|
|
4633
4640
|
speechText: e.speechText,
|
|
4634
4641
|
spokenText: r,
|
|
@@ -4674,7 +4681,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4674
4681
|
start: t,
|
|
4675
4682
|
length: Math.min(n, r.end - t)
|
|
4676
4683
|
} : null;
|
|
4677
|
-
},
|
|
4684
|
+
}, bc = (e, t, n = 1, r) => {
|
|
4678
4685
|
if (e.boundaryOffsetMode === "unsupported" || !Number.isFinite(t)) return null;
|
|
4679
4686
|
const i = Math.max(1, Number.isFinite(n) ? n : 1);
|
|
4680
4687
|
if (r && /^<[^>]+>$/.test(r.trim())) return null;
|
|
@@ -4688,7 +4695,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4688
4695
|
return o || s;
|
|
4689
4696
|
}
|
|
4690
4697
|
return Qr(e, t, i) || Jr(e, t, i);
|
|
4691
|
-
},
|
|
4698
|
+
}, Tc = (e, t) => {
|
|
4692
4699
|
if (e.playbackMode === "region-fallback") return null;
|
|
4693
4700
|
const n = e.anchors.find((o) => o.spokenStart <= t && t < o.spokenEnd);
|
|
4694
4701
|
if (n) return {
|
|
@@ -4710,7 +4717,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4710
4717
|
start: Math.min(r.visibleStart, i.visibleStart),
|
|
4711
4718
|
end: Math.max(r.visibleEnd, i.visibleEnd)
|
|
4712
4719
|
} : null;
|
|
4713
|
-
},
|
|
4720
|
+
}, Sc = /* @__PURE__ */ new Map([
|
|
4714
4721
|
["+", ["plus"]],
|
|
4715
4722
|
["-", ["minus", "negative"]],
|
|
4716
4723
|
["−", ["minus", "negative"]],
|
|
@@ -4734,12 +4741,12 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4734
4741
|
["•", ["times"]],
|
|
4735
4742
|
["·", ["times"]],
|
|
4736
4743
|
["", ["times", "multiplied by"]]
|
|
4737
|
-
]),
|
|
4744
|
+
]), _c = /* @__PURE__ */ new Map([
|
|
4738
4745
|
["", "function-application"],
|
|
4739
4746
|
["", "implicit-multiply"],
|
|
4740
4747
|
["", "invisible-separator"],
|
|
4741
4748
|
["", "invisible-plus"]
|
|
4742
|
-
]), Oo = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]),
|
|
4749
|
+
]), Oo = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), wc = /* @__PURE__ */ new Map([
|
|
4743
4750
|
["msqrt", "radical"],
|
|
4744
4751
|
["mroot", "radical"],
|
|
4745
4752
|
["msub", "subscript"],
|
|
@@ -4749,11 +4756,11 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4749
4756
|
["munderover", "underoverscript"],
|
|
4750
4757
|
["mmultiscripts", "multiscript"],
|
|
4751
4758
|
["menclose", "enclosure"]
|
|
4752
|
-
]),
|
|
4759
|
+
]), Ec = (e) => e.replace(/\s+/g, " ").trim(), Ve = (e) => (e.localName || e.tagName || "").toLowerCase(), kc = (e) => e.nodeType === Node.ELEMENT_NODE, ut = (e) => Array.from(e.childNodes).filter(kc), hr = (e) => Ec(e.textContent || ""), ye = (e, t) => ({
|
|
4753
4760
|
type: "element-range",
|
|
4754
4761
|
quality: t,
|
|
4755
4762
|
element: e
|
|
4756
|
-
}),
|
|
4763
|
+
}), Ac = (e) => {
|
|
4757
4764
|
switch (e) {
|
|
4758
4765
|
case "mi":
|
|
4759
4766
|
return "identifier";
|
|
@@ -4769,15 +4776,15 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4769
4776
|
default:
|
|
4770
4777
|
return "unknown";
|
|
4771
4778
|
}
|
|
4772
|
-
},
|
|
4773
|
-
const t = e.normalized ??
|
|
4779
|
+
}, Cc = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), xc = (e, t, n) => n === "fraction" ? ["over", "divided by"] : n === "superscript" ? Oo.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? Sc.get(e) || [] : [], Ke = (e) => {
|
|
4780
|
+
const t = e.normalized ?? Cc(e.text, e.kind || "unknown");
|
|
4774
4781
|
return {
|
|
4775
4782
|
id: `math-token-${e.state.nextId++}`,
|
|
4776
4783
|
kind: e.kind,
|
|
4777
4784
|
role: e.role,
|
|
4778
4785
|
text: e.text,
|
|
4779
4786
|
normalized: t,
|
|
4780
|
-
spokenAliases:
|
|
4787
|
+
spokenAliases: xc(e.text, e.kind, e.role),
|
|
4781
4788
|
sourceElement: e.sourceElement,
|
|
4782
4789
|
path: e.path,
|
|
4783
4790
|
target: e.target || ye(e.sourceElement, "element-range"),
|
|
@@ -4787,7 +4794,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4787
4794
|
e[n].push(t);
|
|
4788
4795
|
}, Mo = (e, t, n) => {
|
|
4789
4796
|
ut(e).forEach((r, i) => be(r, t, `${n}/${Ve(r)}[${i}]`));
|
|
4790
|
-
},
|
|
4797
|
+
}, Ic = (e, t, n) => {
|
|
4791
4798
|
const r = ut(e);
|
|
4792
4799
|
r[0] && be(r[0], t, `${n}/numerator`), Xe(t, Ke({
|
|
4793
4800
|
state: t,
|
|
@@ -4798,7 +4805,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4798
4805
|
path: n,
|
|
4799
4806
|
target: ye(e, "element-range")
|
|
4800
4807
|
})), r[1] && be(r[1], t, `${n}/denominator`);
|
|
4801
|
-
},
|
|
4808
|
+
}, Oc = (e, t, n) => {
|
|
4802
4809
|
const r = e.getAttribute("open") || "(", i = e.getAttribute("close") || ")";
|
|
4803
4810
|
Xe(t, Ke({
|
|
4804
4811
|
state: t,
|
|
@@ -4817,7 +4824,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4817
4824
|
path: `${n}/close`,
|
|
4818
4825
|
target: ye(e, "element-range")
|
|
4819
4826
|
}));
|
|
4820
|
-
},
|
|
4827
|
+
}, Mc = (e, t, n) => {
|
|
4821
4828
|
const r = ut(e);
|
|
4822
4829
|
r[0] && be(r[0], t, `${n}/base`);
|
|
4823
4830
|
const i = r[1];
|
|
@@ -4837,7 +4844,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4837
4844
|
return;
|
|
4838
4845
|
}
|
|
4839
4846
|
be(i, t, `${n}/exponent`);
|
|
4840
|
-
},
|
|
4847
|
+
}, Rc = (e, t, n, r) => {
|
|
4841
4848
|
Xe(t, Ke({
|
|
4842
4849
|
state: t,
|
|
4843
4850
|
kind: "structure",
|
|
@@ -4861,10 +4868,10 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4861
4868
|
path: `${n}/row[${r}]`,
|
|
4862
4869
|
target: ye(i, "region-fallback")
|
|
4863
4870
|
}), "layoutTargets")), be(i, t, `${n}/${Ve(i)}[${r}]`);
|
|
4864
|
-
},
|
|
4871
|
+
}, $c = (e, t, n) => {
|
|
4865
4872
|
const r = hr(e);
|
|
4866
4873
|
if (!r) return;
|
|
4867
|
-
const i =
|
|
4874
|
+
const i = Ac(Ve(e)), o = i === "operator" ? _c.get(r) : void 0, s = o ?? (i === "operator" && (r === "(" || r === ")") ? "grouping-fence" : i);
|
|
4868
4875
|
Xe(t, Ke({
|
|
4869
4876
|
state: t,
|
|
4870
4877
|
kind: i,
|
|
@@ -4895,16 +4902,16 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4895
4902
|
case "mtext":
|
|
4896
4903
|
case "ms":
|
|
4897
4904
|
case "mspace":
|
|
4898
|
-
|
|
4905
|
+
$c(e, t, n);
|
|
4899
4906
|
return;
|
|
4900
4907
|
case "mfrac":
|
|
4901
|
-
|
|
4908
|
+
Ic(e, t, n);
|
|
4902
4909
|
return;
|
|
4903
4910
|
case "msup":
|
|
4904
|
-
|
|
4911
|
+
Mc(e, t, n);
|
|
4905
4912
|
return;
|
|
4906
4913
|
case "mfenced":
|
|
4907
|
-
|
|
4914
|
+
Oc(e, t, n);
|
|
4908
4915
|
return;
|
|
4909
4916
|
case "mtable":
|
|
4910
4917
|
Lc(e, t, n);
|
|
@@ -4917,15 +4924,15 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4917
4924
|
return;
|
|
4918
4925
|
}
|
|
4919
4926
|
default: {
|
|
4920
|
-
const i =
|
|
4927
|
+
const i = wc.get(r);
|
|
4921
4928
|
if (i) {
|
|
4922
|
-
|
|
4929
|
+
Rc(e, t, n, i);
|
|
4923
4930
|
return;
|
|
4924
4931
|
}
|
|
4925
4932
|
Mo(e, t, n);
|
|
4926
4933
|
}
|
|
4927
4934
|
}
|
|
4928
|
-
},
|
|
4935
|
+
}, Pc = (e) => {
|
|
4929
4936
|
const t = {
|
|
4930
4937
|
tokens: [],
|
|
4931
4938
|
layoutTargets: [],
|
|
@@ -4936,7 +4943,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4936
4943
|
layoutTargets: t.layoutTargets,
|
|
4937
4944
|
expressionTarget: ye(e, "region-fallback")
|
|
4938
4945
|
};
|
|
4939
|
-
},
|
|
4946
|
+
}, Nc = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, Hc = 0.95, Wc = (e) => {
|
|
4940
4947
|
const t = [], n = /* @__PURE__ */ new Set(), r = (i) => {
|
|
4941
4948
|
const o = i.toLowerCase().trim().split(/\s+/).filter(Boolean);
|
|
4942
4949
|
if (o.length === 0) return;
|
|
@@ -4965,7 +4972,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4965
4972
|
const n = [];
|
|
4966
4973
|
let r = 0;
|
|
4967
4974
|
for (const i of t) {
|
|
4968
|
-
const o =
|
|
4975
|
+
const o = Wc(i);
|
|
4969
4976
|
if (i.optional) {
|
|
4970
4977
|
const s = Zr(e, r, o);
|
|
4971
4978
|
s > 0 && (n.push({
|
|
@@ -4987,23 +4994,23 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
4987
4994
|
}
|
|
4988
4995
|
}
|
|
4989
4996
|
return n;
|
|
4990
|
-
},
|
|
4997
|
+
}, zc = (e, t, n) => {
|
|
4991
4998
|
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);
|
|
4992
4999
|
return r > 0 && i === r && o === t.length;
|
|
4993
|
-
},
|
|
5000
|
+
}, Fc = (e) => e.map(({ speechTokens: t, math: n }) => ({
|
|
4994
5001
|
speechTokenIds: t.map((r) => r.id),
|
|
4995
5002
|
mathTokenIds: [n.id],
|
|
4996
5003
|
score: 1,
|
|
4997
5004
|
confidence: 1,
|
|
4998
5005
|
target: n.target
|
|
4999
|
-
})),
|
|
5000
|
-
const t = e.minExactWordConfidence ??
|
|
5006
|
+
})), Dc = (e) => {
|
|
5007
|
+
const t = e.minExactWordConfidence ?? Hc, n = Bc(e.speech.tokens, e.math.tokens), r = zc(n, e.speech.tokens, e.math.tokens) ? 1 : 0;
|
|
5001
5008
|
return {
|
|
5002
|
-
segments: r >= t ?
|
|
5009
|
+
segments: r >= t ? Fc(n) : [],
|
|
5003
5010
|
confidence: r,
|
|
5004
5011
|
fallbackTarget: e.math.expressionTarget
|
|
5005
5012
|
};
|
|
5006
|
-
},
|
|
5013
|
+
}, Ro = mo(), jc = /* @__PURE__ */ new Map([
|
|
5007
5014
|
["zero", "0"],
|
|
5008
5015
|
["one", "1"],
|
|
5009
5016
|
["two", "2"],
|
|
@@ -5015,17 +5022,17 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5015
5022
|
["eight", "8"],
|
|
5016
5023
|
["nine", "9"],
|
|
5017
5024
|
["ten", "10"]
|
|
5018
|
-
]),
|
|
5025
|
+
]), Lo = (e) => {
|
|
5019
5026
|
const t = e.toLowerCase();
|
|
5020
|
-
return
|
|
5021
|
-
},
|
|
5027
|
+
return jc.get(t) || t;
|
|
5028
|
+
}, qc = (e) => {
|
|
5022
5029
|
const t = [];
|
|
5023
|
-
for (const n of e.matchAll(
|
|
5030
|
+
for (const n of e.matchAll(Ro)) {
|
|
5024
5031
|
const r = n[0], i = n.index ?? 0;
|
|
5025
5032
|
t.push({
|
|
5026
5033
|
id: `speech-token-${t.length}`,
|
|
5027
5034
|
text: r,
|
|
5028
|
-
normalized:
|
|
5035
|
+
normalized: Lo(r),
|
|
5029
5036
|
start: i,
|
|
5030
5037
|
end: i + r.length,
|
|
5031
5038
|
sourceStart: i,
|
|
@@ -5039,7 +5046,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5039
5046
|
return {
|
|
5040
5047
|
speechText: e.speechText,
|
|
5041
5048
|
spokenText: t.spokenText,
|
|
5042
|
-
tokens:
|
|
5049
|
+
tokens: qc(t.spokenText),
|
|
5043
5050
|
rawToSpokenOffsetMap: t.rawToSpokenOffsetMap,
|
|
5044
5051
|
boundaryOffsetSpace: t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text",
|
|
5045
5052
|
unsupportedSemantic: t.unsupportedSemantic,
|
|
@@ -5047,9 +5054,9 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5047
5054
|
};
|
|
5048
5055
|
}, dr = (e) => {
|
|
5049
5056
|
if (!e || /^<[^>]+>$/.test(e.trim())) return null;
|
|
5050
|
-
const t = e.match(
|
|
5051
|
-
return t?.[0] ?
|
|
5052
|
-
},
|
|
5057
|
+
const t = e.match(Ro);
|
|
5058
|
+
return t?.[0] ? Lo(t[0]) : null;
|
|
5059
|
+
}, Vc = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, Gc = (e, t) => {
|
|
5053
5060
|
const n = e.rawToSpokenOffsetMap.get(t);
|
|
5054
5061
|
if (n !== void 0) return n;
|
|
5055
5062
|
for (let r = t; r < e.speechText.length; r++) {
|
|
@@ -5060,7 +5067,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5060
5067
|
return null;
|
|
5061
5068
|
}, Dn = (e, t, n) => {
|
|
5062
5069
|
if (t === null) return null;
|
|
5063
|
-
const r =
|
|
5070
|
+
const r = Vc(e.tokens, t);
|
|
5064
5071
|
return r ? {
|
|
5065
5072
|
token: r,
|
|
5066
5073
|
start: t,
|
|
@@ -5070,9 +5077,9 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5070
5077
|
}, jn = (e, t) => {
|
|
5071
5078
|
const n = dr(t);
|
|
5072
5079
|
return !!(e && n && e.token.normalized === n);
|
|
5073
|
-
},
|
|
5080
|
+
}, Uc = (e) => {
|
|
5074
5081
|
if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
|
|
5075
|
-
const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = Dn(e.tokenization,
|
|
5082
|
+
const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = Dn(e.tokenization, Gc(e.tokenization, e.position), t), r = Dn(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
|
|
5076
5083
|
return jn(n, e.boundaryWord) ? {
|
|
5077
5084
|
...n,
|
|
5078
5085
|
confidence: 1
|
|
@@ -5080,7 +5087,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5080
5087
|
...r,
|
|
5081
5088
|
confidence: 1
|
|
5082
5089
|
} : e.boundaryWord && dr(e.boundaryWord) ? null : e.tokenization.boundaryOffsetSpace === "raw-ssml" ? n || r : r || n;
|
|
5083
|
-
},
|
|
5090
|
+
}, Kc = (e) => {
|
|
5084
5091
|
if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
|
|
5085
5092
|
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);
|
|
5086
5093
|
return jn(n, e.boundaryWord) ? {
|
|
@@ -5088,27 +5095,27 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5088
5095
|
confidence: 1
|
|
5089
5096
|
} : e.boundaryWord && dr(e.boundaryWord) ? null : n;
|
|
5090
5097
|
}, an = (e) => {
|
|
5091
|
-
const t = Mt({ speechText: e.speechText }), n =
|
|
5098
|
+
const t = Mt({ speechText: e.speechText }), n = Pc(e.mathElement);
|
|
5092
5099
|
return {
|
|
5093
5100
|
speech: t,
|
|
5094
5101
|
math: n,
|
|
5095
|
-
result:
|
|
5102
|
+
result: Dc({
|
|
5096
5103
|
speech: t,
|
|
5097
5104
|
math: n
|
|
5098
5105
|
})
|
|
5099
5106
|
};
|
|
5100
|
-
},
|
|
5101
|
-
const n =
|
|
5107
|
+
}, Xc = (e, t) => {
|
|
5108
|
+
const n = Kc({
|
|
5102
5109
|
tokenization: e.speech,
|
|
5103
5110
|
position: t.position,
|
|
5104
5111
|
length: t.length,
|
|
5105
5112
|
boundaryWord: t.boundaryWord
|
|
5106
5113
|
});
|
|
5107
|
-
return
|
|
5114
|
+
return Nc({
|
|
5108
5115
|
alignment: e.result,
|
|
5109
5116
|
boundary: n
|
|
5110
5117
|
});
|
|
5111
|
-
},
|
|
5118
|
+
}, Yc = (e, t) => {
|
|
5112
5119
|
if (!t.boundaryWord || /^<[^>]+>$/.test(t.boundaryWord.trim())) return null;
|
|
5113
5120
|
const n = Mt({ speechText: t.boundaryWord }).tokens[0];
|
|
5114
5121
|
if (!n) return null;
|
|
@@ -5117,7 +5124,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5117
5124
|
return i.normalized.toLowerCase() === o || i.spokenAliases.some((s) => s.toLowerCase() === o);
|
|
5118
5125
|
});
|
|
5119
5126
|
return r.length === 1 ? r[0].target : null;
|
|
5120
|
-
}, qn = "http://www.w3.org/1998/Math/MathML",
|
|
5127
|
+
}, qn = "http://www.w3.org/1998/Math/MathML", Jc = /* @__PURE__ */ new Set([
|
|
5121
5128
|
"math",
|
|
5122
5129
|
"maction",
|
|
5123
5130
|
"menclose",
|
|
@@ -5151,7 +5158,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5151
5158
|
"semantics",
|
|
5152
5159
|
"annotation",
|
|
5153
5160
|
"annotation-xml"
|
|
5154
|
-
]),
|
|
5161
|
+
]), Qc = /* @__PURE__ */ new Set([
|
|
5155
5162
|
"accent",
|
|
5156
5163
|
"accentunder",
|
|
5157
5164
|
"align",
|
|
@@ -5203,12 +5210,12 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5203
5210
|
"width",
|
|
5204
5211
|
"xmlns",
|
|
5205
5212
|
"xml:lang"
|
|
5206
|
-
]), $o = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"),
|
|
5213
|
+
]), $o = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), Zc = (e) => $o(e).replace(/"/g, """), eu = (e, t) => {
|
|
5207
5214
|
const n = e.toLowerCase(), r = t.trim().toLowerCase();
|
|
5208
|
-
return !!(n.startsWith("on") || !
|
|
5209
|
-
},
|
|
5215
|
+
return !!(n.startsWith("on") || !Qc.has(n) || r.includes("javascript:") || r.includes("data:text/html"));
|
|
5216
|
+
}, tu = (e) => {
|
|
5210
5217
|
const t = e.localName.toLowerCase();
|
|
5211
|
-
if (!
|
|
5218
|
+
if (!Jc.has(t)) return !1;
|
|
5212
5219
|
const n = e.namespaceURI;
|
|
5213
5220
|
return !n || n === qn || n === "http://www.w3.org/1999/xhtml";
|
|
5214
5221
|
}, Po = (e) => {
|
|
@@ -5216,13 +5223,13 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5216
5223
|
if (e.nodeType === Node.COMMENT_NODE) return "";
|
|
5217
5224
|
if (e.nodeType !== Node.ELEMENT_NODE) return null;
|
|
5218
5225
|
const t = e;
|
|
5219
|
-
if (!
|
|
5226
|
+
if (!tu(t)) return null;
|
|
5220
5227
|
const n = t.localName.toLowerCase(), r = [];
|
|
5221
5228
|
for (const o of Array.from(t.attributes)) {
|
|
5222
5229
|
const s = o.name.toLowerCase();
|
|
5223
|
-
if (!
|
|
5230
|
+
if (!eu(s, o.value)) {
|
|
5224
5231
|
if (s === "xmlns" && o.value !== qn) return null;
|
|
5225
|
-
r.push(`${s}="${
|
|
5232
|
+
r.push(`${s}="${Zc(o.value)}"`);
|
|
5226
5233
|
}
|
|
5227
5234
|
}
|
|
5228
5235
|
n === "math" && !r.some((o) => o.startsWith("xmlns=")) && r.unshift(`xmlns="${qn}"`);
|
|
@@ -5233,10 +5240,10 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5233
5240
|
i.push(s);
|
|
5234
5241
|
}
|
|
5235
5242
|
return `<${n}${r.length > 0 ? ` ${r.join(" ")}` : ""}>${i.join("")}</${n}>`;
|
|
5236
|
-
},
|
|
5243
|
+
}, nu = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, En = (e) => {
|
|
5237
5244
|
const t = String(e || "").trim();
|
|
5238
5245
|
if (!t) return null;
|
|
5239
|
-
const n =
|
|
5246
|
+
const n = nu(t);
|
|
5240
5247
|
if (!n || n.getElementsByTagName("parsererror").length > 0) return null;
|
|
5241
5248
|
const r = n.documentElement;
|
|
5242
5249
|
return !r || r.localName.toLowerCase() !== "math" ? null : Po(r);
|
|
@@ -5248,28 +5255,28 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5248
5255
|
lastCharWasWhitespace: !1,
|
|
5249
5256
|
lastMapped: null,
|
|
5250
5257
|
options: e
|
|
5251
|
-
}), Ho = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container",
|
|
5258
|
+
}), Ho = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container", Wo = (e) => e.tagName?.toLowerCase() === "mjx-assistive-mml", Bo = (e) => {
|
|
5252
5259
|
const t = e.tagName?.toLowerCase();
|
|
5253
5260
|
return t === "annotation" || t === "annotation-xml";
|
|
5254
|
-
},
|
|
5261
|
+
}, ru = (e) => {
|
|
5255
5262
|
const t = e.getAttribute("data-mathml");
|
|
5256
5263
|
return t && t.trim() ? t : null;
|
|
5257
|
-
},
|
|
5258
|
-
if (e.tagName.toLowerCase() === "math") return
|
|
5259
|
-
const t =
|
|
5264
|
+
}, iu = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, ou = (e) => {
|
|
5265
|
+
if (e.tagName.toLowerCase() === "math") return En(e.outerHTML);
|
|
5266
|
+
const t = ru(e);
|
|
5260
5267
|
if (t) {
|
|
5261
|
-
const n =
|
|
5268
|
+
const n = En(t);
|
|
5262
5269
|
if (n) return n;
|
|
5263
5270
|
}
|
|
5264
5271
|
if (Ho(e)) {
|
|
5265
|
-
const n =
|
|
5272
|
+
const n = iu(e);
|
|
5266
5273
|
if (n) {
|
|
5267
|
-
const r =
|
|
5274
|
+
const r = En(n);
|
|
5268
5275
|
if (r) return r;
|
|
5269
5276
|
}
|
|
5270
5277
|
}
|
|
5271
5278
|
return null;
|
|
5272
|
-
},
|
|
5279
|
+
}, su = /* @__PURE__ */ new Set([
|
|
5273
5280
|
"P",
|
|
5274
5281
|
"H1",
|
|
5275
5282
|
"H2",
|
|
@@ -5285,7 +5292,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5285
5292
|
"FIGCAPTION",
|
|
5286
5293
|
"LABEL",
|
|
5287
5294
|
"BUTTON"
|
|
5288
|
-
]),
|
|
5295
|
+
]), au = /* @__PURE__ */ new Set([
|
|
5289
5296
|
"heading",
|
|
5290
5297
|
"listitem",
|
|
5291
5298
|
"option",
|
|
@@ -5294,18 +5301,18 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5294
5301
|
"cell",
|
|
5295
5302
|
"columnheader",
|
|
5296
5303
|
"rowheader"
|
|
5297
|
-
]),
|
|
5304
|
+
]), lu = (e, t) => {
|
|
5298
5305
|
let n = e.parentElement, r = null;
|
|
5299
5306
|
for (; n && n !== t; ) {
|
|
5300
5307
|
const i = (n.getAttribute("role") || "").toLowerCase(), o = n.tagName.toUpperCase();
|
|
5301
|
-
if (
|
|
5308
|
+
if (su.has(o) || au.has(i)) {
|
|
5302
5309
|
r = n;
|
|
5303
5310
|
break;
|
|
5304
5311
|
}
|
|
5305
5312
|
n = n.parentElement;
|
|
5306
5313
|
}
|
|
5307
5314
|
return r || t;
|
|
5308
|
-
},
|
|
5315
|
+
}, cu = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || Ho(e), He = (e, t, n) => {
|
|
5309
5316
|
/[.,;:!?]/.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++;
|
|
5310
5317
|
}, zo = (e, t) => {
|
|
5311
5318
|
if (e.inLeadingWhitespace || e.lastCharWasWhitespace || e.chars.length === 0) return !1;
|
|
@@ -5338,7 +5345,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5338
5345
|
offset: i
|
|
5339
5346
|
}), r = !0, e.lastCharWasWhitespace = !1;
|
|
5340
5347
|
}
|
|
5341
|
-
},
|
|
5348
|
+
}, uu = (e, t) => {
|
|
5342
5349
|
for (let n = 0; n < t.text.length; n++) {
|
|
5343
5350
|
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 ? {
|
|
5344
5351
|
node: o.node,
|
|
@@ -5366,7 +5373,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5366
5373
|
offset: a
|
|
5367
5374
|
});
|
|
5368
5375
|
}
|
|
5369
|
-
},
|
|
5376
|
+
}, hu = (e) => {
|
|
5370
5377
|
if (typeof DOMParser > "u") return "";
|
|
5371
5378
|
const t = new DOMParser().parseFromString(e, "application/xml");
|
|
5372
5379
|
if (t.getElementsByTagName("parsererror").length > 0) return "";
|
|
@@ -5378,11 +5385,11 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5378
5385
|
}
|
|
5379
5386
|
if (i.nodeType !== 1) return;
|
|
5380
5387
|
const o = i;
|
|
5381
|
-
if (!
|
|
5388
|
+
if (!Bo(o))
|
|
5382
5389
|
for (const s of Array.from(o.childNodes)) r(s);
|
|
5383
5390
|
};
|
|
5384
5391
|
return r(t.documentElement), $(n.join(" "));
|
|
5385
|
-
},
|
|
5392
|
+
}, du = (e, t, n) => {
|
|
5386
5393
|
const r = No(n), i = (a) => {
|
|
5387
5394
|
if (ft(a, e)) return;
|
|
5388
5395
|
if (a.nodeType === 3) {
|
|
@@ -5391,7 +5398,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5391
5398
|
}
|
|
5392
5399
|
if (a.nodeType !== 1) return;
|
|
5393
5400
|
const l = a;
|
|
5394
|
-
if (!(
|
|
5401
|
+
if (!(Wo(l) || Bo(l)))
|
|
5395
5402
|
for (const c of Array.from(l.childNodes)) i(c);
|
|
5396
5403
|
};
|
|
5397
5404
|
i(e), Do(r);
|
|
@@ -5400,7 +5407,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5400
5407
|
text: o,
|
|
5401
5408
|
map: r.map
|
|
5402
5409
|
};
|
|
5403
|
-
const s =
|
|
5410
|
+
const s = hu(t);
|
|
5404
5411
|
return s ? {
|
|
5405
5412
|
text: s,
|
|
5406
5413
|
map: /* @__PURE__ */ new Map()
|
|
@@ -5408,7 +5415,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5408
5415
|
}, Do = (e) => {
|
|
5409
5416
|
for (; e.chars.length > 0 && /\s/.test(e.chars[e.chars.length - 1]); )
|
|
5410
5417
|
e.chars.pop(), e.position--, e.map.delete(e.position);
|
|
5411
|
-
},
|
|
5418
|
+
}, fu = (e, t) => {
|
|
5412
5419
|
const n = No(t), r = [];
|
|
5413
5420
|
let i = 0, o, s = !1;
|
|
5414
5421
|
const a = () => {
|
|
@@ -5421,18 +5428,18 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5421
5428
|
}, l = (u) => {
|
|
5422
5429
|
if (ft(u, e)) return;
|
|
5423
5430
|
if (u.nodeType === Node.TEXT_NODE) {
|
|
5424
|
-
const g =
|
|
5431
|
+
const g = lu(u, e);
|
|
5425
5432
|
o && g !== o && a(), o = g, Fo(n, u);
|
|
5426
5433
|
return;
|
|
5427
5434
|
}
|
|
5428
5435
|
if (u.nodeType !== Node.ELEMENT_NODE) return;
|
|
5429
5436
|
const h = u;
|
|
5430
|
-
if (
|
|
5431
|
-
const p =
|
|
5437
|
+
if (Wo(h)) return;
|
|
5438
|
+
const p = ou(h);
|
|
5432
5439
|
if (p) {
|
|
5433
5440
|
a();
|
|
5434
|
-
const g =
|
|
5435
|
-
|
|
5441
|
+
const g = du(h, p, t);
|
|
5442
|
+
uu(n, g);
|
|
5436
5443
|
const m = $(g.text);
|
|
5437
5444
|
r.push({
|
|
5438
5445
|
type: "math",
|
|
@@ -5455,7 +5462,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5455
5462
|
containsMathMarkup: s
|
|
5456
5463
|
};
|
|
5457
5464
|
}, bt = (e, t) => {
|
|
5458
|
-
if (!
|
|
5465
|
+
if (!cu(e)) {
|
|
5459
5466
|
const { text: n, map: r } = on(e, t);
|
|
5460
5467
|
return {
|
|
5461
5468
|
visibleText: n,
|
|
@@ -5467,8 +5474,8 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5467
5474
|
containsMathMarkup: !1
|
|
5468
5475
|
};
|
|
5469
5476
|
}
|
|
5470
|
-
return
|
|
5471
|
-
},
|
|
5477
|
+
return fu(e, t);
|
|
5478
|
+
}, pu = (e, t) => To([e], t), gu = (e) => (e || "en").split("-")[0].toLowerCase() || "en", mu = /* @__PURE__ */ new Set([
|
|
5472
5479
|
"H1",
|
|
5473
5480
|
"H2",
|
|
5474
5481
|
"H3",
|
|
@@ -5478,17 +5485,17 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5478
5485
|
"LI",
|
|
5479
5486
|
"LABEL",
|
|
5480
5487
|
"BUTTON"
|
|
5481
|
-
]),
|
|
5488
|
+
]), vu = /* @__PURE__ */ new Set([
|
|
5482
5489
|
"heading",
|
|
5483
5490
|
"listitem",
|
|
5484
5491
|
"option",
|
|
5485
5492
|
"radio"
|
|
5486
|
-
]),
|
|
5493
|
+
]), yu = (e) => {
|
|
5487
5494
|
if (e.type !== "text" || !e.sourceElement) return !1;
|
|
5488
5495
|
const t = e.sourceElement.tagName.toUpperCase(), n = (e.sourceElement.getAttribute("role") || "").toLowerCase();
|
|
5489
|
-
return
|
|
5490
|
-
},
|
|
5491
|
-
const t = e.resolveMathSpeech ??
|
|
5496
|
+
return mu.has(t) || vu.has(n);
|
|
5497
|
+
}, bu = async (e) => {
|
|
5498
|
+
const t = e.resolveMathSpeech ?? pu, { visibleText: n } = e, r = [];
|
|
5492
5499
|
let i = 0;
|
|
5493
5500
|
const o = (a) => {
|
|
5494
5501
|
const l = $(a), c = n.indexOf(l, i), u = c >= 0 ? c : i, h = u + l.length;
|
|
@@ -5500,7 +5507,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5500
5507
|
for (let a = 0; a < e.chunks.length; a++) {
|
|
5501
5508
|
const l = e.chunks[a];
|
|
5502
5509
|
if (l.type === "text") {
|
|
5503
|
-
const g =
|
|
5510
|
+
const g = yu(l) ? [{
|
|
5504
5511
|
text: l.text,
|
|
5505
5512
|
offset: 0
|
|
5506
5513
|
}] : lr(l.text, { locale: e.language });
|
|
@@ -5540,12 +5547,12 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5540
5547
|
}
|
|
5541
5548
|
return {
|
|
5542
5549
|
segments: r,
|
|
5543
|
-
locale:
|
|
5550
|
+
locale: gu(e.language),
|
|
5544
5551
|
visibleText: n,
|
|
5545
5552
|
plainSpeechText: $(s.join(" "))
|
|
5546
5553
|
};
|
|
5547
|
-
},
|
|
5548
|
-
const t = Math.max(1, e.maxEntries ??
|
|
5554
|
+
}, Tu = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Su = "sre-v1", _u = 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)}`, ei = (e, t, n, r) => `${Su}\0${Tu(e)}\0${t ? "ssml" : "plain"}\0${Vn(n ?? null)}\0${r}`, wu = (e = {}) => {
|
|
5555
|
+
const t = Math.max(1, e.maxEntries ?? _u), n = e.resolve ?? ((o, s) => To([o], s)), r = /* @__PURE__ */ new Map(), i = (o, s) => {
|
|
5549
5556
|
for (r.delete(o), r.set(o, s); r.size > t; ) {
|
|
5550
5557
|
const a = r.keys().next().value;
|
|
5551
5558
|
a !== void 0 && r.delete(a);
|
|
@@ -5565,13 +5572,13 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5565
5572
|
usedFallback: h.usedFallback
|
|
5566
5573
|
}), i(c, h), h;
|
|
5567
5574
|
};
|
|
5568
|
-
},
|
|
5575
|
+
}, Eu = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : Mt({ speechText: e }).tokens[0]?.normalized || null, ku = (e, t) => {
|
|
5569
5576
|
const n = Mt({ speechText: e.speechText });
|
|
5570
5577
|
if (!Number.isFinite(t.position)) return {
|
|
5571
5578
|
boundary: null,
|
|
5572
5579
|
spokenText: n.spokenText
|
|
5573
5580
|
};
|
|
5574
|
-
const r =
|
|
5581
|
+
const r = Uc({
|
|
5575
5582
|
tokenization: n,
|
|
5576
5583
|
position: t.position,
|
|
5577
5584
|
length: t.length,
|
|
@@ -5584,8 +5591,8 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5584
5591
|
} : null,
|
|
5585
5592
|
spokenText: n.spokenText
|
|
5586
5593
|
};
|
|
5587
|
-
},
|
|
5588
|
-
const n =
|
|
5594
|
+
}, Au = (e, t, n) => n ? Mt({ speechText: e }).tokens.find((r) => r.start <= t && t < r.end)?.normalized === n : !0, Cu = (e, t) => {
|
|
5595
|
+
const n = Eu(t.word);
|
|
5589
5596
|
if (e.id !== t.chunkId) return {
|
|
5590
5597
|
chunkId: t.chunkId,
|
|
5591
5598
|
normalizedWord: n,
|
|
@@ -5604,12 +5611,12 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5604
5611
|
};
|
|
5605
5612
|
let r, i;
|
|
5606
5613
|
if (e.catalogAlignment)
|
|
5607
|
-
r =
|
|
5614
|
+
r = bc(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
|
|
5608
5615
|
else {
|
|
5609
5616
|
const o = ku(e, t);
|
|
5610
5617
|
r = o.boundary, i = o.spokenText;
|
|
5611
5618
|
}
|
|
5612
|
-
return r ?
|
|
5619
|
+
return r ? Au(i, r.start, n) ? {
|
|
5613
5620
|
chunkId: e.id,
|
|
5614
5621
|
normalizedWord: n,
|
|
5615
5622
|
chunkSpokenStart: r.start,
|
|
@@ -5686,7 +5693,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5686
5693
|
if (!r || t[n].localName.toLowerCase() !== r) return !1;
|
|
5687
5694
|
}
|
|
5688
5695
|
return !0;
|
|
5689
|
-
},
|
|
5696
|
+
}, xu = (e, t) => {
|
|
5690
5697
|
if (!e || !jo.has(e.localName.toLowerCase()) || t.querySelector(Vo)) return null;
|
|
5691
5698
|
const n = Un(e), r = t.querySelector("mjx-math");
|
|
5692
5699
|
if (!n || !r) return null;
|
|
@@ -5696,7 +5703,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5696
5703
|
if (!Ko(i, s)) return null;
|
|
5697
5704
|
const a = s[o];
|
|
5698
5705
|
return !a || !Uo(a) ? null : a;
|
|
5699
|
-
},
|
|
5706
|
+
}, Iu = (e) => {
|
|
5700
5707
|
const t = mn(e);
|
|
5701
5708
|
if (t) {
|
|
5702
5709
|
if (t.querySelector(Vo)) return "expression";
|
|
@@ -5710,7 +5717,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5710
5717
|
}, Kn = (e) => {
|
|
5711
5718
|
const t = Go(e), n = mn(t);
|
|
5712
5719
|
if (n) {
|
|
5713
|
-
const r =
|
|
5720
|
+
const r = xu(t, n);
|
|
5714
5721
|
return r ? {
|
|
5715
5722
|
type: "element",
|
|
5716
5723
|
quality: "semantic-token",
|
|
@@ -5732,7 +5739,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5732
5739
|
quality: e.quality === "region-fallback" ? "expression" : "semantic-token",
|
|
5733
5740
|
element: e.element
|
|
5734
5741
|
} : null;
|
|
5735
|
-
},
|
|
5742
|
+
}, Ou = Kn, Mu = () => {
|
|
5736
5743
|
const e = /* @__PURE__ */ new WeakMap();
|
|
5737
5744
|
return (t) => {
|
|
5738
5745
|
const n = Go(t), r = mn(n);
|
|
@@ -5741,15 +5748,15 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5741
5748
|
const i = Kn(t);
|
|
5742
5749
|
return e.set(n, i), i;
|
|
5743
5750
|
};
|
|
5744
|
-
},
|
|
5751
|
+
}, Ru = (e, t, n, r = e.mathAlignments, i = Ou) => {
|
|
5745
5752
|
if (t.chunkSpokenStart === null || t.chunkSpokenEnd === null) return null;
|
|
5746
5753
|
let o = null;
|
|
5747
5754
|
for (const s of r) {
|
|
5748
|
-
const a =
|
|
5755
|
+
const a = Xc(s.alignment, {
|
|
5749
5756
|
position: t.chunkSpokenStart,
|
|
5750
5757
|
length: Math.max(1, t.chunkSpokenEnd - t.chunkSpokenStart),
|
|
5751
5758
|
boundaryWord: n.word
|
|
5752
|
-
}) ||
|
|
5759
|
+
}) || Yc(s.alignment, { boundaryWord: n.word });
|
|
5753
5760
|
if (!a) continue;
|
|
5754
5761
|
const l = i(a);
|
|
5755
5762
|
if (l) {
|
|
@@ -5772,7 +5779,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5772
5779
|
}
|
|
5773
5780
|
}, Lu = (e, t) => {
|
|
5774
5781
|
if (!e.catalogAlignment || t.chunkSpokenStart === null) return null;
|
|
5775
|
-
const n =
|
|
5782
|
+
const n = Tc(e.catalogAlignment, t.chunkSpokenStart);
|
|
5776
5783
|
if (!n) return null;
|
|
5777
5784
|
const r = Xo(e.visibleMap, n.start, n.end);
|
|
5778
5785
|
return r ? {
|
|
@@ -5780,7 +5787,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5780
5787
|
quality: e.catalogAlignment.playbackMode === "exact-word" ? "exact-word" : "semantic-token",
|
|
5781
5788
|
range: r
|
|
5782
5789
|
} : null;
|
|
5783
|
-
},
|
|
5790
|
+
}, $u = (e) => e.regionRange ? {
|
|
5784
5791
|
type: "range",
|
|
5785
5792
|
quality: "region",
|
|
5786
5793
|
range: e.regionRange
|
|
@@ -5792,7 +5799,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5792
5799
|
if (t.length !== 1) return null;
|
|
5793
5800
|
const n = t[0]?.alignment.result.fallbackTarget;
|
|
5794
5801
|
return n ? e.renderedMathTargetResolver(n) : null;
|
|
5795
|
-
},
|
|
5802
|
+
}, Pu = (e, t) => e ? t.mathAlignments.filter(({ element: n }) => {
|
|
5796
5803
|
try {
|
|
5797
5804
|
return e.type === "range" ? e.range.intersectsNode(n) : e.type === "element" ? e.element === n || e.element.contains(n) : e.node.parentElement?.contains(n) || !1;
|
|
5798
5805
|
} catch {
|
|
@@ -5804,17 +5811,17 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5804
5811
|
quality: "region",
|
|
5805
5812
|
confidence: 0,
|
|
5806
5813
|
reason: "boundary chunk id was not found"
|
|
5807
|
-
}), ii = (e) => e.length === 1 ? e[0].element : null,
|
|
5814
|
+
}), ii = (e) => e.length === 1 ? e[0].element : null, Nu = (e, t) => t.length > 0 && t.every(({ element: n }) => e.mathCapabilityByElement.get(n) === "token"), Hu = 3, Wu = (e, t, n) => {
|
|
5808
5815
|
if (!t || t.type !== "range") return !1;
|
|
5809
5816
|
const { startContainer: r, endContainer: i } = t.range;
|
|
5810
|
-
return r === i && r.nodeType ===
|
|
5817
|
+
return r === i && r.nodeType === Hu ? !1 : n.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(r) && o.contains(i));
|
|
5811
5818
|
}, Bu = (e, t) => ({
|
|
5812
5819
|
chunk: e,
|
|
5813
|
-
regionTarget:
|
|
5814
|
-
renderedMathTargetResolver:
|
|
5815
|
-
mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: n }) => [n, t ?
|
|
5820
|
+
regionTarget: $u(e),
|
|
5821
|
+
renderedMathTargetResolver: Mu(),
|
|
5822
|
+
mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: n }) => [n, t ? Iu(n) : "expression"])),
|
|
5816
5823
|
heldTokenByElement: /* @__PURE__ */ new Map()
|
|
5817
|
-
}),
|
|
5824
|
+
}), zu = (e) => {
|
|
5818
5825
|
const t = e.mathTokenHighlighting !== !1, n = new Map(e.chunks.map((r) => [r.id, Bu(r, t)]));
|
|
5819
5826
|
return {
|
|
5820
5827
|
chunks: e.chunks,
|
|
@@ -5839,7 +5846,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5839
5846
|
resolveBoundary(r) {
|
|
5840
5847
|
const i = n.get(r.chunkId);
|
|
5841
5848
|
if (!i) return ri();
|
|
5842
|
-
const { chunk: o } = i, s =
|
|
5849
|
+
const { chunk: o } = i, s = Cu(o, r), a = Lu(o, s), l = Pu(a, o), c = (!a || l.length > 0 ? Ru(o, s, r, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, h = c && c.quality === "expression" ? c : null;
|
|
5843
5850
|
if (u) {
|
|
5844
5851
|
const p = ii(l);
|
|
5845
5852
|
return p && i.heldTokenByElement.set(p, u), Ze({
|
|
@@ -5850,14 +5857,14 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5850
5857
|
reason: s.reason
|
|
5851
5858
|
});
|
|
5852
5859
|
}
|
|
5853
|
-
if (a && (t ? !
|
|
5860
|
+
if (a && (t ? !Wu(i, a, l) : l.length === 0)) return Ze({
|
|
5854
5861
|
semanticTarget: a,
|
|
5855
5862
|
expressionTarget: null,
|
|
5856
5863
|
regionTarget: i.regionTarget,
|
|
5857
5864
|
confidence: s.confidence,
|
|
5858
5865
|
reason: s.reason
|
|
5859
5866
|
});
|
|
5860
|
-
if (
|
|
5867
|
+
if (Nu(i, l)) {
|
|
5861
5868
|
const p = ii(l), g = p ? i.heldTokenByElement.get(p) ?? null : null;
|
|
5862
5869
|
return Ze({
|
|
5863
5870
|
semanticTarget: g,
|
|
@@ -5876,14 +5883,14 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5876
5883
|
});
|
|
5877
5884
|
}
|
|
5878
5885
|
};
|
|
5879
|
-
},
|
|
5886
|
+
}, Fu = (e) => {
|
|
5880
5887
|
if (e.alignment?.boundaryOffsetMode) return e.alignment.boundaryOffsetMode;
|
|
5881
5888
|
const t = e.mathAlignment?.speech.boundaryOffsetSpace;
|
|
5882
5889
|
return t || "plain-spoken-text";
|
|
5883
|
-
},
|
|
5890
|
+
}, Du = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
|
|
5884
5891
|
element: e.sourceElement,
|
|
5885
5892
|
alignment: e.mathAlignment
|
|
5886
|
-
}] : [],
|
|
5893
|
+
}] : [], ju = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
|
|
5887
5894
|
speechText: e.speechText || "",
|
|
5888
5895
|
visibleText: e.visibleText || e.speechText || "",
|
|
5889
5896
|
sourceElement: e.sourceElement || e.contentRoot,
|
|
@@ -5900,9 +5907,9 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5900
5907
|
regionRange: t.regionRange,
|
|
5901
5908
|
visibleMap: t.visibleMap,
|
|
5902
5909
|
catalogAlignment: t.alignment,
|
|
5903
|
-
mathAlignments:
|
|
5904
|
-
offsetSpace:
|
|
5905
|
-
})),
|
|
5910
|
+
mathAlignments: Du(t),
|
|
5911
|
+
offsetSpace: Fu(t)
|
|
5912
|
+
})), qu = [
|
|
5906
5913
|
"[data-pie-tts-region]",
|
|
5907
5914
|
"[data-catalog-region]",
|
|
5908
5915
|
"li",
|
|
@@ -5913,17 +5920,17 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5913
5920
|
"[role='region']",
|
|
5914
5921
|
"div"
|
|
5915
5922
|
].join(","), Yo = (e, t) => {
|
|
5916
|
-
const n = e.closest(
|
|
5923
|
+
const n = e.closest(qu);
|
|
5917
5924
|
return n && t.contains(n) ? n : e;
|
|
5918
|
-
},
|
|
5925
|
+
}, Vu = (e, t, n) => {
|
|
5919
5926
|
const r = /* @__PURE__ */ new Map();
|
|
5920
5927
|
for (let i = t; i < n; i++) {
|
|
5921
5928
|
const o = e.get(i);
|
|
5922
5929
|
o && r.set(i - t, o);
|
|
5923
5930
|
}
|
|
5924
5931
|
return r;
|
|
5925
|
-
},
|
|
5926
|
-
const t = bt(e.contentRoot, e.textProcessingOptions), n = await
|
|
5932
|
+
}, Gu = async (e) => {
|
|
5933
|
+
const t = bt(e.contentRoot, e.textProcessingOptions), n = await bu({
|
|
5927
5934
|
chunks: t.chunks,
|
|
5928
5935
|
visibleText: t.visibleText,
|
|
5929
5936
|
language: e.language,
|
|
@@ -5942,7 +5949,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5942
5949
|
anchor: {
|
|
5943
5950
|
sourceElement: a,
|
|
5944
5951
|
regionElement: Yo(a, e.contentRoot),
|
|
5945
|
-
visibleMap:
|
|
5952
|
+
visibleMap: Vu(t.map, r.visibleSpan.start, r.visibleSpan.end)
|
|
5946
5953
|
}
|
|
5947
5954
|
};
|
|
5948
5955
|
}
|
|
@@ -5962,7 +5969,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5962
5969
|
containsMathMarkup: t.containsMathMarkup,
|
|
5963
5970
|
visibleText: t.visibleText
|
|
5964
5971
|
};
|
|
5965
|
-
},
|
|
5972
|
+
}, Uu = (e, t) => {
|
|
5966
5973
|
const n = xo({
|
|
5967
5974
|
speechText: e.spokenText,
|
|
5968
5975
|
visibleText: e.spokenText
|
|
@@ -5991,7 +5998,7 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
5991
5998
|
speechText: e.spokenText
|
|
5992
5999
|
}) : void 0
|
|
5993
6000
|
};
|
|
5994
|
-
},
|
|
6001
|
+
}, Ku = (e, t, n) => {
|
|
5995
6002
|
const r = t.sourceElement;
|
|
5996
6003
|
return {
|
|
5997
6004
|
speechText: n,
|
|
@@ -6005,13 +6012,13 @@ var lc = /* @__PURE__ */ new Set([
|
|
|
6005
6012
|
}) : void 0,
|
|
6006
6013
|
plainFallback: Jo(e, t)
|
|
6007
6014
|
};
|
|
6008
|
-
},
|
|
6015
|
+
}, Xu = (e, t = {}) => e.items.map(({ segment: n, anchor: r }) => n.kind === "prose" ? Uu(n, r) : t.format === "ssml" && n.ssml ? Ku(n, r, n.ssml) : Jo(n, r)), Yu = "pie-tts-control-handoff", I;
|
|
6009
6016
|
(function(e) {
|
|
6010
6017
|
e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
|
|
6011
6018
|
})(I || (I = {}));
|
|
6012
|
-
var
|
|
6019
|
+
var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, Ju = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? Qo(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, Qu = class Xn {
|
|
6013
6020
|
constructor() {
|
|
6014
|
-
f(this, "currentProvider", null), f(this, "provider", null), f(this, "highlightCoordinator", null), f(this, "catalogResolver", null), f(this, "state", I.IDLE), f(this, "ttsConfig", {}), f(this, "currentText", null), f(this, "currentContentElement", null), f(this, "normalizedToDOM", /* @__PURE__ */ new Map()), f(this, "listeners", /* @__PURE__ */ new Map()), f(this, "lastError", null), f(this, "speakRunId", 0), f(this, "currentBoundaryOffset", 0), f(this, "activeWordBoundaryOffset", 0), f(this, "seekSegments", []), f(this, "sentenceHighlightSegments", []), f(this, "currentSeekSegmentIndex", 0), f(this, "activeSentenceStartOffset", null), f(this, "activeHighlightMode", "word"), f(this, "lastRenderedRegionTarget", null), f(this, "telemetryReporter", null), f(this, "generatedMathSpeechResolver",
|
|
6021
|
+
f(this, "currentProvider", null), f(this, "provider", null), f(this, "highlightCoordinator", null), f(this, "highlightTargetResolverProvider", null), f(this, "catalogResolver", null), f(this, "state", I.IDLE), f(this, "ttsConfig", {}), f(this, "currentText", null), f(this, "currentContentElement", null), f(this, "normalizedToDOM", /* @__PURE__ */ new Map()), f(this, "listeners", /* @__PURE__ */ new Map()), f(this, "lastError", null), f(this, "speakRunId", 0), f(this, "currentBoundaryOffset", 0), f(this, "activeWordBoundaryOffset", 0), f(this, "seekSegments", []), f(this, "sentenceHighlightSegments", []), f(this, "currentSeekSegmentIndex", 0), f(this, "activeSentenceStartOffset", null), f(this, "activeHighlightMode", "word"), f(this, "lastRenderedRegionTarget", null), f(this, "telemetryReporter", null), f(this, "generatedMathSpeechResolver", wu());
|
|
6015
6022
|
}
|
|
6016
6023
|
debugLog(t, n) {
|
|
6017
6024
|
Xn.debugEnabled && (n === void 0 ? console.debug(t) : console.debug(t, n));
|
|
@@ -6053,9 +6060,132 @@ var Yu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6053
6060
|
setHighlightCoordinator(t) {
|
|
6054
6061
|
this.highlightCoordinator = t;
|
|
6055
6062
|
}
|
|
6063
|
+
setHighlightTargetResolverProvider(t) {
|
|
6064
|
+
return this.highlightTargetResolverProvider = t, () => {
|
|
6065
|
+
this.highlightTargetResolverProvider === t && (this.highlightTargetResolverProvider = null);
|
|
6066
|
+
};
|
|
6067
|
+
}
|
|
6056
6068
|
setCatalogResolver(t) {
|
|
6057
6069
|
this.catalogResolver = t;
|
|
6058
6070
|
}
|
|
6071
|
+
getHighlightResolverRuntime() {
|
|
6072
|
+
let t = null;
|
|
6073
|
+
try {
|
|
6074
|
+
t = this.highlightTargetResolverProvider?.() ?? null;
|
|
6075
|
+
} catch {
|
|
6076
|
+
t = null;
|
|
6077
|
+
}
|
|
6078
|
+
const n = t?.context ?? {}, r = typeof HTMLElement < "u" && this.currentContentElement instanceof HTMLElement ? this.currentContentElement : null;
|
|
6079
|
+
return {
|
|
6080
|
+
context: {
|
|
6081
|
+
...n,
|
|
6082
|
+
scopeElement: n.scopeElement ?? r
|
|
6083
|
+
},
|
|
6084
|
+
resolver: t?.resolver ?? null
|
|
6085
|
+
};
|
|
6086
|
+
}
|
|
6087
|
+
getNodeElement(t) {
|
|
6088
|
+
return t ? t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement : null;
|
|
6089
|
+
}
|
|
6090
|
+
isElementWithinScope(t, n) {
|
|
6091
|
+
return n ? t === n || n.contains(t) : !0;
|
|
6092
|
+
}
|
|
6093
|
+
isRangeWithinScope(t, n) {
|
|
6094
|
+
const r = this.getNodeElement(t.startContainer), i = this.getNodeElement(t.endContainer);
|
|
6095
|
+
return !r || !i ? !1 : this.isElementWithinScope(r, n) && this.isElementWithinScope(i, n);
|
|
6096
|
+
}
|
|
6097
|
+
resolveWordHighlightRange(t) {
|
|
6098
|
+
const { context: n, resolver: r } = this.getHighlightResolverRuntime(), i = n.scopeElement ?? this.currentContentElement;
|
|
6099
|
+
try {
|
|
6100
|
+
const o = r?.resolveWordRange?.(t, n);
|
|
6101
|
+
if (o && this.isRangeWithinScope(o, i)) return {
|
|
6102
|
+
range: o,
|
|
6103
|
+
remapped: !Qo(t, o)
|
|
6104
|
+
};
|
|
6105
|
+
} catch {
|
|
6106
|
+
}
|
|
6107
|
+
return {
|
|
6108
|
+
range: t,
|
|
6109
|
+
remapped: !1
|
|
6110
|
+
};
|
|
6111
|
+
}
|
|
6112
|
+
resolveSentenceHighlightTargets(t) {
|
|
6113
|
+
const { context: n, resolver: r } = this.getHighlightResolverRuntime(), i = n.scopeElement ?? this.currentContentElement;
|
|
6114
|
+
try {
|
|
6115
|
+
const o = r?.resolveSentenceRanges?.(t, n);
|
|
6116
|
+
if (!o) return {
|
|
6117
|
+
ranges: t,
|
|
6118
|
+
elements: []
|
|
6119
|
+
};
|
|
6120
|
+
const s = [], a = [];
|
|
6121
|
+
for (const l of o) {
|
|
6122
|
+
if (typeof Range < "u" && l instanceof Range) {
|
|
6123
|
+
if (!this.isRangeWithinScope(l, i)) return {
|
|
6124
|
+
ranges: t,
|
|
6125
|
+
elements: []
|
|
6126
|
+
};
|
|
6127
|
+
s.push(l);
|
|
6128
|
+
continue;
|
|
6129
|
+
}
|
|
6130
|
+
if (typeof Element < "u" && l instanceof Element) {
|
|
6131
|
+
if (!this.isElementWithinScope(l, i)) return {
|
|
6132
|
+
ranges: t,
|
|
6133
|
+
elements: []
|
|
6134
|
+
};
|
|
6135
|
+
a.push(l);
|
|
6136
|
+
continue;
|
|
6137
|
+
}
|
|
6138
|
+
return {
|
|
6139
|
+
ranges: t,
|
|
6140
|
+
elements: []
|
|
6141
|
+
};
|
|
6142
|
+
}
|
|
6143
|
+
return {
|
|
6144
|
+
ranges: s,
|
|
6145
|
+
elements: a
|
|
6146
|
+
};
|
|
6147
|
+
} catch {
|
|
6148
|
+
return {
|
|
6149
|
+
ranges: t,
|
|
6150
|
+
elements: []
|
|
6151
|
+
};
|
|
6152
|
+
}
|
|
6153
|
+
}
|
|
6154
|
+
createTextRange(t, n, r) {
|
|
6155
|
+
if (typeof document > "u" || typeof document.createRange != "function") return null;
|
|
6156
|
+
try {
|
|
6157
|
+
const i = document.createRange();
|
|
6158
|
+
return i.setStart(t, n), i.setEnd(t, r), i.startContainer !== t || i.endContainer !== t ? null : i;
|
|
6159
|
+
} catch {
|
|
6160
|
+
return null;
|
|
6161
|
+
}
|
|
6162
|
+
}
|
|
6163
|
+
paintTTSWordRange(t) {
|
|
6164
|
+
if (this.highlightCoordinator) {
|
|
6165
|
+
try {
|
|
6166
|
+
if (t.startContainer === t.endContainer && t.startContainer.nodeType === Node.TEXT_NODE) {
|
|
6167
|
+
this.highlightCoordinator.highlightTTSWord(t.startContainer, t.startOffset, t.endOffset);
|
|
6168
|
+
return;
|
|
6169
|
+
}
|
|
6170
|
+
} catch {
|
|
6171
|
+
}
|
|
6172
|
+
this.highlightCoordinator.highlightRange(t, B.TTS_WORD, st.YELLOW);
|
|
6173
|
+
}
|
|
6174
|
+
}
|
|
6175
|
+
paintTTSSentenceRanges(t) {
|
|
6176
|
+
if (!this.highlightCoordinator) return;
|
|
6177
|
+
const { ranges: n, elements: r } = this.resolveSentenceHighlightTargets(t);
|
|
6178
|
+
if (r.length > 0 && n.length === 0 && this.highlightCoordinator.highlightTTSSentenceElements) {
|
|
6179
|
+
this.highlightCoordinator.highlightTTSSentenceElements(r);
|
|
6180
|
+
return;
|
|
6181
|
+
}
|
|
6182
|
+
const i = [...n];
|
|
6183
|
+
for (const o of r) {
|
|
6184
|
+
const s = document.createRange();
|
|
6185
|
+
s.selectNodeContents(o), i.push(s);
|
|
6186
|
+
}
|
|
6187
|
+
this.highlightCoordinator.highlightTTSSentence(i);
|
|
6188
|
+
}
|
|
6059
6189
|
getCapabilities() {
|
|
6060
6190
|
return this.currentProvider?.getCapabilities() || null;
|
|
6061
6191
|
}
|
|
@@ -6304,7 +6434,7 @@ var Yu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6304
6434
|
const i = this.normalizedToDOM.get(t), o = this.normalizedToDOM.get(t + r - 1);
|
|
6305
6435
|
if (!i || !o) return;
|
|
6306
6436
|
const s = document.createRange();
|
|
6307
|
-
s.setStart(i.node, i.offset), s.setEnd(o.node, o.offset + 1), this.
|
|
6437
|
+
s.setStart(i.node, i.offset), s.setEnd(o.node, o.offset + 1), this.paintTTSSentenceRanges([s]), this.activeSentenceStartOffset = t;
|
|
6308
6438
|
}
|
|
6309
6439
|
getSegmentIndexForOffset(t, n) {
|
|
6310
6440
|
if (t.length === 0) return -1;
|
|
@@ -6582,7 +6712,7 @@ var Yu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6582
6712
|
return !t || t.providerId?.toLowerCase() === "browser" ? "plain" : t.getCapabilities?.().supportsSSML ? "ssml" : "plain";
|
|
6583
6713
|
}
|
|
6584
6714
|
async resolveGeneratedSpeechContent(t, n, r) {
|
|
6585
|
-
const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await
|
|
6715
|
+
const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await Gu({
|
|
6586
6716
|
contentRoot: t,
|
|
6587
6717
|
language: r,
|
|
6588
6718
|
mathSpeech: this.getMathSpeechOptions(),
|
|
@@ -6599,7 +6729,7 @@ var Yu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6599
6729
|
containsMathMarkup: !1,
|
|
6600
6730
|
speechMatchesVisibleText: !0
|
|
6601
6731
|
};
|
|
6602
|
-
const c =
|
|
6732
|
+
const c = Xu(o, { format: i }), u = o.plainSpeechText;
|
|
6603
6733
|
return {
|
|
6604
6734
|
contentToSpeak: u,
|
|
6605
6735
|
speechText: u,
|
|
@@ -6630,7 +6760,7 @@ var Yu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6630
6760
|
this.highlightSentenceSegment(n.startOffset, n.text), this.debugLog("[TTSService] Applied initial sentence highlighting");
|
|
6631
6761
|
else try {
|
|
6632
6762
|
const r = document.createRange();
|
|
6633
|
-
r.selectNodeContents(this.currentContentElement), this.
|
|
6763
|
+
r.selectNodeContents(this.currentContentElement), this.paintTTSSentenceRanges([r]);
|
|
6634
6764
|
} catch {
|
|
6635
6765
|
}
|
|
6636
6766
|
}
|
|
@@ -6641,7 +6771,9 @@ var Yu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6641
6771
|
const a = this.findHighlightRange(s, o);
|
|
6642
6772
|
if (a && this.highlightCoordinator) {
|
|
6643
6773
|
const l = a.node.textContent?.substring(a.start, a.end) || "";
|
|
6644
|
-
this.debugLog(`[TTSService] Highlighting "${l}" (word: "${n}") at position ${s}`)
|
|
6774
|
+
this.debugLog(`[TTSService] Highlighting "${l}" (word: "${n}") at position ${s}`);
|
|
6775
|
+
const c = this.createTextRange(a.node, a.start, a.end);
|
|
6776
|
+
c ? this.paintTTSWordRange(this.resolveWordHighlightRange(c).range) : this.highlightCoordinator.highlightTTSWord(a.node, a.start, a.end);
|
|
6645
6777
|
} else console.warn(`[TTSService] Could not find highlight range for position ${s}, length ${o}`);
|
|
6646
6778
|
});
|
|
6647
6779
|
}
|
|
@@ -6653,55 +6785,57 @@ var Yu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6653
6785
|
if (!(!n && !t.regionRange || !this.highlightCoordinator))
|
|
6654
6786
|
try {
|
|
6655
6787
|
if (this.lastRenderedRegionTarget = null, t.regionRange) {
|
|
6656
|
-
this.highlightCoordinator.clearHighlights?.(
|
|
6788
|
+
this.highlightCoordinator.clearHighlights?.(B.TTS_WORD), this.paintTTSSentenceRanges([t.regionRange]);
|
|
6657
6789
|
return;
|
|
6658
6790
|
}
|
|
6659
6791
|
if (!n) return;
|
|
6660
6792
|
const r = document.createRange();
|
|
6661
|
-
r.selectNodeContents(n), this.highlightCoordinator.clearHighlights?.(
|
|
6793
|
+
r.selectNodeContents(n), this.highlightCoordinator.clearHighlights?.(B.TTS_WORD), this.paintTTSSentenceRanges([r]);
|
|
6662
6794
|
} catch {
|
|
6663
6795
|
}
|
|
6664
6796
|
}
|
|
6665
6797
|
highlightCatalogActiveRange(t) {
|
|
6666
|
-
|
|
6667
|
-
if (t.startContainer === t.endContainer && t.startContainer.nodeType === Node.TEXT_NODE) {
|
|
6668
|
-
this.highlightCoordinator.highlightTTSWord(t.startContainer, t.startOffset, t.endOffset);
|
|
6669
|
-
return;
|
|
6670
|
-
}
|
|
6671
|
-
this.highlightCoordinator.highlightRange(t, W.TTS_WORD, st.YELLOW);
|
|
6672
|
-
}
|
|
6798
|
+
this.highlightCoordinator && this.paintTTSWordRange(this.resolveWordHighlightRange(t).range);
|
|
6673
6799
|
}
|
|
6674
6800
|
highlightRenderableRegionTarget(t) {
|
|
6675
|
-
if (!(!this.highlightCoordinator || !t || typeof document > "u") && !Ju(this.lastRenderedRegionTarget, t))
|
|
6801
|
+
if (!(!this.highlightCoordinator || !t || typeof document > "u") && !(!this.highlightTargetResolverProvider && Ju(this.lastRenderedRegionTarget, t)))
|
|
6676
6802
|
try {
|
|
6677
6803
|
const n = document.createRange();
|
|
6678
6804
|
if (t.type === "element") n.selectNodeContents(t.element);
|
|
6679
6805
|
else if (t.type === "range") {
|
|
6680
|
-
this.
|
|
6806
|
+
this.paintTTSSentenceRanges([t.range]), this.lastRenderedRegionTarget = t;
|
|
6681
6807
|
return;
|
|
6682
6808
|
} else
|
|
6683
6809
|
n.setStart(t.node, t.startOffset), n.setEnd(t.node, t.endOffset);
|
|
6684
|
-
this.
|
|
6810
|
+
this.paintTTSSentenceRanges([n]), this.lastRenderedRegionTarget = t;
|
|
6685
6811
|
} catch {
|
|
6686
6812
|
}
|
|
6687
6813
|
}
|
|
6688
6814
|
highlightRenderableActiveTarget(t) {
|
|
6689
6815
|
if (!this.highlightCoordinator || typeof document > "u") return;
|
|
6690
6816
|
if (!t) {
|
|
6691
|
-
this.highlightCoordinator.clearHighlights(
|
|
6817
|
+
this.highlightCoordinator.clearHighlights(B.TTS_WORD);
|
|
6692
6818
|
return;
|
|
6693
6819
|
}
|
|
6694
6820
|
if (t.type === "text-range") {
|
|
6695
|
-
this.
|
|
6821
|
+
const o = this.createTextRange(t.node, t.startOffset, t.endOffset);
|
|
6822
|
+
o ? this.paintTTSWordRange(this.resolveWordHighlightRange(o).range) : this.highlightCoordinator.highlightTTSWord(t.node, t.startOffset, t.endOffset);
|
|
6696
6823
|
return;
|
|
6697
6824
|
}
|
|
6698
6825
|
if (t.type === "range") {
|
|
6699
6826
|
this.highlightCatalogActiveRange(t.range);
|
|
6700
6827
|
return;
|
|
6701
6828
|
}
|
|
6702
|
-
const n =
|
|
6703
|
-
|
|
6704
|
-
|
|
6829
|
+
const n = document.createRange();
|
|
6830
|
+
n.selectNodeContents(t.element);
|
|
6831
|
+
const r = this.resolveWordHighlightRange(n);
|
|
6832
|
+
if (r.remapped) {
|
|
6833
|
+
this.paintTTSWordRange(r.range);
|
|
6834
|
+
return;
|
|
6835
|
+
}
|
|
6836
|
+
const i = t.element.childNodes.length === 1 ? t.element.firstChild : null;
|
|
6837
|
+
if (t.quality === "semantic-token" && i?.nodeType === Node.TEXT_NODE) {
|
|
6838
|
+
this.highlightCoordinator.highlightTTSWord(i, 0, i.textContent?.length || 0);
|
|
6705
6839
|
return;
|
|
6706
6840
|
}
|
|
6707
6841
|
this.highlightCoordinator.highlightTTSWordElement?.(t.element);
|
|
@@ -6723,10 +6857,10 @@ var Yu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6723
6857
|
async speakCatalogChunkOnce(t, n) {
|
|
6724
6858
|
if (!this.provider) return;
|
|
6725
6859
|
this.lastRenderedRegionTarget = null;
|
|
6726
|
-
const r = t.regionElement || t.sourceElement || this.currentContentElement, i = r ?
|
|
6860
|
+
const r = t.regionElement || t.sourceElement || this.currentContentElement, i = r ? ju({
|
|
6727
6861
|
contentRoot: r,
|
|
6728
6862
|
chunks: [t]
|
|
6729
|
-
})[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ?
|
|
6863
|
+
})[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? zu({
|
|
6730
6864
|
chunks: [i],
|
|
6731
6865
|
mathTokenHighlighting: o
|
|
6732
6866
|
}) : null;
|
|
@@ -6822,10 +6956,10 @@ var Yu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6822
6956
|
highlightMode: this.activeHighlightMode,
|
|
6823
6957
|
wordBoundaryOffset: this.activeWordBoundaryOffset
|
|
6824
6958
|
}), await this.speakWithPlan(i, r, { highlightMode: this.activeHighlightMode }), r !== this.speakRunId) return;
|
|
6825
|
-
this.setState(I.IDLE), this.clearHighlightsAndTracking();
|
|
6959
|
+
this.setState(I.IDLE), this.clearHighlightsAndTracking(), this.highlightTargetResolverProvider = null;
|
|
6826
6960
|
} catch (o) {
|
|
6827
6961
|
if (r !== this.speakRunId) return;
|
|
6828
|
-
throw this.lastError = o instanceof Error ? o.message : String(o), this.setState(I.ERROR), this.clearHighlightsAndTracking(), o;
|
|
6962
|
+
throw this.lastError = o instanceof Error ? o.message : String(o), this.setState(I.ERROR), this.clearHighlightsAndTracking(), this.highlightTargetResolverProvider = null, o;
|
|
6829
6963
|
}
|
|
6830
6964
|
}
|
|
6831
6965
|
async setPlaybackRate(t) {
|
|
@@ -6848,10 +6982,10 @@ var Yu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6848
6982
|
await this.seekBy(-n);
|
|
6849
6983
|
}
|
|
6850
6984
|
stop() {
|
|
6851
|
-
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.activeWordBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
|
|
6985
|
+
this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.highlightTargetResolverProvider = null, 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.activeWordBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
|
|
6852
6986
|
}
|
|
6853
6987
|
requestControlHandoff() {
|
|
6854
|
-
typeof window > "u" || window.dispatchEvent(new CustomEvent(
|
|
6988
|
+
typeof window > "u" || window.dispatchEvent(new CustomEvent(Yu, { detail: { source: "host" } }));
|
|
6855
6989
|
}
|
|
6856
6990
|
isPlaying() {
|
|
6857
6991
|
return this.state === I.PLAYING;
|
|
@@ -6929,7 +7063,7 @@ f(Qu, "debugEnabled", (() => {
|
|
|
6929
7063
|
}
|
|
6930
7064
|
return globalThis.__PIE_TTS_DEBUG__ === !0;
|
|
6931
7065
|
})());
|
|
6932
|
-
var wh =
|
|
7066
|
+
var wh = rl({
|
|
6933
7067
|
policy: {
|
|
6934
7068
|
allowed: [],
|
|
6935
7069
|
blocked: []
|
|
@@ -6940,7 +7074,7 @@ var wh = nl({
|
|
|
6940
7074
|
passage: []
|
|
6941
7075
|
},
|
|
6942
7076
|
providers: {}
|
|
6943
|
-
}),
|
|
7077
|
+
}), Zo, Ie = class ee {
|
|
6944
7078
|
constructor() {
|
|
6945
7079
|
f(this, "elementType", "multiple-choice"), f(this, "priority", 100);
|
|
6946
7080
|
}
|
|
@@ -6989,16 +7123,16 @@ var wh = nl({
|
|
|
6989
7123
|
for (const n of t.querySelectorAll(".feedback-tick")) n.setAttribute(ee.FEEDBACK_HOOK_ATTR, "true");
|
|
6990
7124
|
}
|
|
6991
7125
|
};
|
|
6992
|
-
|
|
7126
|
+
Zo = Ie;
|
|
6993
7127
|
f(Ie, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
|
|
6994
7128
|
f(Ie, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label");
|
|
6995
7129
|
f(Ie, "ROOT_HOOK_ATTR", "data-pie-answer-eliminator-root");
|
|
6996
7130
|
f(Ie, "FEEDBACK_HOOK_ATTR", "data-pie-answer-eliminator-feedback-tick");
|
|
6997
|
-
f(Ie, "CHOICE_SELECTOR", `[${
|
|
6998
|
-
var
|
|
7131
|
+
f(Ie, "CHOICE_SELECTOR", `[${Zo.CHOICE_HOOK_ATTR}="true"], .corespring-checkbox, .corespring-radio-button`);
|
|
7132
|
+
var es = "ebsr-multiple-choice", Zu = `${es}--version-`, fr = (e) => {
|
|
6999
7133
|
if (!(e instanceof HTMLElement)) return !1;
|
|
7000
7134
|
const t = e.tagName.toLowerCase();
|
|
7001
|
-
return t ===
|
|
7135
|
+
return t === es || t.startsWith(Zu);
|
|
7002
7136
|
}, oi = (e, t) => Array.from(e.querySelectorAll(`[id="${t}"]`)).find(fr) ?? null, eh = (e) => {
|
|
7003
7137
|
let t = e.parentElement;
|
|
7004
7138
|
for (; t !== null; ) {
|
|
@@ -7420,20 +7554,20 @@ var pr = class Tt {
|
|
|
7420
7554
|
};
|
|
7421
7555
|
f(pr, "TOGGLE_CLASS", "pie-answer-eliminator-toggle");
|
|
7422
7556
|
f(pr, "TOGGLE_ACTIVE_CLASS", "pie-answer-eliminator-toggle--active");
|
|
7423
|
-
var ih = /* @__PURE__ */
|
|
7557
|
+
var ih = /* @__PURE__ */ xa('<div style="display: none;" aria-hidden="true"></div>');
|
|
7424
7558
|
function oh(e, t) {
|
|
7425
7559
|
mi(t, !0);
|
|
7426
7560
|
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), p = /* @__PURE__ */ F(null);
|
|
7427
7561
|
const g = /* @__PURE__ */ Ar(() => b(h)?.toolCoordinator);
|
|
7428
7562
|
let m = /* @__PURE__ */ F(null), v = /* @__PURE__ */ F(null), y = /* @__PURE__ */ F(null), S = /* @__PURE__ */ F(null), O = /* @__PURE__ */ Ar(() => o() || n());
|
|
7429
|
-
|
|
7563
|
+
Le(() => {
|
|
7430
7564
|
if (b(u))
|
|
7431
|
-
return
|
|
7565
|
+
return Xa(b(u), (C) => {
|
|
7432
7566
|
M(h, C, !0);
|
|
7433
7567
|
});
|
|
7434
|
-
}),
|
|
7568
|
+
}), Le(() => {
|
|
7435
7569
|
if (b(u))
|
|
7436
|
-
return
|
|
7570
|
+
return Ya(b(u), (C) => {
|
|
7437
7571
|
M(p, C, !0);
|
|
7438
7572
|
});
|
|
7439
7573
|
});
|
|
@@ -7456,13 +7590,13 @@ function oh(e, t) {
|
|
|
7456
7590
|
});
|
|
7457
7591
|
});
|
|
7458
7592
|
}
|
|
7459
|
-
|
|
7460
|
-
!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,
|
|
7461
|
-
}),
|
|
7593
|
+
Le(() => {
|
|
7594
|
+
!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, Bn.MODAL), M(S, b(g), !0), M(y, r())));
|
|
7595
|
+
}), Le(() => {
|
|
7462
7596
|
b(m) && l() && c() && b(m).setStoreIntegration(l(), c());
|
|
7463
|
-
}),
|
|
7597
|
+
}), Pa(() => (M(m, new pr(i(), s()), !0), b(m) && l() && c() && b(m).setStoreIntegration(l(), c()), b(O) ? A() : b(m).cleanup(), () => {
|
|
7464
7598
|
b(m)?.destroy(), M(m, null), b(S) && b(y) && (b(S).unregisterTool(b(y)), M(S, null), M(y, null));
|
|
7465
|
-
})),
|
|
7599
|
+
})), Le(() => {
|
|
7466
7600
|
const C = b(p)?.contextVersion ?? null;
|
|
7467
7601
|
if (C !== null) {
|
|
7468
7602
|
if (b(v) === null) {
|
|
@@ -7471,7 +7605,7 @@ function oh(e, t) {
|
|
|
7471
7605
|
}
|
|
7472
7606
|
C !== b(v) && (M(v, C, !0), G());
|
|
7473
7607
|
}
|
|
7474
|
-
}),
|
|
7608
|
+
}), Le(() => {
|
|
7475
7609
|
b(m) && (b(O) ? (b(m).enableStateRestoration(), A()) : b(m).cleanup());
|
|
7476
7610
|
});
|
|
7477
7611
|
var Z = {
|
|
@@ -7524,9 +7658,9 @@ function oh(e, t) {
|
|
|
7524
7658
|
c(C), pe();
|
|
7525
7659
|
}
|
|
7526
7660
|
}, pt = ih();
|
|
7527
|
-
return
|
|
7661
|
+
return Wa(pt, (C) => M(u, C), () => b(u)), eo(e, pt), vi(Z);
|
|
7528
7662
|
}
|
|
7529
|
-
customElements.define("pie-tool-answer-eliminator",
|
|
7663
|
+
customElements.define("pie-tool-answer-eliminator", Da(oh, {
|
|
7530
7664
|
visible: {
|
|
7531
7665
|
attribute: "visible",
|
|
7532
7666
|
type: "Boolean"
|