@pie-players/pie-tool-answer-eliminator 0.2.9 → 0.2.11
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/adapters/multiple-choice-adapter.ts +62 -14
- package/answer-eliminator-core.ts +7 -50
- package/dist/adapters/multiple-choice-adapter.d.ts +8 -0
- package/dist/adapters/multiple-choice-adapter.d.ts.map +1 -1
- package/dist/answer-eliminator-core.d.ts +2 -0
- package/dist/answer-eliminator-core.d.ts.map +1 -1
- package/dist/strategies/mask-strategy.d.ts +6 -2
- package/dist/strategies/mask-strategy.d.ts.map +1 -1
- package/dist/strategies/strikethrough-strategy.d.ts +9 -2
- package/dist/strategies/strikethrough-strategy.d.ts.map +1 -1
- package/dist/tool-answer-eliminator.js +1460 -1325
- package/package.json +4 -4
- package/strategies/mask-strategy.ts +27 -39
- package/strategies/strikethrough-strategy.ts +47 -66
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Rn = Object.defineProperty;
|
|
2
|
+
var li = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var f = (t, e, i) =>
|
|
7
|
-
var c = (t, e, i) => (
|
|
8
|
-
var
|
|
9
|
-
typeof window < "u" && ((
|
|
10
|
-
const
|
|
11
|
-
var
|
|
12
|
-
const
|
|
5
|
+
var On = (t, e, i) => e in t ? Rn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
|
|
6
|
+
var f = (t, e, i) => On(t, typeof e != "symbol" ? e + "" : e, i), Ht = (t, e, i) => e.has(t) || li("Cannot " + i);
|
|
7
|
+
var c = (t, e, i) => (Ht(t, e, "read from private field"), i ? i.call(t) : e.get(t)), A = (t, e, i) => e.has(t) ? li("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), _ = (t, e, i, n) => (Ht(t, e, "write to private field"), n ? n.call(t, i) : e.set(t, i), i), D = (t, e, i) => (Ht(t, e, "access private method"), i);
|
|
8
|
+
var Ai;
|
|
9
|
+
typeof window < "u" && ((Ai = window.__svelte ?? (window.__svelte = {})).v ?? (Ai.v = /* @__PURE__ */ new Set())).add("5");
|
|
10
|
+
const kn = 2, Ii = "[", Ei = "[!", wi = "]", yt = {}, N = /* @__PURE__ */ Symbol(), Hn = "http://www.w3.org/1999/xhtml", Nt = !1;
|
|
11
|
+
var Nn = Array.isArray, Vn = Array.prototype.indexOf, Xe = Array.prototype.includes, Mn = Array.from, Tt = Object.keys, At = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, Fn = Object.prototype, Dn = Array.prototype, Pn = Object.getPrototypeOf, ai = Object.isExtensible;
|
|
12
|
+
const Bn = () => {
|
|
13
13
|
};
|
|
14
|
-
function
|
|
14
|
+
function Gn(t) {
|
|
15
15
|
for (var e = 0; e < t.length; e++)
|
|
16
16
|
t[e]();
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
var t, e, i = new Promise((n,
|
|
20
|
-
t = n, e =
|
|
18
|
+
function jn() {
|
|
19
|
+
var t, e, i = new Promise((n, s) => {
|
|
20
|
+
t = n, e = s;
|
|
21
21
|
});
|
|
22
22
|
return { promise: i, resolve: t, reject: e };
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const H = 2, nt = 4, Si = 8, $i = 1 << 24, be = 16, _e = 32, Ce = 64, Vt = 128, x = 512, V = 1024, F = 2048, te = 4096, Ie = 8192, Ee = 16384, Qe = 32768, It = 65536, ci = 1 << 17, Ci = 1 << 18, Je = 1 << 19, qn = 1 << 20, De = 65536, Mt = 1 << 21, Li = 1 << 22, st = 1 << 23, gt = /* @__PURE__ */ Symbol("$state"), Kn = /* @__PURE__ */ Symbol("legacy props"), Wt = new class extends Error {
|
|
25
25
|
constructor() {
|
|
26
26
|
super(...arguments);
|
|
27
27
|
f(this, "name", "StaleReactionError");
|
|
28
28
|
f(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
29
29
|
}
|
|
30
|
-
}(),
|
|
31
|
-
function
|
|
30
|
+
}(), Qt = 8;
|
|
31
|
+
function zn(t) {
|
|
32
32
|
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Yn(t) {
|
|
35
35
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Un() {
|
|
38
38
|
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function xn(t) {
|
|
41
41
|
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function Xn() {
|
|
44
44
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Wn() {
|
|
47
47
|
throw new Error("https://svelte.dev/e/hydration_failed");
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function Qn() {
|
|
50
50
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function Jn() {
|
|
53
53
|
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Zn() {
|
|
56
56
|
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function es() {
|
|
59
59
|
throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Ri(t) {
|
|
62
62
|
console.warn("https://svelte.dev/e/hydration_mismatch");
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function ts() {
|
|
65
65
|
console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
|
|
66
66
|
}
|
|
67
|
-
let
|
|
68
|
-
function
|
|
69
|
-
|
|
67
|
+
let J = !1;
|
|
68
|
+
function ft(t) {
|
|
69
|
+
J = t;
|
|
70
70
|
}
|
|
71
|
-
let
|
|
72
|
-
function
|
|
71
|
+
let B;
|
|
72
|
+
function rt(t) {
|
|
73
73
|
if (t === null)
|
|
74
|
-
throw
|
|
75
|
-
return
|
|
74
|
+
throw Ri(), yt;
|
|
75
|
+
return B = t;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return
|
|
77
|
+
function Oi() {
|
|
78
|
+
return rt(/* @__PURE__ */ Ze(B));
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
if (
|
|
82
|
-
for (var e = t, i =
|
|
80
|
+
function is(t = 1) {
|
|
81
|
+
if (J) {
|
|
82
|
+
for (var e = t, i = B; e--; )
|
|
83
83
|
i = /** @type {TemplateNode} */
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
|
|
84
|
+
/* @__PURE__ */ Ze(i);
|
|
85
|
+
B = i;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
for (var e = 0, i =
|
|
90
|
-
if (i.nodeType ===
|
|
88
|
+
function ns(t = !0) {
|
|
89
|
+
for (var e = 0, i = B; ; ) {
|
|
90
|
+
if (i.nodeType === Qt) {
|
|
91
91
|
var n = (
|
|
92
92
|
/** @type {Comment} */
|
|
93
93
|
i.data
|
|
94
94
|
);
|
|
95
|
-
if (n ===
|
|
95
|
+
if (n === wi) {
|
|
96
96
|
if (e === 0) return i;
|
|
97
97
|
e -= 1;
|
|
98
|
-
} else (n ===
|
|
98
|
+
} else (n === Ii || n === Ei || // "[1", "[2", etc. for if blocks
|
|
99
99
|
n[0] === "[" && !isNaN(Number(n.slice(1)))) && (e += 1);
|
|
100
100
|
}
|
|
101
|
-
var
|
|
101
|
+
var s = (
|
|
102
102
|
/** @type {TemplateNode} */
|
|
103
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ Ze(i)
|
|
104
104
|
);
|
|
105
|
-
t && i.remove(), i =
|
|
105
|
+
t && i.remove(), i = s;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function ki(t) {
|
|
109
109
|
return t === this.v;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function ss(t, e) {
|
|
112
112
|
return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function";
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
return !
|
|
114
|
+
function rs(t) {
|
|
115
|
+
return !ss(t, this.v);
|
|
116
116
|
}
|
|
117
|
-
let
|
|
118
|
-
function
|
|
119
|
-
|
|
117
|
+
let os = !1, W = null;
|
|
118
|
+
function Et(t) {
|
|
119
|
+
W = t;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
|
|
123
|
-
p:
|
|
121
|
+
function Hi(t, e = !1, i) {
|
|
122
|
+
W = {
|
|
123
|
+
p: W,
|
|
124
124
|
i: !1,
|
|
125
125
|
c: null,
|
|
126
126
|
e: null,
|
|
@@ -129,52 +129,52 @@ function Ii(t, e = !1, i) {
|
|
|
129
129
|
l: null
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function Ni(t) {
|
|
133
133
|
var e = (
|
|
134
134
|
/** @type {ComponentContext} */
|
|
135
|
-
|
|
135
|
+
W
|
|
136
136
|
), i = e.e;
|
|
137
137
|
if (i !== null) {
|
|
138
138
|
e.e = null;
|
|
139
139
|
for (var n of i)
|
|
140
|
-
|
|
140
|
+
ln(n);
|
|
141
141
|
}
|
|
142
|
-
return t !== void 0 && (e.x = t), e.i = !0,
|
|
142
|
+
return t !== void 0 && (e.x = t), e.i = !0, W = e.p, t ?? /** @type {T} */
|
|
143
143
|
{};
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Vi() {
|
|
146
146
|
return !0;
|
|
147
147
|
}
|
|
148
|
-
let
|
|
149
|
-
function
|
|
150
|
-
var t =
|
|
151
|
-
|
|
148
|
+
let Re = [];
|
|
149
|
+
function Mi() {
|
|
150
|
+
var t = Re;
|
|
151
|
+
Re = [], Gn(t);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
if (
|
|
155
|
-
var e =
|
|
153
|
+
function Me(t) {
|
|
154
|
+
if (Re.length === 0 && !tt) {
|
|
155
|
+
var e = Re;
|
|
156
156
|
queueMicrotask(() => {
|
|
157
|
-
e ===
|
|
157
|
+
e === Re && Mi();
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
Re.push(t);
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
for (;
|
|
164
|
-
|
|
162
|
+
function ls() {
|
|
163
|
+
for (; Re.length > 0; )
|
|
164
|
+
Mi();
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
var e =
|
|
166
|
+
function Fi(t) {
|
|
167
|
+
var e = E;
|
|
168
168
|
if (e === null)
|
|
169
|
-
return
|
|
170
|
-
if ((e.f &
|
|
169
|
+
return y.f |= st, t;
|
|
170
|
+
if ((e.f & Qe) === 0 && (e.f & nt) === 0)
|
|
171
171
|
throw t;
|
|
172
172
|
wt(t, e);
|
|
173
173
|
}
|
|
174
174
|
function wt(t, e) {
|
|
175
175
|
for (; e !== null; ) {
|
|
176
|
-
if ((e.f &
|
|
177
|
-
if ((e.f &
|
|
176
|
+
if ((e.f & Vt) !== 0) {
|
|
177
|
+
if ((e.f & Qe) === 0)
|
|
178
178
|
throw t;
|
|
179
179
|
try {
|
|
180
180
|
e.b.error(t);
|
|
@@ -187,30 +187,30 @@ function wt(t, e) {
|
|
|
187
187
|
}
|
|
188
188
|
throw t;
|
|
189
189
|
}
|
|
190
|
-
const
|
|
191
|
-
function
|
|
192
|
-
t.f = t.f &
|
|
190
|
+
const as = -7169;
|
|
191
|
+
function R(t, e) {
|
|
192
|
+
t.f = t.f & as | e;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
(t.f &
|
|
194
|
+
function Jt(t) {
|
|
195
|
+
(t.f & x) !== 0 || t.deps === null ? R(t, V) : R(t, te);
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function Di(t) {
|
|
198
198
|
if (t !== null)
|
|
199
199
|
for (const e of t)
|
|
200
|
-
(e.f &
|
|
200
|
+
(e.f & H) === 0 || (e.f & De) === 0 || (e.f ^= De, Di(
|
|
201
201
|
/** @type {Derived} */
|
|
202
202
|
e.deps
|
|
203
203
|
));
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
(t.f &
|
|
205
|
+
function Pi(t, e, i) {
|
|
206
|
+
(t.f & F) !== 0 ? e.add(t) : (t.f & te) !== 0 && i.add(t), Di(t.deps), R(t, V);
|
|
207
207
|
}
|
|
208
|
-
const
|
|
209
|
-
let
|
|
210
|
-
var
|
|
211
|
-
const
|
|
208
|
+
const dt = /* @__PURE__ */ new Set();
|
|
209
|
+
let k = null, Q = null, G = [], Ct = null, Ft = !1, tt = !1;
|
|
210
|
+
var je, qe, ke, Ke, lt, at, He, de, ze, ae, Dt, Pt, Bi;
|
|
211
|
+
const ri = class ri {
|
|
212
212
|
constructor() {
|
|
213
|
-
|
|
213
|
+
A(this, ae);
|
|
214
214
|
f(this, "committed", !1);
|
|
215
215
|
/**
|
|
216
216
|
* The current values of any sources that are updated in this batch
|
|
@@ -229,36 +229,36 @@ const Jt = class Jt {
|
|
|
229
229
|
* and append new ones by calling the functions added inside (if/each/key/etc) blocks
|
|
230
230
|
* @type {Set<() => void>}
|
|
231
231
|
*/
|
|
232
|
-
|
|
232
|
+
A(this, je, /* @__PURE__ */ new Set());
|
|
233
233
|
/**
|
|
234
234
|
* If a fork is discarded, we need to destroy any effects that are no longer needed
|
|
235
235
|
* @type {Set<(batch: Batch) => void>}
|
|
236
236
|
*/
|
|
237
|
-
|
|
237
|
+
A(this, qe, /* @__PURE__ */ new Set());
|
|
238
238
|
/**
|
|
239
239
|
* The number of async effects that are currently in flight
|
|
240
240
|
*/
|
|
241
|
-
|
|
241
|
+
A(this, ke, 0);
|
|
242
242
|
/**
|
|
243
243
|
* The number of async effects that are currently in flight, _not_ inside a pending boundary
|
|
244
244
|
*/
|
|
245
|
-
|
|
245
|
+
A(this, Ke, 0);
|
|
246
246
|
/**
|
|
247
247
|
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
248
248
|
* TODO replace with Promise.withResolvers once supported widely enough
|
|
249
249
|
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
250
250
|
*/
|
|
251
|
-
|
|
251
|
+
A(this, lt, null);
|
|
252
252
|
/**
|
|
253
253
|
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
254
254
|
* @type {Set<Effect>}
|
|
255
255
|
*/
|
|
256
|
-
|
|
256
|
+
A(this, at, /* @__PURE__ */ new Set());
|
|
257
257
|
/**
|
|
258
258
|
* Deferred effects that are MAYBE_DIRTY
|
|
259
259
|
* @type {Set<Effect>}
|
|
260
260
|
*/
|
|
261
|
-
|
|
261
|
+
A(this, He, /* @__PURE__ */ new Set());
|
|
262
262
|
/**
|
|
263
263
|
* A map of branches that still exist, but will be destroyed when this batch
|
|
264
264
|
* is committed — we skip over these during `process`.
|
|
@@ -266,19 +266,19 @@ const Jt = class Jt {
|
|
|
266
266
|
* so they can be rescheduled if the branch survives.
|
|
267
267
|
* @type {Map<Effect, { d: Effect[], m: Effect[] }>}
|
|
268
268
|
*/
|
|
269
|
-
|
|
269
|
+
A(this, de, /* @__PURE__ */ new Map());
|
|
270
270
|
f(this, "is_fork", !1);
|
|
271
|
-
|
|
271
|
+
A(this, ze, !1);
|
|
272
272
|
}
|
|
273
273
|
is_deferred() {
|
|
274
|
-
return this.is_fork || c(this,
|
|
274
|
+
return this.is_fork || c(this, Ke) > 0;
|
|
275
275
|
}
|
|
276
276
|
/**
|
|
277
277
|
* Add an effect to the #skipped_branches map and reset its children
|
|
278
278
|
* @param {Effect} effect
|
|
279
279
|
*/
|
|
280
280
|
skip_effect(e) {
|
|
281
|
-
c(this,
|
|
281
|
+
c(this, de).has(e) || c(this, de).set(e, { d: [], m: [] });
|
|
282
282
|
}
|
|
283
283
|
/**
|
|
284
284
|
* Remove an effect from the #skipped_branches map and reschedule
|
|
@@ -286,13 +286,13 @@ const Jt = class Jt {
|
|
|
286
286
|
* @param {Effect} effect
|
|
287
287
|
*/
|
|
288
288
|
unskip_effect(e) {
|
|
289
|
-
var i = c(this,
|
|
289
|
+
var i = c(this, de).get(e);
|
|
290
290
|
if (i) {
|
|
291
|
-
c(this,
|
|
291
|
+
c(this, de).delete(e);
|
|
292
292
|
for (var n of i.d)
|
|
293
|
-
|
|
293
|
+
R(n, F), oe(n);
|
|
294
294
|
for (n of i.m)
|
|
295
|
-
|
|
295
|
+
R(n, te), oe(n);
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
/**
|
|
@@ -300,19 +300,19 @@ const Jt = class Jt {
|
|
|
300
300
|
* @param {Effect[]} root_effects
|
|
301
301
|
*/
|
|
302
302
|
process(e) {
|
|
303
|
-
|
|
303
|
+
G = [], this.apply();
|
|
304
304
|
var i = [], n = [];
|
|
305
|
-
for (const
|
|
306
|
-
|
|
305
|
+
for (const s of e)
|
|
306
|
+
D(this, ae, Dt).call(this, s, i, n);
|
|
307
307
|
if (this.is_deferred()) {
|
|
308
|
-
|
|
309
|
-
for (const [
|
|
310
|
-
|
|
308
|
+
D(this, ae, Pt).call(this, n), D(this, ae, Pt).call(this, i);
|
|
309
|
+
for (const [s, r] of c(this, de))
|
|
310
|
+
Ki(s, r);
|
|
311
311
|
} else {
|
|
312
|
-
for (const
|
|
313
|
-
c(this,
|
|
312
|
+
for (const s of c(this, je)) s();
|
|
313
|
+
c(this, je).clear(), c(this, ke) === 0 && D(this, ae, Bi).call(this), k = null, ui(n), ui(i), c(this, lt)?.resolve();
|
|
314
314
|
}
|
|
315
|
-
|
|
315
|
+
Q = null;
|
|
316
316
|
}
|
|
317
317
|
/**
|
|
318
318
|
* Associate a change to a given source with the current
|
|
@@ -321,318 +321,318 @@ const Jt = class Jt {
|
|
|
321
321
|
* @param {any} value
|
|
322
322
|
*/
|
|
323
323
|
capture(e, i) {
|
|
324
|
-
i !==
|
|
324
|
+
i !== N && !this.previous.has(e) && this.previous.set(e, i), (e.f & st) === 0 && (this.current.set(e, e.v), Q?.set(e, e.v));
|
|
325
325
|
}
|
|
326
326
|
activate() {
|
|
327
|
-
|
|
327
|
+
k = this, this.apply();
|
|
328
328
|
}
|
|
329
329
|
deactivate() {
|
|
330
|
-
|
|
330
|
+
k === this && (k = null, Q = null);
|
|
331
331
|
}
|
|
332
332
|
flush() {
|
|
333
|
-
if (this.activate(),
|
|
334
|
-
if (
|
|
333
|
+
if (this.activate(), G.length > 0) {
|
|
334
|
+
if (Gi(), k !== null && k !== this)
|
|
335
335
|
return;
|
|
336
|
-
} else c(this,
|
|
336
|
+
} else c(this, ke) === 0 && this.process([]);
|
|
337
337
|
this.deactivate();
|
|
338
338
|
}
|
|
339
339
|
discard() {
|
|
340
|
-
for (const e of c(this,
|
|
341
|
-
c(this,
|
|
340
|
+
for (const e of c(this, qe)) e(this);
|
|
341
|
+
c(this, qe).clear();
|
|
342
342
|
}
|
|
343
343
|
/**
|
|
344
344
|
*
|
|
345
345
|
* @param {boolean} blocking
|
|
346
346
|
*/
|
|
347
347
|
increment(e) {
|
|
348
|
-
|
|
348
|
+
_(this, ke, c(this, ke) + 1), e && _(this, Ke, c(this, Ke) + 1);
|
|
349
349
|
}
|
|
350
350
|
/**
|
|
351
351
|
*
|
|
352
352
|
* @param {boolean} blocking
|
|
353
353
|
*/
|
|
354
354
|
decrement(e) {
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
_(this, ke, c(this, ke) - 1), e && _(this, Ke, c(this, Ke) - 1), !c(this, ze) && (_(this, ze, !0), Me(() => {
|
|
356
|
+
_(this, ze, !1), this.is_deferred() ? G.length > 0 && this.flush() : this.revive();
|
|
357
357
|
}));
|
|
358
358
|
}
|
|
359
359
|
revive() {
|
|
360
|
-
for (const e of c(this,
|
|
361
|
-
c(this,
|
|
362
|
-
for (const e of c(this,
|
|
363
|
-
|
|
360
|
+
for (const e of c(this, at))
|
|
361
|
+
c(this, He).delete(e), R(e, F), oe(e);
|
|
362
|
+
for (const e of c(this, He))
|
|
363
|
+
R(e, te), oe(e);
|
|
364
364
|
this.flush();
|
|
365
365
|
}
|
|
366
366
|
/** @param {() => void} fn */
|
|
367
367
|
oncommit(e) {
|
|
368
|
-
c(this,
|
|
368
|
+
c(this, je).add(e);
|
|
369
369
|
}
|
|
370
370
|
/** @param {(batch: Batch) => void} fn */
|
|
371
371
|
ondiscard(e) {
|
|
372
|
-
c(this,
|
|
372
|
+
c(this, qe).add(e);
|
|
373
373
|
}
|
|
374
374
|
settled() {
|
|
375
|
-
return (c(this,
|
|
375
|
+
return (c(this, lt) ?? _(this, lt, jn())).promise;
|
|
376
376
|
}
|
|
377
377
|
static ensure() {
|
|
378
|
-
if (
|
|
379
|
-
const e =
|
|
380
|
-
|
|
381
|
-
|
|
378
|
+
if (k === null) {
|
|
379
|
+
const e = k = new ri();
|
|
380
|
+
dt.add(k), tt || Me(() => {
|
|
381
|
+
k === e && e.flush();
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
|
-
return
|
|
384
|
+
return k;
|
|
385
385
|
}
|
|
386
386
|
apply() {
|
|
387
387
|
}
|
|
388
388
|
};
|
|
389
|
-
|
|
389
|
+
je = new WeakMap(), qe = new WeakMap(), ke = new WeakMap(), Ke = new WeakMap(), lt = new WeakMap(), at = new WeakMap(), He = new WeakMap(), de = new WeakMap(), ze = new WeakMap(), ae = new WeakSet(), /**
|
|
390
390
|
* Traverse the effect tree, executing effects or stashing
|
|
391
391
|
* them for later execution as appropriate
|
|
392
392
|
* @param {Effect} root
|
|
393
393
|
* @param {Effect[]} effects
|
|
394
394
|
* @param {Effect[]} render_effects
|
|
395
395
|
*/
|
|
396
|
-
|
|
397
|
-
e.f ^=
|
|
398
|
-
for (var
|
|
399
|
-
var o =
|
|
400
|
-
if (!u &&
|
|
401
|
-
l ?
|
|
402
|
-
var d =
|
|
396
|
+
Dt = function(e, i, n) {
|
|
397
|
+
e.f ^= V;
|
|
398
|
+
for (var s = e.first, r = null; s !== null; ) {
|
|
399
|
+
var o = s.f, l = (o & (_e | Ce)) !== 0, a = l && (o & V) !== 0, u = a || (o & Ie) !== 0 || c(this, de).has(s);
|
|
400
|
+
if (!u && s.fn !== null) {
|
|
401
|
+
l ? s.f ^= V : r !== null && (o & (nt | Si | $i)) !== 0 ? r.b.defer_effect(s) : (o & nt) !== 0 ? i.push(s) : ut(s) && ((o & be) !== 0 && c(this, He).add(s), We(s));
|
|
402
|
+
var d = s.first;
|
|
403
403
|
if (d !== null) {
|
|
404
|
-
|
|
404
|
+
s = d;
|
|
405
405
|
continue;
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
for (;
|
|
409
|
-
|
|
410
|
-
var
|
|
411
|
-
if (
|
|
412
|
-
|
|
408
|
+
for (; s !== null; ) {
|
|
409
|
+
s === r && (r = null);
|
|
410
|
+
var v = s.next;
|
|
411
|
+
if (v !== null) {
|
|
412
|
+
s = v;
|
|
413
413
|
break;
|
|
414
414
|
}
|
|
415
|
-
|
|
415
|
+
s = s.parent;
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
}, /**
|
|
419
419
|
* @param {Effect[]} effects
|
|
420
420
|
*/
|
|
421
|
-
|
|
421
|
+
Pt = function(e) {
|
|
422
422
|
for (var i = 0; i < e.length; i += 1)
|
|
423
|
-
|
|
424
|
-
},
|
|
425
|
-
var
|
|
426
|
-
if (
|
|
423
|
+
Pi(e[i], c(this, at), c(this, He));
|
|
424
|
+
}, Bi = function() {
|
|
425
|
+
var s;
|
|
426
|
+
if (dt.size > 1) {
|
|
427
427
|
this.previous.clear();
|
|
428
|
-
var e =
|
|
429
|
-
for (const
|
|
430
|
-
if (
|
|
428
|
+
var e = Q, i = !0;
|
|
429
|
+
for (const r of dt) {
|
|
430
|
+
if (r === this) {
|
|
431
431
|
i = !1;
|
|
432
432
|
continue;
|
|
433
433
|
}
|
|
434
434
|
const o = [];
|
|
435
435
|
for (const [a, u] of this.current) {
|
|
436
|
-
if (
|
|
437
|
-
if (i && u !==
|
|
438
|
-
|
|
436
|
+
if (r.current.has(a))
|
|
437
|
+
if (i && u !== r.current.get(a))
|
|
438
|
+
r.current.set(a, u);
|
|
439
439
|
else
|
|
440
440
|
continue;
|
|
441
441
|
o.push(a);
|
|
442
442
|
}
|
|
443
443
|
if (o.length === 0)
|
|
444
444
|
continue;
|
|
445
|
-
const l = [...
|
|
445
|
+
const l = [...r.current.keys()].filter((a) => !this.current.has(a));
|
|
446
446
|
if (l.length > 0) {
|
|
447
|
-
var n =
|
|
448
|
-
|
|
447
|
+
var n = G;
|
|
448
|
+
G = [];
|
|
449
449
|
const a = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map();
|
|
450
450
|
for (const d of o)
|
|
451
|
-
|
|
452
|
-
if (
|
|
453
|
-
|
|
454
|
-
for (const d of
|
|
455
|
-
|
|
456
|
-
|
|
451
|
+
ji(d, l, a, u);
|
|
452
|
+
if (G.length > 0) {
|
|
453
|
+
k = r, r.apply();
|
|
454
|
+
for (const d of G)
|
|
455
|
+
D(s = r, ae, Dt).call(s, d, [], []);
|
|
456
|
+
r.deactivate();
|
|
457
457
|
}
|
|
458
|
-
|
|
458
|
+
G = n;
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
|
|
461
|
+
k = null, Q = e;
|
|
462
462
|
}
|
|
463
|
-
this.committed = !0,
|
|
463
|
+
this.committed = !0, dt.delete(this);
|
|
464
464
|
};
|
|
465
|
-
let
|
|
466
|
-
function
|
|
467
|
-
var e =
|
|
468
|
-
|
|
465
|
+
let ve = ri;
|
|
466
|
+
function ue(t) {
|
|
467
|
+
var e = tt;
|
|
468
|
+
tt = !0;
|
|
469
469
|
try {
|
|
470
470
|
for (var i; ; ) {
|
|
471
|
-
if (
|
|
472
|
-
return
|
|
471
|
+
if (ls(), G.length === 0 && (k?.flush(), G.length === 0))
|
|
472
|
+
return Ct = null, /** @type {T} */
|
|
473
473
|
i;
|
|
474
|
-
|
|
474
|
+
Gi();
|
|
475
475
|
}
|
|
476
476
|
} finally {
|
|
477
|
-
|
|
477
|
+
tt = e;
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
|
|
480
|
+
function Gi() {
|
|
481
|
+
Ft = !0;
|
|
482
482
|
var t = null;
|
|
483
483
|
try {
|
|
484
|
-
for (var e = 0;
|
|
485
|
-
var i =
|
|
484
|
+
for (var e = 0; G.length > 0; ) {
|
|
485
|
+
var i = ve.ensure();
|
|
486
486
|
if (e++ > 1e3) {
|
|
487
|
-
var n,
|
|
488
|
-
|
|
487
|
+
var n, s;
|
|
488
|
+
cs();
|
|
489
489
|
}
|
|
490
|
-
i.process(
|
|
490
|
+
i.process(G), we.clear();
|
|
491
491
|
}
|
|
492
492
|
} finally {
|
|
493
|
-
|
|
493
|
+
G = [], Ft = !1, Ct = null;
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function cs() {
|
|
497
497
|
try {
|
|
498
|
-
|
|
498
|
+
Xn();
|
|
499
499
|
} catch (t) {
|
|
500
|
-
wt(t,
|
|
500
|
+
wt(t, Ct);
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
let
|
|
504
|
-
function
|
|
503
|
+
let fe = null;
|
|
504
|
+
function ui(t) {
|
|
505
505
|
var e = t.length;
|
|
506
506
|
if (e !== 0) {
|
|
507
507
|
for (var i = 0; i < e; ) {
|
|
508
508
|
var n = t[i++];
|
|
509
|
-
if ((n.f & (
|
|
509
|
+
if ((n.f & (Ee | Ie)) === 0 && ut(n) && (fe = /* @__PURE__ */ new Set(), We(n), n.deps === null && n.first === null && n.nodes === null && n.teardown === null && n.ac === null && cn(n), fe?.size > 0)) {
|
|
510
510
|
we.clear();
|
|
511
|
-
for (const
|
|
512
|
-
if ((
|
|
513
|
-
const
|
|
514
|
-
let o =
|
|
511
|
+
for (const s of fe) {
|
|
512
|
+
if ((s.f & (Ee | Ie)) !== 0) continue;
|
|
513
|
+
const r = [s];
|
|
514
|
+
let o = s.parent;
|
|
515
515
|
for (; o !== null; )
|
|
516
|
-
|
|
517
|
-
for (let l =
|
|
518
|
-
const a =
|
|
519
|
-
(a.f & (
|
|
516
|
+
fe.has(o) && (fe.delete(o), r.push(o)), o = o.parent;
|
|
517
|
+
for (let l = r.length - 1; l >= 0; l--) {
|
|
518
|
+
const a = r[l];
|
|
519
|
+
(a.f & (Ee | Ie)) === 0 && We(a);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
-
|
|
522
|
+
fe.clear();
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
|
|
525
|
+
fe = null;
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function ji(t, e, i, n) {
|
|
529
529
|
if (!i.has(t) && (i.add(t), t.reactions !== null))
|
|
530
|
-
for (const
|
|
531
|
-
const
|
|
532
|
-
(
|
|
530
|
+
for (const s of t.reactions) {
|
|
531
|
+
const r = s.f;
|
|
532
|
+
(r & H) !== 0 ? ji(
|
|
533
533
|
/** @type {Derived} */
|
|
534
|
-
|
|
534
|
+
s,
|
|
535
535
|
e,
|
|
536
536
|
i,
|
|
537
537
|
n
|
|
538
|
-
) : (
|
|
538
|
+
) : (r & (Li | be)) !== 0 && (r & F) === 0 && qi(s, e, n) && (R(s, F), oe(
|
|
539
539
|
/** @type {Effect} */
|
|
540
|
-
|
|
540
|
+
s
|
|
541
541
|
));
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function qi(t, e, i) {
|
|
545
545
|
const n = i.get(t);
|
|
546
546
|
if (n !== void 0) return n;
|
|
547
547
|
if (t.deps !== null)
|
|
548
|
-
for (const
|
|
549
|
-
if (
|
|
548
|
+
for (const s of t.deps) {
|
|
549
|
+
if (Xe.call(e, s))
|
|
550
550
|
return !0;
|
|
551
|
-
if ((
|
|
551
|
+
if ((s.f & H) !== 0 && qi(
|
|
552
552
|
/** @type {Derived} */
|
|
553
|
-
|
|
553
|
+
s,
|
|
554
554
|
e,
|
|
555
555
|
i
|
|
556
556
|
))
|
|
557
557
|
return i.set(
|
|
558
558
|
/** @type {Derived} */
|
|
559
|
-
|
|
559
|
+
s,
|
|
560
560
|
!0
|
|
561
561
|
), !0;
|
|
562
562
|
}
|
|
563
563
|
return i.set(t, !1), !1;
|
|
564
564
|
}
|
|
565
|
-
function
|
|
566
|
-
for (var e =
|
|
565
|
+
function oe(t) {
|
|
566
|
+
for (var e = Ct = t; e.parent !== null; ) {
|
|
567
567
|
e = e.parent;
|
|
568
568
|
var i = e.f;
|
|
569
|
-
if (
|
|
569
|
+
if (Ft && e === E && (i & be) !== 0 && (i & Ci) === 0)
|
|
570
570
|
return;
|
|
571
|
-
if ((i & (
|
|
572
|
-
if ((i &
|
|
573
|
-
e.f ^=
|
|
571
|
+
if ((i & (Ce | _e)) !== 0) {
|
|
572
|
+
if ((i & V) === 0) return;
|
|
573
|
+
e.f ^= V;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
|
|
576
|
+
G.push(e);
|
|
577
577
|
}
|
|
578
|
-
function
|
|
579
|
-
if (!((t.f &
|
|
580
|
-
(t.f &
|
|
578
|
+
function Ki(t, e) {
|
|
579
|
+
if (!((t.f & _e) !== 0 && (t.f & V) !== 0)) {
|
|
580
|
+
(t.f & F) !== 0 ? e.d.push(t) : (t.f & te) !== 0 && e.m.push(t), R(t, V);
|
|
581
581
|
for (var i = t.first; i !== null; )
|
|
582
|
-
|
|
582
|
+
Ki(i, e), i = i.next;
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
|
-
function
|
|
586
|
-
let e = 0, i =
|
|
585
|
+
function us(t) {
|
|
586
|
+
let e = 0, i = Lt(0), n;
|
|
587
587
|
return () => {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
e -= 1, e === 0 && (n?.(), n = void 0,
|
|
588
|
+
ei() && (m(i), ti(() => (e === 0 && (n = ni(() => t(() => it(i)))), e += 1, () => {
|
|
589
|
+
Me(() => {
|
|
590
|
+
e -= 1, e === 0 && (n?.(), n = void 0, it(i));
|
|
591
591
|
});
|
|
592
592
|
})));
|
|
593
593
|
};
|
|
594
594
|
}
|
|
595
|
-
var
|
|
596
|
-
function
|
|
597
|
-
new
|
|
595
|
+
var fs = It | Je;
|
|
596
|
+
function ds(t, e, i) {
|
|
597
|
+
new hs(t, e, i);
|
|
598
598
|
}
|
|
599
|
-
var
|
|
600
|
-
class
|
|
599
|
+
var Y, ct, he, Ne, ne, se, K, re, pe, Ve, Ae, Ye, Ue, xe, ge, $t, M, zi, Yi, Bt, mt, Gt;
|
|
600
|
+
class hs {
|
|
601
601
|
/**
|
|
602
602
|
* @param {TemplateNode} node
|
|
603
603
|
* @param {BoundaryProps} props
|
|
604
604
|
* @param {((anchor: Node) => void)} children
|
|
605
605
|
*/
|
|
606
606
|
constructor(e, i, n) {
|
|
607
|
-
|
|
607
|
+
A(this, M);
|
|
608
608
|
/** @type {Boundary | null} */
|
|
609
609
|
f(this, "parent");
|
|
610
610
|
f(this, "is_pending", !1);
|
|
611
611
|
/** @type {TemplateNode} */
|
|
612
|
-
|
|
612
|
+
A(this, Y);
|
|
613
613
|
/** @type {TemplateNode | null} */
|
|
614
|
-
|
|
614
|
+
A(this, ct, J ? B : null);
|
|
615
615
|
/** @type {BoundaryProps} */
|
|
616
|
-
|
|
616
|
+
A(this, he);
|
|
617
617
|
/** @type {((anchor: Node) => void)} */
|
|
618
|
-
|
|
618
|
+
A(this, Ne);
|
|
619
619
|
/** @type {Effect} */
|
|
620
|
-
|
|
620
|
+
A(this, ne);
|
|
621
621
|
/** @type {Effect | null} */
|
|
622
|
-
|
|
622
|
+
A(this, se, null);
|
|
623
623
|
/** @type {Effect | null} */
|
|
624
|
-
|
|
624
|
+
A(this, K, null);
|
|
625
625
|
/** @type {Effect | null} */
|
|
626
|
-
|
|
626
|
+
A(this, re, null);
|
|
627
627
|
/** @type {DocumentFragment | null} */
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
628
|
+
A(this, pe, null);
|
|
629
|
+
A(this, Ve, 0);
|
|
630
|
+
A(this, Ae, 0);
|
|
631
|
+
A(this, Ye, !1);
|
|
632
632
|
/** @type {Set<Effect>} */
|
|
633
|
-
|
|
633
|
+
A(this, Ue, /* @__PURE__ */ new Set());
|
|
634
634
|
/** @type {Set<Effect>} */
|
|
635
|
-
|
|
635
|
+
A(this, xe, /* @__PURE__ */ new Set());
|
|
636
636
|
/**
|
|
637
637
|
* A source containing the number of pending async deriveds/expressions.
|
|
638
638
|
* Only created if `$effect.pending()` is used inside the boundary,
|
|
@@ -640,34 +640,34 @@ class or {
|
|
|
640
640
|
* calls followed by no-op flushes
|
|
641
641
|
* @type {Source<number> | null}
|
|
642
642
|
*/
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
643
|
+
A(this, ge, null);
|
|
644
|
+
A(this, $t, us(() => (_(this, ge, Lt(c(this, Ve))), () => {
|
|
645
|
+
_(this, ge, null);
|
|
646
646
|
})));
|
|
647
|
-
|
|
648
|
-
var
|
|
647
|
+
_(this, Y, e), _(this, he, i), _(this, Ne, (s) => {
|
|
648
|
+
var r = (
|
|
649
649
|
/** @type {Effect} */
|
|
650
|
-
|
|
650
|
+
E
|
|
651
651
|
);
|
|
652
|
-
|
|
652
|
+
r.b = this, r.f |= Vt, n(s);
|
|
653
653
|
}), this.parent = /** @type {Effect} */
|
|
654
|
-
|
|
655
|
-
if (
|
|
656
|
-
const
|
|
654
|
+
E.b, _(this, ne, ws(() => {
|
|
655
|
+
if (J) {
|
|
656
|
+
const s = (
|
|
657
657
|
/** @type {Comment} */
|
|
658
|
-
c(this,
|
|
658
|
+
c(this, ct)
|
|
659
659
|
);
|
|
660
|
-
|
|
660
|
+
Oi(), s.data === Ei ? D(this, M, Yi).call(this) : D(this, M, zi).call(this);
|
|
661
661
|
} else
|
|
662
|
-
|
|
663
|
-
},
|
|
662
|
+
D(this, M, Bt).call(this);
|
|
663
|
+
}, fs)), J && _(this, Y, B);
|
|
664
664
|
}
|
|
665
665
|
/**
|
|
666
666
|
* Defer an effect inside a pending boundary until the boundary resolves
|
|
667
667
|
* @param {Effect} effect
|
|
668
668
|
*/
|
|
669
669
|
defer_effect(e) {
|
|
670
|
-
|
|
670
|
+
Pi(e, c(this, Ue), c(this, xe));
|
|
671
671
|
}
|
|
672
672
|
/**
|
|
673
673
|
* Returns `false` if the effect exists inside a boundary whose pending snippet is shown
|
|
@@ -677,7 +677,7 @@ class or {
|
|
|
677
677
|
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
678
678
|
}
|
|
679
679
|
has_pending_snippet() {
|
|
680
|
-
return !!c(this,
|
|
680
|
+
return !!c(this, he).pending;
|
|
681
681
|
}
|
|
682
682
|
/**
|
|
683
683
|
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
@@ -686,54 +686,54 @@ class or {
|
|
|
686
686
|
* @param {1 | -1} d
|
|
687
687
|
*/
|
|
688
688
|
update_pending_count(e) {
|
|
689
|
-
|
|
690
|
-
|
|
689
|
+
D(this, M, Gt).call(this, e), _(this, Ve, c(this, Ve) + e), !(!c(this, ge) || c(this, Ye)) && (_(this, Ye, !0), Me(() => {
|
|
690
|
+
_(this, Ye, !1), c(this, ge) && Qi(c(this, ge), c(this, Ve));
|
|
691
691
|
}));
|
|
692
692
|
}
|
|
693
693
|
get_effect_pending() {
|
|
694
|
-
return c(this,
|
|
694
|
+
return c(this, $t).call(this), m(
|
|
695
695
|
/** @type {Source<number>} */
|
|
696
|
-
c(this,
|
|
696
|
+
c(this, ge)
|
|
697
697
|
);
|
|
698
698
|
}
|
|
699
699
|
/** @param {unknown} error */
|
|
700
700
|
error(e) {
|
|
701
|
-
var i = c(this,
|
|
702
|
-
let n = c(this,
|
|
701
|
+
var i = c(this, he).onerror;
|
|
702
|
+
let n = c(this, he).failed;
|
|
703
703
|
if (!i && !n)
|
|
704
704
|
throw e;
|
|
705
|
-
c(this,
|
|
705
|
+
c(this, se) && (ee(c(this, se)), _(this, se, null)), c(this, K) && (ee(c(this, K)), _(this, K, null)), c(this, re) && (ee(c(this, re)), _(this, re, null)), J && (rt(
|
|
706
706
|
/** @type {TemplateNode} */
|
|
707
|
-
c(this,
|
|
708
|
-
),
|
|
709
|
-
var
|
|
707
|
+
c(this, ct)
|
|
708
|
+
), is(), rt(ns()));
|
|
709
|
+
var s = !1, r = !1;
|
|
710
710
|
const o = () => {
|
|
711
|
-
if (
|
|
712
|
-
|
|
711
|
+
if (s) {
|
|
712
|
+
ts();
|
|
713
713
|
return;
|
|
714
714
|
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}),
|
|
718
|
-
|
|
715
|
+
s = !0, r && es(), c(this, re) !== null && vt(c(this, re), () => {
|
|
716
|
+
_(this, re, null);
|
|
717
|
+
}), D(this, M, mt).call(this, () => {
|
|
718
|
+
ve.ensure(), D(this, M, Bt).call(this);
|
|
719
719
|
});
|
|
720
720
|
};
|
|
721
|
-
|
|
721
|
+
Me(() => {
|
|
722
722
|
try {
|
|
723
|
-
|
|
723
|
+
r = !0, i?.(e, o), r = !1;
|
|
724
724
|
} catch (l) {
|
|
725
|
-
wt(l, c(this,
|
|
725
|
+
wt(l, c(this, ne) && c(this, ne).parent);
|
|
726
726
|
}
|
|
727
|
-
n &&
|
|
728
|
-
|
|
727
|
+
n && _(this, re, D(this, M, mt).call(this, () => {
|
|
728
|
+
ve.ensure();
|
|
729
729
|
try {
|
|
730
|
-
return
|
|
730
|
+
return Be(() => {
|
|
731
731
|
var l = (
|
|
732
732
|
/** @type {Effect} */
|
|
733
|
-
|
|
733
|
+
E
|
|
734
734
|
);
|
|
735
|
-
l.b = this, l.f |=
|
|
736
|
-
c(this,
|
|
735
|
+
l.b = this, l.f |= Vt, n(
|
|
736
|
+
c(this, Y),
|
|
737
737
|
() => e,
|
|
738
738
|
() => o
|
|
739
739
|
);
|
|
@@ -742,43 +742,43 @@ class or {
|
|
|
742
742
|
return wt(
|
|
743
743
|
l,
|
|
744
744
|
/** @type {Effect} */
|
|
745
|
-
c(this,
|
|
745
|
+
c(this, ne).parent
|
|
746
746
|
), null;
|
|
747
747
|
}
|
|
748
748
|
}));
|
|
749
749
|
});
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
|
-
|
|
752
|
+
Y = new WeakMap(), ct = new WeakMap(), he = new WeakMap(), Ne = new WeakMap(), ne = new WeakMap(), se = new WeakMap(), K = new WeakMap(), re = new WeakMap(), pe = new WeakMap(), Ve = new WeakMap(), Ae = new WeakMap(), Ye = new WeakMap(), Ue = new WeakMap(), xe = new WeakMap(), ge = new WeakMap(), $t = new WeakMap(), M = new WeakSet(), zi = function() {
|
|
753
753
|
try {
|
|
754
|
-
|
|
754
|
+
_(this, se, Be(() => c(this, Ne).call(this, c(this, Y))));
|
|
755
755
|
} catch (e) {
|
|
756
756
|
this.error(e);
|
|
757
757
|
}
|
|
758
|
-
},
|
|
759
|
-
const e = c(this,
|
|
760
|
-
e && (this.is_pending = !0,
|
|
761
|
-
var i =
|
|
762
|
-
i.append(n),
|
|
758
|
+
}, Yi = function() {
|
|
759
|
+
const e = c(this, he).pending;
|
|
760
|
+
e && (this.is_pending = !0, _(this, K, Be(() => e(c(this, Y)))), Me(() => {
|
|
761
|
+
var i = _(this, pe, document.createDocumentFragment()), n = nn();
|
|
762
|
+
i.append(n), _(this, se, D(this, M, mt).call(this, () => (ve.ensure(), Be(() => c(this, Ne).call(this, n))))), c(this, Ae) === 0 && (c(this, Y).before(i), _(this, pe, null), vt(
|
|
763
763
|
/** @type {Effect} */
|
|
764
|
-
c(this,
|
|
764
|
+
c(this, K),
|
|
765
765
|
() => {
|
|
766
|
-
|
|
766
|
+
_(this, K, null);
|
|
767
767
|
}
|
|
768
768
|
), this.is_pending = !1);
|
|
769
769
|
}));
|
|
770
|
-
},
|
|
770
|
+
}, Bt = function() {
|
|
771
771
|
try {
|
|
772
|
-
if (this.is_pending = this.has_pending_snippet(),
|
|
773
|
-
c(this,
|
|
774
|
-
})), c(this,
|
|
775
|
-
var e =
|
|
776
|
-
|
|
772
|
+
if (this.is_pending = this.has_pending_snippet(), _(this, Ae, 0), _(this, Ve, 0), _(this, se, Be(() => {
|
|
773
|
+
c(this, Ne).call(this, c(this, Y));
|
|
774
|
+
})), c(this, Ae) > 0) {
|
|
775
|
+
var e = _(this, pe, document.createDocumentFragment());
|
|
776
|
+
Cs(c(this, se), e);
|
|
777
777
|
const i = (
|
|
778
778
|
/** @type {(anchor: Node) => void} */
|
|
779
|
-
c(this,
|
|
779
|
+
c(this, he).pending
|
|
780
780
|
);
|
|
781
|
-
|
|
781
|
+
_(this, K, Be(() => i(c(this, Y))));
|
|
782
782
|
} else
|
|
783
783
|
this.is_pending = !1;
|
|
784
784
|
} catch (i) {
|
|
@@ -788,82 +788,82 @@ H = new WeakMap(), st = new WeakMap(), ue = new WeakMap(), Re = new WeakMap(), e
|
|
|
788
788
|
* @template T
|
|
789
789
|
* @param {() => T} fn
|
|
790
790
|
*/
|
|
791
|
-
|
|
792
|
-
var i =
|
|
793
|
-
|
|
791
|
+
mt = function(e) {
|
|
792
|
+
var i = E, n = y, s = W;
|
|
793
|
+
$e(c(this, ne)), le(c(this, ne)), Et(c(this, ne).ctx);
|
|
794
794
|
try {
|
|
795
795
|
return e();
|
|
796
|
-
} catch (
|
|
797
|
-
return
|
|
796
|
+
} catch (r) {
|
|
797
|
+
return Fi(r), null;
|
|
798
798
|
} finally {
|
|
799
|
-
|
|
799
|
+
$e(i), le(n), Et(s);
|
|
800
800
|
}
|
|
801
801
|
}, /**
|
|
802
802
|
* Updates the pending count associated with the currently visible pending snippet,
|
|
803
803
|
* if any, such that we can replace the snippet with content once work is done
|
|
804
804
|
* @param {1 | -1} d
|
|
805
805
|
*/
|
|
806
|
-
|
|
806
|
+
Gt = function(e) {
|
|
807
807
|
var i;
|
|
808
808
|
if (!this.has_pending_snippet()) {
|
|
809
|
-
this.parent &&
|
|
809
|
+
this.parent && D(i = this.parent, M, Gt).call(i, e);
|
|
810
810
|
return;
|
|
811
811
|
}
|
|
812
|
-
if (
|
|
812
|
+
if (_(this, Ae, c(this, Ae) + e), c(this, Ae) === 0) {
|
|
813
813
|
this.is_pending = !1;
|
|
814
|
-
for (const n of c(this,
|
|
815
|
-
|
|
816
|
-
for (const n of c(this,
|
|
817
|
-
|
|
818
|
-
c(this,
|
|
819
|
-
|
|
820
|
-
}), c(this,
|
|
814
|
+
for (const n of c(this, Ue))
|
|
815
|
+
R(n, F), oe(n);
|
|
816
|
+
for (const n of c(this, xe))
|
|
817
|
+
R(n, te), oe(n);
|
|
818
|
+
c(this, Ue).clear(), c(this, xe).clear(), c(this, K) && vt(c(this, K), () => {
|
|
819
|
+
_(this, K, null);
|
|
820
|
+
}), c(this, pe) && (c(this, Y).before(c(this, pe)), _(this, pe, null));
|
|
821
821
|
}
|
|
822
822
|
};
|
|
823
823
|
// @__NO_SIDE_EFFECTS__
|
|
824
|
-
function
|
|
825
|
-
var e =
|
|
824
|
+
function Ui(t) {
|
|
825
|
+
var e = H | F, i = y !== null && (y.f & H) !== 0 ? (
|
|
826
826
|
/** @type {Derived} */
|
|
827
|
-
|
|
827
|
+
y
|
|
828
828
|
) : null;
|
|
829
|
-
return
|
|
830
|
-
ctx:
|
|
829
|
+
return E !== null && (E.f |= Je), {
|
|
830
|
+
ctx: W,
|
|
831
831
|
deps: null,
|
|
832
832
|
effects: null,
|
|
833
|
-
equals:
|
|
833
|
+
equals: ki,
|
|
834
834
|
f: e,
|
|
835
835
|
fn: t,
|
|
836
836
|
reactions: null,
|
|
837
837
|
rv: 0,
|
|
838
838
|
v: (
|
|
839
839
|
/** @type {V} */
|
|
840
|
-
|
|
840
|
+
N
|
|
841
841
|
),
|
|
842
842
|
wv: 0,
|
|
843
|
-
parent: i ??
|
|
843
|
+
parent: i ?? E,
|
|
844
844
|
ac: null
|
|
845
845
|
};
|
|
846
846
|
}
|
|
847
847
|
// @__NO_SIDE_EFFECTS__
|
|
848
|
-
function
|
|
849
|
-
const e = /* @__PURE__ */
|
|
850
|
-
return
|
|
848
|
+
function fi(t) {
|
|
849
|
+
const e = /* @__PURE__ */ Ui(t);
|
|
850
|
+
return fn(e), e;
|
|
851
851
|
}
|
|
852
|
-
function
|
|
852
|
+
function ps(t) {
|
|
853
853
|
var e = t.effects;
|
|
854
854
|
if (e !== null) {
|
|
855
855
|
t.effects = null;
|
|
856
856
|
for (var i = 0; i < e.length; i += 1)
|
|
857
|
-
|
|
857
|
+
ee(
|
|
858
858
|
/** @type {Effect} */
|
|
859
859
|
e[i]
|
|
860
860
|
);
|
|
861
861
|
}
|
|
862
862
|
}
|
|
863
|
-
function
|
|
863
|
+
function gs(t) {
|
|
864
864
|
for (var e = t.parent; e !== null; ) {
|
|
865
|
-
if ((e.f &
|
|
866
|
-
return (e.f &
|
|
865
|
+
if ((e.f & H) === 0)
|
|
866
|
+
return (e.f & Ee) === 0 ? (
|
|
867
867
|
/** @type {Effect} */
|
|
868
868
|
e
|
|
869
869
|
) : null;
|
|
@@ -871,126 +871,126 @@ function ar(t) {
|
|
|
871
871
|
}
|
|
872
872
|
return null;
|
|
873
873
|
}
|
|
874
|
-
function
|
|
875
|
-
var e, i =
|
|
876
|
-
|
|
874
|
+
function Zt(t) {
|
|
875
|
+
var e, i = E;
|
|
876
|
+
$e(gs(t));
|
|
877
877
|
try {
|
|
878
|
-
t.f &= ~
|
|
878
|
+
t.f &= ~De, ps(t), e = gn(t);
|
|
879
879
|
} finally {
|
|
880
|
-
|
|
880
|
+
$e(i);
|
|
881
881
|
}
|
|
882
882
|
return e;
|
|
883
883
|
}
|
|
884
|
-
function
|
|
885
|
-
var e =
|
|
886
|
-
if (!t.equals(e) && (t.wv =
|
|
887
|
-
|
|
884
|
+
function xi(t) {
|
|
885
|
+
var e = Zt(t);
|
|
886
|
+
if (!t.equals(e) && (t.wv = hn(), (!k?.is_fork || t.deps === null) && (t.v = e, t.deps === null))) {
|
|
887
|
+
R(t, V);
|
|
888
888
|
return;
|
|
889
889
|
}
|
|
890
|
-
|
|
890
|
+
Se || (Q !== null ? (ei() || k?.is_fork) && Q.set(t, e) : Jt(t));
|
|
891
891
|
}
|
|
892
|
-
function
|
|
892
|
+
function ms(t) {
|
|
893
893
|
if (t.effects !== null)
|
|
894
894
|
for (const e of t.effects)
|
|
895
|
-
(e.teardown || e.ac) && (e.teardown?.(), e.ac?.abort(
|
|
895
|
+
(e.teardown || e.ac) && (e.teardown?.(), e.ac?.abort(Wt), e.teardown = Bn, e.ac = null, ot(e, 0), ii(e));
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function Xi(t) {
|
|
898
898
|
if (t.effects !== null)
|
|
899
899
|
for (const e of t.effects)
|
|
900
|
-
e.teardown &&
|
|
900
|
+
e.teardown && We(e);
|
|
901
901
|
}
|
|
902
|
-
let
|
|
902
|
+
let jt = /* @__PURE__ */ new Set();
|
|
903
903
|
const we = /* @__PURE__ */ new Map();
|
|
904
|
-
let
|
|
905
|
-
function
|
|
904
|
+
let Wi = !1;
|
|
905
|
+
function Lt(t, e) {
|
|
906
906
|
var i = {
|
|
907
907
|
f: 0,
|
|
908
908
|
// TODO ideally we could skip this altogether, but it causes type errors
|
|
909
909
|
v: t,
|
|
910
910
|
reactions: null,
|
|
911
|
-
equals:
|
|
911
|
+
equals: ki,
|
|
912
912
|
rv: 0,
|
|
913
913
|
wv: 0
|
|
914
914
|
};
|
|
915
915
|
return i;
|
|
916
916
|
}
|
|
917
917
|
// @__NO_SIDE_EFFECTS__
|
|
918
|
-
function
|
|
919
|
-
const i =
|
|
920
|
-
return
|
|
918
|
+
function P(t, e) {
|
|
919
|
+
const i = Lt(t);
|
|
920
|
+
return fn(i), i;
|
|
921
921
|
}
|
|
922
922
|
// @__NO_SIDE_EFFECTS__
|
|
923
|
-
function
|
|
924
|
-
const n =
|
|
925
|
-
return e || (n.equals =
|
|
923
|
+
function vs(t, e = !1, i = !0) {
|
|
924
|
+
const n = Lt(t);
|
|
925
|
+
return e || (n.equals = rs), n;
|
|
926
926
|
}
|
|
927
|
-
function
|
|
928
|
-
|
|
927
|
+
function $(t, e, i = !1) {
|
|
928
|
+
y !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
929
929
|
// to ensure we error if state is set inside an inspect effect
|
|
930
|
-
(!
|
|
931
|
-
let n = i ?
|
|
932
|
-
return
|
|
930
|
+
(!Z || (y.f & ci) !== 0) && Vi() && (y.f & (H | be | Li | ci)) !== 0 && (X === null || !Xe.call(X, t)) && Zn();
|
|
931
|
+
let n = i ? et(e) : e;
|
|
932
|
+
return Qi(t, n);
|
|
933
933
|
}
|
|
934
|
-
function
|
|
934
|
+
function Qi(t, e) {
|
|
935
935
|
if (!t.equals(e)) {
|
|
936
936
|
var i = t.v;
|
|
937
|
-
|
|
938
|
-
var n =
|
|
939
|
-
if (n.capture(t, i), (t.f &
|
|
940
|
-
const
|
|
937
|
+
Se ? we.set(t, e) : we.set(t, i), t.v = e;
|
|
938
|
+
var n = ve.ensure();
|
|
939
|
+
if (n.capture(t, i), (t.f & H) !== 0) {
|
|
940
|
+
const s = (
|
|
941
941
|
/** @type {Derived} */
|
|
942
942
|
t
|
|
943
943
|
);
|
|
944
|
-
(t.f &
|
|
944
|
+
(t.f & F) !== 0 && Zt(s), Jt(s);
|
|
945
945
|
}
|
|
946
|
-
t.wv =
|
|
946
|
+
t.wv = hn(), Ji(t, F), E !== null && (E.f & V) !== 0 && (E.f & (_e | Ce)) === 0 && (z === null ? Ls([t]) : z.push(t)), !n.is_fork && jt.size > 0 && !Wi && bs();
|
|
947
947
|
}
|
|
948
948
|
return e;
|
|
949
949
|
}
|
|
950
|
-
function
|
|
951
|
-
|
|
952
|
-
for (const t of
|
|
953
|
-
(t.f &
|
|
954
|
-
|
|
950
|
+
function bs() {
|
|
951
|
+
Wi = !1;
|
|
952
|
+
for (const t of jt)
|
|
953
|
+
(t.f & V) !== 0 && R(t, te), ut(t) && We(t);
|
|
954
|
+
jt.clear();
|
|
955
955
|
}
|
|
956
|
-
function
|
|
957
|
-
|
|
956
|
+
function it(t) {
|
|
957
|
+
$(t, t.v + 1);
|
|
958
958
|
}
|
|
959
|
-
function
|
|
959
|
+
function Ji(t, e) {
|
|
960
960
|
var i = t.reactions;
|
|
961
961
|
if (i !== null)
|
|
962
|
-
for (var n = i.length,
|
|
963
|
-
var
|
|
964
|
-
if (l &&
|
|
962
|
+
for (var n = i.length, s = 0; s < n; s++) {
|
|
963
|
+
var r = i[s], o = r.f, l = (o & F) === 0;
|
|
964
|
+
if (l && R(r, e), (o & H) !== 0) {
|
|
965
965
|
var a = (
|
|
966
966
|
/** @type {Derived} */
|
|
967
|
-
|
|
967
|
+
r
|
|
968
968
|
);
|
|
969
|
-
|
|
970
|
-
} else l && ((o &
|
|
969
|
+
Q?.delete(a), (o & De) === 0 && (o & x && (r.f |= De), Ji(a, te));
|
|
970
|
+
} else l && ((o & be) !== 0 && fe !== null && fe.add(
|
|
971
971
|
/** @type {Effect} */
|
|
972
|
-
|
|
973
|
-
),
|
|
972
|
+
r
|
|
973
|
+
), oe(
|
|
974
974
|
/** @type {Effect} */
|
|
975
|
-
|
|
975
|
+
r
|
|
976
976
|
));
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
|
-
function
|
|
980
|
-
if (typeof t != "object" || t === null ||
|
|
979
|
+
function et(t) {
|
|
980
|
+
if (typeof t != "object" || t === null || gt in t)
|
|
981
981
|
return t;
|
|
982
|
-
const e =
|
|
983
|
-
if (e !==
|
|
982
|
+
const e = Pn(t);
|
|
983
|
+
if (e !== Fn && e !== Dn)
|
|
984
984
|
return t;
|
|
985
|
-
var i = /* @__PURE__ */ new Map(), n =
|
|
986
|
-
if (
|
|
985
|
+
var i = /* @__PURE__ */ new Map(), n = Nn(t), s = /* @__PURE__ */ P(0), r = Fe, o = (l) => {
|
|
986
|
+
if (Fe === r)
|
|
987
987
|
return l();
|
|
988
|
-
var a =
|
|
989
|
-
|
|
988
|
+
var a = y, u = Fe;
|
|
989
|
+
le(null), pi(r);
|
|
990
990
|
var d = l();
|
|
991
|
-
return
|
|
991
|
+
return le(a), pi(u), d;
|
|
992
992
|
};
|
|
993
|
-
return n && i.set("length", /* @__PURE__ */
|
|
993
|
+
return n && i.set("length", /* @__PURE__ */ P(
|
|
994
994
|
/** @type {any[]} */
|
|
995
995
|
t.length
|
|
996
996
|
)), new Proxy(
|
|
@@ -998,34 +998,34 @@ function Qe(t) {
|
|
|
998
998
|
t,
|
|
999
999
|
{
|
|
1000
1000
|
defineProperty(l, a, u) {
|
|
1001
|
-
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) &&
|
|
1001
|
+
(!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Qn();
|
|
1002
1002
|
var d = i.get(a);
|
|
1003
1003
|
return d === void 0 ? o(() => {
|
|
1004
|
-
var
|
|
1005
|
-
return i.set(a,
|
|
1006
|
-
}) :
|
|
1004
|
+
var v = /* @__PURE__ */ P(u.value);
|
|
1005
|
+
return i.set(a, v), v;
|
|
1006
|
+
}) : $(d, u.value, !0), !0;
|
|
1007
1007
|
},
|
|
1008
1008
|
deleteProperty(l, a) {
|
|
1009
1009
|
var u = i.get(a);
|
|
1010
1010
|
if (u === void 0) {
|
|
1011
1011
|
if (a in l) {
|
|
1012
|
-
const d = o(() => /* @__PURE__ */ N
|
|
1013
|
-
i.set(a, d),
|
|
1012
|
+
const d = o(() => /* @__PURE__ */ P(N));
|
|
1013
|
+
i.set(a, d), it(s);
|
|
1014
1014
|
}
|
|
1015
1015
|
} else
|
|
1016
|
-
|
|
1016
|
+
$(u, N), it(s);
|
|
1017
1017
|
return !0;
|
|
1018
1018
|
},
|
|
1019
1019
|
get(l, a, u) {
|
|
1020
|
-
if (a ===
|
|
1020
|
+
if (a === gt)
|
|
1021
1021
|
return t;
|
|
1022
|
-
var d = i.get(a),
|
|
1023
|
-
if (d === void 0 && (!
|
|
1024
|
-
var
|
|
1022
|
+
var d = i.get(a), v = a in l;
|
|
1023
|
+
if (d === void 0 && (!v || Ge(l, a)?.writable) && (d = o(() => {
|
|
1024
|
+
var g = et(v ? l[a] : N), h = /* @__PURE__ */ P(g);
|
|
1025
1025
|
return h;
|
|
1026
1026
|
}), i.set(a, d)), d !== void 0) {
|
|
1027
|
-
var p =
|
|
1028
|
-
return p ===
|
|
1027
|
+
var p = m(d);
|
|
1028
|
+
return p === N ? void 0 : p;
|
|
1029
1029
|
}
|
|
1030
1030
|
return Reflect.get(l, a, u);
|
|
1031
1031
|
},
|
|
@@ -1033,10 +1033,10 @@ function Qe(t) {
|
|
|
1033
1033
|
var u = Reflect.getOwnPropertyDescriptor(l, a);
|
|
1034
1034
|
if (u && "value" in u) {
|
|
1035
1035
|
var d = i.get(a);
|
|
1036
|
-
d && (u.value =
|
|
1036
|
+
d && (u.value = m(d));
|
|
1037
1037
|
} else if (u === void 0) {
|
|
1038
|
-
var
|
|
1039
|
-
if (
|
|
1038
|
+
var v = i.get(a), p = v?.v;
|
|
1039
|
+
if (v !== void 0 && p !== N)
|
|
1040
1040
|
return {
|
|
1041
1041
|
enumerable: !0,
|
|
1042
1042
|
configurable: !0,
|
|
@@ -1047,122 +1047,122 @@ function Qe(t) {
|
|
|
1047
1047
|
return u;
|
|
1048
1048
|
},
|
|
1049
1049
|
has(l, a) {
|
|
1050
|
-
if (a ===
|
|
1050
|
+
if (a === gt)
|
|
1051
1051
|
return !0;
|
|
1052
|
-
var u = i.get(a), d = u !== void 0 && u.v !==
|
|
1053
|
-
if (u !== void 0 ||
|
|
1052
|
+
var u = i.get(a), d = u !== void 0 && u.v !== N || Reflect.has(l, a);
|
|
1053
|
+
if (u !== void 0 || E !== null && (!d || Ge(l, a)?.writable)) {
|
|
1054
1054
|
u === void 0 && (u = o(() => {
|
|
1055
|
-
var p = d ?
|
|
1056
|
-
return
|
|
1055
|
+
var p = d ? et(l[a]) : N, g = /* @__PURE__ */ P(p);
|
|
1056
|
+
return g;
|
|
1057
1057
|
}), i.set(a, u));
|
|
1058
|
-
var
|
|
1059
|
-
if (
|
|
1058
|
+
var v = m(u);
|
|
1059
|
+
if (v === N)
|
|
1060
1060
|
return !1;
|
|
1061
1061
|
}
|
|
1062
1062
|
return d;
|
|
1063
1063
|
},
|
|
1064
1064
|
set(l, a, u, d) {
|
|
1065
|
-
var
|
|
1065
|
+
var v = i.get(a), p = a in l;
|
|
1066
1066
|
if (n && a === "length")
|
|
1067
|
-
for (var
|
|
1068
|
-
|
|
1069
|
-
var h = i.get(
|
|
1070
|
-
h !== void 0 ?
|
|
1067
|
+
for (var g = u; g < /** @type {Source<number>} */
|
|
1068
|
+
v.v; g += 1) {
|
|
1069
|
+
var h = i.get(g + "");
|
|
1070
|
+
h !== void 0 ? $(h, N) : g in l && (h = o(() => /* @__PURE__ */ P(N)), i.set(g + "", h));
|
|
1071
1071
|
}
|
|
1072
|
-
if (
|
|
1073
|
-
(!p ||
|
|
1072
|
+
if (v === void 0)
|
|
1073
|
+
(!p || Ge(l, a)?.writable) && (v = o(() => /* @__PURE__ */ P(void 0)), $(v, et(u)), i.set(a, v));
|
|
1074
1074
|
else {
|
|
1075
|
-
p =
|
|
1076
|
-
var
|
|
1077
|
-
|
|
1075
|
+
p = v.v !== N;
|
|
1076
|
+
var T = o(() => et(u));
|
|
1077
|
+
$(v, T);
|
|
1078
1078
|
}
|
|
1079
|
-
var
|
|
1080
|
-
if (
|
|
1079
|
+
var b = Reflect.getOwnPropertyDescriptor(l, a);
|
|
1080
|
+
if (b?.set && b.set.call(d, u), !p) {
|
|
1081
1081
|
if (n && typeof a == "string") {
|
|
1082
|
-
var
|
|
1082
|
+
var S = (
|
|
1083
1083
|
/** @type {Source<number>} */
|
|
1084
1084
|
i.get("length")
|
|
1085
|
-
),
|
|
1086
|
-
Number.isInteger(
|
|
1085
|
+
), L = Number(a);
|
|
1086
|
+
Number.isInteger(L) && L >= S.v && $(S, L + 1);
|
|
1087
1087
|
}
|
|
1088
|
-
|
|
1088
|
+
it(s);
|
|
1089
1089
|
}
|
|
1090
1090
|
return !0;
|
|
1091
1091
|
},
|
|
1092
1092
|
ownKeys(l) {
|
|
1093
|
-
|
|
1094
|
-
var a = Reflect.ownKeys(l).filter((
|
|
1095
|
-
var p = i.get(
|
|
1096
|
-
return p === void 0 || p.v !==
|
|
1093
|
+
m(s);
|
|
1094
|
+
var a = Reflect.ownKeys(l).filter((v) => {
|
|
1095
|
+
var p = i.get(v);
|
|
1096
|
+
return p === void 0 || p.v !== N;
|
|
1097
1097
|
});
|
|
1098
1098
|
for (var [u, d] of i)
|
|
1099
|
-
d.v !==
|
|
1099
|
+
d.v !== N && !(u in l) && a.push(u);
|
|
1100
1100
|
return a;
|
|
1101
1101
|
},
|
|
1102
1102
|
setPrototypeOf() {
|
|
1103
|
-
|
|
1103
|
+
Jn();
|
|
1104
1104
|
}
|
|
1105
1105
|
}
|
|
1106
1106
|
);
|
|
1107
1107
|
}
|
|
1108
|
-
var
|
|
1109
|
-
function
|
|
1110
|
-
if (
|
|
1111
|
-
|
|
1108
|
+
var di, Zi, en, tn;
|
|
1109
|
+
function qt() {
|
|
1110
|
+
if (di === void 0) {
|
|
1111
|
+
di = window, Zi = /Firefox/.test(navigator.userAgent);
|
|
1112
1112
|
var t = Element.prototype, e = Node.prototype, i = Text.prototype;
|
|
1113
|
-
|
|
1113
|
+
en = Ge(e, "firstChild").get, tn = Ge(e, "nextSibling").get, ai(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), ai(i) && (i.__t = void 0);
|
|
1114
1114
|
}
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1116
|
+
function nn(t = "") {
|
|
1117
1117
|
return document.createTextNode(t);
|
|
1118
1118
|
}
|
|
1119
1119
|
// @__NO_SIDE_EFFECTS__
|
|
1120
|
-
function
|
|
1120
|
+
function sn(t) {
|
|
1121
1121
|
return (
|
|
1122
1122
|
/** @type {TemplateNode | null} */
|
|
1123
|
-
|
|
1123
|
+
en.call(t)
|
|
1124
1124
|
);
|
|
1125
1125
|
}
|
|
1126
1126
|
// @__NO_SIDE_EFFECTS__
|
|
1127
|
-
function
|
|
1127
|
+
function Ze(t) {
|
|
1128
1128
|
return (
|
|
1129
1129
|
/** @type {TemplateNode | null} */
|
|
1130
|
-
|
|
1130
|
+
tn.call(t)
|
|
1131
1131
|
);
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function _s(t) {
|
|
1134
1134
|
t.textContent = "";
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function rn(t, e, i) {
|
|
1137
1137
|
return (
|
|
1138
1138
|
/** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */
|
|
1139
|
-
document.createElementNS(
|
|
1139
|
+
document.createElementNS(Hn, t, void 0)
|
|
1140
1140
|
);
|
|
1141
1141
|
}
|
|
1142
|
-
function
|
|
1143
|
-
var e =
|
|
1144
|
-
|
|
1142
|
+
function on(t) {
|
|
1143
|
+
var e = y, i = E;
|
|
1144
|
+
le(null), $e(null);
|
|
1145
1145
|
try {
|
|
1146
1146
|
return t();
|
|
1147
1147
|
} finally {
|
|
1148
|
-
|
|
1148
|
+
le(e), $e(i);
|
|
1149
1149
|
}
|
|
1150
1150
|
}
|
|
1151
|
-
function
|
|
1152
|
-
|
|
1151
|
+
function ys(t) {
|
|
1152
|
+
E === null && (y === null && xn(), Un()), Se && Yn();
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function Ts(t, e) {
|
|
1155
1155
|
var i = e.last;
|
|
1156
1156
|
i === null ? e.last = e.first = t : (i.next = t, t.prev = i, e.last = t);
|
|
1157
1157
|
}
|
|
1158
|
-
function
|
|
1159
|
-
var n =
|
|
1160
|
-
n !== null && (n.f &
|
|
1161
|
-
var
|
|
1162
|
-
ctx:
|
|
1158
|
+
function Pe(t, e, i) {
|
|
1159
|
+
var n = E;
|
|
1160
|
+
n !== null && (n.f & Ie) !== 0 && (t |= Ie);
|
|
1161
|
+
var s = {
|
|
1162
|
+
ctx: W,
|
|
1163
1163
|
deps: null,
|
|
1164
1164
|
nodes: null,
|
|
1165
|
-
f: t |
|
|
1165
|
+
f: t | F | x,
|
|
1166
1166
|
first: null,
|
|
1167
1167
|
fn: e,
|
|
1168
1168
|
last: null,
|
|
@@ -1176,498 +1176,498 @@ function Me(t, e, i) {
|
|
|
1176
1176
|
};
|
|
1177
1177
|
if (i)
|
|
1178
1178
|
try {
|
|
1179
|
-
|
|
1179
|
+
We(s);
|
|
1180
1180
|
} catch (l) {
|
|
1181
|
-
throw
|
|
1181
|
+
throw ee(s), l;
|
|
1182
1182
|
}
|
|
1183
|
-
else e !== null &&
|
|
1184
|
-
var
|
|
1185
|
-
if (i &&
|
|
1186
|
-
(
|
|
1183
|
+
else e !== null && oe(s);
|
|
1184
|
+
var r = s;
|
|
1185
|
+
if (i && r.deps === null && r.teardown === null && r.nodes === null && r.first === r.last && // either `null`, or a singular child
|
|
1186
|
+
(r.f & Je) === 0 && (r = r.first, (t & be) !== 0 && (t & It) !== 0 && r !== null && (r.f |= It)), r !== null && (r.parent = n, n !== null && Ts(r, n), y !== null && (y.f & H) !== 0 && (t & Ce) === 0)) {
|
|
1187
1187
|
var o = (
|
|
1188
1188
|
/** @type {Derived} */
|
|
1189
|
-
|
|
1189
|
+
y
|
|
1190
1190
|
);
|
|
1191
|
-
(o.effects ?? (o.effects = [])).push(
|
|
1191
|
+
(o.effects ?? (o.effects = [])).push(r);
|
|
1192
1192
|
}
|
|
1193
|
-
return
|
|
1193
|
+
return s;
|
|
1194
1194
|
}
|
|
1195
|
-
function
|
|
1196
|
-
return
|
|
1195
|
+
function ei() {
|
|
1196
|
+
return y !== null && !Z;
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1199
|
-
|
|
1198
|
+
function Le(t) {
|
|
1199
|
+
ys();
|
|
1200
1200
|
var e = (
|
|
1201
1201
|
/** @type {Effect} */
|
|
1202
|
-
|
|
1203
|
-
), i = !
|
|
1202
|
+
E.f
|
|
1203
|
+
), i = !y && (e & _e) !== 0 && (e & Qe) === 0;
|
|
1204
1204
|
if (i) {
|
|
1205
1205
|
var n = (
|
|
1206
1206
|
/** @type {ComponentContext} */
|
|
1207
|
-
|
|
1207
|
+
W
|
|
1208
1208
|
);
|
|
1209
1209
|
(n.e ?? (n.e = [])).push(t);
|
|
1210
1210
|
} else
|
|
1211
|
-
return
|
|
1211
|
+
return ln(t);
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1214
|
-
return
|
|
1213
|
+
function ln(t) {
|
|
1214
|
+
return Pe(nt | qn, t, !1);
|
|
1215
1215
|
}
|
|
1216
|
-
function
|
|
1217
|
-
|
|
1218
|
-
const e =
|
|
1216
|
+
function As(t) {
|
|
1217
|
+
ve.ensure();
|
|
1218
|
+
const e = Pe(Ce | Je, t, !0);
|
|
1219
1219
|
return () => {
|
|
1220
|
-
|
|
1220
|
+
ee(e);
|
|
1221
1221
|
};
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1224
|
-
|
|
1225
|
-
const e =
|
|
1223
|
+
function Is(t) {
|
|
1224
|
+
ve.ensure();
|
|
1225
|
+
const e = Pe(Ce | Je, t, !0);
|
|
1226
1226
|
return (i = {}) => new Promise((n) => {
|
|
1227
|
-
i.outro ?
|
|
1228
|
-
|
|
1229
|
-
}) : (
|
|
1227
|
+
i.outro ? vt(e, () => {
|
|
1228
|
+
ee(e), n(void 0);
|
|
1229
|
+
}) : (ee(e), n(void 0));
|
|
1230
1230
|
});
|
|
1231
1231
|
}
|
|
1232
|
-
function
|
|
1233
|
-
return
|
|
1232
|
+
function Es(t) {
|
|
1233
|
+
return Pe(nt, t, !1);
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1236
|
-
return
|
|
1235
|
+
function ti(t, e = 0) {
|
|
1236
|
+
return Pe(Si | e, t, !0);
|
|
1237
1237
|
}
|
|
1238
|
-
function
|
|
1239
|
-
var i =
|
|
1238
|
+
function ws(t, e = 0) {
|
|
1239
|
+
var i = Pe(be | e, t, !0);
|
|
1240
1240
|
return i;
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1243
|
-
return
|
|
1242
|
+
function Be(t) {
|
|
1243
|
+
return Pe(_e | Je, t, !0);
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1245
|
+
function an(t) {
|
|
1246
1246
|
var e = t.teardown;
|
|
1247
1247
|
if (e !== null) {
|
|
1248
|
-
const i =
|
|
1249
|
-
|
|
1248
|
+
const i = Se, n = y;
|
|
1249
|
+
hi(!0), le(null);
|
|
1250
1250
|
try {
|
|
1251
1251
|
e.call(null);
|
|
1252
1252
|
} finally {
|
|
1253
|
-
|
|
1253
|
+
hi(i), le(n);
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function ii(t, e = !1) {
|
|
1258
1258
|
var i = t.first;
|
|
1259
1259
|
for (t.first = t.last = null; i !== null; ) {
|
|
1260
|
-
const
|
|
1261
|
-
|
|
1262
|
-
|
|
1260
|
+
const s = i.ac;
|
|
1261
|
+
s !== null && on(() => {
|
|
1262
|
+
s.abort(Wt);
|
|
1263
1263
|
});
|
|
1264
1264
|
var n = i.next;
|
|
1265
|
-
(i.f &
|
|
1265
|
+
(i.f & Ce) !== 0 ? i.parent = null : ee(i, e), i = n;
|
|
1266
1266
|
}
|
|
1267
1267
|
}
|
|
1268
|
-
function
|
|
1268
|
+
function Ss(t) {
|
|
1269
1269
|
for (var e = t.first; e !== null; ) {
|
|
1270
1270
|
var i = e.next;
|
|
1271
|
-
(e.f &
|
|
1271
|
+
(e.f & _e) === 0 && ee(e), e = i;
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1274
|
+
function ee(t, e = !0) {
|
|
1275
1275
|
var i = !1;
|
|
1276
|
-
(e || (t.f &
|
|
1276
|
+
(e || (t.f & Ci) !== 0) && t.nodes !== null && t.nodes.end !== null && ($s(
|
|
1277
1277
|
t.nodes.start,
|
|
1278
1278
|
/** @type {TemplateNode} */
|
|
1279
1279
|
t.nodes.end
|
|
1280
|
-
), i = !0),
|
|
1280
|
+
), i = !0), ii(t, e && !i), ot(t, 0), R(t, Ee);
|
|
1281
1281
|
var n = t.nodes && t.nodes.t;
|
|
1282
1282
|
if (n !== null)
|
|
1283
|
-
for (const
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
var
|
|
1287
|
-
|
|
1283
|
+
for (const r of n)
|
|
1284
|
+
r.stop();
|
|
1285
|
+
an(t);
|
|
1286
|
+
var s = t.parent;
|
|
1287
|
+
s !== null && s.first !== null && cn(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null;
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1289
|
+
function $s(t, e) {
|
|
1290
1290
|
for (; t !== null; ) {
|
|
1291
|
-
var i = t === e ? null : /* @__PURE__ */
|
|
1291
|
+
var i = t === e ? null : /* @__PURE__ */ Ze(t);
|
|
1292
1292
|
t.remove(), t = i;
|
|
1293
1293
|
}
|
|
1294
1294
|
}
|
|
1295
|
-
function
|
|
1295
|
+
function cn(t) {
|
|
1296
1296
|
var e = t.parent, i = t.prev, n = t.next;
|
|
1297
1297
|
i !== null && (i.next = n), n !== null && (n.prev = i), e !== null && (e.first === t && (e.first = n), e.last === t && (e.last = i));
|
|
1298
1298
|
}
|
|
1299
|
-
function
|
|
1299
|
+
function vt(t, e, i = !0) {
|
|
1300
1300
|
var n = [];
|
|
1301
|
-
|
|
1302
|
-
var
|
|
1303
|
-
i &&
|
|
1304
|
-
},
|
|
1305
|
-
if (
|
|
1306
|
-
var o = () => --
|
|
1301
|
+
un(t, n, !0);
|
|
1302
|
+
var s = () => {
|
|
1303
|
+
i && ee(t), e && e();
|
|
1304
|
+
}, r = n.length;
|
|
1305
|
+
if (r > 0) {
|
|
1306
|
+
var o = () => --r || s();
|
|
1307
1307
|
for (var l of n)
|
|
1308
1308
|
l.out(o);
|
|
1309
1309
|
} else
|
|
1310
|
-
|
|
1310
|
+
s();
|
|
1311
1311
|
}
|
|
1312
|
-
function
|
|
1313
|
-
if ((t.f &
|
|
1314
|
-
t.f ^=
|
|
1312
|
+
function un(t, e, i) {
|
|
1313
|
+
if ((t.f & Ie) === 0) {
|
|
1314
|
+
t.f ^= Ie;
|
|
1315
1315
|
var n = t.nodes && t.nodes.t;
|
|
1316
1316
|
if (n !== null)
|
|
1317
1317
|
for (const l of n)
|
|
1318
1318
|
(l.is_global || i) && e.push(l);
|
|
1319
|
-
for (var
|
|
1320
|
-
var
|
|
1319
|
+
for (var s = t.first; s !== null; ) {
|
|
1320
|
+
var r = s.next, o = (s.f & It) !== 0 || // If this is a branch effect without a block effect parent,
|
|
1321
1321
|
// it means the parent block effect was pruned. In that case,
|
|
1322
1322
|
// transparency information was transferred to the branch effect.
|
|
1323
|
-
(
|
|
1324
|
-
|
|
1323
|
+
(s.f & _e) !== 0 && (t.f & be) !== 0;
|
|
1324
|
+
un(s, e, o ? i : !1), s = r;
|
|
1325
1325
|
}
|
|
1326
1326
|
}
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1328
|
+
function Cs(t, e) {
|
|
1329
1329
|
if (t.nodes)
|
|
1330
1330
|
for (var i = t.nodes.start, n = t.nodes.end; i !== null; ) {
|
|
1331
|
-
var
|
|
1332
|
-
e.append(i), i =
|
|
1331
|
+
var s = i === n ? null : /* @__PURE__ */ Ze(i);
|
|
1332
|
+
e.append(i), i = s;
|
|
1333
1333
|
}
|
|
1334
1334
|
}
|
|
1335
|
-
let
|
|
1336
|
-
function
|
|
1337
|
-
|
|
1335
|
+
let bt = !1, Se = !1;
|
|
1336
|
+
function hi(t) {
|
|
1337
|
+
Se = t;
|
|
1338
1338
|
}
|
|
1339
|
-
let
|
|
1340
|
-
function
|
|
1341
|
-
|
|
1339
|
+
let y = null, Z = !1;
|
|
1340
|
+
function le(t) {
|
|
1341
|
+
y = t;
|
|
1342
1342
|
}
|
|
1343
|
-
let
|
|
1344
|
-
function
|
|
1345
|
-
|
|
1343
|
+
let E = null;
|
|
1344
|
+
function $e(t) {
|
|
1345
|
+
E = t;
|
|
1346
1346
|
}
|
|
1347
|
-
let
|
|
1348
|
-
function
|
|
1349
|
-
|
|
1347
|
+
let X = null;
|
|
1348
|
+
function fn(t) {
|
|
1349
|
+
y !== null && (X === null ? X = [t] : X.push(t));
|
|
1350
1350
|
}
|
|
1351
|
-
let
|
|
1352
|
-
function
|
|
1353
|
-
|
|
1351
|
+
let j = null, q = 0, z = null;
|
|
1352
|
+
function Ls(t) {
|
|
1353
|
+
z = t;
|
|
1354
1354
|
}
|
|
1355
|
-
let
|
|
1356
|
-
function
|
|
1357
|
-
|
|
1355
|
+
let dn = 1, Oe = 0, Fe = Oe;
|
|
1356
|
+
function pi(t) {
|
|
1357
|
+
Fe = t;
|
|
1358
1358
|
}
|
|
1359
|
-
function
|
|
1360
|
-
return ++
|
|
1359
|
+
function hn() {
|
|
1360
|
+
return ++dn;
|
|
1361
1361
|
}
|
|
1362
|
-
function
|
|
1362
|
+
function ut(t) {
|
|
1363
1363
|
var e = t.f;
|
|
1364
|
-
if ((e &
|
|
1364
|
+
if ((e & F) !== 0)
|
|
1365
1365
|
return !0;
|
|
1366
|
-
if (e &
|
|
1366
|
+
if (e & H && (t.f &= ~De), (e & te) !== 0) {
|
|
1367
1367
|
for (var i = (
|
|
1368
1368
|
/** @type {Value[]} */
|
|
1369
1369
|
t.deps
|
|
1370
|
-
), n = i.length,
|
|
1371
|
-
var
|
|
1372
|
-
if (
|
|
1370
|
+
), n = i.length, s = 0; s < n; s++) {
|
|
1371
|
+
var r = i[s];
|
|
1372
|
+
if (ut(
|
|
1373
1373
|
/** @type {Derived} */
|
|
1374
|
-
|
|
1375
|
-
) &&
|
|
1374
|
+
r
|
|
1375
|
+
) && xi(
|
|
1376
1376
|
/** @type {Derived} */
|
|
1377
|
-
|
|
1378
|
-
),
|
|
1377
|
+
r
|
|
1378
|
+
), r.wv > t.wv)
|
|
1379
1379
|
return !0;
|
|
1380
1380
|
}
|
|
1381
|
-
(e &
|
|
1381
|
+
(e & x) !== 0 && // During time traveling we don't want to reset the status so that
|
|
1382
1382
|
// traversal of the graph in the other batches still happens
|
|
1383
|
-
|
|
1383
|
+
Q === null && R(t, V);
|
|
1384
1384
|
}
|
|
1385
1385
|
return !1;
|
|
1386
1386
|
}
|
|
1387
|
-
function
|
|
1387
|
+
function pn(t, e, i = !0) {
|
|
1388
1388
|
var n = t.reactions;
|
|
1389
|
-
if (n !== null && !(
|
|
1390
|
-
for (var
|
|
1391
|
-
var
|
|
1392
|
-
(
|
|
1389
|
+
if (n !== null && !(X !== null && Xe.call(X, t)))
|
|
1390
|
+
for (var s = 0; s < n.length; s++) {
|
|
1391
|
+
var r = n[s];
|
|
1392
|
+
(r.f & H) !== 0 ? pn(
|
|
1393
1393
|
/** @type {Derived} */
|
|
1394
|
-
|
|
1394
|
+
r,
|
|
1395
1395
|
e,
|
|
1396
1396
|
!1
|
|
1397
|
-
) : e ===
|
|
1397
|
+
) : e === r && (i ? R(r, F) : (r.f & V) !== 0 && R(r, te), oe(
|
|
1398
1398
|
/** @type {Effect} */
|
|
1399
|
-
|
|
1399
|
+
r
|
|
1400
1400
|
));
|
|
1401
1401
|
}
|
|
1402
1402
|
}
|
|
1403
|
-
function
|
|
1404
|
-
var
|
|
1405
|
-
var e =
|
|
1406
|
-
|
|
1407
|
-
null,
|
|
1408
|
-
t.ac.abort(
|
|
1403
|
+
function gn(t) {
|
|
1404
|
+
var T;
|
|
1405
|
+
var e = j, i = q, n = z, s = y, r = X, o = W, l = Z, a = Fe, u = t.f;
|
|
1406
|
+
j = /** @type {null | Value[]} */
|
|
1407
|
+
null, q = 0, z = null, y = (u & (_e | Ce)) === 0 ? t : null, X = null, Et(t.ctx), Z = !1, Fe = ++Oe, t.ac !== null && (on(() => {
|
|
1408
|
+
t.ac.abort(Wt);
|
|
1409
1409
|
}), t.ac = null);
|
|
1410
1410
|
try {
|
|
1411
|
-
t.f |=
|
|
1411
|
+
t.f |= Mt;
|
|
1412
1412
|
var d = (
|
|
1413
1413
|
/** @type {Function} */
|
|
1414
1414
|
t.fn
|
|
1415
|
-
),
|
|
1416
|
-
t.f |=
|
|
1417
|
-
var p = t.deps,
|
|
1418
|
-
if (
|
|
1415
|
+
), v = d();
|
|
1416
|
+
t.f |= Qe;
|
|
1417
|
+
var p = t.deps, g = k?.is_fork;
|
|
1418
|
+
if (j !== null) {
|
|
1419
1419
|
var h;
|
|
1420
|
-
if (
|
|
1421
|
-
for (p.length =
|
|
1422
|
-
p[
|
|
1420
|
+
if (g || ot(t, q), p !== null && q > 0)
|
|
1421
|
+
for (p.length = q + j.length, h = 0; h < j.length; h++)
|
|
1422
|
+
p[q + h] = j[h];
|
|
1423
1423
|
else
|
|
1424
|
-
t.deps = p =
|
|
1425
|
-
if (
|
|
1426
|
-
for (h =
|
|
1427
|
-
((
|
|
1428
|
-
} else !
|
|
1429
|
-
if (
|
|
1424
|
+
t.deps = p = j;
|
|
1425
|
+
if (ei() && (t.f & x) !== 0)
|
|
1426
|
+
for (h = q; h < p.length; h++)
|
|
1427
|
+
((T = p[h]).reactions ?? (T.reactions = [])).push(t);
|
|
1428
|
+
} else !g && p !== null && q < p.length && (ot(t, q), p.length = q);
|
|
1429
|
+
if (Vi() && z !== null && !Z && p !== null && (t.f & (H | te | F)) === 0)
|
|
1430
1430
|
for (h = 0; h < /** @type {Source[]} */
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1431
|
+
z.length; h++)
|
|
1432
|
+
pn(
|
|
1433
|
+
z[h],
|
|
1434
1434
|
/** @type {Effect} */
|
|
1435
1435
|
t
|
|
1436
1436
|
);
|
|
1437
|
-
if (
|
|
1438
|
-
if (
|
|
1439
|
-
for (let
|
|
1440
|
-
|
|
1437
|
+
if (s !== null && s !== t) {
|
|
1438
|
+
if (Oe++, s.deps !== null)
|
|
1439
|
+
for (let b = 0; b < i; b += 1)
|
|
1440
|
+
s.deps[b].rv = Oe;
|
|
1441
1441
|
if (e !== null)
|
|
1442
|
-
for (const
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1442
|
+
for (const b of e)
|
|
1443
|
+
b.rv = Oe;
|
|
1444
|
+
z !== null && (n === null ? n = z : n.push(.../** @type {Source[]} */
|
|
1445
|
+
z));
|
|
1446
1446
|
}
|
|
1447
|
-
return (t.f &
|
|
1448
|
-
} catch (
|
|
1449
|
-
return
|
|
1447
|
+
return (t.f & st) !== 0 && (t.f ^= st), v;
|
|
1448
|
+
} catch (b) {
|
|
1449
|
+
return Fi(b);
|
|
1450
1450
|
} finally {
|
|
1451
|
-
t.f ^=
|
|
1451
|
+
t.f ^= Mt, j = e, q = i, z = n, y = s, X = r, Et(o), Z = l, Fe = a;
|
|
1452
1452
|
}
|
|
1453
1453
|
}
|
|
1454
|
-
function
|
|
1454
|
+
function Rs(t, e) {
|
|
1455
1455
|
let i = e.reactions;
|
|
1456
1456
|
if (i !== null) {
|
|
1457
|
-
var n =
|
|
1457
|
+
var n = Vn.call(i, t);
|
|
1458
1458
|
if (n !== -1) {
|
|
1459
|
-
var
|
|
1460
|
-
|
|
1459
|
+
var s = i.length - 1;
|
|
1460
|
+
s === 0 ? i = e.reactions = null : (i[n] = i[s], i.pop());
|
|
1461
1461
|
}
|
|
1462
1462
|
}
|
|
1463
|
-
if (i === null && (e.f &
|
|
1463
|
+
if (i === null && (e.f & H) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1464
1464
|
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1465
1465
|
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1466
|
-
(
|
|
1467
|
-
var
|
|
1466
|
+
(j === null || !Xe.call(j, e))) {
|
|
1467
|
+
var r = (
|
|
1468
1468
|
/** @type {Derived} */
|
|
1469
1469
|
e
|
|
1470
1470
|
);
|
|
1471
|
-
(
|
|
1471
|
+
(r.f & x) !== 0 && (r.f ^= x, r.f &= ~De), Jt(r), ms(r), ot(r, 0);
|
|
1472
1472
|
}
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1474
|
+
function ot(t, e) {
|
|
1475
1475
|
var i = t.deps;
|
|
1476
1476
|
if (i !== null)
|
|
1477
1477
|
for (var n = e; n < i.length; n++)
|
|
1478
|
-
|
|
1478
|
+
Rs(t, i[n]);
|
|
1479
1479
|
}
|
|
1480
|
-
function
|
|
1480
|
+
function We(t) {
|
|
1481
1481
|
var e = t.f;
|
|
1482
|
-
if ((e &
|
|
1483
|
-
|
|
1484
|
-
var i =
|
|
1485
|
-
|
|
1482
|
+
if ((e & Ee) === 0) {
|
|
1483
|
+
R(t, V);
|
|
1484
|
+
var i = E, n = bt;
|
|
1485
|
+
E = t, bt = !0;
|
|
1486
1486
|
try {
|
|
1487
|
-
(e & (
|
|
1488
|
-
var
|
|
1489
|
-
t.teardown = typeof
|
|
1490
|
-
var
|
|
1491
|
-
|
|
1487
|
+
(e & (be | $i)) !== 0 ? Ss(t) : ii(t), an(t);
|
|
1488
|
+
var s = gn(t);
|
|
1489
|
+
t.teardown = typeof s == "function" ? s : null, t.wv = dn;
|
|
1490
|
+
var r;
|
|
1491
|
+
Nt && os && (t.f & F) !== 0 && t.deps;
|
|
1492
1492
|
} finally {
|
|
1493
|
-
|
|
1493
|
+
bt = n, E = i;
|
|
1494
1494
|
}
|
|
1495
1495
|
}
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1498
|
-
var e = t.f, i = (e &
|
|
1499
|
-
if (
|
|
1500
|
-
var n =
|
|
1501
|
-
if (!n && (
|
|
1502
|
-
var
|
|
1503
|
-
if ((
|
|
1504
|
-
t.rv <
|
|
1497
|
+
function m(t) {
|
|
1498
|
+
var e = t.f, i = (e & H) !== 0;
|
|
1499
|
+
if (y !== null && !Z) {
|
|
1500
|
+
var n = E !== null && (E.f & Ee) !== 0;
|
|
1501
|
+
if (!n && (X === null || !Xe.call(X, t))) {
|
|
1502
|
+
var s = y.deps;
|
|
1503
|
+
if ((y.f & Mt) !== 0)
|
|
1504
|
+
t.rv < Oe && (t.rv = Oe, j === null && s !== null && s[q] === t ? q++ : j === null ? j = [t] : j.push(t));
|
|
1505
1505
|
else {
|
|
1506
|
-
(
|
|
1507
|
-
var
|
|
1508
|
-
|
|
1506
|
+
(y.deps ?? (y.deps = [])).push(t);
|
|
1507
|
+
var r = t.reactions;
|
|
1508
|
+
r === null ? t.reactions = [y] : Xe.call(r, y) || r.push(y);
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
|
-
if (
|
|
1512
|
+
if (Se && we.has(t))
|
|
1513
1513
|
return we.get(t);
|
|
1514
1514
|
if (i) {
|
|
1515
1515
|
var o = (
|
|
1516
1516
|
/** @type {Derived} */
|
|
1517
1517
|
t
|
|
1518
1518
|
);
|
|
1519
|
-
if (
|
|
1519
|
+
if (Se) {
|
|
1520
1520
|
var l = o.v;
|
|
1521
|
-
return ((o.f &
|
|
1521
|
+
return ((o.f & V) === 0 && o.reactions !== null || vn(o)) && (l = Zt(o)), we.set(o, l), l;
|
|
1522
1522
|
}
|
|
1523
|
-
var a = (o.f &
|
|
1524
|
-
|
|
1523
|
+
var a = (o.f & x) === 0 && !Z && y !== null && (bt || (y.f & x) !== 0), u = (o.f & Qe) === 0;
|
|
1524
|
+
ut(o) && (a && (o.f |= x), xi(o)), a && !u && (Xi(o), mn(o));
|
|
1525
1525
|
}
|
|
1526
|
-
if (
|
|
1527
|
-
return
|
|
1528
|
-
if ((t.f &
|
|
1526
|
+
if (Q?.has(t))
|
|
1527
|
+
return Q.get(t);
|
|
1528
|
+
if ((t.f & st) !== 0)
|
|
1529
1529
|
throw t.v;
|
|
1530
1530
|
return t.v;
|
|
1531
1531
|
}
|
|
1532
|
-
function
|
|
1533
|
-
if (t.f |=
|
|
1532
|
+
function mn(t) {
|
|
1533
|
+
if (t.f |= x, t.deps !== null)
|
|
1534
1534
|
for (const e of t.deps)
|
|
1535
|
-
(e.reactions ?? (e.reactions = [])).push(t), (e.f &
|
|
1535
|
+
(e.reactions ?? (e.reactions = [])).push(t), (e.f & H) !== 0 && (e.f & x) === 0 && (Xi(
|
|
1536
1536
|
/** @type {Derived} */
|
|
1537
1537
|
e
|
|
1538
|
-
),
|
|
1538
|
+
), mn(
|
|
1539
1539
|
/** @type {Derived} */
|
|
1540
1540
|
e
|
|
1541
1541
|
));
|
|
1542
1542
|
}
|
|
1543
|
-
function
|
|
1544
|
-
if (t.v ===
|
|
1543
|
+
function vn(t) {
|
|
1544
|
+
if (t.v === N) return !0;
|
|
1545
1545
|
if (t.deps === null) return !1;
|
|
1546
1546
|
for (const e of t.deps)
|
|
1547
|
-
if (we.has(e) || (e.f &
|
|
1547
|
+
if (we.has(e) || (e.f & H) !== 0 && vn(
|
|
1548
1548
|
/** @type {Derived} */
|
|
1549
1549
|
e
|
|
1550
1550
|
))
|
|
1551
1551
|
return !0;
|
|
1552
1552
|
return !1;
|
|
1553
1553
|
}
|
|
1554
|
-
function
|
|
1555
|
-
var e =
|
|
1554
|
+
function ni(t) {
|
|
1555
|
+
var e = Z;
|
|
1556
1556
|
try {
|
|
1557
|
-
return
|
|
1557
|
+
return Z = !0, t();
|
|
1558
1558
|
} finally {
|
|
1559
|
-
|
|
1559
|
+
Z = e;
|
|
1560
1560
|
}
|
|
1561
1561
|
}
|
|
1562
|
-
const
|
|
1563
|
-
let
|
|
1564
|
-
function
|
|
1562
|
+
const ht = /* @__PURE__ */ Symbol("events"), Os = /* @__PURE__ */ new Set(), gi = /* @__PURE__ */ new Set();
|
|
1563
|
+
let mi = null;
|
|
1564
|
+
function vi(t) {
|
|
1565
1565
|
var e = this, i = (
|
|
1566
1566
|
/** @type {Node} */
|
|
1567
1567
|
e.ownerDocument
|
|
1568
|
-
), n = t.type,
|
|
1568
|
+
), n = t.type, s = t.composedPath?.() || [], r = (
|
|
1569
1569
|
/** @type {null | Element} */
|
|
1570
|
-
|
|
1570
|
+
s[0] || t.target
|
|
1571
1571
|
);
|
|
1572
|
-
|
|
1573
|
-
var o = 0, l =
|
|
1572
|
+
mi = t;
|
|
1573
|
+
var o = 0, l = mi === t && t[ht];
|
|
1574
1574
|
if (l) {
|
|
1575
|
-
var a =
|
|
1575
|
+
var a = s.indexOf(l);
|
|
1576
1576
|
if (a !== -1 && (e === document || e === /** @type {any} */
|
|
1577
1577
|
window)) {
|
|
1578
|
-
t[
|
|
1578
|
+
t[ht] = e;
|
|
1579
1579
|
return;
|
|
1580
1580
|
}
|
|
1581
|
-
var u =
|
|
1581
|
+
var u = s.indexOf(e);
|
|
1582
1582
|
if (u === -1)
|
|
1583
1583
|
return;
|
|
1584
1584
|
a <= u && (o = a);
|
|
1585
1585
|
}
|
|
1586
|
-
if (
|
|
1587
|
-
|
|
1588
|
-
|
|
1586
|
+
if (r = /** @type {Element} */
|
|
1587
|
+
s[o] || t.target, r !== e) {
|
|
1588
|
+
At(t, "currentTarget", {
|
|
1589
1589
|
configurable: !0,
|
|
1590
1590
|
get() {
|
|
1591
|
-
return
|
|
1591
|
+
return r || i;
|
|
1592
1592
|
}
|
|
1593
1593
|
});
|
|
1594
|
-
var d =
|
|
1595
|
-
|
|
1594
|
+
var d = y, v = E;
|
|
1595
|
+
le(null), $e(null);
|
|
1596
1596
|
try {
|
|
1597
|
-
for (var p,
|
|
1598
|
-
var h =
|
|
1599
|
-
|
|
1597
|
+
for (var p, g = []; r !== null; ) {
|
|
1598
|
+
var h = r.assignedSlot || r.parentNode || /** @type {any} */
|
|
1599
|
+
r.host || null;
|
|
1600
1600
|
try {
|
|
1601
|
-
var
|
|
1602
|
-
|
|
1603
|
-
|
|
1601
|
+
var T = r[ht]?.[n];
|
|
1602
|
+
T != null && (!/** @type {any} */
|
|
1603
|
+
r.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1604
1604
|
// -> the target could not have been disabled because it emits the event in the first place
|
|
1605
|
-
t.target ===
|
|
1606
|
-
} catch (
|
|
1607
|
-
p ?
|
|
1605
|
+
t.target === r) && T.call(r, t);
|
|
1606
|
+
} catch (b) {
|
|
1607
|
+
p ? g.push(b) : p = b;
|
|
1608
1608
|
}
|
|
1609
1609
|
if (t.cancelBubble || h === e || h === null)
|
|
1610
1610
|
break;
|
|
1611
|
-
|
|
1611
|
+
r = h;
|
|
1612
1612
|
}
|
|
1613
1613
|
if (p) {
|
|
1614
|
-
for (let
|
|
1614
|
+
for (let b of g)
|
|
1615
1615
|
queueMicrotask(() => {
|
|
1616
|
-
throw
|
|
1616
|
+
throw b;
|
|
1617
1617
|
});
|
|
1618
1618
|
throw p;
|
|
1619
1619
|
}
|
|
1620
1620
|
} finally {
|
|
1621
|
-
t[
|
|
1621
|
+
t[ht] = e, delete t.currentTarget, le(d), $e(v);
|
|
1622
1622
|
}
|
|
1623
1623
|
}
|
|
1624
1624
|
}
|
|
1625
|
-
const
|
|
1625
|
+
const ks = (
|
|
1626
1626
|
// We gotta write it like this because after downleveling the pure comment may end up in the wrong location
|
|
1627
1627
|
globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
|
|
1628
1628
|
/** @param {string} html */
|
|
1629
1629
|
createHTML: (t) => t
|
|
1630
1630
|
})
|
|
1631
1631
|
);
|
|
1632
|
-
function
|
|
1632
|
+
function Hs(t) {
|
|
1633
1633
|
return (
|
|
1634
1634
|
/** @type {string} */
|
|
1635
|
-
|
|
1635
|
+
ks?.createHTML(t) ?? t
|
|
1636
1636
|
);
|
|
1637
1637
|
}
|
|
1638
|
-
function
|
|
1639
|
-
var i =
|
|
1640
|
-
return t = t.replaceAll("<!>", "<!---->"), i.innerHTML = e ?
|
|
1638
|
+
function Ns(t, e = !1) {
|
|
1639
|
+
var i = rn("template");
|
|
1640
|
+
return t = t.replaceAll("<!>", "<!---->"), i.innerHTML = e ? Hs(t) : t, i.content;
|
|
1641
1641
|
}
|
|
1642
|
-
function
|
|
1642
|
+
function Kt(t, e) {
|
|
1643
1643
|
var i = (
|
|
1644
1644
|
/** @type {Effect} */
|
|
1645
|
-
|
|
1645
|
+
E
|
|
1646
1646
|
);
|
|
1647
1647
|
i.nodes === null && (i.nodes = { start: t, end: e, a: null, t: null });
|
|
1648
1648
|
}
|
|
1649
1649
|
// @__NO_SIDE_EFFECTS__
|
|
1650
|
-
function
|
|
1651
|
-
var i = (e &
|
|
1650
|
+
function Vs(t, e) {
|
|
1651
|
+
var i = (e & kn) !== 0, n, s = !t.startsWith("<!>");
|
|
1652
1652
|
return () => {
|
|
1653
|
-
if (
|
|
1654
|
-
return
|
|
1655
|
-
n === void 0 && (n =
|
|
1656
|
-
/* @__PURE__ */
|
|
1657
|
-
var
|
|
1653
|
+
if (J)
|
|
1654
|
+
return Kt(B, null), B;
|
|
1655
|
+
n === void 0 && (n = Ns(s ? t : "<!>" + t, !0), n = /** @type {TemplateNode} */
|
|
1656
|
+
/* @__PURE__ */ sn(n));
|
|
1657
|
+
var r = (
|
|
1658
1658
|
/** @type {TemplateNode} */
|
|
1659
|
-
i ||
|
|
1659
|
+
i || Zi ? document.importNode(n, !0) : n.cloneNode(!0)
|
|
1660
1660
|
);
|
|
1661
|
-
return
|
|
1661
|
+
return Kt(r, r), r;
|
|
1662
1662
|
};
|
|
1663
1663
|
}
|
|
1664
|
-
function
|
|
1665
|
-
if (
|
|
1664
|
+
function bn(t, e) {
|
|
1665
|
+
if (J) {
|
|
1666
1666
|
var i = (
|
|
1667
1667
|
/** @type {Effect & { nodes: EffectNodes }} */
|
|
1668
|
-
|
|
1668
|
+
E
|
|
1669
1669
|
);
|
|
1670
|
-
((i.f &
|
|
1670
|
+
((i.f & Qe) === 0 || i.nodes.end === null) && (i.nodes.end = B), Oi();
|
|
1671
1671
|
return;
|
|
1672
1672
|
}
|
|
1673
1673
|
t !== null && t.before(
|
|
@@ -1675,44 +1675,44 @@ function un(t, e) {
|
|
|
1675
1675
|
e
|
|
1676
1676
|
);
|
|
1677
1677
|
}
|
|
1678
|
-
const
|
|
1679
|
-
function
|
|
1680
|
-
return
|
|
1678
|
+
const Ms = ["touchstart", "touchmove"];
|
|
1679
|
+
function Fs(t) {
|
|
1680
|
+
return Ms.includes(t);
|
|
1681
1681
|
}
|
|
1682
|
-
function
|
|
1683
|
-
return
|
|
1682
|
+
function _n(t, e) {
|
|
1683
|
+
return yn(t, e);
|
|
1684
1684
|
}
|
|
1685
|
-
function
|
|
1686
|
-
|
|
1687
|
-
const i = e.target, n =
|
|
1685
|
+
function Ds(t, e) {
|
|
1686
|
+
qt(), e.intro = e.intro ?? !1;
|
|
1687
|
+
const i = e.target, n = J, s = B;
|
|
1688
1688
|
try {
|
|
1689
|
-
for (var
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
if (!
|
|
1693
|
-
throw
|
|
1694
|
-
|
|
1689
|
+
for (var r = /* @__PURE__ */ sn(i); r && (r.nodeType !== Qt || /** @type {Comment} */
|
|
1690
|
+
r.data !== Ii); )
|
|
1691
|
+
r = /* @__PURE__ */ Ze(r);
|
|
1692
|
+
if (!r)
|
|
1693
|
+
throw yt;
|
|
1694
|
+
ft(!0), rt(
|
|
1695
1695
|
/** @type {Comment} */
|
|
1696
|
-
|
|
1696
|
+
r
|
|
1697
1697
|
);
|
|
1698
|
-
const o =
|
|
1699
|
-
return
|
|
1698
|
+
const o = yn(t, { ...e, anchor: r });
|
|
1699
|
+
return ft(!1), /** @type {Exports} */
|
|
1700
1700
|
o;
|
|
1701
1701
|
} catch (o) {
|
|
1702
1702
|
if (o instanceof Error && o.message.split(`
|
|
1703
1703
|
`).some((l) => l.startsWith("https://svelte.dev/e/")))
|
|
1704
1704
|
throw o;
|
|
1705
|
-
return o !==
|
|
1705
|
+
return o !== yt && console.warn("Failed to hydrate: ", o), e.recover === !1 && Wn(), qt(), _s(i), ft(!1), _n(t, e);
|
|
1706
1706
|
} finally {
|
|
1707
|
-
|
|
1707
|
+
ft(n), rt(s);
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
|
-
const
|
|
1711
|
-
function
|
|
1712
|
-
|
|
1713
|
-
var l = void 0, a =
|
|
1714
|
-
var u = i ?? e.appendChild(
|
|
1715
|
-
|
|
1710
|
+
const pt = /* @__PURE__ */ new Map();
|
|
1711
|
+
function yn(t, { target: e, anchor: i, props: n = {}, events: s, context: r, intro: o = !0 }) {
|
|
1712
|
+
qt();
|
|
1713
|
+
var l = void 0, a = Is(() => {
|
|
1714
|
+
var u = i ?? e.appendChild(nn());
|
|
1715
|
+
ds(
|
|
1716
1716
|
/** @type {TemplateNode} */
|
|
1717
1717
|
u,
|
|
1718
1718
|
{
|
|
@@ -1720,90 +1720,90 @@ function dn(t, { target: e, anchor: i, props: n = {}, events: r, context: s, int
|
|
|
1720
1720
|
}
|
|
1721
1721
|
},
|
|
1722
1722
|
(p) => {
|
|
1723
|
-
|
|
1724
|
-
var
|
|
1723
|
+
Hi({});
|
|
1724
|
+
var g = (
|
|
1725
1725
|
/** @type {ComponentContext} */
|
|
1726
|
-
|
|
1726
|
+
W
|
|
1727
1727
|
);
|
|
1728
|
-
if (
|
|
1728
|
+
if (r && (g.c = r), s && (n.$$events = s), J && Kt(
|
|
1729
1729
|
/** @type {TemplateNode} */
|
|
1730
1730
|
p,
|
|
1731
1731
|
null
|
|
1732
|
-
), l = t(p, n) || {},
|
|
1733
|
-
|
|
1734
|
-
throw
|
|
1735
|
-
|
|
1732
|
+
), l = t(p, n) || {}, J && (E.nodes.end = B, B === null || B.nodeType !== Qt || /** @type {Comment} */
|
|
1733
|
+
B.data !== wi))
|
|
1734
|
+
throw Ri(), yt;
|
|
1735
|
+
Ni();
|
|
1736
1736
|
}
|
|
1737
1737
|
);
|
|
1738
|
-
var d = /* @__PURE__ */ new Set(),
|
|
1739
|
-
for (var
|
|
1740
|
-
var h = p[
|
|
1738
|
+
var d = /* @__PURE__ */ new Set(), v = (p) => {
|
|
1739
|
+
for (var g = 0; g < p.length; g++) {
|
|
1740
|
+
var h = p[g];
|
|
1741
1741
|
if (!d.has(h)) {
|
|
1742
1742
|
d.add(h);
|
|
1743
|
-
var
|
|
1744
|
-
for (const
|
|
1745
|
-
var
|
|
1746
|
-
|
|
1747
|
-
var
|
|
1748
|
-
|
|
1743
|
+
var T = Fs(h);
|
|
1744
|
+
for (const L of [e, document]) {
|
|
1745
|
+
var b = pt.get(L);
|
|
1746
|
+
b === void 0 && (b = /* @__PURE__ */ new Map(), pt.set(L, b));
|
|
1747
|
+
var S = b.get(h);
|
|
1748
|
+
S === void 0 ? (L.addEventListener(h, vi, { passive: T }), b.set(h, 1)) : b.set(h, S + 1);
|
|
1749
1749
|
}
|
|
1750
1750
|
}
|
|
1751
1751
|
}
|
|
1752
1752
|
};
|
|
1753
|
-
return
|
|
1753
|
+
return v(Mn(Os)), gi.add(v), () => {
|
|
1754
1754
|
for (var p of d)
|
|
1755
|
-
for (const
|
|
1756
|
-
var
|
|
1755
|
+
for (const T of [e, document]) {
|
|
1756
|
+
var g = (
|
|
1757
1757
|
/** @type {Map<string, number>} */
|
|
1758
|
-
|
|
1758
|
+
pt.get(T)
|
|
1759
1759
|
), h = (
|
|
1760
1760
|
/** @type {number} */
|
|
1761
|
-
|
|
1761
|
+
g.get(p)
|
|
1762
1762
|
);
|
|
1763
|
-
--h == 0 ? (
|
|
1763
|
+
--h == 0 ? (T.removeEventListener(p, vi), g.delete(p), g.size === 0 && pt.delete(T)) : g.set(p, h);
|
|
1764
1764
|
}
|
|
1765
|
-
|
|
1765
|
+
gi.delete(v), u !== i && u.parentNode?.removeChild(u);
|
|
1766
1766
|
};
|
|
1767
1767
|
});
|
|
1768
|
-
return
|
|
1768
|
+
return zt.set(l, a), l;
|
|
1769
1769
|
}
|
|
1770
|
-
let
|
|
1771
|
-
function
|
|
1772
|
-
const i =
|
|
1773
|
-
return i ? (
|
|
1770
|
+
let zt = /* @__PURE__ */ new WeakMap();
|
|
1771
|
+
function Ps(t, e) {
|
|
1772
|
+
const i = zt.get(t);
|
|
1773
|
+
return i ? (zt.delete(t), i(e)) : Promise.resolve();
|
|
1774
1774
|
}
|
|
1775
|
-
function
|
|
1776
|
-
|
|
1777
|
-
const e =
|
|
1775
|
+
function Bs(t) {
|
|
1776
|
+
W === null && zn(), Le(() => {
|
|
1777
|
+
const e = ni(t);
|
|
1778
1778
|
if (typeof e == "function") return (
|
|
1779
1779
|
/** @type {() => void} */
|
|
1780
1780
|
e
|
|
1781
1781
|
);
|
|
1782
1782
|
});
|
|
1783
1783
|
}
|
|
1784
|
-
function
|
|
1785
|
-
return t === e || t?.[
|
|
1784
|
+
function bi(t, e) {
|
|
1785
|
+
return t === e || t?.[gt] === e;
|
|
1786
1786
|
}
|
|
1787
|
-
function
|
|
1788
|
-
return
|
|
1789
|
-
var
|
|
1790
|
-
return
|
|
1791
|
-
|
|
1792
|
-
t !== i(...
|
|
1787
|
+
function Gs(t = {}, e, i, n) {
|
|
1788
|
+
return Es(() => {
|
|
1789
|
+
var s, r;
|
|
1790
|
+
return ti(() => {
|
|
1791
|
+
s = r, r = [], ni(() => {
|
|
1792
|
+
t !== i(...r) && (e(t, ...r), s && bi(i(...s), t) && e(null, ...s));
|
|
1793
1793
|
});
|
|
1794
1794
|
}), () => {
|
|
1795
|
-
|
|
1796
|
-
|
|
1795
|
+
Me(() => {
|
|
1796
|
+
r && bi(i(...r), t) && e(null, ...r);
|
|
1797
1797
|
});
|
|
1798
1798
|
};
|
|
1799
1799
|
}), t;
|
|
1800
1800
|
}
|
|
1801
|
-
function
|
|
1802
|
-
var
|
|
1801
|
+
function ye(t, e, i, n) {
|
|
1802
|
+
var s = (
|
|
1803
1803
|
/** @type {V} */
|
|
1804
1804
|
n
|
|
1805
|
-
),
|
|
1806
|
-
n),
|
|
1805
|
+
), r = !0, o = () => (r && (r = !1, s = /** @type {V} */
|
|
1806
|
+
n), s), l;
|
|
1807
1807
|
l = /** @type {V} */
|
|
1808
1808
|
t[e], l === void 0 && n !== void 0 && (l = o());
|
|
1809
1809
|
var a;
|
|
@@ -1812,28 +1812,28 @@ function ve(t, e, i, n) {
|
|
|
1812
1812
|
/** @type {V} */
|
|
1813
1813
|
t[e]
|
|
1814
1814
|
);
|
|
1815
|
-
return p === void 0 ? o() : (
|
|
1815
|
+
return p === void 0 ? o() : (r = !0, p);
|
|
1816
1816
|
};
|
|
1817
|
-
var u = !1, d = /* @__PURE__ */
|
|
1817
|
+
var u = !1, d = /* @__PURE__ */ Ui(() => (u = !1, a())), v = (
|
|
1818
1818
|
/** @type {Effect} */
|
|
1819
|
-
|
|
1819
|
+
E
|
|
1820
1820
|
);
|
|
1821
1821
|
return (
|
|
1822
1822
|
/** @type {() => V} */
|
|
1823
|
-
(function(p,
|
|
1823
|
+
(function(p, g) {
|
|
1824
1824
|
if (arguments.length > 0) {
|
|
1825
|
-
const h =
|
|
1826
|
-
return
|
|
1825
|
+
const h = g ? m(d) : p;
|
|
1826
|
+
return $(d, h), u = !0, s !== void 0 && (s = h), p;
|
|
1827
1827
|
}
|
|
1828
|
-
return
|
|
1828
|
+
return Se && u || (v.f & Ee) !== 0 ? d.v : m(d);
|
|
1829
1829
|
})
|
|
1830
1830
|
);
|
|
1831
1831
|
}
|
|
1832
|
-
function
|
|
1833
|
-
return new
|
|
1832
|
+
function js(t) {
|
|
1833
|
+
return new qs(t);
|
|
1834
1834
|
}
|
|
1835
|
-
var
|
|
1836
|
-
class
|
|
1835
|
+
var me, U;
|
|
1836
|
+
class qs {
|
|
1837
1837
|
/**
|
|
1838
1838
|
* @param {ComponentConstructorOptions & {
|
|
1839
1839
|
* component: any;
|
|
@@ -1841,56 +1841,56 @@ class Fr {
|
|
|
1841
1841
|
*/
|
|
1842
1842
|
constructor(e) {
|
|
1843
1843
|
/** @type {any} */
|
|
1844
|
-
|
|
1844
|
+
A(this, me);
|
|
1845
1845
|
/** @type {Record<string, any>} */
|
|
1846
|
-
|
|
1847
|
-
var i = /* @__PURE__ */ new Map(), n = (
|
|
1848
|
-
var l = /* @__PURE__ */
|
|
1849
|
-
return i.set(
|
|
1846
|
+
A(this, U);
|
|
1847
|
+
var i = /* @__PURE__ */ new Map(), n = (r, o) => {
|
|
1848
|
+
var l = /* @__PURE__ */ vs(o, !1, !1);
|
|
1849
|
+
return i.set(r, l), l;
|
|
1850
1850
|
};
|
|
1851
|
-
const
|
|
1851
|
+
const s = new Proxy(
|
|
1852
1852
|
{ ...e.props || {}, $$events: {} },
|
|
1853
1853
|
{
|
|
1854
|
-
get(
|
|
1855
|
-
return
|
|
1854
|
+
get(r, o) {
|
|
1855
|
+
return m(i.get(o) ?? n(o, Reflect.get(r, o)));
|
|
1856
1856
|
},
|
|
1857
|
-
has(
|
|
1858
|
-
return o ===
|
|
1857
|
+
has(r, o) {
|
|
1858
|
+
return o === Kn ? !0 : (m(i.get(o) ?? n(o, Reflect.get(r, o))), Reflect.has(r, o));
|
|
1859
1859
|
},
|
|
1860
|
-
set(
|
|
1861
|
-
return
|
|
1860
|
+
set(r, o, l) {
|
|
1861
|
+
return $(i.get(o) ?? n(o, l), l), Reflect.set(r, o, l);
|
|
1862
1862
|
}
|
|
1863
1863
|
}
|
|
1864
1864
|
);
|
|
1865
|
-
|
|
1865
|
+
_(this, U, (e.hydrate ? Ds : _n)(e.component, {
|
|
1866
1866
|
target: e.target,
|
|
1867
1867
|
anchor: e.anchor,
|
|
1868
|
-
props:
|
|
1868
|
+
props: s,
|
|
1869
1869
|
context: e.context,
|
|
1870
1870
|
intro: e.intro ?? !1,
|
|
1871
1871
|
recover: e.recover
|
|
1872
|
-
})), (!e?.props?.$$host || e.sync === !1) &&
|
|
1873
|
-
for (const
|
|
1874
|
-
|
|
1872
|
+
})), (!e?.props?.$$host || e.sync === !1) && ue(), _(this, me, s.$$events);
|
|
1873
|
+
for (const r of Object.keys(c(this, U)))
|
|
1874
|
+
r === "$set" || r === "$destroy" || r === "$on" || At(this, r, {
|
|
1875
1875
|
get() {
|
|
1876
|
-
return c(this,
|
|
1876
|
+
return c(this, U)[r];
|
|
1877
1877
|
},
|
|
1878
1878
|
/** @param {any} value */
|
|
1879
1879
|
set(o) {
|
|
1880
|
-
c(this,
|
|
1880
|
+
c(this, U)[r] = o;
|
|
1881
1881
|
},
|
|
1882
1882
|
enumerable: !0
|
|
1883
1883
|
});
|
|
1884
|
-
c(this,
|
|
1885
|
-
(
|
|
1886
|
-
Object.assign(
|
|
1887
|
-
}, c(this,
|
|
1888
|
-
|
|
1884
|
+
c(this, U).$set = /** @param {Record<string, any>} next */
|
|
1885
|
+
(r) => {
|
|
1886
|
+
Object.assign(s, r);
|
|
1887
|
+
}, c(this, U).$destroy = () => {
|
|
1888
|
+
Ps(c(this, U));
|
|
1889
1889
|
};
|
|
1890
1890
|
}
|
|
1891
1891
|
/** @param {Record<string, any>} props */
|
|
1892
1892
|
$set(e) {
|
|
1893
|
-
c(this,
|
|
1893
|
+
c(this, U).$set(e);
|
|
1894
1894
|
}
|
|
1895
1895
|
/**
|
|
1896
1896
|
* @param {string} event
|
|
@@ -1898,22 +1898,22 @@ class Fr {
|
|
|
1898
1898
|
* @returns {any}
|
|
1899
1899
|
*/
|
|
1900
1900
|
$on(e, i) {
|
|
1901
|
-
c(this,
|
|
1902
|
-
const n = (...
|
|
1903
|
-
return c(this,
|
|
1904
|
-
c(this,
|
|
1901
|
+
c(this, me)[e] = c(this, me)[e] || [];
|
|
1902
|
+
const n = (...s) => i.call(this, ...s);
|
|
1903
|
+
return c(this, me)[e].push(n), () => {
|
|
1904
|
+
c(this, me)[e] = c(this, me)[e].filter(
|
|
1905
1905
|
/** @param {any} fn */
|
|
1906
|
-
(
|
|
1906
|
+
(s) => s !== n
|
|
1907
1907
|
);
|
|
1908
1908
|
};
|
|
1909
1909
|
}
|
|
1910
1910
|
$destroy() {
|
|
1911
|
-
c(this,
|
|
1911
|
+
c(this, U).$destroy();
|
|
1912
1912
|
}
|
|
1913
1913
|
}
|
|
1914
|
-
|
|
1915
|
-
let
|
|
1916
|
-
typeof HTMLElement == "function" && (
|
|
1914
|
+
me = new WeakMap(), U = new WeakMap();
|
|
1915
|
+
let Tn;
|
|
1916
|
+
typeof HTMLElement == "function" && (Tn = class extends HTMLElement {
|
|
1917
1917
|
/**
|
|
1918
1918
|
* @param {*} $$componentCtor
|
|
1919
1919
|
* @param {*} $$slots
|
|
@@ -1952,8 +1952,8 @@ typeof HTMLElement == "function" && (hn = class extends HTMLElement {
|
|
|
1952
1952
|
*/
|
|
1953
1953
|
addEventListener(e, i, n) {
|
|
1954
1954
|
if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(i), this.$$c) {
|
|
1955
|
-
const
|
|
1956
|
-
this.$$l_u.set(i,
|
|
1955
|
+
const s = this.$$c.$on(e, i);
|
|
1956
|
+
this.$$l_u.set(i, s);
|
|
1957
1957
|
}
|
|
1958
1958
|
super.addEventListener(e, i, n);
|
|
1959
1959
|
}
|
|
@@ -1964,30 +1964,30 @@ typeof HTMLElement == "function" && (hn = class extends HTMLElement {
|
|
|
1964
1964
|
*/
|
|
1965
1965
|
removeEventListener(e, i, n) {
|
|
1966
1966
|
if (super.removeEventListener(e, i, n), this.$$c) {
|
|
1967
|
-
const
|
|
1968
|
-
|
|
1967
|
+
const s = this.$$l_u.get(i);
|
|
1968
|
+
s && (s(), this.$$l_u.delete(i));
|
|
1969
1969
|
}
|
|
1970
1970
|
}
|
|
1971
1971
|
async connectedCallback() {
|
|
1972
1972
|
if (this.$$cn = !0, !this.$$c) {
|
|
1973
|
-
let e = function(
|
|
1974
|
-
return (
|
|
1975
|
-
const o =
|
|
1976
|
-
|
|
1973
|
+
let e = function(s) {
|
|
1974
|
+
return (r) => {
|
|
1975
|
+
const o = rn("slot");
|
|
1976
|
+
s !== "default" && (o.name = s), bn(r, o);
|
|
1977
1977
|
};
|
|
1978
1978
|
};
|
|
1979
1979
|
if (await Promise.resolve(), !this.$$cn || this.$$c)
|
|
1980
1980
|
return;
|
|
1981
|
-
const i = {}, n =
|
|
1982
|
-
for (const
|
|
1983
|
-
|
|
1984
|
-
for (const
|
|
1985
|
-
const
|
|
1986
|
-
|
|
1981
|
+
const i = {}, n = Ks(this);
|
|
1982
|
+
for (const s of this.$$s)
|
|
1983
|
+
s in n && (s === "default" && !this.$$d.children ? (this.$$d.children = e(s), i.default = !0) : i[s] = e(s));
|
|
1984
|
+
for (const s of this.attributes) {
|
|
1985
|
+
const r = this.$$g_p(s.name);
|
|
1986
|
+
r in this.$$d || (this.$$d[r] = _t(r, s.value, this.$$p_d, "toProp"));
|
|
1987
1987
|
}
|
|
1988
|
-
for (const
|
|
1989
|
-
!(
|
|
1990
|
-
this.$$c =
|
|
1988
|
+
for (const s in this.$$p_d)
|
|
1989
|
+
!(s in this.$$d) && this[s] !== void 0 && (this.$$d[s] = this[s], delete this[s]);
|
|
1990
|
+
this.$$c = js({
|
|
1991
1991
|
component: this.$$ctor,
|
|
1992
1992
|
target: this.$$shadowRoot || this,
|
|
1993
1993
|
props: {
|
|
@@ -1995,27 +1995,27 @@ typeof HTMLElement == "function" && (hn = class extends HTMLElement {
|
|
|
1995
1995
|
$$slots: i,
|
|
1996
1996
|
$$host: this
|
|
1997
1997
|
}
|
|
1998
|
-
}), this.$$me =
|
|
1999
|
-
|
|
1998
|
+
}), this.$$me = As(() => {
|
|
1999
|
+
ti(() => {
|
|
2000
2000
|
this.$$r = !0;
|
|
2001
|
-
for (const
|
|
2002
|
-
if (!this.$$p_d[
|
|
2003
|
-
this.$$d[
|
|
2004
|
-
const
|
|
2005
|
-
|
|
2006
|
-
this.$$d[
|
|
2001
|
+
for (const s of Tt(this.$$c)) {
|
|
2002
|
+
if (!this.$$p_d[s]?.reflect) continue;
|
|
2003
|
+
this.$$d[s] = this.$$c[s];
|
|
2004
|
+
const r = _t(
|
|
2005
|
+
s,
|
|
2006
|
+
this.$$d[s],
|
|
2007
2007
|
this.$$p_d,
|
|
2008
2008
|
"toAttribute"
|
|
2009
2009
|
);
|
|
2010
|
-
|
|
2010
|
+
r == null ? this.removeAttribute(this.$$p_d[s].attribute || s) : this.setAttribute(this.$$p_d[s].attribute || s, r);
|
|
2011
2011
|
}
|
|
2012
2012
|
this.$$r = !1;
|
|
2013
2013
|
});
|
|
2014
2014
|
});
|
|
2015
|
-
for (const
|
|
2016
|
-
for (const
|
|
2017
|
-
const o = this.$$c.$on(
|
|
2018
|
-
this.$$l_u.set(
|
|
2015
|
+
for (const s in this.$$l)
|
|
2016
|
+
for (const r of this.$$l[s]) {
|
|
2017
|
+
const o = this.$$c.$on(s, r);
|
|
2018
|
+
this.$$l_u.set(r, o);
|
|
2019
2019
|
}
|
|
2020
2020
|
this.$$l = {};
|
|
2021
2021
|
}
|
|
@@ -2028,7 +2028,7 @@ typeof HTMLElement == "function" && (hn = class extends HTMLElement {
|
|
|
2028
2028
|
* @param {string} newValue
|
|
2029
2029
|
*/
|
|
2030
2030
|
attributeChangedCallback(e, i, n) {
|
|
2031
|
-
this.$$r || (e = this.$$g_p(e), this.$$d[e] =
|
|
2031
|
+
this.$$r || (e = this.$$g_p(e), this.$$d[e] = _t(e, n, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
|
|
2032
2032
|
}
|
|
2033
2033
|
disconnectedCallback() {
|
|
2034
2034
|
this.$$cn = !1, Promise.resolve().then(() => {
|
|
@@ -2039,17 +2039,17 @@ typeof HTMLElement == "function" && (hn = class extends HTMLElement {
|
|
|
2039
2039
|
* @param {string} attribute_name
|
|
2040
2040
|
*/
|
|
2041
2041
|
$$g_p(e) {
|
|
2042
|
-
return
|
|
2042
|
+
return Tt(this.$$p_d).find(
|
|
2043
2043
|
(i) => this.$$p_d[i].attribute === e || !this.$$p_d[i].attribute && i.toLowerCase() === e
|
|
2044
2044
|
) || e;
|
|
2045
2045
|
}
|
|
2046
2046
|
});
|
|
2047
|
-
function
|
|
2048
|
-
const
|
|
2049
|
-
if (e =
|
|
2047
|
+
function _t(t, e, i, n) {
|
|
2048
|
+
const s = i[t]?.type;
|
|
2049
|
+
if (e = s === "Boolean" && typeof e != "boolean" ? e != null : e, !n || !i[t])
|
|
2050
2050
|
return e;
|
|
2051
2051
|
if (n === "toAttribute")
|
|
2052
|
-
switch (
|
|
2052
|
+
switch (s) {
|
|
2053
2053
|
case "Object":
|
|
2054
2054
|
case "Array":
|
|
2055
2055
|
return e == null ? null : JSON.stringify(e);
|
|
@@ -2061,7 +2061,7 @@ function gt(t, e, i, n) {
|
|
|
2061
2061
|
return e;
|
|
2062
2062
|
}
|
|
2063
2063
|
else
|
|
2064
|
-
switch (
|
|
2064
|
+
switch (s) {
|
|
2065
2065
|
case "Object":
|
|
2066
2066
|
case "Array":
|
|
2067
2067
|
return e && JSON.parse(e);
|
|
@@ -2074,7 +2074,7 @@ function gt(t, e, i, n) {
|
|
|
2074
2074
|
return e;
|
|
2075
2075
|
}
|
|
2076
2076
|
}
|
|
2077
|
-
function
|
|
2077
|
+
function Ks(t) {
|
|
2078
2078
|
const e = {};
|
|
2079
2079
|
return t.childNodes.forEach((i) => {
|
|
2080
2080
|
e[
|
|
@@ -2083,33 +2083,33 @@ function Dr(t) {
|
|
|
2083
2083
|
] = !0;
|
|
2084
2084
|
}), e;
|
|
2085
2085
|
}
|
|
2086
|
-
function
|
|
2087
|
-
let o = class extends
|
|
2086
|
+
function zs(t, e, i, n, s, r) {
|
|
2087
|
+
let o = class extends Tn {
|
|
2088
2088
|
constructor() {
|
|
2089
|
-
super(t, i,
|
|
2089
|
+
super(t, i, s), this.$$p_d = e;
|
|
2090
2090
|
}
|
|
2091
2091
|
static get observedAttributes() {
|
|
2092
|
-
return
|
|
2092
|
+
return Tt(e).map(
|
|
2093
2093
|
(l) => (e[l].attribute || l).toLowerCase()
|
|
2094
2094
|
);
|
|
2095
2095
|
}
|
|
2096
2096
|
};
|
|
2097
|
-
return
|
|
2098
|
-
|
|
2097
|
+
return Tt(e).forEach((l) => {
|
|
2098
|
+
At(o.prototype, l, {
|
|
2099
2099
|
get() {
|
|
2100
2100
|
return this.$$c && l in this.$$c ? this.$$c[l] : this.$$d[l];
|
|
2101
2101
|
},
|
|
2102
2102
|
set(a) {
|
|
2103
|
-
a =
|
|
2103
|
+
a = _t(l, a, e), this.$$d[l] = a;
|
|
2104
2104
|
var u = this.$$c;
|
|
2105
2105
|
if (u) {
|
|
2106
|
-
var d =
|
|
2106
|
+
var d = Ge(u, l)?.get;
|
|
2107
2107
|
d ? u[l] = a : u.$set({ [l]: a });
|
|
2108
2108
|
}
|
|
2109
2109
|
}
|
|
2110
2110
|
});
|
|
2111
2111
|
}), n.forEach((l) => {
|
|
2112
|
-
|
|
2112
|
+
At(o.prototype, l, {
|
|
2113
2113
|
get() {
|
|
2114
2114
|
return this.$$c?.[l];
|
|
2115
2115
|
}
|
|
@@ -2117,17 +2117,17 @@ function Pr(t, e, i, n, r, s) {
|
|
|
2117
2117
|
}), t.element = /** @type {any} */
|
|
2118
2118
|
o, o;
|
|
2119
2119
|
}
|
|
2120
|
-
class
|
|
2121
|
-
constructor(i, n,
|
|
2120
|
+
class Ys extends Event {
|
|
2121
|
+
constructor(i, n, s, r) {
|
|
2122
2122
|
super("context-request", { bubbles: !0, composed: !0 });
|
|
2123
2123
|
f(this, "context");
|
|
2124
2124
|
f(this, "contextTarget");
|
|
2125
2125
|
f(this, "callback");
|
|
2126
2126
|
f(this, "subscribe");
|
|
2127
|
-
this.context = i, this.contextTarget = n, this.callback =
|
|
2127
|
+
this.context = i, this.contextTarget = n, this.callback = s, this.subscribe = r ?? !1;
|
|
2128
2128
|
}
|
|
2129
2129
|
}
|
|
2130
|
-
class
|
|
2130
|
+
class Us {
|
|
2131
2131
|
constructor(e, i) {
|
|
2132
2132
|
f(this, "host");
|
|
2133
2133
|
f(this, "context");
|
|
@@ -2151,57 +2151,65 @@ class jr {
|
|
|
2151
2151
|
return this.currentValue;
|
|
2152
2152
|
}
|
|
2153
2153
|
requestValue() {
|
|
2154
|
-
this.host.dispatchEvent(new
|
|
2154
|
+
this.host.dispatchEvent(new Ys(this.context, this.host, this.handleValue, this.subscribe));
|
|
2155
2155
|
}
|
|
2156
2156
|
}
|
|
2157
|
-
const
|
|
2158
|
-
function
|
|
2157
|
+
const An = (t) => t, xs = An(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), Xs = An(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext"));
|
|
2158
|
+
function In(t, e, i) {
|
|
2159
2159
|
let n = !1;
|
|
2160
|
-
const
|
|
2160
|
+
const s = new Us(t, {
|
|
2161
2161
|
context: e,
|
|
2162
2162
|
subscribe: !0,
|
|
2163
2163
|
onValue: (u) => {
|
|
2164
2164
|
n = !0, i(u);
|
|
2165
2165
|
}
|
|
2166
2166
|
});
|
|
2167
|
-
|
|
2168
|
-
const
|
|
2169
|
-
u.context === e &&
|
|
2167
|
+
s.connect();
|
|
2168
|
+
const r = (u) => {
|
|
2169
|
+
u.context === e && s.requestValue();
|
|
2170
2170
|
};
|
|
2171
|
-
t.addEventListener("context-provider",
|
|
2171
|
+
t.addEventListener("context-provider", r);
|
|
2172
2172
|
let o = 0;
|
|
2173
2173
|
const l = 200, a = globalThis.setInterval(() => {
|
|
2174
2174
|
if (n || o >= l) {
|
|
2175
2175
|
globalThis.clearInterval(a);
|
|
2176
2176
|
return;
|
|
2177
2177
|
}
|
|
2178
|
-
o += 1,
|
|
2178
|
+
o += 1, s.requestValue();
|
|
2179
2179
|
}, 50);
|
|
2180
2180
|
return () => {
|
|
2181
|
-
globalThis.clearInterval(a), t.removeEventListener("context-provider",
|
|
2181
|
+
globalThis.clearInterval(a), t.removeEventListener("context-provider", r), s.disconnect();
|
|
2182
2182
|
};
|
|
2183
2183
|
}
|
|
2184
|
-
function
|
|
2185
|
-
return
|
|
2184
|
+
function Ws(t, e) {
|
|
2185
|
+
return In(t, xs, e);
|
|
2186
2186
|
}
|
|
2187
|
-
function
|
|
2188
|
-
return
|
|
2187
|
+
function Qs(t, e) {
|
|
2188
|
+
return In(t, Xs, e);
|
|
2189
2189
|
}
|
|
2190
|
-
function
|
|
2191
|
-
return
|
|
2190
|
+
function Js(t, e) {
|
|
2191
|
+
return Ws(t, e);
|
|
2192
2192
|
}
|
|
2193
|
-
function
|
|
2194
|
-
return
|
|
2193
|
+
function Zs(t, e) {
|
|
2194
|
+
return Qs(t, e);
|
|
2195
2195
|
}
|
|
2196
|
-
var
|
|
2196
|
+
var _i;
|
|
2197
2197
|
(function(t) {
|
|
2198
2198
|
t.TTS_WORD = "tts-word", t.TTS_SENTENCE = "tts-sentence", t.ANNOTATION = "annotation";
|
|
2199
|
-
})(
|
|
2200
|
-
var
|
|
2199
|
+
})(_i || (_i = {}));
|
|
2200
|
+
var yi;
|
|
2201
2201
|
(function(t) {
|
|
2202
2202
|
t.YELLOW = "yellow", t.GREEN = "green", t.BLUE = "blue", t.PINK = "pink", t.ORANGE = "orange", t.UNDERLINE = "underline";
|
|
2203
|
-
})(
|
|
2204
|
-
|
|
2203
|
+
})(yi || (yi = {}));
|
|
2204
|
+
const er = {
|
|
2205
|
+
tts: "textToSpeech",
|
|
2206
|
+
colorScheme: "theme"
|
|
2207
|
+
};
|
|
2208
|
+
function tr(t) {
|
|
2209
|
+
const e = t.trim();
|
|
2210
|
+
return e ? er[e] || e : "";
|
|
2211
|
+
}
|
|
2212
|
+
class ir {
|
|
2205
2213
|
constructor() {
|
|
2206
2214
|
f(this, "tools", /* @__PURE__ */ new Map());
|
|
2207
2215
|
f(this, "pnpIndex", /* @__PURE__ */ new Map());
|
|
@@ -2215,7 +2223,7 @@ class Yr {
|
|
|
2215
2223
|
* Normalize a single tool alias to canonical toolId.
|
|
2216
2224
|
*/
|
|
2217
2225
|
normalizeToolId(e) {
|
|
2218
|
-
return e
|
|
2226
|
+
return tr(e);
|
|
2219
2227
|
}
|
|
2220
2228
|
/**
|
|
2221
2229
|
* Normalize a list of tool aliases to canonical toolIds.
|
|
@@ -2318,6 +2326,24 @@ class Yr {
|
|
|
2318
2326
|
getToolsByLevel(e) {
|
|
2319
2327
|
return this.getAllTools().filter((i) => i.supportedLevels.includes(e));
|
|
2320
2328
|
}
|
|
2329
|
+
/**
|
|
2330
|
+
* Resolve tool activation with backward-compatible defaults.
|
|
2331
|
+
*/
|
|
2332
|
+
getToolActivation(e) {
|
|
2333
|
+
return this.get(e)?.activation || "toolbar-toggle";
|
|
2334
|
+
}
|
|
2335
|
+
/**
|
|
2336
|
+
* Resolve singleton scope for a tool when present.
|
|
2337
|
+
*/
|
|
2338
|
+
getToolSingletonScope(e) {
|
|
2339
|
+
return this.get(e)?.singletonScope || null;
|
|
2340
|
+
}
|
|
2341
|
+
/**
|
|
2342
|
+
* Filter tool IDs by activation type.
|
|
2343
|
+
*/
|
|
2344
|
+
filterToolIdsByActivation(e, i) {
|
|
2345
|
+
return e.filter((n) => this.getToolActivation(n) === i);
|
|
2346
|
+
}
|
|
2321
2347
|
/**
|
|
2322
2348
|
* Filter tools by visibility in a given context
|
|
2323
2349
|
*
|
|
@@ -2330,17 +2356,17 @@ class Yr {
|
|
|
2330
2356
|
*/
|
|
2331
2357
|
filterVisibleInContext(e, i) {
|
|
2332
2358
|
const n = [];
|
|
2333
|
-
for (const
|
|
2334
|
-
const
|
|
2335
|
-
if (!
|
|
2336
|
-
console.warn(`Tool '${
|
|
2359
|
+
for (const s of e) {
|
|
2360
|
+
const r = this.get(s);
|
|
2361
|
+
if (!r) {
|
|
2362
|
+
console.warn(`Tool '${s}' is allowed but not registered`);
|
|
2337
2363
|
continue;
|
|
2338
2364
|
}
|
|
2339
|
-
if (
|
|
2365
|
+
if (r.supportedLevels.includes(i.level))
|
|
2340
2366
|
try {
|
|
2341
|
-
|
|
2367
|
+
r.isVisibleInContext(i) && n.push(r);
|
|
2342
2368
|
} catch (o) {
|
|
2343
|
-
console.error(`Error evaluating visibility for tool '${
|
|
2369
|
+
console.error(`Error evaluating visibility for tool '${s}':`, o);
|
|
2344
2370
|
}
|
|
2345
2371
|
}
|
|
2346
2372
|
return n;
|
|
@@ -2357,7 +2383,9 @@ class Yr {
|
|
|
2357
2383
|
name: e.name,
|
|
2358
2384
|
description: e.description,
|
|
2359
2385
|
pnpSupportIds: e.pnpSupportIds || [],
|
|
2360
|
-
supportedLevels: e.supportedLevels
|
|
2386
|
+
supportedLevels: e.supportedLevels,
|
|
2387
|
+
activation: e.activation || "toolbar-toggle",
|
|
2388
|
+
singletonScope: e.singletonScope || null
|
|
2361
2389
|
}));
|
|
2362
2390
|
}
|
|
2363
2391
|
/**
|
|
@@ -2370,10 +2398,10 @@ class Yr {
|
|
|
2370
2398
|
generatePNPSupportsFromTools(e) {
|
|
2371
2399
|
const i = /* @__PURE__ */ new Set();
|
|
2372
2400
|
for (const n of e) {
|
|
2373
|
-
const
|
|
2374
|
-
if (
|
|
2375
|
-
for (const
|
|
2376
|
-
i.add(
|
|
2401
|
+
const s = this.get(n);
|
|
2402
|
+
if (s?.pnpSupportIds)
|
|
2403
|
+
for (const r of s.pnpSupportIds)
|
|
2404
|
+
i.add(r);
|
|
2377
2405
|
}
|
|
2378
2406
|
return Array.from(i);
|
|
2379
2407
|
}
|
|
@@ -2412,12 +2440,12 @@ class Yr {
|
|
|
2412
2440
|
const n = this.moduleLoaders.get(e);
|
|
2413
2441
|
if (!n)
|
|
2414
2442
|
return;
|
|
2415
|
-
const
|
|
2443
|
+
const s = (async () => {
|
|
2416
2444
|
await n(), this.loadedToolModules.add(e);
|
|
2417
2445
|
})();
|
|
2418
|
-
this.moduleLoadPromises.set(e,
|
|
2446
|
+
this.moduleLoadPromises.set(e, s);
|
|
2419
2447
|
try {
|
|
2420
|
-
await
|
|
2448
|
+
await s;
|
|
2421
2449
|
} finally {
|
|
2422
2450
|
this.moduleLoadPromises.delete(e);
|
|
2423
2451
|
}
|
|
@@ -2438,39 +2466,39 @@ class Yr {
|
|
|
2438
2466
|
* Render a tool for toolbar use with component overrides attached.
|
|
2439
2467
|
*/
|
|
2440
2468
|
renderForToolbar(e, i, n) {
|
|
2441
|
-
const
|
|
2442
|
-
if (!
|
|
2469
|
+
const s = this.get(e);
|
|
2470
|
+
if (!s)
|
|
2443
2471
|
throw new Error(`Tool '${e}' is not registered`);
|
|
2444
|
-
const
|
|
2472
|
+
const r = {
|
|
2445
2473
|
...n,
|
|
2446
2474
|
componentOverrides: {
|
|
2447
2475
|
...this.componentOverrides || {},
|
|
2448
2476
|
...n.componentOverrides || {}
|
|
2449
2477
|
}
|
|
2450
2478
|
};
|
|
2451
|
-
return
|
|
2479
|
+
return s.renderToolbar(i, r);
|
|
2452
2480
|
}
|
|
2453
2481
|
}
|
|
2454
|
-
function
|
|
2482
|
+
function En(t) {
|
|
2455
2483
|
return t.level === "item";
|
|
2456
2484
|
}
|
|
2457
|
-
function
|
|
2485
|
+
function nr(t) {
|
|
2458
2486
|
return t.level === "passage";
|
|
2459
2487
|
}
|
|
2460
|
-
function
|
|
2488
|
+
function sr(t) {
|
|
2461
2489
|
return t.level === "rubric";
|
|
2462
2490
|
}
|
|
2463
|
-
function
|
|
2491
|
+
function wn(t) {
|
|
2464
2492
|
return t.level === "element";
|
|
2465
2493
|
}
|
|
2466
|
-
function
|
|
2467
|
-
if (
|
|
2494
|
+
function si(t) {
|
|
2495
|
+
if (wn(t)) {
|
|
2468
2496
|
const e = t.item.config;
|
|
2469
2497
|
if (!e)
|
|
2470
2498
|
return "";
|
|
2471
|
-
const i = [], n = (a) => a.replace(/<[^>]*>/g, " ").trim(),
|
|
2472
|
-
|
|
2473
|
-
const
|
|
2499
|
+
const i = [], n = (a) => a.replace(/<[^>]*>/g, " ").trim(), s = e.elements?.[t.elementId];
|
|
2500
|
+
s && typeof s == "string" && i.push(n(s));
|
|
2501
|
+
const r = e.models, l = (Array.isArray(r) ? r : r && typeof r == "object" ? Object.values(r) : []).find((a) => a && typeof a == "object" && a.id === t.elementId);
|
|
2474
2502
|
if (l) {
|
|
2475
2503
|
for (const a of Object.values(l))
|
|
2476
2504
|
if (typeof a == "string" && i.push(n(a)), Array.isArray(a)) {
|
|
@@ -2482,41 +2510,60 @@ function Qt(t) {
|
|
|
2482
2510
|
}
|
|
2483
2511
|
return i.filter(Boolean).join(" ").trim();
|
|
2484
2512
|
}
|
|
2485
|
-
if (
|
|
2513
|
+
if (En(t)) {
|
|
2486
2514
|
const e = t.item;
|
|
2487
2515
|
if (!e?.config)
|
|
2488
2516
|
return "";
|
|
2489
|
-
const i = e.config, n = [],
|
|
2490
|
-
typeof i.markup == "string" && n.push(
|
|
2491
|
-
const
|
|
2492
|
-
if (
|
|
2493
|
-
for (const a of Object.values(
|
|
2494
|
-
typeof a == "string" && n.push(
|
|
2517
|
+
const i = e.config, n = [], s = (a) => a.replace(/<[^>]*>/g, " ").trim();
|
|
2518
|
+
typeof i.markup == "string" && n.push(s(i.markup));
|
|
2519
|
+
const r = i.elements;
|
|
2520
|
+
if (r && typeof r == "object")
|
|
2521
|
+
for (const a of Object.values(r))
|
|
2522
|
+
typeof a == "string" && n.push(s(a));
|
|
2495
2523
|
const o = i.models, l = Array.isArray(o) ? o : o && typeof o == "object" ? Object.values(o) : [];
|
|
2496
2524
|
for (const a of l)
|
|
2497
2525
|
if (!(!a || typeof a != "object")) {
|
|
2498
2526
|
for (const u of Object.values(a))
|
|
2499
|
-
if (typeof u == "string" && n.push(
|
|
2527
|
+
if (typeof u == "string" && n.push(s(u)), Array.isArray(u)) {
|
|
2500
2528
|
for (const d of u)
|
|
2501
2529
|
if (d && typeof d == "object")
|
|
2502
|
-
for (const
|
|
2503
|
-
typeof
|
|
2530
|
+
for (const v of Object.values(d))
|
|
2531
|
+
typeof v == "string" && n.push(s(v));
|
|
2504
2532
|
}
|
|
2505
2533
|
}
|
|
2506
2534
|
return n.filter(Boolean).join(" ").trim();
|
|
2507
2535
|
}
|
|
2508
|
-
if (
|
|
2536
|
+
if (nr(t)) {
|
|
2509
2537
|
const e = t.passage;
|
|
2510
|
-
|
|
2538
|
+
if (!e?.config)
|
|
2539
|
+
return "";
|
|
2540
|
+
const i = e.config, n = [], s = (a) => a.replace(/<[^>]*>/g, " ").trim();
|
|
2541
|
+
typeof i.markup == "string" && n.push(s(i.markup)), typeof i.content == "string" && n.push(s(i.content)), typeof i.prompt == "string" && n.push(s(i.prompt));
|
|
2542
|
+
const r = i.elements;
|
|
2543
|
+
if (r && typeof r == "object")
|
|
2544
|
+
for (const a of Object.values(r))
|
|
2545
|
+
typeof a == "string" && n.push(s(a));
|
|
2546
|
+
const o = i.models, l = Array.isArray(o) ? o : o && typeof o == "object" ? Object.values(o) : [];
|
|
2547
|
+
for (const a of l)
|
|
2548
|
+
if (!(!a || typeof a != "object")) {
|
|
2549
|
+
for (const u of Object.values(a))
|
|
2550
|
+
if (typeof u == "string" && n.push(s(u)), Array.isArray(u)) {
|
|
2551
|
+
for (const d of u)
|
|
2552
|
+
if (d && typeof d == "object")
|
|
2553
|
+
for (const v of Object.values(d))
|
|
2554
|
+
typeof v == "string" && n.push(s(v));
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
return n.filter(Boolean).join(" ").trim();
|
|
2511
2558
|
}
|
|
2512
|
-
if (
|
|
2559
|
+
if (sr(t)) {
|
|
2513
2560
|
const e = t.rubricBlock;
|
|
2514
2561
|
return e.passage?.config ? (e.passage.config.markup || "").replace(/<[^>]*>/g, " ").trim() : (e.content || "").replace(/<[^>]*>/g, " ").trim();
|
|
2515
2562
|
}
|
|
2516
2563
|
return "";
|
|
2517
2564
|
}
|
|
2518
|
-
function
|
|
2519
|
-
const e =
|
|
2565
|
+
function Rt(t) {
|
|
2566
|
+
const e = si(t);
|
|
2520
2567
|
return [
|
|
2521
2568
|
/<math[>\s]/i,
|
|
2522
2569
|
// MathML
|
|
@@ -2532,7 +2579,7 @@ function It(t) {
|
|
|
2532
2579
|
// Simple arithmetic
|
|
2533
2580
|
].some((n) => n.test(e));
|
|
2534
2581
|
}
|
|
2535
|
-
function
|
|
2582
|
+
function rr(t) {
|
|
2536
2583
|
const e = [
|
|
2537
2584
|
"pie-multiple-choice",
|
|
2538
2585
|
"pie-inline-choice",
|
|
@@ -2541,32 +2588,32 @@ function Qr(t) {
|
|
|
2541
2588
|
"inline-choice",
|
|
2542
2589
|
"select-text"
|
|
2543
2590
|
];
|
|
2544
|
-
if (
|
|
2591
|
+
if (wn(t)) {
|
|
2545
2592
|
const i = t.item.config;
|
|
2546
2593
|
if (!i?.models)
|
|
2547
2594
|
return !1;
|
|
2548
|
-
const
|
|
2549
|
-
if (!
|
|
2595
|
+
const s = (Array.isArray(i.models) ? i.models : Object.values(i.models)).find((o) => o && typeof o == "object" && o.id === t.elementId);
|
|
2596
|
+
if (!s)
|
|
2550
2597
|
return !1;
|
|
2551
|
-
const
|
|
2552
|
-
return e.includes(
|
|
2598
|
+
const r = s.element || "";
|
|
2599
|
+
return e.includes(r);
|
|
2553
2600
|
}
|
|
2554
|
-
if (
|
|
2601
|
+
if (En(t)) {
|
|
2555
2602
|
const i = t.item.config?.models;
|
|
2556
|
-
return (Array.isArray(i) ? i : i && typeof i == "object" ? Object.values(i) : []).some((
|
|
2557
|
-
if (!
|
|
2603
|
+
return (Array.isArray(i) ? i : i && typeof i == "object" ? Object.values(i) : []).some((s) => {
|
|
2604
|
+
if (!s || typeof s != "object")
|
|
2558
2605
|
return !1;
|
|
2559
|
-
const
|
|
2560
|
-
return e.includes(
|
|
2606
|
+
const r = s.element || "";
|
|
2607
|
+
return e.includes(r) ? !0 : Array.isArray(s.choices) && s.choices.length > 0;
|
|
2561
2608
|
});
|
|
2562
2609
|
}
|
|
2563
2610
|
return !1;
|
|
2564
2611
|
}
|
|
2565
|
-
function
|
|
2566
|
-
return
|
|
2612
|
+
function Ot(t) {
|
|
2613
|
+
return si(t).trim().length >= 10;
|
|
2567
2614
|
}
|
|
2568
|
-
function
|
|
2569
|
-
const e =
|
|
2615
|
+
function or(t) {
|
|
2616
|
+
const e = si(t);
|
|
2570
2617
|
return [
|
|
2571
2618
|
/chemistry|chemical|element|atom|molecule|compound/i,
|
|
2572
2619
|
/periodic\s+table/i,
|
|
@@ -2578,25 +2625,25 @@ function Jr(t) {
|
|
|
2578
2625
|
/physics|force|energy|velocity|acceleration/i
|
|
2579
2626
|
].some((n) => n.test(e));
|
|
2580
2627
|
}
|
|
2581
|
-
const
|
|
2628
|
+
const lr = [
|
|
2582
2629
|
"assessment",
|
|
2583
2630
|
"section",
|
|
2584
2631
|
"item",
|
|
2585
2632
|
"passage",
|
|
2586
2633
|
"rubric"
|
|
2587
|
-
],
|
|
2588
|
-
function
|
|
2589
|
-
return
|
|
2634
|
+
], ar = new Set(lr);
|
|
2635
|
+
function cr(t) {
|
|
2636
|
+
return ar.has(t);
|
|
2590
2637
|
}
|
|
2591
|
-
function
|
|
2592
|
-
const
|
|
2593
|
-
if (!
|
|
2638
|
+
function ie(t, e, i) {
|
|
2639
|
+
const n = t.trim(), s = i.trim();
|
|
2640
|
+
if (!n || !s)
|
|
2594
2641
|
throw new Error("Tool instance ids require non-empty tool and scope ids");
|
|
2595
|
-
if (!
|
|
2642
|
+
if (!cr(e))
|
|
2596
2643
|
throw new Error(`Unknown tool scope level '${e}'. Register custom levels with registerToolScopeLevel().`);
|
|
2597
|
-
return
|
|
2644
|
+
return `${n}:${e}:${s}`;
|
|
2598
2645
|
}
|
|
2599
|
-
const
|
|
2646
|
+
const ur = /* @__PURE__ */ new Set([
|
|
2600
2647
|
"annotation-xml",
|
|
2601
2648
|
"color-profile",
|
|
2602
2649
|
"font-face",
|
|
@@ -2605,7 +2652,7 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2605
2652
|
"font-face-format",
|
|
2606
2653
|
"font-face-name",
|
|
2607
2654
|
"missing-glyph"
|
|
2608
|
-
]),
|
|
2655
|
+
]), fr = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, dr = (t, e = "custom element tag") => {
|
|
2609
2656
|
if (!t || typeof t != "string")
|
|
2610
2657
|
throw new Error(`Invalid ${e}: expected a non-empty string`);
|
|
2611
2658
|
const i = t.trim();
|
|
@@ -2615,12 +2662,12 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2615
2662
|
throw new Error(`Invalid ${e} "${i}": custom element names must be lowercase`);
|
|
2616
2663
|
if (!i.includes("-"))
|
|
2617
2664
|
throw new Error(`Invalid ${e} "${i}": custom element names must include a hyphen`);
|
|
2618
|
-
if (
|
|
2665
|
+
if (ur.has(i))
|
|
2619
2666
|
throw new Error(`Invalid ${e} "${i}": this name is reserved by the HTML spec`);
|
|
2620
|
-
if (!
|
|
2667
|
+
if (!fr.test(i))
|
|
2621
2668
|
throw new Error(`Invalid ${e} "${i}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
|
|
2622
2669
|
return i;
|
|
2623
|
-
},
|
|
2670
|
+
}, Sn = {
|
|
2624
2671
|
calculator: "pie-tool-calculator",
|
|
2625
2672
|
textToSpeech: "pie-tool-text-to-speech",
|
|
2626
2673
|
ruler: "pie-tool-ruler",
|
|
@@ -2628,17 +2675,18 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2628
2675
|
answerEliminator: "pie-tool-answer-eliminator",
|
|
2629
2676
|
highlighter: "pie-tool-annotation-toolbar",
|
|
2630
2677
|
lineReader: "pie-tool-line-reader",
|
|
2631
|
-
|
|
2678
|
+
theme: "pie-tool-theme",
|
|
2679
|
+
colorScheme: "pie-tool-theme",
|
|
2632
2680
|
annotationToolbar: "pie-tool-annotation-toolbar",
|
|
2633
2681
|
graph: "pie-tool-graph",
|
|
2634
2682
|
periodicTable: "pie-tool-periodic-table"
|
|
2635
|
-
},
|
|
2636
|
-
const i = e?.toolTagMap?.[t] ??
|
|
2637
|
-
return
|
|
2638
|
-
},
|
|
2639
|
-
const
|
|
2640
|
-
return o ? o({ toolId: t, tagName:
|
|
2641
|
-
},
|
|
2683
|
+
}, hr = (t, e) => {
|
|
2684
|
+
const i = e?.toolTagMap?.[t] ?? Sn[t] ?? t;
|
|
2685
|
+
return dr(i, `tool component tag for "${t}"`);
|
|
2686
|
+
}, pr = (t) => document.createElement(t), ce = (t, e, i, n) => {
|
|
2687
|
+
const s = hr(t, n), o = n?.toolComponentFactories?.[t] ?? n?.toolComponentFactory;
|
|
2688
|
+
return o ? o({ toolId: t, tagName: s, context: e, toolbarContext: i }) : pr(s);
|
|
2689
|
+
}, gr = {
|
|
2642
2690
|
toolId: "calculator",
|
|
2643
2691
|
name: "Calculator",
|
|
2644
2692
|
description: "Multi-type calculator (basic, scientific, graphing)",
|
|
@@ -2664,20 +2712,28 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2664
2712
|
* (MathML, LaTeX, arithmetic markers).
|
|
2665
2713
|
*/
|
|
2666
2714
|
isVisibleInContext(t) {
|
|
2667
|
-
return
|
|
2715
|
+
return Rt(t);
|
|
2668
2716
|
},
|
|
2669
2717
|
renderToolbar(t, e) {
|
|
2670
|
-
const i =
|
|
2671
|
-
|
|
2672
|
-
const
|
|
2673
|
-
|
|
2718
|
+
const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = e.componentOverrides, s = ce(this.toolId, t, e, n);
|
|
2719
|
+
s.setAttribute("tool-id", i);
|
|
2720
|
+
const r = {
|
|
2721
|
+
toolId: this.toolId,
|
|
2722
|
+
label: this.name,
|
|
2723
|
+
icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
|
|
2724
|
+
disabled: !1,
|
|
2725
|
+
ariaLabel: "Open scientific calculator",
|
|
2726
|
+
tooltip: "Calculator",
|
|
2727
|
+
onClick: () => e.toggleTool(this.toolId),
|
|
2728
|
+
active: e.isToolVisible(i)
|
|
2729
|
+
};
|
|
2730
|
+
return {
|
|
2674
2731
|
toolId: this.toolId,
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
button: null,
|
|
2732
|
+
elements: [{ element: s, mount: "after-buttons" }],
|
|
2733
|
+
button: r,
|
|
2678
2734
|
sync: () => {
|
|
2679
2735
|
const o = e.isToolVisible(i);
|
|
2680
|
-
r.visible = o;
|
|
2736
|
+
r.active = o, r.ariaLabel = o ? "Close scientific calculator" : "Open scientific calculator", r.tooltip = o ? "Close calculator" : "Calculator", s.visible = o;
|
|
2681
2737
|
},
|
|
2682
2738
|
subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
|
|
2683
2739
|
o(e.isToolVisible(i));
|
|
@@ -2685,7 +2741,7 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2685
2741
|
}
|
|
2686
2742
|
};
|
|
2687
2743
|
}
|
|
2688
|
-
},
|
|
2744
|
+
}, mr = {
|
|
2689
2745
|
toolId: "textToSpeech",
|
|
2690
2746
|
name: "Text to Speech",
|
|
2691
2747
|
description: "Read content aloud",
|
|
@@ -2711,23 +2767,115 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2711
2767
|
* - Context contains readable text (at least 10 characters)
|
|
2712
2768
|
*/
|
|
2713
2769
|
isVisibleInContext(t) {
|
|
2714
|
-
return
|
|
2770
|
+
return Ot(t);
|
|
2715
2771
|
},
|
|
2716
2772
|
renderToolbar(t, e) {
|
|
2717
|
-
|
|
2718
|
-
n.
|
|
2719
|
-
|
|
2773
|
+
let i = null;
|
|
2774
|
+
const n = e.ttsService, s = ie(this.toolId, e.scope.level, e.scope.scopeId), r = () => e.isToolVisible(s), o = {
|
|
2775
|
+
toolId: this.toolId,
|
|
2776
|
+
label: "Read aloud",
|
|
2777
|
+
icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
|
|
2778
|
+
ariaLabel: "Read aloud",
|
|
2779
|
+
tooltip: "Read aloud",
|
|
2780
|
+
onClick: () => {
|
|
2781
|
+
p();
|
|
2782
|
+
},
|
|
2783
|
+
disabled: !1,
|
|
2784
|
+
active: !1
|
|
2785
|
+
}, l = () => {
|
|
2786
|
+
const g = r() ? "Stop reading" : "Read aloud";
|
|
2787
|
+
o.label = g, o.ariaLabel = g, o.tooltip = g, o.active = r(), o.disabled = !e.ttsService;
|
|
2788
|
+
}, a = (g) => {
|
|
2789
|
+
(g === "idle" || g === "error") && r() && (e.toggleTool(this.toolId), l());
|
|
2790
|
+
}, u = async () => {
|
|
2791
|
+
e.ensureTTSReady && (i || (i = (async () => {
|
|
2792
|
+
await e.ensureTTSReady?.(), e.toolkitCoordinator?.highlightCoordinator && n?.setHighlightCoordinator?.(e.toolkitCoordinator.highlightCoordinator);
|
|
2793
|
+
})()), await i);
|
|
2794
|
+
}, d = () => {
|
|
2795
|
+
n?.stop?.(), r() && e.toggleTool(this.toolId), l();
|
|
2796
|
+
}, v = () => {
|
|
2797
|
+
const g = e.getScopeElement?.();
|
|
2798
|
+
if (g)
|
|
2799
|
+
return g;
|
|
2800
|
+
const h = (S) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(S) : S.replace(/"/g, '\\"'), T = [
|
|
2801
|
+
e.catalogId,
|
|
2802
|
+
e.scope.itemId,
|
|
2803
|
+
e.scope.canonicalItemId
|
|
2804
|
+
].filter((S) => typeof S == "string" && S.length > 0), b = [];
|
|
2805
|
+
for (const S of T) {
|
|
2806
|
+
const L = h(S);
|
|
2807
|
+
e.scope.level === "passage" && b.push(`pie-passage-shell[item-id="${L}"] [data-region="content"]`), b.push(`pie-item-shell[item-id="${L}"] [data-region="content"]`);
|
|
2808
|
+
}
|
|
2809
|
+
b.push("[data-region='content']");
|
|
2810
|
+
for (const S of b) {
|
|
2811
|
+
const L = document.querySelector(S);
|
|
2812
|
+
if (L instanceof HTMLElement)
|
|
2813
|
+
return L;
|
|
2814
|
+
}
|
|
2815
|
+
return null;
|
|
2816
|
+
}, p = async () => {
|
|
2817
|
+
if (!n?.speak || !e.ttsService)
|
|
2818
|
+
return;
|
|
2819
|
+
if (r()) {
|
|
2820
|
+
d();
|
|
2821
|
+
return;
|
|
2822
|
+
}
|
|
2823
|
+
const g = v();
|
|
2824
|
+
if (!g)
|
|
2825
|
+
return;
|
|
2826
|
+
const h = g.textContent || "";
|
|
2827
|
+
if (h.trim())
|
|
2828
|
+
try {
|
|
2829
|
+
r() || e.toggleTool(this.toolId), l(), await u(), n.setRootElement?.(g), n.speak(h, {
|
|
2830
|
+
// For passage-level TTS, use rendered DOM text as the source of truth.
|
|
2831
|
+
// Catalog/SSML content can diverge from rendered text and break
|
|
2832
|
+
// word-boundary-to-DOM mapping for progressive yellow highlighting.
|
|
2833
|
+
catalogId: e.scope.level === "passage" ? void 0 : e.catalogId || e.itemId,
|
|
2834
|
+
language: e.language,
|
|
2835
|
+
contentElement: g
|
|
2836
|
+
}).catch((T) => {
|
|
2837
|
+
console.error("[ttsToolRegistration] Failed to start reading:", T), l();
|
|
2838
|
+
}), l();
|
|
2839
|
+
} catch (T) {
|
|
2840
|
+
l(), console.error("[ttsToolRegistration] Failed to start reading:", T);
|
|
2841
|
+
}
|
|
2842
|
+
};
|
|
2720
2843
|
return {
|
|
2721
2844
|
toolId: this.toolId,
|
|
2722
|
-
|
|
2845
|
+
button: o,
|
|
2723
2846
|
sync: () => {
|
|
2724
|
-
|
|
2725
|
-
console.error("[ttsToolRegistration] Failed to initialize TTS service:",
|
|
2726
|
-
})
|
|
2847
|
+
l(), e.ensureTTSReady && u().catch((g) => {
|
|
2848
|
+
console.error("[ttsToolRegistration] Failed to initialize TTS service:", g);
|
|
2849
|
+
});
|
|
2850
|
+
},
|
|
2851
|
+
subscribeActive: (g) => {
|
|
2852
|
+
const h = [];
|
|
2853
|
+
if (e.subscribeVisibility) {
|
|
2854
|
+
const T = e.subscribeVisibility(() => {
|
|
2855
|
+
const b = r();
|
|
2856
|
+
l(), g(b);
|
|
2857
|
+
});
|
|
2858
|
+
h.push(T);
|
|
2859
|
+
}
|
|
2860
|
+
if (e.ttsService) {
|
|
2861
|
+
const T = `tts-toolbar:${s}`, b = (S) => {
|
|
2862
|
+
a(String(S || ""));
|
|
2863
|
+
const L = r();
|
|
2864
|
+
l(), g(L);
|
|
2865
|
+
};
|
|
2866
|
+
e.ttsService.onStateChange(T, b), h.push(() => {
|
|
2867
|
+
e.ttsService?.offStateChange(T, b);
|
|
2868
|
+
});
|
|
2869
|
+
}
|
|
2870
|
+
return h.length === 0 ? () => {
|
|
2871
|
+
} : () => {
|
|
2872
|
+
for (const T of h)
|
|
2873
|
+
T();
|
|
2874
|
+
};
|
|
2727
2875
|
}
|
|
2728
2876
|
};
|
|
2729
2877
|
}
|
|
2730
|
-
},
|
|
2878
|
+
}, vr = {
|
|
2731
2879
|
toolId: "ruler",
|
|
2732
2880
|
name: "Ruler",
|
|
2733
2881
|
description: "On-screen ruler for measurements",
|
|
@@ -2746,10 +2894,10 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2746
2894
|
* Pass 2: Ruler is relevant when math content is present
|
|
2747
2895
|
*/
|
|
2748
2896
|
isVisibleInContext(t) {
|
|
2749
|
-
return
|
|
2897
|
+
return Rt(t);
|
|
2750
2898
|
},
|
|
2751
2899
|
renderToolbar(t, e) {
|
|
2752
|
-
const i =
|
|
2900
|
+
const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
|
|
2753
2901
|
toolId: this.toolId,
|
|
2754
2902
|
label: this.name,
|
|
2755
2903
|
icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
|
|
@@ -2758,14 +2906,14 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2758
2906
|
tooltip: "Ruler",
|
|
2759
2907
|
onClick: () => e.toggleTool(this.toolId),
|
|
2760
2908
|
active: e.isToolVisible(i)
|
|
2761
|
-
},
|
|
2762
|
-
return
|
|
2909
|
+
}, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
|
|
2910
|
+
return r.setAttribute("tool-id", i), {
|
|
2763
2911
|
toolId: this.toolId,
|
|
2764
2912
|
button: n,
|
|
2765
|
-
|
|
2913
|
+
elements: [{ element: r, mount: "after-buttons" }],
|
|
2766
2914
|
sync: () => {
|
|
2767
2915
|
const o = e.isToolVisible(i);
|
|
2768
|
-
n.active = o,
|
|
2916
|
+
n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
|
|
2769
2917
|
},
|
|
2770
2918
|
subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
|
|
2771
2919
|
o(e.isToolVisible(i));
|
|
@@ -2773,7 +2921,7 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2773
2921
|
}
|
|
2774
2922
|
};
|
|
2775
2923
|
}
|
|
2776
|
-
},
|
|
2924
|
+
}, br = {
|
|
2777
2925
|
toolId: "protractor",
|
|
2778
2926
|
name: "Protractor",
|
|
2779
2927
|
description: "On-screen protractor for angle measurements",
|
|
@@ -2792,10 +2940,10 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2792
2940
|
* Pass 2: Protractor is relevant when math content is present
|
|
2793
2941
|
*/
|
|
2794
2942
|
isVisibleInContext(t) {
|
|
2795
|
-
return
|
|
2943
|
+
return Rt(t);
|
|
2796
2944
|
},
|
|
2797
2945
|
renderToolbar(t, e) {
|
|
2798
|
-
const i =
|
|
2946
|
+
const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
|
|
2799
2947
|
toolId: this.toolId,
|
|
2800
2948
|
label: this.name,
|
|
2801
2949
|
icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
|
|
@@ -2804,14 +2952,14 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2804
2952
|
tooltip: "Protractor",
|
|
2805
2953
|
onClick: () => e.toggleTool(this.toolId),
|
|
2806
2954
|
active: e.isToolVisible(i)
|
|
2807
|
-
},
|
|
2808
|
-
return
|
|
2955
|
+
}, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
|
|
2956
|
+
return r.setAttribute("tool-id", i), {
|
|
2809
2957
|
toolId: this.toolId,
|
|
2810
2958
|
button: n,
|
|
2811
|
-
|
|
2959
|
+
elements: [{ element: r, mount: "after-buttons" }],
|
|
2812
2960
|
sync: () => {
|
|
2813
2961
|
const o = e.isToolVisible(i);
|
|
2814
|
-
n.active = o,
|
|
2962
|
+
n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
|
|
2815
2963
|
},
|
|
2816
2964
|
subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
|
|
2817
2965
|
o(e.isToolVisible(i));
|
|
@@ -2819,7 +2967,7 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2819
2967
|
}
|
|
2820
2968
|
};
|
|
2821
2969
|
}
|
|
2822
|
-
},
|
|
2970
|
+
}, _r = {
|
|
2823
2971
|
toolId: "answerEliminator",
|
|
2824
2972
|
name: "Answer Eliminator",
|
|
2825
2973
|
description: "Strike through answer choices",
|
|
@@ -2842,12 +2990,12 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2842
2990
|
* Pass 2: Answer eliminator is relevant only for choice-based questions
|
|
2843
2991
|
*/
|
|
2844
2992
|
isVisibleInContext(t) {
|
|
2845
|
-
return
|
|
2993
|
+
return rr(t);
|
|
2846
2994
|
},
|
|
2847
2995
|
renderToolbar(t, e) {
|
|
2848
|
-
const i =
|
|
2849
|
-
|
|
2850
|
-
const
|
|
2996
|
+
const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = e.componentOverrides ?? {}, s = ce(this.toolId, t, e, n);
|
|
2997
|
+
s.setAttribute("tool-id", i), s.setAttribute("strategy", "strikethrough"), s.setAttribute("button-alignment", "inline");
|
|
2998
|
+
const r = {
|
|
2851
2999
|
toolId: this.toolId,
|
|
2852
3000
|
label: this.name,
|
|
2853
3001
|
icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="currentColor" aria-hidden="true"><path d="M19,3H16.3H7.7H5A2,2 0 0,0 3,5V7.7V16.4V19A2,2 0 0,0 5,21H7.7H16.4H19A2,2 0 0,0 21,19V16.3V7.7V5A2,2 0 0,0 19,3M15.6,17L12,13.4L8.4,17L7,15.6L10.6,12L7,8.4L8.4,7L12,10.6L15.6,7L17,8.4L13.4,12L17,15.6L15.6,17Z"/></svg>',
|
|
@@ -2859,13 +3007,13 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2859
3007
|
};
|
|
2860
3008
|
return {
|
|
2861
3009
|
toolId: this.toolId,
|
|
2862
|
-
button:
|
|
2863
|
-
|
|
3010
|
+
button: r,
|
|
3011
|
+
elements: [{ element: s, mount: "after-buttons" }],
|
|
2864
3012
|
sync: () => {
|
|
2865
3013
|
const o = e.isToolVisible(i);
|
|
2866
|
-
|
|
3014
|
+
r.active = o, s.visible = o, e.toolCoordinator && (s.coordinator = e.toolCoordinator), s.scopeElement = e.getScopeElement?.() || null, e.elementToolStateStore && (s.elementToolStateStore = e.elementToolStateStore);
|
|
2867
3015
|
const l = e.getGlobalElementId?.();
|
|
2868
|
-
l && (
|
|
3016
|
+
l && (s.globalElementId = l);
|
|
2869
3017
|
},
|
|
2870
3018
|
subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
|
|
2871
3019
|
o(e.isToolVisible(i));
|
|
@@ -2873,11 +3021,12 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2873
3021
|
}
|
|
2874
3022
|
};
|
|
2875
3023
|
}
|
|
2876
|
-
},
|
|
3024
|
+
}, yr = {
|
|
2877
3025
|
toolId: "highlighter",
|
|
2878
3026
|
name: "Highlighter",
|
|
2879
3027
|
description: "Highlight text",
|
|
2880
3028
|
icon: "highlighter",
|
|
3029
|
+
activation: "toolbar-toggle",
|
|
2881
3030
|
// Highlighter appears at passage, rubric, item, and element levels
|
|
2882
3031
|
supportedLevels: ["passage", "rubric", "item", "element"],
|
|
2883
3032
|
// PNP support IDs
|
|
@@ -2886,10 +3035,10 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2886
3035
|
* Pass 2: Highlighter is relevant when readable text is available
|
|
2887
3036
|
*/
|
|
2888
3037
|
isVisibleInContext(t) {
|
|
2889
|
-
return
|
|
3038
|
+
return Ot(t);
|
|
2890
3039
|
},
|
|
2891
3040
|
renderToolbar(t, e) {
|
|
2892
|
-
const i =
|
|
3041
|
+
const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
|
|
2893
3042
|
toolId: this.toolId,
|
|
2894
3043
|
label: this.name,
|
|
2895
3044
|
icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
|
|
@@ -2898,14 +3047,14 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2898
3047
|
tooltip: "Highlight",
|
|
2899
3048
|
onClick: () => e.toggleTool(this.toolId),
|
|
2900
3049
|
active: e.isToolVisible(i)
|
|
2901
|
-
},
|
|
2902
|
-
return
|
|
3050
|
+
}, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
|
|
3051
|
+
return r.setAttribute("tool-id", i), {
|
|
2903
3052
|
toolId: this.toolId,
|
|
2904
3053
|
button: n,
|
|
2905
|
-
|
|
3054
|
+
elements: [{ element: r, mount: "after-buttons" }],
|
|
2906
3055
|
sync: () => {
|
|
2907
3056
|
const o = e.isToolVisible(i);
|
|
2908
|
-
n.active = o,
|
|
3057
|
+
n.active = o, r.enabled = o, r.visible = o, e.ttsService && (r.ttsService = e.ttsService);
|
|
2909
3058
|
},
|
|
2910
3059
|
subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
|
|
2911
3060
|
o(e.isToolVisible(i));
|
|
@@ -2913,7 +3062,7 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2913
3062
|
}
|
|
2914
3063
|
};
|
|
2915
3064
|
}
|
|
2916
|
-
},
|
|
3065
|
+
}, Tr = {
|
|
2917
3066
|
toolId: "lineReader",
|
|
2918
3067
|
name: "Line Reader",
|
|
2919
3068
|
description: "Reading guide overlay",
|
|
@@ -2938,10 +3087,10 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2938
3087
|
* Pass 2: Line reader is relevant when readable text is present
|
|
2939
3088
|
*/
|
|
2940
3089
|
isVisibleInContext(t) {
|
|
2941
|
-
return
|
|
3090
|
+
return Ot(t);
|
|
2942
3091
|
},
|
|
2943
3092
|
renderToolbar(t, e) {
|
|
2944
|
-
const i =
|
|
3093
|
+
const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
|
|
2945
3094
|
toolId: this.toolId,
|
|
2946
3095
|
label: this.name,
|
|
2947
3096
|
icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
|
|
@@ -2950,14 +3099,14 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2950
3099
|
tooltip: "Line Reader",
|
|
2951
3100
|
onClick: () => e.toggleTool(this.toolId),
|
|
2952
3101
|
active: e.isToolVisible(i)
|
|
2953
|
-
},
|
|
2954
|
-
return
|
|
3102
|
+
}, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
|
|
3103
|
+
return r.setAttribute("tool-id", i), {
|
|
2955
3104
|
toolId: this.toolId,
|
|
2956
3105
|
button: n,
|
|
2957
|
-
|
|
3106
|
+
elements: [{ element: r, mount: "after-buttons" }],
|
|
2958
3107
|
sync: () => {
|
|
2959
3108
|
const o = e.isToolVisible(i);
|
|
2960
|
-
n.active = o,
|
|
3109
|
+
n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
|
|
2961
3110
|
},
|
|
2962
3111
|
subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
|
|
2963
3112
|
o(e.isToolVisible(i));
|
|
@@ -2965,10 +3114,10 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2965
3114
|
}
|
|
2966
3115
|
};
|
|
2967
3116
|
}
|
|
2968
|
-
},
|
|
2969
|
-
toolId: "
|
|
2970
|
-
name: "
|
|
2971
|
-
description: "Accessible
|
|
3117
|
+
}, Ar = {
|
|
3118
|
+
toolId: "theme",
|
|
3119
|
+
name: "Theme",
|
|
3120
|
+
description: "Accessible themes and contrast",
|
|
2972
3121
|
icon: "swatch",
|
|
2973
3122
|
// Color scheme is assessment-wide
|
|
2974
3123
|
supportedLevels: ["assessment", "section"],
|
|
@@ -2982,7 +3131,9 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2982
3131
|
"invertColors",
|
|
2983
3132
|
// QTI 3.0 standard (visual.invertColors)
|
|
2984
3133
|
"colorScheme",
|
|
2985
|
-
//
|
|
3134
|
+
// Legacy alias
|
|
3135
|
+
"theme",
|
|
3136
|
+
// Canonical id
|
|
2986
3137
|
"highContrast",
|
|
2987
3138
|
// Common variant
|
|
2988
3139
|
"customColors"
|
|
@@ -2995,23 +3146,23 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
2995
3146
|
return !0;
|
|
2996
3147
|
},
|
|
2997
3148
|
renderToolbar(t, e) {
|
|
2998
|
-
const i =
|
|
3149
|
+
const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
|
|
2999
3150
|
toolId: this.toolId,
|
|
3000
3151
|
label: this.name,
|
|
3001
3152
|
icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
|
|
3002
3153
|
disabled: !1,
|
|
3003
|
-
ariaLabel: "
|
|
3004
|
-
tooltip: "
|
|
3154
|
+
ariaLabel: "Theme - Change colors and contrast",
|
|
3155
|
+
tooltip: "Theme",
|
|
3005
3156
|
onClick: () => e.toggleTool(this.toolId),
|
|
3006
3157
|
active: e.isToolVisible(i)
|
|
3007
|
-
},
|
|
3008
|
-
return
|
|
3158
|
+
}, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
|
|
3159
|
+
return r.setAttribute("tool-id", i), {
|
|
3009
3160
|
toolId: this.toolId,
|
|
3010
3161
|
button: n,
|
|
3011
|
-
|
|
3162
|
+
elements: [{ element: r, mount: "after-buttons" }],
|
|
3012
3163
|
sync: () => {
|
|
3013
3164
|
const o = e.isToolVisible(i);
|
|
3014
|
-
n.active = o,
|
|
3165
|
+
n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
|
|
3015
3166
|
},
|
|
3016
3167
|
subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
|
|
3017
3168
|
o(e.isToolVisible(i));
|
|
@@ -3019,11 +3170,13 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
3019
3170
|
}
|
|
3020
3171
|
};
|
|
3021
3172
|
}
|
|
3022
|
-
},
|
|
3173
|
+
}, Ir = Ar, Er = {
|
|
3023
3174
|
toolId: "annotationToolbar",
|
|
3024
3175
|
name: "Highlighter",
|
|
3025
3176
|
description: "Highlight and annotate text",
|
|
3026
3177
|
icon: "highlighter",
|
|
3178
|
+
activation: "selection-gateway",
|
|
3179
|
+
singletonScope: "section",
|
|
3027
3180
|
// Annotation appears where there's text content
|
|
3028
3181
|
supportedLevels: ["passage", "rubric", "item", "element"],
|
|
3029
3182
|
// PNP support IDs
|
|
@@ -3044,10 +3197,10 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
3044
3197
|
* Pass 2: Annotation is relevant when readable text is present
|
|
3045
3198
|
*/
|
|
3046
3199
|
isVisibleInContext(t) {
|
|
3047
|
-
return
|
|
3200
|
+
return Ot(t);
|
|
3048
3201
|
},
|
|
3049
3202
|
renderToolbar(t, e) {
|
|
3050
|
-
const i =
|
|
3203
|
+
const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
|
|
3051
3204
|
toolId: this.toolId,
|
|
3052
3205
|
label: this.name,
|
|
3053
3206
|
icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
|
|
@@ -3056,14 +3209,14 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
3056
3209
|
tooltip: "Highlight",
|
|
3057
3210
|
onClick: () => e.toggleTool(this.toolId),
|
|
3058
3211
|
active: e.isToolVisible(i)
|
|
3059
|
-
},
|
|
3060
|
-
return
|
|
3212
|
+
}, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
|
|
3213
|
+
return r.setAttribute("tool-id", i), {
|
|
3061
3214
|
toolId: this.toolId,
|
|
3062
3215
|
button: n,
|
|
3063
|
-
|
|
3216
|
+
elements: [{ element: r, mount: "after-buttons" }],
|
|
3064
3217
|
sync: () => {
|
|
3065
3218
|
const o = e.isToolVisible(i);
|
|
3066
|
-
n.active = o,
|
|
3219
|
+
n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
|
|
3067
3220
|
},
|
|
3068
3221
|
subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
|
|
3069
3222
|
o(e.isToolVisible(i));
|
|
@@ -3071,7 +3224,7 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
3071
3224
|
}
|
|
3072
3225
|
};
|
|
3073
3226
|
}
|
|
3074
|
-
},
|
|
3227
|
+
}, wr = {
|
|
3075
3228
|
toolId: "graph",
|
|
3076
3229
|
name: "Graph",
|
|
3077
3230
|
description: "Graphing calculator and coordinate plane",
|
|
@@ -3094,10 +3247,10 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
3094
3247
|
* Pass 2: Graph is relevant when math content is present
|
|
3095
3248
|
*/
|
|
3096
3249
|
isVisibleInContext(t) {
|
|
3097
|
-
return
|
|
3250
|
+
return Rt(t);
|
|
3098
3251
|
},
|
|
3099
3252
|
renderToolbar(t, e) {
|
|
3100
|
-
const i =
|
|
3253
|
+
const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
|
|
3101
3254
|
toolId: this.toolId,
|
|
3102
3255
|
label: this.name,
|
|
3103
3256
|
icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
|
|
@@ -3106,14 +3259,14 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
3106
3259
|
tooltip: "Graph",
|
|
3107
3260
|
onClick: () => e.toggleTool(this.toolId),
|
|
3108
3261
|
active: e.isToolVisible(i)
|
|
3109
|
-
},
|
|
3110
|
-
return
|
|
3262
|
+
}, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
|
|
3263
|
+
return r.setAttribute("tool-id", i), {
|
|
3111
3264
|
toolId: this.toolId,
|
|
3112
3265
|
button: n,
|
|
3113
|
-
|
|
3266
|
+
elements: [{ element: r, mount: "after-buttons" }],
|
|
3114
3267
|
sync: () => {
|
|
3115
3268
|
const o = e.isToolVisible(i);
|
|
3116
|
-
n.active = o,
|
|
3269
|
+
n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
|
|
3117
3270
|
},
|
|
3118
3271
|
subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
|
|
3119
3272
|
o(e.isToolVisible(i));
|
|
@@ -3121,7 +3274,7 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
3121
3274
|
}
|
|
3122
3275
|
};
|
|
3123
3276
|
}
|
|
3124
|
-
},
|
|
3277
|
+
}, Sr = {
|
|
3125
3278
|
toolId: "periodicTable",
|
|
3126
3279
|
name: "Periodic Table",
|
|
3127
3280
|
description: "Chemistry periodic table reference",
|
|
@@ -3142,10 +3295,10 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
3142
3295
|
* Pass 2: Periodic table is relevant when science content is present
|
|
3143
3296
|
*/
|
|
3144
3297
|
isVisibleInContext(t) {
|
|
3145
|
-
return
|
|
3298
|
+
return or(t);
|
|
3146
3299
|
},
|
|
3147
3300
|
renderToolbar(t, e) {
|
|
3148
|
-
const i =
|
|
3301
|
+
const i = ie(this.toolId, e.scope.level, e.scope.scopeId), n = {
|
|
3149
3302
|
toolId: this.toolId,
|
|
3150
3303
|
label: this.name,
|
|
3151
3304
|
icon: typeof this.icon == "function" ? this.icon(t) : this.icon,
|
|
@@ -3154,14 +3307,14 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
3154
3307
|
tooltip: "Periodic Table",
|
|
3155
3308
|
onClick: () => e.toggleTool(this.toolId),
|
|
3156
3309
|
active: e.isToolVisible(i)
|
|
3157
|
-
},
|
|
3158
|
-
return
|
|
3310
|
+
}, s = e.componentOverrides ?? {}, r = ce(this.toolId, t, e, s);
|
|
3311
|
+
return r.setAttribute("tool-id", i), {
|
|
3159
3312
|
toolId: this.toolId,
|
|
3160
3313
|
button: n,
|
|
3161
|
-
|
|
3314
|
+
elements: [{ element: r, mount: "after-buttons" }],
|
|
3162
3315
|
sync: () => {
|
|
3163
3316
|
const o = e.isToolVisible(i);
|
|
3164
|
-
n.active = o,
|
|
3317
|
+
n.active = o, r.visible = o, e.toolkitCoordinator && (r.toolkitCoordinator = e.toolkitCoordinator);
|
|
3165
3318
|
},
|
|
3166
3319
|
subscribeActive: (o) => e.subscribeVisibility ? e.subscribeVisibility(() => {
|
|
3167
3320
|
o(e.isToolVisible(i));
|
|
@@ -3170,26 +3323,26 @@ const ts = /* @__PURE__ */ new Set([
|
|
|
3170
3323
|
};
|
|
3171
3324
|
}
|
|
3172
3325
|
};
|
|
3173
|
-
function
|
|
3174
|
-
const e = new
|
|
3326
|
+
function $r(t = {}) {
|
|
3327
|
+
const e = new ir(), i = {
|
|
3175
3328
|
toolTagMap: {
|
|
3176
|
-
...
|
|
3329
|
+
...Sn,
|
|
3177
3330
|
...t.toolTagMap || {}
|
|
3178
3331
|
},
|
|
3179
3332
|
toolComponentFactory: t.toolComponentFactory,
|
|
3180
3333
|
toolComponentFactories: t.toolComponentFactories
|
|
3181
|
-
}, n = (
|
|
3182
|
-
return e.register(n(
|
|
3334
|
+
}, n = (s) => t.overrides?.[s.toolId] || s;
|
|
3335
|
+
return e.register(n(gr)), e.register(n(mr)), e.register(n(vr)), e.register(n(br)), e.register(n(_r)), e.register(n(yr)), e.register(n(Tr)), e.register(n(Ir)), e.register(n(Er)), e.register(n(wr)), e.register(n(Sr)), t.toolModuleLoaders && Object.keys(t.toolModuleLoaders).length > 0 && e.setToolModuleLoaders(t.toolModuleLoaders), e.setComponentOverrides(i), e;
|
|
3183
3336
|
}
|
|
3184
|
-
function
|
|
3185
|
-
const t =
|
|
3337
|
+
function Cr() {
|
|
3338
|
+
const t = $r(), e = /* @__PURE__ */ new Set();
|
|
3186
3339
|
for (const i of t.getAllTools())
|
|
3187
3340
|
for (const n of i.pnpSupportIds || [])
|
|
3188
3341
|
e.add(n);
|
|
3189
3342
|
return [...e].sort();
|
|
3190
3343
|
}
|
|
3191
|
-
|
|
3192
|
-
const
|
|
3344
|
+
Cr();
|
|
3345
|
+
const Lr = {
|
|
3193
3346
|
/**
|
|
3194
3347
|
* Visual accessibility features
|
|
3195
3348
|
* For students with low vision, color blindness, or visual processing needs
|
|
@@ -3360,16 +3513,16 @@ const ys = {
|
|
|
3360
3513
|
tutorialAvailable: "tutorialAvailable"
|
|
3361
3514
|
}
|
|
3362
3515
|
};
|
|
3363
|
-
Object.values(
|
|
3364
|
-
var
|
|
3516
|
+
Object.values(Lr).flatMap((t) => Object.values(t));
|
|
3517
|
+
var Yt;
|
|
3365
3518
|
(function(t) {
|
|
3366
3519
|
t[t.BASE = 0] = "BASE", t[t.TOOL = 1e3] = "TOOL", t[t.MODAL = 2e3] = "MODAL", t[t.CONTROL = 3e3] = "CONTROL", t[t.HIGHLIGHT = 4e3] = "HIGHLIGHT";
|
|
3367
|
-
})(
|
|
3368
|
-
var
|
|
3520
|
+
})(Yt || (Yt = {}));
|
|
3521
|
+
var Ti;
|
|
3369
3522
|
(function(t) {
|
|
3370
3523
|
t.IDLE = "idle", t.LOADING = "loading", t.PLAYING = "playing", t.PAUSED = "paused", t.ERROR = "error";
|
|
3371
|
-
})(
|
|
3372
|
-
class
|
|
3524
|
+
})(Ti || (Ti = {}));
|
|
3525
|
+
const O = class O {
|
|
3373
3526
|
constructor() {
|
|
3374
3527
|
f(this, "elementType", "multiple-choice");
|
|
3375
3528
|
f(this, "priority", 100);
|
|
@@ -3378,14 +3531,16 @@ class yn {
|
|
|
3378
3531
|
return e.tagName.toLowerCase() === "multiple-choice" || e.classList.contains("multiple-choice");
|
|
3379
3532
|
}
|
|
3380
3533
|
findChoices(e) {
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
)
|
|
3534
|
+
e.setAttribute(O.ROOT_HOOK_ATTR, "true");
|
|
3535
|
+
const i = Array.from(
|
|
3536
|
+
e.querySelectorAll(O.CHOICE_SELECTOR)
|
|
3385
3537
|
);
|
|
3538
|
+
for (const n of i)
|
|
3539
|
+
this.annotateChoice(n);
|
|
3540
|
+
return this.annotateFeedbackTicks(e), i;
|
|
3386
3541
|
}
|
|
3387
3542
|
createChoiceRange(e) {
|
|
3388
|
-
const i =
|
|
3543
|
+
const i = this.resolveLabelElement(e);
|
|
3389
3544
|
if (!i)
|
|
3390
3545
|
return null;
|
|
3391
3546
|
const n = document.createRange();
|
|
@@ -3398,34 +3553,59 @@ class yn {
|
|
|
3398
3553
|
return i?.getAttribute("value") || i?.id || this.generateFallbackId(e);
|
|
3399
3554
|
}
|
|
3400
3555
|
getChoiceLabel(e) {
|
|
3401
|
-
return
|
|
3556
|
+
return this.resolveLabelElement(e)?.textContent?.trim() || "Unlabeled choice";
|
|
3402
3557
|
}
|
|
3403
3558
|
canEliminate(e) {
|
|
3404
3559
|
const i = e.querySelector(
|
|
3405
3560
|
'input[type="checkbox"], input[type="radio"]'
|
|
3406
3561
|
);
|
|
3407
|
-
return !(!i || i.getAttribute("aria-checked") === "true" || i.disabled || e.closest(".multiple-choice")?.querySelector(
|
|
3562
|
+
return !(!i || i.getAttribute("aria-checked") === "true" || i.disabled || (e.closest(`[${O.ROOT_HOOK_ATTR}="true"]`) || e.closest("multiple-choice"))?.querySelector(
|
|
3563
|
+
`[${O.FEEDBACK_HOOK_ATTR}="true"]`
|
|
3564
|
+
));
|
|
3408
3565
|
}
|
|
3409
3566
|
getButtonContainer(e) {
|
|
3410
3567
|
return e;
|
|
3411
3568
|
}
|
|
3412
3569
|
generateFallbackId(e) {
|
|
3413
|
-
const n = e.closest(".multiple-choice")?.querySelectorAll(
|
|
3570
|
+
const n = (e.closest(`[${O.ROOT_HOOK_ATTR}="true"]`) || e.closest("multiple-choice"))?.querySelectorAll(
|
|
3571
|
+
`[${O.CHOICE_HOOK_ATTR}="true"]`
|
|
3572
|
+
) || [];
|
|
3414
3573
|
return `choice-${Array.from(n).indexOf(e)}`;
|
|
3415
3574
|
}
|
|
3416
|
-
|
|
3417
|
-
|
|
3575
|
+
annotateChoice(e) {
|
|
3576
|
+
e.setAttribute(O.CHOICE_HOOK_ATTR, "true");
|
|
3577
|
+
const i = this.resolveLabelElement(e);
|
|
3578
|
+
i && i.setAttribute(O.LABEL_HOOK_ATTR, "true");
|
|
3579
|
+
}
|
|
3580
|
+
resolveLabelElement(e) {
|
|
3581
|
+
return e.querySelector(
|
|
3582
|
+
`[${O.LABEL_HOOK_ATTR}="true"]`
|
|
3583
|
+
) || e.querySelector("label") || e.querySelector("span");
|
|
3584
|
+
}
|
|
3585
|
+
annotateFeedbackTicks(e) {
|
|
3586
|
+
for (const i of e.querySelectorAll(
|
|
3587
|
+
".feedback-tick"
|
|
3588
|
+
))
|
|
3589
|
+
i.setAttribute(
|
|
3590
|
+
O.FEEDBACK_HOOK_ATTR,
|
|
3591
|
+
"true"
|
|
3592
|
+
);
|
|
3593
|
+
}
|
|
3594
|
+
};
|
|
3595
|
+
f(O, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice"), f(O, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label"), f(O, "ROOT_HOOK_ATTR", "data-pie-answer-eliminator-root"), f(O, "FEEDBACK_HOOK_ATTR", "data-pie-answer-eliminator-feedback-tick"), f(O, "CHOICE_SELECTOR", `[${O.CHOICE_HOOK_ATTR}="true"], .corespring-checkbox, .corespring-radio-button`);
|
|
3596
|
+
let St = O;
|
|
3597
|
+
class Rr {
|
|
3418
3598
|
constructor() {
|
|
3419
3599
|
f(this, "elementType", "ebsr");
|
|
3420
3600
|
f(this, "priority", 95);
|
|
3421
|
-
f(this, "mcAdapter", new
|
|
3601
|
+
f(this, "mcAdapter", new St());
|
|
3422
3602
|
}
|
|
3423
3603
|
canHandle(e) {
|
|
3424
3604
|
return e.tagName.toLowerCase() === "ebsr" || e.querySelector("ebsr-multiple-choice") !== null;
|
|
3425
3605
|
}
|
|
3426
3606
|
findChoices(e) {
|
|
3427
|
-
const i = e.querySelector('ebsr-multiple-choice[id="a"]'), n = e.querySelector('ebsr-multiple-choice[id="b"]'),
|
|
3428
|
-
return i &&
|
|
3607
|
+
const i = e.querySelector('ebsr-multiple-choice[id="a"]'), n = e.querySelector('ebsr-multiple-choice[id="b"]'), s = [];
|
|
3608
|
+
return i && s.push(...this.mcAdapter.findChoices(i)), n && s.push(...this.mcAdapter.findChoices(n)), s;
|
|
3429
3609
|
}
|
|
3430
3610
|
// Delegate all other methods to MultipleChoiceAdapter
|
|
3431
3611
|
createChoiceRange(e) {
|
|
@@ -3445,7 +3625,7 @@ class _s {
|
|
|
3445
3625
|
return this.mcAdapter.getButtonContainer(e);
|
|
3446
3626
|
}
|
|
3447
3627
|
}
|
|
3448
|
-
class
|
|
3628
|
+
class Or {
|
|
3449
3629
|
constructor() {
|
|
3450
3630
|
f(this, "elementType", "inline-dropdown");
|
|
3451
3631
|
f(this, "priority", 90);
|
|
@@ -3473,13 +3653,13 @@ class ws {
|
|
|
3473
3653
|
return e;
|
|
3474
3654
|
}
|
|
3475
3655
|
}
|
|
3476
|
-
class
|
|
3656
|
+
class kr {
|
|
3477
3657
|
constructor() {
|
|
3478
3658
|
f(this, "adapters");
|
|
3479
3659
|
this.adapters = [
|
|
3480
|
-
new
|
|
3481
|
-
new
|
|
3482
|
-
new
|
|
3660
|
+
new St(),
|
|
3661
|
+
new Rr(),
|
|
3662
|
+
new Or()
|
|
3483
3663
|
].sort((e, i) => i.priority - e.priority);
|
|
3484
3664
|
}
|
|
3485
3665
|
/**
|
|
@@ -3493,10 +3673,10 @@ class Ts {
|
|
|
3493
3673
|
*/
|
|
3494
3674
|
findAllChoicesWithAdapters(e) {
|
|
3495
3675
|
const i = [], n = /* @__PURE__ */ new Set();
|
|
3496
|
-
for (const
|
|
3497
|
-
const
|
|
3498
|
-
for (const o of
|
|
3499
|
-
n.has(o) || (n.add(o), i.push({ choice: o, adapter:
|
|
3676
|
+
for (const s of this.adapters) {
|
|
3677
|
+
const r = s.findChoices(e);
|
|
3678
|
+
for (const o of r)
|
|
3679
|
+
n.has(o) || (n.add(o), i.push({ choice: o, adapter: s }));
|
|
3500
3680
|
}
|
|
3501
3681
|
return i;
|
|
3502
3682
|
}
|
|
@@ -3507,7 +3687,7 @@ class Ts {
|
|
|
3507
3687
|
this.adapters.push(e), this.adapters.sort((i, n) => n.priority - i.priority);
|
|
3508
3688
|
}
|
|
3509
3689
|
}
|
|
3510
|
-
class
|
|
3690
|
+
const C = class C {
|
|
3511
3691
|
constructor() {
|
|
3512
3692
|
f(this, "name", "mask");
|
|
3513
3693
|
f(this, "highlights", /* @__PURE__ */ new Map());
|
|
@@ -3515,10 +3695,9 @@ class Ss {
|
|
|
3515
3695
|
f(this, "fallbackContainers", /* @__PURE__ */ new Map());
|
|
3516
3696
|
}
|
|
3517
3697
|
initialize() {
|
|
3518
|
-
this.injectCSS();
|
|
3519
3698
|
}
|
|
3520
3699
|
destroy() {
|
|
3521
|
-
this.clearAll()
|
|
3700
|
+
this.clearAll();
|
|
3522
3701
|
}
|
|
3523
3702
|
apply(e, i) {
|
|
3524
3703
|
if (!this.isSupported()) {
|
|
@@ -3527,14 +3706,17 @@ class Ss {
|
|
|
3527
3706
|
}
|
|
3528
3707
|
this.injectHighlightCSS(e);
|
|
3529
3708
|
const n = new Highlight(i);
|
|
3530
|
-
CSS.highlights.set(
|
|
3709
|
+
CSS.highlights.set(
|
|
3710
|
+
`${C.HIGHLIGHT_NAME_PREFIX}${e}`,
|
|
3711
|
+
n
|
|
3712
|
+
), this.highlights.set(e, n), this.ranges.set(e, i), this.addAriaAttributes(i);
|
|
3531
3713
|
}
|
|
3532
3714
|
remove(e) {
|
|
3533
3715
|
if (!this.isSupported()) {
|
|
3534
3716
|
this.removeFallback(e);
|
|
3535
3717
|
return;
|
|
3536
3718
|
}
|
|
3537
|
-
CSS.highlights.delete(
|
|
3719
|
+
CSS.highlights.delete(`${C.HIGHLIGHT_NAME_PREFIX}${e}`), this.removeHighlightCSS(e);
|
|
3538
3720
|
const i = this.ranges.get(e);
|
|
3539
3721
|
i && this.removeAriaAttributes(i), this.highlights.delete(e), this.ranges.delete(e), this.fallbackContainers.delete(e);
|
|
3540
3722
|
}
|
|
@@ -3552,47 +3734,32 @@ class Ss {
|
|
|
3552
3734
|
isSupported() {
|
|
3553
3735
|
return typeof CSS < "u" && "highlights" in CSS;
|
|
3554
3736
|
}
|
|
3555
|
-
injectCSS() {
|
|
3556
|
-
const e = "answer-eliminator-mask-styles";
|
|
3557
|
-
if (document.getElementById(e)) return;
|
|
3558
|
-
const i = document.createElement("style");
|
|
3559
|
-
i.id = e, i.textContent = `
|
|
3560
|
-
/* Fallback */
|
|
3561
|
-
.answer-masked-fallback {
|
|
3562
|
-
opacity: 0.2;
|
|
3563
|
-
filter: blur(2px);
|
|
3564
|
-
}
|
|
3565
|
-
`, document.head.appendChild(i);
|
|
3566
|
-
}
|
|
3567
3737
|
injectHighlightCSS(e) {
|
|
3568
|
-
const i =
|
|
3738
|
+
const i = `${C.HIGHLIGHT_STYLE_PREFIX}${e}`;
|
|
3569
3739
|
if (document.getElementById(i)) return;
|
|
3570
3740
|
const n = document.createElement("style");
|
|
3571
3741
|
n.id = i, n.textContent = `
|
|
3572
|
-
::highlight(answer-masked-${e}) {
|
|
3742
|
+
::highlight(pie-answer-masked-${e}) {
|
|
3573
3743
|
opacity: 0.2;
|
|
3574
3744
|
filter: blur(2px);
|
|
3575
3745
|
}
|
|
3576
3746
|
`, document.head.appendChild(n);
|
|
3577
3747
|
}
|
|
3578
3748
|
removeHighlightCSS(e) {
|
|
3579
|
-
document.getElementById(
|
|
3580
|
-
}
|
|
3581
|
-
removeCSS() {
|
|
3582
|
-
document.getElementById("answer-eliminator-mask-styles")?.remove();
|
|
3749
|
+
document.getElementById(`${C.HIGHLIGHT_STYLE_PREFIX}${e}`)?.remove();
|
|
3583
3750
|
}
|
|
3584
3751
|
addAriaAttributes(e) {
|
|
3585
3752
|
const i = this.findChoiceContainer(e);
|
|
3586
|
-
i && (i.setAttribute(
|
|
3753
|
+
i && (i.setAttribute(C.ELIMINATED_ATTR, "true"), i.setAttribute("aria-hidden", "true"));
|
|
3587
3754
|
}
|
|
3588
3755
|
removeAriaAttributes(e) {
|
|
3589
3756
|
const i = this.findChoiceContainer(e);
|
|
3590
|
-
i && (i.removeAttribute(
|
|
3757
|
+
i && (i.removeAttribute(C.ELIMINATED_ATTR), i.removeAttribute("aria-hidden"));
|
|
3591
3758
|
}
|
|
3592
3759
|
findChoiceContainer(e) {
|
|
3593
3760
|
let i = e.startContainer;
|
|
3594
3761
|
for (i.nodeType === Node.TEXT_NODE && (i = i.parentElement); i && i !== document.body; ) {
|
|
3595
|
-
if (i.
|
|
3762
|
+
if (i.getAttribute(C.CHOICE_HOOK_ATTR) === "true")
|
|
3596
3763
|
return i;
|
|
3597
3764
|
i = i.parentElement;
|
|
3598
3765
|
}
|
|
@@ -3600,17 +3767,19 @@ class Ss {
|
|
|
3600
3767
|
}
|
|
3601
3768
|
applyFallback(e, i) {
|
|
3602
3769
|
const n = this.findChoiceContainer(i);
|
|
3603
|
-
n && (n.classList.add(
|
|
3770
|
+
n && (n.classList.add(C.FALLBACK_CLASS), n.setAttribute(C.ELIMINATED_ATTR, "true"), n.setAttribute(C.ELIMINATED_ID_ATTR, e), this.fallbackContainers.set(e, n), this.addAriaAttributes(i));
|
|
3604
3771
|
}
|
|
3605
3772
|
removeFallback(e) {
|
|
3606
3773
|
const i = this.fallbackContainers.get(e);
|
|
3607
3774
|
if (!i) return;
|
|
3608
|
-
i.classList.remove(
|
|
3775
|
+
i.classList.remove(C.FALLBACK_CLASS), i.removeAttribute(C.ELIMINATED_ATTR), i.removeAttribute(C.ELIMINATED_ID_ATTR);
|
|
3609
3776
|
const n = document.createRange();
|
|
3610
3777
|
n.selectNodeContents(i), this.removeAriaAttributes(n), this.fallbackContainers.delete(e);
|
|
3611
3778
|
}
|
|
3612
|
-
}
|
|
3613
|
-
|
|
3779
|
+
};
|
|
3780
|
+
f(C, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-mask-highlight-"), f(C, "HIGHLIGHT_NAME_PREFIX", "pie-answer-masked-"), f(C, "FALLBACK_CLASS", "pie-answer-masked-fallback"), f(C, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice"), f(C, "ELIMINATED_ATTR", "data-pie-answer-eliminated"), f(C, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
|
|
3781
|
+
let Ut = C;
|
|
3782
|
+
const w = class w {
|
|
3614
3783
|
constructor() {
|
|
3615
3784
|
f(this, "name", "strikethrough");
|
|
3616
3785
|
f(this, "highlights", /* @__PURE__ */ new Map());
|
|
@@ -3618,14 +3787,10 @@ class As {
|
|
|
3618
3787
|
f(this, "fallbackContainers", /* @__PURE__ */ new Map());
|
|
3619
3788
|
}
|
|
3620
3789
|
initialize() {
|
|
3621
|
-
|
|
3622
|
-
console.warn("CSS Custom Highlight API not supported, using fallback");
|
|
3623
|
-
return;
|
|
3624
|
-
}
|
|
3625
|
-
this.injectCSS();
|
|
3790
|
+
this.isSupported() || console.warn("CSS Custom Highlight API not supported, using fallback");
|
|
3626
3791
|
}
|
|
3627
3792
|
destroy() {
|
|
3628
|
-
this.clearAll()
|
|
3793
|
+
this.clearAll();
|
|
3629
3794
|
}
|
|
3630
3795
|
apply(e, i) {
|
|
3631
3796
|
if (!this.isSupported()) {
|
|
@@ -3634,14 +3799,19 @@ class As {
|
|
|
3634
3799
|
}
|
|
3635
3800
|
this.injectHighlightCSS(e);
|
|
3636
3801
|
const n = new Highlight(i);
|
|
3637
|
-
CSS.highlights.set(
|
|
3802
|
+
CSS.highlights.set(
|
|
3803
|
+
`${w.HIGHLIGHT_NAME_PREFIX}${e}`,
|
|
3804
|
+
n
|
|
3805
|
+
), this.highlights.set(e, n), this.ranges.set(e, i), this.addAriaAttributes(i);
|
|
3638
3806
|
}
|
|
3639
3807
|
remove(e) {
|
|
3640
3808
|
if (!this.isSupported()) {
|
|
3641
3809
|
this.removeFallback(e);
|
|
3642
3810
|
return;
|
|
3643
3811
|
}
|
|
3644
|
-
CSS.highlights.delete(
|
|
3812
|
+
CSS.highlights.delete(
|
|
3813
|
+
`${w.HIGHLIGHT_NAME_PREFIX}${e}`
|
|
3814
|
+
), this.removeHighlightCSS(e);
|
|
3645
3815
|
const i = this.ranges.get(e);
|
|
3646
3816
|
i && this.removeAriaAttributes(i), this.highlights.delete(e), this.ranges.delete(e), this.fallbackContainers.delete(e);
|
|
3647
3817
|
}
|
|
@@ -3659,35 +3829,12 @@ class As {
|
|
|
3659
3829
|
isSupported() {
|
|
3660
3830
|
return typeof CSS < "u" && "highlights" in CSS;
|
|
3661
3831
|
}
|
|
3662
|
-
injectCSS() {
|
|
3663
|
-
const e = "answer-eliminator-strikethrough-styles";
|
|
3664
|
-
if (document.getElementById(e)) return;
|
|
3665
|
-
const i = document.createElement("style");
|
|
3666
|
-
i.id = e, i.textContent = `
|
|
3667
|
-
/* Fallback for browsers without CSS Highlight API */
|
|
3668
|
-
.answer-eliminated-fallback {
|
|
3669
|
-
text-decoration: line-through;
|
|
3670
|
-
text-decoration-thickness: 2px;
|
|
3671
|
-
text-decoration-color: var(--pie-incorrect, #ff9800);
|
|
3672
|
-
opacity: 0.6;
|
|
3673
|
-
}
|
|
3674
|
-
|
|
3675
|
-
/* Screen reader only text */
|
|
3676
|
-
.sr-announcement {
|
|
3677
|
-
position: absolute;
|
|
3678
|
-
left: -10000px;
|
|
3679
|
-
width: 1px;
|
|
3680
|
-
height: 1px;
|
|
3681
|
-
overflow: hidden;
|
|
3682
|
-
}
|
|
3683
|
-
`, document.head.appendChild(i);
|
|
3684
|
-
}
|
|
3685
3832
|
injectHighlightCSS(e) {
|
|
3686
|
-
const i =
|
|
3833
|
+
const i = `${w.HIGHLIGHT_STYLE_PREFIX}${e}`;
|
|
3687
3834
|
if (document.getElementById(i)) return;
|
|
3688
3835
|
const n = document.createElement("style");
|
|
3689
3836
|
n.id = i, n.textContent = `
|
|
3690
|
-
::highlight(answer-eliminated-${e}) {
|
|
3837
|
+
::highlight(pie-answer-eliminated-${e}) {
|
|
3691
3838
|
text-decoration: line-through;
|
|
3692
3839
|
text-decoration-thickness: 2px;
|
|
3693
3840
|
text-decoration-color: var(--pie-incorrect, #ff9800);
|
|
@@ -3696,32 +3843,31 @@ class As {
|
|
|
3696
3843
|
`, document.head.appendChild(n);
|
|
3697
3844
|
}
|
|
3698
3845
|
removeHighlightCSS(e) {
|
|
3699
|
-
document.getElementById(`answer-eliminator-highlight-${e}`)?.remove();
|
|
3700
|
-
}
|
|
3701
|
-
removeCSS() {
|
|
3702
3846
|
document.getElementById(
|
|
3703
|
-
|
|
3847
|
+
`${w.HIGHLIGHT_STYLE_PREFIX}${e}`
|
|
3704
3848
|
)?.remove();
|
|
3705
3849
|
}
|
|
3706
3850
|
addAriaAttributes(e) {
|
|
3707
3851
|
const i = this.findChoiceContainer(e);
|
|
3708
3852
|
if (!i) return;
|
|
3709
|
-
i.setAttribute(
|
|
3710
|
-
const n =
|
|
3711
|
-
if (n && !n.querySelector(
|
|
3712
|
-
const
|
|
3713
|
-
|
|
3853
|
+
i.setAttribute(w.ELIMINATED_ATTR, "true"), i.setAttribute("aria-disabled", "true");
|
|
3854
|
+
const n = this.resolveLabelElement(i);
|
|
3855
|
+
if (n && !n.querySelector(`.${w.SR_CLASS}`)) {
|
|
3856
|
+
const s = document.createElement("span");
|
|
3857
|
+
s.className = w.SR_CLASS, s.textContent = " (eliminated)", n.appendChild(s);
|
|
3714
3858
|
}
|
|
3715
3859
|
}
|
|
3716
3860
|
removeAriaAttributes(e) {
|
|
3717
3861
|
const i = this.findChoiceContainer(e);
|
|
3718
3862
|
if (!i) return;
|
|
3719
|
-
i.removeAttribute(
|
|
3863
|
+
i.removeAttribute(w.ELIMINATED_ATTR), i.removeAttribute("aria-disabled"), i.querySelector(
|
|
3864
|
+
`.${w.SR_CLASS}`
|
|
3865
|
+
)?.remove();
|
|
3720
3866
|
}
|
|
3721
3867
|
findChoiceContainer(e) {
|
|
3722
3868
|
let i = e.startContainer;
|
|
3723
3869
|
for (i.nodeType === Node.TEXT_NODE && (i = i.parentElement); i && i !== document.body; ) {
|
|
3724
|
-
if (i.
|
|
3870
|
+
if (i.getAttribute(w.CHOICE_HOOK_ATTR) === "true")
|
|
3725
3871
|
return i;
|
|
3726
3872
|
i = i.parentElement;
|
|
3727
3873
|
}
|
|
@@ -3730,17 +3876,24 @@ class As {
|
|
|
3730
3876
|
// Fallback for browsers without CSS Highlight API
|
|
3731
3877
|
applyFallback(e, i) {
|
|
3732
3878
|
const n = this.findChoiceContainer(i);
|
|
3733
|
-
n && (n.classList.add(
|
|
3879
|
+
n && (n.classList.add(w.FALLBACK_CLASS), n.setAttribute(w.ELIMINATED_ATTR, "true"), n.setAttribute(w.ELIMINATED_ID_ATTR, e), this.fallbackContainers.set(e, n), this.addAriaAttributes(i));
|
|
3734
3880
|
}
|
|
3735
3881
|
removeFallback(e) {
|
|
3736
3882
|
const i = this.fallbackContainers.get(e);
|
|
3737
3883
|
if (!i) return;
|
|
3738
|
-
i.classList.remove(
|
|
3884
|
+
i.classList.remove(w.FALLBACK_CLASS), i.removeAttribute(w.ELIMINATED_ATTR), i.removeAttribute(w.ELIMINATED_ID_ATTR);
|
|
3739
3885
|
const n = document.createRange();
|
|
3740
3886
|
n.selectNodeContents(i), this.removeAriaAttributes(n), this.fallbackContainers.delete(e);
|
|
3741
3887
|
}
|
|
3742
|
-
|
|
3743
|
-
|
|
3888
|
+
resolveLabelElement(e) {
|
|
3889
|
+
return e.querySelector(
|
|
3890
|
+
`[${w.LABEL_HOOK_ATTR}="true"]`
|
|
3891
|
+
) || e.querySelector("label");
|
|
3892
|
+
}
|
|
3893
|
+
};
|
|
3894
|
+
f(w, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-highlight-"), f(w, "HIGHLIGHT_NAME_PREFIX", "pie-answer-eliminated-"), f(w, "FALLBACK_CLASS", "pie-answer-eliminator-eliminated-fallback"), f(w, "SR_CLASS", "pie-answer-eliminator-sr-announcement"), f(w, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice"), f(w, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label"), f(w, "ELIMINATED_ATTR", "data-pie-answer-eliminated"), f(w, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
|
|
3895
|
+
let xt = w;
|
|
3896
|
+
const Te = class Te {
|
|
3744
3897
|
constructor(e = "strikethrough", i = "right") {
|
|
3745
3898
|
f(this, "registry");
|
|
3746
3899
|
f(this, "strategy");
|
|
@@ -3757,10 +3910,10 @@ class Is {
|
|
|
3757
3910
|
// Whether to restore eliminations from state storage
|
|
3758
3911
|
// Store integration (replaces session/localStorage)
|
|
3759
3912
|
f(this, "storeIntegration", null);
|
|
3760
|
-
this.registry = new
|
|
3913
|
+
this.registry = new kr(), this.strategy = this.createStrategy(e), this.strategy.initialize(), this.buttonAlignment = i;
|
|
3761
3914
|
}
|
|
3762
3915
|
createStrategy(e) {
|
|
3763
|
-
return e === "mask" ? new
|
|
3916
|
+
return e === "mask" ? new Ut() : new xt();
|
|
3764
3917
|
}
|
|
3765
3918
|
/**
|
|
3766
3919
|
* Initialize eliminator for a question
|
|
@@ -3768,8 +3921,8 @@ class Is {
|
|
|
3768
3921
|
initializeForQuestion(e) {
|
|
3769
3922
|
this.cleanupButtons();
|
|
3770
3923
|
const i = this.registry.findAllChoicesWithAdapters(e);
|
|
3771
|
-
for (const { choice: n, adapter:
|
|
3772
|
-
this.initializeChoice(n,
|
|
3924
|
+
for (const { choice: n, adapter: s } of i)
|
|
3925
|
+
this.initializeChoice(n, s);
|
|
3773
3926
|
this.shouldRestoreState && this.restoreState();
|
|
3774
3927
|
}
|
|
3775
3928
|
/**
|
|
@@ -3778,40 +3931,20 @@ class Is {
|
|
|
3778
3931
|
initializeChoice(e, i) {
|
|
3779
3932
|
const n = i.getChoiceId(e);
|
|
3780
3933
|
this.choiceElements.set(n, e), this.choiceAdapters.set(n, i);
|
|
3781
|
-
const
|
|
3782
|
-
if (!
|
|
3783
|
-
this.choiceButtons.set(n,
|
|
3784
|
-
const
|
|
3785
|
-
|
|
3934
|
+
const s = this.createToggleButton(e, i);
|
|
3935
|
+
if (!s) return;
|
|
3936
|
+
this.choiceButtons.set(n, s);
|
|
3937
|
+
const r = i.getButtonContainer(e);
|
|
3938
|
+
r && (r.style.position = "relative", r.appendChild(s));
|
|
3786
3939
|
}
|
|
3787
3940
|
/**
|
|
3788
3941
|
* Create elimination toggle button
|
|
3789
3942
|
*/
|
|
3790
3943
|
createToggleButton(e, i) {
|
|
3791
|
-
const n = i.getChoiceId(e),
|
|
3792
|
-
return
|
|
3793
|
-
width: "28px",
|
|
3794
|
-
height: "28px",
|
|
3795
|
-
padding: "0",
|
|
3796
|
-
border: "1px solid #ccc",
|
|
3797
|
-
borderRadius: "4px",
|
|
3798
|
-
background: "white",
|
|
3799
|
-
cursor: "pointer",
|
|
3800
|
-
fontSize: "18px",
|
|
3801
|
-
lineHeight: "1",
|
|
3802
|
-
display: "flex",
|
|
3803
|
-
alignItems: "center",
|
|
3804
|
-
justifyContent: "center",
|
|
3805
|
-
color: "#666",
|
|
3806
|
-
transition: "all 0.2s ease",
|
|
3807
|
-
zIndex: "10"
|
|
3808
|
-
}), s.addEventListener("mouseenter", () => {
|
|
3809
|
-
s.style.background = "#f0f0f0", s.style.borderColor = "#999", s.style.color = "#333";
|
|
3810
|
-
}), s.addEventListener("mouseleave", () => {
|
|
3811
|
-
this.strategy.isEliminated(n) || (s.style.background = "white", s.style.borderColor = "#ccc", s.style.color = "#666");
|
|
3812
|
-
}), s.addEventListener("click", (o) => {
|
|
3944
|
+
const n = i.getChoiceId(e), s = i.getChoiceLabel(e), r = document.createElement("button");
|
|
3945
|
+
return r.type = "button", r.className = Te.TOGGLE_CLASS, r.setAttribute("aria-label", `Toggle elimination for ${s}`), r.setAttribute("data-choice-id", n), r.textContent = "⊗", this.applyButtonAlignment(r), r.addEventListener("click", (o) => {
|
|
3813
3946
|
o.preventDefault(), o.stopPropagation(), this.toggleElimination(e, i);
|
|
3814
|
-
}),
|
|
3947
|
+
}), r;
|
|
3815
3948
|
}
|
|
3816
3949
|
/**
|
|
3817
3950
|
* Toggle elimination for a choice
|
|
@@ -3835,14 +3968,14 @@ class Is {
|
|
|
3835
3968
|
* Eliminate a choice
|
|
3836
3969
|
*/
|
|
3837
3970
|
eliminateChoice(e, i) {
|
|
3838
|
-
const n = i.getChoiceId(e),
|
|
3839
|
-
if (!
|
|
3971
|
+
const n = i.getChoiceId(e), s = i.createChoiceRange(e);
|
|
3972
|
+
if (!s) {
|
|
3840
3973
|
console.error("Failed to create range for choice");
|
|
3841
3974
|
return;
|
|
3842
3975
|
}
|
|
3843
|
-
this.strategy.apply(n,
|
|
3844
|
-
const
|
|
3845
|
-
|
|
3976
|
+
this.strategy.apply(n, s), this.eliminatedChoices.add(n);
|
|
3977
|
+
const r = this.choiceButtons.get(n);
|
|
3978
|
+
r && (r.classList.add(Te.TOGGLE_ACTIVE_CLASS), r.setAttribute("aria-pressed", "true")), this.saveState();
|
|
3846
3979
|
}
|
|
3847
3980
|
/**
|
|
3848
3981
|
* Restore a choice
|
|
@@ -3850,7 +3983,7 @@ class Is {
|
|
|
3850
3983
|
restoreChoice(e) {
|
|
3851
3984
|
this.strategy.remove(e), this.eliminatedChoices.delete(e);
|
|
3852
3985
|
const i = this.choiceButtons.get(e);
|
|
3853
|
-
i && (i.classList.remove(
|
|
3986
|
+
i && (i.classList.remove(Te.TOGGLE_ACTIVE_CLASS), i.setAttribute("aria-pressed", "false")), this.saveState();
|
|
3854
3987
|
}
|
|
3855
3988
|
/**
|
|
3856
3989
|
* Reset all eliminations for current element
|
|
@@ -3904,15 +4037,15 @@ class Is {
|
|
|
3904
4037
|
const i = e.eliminatedChoices;
|
|
3905
4038
|
if (!i || i.length === 0) return;
|
|
3906
4039
|
for (const n of i) {
|
|
3907
|
-
const
|
|
3908
|
-
if (!r) continue;
|
|
3909
|
-
const s = this.choiceAdapters.get(n);
|
|
4040
|
+
const s = this.choiceElements.get(n);
|
|
3910
4041
|
if (!s) continue;
|
|
3911
|
-
const
|
|
4042
|
+
const r = this.choiceAdapters.get(n);
|
|
4043
|
+
if (!r) continue;
|
|
4044
|
+
const o = r.createChoiceRange(s);
|
|
3912
4045
|
if (o) {
|
|
3913
4046
|
this.strategy.apply(n, o), this.eliminatedChoices.add(n);
|
|
3914
4047
|
const l = this.choiceButtons.get(n);
|
|
3915
|
-
l && (l.classList.add(
|
|
4048
|
+
l && (l.classList.add(Te.TOGGLE_ACTIVE_CLASS), l.setAttribute("aria-pressed", "true"));
|
|
3916
4049
|
}
|
|
3917
4050
|
}
|
|
3918
4051
|
} catch (i) {
|
|
@@ -3985,145 +4118,147 @@ class Is {
|
|
|
3985
4118
|
destroy() {
|
|
3986
4119
|
this.cleanupButtons(), this.strategy.destroy();
|
|
3987
4120
|
}
|
|
3988
|
-
}
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
4121
|
+
};
|
|
4122
|
+
f(Te, "TOGGLE_CLASS", "pie-answer-eliminator-toggle"), f(Te, "TOGGLE_ACTIVE_CLASS", "pie-answer-eliminator-toggle--active");
|
|
4123
|
+
let Xt = Te;
|
|
4124
|
+
var Hr = /* @__PURE__ */ Vs('<div style="display: none;" aria-hidden="true"></div>');
|
|
4125
|
+
function Nr(t, e) {
|
|
4126
|
+
Hi(e, !0);
|
|
4127
|
+
let i = ye(e, "visible", 7, !1), n = ye(e, "toolId", 7, "answerEliminator"), s = ye(e, "strategy", 7, "strikethrough"), r = ye(
|
|
3993
4128
|
e,
|
|
3994
4129
|
"alwaysOn",
|
|
3995
4130
|
7,
|
|
3996
4131
|
!1
|
|
3997
4132
|
// Set true for profile-based accommodation
|
|
3998
|
-
), o =
|
|
4133
|
+
), o = ye(
|
|
3999
4134
|
e,
|
|
4000
4135
|
"buttonAlignment",
|
|
4001
4136
|
7,
|
|
4002
4137
|
"right"
|
|
4003
4138
|
// Button placement: left, right, or inline with checkbox
|
|
4004
|
-
), l =
|
|
4139
|
+
), l = ye(
|
|
4005
4140
|
e,
|
|
4006
4141
|
"scopeElement",
|
|
4007
4142
|
7,
|
|
4008
4143
|
null
|
|
4009
4144
|
// Container element to limit DOM queries (for multi-item pages)
|
|
4010
|
-
), a =
|
|
4145
|
+
), a = ye(
|
|
4011
4146
|
e,
|
|
4012
4147
|
"elementToolStateStore",
|
|
4013
4148
|
7,
|
|
4014
4149
|
null
|
|
4015
4150
|
// ElementToolStateStore instance
|
|
4016
|
-
), u =
|
|
4151
|
+
), u = ye(
|
|
4017
4152
|
e,
|
|
4018
4153
|
"globalElementId",
|
|
4019
4154
|
7,
|
|
4020
4155
|
""
|
|
4021
4156
|
// Composite key: "assessmentId:sectionId:itemId:elementId"
|
|
4022
|
-
), d = /* @__PURE__ */
|
|
4023
|
-
const
|
|
4024
|
-
let h = /* @__PURE__ */
|
|
4025
|
-
|
|
4026
|
-
if (
|
|
4027
|
-
return
|
|
4028
|
-
|
|
4157
|
+
), d = /* @__PURE__ */ P(null), v = /* @__PURE__ */ P(null), p = /* @__PURE__ */ P(null);
|
|
4158
|
+
const g = /* @__PURE__ */ fi(() => m(v)?.toolCoordinator);
|
|
4159
|
+
let h = /* @__PURE__ */ P(null), T = /* @__PURE__ */ P(null), b = /* @__PURE__ */ P(null), S = /* @__PURE__ */ P(null), L = /* @__PURE__ */ fi(() => r() || i());
|
|
4160
|
+
Le(() => {
|
|
4161
|
+
if (m(d))
|
|
4162
|
+
return Js(m(d), (I) => {
|
|
4163
|
+
$(v, I, !0);
|
|
4029
4164
|
});
|
|
4030
|
-
}),
|
|
4031
|
-
if (
|
|
4032
|
-
return
|
|
4033
|
-
|
|
4165
|
+
}), Le(() => {
|
|
4166
|
+
if (m(d))
|
|
4167
|
+
return Zs(m(d), (I) => {
|
|
4168
|
+
$(p, I, !0);
|
|
4034
4169
|
});
|
|
4035
4170
|
});
|
|
4036
|
-
function
|
|
4037
|
-
return l() ||
|
|
4171
|
+
function $n() {
|
|
4172
|
+
return l() || m(p)?.scopeElement || null;
|
|
4038
4173
|
}
|
|
4039
|
-
function
|
|
4040
|
-
if (!
|
|
4041
|
-
const
|
|
4042
|
-
if (!
|
|
4174
|
+
function kt() {
|
|
4175
|
+
if (!m(L) || !m(h)) return;
|
|
4176
|
+
const I = $n();
|
|
4177
|
+
if (!I) {
|
|
4043
4178
|
console.warn("[AnswerEliminator] Missing shell scope context for question root");
|
|
4044
4179
|
return;
|
|
4045
4180
|
}
|
|
4046
|
-
|
|
4181
|
+
m(h).initializeForQuestion(I);
|
|
4047
4182
|
}
|
|
4048
|
-
function
|
|
4183
|
+
function Cn() {
|
|
4049
4184
|
requestAnimationFrame(() => {
|
|
4050
4185
|
requestAnimationFrame(() => {
|
|
4051
|
-
|
|
4186
|
+
kt();
|
|
4052
4187
|
});
|
|
4053
4188
|
});
|
|
4054
4189
|
}
|
|
4055
|
-
|
|
4056
|
-
!g
|
|
4057
|
-
}),
|
|
4058
|
-
|
|
4059
|
-
}),
|
|
4060
|
-
|
|
4061
|
-
})),
|
|
4062
|
-
const
|
|
4063
|
-
if (
|
|
4064
|
-
if (
|
|
4065
|
-
|
|
4190
|
+
Le(() => {
|
|
4191
|
+
!m(g) || !n() || (m(S) && m(b) && (m(S) !== m(g) || m(b) !== n()) && (m(S).unregisterTool(m(b)), $(S, null), $(b, null)), m(b) || (m(g).registerTool(n(), "Answer Eliminator", void 0, Yt.MODAL), $(S, m(g), !0), $(b, n())));
|
|
4192
|
+
}), Le(() => {
|
|
4193
|
+
m(h) && a() && u() && m(h).setStoreIntegration(a(), u());
|
|
4194
|
+
}), Bs(() => ($(h, new Xt(s(), o()), !0), m(h) && a() && u() && m(h).setStoreIntegration(a(), u()), m(L) ? kt() : m(h).cleanup(), () => {
|
|
4195
|
+
m(h)?.destroy(), $(h, null), m(S) && m(b) && (m(S).unregisterTool(m(b)), $(S, null), $(b, null));
|
|
4196
|
+
})), Le(() => {
|
|
4197
|
+
const I = m(p)?.contextVersion ?? null;
|
|
4198
|
+
if (I !== null) {
|
|
4199
|
+
if (m(T) === null) {
|
|
4200
|
+
$(T, I, !0);
|
|
4066
4201
|
return;
|
|
4067
4202
|
}
|
|
4068
|
-
|
|
4203
|
+
I !== m(T) && ($(T, I, !0), Cn());
|
|
4069
4204
|
}
|
|
4070
|
-
}),
|
|
4071
|
-
|
|
4205
|
+
}), Le(() => {
|
|
4206
|
+
m(h) && (m(L) ? (m(h).enableStateRestoration(), kt()) : m(h).cleanup());
|
|
4072
4207
|
});
|
|
4073
|
-
var
|
|
4208
|
+
var Ln = {
|
|
4074
4209
|
get visible() {
|
|
4075
4210
|
return i();
|
|
4076
4211
|
},
|
|
4077
|
-
set visible(
|
|
4078
|
-
i(
|
|
4212
|
+
set visible(I = !1) {
|
|
4213
|
+
i(I), ue();
|
|
4079
4214
|
},
|
|
4080
4215
|
get toolId() {
|
|
4081
4216
|
return n();
|
|
4082
4217
|
},
|
|
4083
|
-
set toolId(
|
|
4084
|
-
n(
|
|
4218
|
+
set toolId(I = "answerEliminator") {
|
|
4219
|
+
n(I), ue();
|
|
4085
4220
|
},
|
|
4086
4221
|
get strategy() {
|
|
4087
|
-
return
|
|
4222
|
+
return s();
|
|
4088
4223
|
},
|
|
4089
|
-
set strategy(
|
|
4090
|
-
|
|
4224
|
+
set strategy(I = "strikethrough") {
|
|
4225
|
+
s(I), ue();
|
|
4091
4226
|
},
|
|
4092
4227
|
get alwaysOn() {
|
|
4093
|
-
return
|
|
4228
|
+
return r();
|
|
4094
4229
|
},
|
|
4095
|
-
set alwaysOn(
|
|
4096
|
-
|
|
4230
|
+
set alwaysOn(I = !1) {
|
|
4231
|
+
r(I), ue();
|
|
4097
4232
|
},
|
|
4098
4233
|
get buttonAlignment() {
|
|
4099
4234
|
return o();
|
|
4100
4235
|
},
|
|
4101
|
-
set buttonAlignment(
|
|
4102
|
-
o(
|
|
4236
|
+
set buttonAlignment(I = "right") {
|
|
4237
|
+
o(I), ue();
|
|
4103
4238
|
},
|
|
4104
4239
|
get scopeElement() {
|
|
4105
4240
|
return l();
|
|
4106
4241
|
},
|
|
4107
|
-
set scopeElement(
|
|
4108
|
-
l(
|
|
4242
|
+
set scopeElement(I = null) {
|
|
4243
|
+
l(I), ue();
|
|
4109
4244
|
},
|
|
4110
4245
|
get elementToolStateStore() {
|
|
4111
4246
|
return a();
|
|
4112
4247
|
},
|
|
4113
|
-
set elementToolStateStore(
|
|
4114
|
-
a(
|
|
4248
|
+
set elementToolStateStore(I = null) {
|
|
4249
|
+
a(I), ue();
|
|
4115
4250
|
},
|
|
4116
4251
|
get globalElementId() {
|
|
4117
4252
|
return u();
|
|
4118
4253
|
},
|
|
4119
|
-
set globalElementId(
|
|
4120
|
-
u(
|
|
4254
|
+
set globalElementId(I = "") {
|
|
4255
|
+
u(I), ue();
|
|
4121
4256
|
}
|
|
4122
|
-
},
|
|
4123
|
-
return
|
|
4257
|
+
}, oi = Hr();
|
|
4258
|
+
return Gs(oi, (I) => $(d, I), () => m(d)), bn(t, oi), Ni(Ln);
|
|
4124
4259
|
}
|
|
4125
|
-
customElements.define("pie-tool-answer-eliminator",
|
|
4126
|
-
|
|
4260
|
+
customElements.define("pie-tool-answer-eliminator", zs(
|
|
4261
|
+
Nr,
|
|
4127
4262
|
{
|
|
4128
4263
|
visible: { attribute: "visible", type: "Boolean" },
|
|
4129
4264
|
toolId: { attribute: "tool-id", type: "String" },
|
|
@@ -4139,5 +4274,5 @@ customElements.define("pie-tool-answer-eliminator", Pr(
|
|
|
4139
4274
|
{ mode: "open" }
|
|
4140
4275
|
));
|
|
4141
4276
|
export {
|
|
4142
|
-
|
|
4277
|
+
Nr as default
|
|
4143
4278
|
};
|