@pie-framework/pie-fixed-player-static 1.0.0-152280c.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +101 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +262 -0
- package/dist/math-rendering.js +89442 -0
- package/dist/pie-elements-bundle-152280c.js +1978 -0
- package/dist/pie-fixed-player.js +3608 -0
- package/package.json +39 -0
|
@@ -0,0 +1,3608 @@
|
|
|
1
|
+
var Zr = Object.defineProperty;
|
|
2
|
+
var yn = (e) => {
|
|
3
|
+
throw TypeError(e);
|
|
4
|
+
};
|
|
5
|
+
var Kr = (e, t, n) => t in e ? Zr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
6
|
+
var O = (e, t, n) => Kr(e, typeof t != "symbol" ? t + "" : t, n), bn = (e, t, n) => t.has(e) || yn("Cannot " + n);
|
|
7
|
+
var q = (e, t, n) => (bn(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Ht = (e, t, n) => t.has(e) ? yn("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Vt = (e, t, n, r) => (bn(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
|
|
8
|
+
const es = "5";
|
|
9
|
+
var Gn;
|
|
10
|
+
typeof window < "u" && ((Gn = window.__svelte ?? (window.__svelte = {})).v ?? (Gn.v = /* @__PURE__ */ new Set())).add(es);
|
|
11
|
+
const ts = 1, ns = 4, rs = 8, ss = 16, is = 2, It = "[", sn = "[!", on = "]", Ve = {}, H = Symbol(), k = Symbol("filename"), wn = !0, fe = 2, Yn = 4, Ft = 8, ln = 16, _e = 32, De = 64, Et = 128, te = 256, $t = 512, V = 1024, ye = 2048, Ae = 4096, Ye = 8192, Ot = 16384, os = 32768, an = 65536, Jn = 1 << 18, ls = 1 << 19, Wn = 1 << 20, Wt = 1 << 21, Pe = Symbol("$state"), nt = Symbol("$state metadata"), Xn = Symbol("legacy props");
|
|
12
|
+
var cn = Array.isArray, as = Array.prototype.indexOf, cs = Array.from, Rt = Object.keys, ce = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor, Zn = Object.prototype, us = Array.prototype, Kn = Object.getPrototypeOf, En = Object.isExtensible;
|
|
13
|
+
function er(e) {
|
|
14
|
+
for (var t = 0; t < e.length; t++)
|
|
15
|
+
e[t]();
|
|
16
|
+
}
|
|
17
|
+
let ut = [], Xt = [];
|
|
18
|
+
function tr() {
|
|
19
|
+
var e = ut;
|
|
20
|
+
ut = [], er(e);
|
|
21
|
+
}
|
|
22
|
+
function fs() {
|
|
23
|
+
var e = Xt;
|
|
24
|
+
Xt = [], er(e);
|
|
25
|
+
}
|
|
26
|
+
function nr(e) {
|
|
27
|
+
ut.length === 0 && queueMicrotask(tr), ut.push(e);
|
|
28
|
+
}
|
|
29
|
+
function $n() {
|
|
30
|
+
ut.length > 0 && tr(), Xt.length > 0 && fs();
|
|
31
|
+
}
|
|
32
|
+
function rr(e) {
|
|
33
|
+
return e === this.v;
|
|
34
|
+
}
|
|
35
|
+
function ds(e, t) {
|
|
36
|
+
return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
|
|
37
|
+
}
|
|
38
|
+
function sr(e) {
|
|
39
|
+
return !ds(e, this.v);
|
|
40
|
+
}
|
|
41
|
+
function hs(e, t, n) {
|
|
42
|
+
{
|
|
43
|
+
const r = new Error(`component_api_changed
|
|
44
|
+
${e} called \`${t}\` on an instance of ${n}, which is no longer valid in Svelte 5
|
|
45
|
+
https://svelte.dev/e/component_api_changed`);
|
|
46
|
+
throw r.name = "Svelte error", r;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function gs(e, t) {
|
|
50
|
+
{
|
|
51
|
+
const n = new Error(`component_api_invalid_new
|
|
52
|
+
Attempted to instantiate ${e} with \`new ${t}\`, which is no longer valid in Svelte 5. If this component is not under your control, set the \`compatibility.componentApi\` compiler option to \`4\` to keep it working.
|
|
53
|
+
https://svelte.dev/e/component_api_invalid_new`);
|
|
54
|
+
throw n.name = "Svelte error", n;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function ps() {
|
|
58
|
+
{
|
|
59
|
+
const e = new Error(`derived_references_self
|
|
60
|
+
A derived value cannot reference itself recursively
|
|
61
|
+
https://svelte.dev/e/derived_references_self`);
|
|
62
|
+
throw e.name = "Svelte error", e;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function vs(e) {
|
|
66
|
+
{
|
|
67
|
+
const t = new Error(`effect_in_teardown
|
|
68
|
+
\`${e}\` cannot be used inside an effect cleanup function
|
|
69
|
+
https://svelte.dev/e/effect_in_teardown`);
|
|
70
|
+
throw t.name = "Svelte error", t;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function ms() {
|
|
74
|
+
{
|
|
75
|
+
const e = new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");
|
|
76
|
+
throw e.name = "Svelte error", e;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function _s(e) {
|
|
80
|
+
{
|
|
81
|
+
const t = new Error(`effect_orphan
|
|
82
|
+
\`${e}\` can only be used inside an effect (e.g. during component initialisation)
|
|
83
|
+
https://svelte.dev/e/effect_orphan`);
|
|
84
|
+
throw t.name = "Svelte error", t;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function ys() {
|
|
88
|
+
{
|
|
89
|
+
const e = new Error(`effect_update_depth_exceeded
|
|
90
|
+
Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops
|
|
91
|
+
https://svelte.dev/e/effect_update_depth_exceeded`);
|
|
92
|
+
throw e.name = "Svelte error", e;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function bs() {
|
|
96
|
+
{
|
|
97
|
+
const e = new Error(`hydration_failed
|
|
98
|
+
Failed to hydrate the application
|
|
99
|
+
https://svelte.dev/e/hydration_failed`);
|
|
100
|
+
throw e.name = "Svelte error", e;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function ws(e) {
|
|
104
|
+
{
|
|
105
|
+
const t = new Error(`props_invalid_value
|
|
106
|
+
Cannot do \`bind:${e}={undefined}\` when \`${e}\` has a fallback value
|
|
107
|
+
https://svelte.dev/e/props_invalid_value`);
|
|
108
|
+
throw t.name = "Svelte error", t;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function Es(e) {
|
|
112
|
+
{
|
|
113
|
+
const t = new Error(`rune_outside_svelte
|
|
114
|
+
The \`${e}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
|
|
115
|
+
https://svelte.dev/e/rune_outside_svelte`);
|
|
116
|
+
throw t.name = "Svelte error", t;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function $s() {
|
|
120
|
+
{
|
|
121
|
+
const e = new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");
|
|
122
|
+
throw e.name = "Svelte error", e;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function Rs() {
|
|
126
|
+
{
|
|
127
|
+
const e = new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");
|
|
128
|
+
throw e.name = "Svelte error", e;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function Cs() {
|
|
132
|
+
{
|
|
133
|
+
const e = new Error("state_unsafe_mutation\nUpdating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");
|
|
134
|
+
throw e.name = "Svelte error", e;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
let Ps = !1;
|
|
138
|
+
var Ss = "font-weight: bold", xs = "font-weight: normal";
|
|
139
|
+
function Rn(e) {
|
|
140
|
+
console.warn(`%c[svelte] state_snapshot_uncloneable
|
|
141
|
+
%c${e ? `The following properties cannot be cloned with \`$state.snapshot\` — the return value contains the originals:
|
|
142
|
+
|
|
143
|
+
${e}` : "Value cannot be cloned with `$state.snapshot` — the original value was returned"}
|
|
144
|
+
https://svelte.dev/e/state_snapshot_uncloneable`, Ss, xs);
|
|
145
|
+
}
|
|
146
|
+
const Ts = [];
|
|
147
|
+
function Ls(e, t = !1) {
|
|
148
|
+
if (!t) {
|
|
149
|
+
const n = [], r = st(e, /* @__PURE__ */ new Map(), "", n);
|
|
150
|
+
if (n.length === 1 && n[0] === "")
|
|
151
|
+
Rn();
|
|
152
|
+
else if (n.length > 0) {
|
|
153
|
+
const s = n.length > 10 ? n.slice(0, 7) : n.slice(0, 10), i = n.length - s.length;
|
|
154
|
+
let o = s.map((l) => `- <value>${l}`).join(`
|
|
155
|
+
`);
|
|
156
|
+
i > 0 && (o += `
|
|
157
|
+
- ...and ${i} more`), Rn(o);
|
|
158
|
+
}
|
|
159
|
+
return r;
|
|
160
|
+
}
|
|
161
|
+
return st(e, /* @__PURE__ */ new Map(), "", Ts);
|
|
162
|
+
}
|
|
163
|
+
function st(e, t, n, r, s = null) {
|
|
164
|
+
if (typeof e == "object" && e !== null) {
|
|
165
|
+
var i = t.get(e);
|
|
166
|
+
if (i !== void 0) return i;
|
|
167
|
+
if (e instanceof Map) return (
|
|
168
|
+
/** @type {Snapshot<T>} */
|
|
169
|
+
new Map(e)
|
|
170
|
+
);
|
|
171
|
+
if (e instanceof Set) return (
|
|
172
|
+
/** @type {Snapshot<T>} */
|
|
173
|
+
new Set(e)
|
|
174
|
+
);
|
|
175
|
+
if (cn(e)) {
|
|
176
|
+
var o = (
|
|
177
|
+
/** @type {Snapshot<any>} */
|
|
178
|
+
Array(e.length)
|
|
179
|
+
);
|
|
180
|
+
t.set(e, o), s !== null && t.set(s, o);
|
|
181
|
+
for (var l = 0; l < e.length; l += 1) {
|
|
182
|
+
var c = e[l];
|
|
183
|
+
l in e && (o[l] = st(c, t, `${n}[${l}]`, r));
|
|
184
|
+
}
|
|
185
|
+
return o;
|
|
186
|
+
}
|
|
187
|
+
if (Kn(e) === Zn) {
|
|
188
|
+
o = {}, t.set(e, o), s !== null && t.set(s, o);
|
|
189
|
+
for (var a in e)
|
|
190
|
+
o[a] = st(e[a], t, `${n}.${a}`, r);
|
|
191
|
+
return o;
|
|
192
|
+
}
|
|
193
|
+
if (e instanceof Date)
|
|
194
|
+
return (
|
|
195
|
+
/** @type {Snapshot<T>} */
|
|
196
|
+
structuredClone(e)
|
|
197
|
+
);
|
|
198
|
+
if (typeof /** @type {T & { toJSON?: any } } */
|
|
199
|
+
e.toJSON == "function")
|
|
200
|
+
return st(
|
|
201
|
+
/** @type {T & { toJSON(): any } } */
|
|
202
|
+
e.toJSON(),
|
|
203
|
+
t,
|
|
204
|
+
`${n}.toJSON()`,
|
|
205
|
+
r,
|
|
206
|
+
// Associate the instance with the toJSON clone
|
|
207
|
+
e
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
if (e instanceof EventTarget)
|
|
211
|
+
return (
|
|
212
|
+
/** @type {Snapshot<T>} */
|
|
213
|
+
e
|
|
214
|
+
);
|
|
215
|
+
try {
|
|
216
|
+
return (
|
|
217
|
+
/** @type {Snapshot<T>} */
|
|
218
|
+
structuredClone(e)
|
|
219
|
+
);
|
|
220
|
+
} catch {
|
|
221
|
+
return r.push(n), /** @type {Snapshot<T>} */
|
|
222
|
+
e;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
var rt = null;
|
|
226
|
+
function Ie(e, t) {
|
|
227
|
+
if (typeof e != "object" || e === null || Pe in e)
|
|
228
|
+
return e;
|
|
229
|
+
const n = Kn(e);
|
|
230
|
+
if (n !== Zn && n !== us)
|
|
231
|
+
return e;
|
|
232
|
+
var r = /* @__PURE__ */ new Map(), s = cn(e), i = U(0), o = $, l = (a) => {
|
|
233
|
+
var u = $;
|
|
234
|
+
Se(o);
|
|
235
|
+
var d;
|
|
236
|
+
{
|
|
237
|
+
var f = rt;
|
|
238
|
+
rt = c, d = a(), rt = f;
|
|
239
|
+
}
|
|
240
|
+
return Se(u), d;
|
|
241
|
+
};
|
|
242
|
+
s && r.set("length", U(
|
|
243
|
+
/** @type {any[]} */
|
|
244
|
+
e.length
|
|
245
|
+
));
|
|
246
|
+
var c;
|
|
247
|
+
if (c = {
|
|
248
|
+
parent: rt,
|
|
249
|
+
owners: null
|
|
250
|
+
}, t) {
|
|
251
|
+
const a = t.v?.[nt]?.owners;
|
|
252
|
+
c.owners = a ? new Set(a) : null;
|
|
253
|
+
} else
|
|
254
|
+
c.owners = rt === null ? B !== null ? /* @__PURE__ */ new Set([B.function]) : null : /* @__PURE__ */ new Set();
|
|
255
|
+
return new Proxy(
|
|
256
|
+
/** @type {any} */
|
|
257
|
+
e,
|
|
258
|
+
{
|
|
259
|
+
defineProperty(a, u, d) {
|
|
260
|
+
(!("value" in d) || d.configurable === !1 || d.enumerable === !1 || d.writable === !1) && $s();
|
|
261
|
+
var f = r.get(u);
|
|
262
|
+
return f === void 0 ? (f = l(() => U(d.value)), r.set(u, f)) : b(
|
|
263
|
+
f,
|
|
264
|
+
l(() => Ie(d.value))
|
|
265
|
+
), !0;
|
|
266
|
+
},
|
|
267
|
+
deleteProperty(a, u) {
|
|
268
|
+
var d = r.get(u);
|
|
269
|
+
if (d === void 0)
|
|
270
|
+
u in a && r.set(
|
|
271
|
+
u,
|
|
272
|
+
l(() => U(H))
|
|
273
|
+
);
|
|
274
|
+
else {
|
|
275
|
+
if (s && typeof u == "string") {
|
|
276
|
+
var f = (
|
|
277
|
+
/** @type {Source<number>} */
|
|
278
|
+
r.get("length")
|
|
279
|
+
), g = Number(u);
|
|
280
|
+
Number.isInteger(g) && g < f.v && b(f, g);
|
|
281
|
+
}
|
|
282
|
+
b(d, H), Cn(i);
|
|
283
|
+
}
|
|
284
|
+
return !0;
|
|
285
|
+
},
|
|
286
|
+
get(a, u, d) {
|
|
287
|
+
if (u === nt)
|
|
288
|
+
return c;
|
|
289
|
+
if (u === Pe)
|
|
290
|
+
return e;
|
|
291
|
+
var f = r.get(u), g = u in a;
|
|
292
|
+
if (f === void 0 && (!g || Fe(a, u)?.writable) && (f = l(() => U(Ie(g ? a[u] : H))), r.set(u, f)), f !== void 0) {
|
|
293
|
+
var m = p(f);
|
|
294
|
+
{
|
|
295
|
+
var y = m?.[nt];
|
|
296
|
+
y && y?.parent !== c && Un(c, y);
|
|
297
|
+
}
|
|
298
|
+
return m === H ? void 0 : m;
|
|
299
|
+
}
|
|
300
|
+
return Reflect.get(a, u, d);
|
|
301
|
+
},
|
|
302
|
+
getOwnPropertyDescriptor(a, u) {
|
|
303
|
+
var d = Reflect.getOwnPropertyDescriptor(a, u);
|
|
304
|
+
if (d && "value" in d) {
|
|
305
|
+
var f = r.get(u);
|
|
306
|
+
f && (d.value = p(f));
|
|
307
|
+
} else if (d === void 0) {
|
|
308
|
+
var g = r.get(u), m = g?.v;
|
|
309
|
+
if (g !== void 0 && m !== H)
|
|
310
|
+
return {
|
|
311
|
+
enumerable: !0,
|
|
312
|
+
configurable: !0,
|
|
313
|
+
value: m,
|
|
314
|
+
writable: !0
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
return d;
|
|
318
|
+
},
|
|
319
|
+
has(a, u) {
|
|
320
|
+
if (u === nt || u === Pe)
|
|
321
|
+
return !0;
|
|
322
|
+
var d = r.get(u), f = d !== void 0 && d.v !== H || Reflect.has(a, u);
|
|
323
|
+
if (d !== void 0 || T !== null && (!f || Fe(a, u)?.writable)) {
|
|
324
|
+
d === void 0 && (d = l(() => U(f ? Ie(a[u]) : H)), r.set(u, d));
|
|
325
|
+
var g = p(d);
|
|
326
|
+
if (g === H)
|
|
327
|
+
return !1;
|
|
328
|
+
}
|
|
329
|
+
return f;
|
|
330
|
+
},
|
|
331
|
+
set(a, u, d, f) {
|
|
332
|
+
var g = r.get(u), m = u in a;
|
|
333
|
+
if (s && u === "length")
|
|
334
|
+
for (var y = d; y < /** @type {Source<number>} */
|
|
335
|
+
g.v; y += 1) {
|
|
336
|
+
var R = r.get(y + "");
|
|
337
|
+
R !== void 0 ? b(R, H) : y in a && (R = l(() => U(H)), r.set(y + "", R));
|
|
338
|
+
}
|
|
339
|
+
g === void 0 ? (!m || Fe(a, u)?.writable) && (g = l(() => U(void 0)), b(
|
|
340
|
+
g,
|
|
341
|
+
l(() => Ie(d))
|
|
342
|
+
), r.set(u, g)) : (m = g.v !== H, b(
|
|
343
|
+
g,
|
|
344
|
+
l(() => Ie(d))
|
|
345
|
+
));
|
|
346
|
+
{
|
|
347
|
+
var N = d?.[nt];
|
|
348
|
+
N && N?.parent !== c && Un(c, N), ni(c);
|
|
349
|
+
}
|
|
350
|
+
var F = Reflect.getOwnPropertyDescriptor(a, u);
|
|
351
|
+
if (F?.set && F.set.call(f, d), !m) {
|
|
352
|
+
if (s && typeof u == "string") {
|
|
353
|
+
var j = (
|
|
354
|
+
/** @type {Source<number>} */
|
|
355
|
+
r.get("length")
|
|
356
|
+
), I = Number(u);
|
|
357
|
+
Number.isInteger(I) && I >= j.v && b(j, I + 1);
|
|
358
|
+
}
|
|
359
|
+
Cn(i);
|
|
360
|
+
}
|
|
361
|
+
return !0;
|
|
362
|
+
},
|
|
363
|
+
ownKeys(a) {
|
|
364
|
+
p(i);
|
|
365
|
+
var u = Reflect.ownKeys(a).filter((g) => {
|
|
366
|
+
var m = r.get(g);
|
|
367
|
+
return m === void 0 || m.v !== H;
|
|
368
|
+
});
|
|
369
|
+
for (var [d, f] of r)
|
|
370
|
+
f.v !== H && !(d in a) && u.push(d);
|
|
371
|
+
return u;
|
|
372
|
+
},
|
|
373
|
+
setPrototypeOf() {
|
|
374
|
+
Rs();
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
function Cn(e, t = 1) {
|
|
380
|
+
b(e, e.v + t);
|
|
381
|
+
}
|
|
382
|
+
function it(e) {
|
|
383
|
+
try {
|
|
384
|
+
if (e !== null && typeof e == "object" && Pe in e)
|
|
385
|
+
return e[Pe];
|
|
386
|
+
} catch {
|
|
387
|
+
}
|
|
388
|
+
return e;
|
|
389
|
+
}
|
|
390
|
+
let Ge = /* @__PURE__ */ new Set();
|
|
391
|
+
const ft = /* @__PURE__ */ new Map();
|
|
392
|
+
function Pn(e) {
|
|
393
|
+
Ge = e;
|
|
394
|
+
}
|
|
395
|
+
function ir(e, t) {
|
|
396
|
+
var n = {
|
|
397
|
+
f: 0,
|
|
398
|
+
// TODO ideally we could skip this altogether, but it causes type errors
|
|
399
|
+
v: e,
|
|
400
|
+
reactions: null,
|
|
401
|
+
equals: rr,
|
|
402
|
+
rv: 0,
|
|
403
|
+
wv: 0
|
|
404
|
+
};
|
|
405
|
+
return n;
|
|
406
|
+
}
|
|
407
|
+
function U(e, t) {
|
|
408
|
+
const n = ir(e);
|
|
409
|
+
return dr(n), n;
|
|
410
|
+
}
|
|
411
|
+
// @__NO_SIDE_EFFECTS__
|
|
412
|
+
function or(e, t = !1) {
|
|
413
|
+
const n = ir(e);
|
|
414
|
+
return t || (n.equals = sr), n;
|
|
415
|
+
}
|
|
416
|
+
function b(e, t, n = !1) {
|
|
417
|
+
$ !== null && !ae && kr() && ($.f & (fe | ln)) !== 0 && !pe?.includes(e) && Cs();
|
|
418
|
+
let r = n ? Ie(t, e) : t;
|
|
419
|
+
return ks(e, r);
|
|
420
|
+
}
|
|
421
|
+
function ks(e, t) {
|
|
422
|
+
if (!e.equals(t)) {
|
|
423
|
+
var n = e.v;
|
|
424
|
+
if (pt ? ft.set(e, t) : ft.set(e, n), e.v = t, e.wv = gr(), lr(e, ye), T !== null && (T.f & V) !== 0 && (T.f & (_e | De)) === 0 && (K === null ? js([e]) : K.push(e)), Ge.size > 0) {
|
|
425
|
+
const r = Array.from(Ge);
|
|
426
|
+
for (const s of r)
|
|
427
|
+
(s.f & V) !== 0 && re(s, Ae), et(s) && At(s);
|
|
428
|
+
Ge.clear();
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
return t;
|
|
432
|
+
}
|
|
433
|
+
function lr(e, t) {
|
|
434
|
+
var n = e.reactions;
|
|
435
|
+
if (n !== null)
|
|
436
|
+
for (var r = n.length, s = 0; s < r; s++) {
|
|
437
|
+
var i = n[s], o = i.f;
|
|
438
|
+
if ((o & ye) === 0) {
|
|
439
|
+
if ((o & Jn) !== 0) {
|
|
440
|
+
Ge.add(i);
|
|
441
|
+
continue;
|
|
442
|
+
}
|
|
443
|
+
re(i, t), (o & (V | te)) !== 0 && ((o & fe) !== 0 ? lr(
|
|
444
|
+
/** @type {Derived} */
|
|
445
|
+
i,
|
|
446
|
+
Ae
|
|
447
|
+
) : Bt(
|
|
448
|
+
/** @type {Effect} */
|
|
449
|
+
i
|
|
450
|
+
));
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
// @__NO_SIDE_EFFECTS__
|
|
455
|
+
function un(e) {
|
|
456
|
+
var t = fe | ye, n = $ !== null && ($.f & fe) !== 0 ? (
|
|
457
|
+
/** @type {Derived} */
|
|
458
|
+
$
|
|
459
|
+
) : null;
|
|
460
|
+
return T === null || n !== null && (n.f & te) !== 0 ? t |= te : T.f |= Wn, {
|
|
461
|
+
ctx: B,
|
|
462
|
+
deps: null,
|
|
463
|
+
effects: null,
|
|
464
|
+
equals: rr,
|
|
465
|
+
f: t,
|
|
466
|
+
fn: e,
|
|
467
|
+
reactions: null,
|
|
468
|
+
rv: 0,
|
|
469
|
+
v: (
|
|
470
|
+
/** @type {V} */
|
|
471
|
+
null
|
|
472
|
+
),
|
|
473
|
+
wv: 0,
|
|
474
|
+
parent: n ?? T
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
function Z(e) {
|
|
478
|
+
const t = /* @__PURE__ */ un(e);
|
|
479
|
+
return dr(t), t;
|
|
480
|
+
}
|
|
481
|
+
function ar(e) {
|
|
482
|
+
var t = e.effects;
|
|
483
|
+
if (t !== null) {
|
|
484
|
+
e.effects = null;
|
|
485
|
+
for (var n = 0; n < t.length; n += 1)
|
|
486
|
+
me(
|
|
487
|
+
/** @type {Effect} */
|
|
488
|
+
t[n]
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
let Gt = [];
|
|
493
|
+
function Is(e) {
|
|
494
|
+
for (var t = e.parent; t !== null; ) {
|
|
495
|
+
if ((t.f & fe) === 0)
|
|
496
|
+
return (
|
|
497
|
+
/** @type {Effect} */
|
|
498
|
+
t
|
|
499
|
+
);
|
|
500
|
+
t = t.parent;
|
|
501
|
+
}
|
|
502
|
+
return null;
|
|
503
|
+
}
|
|
504
|
+
function Fs(e) {
|
|
505
|
+
var t, n = T;
|
|
506
|
+
Je(Is(e));
|
|
507
|
+
{
|
|
508
|
+
let r = Ge;
|
|
509
|
+
Pn(/* @__PURE__ */ new Set());
|
|
510
|
+
try {
|
|
511
|
+
Gt.includes(e) && ps(), Gt.push(e), ar(e), t = vr(e);
|
|
512
|
+
} finally {
|
|
513
|
+
Je(n), Pn(r), Gt.pop();
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
return t;
|
|
517
|
+
}
|
|
518
|
+
function cr(e) {
|
|
519
|
+
var t = Fs(e), n = ($e || (e.f & te) !== 0) && e.deps !== null ? Ae : V;
|
|
520
|
+
re(e, n), e.equals(t) || (e.v = t, e.wv = gr());
|
|
521
|
+
}
|
|
522
|
+
var Ze = "font-weight: bold", Ke = "font-weight: normal";
|
|
523
|
+
function Os(e) {
|
|
524
|
+
console.warn(`%c[svelte] console_log_state
|
|
525
|
+
%cYour \`console.${e}\` contained \`$state\` proxies. Consider using \`$inspect(...)\` or \`$state.snapshot(...)\` instead
|
|
526
|
+
https://svelte.dev/e/console_log_state`, Ze, Ke);
|
|
527
|
+
}
|
|
528
|
+
function Us(e) {
|
|
529
|
+
console.warn(`%c[svelte] hydration_html_changed
|
|
530
|
+
%c${e ? `The value of an \`{@html ...}\` block ${e} changed between server and client renders. The client value will be ignored in favour of the server value` : "The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value"}
|
|
531
|
+
https://svelte.dev/e/hydration_html_changed`, Ze, Ke);
|
|
532
|
+
}
|
|
533
|
+
function Ut(e) {
|
|
534
|
+
console.warn(`%c[svelte] hydration_mismatch
|
|
535
|
+
%cHydration failed because the initial UI does not match what was rendered on the server
|
|
536
|
+
https://svelte.dev/e/hydration_mismatch`, Ze, Ke);
|
|
537
|
+
}
|
|
538
|
+
function Ds() {
|
|
539
|
+
console.warn(`%c[svelte] lifecycle_double_unmount
|
|
540
|
+
%cTried to unmount a component that was not mounted
|
|
541
|
+
https://svelte.dev/e/lifecycle_double_unmount`, Ze, Ke);
|
|
542
|
+
}
|
|
543
|
+
function Sn(e, t) {
|
|
544
|
+
console.warn(`%c[svelte] ownership_invalid_mutation
|
|
545
|
+
%c${e ? `${e} mutated a value owned by ${t}. This is strongly discouraged. Consider passing values to child components with \`bind:\`, or use a callback instead` : "Mutating a value outside the component that created it is strongly discouraged. Consider passing values to child components with `bind:`, or use a callback instead"}
|
|
546
|
+
https://svelte.dev/e/ownership_invalid_mutation`, Ze, Ke);
|
|
547
|
+
}
|
|
548
|
+
function yt(e) {
|
|
549
|
+
console.warn(`%c[svelte] state_proxy_equality_mismatch
|
|
550
|
+
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${e}\` will produce unexpected results
|
|
551
|
+
https://svelte.dev/e/state_proxy_equality_mismatch`, Ze, Ke);
|
|
552
|
+
}
|
|
553
|
+
let A = !1;
|
|
554
|
+
function qe(e) {
|
|
555
|
+
A = e;
|
|
556
|
+
}
|
|
557
|
+
let D;
|
|
558
|
+
function ve(e) {
|
|
559
|
+
if (e === null)
|
|
560
|
+
throw Ut(), Ve;
|
|
561
|
+
return D = e;
|
|
562
|
+
}
|
|
563
|
+
function dt() {
|
|
564
|
+
return ve(
|
|
565
|
+
/** @type {TemplateNode} */
|
|
566
|
+
/* @__PURE__ */ Be(D)
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
function oe(e) {
|
|
570
|
+
if (A) {
|
|
571
|
+
if (/* @__PURE__ */ Be(D) !== null)
|
|
572
|
+
throw Ut(), Ve;
|
|
573
|
+
D = e;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
function As() {
|
|
577
|
+
for (var e = 0, t = D; ; ) {
|
|
578
|
+
if (t.nodeType === 8) {
|
|
579
|
+
var n = (
|
|
580
|
+
/** @type {Comment} */
|
|
581
|
+
t.data
|
|
582
|
+
);
|
|
583
|
+
if (n === on) {
|
|
584
|
+
if (e === 0) return t;
|
|
585
|
+
e -= 1;
|
|
586
|
+
} else (n === It || n === sn) && (e += 1);
|
|
587
|
+
}
|
|
588
|
+
var r = (
|
|
589
|
+
/** @type {TemplateNode} */
|
|
590
|
+
/* @__PURE__ */ Be(t)
|
|
591
|
+
);
|
|
592
|
+
t.remove(), t = r;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
function Bs() {
|
|
596
|
+
const e = Array.prototype, t = Array.__svelte_cleanup;
|
|
597
|
+
t && t();
|
|
598
|
+
const { indexOf: n, lastIndexOf: r, includes: s } = e;
|
|
599
|
+
e.indexOf = function(i, o) {
|
|
600
|
+
const l = n.call(this, i, o);
|
|
601
|
+
if (l === -1) {
|
|
602
|
+
for (let c = o ?? 0; c < this.length; c += 1)
|
|
603
|
+
if (it(this[c]) === i) {
|
|
604
|
+
yt("array.indexOf(...)");
|
|
605
|
+
break;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
return l;
|
|
609
|
+
}, e.lastIndexOf = function(i, o) {
|
|
610
|
+
const l = r.call(this, i, o ?? this.length - 1);
|
|
611
|
+
if (l === -1) {
|
|
612
|
+
for (let c = 0; c <= (o ?? this.length - 1); c += 1)
|
|
613
|
+
if (it(this[c]) === i) {
|
|
614
|
+
yt("array.lastIndexOf(...)");
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
return l;
|
|
619
|
+
}, e.includes = function(i, o) {
|
|
620
|
+
const l = s.call(this, i, o);
|
|
621
|
+
if (!l) {
|
|
622
|
+
for (let c = 0; c < this.length; c += 1)
|
|
623
|
+
if (it(this[c]) === i) {
|
|
624
|
+
yt("array.includes(...)");
|
|
625
|
+
break;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
return l;
|
|
629
|
+
}, Array.__svelte_cleanup = () => {
|
|
630
|
+
e.indexOf = n, e.lastIndexOf = r, e.includes = s;
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
function S(e, t, n = !0) {
|
|
634
|
+
try {
|
|
635
|
+
e === t != (it(e) === it(t)) && yt(n ? "===" : "!==");
|
|
636
|
+
} catch {
|
|
637
|
+
}
|
|
638
|
+
return e === t === n;
|
|
639
|
+
}
|
|
640
|
+
var xn, fn, ur, fr;
|
|
641
|
+
function Zt() {
|
|
642
|
+
if (xn === void 0) {
|
|
643
|
+
xn = window, fn = /Firefox/.test(navigator.userAgent);
|
|
644
|
+
var e = Element.prototype, t = Node.prototype, n = Text.prototype;
|
|
645
|
+
ur = Fe(t, "firstChild").get, fr = Fe(t, "nextSibling").get, En(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), En(n) && (n.__t = void 0), e.__svelte_meta = null, Bs();
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
function Ct(e = "") {
|
|
649
|
+
return document.createTextNode(e);
|
|
650
|
+
}
|
|
651
|
+
// @__NO_SIDE_EFFECTS__
|
|
652
|
+
function ht(e) {
|
|
653
|
+
return ur.call(e);
|
|
654
|
+
}
|
|
655
|
+
// @__NO_SIDE_EFFECTS__
|
|
656
|
+
function Be(e) {
|
|
657
|
+
return fr.call(e);
|
|
658
|
+
}
|
|
659
|
+
function le(e, t) {
|
|
660
|
+
if (!A)
|
|
661
|
+
return /* @__PURE__ */ ht(e);
|
|
662
|
+
var n = (
|
|
663
|
+
/** @type {TemplateNode} */
|
|
664
|
+
/* @__PURE__ */ ht(D)
|
|
665
|
+
);
|
|
666
|
+
if (n === null)
|
|
667
|
+
n = D.appendChild(Ct());
|
|
668
|
+
else if (t && n.nodeType !== 3) {
|
|
669
|
+
var r = Ct();
|
|
670
|
+
return n?.before(r), ve(r), r;
|
|
671
|
+
}
|
|
672
|
+
return ve(n), n;
|
|
673
|
+
}
|
|
674
|
+
function Kt(e, t = 1, n = !1) {
|
|
675
|
+
let r = A ? D : e;
|
|
676
|
+
for (var s; t--; )
|
|
677
|
+
s = r, r = /** @type {TemplateNode} */
|
|
678
|
+
/* @__PURE__ */ Be(r);
|
|
679
|
+
if (!A)
|
|
680
|
+
return r;
|
|
681
|
+
var i = r?.nodeType;
|
|
682
|
+
if (n && i !== 3) {
|
|
683
|
+
var o = Ct();
|
|
684
|
+
return r === null ? s?.after(o) : r.before(o), ve(o), o;
|
|
685
|
+
}
|
|
686
|
+
return ve(r), /** @type {TemplateNode} */
|
|
687
|
+
r;
|
|
688
|
+
}
|
|
689
|
+
function Ns(e) {
|
|
690
|
+
e.textContent = "";
|
|
691
|
+
}
|
|
692
|
+
const Tn = /* @__PURE__ */ new WeakSet();
|
|
693
|
+
let bt = !1, Pt = !1, St = null, Oe = !1, pt = !1;
|
|
694
|
+
function Ln(e) {
|
|
695
|
+
pt = e;
|
|
696
|
+
}
|
|
697
|
+
let ot = [], xt = [], $ = null, ae = !1;
|
|
698
|
+
function Se(e) {
|
|
699
|
+
$ = e;
|
|
700
|
+
}
|
|
701
|
+
let T = null;
|
|
702
|
+
function Je(e) {
|
|
703
|
+
T = e;
|
|
704
|
+
}
|
|
705
|
+
let pe = null;
|
|
706
|
+
function Ms(e) {
|
|
707
|
+
pe = e;
|
|
708
|
+
}
|
|
709
|
+
function dr(e) {
|
|
710
|
+
$ !== null && $.f & Wt && (pe === null ? Ms([e]) : pe.push(e));
|
|
711
|
+
}
|
|
712
|
+
let Q = null, Y = 0, K = null;
|
|
713
|
+
function js(e) {
|
|
714
|
+
K = e;
|
|
715
|
+
}
|
|
716
|
+
let hr = 1, Tt = 0, $e = !1;
|
|
717
|
+
function gr() {
|
|
718
|
+
return ++hr;
|
|
719
|
+
}
|
|
720
|
+
function et(e) {
|
|
721
|
+
var t = e.f;
|
|
722
|
+
if ((t & ye) !== 0)
|
|
723
|
+
return !0;
|
|
724
|
+
if ((t & Ae) !== 0) {
|
|
725
|
+
var n = e.deps, r = (t & te) !== 0;
|
|
726
|
+
if (n !== null) {
|
|
727
|
+
var s, i, o = (t & $t) !== 0, l = r && T !== null && !$e, c = n.length;
|
|
728
|
+
if (o || l) {
|
|
729
|
+
var a = (
|
|
730
|
+
/** @type {Derived} */
|
|
731
|
+
e
|
|
732
|
+
), u = a.parent;
|
|
733
|
+
for (s = 0; s < c; s++)
|
|
734
|
+
i = n[s], (o || !i?.reactions?.includes(a)) && (i.reactions ?? (i.reactions = [])).push(a);
|
|
735
|
+
o && (a.f ^= $t), l && u !== null && (u.f & te) === 0 && (a.f ^= te);
|
|
736
|
+
}
|
|
737
|
+
for (s = 0; s < c; s++)
|
|
738
|
+
if (i = n[s], et(
|
|
739
|
+
/** @type {Derived} */
|
|
740
|
+
i
|
|
741
|
+
) && cr(
|
|
742
|
+
/** @type {Derived} */
|
|
743
|
+
i
|
|
744
|
+
), i.wv > e.wv)
|
|
745
|
+
return !0;
|
|
746
|
+
}
|
|
747
|
+
(!r || T !== null && !$e) && re(e, V);
|
|
748
|
+
}
|
|
749
|
+
return !1;
|
|
750
|
+
}
|
|
751
|
+
function kn(e, t) {
|
|
752
|
+
for (var n = t; n !== null; ) {
|
|
753
|
+
if ((n.f & Et) !== 0)
|
|
754
|
+
try {
|
|
755
|
+
n.fn(e);
|
|
756
|
+
return;
|
|
757
|
+
} catch {
|
|
758
|
+
n.f ^= Et;
|
|
759
|
+
}
|
|
760
|
+
n = n.parent;
|
|
761
|
+
}
|
|
762
|
+
throw bt = !1, e;
|
|
763
|
+
}
|
|
764
|
+
function In(e) {
|
|
765
|
+
return (e.f & Ot) === 0 && (e.parent === null || (e.parent.f & Et) === 0);
|
|
766
|
+
}
|
|
767
|
+
function Dt(e, t, n, r) {
|
|
768
|
+
if (bt) {
|
|
769
|
+
if (n === null && (bt = !1), In(t))
|
|
770
|
+
throw e;
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
if (n !== null && (bt = !0), r === null || !(e instanceof Error) || Tn.has(e)) {
|
|
774
|
+
kn(e, t);
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
Tn.add(e);
|
|
778
|
+
const s = [], i = t.fn?.name;
|
|
779
|
+
i && s.push(i);
|
|
780
|
+
let o = r;
|
|
781
|
+
for (; o !== null; ) {
|
|
782
|
+
{
|
|
783
|
+
var l = o.function?.[k];
|
|
784
|
+
if (l) {
|
|
785
|
+
const u = l.split("/").pop();
|
|
786
|
+
s.push(u);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
o = o.p;
|
|
790
|
+
}
|
|
791
|
+
const c = fn ? " " : " ";
|
|
792
|
+
ce(e, "message", {
|
|
793
|
+
value: e.message + `
|
|
794
|
+
${s.map((u) => `
|
|
795
|
+
${c}in ${u}`).join("")}
|
|
796
|
+
`
|
|
797
|
+
}), ce(e, "component_stack", {
|
|
798
|
+
value: s
|
|
799
|
+
});
|
|
800
|
+
const a = e.stack;
|
|
801
|
+
if (a) {
|
|
802
|
+
const u = a.split(`
|
|
803
|
+
`), d = [];
|
|
804
|
+
for (let f = 0; f < u.length; f++) {
|
|
805
|
+
const g = u[f];
|
|
806
|
+
g.includes("svelte/src/internal") || d.push(g);
|
|
807
|
+
}
|
|
808
|
+
ce(e, "stack", {
|
|
809
|
+
value: d.join(`
|
|
810
|
+
`)
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
if (kn(e, t), In(t))
|
|
814
|
+
throw e;
|
|
815
|
+
}
|
|
816
|
+
function pr(e, t, n = !0) {
|
|
817
|
+
var r = e.reactions;
|
|
818
|
+
if (r !== null)
|
|
819
|
+
for (var s = 0; s < r.length; s++) {
|
|
820
|
+
var i = r[s];
|
|
821
|
+
pe?.includes(e) || ((i.f & fe) !== 0 ? pr(
|
|
822
|
+
/** @type {Derived} */
|
|
823
|
+
i,
|
|
824
|
+
t,
|
|
825
|
+
!1
|
|
826
|
+
) : t === i && (n ? re(i, ye) : (i.f & V) !== 0 && re(i, Ae), Bt(
|
|
827
|
+
/** @type {Effect} */
|
|
828
|
+
i
|
|
829
|
+
)));
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
function vr(e) {
|
|
833
|
+
var g;
|
|
834
|
+
var t = Q, n = Y, r = K, s = $, i = $e, o = pe, l = B, c = ae, a = e.f;
|
|
835
|
+
Q = /** @type {null | Value[]} */
|
|
836
|
+
null, Y = 0, K = null, $e = (a & te) !== 0 && (ae || !Oe || $ === null), $ = (a & (_e | De)) === 0 ? e : null, pe = null, Dn(e.ctx), ae = !1, Tt++, e.f |= Wt;
|
|
837
|
+
try {
|
|
838
|
+
var u = (
|
|
839
|
+
/** @type {Function} */
|
|
840
|
+
(0, e.fn)()
|
|
841
|
+
), d = e.deps;
|
|
842
|
+
if (Q !== null) {
|
|
843
|
+
var f;
|
|
844
|
+
if (Lt(e, Y), d !== null && Y > 0)
|
|
845
|
+
for (d.length = Y + Q.length, f = 0; f < Q.length; f++)
|
|
846
|
+
d[Y + f] = Q[f];
|
|
847
|
+
else
|
|
848
|
+
e.deps = d = Q;
|
|
849
|
+
if (!$e)
|
|
850
|
+
for (f = Y; f < d.length; f++)
|
|
851
|
+
((g = d[f]).reactions ?? (g.reactions = [])).push(e);
|
|
852
|
+
} else d !== null && Y < d.length && (Lt(e, Y), d.length = Y);
|
|
853
|
+
if (kr() && K !== null && !ae && d !== null && (e.f & (fe | Ae | ye)) === 0)
|
|
854
|
+
for (f = 0; f < /** @type {Source[]} */
|
|
855
|
+
K.length; f++)
|
|
856
|
+
pr(
|
|
857
|
+
K[f],
|
|
858
|
+
/** @type {Effect} */
|
|
859
|
+
e
|
|
860
|
+
);
|
|
861
|
+
return s !== null && (Tt++, K !== null && (r === null ? r = K : r.push(.../** @type {Source[]} */
|
|
862
|
+
K))), u;
|
|
863
|
+
} finally {
|
|
864
|
+
Q = t, Y = n, K = r, $ = s, $e = i, pe = o, Dn(l), ae = c, e.f ^= Wt;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
function Qs(e, t) {
|
|
868
|
+
let n = t.reactions;
|
|
869
|
+
if (n !== null) {
|
|
870
|
+
var r = as.call(n, e);
|
|
871
|
+
if (r !== -1) {
|
|
872
|
+
var s = n.length - 1;
|
|
873
|
+
s === 0 ? n = t.reactions = null : (n[r] = n[s], n.pop());
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
n === null && (t.f & fe) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
877
|
+
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
878
|
+
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
879
|
+
(Q === null || !Q.includes(t)) && (re(t, Ae), (t.f & (te | $t)) === 0 && (t.f ^= $t), ar(
|
|
880
|
+
/** @type {Derived} **/
|
|
881
|
+
t
|
|
882
|
+
), Lt(
|
|
883
|
+
/** @type {Derived} **/
|
|
884
|
+
t,
|
|
885
|
+
0
|
|
886
|
+
));
|
|
887
|
+
}
|
|
888
|
+
function Lt(e, t) {
|
|
889
|
+
var n = e.deps;
|
|
890
|
+
if (n !== null)
|
|
891
|
+
for (var r = t; r < n.length; r++)
|
|
892
|
+
Qs(e, n[r]);
|
|
893
|
+
}
|
|
894
|
+
function At(e) {
|
|
895
|
+
var t = e.f;
|
|
896
|
+
if ((t & Ot) === 0) {
|
|
897
|
+
re(e, V);
|
|
898
|
+
var n = T, r = B, s = Oe;
|
|
899
|
+
T = e, Oe = !0;
|
|
900
|
+
{
|
|
901
|
+
var i = Ue;
|
|
902
|
+
An(e.component_function);
|
|
903
|
+
}
|
|
904
|
+
try {
|
|
905
|
+
(t & ln) !== 0 ? Zs(e) : wr(e), br(e);
|
|
906
|
+
var o = vr(e);
|
|
907
|
+
e.teardown = typeof o == "function" ? o : null, e.wv = hr;
|
|
908
|
+
var l = e.deps, c;
|
|
909
|
+
wn && Ps && e.f & ye, wn && xt.push(e);
|
|
910
|
+
} catch (a) {
|
|
911
|
+
Dt(a, e, n, r || e.ctx);
|
|
912
|
+
} finally {
|
|
913
|
+
Oe = s, T = n, An(i);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
function Fn() {
|
|
918
|
+
console.error(
|
|
919
|
+
"Last ten effects were: ",
|
|
920
|
+
xt.slice(-10).map((e) => e.fn)
|
|
921
|
+
), xt = [];
|
|
922
|
+
}
|
|
923
|
+
function zs() {
|
|
924
|
+
try {
|
|
925
|
+
ys();
|
|
926
|
+
} catch (e) {
|
|
927
|
+
if (ce(e, "stack", {
|
|
928
|
+
value: ""
|
|
929
|
+
}), St !== null)
|
|
930
|
+
try {
|
|
931
|
+
Dt(e, St, null, null);
|
|
932
|
+
} catch (t) {
|
|
933
|
+
throw Fn(), t;
|
|
934
|
+
}
|
|
935
|
+
else
|
|
936
|
+
throw Fn(), e;
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
function mr() {
|
|
940
|
+
var e = Oe;
|
|
941
|
+
try {
|
|
942
|
+
var t = 0;
|
|
943
|
+
for (Oe = !0; ot.length > 0; ) {
|
|
944
|
+
t++ > 1e3 && zs();
|
|
945
|
+
var n = ot, r = n.length;
|
|
946
|
+
ot = [];
|
|
947
|
+
for (var s = 0; s < r; s++) {
|
|
948
|
+
var i = Hs(n[s]);
|
|
949
|
+
qs(i);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
} finally {
|
|
953
|
+
Pt = !1, Oe = e, St = null, xt = [], ft.clear();
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
function qs(e) {
|
|
957
|
+
var t = e.length;
|
|
958
|
+
if (t !== 0)
|
|
959
|
+
for (var n = 0; n < t; n++) {
|
|
960
|
+
var r = e[n];
|
|
961
|
+
if ((r.f & (Ot | Ye)) === 0)
|
|
962
|
+
try {
|
|
963
|
+
et(r) && (At(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? Er(r) : r.fn = null));
|
|
964
|
+
} catch (s) {
|
|
965
|
+
Dt(s, r, null, r.ctx);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
function Bt(e) {
|
|
970
|
+
Pt || (Pt = !0, queueMicrotask(mr));
|
|
971
|
+
for (var t = St = e; t.parent !== null; ) {
|
|
972
|
+
t = t.parent;
|
|
973
|
+
var n = t.f;
|
|
974
|
+
if ((n & (De | _e)) !== 0) {
|
|
975
|
+
if ((n & V) === 0) return;
|
|
976
|
+
t.f ^= V;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
ot.push(t);
|
|
980
|
+
}
|
|
981
|
+
function Hs(e) {
|
|
982
|
+
for (var t = [], n = e; n !== null; ) {
|
|
983
|
+
var r = n.f, s = (r & (_e | De)) !== 0, i = s && (r & V) !== 0;
|
|
984
|
+
if (!i && (r & Ye) === 0) {
|
|
985
|
+
if ((r & Yn) !== 0)
|
|
986
|
+
t.push(n);
|
|
987
|
+
else if (s)
|
|
988
|
+
n.f ^= V;
|
|
989
|
+
else {
|
|
990
|
+
var o = $;
|
|
991
|
+
try {
|
|
992
|
+
$ = n, et(n) && At(n);
|
|
993
|
+
} catch (a) {
|
|
994
|
+
Dt(a, n, null, n.ctx);
|
|
995
|
+
} finally {
|
|
996
|
+
$ = o;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
var l = n.first;
|
|
1000
|
+
if (l !== null) {
|
|
1001
|
+
n = l;
|
|
1002
|
+
continue;
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
var c = n.parent;
|
|
1006
|
+
for (n = n.next; n === null && c !== null; )
|
|
1007
|
+
n = c.next, c = c.parent;
|
|
1008
|
+
}
|
|
1009
|
+
return t;
|
|
1010
|
+
}
|
|
1011
|
+
function E(e) {
|
|
1012
|
+
var t;
|
|
1013
|
+
for ($n(); ot.length > 0; )
|
|
1014
|
+
Pt = !0, mr(), $n();
|
|
1015
|
+
return (
|
|
1016
|
+
/** @type {T} */
|
|
1017
|
+
t
|
|
1018
|
+
);
|
|
1019
|
+
}
|
|
1020
|
+
async function _r() {
|
|
1021
|
+
await Promise.resolve(), E();
|
|
1022
|
+
}
|
|
1023
|
+
function p(e) {
|
|
1024
|
+
var t = e.f, n = (t & fe) !== 0;
|
|
1025
|
+
if ($ !== null && !ae) {
|
|
1026
|
+
if (!pe?.includes(e)) {
|
|
1027
|
+
var r = $.deps;
|
|
1028
|
+
e.rv < Tt && (e.rv = Tt, Q === null && r !== null && r[Y] === e ? Y++ : Q === null ? Q = [e] : (!$e || !Q.includes(e)) && Q.push(e));
|
|
1029
|
+
}
|
|
1030
|
+
} else if (n && /** @type {Derived} */
|
|
1031
|
+
e.deps === null && /** @type {Derived} */
|
|
1032
|
+
e.effects === null) {
|
|
1033
|
+
var s = (
|
|
1034
|
+
/** @type {Derived} */
|
|
1035
|
+
e
|
|
1036
|
+
), i = s.parent;
|
|
1037
|
+
i !== null && (i.f & te) === 0 && (s.f ^= te);
|
|
1038
|
+
}
|
|
1039
|
+
return n && (s = /** @type {Derived} */
|
|
1040
|
+
e, et(s) && cr(s)), pt && ft.has(e) ? ft.get(e) : e.v;
|
|
1041
|
+
}
|
|
1042
|
+
function We(e) {
|
|
1043
|
+
var t = ae;
|
|
1044
|
+
try {
|
|
1045
|
+
return ae = !0, e();
|
|
1046
|
+
} finally {
|
|
1047
|
+
ae = t;
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
const Vs = -7169;
|
|
1051
|
+
function re(e, t) {
|
|
1052
|
+
e.f = e.f & Vs | t;
|
|
1053
|
+
}
|
|
1054
|
+
function Gs(e) {
|
|
1055
|
+
T === null && $ === null && _s(e), $ !== null && ($.f & te) !== 0 && T === null && ms(), pt && vs(e);
|
|
1056
|
+
}
|
|
1057
|
+
function Ys(e, t) {
|
|
1058
|
+
var n = t.last;
|
|
1059
|
+
n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
|
|
1060
|
+
}
|
|
1061
|
+
function Ne(e, t, n, r = !0) {
|
|
1062
|
+
for (var s = T; s !== null && (s.f & Jn) !== 0; )
|
|
1063
|
+
s = s.parent;
|
|
1064
|
+
var i = {
|
|
1065
|
+
ctx: B,
|
|
1066
|
+
deps: null,
|
|
1067
|
+
nodes_start: null,
|
|
1068
|
+
nodes_end: null,
|
|
1069
|
+
f: e | ye,
|
|
1070
|
+
first: null,
|
|
1071
|
+
fn: t,
|
|
1072
|
+
last: null,
|
|
1073
|
+
next: null,
|
|
1074
|
+
parent: s,
|
|
1075
|
+
prev: null,
|
|
1076
|
+
teardown: null,
|
|
1077
|
+
transitions: null,
|
|
1078
|
+
wv: 0
|
|
1079
|
+
};
|
|
1080
|
+
if (i.component_function = Ue, n)
|
|
1081
|
+
try {
|
|
1082
|
+
At(i), i.f |= os;
|
|
1083
|
+
} catch (c) {
|
|
1084
|
+
throw me(i), c;
|
|
1085
|
+
}
|
|
1086
|
+
else t !== null && Bt(i);
|
|
1087
|
+
var o = n && i.deps === null && i.first === null && i.nodes_start === null && i.teardown === null && (i.f & (Wn | Et)) === 0;
|
|
1088
|
+
if (!o && r && (s !== null && Ys(i, s), $ !== null && ($.f & fe) !== 0)) {
|
|
1089
|
+
var l = (
|
|
1090
|
+
/** @type {Derived} */
|
|
1091
|
+
$
|
|
1092
|
+
);
|
|
1093
|
+
(l.effects ?? (l.effects = [])).push(i);
|
|
1094
|
+
}
|
|
1095
|
+
return i;
|
|
1096
|
+
}
|
|
1097
|
+
function Js(e) {
|
|
1098
|
+
const t = Ne(Ft, null, !1);
|
|
1099
|
+
return re(t, V), t.teardown = e, t;
|
|
1100
|
+
}
|
|
1101
|
+
function Re(e) {
|
|
1102
|
+
Gs("$effect");
|
|
1103
|
+
var t = T !== null && (T.f & _e) !== 0 && B !== null && !B.m;
|
|
1104
|
+
if (ce(e, "name", {
|
|
1105
|
+
value: "$effect"
|
|
1106
|
+
}), t) {
|
|
1107
|
+
var n = (
|
|
1108
|
+
/** @type {ComponentContext} */
|
|
1109
|
+
B
|
|
1110
|
+
);
|
|
1111
|
+
(n.e ?? (n.e = [])).push({
|
|
1112
|
+
fn: e,
|
|
1113
|
+
effect: T,
|
|
1114
|
+
reaction: $
|
|
1115
|
+
});
|
|
1116
|
+
} else {
|
|
1117
|
+
var r = dn(e);
|
|
1118
|
+
return r;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
function Ws(e) {
|
|
1122
|
+
const t = Ne(De, e, !0);
|
|
1123
|
+
return () => {
|
|
1124
|
+
me(t);
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
function Xs(e) {
|
|
1128
|
+
const t = Ne(De, e, !0);
|
|
1129
|
+
return (n = {}) => new Promise((r) => {
|
|
1130
|
+
n.outro ? en(t, () => {
|
|
1131
|
+
me(t), r(void 0);
|
|
1132
|
+
}) : (me(t), r(void 0));
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
function dn(e) {
|
|
1136
|
+
return Ne(Yn, e, !1);
|
|
1137
|
+
}
|
|
1138
|
+
function yr(e) {
|
|
1139
|
+
return Ne(Ft, e, !0);
|
|
1140
|
+
}
|
|
1141
|
+
function lt(e, t = [], n = un) {
|
|
1142
|
+
const r = t.map(n), s = () => e(...r.map(p));
|
|
1143
|
+
return ce(s, "name", {
|
|
1144
|
+
value: "{expression}"
|
|
1145
|
+
}), hn(s);
|
|
1146
|
+
}
|
|
1147
|
+
function hn(e, t = 0) {
|
|
1148
|
+
return Ne(Ft | ln | t, e, !0);
|
|
1149
|
+
}
|
|
1150
|
+
function kt(e, t = !0) {
|
|
1151
|
+
return Ne(Ft | _e, e, !0, t);
|
|
1152
|
+
}
|
|
1153
|
+
function br(e) {
|
|
1154
|
+
var t = e.teardown;
|
|
1155
|
+
if (t !== null) {
|
|
1156
|
+
const n = pt, r = $;
|
|
1157
|
+
Ln(!0), Se(null);
|
|
1158
|
+
try {
|
|
1159
|
+
t.call(null);
|
|
1160
|
+
} finally {
|
|
1161
|
+
Ln(n), Se(r);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
function wr(e, t = !1) {
|
|
1166
|
+
var n = e.first;
|
|
1167
|
+
for (e.first = e.last = null; n !== null; ) {
|
|
1168
|
+
var r = n.next;
|
|
1169
|
+
(n.f & De) !== 0 ? n.parent = null : me(n, t), n = r;
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
function Zs(e) {
|
|
1173
|
+
for (var t = e.first; t !== null; ) {
|
|
1174
|
+
var n = t.next;
|
|
1175
|
+
(t.f & _e) === 0 && me(t), t = n;
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
function me(e, t = !0) {
|
|
1179
|
+
var n = !1;
|
|
1180
|
+
if ((t || (e.f & ls) !== 0) && e.nodes_start !== null) {
|
|
1181
|
+
for (var r = e.nodes_start, s = e.nodes_end; r !== null; ) {
|
|
1182
|
+
var i = r === s ? null : (
|
|
1183
|
+
/** @type {TemplateNode} */
|
|
1184
|
+
/* @__PURE__ */ Be(r)
|
|
1185
|
+
);
|
|
1186
|
+
r.remove(), r = i;
|
|
1187
|
+
}
|
|
1188
|
+
n = !0;
|
|
1189
|
+
}
|
|
1190
|
+
wr(e, t && !n), Lt(e, 0), re(e, Ot);
|
|
1191
|
+
var o = e.transitions;
|
|
1192
|
+
if (o !== null)
|
|
1193
|
+
for (const c of o)
|
|
1194
|
+
c.stop();
|
|
1195
|
+
br(e);
|
|
1196
|
+
var l = e.parent;
|
|
1197
|
+
l !== null && l.first !== null && Er(e), e.component_function = null, e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes_start = e.nodes_end = null;
|
|
1198
|
+
}
|
|
1199
|
+
function Er(e) {
|
|
1200
|
+
var t = e.parent, n = e.prev, r = e.next;
|
|
1201
|
+
n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
|
|
1202
|
+
}
|
|
1203
|
+
function en(e, t) {
|
|
1204
|
+
var n = [];
|
|
1205
|
+
$r(e, n, !0), Ks(n, () => {
|
|
1206
|
+
me(e), t && t();
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
function Ks(e, t) {
|
|
1210
|
+
var n = e.length;
|
|
1211
|
+
if (n > 0) {
|
|
1212
|
+
var r = () => --n || t();
|
|
1213
|
+
for (var s of e)
|
|
1214
|
+
s.out(r);
|
|
1215
|
+
} else
|
|
1216
|
+
t();
|
|
1217
|
+
}
|
|
1218
|
+
function $r(e, t, n) {
|
|
1219
|
+
if ((e.f & Ye) === 0) {
|
|
1220
|
+
if (e.f ^= Ye, e.transitions !== null)
|
|
1221
|
+
for (const o of e.transitions)
|
|
1222
|
+
(o.is_global || n) && t.push(o);
|
|
1223
|
+
for (var r = e.first; r !== null; ) {
|
|
1224
|
+
var s = r.next, i = (r.f & an) !== 0 || (r.f & _e) !== 0;
|
|
1225
|
+
$r(r, t, i ? n : !1), r = s;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
function On(e) {
|
|
1230
|
+
Rr(e, !0);
|
|
1231
|
+
}
|
|
1232
|
+
function Rr(e, t) {
|
|
1233
|
+
if ((e.f & Ye) !== 0) {
|
|
1234
|
+
e.f ^= Ye, (e.f & V) === 0 && (e.f ^= V), et(e) && (re(e, ye), Bt(e));
|
|
1235
|
+
for (var n = e.first; n !== null; ) {
|
|
1236
|
+
var r = n.next, s = (n.f & an) !== 0 || (n.f & _e) !== 0;
|
|
1237
|
+
Rr(n, s ? t : !1), n = r;
|
|
1238
|
+
}
|
|
1239
|
+
if (e.transitions !== null)
|
|
1240
|
+
for (const i of e.transitions)
|
|
1241
|
+
(i.is_global || t) && i.in();
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
const at = {}, ei = /at (?:.+ \()?(.+):(\d+):(\d+)\)?$/, ti = /@(.+):(\d+):(\d+)$/;
|
|
1245
|
+
function gn() {
|
|
1246
|
+
const e = new Error().stack;
|
|
1247
|
+
if (!e) return null;
|
|
1248
|
+
const t = [];
|
|
1249
|
+
for (const n of e.split(`
|
|
1250
|
+
`)) {
|
|
1251
|
+
let r = ei.exec(n) ?? ti.exec(n);
|
|
1252
|
+
r && t.push({
|
|
1253
|
+
file: r[1],
|
|
1254
|
+
line: +r[2],
|
|
1255
|
+
column: +r[3]
|
|
1256
|
+
});
|
|
1257
|
+
}
|
|
1258
|
+
return t;
|
|
1259
|
+
}
|
|
1260
|
+
function Cr() {
|
|
1261
|
+
const e = gn()?.slice(4);
|
|
1262
|
+
if (!e) return null;
|
|
1263
|
+
for (let t = 0; t < e.length; t++) {
|
|
1264
|
+
const n = e[t], r = at[n.file];
|
|
1265
|
+
if (!r) {
|
|
1266
|
+
if (t === 0) return null;
|
|
1267
|
+
continue;
|
|
1268
|
+
}
|
|
1269
|
+
for (const s of r) {
|
|
1270
|
+
if (s.end == null)
|
|
1271
|
+
return null;
|
|
1272
|
+
if (s.start.line < n.line && s.end.line > n.line)
|
|
1273
|
+
return s.component;
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
return null;
|
|
1277
|
+
}
|
|
1278
|
+
function Pr() {
|
|
1279
|
+
var t;
|
|
1280
|
+
const e = gn()?.[2];
|
|
1281
|
+
e && (at[t = e.file] ?? (at[t] = [])).push({
|
|
1282
|
+
start: e,
|
|
1283
|
+
// @ts-expect-error
|
|
1284
|
+
end: null,
|
|
1285
|
+
// @ts-expect-error we add the component at the end, since HMR will overwrite the function
|
|
1286
|
+
component: null
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1289
|
+
function Sr(e) {
|
|
1290
|
+
const t = gn()?.[2];
|
|
1291
|
+
if (t) {
|
|
1292
|
+
const n = at[t.file], r = n[n.length - 1];
|
|
1293
|
+
r.end = t, r.component = e;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
function Un(e, t) {
|
|
1297
|
+
if (t.owners !== null)
|
|
1298
|
+
for (; e; ) {
|
|
1299
|
+
if (e.owners === null) {
|
|
1300
|
+
t.owners = null;
|
|
1301
|
+
break;
|
|
1302
|
+
}
|
|
1303
|
+
for (const n of e.owners)
|
|
1304
|
+
t.owners.add(n);
|
|
1305
|
+
e = e.parent;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
function xr(e, t) {
|
|
1309
|
+
return e.owners === null ? !0 : e.owners.has(t) || // This helps avoid false positives when using HMR, where the component function is replaced
|
|
1310
|
+
k in t && [...e.owners].some(
|
|
1311
|
+
(n) => (
|
|
1312
|
+
/** @type {any} */
|
|
1313
|
+
n[k] === t[k]
|
|
1314
|
+
)
|
|
1315
|
+
) || e.parent !== null && xr(e.parent, t);
|
|
1316
|
+
}
|
|
1317
|
+
function Tr(e) {
|
|
1318
|
+
return e?.owners?.values().next().value ?? Tr(
|
|
1319
|
+
/** @type {ProxyMetadata} */
|
|
1320
|
+
e.parent
|
|
1321
|
+
);
|
|
1322
|
+
}
|
|
1323
|
+
function ni(e) {
|
|
1324
|
+
const t = Cr();
|
|
1325
|
+
if (t && !xr(e, t)) {
|
|
1326
|
+
let n = Tr(e);
|
|
1327
|
+
n[k] !== t[k] ? Sn(t[k], n[k]) : Sn();
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
function Lr(e) {
|
|
1331
|
+
{
|
|
1332
|
+
const t = new Error(`lifecycle_outside_component
|
|
1333
|
+
\`${e}(...)\` can only be used during component initialisation
|
|
1334
|
+
https://svelte.dev/e/lifecycle_outside_component`);
|
|
1335
|
+
throw t.name = "Svelte error", t;
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
let B = null;
|
|
1339
|
+
function Dn(e) {
|
|
1340
|
+
B = e;
|
|
1341
|
+
}
|
|
1342
|
+
let Ue = null;
|
|
1343
|
+
function An(e) {
|
|
1344
|
+
Ue = e;
|
|
1345
|
+
}
|
|
1346
|
+
function pn(e, t = !1, n) {
|
|
1347
|
+
var r = B = {
|
|
1348
|
+
p: B,
|
|
1349
|
+
c: null,
|
|
1350
|
+
d: !1,
|
|
1351
|
+
e: null,
|
|
1352
|
+
m: !1,
|
|
1353
|
+
s: e,
|
|
1354
|
+
x: null,
|
|
1355
|
+
l: null
|
|
1356
|
+
};
|
|
1357
|
+
Js(() => {
|
|
1358
|
+
r.d = !0;
|
|
1359
|
+
}), B.function = n, Ue = n;
|
|
1360
|
+
}
|
|
1361
|
+
function vn(e) {
|
|
1362
|
+
const t = B;
|
|
1363
|
+
if (t !== null) {
|
|
1364
|
+
e !== void 0 && (t.x = e);
|
|
1365
|
+
const o = t.e;
|
|
1366
|
+
if (o !== null) {
|
|
1367
|
+
var n = T, r = $;
|
|
1368
|
+
t.e = null;
|
|
1369
|
+
try {
|
|
1370
|
+
for (var s = 0; s < o.length; s++) {
|
|
1371
|
+
var i = o[s];
|
|
1372
|
+
Je(i.effect), Se(i.reaction), dn(i.fn);
|
|
1373
|
+
}
|
|
1374
|
+
} finally {
|
|
1375
|
+
Je(n), Se(r);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
B = t.p, Ue = t.p?.function ?? null, t.m = !0;
|
|
1379
|
+
}
|
|
1380
|
+
return e || /** @type {T} */
|
|
1381
|
+
{};
|
|
1382
|
+
}
|
|
1383
|
+
function kr() {
|
|
1384
|
+
return !0;
|
|
1385
|
+
}
|
|
1386
|
+
const ri = /\r/g;
|
|
1387
|
+
function si(e) {
|
|
1388
|
+
e = e.replace(ri, "");
|
|
1389
|
+
let t = 5381, n = e.length;
|
|
1390
|
+
for (; n--; ) t = (t << 5) - t ^ e.charCodeAt(n);
|
|
1391
|
+
return (t >>> 0).toString(36);
|
|
1392
|
+
}
|
|
1393
|
+
const ii = ["touchstart", "touchmove"];
|
|
1394
|
+
function oi(e) {
|
|
1395
|
+
return ii.includes(e);
|
|
1396
|
+
}
|
|
1397
|
+
function li(e) {
|
|
1398
|
+
return e?.replace(/\//g, "/");
|
|
1399
|
+
}
|
|
1400
|
+
var Bn = /* @__PURE__ */ new Map();
|
|
1401
|
+
function ai(e, t) {
|
|
1402
|
+
var n = Bn.get(e);
|
|
1403
|
+
n || (n = /* @__PURE__ */ new Set(), Bn.set(e, n)), n.add(t);
|
|
1404
|
+
}
|
|
1405
|
+
function xe(e, t, n) {
|
|
1406
|
+
return (...r) => {
|
|
1407
|
+
const s = e(...r);
|
|
1408
|
+
var i = A ? s : s.nodeType === 11 ? s.firstChild : s;
|
|
1409
|
+
return Ir(i, t, n), s;
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
function ci(e, t, n) {
|
|
1413
|
+
e.__svelte_meta = {
|
|
1414
|
+
loc: { file: t, line: n[0], column: n[1] }
|
|
1415
|
+
}, n[2] && Ir(e.firstChild, t, n[2]);
|
|
1416
|
+
}
|
|
1417
|
+
function Ir(e, t, n) {
|
|
1418
|
+
for (var r = 0, s = 0; e && r < n.length; ) {
|
|
1419
|
+
if (A && e.nodeType === 8) {
|
|
1420
|
+
var i = (
|
|
1421
|
+
/** @type {Comment} */
|
|
1422
|
+
e
|
|
1423
|
+
);
|
|
1424
|
+
i.data === It || i.data === sn ? s += 1 : i.data[0] === on && (s -= 1);
|
|
1425
|
+
}
|
|
1426
|
+
s === 0 && e.nodeType === 1 && ci(
|
|
1427
|
+
/** @type {Element} */
|
|
1428
|
+
e,
|
|
1429
|
+
t,
|
|
1430
|
+
n[r++]
|
|
1431
|
+
), e = e.nextSibling;
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
const ui = /* @__PURE__ */ new Set(), Nn = /* @__PURE__ */ new Set();
|
|
1435
|
+
function vt(e) {
|
|
1436
|
+
var t = this, n = (
|
|
1437
|
+
/** @type {Node} */
|
|
1438
|
+
t.ownerDocument
|
|
1439
|
+
), r = e.type, s = e.composedPath?.() || [], i = (
|
|
1440
|
+
/** @type {null | Element} */
|
|
1441
|
+
s[0] || e.target
|
|
1442
|
+
), o = 0, l = e.__root;
|
|
1443
|
+
if (l) {
|
|
1444
|
+
var c = s.indexOf(l);
|
|
1445
|
+
if (c !== -1 && (t === document || t === /** @type {any} */
|
|
1446
|
+
window)) {
|
|
1447
|
+
e.__root = t;
|
|
1448
|
+
return;
|
|
1449
|
+
}
|
|
1450
|
+
var a = s.indexOf(t);
|
|
1451
|
+
if (a === -1)
|
|
1452
|
+
return;
|
|
1453
|
+
c <= a && (o = c);
|
|
1454
|
+
}
|
|
1455
|
+
if (i = /** @type {Element} */
|
|
1456
|
+
s[o] || e.target, i !== t) {
|
|
1457
|
+
ce(e, "currentTarget", {
|
|
1458
|
+
configurable: !0,
|
|
1459
|
+
get() {
|
|
1460
|
+
return i || n;
|
|
1461
|
+
}
|
|
1462
|
+
});
|
|
1463
|
+
var u = $, d = T;
|
|
1464
|
+
Se(null), Je(null);
|
|
1465
|
+
try {
|
|
1466
|
+
for (var f, g = []; i !== null; ) {
|
|
1467
|
+
var m = i.assignedSlot || i.parentNode || /** @type {any} */
|
|
1468
|
+
i.host || null;
|
|
1469
|
+
try {
|
|
1470
|
+
var y = i["__" + r];
|
|
1471
|
+
if (y != null && (!/** @type {any} */
|
|
1472
|
+
i.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1473
|
+
// -> the target could not have been disabled because it emits the event in the first place
|
|
1474
|
+
e.target === i))
|
|
1475
|
+
if (cn(y)) {
|
|
1476
|
+
var [R, ...N] = y;
|
|
1477
|
+
R.apply(i, [e, ...N]);
|
|
1478
|
+
} else
|
|
1479
|
+
y.call(i, e);
|
|
1480
|
+
} catch (F) {
|
|
1481
|
+
f ? g.push(F) : f = F;
|
|
1482
|
+
}
|
|
1483
|
+
if (e.cancelBubble || m === t || m === null)
|
|
1484
|
+
break;
|
|
1485
|
+
i = m;
|
|
1486
|
+
}
|
|
1487
|
+
if (f) {
|
|
1488
|
+
for (let F of g)
|
|
1489
|
+
queueMicrotask(() => {
|
|
1490
|
+
throw F;
|
|
1491
|
+
});
|
|
1492
|
+
throw f;
|
|
1493
|
+
}
|
|
1494
|
+
} finally {
|
|
1495
|
+
e.__root = t, delete e.currentTarget, Se(u), Je(d);
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
function Fr(e) {
|
|
1500
|
+
var t = document.createElement("template");
|
|
1501
|
+
return t.innerHTML = e, t.content;
|
|
1502
|
+
}
|
|
1503
|
+
function gt(e, t) {
|
|
1504
|
+
var n = (
|
|
1505
|
+
/** @type {Effect} */
|
|
1506
|
+
T
|
|
1507
|
+
);
|
|
1508
|
+
n.nodes_start === null && (n.nodes_start = e, n.nodes_end = t);
|
|
1509
|
+
}
|
|
1510
|
+
// @__NO_SIDE_EFFECTS__
|
|
1511
|
+
function Te(e, t) {
|
|
1512
|
+
var n = (t & is) !== 0, r, s = !e.startsWith("<!>");
|
|
1513
|
+
return () => {
|
|
1514
|
+
if (A)
|
|
1515
|
+
return gt(D, null), D;
|
|
1516
|
+
r === void 0 && (r = Fr(s ? e : "<!>" + e), r = /** @type {Node} */
|
|
1517
|
+
/* @__PURE__ */ ht(r));
|
|
1518
|
+
var i = (
|
|
1519
|
+
/** @type {TemplateNode} */
|
|
1520
|
+
n || fn ? document.importNode(r, !0) : r.cloneNode(!0)
|
|
1521
|
+
);
|
|
1522
|
+
return gt(i, i), i;
|
|
1523
|
+
};
|
|
1524
|
+
}
|
|
1525
|
+
function ge(e, t) {
|
|
1526
|
+
if (A) {
|
|
1527
|
+
T.nodes_end = D, dt();
|
|
1528
|
+
return;
|
|
1529
|
+
}
|
|
1530
|
+
e !== null && e.before(
|
|
1531
|
+
/** @type {Node} */
|
|
1532
|
+
t
|
|
1533
|
+
);
|
|
1534
|
+
}
|
|
1535
|
+
function fi(e, t) {
|
|
1536
|
+
var n = t == null ? "" : typeof t == "object" ? t + "" : t;
|
|
1537
|
+
n !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = n, e.nodeValue = n + "");
|
|
1538
|
+
}
|
|
1539
|
+
function Or(e, t) {
|
|
1540
|
+
return Ur(e, t);
|
|
1541
|
+
}
|
|
1542
|
+
function di(e, t) {
|
|
1543
|
+
Zt(), t.intro = t.intro ?? !1;
|
|
1544
|
+
const n = t.target, r = A, s = D;
|
|
1545
|
+
try {
|
|
1546
|
+
for (var i = (
|
|
1547
|
+
/** @type {TemplateNode} */
|
|
1548
|
+
/* @__PURE__ */ ht(n)
|
|
1549
|
+
); i && (i.nodeType !== 8 || /** @type {Comment} */
|
|
1550
|
+
i.data !== It); )
|
|
1551
|
+
i = /** @type {TemplateNode} */
|
|
1552
|
+
/* @__PURE__ */ Be(i);
|
|
1553
|
+
if (!i)
|
|
1554
|
+
throw Ve;
|
|
1555
|
+
qe(!0), ve(
|
|
1556
|
+
/** @type {Comment} */
|
|
1557
|
+
i
|
|
1558
|
+
), dt();
|
|
1559
|
+
const o = Ur(e, { ...t, anchor: i });
|
|
1560
|
+
if (D === null || D.nodeType !== 8 || /** @type {Comment} */
|
|
1561
|
+
D.data !== on)
|
|
1562
|
+
throw Ut(), Ve;
|
|
1563
|
+
return qe(!1), /** @type {Exports} */
|
|
1564
|
+
o;
|
|
1565
|
+
} catch (o) {
|
|
1566
|
+
if (o === Ve)
|
|
1567
|
+
return t.recover === !1 && bs(), Zt(), Ns(n), qe(!1), Or(e, t);
|
|
1568
|
+
throw o;
|
|
1569
|
+
} finally {
|
|
1570
|
+
qe(r), ve(s);
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
const ze = /* @__PURE__ */ new Map();
|
|
1574
|
+
function Ur(e, { target: t, anchor: n, props: r = {}, events: s, context: i, intro: o = !0 }) {
|
|
1575
|
+
Zt();
|
|
1576
|
+
var l = /* @__PURE__ */ new Set(), c = (d) => {
|
|
1577
|
+
for (var f = 0; f < d.length; f++) {
|
|
1578
|
+
var g = d[f];
|
|
1579
|
+
if (!l.has(g)) {
|
|
1580
|
+
l.add(g);
|
|
1581
|
+
var m = oi(g);
|
|
1582
|
+
t.addEventListener(g, vt, { passive: m });
|
|
1583
|
+
var y = ze.get(g);
|
|
1584
|
+
y === void 0 ? (document.addEventListener(g, vt, { passive: m }), ze.set(g, 1)) : ze.set(g, y + 1);
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
};
|
|
1588
|
+
c(cs(ui)), Nn.add(c);
|
|
1589
|
+
var a = void 0, u = Xs(() => {
|
|
1590
|
+
var d = n ?? t.appendChild(Ct());
|
|
1591
|
+
return kt(() => {
|
|
1592
|
+
if (i) {
|
|
1593
|
+
pn({});
|
|
1594
|
+
var f = (
|
|
1595
|
+
/** @type {ComponentContext} */
|
|
1596
|
+
B
|
|
1597
|
+
);
|
|
1598
|
+
f.c = i;
|
|
1599
|
+
}
|
|
1600
|
+
s && (r.$$events = s), A && gt(
|
|
1601
|
+
/** @type {TemplateNode} */
|
|
1602
|
+
d,
|
|
1603
|
+
null
|
|
1604
|
+
), a = e(d, r) || {}, A && (T.nodes_end = D), i && vn();
|
|
1605
|
+
}), () => {
|
|
1606
|
+
for (var f of l) {
|
|
1607
|
+
t.removeEventListener(f, vt);
|
|
1608
|
+
var g = (
|
|
1609
|
+
/** @type {number} */
|
|
1610
|
+
ze.get(f)
|
|
1611
|
+
);
|
|
1612
|
+
--g === 0 ? (document.removeEventListener(f, vt), ze.delete(f)) : ze.set(f, g);
|
|
1613
|
+
}
|
|
1614
|
+
Nn.delete(c), d !== n && d.parentNode?.removeChild(d);
|
|
1615
|
+
};
|
|
1616
|
+
});
|
|
1617
|
+
return tn.set(a, u), a;
|
|
1618
|
+
}
|
|
1619
|
+
let tn = /* @__PURE__ */ new WeakMap();
|
|
1620
|
+
function hi(e, t) {
|
|
1621
|
+
const n = tn.get(e);
|
|
1622
|
+
return n ? (tn.delete(e), n(t)) : (Ds(), Promise.resolve());
|
|
1623
|
+
}
|
|
1624
|
+
function Dr(e) {
|
|
1625
|
+
e && gs(e[k] ?? "a component", e.name);
|
|
1626
|
+
}
|
|
1627
|
+
function Ar() {
|
|
1628
|
+
const e = B?.function;
|
|
1629
|
+
function t(n) {
|
|
1630
|
+
const r = Cr()?.[k] ?? "Something";
|
|
1631
|
+
hs(r, n, e[k]);
|
|
1632
|
+
}
|
|
1633
|
+
return {
|
|
1634
|
+
$destroy: () => t("$destroy()"),
|
|
1635
|
+
$on: () => t("$on(...)"),
|
|
1636
|
+
$set: () => t("$set(...)")
|
|
1637
|
+
};
|
|
1638
|
+
}
|
|
1639
|
+
function ct(e, t, [n, r] = [0, 0]) {
|
|
1640
|
+
A && n === 0 && dt();
|
|
1641
|
+
var s = e, i = null, o = null, l = H, c = n > 0 ? an : 0, a = !1;
|
|
1642
|
+
const u = (f, g = !0) => {
|
|
1643
|
+
a = !0, d(g, f);
|
|
1644
|
+
}, d = (f, g) => {
|
|
1645
|
+
if (l === (l = f)) return;
|
|
1646
|
+
let m = !1;
|
|
1647
|
+
if (A && r !== -1) {
|
|
1648
|
+
if (n === 0) {
|
|
1649
|
+
const R = (
|
|
1650
|
+
/** @type {Comment} */
|
|
1651
|
+
s.data
|
|
1652
|
+
);
|
|
1653
|
+
R === It ? r = 0 : R === sn ? r = 1 / 0 : (r = parseInt(R.substring(1)), r !== r && (r = l ? 1 / 0 : -1));
|
|
1654
|
+
}
|
|
1655
|
+
const y = r > n;
|
|
1656
|
+
!!l === y && (s = As(), ve(s), qe(!1), m = !0, r = -1);
|
|
1657
|
+
}
|
|
1658
|
+
l ? (i ? On(i) : g && (i = kt(() => g(s))), o && en(o, () => {
|
|
1659
|
+
o = null;
|
|
1660
|
+
})) : (o ? On(o) : g && (o = kt(() => g(s, [n + 1, r]))), i && en(i, () => {
|
|
1661
|
+
i = null;
|
|
1662
|
+
})), m && qe(!0);
|
|
1663
|
+
};
|
|
1664
|
+
hn(() => {
|
|
1665
|
+
a = !1, t(u), a || d(null, null);
|
|
1666
|
+
}, c), A && (s = D);
|
|
1667
|
+
}
|
|
1668
|
+
function gi(e, t, n) {
|
|
1669
|
+
if (!t || t === si(String(n ?? ""))) return;
|
|
1670
|
+
let r;
|
|
1671
|
+
const s = e.__svelte_meta?.loc;
|
|
1672
|
+
s ? r = `near ${s.file}:${s.line}:${s.column}` : Ue?.[k] && (r = `in ${Ue[k]}`), Us(li(r));
|
|
1673
|
+
}
|
|
1674
|
+
function Mn(e, t, n, r, s) {
|
|
1675
|
+
var i = e, o = "", l;
|
|
1676
|
+
hn(() => {
|
|
1677
|
+
if (o === (o = t() ?? "")) {
|
|
1678
|
+
A && dt();
|
|
1679
|
+
return;
|
|
1680
|
+
}
|
|
1681
|
+
l !== void 0 && (me(l), l = void 0), o !== "" && (l = kt(() => {
|
|
1682
|
+
if (A) {
|
|
1683
|
+
for (var c = (
|
|
1684
|
+
/** @type {Comment} */
|
|
1685
|
+
D.data
|
|
1686
|
+
), a = dt(), u = a; a !== null && (a.nodeType !== 8 || /** @type {Comment} */
|
|
1687
|
+
a.data !== ""); )
|
|
1688
|
+
u = a, a = /** @type {TemplateNode} */
|
|
1689
|
+
/* @__PURE__ */ Be(a);
|
|
1690
|
+
if (a === null)
|
|
1691
|
+
throw Ut(), Ve;
|
|
1692
|
+
gi(
|
|
1693
|
+
/** @type {Element} */
|
|
1694
|
+
a.parentNode,
|
|
1695
|
+
c,
|
|
1696
|
+
o
|
|
1697
|
+
), gt(D, u), i = ve(a);
|
|
1698
|
+
return;
|
|
1699
|
+
}
|
|
1700
|
+
var d = o + "", f = Fr(d);
|
|
1701
|
+
gt(
|
|
1702
|
+
/** @type {TemplateNode} */
|
|
1703
|
+
/* @__PURE__ */ ht(f),
|
|
1704
|
+
/** @type {TemplateNode} */
|
|
1705
|
+
f.lastChild
|
|
1706
|
+
), i.before(f);
|
|
1707
|
+
}));
|
|
1708
|
+
});
|
|
1709
|
+
}
|
|
1710
|
+
function Br(e, t) {
|
|
1711
|
+
nr(() => {
|
|
1712
|
+
var n = e.getRootNode(), r = (
|
|
1713
|
+
/** @type {ShadowRoot} */
|
|
1714
|
+
n.host ? (
|
|
1715
|
+
/** @type {ShadowRoot} */
|
|
1716
|
+
n
|
|
1717
|
+
) : (
|
|
1718
|
+
/** @type {Document} */
|
|
1719
|
+
n.head ?? /** @type {Document} */
|
|
1720
|
+
n.ownerDocument.head
|
|
1721
|
+
)
|
|
1722
|
+
);
|
|
1723
|
+
if (!r.querySelector("#" + t.hash)) {
|
|
1724
|
+
const s = document.createElement("style");
|
|
1725
|
+
s.id = t.hash, s.textContent = t.code, r.appendChild(s), ai(t.hash, s);
|
|
1726
|
+
}
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1729
|
+
function pi(e, t, n) {
|
|
1730
|
+
var r = e == null ? "" : "" + e;
|
|
1731
|
+
return t && (r = r ? r + " " + t : t), r === "" ? null : r;
|
|
1732
|
+
}
|
|
1733
|
+
function He(e, t, n, r, s, i) {
|
|
1734
|
+
var o = e.__className;
|
|
1735
|
+
if (A || o !== n || o === void 0) {
|
|
1736
|
+
var l = pi(n, r);
|
|
1737
|
+
(!A || l !== e.getAttribute("class")) && (l == null ? e.removeAttribute("class") : e.className = l), e.__className = n;
|
|
1738
|
+
}
|
|
1739
|
+
return i;
|
|
1740
|
+
}
|
|
1741
|
+
function jn(e, t) {
|
|
1742
|
+
return e === t || e?.[Pe] === t;
|
|
1743
|
+
}
|
|
1744
|
+
function Nr(e = {}, t, n, r) {
|
|
1745
|
+
return dn(() => {
|
|
1746
|
+
var s, i;
|
|
1747
|
+
return yr(() => {
|
|
1748
|
+
s = i, i = [], We(() => {
|
|
1749
|
+
e !== n(...i) && (t(e, ...i), s && jn(n(...s), e) && t(null, ...s));
|
|
1750
|
+
});
|
|
1751
|
+
}), () => {
|
|
1752
|
+
nr(() => {
|
|
1753
|
+
i && jn(n(...i), e) && t(null, ...i);
|
|
1754
|
+
});
|
|
1755
|
+
};
|
|
1756
|
+
}), e;
|
|
1757
|
+
}
|
|
1758
|
+
{
|
|
1759
|
+
let e = function(t) {
|
|
1760
|
+
if (!(t in globalThis)) {
|
|
1761
|
+
let n;
|
|
1762
|
+
Object.defineProperty(globalThis, t, {
|
|
1763
|
+
configurable: !0,
|
|
1764
|
+
// eslint-disable-next-line getter-return
|
|
1765
|
+
get: () => {
|
|
1766
|
+
if (n !== void 0)
|
|
1767
|
+
return n;
|
|
1768
|
+
Es(t);
|
|
1769
|
+
},
|
|
1770
|
+
set: (r) => {
|
|
1771
|
+
n = r;
|
|
1772
|
+
}
|
|
1773
|
+
});
|
|
1774
|
+
}
|
|
1775
|
+
};
|
|
1776
|
+
var Yi = e;
|
|
1777
|
+
e("$state"), e("$effect"), e("$derived"), e("$inspect"), e("$props"), e("$bindable");
|
|
1778
|
+
}
|
|
1779
|
+
function vi(e) {
|
|
1780
|
+
B === null && Lr("onMount"), Re(() => {
|
|
1781
|
+
const t = We(e);
|
|
1782
|
+
if (typeof t == "function") return (
|
|
1783
|
+
/** @type {() => void} */
|
|
1784
|
+
t
|
|
1785
|
+
);
|
|
1786
|
+
});
|
|
1787
|
+
}
|
|
1788
|
+
function mi(e) {
|
|
1789
|
+
B === null && Lr("onDestroy"), vi(() => () => We(e));
|
|
1790
|
+
}
|
|
1791
|
+
let mt = !1;
|
|
1792
|
+
function _i(e) {
|
|
1793
|
+
var t = mt;
|
|
1794
|
+
try {
|
|
1795
|
+
return mt = !1, [e(), mt];
|
|
1796
|
+
} finally {
|
|
1797
|
+
mt = t;
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
function Qn(e) {
|
|
1801
|
+
return e.ctx?.d ?? !1;
|
|
1802
|
+
}
|
|
1803
|
+
function x(e, t, n, r) {
|
|
1804
|
+
var s = (n & ts) !== 0, i = !0, o = (n & rs) !== 0, l = (n & ss) !== 0, c = !1, a;
|
|
1805
|
+
o ? [a, c] = _i(() => (
|
|
1806
|
+
/** @type {V} */
|
|
1807
|
+
e[t]
|
|
1808
|
+
)) : a = /** @type {V} */
|
|
1809
|
+
e[t];
|
|
1810
|
+
var u = Pe in e || Xn in e, d = o && (Fe(e, t)?.set ?? (u && t in e && ((w) => e[t] = w))) || void 0, f = (
|
|
1811
|
+
/** @type {V} */
|
|
1812
|
+
r
|
|
1813
|
+
), g = !0, m = !1, y = () => (m = !0, g && (g = !1, l ? f = We(
|
|
1814
|
+
/** @type {() => V} */
|
|
1815
|
+
r
|
|
1816
|
+
) : f = /** @type {V} */
|
|
1817
|
+
r), f);
|
|
1818
|
+
a === void 0 && r !== void 0 && (d && i && ws(t), a = y(), d && d(a));
|
|
1819
|
+
var R;
|
|
1820
|
+
if (R = () => {
|
|
1821
|
+
var w = (
|
|
1822
|
+
/** @type {V} */
|
|
1823
|
+
e[t]
|
|
1824
|
+
);
|
|
1825
|
+
return w === void 0 ? y() : (g = !0, m = !1, w);
|
|
1826
|
+
}, (n & ns) === 0)
|
|
1827
|
+
return R;
|
|
1828
|
+
if (d) {
|
|
1829
|
+
var N = e.$$legacy;
|
|
1830
|
+
return function(w, M) {
|
|
1831
|
+
return arguments.length > 0 ? ((!M || N || c) && d(M ? R() : w), w) : R();
|
|
1832
|
+
};
|
|
1833
|
+
}
|
|
1834
|
+
var F = !1, j = /* @__PURE__ */ or(a), I = /* @__PURE__ */ un(() => {
|
|
1835
|
+
var w = R(), M = p(j);
|
|
1836
|
+
return F ? (F = !1, M) : j.v = w;
|
|
1837
|
+
});
|
|
1838
|
+
return o && p(I), s || (I.equals = sr), function(w, M) {
|
|
1839
|
+
if (arguments.length > 0) {
|
|
1840
|
+
const W = M ? p(I) : o ? Ie(w) : w;
|
|
1841
|
+
if (!I.equals(W)) {
|
|
1842
|
+
if (F = !0, b(j, W), m && f !== void 0 && (f = W), Qn(I))
|
|
1843
|
+
return w;
|
|
1844
|
+
We(() => p(I));
|
|
1845
|
+
}
|
|
1846
|
+
return w;
|
|
1847
|
+
}
|
|
1848
|
+
return Qn(I) ? I.v : p(I);
|
|
1849
|
+
};
|
|
1850
|
+
}
|
|
1851
|
+
function yi(e) {
|
|
1852
|
+
return new bi(e);
|
|
1853
|
+
}
|
|
1854
|
+
var he, ee;
|
|
1855
|
+
class bi {
|
|
1856
|
+
/**
|
|
1857
|
+
* @param {ComponentConstructorOptions & {
|
|
1858
|
+
* component: any;
|
|
1859
|
+
* }} options
|
|
1860
|
+
*/
|
|
1861
|
+
constructor(t) {
|
|
1862
|
+
/** @type {any} */
|
|
1863
|
+
Ht(this, he);
|
|
1864
|
+
/** @type {Record<string, any>} */
|
|
1865
|
+
Ht(this, ee);
|
|
1866
|
+
var n = /* @__PURE__ */ new Map(), r = (i, o) => {
|
|
1867
|
+
var l = /* @__PURE__ */ or(o);
|
|
1868
|
+
return n.set(i, l), l;
|
|
1869
|
+
};
|
|
1870
|
+
const s = new Proxy(
|
|
1871
|
+
{ ...t.props || {}, $$events: {} },
|
|
1872
|
+
{
|
|
1873
|
+
get(i, o) {
|
|
1874
|
+
return p(n.get(o) ?? r(o, Reflect.get(i, o)));
|
|
1875
|
+
},
|
|
1876
|
+
has(i, o) {
|
|
1877
|
+
return o === Xn ? !0 : (p(n.get(o) ?? r(o, Reflect.get(i, o))), Reflect.has(i, o));
|
|
1878
|
+
},
|
|
1879
|
+
set(i, o, l) {
|
|
1880
|
+
return b(n.get(o) ?? r(o, l), l), Reflect.set(i, o, l);
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
);
|
|
1884
|
+
Vt(this, ee, (t.hydrate ? di : Or)(t.component, {
|
|
1885
|
+
target: t.target,
|
|
1886
|
+
anchor: t.anchor,
|
|
1887
|
+
props: s,
|
|
1888
|
+
context: t.context,
|
|
1889
|
+
intro: t.intro ?? !1,
|
|
1890
|
+
recover: t.recover
|
|
1891
|
+
})), (!t?.props?.$$host || t.sync === !1) && E(), Vt(this, he, s.$$events);
|
|
1892
|
+
for (const i of Object.keys(q(this, ee)))
|
|
1893
|
+
i === "$set" || i === "$destroy" || i === "$on" || ce(this, i, {
|
|
1894
|
+
get() {
|
|
1895
|
+
return q(this, ee)[i];
|
|
1896
|
+
},
|
|
1897
|
+
/** @param {any} value */
|
|
1898
|
+
set(o) {
|
|
1899
|
+
q(this, ee)[i] = o;
|
|
1900
|
+
},
|
|
1901
|
+
enumerable: !0
|
|
1902
|
+
});
|
|
1903
|
+
q(this, ee).$set = /** @param {Record<string, any>} next */
|
|
1904
|
+
(i) => {
|
|
1905
|
+
Object.assign(s, i);
|
|
1906
|
+
}, q(this, ee).$destroy = () => {
|
|
1907
|
+
hi(q(this, ee));
|
|
1908
|
+
};
|
|
1909
|
+
}
|
|
1910
|
+
/** @param {Record<string, any>} props */
|
|
1911
|
+
$set(t) {
|
|
1912
|
+
q(this, ee).$set(t);
|
|
1913
|
+
}
|
|
1914
|
+
/**
|
|
1915
|
+
* @param {string} event
|
|
1916
|
+
* @param {(...args: any[]) => any} callback
|
|
1917
|
+
* @returns {any}
|
|
1918
|
+
*/
|
|
1919
|
+
$on(t, n) {
|
|
1920
|
+
q(this, he)[t] = q(this, he)[t] || [];
|
|
1921
|
+
const r = (...s) => n.call(this, ...s);
|
|
1922
|
+
return q(this, he)[t].push(r), () => {
|
|
1923
|
+
q(this, he)[t] = q(this, he)[t].filter(
|
|
1924
|
+
/** @param {any} fn */
|
|
1925
|
+
(s) => s !== r
|
|
1926
|
+
);
|
|
1927
|
+
};
|
|
1928
|
+
}
|
|
1929
|
+
$destroy() {
|
|
1930
|
+
q(this, ee).$destroy();
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
he = new WeakMap(), ee = new WeakMap();
|
|
1934
|
+
let Mr;
|
|
1935
|
+
typeof HTMLElement == "function" && (Mr = class extends HTMLElement {
|
|
1936
|
+
/**
|
|
1937
|
+
* @param {*} $$componentCtor
|
|
1938
|
+
* @param {*} $$slots
|
|
1939
|
+
* @param {*} use_shadow_dom
|
|
1940
|
+
*/
|
|
1941
|
+
constructor(t, n, r) {
|
|
1942
|
+
super();
|
|
1943
|
+
/** The Svelte component constructor */
|
|
1944
|
+
O(this, "$$ctor");
|
|
1945
|
+
/** Slots */
|
|
1946
|
+
O(this, "$$s");
|
|
1947
|
+
/** @type {any} The Svelte component instance */
|
|
1948
|
+
O(this, "$$c");
|
|
1949
|
+
/** Whether or not the custom element is connected */
|
|
1950
|
+
O(this, "$$cn", !1);
|
|
1951
|
+
/** @type {Record<string, any>} Component props data */
|
|
1952
|
+
O(this, "$$d", {});
|
|
1953
|
+
/** `true` if currently in the process of reflecting component props back to attributes */
|
|
1954
|
+
O(this, "$$r", !1);
|
|
1955
|
+
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
|
|
1956
|
+
O(this, "$$p_d", {});
|
|
1957
|
+
/** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */
|
|
1958
|
+
O(this, "$$l", {});
|
|
1959
|
+
/** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */
|
|
1960
|
+
O(this, "$$l_u", /* @__PURE__ */ new Map());
|
|
1961
|
+
/** @type {any} The managed render effect for reflecting attributes */
|
|
1962
|
+
O(this, "$$me");
|
|
1963
|
+
this.$$ctor = t, this.$$s = n, r && this.attachShadow({ mode: "open" });
|
|
1964
|
+
}
|
|
1965
|
+
/**
|
|
1966
|
+
* @param {string} type
|
|
1967
|
+
* @param {EventListenerOrEventListenerObject} listener
|
|
1968
|
+
* @param {boolean | AddEventListenerOptions} [options]
|
|
1969
|
+
*/
|
|
1970
|
+
addEventListener(t, n, r) {
|
|
1971
|
+
if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(n), this.$$c) {
|
|
1972
|
+
const s = this.$$c.$on(t, n);
|
|
1973
|
+
this.$$l_u.set(n, s);
|
|
1974
|
+
}
|
|
1975
|
+
super.addEventListener(t, n, r);
|
|
1976
|
+
}
|
|
1977
|
+
/**
|
|
1978
|
+
* @param {string} type
|
|
1979
|
+
* @param {EventListenerOrEventListenerObject} listener
|
|
1980
|
+
* @param {boolean | AddEventListenerOptions} [options]
|
|
1981
|
+
*/
|
|
1982
|
+
removeEventListener(t, n, r) {
|
|
1983
|
+
if (super.removeEventListener(t, n, r), this.$$c) {
|
|
1984
|
+
const s = this.$$l_u.get(n);
|
|
1985
|
+
s && (s(), this.$$l_u.delete(n));
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
async connectedCallback() {
|
|
1989
|
+
if (this.$$cn = !0, !this.$$c) {
|
|
1990
|
+
let n = function(i) {
|
|
1991
|
+
return (o) => {
|
|
1992
|
+
const l = document.createElement("slot");
|
|
1993
|
+
i !== "default" && (l.name = i), ge(o, l);
|
|
1994
|
+
};
|
|
1995
|
+
};
|
|
1996
|
+
var t = n;
|
|
1997
|
+
if (await Promise.resolve(), !this.$$cn || this.$$c)
|
|
1998
|
+
return;
|
|
1999
|
+
const r = {}, s = wi(this);
|
|
2000
|
+
for (const i of this.$$s)
|
|
2001
|
+
i in s && (i === "default" && !this.$$d.children ? (this.$$d.children = n(i), r.default = !0) : r[i] = n(i));
|
|
2002
|
+
for (const i of this.attributes) {
|
|
2003
|
+
const o = this.$$g_p(i.name);
|
|
2004
|
+
o in this.$$d || (this.$$d[o] = wt(o, i.value, this.$$p_d, "toProp"));
|
|
2005
|
+
}
|
|
2006
|
+
for (const i in this.$$p_d)
|
|
2007
|
+
!(i in this.$$d) && this[i] !== void 0 && (this.$$d[i] = this[i], delete this[i]);
|
|
2008
|
+
this.$$c = yi({
|
|
2009
|
+
component: this.$$ctor,
|
|
2010
|
+
target: this.shadowRoot || this,
|
|
2011
|
+
props: {
|
|
2012
|
+
...this.$$d,
|
|
2013
|
+
$$slots: r,
|
|
2014
|
+
$$host: this
|
|
2015
|
+
}
|
|
2016
|
+
}), this.$$me = Ws(() => {
|
|
2017
|
+
yr(() => {
|
|
2018
|
+
this.$$r = !0;
|
|
2019
|
+
for (const i of Rt(this.$$c)) {
|
|
2020
|
+
if (!this.$$p_d[i]?.reflect) continue;
|
|
2021
|
+
this.$$d[i] = this.$$c[i];
|
|
2022
|
+
const o = wt(
|
|
2023
|
+
i,
|
|
2024
|
+
this.$$d[i],
|
|
2025
|
+
this.$$p_d,
|
|
2026
|
+
"toAttribute"
|
|
2027
|
+
);
|
|
2028
|
+
o == null ? this.removeAttribute(this.$$p_d[i].attribute || i) : this.setAttribute(this.$$p_d[i].attribute || i, o);
|
|
2029
|
+
}
|
|
2030
|
+
this.$$r = !1;
|
|
2031
|
+
});
|
|
2032
|
+
});
|
|
2033
|
+
for (const i in this.$$l)
|
|
2034
|
+
for (const o of this.$$l[i]) {
|
|
2035
|
+
const l = this.$$c.$on(i, o);
|
|
2036
|
+
this.$$l_u.set(o, l);
|
|
2037
|
+
}
|
|
2038
|
+
this.$$l = {};
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
|
|
2042
|
+
// and setting attributes through setAttribute etc, this is helpful
|
|
2043
|
+
/**
|
|
2044
|
+
* @param {string} attr
|
|
2045
|
+
* @param {string} _oldValue
|
|
2046
|
+
* @param {string} newValue
|
|
2047
|
+
*/
|
|
2048
|
+
attributeChangedCallback(t, n, r) {
|
|
2049
|
+
this.$$r || (t = this.$$g_p(t), this.$$d[t] = wt(t, r, this.$$p_d, "toProp"), this.$$c?.$set({ [t]: this.$$d[t] }));
|
|
2050
|
+
}
|
|
2051
|
+
disconnectedCallback() {
|
|
2052
|
+
this.$$cn = !1, Promise.resolve().then(() => {
|
|
2053
|
+
!this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0);
|
|
2054
|
+
});
|
|
2055
|
+
}
|
|
2056
|
+
/**
|
|
2057
|
+
* @param {string} attribute_name
|
|
2058
|
+
*/
|
|
2059
|
+
$$g_p(t) {
|
|
2060
|
+
return Rt(this.$$p_d).find(
|
|
2061
|
+
(n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t
|
|
2062
|
+
) || t;
|
|
2063
|
+
}
|
|
2064
|
+
});
|
|
2065
|
+
function wt(e, t, n, r) {
|
|
2066
|
+
const s = n[e]?.type;
|
|
2067
|
+
if (t = s === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e])
|
|
2068
|
+
return t;
|
|
2069
|
+
if (r === "toAttribute")
|
|
2070
|
+
switch (s) {
|
|
2071
|
+
case "Object":
|
|
2072
|
+
case "Array":
|
|
2073
|
+
return t == null ? null : JSON.stringify(t);
|
|
2074
|
+
case "Boolean":
|
|
2075
|
+
return t ? "" : null;
|
|
2076
|
+
case "Number":
|
|
2077
|
+
return t ?? null;
|
|
2078
|
+
default:
|
|
2079
|
+
return t;
|
|
2080
|
+
}
|
|
2081
|
+
else
|
|
2082
|
+
switch (s) {
|
|
2083
|
+
case "Object":
|
|
2084
|
+
case "Array":
|
|
2085
|
+
return t && JSON.parse(t);
|
|
2086
|
+
case "Boolean":
|
|
2087
|
+
return t;
|
|
2088
|
+
// conversion already handled above
|
|
2089
|
+
case "Number":
|
|
2090
|
+
return t != null ? +t : t;
|
|
2091
|
+
default:
|
|
2092
|
+
return t;
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
function wi(e) {
|
|
2096
|
+
const t = {};
|
|
2097
|
+
return e.childNodes.forEach((n) => {
|
|
2098
|
+
t[
|
|
2099
|
+
/** @type {Element} node */
|
|
2100
|
+
n.slot || "default"
|
|
2101
|
+
] = !0;
|
|
2102
|
+
}), t;
|
|
2103
|
+
}
|
|
2104
|
+
function jr(e, t, n, r, s, i) {
|
|
2105
|
+
let o = class extends Mr {
|
|
2106
|
+
constructor() {
|
|
2107
|
+
super(e, n, s), this.$$p_d = t;
|
|
2108
|
+
}
|
|
2109
|
+
static get observedAttributes() {
|
|
2110
|
+
return Rt(t).map(
|
|
2111
|
+
(l) => (t[l].attribute || l).toLowerCase()
|
|
2112
|
+
);
|
|
2113
|
+
}
|
|
2114
|
+
};
|
|
2115
|
+
return Rt(t).forEach((l) => {
|
|
2116
|
+
ce(o.prototype, l, {
|
|
2117
|
+
get() {
|
|
2118
|
+
return this.$$c && l in this.$$c ? this.$$c[l] : this.$$d[l];
|
|
2119
|
+
},
|
|
2120
|
+
set(c) {
|
|
2121
|
+
c = wt(l, c, t), this.$$d[l] = c;
|
|
2122
|
+
var a = this.$$c;
|
|
2123
|
+
if (a) {
|
|
2124
|
+
var u = Fe(a, l)?.get;
|
|
2125
|
+
u ? a[l] = c : a.$set({ [l]: c });
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
});
|
|
2129
|
+
}), r.forEach((l) => {
|
|
2130
|
+
ce(o.prototype, l, {
|
|
2131
|
+
get() {
|
|
2132
|
+
return this.$$c?.[l];
|
|
2133
|
+
}
|
|
2134
|
+
});
|
|
2135
|
+
}), e.element = /** @type {any} */
|
|
2136
|
+
o, o;
|
|
2137
|
+
}
|
|
2138
|
+
function zn(e, ...t) {
|
|
2139
|
+
return We(() => {
|
|
2140
|
+
try {
|
|
2141
|
+
let n = !1;
|
|
2142
|
+
const r = [];
|
|
2143
|
+
for (const s of t)
|
|
2144
|
+
s && typeof s == "object" && Pe in s ? (r.push(Ls(s, !0)), n = !0) : r.push(s);
|
|
2145
|
+
n && (Os(e), console.log("%c[snapshot]", "color: grey", ...r));
|
|
2146
|
+
} catch {
|
|
2147
|
+
}
|
|
2148
|
+
}), t;
|
|
2149
|
+
}
|
|
2150
|
+
const qn = "-pie-editor--", Qr = (...e) => e.reduce((t, n) => {
|
|
2151
|
+
for (const r in n)
|
|
2152
|
+
n.hasOwnProperty(r) && n[r] !== null && n[r] !== void 0 && (t[r] = n[r]);
|
|
2153
|
+
return t;
|
|
2154
|
+
}, {}), zr = {}, Ei = "https://builder.pie-api.com", $i = zr.PUBLIC_BUILDER_ORIGIN_URL || Ei, Ri = zr.PUBLIC_BUILDER_BUNDLE_URL || `${$i}/api/v1/bundles/`;
|
|
2155
|
+
var z = /* @__PURE__ */ ((e) => (e.player = "player.js", e.clientPlayer = "client-player.js", e.editor = "editor.js", e))(z || {}), nn = /* @__PURE__ */ ((e) => (e.loading = "loading", e.loaded = "loaded", e))(nn || {});
|
|
2156
|
+
const Ci = {
|
|
2157
|
+
invokeControllerForModel: !0,
|
|
2158
|
+
env: { mode: "gather", role: "student", partialScoring: !1 },
|
|
2159
|
+
eventListeners: {}
|
|
2160
|
+
};
|
|
2161
|
+
function Pi(e) {
|
|
2162
|
+
return e && typeof e.pie == "object";
|
|
2163
|
+
}
|
|
2164
|
+
function Hn(e) {
|
|
2165
|
+
return typeof e == "function" && "prototype" in e && e.prototype instanceof HTMLElement;
|
|
2166
|
+
}
|
|
2167
|
+
function Si(e) {
|
|
2168
|
+
return e && typeof e.PIE_REGISTRY == "object";
|
|
2169
|
+
}
|
|
2170
|
+
const mn = () => {
|
|
2171
|
+
let e;
|
|
2172
|
+
return Si(window) ? e = window.PIE_REGISTRY : (e = {}, window.PIE_REGISTRY = e), e;
|
|
2173
|
+
}, qr = (e) => {
|
|
2174
|
+
if (!e)
|
|
2175
|
+
throw new Error("Parameter is required: input");
|
|
2176
|
+
const t = e.charAt(0) === "@" ? e.match(/^(@[^/]+\/[^/@]+)(?:\/([^@]+))?(?:@([\s\S]+))?/) : e.match(/^([^/@]+)(?:\/([^@]+))?(?:@([\s\S]+))?/);
|
|
2177
|
+
if (!t)
|
|
2178
|
+
throw new Error(`[parse-package-name] "${e}" is not a valid string`);
|
|
2179
|
+
return {
|
|
2180
|
+
name: t[1],
|
|
2181
|
+
path: t[2] || "",
|
|
2182
|
+
version: t[3] || ""
|
|
2183
|
+
};
|
|
2184
|
+
}, xi = (e) => e.split("+").map((t) => qr(t).name).join("+"), Hr = (e, t, n) => {
|
|
2185
|
+
if (!e)
|
|
2186
|
+
throw new Error("session data is required");
|
|
2187
|
+
const r = e.find((i) => i.id === t);
|
|
2188
|
+
if (r)
|
|
2189
|
+
return n && !r.element && (r.element = n), r;
|
|
2190
|
+
const s = n ? { id: t, element: n } : { id: t };
|
|
2191
|
+
return e.push(s), s;
|
|
2192
|
+
};
|
|
2193
|
+
function Me(e, t) {
|
|
2194
|
+
const n = `[${e}]`;
|
|
2195
|
+
return {
|
|
2196
|
+
// Only debug method checks debugEnabledFn - it's checked dynamically on every call
|
|
2197
|
+
debug: (r, ...s) => {
|
|
2198
|
+
t() && console.debug(n, r, ...s);
|
|
2199
|
+
},
|
|
2200
|
+
// info, warn, error always log (not gated by debug flag)
|
|
2201
|
+
info: (r, ...s) => console.info(n, r, ...s),
|
|
2202
|
+
warn: (r, ...s) => console.warn(n, r, ...s),
|
|
2203
|
+
error: (r, ...s) => console.error(n, r, ...s)
|
|
2204
|
+
};
|
|
2205
|
+
}
|
|
2206
|
+
function Xe() {
|
|
2207
|
+
return typeof window < "u" && window.PIE_DEBUG === !0;
|
|
2208
|
+
}
|
|
2209
|
+
const ne = Me("pie-scoring", () => Xe()), _n = (e) => {
|
|
2210
|
+
const t = mn();
|
|
2211
|
+
ne.debug(`[findPieController] Looking for controller for: ${e}`), ne.debug("[findPieController] Registry has entries for:", Object.keys(t));
|
|
2212
|
+
const n = t[e];
|
|
2213
|
+
if (!n) {
|
|
2214
|
+
ne.error(`[findPieController] ❌ No registry entry found for element: ${e}`), ne.error("[findPieController] Available element names:", Object.keys(t)), ne.error("[findPieController] Full registry:", t);
|
|
2215
|
+
return;
|
|
2216
|
+
}
|
|
2217
|
+
ne.debug(`[findPieController] Found registry entry for ${e}:`, {
|
|
2218
|
+
package: n.package,
|
|
2219
|
+
tagName: n.tagName,
|
|
2220
|
+
hasController: !!n.controller,
|
|
2221
|
+
controllerKeys: n.controller ? Object.keys(n.controller) : [],
|
|
2222
|
+
bundleType: n.bundleType
|
|
2223
|
+
});
|
|
2224
|
+
const r = n.controller;
|
|
2225
|
+
if (r)
|
|
2226
|
+
ne.debug(`[findPieController] ✅ Controller found for ${e} with functions:`, Object.keys(r));
|
|
2227
|
+
else {
|
|
2228
|
+
if (n.bundleType === z.clientPlayer)
|
|
2229
|
+
throw ne.error(
|
|
2230
|
+
`[findPieController] ❌ CRITICAL: Registry entry exists for ${e} but controller is missing!`
|
|
2231
|
+
), ne.error(`[findPieController] Bundle type: ${n.bundleType} (controllers required)`), ne.error("[findPieController] Entry:", n), new Error(
|
|
2232
|
+
`No controller found for ${e}. client-player.js bundles MUST include controllers. Check bundle loading and registration.`
|
|
2233
|
+
);
|
|
2234
|
+
ne.debug(
|
|
2235
|
+
`[findPieController] ℹ️ No controller for ${e} - using server-processed models (player.js bundle)`
|
|
2236
|
+
);
|
|
2237
|
+
}
|
|
2238
|
+
return r;
|
|
2239
|
+
}, J = Me("pie-updates", () => Xe()), Ti = async (e, t, n, r, s, i) => {
|
|
2240
|
+
J.debug(`${i} Using controller, env:`, s), J.debug(`${i} Model before filter:`, {
|
|
2241
|
+
id: t.id,
|
|
2242
|
+
element: t.element,
|
|
2243
|
+
hasCorrectResponse: "correctResponse" in t
|
|
2244
|
+
});
|
|
2245
|
+
const o = (l, c, a) => (J.debug(`${i} updateSession called for ${l} with:`, a), Object.assign(n, a), Promise.resolve());
|
|
2246
|
+
try {
|
|
2247
|
+
const l = await r.model(t, n, s, o), c = {
|
|
2248
|
+
id: t.id,
|
|
2249
|
+
element: t.element,
|
|
2250
|
+
...l
|
|
2251
|
+
};
|
|
2252
|
+
J.debug(`${i} ✅ Controller filtered model:`, {
|
|
2253
|
+
id: c.id,
|
|
2254
|
+
element: c.element,
|
|
2255
|
+
hasCorrectResponse: "correctResponse" in c,
|
|
2256
|
+
mode: s.mode,
|
|
2257
|
+
role: s.role
|
|
2258
|
+
}), e.model = c;
|
|
2259
|
+
} catch (l) {
|
|
2260
|
+
throw J.error(`${i} ❌ Controller error:`, l), l;
|
|
2261
|
+
}
|
|
2262
|
+
}, rn = (e, t) => {
|
|
2263
|
+
const { config: n, session: r, env: s, eventListeners: i, invokeControllerForModel: o } = Qr(
|
|
2264
|
+
Ci,
|
|
2265
|
+
t
|
|
2266
|
+
);
|
|
2267
|
+
if (!s)
|
|
2268
|
+
throw new Error("env is required");
|
|
2269
|
+
if (!r)
|
|
2270
|
+
throw new Error("session is required");
|
|
2271
|
+
if (!n)
|
|
2272
|
+
throw new Error("config is required");
|
|
2273
|
+
const l = document.querySelectorAll(e);
|
|
2274
|
+
if (!l || l.length === 0) {
|
|
2275
|
+
J.debug(`no elements found for ${e}`);
|
|
2276
|
+
return;
|
|
2277
|
+
}
|
|
2278
|
+
l.forEach((c) => {
|
|
2279
|
+
const a = c;
|
|
2280
|
+
let u = t?.config?.models?.find((f) => f.id === c.id);
|
|
2281
|
+
if (!u)
|
|
2282
|
+
throw J.error("[updatePieElement] Model not found for", e, t), new Error(`model not found for ${e}`);
|
|
2283
|
+
J.debug(`[updatePieElement] Updating ${e}#${c.id}, env:`, s);
|
|
2284
|
+
const d = Hr(r, u.id, u.element);
|
|
2285
|
+
if (a.session = d, i && Object.entries(i).forEach(([f, g]) => {
|
|
2286
|
+
a.addEventListener(f, g);
|
|
2287
|
+
}), s && o) {
|
|
2288
|
+
const f = _n(e);
|
|
2289
|
+
f ? (J.debug(`[updatePieElement] Invoking controller for ${e}#${c.id}`, {
|
|
2290
|
+
mode: s.mode,
|
|
2291
|
+
role: s.role,
|
|
2292
|
+
hasCorrectResponse: "correctResponse" in u
|
|
2293
|
+
}), Ti(
|
|
2294
|
+
a,
|
|
2295
|
+
u,
|
|
2296
|
+
d,
|
|
2297
|
+
f,
|
|
2298
|
+
s,
|
|
2299
|
+
`[updatePieElement(${e}#${c.id})]`
|
|
2300
|
+
).catch((g) => {
|
|
2301
|
+
J.error(`[updatePieElement] Controller failed for ${e}#${c.id}:`, g), a.model = u;
|
|
2302
|
+
})) : (J.debug(`[updatePieElement] ℹ️ No controller for ${e}, using server-processed model`), a.model = u);
|
|
2303
|
+
} else
|
|
2304
|
+
J.debug(
|
|
2305
|
+
`[updatePieElement] Direct model assignment for ${e}#${c.id} (no controller invocation requested)`
|
|
2306
|
+
), a.model = u;
|
|
2307
|
+
});
|
|
2308
|
+
}, _t = (e, t, n) => {
|
|
2309
|
+
J.debug("[updatePieElements] Updating all elements with env:", n), Object.entries(e.elements).forEach(([r, s]) => {
|
|
2310
|
+
rn(r, { config: e, session: t, env: n });
|
|
2311
|
+
});
|
|
2312
|
+
}, C = Me("pie-initialization", () => Xe()), Li = {
|
|
2313
|
+
buildServiceBase: Ri,
|
|
2314
|
+
bundleType: z.player,
|
|
2315
|
+
// Default to player.js (no controllers, server-processed models)
|
|
2316
|
+
env: { mode: "gather", role: "student" }
|
|
2317
|
+
}, Yt = (e, t) => {
|
|
2318
|
+
const { config: n, session: r, env: s, eventListeners: i } = t, o = e.tagName.toLowerCase();
|
|
2319
|
+
C.debug(`[initializePieElement] Initializing ${o}#${e.id}`);
|
|
2320
|
+
let l = n?.models?.find((u) => u.id === e.id);
|
|
2321
|
+
if (!l) {
|
|
2322
|
+
const d = mn()[o];
|
|
2323
|
+
d && d.bundleType === z.clientPlayer && C.warn(
|
|
2324
|
+
`[initializePieElement] Model not found for PIE element ${o}#${e.id} (client-player.js bundle)`
|
|
2325
|
+
);
|
|
2326
|
+
return;
|
|
2327
|
+
}
|
|
2328
|
+
const c = Hr(r, l.id, l.element);
|
|
2329
|
+
e.session = c, C.debug(`[initializePieElement] Session set for ${o}#${e.id}:`, c);
|
|
2330
|
+
const a = _n(o);
|
|
2331
|
+
if (!s)
|
|
2332
|
+
throw C.error(`[initializePieElement] ❌ FATAL: No env provided for ${o}`), new Error(`No env provided for ${o}. PIE elements require an env object with mode and role.`);
|
|
2333
|
+
a ? C.debug(`[initializePieElement] Controller found for ${o}, will invoke model() function`) : (C.debug(`[initializePieElement] ℹ️ No controller for ${o}, using server-processed model`), C.debug("[initializePieElement] Model already processed by server:", {
|
|
2334
|
+
id: l.id,
|
|
2335
|
+
element: l.element,
|
|
2336
|
+
hasCorrectResponse: "correctResponse" in l,
|
|
2337
|
+
mode: s.mode,
|
|
2338
|
+
role: s.role
|
|
2339
|
+
}), e.model = l), i && Object.entries(i).forEach(([u, d]) => {
|
|
2340
|
+
e.addEventListener(u, d);
|
|
2341
|
+
});
|
|
2342
|
+
}, ki = (e, t, n, r, s) => {
|
|
2343
|
+
const i = [];
|
|
2344
|
+
return C.debug("[registerPieElementsFromBundle] Available packages in bundle:", Object.keys(e)), C.debug("[registerPieElementsFromBundle] config.elements:", t.elements), typeof window < "u" && (window._pieCurrentContext = { config: t, session: n, env: s.env }), Object.entries(t.elements).forEach(([o, l]) => {
|
|
2345
|
+
C.debug(`[registerPieElementsFromBundle] Processing element: ${o} -> ${l}`);
|
|
2346
|
+
const c = xi(l);
|
|
2347
|
+
C.debug(`[registerPieElementsFromBundle] Package without version: "${c}"`);
|
|
2348
|
+
const a = e[c];
|
|
2349
|
+
if (C.debug("[registerPieElementsFromBundle] elementData result:", a ? "FOUND" : "UNDEFINED"), !a)
|
|
2350
|
+
throw C.error(`[registerPieElementsFromBundle] ❌ Package "${c}" not found in bundle!`), C.error(`[registerPieElementsFromBundle] Lookup key: "${c}"`), C.error("[registerPieElementsFromBundle] Available packages:", Object.keys(e)), new Error(`pie ${c} not found in ${Object.keys(e)}`);
|
|
2351
|
+
if (C.debug(`[registerPieElementsFromBundle] elementData for ${c}:`, {
|
|
2352
|
+
hasController: !!a.controller,
|
|
2353
|
+
hasElement: !!a.Element,
|
|
2354
|
+
hasConfig: !!a.config,
|
|
2355
|
+
controllerKeys: a.controller ? Object.keys(a.controller) : [],
|
|
2356
|
+
bundleType: s.bundleType
|
|
2357
|
+
}), !a.controller) {
|
|
2358
|
+
if (s.bundleType === z.clientPlayer)
|
|
2359
|
+
throw C.error(`[registerPieElementsFromBundle] ❌ CRITICAL: No controller found for ${c}!`), C.error(`[registerPieElementsFromBundle] Bundle type: ${s.bundleType} (controllers required)`), new Error(`No controller found for ${c}. client-player.js bundles MUST include controllers!`);
|
|
2360
|
+
C.debug(
|
|
2361
|
+
`[registerPieElementsFromBundle] ℹ️ No controller found for ${c} - using server-processed models (player.js bundle)`
|
|
2362
|
+
);
|
|
2363
|
+
}
|
|
2364
|
+
if (customElements.get(o)) {
|
|
2365
|
+
if (rn(o, {
|
|
2366
|
+
config: t,
|
|
2367
|
+
session: n,
|
|
2368
|
+
env: s.env,
|
|
2369
|
+
...s.eventListeners?.[o] && { eventListeners: s.eventListeners[o] }
|
|
2370
|
+
}), s.bundleType === z.editor) {
|
|
2371
|
+
const u = o + qn;
|
|
2372
|
+
rn(u, {
|
|
2373
|
+
config: t,
|
|
2374
|
+
session: n,
|
|
2375
|
+
...s.eventListeners?.[u] && {
|
|
2376
|
+
eventListeners: s.eventListeners[u]
|
|
2377
|
+
}
|
|
2378
|
+
});
|
|
2379
|
+
}
|
|
2380
|
+
} else if (C.debug(
|
|
2381
|
+
`[registerPieElementsFromBundle] Registering ${o} in registry${a.controller ? " with controller" : " (no controller - server-processed models)"}`
|
|
2382
|
+
), r[o] = {
|
|
2383
|
+
package: l,
|
|
2384
|
+
status: nn.loading,
|
|
2385
|
+
tagName: o,
|
|
2386
|
+
controller: a.controller || null,
|
|
2387
|
+
config: a.config,
|
|
2388
|
+
bundleType: s.bundleType
|
|
2389
|
+
}, Hn(a.Element)) {
|
|
2390
|
+
customElements.define(o, a.Element);
|
|
2391
|
+
const u = document.querySelectorAll(o);
|
|
2392
|
+
if (C.debug(`[registerPieElementsFromBundle] Found ${u.length} elements for tag '${o}'`), u.forEach((d) => {
|
|
2393
|
+
Yt(d, {
|
|
2394
|
+
config: t,
|
|
2395
|
+
session: n,
|
|
2396
|
+
env: s.env,
|
|
2397
|
+
eventListeners: s.eventListeners?.[o]
|
|
2398
|
+
});
|
|
2399
|
+
}), r[o] = {
|
|
2400
|
+
...r[o],
|
|
2401
|
+
status: nn.loaded
|
|
2402
|
+
}, i.push(
|
|
2403
|
+
customElements.whenDefined(o).then(() => {
|
|
2404
|
+
C.debug("[registerPieElementsFromBundle] defined custom PIE element: %s", o);
|
|
2405
|
+
})
|
|
2406
|
+
), window._pieElementObserver || (window._pieElementObserver = new MutationObserver((d) => {
|
|
2407
|
+
const f = window._pieCurrentContext;
|
|
2408
|
+
if (!f) {
|
|
2409
|
+
C.warn("[MutationObserver] No current context available");
|
|
2410
|
+
return;
|
|
2411
|
+
}
|
|
2412
|
+
d.forEach((g) => {
|
|
2413
|
+
g.type === "childList" && g.addedNodes.forEach((m) => {
|
|
2414
|
+
if (m.nodeType === Node.ELEMENT_NODE) {
|
|
2415
|
+
const y = m.tagName.toLowerCase();
|
|
2416
|
+
r[y] && Yt(m, {
|
|
2417
|
+
config: f.config,
|
|
2418
|
+
session: f.session,
|
|
2419
|
+
env: f.env,
|
|
2420
|
+
eventListeners: s.eventListeners?.[y]
|
|
2421
|
+
}), m.querySelectorAll("*").forEach((R) => {
|
|
2422
|
+
const N = R.tagName.toLowerCase();
|
|
2423
|
+
r[N] && Yt(R, {
|
|
2424
|
+
config: f.config,
|
|
2425
|
+
session: f.session,
|
|
2426
|
+
env: f.env,
|
|
2427
|
+
eventListeners: s.eventListeners?.[N]
|
|
2428
|
+
});
|
|
2429
|
+
});
|
|
2430
|
+
}
|
|
2431
|
+
});
|
|
2432
|
+
});
|
|
2433
|
+
}), window._pieElementObserver.observe(document.body, {
|
|
2434
|
+
childList: !0,
|
|
2435
|
+
subtree: !0
|
|
2436
|
+
})), s.bundleType === z.editor)
|
|
2437
|
+
if (Hn(a.Configure)) {
|
|
2438
|
+
const d = o + qn;
|
|
2439
|
+
customElements.define(d, a.Configure), i.push(
|
|
2440
|
+
customElements.whenDefined(d).then(() => {
|
|
2441
|
+
C.debug(`[registerPieElementsFromBundle] defined custom PIE editor element: ${d}`);
|
|
2442
|
+
})
|
|
2443
|
+
);
|
|
2444
|
+
} else
|
|
2445
|
+
C.error(
|
|
2446
|
+
`[registerPieElementsFromBundle] pie.Configure for ${c} is not a valid custom element constructor.`,
|
|
2447
|
+
a.configure
|
|
2448
|
+
);
|
|
2449
|
+
} else
|
|
2450
|
+
C.error(
|
|
2451
|
+
`[registerPieElementsFromBundle] pie.Element for ${c} is not a valid custom element constructor.`
|
|
2452
|
+
);
|
|
2453
|
+
}), i;
|
|
2454
|
+
}, Vn = (e, t, n = {}) => {
|
|
2455
|
+
const r = mn(), s = Qr(Li, n);
|
|
2456
|
+
if (Pi(window)) {
|
|
2457
|
+
C.debug("[initializePiesFromLoadedBundle] window.pie available");
|
|
2458
|
+
const i = window.pie.default;
|
|
2459
|
+
ki(i, e, t, r, s);
|
|
2460
|
+
} else
|
|
2461
|
+
C.error("[initializePiesFromLoadedBundle] window.pie not found; was the bundle inlined correctly?");
|
|
2462
|
+
}, Ce = {
|
|
2463
|
+
trackPageActions: !1,
|
|
2464
|
+
maxResourceRetries: 3,
|
|
2465
|
+
resourceRetryDelay: 500
|
|
2466
|
+
}, Ii = {
|
|
2467
|
+
trackPageActions: !1,
|
|
2468
|
+
maxRetries: 3,
|
|
2469
|
+
initialRetryDelay: 500,
|
|
2470
|
+
maxRetryDelay: 5e3,
|
|
2471
|
+
debug: !1
|
|
2472
|
+
}, Fi = 80;
|
|
2473
|
+
class Oi {
|
|
2474
|
+
// Track resources within our container
|
|
2475
|
+
constructor(t = {}) {
|
|
2476
|
+
O(this, "config");
|
|
2477
|
+
O(this, "logger");
|
|
2478
|
+
O(this, "observer", null);
|
|
2479
|
+
O(this, "mutationObserver", null);
|
|
2480
|
+
O(this, "errorHandler", null);
|
|
2481
|
+
O(this, "retryAttempts", /* @__PURE__ */ new Map());
|
|
2482
|
+
O(this, "container", null);
|
|
2483
|
+
O(this, "isBrowser");
|
|
2484
|
+
O(this, "containerResources", /* @__PURE__ */ new Set());
|
|
2485
|
+
this.config = { ...Ii, ...t }, this.logger = Me("resource-monitor", () => this.isDebugEnabled()), this.isBrowser = typeof window < "u" && typeof document < "u";
|
|
2486
|
+
}
|
|
2487
|
+
/**
|
|
2488
|
+
* Check if debug logging is enabled (dynamically checks window.PIE_DEBUG)
|
|
2489
|
+
*/
|
|
2490
|
+
isDebugEnabled() {
|
|
2491
|
+
return this.config.debug || typeof window < "u" && window.PIE_DEBUG === !0;
|
|
2492
|
+
}
|
|
2493
|
+
/**
|
|
2494
|
+
* Truncate URL for display in logs
|
|
2495
|
+
*/
|
|
2496
|
+
truncateUrl(t) {
|
|
2497
|
+
return t.length > Fi ? "..." + t.slice(-77) : t;
|
|
2498
|
+
}
|
|
2499
|
+
/**
|
|
2500
|
+
* Strip retry parameters from URL to get the original URL
|
|
2501
|
+
*/
|
|
2502
|
+
getOriginalUrl(t) {
|
|
2503
|
+
try {
|
|
2504
|
+
const n = new URL(t);
|
|
2505
|
+
return n.searchParams.delete("retry"), n.searchParams.delete("t"), n.toString();
|
|
2506
|
+
} catch {
|
|
2507
|
+
return t;
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
/**
|
|
2511
|
+
* Track action with New Relic if enabled
|
|
2512
|
+
*/
|
|
2513
|
+
trackNewRelicAction(t, n) {
|
|
2514
|
+
!this.config.trackPageActions || !window.newrelic || window.newrelic.addPageAction(t, {
|
|
2515
|
+
...n,
|
|
2516
|
+
component: "pie-fixed-player",
|
|
2517
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
2518
|
+
});
|
|
2519
|
+
}
|
|
2520
|
+
/**
|
|
2521
|
+
* Track error with New Relic if enabled
|
|
2522
|
+
*/
|
|
2523
|
+
trackNewRelicError(t, n) {
|
|
2524
|
+
!this.config.trackPageActions || !window.newrelic || window.newrelic.noticeError(t, {
|
|
2525
|
+
...n,
|
|
2526
|
+
component: "pie-fixed-player"
|
|
2527
|
+
});
|
|
2528
|
+
}
|
|
2529
|
+
/**
|
|
2530
|
+
* Start monitoring resources in the given container
|
|
2531
|
+
*/
|
|
2532
|
+
start(t) {
|
|
2533
|
+
if (!this.isBrowser) {
|
|
2534
|
+
this.logger.debug("Not in browser environment, skipping resource monitoring");
|
|
2535
|
+
return;
|
|
2536
|
+
}
|
|
2537
|
+
this.container = t, this.setupMutationObserver(), this.scanContainerResources(), this.setupPerformanceObserver(), this.setupErrorHandler(), this.logger.info("✅ Resource monitoring started");
|
|
2538
|
+
}
|
|
2539
|
+
/**
|
|
2540
|
+
* Stop monitoring and clean up
|
|
2541
|
+
*/
|
|
2542
|
+
stop() {
|
|
2543
|
+
this.observer && (this.observer.disconnect(), this.observer = null), this.mutationObserver && (this.mutationObserver.disconnect(), this.mutationObserver = null), this.errorHandler && this.container && (this.container.removeEventListener("error", this.errorHandler, !0), this.errorHandler = null), this.retryAttempts.clear(), this.containerResources.clear(), this.container = null, this.logger.info("Resource monitoring stopped");
|
|
2544
|
+
}
|
|
2545
|
+
/**
|
|
2546
|
+
* Set up MutationObserver to track DOM changes within container
|
|
2547
|
+
* This allows us to know which resources belong to our container
|
|
2548
|
+
*/
|
|
2549
|
+
setupMutationObserver() {
|
|
2550
|
+
if (!this.isBrowser || typeof MutationObserver > "u" || !this.container) {
|
|
2551
|
+
this.logger.debug("MutationObserver not available or no container");
|
|
2552
|
+
return;
|
|
2553
|
+
}
|
|
2554
|
+
try {
|
|
2555
|
+
this.mutationObserver = new MutationObserver((t) => {
|
|
2556
|
+
for (const n of t)
|
|
2557
|
+
if (n.addedNodes.forEach((r) => {
|
|
2558
|
+
r instanceof HTMLElement && this.scanElementForResources(r);
|
|
2559
|
+
}), n.type === "attributes" && n.target instanceof HTMLElement) {
|
|
2560
|
+
const r = n.target;
|
|
2561
|
+
if (this.isResourceElement(r)) {
|
|
2562
|
+
const s = this.getResourceSrc(r);
|
|
2563
|
+
s && (this.containerResources.add(s), this.isDebugEnabled() && this.logger.debug(`📌 Tracked resource attribute change: ${s}`));
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
}), this.mutationObserver.observe(this.container, {
|
|
2567
|
+
childList: !0,
|
|
2568
|
+
subtree: !0,
|
|
2569
|
+
attributes: !0,
|
|
2570
|
+
attributeFilter: ["src", "href"]
|
|
2571
|
+
}), this.logger.debug("MutationObserver set up successfully");
|
|
2572
|
+
} catch (t) {
|
|
2573
|
+
this.logger.warn("Failed to set up MutationObserver:", t);
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
/**
|
|
2577
|
+
* Scan an element and its descendants for resources
|
|
2578
|
+
*/
|
|
2579
|
+
scanElementForResources(t) {
|
|
2580
|
+
if (this.isResourceElement(t)) {
|
|
2581
|
+
const r = this.getResourceSrc(t);
|
|
2582
|
+
r && (this.containerResources.add(r), this.isDebugEnabled() && this.logger.debug(`📌 Tracked new resource in container: ${r}`));
|
|
2583
|
+
}
|
|
2584
|
+
["img", "audio", "video", 'link[rel="stylesheet"]', "source"].forEach((r) => {
|
|
2585
|
+
t.querySelectorAll(r).forEach((s) => {
|
|
2586
|
+
if (this.isResourceElement(s)) {
|
|
2587
|
+
const i = this.getResourceSrc(s);
|
|
2588
|
+
i && this.containerResources.add(i);
|
|
2589
|
+
}
|
|
2590
|
+
});
|
|
2591
|
+
});
|
|
2592
|
+
}
|
|
2593
|
+
/**
|
|
2594
|
+
* Initial scan of container for existing resources
|
|
2595
|
+
*/
|
|
2596
|
+
scanContainerResources() {
|
|
2597
|
+
this.container && (this.scanElementForResources(this.container), this.isDebugEnabled() && (this.logger.debug(`📊 Initial container scan found ${this.containerResources.size} resources`), this.containerResources.size > 0 && this.containerResources.forEach((t) => {
|
|
2598
|
+
this.logger.debug(` - ${this.truncateUrl(t)}`);
|
|
2599
|
+
})));
|
|
2600
|
+
}
|
|
2601
|
+
/**
|
|
2602
|
+
* Set up PerformanceObserver to track resource loading timing
|
|
2603
|
+
*/
|
|
2604
|
+
setupPerformanceObserver() {
|
|
2605
|
+
if (!this.isBrowser || typeof PerformanceObserver > "u") {
|
|
2606
|
+
this.logger.debug("PerformanceObserver not available");
|
|
2607
|
+
return;
|
|
2608
|
+
}
|
|
2609
|
+
try {
|
|
2610
|
+
this.observer = new PerformanceObserver((t) => {
|
|
2611
|
+
for (const n of t.getEntries())
|
|
2612
|
+
n.entryType === "resource" && this.handleResourceTiming(n);
|
|
2613
|
+
}), this.observer.observe({
|
|
2614
|
+
type: "resource",
|
|
2615
|
+
buffered: !0
|
|
2616
|
+
// Capture resources loaded before observer started
|
|
2617
|
+
}), this.logger.debug("PerformanceObserver set up successfully");
|
|
2618
|
+
} catch (t) {
|
|
2619
|
+
this.logger.warn("Failed to set up PerformanceObserver:", t);
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
/**
|
|
2623
|
+
* Handle resource timing entry
|
|
2624
|
+
*/
|
|
2625
|
+
handleResourceTiming(t) {
|
|
2626
|
+
if (!this.isRelevantResource(t)) {
|
|
2627
|
+
this.isDebugEnabled() && (t.initiatorType === "img" || t.initiatorType === "audio" || t.initiatorType === "video") && this.logger.debug(`⏭️ Skipping non-container resource: ${this.truncateUrl(t.name)}`);
|
|
2628
|
+
return;
|
|
2629
|
+
}
|
|
2630
|
+
const r = t.duration, s = t.transferSize, i = t.name, o = t.responseEnd === 0 && t.duration > 0, l = this.retryAttempts.has(i), c = this.retryAttempts.get(i) || 0;
|
|
2631
|
+
if (this.isDebugEnabled()) {
|
|
2632
|
+
const a = this.truncateUrl(i), u = (s / 1024).toFixed(2), d = o ? "❌ FAILED" : "✅ SUCCESS", f = {
|
|
2633
|
+
total: `${r.toFixed(2)}ms`,
|
|
2634
|
+
dns: t.domainLookupEnd > 0 ? `${(t.domainLookupEnd - t.domainLookupStart).toFixed(2)}ms` : "n/a",
|
|
2635
|
+
tcp: t.connectEnd > 0 ? `${(t.connectEnd - t.connectStart).toFixed(2)}ms` : "n/a",
|
|
2636
|
+
request: t.responseStart > 0 ? `${(t.responseStart - t.requestStart).toFixed(2)}ms` : "n/a",
|
|
2637
|
+
response: t.responseEnd > 0 ? `${(t.responseEnd - t.responseStart).toFixed(2)}ms` : "n/a",
|
|
2638
|
+
size: s > 0 ? `${u} KB` : "0 KB",
|
|
2639
|
+
type: t.initiatorType,
|
|
2640
|
+
protocol: t.nextHopProtocol || "unknown"
|
|
2641
|
+
}, g = l && !o ? `
|
|
2642
|
+
🔄 Retry Success: Succeeded after ${c} ${c === 1 ? "retry" : "retries"}` : "";
|
|
2643
|
+
this.logger.info(
|
|
2644
|
+
`📊 PIE Resource Load ${d}
|
|
2645
|
+
URL: ${a}
|
|
2646
|
+
Type: ${f.type} | Protocol: ${f.protocol}
|
|
2647
|
+
⏱️ Total Time: ${f.total}
|
|
2648
|
+
└─ DNS Lookup: ${f.dns}
|
|
2649
|
+
└─ TCP Connect: ${f.tcp}
|
|
2650
|
+
└─ Request Time: ${f.request}
|
|
2651
|
+
└─ Response Time: ${f.response}
|
|
2652
|
+
📦 Transfer Size: ${f.size}${g}`
|
|
2653
|
+
);
|
|
2654
|
+
} else
|
|
2655
|
+
this.logger.debug(`Resource loaded: ${t.name}`, {
|
|
2656
|
+
duration: `${r.toFixed(2)}ms`,
|
|
2657
|
+
size: `${s} bytes`,
|
|
2658
|
+
type: t.initiatorType,
|
|
2659
|
+
failed: o,
|
|
2660
|
+
wasRetried: l,
|
|
2661
|
+
retryCount: c
|
|
2662
|
+
});
|
|
2663
|
+
o || this.handleSuccessfulLoad(i, t, r, s, c, l), this.trackNewRelicAction("pie-resource-load", {
|
|
2664
|
+
url: t.name,
|
|
2665
|
+
duration: Math.round(r),
|
|
2666
|
+
size: s,
|
|
2667
|
+
type: t.initiatorType,
|
|
2668
|
+
failed: o,
|
|
2669
|
+
wasRetried: l,
|
|
2670
|
+
retryCount: c
|
|
2671
|
+
}), o && this.handleFailedLoad(i, t, r, c, l);
|
|
2672
|
+
}
|
|
2673
|
+
/**
|
|
2674
|
+
* Handle successful resource load
|
|
2675
|
+
*/
|
|
2676
|
+
handleSuccessfulLoad(t, n, r, s, i, o) {
|
|
2677
|
+
if (this.dispatchEvent("pie-resource-load-success", {
|
|
2678
|
+
url: t,
|
|
2679
|
+
resourceType: n.initiatorType,
|
|
2680
|
+
duration: r,
|
|
2681
|
+
size: s,
|
|
2682
|
+
retryCount: i,
|
|
2683
|
+
maxRetries: this.config.maxRetries
|
|
2684
|
+
}), o) {
|
|
2685
|
+
const l = this.truncateUrl(t);
|
|
2686
|
+
this.logger.info(
|
|
2687
|
+
`✅ PIE Resource Retry Succeeded!
|
|
2688
|
+
URL: ${l}
|
|
2689
|
+
Retry Attempt: ${i}
|
|
2690
|
+
Load Time: ${r.toFixed(2)}ms
|
|
2691
|
+
Result: Resource now available to user`
|
|
2692
|
+
), this.dispatchEvent("pie-resource-retry-success", {
|
|
2693
|
+
url: t,
|
|
2694
|
+
resourceType: n.initiatorType,
|
|
2695
|
+
duration: r,
|
|
2696
|
+
size: s,
|
|
2697
|
+
retryCount: i,
|
|
2698
|
+
maxRetries: this.config.maxRetries
|
|
2699
|
+
}), this.retryAttempts.delete(t);
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2702
|
+
/**
|
|
2703
|
+
* Handle failed resource load
|
|
2704
|
+
*/
|
|
2705
|
+
handleFailedLoad(t, n, r, s, i) {
|
|
2706
|
+
const o = this.truncateUrl(t);
|
|
2707
|
+
i ? (this.logger.warn(
|
|
2708
|
+
`⚠️ PIE Resource Retry Failed
|
|
2709
|
+
URL: ${o}
|
|
2710
|
+
Retry Attempt: ${s}
|
|
2711
|
+
Remaining Attempts: ${this.config.maxRetries - s}
|
|
2712
|
+
Status: Will ${s >= this.config.maxRetries ? "give up" : "retry again"}`
|
|
2713
|
+
), this.dispatchEvent("pie-resource-retry-failed", {
|
|
2714
|
+
url: t,
|
|
2715
|
+
resourceType: n.initiatorType,
|
|
2716
|
+
duration: r,
|
|
2717
|
+
retryCount: s,
|
|
2718
|
+
maxRetries: this.config.maxRetries,
|
|
2719
|
+
error: "Resource load failed after retry"
|
|
2720
|
+
})) : (this.logger.warn(
|
|
2721
|
+
`⚠️ PIE Resource Initial Load Failed
|
|
2722
|
+
URL: ${o}
|
|
2723
|
+
Status: Will attempt ${this.config.maxRetries} ${this.config.maxRetries === 1 ? "retry" : "retries"}`
|
|
2724
|
+
), this.dispatchEvent("pie-resource-load-failed", {
|
|
2725
|
+
url: t,
|
|
2726
|
+
resourceType: n.initiatorType,
|
|
2727
|
+
duration: r,
|
|
2728
|
+
retryCount: 0,
|
|
2729
|
+
maxRetries: this.config.maxRetries,
|
|
2730
|
+
error: "Initial resource load failed"
|
|
2731
|
+
})), this.trackNewRelicError(new Error(`Resource load failed: ${n.name}`), {
|
|
2732
|
+
resourceUrl: n.name,
|
|
2733
|
+
resourceType: n.initiatorType,
|
|
2734
|
+
duration: Math.round(r),
|
|
2735
|
+
wasRetried: i,
|
|
2736
|
+
retryCount: s
|
|
2737
|
+
});
|
|
2738
|
+
}
|
|
2739
|
+
/**
|
|
2740
|
+
* Check if resource is relevant to our container
|
|
2741
|
+
* Uses container-scoped tracking via MutationObserver
|
|
2742
|
+
*/
|
|
2743
|
+
isRelevantResource(t) {
|
|
2744
|
+
const n = t.name, r = this.containerResources.has(n);
|
|
2745
|
+
if (!r) {
|
|
2746
|
+
for (const s of this.containerResources)
|
|
2747
|
+
if (n.endsWith(s) || s.endsWith(n))
|
|
2748
|
+
return !0;
|
|
2749
|
+
}
|
|
2750
|
+
return r;
|
|
2751
|
+
}
|
|
2752
|
+
/**
|
|
2753
|
+
* Set up error event handler for resource loading failures
|
|
2754
|
+
*/
|
|
2755
|
+
setupErrorHandler() {
|
|
2756
|
+
this.container && (this.errorHandler = (t) => {
|
|
2757
|
+
const n = t.target;
|
|
2758
|
+
if (!this.isResourceElement(n))
|
|
2759
|
+
return;
|
|
2760
|
+
const r = n.tagName.toLowerCase(), s = this.getResourceSrc(n);
|
|
2761
|
+
if (!s)
|
|
2762
|
+
return;
|
|
2763
|
+
const i = this.getOriginalUrl(s), o = this.retryAttempts.get(i) || 0, l = this.config.maxRetries - o, c = l > 0;
|
|
2764
|
+
if (this.isDebugEnabled()) {
|
|
2765
|
+
const a = this.truncateUrl(s);
|
|
2766
|
+
(c ? this.logger.warn.bind(this.logger) : this.logger.error.bind(this.logger))(
|
|
2767
|
+
`${c ? "⚠️" : "❌"} PIE Resource Load Error
|
|
2768
|
+
Element: <${r}>
|
|
2769
|
+
URL: ${a}
|
|
2770
|
+
Current Attempts: ${o}
|
|
2771
|
+
Remaining Retries: ${l}/${this.config.maxRetries}
|
|
2772
|
+
Action: ${c ? "Will retry with exponential backoff" : "Max retries reached, giving up"}`
|
|
2773
|
+
);
|
|
2774
|
+
} else
|
|
2775
|
+
(c ? this.logger.warn.bind(this.logger) : this.logger.error.bind(this.logger))(`${c ? "⚠️" : "❌"} Resource error: ${r} failed to load ${s}`);
|
|
2776
|
+
this.trackNewRelicError(new Error(`Resource load error: ${i}`), {
|
|
2777
|
+
resourceType: r,
|
|
2778
|
+
resourceUrl: i
|
|
2779
|
+
}), this.retryResourceLoad(n, i);
|
|
2780
|
+
}, this.container.addEventListener("error", this.errorHandler, !0), this.logger.debug("Error handler attached to container"));
|
|
2781
|
+
}
|
|
2782
|
+
/**
|
|
2783
|
+
* Check if element is a resource element
|
|
2784
|
+
*/
|
|
2785
|
+
isResourceElement(t) {
|
|
2786
|
+
if (!t || !(t instanceof HTMLElement))
|
|
2787
|
+
return !1;
|
|
2788
|
+
const n = t.tagName.toLowerCase();
|
|
2789
|
+
return ["img", "audio", "video", "link", "source"].includes(n);
|
|
2790
|
+
}
|
|
2791
|
+
/**
|
|
2792
|
+
* Get resource src/href from element
|
|
2793
|
+
*/
|
|
2794
|
+
getResourceSrc(t) {
|
|
2795
|
+
return t instanceof HTMLLinkElement ? t.href : "src" in t && t.src ? t.src : null;
|
|
2796
|
+
}
|
|
2797
|
+
/**
|
|
2798
|
+
* Handle permanent resource failure after all retries exhausted
|
|
2799
|
+
*/
|
|
2800
|
+
handlePermanentFailure(t, n, r) {
|
|
2801
|
+
if (this.isDebugEnabled()) {
|
|
2802
|
+
const s = this.truncateUrl(t);
|
|
2803
|
+
this.logger.error(
|
|
2804
|
+
`❌ PIE Resource Permanently Failed
|
|
2805
|
+
URL: ${s}
|
|
2806
|
+
Total Attempts: ${r + 1} (initial + ${r} retries)
|
|
2807
|
+
Status: Giving up after ${this.config.maxRetries} retries
|
|
2808
|
+
⚠️ This resource will not be available to the user`
|
|
2809
|
+
);
|
|
2810
|
+
} else
|
|
2811
|
+
this.logger.error(`❌ Failed to load resource after ${this.config.maxRetries} retries: ${t}`);
|
|
2812
|
+
this.dispatchEvent("pie-resource-load-error", {
|
|
2813
|
+
url: t,
|
|
2814
|
+
resourceType: n,
|
|
2815
|
+
retryCount: r,
|
|
2816
|
+
maxRetries: this.config.maxRetries,
|
|
2817
|
+
error: `Resource permanently failed after ${this.config.maxRetries} retries`
|
|
2818
|
+
}), this.trackNewRelicError(new Error(`Resource permanently failed after ${this.config.maxRetries} retries: ${t}`), {
|
|
2819
|
+
resourceUrl: t,
|
|
2820
|
+
retryCount: r,
|
|
2821
|
+
resourceType: n
|
|
2822
|
+
});
|
|
2823
|
+
}
|
|
2824
|
+
/**
|
|
2825
|
+
* Log retry schedule information
|
|
2826
|
+
*/
|
|
2827
|
+
logRetrySchedule(t, n, r, s) {
|
|
2828
|
+
if (this.isDebugEnabled()) {
|
|
2829
|
+
const i = this.truncateUrl(t), o = Math.min(
|
|
2830
|
+
this.config.initialRetryDelay * Math.pow(2, n + 1),
|
|
2831
|
+
this.config.maxRetryDelay
|
|
2832
|
+
), l = s === "img" ? "Cache-busting URL" : s === "audio" || s === "video" ? "element.load()" : "Element replacement";
|
|
2833
|
+
this.logger.info(
|
|
2834
|
+
`🔄 PIE Resource Retry Scheduled
|
|
2835
|
+
URL: ${i}
|
|
2836
|
+
Attempt: ${n + 1}/${this.config.maxRetries}
|
|
2837
|
+
⏰ Wait Time: ${r}ms (exponential backoff)
|
|
2838
|
+
Next Retry Delay: ${o}ms (if this fails)
|
|
2839
|
+
Strategy: ${l}`
|
|
2840
|
+
);
|
|
2841
|
+
} else
|
|
2842
|
+
this.logger.info(
|
|
2843
|
+
`🔄 Retrying resource load (attempt ${n + 1}/${this.config.maxRetries}) after ${r}ms: ${t}`
|
|
2844
|
+
);
|
|
2845
|
+
}
|
|
2846
|
+
/**
|
|
2847
|
+
* Retry loading a failed resource with exponential backoff
|
|
2848
|
+
*/
|
|
2849
|
+
async retryResourceLoad(t, n) {
|
|
2850
|
+
const r = this.retryAttempts.get(n) || 0;
|
|
2851
|
+
if (r >= this.config.maxRetries) {
|
|
2852
|
+
this.handlePermanentFailure(n, t.tagName.toLowerCase(), r);
|
|
2853
|
+
return;
|
|
2854
|
+
}
|
|
2855
|
+
const s = Math.min(this.config.initialRetryDelay * Math.pow(2, r), this.config.maxRetryDelay);
|
|
2856
|
+
this.logRetrySchedule(n, r, s, t.tagName.toLowerCase()), this.trackNewRelicAction("pie-resource-retry", {
|
|
2857
|
+
url: n,
|
|
2858
|
+
attempt: r + 1,
|
|
2859
|
+
delay: s
|
|
2860
|
+
}), await new Promise((i) => setTimeout(i, s)), this.isDebugEnabled() && this.logger.debug(`⏱️ Retry wait completed (${s}ms), attempting reload now...`), this.retryAttempts.set(n, r + 1);
|
|
2861
|
+
try {
|
|
2862
|
+
if (t instanceof HTMLAudioElement || t instanceof HTMLVideoElement)
|
|
2863
|
+
t.load(), this.isDebugEnabled() ? this.logger.debug(`✓ Triggered load() on <${t.tagName.toLowerCase()}>`) : this.logger.debug(`Triggered load() on ${t.tagName.toLowerCase()}`);
|
|
2864
|
+
else if (t instanceof HTMLImageElement) {
|
|
2865
|
+
const i = new URL(n);
|
|
2866
|
+
i.searchParams.set("retry", (r + 1).toString()), i.searchParams.set("t", Date.now().toString()), t.src = i.toString(), this.isDebugEnabled() ? this.logger.debug(`✓ Updated <img> src with cache-busting params: retry=${r + 1}, t=${Date.now()}`) : this.logger.debug("Updated img src with cache-busting params");
|
|
2867
|
+
} else if (t instanceof HTMLLinkElement) {
|
|
2868
|
+
const i = t.cloneNode(!0), o = new URL(n);
|
|
2869
|
+
o.searchParams.set("retry", (r + 1).toString()), i.href = o.toString(), t.parentNode?.replaceChild(i, t), this.isDebugEnabled() ? this.logger.debug("✓ Recreated <link> element with cache-busting params") : this.logger.debug("Recreated link element with cache-busting params");
|
|
2870
|
+
}
|
|
2871
|
+
} catch (i) {
|
|
2872
|
+
this.isDebugEnabled() ? this.logger.error(`❌ Error during retry attempt for ${n}:`, i) : this.logger.error(`Error during retry for ${n}:`, i);
|
|
2873
|
+
}
|
|
2874
|
+
}
|
|
2875
|
+
/**
|
|
2876
|
+
* Dispatch a custom event from the container
|
|
2877
|
+
*/
|
|
2878
|
+
dispatchEvent(t, n) {
|
|
2879
|
+
if (!this.container)
|
|
2880
|
+
return;
|
|
2881
|
+
const r = new CustomEvent(t, {
|
|
2882
|
+
detail: n,
|
|
2883
|
+
bubbles: !0,
|
|
2884
|
+
composed: !0
|
|
2885
|
+
// Allow crossing shadow DOM boundaries
|
|
2886
|
+
});
|
|
2887
|
+
this.container.dispatchEvent(r);
|
|
2888
|
+
}
|
|
2889
|
+
/**
|
|
2890
|
+
* Get current retry statistics
|
|
2891
|
+
*/
|
|
2892
|
+
getStats() {
|
|
2893
|
+
const t = [];
|
|
2894
|
+
return this.retryAttempts.forEach((n, r) => {
|
|
2895
|
+
t.push({ url: r, attempts: n });
|
|
2896
|
+
}), {
|
|
2897
|
+
activeRetries: this.retryAttempts.size,
|
|
2898
|
+
failedResources: t.sort((n, r) => r.attempts - n.attempts)
|
|
2899
|
+
};
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
const Ui = 5e3;
|
|
2903
|
+
function Di(e, t, n, r = "pie-player") {
|
|
2904
|
+
const s = Me("use-resource-monitor", n);
|
|
2905
|
+
let i = U(null), o = U(!1);
|
|
2906
|
+
return Re(() => {
|
|
2907
|
+
const l = e(), c = t(), a = n();
|
|
2908
|
+
l && !p(o) && (s.debug(`Initializing resource monitor for ${r}`, {
|
|
2909
|
+
trackPageActions: c?.trackPageActions ?? !1,
|
|
2910
|
+
maxRetries: c?.maxResourceRetries ?? Ce.maxResourceRetries,
|
|
2911
|
+
retryDelay: c?.resourceRetryDelay ?? Ce.resourceRetryDelay
|
|
2912
|
+
}), b(
|
|
2913
|
+
i,
|
|
2914
|
+
new Oi({
|
|
2915
|
+
trackPageActions: c?.trackPageActions ?? !1,
|
|
2916
|
+
maxRetries: c?.maxResourceRetries ?? Ce.maxResourceRetries,
|
|
2917
|
+
initialRetryDelay: c?.resourceRetryDelay ?? Ce.resourceRetryDelay,
|
|
2918
|
+
maxRetryDelay: Ui,
|
|
2919
|
+
debug: a
|
|
2920
|
+
}),
|
|
2921
|
+
!0
|
|
2922
|
+
), p(i).start(l), b(o, !0), s.info(`✅ Resource monitoring enabled for ${r}` + (c?.trackPageActions ? " (with New Relic tracking)" : " (retry only)")));
|
|
2923
|
+
}), mi(() => {
|
|
2924
|
+
if (p(i)) {
|
|
2925
|
+
const l = p(i).getStats();
|
|
2926
|
+
s.debug(`Resource monitor stats at cleanup for ${r}:`, l), p(i).stop(), b(i, null), b(o, !1);
|
|
2927
|
+
}
|
|
2928
|
+
}), {
|
|
2929
|
+
get instance() {
|
|
2930
|
+
return p(i);
|
|
2931
|
+
},
|
|
2932
|
+
getStats() {
|
|
2933
|
+
return p(i)?.getStats() ?? { activeRetries: 0, failedResources: [] };
|
|
2934
|
+
},
|
|
2935
|
+
get isActive() {
|
|
2936
|
+
return p(o) && S(p(i), null, !1);
|
|
2937
|
+
}
|
|
2938
|
+
};
|
|
2939
|
+
}
|
|
2940
|
+
Pr();
|
|
2941
|
+
ue[k] = "src/lib/components/PieItemPlayer.svelte";
|
|
2942
|
+
var Ai = xe(/* @__PURE__ */ Te("<div><!></div>"), ue[k], [[256, 2]]), Bi = xe(/* @__PURE__ */ Te("<div><!></div>"), ue[k], [[262, 2]]), Ni = xe(/* @__PURE__ */ Te('<div class="pie-item-player svelte-d1rctr"><!> <!></div>'), ue[k], [[254, 0]]);
|
|
2943
|
+
const Mi = {
|
|
2944
|
+
hash: "svelte-d1rctr",
|
|
2945
|
+
code: `
|
|
2946
|
+
.pie-item-player.svelte-d1rctr {
|
|
2947
|
+
display: block;
|
|
2948
|
+
width: 100%;
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
.pie-passage-container.svelte-d1rctr,
|
|
2952
|
+
.pie-item-container.svelte-d1rctr {
|
|
2953
|
+
display: block;
|
|
2954
|
+
width: 100%;
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2957
|
+
/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGllSXRlbVBsYXllci5zdmVsdGUiLCJtYXBwaW5ncyI6IjtBQTRRQSxDQUFDLDhCQUFnQixDQUFDO0FBQ2xCLEVBQUUsY0FBYztBQUNoQixFQUFFLFdBQVc7QUFDYjs7QUFFQSxDQUFDLG9DQUFzQjtBQUN2QixDQUFDLGlDQUFtQixDQUFDO0FBQ3JCLEVBQUUsY0FBYztBQUNoQixFQUFFLFdBQVc7QUFDYiIsIm5hbWVzIjpbXSwiaWdub3JlTGlzdCI6W10sInNvdXJjZXMiOlsiUGllSXRlbVBsYXllci5zdmVsdGUiXX0= */`
|
|
2958
|
+
};
|
|
2959
|
+
function ue(e, t) {
|
|
2960
|
+
Dr(new.target), pn(t, !0, ue), Br(e, Mi);
|
|
2961
|
+
const n = Me("pie-item-player", () => Xe());
|
|
2962
|
+
let r = x(t, "itemConfig", 7), s = x(t, "passageConfig", 7, null), i = x(t, "env", 23, () => ({ mode: "gather", role: "student" })), o = x(t, "session", 23, () => []), l = x(t, "addCorrectResponse", 7, !1), c = x(t, "customClassname", 7, ""), a = x(t, "passageContainerClass", 7, ""), u = x(t, "containerClass", 7, ""), d = x(t, "bundleType", 23, () => z.player), f = x(t, "loaderConfig", 7, Ce), g = x(t, "onLoadComplete", 7), m = x(t, "onPlayerError", 7), y = x(t, "onSessionChanged", 7), R = U(!1);
|
|
2963
|
+
const N = (v, L) => {
|
|
2964
|
+
S(v, "load-complete") && g() ? g()(L) : S(v, "player-error") && m() ? m()(L) : S(v, "session-changed") && y() && y()(L);
|
|
2965
|
+
const h = new CustomEvent(v, {
|
|
2966
|
+
detail: L,
|
|
2967
|
+
bubbles: !0,
|
|
2968
|
+
composed: !0
|
|
2969
|
+
// Allow events to cross shadow DOM boundaries
|
|
2970
|
+
});
|
|
2971
|
+
dispatchEvent(h);
|
|
2972
|
+
};
|
|
2973
|
+
async function F() {
|
|
2974
|
+
if (!l() || !r() || p(R)) return;
|
|
2975
|
+
n.debug("[PieItemPlayer] Populating session with correct responses");
|
|
2976
|
+
const v = [];
|
|
2977
|
+
for (const L of r().models) {
|
|
2978
|
+
const h = _n(L.element);
|
|
2979
|
+
if (h && h.createCorrectResponseSession)
|
|
2980
|
+
try {
|
|
2981
|
+
const _ = await h.createCorrectResponseSession(L, i()), { id: P, ...X } = _;
|
|
2982
|
+
v.push({
|
|
2983
|
+
id: L.id,
|
|
2984
|
+
element: L.element,
|
|
2985
|
+
...X
|
|
2986
|
+
});
|
|
2987
|
+
} catch (_) {
|
|
2988
|
+
n.warn(`[PieItemPlayer] Failed to create correct response for ${L.element}:`, _);
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
o().length = 0, o().push(...v), b(R, !0), n.debug("[PieItemPlayer] Correct responses added to session:", o());
|
|
2992
|
+
}
|
|
2993
|
+
const j = Z(() => [
|
|
2994
|
+
"pie-passage-container",
|
|
2995
|
+
c(),
|
|
2996
|
+
a()
|
|
2997
|
+
].filter(Boolean).join(" ")), I = Z(() => [
|
|
2998
|
+
"pie-item-container",
|
|
2999
|
+
c(),
|
|
3000
|
+
u()
|
|
3001
|
+
].filter(Boolean).join(" "));
|
|
3002
|
+
let w = U(!1), M = U(!1), W = U(!1), de = U(null);
|
|
3003
|
+
Di(() => p(de), () => f(), () => Xe(), "pie-item-player"), Re(() => {
|
|
3004
|
+
!r() || p(w) || (n.debug("[PieItemPlayer] Item config received, initializing after DOM renders..."), _r().then(async () => {
|
|
3005
|
+
try {
|
|
3006
|
+
if (n.debug("[PieItemPlayer] DOM ready, initializing PIE elements"), n.debug("[PieItemPlayer] Config:", {
|
|
3007
|
+
itemElements: Object.keys(r().elements || {}),
|
|
3008
|
+
itemModels: (r().models || []).length,
|
|
3009
|
+
passageElements: s() ? Object.keys(s().elements || {}) : [],
|
|
3010
|
+
passageModels: s() ? (s().models || []).length : 0,
|
|
3011
|
+
sessionLength: o().length,
|
|
3012
|
+
addCorrectResponse: l(),
|
|
3013
|
+
env: i()
|
|
3014
|
+
}), Vn(r(), [], { env: i(), bundleType: d() }), n.debug("[PieItemPlayer] Item bundle initialized (bundle type: %s)", d()), s() && (Vn(s(), [], { env: i(), bundleType: d() }), n.debug("[PieItemPlayer] Passage bundle initialized (bundle type: %s)", d())), await F(), n.debug("[PieItemPlayer] Updating elements with session (length=" + o().length + ")"), _t(r(), o(), i()), s() && _t(s(), o(), i()), b(w, !0), !p(M)) {
|
|
3015
|
+
const v = document.querySelector(".pie-item-player"), L = (h) => {
|
|
3016
|
+
if (p(W))
|
|
3017
|
+
return;
|
|
3018
|
+
const _ = h;
|
|
3019
|
+
n.debug("[PieItemPlayer] session-changed event received from PIE element"), b(W, !0);
|
|
3020
|
+
try {
|
|
3021
|
+
N("session-changed", _.detail);
|
|
3022
|
+
} finally {
|
|
3023
|
+
setTimeout(
|
|
3024
|
+
() => {
|
|
3025
|
+
b(W, !1);
|
|
3026
|
+
},
|
|
3027
|
+
0
|
|
3028
|
+
);
|
|
3029
|
+
}
|
|
3030
|
+
};
|
|
3031
|
+
v && (v.addEventListener("session-changed", L), b(M, !0), n.debug("[PieItemPlayer] session-changed listener attached to root element"));
|
|
3032
|
+
}
|
|
3033
|
+
n.debug("[PieItemPlayer] ✅ Initialization complete, dispatching load-complete event"), N("load-complete");
|
|
3034
|
+
} catch (v) {
|
|
3035
|
+
n.error("[PieItemPlayer] Error initializing:", v), N("player-error", v.message);
|
|
3036
|
+
}
|
|
3037
|
+
}));
|
|
3038
|
+
}), Re(() => {
|
|
3039
|
+
!p(w) || !i() || !r() || !o() || (n.debug("[PieItemPlayer] Dependencies changed, updating elements"), n.debug("[PieItemPlayer] Env:", i()), n.debug("[PieItemPlayer] Session (length=" + o().length + "):", o()), _t(r(), o(), i()), s() && _t(s(), o(), i()));
|
|
3040
|
+
});
|
|
3041
|
+
var Le = Ni(), se = le(Le);
|
|
3042
|
+
{
|
|
3043
|
+
var tt = (v) => {
|
|
3044
|
+
var L = Ai(), h = le(L);
|
|
3045
|
+
Mn(h, () => s().markup), oe(L), lt(() => He(L, 1, p(j), "svelte-d1rctr")), ge(v, L);
|
|
3046
|
+
};
|
|
3047
|
+
ct(se, (v) => {
|
|
3048
|
+
s()?.markup && v(tt);
|
|
3049
|
+
});
|
|
3050
|
+
}
|
|
3051
|
+
var ke = Kt(se, 2);
|
|
3052
|
+
{
|
|
3053
|
+
var Nt = (v) => {
|
|
3054
|
+
var L = Bi(), h = le(L);
|
|
3055
|
+
Mn(h, () => r().markup), oe(L), lt(() => He(L, 1, p(I), "svelte-d1rctr")), ge(v, L);
|
|
3056
|
+
};
|
|
3057
|
+
ct(ke, (v) => {
|
|
3058
|
+
r()?.markup && v(Nt);
|
|
3059
|
+
});
|
|
3060
|
+
}
|
|
3061
|
+
return oe(Le), Nr(Le, (v) => b(de, v), () => p(de)), ge(e, Le), vn({
|
|
3062
|
+
get itemConfig() {
|
|
3063
|
+
return r();
|
|
3064
|
+
},
|
|
3065
|
+
set itemConfig(v) {
|
|
3066
|
+
r(v), E();
|
|
3067
|
+
},
|
|
3068
|
+
get passageConfig() {
|
|
3069
|
+
return s();
|
|
3070
|
+
},
|
|
3071
|
+
set passageConfig(v = null) {
|
|
3072
|
+
s(v), E();
|
|
3073
|
+
},
|
|
3074
|
+
get env() {
|
|
3075
|
+
return i();
|
|
3076
|
+
},
|
|
3077
|
+
set env(v = { mode: "gather", role: "student" }) {
|
|
3078
|
+
i(v), E();
|
|
3079
|
+
},
|
|
3080
|
+
get session() {
|
|
3081
|
+
return o();
|
|
3082
|
+
},
|
|
3083
|
+
set session(v = []) {
|
|
3084
|
+
o(v), E();
|
|
3085
|
+
},
|
|
3086
|
+
get addCorrectResponse() {
|
|
3087
|
+
return l();
|
|
3088
|
+
},
|
|
3089
|
+
set addCorrectResponse(v = !1) {
|
|
3090
|
+
l(v), E();
|
|
3091
|
+
},
|
|
3092
|
+
get customClassname() {
|
|
3093
|
+
return c();
|
|
3094
|
+
},
|
|
3095
|
+
set customClassname(v = "") {
|
|
3096
|
+
c(v), E();
|
|
3097
|
+
},
|
|
3098
|
+
get passageContainerClass() {
|
|
3099
|
+
return a();
|
|
3100
|
+
},
|
|
3101
|
+
set passageContainerClass(v = "") {
|
|
3102
|
+
a(v), E();
|
|
3103
|
+
},
|
|
3104
|
+
get containerClass() {
|
|
3105
|
+
return u();
|
|
3106
|
+
},
|
|
3107
|
+
set containerClass(v = "") {
|
|
3108
|
+
u(v), E();
|
|
3109
|
+
},
|
|
3110
|
+
get bundleType() {
|
|
3111
|
+
return d();
|
|
3112
|
+
},
|
|
3113
|
+
set bundleType(v = z.player) {
|
|
3114
|
+
d(v), E();
|
|
3115
|
+
},
|
|
3116
|
+
get loaderConfig() {
|
|
3117
|
+
return f();
|
|
3118
|
+
},
|
|
3119
|
+
set loaderConfig(v = Ce) {
|
|
3120
|
+
f(v), E();
|
|
3121
|
+
},
|
|
3122
|
+
get onLoadComplete() {
|
|
3123
|
+
return g();
|
|
3124
|
+
},
|
|
3125
|
+
set onLoadComplete(v) {
|
|
3126
|
+
g(v), E();
|
|
3127
|
+
},
|
|
3128
|
+
get onPlayerError() {
|
|
3129
|
+
return m();
|
|
3130
|
+
},
|
|
3131
|
+
set onPlayerError(v) {
|
|
3132
|
+
m(v), E();
|
|
3133
|
+
},
|
|
3134
|
+
get onSessionChanged() {
|
|
3135
|
+
return y();
|
|
3136
|
+
},
|
|
3137
|
+
set onSessionChanged(v) {
|
|
3138
|
+
y(v), E();
|
|
3139
|
+
},
|
|
3140
|
+
...Ar()
|
|
3141
|
+
});
|
|
3142
|
+
}
|
|
3143
|
+
Sr(ue);
|
|
3144
|
+
jr(
|
|
3145
|
+
ue,
|
|
3146
|
+
{
|
|
3147
|
+
itemConfig: {},
|
|
3148
|
+
passageConfig: {},
|
|
3149
|
+
env: {},
|
|
3150
|
+
session: {},
|
|
3151
|
+
addCorrectResponse: {},
|
|
3152
|
+
customClassname: {},
|
|
3153
|
+
passageContainerClass: {},
|
|
3154
|
+
containerClass: {},
|
|
3155
|
+
bundleType: {},
|
|
3156
|
+
loaderConfig: {},
|
|
3157
|
+
onLoadComplete: {},
|
|
3158
|
+
onPlayerError: {},
|
|
3159
|
+
onSessionChanged: {}
|
|
3160
|
+
},
|
|
3161
|
+
[],
|
|
3162
|
+
[],
|
|
3163
|
+
!0
|
|
3164
|
+
);
|
|
3165
|
+
const Jt = (e) => {
|
|
3166
|
+
const t = "--version-", n = (c) => {
|
|
3167
|
+
const a = c.match(`${t}(\\d+-\\d+-\\d+)$`);
|
|
3168
|
+
return a ? {
|
|
3169
|
+
baseName: c.replace(`${t}${a[1]}`, ""),
|
|
3170
|
+
existingVersion: a[1].replace(/-/g, ".")
|
|
3171
|
+
} : { baseName: c };
|
|
3172
|
+
}, r = (c, a) => {
|
|
3173
|
+
const { baseName: u, existingVersion: d } = n(c), { version: f } = qr(a);
|
|
3174
|
+
return d !== f ? `${u}${t}${f.replace(/\./g, "-")}` : c;
|
|
3175
|
+
}, s = Object.entries(e.config.elements).reduce(
|
|
3176
|
+
(c, [a, u]) => {
|
|
3177
|
+
const d = r(a, u);
|
|
3178
|
+
return {
|
|
3179
|
+
...c,
|
|
3180
|
+
[a]: {
|
|
3181
|
+
versionedName: d,
|
|
3182
|
+
package: u
|
|
3183
|
+
}
|
|
3184
|
+
};
|
|
3185
|
+
},
|
|
3186
|
+
{}
|
|
3187
|
+
), i = Object.entries(s).reduce(
|
|
3188
|
+
(c, [a, { versionedName: u }]) => a !== u ? c.replace(new RegExp(`<${a}`, "g"), `<${u}`).replace(new RegExp(`</${a}`, "g"), `</${u}`) : c,
|
|
3189
|
+
e.config.markup
|
|
3190
|
+
), o = Object.values(s).reduce(
|
|
3191
|
+
(c, { versionedName: a, package: u }) => ({
|
|
3192
|
+
...c,
|
|
3193
|
+
[a]: u
|
|
3194
|
+
}),
|
|
3195
|
+
{}
|
|
3196
|
+
), l = e.config.models.map((c) => {
|
|
3197
|
+
const a = c.element, u = s[a];
|
|
3198
|
+
if (u && u.versionedName !== a)
|
|
3199
|
+
return {
|
|
3200
|
+
...c,
|
|
3201
|
+
element: u.versionedName
|
|
3202
|
+
};
|
|
3203
|
+
if (o[a])
|
|
3204
|
+
return c;
|
|
3205
|
+
const d = Object.entries(s).filter(([f, { versionedName: g }]) => {
|
|
3206
|
+
const { baseName: m } = n(f);
|
|
3207
|
+
return m === a;
|
|
3208
|
+
});
|
|
3209
|
+
if (d.length > 0) {
|
|
3210
|
+
const [, { versionedName: f }] = d[0];
|
|
3211
|
+
return {
|
|
3212
|
+
...c,
|
|
3213
|
+
element: f
|
|
3214
|
+
};
|
|
3215
|
+
}
|
|
3216
|
+
return c;
|
|
3217
|
+
});
|
|
3218
|
+
return {
|
|
3219
|
+
...e,
|
|
3220
|
+
config: {
|
|
3221
|
+
...e.config,
|
|
3222
|
+
elements: o,
|
|
3223
|
+
markup: i,
|
|
3224
|
+
models: l
|
|
3225
|
+
}
|
|
3226
|
+
};
|
|
3227
|
+
};
|
|
3228
|
+
Pr();
|
|
3229
|
+
be[k] = "src/lib/tags/pie-fixed-player/PieFixedPlayer.svelte";
|
|
3230
|
+
var ji = xe(
|
|
3231
|
+
/* @__PURE__ */ Te(`<div class="pie-player-error" style="
|
|
3232
|
+
padding: 20px;
|
|
3233
|
+
margin: 20px;
|
|
3234
|
+
border: 2px solid #d32f2f;
|
|
3235
|
+
border-radius: 4px;
|
|
3236
|
+
background-color: #ffebee;
|
|
3237
|
+
color: #c62828;
|
|
3238
|
+
font-family: sans-serif;
|
|
3239
|
+
"><h3 style="margin: 0 0 10px 0">⚠️ Configuration Error</h3> <p style="margin: 0"> </p></div>`),
|
|
3240
|
+
be[k],
|
|
3241
|
+
[[337, 2, [[346, 3], [347, 3]]]]
|
|
3242
|
+
), Qi = xe(/* @__PURE__ */ Te('<div class="pie-loading" style="padding: 20px; text-align: center;"><p>Loading...</p></div>'), be[k], [[350, 2, [[351, 3]]]]), zi = xe(/* @__PURE__ */ Te('<div class="pie-stimulus-container" style="display: flex; gap: 20px; width: 100%;"><div style="flex: 1; min-width: 0;"><!></div> <div style="flex: 1; min-width: 0;"><!></div></div>'), be[k], [[356, 2, [[357, 3], [373, 3]]]]), qi = xe(/* @__PURE__ */ Te("<div><!></div>"), be[k], [[392, 2]]), Hi = xe(/* @__PURE__ */ Te("<div><!></div>"), be[k], [[335, 0]]);
|
|
3243
|
+
const Vi = {
|
|
3244
|
+
hash: "svelte-10l24ug",
|
|
3245
|
+
code: `
|
|
3246
|
+
:host {
|
|
3247
|
+
display: block;
|
|
3248
|
+
}
|
|
3249
|
+
|
|
3250
|
+
.pie-fixed-player {
|
|
3251
|
+
width: 100%;
|
|
3252
|
+
}
|
|
3253
|
+
|
|
3254
|
+
.player-item-container,
|
|
3255
|
+
.player-stimulus-container {
|
|
3256
|
+
width: 100%;
|
|
3257
|
+
}
|
|
3258
|
+
|
|
3259
|
+
/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGllRml4ZWRQbGF5ZXIuc3ZlbHRlIiwibWFwcGluZ3MiOiI7QUErWkEsQ0FBQyxLQUFLLENBQUM7QUFDUCxFQUFFLGNBQWM7QUFDaEI7O0FBRUEsQ0FBUyxpQkFBa0IsQ0FBQztBQUM1QixFQUFFLFdBQVc7QUFDYjs7QUFFQSxDQUFTLHNCQUF1QjtBQUNoQyxDQUFTLDBCQUEyQixDQUFDO0FBQ3JDLEVBQUUsV0FBVztBQUNiIiwibmFtZXMiOltdLCJpZ25vcmVMaXN0IjpbXSwic291cmNlcyI6WyJQaWVGaXhlZFBsYXllci5zdmVsdGUiXX0= */`
|
|
3260
|
+
};
|
|
3261
|
+
function be(e, t) {
|
|
3262
|
+
Dr(new.target), pn(t, !0, be), Br(e, Vi);
|
|
3263
|
+
let n = x(t, "config", 7, null), r = x(t, "session", 23, () => ({ id: "", data: [] })), s = x(t, "env", 23, () => ({ mode: "gather", role: "student" })), i = x(t, "addCorrectResponse", 7, !1), o = x(t, "renderStimulus", 7, !0), l = x(t, "allowedResize", 7, !1), c = x(t, "showBottomBorder", 7, !1), a = x(t, "debug", 7, ""), u = x(t, "customClassname", 7, ""), d = x(t, "containerClass", 7, ""), f = x(t, "passageContainerClass", 7, ""), g = x(t, "externalStyleUrls", 7, ""), m = x(t, "bundleType", 7, "player.js"), y = x(t, "loaderConfig", 7, Ce);
|
|
3264
|
+
const R = S(typeof window, "undefined", !1) && S(typeof document, "undefined", !1), N = Z(() => {
|
|
3265
|
+
if (S(a(), void 0, !1) && S(a(), null, !1)) {
|
|
3266
|
+
const _ = String(a()), P = !(S(_.toLowerCase(), "false") || S(_, "0") || S(_, ""));
|
|
3267
|
+
if (R)
|
|
3268
|
+
try {
|
|
3269
|
+
window.PIE_DEBUG = P, console.log(...zn("log", "[pie-fixed-player] Setting PIE_DEBUG:", P, "from debug prop:", a(), "type:", typeof a()));
|
|
3270
|
+
} catch {
|
|
3271
|
+
}
|
|
3272
|
+
return P;
|
|
3273
|
+
}
|
|
3274
|
+
const h = Xe();
|
|
3275
|
+
return R && console.log(...zn("log", "[pie-fixed-player] Using global PIE_DEBUG:", h)), h;
|
|
3276
|
+
}), F = Me("pie-fixed-player", () => p(N));
|
|
3277
|
+
let j = U(!0), I = U(null), w = U(null), M = U(null), W = U(null);
|
|
3278
|
+
const de = u() || `pie-player-${Date.now().toString(36)}`;
|
|
3279
|
+
Re(() => {
|
|
3280
|
+
if (n()) {
|
|
3281
|
+
performance.mark("pie-load-end");
|
|
3282
|
+
try {
|
|
3283
|
+
const h = S(typeof n(), "string") ? JSON.parse(n()) : n();
|
|
3284
|
+
if (h.pie && h.passage) {
|
|
3285
|
+
const _ = Jt({ config: h.pie }), P = Jt({ config: h.passage });
|
|
3286
|
+
b(w, _.config, !0), b(M, o() ? P.config : null, !0), b(j, !1), b(I, null);
|
|
3287
|
+
} else if (h.elements || h.models || h.markup) {
|
|
3288
|
+
const _ = Jt({ config: h });
|
|
3289
|
+
b(w, _.config, !0), b(M, null), b(j, !1), b(I, null);
|
|
3290
|
+
} else {
|
|
3291
|
+
const _ = "Invalid config: must contain elements, models, and markup, or pie/passage structure";
|
|
3292
|
+
if (b(I, _), b(j, !1), R && y()?.trackPageActions)
|
|
3293
|
+
try {
|
|
3294
|
+
const P = window?.newrelic;
|
|
3295
|
+
P && S(typeof P.noticeError, "function") && P.noticeError(new Error(_), {
|
|
3296
|
+
component: "pie-fixed-player",
|
|
3297
|
+
errorType: "InvalidConfig"
|
|
3298
|
+
});
|
|
3299
|
+
} catch {
|
|
3300
|
+
F.debug("New Relic tracking skipped (InvalidConfig)");
|
|
3301
|
+
}
|
|
3302
|
+
}
|
|
3303
|
+
} catch (h) {
|
|
3304
|
+
const _ = `Error parsing config: ${h.message}`;
|
|
3305
|
+
if (b(I, _), b(j, !1), R && y()?.trackPageActions)
|
|
3306
|
+
try {
|
|
3307
|
+
const P = window?.newrelic;
|
|
3308
|
+
P && S(typeof P.noticeError, "function") && P.noticeError(h, {
|
|
3309
|
+
component: "pie-fixed-player",
|
|
3310
|
+
errorType: "ConfigParseError"
|
|
3311
|
+
});
|
|
3312
|
+
} catch {
|
|
3313
|
+
F.debug("New Relic tracking skipped (ConfigParseError)");
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
3316
|
+
} else
|
|
3317
|
+
b(w, null), b(M, null), b(j, !0);
|
|
3318
|
+
});
|
|
3319
|
+
const Le = async (h) => {
|
|
3320
|
+
if (!(!R || !h || S(typeof h, "string", !1))) {
|
|
3321
|
+
if (document.querySelector(`style[data-pie-style="${h}"]`)) {
|
|
3322
|
+
F.debug(`Stylesheet already loaded: ${h}`);
|
|
3323
|
+
return;
|
|
3324
|
+
}
|
|
3325
|
+
try {
|
|
3326
|
+
const X = (await (await fetch(h)).text()).replace(/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g, `.pie-fixed-player.${de} $1$2`), ie = document.createElement("style");
|
|
3327
|
+
ie.setAttribute("data-pie-style", h), ie.textContent = X, document.head.appendChild(ie), F.info(`✅ Loaded and scoped stylesheet: ${h}`);
|
|
3328
|
+
} catch (_) {
|
|
3329
|
+
F.error(`❌ Failed to load external stylesheet: ${h}`, _);
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
};
|
|
3333
|
+
Re(() => {
|
|
3334
|
+
g() && S(typeof g(), "string") && g().split(",").map((_) => _.trim()).forEach((_) => {
|
|
3335
|
+
_ && Le(_);
|
|
3336
|
+
});
|
|
3337
|
+
}), Re(() => {
|
|
3338
|
+
if (!p(w)?.resources?.stylesheets) return;
|
|
3339
|
+
const h = p(w).resources.stylesheets;
|
|
3340
|
+
Array.isArray(h) && h.forEach((_) => {
|
|
3341
|
+
const P = _?.url;
|
|
3342
|
+
P && S(typeof P, "string") && Le(P);
|
|
3343
|
+
});
|
|
3344
|
+
}), Re(() => {
|
|
3345
|
+
c() && S(s().mode, "evaluate") && p(w)?.elements && _r().then(() => {
|
|
3346
|
+
Object.keys(p(w).elements).forEach((_) => {
|
|
3347
|
+
document.querySelectorAll(_).forEach((X) => {
|
|
3348
|
+
X instanceof HTMLElement && (X.style.borderBottom = "1px solid #ddd", X.style.paddingBottom = "20px", X.style.marginBottom = "20px");
|
|
3349
|
+
});
|
|
3350
|
+
});
|
|
3351
|
+
});
|
|
3352
|
+
});
|
|
3353
|
+
const se = (h) => {
|
|
3354
|
+
const _ = new CustomEvent(h.type, {
|
|
3355
|
+
detail: h.detail,
|
|
3356
|
+
bubbles: !0,
|
|
3357
|
+
composed: !0
|
|
3358
|
+
});
|
|
3359
|
+
p(W)?.parentElement ? (p(W).parentElement.dispatchEvent(_), F.debug(`Dispatched ${h.type} event from custom element host`)) : F.warn("⚠️ Cannot dispatch event: custom element host not found");
|
|
3360
|
+
}, tt = (h) => {
|
|
3361
|
+
se(h);
|
|
3362
|
+
};
|
|
3363
|
+
var ke = Hi();
|
|
3364
|
+
He(ke, 1, `pie-fixed-player ${de ?? ""}`);
|
|
3365
|
+
var Nt = le(ke);
|
|
3366
|
+
{
|
|
3367
|
+
var v = (h) => {
|
|
3368
|
+
var _ = ji(), P = Kt(le(_), 2), X = le(P, !0);
|
|
3369
|
+
oe(P), oe(_), lt(() => fi(X, p(I))), ge(h, _);
|
|
3370
|
+
}, L = (h, _) => {
|
|
3371
|
+
{
|
|
3372
|
+
var P = (ie) => {
|
|
3373
|
+
var Mt = Qi();
|
|
3374
|
+
ge(ie, Mt);
|
|
3375
|
+
}, X = (ie, Mt) => {
|
|
3376
|
+
{
|
|
3377
|
+
var Vr = (je) => {
|
|
3378
|
+
var we = zi(), Qe = le(we), jt = le(Qe);
|
|
3379
|
+
const Qt = Z(() => S(typeof s(), "string") ? JSON.parse(s()) : s()), zt = Z(() => (S(typeof r(), "string") ? JSON.parse(r()) : r()).data || []), Ee = Z(() => S(m(), "client-player.js") ? z.clientPlayer : z.player);
|
|
3380
|
+
ue(jt, {
|
|
3381
|
+
get itemConfig() {
|
|
3382
|
+
return p(M);
|
|
3383
|
+
},
|
|
3384
|
+
get env() {
|
|
3385
|
+
return p(Qt);
|
|
3386
|
+
},
|
|
3387
|
+
get session() {
|
|
3388
|
+
return p(zt);
|
|
3389
|
+
},
|
|
3390
|
+
get addCorrectResponse() {
|
|
3391
|
+
return i();
|
|
3392
|
+
},
|
|
3393
|
+
customClassname: de,
|
|
3394
|
+
get bundleType() {
|
|
3395
|
+
return p(Ee);
|
|
3396
|
+
},
|
|
3397
|
+
onLoadComplete: (G) => se(new CustomEvent("load-complete", { detail: G })),
|
|
3398
|
+
onPlayerError: (G) => se(new CustomEvent("player-error", { detail: G })),
|
|
3399
|
+
onSessionChanged: (G) => tt(new CustomEvent("session-changed", { detail: G }))
|
|
3400
|
+
}), oe(Qe);
|
|
3401
|
+
var qt = Kt(Qe, 2), Yr = le(qt);
|
|
3402
|
+
const Jr = Z(() => S(typeof s(), "string") ? JSON.parse(s()) : s()), Wr = Z(() => (S(typeof r(), "string") ? JSON.parse(r()) : r()).data || []), Xr = Z(() => S(m(), "client-player.js") ? z.clientPlayer : z.player);
|
|
3403
|
+
ue(Yr, {
|
|
3404
|
+
get itemConfig() {
|
|
3405
|
+
return p(w);
|
|
3406
|
+
},
|
|
3407
|
+
get env() {
|
|
3408
|
+
return p(Jr);
|
|
3409
|
+
},
|
|
3410
|
+
get session() {
|
|
3411
|
+
return p(Wr);
|
|
3412
|
+
},
|
|
3413
|
+
get addCorrectResponse() {
|
|
3414
|
+
return i();
|
|
3415
|
+
},
|
|
3416
|
+
customClassname: de,
|
|
3417
|
+
get bundleType() {
|
|
3418
|
+
return p(Xr);
|
|
3419
|
+
},
|
|
3420
|
+
onLoadComplete: (G) => se(new CustomEvent("load-complete", { detail: G })),
|
|
3421
|
+
onPlayerError: (G) => se(new CustomEvent("player-error", { detail: G })),
|
|
3422
|
+
onSessionChanged: (G) => tt(new CustomEvent("session-changed", { detail: G }))
|
|
3423
|
+
}), oe(qt), oe(we), lt(() => {
|
|
3424
|
+
He(Qe, 1, `player-stimulus-container ${f() ?? ""}`), He(qt, 1, `player-item-container ${d() ?? ""}`);
|
|
3425
|
+
}), ge(je, we);
|
|
3426
|
+
}, Gr = (je) => {
|
|
3427
|
+
var we = qi(), Qe = le(we);
|
|
3428
|
+
const jt = Z(() => S(typeof s(), "string") ? JSON.parse(s()) : s()), Qt = Z(() => (S(typeof r(), "string") ? JSON.parse(r()) : r()).data || []), zt = Z(() => S(m(), "client-player.js") ? z.clientPlayer : z.player);
|
|
3429
|
+
ue(Qe, {
|
|
3430
|
+
get itemConfig() {
|
|
3431
|
+
return p(w);
|
|
3432
|
+
},
|
|
3433
|
+
get passageConfig() {
|
|
3434
|
+
return p(M);
|
|
3435
|
+
},
|
|
3436
|
+
get env() {
|
|
3437
|
+
return p(jt);
|
|
3438
|
+
},
|
|
3439
|
+
get session() {
|
|
3440
|
+
return p(Qt);
|
|
3441
|
+
},
|
|
3442
|
+
get addCorrectResponse() {
|
|
3443
|
+
return i();
|
|
3444
|
+
},
|
|
3445
|
+
customClassname: de,
|
|
3446
|
+
get passageContainerClass() {
|
|
3447
|
+
return f();
|
|
3448
|
+
},
|
|
3449
|
+
get containerClass() {
|
|
3450
|
+
return d();
|
|
3451
|
+
},
|
|
3452
|
+
get bundleType() {
|
|
3453
|
+
return p(zt);
|
|
3454
|
+
},
|
|
3455
|
+
get loaderConfig() {
|
|
3456
|
+
return y();
|
|
3457
|
+
},
|
|
3458
|
+
onLoadComplete: (Ee) => se(new CustomEvent("load-complete", { detail: Ee })),
|
|
3459
|
+
onPlayerError: (Ee) => se(new CustomEvent("player-error", { detail: Ee })),
|
|
3460
|
+
onSessionChanged: (Ee) => tt(new CustomEvent("session-changed", { detail: Ee }))
|
|
3461
|
+
}), oe(we), lt(() => He(we, 1, `player-item-container ${d() ?? ""}`)), ge(je, we);
|
|
3462
|
+
};
|
|
3463
|
+
ct(
|
|
3464
|
+
ie,
|
|
3465
|
+
(je) => {
|
|
3466
|
+
p(M) && o() ? je(Vr) : je(Gr, !1);
|
|
3467
|
+
},
|
|
3468
|
+
Mt
|
|
3469
|
+
);
|
|
3470
|
+
}
|
|
3471
|
+
};
|
|
3472
|
+
ct(
|
|
3473
|
+
h,
|
|
3474
|
+
(ie) => {
|
|
3475
|
+
p(j) || !p(w) ? ie(P) : ie(X, !1);
|
|
3476
|
+
},
|
|
3477
|
+
_
|
|
3478
|
+
);
|
|
3479
|
+
}
|
|
3480
|
+
};
|
|
3481
|
+
ct(Nt, (h) => {
|
|
3482
|
+
p(I) ? h(v) : h(L, !1);
|
|
3483
|
+
});
|
|
3484
|
+
}
|
|
3485
|
+
return oe(ke), Nr(ke, (h) => b(W, h), () => p(W)), ge(e, ke), vn({
|
|
3486
|
+
get config() {
|
|
3487
|
+
return n();
|
|
3488
|
+
},
|
|
3489
|
+
set config(h = null) {
|
|
3490
|
+
n(h), E();
|
|
3491
|
+
},
|
|
3492
|
+
get session() {
|
|
3493
|
+
return r();
|
|
3494
|
+
},
|
|
3495
|
+
set session(h = { id: "", data: [] }) {
|
|
3496
|
+
r(h), E();
|
|
3497
|
+
},
|
|
3498
|
+
get env() {
|
|
3499
|
+
return s();
|
|
3500
|
+
},
|
|
3501
|
+
set env(h = { mode: "gather", role: "student" }) {
|
|
3502
|
+
s(h), E();
|
|
3503
|
+
},
|
|
3504
|
+
get addCorrectResponse() {
|
|
3505
|
+
return i();
|
|
3506
|
+
},
|
|
3507
|
+
set addCorrectResponse(h = !1) {
|
|
3508
|
+
i(h), E();
|
|
3509
|
+
},
|
|
3510
|
+
get renderStimulus() {
|
|
3511
|
+
return o();
|
|
3512
|
+
},
|
|
3513
|
+
set renderStimulus(h = !0) {
|
|
3514
|
+
o(h), E();
|
|
3515
|
+
},
|
|
3516
|
+
get allowedResize() {
|
|
3517
|
+
return l();
|
|
3518
|
+
},
|
|
3519
|
+
set allowedResize(h = !1) {
|
|
3520
|
+
l(h), E();
|
|
3521
|
+
},
|
|
3522
|
+
get showBottomBorder() {
|
|
3523
|
+
return c();
|
|
3524
|
+
},
|
|
3525
|
+
set showBottomBorder(h = !1) {
|
|
3526
|
+
c(h), E();
|
|
3527
|
+
},
|
|
3528
|
+
get debug() {
|
|
3529
|
+
return a();
|
|
3530
|
+
},
|
|
3531
|
+
set debug(h = "") {
|
|
3532
|
+
a(h), E();
|
|
3533
|
+
},
|
|
3534
|
+
get customClassname() {
|
|
3535
|
+
return u();
|
|
3536
|
+
},
|
|
3537
|
+
set customClassname(h = "") {
|
|
3538
|
+
u(h), E();
|
|
3539
|
+
},
|
|
3540
|
+
get containerClass() {
|
|
3541
|
+
return d();
|
|
3542
|
+
},
|
|
3543
|
+
set containerClass(h = "") {
|
|
3544
|
+
d(h), E();
|
|
3545
|
+
},
|
|
3546
|
+
get passageContainerClass() {
|
|
3547
|
+
return f();
|
|
3548
|
+
},
|
|
3549
|
+
set passageContainerClass(h = "") {
|
|
3550
|
+
f(h), E();
|
|
3551
|
+
},
|
|
3552
|
+
get externalStyleUrls() {
|
|
3553
|
+
return g();
|
|
3554
|
+
},
|
|
3555
|
+
set externalStyleUrls(h = "") {
|
|
3556
|
+
g(h), E();
|
|
3557
|
+
},
|
|
3558
|
+
get bundleType() {
|
|
3559
|
+
return m();
|
|
3560
|
+
},
|
|
3561
|
+
set bundleType(h = "player.js") {
|
|
3562
|
+
m(h), E();
|
|
3563
|
+
},
|
|
3564
|
+
get loaderConfig() {
|
|
3565
|
+
return y();
|
|
3566
|
+
},
|
|
3567
|
+
set loaderConfig(h = Ce) {
|
|
3568
|
+
y(h), E();
|
|
3569
|
+
},
|
|
3570
|
+
...Ar()
|
|
3571
|
+
});
|
|
3572
|
+
}
|
|
3573
|
+
Sr(be);
|
|
3574
|
+
customElements.define("pie-fixed-player", jr(
|
|
3575
|
+
be,
|
|
3576
|
+
{
|
|
3577
|
+
config: { attribute: "config", type: "Object" },
|
|
3578
|
+
session: { attribute: "session", type: "Object" },
|
|
3579
|
+
env: { attribute: "env", type: "Object" },
|
|
3580
|
+
addCorrectResponse: {
|
|
3581
|
+
attribute: "add-correct-response",
|
|
3582
|
+
type: "Boolean"
|
|
3583
|
+
},
|
|
3584
|
+
renderStimulus: { attribute: "render-stimulus", type: "Boolean" },
|
|
3585
|
+
allowedResize: { attribute: "allowed-resize", type: "Boolean" },
|
|
3586
|
+
showBottomBorder: {
|
|
3587
|
+
attribute: "show-bottom-border",
|
|
3588
|
+
type: "Boolean"
|
|
3589
|
+
},
|
|
3590
|
+
debug: { attribute: "debug", type: "String" },
|
|
3591
|
+
customClassname: { attribute: "custom-classname", type: "String" },
|
|
3592
|
+
containerClass: { attribute: "container-class", type: "String" },
|
|
3593
|
+
passageContainerClass: {
|
|
3594
|
+
attribute: "passage-container-class",
|
|
3595
|
+
type: "String"
|
|
3596
|
+
},
|
|
3597
|
+
externalStyleUrls: {
|
|
3598
|
+
attribute: "external-style-urls",
|
|
3599
|
+
type: "String"
|
|
3600
|
+
},
|
|
3601
|
+
bundleType: { attribute: "bundle-type", type: "String" },
|
|
3602
|
+
loaderConfig: { attribute: "loader-config", type: "Object" }
|
|
3603
|
+
},
|
|
3604
|
+
[],
|
|
3605
|
+
[],
|
|
3606
|
+
!1
|
|
3607
|
+
));
|
|
3608
|
+
//# sourceMappingURL=pie-fixed-player.js.map
|