@pie-players/pie-tool-annotation-toolbar 0.3.49 → 0.3.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as m } from "./defineProperty-Dt7ri80W.js";
|
|
2
|
-
var
|
|
2
|
+
var _a = Object.create, _o = Object.defineProperty, Ta = Object.getOwnPropertyDescriptor, Sa = Object.getOwnPropertyNames, wa = Object.getPrototypeOf, ka = Object.prototype.hasOwnProperty, $h = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), Ea = (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 = Sa(t), o = 0, s = i.length, a; o < s; o++)
|
|
5
|
+
a = i[o], !ka.call(e, a) && a !== n && _o(e, a, {
|
|
6
6
|
get: ((l) => t[l]).bind(null, a),
|
|
7
|
-
enumerable: !(r =
|
|
7
|
+
enumerable: !(r = Ta(t, a)) || r.enumerable
|
|
8
8
|
});
|
|
9
9
|
return e;
|
|
10
|
-
},
|
|
10
|
+
}, xa = (e, t, n) => (n = e != null ? _a(wa(e)) : {}, Ea(t || !e || !e.__esModule ? _o(n, "default", {
|
|
11
11
|
value: e,
|
|
12
12
|
enumerable: !0
|
|
13
|
-
}) : n, e)),
|
|
13
|
+
}) : n, e)), Rh = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, n) => (typeof require < "u" ? require : t)[n] }) : e)(function(e) {
|
|
14
14
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
15
15
|
throw Error('Calling `require` for "' + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
16
16
|
});
|
|
@@ -19,12 +19,12 @@ if (typeof window < "u") {
|
|
|
19
19
|
((wi = (ki = window).__svelte ?? (ki.__svelte = {})).v ?? (wi.v = /* @__PURE__ */ new Set())).add("5");
|
|
20
20
|
}
|
|
21
21
|
var Ct = {}, j = /* @__PURE__ */ Symbol("uninitialized");
|
|
22
|
-
var
|
|
22
|
+
var To = Array.isArray, Aa = Array.prototype.indexOf, Cn = Array.prototype.includes, Un = Array.from, Mn = Object.keys, On = Object.defineProperty, it = Object.getOwnPropertyDescriptor, Ca = Object.getOwnPropertyDescriptors, Ma = Object.prototype, Oa = Array.prototype, So = Object.getPrototypeOf, Ei = Object.isExtensible, Ia = () => {
|
|
23
23
|
};
|
|
24
|
-
function
|
|
24
|
+
function $a(e) {
|
|
25
25
|
for (var t = 0; t < e.length; t++) e[t]();
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function wo() {
|
|
28
28
|
var e, t;
|
|
29
29
|
return {
|
|
30
30
|
promise: new Promise((n, r) => {
|
|
@@ -34,60 +34,60 @@ function _o() {
|
|
|
34
34
|
reject: t
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var Lh = 1 << 24, ce = 1024, he = 2048, bt = 4096, Ur = 8192, Ra = 16384, Gr = 32768, xi = 1 << 25, Kr = 65536, Ph = 1 << 17, Nh = 1 << 18, Lt = 1 << 19, La = 1 << 20, Yt = 1 << 25, nn = 65536, Ai = 1 << 21, Pa = 1 << 22, In = 1 << 23, Xt = /* @__PURE__ */ Symbol("$state"), ko = /* @__PURE__ */ Symbol("legacy props"), Na = /* @__PURE__ */ Symbol(""), Wa = /* @__PURE__ */ Symbol("proxy path"), yr = /* @__PURE__ */ Symbol("attributes"), za = /* @__PURE__ */ Symbol("class"), _r = /* @__PURE__ */ Symbol("style"), _n = /* @__PURE__ */ Symbol("text");
|
|
38
38
|
var Gn = new class extends Error {
|
|
39
39
|
constructor(...t) {
|
|
40
40
|
super(...t), m(this, "name", "StaleReactionError"), m(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
41
41
|
}
|
|
42
|
-
}(),
|
|
43
|
-
function
|
|
42
|
+
}(), Ha = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
|
|
43
|
+
function Ba() {
|
|
44
44
|
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Da(e, t, n) {
|
|
47
47
|
throw new Error("https://svelte.dev/e/each_key_duplicate");
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function Fa(e) {
|
|
50
50
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function ja() {
|
|
53
53
|
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function qa(e) {
|
|
56
56
|
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Va() {
|
|
59
59
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Ua() {
|
|
62
62
|
throw new Error("https://svelte.dev/e/hydration_failed");
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Ga(e) {
|
|
65
65
|
throw new Error("https://svelte.dev/e/props_invalid_value");
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function Ka() {
|
|
68
68
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function Ya() {
|
|
71
71
|
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Xa() {
|
|
74
74
|
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Ja() {
|
|
77
77
|
throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function Qa() {
|
|
80
80
|
console.warn("https://svelte.dev/e/derived_inert");
|
|
81
81
|
}
|
|
82
82
|
function Kn(e) {
|
|
83
83
|
console.warn("https://svelte.dev/e/hydration_mismatch");
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Za() {
|
|
86
86
|
console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
|
|
87
87
|
}
|
|
88
|
-
var
|
|
88
|
+
var P = !1;
|
|
89
89
|
function Ie(e) {
|
|
90
|
-
|
|
90
|
+
P = e;
|
|
91
91
|
}
|
|
92
92
|
var R;
|
|
93
93
|
function Z(e) {
|
|
@@ -99,14 +99,14 @@ function Yn() {
|
|
|
99
99
|
return Z(/* @__PURE__ */ xe(R));
|
|
100
100
|
}
|
|
101
101
|
function dn(e) {
|
|
102
|
-
if (
|
|
102
|
+
if (P) {
|
|
103
103
|
if (/* @__PURE__ */ xe(R) !== null)
|
|
104
104
|
throw Kn(), Ct;
|
|
105
105
|
R = e;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
if (
|
|
108
|
+
function el(e = 1) {
|
|
109
|
+
if (P) {
|
|
110
110
|
for (var t = e, n = R; t--; ) n = /* @__PURE__ */ xe(n);
|
|
111
111
|
R = n;
|
|
112
112
|
}
|
|
@@ -124,32 +124,32 @@ function $n(e = !0) {
|
|
|
124
124
|
e && n.remove(), n = i;
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Eo(e) {
|
|
128
128
|
if (!e || e.nodeType !== 8)
|
|
129
129
|
throw Kn(), Ct;
|
|
130
130
|
return e.data;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function xo(e) {
|
|
133
133
|
return e === this.v;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function tl(e, t) {
|
|
136
136
|
return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
return !
|
|
138
|
+
function Ao(e) {
|
|
139
|
+
return !tl(e, this.v);
|
|
140
140
|
}
|
|
141
141
|
var Re = !1, Xn = !1;
|
|
142
142
|
function Ci(e, t) {
|
|
143
|
-
return e.label = t,
|
|
143
|
+
return e.label = t, nl(e.v, t), e;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
return e?.[
|
|
145
|
+
function nl(e, t) {
|
|
146
|
+
return e?.[Wa]?.(t), e;
|
|
147
147
|
}
|
|
148
148
|
var F = null;
|
|
149
149
|
function Mt(e) {
|
|
150
150
|
F = e;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function Co(e, t = !1, n) {
|
|
153
153
|
F = {
|
|
154
154
|
p: F,
|
|
155
155
|
i: !1,
|
|
@@ -165,11 +165,11 @@ function Eo(e, t = !1, n) {
|
|
|
165
165
|
} : null
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function Mo(e) {
|
|
169
169
|
var t = F, n = t.e;
|
|
170
170
|
if (n !== null) {
|
|
171
171
|
t.e = null;
|
|
172
|
-
for (var r of n)
|
|
172
|
+
for (var r of n) ns(r);
|
|
173
173
|
}
|
|
174
174
|
return e !== void 0 && (t.x = e), t.i = !0, F = t.p, e ?? {};
|
|
175
175
|
}
|
|
@@ -177,23 +177,23 @@ function rn() {
|
|
|
177
177
|
return !Xn || F !== null && F.l === null;
|
|
178
178
|
}
|
|
179
179
|
var Ze = [];
|
|
180
|
-
function
|
|
180
|
+
function Oo() {
|
|
181
181
|
var e = Ze;
|
|
182
|
-
Ze = [],
|
|
182
|
+
Ze = [], $a(e);
|
|
183
183
|
}
|
|
184
184
|
function ht(e) {
|
|
185
185
|
if (Ze.length === 0 && !Jt) {
|
|
186
186
|
var t = Ze;
|
|
187
187
|
queueMicrotask(() => {
|
|
188
|
-
t === Ze &&
|
|
188
|
+
t === Ze && Oo();
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
191
|
Ze.push(e);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
for (; Ze.length > 0; )
|
|
193
|
+
function rl() {
|
|
194
|
+
for (; Ze.length > 0; ) Oo();
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function Io(e) {
|
|
197
197
|
var t = x;
|
|
198
198
|
if (t === null)
|
|
199
199
|
return M.f |= In, e;
|
|
@@ -216,23 +216,23 @@ function Ue(e, t) {
|
|
|
216
216
|
}
|
|
217
217
|
throw e;
|
|
218
218
|
}
|
|
219
|
-
var
|
|
219
|
+
var il = ~(he | bt | ce);
|
|
220
220
|
function H(e, t) {
|
|
221
|
-
e.f = e.f &
|
|
221
|
+
e.f = e.f & il | t;
|
|
222
222
|
}
|
|
223
223
|
function Yr(e) {
|
|
224
224
|
(e.f & 512) !== 0 || e.deps === null ? H(e, ce) : H(e, bt);
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function $o(e) {
|
|
227
227
|
if (e !== null)
|
|
228
228
|
for (const t of e)
|
|
229
|
-
(t.f & 2) === 0 || (t.f & 65536) === 0 || (t.f ^= nn,
|
|
229
|
+
(t.f & 2) === 0 || (t.f & 65536) === 0 || (t.f ^= nn, $o(t.deps));
|
|
230
230
|
}
|
|
231
|
-
function
|
|
232
|
-
(e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && n.add(e),
|
|
231
|
+
function Ro(e, t, n) {
|
|
232
|
+
(e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && n.add(e), $o(e.deps), H(e, ce);
|
|
233
233
|
}
|
|
234
|
-
var
|
|
235
|
-
function
|
|
234
|
+
var ol = !1, hn = !1;
|
|
235
|
+
function sl(e) {
|
|
236
236
|
var t = hn;
|
|
237
237
|
try {
|
|
238
238
|
return hn = !1, [e(), hn];
|
|
@@ -240,14 +240,14 @@ function nl(e) {
|
|
|
240
240
|
hn = t;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function Lo(e, t) {
|
|
244
244
|
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
245
245
|
}
|
|
246
246
|
function Xr(e, t) {
|
|
247
|
-
|
|
247
|
+
Lo(e, t), t.add(e);
|
|
248
248
|
}
|
|
249
249
|
function E(e, t, n) {
|
|
250
|
-
|
|
250
|
+
Lo(e, t), t.set(e, n);
|
|
251
251
|
}
|
|
252
252
|
function A(e, t, n) {
|
|
253
253
|
if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
@@ -259,10 +259,10 @@ function w(e, t, n) {
|
|
|
259
259
|
function f(e, t) {
|
|
260
260
|
return e.get(A(e, t));
|
|
261
261
|
}
|
|
262
|
-
var
|
|
263
|
-
var
|
|
262
|
+
var Po, Rn = null, wt = null, C = null, Tr = null, X = null, Sr = null, Jt = !1, ir = !1, Ot = null, Ln = null, No = 0;
|
|
263
|
+
var al = 1, Pn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), Nn = /* @__PURE__ */ new WeakMap(), fn = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakMap(), wr = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), Ve = /* @__PURE__ */ new WeakMap(), Tn = /* @__PURE__ */ new WeakMap(), Vt = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakSet(), yt = class Wo {
|
|
264
264
|
constructor() {
|
|
265
|
-
Xr(this, B), m(this, "id",
|
|
265
|
+
Xr(this, B), m(this, "id", al++), E(this, Pn, !1), m(this, "linked", !0), E(this, ot, null), E(this, et, null), m(this, "async_deriveds", /* @__PURE__ */ new Map()), m(this, "current", /* @__PURE__ */ new Map()), m(this, "previous", /* @__PURE__ */ new Map()), E(this, Nn, /* @__PURE__ */ new Set()), E(this, fn, /* @__PURE__ */ new Set()), E(this, kt, 0), E(this, Qe, /* @__PURE__ */ new Map()), E(this, qt, null), E(this, se, []), E(this, wr, []), E(this, ft, /* @__PURE__ */ new Set()), E(this, $e, /* @__PURE__ */ new Set()), E(this, Ve, /* @__PURE__ */ new Map()), E(this, Tn, /* @__PURE__ */ new Set()), m(this, "is_fork", !1), E(this, Vt, !1), wt === null ? Rn = wt = this : (w(et, wt, this), w(ot, this, wt)), wt = this;
|
|
266
266
|
}
|
|
267
267
|
skip_effect(t) {
|
|
268
268
|
f(Ve, this).has(t) || f(Ve, this).set(t, {
|
|
@@ -294,7 +294,7 @@ var rl = 1, Pn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap
|
|
|
294
294
|
try {
|
|
295
295
|
ir = !0, C = this, A(B, this, Wn).call(this);
|
|
296
296
|
} finally {
|
|
297
|
-
|
|
297
|
+
No = 0, Sr = null, Ot = null, Ln = null, ir = !1, C = null, X = null, lt.clear();
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
discard() {
|
|
@@ -302,7 +302,7 @@ var rl = 1, Pn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap
|
|
|
302
302
|
f(fn, this).clear(), A(B, this, zn).call(this), f(qt, this)?.resolve();
|
|
303
303
|
}
|
|
304
304
|
register_created_effect(t) {
|
|
305
|
-
f(
|
|
305
|
+
f(wr, this).push(t);
|
|
306
306
|
}
|
|
307
307
|
increment(t, n) {
|
|
308
308
|
if (w(kt, this, f(kt, this) + 1), t) {
|
|
@@ -331,11 +331,11 @@ var rl = 1, Pn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap
|
|
|
331
331
|
f(fn, this).add(t);
|
|
332
332
|
}
|
|
333
333
|
settled() {
|
|
334
|
-
return (f(qt, this) ?? w(qt, this,
|
|
334
|
+
return (f(qt, this) ?? w(qt, this, wo())).promise;
|
|
335
335
|
}
|
|
336
336
|
static ensure() {
|
|
337
337
|
if (C === null) {
|
|
338
|
-
const t = C = new
|
|
338
|
+
const t = C = new Wo();
|
|
339
339
|
!ir && !Jt && ht(() => {
|
|
340
340
|
f(Pn, t) || t.flush();
|
|
341
341
|
});
|
|
@@ -364,14 +364,14 @@ var rl = 1, Pn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap
|
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
schedule(t) {
|
|
367
|
-
if (
|
|
367
|
+
if (Sr = t, t.b?.is_pending && (t.f & 16777228) !== 0 && (t.f & 32768) === 0) {
|
|
368
368
|
t.b.defer_effect(t);
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
371
371
|
for (var n = t; n.parent !== null; ) {
|
|
372
372
|
n = n.parent;
|
|
373
373
|
var r = n.f;
|
|
374
|
-
if (Ot !== null && n === x && (Re || (M === null || (M.f & 2) === 0) && !
|
|
374
|
+
if (Ot !== null && n === x && (Re || (M === null || (M.f & 2) === 0) && !ol))
|
|
375
375
|
return;
|
|
376
376
|
if ((r & 96) !== 0) {
|
|
377
377
|
if ((r & 1024) === 0) return;
|
|
@@ -381,7 +381,7 @@ var rl = 1, Pn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap
|
|
|
381
381
|
f(se, this).push(n);
|
|
382
382
|
}
|
|
383
383
|
};
|
|
384
|
-
|
|
384
|
+
Po = yt;
|
|
385
385
|
function Mi() {
|
|
386
386
|
if (this.is_fork) return !0;
|
|
387
387
|
for (const n of f(Qe, this).keys()) {
|
|
@@ -397,7 +397,7 @@ function Mi() {
|
|
|
397
397
|
return !1;
|
|
398
398
|
}
|
|
399
399
|
function Wn() {
|
|
400
|
-
w(Pn, this, !0),
|
|
400
|
+
w(Pn, this, !0), No++ > 1e3 && (A(B, this, zn).call(this), dl());
|
|
401
401
|
for (const a of f(ft, this))
|
|
402
402
|
f($e, this).delete(a), H(a, he), this.schedule(a);
|
|
403
403
|
for (const a of f($e, this))
|
|
@@ -406,36 +406,36 @@ function Wn() {
|
|
|
406
406
|
w(se, this, []), this.apply();
|
|
407
407
|
var t = Ot = [], n = [], r = Ln = [];
|
|
408
408
|
for (const a of e) try {
|
|
409
|
-
A(B, this,
|
|
409
|
+
A(B, this, zo).call(this, a, t, n);
|
|
410
410
|
} catch (l) {
|
|
411
|
-
throw
|
|
411
|
+
throw Do(a), A(B, this, Mi).call(this) || this.discard(), l;
|
|
412
412
|
}
|
|
413
413
|
if (C = null, r.length > 0) {
|
|
414
|
-
var i =
|
|
414
|
+
var i = Po.ensure();
|
|
415
415
|
for (const a of r) i.schedule(a);
|
|
416
416
|
}
|
|
417
417
|
if (Ot = null, Ln = null, A(B, this, Mi).call(this)) {
|
|
418
418
|
A(B, this, Ut).call(this, n), A(B, this, Ut).call(this, t);
|
|
419
|
-
for (const [a, l] of f(Ve, this))
|
|
419
|
+
for (const [a, l] of f(Ve, this)) Bo(a, l);
|
|
420
420
|
r.length > 0 && A(B, C, Wn).call(C);
|
|
421
421
|
return;
|
|
422
422
|
}
|
|
423
|
-
const o = A(B, this,
|
|
423
|
+
const o = A(B, this, ll).call(this);
|
|
424
424
|
if (o) {
|
|
425
|
-
A(B, this, Ut).call(this, n), A(B, this, Ut).call(this, t), A(B, o,
|
|
425
|
+
A(B, this, Ut).call(this, n), A(B, this, Ut).call(this, t), A(B, o, cl).call(o, this);
|
|
426
426
|
return;
|
|
427
427
|
}
|
|
428
428
|
f(ft, this).clear(), f($e, this).clear();
|
|
429
429
|
for (const a of f(Nn, this)) a(this);
|
|
430
|
-
f(Nn, this).clear(),
|
|
430
|
+
f(Nn, this).clear(), Tr = this, Oi(n), Oi(t), Tr = null, f(qt, this)?.resolve();
|
|
431
431
|
var s = C;
|
|
432
|
-
if (f(kt, this) === 0 && (f(se, this).length === 0 || s !== null) && (A(B, this, zn).call(this), Re && (A(B, this,
|
|
432
|
+
if (f(kt, this) === 0 && (f(se, this).length === 0 || s !== null) && (A(B, this, zn).call(this), Re && (A(B, this, ul).call(this), C = s)), f(se, this).length > 0) if (s !== null) {
|
|
433
433
|
const a = s;
|
|
434
434
|
f(se, a).push(...f(se, this).filter((l) => !f(se, a).includes(l)));
|
|
435
435
|
} else s = this;
|
|
436
436
|
s !== null && A(B, s, Wn).call(s);
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function zo(e, t, n) {
|
|
439
439
|
e.f ^= ce;
|
|
440
440
|
for (var r = e.first; r !== null; ) {
|
|
441
441
|
var i = r.f, o = (i & 96) !== 0;
|
|
@@ -457,7 +457,7 @@ function Po(e, t, n) {
|
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function ll() {
|
|
461
461
|
for (var e = f(ot, this); e !== null; ) {
|
|
462
462
|
if (!e.is_fork) {
|
|
463
463
|
for (const [t, [, n]] of this.current) if (e.current.has(t) && !n) return e;
|
|
@@ -466,7 +466,7 @@ function il() {
|
|
|
466
466
|
}
|
|
467
467
|
return null;
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function cl(e) {
|
|
470
470
|
for (const [n, r] of e.current)
|
|
471
471
|
!this.previous.has(n) && e.previous.has(n) && this.previous.set(n, e.previous.get(n)), this.current.set(n, r);
|
|
472
472
|
for (const [n, r] of e.async_deriveds) {
|
|
@@ -490,9 +490,9 @@ function ol(e) {
|
|
|
490
490
|
this.oncommit(() => e.discard()), A(B, e, zn).call(e), C = this, A(B, this, Wn).call(this);
|
|
491
491
|
}
|
|
492
492
|
function Ut(e) {
|
|
493
|
-
for (var t = 0; t < e.length; t += 1)
|
|
493
|
+
for (var t = 0; t < e.length; t += 1) Ro(e[t], f(ft, this), f($e, this));
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function ul() {
|
|
496
496
|
for (let c = Rn; c !== null; c = f(et, c)) {
|
|
497
497
|
var e = c.id < this.id, t = [];
|
|
498
498
|
for (const [u, [d, h]] of this.current) {
|
|
@@ -517,17 +517,17 @@ function sl() {
|
|
|
517
517
|
});
|
|
518
518
|
c.activate();
|
|
519
519
|
var i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
520
|
-
for (var s of t)
|
|
520
|
+
for (var s of t) Ho(s, r, i, o);
|
|
521
521
|
o = /* @__PURE__ */ new Map();
|
|
522
522
|
var a = [...c.current].filter(([u, d]) => {
|
|
523
523
|
const h = this.current.get(u);
|
|
524
524
|
return h ? h[0] !== d[0] || h[1] !== d[1] : !0;
|
|
525
525
|
}).map(([u]) => u);
|
|
526
526
|
if (a.length > 0)
|
|
527
|
-
for (const u of f(
|
|
527
|
+
for (const u of f(wr, this)) (u.f & 155648) === 0 && Jr(u, a, o) && ((u.f & 4194320) !== 0 ? (H(u, he), c.schedule(u)) : f(ft, c).add(u));
|
|
528
528
|
if (f(se, c).length > 0 && !f(Vt, c)) {
|
|
529
529
|
c.apply();
|
|
530
|
-
for (var l of f(se, c)) A(B, c,
|
|
530
|
+
for (var l of f(se, c)) A(B, c, zo).call(c, l, [], []);
|
|
531
531
|
w(se, c, []);
|
|
532
532
|
}
|
|
533
533
|
c.deactivate();
|
|
@@ -547,23 +547,23 @@ function Sn(e) {
|
|
|
547
547
|
try {
|
|
548
548
|
var n;
|
|
549
549
|
for (e && (C !== null && !C.is_fork && C.flush(), n = e()); ; ) {
|
|
550
|
-
if (
|
|
550
|
+
if (rl(), C === null) return n;
|
|
551
551
|
C.flush();
|
|
552
552
|
}
|
|
553
553
|
} finally {
|
|
554
554
|
Jt = t;
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function dl() {
|
|
558
558
|
if (0) {
|
|
559
559
|
var e;
|
|
560
560
|
for (const n of C.current.keys()) for (const [r, i] of n.updated ?? [])
|
|
561
561
|
var t;
|
|
562
562
|
}
|
|
563
563
|
try {
|
|
564
|
-
|
|
564
|
+
Va();
|
|
565
565
|
} catch (n) {
|
|
566
|
-
Ue(n,
|
|
566
|
+
Ue(n, Sr);
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
569
|
var Se = null;
|
|
@@ -572,7 +572,7 @@ function Oi(e) {
|
|
|
572
572
|
if (t !== 0) {
|
|
573
573
|
for (var n = 0; n < t; ) {
|
|
574
574
|
var r = e[n++];
|
|
575
|
-
if ((r.f & 24576) === 0 && on(r) && (Se = /* @__PURE__ */ new Set(), $t(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null &&
|
|
575
|
+
if ((r.f & 24576) === 0 && on(r) && (Se = /* @__PURE__ */ new Set(), $t(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && os(r), Se?.size > 0)) {
|
|
576
576
|
lt.clear();
|
|
577
577
|
for (const i of Se) {
|
|
578
578
|
if ((i.f & 24576) !== 0) continue;
|
|
@@ -591,11 +591,11 @@ function Oi(e) {
|
|
|
591
591
|
Se = null;
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function Ho(e, t, n, r) {
|
|
595
595
|
if (!n.has(e) && (n.add(e), e.reactions !== null))
|
|
596
596
|
for (const i of e.reactions) {
|
|
597
597
|
const o = i.f;
|
|
598
|
-
(o & 2) !== 0 ?
|
|
598
|
+
(o & 2) !== 0 ? Ho(i, t, n, r) : (o & 4194320) !== 0 && (o & 2048) === 0 && Jr(i, t, r) && (H(i, he), Qr(i));
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
601
|
function Jr(e, t, n) {
|
|
@@ -611,19 +611,19 @@ function Jr(e, t, n) {
|
|
|
611
611
|
function Qr(e) {
|
|
612
612
|
C.schedule(e);
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function Bo(e, t) {
|
|
615
615
|
if (!((e.f & 32) !== 0 && (e.f & 1024) !== 0)) {
|
|
616
616
|
(e.f & 2048) !== 0 ? t.d.push(e) : (e.f & 4096) !== 0 && t.m.push(e), H(e, ce);
|
|
617
617
|
for (var n = e.first; n !== null; )
|
|
618
|
-
|
|
618
|
+
Bo(n, t), n = n.next;
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function Do(e) {
|
|
622
622
|
H(e, ce);
|
|
623
623
|
for (var t = e.first; t !== null; )
|
|
624
|
-
|
|
624
|
+
Do(t), t = t.next;
|
|
625
625
|
}
|
|
626
|
-
function
|
|
626
|
+
function hl(e) {
|
|
627
627
|
let t = 0, n = pt(0), r;
|
|
628
628
|
return () => {
|
|
629
629
|
ii() && (_(n), oi(() => (t === 0 && (r = ci(() => e(() => Qt(n)))), t += 1, () => {
|
|
@@ -633,31 +633,31 @@ function ll(e) {
|
|
|
633
633
|
})));
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
|
-
var
|
|
637
|
-
function
|
|
638
|
-
new
|
|
636
|
+
var fl = Kr | Lt;
|
|
637
|
+
function pl(e, t, n, r) {
|
|
638
|
+
new gl(e, t, n, r);
|
|
639
639
|
}
|
|
640
|
-
var be = /* @__PURE__ */ new WeakMap(),
|
|
640
|
+
var be = /* @__PURE__ */ new WeakMap(), kr = /* @__PURE__ */ new WeakMap(), we = /* @__PURE__ */ new WeakMap(), Zt = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new WeakMap(), ke = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), pn = /* @__PURE__ */ new WeakMap(), Er = /* @__PURE__ */ new WeakMap(), xr = /* @__PURE__ */ new WeakMap(), Xe = /* @__PURE__ */ new WeakMap(), Ii = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakSet(), gl = class {
|
|
641
641
|
constructor(e, t, n, r) {
|
|
642
|
-
Xr(this, G), m(this, "parent", void 0), m(this, "is_pending", !1), m(this, "transform_error", void 0), E(this, be, void 0), E(this,
|
|
642
|
+
Xr(this, G), m(this, "parent", void 0), m(this, "is_pending", !1), m(this, "transform_error", void 0), E(this, be, void 0), E(this, kr, P ? R : null), E(this, we, void 0), E(this, Zt, void 0), E(this, ae, void 0), E(this, ke, null), E(this, re, null), E(this, ve, null), E(this, st, null), E(this, Et, 0), E(this, at, 0), E(this, pn, !1), E(this, Er, /* @__PURE__ */ new Set()), E(this, xr, /* @__PURE__ */ new Set()), E(this, Xe, null), E(this, Ii, hl(() => (w(Xe, this, pt(f(Et, this))), () => {
|
|
643
643
|
w(Xe, this, null);
|
|
644
644
|
}))), w(be, this, e), w(we, this, t), w(Zt, this, (i) => {
|
|
645
645
|
var o = x;
|
|
646
646
|
o.b = this, o.f |= 128, n(i);
|
|
647
647
|
}), this.parent = x.b, this.transform_error = r ?? this.parent?.transform_error ?? ((i) => i), w(ae, this, si(() => {
|
|
648
|
-
if (
|
|
649
|
-
const i = f(
|
|
648
|
+
if (P) {
|
|
649
|
+
const i = f(kr, this);
|
|
650
650
|
Yn();
|
|
651
651
|
const o = i.data === "[!";
|
|
652
652
|
if (i.data.startsWith("[?")) {
|
|
653
653
|
const s = JSON.parse(i.data.slice(2));
|
|
654
|
-
A(G, this,
|
|
655
|
-
} else o ? A(G, this,
|
|
656
|
-
} else A(G, this,
|
|
657
|
-
},
|
|
654
|
+
A(G, this, ml).call(this, s);
|
|
655
|
+
} else o ? A(G, this, bl).call(this) : A(G, this, vl).call(this);
|
|
656
|
+
} else A(G, this, Fo).call(this);
|
|
657
|
+
}, fl)), P && w(be, this, R);
|
|
658
658
|
}
|
|
659
659
|
defer_effect(e) {
|
|
660
|
-
|
|
660
|
+
Ro(e, f(Er, this), f(xr, this));
|
|
661
661
|
}
|
|
662
662
|
is_rendered() {
|
|
663
663
|
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
@@ -666,7 +666,7 @@ var be = /* @__PURE__ */ new WeakMap(), Er = /* @__PURE__ */ new WeakMap(), we =
|
|
|
666
666
|
return !!f(we, this).pending;
|
|
667
667
|
}
|
|
668
668
|
update_pending_count(e, t) {
|
|
669
|
-
A(G, this,
|
|
669
|
+
A(G, this, jo).call(this, e, t), w(Et, this, f(Et, this) + e), !(!f(Xe, this) || f(pn, this)) && (w(pn, this, !0), ht(() => {
|
|
670
670
|
w(pn, this, !1), f(Xe, this) && It(f(Xe, this), f(Et, this));
|
|
671
671
|
}));
|
|
672
672
|
}
|
|
@@ -680,30 +680,30 @@ var be = /* @__PURE__ */ new WeakMap(), Er = /* @__PURE__ */ new WeakMap(), we =
|
|
|
680
680
|
})) : A(G, this, $i).call(this, e);
|
|
681
681
|
}
|
|
682
682
|
};
|
|
683
|
-
function
|
|
683
|
+
function vl() {
|
|
684
684
|
try {
|
|
685
685
|
w(ke, this, ue(() => f(Zt, this).call(this, f(be, this))));
|
|
686
686
|
} catch (e) {
|
|
687
687
|
this.error(e);
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function ml(e) {
|
|
691
691
|
const t = f(we, this).failed;
|
|
692
692
|
t && w(ve, this, ue(() => {
|
|
693
693
|
t(f(be, this), () => e, () => () => {
|
|
694
694
|
});
|
|
695
695
|
}));
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function bl() {
|
|
698
698
|
const e = f(we, this).pending;
|
|
699
699
|
e && (this.is_pending = !0, w(re, this, ue(() => e(f(be, this)))), ht(() => {
|
|
700
700
|
var t = w(st, this, document.createDocumentFragment()), n = ye();
|
|
701
|
-
t.append(n), w(ke, this, A(G, this,
|
|
701
|
+
t.append(n), w(ke, this, A(G, this, Ar).call(this, () => ue(() => f(Zt, this).call(this, n)))), f(at, this) === 0 && (f(be, this).before(t), w(st, this, null), _t(f(re, this), () => {
|
|
702
702
|
w(re, this, null);
|
|
703
703
|
}), A(G, this, Zr).call(this, C));
|
|
704
704
|
}));
|
|
705
705
|
}
|
|
706
|
-
function
|
|
706
|
+
function Fo() {
|
|
707
707
|
try {
|
|
708
708
|
if (this.is_pending = this.has_pending_snippet(), w(at, this, 0), w(Et, this, 0), w(ke, this, ue(() => {
|
|
709
709
|
f(Zt, this).call(this, f(be, this));
|
|
@@ -718,24 +718,24 @@ function Ho() {
|
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
720
|
function Zr(e) {
|
|
721
|
-
this.is_pending = !1, e.transfer_effects(f(
|
|
721
|
+
this.is_pending = !1, e.transfer_effects(f(Er, this), f(xr, this));
|
|
722
722
|
}
|
|
723
|
-
function
|
|
723
|
+
function Ar(e) {
|
|
724
724
|
var t = x, n = M, r = F;
|
|
725
725
|
Ee(f(ae, this)), de(f(ae, this)), Mt(f(ae, this).ctx);
|
|
726
726
|
try {
|
|
727
727
|
return yt.ensure(), e();
|
|
728
728
|
} catch (i) {
|
|
729
|
-
return
|
|
729
|
+
return Io(i), null;
|
|
730
730
|
} finally {
|
|
731
731
|
Ee(t), de(n), Mt(r);
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function jo(e, t) {
|
|
735
735
|
if (!this.has_pending_snippet()) {
|
|
736
736
|
if (this.parent) {
|
|
737
737
|
var n;
|
|
738
|
-
A(G, n = this.parent,
|
|
738
|
+
A(G, n = this.parent, jo).call(n, e, t);
|
|
739
739
|
}
|
|
740
740
|
return;
|
|
741
741
|
}
|
|
@@ -744,19 +744,19 @@ function Bo(e, t) {
|
|
|
744
744
|
}), f(st, this) && (f(be, this).before(f(st, this)), w(st, this, null)));
|
|
745
745
|
}
|
|
746
746
|
function $i(e) {
|
|
747
|
-
f(ke, this) && (J(f(ke, this)), w(ke, this, null)), f(re, this) && (J(f(re, this)), w(re, this, null)), f(ve, this) && (J(f(ve, this)), w(ve, this, null)),
|
|
747
|
+
f(ke, this) && (J(f(ke, this)), w(ke, this, null)), f(re, this) && (J(f(re, this)), w(re, this, null)), f(ve, this) && (J(f(ve, this)), w(ve, this, null)), P && (Z(f(kr, this)), el(), Z($n()));
|
|
748
748
|
var t = f(we, this).onerror;
|
|
749
749
|
let n = f(we, this).failed;
|
|
750
750
|
var r = !1, i = !1;
|
|
751
751
|
const o = () => {
|
|
752
752
|
if (r) {
|
|
753
|
-
|
|
753
|
+
Za();
|
|
754
754
|
return;
|
|
755
755
|
}
|
|
756
|
-
r = !0, i &&
|
|
756
|
+
r = !0, i && Ja(), f(ve, this) !== null && _t(f(ve, this), () => {
|
|
757
757
|
w(ve, this, null);
|
|
758
|
-
}), A(G, this,
|
|
759
|
-
A(G, this,
|
|
758
|
+
}), A(G, this, Ar).call(this, () => {
|
|
759
|
+
A(G, this, Fo).call(this);
|
|
760
760
|
});
|
|
761
761
|
}, s = (a) => {
|
|
762
762
|
try {
|
|
@@ -764,7 +764,7 @@ function $i(e) {
|
|
|
764
764
|
} catch (l) {
|
|
765
765
|
Ue(l, f(ae, this) && f(ae, this).parent);
|
|
766
766
|
}
|
|
767
|
-
n && w(ve, this, A(G, this,
|
|
767
|
+
n && w(ve, this, A(G, this, Ar).call(this, () => {
|
|
768
768
|
try {
|
|
769
769
|
return ue(() => {
|
|
770
770
|
var l = x;
|
|
@@ -786,14 +786,14 @@ function $i(e) {
|
|
|
786
786
|
a !== null && typeof a == "object" && typeof a.then == "function" ? a.then(s, (l) => Ue(l, f(ae, this) && f(ae, this).parent)) : s(a);
|
|
787
787
|
});
|
|
788
788
|
}
|
|
789
|
-
function
|
|
789
|
+
function yl(e, t, n, r) {
|
|
790
790
|
const i = rn() ? en : ei;
|
|
791
791
|
var o = e.filter((h) => !h.settled);
|
|
792
792
|
if (n.length === 0 && o.length === 0) {
|
|
793
793
|
r(t.map(i));
|
|
794
794
|
return;
|
|
795
795
|
}
|
|
796
|
-
var s = x, a =
|
|
796
|
+
var s = x, a = _l(), l = o.length === 1 ? o[0].promise : o.length > 1 ? Promise.all(o.map((h) => h.promise)) : null;
|
|
797
797
|
function c(h) {
|
|
798
798
|
if ((s.f & 16384) === 0) {
|
|
799
799
|
a();
|
|
@@ -805,19 +805,19 @@ function gl(e, t, n, r) {
|
|
|
805
805
|
Hn();
|
|
806
806
|
}
|
|
807
807
|
}
|
|
808
|
-
var u =
|
|
808
|
+
var u = qo();
|
|
809
809
|
if (n.length === 0) {
|
|
810
810
|
l.then(() => c(t.map(i))).finally(u);
|
|
811
811
|
return;
|
|
812
812
|
}
|
|
813
813
|
function d() {
|
|
814
|
-
Promise.all(n.map((h) => /* @__PURE__ */
|
|
814
|
+
Promise.all(n.map((h) => /* @__PURE__ */ Tl(h))).then((h) => c([...t.map(i), ...h])).catch((h) => Ue(h, s)).finally(u);
|
|
815
815
|
}
|
|
816
816
|
l ? l.then(() => {
|
|
817
817
|
a(), d(), Hn();
|
|
818
818
|
}) : d();
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function _l() {
|
|
821
821
|
var e = x, t = M, n = F, r = C;
|
|
822
822
|
if (0) var i;
|
|
823
823
|
return function(s = !0) {
|
|
@@ -827,7 +827,7 @@ function vl() {
|
|
|
827
827
|
function Hn(e = !0) {
|
|
828
828
|
Ee(null), de(null), Mt(null), e && C?.deactivate();
|
|
829
829
|
}
|
|
830
|
-
function
|
|
830
|
+
function qo() {
|
|
831
831
|
var e = x, t = e.b, n = C, r = !!t?.is_rendered();
|
|
832
832
|
return t?.update_pending_count(1, n), n.increment(r, e), () => {
|
|
833
833
|
t?.update_pending_count(-1, n), n.decrement(r, e);
|
|
@@ -840,7 +840,7 @@ function en(e) {
|
|
|
840
840
|
ctx: F,
|
|
841
841
|
deps: null,
|
|
842
842
|
effects: null,
|
|
843
|
-
equals:
|
|
843
|
+
equals: xo,
|
|
844
844
|
f: t,
|
|
845
845
|
fn: e,
|
|
846
846
|
reactions: null,
|
|
@@ -853,12 +853,12 @@ function en(e) {
|
|
|
853
853
|
}
|
|
854
854
|
var gn = /* @__PURE__ */ Symbol("obsolete");
|
|
855
855
|
// @__NO_SIDE_EFFECTS__
|
|
856
|
-
function
|
|
856
|
+
function Tl(e, t, n) {
|
|
857
857
|
let r = x;
|
|
858
|
-
r === null &&
|
|
858
|
+
r === null && Ba();
|
|
859
859
|
var i = void 0, o = pt(j), s = !M, a = /* @__PURE__ */ new Set();
|
|
860
|
-
return
|
|
861
|
-
var l = x, c =
|
|
860
|
+
return Rl(() => {
|
|
861
|
+
var l = x, c = wo();
|
|
862
862
|
i = c.promise;
|
|
863
863
|
try {
|
|
864
864
|
Promise.resolve(e()).then(c.resolve, (p) => {
|
|
@@ -869,7 +869,7 @@ function ml(e, t, n) {
|
|
|
869
869
|
}
|
|
870
870
|
var u = C;
|
|
871
871
|
if (s) {
|
|
872
|
-
if ((l.f & 32768) !== 0) var d =
|
|
872
|
+
if ((l.f & 32768) !== 0) var d = qo();
|
|
873
873
|
if (r.b?.is_rendered()) u.async_deriveds.get(l)?.reject(gn);
|
|
874
874
|
else for (const p of a.values()) p.reject(gn);
|
|
875
875
|
a.add(c), u.async_deriveds.set(l, c);
|
|
@@ -878,7 +878,7 @@ function ml(e, t, n) {
|
|
|
878
878
|
d?.(), a.delete(c), v !== gn && (u.activate(), v ? (o.f |= In, It(o, v)) : ((o.f & 8388608) !== 0 && (o.f ^= In), It(o, p)), u.deactivate());
|
|
879
879
|
};
|
|
880
880
|
c.promise.then(h, (p) => h(null, p || "unknown"));
|
|
881
|
-
}),
|
|
881
|
+
}), Ol(() => {
|
|
882
882
|
for (const l of a) l.reject(gn);
|
|
883
883
|
}), new Promise((l) => {
|
|
884
884
|
function c(u) {
|
|
@@ -893,14 +893,14 @@ function ml(e, t, n) {
|
|
|
893
893
|
// @__NO_SIDE_EFFECTS__
|
|
894
894
|
function or(e) {
|
|
895
895
|
const t = /* @__PURE__ */ en(e);
|
|
896
|
-
return Re ||
|
|
896
|
+
return Re || ls(t), t;
|
|
897
897
|
}
|
|
898
898
|
// @__NO_SIDE_EFFECTS__
|
|
899
899
|
function ei(e) {
|
|
900
900
|
const t = /* @__PURE__ */ en(e);
|
|
901
|
-
return t.equals =
|
|
901
|
+
return t.equals = Ao, t;
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function Sl(e) {
|
|
904
904
|
var t = e.effects;
|
|
905
905
|
if (t !== null) {
|
|
906
906
|
e.effects = null;
|
|
@@ -910,39 +910,39 @@ function bl(e) {
|
|
|
910
910
|
function ti(e) {
|
|
911
911
|
var t, n = x, r = e.parent;
|
|
912
912
|
if (!Le && r !== null && e.v !== j && (r.f & 24576) !== 0)
|
|
913
|
-
return
|
|
913
|
+
return Qa(), e.v;
|
|
914
914
|
Ee(r);
|
|
915
915
|
try {
|
|
916
|
-
e.f &= ~nn,
|
|
916
|
+
e.f &= ~nn, Sl(e), t = hs(e);
|
|
917
917
|
} finally {
|
|
918
918
|
Ee(n);
|
|
919
919
|
}
|
|
920
920
|
return t;
|
|
921
921
|
}
|
|
922
|
-
function
|
|
922
|
+
function Vo(e) {
|
|
923
923
|
var t = ti(e);
|
|
924
|
-
if (!e.equals(t) && (e.wv =
|
|
924
|
+
if (!e.equals(t) && (e.wv = us(), (!C?.is_fork || e.deps === null) && (C !== null ? (C.capture(e, t, !0), Tr?.capture(e, t, !0)) : e.v = t, e.deps === null))) {
|
|
925
925
|
H(e, ce);
|
|
926
926
|
return;
|
|
927
927
|
}
|
|
928
928
|
Le || (X !== null ? (ii() || C?.is_fork) && X.set(e, t) : Yr(e));
|
|
929
929
|
}
|
|
930
|
-
function
|
|
930
|
+
function wl(e) {
|
|
931
931
|
if (e.effects !== null)
|
|
932
|
-
for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(Gn), t.fn !== null && (t.teardown =
|
|
932
|
+
for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(Gn), t.fn !== null && (t.teardown = Ia), t.ac = null, tn(t, 0), ai(t));
|
|
933
933
|
}
|
|
934
|
-
function
|
|
934
|
+
function Uo(e) {
|
|
935
935
|
if (e.effects !== null)
|
|
936
936
|
for (const t of e.effects) t.teardown && t.fn !== null && $t(t);
|
|
937
937
|
}
|
|
938
938
|
var Bn = /* @__PURE__ */ new Set(), lt = /* @__PURE__ */ new Map();
|
|
939
|
-
var
|
|
939
|
+
var Go = !1;
|
|
940
940
|
function pt(e, t) {
|
|
941
941
|
var n = {
|
|
942
942
|
f: 0,
|
|
943
943
|
v: e,
|
|
944
944
|
reactions: null,
|
|
945
|
-
equals:
|
|
945
|
+
equals: xo,
|
|
946
946
|
rv: 0,
|
|
947
947
|
wv: 0
|
|
948
948
|
};
|
|
@@ -951,19 +951,19 @@ function pt(e, t) {
|
|
|
951
951
|
// @__NO_SIDE_EFFECTS__
|
|
952
952
|
function V(e, t) {
|
|
953
953
|
const n = pt(e, t);
|
|
954
|
-
return
|
|
954
|
+
return ls(n), n;
|
|
955
955
|
}
|
|
956
956
|
// @__NO_SIDE_EFFECTS__
|
|
957
|
-
function
|
|
957
|
+
function Ko(e, t = !1, n = !0) {
|
|
958
958
|
const r = pt(e);
|
|
959
|
-
if (t || (r.equals =
|
|
959
|
+
if (t || (r.equals = Ao), Xn && n && F !== null && F.l !== null) {
|
|
960
960
|
var i;
|
|
961
961
|
((i = F.l).s ?? (i.s = [])).push(r);
|
|
962
962
|
}
|
|
963
963
|
return r;
|
|
964
964
|
}
|
|
965
965
|
function I(e, t, n = !1) {
|
|
966
|
-
M !== null && (!me || (M.f & 131072) !== 0) && rn() && (M.f & 4325394) !== 0 && (_e === null || !_e.has(e)) &&
|
|
966
|
+
M !== null && (!me || (M.f & 131072) !== 0) && rn() && (M.f & 4325394) !== 0 && (_e === null || !_e.has(e)) && Xa();
|
|
967
967
|
let r = n ? tt(t) : t;
|
|
968
968
|
return It(e, r, Ln);
|
|
969
969
|
}
|
|
@@ -975,12 +975,12 @@ function It(e, t, n = null) {
|
|
|
975
975
|
const i = e;
|
|
976
976
|
(e.f & 2048) !== 0 && ti(i), X === null && Yr(i);
|
|
977
977
|
}
|
|
978
|
-
e.wv =
|
|
978
|
+
e.wv = us(), Yo(e, he, n), rn() && x !== null && (x.f & 1024) !== 0 && (x.f & 96) === 0 && (oe === null ? Wl([e]) : oe.push(e)), !r.is_fork && Bn.size > 0 && !Go && kl();
|
|
979
979
|
}
|
|
980
980
|
return t;
|
|
981
981
|
}
|
|
982
|
-
function
|
|
983
|
-
|
|
982
|
+
function kl() {
|
|
983
|
+
Go = !1;
|
|
984
984
|
for (const e of Bn) {
|
|
985
985
|
(e.f & 1024) !== 0 && H(e, bt);
|
|
986
986
|
let t;
|
|
@@ -996,7 +996,7 @@ function _l() {
|
|
|
996
996
|
function Qt(e) {
|
|
997
997
|
I(e, e.v + 1);
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function Yo(e, t, n) {
|
|
1000
1000
|
var r = e.reactions;
|
|
1001
1001
|
if (r !== null)
|
|
1002
1002
|
for (var i = rn(), o = r.length, s = 0; s < o; s++) {
|
|
@@ -1006,7 +1006,7 @@ function Uo(e, t, n) {
|
|
|
1006
1006
|
if (c && H(a, t), (l & 131072) !== 0) Bn.add(a);
|
|
1007
1007
|
else if ((l & 2) !== 0) {
|
|
1008
1008
|
var u = a;
|
|
1009
|
-
X?.delete(u), (l & 65536) === 0 && (l & 512 && (x === null || (x.f & 2097152) === 0) && (a.f |= nn),
|
|
1009
|
+
X?.delete(u), (l & 65536) === 0 && (l & 512 && (x === null || (x.f & 2097152) === 0) && (a.f |= nn), Yo(u, bt, n));
|
|
1010
1010
|
} else if (c) {
|
|
1011
1011
|
var d = a;
|
|
1012
1012
|
(l & 16) !== 0 && Se !== null && Se.add(d), n !== null ? n.push(d) : Qr(d);
|
|
@@ -1014,12 +1014,12 @@ function Uo(e, t, n) {
|
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
|
-
var
|
|
1017
|
+
var El = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
|
|
1018
1018
|
function tt(e) {
|
|
1019
1019
|
if (typeof e != "object" || e === null || Xt in e) return e;
|
|
1020
|
-
const t =
|
|
1021
|
-
if (t !==
|
|
1022
|
-
var n = /* @__PURE__ */ new Map(), r =
|
|
1020
|
+
const t = So(e);
|
|
1021
|
+
if (t !== Ma && t !== Oa) return e;
|
|
1022
|
+
var n = /* @__PURE__ */ new Map(), r = To(e), i = /* @__PURE__ */ V(0), o = null, s = ct, a = (d) => {
|
|
1023
1023
|
if (ct === s) return d();
|
|
1024
1024
|
var h = M, p = ct;
|
|
1025
1025
|
de(null), Ni(s);
|
|
@@ -1032,13 +1032,13 @@ function tt(e) {
|
|
|
1032
1032
|
function u(d) {
|
|
1033
1033
|
if (!c) {
|
|
1034
1034
|
c = !0, l = d, Ci(i, `${l} version`);
|
|
1035
|
-
for (const [h, p] of n) Ci(p,
|
|
1035
|
+
for (const [h, p] of n) Ci(p, xl(l, h));
|
|
1036
1036
|
c = !1;
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
1039
|
return new Proxy(e, {
|
|
1040
1040
|
defineProperty(d, h, p) {
|
|
1041
|
-
(!("value" in p) || p.configurable === !1 || p.enumerable === !1 || p.writable === !1) &&
|
|
1041
|
+
(!("value" in p) || p.configurable === !1 || p.enumerable === !1 || p.writable === !1) && Ka();
|
|
1042
1042
|
var v = n.get(h);
|
|
1043
1043
|
return v === void 0 ? a(() => {
|
|
1044
1044
|
var b = /* @__PURE__ */ V(p.value, o);
|
|
@@ -1125,19 +1125,19 @@ function tt(e) {
|
|
|
1125
1125
|
return h;
|
|
1126
1126
|
},
|
|
1127
1127
|
setPrototypeOf() {
|
|
1128
|
-
|
|
1128
|
+
Ya();
|
|
1129
1129
|
}
|
|
1130
1130
|
});
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1133
|
-
return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` :
|
|
1132
|
+
function xl(e, t) {
|
|
1133
|
+
return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : El.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
|
|
1134
1134
|
}
|
|
1135
|
-
var Ri,
|
|
1136
|
-
function
|
|
1135
|
+
var Ri, Al, Xo, Jo, Qo;
|
|
1136
|
+
function Cr() {
|
|
1137
1137
|
if (Ri === void 0) {
|
|
1138
|
-
Ri = window,
|
|
1138
|
+
Ri = window, Al = document, Xo = /Firefox/.test(navigator.userAgent);
|
|
1139
1139
|
var e = Element.prototype, t = Node.prototype, n = Text.prototype;
|
|
1140
|
-
|
|
1140
|
+
Jo = it(t, "firstChild").get, Qo = it(t, "nextSibling").get, Ei(e) && (e[za] = void 0, e[yr] = null, e[_r] = void 0, e.__e = void 0), Ei(n) && (n[_n] = void 0);
|
|
1141
1141
|
}
|
|
1142
1142
|
}
|
|
1143
1143
|
function ye(e = "") {
|
|
@@ -1145,14 +1145,14 @@ function ye(e = "") {
|
|
|
1145
1145
|
}
|
|
1146
1146
|
// @__NO_SIDE_EFFECTS__
|
|
1147
1147
|
function gt(e) {
|
|
1148
|
-
return
|
|
1148
|
+
return Jo.call(e);
|
|
1149
1149
|
}
|
|
1150
1150
|
// @__NO_SIDE_EFFECTS__
|
|
1151
1151
|
function xe(e) {
|
|
1152
|
-
return
|
|
1152
|
+
return Qo.call(e);
|
|
1153
1153
|
}
|
|
1154
1154
|
function vn(e, t) {
|
|
1155
|
-
if (!
|
|
1155
|
+
if (!P) return /* @__PURE__ */ gt(e);
|
|
1156
1156
|
var n = /* @__PURE__ */ gt(R);
|
|
1157
1157
|
if (n === null) n = R.appendChild(ye());
|
|
1158
1158
|
else if (t && n.nodeType !== 3) {
|
|
@@ -1162,7 +1162,7 @@ function vn(e, t) {
|
|
|
1162
1162
|
return t && ri(n), Z(n), n;
|
|
1163
1163
|
}
|
|
1164
1164
|
function sr(e, t = !1) {
|
|
1165
|
-
if (!
|
|
1165
|
+
if (!P) {
|
|
1166
1166
|
var n = /* @__PURE__ */ gt(e);
|
|
1167
1167
|
return n instanceof Comment && n.data === "" ? /* @__PURE__ */ xe(n) : n;
|
|
1168
1168
|
}
|
|
@@ -1176,10 +1176,10 @@ function sr(e, t = !1) {
|
|
|
1176
1176
|
return R;
|
|
1177
1177
|
}
|
|
1178
1178
|
function He(e, t = 1, n = !1) {
|
|
1179
|
-
let r =
|
|
1179
|
+
let r = P ? R : e;
|
|
1180
1180
|
for (var i; t--; )
|
|
1181
1181
|
i = r, r = /* @__PURE__ */ xe(r);
|
|
1182
|
-
if (!
|
|
1182
|
+
if (!P) return r;
|
|
1183
1183
|
if (n) {
|
|
1184
1184
|
if (r?.nodeType !== 3) {
|
|
1185
1185
|
var o = ye();
|
|
@@ -1189,10 +1189,10 @@ function He(e, t = 1, n = !1) {
|
|
|
1189
1189
|
}
|
|
1190
1190
|
return Z(r), r;
|
|
1191
1191
|
}
|
|
1192
|
-
function
|
|
1192
|
+
function Zo(e) {
|
|
1193
1193
|
e.textContent = "";
|
|
1194
1194
|
}
|
|
1195
|
-
function
|
|
1195
|
+
function es() {
|
|
1196
1196
|
return !Re || Se !== null ? !1 : (x.f & Gr) !== 0;
|
|
1197
1197
|
}
|
|
1198
1198
|
function ni(e, t, n) {
|
|
@@ -1204,7 +1204,7 @@ function ri(e) {
|
|
|
1204
1204
|
for (; t !== null && t.nodeType === 3; )
|
|
1205
1205
|
t.remove(), e.nodeValue += t.nodeValue, t = e.nextSibling;
|
|
1206
1206
|
}
|
|
1207
|
-
function
|
|
1207
|
+
function ts(e) {
|
|
1208
1208
|
var t = M, n = x;
|
|
1209
1209
|
de(null), Ee(null);
|
|
1210
1210
|
try {
|
|
@@ -1213,10 +1213,10 @@ function Qo(e) {
|
|
|
1213
1213
|
de(t), Ee(n);
|
|
1214
1214
|
}
|
|
1215
1215
|
}
|
|
1216
|
-
function
|
|
1217
|
-
x === null && (M === null &&
|
|
1216
|
+
function Cl(e) {
|
|
1217
|
+
x === null && (M === null && qa(e), ja()), Le && Fa(e);
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1219
|
+
function Ml(e, t) {
|
|
1220
1220
|
var n = t.last;
|
|
1221
1221
|
n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
|
|
1222
1222
|
}
|
|
@@ -1250,7 +1250,7 @@ function Ae(e, t) {
|
|
|
1250
1250
|
}
|
|
1251
1251
|
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 |= Kr));
|
|
1252
1252
|
}
|
|
1253
|
-
if (i !== null && (i.parent = n, n !== null &&
|
|
1253
|
+
if (i !== null && (i.parent = n, n !== null && Ml(i, n), M !== null && (M.f & 2) !== 0 && (e & 64) === 0)) {
|
|
1254
1254
|
var o = M;
|
|
1255
1255
|
(o.effects ?? (o.effects = [])).push(i);
|
|
1256
1256
|
}
|
|
@@ -1259,29 +1259,29 @@ function Ae(e, t) {
|
|
|
1259
1259
|
function ii() {
|
|
1260
1260
|
return M !== null && !me;
|
|
1261
1261
|
}
|
|
1262
|
-
function
|
|
1262
|
+
function Ol(e) {
|
|
1263
1263
|
const t = Ae(8, null);
|
|
1264
1264
|
return H(t, ce), t.teardown = e, t;
|
|
1265
1265
|
}
|
|
1266
1266
|
function Li(e) {
|
|
1267
|
-
|
|
1267
|
+
Cl("$effect");
|
|
1268
1268
|
var t = x.f;
|
|
1269
1269
|
if (!M && (t & 32) !== 0 && F !== null && !F.i) {
|
|
1270
1270
|
var n = F;
|
|
1271
1271
|
(n.e ?? (n.e = [])).push(e);
|
|
1272
|
-
} else return
|
|
1272
|
+
} else return ns(e);
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1275
|
-
return Ae(4 |
|
|
1274
|
+
function ns(e) {
|
|
1275
|
+
return Ae(4 | La, e);
|
|
1276
1276
|
}
|
|
1277
|
-
function
|
|
1277
|
+
function Il(e) {
|
|
1278
1278
|
yt.ensure();
|
|
1279
1279
|
const t = Ae(64 | Lt, e);
|
|
1280
1280
|
return () => {
|
|
1281
1281
|
J(t);
|
|
1282
1282
|
};
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function $l(e) {
|
|
1285
1285
|
yt.ensure();
|
|
1286
1286
|
const t = Ae(64 | Lt, e);
|
|
1287
1287
|
return (n = {}) => new Promise((r) => {
|
|
@@ -1290,17 +1290,17 @@ function Cl(e) {
|
|
|
1290
1290
|
}) : (J(t), r(void 0));
|
|
1291
1291
|
});
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1293
|
+
function rs(e) {
|
|
1294
1294
|
return Ae(4, e);
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1297
|
-
return Ae(
|
|
1296
|
+
function Rl(e) {
|
|
1297
|
+
return Ae(Pa | Lt, e);
|
|
1298
1298
|
}
|
|
1299
1299
|
function oi(e, t = 0) {
|
|
1300
1300
|
return Ae(8 | t, e);
|
|
1301
1301
|
}
|
|
1302
1302
|
function mn(e, t = [], n = [], r = []) {
|
|
1303
|
-
|
|
1303
|
+
yl(r, t, n, (i) => {
|
|
1304
1304
|
Ae(8, () => e(...i.map(_)));
|
|
1305
1305
|
});
|
|
1306
1306
|
}
|
|
@@ -1311,7 +1311,7 @@ function si(e, t = 0) {
|
|
|
1311
1311
|
function ue(e) {
|
|
1312
1312
|
return Ae(32 | Lt, e);
|
|
1313
1313
|
}
|
|
1314
|
-
function
|
|
1314
|
+
function is(e) {
|
|
1315
1315
|
var t = e.teardown;
|
|
1316
1316
|
if (t !== null) {
|
|
1317
1317
|
const n = Le, r = M;
|
|
@@ -1327,14 +1327,14 @@ function ai(e, t = !1) {
|
|
|
1327
1327
|
var n = e.first;
|
|
1328
1328
|
for (e.first = e.last = null; n !== null; ) {
|
|
1329
1329
|
const i = n.ac;
|
|
1330
|
-
i !== null &&
|
|
1330
|
+
i !== null && ts(() => {
|
|
1331
1331
|
i.abort(Gn);
|
|
1332
1332
|
});
|
|
1333
1333
|
var r = n.next;
|
|
1334
1334
|
(n.f & 64) !== 0 ? n.parent = null : J(n, t), n = r;
|
|
1335
1335
|
}
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function Ll(e) {
|
|
1338
1338
|
for (var t = e.first; t !== null; ) {
|
|
1339
1339
|
var n = t.next;
|
|
1340
1340
|
(t.f & 32) === 0 && J(t), t = n;
|
|
@@ -1342,26 +1342,26 @@ function Ol(e) {
|
|
|
1342
1342
|
}
|
|
1343
1343
|
function J(e, t = !0) {
|
|
1344
1344
|
var n = !1;
|
|
1345
|
-
(t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (
|
|
1345
|
+
(t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (Pl(e.nodes.start, e.nodes.end), n = !0), H(e, xi), ai(e, t && !n), tn(e, 0);
|
|
1346
1346
|
var r = e.nodes && e.nodes.t;
|
|
1347
1347
|
if (r !== null) for (const o of r) o.stop();
|
|
1348
|
-
|
|
1348
|
+
is(e), e.f ^= xi, e.f |= Ra;
|
|
1349
1349
|
var i = e.parent;
|
|
1350
|
-
i !== null && i.first !== null &&
|
|
1350
|
+
i !== null && i.first !== null && os(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
|
|
1351
1351
|
}
|
|
1352
|
-
function
|
|
1352
|
+
function Pl(e, t) {
|
|
1353
1353
|
for (; e !== null; ) {
|
|
1354
1354
|
var n = e === t ? null : /* @__PURE__ */ xe(e);
|
|
1355
1355
|
e.remove(), e = n;
|
|
1356
1356
|
}
|
|
1357
1357
|
}
|
|
1358
|
-
function
|
|
1358
|
+
function os(e) {
|
|
1359
1359
|
var t = e.parent, n = e.prev, r = e.next;
|
|
1360
1360
|
n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
|
|
1361
1361
|
}
|
|
1362
1362
|
function _t(e, t, n = !0) {
|
|
1363
1363
|
var r = [];
|
|
1364
|
-
|
|
1364
|
+
ss(e, r, !0);
|
|
1365
1365
|
var i = () => {
|
|
1366
1366
|
n && J(e), t && t();
|
|
1367
1367
|
}, o = r.length;
|
|
@@ -1370,7 +1370,7 @@ function _t(e, t, n = !0) {
|
|
|
1370
1370
|
for (var a of r) a.out(s);
|
|
1371
1371
|
} else i();
|
|
1372
1372
|
}
|
|
1373
|
-
function
|
|
1373
|
+
function ss(e, t, n) {
|
|
1374
1374
|
if ((e.f & 8192) === 0) {
|
|
1375
1375
|
e.f ^= Ur;
|
|
1376
1376
|
var r = e.nodes && e.nodes.t;
|
|
@@ -1380,21 +1380,21 @@ function rs(e, t, n) {
|
|
|
1380
1380
|
var o = i.next;
|
|
1381
1381
|
if ((i.f & 64) === 0) {
|
|
1382
1382
|
var s = (i.f & 65536) !== 0 || (i.f & 32) !== 0 && (e.f & 16) !== 0;
|
|
1383
|
-
|
|
1383
|
+
ss(i, t, s ? n : !1);
|
|
1384
1384
|
}
|
|
1385
1385
|
i = o;
|
|
1386
1386
|
}
|
|
1387
1387
|
}
|
|
1388
1388
|
}
|
|
1389
1389
|
function Dn(e) {
|
|
1390
|
-
|
|
1390
|
+
as(e, !0);
|
|
1391
1391
|
}
|
|
1392
|
-
function
|
|
1392
|
+
function as(e, t) {
|
|
1393
1393
|
if ((e.f & 8192) !== 0) {
|
|
1394
1394
|
e.f ^= Ur, (e.f & 1024) === 0 && (H(e, he), yt.ensure().schedule(e));
|
|
1395
1395
|
for (var n = e.first; n !== null; ) {
|
|
1396
1396
|
var r = n.next, i = (n.f & 65536) !== 0 || (n.f & 32) !== 0;
|
|
1397
|
-
|
|
1397
|
+
as(n, i ? t : !1), n = r;
|
|
1398
1398
|
}
|
|
1399
1399
|
var o = e.nodes && e.nodes.t;
|
|
1400
1400
|
if (o !== null)
|
|
@@ -1408,7 +1408,7 @@ function li(e, t) {
|
|
|
1408
1408
|
t.append(n), n = i;
|
|
1409
1409
|
}
|
|
1410
1410
|
}
|
|
1411
|
-
var
|
|
1411
|
+
var Nl = null, wn = !1, Le = !1;
|
|
1412
1412
|
function Pi(e) {
|
|
1413
1413
|
Le = e;
|
|
1414
1414
|
}
|
|
@@ -1421,19 +1421,19 @@ function Ee(e) {
|
|
|
1421
1421
|
x = e;
|
|
1422
1422
|
}
|
|
1423
1423
|
var _e = null;
|
|
1424
|
-
function
|
|
1424
|
+
function ls(e) {
|
|
1425
1425
|
M !== null && (!Re || (M.f & 2) !== 0) && (_e ?? (_e = /* @__PURE__ */ new Set())).add(e);
|
|
1426
1426
|
}
|
|
1427
1427
|
var Q = null, ne = 0, oe = null;
|
|
1428
|
-
function
|
|
1428
|
+
function Wl(e) {
|
|
1429
1429
|
oe = e;
|
|
1430
1430
|
}
|
|
1431
|
-
var
|
|
1431
|
+
var cs = 1, nt = 0, ct = nt;
|
|
1432
1432
|
function Ni(e) {
|
|
1433
1433
|
ct = e;
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
1436
|
-
return ++
|
|
1435
|
+
function us() {
|
|
1436
|
+
return ++cs;
|
|
1437
1437
|
}
|
|
1438
1438
|
function on(e) {
|
|
1439
1439
|
var t = e.f;
|
|
@@ -1441,23 +1441,23 @@ function on(e) {
|
|
|
1441
1441
|
if (t & 2 && (e.f &= ~nn), (t & 4096) !== 0) {
|
|
1442
1442
|
for (var n = e.deps, r = n.length, i = 0; i < r; i++) {
|
|
1443
1443
|
var o = n[i];
|
|
1444
|
-
if (on(o) &&
|
|
1444
|
+
if (on(o) && Vo(o), o.wv > e.wv) return !0;
|
|
1445
1445
|
}
|
|
1446
1446
|
(t & 512) !== 0 && X === null && H(e, ce);
|
|
1447
1447
|
}
|
|
1448
1448
|
return !1;
|
|
1449
1449
|
}
|
|
1450
|
-
function
|
|
1450
|
+
function ds(e, t, n = !0) {
|
|
1451
1451
|
var r = e.reactions;
|
|
1452
1452
|
if (r !== null && !(!Re && _e !== null && _e.has(e)))
|
|
1453
1453
|
for (var i = 0; i < r.length; i++) {
|
|
1454
1454
|
var o = r[i];
|
|
1455
|
-
(o.f & 2) !== 0 ?
|
|
1455
|
+
(o.f & 2) !== 0 ? ds(o, t, !1) : t === o && (n ? H(o, he) : (o.f & 1024) !== 0 && H(o, bt), Qr(o));
|
|
1456
1456
|
}
|
|
1457
1457
|
}
|
|
1458
|
-
function
|
|
1458
|
+
function hs(e) {
|
|
1459
1459
|
var t = Q, n = ne, r = oe, i = M, o = _e, s = F, a = me, l = ct, c = e.f;
|
|
1460
|
-
Q = null, ne = 0, oe = null, M = (c & 96) === 0 ? e : null, _e = null, Mt(e.ctx), me = !1, ct = ++nt, e.ac !== null && (
|
|
1460
|
+
Q = null, ne = 0, oe = null, M = (c & 96) === 0 ? e : null, _e = null, Mt(e.ctx), me = !1, ct = ++nt, e.ac !== null && (ts(() => {
|
|
1461
1461
|
e.ac.abort(Gn);
|
|
1462
1462
|
}), e.ac = null);
|
|
1463
1463
|
try {
|
|
@@ -1475,7 +1475,7 @@ function cs(e) {
|
|
|
1475
1475
|
((b = h[v]).reactions ?? (b.reactions = [])).push(e);
|
|
1476
1476
|
}
|
|
1477
1477
|
} else !p && h !== null && ne < h.length && (tn(e, ne), h.length = ne);
|
|
1478
|
-
if (rn() && oe !== null && !me && h !== null && (e.f & 6146) === 0) for (v = 0; v < oe.length; v++)
|
|
1478
|
+
if (rn() && oe !== null && !me && h !== null && (e.f & 6146) === 0) for (v = 0; v < oe.length; v++) ds(oe[v], e);
|
|
1479
1479
|
if (i !== null && i !== e) {
|
|
1480
1480
|
if (nt++, i.deps !== null) for (let g = 0; g < n; g += 1) i.deps[g].rv = nt;
|
|
1481
1481
|
if (t !== null) for (const g of t) g.rv = nt;
|
|
@@ -1483,15 +1483,15 @@ function cs(e) {
|
|
|
1483
1483
|
}
|
|
1484
1484
|
return (e.f & 8388608) !== 0 && (e.f ^= In), d;
|
|
1485
1485
|
} catch (g) {
|
|
1486
|
-
return
|
|
1486
|
+
return Io(g);
|
|
1487
1487
|
} finally {
|
|
1488
1488
|
e.f ^= Ai, Q = t, ne = n, oe = r, M = i, _e = o, Mt(s), me = a, ct = l;
|
|
1489
1489
|
}
|
|
1490
1490
|
}
|
|
1491
|
-
function
|
|
1491
|
+
function zl(e, t) {
|
|
1492
1492
|
let n = t.reactions;
|
|
1493
1493
|
if (n !== null) {
|
|
1494
|
-
var r =
|
|
1494
|
+
var r = Aa.call(n, e);
|
|
1495
1495
|
if (r !== -1) {
|
|
1496
1496
|
var i = n.length - 1;
|
|
1497
1497
|
i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop());
|
|
@@ -1499,13 +1499,13 @@ function Ll(e, t) {
|
|
|
1499
1499
|
}
|
|
1500
1500
|
if (n === null && (t.f & 2) !== 0 && (Q === null || !Cn.call(Q, t))) {
|
|
1501
1501
|
var o = t;
|
|
1502
|
-
(o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~nn), o.v !== j && Yr(o),
|
|
1502
|
+
(o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~nn), o.v !== j && Yr(o), wl(o), tn(o, 0);
|
|
1503
1503
|
}
|
|
1504
1504
|
}
|
|
1505
1505
|
function tn(e, t) {
|
|
1506
1506
|
var n = e.deps;
|
|
1507
1507
|
if (n !== null)
|
|
1508
|
-
for (var r = t; r < n.length; r++)
|
|
1508
|
+
for (var r = t; r < n.length; r++) zl(e, n[r]);
|
|
1509
1509
|
}
|
|
1510
1510
|
function $t(e) {
|
|
1511
1511
|
var t = e.f;
|
|
@@ -1515,9 +1515,9 @@ function $t(e) {
|
|
|
1515
1515
|
if (x = e, wn = !0, 0)
|
|
1516
1516
|
var i, o;
|
|
1517
1517
|
try {
|
|
1518
|
-
(t & 16777232) !== 0 ?
|
|
1519
|
-
var s =
|
|
1520
|
-
if (e.teardown = typeof s == "function" ? s : null, e.wv =
|
|
1518
|
+
(t & 16777232) !== 0 ? Ll(e) : ai(e), is(e);
|
|
1519
|
+
var s = hs(e);
|
|
1520
|
+
if (e.teardown = typeof s == "function" ? s : null, e.wv = cs, 0)
|
|
1521
1521
|
for (var a of e.deps) ;
|
|
1522
1522
|
} finally {
|
|
1523
1523
|
wn = r, x = n;
|
|
@@ -1526,7 +1526,7 @@ function $t(e) {
|
|
|
1526
1526
|
}
|
|
1527
1527
|
function _(e) {
|
|
1528
1528
|
var t = (e.f & 2) !== 0;
|
|
1529
|
-
if (
|
|
1529
|
+
if (Nl?.add(e), M !== null && !me && !(x !== null && (x.f & 16384) !== 0) && (_e === null || !_e.has(e))) {
|
|
1530
1530
|
var n = M.deps;
|
|
1531
1531
|
if ((M.f & 2097152) !== 0)
|
|
1532
1532
|
e.rv < nt && (e.rv = nt, Q === null && n !== null && n[ne] === e ? ne++ : Q === null ? Q = [e] : Q.push(e));
|
|
@@ -1550,25 +1550,25 @@ function _(e) {
|
|
|
1550
1550
|
var l = e;
|
|
1551
1551
|
if (Le) {
|
|
1552
1552
|
var c = l.v;
|
|
1553
|
-
return ((l.f & 1024) === 0 && l.reactions !== null ||
|
|
1553
|
+
return ((l.f & 1024) === 0 && l.reactions !== null || ps(l)) && (c = ti(l)), lt.set(l, c), c;
|
|
1554
1554
|
}
|
|
1555
1555
|
var u = (l.f & 512) === 0 && !me && M !== null && (wn || (M.f & 512) !== 0), d = (l.f & Gr) === 0;
|
|
1556
|
-
on(l) && (u && (l.f |= 512),
|
|
1556
|
+
on(l) && (u && (l.f |= 512), Vo(l)), u && !d && (Uo(l), fs(l));
|
|
1557
1557
|
}
|
|
1558
1558
|
if (X?.has(e)) return X.get(e);
|
|
1559
1559
|
if ((e.f & 8388608) !== 0) throw e.v;
|
|
1560
1560
|
return e.v;
|
|
1561
1561
|
}
|
|
1562
|
-
function
|
|
1562
|
+
function fs(e) {
|
|
1563
1563
|
if (e.f |= 512, e.deps !== null)
|
|
1564
1564
|
for (const t of e.deps)
|
|
1565
|
-
(t.reactions ?? (t.reactions = [])).push(e), (t.f & 2) !== 0 && (t.f & 512) === 0 && (
|
|
1565
|
+
(t.reactions ?? (t.reactions = [])).push(e), (t.f & 2) !== 0 && (t.f & 512) === 0 && (Uo(t), fs(t));
|
|
1566
1566
|
}
|
|
1567
|
-
function
|
|
1567
|
+
function ps(e) {
|
|
1568
1568
|
if (e.v === j) return !0;
|
|
1569
1569
|
if (e.deps === null) return !1;
|
|
1570
1570
|
for (const t of e.deps)
|
|
1571
|
-
if (lt.has(t) || (t.f & 2) !== 0 &&
|
|
1571
|
+
if (lt.has(t) || (t.f & 2) !== 0 && ps(t)) return !0;
|
|
1572
1572
|
return !1;
|
|
1573
1573
|
}
|
|
1574
1574
|
function ci(e) {
|
|
@@ -1579,13 +1579,13 @@ function ci(e) {
|
|
|
1579
1579
|
me = t;
|
|
1580
1580
|
}
|
|
1581
1581
|
}
|
|
1582
|
-
var At = /* @__PURE__ */ Symbol("events"),
|
|
1582
|
+
var At = /* @__PURE__ */ Symbol("events"), gs = /* @__PURE__ */ new Set(), Mr = /* @__PURE__ */ new Set();
|
|
1583
1583
|
function Ht(e, t, n) {
|
|
1584
1584
|
(t[At] ?? (t[At] = {}))[e] = n;
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1587
|
-
for (var t = 0; t < e.length; t++)
|
|
1588
|
-
for (var n of
|
|
1586
|
+
function Hl(e) {
|
|
1587
|
+
for (var t = 0; t < e.length; t++) gs.add(e[t]);
|
|
1588
|
+
for (var n of Mr) n(e);
|
|
1589
1589
|
}
|
|
1590
1590
|
var Wi = null;
|
|
1591
1591
|
function zi(e) {
|
|
@@ -1633,13 +1633,13 @@ function zi(e) {
|
|
|
1633
1633
|
}
|
|
1634
1634
|
}
|
|
1635
1635
|
}
|
|
1636
|
-
var
|
|
1637
|
-
function
|
|
1638
|
-
return
|
|
1636
|
+
var Bl = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
|
|
1637
|
+
function Dl(e) {
|
|
1638
|
+
return Bl?.createHTML(e) ?? e;
|
|
1639
1639
|
}
|
|
1640
|
-
function
|
|
1640
|
+
function Fl(e) {
|
|
1641
1641
|
var t = ni("template");
|
|
1642
|
-
return t.innerHTML =
|
|
1642
|
+
return t.innerHTML = Dl(e.replaceAll("<!>", "<!---->")), t.content;
|
|
1643
1643
|
}
|
|
1644
1644
|
function kn(e, t) {
|
|
1645
1645
|
var n = x;
|
|
@@ -1654,10 +1654,10 @@ function kn(e, t) {
|
|
|
1654
1654
|
function Tt(e, t) {
|
|
1655
1655
|
var n = (t & 1) !== 0, r = (t & 2) !== 0, i, o = !e.startsWith("<!>");
|
|
1656
1656
|
return () => {
|
|
1657
|
-
if (
|
|
1657
|
+
if (P)
|
|
1658
1658
|
return kn(R, null), R;
|
|
1659
|
-
i === void 0 && (i =
|
|
1660
|
-
var s = r ||
|
|
1659
|
+
i === void 0 && (i = Fl(o ? e : "<!>" + e), n || (i = /* @__PURE__ */ gt(i)));
|
|
1660
|
+
var s = r || Xo ? document.importNode(i, !0) : i.cloneNode(!0);
|
|
1661
1661
|
if (n) {
|
|
1662
1662
|
var a = /* @__PURE__ */ gt(s), l = s.lastChild;
|
|
1663
1663
|
kn(a, l);
|
|
@@ -1666,14 +1666,14 @@ function Tt(e, t) {
|
|
|
1666
1666
|
};
|
|
1667
1667
|
}
|
|
1668
1668
|
function qe(e, t) {
|
|
1669
|
-
if (
|
|
1669
|
+
if (P) {
|
|
1670
1670
|
var n = x;
|
|
1671
1671
|
((n.f & 32768) === 0 || n.nodes.end === null) && (n.nodes.end = R), Yn();
|
|
1672
1672
|
return;
|
|
1673
1673
|
}
|
|
1674
1674
|
e !== null && e.before(t);
|
|
1675
1675
|
}
|
|
1676
|
-
var
|
|
1676
|
+
var jl = [
|
|
1677
1677
|
"allowfullscreen",
|
|
1678
1678
|
"async",
|
|
1679
1679
|
"autofocus",
|
|
@@ -1702,8 +1702,8 @@ var Hl = [
|
|
|
1702
1702
|
"defer",
|
|
1703
1703
|
"disablepictureinpicture",
|
|
1704
1704
|
"disableremoteplayback"
|
|
1705
|
-
],
|
|
1706
|
-
...
|
|
1705
|
+
], zh = [
|
|
1706
|
+
...jl,
|
|
1707
1707
|
"formNoValidate",
|
|
1708
1708
|
"isMap",
|
|
1709
1709
|
"noModule",
|
|
@@ -1718,17 +1718,17 @@ var Hl = [
|
|
|
1718
1718
|
"allowFullscreen",
|
|
1719
1719
|
"disablePictureInPicture",
|
|
1720
1720
|
"disableRemotePlayback"
|
|
1721
|
-
],
|
|
1722
|
-
function
|
|
1723
|
-
return
|
|
1721
|
+
], ql = ["touchstart", "touchmove"];
|
|
1722
|
+
function Vl(e) {
|
|
1723
|
+
return ql.includes(e);
|
|
1724
1724
|
}
|
|
1725
|
-
var
|
|
1725
|
+
var Ul = [
|
|
1726
1726
|
"$state",
|
|
1727
1727
|
"$state.raw",
|
|
1728
1728
|
"$derived",
|
|
1729
1729
|
"$derived.by"
|
|
1730
|
-
],
|
|
1731
|
-
...
|
|
1730
|
+
], Hh = [
|
|
1731
|
+
...Ul,
|
|
1732
1732
|
"$state.eager",
|
|
1733
1733
|
"$state.snapshot",
|
|
1734
1734
|
"$props",
|
|
@@ -1748,17 +1748,17 @@ function Bi(e, t) {
|
|
|
1748
1748
|
var n, r = t == null ? "" : typeof t == "object" ? `${t}` : t;
|
|
1749
1749
|
r !== ((n = e)[_n] ?? (n[_n] = e.nodeValue)) && (e[_n] = r, e.nodeValue = `${r}`);
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1752
|
-
return
|
|
1751
|
+
function vs(e, t) {
|
|
1752
|
+
return ms(e, t);
|
|
1753
1753
|
}
|
|
1754
|
-
function
|
|
1755
|
-
|
|
1756
|
-
const n = t.target, r =
|
|
1754
|
+
function Gl(e, t) {
|
|
1755
|
+
Cr(), t.intro = t.intro ?? !1;
|
|
1756
|
+
const n = t.target, r = P, i = R;
|
|
1757
1757
|
try {
|
|
1758
1758
|
for (var o = /* @__PURE__ */ gt(n); o && (o.nodeType !== 8 || o.data !== "["); ) o = /* @__PURE__ */ xe(o);
|
|
1759
1759
|
if (!o) throw Ct;
|
|
1760
1760
|
Ie(!0), Z(o);
|
|
1761
|
-
const s =
|
|
1761
|
+
const s = ms(e, {
|
|
1762
1762
|
...t,
|
|
1763
1763
|
anchor: o
|
|
1764
1764
|
});
|
|
@@ -1766,30 +1766,30 @@ function jl(e, t) {
|
|
|
1766
1766
|
} catch (s) {
|
|
1767
1767
|
if (s instanceof Error && s.message.split(`
|
|
1768
1768
|
`).some((a) => a.startsWith("https://svelte.dev/e/"))) throw s;
|
|
1769
|
-
return s !== Ct && console.warn("Failed to hydrate: ", s), t.recover === !1 &&
|
|
1769
|
+
return s !== Ct && console.warn("Failed to hydrate: ", s), t.recover === !1 && Ua(), Cr(), Zo(n), Ie(!1), vs(e, t);
|
|
1770
1770
|
} finally {
|
|
1771
1771
|
Ie(r), Z(i);
|
|
1772
1772
|
}
|
|
1773
1773
|
}
|
|
1774
1774
|
var bn = /* @__PURE__ */ new Map();
|
|
1775
|
-
function
|
|
1776
|
-
|
|
1777
|
-
var l = void 0, c =
|
|
1775
|
+
function ms(e, { target: t, anchor: n, props: r = {}, events: i, context: o, intro: s = !0, transformError: a }) {
|
|
1776
|
+
Cr();
|
|
1777
|
+
var l = void 0, c = $l(() => {
|
|
1778
1778
|
var u = n ?? t.appendChild(ye());
|
|
1779
|
-
|
|
1779
|
+
pl(u, { pending: () => {
|
|
1780
1780
|
} }, (p) => {
|
|
1781
|
-
|
|
1781
|
+
Co({});
|
|
1782
1782
|
var v = F;
|
|
1783
|
-
if (o && (v.c = o), i && (r.$$events = i),
|
|
1783
|
+
if (o && (v.c = o), i && (r.$$events = i), P && kn(p, null), Hi = s, l = e(p, r) || {}, Hi = !0, P && (x.nodes.end = R, R === null || R.nodeType !== 8 || R.data !== "]"))
|
|
1784
1784
|
throw Kn(), Ct;
|
|
1785
|
-
|
|
1785
|
+
Mo();
|
|
1786
1786
|
}, a);
|
|
1787
1787
|
var d = /* @__PURE__ */ new Set(), h = (p) => {
|
|
1788
1788
|
for (var v = 0; v < p.length; v++) {
|
|
1789
1789
|
var b = p[v];
|
|
1790
1790
|
if (!d.has(b)) {
|
|
1791
1791
|
d.add(b);
|
|
1792
|
-
var g =
|
|
1792
|
+
var g = Vl(b);
|
|
1793
1793
|
for (const N of [t, document]) {
|
|
1794
1794
|
var y = bn.get(N);
|
|
1795
1795
|
y === void 0 && (y = /* @__PURE__ */ new Map(), bn.set(N, y));
|
|
@@ -1799,22 +1799,22 @@ function ps(e, { target: t, anchor: n, props: r = {}, events: i, context: o, int
|
|
|
1799
1799
|
}
|
|
1800
1800
|
}
|
|
1801
1801
|
};
|
|
1802
|
-
return h(Un(
|
|
1802
|
+
return h(Un(gs)), Mr.add(h), () => {
|
|
1803
1803
|
for (var p of d) for (const g of [t, document]) {
|
|
1804
1804
|
var v = bn.get(g), b = v.get(p);
|
|
1805
1805
|
--b == 0 ? (g.removeEventListener(p, zi), v.delete(p), v.size === 0 && bn.delete(g)) : v.set(p, b);
|
|
1806
1806
|
}
|
|
1807
|
-
|
|
1807
|
+
Mr.delete(h), u !== n && u.parentNode?.removeChild(u);
|
|
1808
1808
|
};
|
|
1809
1809
|
});
|
|
1810
|
-
return
|
|
1810
|
+
return Or.set(l, c), l;
|
|
1811
1811
|
}
|
|
1812
|
-
var
|
|
1813
|
-
function
|
|
1814
|
-
const n =
|
|
1815
|
-
return n ? (
|
|
1812
|
+
var Or = /* @__PURE__ */ new WeakMap();
|
|
1813
|
+
function Kl(e, t) {
|
|
1814
|
+
const n = Or.get(e);
|
|
1815
|
+
return n ? (Or.delete(e), n(t)) : Promise.resolve();
|
|
1816
1816
|
}
|
|
1817
|
-
var Oe = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), Bt = /* @__PURE__ */ new WeakMap(), ar = /* @__PURE__ */ new WeakMap(), lr = /* @__PURE__ */ new WeakMap(), Di = /* @__PURE__ */ new WeakMap(),
|
|
1817
|
+
var Oe = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), Bt = /* @__PURE__ */ new WeakMap(), ar = /* @__PURE__ */ new WeakMap(), lr = /* @__PURE__ */ new WeakMap(), Di = /* @__PURE__ */ new WeakMap(), Yl = class {
|
|
1818
1818
|
constructor(e, t = !0) {
|
|
1819
1819
|
m(this, "anchor", void 0), E(this, Oe, /* @__PURE__ */ new Map()), E(this, Be, /* @__PURE__ */ new Map()), E(this, ge, /* @__PURE__ */ new Map()), E(this, Bt, /* @__PURE__ */ new Set()), E(this, ar, !0), E(this, lr, (n) => {
|
|
1820
1820
|
if (f(Oe, this).has(n)) {
|
|
@@ -1852,7 +1852,7 @@ var Oe = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), ge =
|
|
|
1852
1852
|
}), this.anchor = e, w(ar, this, t);
|
|
1853
1853
|
}
|
|
1854
1854
|
ensure(e, t) {
|
|
1855
|
-
var n = C, r =
|
|
1855
|
+
var n = C, r = es();
|
|
1856
1856
|
if (t && !f(Be, this).has(e) && !f(ge, this).has(e)) if (r) {
|
|
1857
1857
|
var i = document.createDocumentFragment(), o = ye();
|
|
1858
1858
|
i.append(o), f(ge, this).set(e, {
|
|
@@ -1865,16 +1865,16 @@ var Oe = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), ge =
|
|
|
1865
1865
|
for (const [s, a] of f(ge, this)) s === e ? n.unskip_effect(a.effect) : n.skip_effect(a.effect);
|
|
1866
1866
|
n.oncommit(f(lr, this)), n.ondiscard(f(Di, this));
|
|
1867
1867
|
} else
|
|
1868
|
-
|
|
1868
|
+
P && (this.anchor = R), f(lr, this).call(this, n);
|
|
1869
1869
|
}
|
|
1870
1870
|
};
|
|
1871
1871
|
function Dt(e, t, n = !1) {
|
|
1872
1872
|
var r;
|
|
1873
|
-
|
|
1874
|
-
var i = new
|
|
1873
|
+
P && (r = R, Yn());
|
|
1874
|
+
var i = new Yl(e), o = n ? Kr : 0;
|
|
1875
1875
|
function s(a, l) {
|
|
1876
|
-
if (
|
|
1877
|
-
var c =
|
|
1876
|
+
if (P) {
|
|
1877
|
+
var c = Eo(r);
|
|
1878
1878
|
if (a !== parseInt(c.substring(1))) {
|
|
1879
1879
|
var u = $n();
|
|
1880
1880
|
Z(u), i.anchor = u, Ie(!1), i.ensure(a, l), Ie(!0);
|
|
@@ -1890,17 +1890,17 @@ function Dt(e, t, n = !1) {
|
|
|
1890
1890
|
}), a || s(-1, null);
|
|
1891
1891
|
}, o);
|
|
1892
1892
|
}
|
|
1893
|
-
function
|
|
1893
|
+
function Xl(e, t) {
|
|
1894
1894
|
return t;
|
|
1895
1895
|
}
|
|
1896
|
-
function
|
|
1896
|
+
function Jl(e, t, n) {
|
|
1897
1897
|
for (var r = [], i = t.length, o, s = t.length, a = 0; a < i; a++) {
|
|
1898
1898
|
let d = t[a];
|
|
1899
1899
|
_t(d, () => {
|
|
1900
1900
|
if (o) {
|
|
1901
1901
|
if (o.pending.delete(d), o.done.add(d), o.pending.size === 0) {
|
|
1902
1902
|
var h = e.outrogroups;
|
|
1903
|
-
|
|
1903
|
+
Ir(e, Un(o.done)), h.delete(o), h.size === 0 && (e.outrogroups = null);
|
|
1904
1904
|
}
|
|
1905
1905
|
} else s -= 1;
|
|
1906
1906
|
}, !1);
|
|
@@ -1909,16 +1909,16 @@ function Gl(e, t, n) {
|
|
|
1909
1909
|
var l = r.length === 0 && n !== null;
|
|
1910
1910
|
if (l) {
|
|
1911
1911
|
var c = n, u = c.parentNode;
|
|
1912
|
-
|
|
1912
|
+
Zo(u), u.append(c), e.items.clear();
|
|
1913
1913
|
}
|
|
1914
|
-
|
|
1914
|
+
Ir(e, t, !l);
|
|
1915
1915
|
} else
|
|
1916
1916
|
o = {
|
|
1917
1917
|
pending: new Set(t),
|
|
1918
1918
|
done: /* @__PURE__ */ new Set()
|
|
1919
1919
|
}, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(o);
|
|
1920
1920
|
}
|
|
1921
|
-
function
|
|
1921
|
+
function Ir(e, t, n = !0) {
|
|
1922
1922
|
var r;
|
|
1923
1923
|
if (e.pending.size > 0) {
|
|
1924
1924
|
r = /* @__PURE__ */ new Set();
|
|
@@ -1930,19 +1930,19 @@ function $r(e, t, n = !0) {
|
|
|
1930
1930
|
}
|
|
1931
1931
|
}
|
|
1932
1932
|
var yn;
|
|
1933
|
-
function
|
|
1933
|
+
function Ql(e, t, n, r, i, o = null) {
|
|
1934
1934
|
var s = e, a = /* @__PURE__ */ new Map();
|
|
1935
1935
|
if ((t & 4) !== 0) {
|
|
1936
1936
|
var l = e;
|
|
1937
|
-
s =
|
|
1937
|
+
s = P ? Z(/* @__PURE__ */ gt(l)) : l.appendChild(ye());
|
|
1938
1938
|
}
|
|
1939
|
-
|
|
1939
|
+
P && Yn();
|
|
1940
1940
|
var c = null, u = /* @__PURE__ */ ei(() => {
|
|
1941
1941
|
var y = n();
|
|
1942
|
-
return
|
|
1942
|
+
return To(y) ? y : y == null ? [] : Un(y);
|
|
1943
1943
|
}), d, h = /* @__PURE__ */ new Map(), p = !0;
|
|
1944
1944
|
function v(y) {
|
|
1945
|
-
(g.effect.f & 16384) === 0 && (g.pending.delete(y), g.fallback = c,
|
|
1945
|
+
(g.effect.f & 16384) === 0 && (g.pending.delete(y), g.fallback = c, Zl(g, d, s, t, r), c !== null && (d.length === 0 ? (c.f & 33554432) === 0 ? Dn(c) : (c.f ^= Yt, Gt(c, null, s)) : _t(c, () => {
|
|
1946
1946
|
c = null;
|
|
1947
1947
|
})));
|
|
1948
1948
|
}
|
|
@@ -1954,16 +1954,16 @@ function Kl(e, t, n, r, i, o = null) {
|
|
|
1954
1954
|
d = _(u);
|
|
1955
1955
|
var y = d.length;
|
|
1956
1956
|
let O = !1;
|
|
1957
|
-
|
|
1958
|
-
for (var N = /* @__PURE__ */ new Set(), S = C, z =
|
|
1959
|
-
|
|
1957
|
+
P && Eo(s) === "[!" != (y === 0) && (s = $n(), Z(s), Ie(!1), O = !0);
|
|
1958
|
+
for (var N = /* @__PURE__ */ new Set(), S = C, z = es(), W = 0; W < y; W += 1) {
|
|
1959
|
+
P && R.nodeType === 8 && R.data === "]" && (s = R, O = !0, Ie(!1));
|
|
1960
1960
|
var U = d[W], ee = r(U, W);
|
|
1961
1961
|
if (0)
|
|
1962
1962
|
var Ge;
|
|
1963
1963
|
var q = p ? null : a.get(ee);
|
|
1964
|
-
q ? (q.v && It(q.v, U), q.i && It(q.i, W), z && S.unskip_effect(q.e)) : (q =
|
|
1964
|
+
q ? (q.v && It(q.v, U), q.i && It(q.i, W), z && S.unskip_effect(q.e)) : (q = ec(a, p ? s : yn ?? (yn = ye()), U, ee, W, i, t, n), p || (q.e.f |= Yt), a.set(ee, q)), N.add(ee);
|
|
1965
1965
|
}
|
|
1966
|
-
if (y === 0 && o && !c && (p ? c = ue(() => o(s)) : (c = ue(() => o(yn ?? (yn = ye()))), c.f |= Yt)), y > N.size &&
|
|
1966
|
+
if (y === 0 && o && !c && (p ? c = ue(() => o(s)) : (c = ue(() => o(yn ?? (yn = ye()))), c.f |= Yt)), y > N.size && Da("", "", ""), P && y > 0 && Z($n()), !p)
|
|
1967
1967
|
if (h.set(S, N), z) {
|
|
1968
1968
|
for (const [an, nr] of a) N.has(an) || S.skip_effect(nr.e);
|
|
1969
1969
|
S.oncommit(v), S.ondiscard(b);
|
|
@@ -1976,13 +1976,13 @@ function Kl(e, t, n, r, i, o = null) {
|
|
|
1976
1976
|
outrogroups: null,
|
|
1977
1977
|
fallback: c
|
|
1978
1978
|
};
|
|
1979
|
-
p = !1,
|
|
1979
|
+
p = !1, P && (s = R);
|
|
1980
1980
|
}
|
|
1981
1981
|
function Ft(e) {
|
|
1982
1982
|
for (; e !== null && (e.f & 32) === 0; ) e = e.next;
|
|
1983
1983
|
return e;
|
|
1984
1984
|
}
|
|
1985
|
-
function
|
|
1985
|
+
function Zl(e, t, n, r, i) {
|
|
1986
1986
|
var o = (r & 8) !== 0, s = t.length, a = e.items, l = Ft(e.effect.first), c, u = null, d, h = [], p = [], v, b, g, y;
|
|
1987
1987
|
if (o) for (y = 0; y < s; y += 1)
|
|
1988
1988
|
v = t[y], b = i(v, y), g = a.get(b).e, (g.f & 33554432) === 0 && (g.nodes?.a?.measure(), (d ?? (d = /* @__PURE__ */ new Set())).add(g));
|
|
@@ -2016,7 +2016,7 @@ function Yl(e, t, n, r, i) {
|
|
|
2016
2016
|
(g.f & 33554432) === 0 && h.push(g), u = g, l = Ft(g.next);
|
|
2017
2017
|
}
|
|
2018
2018
|
if (e.outrogroups !== null) {
|
|
2019
|
-
for (const q of e.outrogroups) q.pending.size === 0 && (
|
|
2019
|
+
for (const q of e.outrogroups) q.pending.size === 0 && (Ir(e, Un(q.done)), e.outrogroups?.delete(q));
|
|
2020
2020
|
e.outrogroups.size === 0 && (e.outrogroups = null);
|
|
2021
2021
|
}
|
|
2022
2022
|
if (l !== null || c !== void 0) {
|
|
@@ -2032,7 +2032,7 @@ function Yl(e, t, n, r, i) {
|
|
|
2032
2032
|
for (y = 0; y < ee; y += 1) U[y].nodes?.a?.measure();
|
|
2033
2033
|
for (y = 0; y < ee; y += 1) U[y].nodes?.a?.fix();
|
|
2034
2034
|
}
|
|
2035
|
-
|
|
2035
|
+
Jl(e, U, Ge);
|
|
2036
2036
|
}
|
|
2037
2037
|
}
|
|
2038
2038
|
o && ht(() => {
|
|
@@ -2040,8 +2040,8 @@ function Yl(e, t, n, r, i) {
|
|
|
2040
2040
|
for (g of d) g.nodes?.a?.apply();
|
|
2041
2041
|
});
|
|
2042
2042
|
}
|
|
2043
|
-
function
|
|
2044
|
-
var l = (s & 1) !== 0 ? (s & 16) === 0 ? /* @__PURE__ */
|
|
2043
|
+
function ec(e, t, n, r, i, o, s, a) {
|
|
2044
|
+
var l = (s & 1) !== 0 ? (s & 16) === 0 ? /* @__PURE__ */ Ko(n, !1, !1) : pt(n) : null, c = (s & 2) !== 0 ? pt(i) : null;
|
|
2045
2045
|
return {
|
|
2046
2046
|
v: l,
|
|
2047
2047
|
i: c,
|
|
@@ -2061,8 +2061,8 @@ function Gt(e, t, n) {
|
|
|
2061
2061
|
function De(e, t, n) {
|
|
2062
2062
|
t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t;
|
|
2063
2063
|
}
|
|
2064
|
-
function
|
|
2065
|
-
|
|
2064
|
+
function tc(e, t) {
|
|
2065
|
+
rs(() => {
|
|
2066
2066
|
var n = e.getRootNode(), r = n.host ? n : n.head ?? n.ownerDocument.head;
|
|
2067
2067
|
if (!r.querySelector("#" + t.hash)) {
|
|
2068
2068
|
const i = ni("style");
|
|
@@ -2081,7 +2081,7 @@ function Fi(e, t = !1) {
|
|
|
2081
2081
|
function cr(e) {
|
|
2082
2082
|
return e[0] !== "-" || e[1] !== "-" ? e.toLowerCase() : e;
|
|
2083
2083
|
}
|
|
2084
|
-
function
|
|
2084
|
+
function nc(e, t) {
|
|
2085
2085
|
if (t) {
|
|
2086
2086
|
var n = "", r, i;
|
|
2087
2087
|
if (Array.isArray(t) ? (r = t[0], i = t[1]) : r = t, e) {
|
|
@@ -2119,69 +2119,69 @@ function ur(e, t = {}, n, r) {
|
|
|
2119
2119
|
}
|
|
2120
2120
|
}
|
|
2121
2121
|
function ji(e, t, n, r) {
|
|
2122
|
-
var i = e[
|
|
2123
|
-
if (
|
|
2124
|
-
var o =
|
|
2125
|
-
(!
|
|
2122
|
+
var i = e[_r];
|
|
2123
|
+
if (P || i !== t) {
|
|
2124
|
+
var o = nc(t, r);
|
|
2125
|
+
(!P || o !== e.getAttribute("style")) && (o == null ? e.removeAttribute("style") : e.style.cssText = o), e[_r] = t;
|
|
2126
2126
|
} else r && (Array.isArray(r) ? (ur(e, n?.[0], r[0]), ur(e, n?.[1], r[1], "important")) : ur(e, n, r));
|
|
2127
2127
|
return r;
|
|
2128
2128
|
}
|
|
2129
|
-
var
|
|
2129
|
+
var rc = /* @__PURE__ */ Symbol("is custom element"), ic = /* @__PURE__ */ Symbol("is html"), oc = Ha ? "link" : "LINK";
|
|
2130
2130
|
function qi(e, t, n, r) {
|
|
2131
|
-
var i =
|
|
2132
|
-
if (
|
|
2131
|
+
var i = sc(e);
|
|
2132
|
+
if (P && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === oc)) {
|
|
2133
2133
|
r || void 0;
|
|
2134
2134
|
return;
|
|
2135
2135
|
}
|
|
2136
|
-
i[t] !== (i[t] = n) && (t === "loading" && (e[
|
|
2136
|
+
i[t] !== (i[t] = n) && (t === "loading" && (e[Na] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && ac(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
|
|
2137
2137
|
}
|
|
2138
|
-
function
|
|
2138
|
+
function sc(e) {
|
|
2139
2139
|
var t;
|
|
2140
|
-
return (t = e)[
|
|
2141
|
-
[
|
|
2142
|
-
[
|
|
2140
|
+
return (t = e)[yr] ?? (t[yr] = {
|
|
2141
|
+
[rc]: e.nodeName.includes("-"),
|
|
2142
|
+
[ic]: e.namespaceURI === "http://www.w3.org/1999/xhtml"
|
|
2143
2143
|
});
|
|
2144
2144
|
}
|
|
2145
2145
|
var Vi = /* @__PURE__ */ new Map();
|
|
2146
|
-
function
|
|
2146
|
+
function ac(e) {
|
|
2147
2147
|
var t = e.getAttribute("is") || e.nodeName, n = Vi.get(t);
|
|
2148
2148
|
if (n) return n;
|
|
2149
2149
|
Vi.set(t, n = []);
|
|
2150
2150
|
for (var r, i = e, o = Element.prototype; o !== i; ) {
|
|
2151
|
-
r =
|
|
2151
|
+
r = Ca(i);
|
|
2152
2152
|
for (var s in r) r[s].set && s !== "innerHTML" && s !== "textContent" && s !== "innerText" && n.push(s);
|
|
2153
|
-
i =
|
|
2153
|
+
i = So(i);
|
|
2154
2154
|
}
|
|
2155
2155
|
return n;
|
|
2156
2156
|
}
|
|
2157
|
-
var
|
|
2157
|
+
var bs, xt = /* @__PURE__ */ new WeakMap(), Fn = /* @__PURE__ */ new WeakMap(), dr = /* @__PURE__ */ new WeakMap(), Ui = /* @__PURE__ */ new WeakSet(), ys = class {
|
|
2158
2158
|
constructor(e) {
|
|
2159
2159
|
Xr(this, Ui), E(this, xt, /* @__PURE__ */ new WeakMap()), E(this, Fn, void 0), E(this, dr, void 0), w(dr, this, e);
|
|
2160
2160
|
}
|
|
2161
2161
|
observe(e, t) {
|
|
2162
2162
|
var n = f(xt, this).get(e) || /* @__PURE__ */ new Set();
|
|
2163
|
-
return n.add(t), f(xt, this).set(e, n), A(Ui, this,
|
|
2163
|
+
return n.add(t), f(xt, this).set(e, n), A(Ui, this, lc).call(this).observe(e, f(dr, this)), () => {
|
|
2164
2164
|
var r = f(xt, this).get(e);
|
|
2165
2165
|
r.delete(t), r.size === 0 && (f(xt, this).delete(e), f(Fn, this).unobserve(e));
|
|
2166
2166
|
};
|
|
2167
2167
|
}
|
|
2168
2168
|
};
|
|
2169
|
-
|
|
2170
|
-
function
|
|
2169
|
+
bs = ys;
|
|
2170
|
+
function lc() {
|
|
2171
2171
|
return f(Fn, this) ?? w(Fn, this, new ResizeObserver((e) => {
|
|
2172
2172
|
for (var t of e) {
|
|
2173
|
-
|
|
2173
|
+
bs.entries.set(t.target, t);
|
|
2174
2174
|
for (var n of f(xt, this).get(t.target) || []) n(t);
|
|
2175
2175
|
}
|
|
2176
2176
|
}));
|
|
2177
2177
|
}
|
|
2178
|
-
m(
|
|
2178
|
+
m(ys, "entries", /* @__PURE__ */ new WeakMap());
|
|
2179
2179
|
function hr(e, t) {
|
|
2180
2180
|
return e === t || e?.[Xt] === t;
|
|
2181
2181
|
}
|
|
2182
2182
|
function Gi(e = {}, t, n, r) {
|
|
2183
2183
|
var i = F.r, o = x;
|
|
2184
|
-
return
|
|
2184
|
+
return rs(() => {
|
|
2185
2185
|
var s, a;
|
|
2186
2186
|
return oi(() => {
|
|
2187
2187
|
s = a, a = r?.() || [], ci(() => {
|
|
@@ -2203,11 +2203,11 @@ function fr(e, t, n, r) {
|
|
|
2203
2203
|
var i = !Xn || (n & 2) !== 0, o = (n & 8) !== 0, s = (n & 16) !== 0, a = r, l = !0, c = void 0, u = () => s && i ? (c ?? (c = /* @__PURE__ */ en(r)), _(c)) : (l && (l = !1, a = s ? ci(r) : r), a);
|
|
2204
2204
|
let d;
|
|
2205
2205
|
if (o) {
|
|
2206
|
-
var h = Xt in e ||
|
|
2206
|
+
var h = Xt in e || ko in e;
|
|
2207
2207
|
d = it(e, t)?.set ?? (h && t in e ? (S) => e[t] = S : void 0);
|
|
2208
2208
|
}
|
|
2209
2209
|
var p, v = !1;
|
|
2210
|
-
o ? [p, v] =
|
|
2210
|
+
o ? [p, v] = sl(() => e[t]) : p = e[t], p === void 0 && r !== void 0 && (p = u(), d && (i && Ga(t), d(p)));
|
|
2211
2211
|
var b;
|
|
2212
2212
|
if (i ? b = () => {
|
|
2213
2213
|
var S = e[t];
|
|
@@ -2233,14 +2233,14 @@ function fr(e, t, n, r) {
|
|
|
2233
2233
|
return Le && y || (N.f & 16384) !== 0 ? O.v : _(O);
|
|
2234
2234
|
});
|
|
2235
2235
|
}
|
|
2236
|
-
function
|
|
2237
|
-
return new
|
|
2236
|
+
function cc(e) {
|
|
2237
|
+
return new uc(e);
|
|
2238
2238
|
}
|
|
2239
|
-
var Je = /* @__PURE__ */ new WeakMap(), Te = /* @__PURE__ */ new WeakMap(),
|
|
2239
|
+
var Je = /* @__PURE__ */ new WeakMap(), Te = /* @__PURE__ */ new WeakMap(), uc = class {
|
|
2240
2240
|
constructor(e) {
|
|
2241
2241
|
E(this, Je, void 0), E(this, Te, void 0);
|
|
2242
2242
|
var t = /* @__PURE__ */ new Map(), n = (i, o) => {
|
|
2243
|
-
var s = /* @__PURE__ */
|
|
2243
|
+
var s = /* @__PURE__ */ Ko(o, !1, !1);
|
|
2244
2244
|
return t.set(i, s), s;
|
|
2245
2245
|
};
|
|
2246
2246
|
const r = new Proxy({
|
|
@@ -2251,13 +2251,13 @@ var Je = /* @__PURE__ */ new WeakMap(), Te = /* @__PURE__ */ new WeakMap(), sc =
|
|
|
2251
2251
|
return _(t.get(o) ?? n(o, Reflect.get(i, o)));
|
|
2252
2252
|
},
|
|
2253
2253
|
has(i, o) {
|
|
2254
|
-
return o ===
|
|
2254
|
+
return o === ko ? !0 : (_(t.get(o) ?? n(o, Reflect.get(i, o))), Reflect.has(i, o));
|
|
2255
2255
|
},
|
|
2256
2256
|
set(i, o, s) {
|
|
2257
2257
|
return I(t.get(o) ?? n(o, s), s), Reflect.set(i, o, s);
|
|
2258
2258
|
}
|
|
2259
2259
|
});
|
|
2260
|
-
w(Te, this, (e.hydrate ?
|
|
2260
|
+
w(Te, this, (e.hydrate ? Gl : vs)(e.component, {
|
|
2261
2261
|
target: e.target,
|
|
2262
2262
|
anchor: e.anchor,
|
|
2263
2263
|
props: r,
|
|
@@ -2279,7 +2279,7 @@ var Je = /* @__PURE__ */ new WeakMap(), Te = /* @__PURE__ */ new WeakMap(), sc =
|
|
|
2279
2279
|
f(Te, this).$set = (i) => {
|
|
2280
2280
|
Object.assign(r, i);
|
|
2281
2281
|
}, f(Te, this).$destroy = () => {
|
|
2282
|
-
|
|
2282
|
+
Kl(f(Te, this));
|
|
2283
2283
|
};
|
|
2284
2284
|
}
|
|
2285
2285
|
$set(e) {
|
|
@@ -2295,8 +2295,8 @@ var Je = /* @__PURE__ */ new WeakMap(), Te = /* @__PURE__ */ new WeakMap(), sc =
|
|
|
2295
2295
|
$destroy() {
|
|
2296
2296
|
f(Te, this).$destroy();
|
|
2297
2297
|
}
|
|
2298
|
-
},
|
|
2299
|
-
typeof HTMLElement == "function" && (
|
|
2298
|
+
}, _s;
|
|
2299
|
+
typeof HTMLElement == "function" && (_s = class extends HTMLElement {
|
|
2300
2300
|
constructor(e, t, n) {
|
|
2301
2301
|
super(), m(this, "$$ctor", void 0), m(this, "$$s", void 0), m(this, "$$c", void 0), m(this, "$$cn", !1), m(this, "$$d", {}), m(this, "$$r", !1), m(this, "$$p_d", {}), m(this, "$$l", {}), m(this, "$$l_u", /* @__PURE__ */ new Map()), m(this, "$$me", void 0), m(this, "$$shadowRoot", null), this.$$ctor = e, this.$$s = t, n && (this.$$shadowRoot = this.attachShadow(n));
|
|
2302
2302
|
}
|
|
@@ -2322,14 +2322,14 @@ typeof HTMLElement == "function" && (ms = class extends HTMLElement {
|
|
|
2322
2322
|
};
|
|
2323
2323
|
};
|
|
2324
2324
|
if (await Promise.resolve(), !this.$$cn || this.$$c) return;
|
|
2325
|
-
const t = {}, n =
|
|
2325
|
+
const t = {}, n = dc(this);
|
|
2326
2326
|
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));
|
|
2327
2327
|
for (const r of this.attributes) {
|
|
2328
2328
|
const i = this.$$g_p(r.name);
|
|
2329
2329
|
i in this.$$d || (this.$$d[i] = En(i, r.value, this.$$p_d, "toProp"));
|
|
2330
2330
|
}
|
|
2331
2331
|
for (const r in this.$$p_d) !(r in this.$$d) && this[r] !== void 0 && (this.$$d[r] = this[r], delete this[r]);
|
|
2332
|
-
this.$$c =
|
|
2332
|
+
this.$$c = cc({
|
|
2333
2333
|
component: this.$$ctor,
|
|
2334
2334
|
target: this.$$shadowRoot || this,
|
|
2335
2335
|
props: {
|
|
@@ -2337,7 +2337,7 @@ typeof HTMLElement == "function" && (ms = class extends HTMLElement {
|
|
|
2337
2337
|
$$slots: t,
|
|
2338
2338
|
$$host: this
|
|
2339
2339
|
}
|
|
2340
|
-
}), this.$$me =
|
|
2340
|
+
}), this.$$me = Il(() => {
|
|
2341
2341
|
oi(() => {
|
|
2342
2342
|
this.$$r = !0;
|
|
2343
2343
|
for (const r of Mn(this.$$c)) {
|
|
@@ -2394,14 +2394,14 @@ function En(e, t, n, r) {
|
|
|
2394
2394
|
return t;
|
|
2395
2395
|
}
|
|
2396
2396
|
}
|
|
2397
|
-
function
|
|
2397
|
+
function dc(e) {
|
|
2398
2398
|
const t = {};
|
|
2399
2399
|
return e.childNodes.forEach((n) => {
|
|
2400
2400
|
t[n.slot || "default"] = !0;
|
|
2401
2401
|
}), t;
|
|
2402
2402
|
}
|
|
2403
|
-
function
|
|
2404
|
-
let s = class extends
|
|
2403
|
+
function hc(e, t, n, r, i, o) {
|
|
2404
|
+
let s = class extends _s {
|
|
2405
2405
|
constructor() {
|
|
2406
2406
|
super(e, n, i), this.$$p_d = t;
|
|
2407
2407
|
}
|
|
@@ -2426,14 +2426,14 @@ function lc(e, t, n, r, i, o) {
|
|
|
2426
2426
|
} });
|
|
2427
2427
|
}), o && (s = o(s)), e.element = s, s;
|
|
2428
2428
|
}
|
|
2429
|
-
var
|
|
2429
|
+
var fc = class extends Event {
|
|
2430
2430
|
constructor(e, t, n, r) {
|
|
2431
2431
|
super("context-request", {
|
|
2432
2432
|
bubbles: !0,
|
|
2433
2433
|
composed: !0
|
|
2434
2434
|
}), m(this, "context", void 0), m(this, "contextTarget", void 0), m(this, "callback", void 0), m(this, "subscribe", void 0), this.context = e, this.contextTarget = t, this.callback = n, this.subscribe = r ?? !1;
|
|
2435
2435
|
}
|
|
2436
|
-
},
|
|
2436
|
+
}, pc = class {
|
|
2437
2437
|
constructor(e, t) {
|
|
2438
2438
|
m(this, "host", void 0), m(this, "context", void 0), m(this, "subscribe", void 0), m(this, "onValue", void 0), m(this, "isConnected", !1), m(this, "unsubscribe", void 0), m(this, "currentValue", void 0), m(this, "handleValue", (n, r) => {
|
|
2439
2439
|
r !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = r), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = n, this.onValue?.(n);
|
|
@@ -2449,12 +2449,12 @@ var cc = class extends Event {
|
|
|
2449
2449
|
return this.currentValue;
|
|
2450
2450
|
}
|
|
2451
2451
|
requestValue() {
|
|
2452
|
-
this.host.dispatchEvent(new
|
|
2452
|
+
this.host.dispatchEvent(new fc(this.context, this.host, this.handleValue, this.subscribe));
|
|
2453
2453
|
}
|
|
2454
|
-
}, Jn = (e) => e,
|
|
2455
|
-
function
|
|
2454
|
+
}, Jn = (e) => e, Bh = Jn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), Dh = Jn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), gc = Jn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), vc = Jn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
|
|
2455
|
+
function Ts(e, t, n) {
|
|
2456
2456
|
let r = !1;
|
|
2457
|
-
const i = new
|
|
2457
|
+
const i = new pc(e, {
|
|
2458
2458
|
context: t,
|
|
2459
2459
|
subscribe: !0,
|
|
2460
2460
|
onValue: (c) => {
|
|
@@ -2478,13 +2478,13 @@ function bs(e, t, n) {
|
|
|
2478
2478
|
globalThis.clearInterval(l), e.removeEventListener("context-provider", o), i.disconnect();
|
|
2479
2479
|
};
|
|
2480
2480
|
}
|
|
2481
|
-
function
|
|
2482
|
-
return
|
|
2481
|
+
function mc(e, t) {
|
|
2482
|
+
return Ts(e, gc, t);
|
|
2483
2483
|
}
|
|
2484
|
-
function
|
|
2485
|
-
return
|
|
2484
|
+
function bc(e, t) {
|
|
2485
|
+
return Ts(e, vc, t);
|
|
2486
2486
|
}
|
|
2487
|
-
var
|
|
2487
|
+
var yc = class {
|
|
2488
2488
|
serialize(e, t) {
|
|
2489
2489
|
return {
|
|
2490
2490
|
startContainer: this.getNodePath(e.startContainer, t),
|
|
@@ -2557,9 +2557,9 @@ var le;
|
|
|
2557
2557
|
(function(e) {
|
|
2558
2558
|
e.YELLOW = "yellow", e.GREEN = "green", e.BLUE = "blue", e.PINK = "pink", e.ORANGE = "orange", e.UNDERLINE = "underline";
|
|
2559
2559
|
})(le || (le = {}));
|
|
2560
|
-
var
|
|
2560
|
+
var Ss = class $r {
|
|
2561
2561
|
constructor(t = {}) {
|
|
2562
|
-
if (m(this, "config", void 0), m(this, "ttsWordHighlight", null), m(this, "ttsSentenceHighlight", null), m(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), m(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), m(this, "annotations", /* @__PURE__ */ new Map()), m(this, "colorHighlights", /* @__PURE__ */ new Map()), m(this, "nextAnnotationId", 1), m(this, "supported", !1), m(this, "rangeSerializer", void 0), m(this, "themeObserver", null), m(this, "explicitTTSColorOverride", null), this.config = t, this.rangeSerializer = new
|
|
2562
|
+
if (m(this, "config", void 0), m(this, "ttsWordHighlight", null), m(this, "ttsSentenceHighlight", null), m(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), m(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), m(this, "annotations", /* @__PURE__ */ new Map()), m(this, "colorHighlights", /* @__PURE__ */ new Map()), m(this, "nextAnnotationId", 1), m(this, "supported", !1), m(this, "rangeSerializer", void 0), m(this, "themeObserver", null), m(this, "explicitTTSColorOverride", null), this.config = t, this.rangeSerializer = new yc(), typeof CSS > "u" || !("highlights" in CSS)) {
|
|
2563
2563
|
console.warn("CSS Custom Highlight API not supported (SSR or unsupported browser)");
|
|
2564
2564
|
return;
|
|
2565
2565
|
}
|
|
@@ -2795,10 +2795,10 @@ var ys = class Rr {
|
|
|
2795
2795
|
this.highlightTTSElementFallbacks(t);
|
|
2796
2796
|
}
|
|
2797
2797
|
highlightTTSElementFallbacks(t) {
|
|
2798
|
-
typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-sentence-element", this.ttsSentenceElementHighlights,
|
|
2798
|
+
typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-sentence-element", this.ttsSentenceElementHighlights, $r.SENTENCE_FALLBACK_SELECTOR);
|
|
2799
2799
|
}
|
|
2800
2800
|
highlightTTSWordElementFallbacks(t) {
|
|
2801
|
-
typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-word-element", this.ttsWordElementHighlights,
|
|
2801
|
+
typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-word-element", this.ttsWordElementHighlights, $r.WORD_FALLBACK_SELECTOR);
|
|
2802
2802
|
}
|
|
2803
2803
|
highlightElementFallbacks(t, n, r, i) {
|
|
2804
2804
|
for (const o of t) {
|
|
@@ -2962,14 +2962,14 @@ var ys = class Rr {
|
|
|
2962
2962
|
}
|
|
2963
2963
|
}
|
|
2964
2964
|
};
|
|
2965
|
-
m(
|
|
2966
|
-
m(
|
|
2967
|
-
function
|
|
2965
|
+
m(Ss, "SENTENCE_FALLBACK_SELECTOR", "math, mjx-container, svg, img, canvas, [role='img']");
|
|
2966
|
+
m(Ss, "WORD_FALLBACK_SELECTOR", "svg, img, canvas, [role='img']");
|
|
2967
|
+
function ws(e) {
|
|
2968
2968
|
return (...t) => {
|
|
2969
2969
|
console.debug(`[${e}]`, ...t);
|
|
2970
2970
|
};
|
|
2971
2971
|
}
|
|
2972
|
-
var
|
|
2972
|
+
var Fh = ws("I18nService"), pr = {
|
|
2973
2973
|
assessment: [],
|
|
2974
2974
|
section: [],
|
|
2975
2975
|
item: [],
|
|
@@ -2990,19 +2990,19 @@ function Fe(e, t) {
|
|
|
2990
2990
|
if (e.find((n) => typeof n != "string") !== void 0) throw new Error(`Invalid tools config at "${t}": all entries must be strings.`);
|
|
2991
2991
|
return e;
|
|
2992
2992
|
}
|
|
2993
|
-
function
|
|
2993
|
+
function _c(e) {
|
|
2994
2994
|
if (e != null) {
|
|
2995
2995
|
if (!ut(e)) throw new Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');
|
|
2996
2996
|
return e;
|
|
2997
2997
|
}
|
|
2998
2998
|
}
|
|
2999
|
-
function
|
|
2999
|
+
function Tc(e) {
|
|
3000
3000
|
if (e != null) {
|
|
3001
3001
|
if (!ut(e)) throw new Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');
|
|
3002
3002
|
return e;
|
|
3003
3003
|
}
|
|
3004
3004
|
}
|
|
3005
|
-
function
|
|
3005
|
+
function Sc(e, t) {
|
|
3006
3006
|
if (t == null) return;
|
|
3007
3007
|
if (!ut(t)) throw new Error(`Invalid tools config at "providers.${e}": expected an object.`);
|
|
3008
3008
|
const n = t, r = (i) => i === "polly" || i === "google" || i === "custom";
|
|
@@ -3011,14 +3011,14 @@ function bc(e, t) {
|
|
|
3011
3011
|
if ("provider" in n && n.provider !== void 0 && !ut(n.provider) && !(e === "textToSpeech" && r(n.provider))) throw new Error(`Invalid tools config at "providers.${e}.provider": expected an object.`);
|
|
3012
3012
|
return n;
|
|
3013
3013
|
}
|
|
3014
|
-
function
|
|
3014
|
+
function wc(e) {
|
|
3015
3015
|
if (e == null) return {};
|
|
3016
3016
|
if (!ut(e)) throw new Error('Invalid tools config at "providers": expected an object keyed by tool id.');
|
|
3017
3017
|
const t = {};
|
|
3018
|
-
for (const [n, r] of Object.entries(e)) t[n] =
|
|
3018
|
+
for (const [n, r] of Object.entries(e)) t[n] = Sc(n, r);
|
|
3019
3019
|
return t;
|
|
3020
3020
|
}
|
|
3021
|
-
function
|
|
3021
|
+
function ks(e) {
|
|
3022
3022
|
const t = e.trim();
|
|
3023
3023
|
return t || "";
|
|
3024
3024
|
}
|
|
@@ -3027,20 +3027,20 @@ function je(e) {
|
|
|
3027
3027
|
const t = /* @__PURE__ */ new Set();
|
|
3028
3028
|
for (const n of e) {
|
|
3029
3029
|
if (typeof n != "string") throw new Error("Invalid tools config: tool list entries must be strings.");
|
|
3030
|
-
const r =
|
|
3030
|
+
const r = ks(n);
|
|
3031
3031
|
r && t.add(r);
|
|
3032
3032
|
}
|
|
3033
3033
|
return Array.from(t);
|
|
3034
3034
|
}
|
|
3035
|
-
function
|
|
3035
|
+
function kc(e, t) {
|
|
3036
3036
|
if (e != null) {
|
|
3037
3037
|
if (e === "on" || e === "off") return e;
|
|
3038
3038
|
throw new Error(`Invalid tools config at "${t}": expected "on" or "off", got ${JSON.stringify(e)}.`);
|
|
3039
3039
|
}
|
|
3040
3040
|
}
|
|
3041
|
-
function
|
|
3041
|
+
function Ec(e) {
|
|
3042
3042
|
if (e != null && !ut(e)) throw new Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');
|
|
3043
|
-
const t =
|
|
3043
|
+
const t = Tc(e?.policy), n = _c(e?.placement), r = wc(e?.providers), i = kc(e?.pnpEnforcement, "pnpEnforcement"), o = {
|
|
3044
3044
|
policy: {
|
|
3045
3045
|
allowed: je(Fe(t?.allowed, "policy.allowed")),
|
|
3046
3046
|
blocked: je(Fe(t?.blocked, "policy.blocked"))
|
|
@@ -3054,7 +3054,7 @@ function Tc(e) {
|
|
|
3054
3054
|
};
|
|
3055
3055
|
return i && (o.pnpEnforcement = i), o;
|
|
3056
3056
|
}
|
|
3057
|
-
var
|
|
3057
|
+
var xc = [
|
|
3058
3058
|
"assessment",
|
|
3059
3059
|
"section",
|
|
3060
3060
|
"item",
|
|
@@ -3065,7 +3065,7 @@ var Sc = [
|
|
|
3065
3065
|
function xn(e, t) {
|
|
3066
3066
|
if (typeof e != "string" || e.trim().length === 0) throw new Error(`Invalid tool registration: "${t}" must be a non-empty string.`);
|
|
3067
3067
|
}
|
|
3068
|
-
var
|
|
3068
|
+
var Ac = [
|
|
3069
3069
|
{
|
|
3070
3070
|
pattern: /<script\b/i,
|
|
3071
3071
|
reason: "contains a <script> tag"
|
|
@@ -3083,17 +3083,17 @@ var wc = [
|
|
|
3083
3083
|
reason: "contains a <foreignObject> element"
|
|
3084
3084
|
}
|
|
3085
3085
|
];
|
|
3086
|
-
function
|
|
3086
|
+
function Cc(e, t, n) {
|
|
3087
3087
|
const r = t.trimStart(), i = r.toLowerCase().startsWith("<svg"), o = /^https?:/i.test(r);
|
|
3088
3088
|
if (/^data:/i.test(r)) throw new Error(`Invalid tool registration "${e}": "${n}" may not be a data: URL.`);
|
|
3089
3089
|
if (!(!i && !o)) {
|
|
3090
|
-
for (const { pattern: s, reason: a } of
|
|
3090
|
+
for (const { pattern: s, reason: a } of Ac) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${n}" ${a}. Inline SVG icons must not include scriptable content.`);
|
|
3091
3091
|
}
|
|
3092
3092
|
}
|
|
3093
3093
|
function Ki(e) {
|
|
3094
3094
|
if (xn(e.toolId, "toolId"), xn(e.name, "name"), xn(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.`);
|
|
3095
|
-
if (typeof e.icon == "string" &&
|
|
3096
|
-
const t = e.supportedLevels.find((n) => !
|
|
3095
|
+
if (typeof e.icon == "string" && Cc(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.`);
|
|
3096
|
+
const t = e.supportedLevels.find((n) => !xc.includes(n));
|
|
3097
3097
|
if (t) throw new Error(`Invalid tool registration "${e.toolId}": unsupported level "${t}".`);
|
|
3098
3098
|
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)}".`);
|
|
3099
3099
|
if (e.singletonScope !== void 0 && e.singletonScope !== "section") throw new Error(`Invalid tool registration "${e.toolId}": unsupported singletonScope "${String(e.singletonScope)}".`);
|
|
@@ -3102,12 +3102,12 @@ function Ki(e) {
|
|
|
3102
3102
|
if (typeof e.isVisibleInContext != "function") throw new Error(`Invalid tool registration "${e.toolId}": "isVisibleInContext" must be a function.`);
|
|
3103
3103
|
if (typeof e.renderToolbar != "function") throw new Error(`Invalid tool registration "${e.toolId}": "renderToolbar" must be a function.`);
|
|
3104
3104
|
}
|
|
3105
|
-
var
|
|
3105
|
+
var Mc = class {
|
|
3106
3106
|
constructor() {
|
|
3107
3107
|
m(this, "tools", /* @__PURE__ */ new Map()), m(this, "pnpIndex", /* @__PURE__ */ new Map()), m(this, "componentOverrides", {}), m(this, "moduleLoaders", /* @__PURE__ */ new Map()), m(this, "loadedToolModules", /* @__PURE__ */ new Set()), m(this, "moduleLoadPromises", /* @__PURE__ */ new Map());
|
|
3108
3108
|
}
|
|
3109
3109
|
normalizeToolId(e) {
|
|
3110
|
-
return
|
|
3110
|
+
return ks(e);
|
|
3111
3111
|
}
|
|
3112
3112
|
normalizeToolIds(e) {
|
|
3113
3113
|
return e.map((t) => this.normalizeToolId(t));
|
|
@@ -3245,20 +3245,20 @@ var Ec = class {
|
|
|
3245
3245
|
return r.renderToolbar(t, i);
|
|
3246
3246
|
}
|
|
3247
3247
|
};
|
|
3248
|
-
function
|
|
3248
|
+
function Es(e) {
|
|
3249
3249
|
return e.level === "item";
|
|
3250
3250
|
}
|
|
3251
|
-
function
|
|
3251
|
+
function Oc(e) {
|
|
3252
3252
|
return e.level === "passage";
|
|
3253
3253
|
}
|
|
3254
|
-
function
|
|
3254
|
+
function Ic(e) {
|
|
3255
3255
|
return e.level === "rubric";
|
|
3256
3256
|
}
|
|
3257
|
-
function
|
|
3257
|
+
function xs(e) {
|
|
3258
3258
|
return e.level === "element";
|
|
3259
3259
|
}
|
|
3260
3260
|
function ui(e) {
|
|
3261
|
-
if (
|
|
3261
|
+
if (xs(e)) {
|
|
3262
3262
|
const t = e.item.config;
|
|
3263
3263
|
if (!t) return "";
|
|
3264
3264
|
const n = [], r = (a) => a.replace(/<[^>]*>/g, " ").trim(), i = t.elements?.[e.elementId];
|
|
@@ -3273,7 +3273,7 @@ function ui(e) {
|
|
|
3273
3273
|
}
|
|
3274
3274
|
return n.filter(Boolean).join(" ").trim();
|
|
3275
3275
|
}
|
|
3276
|
-
if (
|
|
3276
|
+
if (Es(e)) {
|
|
3277
3277
|
const t = e.item;
|
|
3278
3278
|
if (!t?.config) return "";
|
|
3279
3279
|
const n = t.config, r = [], i = (l) => l.replace(/<[^>]*>/g, " ").trim();
|
|
@@ -3292,7 +3292,7 @@ function ui(e) {
|
|
|
3292
3292
|
}
|
|
3293
3293
|
return r.filter(Boolean).join(" ").trim();
|
|
3294
3294
|
}
|
|
3295
|
-
if (
|
|
3295
|
+
if (Oc(e)) {
|
|
3296
3296
|
const t = e.passage;
|
|
3297
3297
|
if (!t?.config) return "";
|
|
3298
3298
|
const n = t.config, r = [], i = (l) => l.replace(/<[^>]*>/g, " ").trim();
|
|
@@ -3311,7 +3311,7 @@ function ui(e) {
|
|
|
3311
3311
|
}
|
|
3312
3312
|
return r.filter(Boolean).join(" ").trim();
|
|
3313
3313
|
}
|
|
3314
|
-
if (
|
|
3314
|
+
if (Ic(e)) {
|
|
3315
3315
|
const t = e.rubricBlock;
|
|
3316
3316
|
return t.passage?.config ? (t.passage.config.markup || "").replace(/<[^>]*>/g, " ").trim() : (t.content || "").replace(/<[^>]*>/g, " ").trim();
|
|
3317
3317
|
}
|
|
@@ -3328,7 +3328,7 @@ function Qn(e) {
|
|
|
3328
3328
|
/\d+\s*[+\-*/=]\s*\d+/
|
|
3329
3329
|
].some((n) => n.test(t));
|
|
3330
3330
|
}
|
|
3331
|
-
function
|
|
3331
|
+
function $c(e) {
|
|
3332
3332
|
const t = [
|
|
3333
3333
|
"pie-multiple-choice",
|
|
3334
3334
|
"pie-inline-choice",
|
|
@@ -3337,7 +3337,7 @@ function Cc(e) {
|
|
|
3337
3337
|
"inline-choice",
|
|
3338
3338
|
"select-text"
|
|
3339
3339
|
];
|
|
3340
|
-
if (
|
|
3340
|
+
if (xs(e)) {
|
|
3341
3341
|
const n = e.item.config;
|
|
3342
3342
|
if (!n?.models) return !1;
|
|
3343
3343
|
const r = (Array.isArray(n.models) ? n.models : Object.values(n.models)).find((o) => o && typeof o == "object" && o.id === e.elementId);
|
|
@@ -3345,7 +3345,7 @@ function Cc(e) {
|
|
|
3345
3345
|
const i = r.element || "";
|
|
3346
3346
|
return t.includes(i);
|
|
3347
3347
|
}
|
|
3348
|
-
if (
|
|
3348
|
+
if (Es(e)) {
|
|
3349
3349
|
const n = e.item.config?.models;
|
|
3350
3350
|
return (Array.isArray(n) ? n : n && typeof n == "object" ? Object.values(n) : []).some((r) => {
|
|
3351
3351
|
if (!r || typeof r != "object") return !1;
|
|
@@ -3358,7 +3358,7 @@ function Cc(e) {
|
|
|
3358
3358
|
function Zn(e) {
|
|
3359
3359
|
return ui(e).trim().length >= 10;
|
|
3360
3360
|
}
|
|
3361
|
-
function
|
|
3361
|
+
function Rc(e) {
|
|
3362
3362
|
const t = ui(e);
|
|
3363
3363
|
return [
|
|
3364
3364
|
/chemistry|chemical|element|atom|molecule|compound/i,
|
|
@@ -3369,23 +3369,23 @@ function Mc(e) {
|
|
|
3369
3369
|
/physics|force|energy|velocity|acceleration/i
|
|
3370
3370
|
].some((n) => n.test(t));
|
|
3371
3371
|
}
|
|
3372
|
-
var
|
|
3372
|
+
var Lc = [
|
|
3373
3373
|
"assessment",
|
|
3374
3374
|
"section",
|
|
3375
3375
|
"item",
|
|
3376
3376
|
"passage",
|
|
3377
3377
|
"rubric"
|
|
3378
|
-
],
|
|
3379
|
-
function
|
|
3380
|
-
return
|
|
3378
|
+
], Pc = new Set(Lc);
|
|
3379
|
+
function Nc(e) {
|
|
3380
|
+
return Pc.has(e);
|
|
3381
3381
|
}
|
|
3382
3382
|
function di(e, t, n) {
|
|
3383
3383
|
const r = e.trim(), i = n.trim();
|
|
3384
3384
|
if (!r || !i) throw new Error("Tool instance ids require non-empty tool and scope ids");
|
|
3385
|
-
if (
|
|
3385
|
+
if (!Nc(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
|
|
3386
3386
|
return `${r}:${t}:${i}`;
|
|
3387
3387
|
}
|
|
3388
|
-
var
|
|
3388
|
+
var Wc = class {
|
|
3389
3389
|
constructor() {
|
|
3390
3390
|
m(this, "providerId", "desmos-calculator"), m(this, "providerName", "Desmos Calculator"), m(this, "category", "calculator"), m(this, "version", "1.10"), m(this, "requiresAuth", !0), m(this, "desmosProvider", null), m(this, "config", null);
|
|
3391
3391
|
}
|
|
@@ -3489,13 +3489,13 @@ var Rc = class {
|
|
|
3489
3489
|
text: e,
|
|
3490
3490
|
offset: 0
|
|
3491
3491
|
}];
|
|
3492
|
-
},
|
|
3492
|
+
}, As = (e) => String(e || "").trim().toLowerCase(), zc = () => As((typeof navigator < "u" ? navigator.language || navigator.languages?.[0] : "") || "en-US"), Hc = (e, t) => {
|
|
3493
3493
|
if (t) {
|
|
3494
3494
|
const s = e.find((a) => a.name === t);
|
|
3495
3495
|
if (s) return s;
|
|
3496
3496
|
}
|
|
3497
|
-
const n =
|
|
3498
|
-
const a =
|
|
3497
|
+
const n = zc(), r = n.split("-")[0] || "en", i = (s) => {
|
|
3498
|
+
const a = As(s.lang);
|
|
3499
3499
|
return a === n || a.startsWith(`${r}-`);
|
|
3500
3500
|
}, o = [
|
|
3501
3501
|
(s) => s.localService && i(s),
|
|
@@ -3509,14 +3509,14 @@ var Rc = class {
|
|
|
3509
3509
|
if (a) return a;
|
|
3510
3510
|
}
|
|
3511
3511
|
return e[0] || null;
|
|
3512
|
-
},
|
|
3512
|
+
}, Bc = (e) => !e.default, Cs = class {
|
|
3513
3513
|
constructor() {
|
|
3514
3514
|
m(this, "providerId", "browser"), m(this, "providerName", "Browser Speech Synthesis"), m(this, "version", "1.0.0");
|
|
3515
3515
|
}
|
|
3516
3516
|
async initialize(e) {
|
|
3517
3517
|
if (typeof window > "u") throw new Error("BrowserTTSProvider requires browser environment");
|
|
3518
3518
|
if (!("speechSynthesis" in window)) throw new Error("Browser does not support Speech Synthesis API");
|
|
3519
|
-
return new
|
|
3519
|
+
return new Dc(e);
|
|
3520
3520
|
}
|
|
3521
3521
|
supportsFeature(e) {
|
|
3522
3522
|
return !0;
|
|
@@ -3534,7 +3534,7 @@ var Rc = class {
|
|
|
3534
3534
|
}
|
|
3535
3535
|
destroy() {
|
|
3536
3536
|
}
|
|
3537
|
-
},
|
|
3537
|
+
}, Dc = class {
|
|
3538
3538
|
constructor(e) {
|
|
3539
3539
|
m(this, "utterance", null), m(this, "config", null), m(this, "_isPlaying", !1), m(this, "_isPaused", !1), m(this, "speakRunId", 0), m(this, "onWordBoundary", void 0), this.config = e;
|
|
3540
3540
|
}
|
|
@@ -3621,8 +3621,8 @@ var Rc = class {
|
|
|
3621
3621
|
}
|
|
3622
3622
|
const o = new SpeechSynthesisUtterance(e);
|
|
3623
3623
|
this.utterance = o;
|
|
3624
|
-
const s =
|
|
3625
|
-
s &&
|
|
3624
|
+
const s = Hc(speechSynthesis.getVoices(), this.config?.voice);
|
|
3625
|
+
s && Bc(s) && (o.voice = s), this.config?.rate && (o.rate = this.config.rate), this.config?.pitch && (o.pitch = this.config.pitch);
|
|
3626
3626
|
const a = () => {
|
|
3627
3627
|
this.utterance === o && (this.utterance = null);
|
|
3628
3628
|
};
|
|
@@ -3676,7 +3676,7 @@ var Rc = class {
|
|
|
3676
3676
|
...e.providerOptions || {}
|
|
3677
3677
|
});
|
|
3678
3678
|
}
|
|
3679
|
-
},
|
|
3679
|
+
}, Fc = class {
|
|
3680
3680
|
async emitTelemetry(e, t) {
|
|
3681
3681
|
try {
|
|
3682
3682
|
await this.config?.onTelemetry?.(e, t);
|
|
@@ -3708,7 +3708,7 @@ var Rc = class {
|
|
|
3708
3708
|
}
|
|
3709
3709
|
async _initializeBrowserTTS(e) {
|
|
3710
3710
|
if (typeof window > "u" || !("speechSynthesis" in window)) throw new Error("[TTSToolProvider] Browser TTS not supported (Web Speech API not available)");
|
|
3711
|
-
this.ttsProvider = new
|
|
3711
|
+
this.ttsProvider = new Cs(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
|
|
3712
3712
|
}
|
|
3713
3713
|
async _initializeServerTTS(e) {
|
|
3714
3714
|
if (!e.apiEndpoint) throw new Error("[TTSToolProvider] apiEndpoint required for server-based TTS backends");
|
|
@@ -3720,7 +3720,7 @@ var Rc = class {
|
|
|
3720
3720
|
});
|
|
3721
3721
|
const n = await (async () => {
|
|
3722
3722
|
try {
|
|
3723
|
-
const r = await import("./dist-
|
|
3723
|
+
const r = await import("./dist-BV1q85ZL.js");
|
|
3724
3724
|
return await this.emitTelemetry("pie-tool-library-load-success", {
|
|
3725
3725
|
toolId: "textToSpeech",
|
|
3726
3726
|
operation: "server-provider-module-import",
|
|
@@ -3766,7 +3766,7 @@ var Rc = class {
|
|
|
3766
3766
|
destroy() {
|
|
3767
3767
|
this.ttsProvider && (this.ttsProvider.destroy(), this.ttsProvider = null), this.config = null, console.log("[TTSToolProvider] Destroyed");
|
|
3768
3768
|
}
|
|
3769
|
-
},
|
|
3769
|
+
}, jc = /* @__PURE__ */ new Set([
|
|
3770
3770
|
"annotation-xml",
|
|
3771
3771
|
"color-profile",
|
|
3772
3772
|
"font-face",
|
|
@@ -3775,16 +3775,16 @@ var Rc = class {
|
|
|
3775
3775
|
"font-face-format",
|
|
3776
3776
|
"font-face-name",
|
|
3777
3777
|
"missing-glyph"
|
|
3778
|
-
]),
|
|
3778
|
+
]), qc = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, Vc = (e, t = "custom element tag") => {
|
|
3779
3779
|
if (!e || typeof e != "string") throw new Error(`Invalid ${t}: expected a non-empty string`);
|
|
3780
3780
|
const n = e.trim();
|
|
3781
3781
|
if (!n) throw new Error(`Invalid ${t}: tag is empty`);
|
|
3782
3782
|
if (n !== n.toLowerCase()) throw new Error(`Invalid ${t} "${n}": custom element names must be lowercase`);
|
|
3783
3783
|
if (!n.includes("-")) throw new Error(`Invalid ${t} "${n}": custom element names must include a hyphen`);
|
|
3784
|
-
if (
|
|
3785
|
-
if (!
|
|
3784
|
+
if (jc.has(n)) throw new Error(`Invalid ${t} "${n}": this name is reserved by the HTML spec`);
|
|
3785
|
+
if (!qc.test(n)) throw new Error(`Invalid ${t} "${n}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
|
|
3786
3786
|
return n;
|
|
3787
|
-
},
|
|
3787
|
+
}, Ms = {
|
|
3788
3788
|
calculator: "pie-tool-calculator",
|
|
3789
3789
|
textToSpeech: "pie-tool-text-to-speech",
|
|
3790
3790
|
ruler: "pie-tool-ruler",
|
|
@@ -3796,29 +3796,29 @@ var Rc = class {
|
|
|
3796
3796
|
annotationToolbar: "pie-tool-annotation-toolbar",
|
|
3797
3797
|
graph: "pie-tool-graph",
|
|
3798
3798
|
periodicTable: "pie-tool-periodic-table"
|
|
3799
|
-
},
|
|
3800
|
-
const i =
|
|
3799
|
+
}, Uc = (e, t) => Vc(t?.toolTagMap?.[e] ?? Ms[e] ?? e, `tool component tag for "${e}"`), Gc = (e) => document.createElement(e), Ce = (e, t, n, r) => {
|
|
3800
|
+
const i = Uc(e, r), o = r?.toolComponentFactories?.[e] ?? r?.toolComponentFactory;
|
|
3801
3801
|
return o ? o({
|
|
3802
3802
|
toolId: e,
|
|
3803
3803
|
tagName: i,
|
|
3804
3804
|
context: t,
|
|
3805
3805
|
toolbarContext: n
|
|
3806
|
-
}) :
|
|
3807
|
-
},
|
|
3808
|
-
function
|
|
3806
|
+
}) : Gc(i);
|
|
3807
|
+
}, Rr = /* @__PURE__ */ new WeakMap();
|
|
3808
|
+
function Kc(e, t) {
|
|
3809
3809
|
if (!e) return null;
|
|
3810
|
-
const n =
|
|
3810
|
+
const n = Rr.get(e), r = n?.get(t);
|
|
3811
3811
|
return r ? r.isConnected ? r : (n?.delete(t), null) : null;
|
|
3812
3812
|
}
|
|
3813
|
-
function
|
|
3813
|
+
function Yc(e, t, n) {
|
|
3814
3814
|
if (!e) return;
|
|
3815
|
-
let r =
|
|
3816
|
-
r || (r = /* @__PURE__ */ new Map(),
|
|
3815
|
+
let r = Rr.get(e);
|
|
3816
|
+
r || (r = /* @__PURE__ */ new Map(), Rr.set(e, r)), r.set(t, n);
|
|
3817
3817
|
}
|
|
3818
3818
|
function Yi(e) {
|
|
3819
3819
|
return e === "basic" || e === "scientific" ? e : null;
|
|
3820
3820
|
}
|
|
3821
|
-
function
|
|
3821
|
+
function Xc(e) {
|
|
3822
3822
|
const t = e.getToolRenderParams?.("calculator") ?? {}, n = Yi(t.calculatorType), r = t.availableTypes;
|
|
3823
3823
|
return {
|
|
3824
3824
|
calculatorType: n,
|
|
@@ -3830,14 +3830,14 @@ function Xi(e, t, n) {
|
|
|
3830
3830
|
const r = e;
|
|
3831
3831
|
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;
|
|
3832
3832
|
}
|
|
3833
|
-
var
|
|
3833
|
+
var Jc = {
|
|
3834
3834
|
toolId: "calculator",
|
|
3835
3835
|
name: "Calculator",
|
|
3836
3836
|
description: "Multi-type calculator (basic, scientific, graphing)",
|
|
3837
3837
|
icon: "calculator",
|
|
3838
3838
|
provider: {
|
|
3839
3839
|
getProviderId: (e) => typeof e?.provider?.id == "string" && e.provider.id.length > 0 ? e.provider.id : "calculator-desmos",
|
|
3840
|
-
createProvider: () => new
|
|
3840
|
+
createProvider: () => new Wc(),
|
|
3841
3841
|
getInitConfig: (e) => e?.provider?.init ?? {},
|
|
3842
3842
|
getAuthFetcher: (e) => {
|
|
3843
3843
|
const t = e?.provider?.runtime?.authFetcher;
|
|
@@ -3863,8 +3863,8 @@ var Gc = {
|
|
|
3863
3863
|
return Qn(e);
|
|
3864
3864
|
},
|
|
3865
3865
|
renderToolbar(e, t) {
|
|
3866
|
-
const { calculatorType: n, availableTypes: r, displayName: i } =
|
|
3867
|
-
a ||
|
|
3866
|
+
const { calculatorType: n, availableTypes: r, displayName: i } = Xc(t), o = di(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = Kc(t.toolCoordinator, o), l = a ?? Ce(this.toolId, e, t, s);
|
|
3867
|
+
a || Yc(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Xi(l, n, r);
|
|
3868
3868
|
const c = n === null ? "Open scientific calculator" : `Open ${i.toLowerCase()}`, u = n === null ? "Close scientific calculator" : `Close ${i.toLowerCase()}`, d = {
|
|
3869
3869
|
toolId: this.toolId,
|
|
3870
3870
|
label: i,
|
|
@@ -3905,7 +3905,7 @@ var Gc = {
|
|
|
3905
3905
|
}
|
|
3906
3906
|
};
|
|
3907
3907
|
}
|
|
3908
|
-
}, D = (e) => e.trim().replace(/\s+/g, " "),
|
|
3908
|
+
}, D = (e) => e.trim().replace(/\s+/g, " "), Os = () => /[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu, Is = (e) => {
|
|
3909
3909
|
if (e.hidden || e.tagName?.toLowerCase() === "mjx-assistive-mml" || e.getAttribute("aria-hidden") === "true" || e.hasAttribute("inert")) return !0;
|
|
3910
3910
|
const t = e.classList;
|
|
3911
3911
|
if (t?.contains("sr-only") || t?.contains("pie-sr-only") || t?.contains("visually-hidden")) return !0;
|
|
@@ -3919,12 +3919,12 @@ var Gc = {
|
|
|
3919
3919
|
}, Pt = (e, t) => {
|
|
3920
3920
|
let n = e.nodeType === 1 ? e : e.parentElement;
|
|
3921
3921
|
for (; n; ) {
|
|
3922
|
-
if (
|
|
3922
|
+
if (Is(n)) return !0;
|
|
3923
3923
|
if (t && n === t) break;
|
|
3924
3924
|
n = n.parentElement;
|
|
3925
3925
|
}
|
|
3926
3926
|
return !1;
|
|
3927
|
-
},
|
|
3927
|
+
}, $s = (e, t, n) => {
|
|
3928
3928
|
if (!e || !t || /\s/.test(e) || /\s/.test(t)) return !1;
|
|
3929
3929
|
const r = n?.boundarySpacingMode ?? "segmenterPreferred";
|
|
3930
3930
|
if (r === "none") return !1;
|
|
@@ -3952,7 +3952,7 @@ var Gc = {
|
|
|
3952
3952
|
const h = u;
|
|
3953
3953
|
if (h.parentElement && !Pt(h, e)) {
|
|
3954
3954
|
const p = h.textContent || "", v = p.match(/\S/), b = v ? v[0] : null;
|
|
3955
|
-
!o && !s &&
|
|
3955
|
+
!o && !s && $s(l, b, t) && (r.push(" "), a && n.set(i, a), i++, s = !0);
|
|
3956
3956
|
for (let g = 0; g < p.length; g++) {
|
|
3957
3957
|
const y = p[g], O = /\s/.test(y);
|
|
3958
3958
|
o ? O || (o = !1, r.push(y), n.set(i, {
|
|
@@ -3984,11 +3984,11 @@ var Gc = {
|
|
|
3984
3984
|
text: d,
|
|
3985
3985
|
map: n
|
|
3986
3986
|
};
|
|
3987
|
-
}, vr = null, Ji = Promise.resolve(),
|
|
3987
|
+
}, vr = null, Ji = Promise.resolve(), Qc = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Zc = async () => (vr || (vr = import("./sre-CXN7ed6H.js").then((e) => /* @__PURE__ */ xa(e.default, 1)).then((e) => {
|
|
3988
3988
|
const t = e.default || e;
|
|
3989
3989
|
if (!t || typeof t.toSpeech != "function") throw new Error("speech-rule-engine did not expose toSpeech");
|
|
3990
3990
|
return t;
|
|
3991
|
-
})), vr),
|
|
3991
|
+
})), vr), eu = (e) => e === "en" ? "clearspeak" : "mathspeak", Qi = (e) => !!e && typeof e == "object" && !Array.isArray(e), Zi = (e) => typeof e == "string" && e.trim() ? e.trim() : void 0, er = (e) => {
|
|
3992
3992
|
if (!Qi(e)) return;
|
|
3993
3993
|
const t = Zi(e.domain), n = Zi(e.style), r = Qi(e.engineOptions) ? e.engineOptions : void 0;
|
|
3994
3994
|
if (!(!t && !n && !r))
|
|
@@ -3997,36 +3997,36 @@ var Gc = {
|
|
|
3997
3997
|
...n ? { style: n } : {},
|
|
3998
3998
|
...r ? { engineOptions: r } : {}
|
|
3999
3999
|
};
|
|
4000
|
-
},
|
|
4001
|
-
const i =
|
|
4000
|
+
}, tu = async (e, t, n, r) => {
|
|
4001
|
+
const i = Qc(t), o = er(r);
|
|
4002
4002
|
await e.setupEngine?.({
|
|
4003
4003
|
...o?.engineOptions || {},
|
|
4004
4004
|
locale: i,
|
|
4005
|
-
domain: o?.domain ||
|
|
4005
|
+
domain: o?.domain || eu(i),
|
|
4006
4006
|
...o?.style ? { style: o.style } : {},
|
|
4007
4007
|
modality: "speech",
|
|
4008
4008
|
markup: n
|
|
4009
4009
|
}), await e.engineReady?.();
|
|
4010
|
-
},
|
|
4010
|
+
}, nu = async (e) => {
|
|
4011
4011
|
const t = Ji.then(e, e);
|
|
4012
4012
|
return Ji = t.then(() => {
|
|
4013
4013
|
}, () => {
|
|
4014
4014
|
}), t;
|
|
4015
|
-
},
|
|
4015
|
+
}, Rs = async (e, t, n, r, i) => nu(async () => (await tu(e, n, r, i), e.toSpeech(t))), ru = (e) => e.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), iu = async (e, t, n, r) => {
|
|
4016
4016
|
try {
|
|
4017
|
-
const i =
|
|
4017
|
+
const i = ru(await Rs(e, t, n, "ssml", r));
|
|
4018
4018
|
return i.includes("<speak") ? i : null;
|
|
4019
4019
|
} catch (i) {
|
|
4020
4020
|
return console.debug("[TTSService] Math SSML generation failed; using plain", { message: i instanceof Error ? i.message : String(i) }), null;
|
|
4021
4021
|
}
|
|
4022
|
-
},
|
|
4022
|
+
}, Ls = async (e, t = {}) => {
|
|
4023
4023
|
if (!e.some((c) => c.type === "math")) return {
|
|
4024
4024
|
speechText: D(e.map((c) => c.type === "text" ? c.text : c.fallbackText).join(" ")),
|
|
4025
4025
|
usedMathSpeech: !1,
|
|
4026
4026
|
usedFallback: !1
|
|
4027
4027
|
};
|
|
4028
4028
|
let n = null, r = !1, i = !1;
|
|
4029
|
-
const o = t.loadSre ||
|
|
4029
|
+
const o = t.loadSre || Zc, s = [];
|
|
4030
4030
|
for (const c of e) {
|
|
4031
4031
|
if (c.type === "text") {
|
|
4032
4032
|
s.push(c.text);
|
|
@@ -4034,7 +4034,7 @@ var Gc = {
|
|
|
4034
4034
|
}
|
|
4035
4035
|
try {
|
|
4036
4036
|
n || (n = await o());
|
|
4037
|
-
const u = D(await
|
|
4037
|
+
const u = D(await Rs(n, c.mathml, t.language, "none", t.mathSpeech));
|
|
4038
4038
|
if (u) {
|
|
4039
4039
|
s.push(u), r = !0;
|
|
4040
4040
|
continue;
|
|
@@ -4046,33 +4046,68 @@ var Gc = {
|
|
|
4046
4046
|
}
|
|
4047
4047
|
const a = D(s.join(" "));
|
|
4048
4048
|
let l;
|
|
4049
|
-
return t.produceSsml && n && r && e.length === 1 && e[0].type === "math" && (l = await
|
|
4049
|
+
return t.produceSsml && n && r && e.length === 1 && e[0].type === "math" && (l = await iu(n, e[0].mathml, t.language, t.mathSpeech) ?? void 0), {
|
|
4050
4050
|
speechText: a,
|
|
4051
4051
|
usedMathSpeech: r,
|
|
4052
4052
|
usedFallback: i,
|
|
4053
4053
|
ssml: l
|
|
4054
4054
|
};
|
|
4055
|
-
},
|
|
4055
|
+
}, ou = /* @__PURE__ */ new Set([
|
|
4056
4056
|
"reserved-row",
|
|
4057
4057
|
"expanding-row",
|
|
4058
4058
|
"floating-overlay",
|
|
4059
4059
|
"left-aligned"
|
|
4060
|
-
]), eo = (e) => e && typeof e == "object" ? e : {},
|
|
4060
|
+
]), eo = (e) => e && typeof e == "object" ? e : {}, su = (e) => e === "polly" || e === "google" || e === "server", ie = (e, t) => e === void 0 ? t : e, qn = (e, t = "left-aligned") => typeof e == "string" && ou.has(e) ? e : t, to = Object.freeze([0.8, 1.25]), no = (e) => {
|
|
4061
|
+
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) return;
|
|
4062
|
+
const t = Math.round(e * 100) / 100;
|
|
4063
|
+
return t === 1 ? void 0 : t;
|
|
4064
|
+
}, ro = (e) => {
|
|
4065
|
+
if (typeof e != "string") return;
|
|
4066
|
+
const t = e.trim();
|
|
4067
|
+
return t.length ? t : void 0;
|
|
4068
|
+
}, io = (e) => `${e}x`, Ps = (e, t) => t ? `Speed ${e}` : `${e} speed`, au = (e, t, n) => t ? t.toLowerCase().includes(e.toLowerCase()) ? t : `${e} ${t}` : Ps(e, n), lu = (e) => {
|
|
4069
|
+
if (typeof e == "number") return no(e);
|
|
4070
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return;
|
|
4071
|
+
const t = e, n = no(t.rate);
|
|
4072
|
+
if (n === void 0) return;
|
|
4073
|
+
const r = ro(t.label), i = ro(t.ariaLabel);
|
|
4074
|
+
return {
|
|
4075
|
+
rate: n,
|
|
4076
|
+
...r ? { label: r } : {},
|
|
4077
|
+
...i ? { ariaLabel: i } : {}
|
|
4078
|
+
};
|
|
4079
|
+
}, Lr = (e) => {
|
|
4061
4080
|
if (!Array.isArray(e)) return [...to];
|
|
4062
4081
|
if (e.length === 0) return [];
|
|
4063
|
-
const t = /* @__PURE__ */ new Set();
|
|
4064
|
-
for (const
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4082
|
+
const t = /* @__PURE__ */ new Set(), n = [];
|
|
4083
|
+
for (const r of e) {
|
|
4084
|
+
const i = lu(r);
|
|
4085
|
+
if (i === void 0) continue;
|
|
4086
|
+
const o = typeof i == "number" ? i : i.rate;
|
|
4087
|
+
t.has(o) || (t.add(o), n.push(i));
|
|
4088
|
+
}
|
|
4089
|
+
return n.length ? n : [...to];
|
|
4090
|
+
}, cu = (e) => Lr(e).map((t) => {
|
|
4091
|
+
if (typeof t == "number") {
|
|
4092
|
+
const i = io(t);
|
|
4093
|
+
return {
|
|
4094
|
+
rate: t,
|
|
4095
|
+
label: i,
|
|
4096
|
+
ariaLabel: Ps(i, !0)
|
|
4097
|
+
};
|
|
4068
4098
|
}
|
|
4069
|
-
|
|
4070
|
-
|
|
4099
|
+
const n = io(t.rate), r = t.label || n;
|
|
4100
|
+
return {
|
|
4101
|
+
rate: t.rate,
|
|
4102
|
+
label: r,
|
|
4103
|
+
ariaLabel: au(r, t.ariaLabel, r === n)
|
|
4104
|
+
};
|
|
4105
|
+
}), uu = (e) => {
|
|
4071
4106
|
const t = {
|
|
4072
4107
|
...e,
|
|
4073
4108
|
layoutMode: qn(e.layoutMode)
|
|
4074
4109
|
}, n = e.backend || "browser";
|
|
4075
|
-
if (!
|
|
4110
|
+
if (!su(n)) return t;
|
|
4076
4111
|
const r = {
|
|
4077
4112
|
...t,
|
|
4078
4113
|
apiEndpoint: ie(t.apiEndpoint, "/api/tts"),
|
|
@@ -4093,14 +4128,14 @@ var Gc = {
|
|
|
4093
4128
|
...r,
|
|
4094
4129
|
defaultVoice: ie(r.defaultVoice, "en-US-Wavenet-A")
|
|
4095
4130
|
} : r;
|
|
4096
|
-
},
|
|
4131
|
+
}, mr = (e) => {
|
|
4097
4132
|
const t = eo(e), n = eo(t.settings);
|
|
4098
|
-
return
|
|
4133
|
+
return uu({
|
|
4099
4134
|
...t,
|
|
4100
4135
|
...n
|
|
4101
4136
|
});
|
|
4102
|
-
}, Pr = (e) => e.backend || "browser",
|
|
4103
|
-
const t = Pr(e), n =
|
|
4137
|
+
}, Pr = (e) => e.backend || "browser", Ns = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, Ws = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), du = (e) => {
|
|
4138
|
+
const t = Pr(e), n = Ns(e, t), r = Ws(e, n), i = er(e.mathSpeech);
|
|
4104
4139
|
return {
|
|
4105
4140
|
voice: e.defaultVoice,
|
|
4106
4141
|
rate: e.rate,
|
|
@@ -4126,8 +4161,8 @@ var Gc = {
|
|
|
4126
4161
|
validateEndpoint: e.validateEndpoint,
|
|
4127
4162
|
...typeof e.mathTokenHighlighting == "boolean" ? { mathTokenHighlighting: e.mathTokenHighlighting } : {}
|
|
4128
4163
|
};
|
|
4129
|
-
},
|
|
4130
|
-
switch (
|
|
4164
|
+
}, zs = (e) => qn(e.layoutMode), hu = (e) => {
|
|
4165
|
+
switch (zs(e)) {
|
|
4131
4166
|
case "reserved-row":
|
|
4132
4167
|
return {
|
|
4133
4168
|
mount: "before-buttons",
|
|
@@ -4153,21 +4188,21 @@ var Gc = {
|
|
|
4153
4188
|
}
|
|
4154
4189
|
};
|
|
4155
4190
|
}
|
|
4156
|
-
}, jt = /* @__PURE__ */ new Map(),
|
|
4191
|
+
}, jt = /* @__PURE__ */ new Map(), fu = "__pieToolElementUnmount", oo = "pie-tool-active-change", pu = {
|
|
4157
4192
|
toolId: "textToSpeech",
|
|
4158
4193
|
name: "Text to Speech",
|
|
4159
4194
|
description: "Read content aloud",
|
|
4160
4195
|
icon: "volume-up",
|
|
4161
4196
|
provider: {
|
|
4162
4197
|
getProviderId: () => "tts",
|
|
4163
|
-
createProvider: (e) => new
|
|
4198
|
+
createProvider: (e) => new Fc(Pr(mr(e))),
|
|
4164
4199
|
getInitConfig: (e) => {
|
|
4165
|
-
const t =
|
|
4200
|
+
const t = mr(e), n = Pr(t), r = Ns(t, n);
|
|
4166
4201
|
return {
|
|
4167
4202
|
backend: n,
|
|
4168
4203
|
serverProvider: r,
|
|
4169
|
-
transportMode:
|
|
4170
|
-
...
|
|
4204
|
+
transportMode: Ws(t, r),
|
|
4205
|
+
...du(t)
|
|
4171
4206
|
};
|
|
4172
4207
|
},
|
|
4173
4208
|
getAuthFetcher: (e) => {
|
|
@@ -4176,9 +4211,9 @@ var Gc = {
|
|
|
4176
4211
|
},
|
|
4177
4212
|
sanitizeConfig: (e) => {
|
|
4178
4213
|
const t = e.settings && typeof e.settings == "object" ? { ...e.settings } : void 0;
|
|
4179
|
-
t && "layoutMode" in t && (t.layoutMode = qn(t.layoutMode)), t && "speedOptions" in t && (t.speedOptions =
|
|
4214
|
+
t && "layoutMode" in t && (t.layoutMode = qn(t.layoutMode)), t && "speedOptions" in t && (t.speedOptions = Lr(t.speedOptions));
|
|
4180
4215
|
const n = { ...e };
|
|
4181
|
-
return "layoutMode" in n && (n.layoutMode = qn(n.layoutMode)), "speedOptions" in n && (n.speedOptions =
|
|
4216
|
+
return "layoutMode" in n && (n.layoutMode = qn(n.layoutMode)), "speedOptions" in n && (n.speedOptions = Lr(n.speedOptions)), t && (n.settings = t), n;
|
|
4182
4217
|
},
|
|
4183
4218
|
lazy: !0
|
|
4184
4219
|
},
|
|
@@ -4193,12 +4228,12 @@ var Gc = {
|
|
|
4193
4228
|
return Zn(e);
|
|
4194
4229
|
},
|
|
4195
4230
|
renderToolbar(e, t) {
|
|
4196
|
-
const n = () =>
|
|
4231
|
+
const n = () => mr(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), r = () => cu(n().speedOptions), i = () => zs(n()), o = () => hu(n()), s = di(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
|
|
4197
4232
|
const u = t.ui?.size;
|
|
4198
4233
|
return u === "sm" || u === "lg" ? u : "md";
|
|
4199
4234
|
}, l = () => {
|
|
4200
4235
|
let u = jt.get(s);
|
|
4201
|
-
return u && typeof u.isConnected == "boolean" && !u.isConnected && (jt.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[
|
|
4236
|
+
return u && typeof u.isConnected == "boolean" && !u.isConnected && (jt.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[fu] = () => {
|
|
4202
4237
|
jt.get(s) === u && jt.delete(s);
|
|
4203
4238
|
}, jt.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;
|
|
4204
4239
|
}, c = o();
|
|
@@ -4218,8 +4253,8 @@ var Gc = {
|
|
|
4218
4253
|
const v = p.detail;
|
|
4219
4254
|
u(v?.active === !0);
|
|
4220
4255
|
};
|
|
4221
|
-
return d.addEventListener(
|
|
4222
|
-
d.removeEventListener(
|
|
4256
|
+
return d.addEventListener(oo, h), () => {
|
|
4257
|
+
d.removeEventListener(oo, h);
|
|
4223
4258
|
};
|
|
4224
4259
|
},
|
|
4225
4260
|
sync: () => {
|
|
@@ -4247,7 +4282,7 @@ function ze(e) {
|
|
|
4247
4282
|
function fi(e, t) {
|
|
4248
4283
|
e.setAttribute("data-pie-tool-surface", t);
|
|
4249
4284
|
}
|
|
4250
|
-
var
|
|
4285
|
+
var gu = {
|
|
4251
4286
|
toolId: "ruler",
|
|
4252
4287
|
name: "Ruler",
|
|
4253
4288
|
description: "On-screen ruler for measurements",
|
|
@@ -4289,7 +4324,7 @@ var lu = {
|
|
|
4289
4324
|
subscribeActive: n.subscribeActive
|
|
4290
4325
|
};
|
|
4291
4326
|
}
|
|
4292
|
-
},
|
|
4327
|
+
}, vu = {
|
|
4293
4328
|
toolId: "protractor",
|
|
4294
4329
|
name: "Protractor",
|
|
4295
4330
|
description: "On-screen protractor for angle measurements",
|
|
@@ -4331,7 +4366,7 @@ var lu = {
|
|
|
4331
4366
|
subscribeActive: n.subscribeActive
|
|
4332
4367
|
};
|
|
4333
4368
|
}
|
|
4334
|
-
},
|
|
4369
|
+
}, mu = {
|
|
4335
4370
|
toolId: "answerEliminator",
|
|
4336
4371
|
name: "Answer Eliminator",
|
|
4337
4372
|
description: "Strike through answer choices",
|
|
@@ -4344,7 +4379,7 @@ var lu = {
|
|
|
4344
4379
|
"choiceMasking"
|
|
4345
4380
|
],
|
|
4346
4381
|
isVisibleInContext(e) {
|
|
4347
|
-
return
|
|
4382
|
+
return $c(e);
|
|
4348
4383
|
},
|
|
4349
4384
|
renderToolbar(e, t) {
|
|
4350
4385
|
const n = We(this.toolId, t), r = t.componentOverrides ?? {}, i = Ce(this.toolId, e, t, r);
|
|
@@ -4378,7 +4413,7 @@ var lu = {
|
|
|
4378
4413
|
subscribeActive: n.subscribeActive
|
|
4379
4414
|
};
|
|
4380
4415
|
}
|
|
4381
|
-
},
|
|
4416
|
+
}, bu = {
|
|
4382
4417
|
toolId: "highlighter",
|
|
4383
4418
|
name: "Highlighter",
|
|
4384
4419
|
description: "Highlight text",
|
|
@@ -4429,7 +4464,7 @@ var lu = {
|
|
|
4429
4464
|
subscribeActive: n.subscribeActive
|
|
4430
4465
|
};
|
|
4431
4466
|
}
|
|
4432
|
-
},
|
|
4467
|
+
}, yu = {
|
|
4433
4468
|
toolId: "lineReader",
|
|
4434
4469
|
name: "Line Reader",
|
|
4435
4470
|
description: "Reading guide overlay",
|
|
@@ -4478,7 +4513,7 @@ var lu = {
|
|
|
4478
4513
|
subscribeActive: n.subscribeActive
|
|
4479
4514
|
};
|
|
4480
4515
|
}
|
|
4481
|
-
},
|
|
4516
|
+
}, _u = {
|
|
4482
4517
|
toolId: "theme",
|
|
4483
4518
|
name: "Theme",
|
|
4484
4519
|
description: "Accessible themes and contrast",
|
|
@@ -4533,7 +4568,7 @@ var lu = {
|
|
|
4533
4568
|
subscribeActive: n.subscribeActive
|
|
4534
4569
|
};
|
|
4535
4570
|
}
|
|
4536
|
-
},
|
|
4571
|
+
}, Tu = {
|
|
4537
4572
|
toolId: "annotationToolbar",
|
|
4538
4573
|
name: "Highlighter",
|
|
4539
4574
|
description: "Highlight and annotate text",
|
|
@@ -4584,7 +4619,7 @@ var lu = {
|
|
|
4584
4619
|
subscribeActive: n.subscribeActive
|
|
4585
4620
|
};
|
|
4586
4621
|
}
|
|
4587
|
-
},
|
|
4622
|
+
}, Su = {
|
|
4588
4623
|
toolId: "graph",
|
|
4589
4624
|
name: "Graph",
|
|
4590
4625
|
description: "Graphing calculator and coordinate plane",
|
|
@@ -4637,7 +4672,7 @@ var lu = {
|
|
|
4637
4672
|
subscribeActive: n.subscribeActive
|
|
4638
4673
|
};
|
|
4639
4674
|
}
|
|
4640
|
-
},
|
|
4675
|
+
}, wu = {
|
|
4641
4676
|
toolId: "periodicTable",
|
|
4642
4677
|
name: "Periodic Table",
|
|
4643
4678
|
description: "Chemistry periodic table reference",
|
|
@@ -4649,7 +4684,7 @@ var lu = {
|
|
|
4649
4684
|
"elementReference"
|
|
4650
4685
|
],
|
|
4651
4686
|
isVisibleInContext(e) {
|
|
4652
|
-
return
|
|
4687
|
+
return Rc(e);
|
|
4653
4688
|
},
|
|
4654
4689
|
renderToolbar(e, t) {
|
|
4655
4690
|
const n = We(this.toolId, t), r = {
|
|
@@ -4689,54 +4724,54 @@ var lu = {
|
|
|
4689
4724
|
subscribeActive: n.subscribeActive
|
|
4690
4725
|
};
|
|
4691
4726
|
}
|
|
4692
|
-
},
|
|
4693
|
-
|
|
4694
|
-
au,
|
|
4695
|
-
lu,
|
|
4696
|
-
cu,
|
|
4697
|
-
uu,
|
|
4698
|
-
du,
|
|
4699
|
-
hu,
|
|
4700
|
-
fu,
|
|
4727
|
+
}, ku = [
|
|
4728
|
+
Jc,
|
|
4701
4729
|
pu,
|
|
4702
4730
|
gu,
|
|
4703
|
-
vu
|
|
4731
|
+
vu,
|
|
4732
|
+
mu,
|
|
4733
|
+
bu,
|
|
4734
|
+
yu,
|
|
4735
|
+
_u,
|
|
4736
|
+
Tu,
|
|
4737
|
+
Su,
|
|
4738
|
+
wu
|
|
4704
4739
|
];
|
|
4705
|
-
function
|
|
4706
|
-
const t = new
|
|
4740
|
+
function Eu(e = {}) {
|
|
4741
|
+
const t = new Mc(), n = {
|
|
4707
4742
|
toolTagMap: {
|
|
4708
|
-
...
|
|
4743
|
+
...Ms,
|
|
4709
4744
|
...e.toolTagMap || {}
|
|
4710
4745
|
},
|
|
4711
4746
|
toolComponentFactory: e.toolComponentFactory,
|
|
4712
4747
|
toolComponentFactories: e.toolComponentFactories
|
|
4713
4748
|
}, r = (i) => e.overrides?.[i.toolId] || i;
|
|
4714
|
-
return e.includePackagedTools &&
|
|
4749
|
+
return e.includePackagedTools && xu(t, {
|
|
4715
4750
|
toolIds: e.toolIds,
|
|
4716
4751
|
applyOverrides: r
|
|
4717
4752
|
}), e.toolModuleLoaders && Object.keys(e.toolModuleLoaders).length > 0 && t.setToolModuleLoaders(e.toolModuleLoaders), t.setComponentOverrides(n), t;
|
|
4718
4753
|
}
|
|
4719
|
-
function
|
|
4754
|
+
function xu(e, t = {}) {
|
|
4720
4755
|
const n = t.toolIds && t.toolIds.length > 0 ? new Set(t.toolIds) : null, r = t.applyOverrides || ((i) => i);
|
|
4721
|
-
for (const i of
|
|
4756
|
+
for (const i of ku)
|
|
4722
4757
|
n && !n.has(i.toolId) || e.register(r(i));
|
|
4723
4758
|
}
|
|
4724
|
-
function
|
|
4725
|
-
return
|
|
4759
|
+
function Au(e = {}) {
|
|
4760
|
+
return Eu({
|
|
4726
4761
|
...e,
|
|
4727
4762
|
includePackagedTools: !0
|
|
4728
4763
|
});
|
|
4729
4764
|
}
|
|
4730
|
-
function
|
|
4731
|
-
const e =
|
|
4765
|
+
function Cu() {
|
|
4766
|
+
const e = Au(), t = /* @__PURE__ */ new Set();
|
|
4732
4767
|
for (const n of e.getAllTools()) for (const r of n.pnpSupportIds || []) t.add(r);
|
|
4733
4768
|
return [...t].sort();
|
|
4734
4769
|
}
|
|
4735
|
-
var
|
|
4736
|
-
supports: [...
|
|
4770
|
+
var Mu = Cu(), jh = {
|
|
4771
|
+
supports: [...Mu],
|
|
4737
4772
|
prohibitedSupports: [],
|
|
4738
4773
|
activateAtInit: []
|
|
4739
|
-
},
|
|
4774
|
+
}, Ou = {
|
|
4740
4775
|
visual: {
|
|
4741
4776
|
magnification: "magnification",
|
|
4742
4777
|
screenMagnifier: "screenMagnifier",
|
|
@@ -4849,11 +4884,11 @@ var Su = Tu(), Nh = {
|
|
|
4849
4884
|
itemGlossary: "itemGlossary",
|
|
4850
4885
|
tutorialAvailable: "tutorialAvailable"
|
|
4851
4886
|
}
|
|
4852
|
-
},
|
|
4887
|
+
}, qh = Object.values(Ou).flatMap((e) => Object.values(e)), Vh = ws("ToolCoordinator"), so;
|
|
4853
4888
|
(function(e) {
|
|
4854
4889
|
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";
|
|
4855
|
-
})(
|
|
4856
|
-
var
|
|
4890
|
+
})(so || (so = {}));
|
|
4891
|
+
var Iu = /* @__PURE__ */ new Set([
|
|
4857
4892
|
"speak",
|
|
4858
4893
|
"p",
|
|
4859
4894
|
"s",
|
|
@@ -4862,20 +4897,20 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
4862
4897
|
"say-as",
|
|
4863
4898
|
"voice",
|
|
4864
4899
|
"lang"
|
|
4865
|
-
]),
|
|
4900
|
+
]), ao = /* @__PURE__ */ new Set(["audio", "phoneme"]), Hs = (e) => e.replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/ /g, " ").replace(/ /g, " ").replace(/&/g, "&"), An = (e, t, n) => {
|
|
4866
4901
|
for (let r = 0; r < t.length; r++) e.push({
|
|
4867
4902
|
char: t[r],
|
|
4868
4903
|
rawOffset: n === null ? null : n + r
|
|
4869
4904
|
});
|
|
4870
|
-
},
|
|
4905
|
+
}, $u = (e, t, n) => {
|
|
4871
4906
|
const r = t.slice(n).match(/^&(quot|apos|lt|gt|nbsp|amp|#160);/i);
|
|
4872
|
-
return r ? (An(e,
|
|
4873
|
-
},
|
|
4907
|
+
return r ? (An(e, Hs(r[0]), n), r[0].length) : 0;
|
|
4908
|
+
}, lo = (e) => {
|
|
4874
4909
|
e.push({
|
|
4875
4910
|
char: " ",
|
|
4876
4911
|
rawOffset: null
|
|
4877
4912
|
});
|
|
4878
|
-
},
|
|
4913
|
+
}, Ru = (e) => {
|
|
4879
4914
|
const t = /* @__PURE__ */ new Map(), n = [];
|
|
4880
4915
|
let r = !0;
|
|
4881
4916
|
for (const i of e) {
|
|
@@ -4891,17 +4926,17 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
4891
4926
|
text: n.join(""),
|
|
4892
4927
|
rawToSpokenOffsetMap: t
|
|
4893
4928
|
};
|
|
4894
|
-
},
|
|
4929
|
+
}, Lu = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", Pu = (e, t) => {
|
|
4895
4930
|
const n = new RegExp(`${t}\\s*=\\s*("([^"]*)"|'([^']*)')`, "i"), r = e.match(n);
|
|
4896
|
-
return
|
|
4897
|
-
},
|
|
4931
|
+
return Hs(r?.[2] ?? r?.[3] ?? "") || null;
|
|
4932
|
+
}, Bs = (e) => {
|
|
4898
4933
|
const t = [];
|
|
4899
4934
|
let n = !1, r = !1, i = 0;
|
|
4900
4935
|
for (; i < e.length; ) {
|
|
4901
4936
|
const s = e[i];
|
|
4902
4937
|
if (s !== "<") {
|
|
4903
4938
|
if (s === "&") {
|
|
4904
|
-
const h =
|
|
4939
|
+
const h = $u(t, e, i);
|
|
4905
4940
|
if (h > 0) {
|
|
4906
4941
|
i += h;
|
|
4907
4942
|
continue;
|
|
@@ -4916,9 +4951,9 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
4916
4951
|
continue;
|
|
4917
4952
|
}
|
|
4918
4953
|
r = !0;
|
|
4919
|
-
const l = e.slice(i, a + 1), c =
|
|
4954
|
+
const l = e.slice(i, a + 1), c = Lu(l), u = /^<\s*\//.test(l), d = /\/\s*>$/.test(l);
|
|
4920
4955
|
if (!u && c === "sub") {
|
|
4921
|
-
const h =
|
|
4956
|
+
const h = Pu(l, "alias");
|
|
4922
4957
|
if (!h) {
|
|
4923
4958
|
n = !0, i = a + 1;
|
|
4924
4959
|
continue;
|
|
@@ -4929,23 +4964,23 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
4929
4964
|
continue;
|
|
4930
4965
|
}
|
|
4931
4966
|
if (!u && c === "break") {
|
|
4932
|
-
|
|
4967
|
+
lo(t), i = a + 1;
|
|
4933
4968
|
continue;
|
|
4934
4969
|
}
|
|
4935
|
-
if (!u &&
|
|
4970
|
+
if (!u && ao.has(c) && (n = !0, d)) {
|
|
4936
4971
|
i = a + 1;
|
|
4937
4972
|
continue;
|
|
4938
4973
|
}
|
|
4939
|
-
c && !
|
|
4974
|
+
c && !Iu.has(c) && !ao.has(c) && c !== "break" && c !== "sub" && (n = !0), !u && (c === "p" || c === "s") && lo(t), i = a + 1;
|
|
4940
4975
|
}
|
|
4941
|
-
const o =
|
|
4976
|
+
const o = Ru(t);
|
|
4942
4977
|
return {
|
|
4943
4978
|
spokenText: D(o.text),
|
|
4944
4979
|
rawToSpokenOffsetMap: o.rawToSpokenOffsetMap,
|
|
4945
4980
|
unsupportedSemantic: n,
|
|
4946
4981
|
hasMarkup: r
|
|
4947
4982
|
};
|
|
4948
|
-
},
|
|
4983
|
+
}, Nu = Os(), Ds = /* @__PURE__ */ new Map([
|
|
4949
4984
|
["zero", "0"],
|
|
4950
4985
|
["one", "1"],
|
|
4951
4986
|
["two", "2"],
|
|
@@ -4957,7 +4992,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
4957
4992
|
["eight", "8"],
|
|
4958
4993
|
["nine", "9"],
|
|
4959
4994
|
["ten", "10"]
|
|
4960
|
-
]),
|
|
4995
|
+
]), Wu = [
|
|
4961
4996
|
{
|
|
4962
4997
|
phrase: [
|
|
4963
4998
|
"plus",
|
|
@@ -5034,7 +5069,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5034
5069
|
}
|
|
5035
5070
|
], Nr = (e) => {
|
|
5036
5071
|
const t = [];
|
|
5037
|
-
for (const n of e.matchAll(
|
|
5072
|
+
for (const n of e.matchAll(Nu)) {
|
|
5038
5073
|
const r = n[0], i = n.index ?? 0;
|
|
5039
5074
|
t.push({
|
|
5040
5075
|
text: r,
|
|
@@ -5044,7 +5079,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5044
5079
|
});
|
|
5045
5080
|
}
|
|
5046
5081
|
return t;
|
|
5047
|
-
}, Wr = (e) =>
|
|
5082
|
+
}, Wr = (e) => Ds.get(e.normalized) || e.normalized, zu = (e, t) => {
|
|
5048
5083
|
const n = [];
|
|
5049
5084
|
for (let r = 0; r < e.length; r++) {
|
|
5050
5085
|
for (let i = 0; i < t.length; i++) Wr(e[r]) === Wr(t[i]) && n.push({
|
|
@@ -5053,7 +5088,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5053
5088
|
visibleToken: i,
|
|
5054
5089
|
score: 10
|
|
5055
5090
|
});
|
|
5056
|
-
for (const i of
|
|
5091
|
+
for (const i of Wu) {
|
|
5057
5092
|
const o = e.slice(r, r + i.phrase.length);
|
|
5058
5093
|
if (o.length === i.phrase.length && o.every((s, a) => s.normalized === i.phrase[a]))
|
|
5059
5094
|
for (let s = 0; s < t.length; s++)
|
|
@@ -5066,8 +5101,8 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5066
5101
|
}
|
|
5067
5102
|
}
|
|
5068
5103
|
return n;
|
|
5069
|
-
},
|
|
5070
|
-
const n =
|
|
5104
|
+
}, Hu = (e, t) => {
|
|
5105
|
+
const n = zu(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);
|
|
5071
5106
|
for (let l = 0; l < n.length; l++) {
|
|
5072
5107
|
const c = n[l];
|
|
5073
5108
|
r[l] = c.score;
|
|
@@ -5096,12 +5131,12 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5096
5131
|
score: l.score
|
|
5097
5132
|
};
|
|
5098
5133
|
});
|
|
5099
|
-
},
|
|
5134
|
+
}, Bu = (e, t, n) => {
|
|
5100
5135
|
if (e.length === 0) return 0;
|
|
5101
5136
|
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;
|
|
5102
5137
|
return Math.min(1, r * i);
|
|
5103
|
-
},
|
|
5104
|
-
const t =
|
|
5138
|
+
}, Fs = (e) => {
|
|
5139
|
+
const t = Bs(e.speechText), n = D(e.visibleText), r = t.spokenText, i = Nr(r), o = Nr(n), s = t.unsupportedSemantic ? [] : Hu(i, o), a = Bu(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", d = t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text";
|
|
5105
5140
|
return {
|
|
5106
5141
|
speechText: e.speechText,
|
|
5107
5142
|
spokenText: r,
|
|
@@ -5114,16 +5149,16 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5114
5149
|
visibleTokens: o,
|
|
5115
5150
|
rawToSpokenOffsetMap: t.rawToSpokenOffsetMap
|
|
5116
5151
|
};
|
|
5117
|
-
}, pi = (e, t) => e.find((n) => n.start <= t && t < n.end) || null,
|
|
5152
|
+
}, pi = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, js = (e) => {
|
|
5118
5153
|
if (!e || /^<[^>]+>$/.test(e.trim())) return null;
|
|
5119
5154
|
const t = Nr(e)[0];
|
|
5120
|
-
return t ?
|
|
5121
|
-
},
|
|
5122
|
-
const r =
|
|
5155
|
+
return t ? Ds.get(t.normalized) || t.normalized : null;
|
|
5156
|
+
}, co = (e, t, n) => {
|
|
5157
|
+
const r = js(n);
|
|
5123
5158
|
if (!t || !r) return !1;
|
|
5124
5159
|
const i = pi(e.spokenTokens, t.start);
|
|
5125
5160
|
return i ? Wr(i) === r : !1;
|
|
5126
|
-
},
|
|
5161
|
+
}, uo = (e, t) => {
|
|
5127
5162
|
const n = e.rawToSpokenOffsetMap.get(t);
|
|
5128
5163
|
if (n !== void 0) return n;
|
|
5129
5164
|
for (let r = t; r < e.speechText.length; r++) {
|
|
@@ -5132,36 +5167,36 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5132
5167
|
if (e.speechText[r] === ">") break;
|
|
5133
5168
|
}
|
|
5134
5169
|
return null;
|
|
5135
|
-
},
|
|
5136
|
-
const r =
|
|
5170
|
+
}, ho = (e, t, n) => {
|
|
5171
|
+
const r = uo(e, t);
|
|
5137
5172
|
if (r === null) return null;
|
|
5138
|
-
const i =
|
|
5173
|
+
const i = uo(e, Math.max(t, t + n - 1)), o = pi(e.spokenTokens, r), s = i !== null && i >= r ? i - r + 1 : o ? o.end - r : n;
|
|
5139
5174
|
return {
|
|
5140
5175
|
start: r,
|
|
5141
5176
|
length: Math.max(1, s)
|
|
5142
5177
|
};
|
|
5143
|
-
},
|
|
5178
|
+
}, fo = (e, t, n) => {
|
|
5144
5179
|
if (t < 0 || t >= e.spokenText.length) return null;
|
|
5145
5180
|
const r = pi(e.spokenTokens, t);
|
|
5146
5181
|
return r ? {
|
|
5147
5182
|
start: t,
|
|
5148
5183
|
length: Math.min(n, r.end - t)
|
|
5149
5184
|
} : null;
|
|
5150
|
-
},
|
|
5185
|
+
}, Du = (e, t, n = 1, r) => {
|
|
5151
5186
|
if (e.boundaryOffsetMode === "unsupported" || !Number.isFinite(t)) return null;
|
|
5152
5187
|
const i = Math.max(1, Number.isFinite(n) ? n : 1);
|
|
5153
5188
|
if (r && /^<[^>]+>$/.test(r.trim())) return null;
|
|
5154
5189
|
if (e.boundaryOffsetMode === "raw-ssml") {
|
|
5155
|
-
const o =
|
|
5190
|
+
const o = ho(e, t, i), s = fo(e, t, i);
|
|
5156
5191
|
if (r) {
|
|
5157
|
-
if (
|
|
5158
|
-
if (
|
|
5159
|
-
if (
|
|
5192
|
+
if (co(e, o, r)) return o;
|
|
5193
|
+
if (co(e, s, r)) return s;
|
|
5194
|
+
if (js(r)) return null;
|
|
5160
5195
|
}
|
|
5161
5196
|
return o || s;
|
|
5162
5197
|
}
|
|
5163
|
-
return
|
|
5164
|
-
},
|
|
5198
|
+
return fo(e, t, i) || ho(e, t, i);
|
|
5199
|
+
}, Fu = (e, t) => {
|
|
5165
5200
|
if (e.playbackMode === "region-fallback") return null;
|
|
5166
5201
|
const n = e.anchors.find((o) => o.spokenStart <= t && t < o.spokenEnd);
|
|
5167
5202
|
if (n) return {
|
|
@@ -5183,7 +5218,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5183
5218
|
start: Math.min(r.visibleStart, i.visibleStart),
|
|
5184
5219
|
end: Math.max(r.visibleEnd, i.visibleEnd)
|
|
5185
5220
|
} : null;
|
|
5186
|
-
},
|
|
5221
|
+
}, ju = /* @__PURE__ */ new Map([
|
|
5187
5222
|
["+", ["plus"]],
|
|
5188
5223
|
["-", ["minus", "negative"]],
|
|
5189
5224
|
["−", ["minus", "negative"]],
|
|
@@ -5207,12 +5242,12 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5207
5242
|
["•", ["times"]],
|
|
5208
5243
|
["·", ["times"]],
|
|
5209
5244
|
["", ["times", "multiplied by"]]
|
|
5210
|
-
]),
|
|
5245
|
+
]), qu = /* @__PURE__ */ new Map([
|
|
5211
5246
|
["", "function-application"],
|
|
5212
5247
|
["", "implicit-multiply"],
|
|
5213
5248
|
["", "invisible-separator"],
|
|
5214
5249
|
["", "invisible-plus"]
|
|
5215
|
-
]),
|
|
5250
|
+
]), qs = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), Vu = /* @__PURE__ */ new Map([
|
|
5216
5251
|
["msqrt", "radical"],
|
|
5217
5252
|
["mroot", "radical"],
|
|
5218
5253
|
["msub", "subscript"],
|
|
@@ -5222,11 +5257,11 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5222
5257
|
["munderover", "underoverscript"],
|
|
5223
5258
|
["mmultiscripts", "multiscript"],
|
|
5224
5259
|
["menclose", "enclosure"]
|
|
5225
|
-
]),
|
|
5260
|
+
]), Uu = (e) => e.replace(/\s+/g, " ").trim(), dt = (e) => (e.localName || e.tagName || "").toLowerCase(), Gu = (e) => e.nodeType === Node.ELEMENT_NODE, Rt = (e) => Array.from(e.childNodes).filter(Gu), gi = (e) => Uu(e.textContent || ""), Pe = (e, t) => ({
|
|
5226
5261
|
type: "element-range",
|
|
5227
5262
|
quality: t,
|
|
5228
5263
|
element: e
|
|
5229
|
-
}),
|
|
5264
|
+
}), Ku = (e) => {
|
|
5230
5265
|
switch (e) {
|
|
5231
5266
|
case "mi":
|
|
5232
5267
|
return "identifier";
|
|
@@ -5242,15 +5277,15 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5242
5277
|
default:
|
|
5243
5278
|
return "unknown";
|
|
5244
5279
|
}
|
|
5245
|
-
},
|
|
5246
|
-
const t = e.normalized ??
|
|
5280
|
+
}, Yu = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), Xu = (e, t, n) => n === "fraction" ? ["over", "divided by"] : n === "superscript" ? qs.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? ju.get(e) || [] : [], vt = (e) => {
|
|
5281
|
+
const t = e.normalized ?? Yu(e.text, e.kind || "unknown");
|
|
5247
5282
|
return {
|
|
5248
5283
|
id: `math-token-${e.state.nextId++}`,
|
|
5249
5284
|
kind: e.kind,
|
|
5250
5285
|
role: e.role,
|
|
5251
5286
|
text: e.text,
|
|
5252
5287
|
normalized: t,
|
|
5253
|
-
spokenAliases:
|
|
5288
|
+
spokenAliases: Xu(e.text, e.kind, e.role),
|
|
5254
5289
|
sourceElement: e.sourceElement,
|
|
5255
5290
|
path: e.path,
|
|
5256
5291
|
target: e.target || Pe(e.sourceElement, "element-range"),
|
|
@@ -5258,9 +5293,9 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5258
5293
|
};
|
|
5259
5294
|
}, mt = (e, t, n = "tokens") => {
|
|
5260
5295
|
e[n].push(t);
|
|
5261
|
-
},
|
|
5296
|
+
}, Vs = (e, t, n) => {
|
|
5262
5297
|
Rt(e).forEach((r, i) => Ne(r, t, `${n}/${dt(r)}[${i}]`));
|
|
5263
|
-
},
|
|
5298
|
+
}, Ju = (e, t, n) => {
|
|
5264
5299
|
const r = Rt(e);
|
|
5265
5300
|
r[0] && Ne(r[0], t, `${n}/numerator`), mt(t, vt({
|
|
5266
5301
|
state: t,
|
|
@@ -5271,7 +5306,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5271
5306
|
path: n,
|
|
5272
5307
|
target: Pe(e, "element-range")
|
|
5273
5308
|
})), r[1] && Ne(r[1], t, `${n}/denominator`);
|
|
5274
|
-
},
|
|
5309
|
+
}, Qu = (e, t, n) => {
|
|
5275
5310
|
const r = e.getAttribute("open") || "(", i = e.getAttribute("close") || ")";
|
|
5276
5311
|
mt(t, vt({
|
|
5277
5312
|
state: t,
|
|
@@ -5281,7 +5316,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5281
5316
|
sourceElement: e,
|
|
5282
5317
|
path: `${n}/open`,
|
|
5283
5318
|
target: Pe(e, "element-range")
|
|
5284
|
-
})),
|
|
5319
|
+
})), Vs(e, t, n), mt(t, vt({
|
|
5285
5320
|
state: t,
|
|
5286
5321
|
kind: "operator",
|
|
5287
5322
|
role: i === "|" ? "absolute-value-fence" : "close-fence",
|
|
@@ -5290,13 +5325,13 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5290
5325
|
path: `${n}/close`,
|
|
5291
5326
|
target: Pe(e, "element-range")
|
|
5292
5327
|
}));
|
|
5293
|
-
},
|
|
5328
|
+
}, Zu = (e, t, n) => {
|
|
5294
5329
|
const r = Rt(e);
|
|
5295
5330
|
r[0] && Ne(r[0], t, `${n}/base`);
|
|
5296
5331
|
const i = r[1];
|
|
5297
5332
|
if (!i) return;
|
|
5298
5333
|
const o = gi(i);
|
|
5299
|
-
if (
|
|
5334
|
+
if (qs.has(o)) {
|
|
5300
5335
|
mt(t, vt({
|
|
5301
5336
|
state: t,
|
|
5302
5337
|
kind: "structure",
|
|
@@ -5310,7 +5345,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5310
5345
|
return;
|
|
5311
5346
|
}
|
|
5312
5347
|
Ne(i, t, `${n}/exponent`);
|
|
5313
|
-
},
|
|
5348
|
+
}, ed = (e, t, n, r) => {
|
|
5314
5349
|
mt(t, vt({
|
|
5315
5350
|
state: t,
|
|
5316
5351
|
kind: "structure",
|
|
@@ -5321,7 +5356,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5321
5356
|
path: n,
|
|
5322
5357
|
target: Pe(e, "element-range")
|
|
5323
5358
|
}));
|
|
5324
|
-
},
|
|
5359
|
+
}, td = (e, t, n) => {
|
|
5325
5360
|
let r = 0;
|
|
5326
5361
|
for (const i of Rt(e))
|
|
5327
5362
|
(dt(i) === "mtr" || dt(i) === "mlabeledtr") && (r++, mt(t, vt({
|
|
@@ -5334,10 +5369,10 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5334
5369
|
path: `${n}/row[${r}]`,
|
|
5335
5370
|
target: Pe(i, "region-fallback")
|
|
5336
5371
|
}), "layoutTargets")), Ne(i, t, `${n}/${dt(i)}[${r}]`);
|
|
5337
|
-
},
|
|
5372
|
+
}, nd = (e, t, n) => {
|
|
5338
5373
|
const r = gi(e);
|
|
5339
5374
|
if (!r) return;
|
|
5340
|
-
const i =
|
|
5375
|
+
const i = Ku(dt(e)), o = i === "operator" ? qu.get(r) : void 0, s = o ?? (i === "operator" && (r === "(" || r === ")") ? "grouping-fence" : i);
|
|
5341
5376
|
mt(t, vt({
|
|
5342
5377
|
state: t,
|
|
5343
5378
|
kind: i,
|
|
@@ -5368,19 +5403,19 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5368
5403
|
case "mtext":
|
|
5369
5404
|
case "ms":
|
|
5370
5405
|
case "mspace":
|
|
5371
|
-
|
|
5406
|
+
nd(e, t, n);
|
|
5372
5407
|
return;
|
|
5373
5408
|
case "mfrac":
|
|
5374
|
-
|
|
5409
|
+
Ju(e, t, n);
|
|
5375
5410
|
return;
|
|
5376
5411
|
case "msup":
|
|
5377
|
-
|
|
5412
|
+
Zu(e, t, n);
|
|
5378
5413
|
return;
|
|
5379
5414
|
case "mfenced":
|
|
5380
|
-
|
|
5415
|
+
Qu(e, t, n);
|
|
5381
5416
|
return;
|
|
5382
5417
|
case "mtable":
|
|
5383
|
-
|
|
5418
|
+
td(e, t, n);
|
|
5384
5419
|
return;
|
|
5385
5420
|
case "mphantom":
|
|
5386
5421
|
return;
|
|
@@ -5390,15 +5425,15 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5390
5425
|
return;
|
|
5391
5426
|
}
|
|
5392
5427
|
default: {
|
|
5393
|
-
const i =
|
|
5428
|
+
const i = Vu.get(r);
|
|
5394
5429
|
if (i) {
|
|
5395
|
-
|
|
5430
|
+
ed(e, t, n, i);
|
|
5396
5431
|
return;
|
|
5397
5432
|
}
|
|
5398
|
-
|
|
5433
|
+
Vs(e, t, n);
|
|
5399
5434
|
}
|
|
5400
5435
|
}
|
|
5401
|
-
},
|
|
5436
|
+
}, rd = (e) => {
|
|
5402
5437
|
const t = {
|
|
5403
5438
|
tokens: [],
|
|
5404
5439
|
layoutTargets: [],
|
|
@@ -5409,7 +5444,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5409
5444
|
layoutTargets: t.layoutTargets,
|
|
5410
5445
|
expressionTarget: Pe(e, "region-fallback")
|
|
5411
5446
|
};
|
|
5412
|
-
},
|
|
5447
|
+
}, id = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, od = 0.95, sd = (e) => {
|
|
5413
5448
|
const t = [], n = /* @__PURE__ */ new Set(), r = (i) => {
|
|
5414
5449
|
const o = i.toLowerCase().trim().split(/\s+/).filter(Boolean);
|
|
5415
5450
|
if (o.length === 0) return;
|
|
@@ -5419,7 +5454,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5419
5454
|
r(e.normalized);
|
|
5420
5455
|
for (const i of e.spokenAliases) r(i);
|
|
5421
5456
|
return t;
|
|
5422
|
-
},
|
|
5457
|
+
}, po = (e, t, n) => {
|
|
5423
5458
|
let r = 0;
|
|
5424
5459
|
for (const i of n) {
|
|
5425
5460
|
if (i.length <= r) continue;
|
|
@@ -5434,13 +5469,13 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5434
5469
|
o && (r = i.length);
|
|
5435
5470
|
}
|
|
5436
5471
|
return r;
|
|
5437
|
-
},
|
|
5472
|
+
}, ad = (e, t) => {
|
|
5438
5473
|
const n = [];
|
|
5439
5474
|
let r = 0;
|
|
5440
5475
|
for (const i of t) {
|
|
5441
|
-
const o =
|
|
5476
|
+
const o = sd(i);
|
|
5442
5477
|
if (i.optional) {
|
|
5443
|
-
const s =
|
|
5478
|
+
const s = po(e, r, o);
|
|
5444
5479
|
s > 0 && (n.push({
|
|
5445
5480
|
speechTokens: e.slice(r, r + s),
|
|
5446
5481
|
math: i
|
|
@@ -5448,7 +5483,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5448
5483
|
continue;
|
|
5449
5484
|
}
|
|
5450
5485
|
for (; r < e.length; ) {
|
|
5451
|
-
const s =
|
|
5486
|
+
const s = po(e, r, o);
|
|
5452
5487
|
if (s > 0) {
|
|
5453
5488
|
n.push({
|
|
5454
5489
|
speechTokens: e.slice(r, r + s),
|
|
@@ -5460,23 +5495,23 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5460
5495
|
}
|
|
5461
5496
|
}
|
|
5462
5497
|
return n;
|
|
5463
|
-
},
|
|
5498
|
+
}, ld = (e, t, n) => {
|
|
5464
5499
|
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);
|
|
5465
5500
|
return r > 0 && i === r && o === t.length;
|
|
5466
|
-
},
|
|
5501
|
+
}, cd = (e) => e.map(({ speechTokens: t, math: n }) => ({
|
|
5467
5502
|
speechTokenIds: t.map((r) => r.id),
|
|
5468
5503
|
mathTokenIds: [n.id],
|
|
5469
5504
|
score: 1,
|
|
5470
5505
|
confidence: 1,
|
|
5471
5506
|
target: n.target
|
|
5472
|
-
})),
|
|
5473
|
-
const t = e.minExactWordConfidence ??
|
|
5507
|
+
})), ud = (e) => {
|
|
5508
|
+
const t = e.minExactWordConfidence ?? od, n = ad(e.speech.tokens, e.math.tokens), r = ld(n, e.speech.tokens, e.math.tokens) ? 1 : 0;
|
|
5474
5509
|
return {
|
|
5475
|
-
segments: r >= t ?
|
|
5510
|
+
segments: r >= t ? cd(n) : [],
|
|
5476
5511
|
confidence: r,
|
|
5477
5512
|
fallbackTarget: e.math.expressionTarget
|
|
5478
5513
|
};
|
|
5479
|
-
},
|
|
5514
|
+
}, Us = Os(), dd = /* @__PURE__ */ new Map([
|
|
5480
5515
|
["zero", "0"],
|
|
5481
5516
|
["one", "1"],
|
|
5482
5517
|
["two", "2"],
|
|
@@ -5488,17 +5523,17 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5488
5523
|
["eight", "8"],
|
|
5489
5524
|
["nine", "9"],
|
|
5490
5525
|
["ten", "10"]
|
|
5491
|
-
]),
|
|
5526
|
+
]), Gs = (e) => {
|
|
5492
5527
|
const t = e.toLowerCase();
|
|
5493
|
-
return
|
|
5494
|
-
},
|
|
5528
|
+
return dd.get(t) || t;
|
|
5529
|
+
}, hd = (e) => {
|
|
5495
5530
|
const t = [];
|
|
5496
|
-
for (const n of e.matchAll(
|
|
5531
|
+
for (const n of e.matchAll(Us)) {
|
|
5497
5532
|
const r = n[0], i = n.index ?? 0;
|
|
5498
5533
|
t.push({
|
|
5499
5534
|
id: `speech-token-${t.length}`,
|
|
5500
5535
|
text: r,
|
|
5501
|
-
normalized:
|
|
5536
|
+
normalized: Gs(r),
|
|
5502
5537
|
start: i,
|
|
5503
5538
|
end: i + r.length,
|
|
5504
5539
|
sourceStart: i,
|
|
@@ -5508,11 +5543,11 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5508
5543
|
}
|
|
5509
5544
|
return t;
|
|
5510
5545
|
}, sn = (e) => {
|
|
5511
|
-
const t =
|
|
5546
|
+
const t = Bs(e.speechText);
|
|
5512
5547
|
return {
|
|
5513
5548
|
speechText: e.speechText,
|
|
5514
5549
|
spokenText: t.spokenText,
|
|
5515
|
-
tokens:
|
|
5550
|
+
tokens: hd(t.spokenText),
|
|
5516
5551
|
rawToSpokenOffsetMap: t.rawToSpokenOffsetMap,
|
|
5517
5552
|
boundaryOffsetSpace: t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text",
|
|
5518
5553
|
unsupportedSemantic: t.unsupportedSemantic,
|
|
@@ -5520,9 +5555,9 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5520
5555
|
};
|
|
5521
5556
|
}, vi = (e) => {
|
|
5522
5557
|
if (!e || /^<[^>]+>$/.test(e.trim())) return null;
|
|
5523
|
-
const t = e.match(
|
|
5524
|
-
return t?.[0] ?
|
|
5525
|
-
},
|
|
5558
|
+
const t = e.match(Us);
|
|
5559
|
+
return t?.[0] ? Gs(t[0]) : null;
|
|
5560
|
+
}, fd = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, pd = (e, t) => {
|
|
5526
5561
|
const n = e.rawToSpokenOffsetMap.get(t);
|
|
5527
5562
|
if (n !== void 0) return n;
|
|
5528
5563
|
for (let r = t; r < e.speechText.length; r++) {
|
|
@@ -5533,7 +5568,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5533
5568
|
return null;
|
|
5534
5569
|
}, zr = (e, t, n) => {
|
|
5535
5570
|
if (t === null) return null;
|
|
5536
|
-
const r =
|
|
5571
|
+
const r = fd(e.tokens, t);
|
|
5537
5572
|
return r ? {
|
|
5538
5573
|
token: r,
|
|
5539
5574
|
start: t,
|
|
@@ -5543,9 +5578,9 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5543
5578
|
}, Hr = (e, t) => {
|
|
5544
5579
|
const n = vi(t);
|
|
5545
5580
|
return !!(e && n && e.token.normalized === n);
|
|
5546
|
-
},
|
|
5581
|
+
}, gd = (e) => {
|
|
5547
5582
|
if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
|
|
5548
|
-
const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = zr(e.tokenization,
|
|
5583
|
+
const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = zr(e.tokenization, pd(e.tokenization, e.position), t), r = zr(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
|
|
5549
5584
|
return Hr(n, e.boundaryWord) ? {
|
|
5550
5585
|
...n,
|
|
5551
5586
|
confidence: 1
|
|
@@ -5553,7 +5588,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5553
5588
|
...r,
|
|
5554
5589
|
confidence: 1
|
|
5555
5590
|
} : e.boundaryWord && vi(e.boundaryWord) ? null : e.tokenization.boundaryOffsetSpace === "raw-ssml" ? n || r : r || n;
|
|
5556
|
-
},
|
|
5591
|
+
}, vd = (e) => {
|
|
5557
5592
|
if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
|
|
5558
5593
|
const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = zr(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
|
|
5559
5594
|
return Hr(n, e.boundaryWord) ? {
|
|
@@ -5561,27 +5596,27 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5561
5596
|
confidence: 1
|
|
5562
5597
|
} : e.boundaryWord && vi(e.boundaryWord) ? null : n;
|
|
5563
5598
|
}, Vn = (e) => {
|
|
5564
|
-
const t = sn({ speechText: e.speechText }), n =
|
|
5599
|
+
const t = sn({ speechText: e.speechText }), n = rd(e.mathElement);
|
|
5565
5600
|
return {
|
|
5566
5601
|
speech: t,
|
|
5567
5602
|
math: n,
|
|
5568
|
-
result:
|
|
5603
|
+
result: ud({
|
|
5569
5604
|
speech: t,
|
|
5570
5605
|
math: n
|
|
5571
5606
|
})
|
|
5572
5607
|
};
|
|
5573
|
-
},
|
|
5574
|
-
const n =
|
|
5608
|
+
}, md = (e, t) => {
|
|
5609
|
+
const n = vd({
|
|
5575
5610
|
tokenization: e.speech,
|
|
5576
5611
|
position: t.position,
|
|
5577
5612
|
length: t.length,
|
|
5578
5613
|
boundaryWord: t.boundaryWord
|
|
5579
5614
|
});
|
|
5580
|
-
return
|
|
5615
|
+
return id({
|
|
5581
5616
|
alignment: e.result,
|
|
5582
5617
|
boundary: n
|
|
5583
5618
|
});
|
|
5584
|
-
},
|
|
5619
|
+
}, bd = (e, t) => {
|
|
5585
5620
|
if (!t.boundaryWord || /^<[^>]+>$/.test(t.boundaryWord.trim())) return null;
|
|
5586
5621
|
const n = sn({ speechText: t.boundaryWord }).tokens[0];
|
|
5587
5622
|
if (!n) return null;
|
|
@@ -5590,7 +5625,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5590
5625
|
return i.normalized.toLowerCase() === o || i.spokenAliases.some((s) => s.toLowerCase() === o);
|
|
5591
5626
|
});
|
|
5592
5627
|
return r.length === 1 ? r[0].target : null;
|
|
5593
|
-
}, Br = "http://www.w3.org/1998/Math/MathML",
|
|
5628
|
+
}, Br = "http://www.w3.org/1998/Math/MathML", yd = /* @__PURE__ */ new Set([
|
|
5594
5629
|
"math",
|
|
5595
5630
|
"maction",
|
|
5596
5631
|
"menclose",
|
|
@@ -5624,7 +5659,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5624
5659
|
"semantics",
|
|
5625
5660
|
"annotation",
|
|
5626
5661
|
"annotation-xml"
|
|
5627
|
-
]),
|
|
5662
|
+
]), _d = /* @__PURE__ */ new Set([
|
|
5628
5663
|
"accent",
|
|
5629
5664
|
"accentunder",
|
|
5630
5665
|
"align",
|
|
@@ -5676,44 +5711,44 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5676
5711
|
"width",
|
|
5677
5712
|
"xmlns",
|
|
5678
5713
|
"xml:lang"
|
|
5679
|
-
]),
|
|
5714
|
+
]), Ks = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), Td = (e) => Ks(e).replace(/"/g, """), Sd = (e, t) => {
|
|
5680
5715
|
const n = e.toLowerCase(), r = t.trim().toLowerCase();
|
|
5681
|
-
return !!(n.startsWith("on") || !
|
|
5682
|
-
},
|
|
5716
|
+
return !!(n.startsWith("on") || !_d.has(n) || r.includes("javascript:") || r.includes("data:text/html"));
|
|
5717
|
+
}, wd = (e) => {
|
|
5683
5718
|
const t = e.localName.toLowerCase();
|
|
5684
|
-
if (!
|
|
5719
|
+
if (!yd.has(t)) return !1;
|
|
5685
5720
|
const n = e.namespaceURI;
|
|
5686
5721
|
return !n || n === Br || n === "http://www.w3.org/1999/xhtml";
|
|
5687
|
-
},
|
|
5688
|
-
if (e.nodeType === Node.TEXT_NODE) return
|
|
5722
|
+
}, Ys = (e) => {
|
|
5723
|
+
if (e.nodeType === Node.TEXT_NODE) return Ks(e.textContent || "");
|
|
5689
5724
|
if (e.nodeType === Node.COMMENT_NODE) return "";
|
|
5690
5725
|
if (e.nodeType !== Node.ELEMENT_NODE) return null;
|
|
5691
5726
|
const t = e;
|
|
5692
|
-
if (!
|
|
5727
|
+
if (!wd(t)) return null;
|
|
5693
5728
|
const n = t.localName.toLowerCase(), r = [];
|
|
5694
5729
|
for (const o of Array.from(t.attributes)) {
|
|
5695
5730
|
const s = o.name.toLowerCase();
|
|
5696
|
-
if (!
|
|
5731
|
+
if (!Sd(s, o.value)) {
|
|
5697
5732
|
if (s === "xmlns" && o.value !== Br) return null;
|
|
5698
|
-
r.push(`${s}="${
|
|
5733
|
+
r.push(`${s}="${Td(o.value)}"`);
|
|
5699
5734
|
}
|
|
5700
5735
|
}
|
|
5701
5736
|
n === "math" && !r.some((o) => o.startsWith("xmlns=")) && r.unshift(`xmlns="${Br}"`);
|
|
5702
5737
|
const i = [];
|
|
5703
5738
|
for (const o of Array.from(t.childNodes)) {
|
|
5704
|
-
const s =
|
|
5739
|
+
const s = Ys(o);
|
|
5705
5740
|
if (s === null) return null;
|
|
5706
5741
|
i.push(s);
|
|
5707
5742
|
}
|
|
5708
5743
|
return `<${n}${r.length > 0 ? ` ${r.join(" ")}` : ""}>${i.join("")}</${n}>`;
|
|
5709
|
-
},
|
|
5744
|
+
}, kd = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, br = (e) => {
|
|
5710
5745
|
const t = String(e || "").trim();
|
|
5711
5746
|
if (!t) return null;
|
|
5712
|
-
const n =
|
|
5747
|
+
const n = kd(t);
|
|
5713
5748
|
if (!n || n.getElementsByTagName("parsererror").length > 0) return null;
|
|
5714
5749
|
const r = n.documentElement;
|
|
5715
|
-
return !r || r.localName.toLowerCase() !== "math" ? null :
|
|
5716
|
-
},
|
|
5750
|
+
return !r || r.localName.toLowerCase() !== "math" ? null : Ys(r);
|
|
5751
|
+
}, Xs = (e) => ({
|
|
5717
5752
|
chars: [],
|
|
5718
5753
|
map: /* @__PURE__ */ new Map(),
|
|
5719
5754
|
position: 0,
|
|
@@ -5721,28 +5756,28 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5721
5756
|
lastCharWasWhitespace: !1,
|
|
5722
5757
|
lastMapped: null,
|
|
5723
5758
|
options: e
|
|
5724
|
-
}),
|
|
5759
|
+
}), Js = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container", Qs = (e) => e.tagName?.toLowerCase() === "mjx-assistive-mml", Zs = (e) => {
|
|
5725
5760
|
const t = e.tagName?.toLowerCase();
|
|
5726
5761
|
return t === "annotation" || t === "annotation-xml";
|
|
5727
|
-
},
|
|
5762
|
+
}, Ed = (e) => {
|
|
5728
5763
|
const t = e.getAttribute("data-mathml");
|
|
5729
5764
|
return t && t.trim() ? t : null;
|
|
5730
|
-
},
|
|
5731
|
-
if (e.tagName.toLowerCase() === "math") return
|
|
5732
|
-
const t =
|
|
5765
|
+
}, xd = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, Ad = (e) => {
|
|
5766
|
+
if (e.tagName.toLowerCase() === "math") return br(e.outerHTML);
|
|
5767
|
+
const t = Ed(e);
|
|
5733
5768
|
if (t) {
|
|
5734
|
-
const n =
|
|
5769
|
+
const n = br(t);
|
|
5735
5770
|
if (n) return n;
|
|
5736
5771
|
}
|
|
5737
|
-
if (
|
|
5738
|
-
const n =
|
|
5772
|
+
if (Js(e)) {
|
|
5773
|
+
const n = xd(e);
|
|
5739
5774
|
if (n) {
|
|
5740
|
-
const r =
|
|
5775
|
+
const r = br(n);
|
|
5741
5776
|
if (r) return r;
|
|
5742
5777
|
}
|
|
5743
5778
|
}
|
|
5744
5779
|
return null;
|
|
5745
|
-
},
|
|
5780
|
+
}, Cd = /* @__PURE__ */ new Set([
|
|
5746
5781
|
"P",
|
|
5747
5782
|
"H1",
|
|
5748
5783
|
"H2",
|
|
@@ -5758,7 +5793,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5758
5793
|
"FIGCAPTION",
|
|
5759
5794
|
"LABEL",
|
|
5760
5795
|
"BUTTON"
|
|
5761
|
-
]),
|
|
5796
|
+
]), Md = /* @__PURE__ */ new Set([
|
|
5762
5797
|
"heading",
|
|
5763
5798
|
"listitem",
|
|
5764
5799
|
"option",
|
|
@@ -5767,24 +5802,24 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5767
5802
|
"cell",
|
|
5768
5803
|
"columnheader",
|
|
5769
5804
|
"rowheader"
|
|
5770
|
-
]),
|
|
5805
|
+
]), Od = (e, t) => {
|
|
5771
5806
|
let n = e.parentElement, r = null;
|
|
5772
5807
|
for (; n && n !== t; ) {
|
|
5773
5808
|
const i = (n.getAttribute("role") || "").toLowerCase(), o = n.tagName.toUpperCase();
|
|
5774
|
-
if (
|
|
5809
|
+
if (Cd.has(o) || Md.has(i)) {
|
|
5775
5810
|
r = n;
|
|
5776
5811
|
break;
|
|
5777
5812
|
}
|
|
5778
5813
|
n = n.parentElement;
|
|
5779
5814
|
}
|
|
5780
5815
|
return r || t;
|
|
5781
|
-
},
|
|
5816
|
+
}, Id = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || Js(e), rt = (e, t, n) => {
|
|
5782
5817
|
/[.,;:!?]/.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++;
|
|
5783
|
-
},
|
|
5818
|
+
}, ea = (e, t) => {
|
|
5784
5819
|
if (e.inLeadingWhitespace || e.lastCharWasWhitespace || e.chars.length === 0) return !1;
|
|
5785
5820
|
const n = e.chars[e.chars.length - 1];
|
|
5786
|
-
return
|
|
5787
|
-
},
|
|
5821
|
+
return $s(n, t, e.options);
|
|
5822
|
+
}, ta = (e, t) => {
|
|
5788
5823
|
const n = t.textContent || "";
|
|
5789
5824
|
let r = !1;
|
|
5790
5825
|
for (let i = 0; i < n.length; i++) {
|
|
@@ -5803,7 +5838,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5803
5838
|
}), e.lastCharWasWhitespace = !0;
|
|
5804
5839
|
continue;
|
|
5805
5840
|
}
|
|
5806
|
-
!r &&
|
|
5841
|
+
!r && ea(e, o) && rt(e, " ", {
|
|
5807
5842
|
node: t,
|
|
5808
5843
|
offset: i
|
|
5809
5844
|
}), rt(e, o, {
|
|
@@ -5811,7 +5846,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5811
5846
|
offset: i
|
|
5812
5847
|
}), r = !0, e.lastCharWasWhitespace = !1;
|
|
5813
5848
|
}
|
|
5814
|
-
},
|
|
5849
|
+
}, $d = (e, t) => {
|
|
5815
5850
|
for (let n = 0; n < t.text.length; n++) {
|
|
5816
5851
|
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 ? {
|
|
5817
5852
|
node: o.node,
|
|
@@ -5828,7 +5863,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5828
5863
|
e.lastCharWasWhitespace || rt(e, " ", l), e.lastCharWasWhitespace = !0;
|
|
5829
5864
|
continue;
|
|
5830
5865
|
}
|
|
5831
|
-
n === 0 &&
|
|
5866
|
+
n === 0 && ea(e, r) && rt(e, " ", l), rt(e, r, l), e.lastCharWasWhitespace = !1, o ? (e.map.set(e.position - 1, {
|
|
5832
5867
|
node: o.node,
|
|
5833
5868
|
offset: o.offset
|
|
5834
5869
|
}), e.lastMapped = {
|
|
@@ -5839,7 +5874,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5839
5874
|
offset: a
|
|
5840
5875
|
});
|
|
5841
5876
|
}
|
|
5842
|
-
},
|
|
5877
|
+
}, Rd = (e) => {
|
|
5843
5878
|
if (typeof DOMParser > "u") return "";
|
|
5844
5879
|
const t = new DOMParser().parseFromString(e, "application/xml");
|
|
5845
5880
|
if (t.getElementsByTagName("parsererror").length > 0) return "";
|
|
@@ -5851,38 +5886,38 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5851
5886
|
}
|
|
5852
5887
|
if (i.nodeType !== 1) return;
|
|
5853
5888
|
const o = i;
|
|
5854
|
-
if (!
|
|
5889
|
+
if (!Zs(o))
|
|
5855
5890
|
for (const s of Array.from(o.childNodes)) r(s);
|
|
5856
5891
|
};
|
|
5857
5892
|
return r(t.documentElement), D(n.join(" "));
|
|
5858
|
-
},
|
|
5859
|
-
const r =
|
|
5893
|
+
}, Ld = (e, t, n) => {
|
|
5894
|
+
const r = Xs(n), i = (a) => {
|
|
5860
5895
|
if (Pt(a, e)) return;
|
|
5861
5896
|
if (a.nodeType === 3) {
|
|
5862
|
-
|
|
5897
|
+
ta(r, a);
|
|
5863
5898
|
return;
|
|
5864
5899
|
}
|
|
5865
5900
|
if (a.nodeType !== 1) return;
|
|
5866
5901
|
const l = a;
|
|
5867
|
-
if (!(
|
|
5902
|
+
if (!(Qs(l) || Zs(l)))
|
|
5868
5903
|
for (const c of Array.from(l.childNodes)) i(c);
|
|
5869
5904
|
};
|
|
5870
|
-
i(e),
|
|
5905
|
+
i(e), na(r);
|
|
5871
5906
|
const o = D(r.chars.join(""));
|
|
5872
5907
|
if (o) return {
|
|
5873
5908
|
text: o,
|
|
5874
5909
|
map: r.map
|
|
5875
5910
|
};
|
|
5876
|
-
const s =
|
|
5911
|
+
const s = Rd(t);
|
|
5877
5912
|
return s ? {
|
|
5878
5913
|
text: s,
|
|
5879
5914
|
map: /* @__PURE__ */ new Map()
|
|
5880
5915
|
} : jn(e, n);
|
|
5881
|
-
},
|
|
5916
|
+
}, na = (e) => {
|
|
5882
5917
|
for (; e.chars.length > 0 && /\s/.test(e.chars[e.chars.length - 1]); )
|
|
5883
5918
|
e.chars.pop(), e.position--, e.map.delete(e.position);
|
|
5884
|
-
},
|
|
5885
|
-
const n =
|
|
5919
|
+
}, Pd = (e, t) => {
|
|
5920
|
+
const n = Xs(t), r = [];
|
|
5886
5921
|
let i = 0, o, s = !1;
|
|
5887
5922
|
const a = () => {
|
|
5888
5923
|
const u = D(n.chars.slice(i, n.chars.length).join(""));
|
|
@@ -5894,18 +5929,18 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5894
5929
|
}, l = (u) => {
|
|
5895
5930
|
if (Pt(u, e)) return;
|
|
5896
5931
|
if (u.nodeType === Node.TEXT_NODE) {
|
|
5897
|
-
const p =
|
|
5898
|
-
o && p !== o && a(), o = p,
|
|
5932
|
+
const p = Od(u, e);
|
|
5933
|
+
o && p !== o && a(), o = p, ta(n, u);
|
|
5899
5934
|
return;
|
|
5900
5935
|
}
|
|
5901
5936
|
if (u.nodeType !== Node.ELEMENT_NODE) return;
|
|
5902
5937
|
const d = u;
|
|
5903
|
-
if (
|
|
5904
|
-
const h =
|
|
5938
|
+
if (Qs(d)) return;
|
|
5939
|
+
const h = Ad(d);
|
|
5905
5940
|
if (h) {
|
|
5906
5941
|
a();
|
|
5907
|
-
const p =
|
|
5908
|
-
|
|
5942
|
+
const p = Ld(d, h, t);
|
|
5943
|
+
$d(n, p);
|
|
5909
5944
|
const v = D(p.text);
|
|
5910
5945
|
r.push({
|
|
5911
5946
|
type: "math",
|
|
@@ -5918,7 +5953,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5918
5953
|
for (const p of Array.from(d.childNodes)) l(p);
|
|
5919
5954
|
};
|
|
5920
5955
|
for (const u of Array.from(e.childNodes)) l(u);
|
|
5921
|
-
|
|
5956
|
+
na(n), a();
|
|
5922
5957
|
const c = n.chars.join("");
|
|
5923
5958
|
for (; n.map.has(c.length); ) n.map.delete(c.length);
|
|
5924
5959
|
return {
|
|
@@ -5928,7 +5963,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5928
5963
|
containsMathMarkup: s
|
|
5929
5964
|
};
|
|
5930
5965
|
}, Kt = (e, t) => {
|
|
5931
|
-
if (!
|
|
5966
|
+
if (!Id(e)) {
|
|
5932
5967
|
const { text: n, map: r } = jn(e, t);
|
|
5933
5968
|
return {
|
|
5934
5969
|
visibleText: n,
|
|
@@ -5940,8 +5975,8 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5940
5975
|
containsMathMarkup: !1
|
|
5941
5976
|
};
|
|
5942
5977
|
}
|
|
5943
|
-
return
|
|
5944
|
-
},
|
|
5978
|
+
return Pd(e, t);
|
|
5979
|
+
}, Nd = (e, t) => Ls([e], t), Wd = (e) => (e || "en").split("-")[0].toLowerCase() || "en", zd = /* @__PURE__ */ new Set([
|
|
5945
5980
|
"H1",
|
|
5946
5981
|
"H2",
|
|
5947
5982
|
"H3",
|
|
@@ -5951,17 +5986,17 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5951
5986
|
"LI",
|
|
5952
5987
|
"LABEL",
|
|
5953
5988
|
"BUTTON"
|
|
5954
|
-
]),
|
|
5989
|
+
]), Hd = /* @__PURE__ */ new Set([
|
|
5955
5990
|
"heading",
|
|
5956
5991
|
"listitem",
|
|
5957
5992
|
"option",
|
|
5958
5993
|
"radio"
|
|
5959
|
-
]),
|
|
5994
|
+
]), Bd = (e) => {
|
|
5960
5995
|
if (e.type !== "text" || !e.sourceElement) return !1;
|
|
5961
5996
|
const t = e.sourceElement.tagName.toUpperCase(), n = (e.sourceElement.getAttribute("role") || "").toLowerCase();
|
|
5962
|
-
return
|
|
5963
|
-
},
|
|
5964
|
-
const t = e.resolveMathSpeech ??
|
|
5997
|
+
return zd.has(t) || Hd.has(n);
|
|
5998
|
+
}, Dd = async (e) => {
|
|
5999
|
+
const t = e.resolveMathSpeech ?? Nd, { visibleText: n } = e, r = [];
|
|
5965
6000
|
let i = 0;
|
|
5966
6001
|
const o = (a) => {
|
|
5967
6002
|
const l = D(a), c = n.indexOf(l, i), u = c >= 0 ? c : i, d = u + l.length;
|
|
@@ -5973,7 +6008,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
5973
6008
|
for (let a = 0; a < e.chunks.length; a++) {
|
|
5974
6009
|
const l = e.chunks[a];
|
|
5975
6010
|
if (l.type === "text") {
|
|
5976
|
-
const p =
|
|
6011
|
+
const p = Bd(l) ? [{
|
|
5977
6012
|
text: l.text,
|
|
5978
6013
|
offset: 0
|
|
5979
6014
|
}] : hi(l.text, { locale: e.language });
|
|
@@ -6013,38 +6048,38 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6013
6048
|
}
|
|
6014
6049
|
return {
|
|
6015
6050
|
segments: r,
|
|
6016
|
-
locale:
|
|
6051
|
+
locale: Wd(e.language),
|
|
6017
6052
|
visibleText: n,
|
|
6018
6053
|
plainSpeechText: D(s.join(" "))
|
|
6019
6054
|
};
|
|
6020
|
-
},
|
|
6021
|
-
const t = Math.max(1, e.maxEntries ??
|
|
6055
|
+
}, Fd = (e) => (e || "en").split("-")[0].toLowerCase() || "en", jd = "sre-v1", qd = 256, Dr = (e) => Array.isArray(e) ? `array:[${e.map(Dr).join(",")}]` : e && typeof e == "object" ? `object:{${Object.entries(e).sort(([t], [n]) => t.localeCompare(n)).map(([t, n]) => `${JSON.stringify(t)}:${Dr(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)}`, go = (e, t, n, r) => `${jd}\0${Fd(e)}\0${t ? "ssml" : "plain"}\0${Dr(n ?? null)}\0${r}`, Vd = (e = {}) => {
|
|
6056
|
+
const t = Math.max(1, e.maxEntries ?? qd), n = e.resolve ?? ((o, s) => Ls([o], s)), r = /* @__PURE__ */ new Map(), i = (o, s) => {
|
|
6022
6057
|
for (r.delete(o), r.set(o, s); r.size > t; ) {
|
|
6023
6058
|
const a = r.keys().next().value;
|
|
6024
6059
|
a !== void 0 && r.delete(a);
|
|
6025
6060
|
}
|
|
6026
6061
|
};
|
|
6027
6062
|
return async (o, s) => {
|
|
6028
|
-
const a = er(s.mathSpeech), l = s.produceSsml === !0, c =
|
|
6063
|
+
const a = er(s.mathSpeech), l = s.produceSsml === !0, c = go(s.language, l, a, o.mathml), u = r.get(c);
|
|
6029
6064
|
if (u)
|
|
6030
6065
|
return r.delete(c), r.set(c, u), u;
|
|
6031
6066
|
const d = await n(o, {
|
|
6032
6067
|
...s,
|
|
6033
6068
|
mathSpeech: a
|
|
6034
6069
|
});
|
|
6035
|
-
return l && d.ssml && t > 1 && i(
|
|
6070
|
+
return l && d.ssml && t > 1 && i(go(s.language, !1, a, o.mathml), {
|
|
6036
6071
|
speechText: d.speechText,
|
|
6037
6072
|
usedMathSpeech: d.usedMathSpeech,
|
|
6038
6073
|
usedFallback: d.usedFallback
|
|
6039
6074
|
}), i(c, d), d;
|
|
6040
6075
|
};
|
|
6041
|
-
},
|
|
6076
|
+
}, Ud = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : sn({ speechText: e }).tokens[0]?.normalized || null, Gd = (e, t) => {
|
|
6042
6077
|
const n = sn({ speechText: e.speechText });
|
|
6043
6078
|
if (!Number.isFinite(t.position)) return {
|
|
6044
6079
|
boundary: null,
|
|
6045
6080
|
spokenText: n.spokenText
|
|
6046
6081
|
};
|
|
6047
|
-
const r =
|
|
6082
|
+
const r = gd({
|
|
6048
6083
|
tokenization: n,
|
|
6049
6084
|
position: t.position,
|
|
6050
6085
|
length: t.length,
|
|
@@ -6057,8 +6092,8 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6057
6092
|
} : null,
|
|
6058
6093
|
spokenText: n.spokenText
|
|
6059
6094
|
};
|
|
6060
|
-
},
|
|
6061
|
-
const n =
|
|
6095
|
+
}, Kd = (e, t, n) => n ? sn({ speechText: e }).tokens.find((r) => r.start <= t && t < r.end)?.normalized === n : !0, Yd = (e, t) => {
|
|
6096
|
+
const n = Ud(t.word);
|
|
6062
6097
|
if (e.id !== t.chunkId) return {
|
|
6063
6098
|
chunkId: t.chunkId,
|
|
6064
6099
|
normalizedWord: n,
|
|
@@ -6077,12 +6112,12 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6077
6112
|
};
|
|
6078
6113
|
let r, i;
|
|
6079
6114
|
if (e.catalogAlignment)
|
|
6080
|
-
r =
|
|
6115
|
+
r = Du(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
|
|
6081
6116
|
else {
|
|
6082
|
-
const o =
|
|
6117
|
+
const o = Gd(e, t);
|
|
6083
6118
|
r = o.boundary, i = o.spokenText;
|
|
6084
6119
|
}
|
|
6085
|
-
return r ?
|
|
6120
|
+
return r ? Kd(i, r.start, n) ? {
|
|
6086
6121
|
chunkId: e.id,
|
|
6087
6122
|
normalizedWord: n,
|
|
6088
6123
|
chunkSpokenStart: r.start,
|
|
@@ -6122,12 +6157,12 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6122
6157
|
quality: "region",
|
|
6123
6158
|
confidence: e.confidence,
|
|
6124
6159
|
reason: e.reason
|
|
6125
|
-
},
|
|
6160
|
+
}, ra = /* @__PURE__ */ new Map([
|
|
6126
6161
|
["mi", "mjx-mi"],
|
|
6127
6162
|
["mn", "mjx-mn"],
|
|
6128
6163
|
["mo", "mjx-mo"],
|
|
6129
6164
|
["mtext", "mjx-mtext"]
|
|
6130
|
-
]), Fr = "mi,mn,mo,mtext",
|
|
6165
|
+
]), Fr = "mi,mn,mo,mtext", ia = "mjx-mi,mjx-mn,mjx-mo,mjx-mtext", oa = [
|
|
6131
6166
|
"mjx-mfrac",
|
|
6132
6167
|
"mjx-msqrt",
|
|
6133
6168
|
"mjx-mroot",
|
|
@@ -6135,14 +6170,14 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6135
6170
|
"mjx-munder",
|
|
6136
6171
|
"mjx-mover",
|
|
6137
6172
|
"mjx-munderover"
|
|
6138
|
-
].join(","),
|
|
6173
|
+
].join(","), sa = (e) => e.type === "text-range" ? e.node.parentElement : e.element, tr = (e) => {
|
|
6139
6174
|
let t = e;
|
|
6140
6175
|
for (; t; ) {
|
|
6141
6176
|
if (t.localName?.toLowerCase() === "mjx-container") return t;
|
|
6142
6177
|
t = t.parentElement;
|
|
6143
6178
|
}
|
|
6144
6179
|
return null;
|
|
6145
|
-
},
|
|
6180
|
+
}, vo = (e) => !e || tr(e) ? !1 : !Pt(e), aa = (e) => {
|
|
6146
6181
|
const t = e.getBoundingClientRect?.();
|
|
6147
6182
|
return !!(t && t.width > 0 && t.height > 0);
|
|
6148
6183
|
}, jr = (e) => {
|
|
@@ -6152,38 +6187,38 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6152
6187
|
t = t.parentElement;
|
|
6153
6188
|
}
|
|
6154
6189
|
return null;
|
|
6155
|
-
},
|
|
6190
|
+
}, la = (e, t) => {
|
|
6156
6191
|
if (e.length === 0 || e.length !== t.length) return !1;
|
|
6157
6192
|
for (let n = 0; n < e.length; n += 1) {
|
|
6158
|
-
const r =
|
|
6193
|
+
const r = ra.get(e[n].localName.toLowerCase());
|
|
6159
6194
|
if (!r || t[n].localName.toLowerCase() !== r) return !1;
|
|
6160
6195
|
}
|
|
6161
6196
|
return !0;
|
|
6162
|
-
},
|
|
6163
|
-
if (!e || !
|
|
6197
|
+
}, Xd = (e, t) => {
|
|
6198
|
+
if (!e || !ra.has(e.localName.toLowerCase()) || t.querySelector(oa)) return null;
|
|
6164
6199
|
const n = jr(e), r = t.querySelector("mjx-math");
|
|
6165
6200
|
if (!n || !r) return null;
|
|
6166
6201
|
const i = Array.from(n.querySelectorAll(Fr)), o = i.indexOf(e);
|
|
6167
6202
|
if (o < 0) return null;
|
|
6168
|
-
const s = Array.from(r.querySelectorAll(
|
|
6169
|
-
if (!
|
|
6203
|
+
const s = Array.from(r.querySelectorAll(ia));
|
|
6204
|
+
if (!la(i, s)) return null;
|
|
6170
6205
|
const a = s[o];
|
|
6171
|
-
return !a || !
|
|
6172
|
-
},
|
|
6206
|
+
return !a || !aa(a) ? null : a;
|
|
6207
|
+
}, Jd = (e) => {
|
|
6173
6208
|
const t = tr(e);
|
|
6174
6209
|
if (t) {
|
|
6175
|
-
if (t.querySelector(
|
|
6210
|
+
if (t.querySelector(oa)) return "expression";
|
|
6176
6211
|
const r = jr(e) ?? e, i = t.querySelector("mjx-math");
|
|
6177
6212
|
if (!i) return "expression";
|
|
6178
|
-
const o = Array.from(r.querySelectorAll(Fr)), s = Array.from(i.querySelectorAll(
|
|
6179
|
-
return
|
|
6213
|
+
const o = Array.from(r.querySelectorAll(Fr)), s = Array.from(i.querySelectorAll(ia));
|
|
6214
|
+
return la(o, s) && s.some((a) => aa(a)) ? "token" : "expression";
|
|
6180
6215
|
}
|
|
6181
6216
|
const n = jr(e) ?? e;
|
|
6182
6217
|
return Array.from(n.querySelectorAll(Fr)).some((r) => !Pt(r)) ? "token" : "expression";
|
|
6183
6218
|
}, qr = (e) => {
|
|
6184
|
-
const t =
|
|
6219
|
+
const t = sa(e), n = tr(t);
|
|
6185
6220
|
if (n) {
|
|
6186
|
-
const r =
|
|
6221
|
+
const r = Xd(t, n);
|
|
6187
6222
|
return r ? {
|
|
6188
6223
|
type: "element",
|
|
6189
6224
|
quality: "semantic-token",
|
|
@@ -6194,35 +6229,35 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6194
6229
|
element: n
|
|
6195
6230
|
};
|
|
6196
6231
|
}
|
|
6197
|
-
return e.type === "text-range" ?
|
|
6232
|
+
return e.type === "text-range" ? vo(e.node.parentElement) ? {
|
|
6198
6233
|
type: "text-range",
|
|
6199
6234
|
quality: "semantic-token",
|
|
6200
6235
|
node: e.node,
|
|
6201
6236
|
startOffset: e.startOffset,
|
|
6202
6237
|
endOffset: e.endOffset
|
|
6203
|
-
} : null :
|
|
6238
|
+
} : null : vo(e.element) ? {
|
|
6204
6239
|
type: "element",
|
|
6205
6240
|
quality: e.quality === "region-fallback" ? "expression" : "semantic-token",
|
|
6206
6241
|
element: e.element
|
|
6207
6242
|
} : null;
|
|
6208
|
-
},
|
|
6243
|
+
}, Qd = qr, Zd = () => {
|
|
6209
6244
|
const e = /* @__PURE__ */ new WeakMap();
|
|
6210
6245
|
return (t) => {
|
|
6211
|
-
const n =
|
|
6246
|
+
const n = sa(t), r = tr(n);
|
|
6212
6247
|
if (!n || !r) return qr(t);
|
|
6213
6248
|
if (e.has(n)) return e.get(n) ?? null;
|
|
6214
6249
|
const i = qr(t);
|
|
6215
6250
|
return e.set(n, i), i;
|
|
6216
6251
|
};
|
|
6217
|
-
},
|
|
6252
|
+
}, eh = (e, t, n, r = e.mathAlignments, i = Qd) => {
|
|
6218
6253
|
if (t.chunkSpokenStart === null || t.chunkSpokenEnd === null) return null;
|
|
6219
6254
|
let o = null;
|
|
6220
6255
|
for (const s of r) {
|
|
6221
|
-
const a =
|
|
6256
|
+
const a = md(s.alignment, {
|
|
6222
6257
|
position: t.chunkSpokenStart,
|
|
6223
6258
|
length: Math.max(1, t.chunkSpokenEnd - t.chunkSpokenStart),
|
|
6224
6259
|
boundaryWord: n.word
|
|
6225
|
-
}) ||
|
|
6260
|
+
}) || bd(s.alignment, { boundaryWord: n.word });
|
|
6226
6261
|
if (!a) continue;
|
|
6227
6262
|
const l = i(a);
|
|
6228
6263
|
if (l) {
|
|
@@ -6231,7 +6266,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6231
6266
|
}
|
|
6232
6267
|
}
|
|
6233
6268
|
return o;
|
|
6234
|
-
},
|
|
6269
|
+
}, ca = (e, t, n) => {
|
|
6235
6270
|
if (!e || typeof document > "u" || n <= t) return null;
|
|
6236
6271
|
const r = e.get(t);
|
|
6237
6272
|
let i = e.get(Math.max(t, n - 1));
|
|
@@ -6243,17 +6278,17 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6243
6278
|
} catch {
|
|
6244
6279
|
return null;
|
|
6245
6280
|
}
|
|
6246
|
-
},
|
|
6281
|
+
}, th = (e, t) => {
|
|
6247
6282
|
if (!e.catalogAlignment || t.chunkSpokenStart === null) return null;
|
|
6248
|
-
const n =
|
|
6283
|
+
const n = Fu(e.catalogAlignment, t.chunkSpokenStart);
|
|
6249
6284
|
if (!n) return null;
|
|
6250
|
-
const r =
|
|
6285
|
+
const r = ca(e.visibleMap, n.start, n.end);
|
|
6251
6286
|
return r ? {
|
|
6252
6287
|
type: "range",
|
|
6253
6288
|
quality: e.catalogAlignment.playbackMode === "exact-word" ? "exact-word" : "semantic-token",
|
|
6254
6289
|
range: r
|
|
6255
6290
|
} : null;
|
|
6256
|
-
},
|
|
6291
|
+
}, nh = (e) => e.regionRange ? {
|
|
6257
6292
|
type: "range",
|
|
6258
6293
|
quality: "region",
|
|
6259
6294
|
range: e.regionRange
|
|
@@ -6261,43 +6296,43 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6261
6296
|
type: "element",
|
|
6262
6297
|
quality: "region",
|
|
6263
6298
|
element: e.regionElement
|
|
6264
|
-
} : null,
|
|
6299
|
+
} : null, mo = (e, t = e.chunk.mathAlignments) => {
|
|
6265
6300
|
if (t.length !== 1) return null;
|
|
6266
6301
|
const n = t[0]?.alignment.result.fallbackTarget;
|
|
6267
6302
|
return n ? e.renderedMathTargetResolver(n) : null;
|
|
6268
|
-
},
|
|
6303
|
+
}, rh = (e, t) => e ? t.mathAlignments.filter(({ element: n }) => {
|
|
6269
6304
|
try {
|
|
6270
6305
|
return e.type === "range" ? e.range.intersectsNode(n) : e.type === "element" ? e.element === n || e.element.contains(n) : e.node.parentElement?.contains(n) || !1;
|
|
6271
6306
|
} catch {
|
|
6272
6307
|
return !1;
|
|
6273
6308
|
}
|
|
6274
|
-
}) : t.mathAlignments,
|
|
6309
|
+
}) : t.mathAlignments, bo = () => ({
|
|
6275
6310
|
activeTarget: null,
|
|
6276
6311
|
regionTarget: null,
|
|
6277
6312
|
quality: "region",
|
|
6278
6313
|
confidence: 0,
|
|
6279
6314
|
reason: "boundary chunk id was not found"
|
|
6280
|
-
}),
|
|
6315
|
+
}), yo = (e) => e.length === 1 ? e[0].element : null, ih = (e, t) => t.length > 0 && t.every(({ element: n }) => e.mathCapabilityByElement.get(n) === "token"), oh = 3, sh = (e, t, n) => {
|
|
6281
6316
|
if (!t || t.type !== "range") return !1;
|
|
6282
6317
|
const { startContainer: r, endContainer: i } = t.range;
|
|
6283
|
-
return r === i && r.nodeType ===
|
|
6284
|
-
},
|
|
6318
|
+
return r === i && r.nodeType === oh ? !1 : n.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(r) && o.contains(i));
|
|
6319
|
+
}, ah = (e, t) => ({
|
|
6285
6320
|
chunk: e,
|
|
6286
|
-
regionTarget:
|
|
6287
|
-
renderedMathTargetResolver:
|
|
6288
|
-
mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: n }) => [n, t ?
|
|
6321
|
+
regionTarget: nh(e),
|
|
6322
|
+
renderedMathTargetResolver: Zd(),
|
|
6323
|
+
mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: n }) => [n, t ? Jd(n) : "expression"])),
|
|
6289
6324
|
heldTokenByElement: /* @__PURE__ */ new Map()
|
|
6290
|
-
}),
|
|
6291
|
-
const t = e.mathTokenHighlighting !== !1, n = new Map(e.chunks.map((r) => [r.id,
|
|
6325
|
+
}), lh = (e) => {
|
|
6326
|
+
const t = e.mathTokenHighlighting !== !1, n = new Map(e.chunks.map((r) => [r.id, ah(r, t)]));
|
|
6292
6327
|
return {
|
|
6293
6328
|
chunks: e.chunks,
|
|
6294
6329
|
resolveInitial(r) {
|
|
6295
6330
|
const i = n.get(r);
|
|
6296
|
-
if (!i) return
|
|
6331
|
+
if (!i) return bo();
|
|
6297
6332
|
const o = i.chunk.mathAlignments, s = o.length === 1 ? o[0].element : null, a = s ? i.mathCapabilityByElement.get(s) : null;
|
|
6298
6333
|
return St(a === "expression" ? {
|
|
6299
6334
|
semanticTarget: null,
|
|
6300
|
-
expressionTarget:
|
|
6335
|
+
expressionTarget: mo(i),
|
|
6301
6336
|
regionTarget: i.regionTarget,
|
|
6302
6337
|
confidence: 0.5,
|
|
6303
6338
|
reason: "initial expression (sticky expression mode)"
|
|
@@ -6311,10 +6346,10 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6311
6346
|
},
|
|
6312
6347
|
resolveBoundary(r) {
|
|
6313
6348
|
const i = n.get(r.chunkId);
|
|
6314
|
-
if (!i) return
|
|
6315
|
-
const { chunk: o } = i, s =
|
|
6349
|
+
if (!i) return bo();
|
|
6350
|
+
const { chunk: o } = i, s = Yd(o, r), a = th(o, s), l = rh(a, o), c = (!a || l.length > 0 ? eh(o, s, r, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, d = c && c.quality === "expression" ? c : null;
|
|
6316
6351
|
if (u) {
|
|
6317
|
-
const h =
|
|
6352
|
+
const h = yo(l);
|
|
6318
6353
|
return h && i.heldTokenByElement.set(h, u), St({
|
|
6319
6354
|
semanticTarget: u,
|
|
6320
6355
|
expressionTarget: null,
|
|
@@ -6323,15 +6358,15 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6323
6358
|
reason: s.reason
|
|
6324
6359
|
});
|
|
6325
6360
|
}
|
|
6326
|
-
if (a && (t ? !
|
|
6361
|
+
if (a && (t ? !sh(i, a, l) : l.length === 0)) return St({
|
|
6327
6362
|
semanticTarget: a,
|
|
6328
6363
|
expressionTarget: null,
|
|
6329
6364
|
regionTarget: i.regionTarget,
|
|
6330
6365
|
confidence: s.confidence,
|
|
6331
6366
|
reason: s.reason
|
|
6332
6367
|
});
|
|
6333
|
-
if (
|
|
6334
|
-
const h =
|
|
6368
|
+
if (ih(i, l)) {
|
|
6369
|
+
const h = yo(l), p = h ? i.heldTokenByElement.get(h) ?? null : null;
|
|
6335
6370
|
return St({
|
|
6336
6371
|
semanticTarget: p,
|
|
6337
6372
|
expressionTarget: null,
|
|
@@ -6342,21 +6377,21 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6342
6377
|
}
|
|
6343
6378
|
return St({
|
|
6344
6379
|
semanticTarget: null,
|
|
6345
|
-
expressionTarget: d ??
|
|
6380
|
+
expressionTarget: d ?? mo(i, l),
|
|
6346
6381
|
regionTarget: i.regionTarget,
|
|
6347
6382
|
confidence: s.confidence,
|
|
6348
6383
|
reason: s.reason
|
|
6349
6384
|
});
|
|
6350
6385
|
}
|
|
6351
6386
|
};
|
|
6352
|
-
},
|
|
6387
|
+
}, ch = (e) => {
|
|
6353
6388
|
if (e.alignment?.boundaryOffsetMode) return e.alignment.boundaryOffsetMode;
|
|
6354
6389
|
const t = e.mathAlignment?.speech.boundaryOffsetSpace;
|
|
6355
6390
|
return t || "plain-spoken-text";
|
|
6356
|
-
},
|
|
6391
|
+
}, uh = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
|
|
6357
6392
|
element: e.sourceElement,
|
|
6358
6393
|
alignment: e.mathAlignment
|
|
6359
|
-
}] : [],
|
|
6394
|
+
}] : [], dh = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
|
|
6360
6395
|
speechText: e.speechText || "",
|
|
6361
6396
|
visibleText: e.visibleText || e.speechText || "",
|
|
6362
6397
|
sourceElement: e.sourceElement || e.contentRoot,
|
|
@@ -6373,9 +6408,9 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6373
6408
|
regionRange: t.regionRange,
|
|
6374
6409
|
visibleMap: t.visibleMap,
|
|
6375
6410
|
catalogAlignment: t.alignment,
|
|
6376
|
-
mathAlignments:
|
|
6377
|
-
offsetSpace:
|
|
6378
|
-
})),
|
|
6411
|
+
mathAlignments: uh(t),
|
|
6412
|
+
offsetSpace: ch(t)
|
|
6413
|
+
})), hh = [
|
|
6379
6414
|
"[data-pie-tts-region]",
|
|
6380
6415
|
"[data-catalog-region]",
|
|
6381
6416
|
"li",
|
|
@@ -6385,18 +6420,18 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6385
6420
|
"[role='group']",
|
|
6386
6421
|
"[role='region']",
|
|
6387
6422
|
"div"
|
|
6388
|
-
].join(","),
|
|
6389
|
-
const n = e.closest(
|
|
6423
|
+
].join(","), ua = (e, t) => {
|
|
6424
|
+
const n = e.closest(hh);
|
|
6390
6425
|
return n && t.contains(n) ? n : e;
|
|
6391
|
-
},
|
|
6426
|
+
}, fh = (e, t, n) => {
|
|
6392
6427
|
const r = /* @__PURE__ */ new Map();
|
|
6393
6428
|
for (let i = t; i < n; i++) {
|
|
6394
6429
|
const o = e.get(i);
|
|
6395
6430
|
o && r.set(i - t, o);
|
|
6396
6431
|
}
|
|
6397
6432
|
return r;
|
|
6398
|
-
},
|
|
6399
|
-
const t = Kt(e.contentRoot, e.textProcessingOptions), n = await
|
|
6433
|
+
}, ph = async (e) => {
|
|
6434
|
+
const t = Kt(e.contentRoot, e.textProcessingOptions), n = await Dd({
|
|
6400
6435
|
chunks: t.chunks,
|
|
6401
6436
|
visibleText: t.visibleText,
|
|
6402
6437
|
language: e.language,
|
|
@@ -6414,8 +6449,8 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6414
6449
|
segment: r,
|
|
6415
6450
|
anchor: {
|
|
6416
6451
|
sourceElement: a,
|
|
6417
|
-
regionElement:
|
|
6418
|
-
visibleMap:
|
|
6452
|
+
regionElement: ua(a, e.contentRoot),
|
|
6453
|
+
visibleMap: fh(t.map, r.visibleSpan.start, r.visibleSpan.end)
|
|
6419
6454
|
}
|
|
6420
6455
|
};
|
|
6421
6456
|
}
|
|
@@ -6435,8 +6470,8 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6435
6470
|
containsMathMarkup: t.containsMathMarkup,
|
|
6436
6471
|
visibleText: t.visibleText
|
|
6437
6472
|
};
|
|
6438
|
-
},
|
|
6439
|
-
const n =
|
|
6473
|
+
}, gh = (e, t) => {
|
|
6474
|
+
const n = Fs({
|
|
6440
6475
|
speechText: e.spokenText,
|
|
6441
6476
|
visibleText: e.spokenText
|
|
6442
6477
|
});
|
|
@@ -6445,13 +6480,13 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6445
6480
|
visibleText: e.visibleText,
|
|
6446
6481
|
sourceElement: t.sourceElement,
|
|
6447
6482
|
regionElement: t.regionElement,
|
|
6448
|
-
regionRange:
|
|
6483
|
+
regionRange: ca(t.visibleMap, 0, e.visibleText.length) ?? void 0,
|
|
6449
6484
|
speechMatchesVisibleText: !0,
|
|
6450
6485
|
playbackMode: n.playbackMode,
|
|
6451
6486
|
alignment: n,
|
|
6452
6487
|
visibleMap: t.visibleMap
|
|
6453
6488
|
};
|
|
6454
|
-
},
|
|
6489
|
+
}, da = (e, t) => {
|
|
6455
6490
|
const n = t.sourceElement;
|
|
6456
6491
|
return {
|
|
6457
6492
|
speechText: e.spokenText,
|
|
@@ -6464,7 +6499,7 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6464
6499
|
speechText: e.spokenText
|
|
6465
6500
|
}) : void 0
|
|
6466
6501
|
};
|
|
6467
|
-
},
|
|
6502
|
+
}, vh = (e, t, n) => {
|
|
6468
6503
|
const r = t.sourceElement;
|
|
6469
6504
|
return {
|
|
6470
6505
|
speechText: n,
|
|
@@ -6476,15 +6511,15 @@ var ku = /* @__PURE__ */ new Set([
|
|
|
6476
6511
|
mathElement: r,
|
|
6477
6512
|
speechText: n
|
|
6478
6513
|
}) : void 0,
|
|
6479
|
-
plainFallback:
|
|
6514
|
+
plainFallback: da(e, t)
|
|
6480
6515
|
};
|
|
6481
|
-
},
|
|
6516
|
+
}, mh = (e, t = {}) => e.items.map(({ segment: n, anchor: r }) => n.kind === "prose" ? gh(n, r) : t.format === "ssml" && n.ssml ? vh(n, r, n.ssml) : da(n, r)), bh = "pie-tts-control-handoff", L;
|
|
6482
6517
|
(function(e) {
|
|
6483
6518
|
e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
|
|
6484
|
-
})(
|
|
6485
|
-
var
|
|
6519
|
+
})(L || (L = {}));
|
|
6520
|
+
var yh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, _h = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? yh(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, Th = class Vr {
|
|
6486
6521
|
constructor() {
|
|
6487
|
-
m(this, "currentProvider", null), m(this, "provider", null), m(this, "highlightCoordinator", null), m(this, "catalogResolver", null), m(this, "state",
|
|
6522
|
+
m(this, "currentProvider", null), m(this, "provider", null), m(this, "highlightCoordinator", null), m(this, "catalogResolver", null), m(this, "state", L.IDLE), m(this, "ttsConfig", {}), m(this, "currentText", null), m(this, "currentContentElement", null), m(this, "normalizedToDOM", /* @__PURE__ */ new Map()), m(this, "listeners", /* @__PURE__ */ new Map()), m(this, "lastError", null), m(this, "speakRunId", 0), m(this, "currentBoundaryOffset", 0), m(this, "activeWordBoundaryOffset", 0), m(this, "seekSegments", []), m(this, "sentenceHighlightSegments", []), m(this, "currentSeekSegmentIndex", 0), m(this, "activeSentenceStartOffset", null), m(this, "activeHighlightMode", "word"), m(this, "lastRenderedRegionTarget", null), m(this, "telemetryReporter", null), m(this, "generatedMathSpeechResolver", Vd());
|
|
6488
6523
|
}
|
|
6489
6524
|
debugLog(t, n) {
|
|
6490
6525
|
Vr.debugEnabled && (n === void 0 ? console.debug(t) : console.debug(t, n));
|
|
@@ -6607,7 +6642,7 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6607
6642
|
return t.includes("<") ? /<\s*break\b|<\s*speak\b|<\s*prosody\b|<\s*p\b|<\s*s\b/i.test(t) : !1;
|
|
6608
6643
|
}
|
|
6609
6644
|
isElementHidden(t) {
|
|
6610
|
-
return
|
|
6645
|
+
return Is(t);
|
|
6611
6646
|
}
|
|
6612
6647
|
getBoundaryStrength(t) {
|
|
6613
6648
|
const n = Number(t.getAttribute("data-tts-break-ms"));
|
|
@@ -6749,7 +6784,7 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6749
6784
|
this.currentBoundaryOffset = 0;
|
|
6750
6785
|
const s = this.provider.onWordBoundary;
|
|
6751
6786
|
this.provider.onWordBoundary = (a, l, c) => {
|
|
6752
|
-
Number.isFinite(l) && (this.currentBoundaryOffset = l, this.currentSeekSegmentIndex = this.getCurrentSeekSegmentIndex())
|
|
6787
|
+
s?.(a, l, c), Number.isFinite(l) && (this.currentBoundaryOffset = l, this.currentSeekSegmentIndex = this.getCurrentSeekSegmentIndex());
|
|
6753
6788
|
};
|
|
6754
6789
|
try {
|
|
6755
6790
|
await o.speakSegments(t);
|
|
@@ -6758,6 +6793,10 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6758
6793
|
}
|
|
6759
6794
|
return;
|
|
6760
6795
|
}
|
|
6796
|
+
this.configureWordBoundaryHighlighting({
|
|
6797
|
+
highlightMode: r?.highlightMode || "word",
|
|
6798
|
+
wordBoundaryOffset: this.activeWordBoundaryOffset
|
|
6799
|
+
});
|
|
6761
6800
|
for (const s of t) {
|
|
6762
6801
|
if (n !== this.speakRunId) return;
|
|
6763
6802
|
const a = this.seekSegments.findIndex((c) => c.startOffset === s.startOffset);
|
|
@@ -6829,13 +6868,13 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6829
6868
|
catalogId: n?.catalogId
|
|
6830
6869
|
}), this.initializeSpeakTracking(a, n);
|
|
6831
6870
|
const p = n?.highlightModeOverride || (d ? this.resolveHighlightMode() : "sentence");
|
|
6832
|
-
this.activeHighlightMode = p;
|
|
6871
|
+
this.activeHighlightMode = p, this.activeWordBoundaryOffset = n?.wordBoundaryOffset || 0;
|
|
6833
6872
|
const v = this.hasExplicitBreakSemantics(o), b = !!this.currentContentElement && !c && !v && d;
|
|
6834
6873
|
if (this.seekSegments = v || !d ? [] : b && this.currentContentElement ? this.createSpeechPlan(this.currentContentElement, l) : this.createSeekSegmentsFromText(a), this.sentenceHighlightSegments = v ? [] : this.createSentenceHighlightSegments({
|
|
6835
6874
|
contentToSpeak: a,
|
|
6836
6875
|
shouldUsePlan: b,
|
|
6837
6876
|
playbackSegments: this.seekSegments
|
|
6838
|
-
}), this.setState(
|
|
6877
|
+
}), this.setState(L.LOADING), this.prepareHighlightsForSpeak({
|
|
6839
6878
|
contentToSpeak: a,
|
|
6840
6879
|
options: n,
|
|
6841
6880
|
highlightMode: p,
|
|
@@ -6843,23 +6882,23 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6843
6882
|
}), d ? this.configureWordBoundaryHighlighting({
|
|
6844
6883
|
highlightMode: p,
|
|
6845
6884
|
wordBoundaryOffset: n?.wordBoundaryOffset || 0
|
|
6846
|
-
}) : this.clearWordBoundaryHighlighting(), this.setState(
|
|
6885
|
+
}) : this.clearWordBoundaryHighlighting(), this.setState(L.PLAYING), await this.executeSpeakPlayback({
|
|
6847
6886
|
shouldUsePlan: b,
|
|
6848
6887
|
runId: r,
|
|
6849
6888
|
highlightMode: p,
|
|
6850
6889
|
contentToSpeak: s,
|
|
6851
6890
|
speechChunks: h
|
|
6852
6891
|
}), r !== this.speakRunId) return;
|
|
6853
|
-
this.setState(
|
|
6892
|
+
this.setState(L.IDLE), this.clearHighlightsAndTracking();
|
|
6854
6893
|
} catch (i) {
|
|
6855
6894
|
let o = i;
|
|
6856
6895
|
if (console.error("TTS error:", o), this.lastError = o instanceof Error ? o.message : String(o), r !== this.speakRunId) return;
|
|
6857
|
-
throw this.setState(
|
|
6896
|
+
throw this.setState(L.ERROR), this.clearHighlightsAndTracking(), o;
|
|
6858
6897
|
}
|
|
6859
6898
|
}
|
|
6860
6899
|
async switchProviderToBrowser(t, n) {
|
|
6861
6900
|
if (!this.currentProvider) return !1;
|
|
6862
|
-
const r = new
|
|
6901
|
+
const r = new Cs(), i = this.currentProvider.providerId, o = { ...this.ttsConfig }, s = n?.operation || "tts-initialize", a = n?.contentToSpeak ?? "", l = a.replace(/\s+/g, " ").trim().slice(0, 120), c = a.length > 0 ? {
|
|
6863
6902
|
textLength: a.length,
|
|
6864
6903
|
textPreview: l.length < a.length ? `${l}…` : l
|
|
6865
6904
|
} : {};
|
|
@@ -7015,7 +7054,7 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7015
7054
|
const d = u, h = s(d);
|
|
7016
7055
|
if (h) {
|
|
7017
7056
|
o();
|
|
7018
|
-
const p = Kt(d, this.getTextProcessingOptions(n.language)), v = p.visibleText || D(d.textContent || ""), b =
|
|
7057
|
+
const p = Kt(d, this.getTextProcessingOptions(n.language)), v = p.visibleText || D(d.textContent || ""), b = Fs({
|
|
7019
7058
|
speechText: h.content,
|
|
7020
7059
|
visibleText: v
|
|
7021
7060
|
}), g = a(d, v), y = g ? Vn({
|
|
@@ -7032,7 +7071,7 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7032
7071
|
speechText: h.content,
|
|
7033
7072
|
visibleText: v,
|
|
7034
7073
|
sourceElement: d,
|
|
7035
|
-
regionElement:
|
|
7074
|
+
regionElement: ua(d, t),
|
|
7036
7075
|
speechMatchesVisibleText: N === v,
|
|
7037
7076
|
playbackMode: b.playbackMode,
|
|
7038
7077
|
alignment: b,
|
|
@@ -7051,7 +7090,7 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7051
7090
|
return !t || t.providerId?.toLowerCase() === "browser" ? "plain" : t.getCapabilities?.().supportsSSML ? "ssml" : "plain";
|
|
7052
7091
|
}
|
|
7053
7092
|
async resolveGeneratedSpeechContent(t, n, r) {
|
|
7054
|
-
const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await
|
|
7093
|
+
const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await ph({
|
|
7055
7094
|
contentRoot: t,
|
|
7056
7095
|
language: r,
|
|
7057
7096
|
mathSpeech: this.getMathSpeechOptions(),
|
|
@@ -7068,7 +7107,7 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7068
7107
|
containsMathMarkup: !1,
|
|
7069
7108
|
speechMatchesVisibleText: !0
|
|
7070
7109
|
};
|
|
7071
|
-
const c =
|
|
7110
|
+
const c = mh(o, { format: i }), u = o.plainSpeechText;
|
|
7072
7111
|
return {
|
|
7073
7112
|
contentToSpeak: u,
|
|
7074
7113
|
speechText: u,
|
|
@@ -7141,7 +7180,7 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7141
7180
|
}
|
|
7142
7181
|
}
|
|
7143
7182
|
highlightRenderableRegionTarget(t) {
|
|
7144
|
-
if (!(!this.highlightCoordinator || !t || typeof document > "u") && !
|
|
7183
|
+
if (!(!this.highlightCoordinator || !t || typeof document > "u") && !_h(this.lastRenderedRegionTarget, t))
|
|
7145
7184
|
try {
|
|
7146
7185
|
const n = document.createRange();
|
|
7147
7186
|
if (t.type === "element") n.selectNodeContents(t.element);
|
|
@@ -7192,10 +7231,10 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7192
7231
|
async speakCatalogChunkOnce(t, n) {
|
|
7193
7232
|
if (!this.provider) return;
|
|
7194
7233
|
this.lastRenderedRegionTarget = null;
|
|
7195
|
-
const r = t.regionElement || t.sourceElement || this.currentContentElement, i = r ?
|
|
7234
|
+
const r = t.regionElement || t.sourceElement || this.currentContentElement, i = r ? dh({
|
|
7196
7235
|
contentRoot: r,
|
|
7197
7236
|
chunks: [t]
|
|
7198
|
-
})[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ?
|
|
7237
|
+
})[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? lh({
|
|
7199
7238
|
chunks: [i],
|
|
7200
7239
|
mathTokenHighlighting: o
|
|
7201
7240
|
}) : null;
|
|
@@ -7245,7 +7284,7 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7245
7284
|
this.provider && await this.provider.speak(t.contentToSpeak);
|
|
7246
7285
|
}
|
|
7247
7286
|
clearHighlightsAndTracking() {
|
|
7248
|
-
this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null;
|
|
7287
|
+
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;
|
|
7249
7288
|
}
|
|
7250
7289
|
async speakRange(t, n) {
|
|
7251
7290
|
if (!this.provider) throw new Error("TTS service not initialized");
|
|
@@ -7272,27 +7311,41 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7272
7311
|
});
|
|
7273
7312
|
}
|
|
7274
7313
|
pause() {
|
|
7275
|
-
this.provider && this.state ===
|
|
7314
|
+
this.provider && this.state === L.PLAYING && (this.provider.pause(), this.setState(L.PAUSED));
|
|
7276
7315
|
}
|
|
7277
7316
|
resume() {
|
|
7278
|
-
this.provider && this.state ===
|
|
7317
|
+
this.provider && this.state === L.PAUSED && (this.provider.resume(), this.setState(L.PLAYING));
|
|
7318
|
+
}
|
|
7319
|
+
normalizePlaybackRate(t) {
|
|
7320
|
+
return Number.isFinite(t) ? Math.max(0.25, Math.min(4, t)) : 1;
|
|
7321
|
+
}
|
|
7322
|
+
async restartFromSeekIndex(t) {
|
|
7323
|
+
if (!this.provider || this.seekSegments.length === 0) return;
|
|
7324
|
+
const n = Math.max(0, Math.min(this.seekSegments.length - 1, t));
|
|
7325
|
+
this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.currentSeekSegmentIndex = n;
|
|
7326
|
+
const r = ++this.speakRunId, i = this.seekSegments.slice(n);
|
|
7327
|
+
this.setState(L.PLAYING);
|
|
7328
|
+
try {
|
|
7329
|
+
if (this.configureWordBoundaryHighlighting({
|
|
7330
|
+
highlightMode: this.activeHighlightMode,
|
|
7331
|
+
wordBoundaryOffset: this.activeWordBoundaryOffset
|
|
7332
|
+
}), await this.speakWithPlan(i, r, { highlightMode: this.activeHighlightMode }), r !== this.speakRunId) return;
|
|
7333
|
+
this.setState(L.IDLE), this.clearHighlightsAndTracking();
|
|
7334
|
+
} catch (o) {
|
|
7335
|
+
if (r !== this.speakRunId) return;
|
|
7336
|
+
throw this.lastError = o instanceof Error ? o.message : String(o), this.setState(L.ERROR), this.clearHighlightsAndTracking(), o;
|
|
7337
|
+
}
|
|
7338
|
+
}
|
|
7339
|
+
async setPlaybackRate(t) {
|
|
7340
|
+
const n = this.normalizePlaybackRate(t);
|
|
7341
|
+
await this.updateSettings({ rate: n }), !(this.state !== L.PLAYING || !this.currentText || this.seekSegments.length === 0 || this.hasExplicitBreakSemantics(this.currentText)) && await this.restartFromSeekIndex(this.getCurrentSeekSegmentIndex());
|
|
7279
7342
|
}
|
|
7280
7343
|
async seekBy(t) {
|
|
7281
|
-
if (!this.provider || !this.currentText || this.state !==
|
|
7344
|
+
if (!this.provider || !this.currentText || this.state !== L.PLAYING && this.state !== L.PAUSED || this.hasExplicitBreakSemantics(this.currentText) || this.seekSegments.length === 0) return;
|
|
7282
7345
|
const n = Number.isFinite(t) ? Math.trunc(t) : 0;
|
|
7283
7346
|
if (n === 0) return;
|
|
7284
7347
|
const r = this.getCurrentSeekSegmentIndex(), i = Math.max(0, Math.min(this.seekSegments.length - 1, r + n));
|
|
7285
|
-
|
|
7286
|
-
this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.currentSeekSegmentIndex = i;
|
|
7287
|
-
const o = ++this.speakRunId, s = this.seekSegments.slice(i);
|
|
7288
|
-
this.setState(P.PLAYING);
|
|
7289
|
-
try {
|
|
7290
|
-
if (await this.speakWithPlan(s, o, { highlightMode: this.activeHighlightMode }), o !== this.speakRunId) return;
|
|
7291
|
-
this.setState(P.IDLE), this.clearHighlightsAndTracking();
|
|
7292
|
-
} catch (a) {
|
|
7293
|
-
if (o !== this.speakRunId) return;
|
|
7294
|
-
throw this.lastError = a instanceof Error ? a.message : String(a), this.setState(P.ERROR), this.clearHighlightsAndTracking(), a;
|
|
7295
|
-
}
|
|
7348
|
+
i !== r && await this.restartFromSeekIndex(i);
|
|
7296
7349
|
}
|
|
7297
7350
|
async seekForward(t = 1) {
|
|
7298
7351
|
const n = Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : 1;
|
|
@@ -7303,16 +7356,16 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7303
7356
|
await this.seekBy(-n);
|
|
7304
7357
|
}
|
|
7305
7358
|
stop() {
|
|
7306
|
-
this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.setState(
|
|
7359
|
+
this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.setState(L.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);
|
|
7307
7360
|
}
|
|
7308
7361
|
requestControlHandoff() {
|
|
7309
|
-
typeof window > "u" || window.dispatchEvent(new CustomEvent(
|
|
7362
|
+
typeof window > "u" || window.dispatchEvent(new CustomEvent(bh, { detail: { source: "host" } }));
|
|
7310
7363
|
}
|
|
7311
7364
|
isPlaying() {
|
|
7312
|
-
return this.state ===
|
|
7365
|
+
return this.state === L.PLAYING;
|
|
7313
7366
|
}
|
|
7314
7367
|
isPaused() {
|
|
7315
|
-
return this.state ===
|
|
7368
|
+
return this.state === L.PAUSED;
|
|
7316
7369
|
}
|
|
7317
7370
|
getState() {
|
|
7318
7371
|
return this.state;
|
|
@@ -7340,8 +7393,8 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7340
7393
|
providerId: "tts",
|
|
7341
7394
|
previousState: n,
|
|
7342
7395
|
state: t
|
|
7343
|
-
}), t ===
|
|
7344
|
-
const r = n ===
|
|
7396
|
+
}), t === L.PLAYING) {
|
|
7397
|
+
const r = n === L.PAUSED ? "pie-tool-playback-resume" : "pie-tool-playback-start";
|
|
7345
7398
|
this.emitTelemetry(r, {
|
|
7346
7399
|
toolId: "textToSpeech",
|
|
7347
7400
|
providerId: "tts",
|
|
@@ -7350,7 +7403,7 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7350
7403
|
});
|
|
7351
7404
|
return;
|
|
7352
7405
|
}
|
|
7353
|
-
if (t ===
|
|
7406
|
+
if (t === L.PAUSED) {
|
|
7354
7407
|
this.emitTelemetry("pie-tool-playback-pause", {
|
|
7355
7408
|
toolId: "textToSpeech",
|
|
7356
7409
|
providerId: "tts",
|
|
@@ -7359,7 +7412,7 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7359
7412
|
});
|
|
7360
7413
|
return;
|
|
7361
7414
|
}
|
|
7362
|
-
if (t ===
|
|
7415
|
+
if (t === L.ERROR) {
|
|
7363
7416
|
this.emitTelemetry("pie-tool-playback-error", {
|
|
7364
7417
|
toolId: "textToSpeech",
|
|
7365
7418
|
providerId: "tts",
|
|
@@ -7369,7 +7422,7 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7369
7422
|
});
|
|
7370
7423
|
return;
|
|
7371
7424
|
}
|
|
7372
|
-
t ===
|
|
7425
|
+
t === L.IDLE && (n === L.PLAYING || n === L.PAUSED || n === L.LOADING) && this.emitTelemetry("pie-tool-playback-stop", {
|
|
7373
7426
|
toolId: "textToSpeech",
|
|
7374
7427
|
providerId: "tts",
|
|
7375
7428
|
previousState: n,
|
|
@@ -7377,14 +7430,14 @@ var hh = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
7377
7430
|
});
|
|
7378
7431
|
}
|
|
7379
7432
|
};
|
|
7380
|
-
m(
|
|
7433
|
+
m(Th, "debugEnabled", (() => {
|
|
7381
7434
|
try {
|
|
7382
7435
|
if (typeof process < "u" && process.env?.PIE_TTS_DEBUG === "1") return !0;
|
|
7383
7436
|
} catch {
|
|
7384
7437
|
}
|
|
7385
7438
|
return globalThis.__PIE_TTS_DEBUG__ === !0;
|
|
7386
7439
|
})());
|
|
7387
|
-
var
|
|
7440
|
+
var Uh = Ec({
|
|
7388
7441
|
policy: {
|
|
7389
7442
|
allowed: [],
|
|
7390
7443
|
blocked: []
|
|
@@ -7395,7 +7448,7 @@ var Hh = Tc({
|
|
|
7395
7448
|
passage: []
|
|
7396
7449
|
},
|
|
7397
7450
|
providers: {}
|
|
7398
|
-
}),
|
|
7451
|
+
}), Sh = /* @__PURE__ */ Tt('<button class="pie-tool-annotation-toolbar__highlight-swatch svelte-g8qu62"><span class="pie-sr-only svelte-g8qu62"> </span></button>'), wh = /* @__PURE__ */ Tt('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-g8qu62" aria-label="Read selected text aloud" title="Read Aloud"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z"></path></svg></button>', 1), kh = /* @__PURE__ */ Tt('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--warning svelte-g8qu62" aria-label="Remove this annotation" title="Remove"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path></svg></button>'), Eh = /* @__PURE__ */ Tt('<button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--danger svelte-g8qu62" aria-label="Clear all annotations from document" title="Clear All">Clear All</button>'), xh = /* @__PURE__ */ Tt('<div class="divider divider-horizontal mx-0 w-px svelte-g8qu62"></div> <!> <!>', 1), Ah = /* @__PURE__ */ Tt('<div class="pie-tool-annotation-toolbar notranslate svelte-g8qu62" role="toolbar" aria-label="Text annotation toolbar" translate="no"><!> <button class="pie-tool-annotation-toolbar__button pie-tool-annotation-toolbar__button--icon svelte-g8qu62" aria-label="Underline selected text" title="Underline"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18" fill="currentColor" aria-hidden="true" class="svelte-g8qu62"><path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z"></path></svg></button> <!> <!></div>'), Ch = /* @__PURE__ */ Tt('<div style="display: none;" aria-hidden="true"></div> <!> <div role="status" aria-live="polite" aria-atomic="true" class="pie-sr-only svelte-g8qu62"> </div>', 1), Mh = {
|
|
7399
7452
|
hash: "svelte-g8qu62",
|
|
7400
7453
|
code: `.pie-tool-annotation-toolbar.svelte-g8qu62 {position:fixed;z-index:4200;display:flex;gap:0.25rem;padding:0.5rem;border-radius:0.5rem;background:var(--pie-background, #fff);color:var(--pie-text, #111827);border:1px solid var(--pie-border, #d1d5db);box-shadow:0 10px 25px -8px rgb(0 0 0 / 0.3);user-select:none;}.pie-tool-annotation-toolbar__highlight-swatch.svelte-g8qu62 {width:2.5rem;height:2rem;border:2px solid color-mix(in srgb, var(--pie-border-dark, #111827) 20%, transparent);border-radius:0.375rem;cursor:pointer;transition:all 0.15s ease;display:flex;align-items:center;justify-content:center;padding:0;}.pie-tool-annotation-toolbar__highlight-swatch.svelte-g8qu62:hover {transform:scale(1.1);border-color:color-mix(in srgb, var(--pie-border-dark, #111827) 45%, transparent);box-shadow:0 2px 8px rgb(0 0 0 / 0.15);}.pie-tool-annotation-toolbar__highlight-swatch.svelte-g8qu62:focus-visible {outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #3f51b5));outline-offset:2px;}.pie-tool-annotation-toolbar.svelte-g8qu62 .divider-horizontal:where(.svelte-g8qu62) {height:auto;width:1px;background-color:color-mix(in srgb, var(--pie-border, #d1d5db) 70%, transparent);}
|
|
7401
7454
|
|
|
@@ -7403,8 +7456,8 @@ var Hh = Tc({
|
|
|
7403
7456
|
|
|
7404
7457
|
/* Button styling */.pie-tool-annotation-toolbar__button.svelte-g8qu62 {display:inline-flex;align-items:center;justify-content:center;gap:0.35rem;padding:0.4rem 0.55rem;border:1px solid var(--pie-button-border, #d1d5db);border-radius:0.4rem;background:var(--pie-button-bg, #fff);color:var(--pie-button-color, var(--pie-text, #111827));cursor:pointer;}.pie-tool-annotation-toolbar__button--icon.svelte-g8qu62 {min-width:2rem;min-height:2rem;padding:0.45rem;}.pie-tool-annotation-toolbar__button.svelte-g8qu62:hover {background:var(--pie-button-hover-bg, #f9fafb);color:var(--pie-button-hover-color, var(--pie-text, #111827));border-color:var(--pie-button-hover-border, #9ca3af);}.pie-tool-annotation-toolbar__button.svelte-g8qu62:focus-visible {outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #3f51b5));outline-offset:2px;}.pie-tool-annotation-toolbar__button.svelte-g8qu62:disabled {opacity:0.6;cursor:not-allowed;}.pie-tool-annotation-toolbar__button--warning.svelte-g8qu62 {color:var(--pie-missing-icon, #92400e);}.pie-tool-annotation-toolbar__button--danger.svelte-g8qu62 {color:var(--pie-incorrect-icon, #b91c1c);}.pie-tool-annotation-toolbar__button.svelte-g8qu62 svg:where(.svelte-g8qu62) {width:18px;height:18px;}`
|
|
7405
7458
|
};
|
|
7406
|
-
function
|
|
7407
|
-
|
|
7459
|
+
function Oh(e, t) {
|
|
7460
|
+
Co(t, !0), tc(e, Mh);
|
|
7408
7461
|
let n = fr(t, "enabled", 7, !0), r = fr(t, "highlightCoordinator", 7, null), i = fr(t, "ttsService", 7, null);
|
|
7409
7462
|
const o = typeof window < "u", s = "pie-annotations", a = [
|
|
7410
7463
|
{
|
|
@@ -7529,7 +7582,7 @@ function wh(e, t) {
|
|
|
7529
7582
|
I(g, "");
|
|
7530
7583
|
}, 3e3), Me();
|
|
7531
7584
|
}
|
|
7532
|
-
function
|
|
7585
|
+
function ha() {
|
|
7533
7586
|
if (!_(O) || !r()) {
|
|
7534
7587
|
console.warn("[AnnotationToolbar] No overlapping annotation to remove");
|
|
7535
7588
|
return;
|
|
@@ -7549,13 +7602,13 @@ function wh(e, t) {
|
|
|
7549
7602
|
I(g, "");
|
|
7550
7603
|
}, 3e3), Me();
|
|
7551
7604
|
}
|
|
7552
|
-
function
|
|
7605
|
+
function fa() {
|
|
7553
7606
|
const T = _(y);
|
|
7554
7607
|
r()?.clearAnnotations(), I(y, 0), sessionStorage.removeItem(U()), I(g, `${T} annotation${T === 1 ? "" : "s"} cleared`), setTimeout(() => {
|
|
7555
7608
|
I(g, "");
|
|
7556
7609
|
}, 3e3), Me();
|
|
7557
7610
|
}
|
|
7558
|
-
async function
|
|
7611
|
+
async function pa() {
|
|
7559
7612
|
if (!(!_(p).selectedRange || !i())) {
|
|
7560
7613
|
I(v, !0);
|
|
7561
7614
|
try {
|
|
@@ -7583,16 +7636,16 @@ function wh(e, t) {
|
|
|
7583
7636
|
};
|
|
7584
7637
|
}), Li(() => {
|
|
7585
7638
|
if (!_(c)) return;
|
|
7586
|
-
const T =
|
|
7639
|
+
const T = mc(_(c), ($) => {
|
|
7587
7640
|
I(d, $, !0);
|
|
7588
|
-
}), k =
|
|
7641
|
+
}), k = bc(_(c), ($) => {
|
|
7589
7642
|
I(h, $, !0);
|
|
7590
7643
|
});
|
|
7591
7644
|
return () => {
|
|
7592
7645
|
k(), T();
|
|
7593
7646
|
};
|
|
7594
7647
|
});
|
|
7595
|
-
var
|
|
7648
|
+
var ga = {
|
|
7596
7649
|
get enabled() {
|
|
7597
7650
|
return n();
|
|
7598
7651
|
},
|
|
@@ -7611,51 +7664,51 @@ function wh(e, t) {
|
|
|
7611
7664
|
set ttsService(T = null) {
|
|
7612
7665
|
i(T), Sn();
|
|
7613
7666
|
}
|
|
7614
|
-
}, yi =
|
|
7667
|
+
}, yi = Ch(), _i = sr(yi);
|
|
7615
7668
|
Gi(_i, (T) => I(c, T), () => _(c));
|
|
7616
|
-
var Ti = He(_i, 2),
|
|
7617
|
-
var k =
|
|
7618
|
-
|
|
7619
|
-
var te =
|
|
7669
|
+
var Ti = He(_i, 2), va = (T) => {
|
|
7670
|
+
var k = Ah(), $ = vn(k);
|
|
7671
|
+
Ql($, 17, () => a, Xl, (fe, pe) => {
|
|
7672
|
+
var te = Sh(), un = vn(te), rr = vn(un, !0);
|
|
7620
7673
|
dn(un), dn(te), mn(() => {
|
|
7621
7674
|
ji(te, `background-color: ${_(pe).hex ?? ""};`), qi(te, "aria-label", _(pe).label), qi(te, "title", _(pe).label), Bi(rr, _(pe).label);
|
|
7622
7675
|
}), Ht("click", te, () => mi(_(pe).name)), qe(fe, te);
|
|
7623
7676
|
});
|
|
7624
7677
|
var K = He($, 2), Ke = He(K, 2), Nt = (fe) => {
|
|
7625
|
-
var pe =
|
|
7626
|
-
mn(() => te.disabled = _(v)), Ht("click", te,
|
|
7678
|
+
var pe = wh(), te = He(sr(pe), 2);
|
|
7679
|
+
mn(() => te.disabled = _(v)), Ht("click", te, pa), qe(fe, pe);
|
|
7627
7680
|
};
|
|
7628
7681
|
Dt(Ke, (fe) => {
|
|
7629
7682
|
i() && fe(Nt);
|
|
7630
7683
|
});
|
|
7631
|
-
var Wt = He(Ke, 2),
|
|
7632
|
-
var pe =
|
|
7633
|
-
var zt =
|
|
7634
|
-
Ht("click", zt,
|
|
7684
|
+
var Wt = He(Ke, 2), ba = (fe) => {
|
|
7685
|
+
var pe = xh(), te = He(sr(pe), 2), un = (Ye) => {
|
|
7686
|
+
var zt = kh();
|
|
7687
|
+
Ht("click", zt, ha), qe(Ye, zt);
|
|
7635
7688
|
};
|
|
7636
7689
|
Dt(te, (Ye) => {
|
|
7637
7690
|
_(S) && Ye(un);
|
|
7638
7691
|
});
|
|
7639
|
-
var rr = He(te, 2),
|
|
7640
|
-
var zt =
|
|
7641
|
-
Ht("click", zt,
|
|
7692
|
+
var rr = He(te, 2), ya = (Ye) => {
|
|
7693
|
+
var zt = Eh();
|
|
7694
|
+
Ht("click", zt, fa), qe(Ye, zt);
|
|
7642
7695
|
};
|
|
7643
7696
|
Dt(rr, (Ye) => {
|
|
7644
|
-
_(N) && Ye(
|
|
7697
|
+
_(N) && Ye(ya);
|
|
7645
7698
|
}), qe(fe, pe);
|
|
7646
7699
|
};
|
|
7647
7700
|
Dt(Wt, (fe) => {
|
|
7648
|
-
(_(S) || _(N)) && fe(
|
|
7701
|
+
(_(S) || _(N)) && fe(ba);
|
|
7649
7702
|
}), dn(k), Gi(k, (fe) => I(u, fe), () => _(u)), mn(() => ji(k, `left:${_(p).toolbarPosition.x}px; top:${_(p).toolbarPosition.y}px; transform: translate(-50%, -100%);`)), Ht("click", K, () => mi(le.UNDERLINE)), qe(T, k);
|
|
7650
7703
|
};
|
|
7651
7704
|
Dt(Ti, (T) => {
|
|
7652
|
-
_(p).isVisible && T(
|
|
7705
|
+
_(p).isVisible && T(va);
|
|
7653
7706
|
});
|
|
7654
|
-
var Si = He(Ti, 2),
|
|
7655
|
-
return dn(Si), mn(() => Bi(
|
|
7707
|
+
var Si = He(Ti, 2), ma = vn(Si, !0);
|
|
7708
|
+
return dn(Si), mn(() => Bi(ma, _(g))), qe(e, yi), Mo(ga);
|
|
7656
7709
|
}
|
|
7657
|
-
|
|
7658
|
-
customElements.define("pie-tool-annotation-toolbar",
|
|
7710
|
+
Hl(["click"]);
|
|
7711
|
+
customElements.define("pie-tool-annotation-toolbar", hc(Oh, {
|
|
7659
7712
|
enabled: {
|
|
7660
7713
|
attribute: "enabled",
|
|
7661
7714
|
type: "Boolean"
|
|
@@ -7664,7 +7717,7 @@ customElements.define("pie-tool-annotation-toolbar", lc(wh, {
|
|
|
7664
7717
|
ttsService: { type: "Object" }
|
|
7665
7718
|
}, [], [], { mode: "open" }));
|
|
7666
7719
|
export {
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7720
|
+
Oh as default,
|
|
7721
|
+
Rh as n,
|
|
7722
|
+
$h as t
|
|
7670
7723
|
};
|