@pie-players/pie-tool-answer-eliminator 0.3.52 → 0.3.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tool-answer-eliminator.js +188 -165
- package/package.json +4 -4
|
@@ -39,10 +39,10 @@ var ch = 1 << 24, ae = 1024, le = 2048, Ye = 4096, ai = 8192, vs = 16384, li = 3
|
|
|
39
39
|
super(...t), f(this, "name", "StaleReactionError"), f(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
40
40
|
}
|
|
41
41
|
}(), ph = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
|
|
42
|
-
function
|
|
42
|
+
function ks(e) {
|
|
43
43
|
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Es(e) {
|
|
46
46
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
47
47
|
}
|
|
48
48
|
function As() {
|
|
@@ -86,13 +86,13 @@ function Rt(e) {
|
|
|
86
86
|
re = e;
|
|
87
87
|
}
|
|
88
88
|
var D;
|
|
89
|
-
function
|
|
89
|
+
function kt(e) {
|
|
90
90
|
if (e === null)
|
|
91
91
|
throw di(), qt;
|
|
92
92
|
return D = e;
|
|
93
93
|
}
|
|
94
94
|
function fi() {
|
|
95
|
-
return
|
|
95
|
+
return kt(/* @__PURE__ */ dt(D));
|
|
96
96
|
}
|
|
97
97
|
function Hs(e = 1) {
|
|
98
98
|
if (re) {
|
|
@@ -129,19 +129,19 @@ function Sr(e, t) {
|
|
|
129
129
|
function zs(e, t) {
|
|
130
130
|
return e?.[bs]?.(t), e;
|
|
131
131
|
}
|
|
132
|
-
var
|
|
132
|
+
var L = null;
|
|
133
133
|
function Kt(e) {
|
|
134
|
-
|
|
134
|
+
L = e;
|
|
135
135
|
}
|
|
136
136
|
function mi(e, t = !1, n) {
|
|
137
|
-
|
|
138
|
-
p:
|
|
137
|
+
L = {
|
|
138
|
+
p: L,
|
|
139
139
|
i: !1,
|
|
140
140
|
c: null,
|
|
141
141
|
e: null,
|
|
142
142
|
s: e,
|
|
143
143
|
x: null,
|
|
144
|
-
r:
|
|
144
|
+
r: E,
|
|
145
145
|
l: It && !t ? {
|
|
146
146
|
s: null,
|
|
147
147
|
u: null,
|
|
@@ -150,15 +150,15 @@ function mi(e, t = !1, n) {
|
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
function vi(e) {
|
|
153
|
-
var t =
|
|
153
|
+
var t = L, n = t.e;
|
|
154
154
|
if (n !== null) {
|
|
155
155
|
t.e = null;
|
|
156
156
|
for (var r of n) ji(r);
|
|
157
157
|
}
|
|
158
|
-
return e !== void 0 && (t.x = e), t.i = !0,
|
|
158
|
+
return e !== void 0 && (t.x = e), t.i = !0, L = t.p, e ?? {};
|
|
159
159
|
}
|
|
160
160
|
function ln() {
|
|
161
|
-
return !It ||
|
|
161
|
+
return !It || L !== null && L.l === null;
|
|
162
162
|
}
|
|
163
163
|
var $e = [];
|
|
164
164
|
function yi() {
|
|
@@ -178,9 +178,9 @@ function Fs() {
|
|
|
178
178
|
for (; $e.length > 0; ) yi();
|
|
179
179
|
}
|
|
180
180
|
function bi(e) {
|
|
181
|
-
var t =
|
|
181
|
+
var t = E;
|
|
182
182
|
if (t === null)
|
|
183
|
-
return
|
|
183
|
+
return k.f |= ui, e;
|
|
184
184
|
if ((t.f & 32768) === 0 && (t.f & 4) === 0)
|
|
185
185
|
throw e;
|
|
186
186
|
it(e, t);
|
|
@@ -243,10 +243,10 @@ function T(e, t, n) {
|
|
|
243
243
|
function d(e, t) {
|
|
244
244
|
return e.get(_(e, t));
|
|
245
245
|
}
|
|
246
|
-
var wi, Xt = null, et = null, x = null,
|
|
247
|
-
var Vs = 1, Jt = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Cn = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(),
|
|
246
|
+
var wi, Xt = null, et = null, x = null, En = null, z = null, An = null, _t = !1, vn = !1, lt = null, Yt = null, ki = 0;
|
|
247
|
+
var Vs = 1, Jt = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Cn = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakSet(), ht = class Ei {
|
|
248
248
|
constructor() {
|
|
249
|
-
Qn(this,
|
|
249
|
+
Qn(this, $), f(this, "id", Vs++), w(this, Jt, !1), f(this, "linked", !0), w(this, Be, null), w(this, Pe, null), f(this, "async_deriveds", /* @__PURE__ */ new Map()), f(this, "current", /* @__PURE__ */ new Map()), f(this, "previous", /* @__PURE__ */ new Map()), w(this, Qt, /* @__PURE__ */ new Set()), w(this, $t, /* @__PURE__ */ new Set()), w(this, tt, 0), w(this, Re, /* @__PURE__ */ new Map()), w(this, mt, null), w(this, J, []), w(this, Cn, []), w(this, Ge, /* @__PURE__ */ new Set()), w(this, me, /* @__PURE__ */ new Set()), w(this, Ae, /* @__PURE__ */ new Map()), w(this, Wt, /* @__PURE__ */ new Set()), f(this, "is_fork", !1), w(this, vt, !1), et === null ? Xt = et = this : (T(Pe, et, this), T(Be, this, et)), et = this;
|
|
250
250
|
}
|
|
251
251
|
skip_effect(t) {
|
|
252
252
|
d(Ae, this).has(t) || d(Ae, this).set(t, {
|
|
@@ -276,14 +276,14 @@ var Vs = 1, Jt = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap
|
|
|
276
276
|
}
|
|
277
277
|
flush() {
|
|
278
278
|
try {
|
|
279
|
-
vn = !0, x = this, _(
|
|
279
|
+
vn = !0, x = this, _($, this, Zt).call(this);
|
|
280
280
|
} finally {
|
|
281
|
-
|
|
281
|
+
ki = 0, An = null, lt = null, Yt = null, vn = !1, x = null, z = null, De.clear();
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
discard() {
|
|
285
285
|
for (const t of d($t, this)) t(this);
|
|
286
|
-
d($t, this).clear(), _(
|
|
286
|
+
d($t, this).clear(), _($, this, en).call(this), d(mt, this)?.resolve();
|
|
287
287
|
}
|
|
288
288
|
register_created_effect(t) {
|
|
289
289
|
d(Cn, this).push(t);
|
|
@@ -319,7 +319,7 @@ var Vs = 1, Jt = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap
|
|
|
319
319
|
}
|
|
320
320
|
static ensure() {
|
|
321
321
|
if (x === null) {
|
|
322
|
-
const t = x = new
|
|
322
|
+
const t = x = new Ei();
|
|
323
323
|
!vn && !_t && at(() => {
|
|
324
324
|
d(Jt, t) || t.flush();
|
|
325
325
|
});
|
|
@@ -355,7 +355,7 @@ var Vs = 1, Jt = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap
|
|
|
355
355
|
for (var n = t; n.parent !== null; ) {
|
|
356
356
|
n = n.parent;
|
|
357
357
|
var r = n.f;
|
|
358
|
-
if (lt !== null && n ===
|
|
358
|
+
if (lt !== null && n === E && (Ce || (k === null || (k.f & 2) === 0) && !js))
|
|
359
359
|
return;
|
|
360
360
|
if ((r & 96) !== 0) {
|
|
361
361
|
if ((r & 1024) === 0) return;
|
|
@@ -381,7 +381,7 @@ function _r() {
|
|
|
381
381
|
return !1;
|
|
382
382
|
}
|
|
383
383
|
function Zt() {
|
|
384
|
-
T(Jt, this, !0),
|
|
384
|
+
T(Jt, this, !0), ki++ > 1e3 && (_($, this, en).call(this), Xs());
|
|
385
385
|
for (const a of d(Ge, this))
|
|
386
386
|
d(me, this).delete(a), P(a, le), this.schedule(a);
|
|
387
387
|
for (const a of d(me, this))
|
|
@@ -390,34 +390,34 @@ function Zt() {
|
|
|
390
390
|
T(J, this, []), this.apply();
|
|
391
391
|
var t = lt = [], n = [], r = Yt = [];
|
|
392
392
|
for (const a of e) try {
|
|
393
|
-
_(
|
|
393
|
+
_($, this, Ai).call(this, a, t, n);
|
|
394
394
|
} catch (l) {
|
|
395
|
-
throw Ii(a), _(
|
|
395
|
+
throw Ii(a), _($, this, _r).call(this) || this.discard(), l;
|
|
396
396
|
}
|
|
397
397
|
if (x = null, r.length > 0) {
|
|
398
398
|
var i = wi.ensure();
|
|
399
399
|
for (const a of r) i.schedule(a);
|
|
400
400
|
}
|
|
401
|
-
if (lt = null, Yt = null, _(
|
|
402
|
-
_(
|
|
401
|
+
if (lt = null, Yt = null, _($, this, _r).call(this)) {
|
|
402
|
+
_($, this, yt).call(this, n), _($, this, yt).call(this, t);
|
|
403
403
|
for (const [a, l] of d(Ae, this)) xi(a, l);
|
|
404
|
-
r.length > 0 && _(
|
|
404
|
+
r.length > 0 && _($, x, Zt).call(x);
|
|
405
405
|
return;
|
|
406
406
|
}
|
|
407
|
-
const o = _(
|
|
407
|
+
const o = _($, this, Gs).call(this);
|
|
408
408
|
if (o) {
|
|
409
|
-
_(
|
|
409
|
+
_($, this, yt).call(this, n), _($, this, yt).call(this, t), _($, o, Us).call(o, this);
|
|
410
410
|
return;
|
|
411
411
|
}
|
|
412
412
|
d(Ge, this).clear(), d(me, this).clear();
|
|
413
413
|
for (const a of d(Qt, this)) a(this);
|
|
414
|
-
d(Qt, this).clear(),
|
|
414
|
+
d(Qt, this).clear(), En = this, wr(n), wr(t), En = null, d(mt, this)?.resolve();
|
|
415
415
|
var s = x;
|
|
416
|
-
if (d(tt, this) === 0 && (d(J, this).length === 0 || s !== null) && (_(
|
|
416
|
+
if (d(tt, this) === 0 && (d(J, this).length === 0 || s !== null) && (_($, this, en).call(this), Ce && (_($, this, Ks).call(this), x = s)), d(J, this).length > 0) if (s !== null) {
|
|
417
417
|
const a = s;
|
|
418
418
|
d(J, a).push(...d(J, this).filter((l) => !d(J, a).includes(l)));
|
|
419
419
|
} else s = this;
|
|
420
|
-
s !== null && _(
|
|
420
|
+
s !== null && _($, s, Zt).call(s);
|
|
421
421
|
}
|
|
422
422
|
function Ai(e, t, n) {
|
|
423
423
|
e.f ^= ae;
|
|
@@ -471,7 +471,7 @@ function Us(e) {
|
|
|
471
471
|
}
|
|
472
472
|
};
|
|
473
473
|
for (const n of this.current.keys()) t(n);
|
|
474
|
-
this.oncommit(() => e.discard()), _(
|
|
474
|
+
this.oncommit(() => e.discard()), _($, e, en).call(e), x = this, _($, this, Zt).call(this);
|
|
475
475
|
}
|
|
476
476
|
function yt(e) {
|
|
477
477
|
for (var t = 0; t < e.length; t += 1) Si(e[t], d(Ge, this), d(me, this));
|
|
@@ -497,7 +497,7 @@ function Ks() {
|
|
|
497
497
|
e && c.discard();
|
|
498
498
|
else if (t.length > 0) {
|
|
499
499
|
if (e) for (const u of d(Wt, this)) c.unskip_effect(u, (h) => {
|
|
500
|
-
(h.f & 4194320) !== 0 ? c.schedule(h) : _(
|
|
500
|
+
(h.f & 4194320) !== 0 ? c.schedule(h) : _($, c, yt).call(c, [h]);
|
|
501
501
|
});
|
|
502
502
|
c.activate();
|
|
503
503
|
var i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
@@ -511,7 +511,7 @@ function Ks() {
|
|
|
511
511
|
for (const u of d(Cn, this)) (u.f & 155648) === 0 && Zn(u, a, o) && ((u.f & 4194320) !== 0 ? (P(u, le), c.schedule(u)) : d(Ge, c).add(u));
|
|
512
512
|
if (d(J, c).length > 0 && !d(vt, c)) {
|
|
513
513
|
c.apply();
|
|
514
|
-
for (var l of d(J, c)) _(
|
|
514
|
+
for (var l of d(J, c)) _($, c, Ai).call(c, l, [], []);
|
|
515
515
|
T(J, c, []);
|
|
516
516
|
}
|
|
517
517
|
c.deactivate();
|
|
@@ -621,14 +621,14 @@ var Js = ci | Ct;
|
|
|
621
621
|
function Qs(e, t, n, r) {
|
|
622
622
|
new Zs(e, t, n, r);
|
|
623
623
|
}
|
|
624
|
-
var ie = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(),
|
|
624
|
+
var ie = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), kr = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakSet(), Zs = class {
|
|
625
625
|
constructor(e, t, n, r) {
|
|
626
|
-
Qn(this, W), f(this, "parent", void 0), f(this, "is_pending", !1), f(this, "transform_error", void 0), w(this, ie, void 0), w(this, xn, re ? D : null), w(this, ue, void 0), w(this,
|
|
626
|
+
Qn(this, W), f(this, "parent", void 0), f(this, "is_pending", !1), f(this, "transform_error", void 0), w(this, ie, void 0), w(this, xn, re ? D : null), w(this, ue, void 0), w(this, Et, void 0), w(this, Q, void 0), w(this, he, null), w(this, K, null), w(this, te, null), w(this, ze, null), w(this, nt, 0), w(this, Fe, 0), w(this, Pt, !1), w(this, In, /* @__PURE__ */ new Set()), w(this, On, /* @__PURE__ */ new Set()), w(this, Oe, null), w(this, kr, Ys(() => (T(Oe, this, cn(d(nt, this))), () => {
|
|
627
627
|
T(Oe, this, null);
|
|
628
|
-
}))), T(ie, this, e), T(ue, this, t), T(
|
|
629
|
-
var o =
|
|
628
|
+
}))), T(ie, this, e), T(ue, this, t), T(Et, this, (i) => {
|
|
629
|
+
var o = E;
|
|
630
630
|
o.b = this, o.f |= 128, n(i);
|
|
631
|
-
}), this.parent =
|
|
631
|
+
}), this.parent = E.b, this.transform_error = r ?? this.parent?.transform_error ?? ((i) => i), T(Q, this, va(() => {
|
|
632
632
|
if (re) {
|
|
633
633
|
const i = d(xn, this);
|
|
634
634
|
fi();
|
|
@@ -655,18 +655,18 @@ var ie = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), ue =
|
|
|
655
655
|
}));
|
|
656
656
|
}
|
|
657
657
|
get_effect_pending() {
|
|
658
|
-
return d(
|
|
658
|
+
return d(kr, this).call(this), b(d(Oe, this));
|
|
659
659
|
}
|
|
660
660
|
error(e) {
|
|
661
661
|
if (!d(ue, this).onerror && !d(ue, this).failed) throw e;
|
|
662
662
|
x?.is_fork ? (d(he, this) && x.skip_effect(d(he, this)), d(K, this) && x.skip_effect(d(K, this)), d(te, this) && x.skip_effect(d(te, this)), x.oncommit(() => {
|
|
663
|
-
_(W, this,
|
|
664
|
-
})) : _(W, this,
|
|
663
|
+
_(W, this, Er).call(this, e);
|
|
664
|
+
})) : _(W, this, Er).call(this, e);
|
|
665
665
|
}
|
|
666
666
|
};
|
|
667
667
|
function ea() {
|
|
668
668
|
try {
|
|
669
|
-
T(he, this, Ue(() => d(
|
|
669
|
+
T(he, this, Ue(() => d(Et, this).call(this, d(ie, this))));
|
|
670
670
|
} catch (e) {
|
|
671
671
|
this.error(e);
|
|
672
672
|
}
|
|
@@ -682,7 +682,7 @@ function na() {
|
|
|
682
682
|
const e = d(ue, this).pending;
|
|
683
683
|
e && (this.is_pending = !0, T(K, this, Ue(() => e(d(ie, this)))), at(() => {
|
|
684
684
|
var t = T(ze, this, document.createDocumentFragment()), n = zi();
|
|
685
|
-
t.append(n), T(he, this, _(W, this, Mn).call(this, () => Ue(() => d(
|
|
685
|
+
t.append(n), T(he, this, _(W, this, Mn).call(this, () => Ue(() => d(Et, this).call(this, n)))), d(Fe, this) === 0 && (d(ie, this).before(t), T(ze, this, null), un(d(K, this), () => {
|
|
686
686
|
T(K, this, null);
|
|
687
687
|
}), _(W, this, tr).call(this, x));
|
|
688
688
|
}));
|
|
@@ -690,7 +690,7 @@ function na() {
|
|
|
690
690
|
function Oi() {
|
|
691
691
|
try {
|
|
692
692
|
if (this.is_pending = this.has_pending_snippet(), T(Fe, this, 0), T(nt, this, 0), T(he, this, Ue(() => {
|
|
693
|
-
d(
|
|
693
|
+
d(Et, this).call(this, d(ie, this));
|
|
694
694
|
})), d(Fe, this) > 0) {
|
|
695
695
|
var e = T(ze, this, document.createDocumentFragment());
|
|
696
696
|
Ta(d(he, this), e);
|
|
@@ -705,7 +705,7 @@ function tr(e) {
|
|
|
705
705
|
this.is_pending = !1, e.transfer_effects(d(In, this), d(On, this));
|
|
706
706
|
}
|
|
707
707
|
function Mn(e) {
|
|
708
|
-
var t =
|
|
708
|
+
var t = E, n = k, r = L;
|
|
709
709
|
xe(d(Q, this)), de(d(Q, this)), Kt(d(Q, this).ctx);
|
|
710
710
|
try {
|
|
711
711
|
return ht.ensure(), e();
|
|
@@ -727,8 +727,8 @@ function Mi(e, t) {
|
|
|
727
727
|
T(K, this, null);
|
|
728
728
|
}), d(ze, this) && (d(ie, this).before(d(ze, this)), T(ze, this, null)));
|
|
729
729
|
}
|
|
730
|
-
function
|
|
731
|
-
d(he, this) && (oe(d(he, this)), T(he, this, null)), d(K, this) && (oe(d(K, this)), T(K, this, null)), d(te, this) && (oe(d(te, this)), T(te, this, null)), re && (
|
|
730
|
+
function Er(e) {
|
|
731
|
+
d(he, this) && (oe(d(he, this)), T(he, this, null)), d(K, this) && (oe(d(K, this)), T(K, this, null)), d(te, this) && (oe(d(te, this)), T(te, this, null)), re && (kt(d(xn, this)), Hs(), kt(Ws()));
|
|
732
732
|
var t = d(ue, this).onerror;
|
|
733
733
|
let n = d(ue, this).failed;
|
|
734
734
|
var r = !1, i = !1;
|
|
@@ -751,7 +751,7 @@ function kr(e) {
|
|
|
751
751
|
n && T(te, this, _(W, this, Mn).call(this, () => {
|
|
752
752
|
try {
|
|
753
753
|
return Ue(() => {
|
|
754
|
-
var l =
|
|
754
|
+
var l = E;
|
|
755
755
|
l.b = this, l.f |= 128, n(d(ie, this), () => a, () => o);
|
|
756
756
|
});
|
|
757
757
|
} catch (l) {
|
|
@@ -773,8 +773,8 @@ function kr(e) {
|
|
|
773
773
|
// @__NO_SIDE_EFFECTS__
|
|
774
774
|
function tn(e) {
|
|
775
775
|
var t = 2 | le;
|
|
776
|
-
return
|
|
777
|
-
ctx:
|
|
776
|
+
return E !== null && (E.f |= Ct), {
|
|
777
|
+
ctx: L,
|
|
778
778
|
deps: null,
|
|
779
779
|
effects: null,
|
|
780
780
|
equals: pi,
|
|
@@ -784,7 +784,7 @@ function tn(e) {
|
|
|
784
784
|
rv: 0,
|
|
785
785
|
v: H,
|
|
786
786
|
wv: 0,
|
|
787
|
-
parent:
|
|
787
|
+
parent: E,
|
|
788
788
|
ac: null
|
|
789
789
|
};
|
|
790
790
|
}
|
|
@@ -806,7 +806,7 @@ function ia(e) {
|
|
|
806
806
|
}
|
|
807
807
|
}
|
|
808
808
|
function nr(e) {
|
|
809
|
-
var t, n =
|
|
809
|
+
var t, n = E, r = e.parent;
|
|
810
810
|
if (!ve && r !== null && e.v !== H && (r.f & 24576) !== 0)
|
|
811
811
|
return Ps(), e.v;
|
|
812
812
|
xe(r);
|
|
@@ -819,7 +819,7 @@ function nr(e) {
|
|
|
819
819
|
}
|
|
820
820
|
function Ri(e) {
|
|
821
821
|
var t = nr(e);
|
|
822
|
-
if (!e.equals(t) && (e.wv = Xi(), (!x?.is_fork || e.deps === null) && (x !== null ? (x.capture(e, t, !0),
|
|
822
|
+
if (!e.equals(t) && (e.wv = Xi(), (!x?.is_fork || e.deps === null) && (x !== null ? (x.capture(e, t, !0), En?.capture(e, t, !0)) : e.v = t, e.deps === null))) {
|
|
823
823
|
P(e, ae);
|
|
824
824
|
return;
|
|
825
825
|
}
|
|
@@ -854,14 +854,14 @@ function F(e, t) {
|
|
|
854
854
|
// @__NO_SIDE_EFFECTS__
|
|
855
855
|
function sa(e, t = !1, n = !0) {
|
|
856
856
|
const r = cn(e);
|
|
857
|
-
if (t || (r.equals = gi), It && n &&
|
|
857
|
+
if (t || (r.equals = gi), It && n && L !== null && L.l !== null) {
|
|
858
858
|
var i;
|
|
859
|
-
((i =
|
|
859
|
+
((i = L.l).s ?? (i.s = [])).push(r);
|
|
860
860
|
}
|
|
861
861
|
return r;
|
|
862
862
|
}
|
|
863
863
|
function M(e, t, n = !1) {
|
|
864
|
-
|
|
864
|
+
k !== null && (!ne || (k.f & 131072) !== 0) && ln() && (k.f & 4325394) !== 0 && (se === null || !se.has(e)) && Ls();
|
|
865
865
|
let r = n ? ot(t) : t;
|
|
866
866
|
return Pi(e, r, Yt);
|
|
867
867
|
}
|
|
@@ -873,7 +873,7 @@ function Pi(e, t, n = null) {
|
|
|
873
873
|
const i = e;
|
|
874
874
|
(e.f & 2048) !== 0 && nr(i), z === null && Jn(i);
|
|
875
875
|
}
|
|
876
|
-
e.wv = Xi(), Ni(e, le, n), ln() &&
|
|
876
|
+
e.wv = Xi(), Ni(e, le, n), ln() && E !== null && (E.f & 1024) !== 0 && (E.f & 96) === 0 && (Y === null ? _a([e]) : Y.push(e)), !r.is_fork && nn.size > 0 && !$i && aa();
|
|
877
877
|
}
|
|
878
878
|
return t;
|
|
879
879
|
}
|
|
@@ -899,12 +899,12 @@ function Ni(e, t, n) {
|
|
|
899
899
|
if (r !== null)
|
|
900
900
|
for (var i = ln(), o = r.length, s = 0; s < o; s++) {
|
|
901
901
|
var a = r[s], l = a.f;
|
|
902
|
-
if (!(!i && a ===
|
|
902
|
+
if (!(!i && a === E)) {
|
|
903
903
|
var c = (l & le) === 0;
|
|
904
904
|
if (c && P(a, t), (l & 131072) !== 0) nn.add(a);
|
|
905
905
|
else if ((l & 2) !== 0) {
|
|
906
906
|
var u = a;
|
|
907
|
-
z?.delete(u), (l & 65536) === 0 && (l & 512 && (
|
|
907
|
+
z?.delete(u), (l & 65536) === 0 && (l & 512 && (E === null || (E.f & 2097152) === 0) && (a.f |= xt), Ni(u, Ye, n));
|
|
908
908
|
} else if (c) {
|
|
909
909
|
var h = a;
|
|
910
910
|
(l & 16) !== 0 && ge !== null && ge.add(h), n !== null ? n.push(h) : er(h);
|
|
@@ -919,7 +919,7 @@ function ot(e) {
|
|
|
919
919
|
if (t !== hs && t !== ds) return e;
|
|
920
920
|
var n = /* @__PURE__ */ new Map(), r = ls(e), i = /* @__PURE__ */ F(0), o = null, s = je, a = (h) => {
|
|
921
921
|
if (je === s) return h();
|
|
922
|
-
var p =
|
|
922
|
+
var p = k, g = je;
|
|
923
923
|
de(null), Ir(s);
|
|
924
924
|
var m = h();
|
|
925
925
|
return de(p), Ir(g), m;
|
|
@@ -985,7 +985,7 @@ function ot(e) {
|
|
|
985
985
|
has(h, p) {
|
|
986
986
|
if (p === St) return !0;
|
|
987
987
|
var g = n.get(p), m = g !== void 0 && g.v !== H || Reflect.has(h, p);
|
|
988
|
-
return (g !== void 0 ||
|
|
988
|
+
return (g !== void 0 || E !== null && (!m || We(h, p)?.writable)) && (g === void 0 && (g = a(() => {
|
|
989
989
|
var v = /* @__PURE__ */ F(m ? ot(h[p]) : H, o);
|
|
990
990
|
return v;
|
|
991
991
|
}), n.set(p, g)), b(g) === H) ? !1 : m;
|
|
@@ -1056,7 +1056,7 @@ function Fi(e, t, n) {
|
|
|
1056
1056
|
return t == null || t === "http://www.w3.org/1999/xhtml" ? n ? document.createElement(e, { is: n }) : document.createElement(e) : n ? document.createElementNS(t, e, { is: n }) : document.createElementNS(t, e);
|
|
1057
1057
|
}
|
|
1058
1058
|
function Di(e) {
|
|
1059
|
-
var t =
|
|
1059
|
+
var t = k, n = E;
|
|
1060
1060
|
de(null), xe(null);
|
|
1061
1061
|
try {
|
|
1062
1062
|
return e();
|
|
@@ -1065,17 +1065,17 @@ function Di(e) {
|
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
1067
|
function da(e) {
|
|
1068
|
-
|
|
1068
|
+
E === null && (k === null && Cs(e), As()), ve && Es(e);
|
|
1069
1069
|
}
|
|
1070
1070
|
function fa(e, t) {
|
|
1071
1071
|
var n = t.last;
|
|
1072
1072
|
n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
|
|
1073
1073
|
}
|
|
1074
1074
|
function Je(e, t) {
|
|
1075
|
-
var n =
|
|
1075
|
+
var n = E;
|
|
1076
1076
|
n !== null && (n.f & 8192) !== 0 && (e |= ai);
|
|
1077
1077
|
var r = {
|
|
1078
|
-
ctx:
|
|
1078
|
+
ctx: L,
|
|
1079
1079
|
deps: null,
|
|
1080
1080
|
nodes: null,
|
|
1081
1081
|
f: e | le | 512,
|
|
@@ -1101,20 +1101,20 @@ function Je(e, t) {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && (i.f & 524288) === 0 && (i = i.first, (e & 16) !== 0 && (e & 65536) !== 0 && i !== null && (i.f |= ci));
|
|
1103
1103
|
}
|
|
1104
|
-
if (i !== null && (i.parent = n, n !== null && fa(i, n),
|
|
1105
|
-
var o =
|
|
1104
|
+
if (i !== null && (i.parent = n, n !== null && fa(i, n), k !== null && (k.f & 2) !== 0 && (e & 64) === 0)) {
|
|
1105
|
+
var o = k;
|
|
1106
1106
|
(o.effects ?? (o.effects = [])).push(i);
|
|
1107
1107
|
}
|
|
1108
1108
|
return r;
|
|
1109
1109
|
}
|
|
1110
1110
|
function rr() {
|
|
1111
|
-
return
|
|
1111
|
+
return k !== null && !ne;
|
|
1112
1112
|
}
|
|
1113
1113
|
function Le(e) {
|
|
1114
1114
|
da("$effect");
|
|
1115
|
-
var t =
|
|
1116
|
-
if (!
|
|
1117
|
-
var n =
|
|
1115
|
+
var t = E.f;
|
|
1116
|
+
if (!k && (t & 32) !== 0 && L !== null && !L.i) {
|
|
1117
|
+
var n = L;
|
|
1118
1118
|
(n.e ?? (n.e = [])).push(e);
|
|
1119
1119
|
} else return ji(e);
|
|
1120
1120
|
}
|
|
@@ -1153,7 +1153,7 @@ function Ue(e) {
|
|
|
1153
1153
|
function qi(e) {
|
|
1154
1154
|
var t = e.teardown;
|
|
1155
1155
|
if (t !== null) {
|
|
1156
|
-
const n = ve, r =
|
|
1156
|
+
const n = ve, r = k;
|
|
1157
1157
|
xr(!0), de(null);
|
|
1158
1158
|
try {
|
|
1159
1159
|
t.call(null);
|
|
@@ -1236,17 +1236,17 @@ var Sa = null, Bt = !1, ve = !1;
|
|
|
1236
1236
|
function xr(e) {
|
|
1237
1237
|
ve = e;
|
|
1238
1238
|
}
|
|
1239
|
-
var
|
|
1239
|
+
var k = null, ne = !1;
|
|
1240
1240
|
function de(e) {
|
|
1241
|
-
|
|
1241
|
+
k = e;
|
|
1242
1242
|
}
|
|
1243
|
-
var
|
|
1243
|
+
var E = null;
|
|
1244
1244
|
function xe(e) {
|
|
1245
|
-
|
|
1245
|
+
E = e;
|
|
1246
1246
|
}
|
|
1247
1247
|
var se = null;
|
|
1248
1248
|
function Ui(e) {
|
|
1249
|
-
|
|
1249
|
+
k !== null && (!Ce || (k.f & 2) !== 0) && (se ?? (se = /* @__PURE__ */ new Set())).add(e);
|
|
1250
1250
|
}
|
|
1251
1251
|
var q = null, U = 0, Y = null;
|
|
1252
1252
|
function _a(e) {
|
|
@@ -1280,8 +1280,8 @@ function Yi(e, t, n = !0) {
|
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
1282
|
function Ji(e) {
|
|
1283
|
-
var t = q, n = U, r = Y, i =
|
|
1284
|
-
q = null, U = 0, Y = null,
|
|
1283
|
+
var t = q, n = U, r = Y, i = k, o = se, s = L, a = ne, l = je, c = e.f;
|
|
1284
|
+
q = null, U = 0, Y = null, k = (c & 96) === 0 ? e : null, se = null, Kt(e.ctx), ne = !1, je = ++Ne, e.ac !== null && (Di(() => {
|
|
1285
1285
|
e.ac.abort(Yn);
|
|
1286
1286
|
}), e.ac = null);
|
|
1287
1287
|
try {
|
|
@@ -1309,7 +1309,7 @@ function Ji(e) {
|
|
|
1309
1309
|
} catch (y) {
|
|
1310
1310
|
return bi(y);
|
|
1311
1311
|
} finally {
|
|
1312
|
-
e.f ^= Tr, q = t, U = n, Y = r,
|
|
1312
|
+
e.f ^= Tr, q = t, U = n, Y = r, k = i, se = o, Kt(s), ne = a, je = l;
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
1315
|
function wa(e, t) {
|
|
@@ -1335,8 +1335,8 @@ function ct(e) {
|
|
|
1335
1335
|
var t = e.f;
|
|
1336
1336
|
if ((t & 16384) === 0) {
|
|
1337
1337
|
P(e, ae);
|
|
1338
|
-
var n =
|
|
1339
|
-
if (
|
|
1338
|
+
var n = E, r = Bt;
|
|
1339
|
+
if (E = e, Bt = !0, 0)
|
|
1340
1340
|
var i, o;
|
|
1341
1341
|
try {
|
|
1342
1342
|
(t & 16777232) !== 0 ? ya(e) : or(e), qi(e);
|
|
@@ -1344,27 +1344,27 @@ function ct(e) {
|
|
|
1344
1344
|
if (e.teardown = typeof s == "function" ? s : null, e.wv = Ki, 0)
|
|
1345
1345
|
for (var a of e.deps) ;
|
|
1346
1346
|
} finally {
|
|
1347
|
-
Bt = r,
|
|
1347
|
+
Bt = r, E = n;
|
|
1348
1348
|
}
|
|
1349
1349
|
}
|
|
1350
1350
|
}
|
|
1351
1351
|
function b(e) {
|
|
1352
1352
|
var t = (e.f & 2) !== 0;
|
|
1353
|
-
if (Sa?.add(e),
|
|
1354
|
-
var n =
|
|
1355
|
-
if ((
|
|
1353
|
+
if (Sa?.add(e), k !== null && !ne && !(E !== null && (E.f & 16384) !== 0) && (se === null || !se.has(e))) {
|
|
1354
|
+
var n = k.deps;
|
|
1355
|
+
if ((k.f & 2097152) !== 0)
|
|
1356
1356
|
e.rv < Ne && (e.rv = Ne, q === null && n !== null && n[U] === e ? U++ : q === null ? q = [e] : q.push(e));
|
|
1357
1357
|
else {
|
|
1358
1358
|
var r;
|
|
1359
|
-
(r =
|
|
1359
|
+
(r = k).deps ?? (r.deps = []), Vt.call(k.deps, e) || k.deps.push(e);
|
|
1360
1360
|
var i = e.reactions;
|
|
1361
|
-
i === null ? e.reactions = [
|
|
1361
|
+
i === null ? e.reactions = [k] : Vt.call(i, k) || i.push(k);
|
|
1362
1362
|
}
|
|
1363
1363
|
}
|
|
1364
1364
|
if (0) {
|
|
1365
1365
|
if (!ne && reactivity_loss_tracker && !reactivity_loss_tracker.warned && (reactivity_loss_tracker.effect.f & 2097152) === 0 && !reactivity_loss_tracker.effect_deps.has(e))
|
|
1366
1366
|
var o;
|
|
1367
|
-
if (tracing_mode_flag && !ne && tracing_expressions !== null &&
|
|
1367
|
+
if (tracing_mode_flag && !ne && tracing_expressions !== null && k !== null && tracing_expressions.reaction === k && !e.trace) {
|
|
1368
1368
|
if (o)
|
|
1369
1369
|
var s, a;
|
|
1370
1370
|
}
|
|
@@ -1376,7 +1376,7 @@ function b(e) {
|
|
|
1376
1376
|
var c = l.v;
|
|
1377
1377
|
return ((l.f & 1024) === 0 && l.reactions !== null || Zi(l)) && (c = nr(l)), De.set(l, c), c;
|
|
1378
1378
|
}
|
|
1379
|
-
var u = (l.f & 512) === 0 && !ne &&
|
|
1379
|
+
var u = (l.f & 512) === 0 && !ne && k !== null && (Bt || (k.f & 512) !== 0), h = (l.f & li) === 0;
|
|
1380
1380
|
Ot(l) && (u && (l.f |= 512), Ri(l)), u && !h && (Li(l), Qi(l));
|
|
1381
1381
|
}
|
|
1382
1382
|
if (z?.has(e)) return z.get(e);
|
|
@@ -1403,7 +1403,7 @@ function hn(e) {
|
|
|
1403
1403
|
ne = t;
|
|
1404
1404
|
}
|
|
1405
1405
|
}
|
|
1406
|
-
var Nt = /* @__PURE__ */ Symbol("events"),
|
|
1406
|
+
var Nt = /* @__PURE__ */ Symbol("events"), ka = /* @__PURE__ */ new Set(), Or = /* @__PURE__ */ new Set(), Mr = null;
|
|
1407
1407
|
function Rr(e) {
|
|
1408
1408
|
var t = this, n = t.ownerDocument, r = e.type, i = e.composedPath?.() || [], o = i[0] || e.target;
|
|
1409
1409
|
Mr = e;
|
|
@@ -1425,7 +1425,7 @@ function Rr(e) {
|
|
|
1425
1425
|
return o || n;
|
|
1426
1426
|
}
|
|
1427
1427
|
});
|
|
1428
|
-
var u =
|
|
1428
|
+
var u = k, h = E;
|
|
1429
1429
|
de(null), xe(null);
|
|
1430
1430
|
try {
|
|
1431
1431
|
for (var p, g = []; o !== null && o !== t; ) {
|
|
@@ -1449,16 +1449,16 @@ function Rr(e) {
|
|
|
1449
1449
|
}
|
|
1450
1450
|
}
|
|
1451
1451
|
}
|
|
1452
|
-
var
|
|
1452
|
+
var Ea = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
|
|
1453
1453
|
function Aa(e) {
|
|
1454
|
-
return
|
|
1454
|
+
return Ea?.createHTML(e) ?? e;
|
|
1455
1455
|
}
|
|
1456
1456
|
function Ca(e) {
|
|
1457
1457
|
var t = Fi("template");
|
|
1458
1458
|
return t.innerHTML = Aa(e.replaceAll("<!>", "<!---->")), t.content;
|
|
1459
1459
|
}
|
|
1460
1460
|
function zt(e, t) {
|
|
1461
|
-
var n =
|
|
1461
|
+
var n = E;
|
|
1462
1462
|
n.nodes === null && (n.nodes = {
|
|
1463
1463
|
start: e,
|
|
1464
1464
|
end: t,
|
|
@@ -1483,7 +1483,7 @@ function xa(e, t) {
|
|
|
1483
1483
|
}
|
|
1484
1484
|
function eo(e, t) {
|
|
1485
1485
|
if (re) {
|
|
1486
|
-
var n =
|
|
1486
|
+
var n = E;
|
|
1487
1487
|
((n.f & 32768) === 0 || n.nodes.end === null) && (n.nodes.end = D), fi();
|
|
1488
1488
|
return;
|
|
1489
1489
|
}
|
|
@@ -1569,7 +1569,7 @@ function La(e, t) {
|
|
|
1569
1569
|
try {
|
|
1570
1570
|
for (var o = /* @__PURE__ */ Ln(n); o && (o.nodeType !== 8 || o.data !== "["); ) o = /* @__PURE__ */ dt(o);
|
|
1571
1571
|
if (!o) throw qt;
|
|
1572
|
-
Rt(!0),
|
|
1572
|
+
Rt(!0), kt(o);
|
|
1573
1573
|
const s = no(e, {
|
|
1574
1574
|
...t,
|
|
1575
1575
|
anchor: o
|
|
@@ -1580,7 +1580,7 @@ function La(e, t) {
|
|
|
1580
1580
|
`).some((a) => a.startsWith("https://svelte.dev/e/"))) throw s;
|
|
1581
1581
|
return s !== qt && console.warn("Failed to hydrate: ", s), t.recover === !1 && Is(), Rn(), ha(n), Rt(!1), to(e, t);
|
|
1582
1582
|
} finally {
|
|
1583
|
-
Rt(r),
|
|
1583
|
+
Rt(r), kt(i);
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
1586
|
var Ht = /* @__PURE__ */ new Map();
|
|
@@ -1591,8 +1591,8 @@ function no(e, { target: t, anchor: n, props: r = {}, events: i, context: o, int
|
|
|
1591
1591
|
Qs(u, { pending: () => {
|
|
1592
1592
|
} }, (g) => {
|
|
1593
1593
|
mi({});
|
|
1594
|
-
var m =
|
|
1595
|
-
if (o && (m.c = o), i && (r.$$events = i), re && zt(g, null), Lr = s, l = e(g, r) || {}, Lr = !0, re && (
|
|
1594
|
+
var m = L;
|
|
1595
|
+
if (o && (m.c = o), i && (r.$$events = i), re && zt(g, null), Lr = s, l = e(g, r) || {}, Lr = !0, re && (E.nodes.end = D, D === null || D.nodeType !== 8 || D.data !== "]"))
|
|
1596
1596
|
throw di(), qt;
|
|
1597
1597
|
vi();
|
|
1598
1598
|
}, a);
|
|
@@ -1611,7 +1611,7 @@ function no(e, { target: t, anchor: n, props: r = {}, events: i, context: o, int
|
|
|
1611
1611
|
}
|
|
1612
1612
|
}
|
|
1613
1613
|
};
|
|
1614
|
-
return p(us(
|
|
1614
|
+
return p(us(ka)), Or.add(p), () => {
|
|
1615
1615
|
for (var g of h) for (const y of [t, document]) {
|
|
1616
1616
|
var m = Ht.get(y), v = m.get(g);
|
|
1617
1617
|
--v == 0 ? (y.removeEventListener(g, Rr), m.delete(g), m.size === 0 && Ht.delete(y)) : m.set(g, v);
|
|
@@ -1627,7 +1627,7 @@ function $a(e, t) {
|
|
|
1627
1627
|
return n ? ($n.delete(e), n(t)) : Promise.resolve();
|
|
1628
1628
|
}
|
|
1629
1629
|
function Pa(e) {
|
|
1630
|
-
|
|
1630
|
+
L === null && ks("onMount"), It && L.l !== null ? Na(L).m.push(e) : Le(() => {
|
|
1631
1631
|
const t = hn(e);
|
|
1632
1632
|
if (typeof t == "function") return t;
|
|
1633
1633
|
});
|
|
@@ -1666,7 +1666,7 @@ function bn(e, t) {
|
|
|
1666
1666
|
return e === t || e?.[St] === t;
|
|
1667
1667
|
}
|
|
1668
1668
|
function Wa(e = {}, t, n, r) {
|
|
1669
|
-
var i =
|
|
1669
|
+
var i = L.r, o = E;
|
|
1670
1670
|
return ma(() => {
|
|
1671
1671
|
var s, a;
|
|
1672
1672
|
return ir(() => {
|
|
@@ -1710,7 +1710,7 @@ function we(e, t, n, r) {
|
|
|
1710
1710
|
}
|
|
1711
1711
|
var S = !1, O = ((n & 1) !== 0 ? tn : ra)(() => (S = !1, v()));
|
|
1712
1712
|
o && b(O);
|
|
1713
|
-
var V =
|
|
1713
|
+
var V = E;
|
|
1714
1714
|
return (function(A, G) {
|
|
1715
1715
|
if (arguments.length > 0) {
|
|
1716
1716
|
const Z = G ? b(O) : i && o ? ot(A) : A;
|
|
@@ -2483,7 +2483,7 @@ var bh = lo("I18nService"), Tn = {
|
|
|
2483
2483
|
function qe(e) {
|
|
2484
2484
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
2485
2485
|
}
|
|
2486
|
-
function
|
|
2486
|
+
function ke(e, t) {
|
|
2487
2487
|
if (e == null) return [];
|
|
2488
2488
|
if (!Array.isArray(e)) throw new Error(`Invalid tools config at "${t}": expected an array of tool ids.`);
|
|
2489
2489
|
if (e.find((n) => typeof n != "string") !== void 0) throw new Error(`Invalid tools config at "${t}": all entries must be strings.`);
|
|
@@ -2521,7 +2521,7 @@ function co(e) {
|
|
|
2521
2521
|
const t = e.trim();
|
|
2522
2522
|
return t || "";
|
|
2523
2523
|
}
|
|
2524
|
-
function
|
|
2524
|
+
function Ee(e) {
|
|
2525
2525
|
if (!e || e.length === 0) return [];
|
|
2526
2526
|
const t = /* @__PURE__ */ new Set();
|
|
2527
2527
|
for (const n of e) {
|
|
@@ -2541,13 +2541,13 @@ function rl(e) {
|
|
|
2541
2541
|
if (e != null && !qe(e)) throw new Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');
|
|
2542
2542
|
const t = Za(e?.policy), n = Qa(e?.placement), r = tl(e?.providers), i = nl(e?.pnpEnforcement, "pnpEnforcement"), o = {
|
|
2543
2543
|
policy: {
|
|
2544
|
-
allowed: ke(
|
|
2545
|
-
blocked: ke(
|
|
2544
|
+
allowed: Ee(ke(t?.allowed, "policy.allowed")),
|
|
2545
|
+
blocked: Ee(ke(t?.blocked, "policy.blocked"))
|
|
2546
2546
|
},
|
|
2547
2547
|
placement: {
|
|
2548
|
-
section: ke(
|
|
2549
|
-
item: ke(
|
|
2550
|
-
passage: ke(
|
|
2548
|
+
section: Ee(ke(n?.section, "placement.section")).length ? Ee(ke(n?.section, "placement.section")) : [...Sn.section],
|
|
2549
|
+
item: Ee(ke(n?.item, "placement.item")).length ? Ee(ke(n?.item, "placement.item")) : [...Sn.item],
|
|
2550
|
+
passage: Ee(ke(n?.passage, "placement.passage")).length ? Ee(ke(n?.passage, "placement.passage")) : [...Sn.passage]
|
|
2551
2551
|
},
|
|
2552
2552
|
providers: r
|
|
2553
2553
|
};
|
|
@@ -3295,14 +3295,14 @@ var gl = class {
|
|
|
3295
3295
|
annotationToolbar: "pie-tool-annotation-toolbar",
|
|
3296
3296
|
graph: "pie-tool-graph",
|
|
3297
3297
|
periodicTable: "pie-tool-periodic-table"
|
|
3298
|
-
},
|
|
3299
|
-
const i =
|
|
3298
|
+
}, kl = (e, t) => wl(t?.toolTagMap?.[e] ?? go[e] ?? e, `tool component tag for "${e}"`), El = (e) => document.createElement(e), fe = (e, t, n, r) => {
|
|
3299
|
+
const i = kl(e, r), o = r?.toolComponentFactories?.[e] ?? r?.toolComponentFactory;
|
|
3300
3300
|
return o ? o({
|
|
3301
3301
|
toolId: e,
|
|
3302
3302
|
tagName: i,
|
|
3303
3303
|
context: t,
|
|
3304
3304
|
toolbarContext: n
|
|
3305
|
-
}) :
|
|
3305
|
+
}) : El(i);
|
|
3306
3306
|
}, Nn = /* @__PURE__ */ new WeakMap();
|
|
3307
3307
|
function Al(e, t) {
|
|
3308
3308
|
if (!e) return null;
|
|
@@ -3404,7 +3404,7 @@ var Il = {
|
|
|
3404
3404
|
}
|
|
3405
3405
|
};
|
|
3406
3406
|
}
|
|
3407
|
-
},
|
|
3407
|
+
}, R = (e) => e.trim().replace(/\s+/g, " "), mo = () => /[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu, vo = (e) => {
|
|
3408
3408
|
if (e.hidden || e.tagName?.toLowerCase() === "mjx-assistive-mml" || e.getAttribute("aria-hidden") === "true" || e.hasAttribute("inert")) return !0;
|
|
3409
3409
|
const t = e.classList;
|
|
3410
3410
|
if (t?.contains("sr-only") || t?.contains("pie-sr-only") || t?.contains("visually-hidden")) return !0;
|
|
@@ -3520,7 +3520,7 @@ var Il = {
|
|
|
3520
3520
|
}
|
|
3521
3521
|
}, To = async (e, t = {}) => {
|
|
3522
3522
|
if (!e.some((c) => c.type === "math")) return {
|
|
3523
|
-
speechText:
|
|
3523
|
+
speechText: R(e.map((c) => c.type === "text" ? c.text : c.fallbackText).join(" ")),
|
|
3524
3524
|
usedMathSpeech: !1,
|
|
3525
3525
|
usedFallback: !1
|
|
3526
3526
|
};
|
|
@@ -3533,7 +3533,7 @@ var Il = {
|
|
|
3533
3533
|
}
|
|
3534
3534
|
try {
|
|
3535
3535
|
n || (n = await o());
|
|
3536
|
-
const u =
|
|
3536
|
+
const u = R(await bo(n, c.mathml, t.language, "none", t.mathSpeech));
|
|
3537
3537
|
if (u) {
|
|
3538
3538
|
s.push(u), r = !0;
|
|
3539
3539
|
continue;
|
|
@@ -3543,7 +3543,7 @@ var Il = {
|
|
|
3543
3543
|
i = !0, console.debug("[TTSService] Math speech generation failed; using visible fallback", { message: u instanceof Error ? u.message : String(u) }), s.push(c.fallbackText);
|
|
3544
3544
|
}
|
|
3545
3545
|
}
|
|
3546
|
-
const a =
|
|
3546
|
+
const a = R(s.join(" "));
|
|
3547
3547
|
let l;
|
|
3548
3548
|
return t.produceSsml && n && r && e.length === 1 && e[0].type === "math" && (l = await Nl(n, e[0].mathml, t.language, t.mathSpeech) ?? void 0), {
|
|
3549
3549
|
speechText: a,
|
|
@@ -3660,8 +3660,8 @@ var Il = {
|
|
|
3660
3660
|
validateEndpoint: e.validateEndpoint,
|
|
3661
3661
|
...typeof e.mathTokenHighlighting == "boolean" ? { mathTokenHighlighting: e.mathTokenHighlighting } : {}
|
|
3662
3662
|
};
|
|
3663
|
-
},
|
|
3664
|
-
switch (
|
|
3663
|
+
}, ko = (e) => sn(e.layoutMode), ql = (e) => {
|
|
3664
|
+
switch (ko(e)) {
|
|
3665
3665
|
case "reserved-row":
|
|
3666
3666
|
return {
|
|
3667
3667
|
mount: "before-buttons",
|
|
@@ -3727,7 +3727,7 @@ var Il = {
|
|
|
3727
3727
|
return pn(e);
|
|
3728
3728
|
},
|
|
3729
3729
|
renderToolbar(e, t) {
|
|
3730
|
-
const n = () => wn(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), r = () => Fl(n().speedOptions), i = () =>
|
|
3730
|
+
const n = () => wn(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), r = () => Fl(n().speedOptions), i = () => ko(n()), o = () => ql(n()), s = ar(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
|
|
3731
3731
|
const u = t.ui?.size;
|
|
3732
3732
|
return u === "sm" || u === "lg" ? u : "md";
|
|
3733
3733
|
}, l = () => {
|
|
@@ -4396,14 +4396,14 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
4396
4396
|
"say-as",
|
|
4397
4397
|
"voice",
|
|
4398
4398
|
"lang"
|
|
4399
|
-
]), Ur = /* @__PURE__ */ new Set(["audio", "phoneme"]),
|
|
4399
|
+
]), Ur = /* @__PURE__ */ new Set(["audio", "phoneme"]), Eo = (e) => e.replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/ /g, " ").replace(/ /g, " ").replace(/&/g, "&"), jt = (e, t, n) => {
|
|
4400
4400
|
for (let r = 0; r < t.length; r++) e.push({
|
|
4401
4401
|
char: t[r],
|
|
4402
4402
|
rawOffset: n === null ? null : n + r
|
|
4403
4403
|
});
|
|
4404
4404
|
}, uc = (e, t, n) => {
|
|
4405
4405
|
const r = t.slice(n).match(/^&(quot|apos|lt|gt|nbsp|amp|#160);/i);
|
|
4406
|
-
return r ? (jt(e,
|
|
4406
|
+
return r ? (jt(e, Eo(r[0]), n), r[0].length) : 0;
|
|
4407
4407
|
}, Kr = (e) => {
|
|
4408
4408
|
e.push({
|
|
4409
4409
|
char: " ",
|
|
@@ -4427,7 +4427,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
4427
4427
|
};
|
|
4428
4428
|
}, dc = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", fc = (e, t) => {
|
|
4429
4429
|
const n = new RegExp(`${t}\\s*=\\s*("([^"]*)"|'([^']*)')`, "i"), r = e.match(n);
|
|
4430
|
-
return
|
|
4430
|
+
return Eo(r?.[2] ?? r?.[3] ?? "") || null;
|
|
4431
4431
|
}, Ao = (e) => {
|
|
4432
4432
|
const t = [];
|
|
4433
4433
|
let n = !1, r = !1, i = 0;
|
|
@@ -4474,7 +4474,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
4474
4474
|
}
|
|
4475
4475
|
const o = hc(t);
|
|
4476
4476
|
return {
|
|
4477
|
-
spokenText:
|
|
4477
|
+
spokenText: R(o.text),
|
|
4478
4478
|
rawToSpokenOffsetMap: o.rawToSpokenOffsetMap,
|
|
4479
4479
|
unsupportedSemantic: n,
|
|
4480
4480
|
hasMarkup: r
|
|
@@ -4635,7 +4635,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
4635
4635
|
const r = e.length / Math.max(1, Math.min(t.length, n.length)), i = e.reduce((o, s) => o + s.score, 0) / e.length / 10;
|
|
4636
4636
|
return Math.min(1, r * i);
|
|
4637
4637
|
}, xo = (e) => {
|
|
4638
|
-
const t = Ao(e.speechText), n =
|
|
4638
|
+
const t = Ao(e.speechText), n = R(e.visibleText), r = t.spokenText, i = zn(r), o = zn(n), s = t.unsupportedSemantic ? [] : vc(i, o), a = yc(s, i, o), l = r === n && r.length > 0, c = s.length === 1 && s[0].score === 10 && i.length <= 2 && o.length <= 2, u = t.unsupportedSemantic ? "region-fallback" : l ? "exact-word" : (s.length >= 2 || c) && a >= 0.12 ? "anchor-span" : "region-fallback", h = t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text";
|
|
4639
4639
|
return {
|
|
4640
4640
|
speechText: e.speechText,
|
|
4641
4641
|
spokenText: r,
|
|
@@ -4756,7 +4756,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
4756
4756
|
["munderover", "underoverscript"],
|
|
4757
4757
|
["mmultiscripts", "multiscript"],
|
|
4758
4758
|
["menclose", "enclosure"]
|
|
4759
|
-
]),
|
|
4759
|
+
]), kc = (e) => e.replace(/\s+/g, " ").trim(), Ve = (e) => (e.localName || e.tagName || "").toLowerCase(), Ec = (e) => e.nodeType === Node.ELEMENT_NODE, ut = (e) => Array.from(e.childNodes).filter(Ec), hr = (e) => kc(e.textContent || ""), ye = (e, t) => ({
|
|
4760
4760
|
type: "element-range",
|
|
4761
4761
|
quality: t,
|
|
4762
4762
|
element: e
|
|
@@ -5240,7 +5240,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
5240
5240
|
i.push(s);
|
|
5241
5241
|
}
|
|
5242
5242
|
return `<${n}${r.length > 0 ? ` ${r.join(" ")}` : ""}>${i.join("")}</${n}>`;
|
|
5243
|
-
}, nu = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null,
|
|
5243
|
+
}, nu = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, kn = (e) => {
|
|
5244
5244
|
const t = String(e || "").trim();
|
|
5245
5245
|
if (!t) return null;
|
|
5246
5246
|
const n = nu(t);
|
|
@@ -5262,16 +5262,16 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
5262
5262
|
const t = e.getAttribute("data-mathml");
|
|
5263
5263
|
return t && t.trim() ? t : null;
|
|
5264
5264
|
}, iu = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, ou = (e) => {
|
|
5265
|
-
if (e.tagName.toLowerCase() === "math") return
|
|
5265
|
+
if (e.tagName.toLowerCase() === "math") return kn(e.outerHTML);
|
|
5266
5266
|
const t = ru(e);
|
|
5267
5267
|
if (t) {
|
|
5268
|
-
const n =
|
|
5268
|
+
const n = kn(t);
|
|
5269
5269
|
if (n) return n;
|
|
5270
5270
|
}
|
|
5271
5271
|
if (Ho(e)) {
|
|
5272
5272
|
const n = iu(e);
|
|
5273
5273
|
if (n) {
|
|
5274
|
-
const r =
|
|
5274
|
+
const r = kn(n);
|
|
5275
5275
|
if (r) return r;
|
|
5276
5276
|
}
|
|
5277
5277
|
}
|
|
@@ -5388,7 +5388,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
5388
5388
|
if (!Bo(o))
|
|
5389
5389
|
for (const s of Array.from(o.childNodes)) r(s);
|
|
5390
5390
|
};
|
|
5391
|
-
return r(t.documentElement),
|
|
5391
|
+
return r(t.documentElement), R(n.join(" "));
|
|
5392
5392
|
}, du = (e, t, n) => {
|
|
5393
5393
|
const r = No(n), i = (a) => {
|
|
5394
5394
|
if (ft(a, e)) return;
|
|
@@ -5402,7 +5402,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
5402
5402
|
for (const c of Array.from(l.childNodes)) i(c);
|
|
5403
5403
|
};
|
|
5404
5404
|
i(e), Do(r);
|
|
5405
|
-
const o =
|
|
5405
|
+
const o = R(r.chars.join(""));
|
|
5406
5406
|
if (o) return {
|
|
5407
5407
|
text: o,
|
|
5408
5408
|
map: r.map
|
|
@@ -5419,7 +5419,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
5419
5419
|
const n = No(t), r = [];
|
|
5420
5420
|
let i = 0, o, s = !1;
|
|
5421
5421
|
const a = () => {
|
|
5422
|
-
const u =
|
|
5422
|
+
const u = R(n.chars.slice(i, n.chars.length).join(""));
|
|
5423
5423
|
u && r.push({
|
|
5424
5424
|
type: "text",
|
|
5425
5425
|
text: u,
|
|
@@ -5440,7 +5440,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
5440
5440
|
a();
|
|
5441
5441
|
const g = du(h, p, t);
|
|
5442
5442
|
uu(n, g);
|
|
5443
|
-
const m =
|
|
5443
|
+
const m = R(g.text);
|
|
5444
5444
|
r.push({
|
|
5445
5445
|
type: "math",
|
|
5446
5446
|
mathml: p,
|
|
@@ -5498,7 +5498,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
5498
5498
|
const t = e.resolveMathSpeech ?? pu, { visibleText: n } = e, r = [];
|
|
5499
5499
|
let i = 0;
|
|
5500
5500
|
const o = (a) => {
|
|
5501
|
-
const l =
|
|
5501
|
+
const l = R(a), c = n.indexOf(l, i), u = c >= 0 ? c : i, h = u + l.length;
|
|
5502
5502
|
return i = h, {
|
|
5503
5503
|
start: u,
|
|
5504
5504
|
end: h
|
|
@@ -5512,7 +5512,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
5512
5512
|
offset: 0
|
|
5513
5513
|
}] : lr(l.text, { locale: e.language });
|
|
5514
5514
|
for (const m of g) {
|
|
5515
|
-
const v =
|
|
5515
|
+
const v = R(m.text);
|
|
5516
5516
|
if (!v) continue;
|
|
5517
5517
|
const y = o(v);
|
|
5518
5518
|
r.push({
|
|
@@ -5549,7 +5549,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
5549
5549
|
segments: r,
|
|
5550
5550
|
locale: gu(e.language),
|
|
5551
5551
|
visibleText: n,
|
|
5552
|
-
plainSpeechText:
|
|
5552
|
+
plainSpeechText: R(s.join(" "))
|
|
5553
5553
|
};
|
|
5554
5554
|
}, Tu = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Su = "sre-v1", _u = 256, Vn = (e) => Array.isArray(e) ? `array:[${e.map(Vn).join(",")}]` : e && typeof e == "object" ? `object:{${Object.entries(e).sort(([t], [n]) => t.localeCompare(n)).map(([t, n]) => `${JSON.stringify(t)}:${Vn(n)}`).join(",")}}` : e === null ? "null:null" : typeof e > "u" ? "undefined:" : typeof e == "function" ? `function:${e.name || "anonymous"}` : typeof e == "symbol" ? `symbol:${String(e)}` : typeof e == "bigint" ? `bigint:${e.toString()}` : typeof e == "number" ? Number.isFinite(e) ? `number:${e}` : `number:${String(e)}` : `${typeof e}:${JSON.stringify(e)}`, ei = (e, t, n, r) => `${Su}\0${Tu(e)}\0${t ? "ssml" : "plain"}\0${Vn(n ?? null)}\0${r}`, wu = (e = {}) => {
|
|
5555
5555
|
const t = Math.max(1, e.maxEntries ?? _u), n = e.resolve ?? ((o, s) => To([o], s)), r = /* @__PURE__ */ new Map(), i = (o, s) => {
|
|
@@ -5572,7 +5572,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
5572
5572
|
usedFallback: h.usedFallback
|
|
5573
5573
|
}), i(c, h), h;
|
|
5574
5574
|
};
|
|
5575
|
-
},
|
|
5575
|
+
}, ku = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : Mt({ speechText: e }).tokens[0]?.normalized || null, Eu = (e, t) => {
|
|
5576
5576
|
const n = Mt({ speechText: e.speechText });
|
|
5577
5577
|
if (!Number.isFinite(t.position)) return {
|
|
5578
5578
|
boundary: null,
|
|
@@ -5592,7 +5592,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
5592
5592
|
spokenText: n.spokenText
|
|
5593
5593
|
};
|
|
5594
5594
|
}, Au = (e, t, n) => n ? Mt({ speechText: e }).tokens.find((r) => r.start <= t && t < r.end)?.normalized === n : !0, Cu = (e, t) => {
|
|
5595
|
-
const n =
|
|
5595
|
+
const n = ku(t.word);
|
|
5596
5596
|
if (e.id !== t.chunkId) return {
|
|
5597
5597
|
chunkId: t.chunkId,
|
|
5598
5598
|
normalizedWord: n,
|
|
@@ -5613,7 +5613,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
5613
5613
|
if (e.catalogAlignment)
|
|
5614
5614
|
r = bc(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
|
|
5615
5615
|
else {
|
|
5616
|
-
const o =
|
|
5616
|
+
const o = Eu(e, t);
|
|
5617
5617
|
r = o.boundary, i = o.spokenText;
|
|
5618
5618
|
}
|
|
5619
5619
|
return r ? Au(i, r.start, n) ? {
|
|
@@ -6018,7 +6018,7 @@ var cc = /* @__PURE__ */ new Set([
|
|
|
6018
6018
|
})(I || (I = {}));
|
|
6019
6019
|
var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, Ju = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? Qo(e.range, t.range) : e.type === "element" && t.type === "element" ? e.element === t.element : e.type === "text-range" && t.type === "text-range" ? e.node === t.node && e.startOffset === t.startOffset && e.endOffset === t.endOffset : !1, Qu = class Xn {
|
|
6020
6020
|
constructor() {
|
|
6021
|
-
f(this, "currentProvider", null), f(this, "provider", null), f(this, "highlightCoordinator", null), f(this, "highlightTargetResolverProvider", null), f(this, "catalogResolver", null), f(this, "state", I.IDLE), f(this, "ttsConfig", {}), f(this, "currentText", null), f(this, "currentContentElement", null), f(this, "normalizedToDOM", /* @__PURE__ */ new Map()), f(this, "listeners", /* @__PURE__ */ new Map()), f(this, "lastError", null), f(this, "speakRunId", 0), f(this, "currentBoundaryOffset", 0), f(this, "activeWordBoundaryOffset", 0), f(this, "seekSegments", []), f(this, "sentenceHighlightSegments", []), f(this, "currentSeekSegmentIndex", 0), f(this, "activeSentenceStartOffset", null), f(this, "activeHighlightMode", "word"), f(this, "lastRenderedRegionTarget", null), f(this, "telemetryReporter", null), f(this, "generatedMathSpeechResolver", wu());
|
|
6021
|
+
f(this, "currentProvider", null), f(this, "provider", null), f(this, "highlightCoordinator", null), f(this, "highlightTargetResolverProvider", null), f(this, "catalogResolver", null), f(this, "state", I.IDLE), f(this, "ttsConfig", {}), f(this, "currentText", null), f(this, "currentContentElement", null), f(this, "normalizedToDOM", /* @__PURE__ */ new Map()), f(this, "listeners", /* @__PURE__ */ new Map()), f(this, "lastError", null), f(this, "speakRunId", 0), f(this, "currentBoundaryOffset", 0), f(this, "activeWordBoundaryOffset", 0), f(this, "seekSegments", []), f(this, "playbackChunks", []), f(this, "sentenceHighlightSegments", []), f(this, "currentSeekSegmentIndex", 0), f(this, "activeSentenceStartOffset", null), f(this, "activeHighlightMode", "word"), f(this, "lastRenderedRegionTarget", null), f(this, "telemetryReporter", null), f(this, "generatedMathSpeechResolver", wu());
|
|
6022
6022
|
}
|
|
6023
6023
|
debugLog(t, n) {
|
|
6024
6024
|
Xn.debugEnabled && (n === void 0 ? console.debug(t) : console.debug(t, n));
|
|
@@ -6393,6 +6393,17 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6393
6393
|
const r = t.playbackSegments.map((i) => i.startOffset).filter((i) => i > 0);
|
|
6394
6394
|
return this.splitSegmentsAtBoundaries(n, r, t.contentToSpeak);
|
|
6395
6395
|
}
|
|
6396
|
+
createSeekSegmentsFromSpeechChunks(t) {
|
|
6397
|
+
let n = 0;
|
|
6398
|
+
return t.map((r) => {
|
|
6399
|
+
const i = R(r.plainFallback?.speechText || (this.hasExplicitBreakSemantics(r.speechText) ? r.visibleText : r.speechText) || r.visibleText) || r.visibleText || "", o = {
|
|
6400
|
+
text: i,
|
|
6401
|
+
startOffset: n,
|
|
6402
|
+
pauseMsAfter: 0
|
|
6403
|
+
};
|
|
6404
|
+
return n += Math.max(1, i.length + 1), o;
|
|
6405
|
+
});
|
|
6406
|
+
}
|
|
6396
6407
|
getCurrentSeekSegmentIndex() {
|
|
6397
6408
|
if (this.seekSegments.length === 0) return 0;
|
|
6398
6409
|
let t = 0;
|
|
@@ -6492,7 +6503,7 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6492
6503
|
const g = n?.highlightModeOverride || (h ? this.resolveHighlightMode() : "sentence");
|
|
6493
6504
|
this.activeHighlightMode = g, this.activeWordBoundaryOffset = n?.wordBoundaryOffset || 0;
|
|
6494
6505
|
const m = this.hasExplicitBreakSemantics(o), v = !!this.currentContentElement && !c && !m && h;
|
|
6495
|
-
if (this.seekSegments = m || !h ? [] : v && this.currentContentElement ? this.createSpeechPlan(this.currentContentElement, l) : this.createSeekSegmentsFromText(a), this.sentenceHighlightSegments = m ? [] : this.createSentenceHighlightSegments({
|
|
6506
|
+
if (this.playbackChunks = p?.length ? p : [], this.seekSegments = this.playbackChunks.length ? this.createSeekSegmentsFromSpeechChunks(this.playbackChunks) : m || !h ? [] : v && this.currentContentElement ? this.createSpeechPlan(this.currentContentElement, l) : this.createSeekSegmentsFromText(a), this.sentenceHighlightSegments = m ? [] : this.createSentenceHighlightSegments({
|
|
6496
6507
|
contentToSpeak: a,
|
|
6497
6508
|
shouldUsePlan: v,
|
|
6498
6509
|
playbackSegments: this.seekSegments
|
|
@@ -6571,7 +6582,7 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6571
6582
|
}, "updateSettings" in this.provider && typeof this.provider.updateSettings == "function" && await this.provider.updateSettings({ providerOptions: o });
|
|
6572
6583
|
}
|
|
6573
6584
|
async resolveSpeechContent(t, n) {
|
|
6574
|
-
const r =
|
|
6585
|
+
const r = R(t);
|
|
6575
6586
|
if (n?.ignoreCatalogs) return {
|
|
6576
6587
|
contentToSpeak: r,
|
|
6577
6588
|
speechText: r,
|
|
@@ -6591,7 +6602,7 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6591
6602
|
context: n.catalogContext
|
|
6592
6603
|
});
|
|
6593
6604
|
if (o) {
|
|
6594
|
-
const s = n?.contentElement && bt(n.contentElement, this.getTextProcessingOptions(n.language)).visibleText || r, a =
|
|
6605
|
+
const s = n?.contentElement && bt(n.contentElement, this.getTextProcessingOptions(n.language)).visibleText || r, a = R(o.content);
|
|
6595
6606
|
return this.debugLog(`[TTSService] Using catalog content for "${n.catalogId}" (${o.language})`), {
|
|
6596
6607
|
contentToSpeak: o.content,
|
|
6597
6608
|
speechText: o.content,
|
|
@@ -6625,7 +6636,7 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6625
6636
|
if (!this.catalogResolver) return null;
|
|
6626
6637
|
const i = this.collectCatalogSpeechChunks(t, r);
|
|
6627
6638
|
if (!i.some((a) => a.sourceElement)) return null;
|
|
6628
|
-
const o =
|
|
6639
|
+
const o = R(i.map((a) => a.speechText).join(" ")), s = bt(t, this.getTextProcessingOptions(r.language)).visibleText || n;
|
|
6629
6640
|
return {
|
|
6630
6641
|
contentToSpeak: o,
|
|
6631
6642
|
speechText: o,
|
|
@@ -6643,7 +6654,7 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6643
6654
|
const r = [];
|
|
6644
6655
|
let i = "";
|
|
6645
6656
|
const o = () => {
|
|
6646
|
-
const u =
|
|
6657
|
+
const u = R(i);
|
|
6647
6658
|
i = "", u && r.push({
|
|
6648
6659
|
speechText: u,
|
|
6649
6660
|
visibleText: u,
|
|
@@ -6661,7 +6672,7 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6661
6672
|
}, a = (u, h) => {
|
|
6662
6673
|
const p = l(u);
|
|
6663
6674
|
if (p.length !== 1) return null;
|
|
6664
|
-
const g = p[0], m = bt(g, this.getTextProcessingOptions(n.language)).visibleText ||
|
|
6675
|
+
const g = p[0], m = bt(g, this.getTextProcessingOptions(n.language)).visibleText || R(g.textContent || ""), v = (y) => R(y).replace(/\s+/g, "");
|
|
6665
6676
|
return v(m) === v(h) ? g : null;
|
|
6666
6677
|
}, l = (u) => {
|
|
6667
6678
|
const h = Array.from(u.querySelectorAll("math"));
|
|
@@ -6676,7 +6687,7 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6676
6687
|
const h = u, p = s(h);
|
|
6677
6688
|
if (p) {
|
|
6678
6689
|
o();
|
|
6679
|
-
const g = bt(h, this.getTextProcessingOptions(n.language)), m = g.visibleText ||
|
|
6690
|
+
const g = bt(h, this.getTextProcessingOptions(n.language)), m = g.visibleText || R(h.textContent || ""), v = xo({
|
|
6680
6691
|
speechText: p.content,
|
|
6681
6692
|
visibleText: m
|
|
6682
6693
|
}), y = a(h, m), S = y ? an({
|
|
@@ -6688,7 +6699,7 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6688
6699
|
mathElement: A,
|
|
6689
6700
|
speechText: p.content
|
|
6690
6701
|
})
|
|
6691
|
-
})), V =
|
|
6702
|
+
})), V = R(p.content);
|
|
6692
6703
|
r.push({
|
|
6693
6704
|
speechText: p.content,
|
|
6694
6705
|
visibleText: m,
|
|
@@ -6751,7 +6762,7 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6751
6762
|
});
|
|
6752
6763
|
}
|
|
6753
6764
|
initializeSpeakTracking(t, n) {
|
|
6754
|
-
this.currentText = t, this.currentContentElement = n?.contentElement || null, this.lastError = null, this.currentBoundaryOffset = 0, this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null;
|
|
6765
|
+
this.currentText = t, this.currentContentElement = n?.contentElement || null, this.lastError = null, this.currentBoundaryOffset = 0, this.playbackChunks = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null;
|
|
6755
6766
|
}
|
|
6756
6767
|
prepareHighlightsForSpeak(t) {
|
|
6757
6768
|
if (!this.currentContentElement || !this.highlightCoordinator || (this.buildPositionMap(this.currentContentElement, t.contentToSpeak, t.options?.language), t.highlightMode === "sentence" && t.shouldUsePlan)) return;
|
|
@@ -6896,9 +6907,13 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6896
6907
|
}
|
|
6897
6908
|
async executeSpeakPlayback(t) {
|
|
6898
6909
|
if (t.speechChunks?.length && this.provider) {
|
|
6899
|
-
for (
|
|
6910
|
+
for (let n = 0; n < t.speechChunks.length; n++) {
|
|
6900
6911
|
if (t.runId !== this.speakRunId) return;
|
|
6901
|
-
|
|
6912
|
+
this.currentSeekSegmentIndex = n;
|
|
6913
|
+
const r = this.seekSegments[n];
|
|
6914
|
+
r && (this.currentBoundaryOffset = r.startOffset);
|
|
6915
|
+
const i = t.speechChunks[n];
|
|
6916
|
+
await this.speakCatalogChunk(i, t.runId);
|
|
6902
6917
|
}
|
|
6903
6918
|
return;
|
|
6904
6919
|
}
|
|
@@ -6910,7 +6925,7 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6910
6925
|
this.provider && await this.provider.speak(t.contentToSpeak);
|
|
6911
6926
|
}
|
|
6912
6927
|
clearHighlightsAndTracking() {
|
|
6913
|
-
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;
|
|
6928
|
+
this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.activeWordBoundaryOffset = 0, this.seekSegments = [], this.playbackChunks = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null;
|
|
6914
6929
|
}
|
|
6915
6930
|
async speakRange(t, n) {
|
|
6916
6931
|
if (!this.provider) throw new Error("TTS service not initialized");
|
|
@@ -6924,7 +6939,7 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6924
6939
|
if (!i) return;
|
|
6925
6940
|
const o = document.createRange();
|
|
6926
6941
|
o.selectNodeContents(i), o.setEnd(t.startContainer, t.startOffset);
|
|
6927
|
-
const s = o.toString(), a =
|
|
6942
|
+
const s = o.toString(), a = R(s), l = a.length + (/\s$/.test(s) && a ? 1 : 0);
|
|
6928
6943
|
this.debugLog("[TTSService] speakRange offset calculation:", {
|
|
6929
6944
|
selectedText: r,
|
|
6930
6945
|
textBeforeRange: s.substring(0, 100),
|
|
@@ -6947,19 +6962,27 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6947
6962
|
}
|
|
6948
6963
|
async restartFromSeekIndex(t) {
|
|
6949
6964
|
if (!this.provider || this.seekSegments.length === 0) return;
|
|
6950
|
-
const n = Math.max(0, Math.min(this.seekSegments.length - 1, t));
|
|
6965
|
+
const n = Math.max(0, Math.min(this.seekSegments.length - 1, t)), r = this.playbackChunks.length ? this.playbackChunks.slice(n) : null;
|
|
6951
6966
|
this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.currentSeekSegmentIndex = n;
|
|
6952
|
-
const
|
|
6967
|
+
const i = ++this.speakRunId, o = this.seekSegments.slice(n);
|
|
6953
6968
|
this.setState(I.PLAYING);
|
|
6954
6969
|
try {
|
|
6955
6970
|
if (this.configureWordBoundaryHighlighting({
|
|
6956
6971
|
highlightMode: this.activeHighlightMode,
|
|
6957
6972
|
wordBoundaryOffset: this.activeWordBoundaryOffset
|
|
6958
|
-
}),
|
|
6973
|
+
}), r) for (let s = 0; s < r.length; s++) {
|
|
6974
|
+
if (i !== this.speakRunId) return;
|
|
6975
|
+
const a = n + s;
|
|
6976
|
+
this.currentSeekSegmentIndex = a;
|
|
6977
|
+
const l = this.seekSegments[a];
|
|
6978
|
+
l && (this.currentBoundaryOffset = l.startOffset), await this.speakCatalogChunk(r[s], i);
|
|
6979
|
+
}
|
|
6980
|
+
else await this.speakWithPlan(o, i, { highlightMode: this.activeHighlightMode });
|
|
6981
|
+
if (i !== this.speakRunId) return;
|
|
6959
6982
|
this.setState(I.IDLE), this.clearHighlightsAndTracking(), this.highlightTargetResolverProvider = null;
|
|
6960
|
-
} catch (
|
|
6961
|
-
if (
|
|
6962
|
-
throw this.lastError =
|
|
6983
|
+
} catch (s) {
|
|
6984
|
+
if (i !== this.speakRunId) return;
|
|
6985
|
+
throw this.lastError = s instanceof Error ? s.message : String(s), this.setState(I.ERROR), this.clearHighlightsAndTracking(), this.highlightTargetResolverProvider = null, s;
|
|
6963
6986
|
}
|
|
6964
6987
|
}
|
|
6965
6988
|
async setPlaybackRate(t) {
|
|
@@ -6982,7 +7005,7 @@ var Qo = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6982
7005
|
await this.seekBy(-n);
|
|
6983
7006
|
}
|
|
6984
7007
|
stop() {
|
|
6985
|
-
this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.highlightTargetResolverProvider = null, this.setState(I.IDLE), this.currentText = null, this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.activeWordBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
|
|
7008
|
+
this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.highlightTargetResolverProvider = null, this.setState(I.IDLE), this.currentText = null, this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.activeWordBoundaryOffset = 0, this.seekSegments = [], this.playbackChunks = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
|
|
6986
7009
|
}
|
|
6987
7010
|
requestControlHandoff() {
|
|
6988
7011
|
typeof window > "u" || window.dispatchEvent(new CustomEvent(Yu, { detail: { source: "host" } }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-players/pie-tool-answer-eliminator",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.53",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Answer eliminator tool for PIE assessment player - supports process-of-elimination test-taking strategy",
|
|
6
6
|
"repository": {
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"unpkg": "./dist/tool-answer-eliminator.js",
|
|
40
40
|
"jsdelivr": "./dist/tool-answer-eliminator.js",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@pie-players/pie-assessment-toolkit": "0.3.
|
|
43
|
-
"@pie-players/pie-context": "0.3.
|
|
44
|
-
"@pie-players/pie-players-shared": "0.3.
|
|
42
|
+
"@pie-players/pie-assessment-toolkit": "0.3.53",
|
|
43
|
+
"@pie-players/pie-context": "0.3.53",
|
|
44
|
+
"@pie-players/pie-players-shared": "0.3.53"
|
|
45
45
|
},
|
|
46
46
|
"types": "./dist/index.d.ts",
|
|
47
47
|
"scripts": {
|