eat-js-sdk 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/interaction-builder.mjs +4875 -0
- package/package.json +2 -2
|
@@ -0,0 +1,4875 @@
|
|
|
1
|
+
var xo = Object.defineProperty;
|
|
2
|
+
var Ni = (t) => {
|
|
3
|
+
throw TypeError(t);
|
|
4
|
+
};
|
|
5
|
+
var Co = (t, e, r) => e in t ? xo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
6
|
+
var lt = (t, e, r) => Co(t, typeof e != "symbol" ? e + "" : e, r), Yr = (t, e, r) => e.has(t) || Ni("Cannot " + r);
|
|
7
|
+
var v = (t, e, r) => (Yr(t, e, "read from private field"), r ? r.call(t) : e.get(t)), B = (t, e, r) => e.has(t) ? Ni("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), L = (t, e, r, i) => (Yr(t, e, "write to private field"), i ? i.call(t, r) : e.set(t, r), r), ot = (t, e, r) => (Yr(t, e, "access private method"), r);
|
|
8
|
+
const Ie = {}, ft = Symbol(), ko = "http://www.w3.org/1999/xhtml", Wi = !1;
|
|
9
|
+
var mi = Array.isArray, To = Array.prototype.indexOf, gi = Array.from, Or = Object.keys, tr = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, Eo = Object.getOwnPropertyDescriptors, Ao = Object.prototype, So = Array.prototype, Qi = Object.getPrototypeOf, Fi = Object.isExtensible;
|
|
10
|
+
const Me = () => {
|
|
11
|
+
};
|
|
12
|
+
function Mo(t) {
|
|
13
|
+
for (var e = 0; e < t.length; e++)
|
|
14
|
+
t[e]();
|
|
15
|
+
}
|
|
16
|
+
function Gi() {
|
|
17
|
+
var t, e, r = new Promise((i, n) => {
|
|
18
|
+
t = i, e = n;
|
|
19
|
+
});
|
|
20
|
+
return { promise: r, resolve: t, reject: e };
|
|
21
|
+
}
|
|
22
|
+
const xt = 2, wi = 4, bi = 8, Ne = 16, le = 32, me = 64, _i = 128, Pt = 256, Nr = 512, bt = 1024, Lt = 2048, ge = 4096, Ut = 8192, Fe = 16384, yi = 32768, or = 65536, Pi = 1 << 17, Ki = 1 << 18, Pe = 1 << 19, $o = 1 << 20, Jr = 1 << 21, xi = 1 << 22, $e = 1 << 23, Zr = Symbol("$state"), Lo = Symbol("legacy props"), Io = Symbol(""), Ve = new class extends Error {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
lt(this, "name", "StaleReactionError");
|
|
26
|
+
lt(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
27
|
+
}
|
|
28
|
+
}(), Ci = 3, we = 8;
|
|
29
|
+
function Ro() {
|
|
30
|
+
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
31
|
+
}
|
|
32
|
+
function Do(t) {
|
|
33
|
+
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
34
|
+
}
|
|
35
|
+
function Oo() {
|
|
36
|
+
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
37
|
+
}
|
|
38
|
+
function No(t) {
|
|
39
|
+
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
40
|
+
}
|
|
41
|
+
function Fo() {
|
|
42
|
+
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
43
|
+
}
|
|
44
|
+
function Po() {
|
|
45
|
+
throw new Error("https://svelte.dev/e/hydration_failed");
|
|
46
|
+
}
|
|
47
|
+
function qo() {
|
|
48
|
+
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
49
|
+
}
|
|
50
|
+
function Ho() {
|
|
51
|
+
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
52
|
+
}
|
|
53
|
+
function zo() {
|
|
54
|
+
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
55
|
+
}
|
|
56
|
+
function jo() {
|
|
57
|
+
throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
|
|
58
|
+
}
|
|
59
|
+
function xr(t) {
|
|
60
|
+
console.warn("https://svelte.dev/e/hydration_mismatch");
|
|
61
|
+
}
|
|
62
|
+
function Bo() {
|
|
63
|
+
console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
|
|
64
|
+
}
|
|
65
|
+
let D = !1;
|
|
66
|
+
function $t(t) {
|
|
67
|
+
D = t;
|
|
68
|
+
}
|
|
69
|
+
let j;
|
|
70
|
+
function at(t) {
|
|
71
|
+
if (t === null)
|
|
72
|
+
throw xr(), Ie;
|
|
73
|
+
return j = t;
|
|
74
|
+
}
|
|
75
|
+
function Re() {
|
|
76
|
+
return at(
|
|
77
|
+
/** @type {TemplateNode} */
|
|
78
|
+
/* @__PURE__ */ It(j)
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
function O(t) {
|
|
82
|
+
if (D) {
|
|
83
|
+
if (/* @__PURE__ */ It(j) !== null)
|
|
84
|
+
throw xr(), Ie;
|
|
85
|
+
j = t;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function ki(t = 1) {
|
|
89
|
+
if (D) {
|
|
90
|
+
for (var e = t, r = j; e--; )
|
|
91
|
+
r = /** @type {TemplateNode} */
|
|
92
|
+
/* @__PURE__ */ It(r);
|
|
93
|
+
j = r;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function Fr(t = !0) {
|
|
97
|
+
for (var e = 0, r = j; ; ) {
|
|
98
|
+
if (r.nodeType === we) {
|
|
99
|
+
var i = (
|
|
100
|
+
/** @type {Comment} */
|
|
101
|
+
r.data
|
|
102
|
+
);
|
|
103
|
+
if (i === "]") {
|
|
104
|
+
if (e === 0) return r;
|
|
105
|
+
e -= 1;
|
|
106
|
+
} else (i === "[" || i === "[!") && (e += 1);
|
|
107
|
+
}
|
|
108
|
+
var n = (
|
|
109
|
+
/** @type {TemplateNode} */
|
|
110
|
+
/* @__PURE__ */ It(r)
|
|
111
|
+
);
|
|
112
|
+
t && r.remove(), r = n;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function Xi(t) {
|
|
116
|
+
if (!t || t.nodeType !== we)
|
|
117
|
+
throw xr(), Ie;
|
|
118
|
+
return (
|
|
119
|
+
/** @type {Comment} */
|
|
120
|
+
t.data
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
function Ji(t) {
|
|
124
|
+
return t === this.v;
|
|
125
|
+
}
|
|
126
|
+
function tn(t, e) {
|
|
127
|
+
return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function";
|
|
128
|
+
}
|
|
129
|
+
function en(t) {
|
|
130
|
+
return !tn(t, this.v);
|
|
131
|
+
}
|
|
132
|
+
let Vo = !1, Ht = null;
|
|
133
|
+
function er(t) {
|
|
134
|
+
Ht = t;
|
|
135
|
+
}
|
|
136
|
+
function ht(t, e = !1, r) {
|
|
137
|
+
Ht = {
|
|
138
|
+
p: Ht,
|
|
139
|
+
c: null,
|
|
140
|
+
e: null,
|
|
141
|
+
s: t,
|
|
142
|
+
x: null,
|
|
143
|
+
l: null
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function vt(t) {
|
|
147
|
+
var e = (
|
|
148
|
+
/** @type {ComponentContext} */
|
|
149
|
+
Ht
|
|
150
|
+
), r = e.e;
|
|
151
|
+
if (r !== null) {
|
|
152
|
+
e.e = null;
|
|
153
|
+
for (var i of r)
|
|
154
|
+
xn(i);
|
|
155
|
+
}
|
|
156
|
+
return t !== void 0 && (e.x = t), Ht = e.p, t ?? /** @type {T} */
|
|
157
|
+
{};
|
|
158
|
+
}
|
|
159
|
+
function rn() {
|
|
160
|
+
return !0;
|
|
161
|
+
}
|
|
162
|
+
let xe = [];
|
|
163
|
+
function nn() {
|
|
164
|
+
var t = xe;
|
|
165
|
+
xe = [], Mo(t);
|
|
166
|
+
}
|
|
167
|
+
function rr(t) {
|
|
168
|
+
if (xe.length === 0 && !pr) {
|
|
169
|
+
var e = xe;
|
|
170
|
+
queueMicrotask(() => {
|
|
171
|
+
e === xe && nn();
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
xe.push(t);
|
|
175
|
+
}
|
|
176
|
+
function Uo() {
|
|
177
|
+
for (; xe.length > 0; )
|
|
178
|
+
nn();
|
|
179
|
+
}
|
|
180
|
+
const Yo = /* @__PURE__ */ new WeakMap();
|
|
181
|
+
function on(t) {
|
|
182
|
+
var e = F;
|
|
183
|
+
if (e === null)
|
|
184
|
+
return N.f |= $e, t;
|
|
185
|
+
if ((e.f & yi) === 0) {
|
|
186
|
+
if ((e.f & _i) === 0)
|
|
187
|
+
throw !e.parent && t instanceof Error && an(t), t;
|
|
188
|
+
e.b.error(t);
|
|
189
|
+
} else
|
|
190
|
+
ir(t, e);
|
|
191
|
+
}
|
|
192
|
+
function ir(t, e) {
|
|
193
|
+
for (; e !== null; ) {
|
|
194
|
+
if ((e.f & _i) !== 0)
|
|
195
|
+
try {
|
|
196
|
+
e.b.error(t);
|
|
197
|
+
return;
|
|
198
|
+
} catch (r) {
|
|
199
|
+
t = r;
|
|
200
|
+
}
|
|
201
|
+
e = e.parent;
|
|
202
|
+
}
|
|
203
|
+
throw t instanceof Error && an(t), t;
|
|
204
|
+
}
|
|
205
|
+
function an(t) {
|
|
206
|
+
const e = Yo.get(t);
|
|
207
|
+
e && (tr(t, "message", {
|
|
208
|
+
value: e.message
|
|
209
|
+
}), tr(t, "stack", {
|
|
210
|
+
value: e.stack
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
const Sr = /* @__PURE__ */ new Set();
|
|
214
|
+
let it = null, Bt = null, ti = /* @__PURE__ */ new Set(), Jt = [], Br = null, ei = !1, pr = !1;
|
|
215
|
+
var Ge, Ke, ke, mr, Xe, Te, Je, gr, wr, qt, ri, Lr, ii;
|
|
216
|
+
const Hr = class Hr {
|
|
217
|
+
constructor() {
|
|
218
|
+
B(this, qt);
|
|
219
|
+
/**
|
|
220
|
+
* The current values of any sources that are updated in this batch
|
|
221
|
+
* They keys of this map are identical to `this.#previous`
|
|
222
|
+
* @type {Map<Source, any>}
|
|
223
|
+
*/
|
|
224
|
+
lt(this, "current", /* @__PURE__ */ new Map());
|
|
225
|
+
/**
|
|
226
|
+
* The values of any sources that are updated in this batch _before_ those updates took place.
|
|
227
|
+
* They keys of this map are identical to `this.#current`
|
|
228
|
+
* @type {Map<Source, any>}
|
|
229
|
+
*/
|
|
230
|
+
B(this, Ge, /* @__PURE__ */ new Map());
|
|
231
|
+
/**
|
|
232
|
+
* When the batch is committed (and the DOM is updated), we need to remove old branches
|
|
233
|
+
* and append new ones by calling the functions added inside (if/each/key/etc) blocks
|
|
234
|
+
* @type {Set<() => void>}
|
|
235
|
+
*/
|
|
236
|
+
B(this, Ke, /* @__PURE__ */ new Set());
|
|
237
|
+
/**
|
|
238
|
+
* The number of async effects that are currently in flight
|
|
239
|
+
*/
|
|
240
|
+
B(this, ke, 0);
|
|
241
|
+
/**
|
|
242
|
+
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
243
|
+
* TODO replace with Promise.withResolvers once supported widely enough
|
|
244
|
+
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
245
|
+
*/
|
|
246
|
+
B(this, mr, null);
|
|
247
|
+
/**
|
|
248
|
+
* Template effects and `$effect.pre` effects, which run when
|
|
249
|
+
* a batch is committed
|
|
250
|
+
* @type {Effect[]}
|
|
251
|
+
*/
|
|
252
|
+
B(this, Xe, []);
|
|
253
|
+
/**
|
|
254
|
+
* The same as `#render_effects`, but for `$effect` (which runs after)
|
|
255
|
+
* @type {Effect[]}
|
|
256
|
+
*/
|
|
257
|
+
B(this, Te, []);
|
|
258
|
+
/**
|
|
259
|
+
* Block effects, which may need to re-run on subsequent flushes
|
|
260
|
+
* in order to update internal sources (e.g. each block items)
|
|
261
|
+
* @type {Effect[]}
|
|
262
|
+
*/
|
|
263
|
+
B(this, Je, []);
|
|
264
|
+
/**
|
|
265
|
+
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
266
|
+
* @type {Effect[]}
|
|
267
|
+
*/
|
|
268
|
+
B(this, gr, []);
|
|
269
|
+
/**
|
|
270
|
+
* Deferred effects that are MAYBE_DIRTY
|
|
271
|
+
* @type {Effect[]}
|
|
272
|
+
*/
|
|
273
|
+
B(this, wr, []);
|
|
274
|
+
/**
|
|
275
|
+
* A set of branches that still exist, but will be destroyed when this batch
|
|
276
|
+
* is committed — we skip over these during `process`
|
|
277
|
+
* @type {Set<Effect>}
|
|
278
|
+
*/
|
|
279
|
+
lt(this, "skipped_effects", /* @__PURE__ */ new Set());
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
*
|
|
283
|
+
* @param {Effect[]} root_effects
|
|
284
|
+
*/
|
|
285
|
+
process(e) {
|
|
286
|
+
Jt = [], this.apply();
|
|
287
|
+
for (const o of e)
|
|
288
|
+
ot(this, qt, ri).call(this, o);
|
|
289
|
+
if (v(this, ke) === 0) {
|
|
290
|
+
var r = Bt;
|
|
291
|
+
ot(this, qt, ii).call(this);
|
|
292
|
+
var i = v(this, Xe), n = v(this, Te);
|
|
293
|
+
L(this, Xe, []), L(this, Te, []), L(this, Je, []), it = null, Bt = r, qi(i), qi(n), v(this, mr)?.resolve();
|
|
294
|
+
} else
|
|
295
|
+
ot(this, qt, Lr).call(this, v(this, Xe)), ot(this, qt, Lr).call(this, v(this, Te)), ot(this, qt, Lr).call(this, v(this, Je));
|
|
296
|
+
Bt = null;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Associate a change to a given source with the current
|
|
300
|
+
* batch, noting its previous and current values
|
|
301
|
+
* @param {Source} source
|
|
302
|
+
* @param {any} value
|
|
303
|
+
*/
|
|
304
|
+
capture(e, r) {
|
|
305
|
+
v(this, Ge).has(e) || v(this, Ge).set(e, r), this.current.set(e, e.v), Bt?.set(e, e.v);
|
|
306
|
+
}
|
|
307
|
+
activate() {
|
|
308
|
+
it = this;
|
|
309
|
+
}
|
|
310
|
+
deactivate() {
|
|
311
|
+
it = null, Bt = null;
|
|
312
|
+
}
|
|
313
|
+
flush() {
|
|
314
|
+
if (Jt.length > 0) {
|
|
315
|
+
if (this.activate(), sn(), it !== null && it !== this)
|
|
316
|
+
return;
|
|
317
|
+
} else v(this, ke) === 0 && ot(this, qt, ii).call(this);
|
|
318
|
+
this.deactivate();
|
|
319
|
+
for (const e of ti)
|
|
320
|
+
if (ti.delete(e), e(), it !== null)
|
|
321
|
+
break;
|
|
322
|
+
}
|
|
323
|
+
increment() {
|
|
324
|
+
L(this, ke, v(this, ke) + 1);
|
|
325
|
+
}
|
|
326
|
+
decrement() {
|
|
327
|
+
L(this, ke, v(this, ke) - 1);
|
|
328
|
+
for (const e of v(this, gr))
|
|
329
|
+
yt(e, Lt), De(e);
|
|
330
|
+
for (const e of v(this, wr))
|
|
331
|
+
yt(e, ge), De(e);
|
|
332
|
+
this.flush();
|
|
333
|
+
}
|
|
334
|
+
/** @param {() => void} fn */
|
|
335
|
+
add_callback(e) {
|
|
336
|
+
v(this, Ke).add(e);
|
|
337
|
+
}
|
|
338
|
+
settled() {
|
|
339
|
+
return (v(this, mr) ?? L(this, mr, Gi())).promise;
|
|
340
|
+
}
|
|
341
|
+
static ensure() {
|
|
342
|
+
if (it === null) {
|
|
343
|
+
const e = it = new Hr();
|
|
344
|
+
Sr.add(it), pr || Hr.enqueue(() => {
|
|
345
|
+
it === e && e.flush();
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
return it;
|
|
349
|
+
}
|
|
350
|
+
/** @param {() => void} task */
|
|
351
|
+
static enqueue(e) {
|
|
352
|
+
rr(e);
|
|
353
|
+
}
|
|
354
|
+
apply() {
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
Ge = new WeakMap(), Ke = new WeakMap(), ke = new WeakMap(), mr = new WeakMap(), Xe = new WeakMap(), Te = new WeakMap(), Je = new WeakMap(), gr = new WeakMap(), wr = new WeakMap(), qt = new WeakSet(), /**
|
|
358
|
+
* Traverse the effect tree, executing effects or stashing
|
|
359
|
+
* them for later execution as appropriate
|
|
360
|
+
* @param {Effect} root
|
|
361
|
+
*/
|
|
362
|
+
ri = function(e) {
|
|
363
|
+
e.f ^= bt;
|
|
364
|
+
for (var r = e.first; r !== null; ) {
|
|
365
|
+
var i = r.f, n = (i & (le | me)) !== 0, o = n && (i & bt) !== 0, a = o || (i & Ut) !== 0 || this.skipped_effects.has(r);
|
|
366
|
+
if (!a && r.fn !== null) {
|
|
367
|
+
n ? r.f ^= bt : (i & wi) !== 0 ? v(this, Te).push(r) : Ur(r) && ((r.f & Ne) !== 0 && v(this, Je).push(r), qr(r));
|
|
368
|
+
var c = r.first;
|
|
369
|
+
if (c !== null) {
|
|
370
|
+
r = c;
|
|
371
|
+
continue;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
var l = r.parent;
|
|
375
|
+
for (r = r.next; r === null && l !== null; )
|
|
376
|
+
r = l.next, l = l.parent;
|
|
377
|
+
}
|
|
378
|
+
}, /**
|
|
379
|
+
* @param {Effect[]} effects
|
|
380
|
+
*/
|
|
381
|
+
Lr = function(e) {
|
|
382
|
+
for (const r of e)
|
|
383
|
+
((r.f & Lt) !== 0 ? v(this, gr) : v(this, wr)).push(r), yt(r, bt);
|
|
384
|
+
e.length = 0;
|
|
385
|
+
}, /**
|
|
386
|
+
* Append and remove branches to/from the DOM
|
|
387
|
+
*/
|
|
388
|
+
ii = function() {
|
|
389
|
+
var e;
|
|
390
|
+
for (const r of v(this, Ke))
|
|
391
|
+
r();
|
|
392
|
+
if (v(this, Ke).clear(), Sr.size > 1) {
|
|
393
|
+
v(this, Ge).clear();
|
|
394
|
+
let r = !0;
|
|
395
|
+
for (const i of Sr) {
|
|
396
|
+
if (i === this) {
|
|
397
|
+
r = !1;
|
|
398
|
+
continue;
|
|
399
|
+
}
|
|
400
|
+
const n = [];
|
|
401
|
+
for (const [a, c] of this.current) {
|
|
402
|
+
if (i.current.has(a))
|
|
403
|
+
if (r && c !== i.current.get(a))
|
|
404
|
+
i.current.set(a, c);
|
|
405
|
+
else
|
|
406
|
+
continue;
|
|
407
|
+
n.push(a);
|
|
408
|
+
}
|
|
409
|
+
if (n.length === 0)
|
|
410
|
+
continue;
|
|
411
|
+
const o = [...i.current.keys()].filter((a) => !this.current.has(a));
|
|
412
|
+
if (o.length > 0) {
|
|
413
|
+
for (const a of n)
|
|
414
|
+
ln(a, o);
|
|
415
|
+
if (Jt.length > 0) {
|
|
416
|
+
it = i, i.apply();
|
|
417
|
+
for (const a of Jt)
|
|
418
|
+
ot(e = i, qt, ri).call(e, a);
|
|
419
|
+
Jt = [], i.deactivate();
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
it = null;
|
|
424
|
+
}
|
|
425
|
+
Sr.delete(this);
|
|
426
|
+
};
|
|
427
|
+
let te = Hr;
|
|
428
|
+
function T(t) {
|
|
429
|
+
var e = pr;
|
|
430
|
+
pr = !0;
|
|
431
|
+
try {
|
|
432
|
+
for (var r; ; ) {
|
|
433
|
+
if (Uo(), Jt.length === 0 && (it?.flush(), Jt.length === 0))
|
|
434
|
+
return Br = null, /** @type {T} */
|
|
435
|
+
r;
|
|
436
|
+
sn();
|
|
437
|
+
}
|
|
438
|
+
} finally {
|
|
439
|
+
pr = e;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
function sn() {
|
|
443
|
+
var t = We;
|
|
444
|
+
ei = !0;
|
|
445
|
+
try {
|
|
446
|
+
var e = 0;
|
|
447
|
+
for (zi(!0); Jt.length > 0; ) {
|
|
448
|
+
var r = te.ensure();
|
|
449
|
+
if (e++ > 1e3) {
|
|
450
|
+
var i, n;
|
|
451
|
+
Zo();
|
|
452
|
+
}
|
|
453
|
+
r.process(Jt), he.clear();
|
|
454
|
+
}
|
|
455
|
+
} finally {
|
|
456
|
+
ei = !1, zi(t), Br = null;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
function Zo() {
|
|
460
|
+
try {
|
|
461
|
+
Fo();
|
|
462
|
+
} catch (t) {
|
|
463
|
+
ir(t, Br);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
let ye = null;
|
|
467
|
+
function qi(t) {
|
|
468
|
+
var e = t.length;
|
|
469
|
+
if (e !== 0) {
|
|
470
|
+
for (var r = 0; r < e; ) {
|
|
471
|
+
var i = t[r++];
|
|
472
|
+
if ((i.f & (Fe | Ut)) === 0 && Ur(i) && (ye = [], qr(i), i.deps === null && i.first === null && i.nodes_start === null && (i.teardown === null && i.ac === null ? An(i) : i.fn = null), ye?.length > 0)) {
|
|
473
|
+
he.clear();
|
|
474
|
+
for (const n of ye)
|
|
475
|
+
qr(n);
|
|
476
|
+
ye = [];
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
ye = null;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
function ln(t, e) {
|
|
483
|
+
if (t.reactions !== null)
|
|
484
|
+
for (const r of t.reactions) {
|
|
485
|
+
const i = r.f;
|
|
486
|
+
(i & xt) !== 0 ? ln(
|
|
487
|
+
/** @type {Derived} */
|
|
488
|
+
r,
|
|
489
|
+
e
|
|
490
|
+
) : (i & (xi | Ne)) !== 0 && cn(r, e) && (yt(r, Lt), De(
|
|
491
|
+
/** @type {Effect} */
|
|
492
|
+
r
|
|
493
|
+
));
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
function cn(t, e) {
|
|
497
|
+
if (t.deps !== null) {
|
|
498
|
+
for (const r of t.deps)
|
|
499
|
+
if (e.includes(r) || (r.f & xt) !== 0 && cn(
|
|
500
|
+
/** @type {Derived} */
|
|
501
|
+
r,
|
|
502
|
+
e
|
|
503
|
+
))
|
|
504
|
+
return !0;
|
|
505
|
+
}
|
|
506
|
+
return !1;
|
|
507
|
+
}
|
|
508
|
+
function De(t) {
|
|
509
|
+
for (var e = Br = t; e.parent !== null; ) {
|
|
510
|
+
e = e.parent;
|
|
511
|
+
var r = e.f;
|
|
512
|
+
if (ei && e === F && (r & Ne) !== 0)
|
|
513
|
+
return;
|
|
514
|
+
if ((r & (me | le)) !== 0) {
|
|
515
|
+
if ((r & bt) === 0) return;
|
|
516
|
+
e.f ^= bt;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
Jt.push(e);
|
|
520
|
+
}
|
|
521
|
+
function Wo(t) {
|
|
522
|
+
let e = 0, r = Oe(0), i;
|
|
523
|
+
return () => {
|
|
524
|
+
oa() && (u(r), Cn(() => (e === 0 && (i = Fn(() => t(() => hr(r)))), e += 1, () => {
|
|
525
|
+
rr(() => {
|
|
526
|
+
e -= 1, e === 0 && (i?.(), i = void 0, hr(r));
|
|
527
|
+
});
|
|
528
|
+
})));
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
var Qo = or | Pe | _i;
|
|
532
|
+
function Go(t, e, r) {
|
|
533
|
+
new Ko(t, e, r);
|
|
534
|
+
}
|
|
535
|
+
var zt, Mt, br, Qt, Ee, Gt, Ot, kt, Kt, ce, Ae, ue, Se, de, zr, jr, dt, un, dn, Ir, Rr, ni;
|
|
536
|
+
class Ko {
|
|
537
|
+
/**
|
|
538
|
+
* @param {TemplateNode} node
|
|
539
|
+
* @param {BoundaryProps} props
|
|
540
|
+
* @param {((anchor: Node) => void)} children
|
|
541
|
+
*/
|
|
542
|
+
constructor(e, r, i) {
|
|
543
|
+
B(this, dt);
|
|
544
|
+
/** @type {Boundary | null} */
|
|
545
|
+
lt(this, "parent");
|
|
546
|
+
B(this, zt, !1);
|
|
547
|
+
/** @type {TemplateNode} */
|
|
548
|
+
B(this, Mt);
|
|
549
|
+
/** @type {TemplateNode | null} */
|
|
550
|
+
B(this, br, D ? j : null);
|
|
551
|
+
/** @type {BoundaryProps} */
|
|
552
|
+
B(this, Qt);
|
|
553
|
+
/** @type {((anchor: Node) => void)} */
|
|
554
|
+
B(this, Ee);
|
|
555
|
+
/** @type {Effect} */
|
|
556
|
+
B(this, Gt);
|
|
557
|
+
/** @type {Effect | null} */
|
|
558
|
+
B(this, Ot, null);
|
|
559
|
+
/** @type {Effect | null} */
|
|
560
|
+
B(this, kt, null);
|
|
561
|
+
/** @type {Effect | null} */
|
|
562
|
+
B(this, Kt, null);
|
|
563
|
+
/** @type {DocumentFragment | null} */
|
|
564
|
+
B(this, ce, null);
|
|
565
|
+
B(this, Ae, 0);
|
|
566
|
+
B(this, ue, 0);
|
|
567
|
+
B(this, Se, !1);
|
|
568
|
+
/**
|
|
569
|
+
* A source containing the number of pending async deriveds/expressions.
|
|
570
|
+
* Only created if `$effect.pending()` is used inside the boundary,
|
|
571
|
+
* otherwise updating the source results in needless `Batch.ensure()`
|
|
572
|
+
* calls followed by no-op flushes
|
|
573
|
+
* @type {Source<number> | null}
|
|
574
|
+
*/
|
|
575
|
+
B(this, de, null);
|
|
576
|
+
B(this, zr, () => {
|
|
577
|
+
v(this, de) && nr(v(this, de), v(this, Ae));
|
|
578
|
+
});
|
|
579
|
+
B(this, jr, Wo(() => (L(this, de, Oe(v(this, Ae))), () => {
|
|
580
|
+
L(this, de, null);
|
|
581
|
+
})));
|
|
582
|
+
L(this, Mt, e), L(this, Qt, r), L(this, Ee, i), this.parent = /** @type {Effect} */
|
|
583
|
+
F.b, L(this, zt, !!v(this, Qt).pending), L(this, Gt, ar(() => {
|
|
584
|
+
if (F.b = this, D) {
|
|
585
|
+
const n = v(this, br);
|
|
586
|
+
Re(), /** @type {Comment} */
|
|
587
|
+
n.nodeType === we && /** @type {Comment} */
|
|
588
|
+
n.data === "[!" ? ot(this, dt, dn).call(this) : ot(this, dt, un).call(this);
|
|
589
|
+
} else {
|
|
590
|
+
try {
|
|
591
|
+
L(this, Ot, Ft(() => i(v(this, Mt))));
|
|
592
|
+
} catch (n) {
|
|
593
|
+
this.error(n);
|
|
594
|
+
}
|
|
595
|
+
v(this, ue) > 0 ? ot(this, dt, Rr).call(this) : L(this, zt, !1);
|
|
596
|
+
}
|
|
597
|
+
}, Qo)), D && L(this, Mt, j);
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Returns `true` if the effect exists inside a boundary whose pending snippet is shown
|
|
601
|
+
* @returns {boolean}
|
|
602
|
+
*/
|
|
603
|
+
is_pending() {
|
|
604
|
+
return v(this, zt) || !!this.parent && this.parent.is_pending();
|
|
605
|
+
}
|
|
606
|
+
has_pending_snippet() {
|
|
607
|
+
return !!v(this, Qt).pending;
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
611
|
+
* and controls when the current `pending` snippet (if any) is removed.
|
|
612
|
+
* Do not call from inside the class
|
|
613
|
+
* @param {1 | -1} d
|
|
614
|
+
*/
|
|
615
|
+
update_pending_count(e) {
|
|
616
|
+
ot(this, dt, ni).call(this, e), L(this, Ae, v(this, Ae) + e), ti.add(v(this, zr));
|
|
617
|
+
}
|
|
618
|
+
get_effect_pending() {
|
|
619
|
+
return v(this, jr).call(this), u(
|
|
620
|
+
/** @type {Source<number>} */
|
|
621
|
+
v(this, de)
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
/** @param {unknown} error */
|
|
625
|
+
error(e) {
|
|
626
|
+
var r = v(this, Qt).onerror;
|
|
627
|
+
let i = v(this, Qt).failed;
|
|
628
|
+
if (v(this, Se) || !r && !i)
|
|
629
|
+
throw e;
|
|
630
|
+
v(this, Ot) && (_t(v(this, Ot)), L(this, Ot, null)), v(this, kt) && (_t(v(this, kt)), L(this, kt, null)), v(this, Kt) && (_t(v(this, Kt)), L(this, Kt, null)), D && (at(
|
|
631
|
+
/** @type {TemplateNode} */
|
|
632
|
+
v(this, br)
|
|
633
|
+
), ki(), at(Fr()));
|
|
634
|
+
var n = !1, o = !1;
|
|
635
|
+
const a = () => {
|
|
636
|
+
if (n) {
|
|
637
|
+
Bo();
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
n = !0, o && jo(), te.ensure(), L(this, Ae, 0), v(this, Kt) !== null && Ze(v(this, Kt), () => {
|
|
641
|
+
L(this, Kt, null);
|
|
642
|
+
}), L(this, zt, this.has_pending_snippet()), L(this, Ot, ot(this, dt, Ir).call(this, () => (L(this, Se, !1), Ft(() => v(this, Ee).call(this, v(this, Mt)))))), v(this, ue) > 0 ? ot(this, dt, Rr).call(this) : L(this, zt, !1);
|
|
643
|
+
};
|
|
644
|
+
var c = N;
|
|
645
|
+
try {
|
|
646
|
+
Et(null), o = !0, r?.(e, a), o = !1;
|
|
647
|
+
} catch (l) {
|
|
648
|
+
ir(l, v(this, Gt) && v(this, Gt).parent);
|
|
649
|
+
} finally {
|
|
650
|
+
Et(c);
|
|
651
|
+
}
|
|
652
|
+
i && rr(() => {
|
|
653
|
+
L(this, Kt, ot(this, dt, Ir).call(this, () => {
|
|
654
|
+
L(this, Se, !0);
|
|
655
|
+
try {
|
|
656
|
+
return Ft(() => {
|
|
657
|
+
i(
|
|
658
|
+
v(this, Mt),
|
|
659
|
+
() => e,
|
|
660
|
+
() => a
|
|
661
|
+
);
|
|
662
|
+
});
|
|
663
|
+
} catch (l) {
|
|
664
|
+
return ir(
|
|
665
|
+
l,
|
|
666
|
+
/** @type {Effect} */
|
|
667
|
+
v(this, Gt).parent
|
|
668
|
+
), null;
|
|
669
|
+
} finally {
|
|
670
|
+
L(this, Se, !1);
|
|
671
|
+
}
|
|
672
|
+
}));
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
zt = new WeakMap(), Mt = new WeakMap(), br = new WeakMap(), Qt = new WeakMap(), Ee = new WeakMap(), Gt = new WeakMap(), Ot = new WeakMap(), kt = new WeakMap(), Kt = new WeakMap(), ce = new WeakMap(), Ae = new WeakMap(), ue = new WeakMap(), Se = new WeakMap(), de = new WeakMap(), zr = new WeakMap(), jr = new WeakMap(), dt = new WeakSet(), un = function() {
|
|
677
|
+
try {
|
|
678
|
+
L(this, Ot, Ft(() => v(this, Ee).call(this, v(this, Mt))));
|
|
679
|
+
} catch (e) {
|
|
680
|
+
this.error(e);
|
|
681
|
+
}
|
|
682
|
+
L(this, zt, !1);
|
|
683
|
+
}, dn = function() {
|
|
684
|
+
const e = v(this, Qt).pending;
|
|
685
|
+
e && (L(this, kt, Ft(() => e(v(this, Mt)))), te.enqueue(() => {
|
|
686
|
+
L(this, Ot, ot(this, dt, Ir).call(this, () => (te.ensure(), Ft(() => v(this, Ee).call(this, v(this, Mt)))))), v(this, ue) > 0 ? ot(this, dt, Rr).call(this) : (Ze(
|
|
687
|
+
/** @type {Effect} */
|
|
688
|
+
v(this, kt),
|
|
689
|
+
() => {
|
|
690
|
+
L(this, kt, null);
|
|
691
|
+
}
|
|
692
|
+
), L(this, zt, !1));
|
|
693
|
+
}));
|
|
694
|
+
}, /**
|
|
695
|
+
* @param {() => Effect | null} fn
|
|
696
|
+
*/
|
|
697
|
+
Ir = function(e) {
|
|
698
|
+
var r = F, i = N, n = Ht;
|
|
699
|
+
re(v(this, Gt)), Et(v(this, Gt)), er(v(this, Gt).ctx);
|
|
700
|
+
try {
|
|
701
|
+
return e();
|
|
702
|
+
} catch (o) {
|
|
703
|
+
return on(o), null;
|
|
704
|
+
} finally {
|
|
705
|
+
re(r), Et(i), er(n);
|
|
706
|
+
}
|
|
707
|
+
}, Rr = function() {
|
|
708
|
+
const e = (
|
|
709
|
+
/** @type {(anchor: Node) => void} */
|
|
710
|
+
v(this, Qt).pending
|
|
711
|
+
);
|
|
712
|
+
v(this, Ot) !== null && (L(this, ce, document.createDocumentFragment()), $n(v(this, Ot), v(this, ce))), v(this, kt) === null && L(this, kt, Ft(() => e(v(this, Mt))));
|
|
713
|
+
}, /**
|
|
714
|
+
* Updates the pending count associated with the currently visible pending snippet,
|
|
715
|
+
* if any, such that we can replace the snippet with content once work is done
|
|
716
|
+
* @param {1 | -1} d
|
|
717
|
+
*/
|
|
718
|
+
ni = function(e) {
|
|
719
|
+
var r;
|
|
720
|
+
if (!this.has_pending_snippet()) {
|
|
721
|
+
this.parent && ot(r = this.parent, dt, ni).call(r, e);
|
|
722
|
+
return;
|
|
723
|
+
}
|
|
724
|
+
L(this, ue, v(this, ue) + e), v(this, ue) === 0 && (L(this, zt, !1), v(this, kt) && Ze(v(this, kt), () => {
|
|
725
|
+
L(this, kt, null);
|
|
726
|
+
}), v(this, ce) && (v(this, Mt).before(v(this, ce)), L(this, ce, null)), rr(() => {
|
|
727
|
+
te.ensure().flush();
|
|
728
|
+
}));
|
|
729
|
+
};
|
|
730
|
+
function Xo(t, e, r) {
|
|
731
|
+
const i = Vr;
|
|
732
|
+
if (e.length === 0) {
|
|
733
|
+
r(t.map(i));
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
var n = it, o = (
|
|
737
|
+
/** @type {Effect} */
|
|
738
|
+
F
|
|
739
|
+
), a = Jo(), c = D;
|
|
740
|
+
Promise.all(e.map((l) => /* @__PURE__ */ ta(l))).then((l) => {
|
|
741
|
+
a();
|
|
742
|
+
try {
|
|
743
|
+
r([...t.map(i), ...l]);
|
|
744
|
+
} catch (s) {
|
|
745
|
+
(o.f & Fe) === 0 && ir(s, o);
|
|
746
|
+
}
|
|
747
|
+
c && $t(!1), n?.deactivate(), oi();
|
|
748
|
+
}).catch((l) => {
|
|
749
|
+
ir(l, o);
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
function Jo() {
|
|
753
|
+
var t = F, e = N, r = Ht, i = it, n = D;
|
|
754
|
+
if (n)
|
|
755
|
+
var o = j;
|
|
756
|
+
return function() {
|
|
757
|
+
re(t), Et(e), er(r), i?.activate(), n && ($t(!0), at(o));
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
function oi() {
|
|
761
|
+
re(null), Et(null), er(null);
|
|
762
|
+
}
|
|
763
|
+
// @__NO_SIDE_EFFECTS__
|
|
764
|
+
function Vr(t) {
|
|
765
|
+
var e = xt | Lt, r = N !== null && (N.f & xt) !== 0 ? (
|
|
766
|
+
/** @type {Derived} */
|
|
767
|
+
N
|
|
768
|
+
) : null;
|
|
769
|
+
return F === null || r !== null && (r.f & Pt) !== 0 ? e |= Pt : F.f |= Pe, {
|
|
770
|
+
ctx: Ht,
|
|
771
|
+
deps: null,
|
|
772
|
+
effects: null,
|
|
773
|
+
equals: Ji,
|
|
774
|
+
f: e,
|
|
775
|
+
fn: t,
|
|
776
|
+
reactions: null,
|
|
777
|
+
rv: 0,
|
|
778
|
+
v: (
|
|
779
|
+
/** @type {V} */
|
|
780
|
+
ft
|
|
781
|
+
),
|
|
782
|
+
wv: 0,
|
|
783
|
+
parent: r ?? F,
|
|
784
|
+
ac: null
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
// @__NO_SIDE_EFFECTS__
|
|
788
|
+
function ta(t, e) {
|
|
789
|
+
let r = (
|
|
790
|
+
/** @type {Effect | null} */
|
|
791
|
+
F
|
|
792
|
+
);
|
|
793
|
+
r === null && Ro();
|
|
794
|
+
var i = (
|
|
795
|
+
/** @type {Boundary} */
|
|
796
|
+
r.b
|
|
797
|
+
), n = (
|
|
798
|
+
/** @type {Promise<V>} */
|
|
799
|
+
/** @type {unknown} */
|
|
800
|
+
void 0
|
|
801
|
+
), o = Oe(
|
|
802
|
+
/** @type {V} */
|
|
803
|
+
ft
|
|
804
|
+
), a = !N, c = /* @__PURE__ */ new Map();
|
|
805
|
+
return ua(() => {
|
|
806
|
+
var l = Gi();
|
|
807
|
+
n = l.promise;
|
|
808
|
+
try {
|
|
809
|
+
Promise.resolve(t()).then(l.resolve, l.reject).then(oi);
|
|
810
|
+
} catch (p) {
|
|
811
|
+
l.reject(p), oi();
|
|
812
|
+
}
|
|
813
|
+
var s = (
|
|
814
|
+
/** @type {Batch} */
|
|
815
|
+
it
|
|
816
|
+
), d = i.is_pending();
|
|
817
|
+
a && (i.update_pending_count(1), d || (s.increment(), c.get(s)?.reject(Ve), c.delete(s), c.set(s, l)));
|
|
818
|
+
const f = (p, m = void 0) => {
|
|
819
|
+
if (d || s.activate(), m)
|
|
820
|
+
m !== Ve && (o.f |= $e, nr(o, m));
|
|
821
|
+
else {
|
|
822
|
+
(o.f & $e) !== 0 && (o.f ^= $e), nr(o, p);
|
|
823
|
+
for (const [h, w] of c) {
|
|
824
|
+
if (c.delete(h), h === s) break;
|
|
825
|
+
w.reject(Ve);
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
a && (i.update_pending_count(-1), d || s.decrement());
|
|
829
|
+
};
|
|
830
|
+
l.promise.then(f, (p) => f(null, p || "unknown"));
|
|
831
|
+
}), yn(() => {
|
|
832
|
+
for (const l of c.values())
|
|
833
|
+
l.reject(Ve);
|
|
834
|
+
}), new Promise((l) => {
|
|
835
|
+
function s(d) {
|
|
836
|
+
function f() {
|
|
837
|
+
d === n ? l(o) : s(n);
|
|
838
|
+
}
|
|
839
|
+
d.then(f, f);
|
|
840
|
+
}
|
|
841
|
+
s(n);
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
// @__NO_SIDE_EFFECTS__
|
|
845
|
+
function $(t) {
|
|
846
|
+
const e = /* @__PURE__ */ Vr(t);
|
|
847
|
+
return Ln(e), e;
|
|
848
|
+
}
|
|
849
|
+
// @__NO_SIDE_EFFECTS__
|
|
850
|
+
function ea(t) {
|
|
851
|
+
const e = /* @__PURE__ */ Vr(t);
|
|
852
|
+
return e.equals = en, e;
|
|
853
|
+
}
|
|
854
|
+
function fn(t) {
|
|
855
|
+
var e = t.effects;
|
|
856
|
+
if (e !== null) {
|
|
857
|
+
t.effects = null;
|
|
858
|
+
for (var r = 0; r < e.length; r += 1)
|
|
859
|
+
_t(
|
|
860
|
+
/** @type {Effect} */
|
|
861
|
+
e[r]
|
|
862
|
+
);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
function ra(t) {
|
|
866
|
+
for (var e = t.parent; e !== null; ) {
|
|
867
|
+
if ((e.f & xt) === 0)
|
|
868
|
+
return (
|
|
869
|
+
/** @type {Effect} */
|
|
870
|
+
e
|
|
871
|
+
);
|
|
872
|
+
e = e.parent;
|
|
873
|
+
}
|
|
874
|
+
return null;
|
|
875
|
+
}
|
|
876
|
+
function Ti(t) {
|
|
877
|
+
var e, r = F;
|
|
878
|
+
re(ra(t));
|
|
879
|
+
try {
|
|
880
|
+
fn(t), e = On(t);
|
|
881
|
+
} finally {
|
|
882
|
+
re(r);
|
|
883
|
+
}
|
|
884
|
+
return e;
|
|
885
|
+
}
|
|
886
|
+
function pn(t) {
|
|
887
|
+
var e = Ti(t);
|
|
888
|
+
if (t.equals(e) || (t.v = e, t.wv = Rn()), !qe)
|
|
889
|
+
if (Bt !== null)
|
|
890
|
+
Bt.set(t, t.v);
|
|
891
|
+
else {
|
|
892
|
+
var r = (fe || (t.f & Pt) !== 0) && t.deps !== null ? ge : bt;
|
|
893
|
+
yt(t, r);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
const he = /* @__PURE__ */ new Map();
|
|
897
|
+
function Oe(t, e) {
|
|
898
|
+
var r = {
|
|
899
|
+
f: 0,
|
|
900
|
+
// TODO ideally we could skip this altogether, but it causes type errors
|
|
901
|
+
v: t,
|
|
902
|
+
reactions: null,
|
|
903
|
+
equals: Ji,
|
|
904
|
+
rv: 0,
|
|
905
|
+
wv: 0
|
|
906
|
+
};
|
|
907
|
+
return r;
|
|
908
|
+
}
|
|
909
|
+
// @__NO_SIDE_EFFECTS__
|
|
910
|
+
function ct(t, e) {
|
|
911
|
+
const r = Oe(t);
|
|
912
|
+
return Ln(r), r;
|
|
913
|
+
}
|
|
914
|
+
// @__NO_SIDE_EFFECTS__
|
|
915
|
+
function hn(t, e = !1, r = !0) {
|
|
916
|
+
const i = Oe(t);
|
|
917
|
+
return e || (i.equals = en), i;
|
|
918
|
+
}
|
|
919
|
+
function Q(t, e, r = !1) {
|
|
920
|
+
N !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
921
|
+
// to ensure we error if state is set inside an inspect effect
|
|
922
|
+
(!Vt || (N.f & Pi) !== 0) && rn() && (N.f & (xt | Ne | xi | Pi)) !== 0 && !se?.includes(t) && zo();
|
|
923
|
+
let i = r ? Ue(e) : e;
|
|
924
|
+
return nr(t, i);
|
|
925
|
+
}
|
|
926
|
+
function nr(t, e) {
|
|
927
|
+
if (!t.equals(e)) {
|
|
928
|
+
var r = t.v;
|
|
929
|
+
qe ? he.set(t, e) : he.set(t, r), t.v = e;
|
|
930
|
+
var i = te.ensure();
|
|
931
|
+
i.capture(t, r), (t.f & xt) !== 0 && ((t.f & Lt) !== 0 && Ti(
|
|
932
|
+
/** @type {Derived} */
|
|
933
|
+
t
|
|
934
|
+
), yt(t, (t.f & Pt) === 0 ? bt : ge)), t.wv = Rn(), vn(t, Lt), F !== null && (F.f & bt) !== 0 && (F.f & (le | me)) === 0 && (Dt === null ? fa([t]) : Dt.push(t));
|
|
935
|
+
}
|
|
936
|
+
return e;
|
|
937
|
+
}
|
|
938
|
+
function hr(t) {
|
|
939
|
+
Q(t, t.v + 1);
|
|
940
|
+
}
|
|
941
|
+
function vn(t, e) {
|
|
942
|
+
var r = t.reactions;
|
|
943
|
+
if (r !== null)
|
|
944
|
+
for (var i = r.length, n = 0; n < i; n++) {
|
|
945
|
+
var o = r[n], a = o.f, c = (a & Lt) === 0;
|
|
946
|
+
c && yt(o, e), (a & xt) !== 0 ? vn(
|
|
947
|
+
/** @type {Derived} */
|
|
948
|
+
o,
|
|
949
|
+
ge
|
|
950
|
+
) : c && ((a & Ne) !== 0 && ye !== null && ye.push(
|
|
951
|
+
/** @type {Effect} */
|
|
952
|
+
o
|
|
953
|
+
), De(
|
|
954
|
+
/** @type {Effect} */
|
|
955
|
+
o
|
|
956
|
+
));
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
function Ue(t) {
|
|
960
|
+
if (typeof t != "object" || t === null || Zr in t)
|
|
961
|
+
return t;
|
|
962
|
+
const e = Qi(t);
|
|
963
|
+
if (e !== Ao && e !== So)
|
|
964
|
+
return t;
|
|
965
|
+
var r = /* @__PURE__ */ new Map(), i = mi(t), n = /* @__PURE__ */ ct(0), o = Le, a = (c) => {
|
|
966
|
+
if (Le === o)
|
|
967
|
+
return c();
|
|
968
|
+
var l = N, s = Le;
|
|
969
|
+
Et(null), Bi(o);
|
|
970
|
+
var d = c();
|
|
971
|
+
return Et(l), Bi(s), d;
|
|
972
|
+
};
|
|
973
|
+
return i && r.set("length", /* @__PURE__ */ ct(
|
|
974
|
+
/** @type {any[]} */
|
|
975
|
+
t.length
|
|
976
|
+
)), new Proxy(
|
|
977
|
+
/** @type {any} */
|
|
978
|
+
t,
|
|
979
|
+
{
|
|
980
|
+
defineProperty(c, l, s) {
|
|
981
|
+
(!("value" in s) || s.configurable === !1 || s.enumerable === !1 || s.writable === !1) && qo();
|
|
982
|
+
var d = r.get(l);
|
|
983
|
+
return d === void 0 ? d = a(() => {
|
|
984
|
+
var f = /* @__PURE__ */ ct(s.value);
|
|
985
|
+
return r.set(l, f), f;
|
|
986
|
+
}) : Q(d, s.value, !0), !0;
|
|
987
|
+
},
|
|
988
|
+
deleteProperty(c, l) {
|
|
989
|
+
var s = r.get(l);
|
|
990
|
+
if (s === void 0) {
|
|
991
|
+
if (l in c) {
|
|
992
|
+
const d = a(() => /* @__PURE__ */ ct(ft));
|
|
993
|
+
r.set(l, d), hr(n);
|
|
994
|
+
}
|
|
995
|
+
} else
|
|
996
|
+
Q(s, ft), hr(n);
|
|
997
|
+
return !0;
|
|
998
|
+
},
|
|
999
|
+
get(c, l, s) {
|
|
1000
|
+
if (l === Zr)
|
|
1001
|
+
return t;
|
|
1002
|
+
var d = r.get(l), f = l in c;
|
|
1003
|
+
if (d === void 0 && (!f || Ye(c, l)?.writable) && (d = a(() => {
|
|
1004
|
+
var m = Ue(f ? c[l] : ft), h = /* @__PURE__ */ ct(m);
|
|
1005
|
+
return h;
|
|
1006
|
+
}), r.set(l, d)), d !== void 0) {
|
|
1007
|
+
var p = u(d);
|
|
1008
|
+
return p === ft ? void 0 : p;
|
|
1009
|
+
}
|
|
1010
|
+
return Reflect.get(c, l, s);
|
|
1011
|
+
},
|
|
1012
|
+
getOwnPropertyDescriptor(c, l) {
|
|
1013
|
+
var s = Reflect.getOwnPropertyDescriptor(c, l);
|
|
1014
|
+
if (s && "value" in s) {
|
|
1015
|
+
var d = r.get(l);
|
|
1016
|
+
d && (s.value = u(d));
|
|
1017
|
+
} else if (s === void 0) {
|
|
1018
|
+
var f = r.get(l), p = f?.v;
|
|
1019
|
+
if (f !== void 0 && p !== ft)
|
|
1020
|
+
return {
|
|
1021
|
+
enumerable: !0,
|
|
1022
|
+
configurable: !0,
|
|
1023
|
+
value: p,
|
|
1024
|
+
writable: !0
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
return s;
|
|
1028
|
+
},
|
|
1029
|
+
has(c, l) {
|
|
1030
|
+
if (l === Zr)
|
|
1031
|
+
return !0;
|
|
1032
|
+
var s = r.get(l), d = s !== void 0 && s.v !== ft || Reflect.has(c, l);
|
|
1033
|
+
if (s !== void 0 || F !== null && (!d || Ye(c, l)?.writable)) {
|
|
1034
|
+
s === void 0 && (s = a(() => {
|
|
1035
|
+
var p = d ? Ue(c[l]) : ft, m = /* @__PURE__ */ ct(p);
|
|
1036
|
+
return m;
|
|
1037
|
+
}), r.set(l, s));
|
|
1038
|
+
var f = u(s);
|
|
1039
|
+
if (f === ft)
|
|
1040
|
+
return !1;
|
|
1041
|
+
}
|
|
1042
|
+
return d;
|
|
1043
|
+
},
|
|
1044
|
+
set(c, l, s, d) {
|
|
1045
|
+
var f = r.get(l), p = l in c;
|
|
1046
|
+
if (i && l === "length")
|
|
1047
|
+
for (var m = s; m < /** @type {Source<number>} */
|
|
1048
|
+
f.v; m += 1) {
|
|
1049
|
+
var h = r.get(m + "");
|
|
1050
|
+
h !== void 0 ? Q(h, ft) : m in c && (h = a(() => /* @__PURE__ */ ct(ft)), r.set(m + "", h));
|
|
1051
|
+
}
|
|
1052
|
+
if (f === void 0)
|
|
1053
|
+
(!p || Ye(c, l)?.writable) && (f = a(() => /* @__PURE__ */ ct(void 0)), Q(f, Ue(s)), r.set(l, f));
|
|
1054
|
+
else {
|
|
1055
|
+
p = f.v !== ft;
|
|
1056
|
+
var w = a(() => Ue(s));
|
|
1057
|
+
Q(f, w);
|
|
1058
|
+
}
|
|
1059
|
+
var b = Reflect.getOwnPropertyDescriptor(c, l);
|
|
1060
|
+
if (b?.set && b.set.call(d, s), !p) {
|
|
1061
|
+
if (i && typeof l == "string") {
|
|
1062
|
+
var I = (
|
|
1063
|
+
/** @type {Source<number>} */
|
|
1064
|
+
r.get("length")
|
|
1065
|
+
), y = Number(l);
|
|
1066
|
+
Number.isInteger(y) && y >= I.v && Q(I, y + 1);
|
|
1067
|
+
}
|
|
1068
|
+
hr(n);
|
|
1069
|
+
}
|
|
1070
|
+
return !0;
|
|
1071
|
+
},
|
|
1072
|
+
ownKeys(c) {
|
|
1073
|
+
u(n);
|
|
1074
|
+
var l = Reflect.ownKeys(c).filter((f) => {
|
|
1075
|
+
var p = r.get(f);
|
|
1076
|
+
return p === void 0 || p.v !== ft;
|
|
1077
|
+
});
|
|
1078
|
+
for (var [s, d] of r)
|
|
1079
|
+
d.v !== ft && !(s in c) && l.push(s);
|
|
1080
|
+
return l;
|
|
1081
|
+
},
|
|
1082
|
+
setPrototypeOf() {
|
|
1083
|
+
Ho();
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
);
|
|
1087
|
+
}
|
|
1088
|
+
var Hi, mn, gn, wn;
|
|
1089
|
+
function ai() {
|
|
1090
|
+
if (Hi === void 0) {
|
|
1091
|
+
Hi = window, mn = /Firefox/.test(navigator.userAgent);
|
|
1092
|
+
var t = Element.prototype, e = Node.prototype, r = Text.prototype;
|
|
1093
|
+
gn = Ye(e, "firstChild").get, wn = Ye(e, "nextSibling").get, Fi(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Fi(r) && (r.__t = void 0);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
function Zt(t = "") {
|
|
1097
|
+
return document.createTextNode(t);
|
|
1098
|
+
}
|
|
1099
|
+
// @__NO_SIDE_EFFECTS__
|
|
1100
|
+
function Tt(t) {
|
|
1101
|
+
return gn.call(t);
|
|
1102
|
+
}
|
|
1103
|
+
// @__NO_SIDE_EFFECTS__
|
|
1104
|
+
function It(t) {
|
|
1105
|
+
return wn.call(t);
|
|
1106
|
+
}
|
|
1107
|
+
function H(t, e) {
|
|
1108
|
+
if (!D)
|
|
1109
|
+
return /* @__PURE__ */ Tt(t);
|
|
1110
|
+
var r = (
|
|
1111
|
+
/** @type {TemplateNode} */
|
|
1112
|
+
/* @__PURE__ */ Tt(j)
|
|
1113
|
+
);
|
|
1114
|
+
if (r === null)
|
|
1115
|
+
r = j.appendChild(Zt());
|
|
1116
|
+
else if (e && r.nodeType !== Ci) {
|
|
1117
|
+
var i = Zt();
|
|
1118
|
+
return r?.before(i), at(i), i;
|
|
1119
|
+
}
|
|
1120
|
+
return at(r), r;
|
|
1121
|
+
}
|
|
1122
|
+
function tt(t, e = !1) {
|
|
1123
|
+
if (!D) {
|
|
1124
|
+
var r = (
|
|
1125
|
+
/** @type {DocumentFragment} */
|
|
1126
|
+
/* @__PURE__ */ Tt(
|
|
1127
|
+
/** @type {Node} */
|
|
1128
|
+
t
|
|
1129
|
+
)
|
|
1130
|
+
);
|
|
1131
|
+
return r instanceof Comment && r.data === "" ? /* @__PURE__ */ It(r) : r;
|
|
1132
|
+
}
|
|
1133
|
+
if (e && j?.nodeType !== Ci) {
|
|
1134
|
+
var i = Zt();
|
|
1135
|
+
return j?.before(i), at(i), i;
|
|
1136
|
+
}
|
|
1137
|
+
return j;
|
|
1138
|
+
}
|
|
1139
|
+
function ut(t, e = 1, r = !1) {
|
|
1140
|
+
let i = D ? j : t;
|
|
1141
|
+
for (var n; e--; )
|
|
1142
|
+
n = i, i = /** @type {TemplateNode} */
|
|
1143
|
+
/* @__PURE__ */ It(i);
|
|
1144
|
+
if (!D)
|
|
1145
|
+
return i;
|
|
1146
|
+
if (r && i?.nodeType !== Ci) {
|
|
1147
|
+
var o = Zt();
|
|
1148
|
+
return i === null ? n?.after(o) : i.before(o), at(o), o;
|
|
1149
|
+
}
|
|
1150
|
+
return at(i), /** @type {TemplateNode} */
|
|
1151
|
+
i;
|
|
1152
|
+
}
|
|
1153
|
+
function bn(t) {
|
|
1154
|
+
t.textContent = "";
|
|
1155
|
+
}
|
|
1156
|
+
function _n() {
|
|
1157
|
+
return !1;
|
|
1158
|
+
}
|
|
1159
|
+
function Ei(t) {
|
|
1160
|
+
var e = N, r = F;
|
|
1161
|
+
Et(null), re(null);
|
|
1162
|
+
try {
|
|
1163
|
+
return t();
|
|
1164
|
+
} finally {
|
|
1165
|
+
Et(e), re(r);
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
function ia(t) {
|
|
1169
|
+
F === null && N === null && No(), N !== null && (N.f & Pt) !== 0 && F === null && Oo(), qe && Do();
|
|
1170
|
+
}
|
|
1171
|
+
function na(t, e) {
|
|
1172
|
+
var r = e.last;
|
|
1173
|
+
r === null ? e.last = e.first = t : (r.next = t, t.prev = r, e.last = t);
|
|
1174
|
+
}
|
|
1175
|
+
function ie(t, e, r, i = !0) {
|
|
1176
|
+
var n = F;
|
|
1177
|
+
n !== null && (n.f & Ut) !== 0 && (t |= Ut);
|
|
1178
|
+
var o = {
|
|
1179
|
+
ctx: Ht,
|
|
1180
|
+
deps: null,
|
|
1181
|
+
nodes_start: null,
|
|
1182
|
+
nodes_end: null,
|
|
1183
|
+
f: t | Lt,
|
|
1184
|
+
first: null,
|
|
1185
|
+
fn: e,
|
|
1186
|
+
last: null,
|
|
1187
|
+
next: null,
|
|
1188
|
+
parent: n,
|
|
1189
|
+
b: n && n.b,
|
|
1190
|
+
prev: null,
|
|
1191
|
+
teardown: null,
|
|
1192
|
+
transitions: null,
|
|
1193
|
+
wv: 0,
|
|
1194
|
+
ac: null
|
|
1195
|
+
};
|
|
1196
|
+
if (r)
|
|
1197
|
+
try {
|
|
1198
|
+
qr(o), o.f |= yi;
|
|
1199
|
+
} catch (l) {
|
|
1200
|
+
throw _t(o), l;
|
|
1201
|
+
}
|
|
1202
|
+
else e !== null && De(o);
|
|
1203
|
+
if (i) {
|
|
1204
|
+
var a = o;
|
|
1205
|
+
if (r && a.deps === null && a.teardown === null && a.nodes_start === null && a.first === a.last && // either `null`, or a singular child
|
|
1206
|
+
(a.f & Pe) === 0 && (a = a.first), a !== null && (a.parent = n, n !== null && na(a, n), N !== null && (N.f & xt) !== 0 && (t & me) === 0)) {
|
|
1207
|
+
var c = (
|
|
1208
|
+
/** @type {Derived} */
|
|
1209
|
+
N
|
|
1210
|
+
);
|
|
1211
|
+
(c.effects ?? (c.effects = [])).push(a);
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
return o;
|
|
1215
|
+
}
|
|
1216
|
+
function oa() {
|
|
1217
|
+
return N !== null && !Vt;
|
|
1218
|
+
}
|
|
1219
|
+
function yn(t) {
|
|
1220
|
+
const e = ie(bi, null, !1);
|
|
1221
|
+
return yt(e, bt), e.teardown = t, e;
|
|
1222
|
+
}
|
|
1223
|
+
function aa(t) {
|
|
1224
|
+
ia();
|
|
1225
|
+
var e = (
|
|
1226
|
+
/** @type {Effect} */
|
|
1227
|
+
F.f
|
|
1228
|
+
), r = !N && (e & le) !== 0 && (e & yi) === 0;
|
|
1229
|
+
if (r) {
|
|
1230
|
+
var i = (
|
|
1231
|
+
/** @type {ComponentContext} */
|
|
1232
|
+
Ht
|
|
1233
|
+
);
|
|
1234
|
+
(i.e ?? (i.e = [])).push(t);
|
|
1235
|
+
} else
|
|
1236
|
+
return xn(t);
|
|
1237
|
+
}
|
|
1238
|
+
function xn(t) {
|
|
1239
|
+
return ie(wi | $o, t, !1);
|
|
1240
|
+
}
|
|
1241
|
+
function sa(t) {
|
|
1242
|
+
te.ensure();
|
|
1243
|
+
const e = ie(me | Pe, t, !0);
|
|
1244
|
+
return () => {
|
|
1245
|
+
_t(e);
|
|
1246
|
+
};
|
|
1247
|
+
}
|
|
1248
|
+
function la(t) {
|
|
1249
|
+
te.ensure();
|
|
1250
|
+
const e = ie(me | Pe, t, !0);
|
|
1251
|
+
return (r = {}) => new Promise((i) => {
|
|
1252
|
+
r.outro ? Ze(e, () => {
|
|
1253
|
+
_t(e), i(void 0);
|
|
1254
|
+
}) : (_t(e), i(void 0));
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
function ca(t) {
|
|
1258
|
+
return ie(wi, t, !1);
|
|
1259
|
+
}
|
|
1260
|
+
function ua(t) {
|
|
1261
|
+
return ie(xi | Pe, t, !0);
|
|
1262
|
+
}
|
|
1263
|
+
function Cn(t, e = 0) {
|
|
1264
|
+
return ie(bi | e, t, !0);
|
|
1265
|
+
}
|
|
1266
|
+
function rt(t, e = [], r = []) {
|
|
1267
|
+
Xo(e, r, (i) => {
|
|
1268
|
+
ie(bi, () => t(...i.map(u)), !0);
|
|
1269
|
+
});
|
|
1270
|
+
}
|
|
1271
|
+
function ar(t, e = 0) {
|
|
1272
|
+
var r = ie(Ne | e, t, !0);
|
|
1273
|
+
return r;
|
|
1274
|
+
}
|
|
1275
|
+
function Ft(t, e = !0) {
|
|
1276
|
+
return ie(le | Pe, t, !0, e);
|
|
1277
|
+
}
|
|
1278
|
+
function kn(t) {
|
|
1279
|
+
var e = t.teardown;
|
|
1280
|
+
if (e !== null) {
|
|
1281
|
+
const r = qe, i = N;
|
|
1282
|
+
ji(!0), Et(null);
|
|
1283
|
+
try {
|
|
1284
|
+
e.call(null);
|
|
1285
|
+
} finally {
|
|
1286
|
+
ji(r), Et(i);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
function Tn(t, e = !1) {
|
|
1291
|
+
var r = t.first;
|
|
1292
|
+
for (t.first = t.last = null; r !== null; ) {
|
|
1293
|
+
const n = r.ac;
|
|
1294
|
+
n !== null && Ei(() => {
|
|
1295
|
+
n.abort(Ve);
|
|
1296
|
+
});
|
|
1297
|
+
var i = r.next;
|
|
1298
|
+
(r.f & me) !== 0 ? r.parent = null : _t(r, e), r = i;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
function da(t) {
|
|
1302
|
+
for (var e = t.first; e !== null; ) {
|
|
1303
|
+
var r = e.next;
|
|
1304
|
+
(e.f & le) === 0 && _t(e), e = r;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
function _t(t, e = !0) {
|
|
1308
|
+
var r = !1;
|
|
1309
|
+
(e || (t.f & Ki) !== 0) && t.nodes_start !== null && t.nodes_end !== null && (En(
|
|
1310
|
+
t.nodes_start,
|
|
1311
|
+
/** @type {TemplateNode} */
|
|
1312
|
+
t.nodes_end
|
|
1313
|
+
), r = !0), Tn(t, e && !r), Pr(t, 0), yt(t, Fe);
|
|
1314
|
+
var i = t.transitions;
|
|
1315
|
+
if (i !== null)
|
|
1316
|
+
for (const o of i)
|
|
1317
|
+
o.stop();
|
|
1318
|
+
kn(t);
|
|
1319
|
+
var n = t.parent;
|
|
1320
|
+
n !== null && n.first !== null && An(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = t.ac = null;
|
|
1321
|
+
}
|
|
1322
|
+
function En(t, e) {
|
|
1323
|
+
for (; t !== null; ) {
|
|
1324
|
+
var r = t === e ? null : (
|
|
1325
|
+
/** @type {TemplateNode} */
|
|
1326
|
+
/* @__PURE__ */ It(t)
|
|
1327
|
+
);
|
|
1328
|
+
t.remove(), t = r;
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
function An(t) {
|
|
1332
|
+
var e = t.parent, r = t.prev, i = t.next;
|
|
1333
|
+
r !== null && (r.next = i), i !== null && (i.prev = r), e !== null && (e.first === t && (e.first = i), e.last === t && (e.last = r));
|
|
1334
|
+
}
|
|
1335
|
+
function Ze(t, e, r = !0) {
|
|
1336
|
+
var i = [];
|
|
1337
|
+
Ai(t, i, !0), Sn(i, () => {
|
|
1338
|
+
r && _t(t), e && e();
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
function Sn(t, e) {
|
|
1342
|
+
var r = t.length;
|
|
1343
|
+
if (r > 0) {
|
|
1344
|
+
var i = () => --r || e();
|
|
1345
|
+
for (var n of t)
|
|
1346
|
+
n.out(i);
|
|
1347
|
+
} else
|
|
1348
|
+
e();
|
|
1349
|
+
}
|
|
1350
|
+
function Ai(t, e, r) {
|
|
1351
|
+
if ((t.f & Ut) === 0) {
|
|
1352
|
+
if (t.f ^= Ut, t.transitions !== null)
|
|
1353
|
+
for (const a of t.transitions)
|
|
1354
|
+
(a.is_global || r) && e.push(a);
|
|
1355
|
+
for (var i = t.first; i !== null; ) {
|
|
1356
|
+
var n = i.next, o = (i.f & or) !== 0 || (i.f & le) !== 0;
|
|
1357
|
+
Ai(i, e, o ? r : !1), i = n;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
function Si(t) {
|
|
1362
|
+
Mn(t, !0);
|
|
1363
|
+
}
|
|
1364
|
+
function Mn(t, e) {
|
|
1365
|
+
if ((t.f & Ut) !== 0) {
|
|
1366
|
+
t.f ^= Ut, (t.f & bt) === 0 && (yt(t, Lt), De(t));
|
|
1367
|
+
for (var r = t.first; r !== null; ) {
|
|
1368
|
+
var i = r.next, n = (r.f & or) !== 0 || (r.f & le) !== 0;
|
|
1369
|
+
Mn(r, n ? e : !1), r = i;
|
|
1370
|
+
}
|
|
1371
|
+
if (t.transitions !== null)
|
|
1372
|
+
for (const o of t.transitions)
|
|
1373
|
+
(o.is_global || e) && o.in();
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
function $n(t, e) {
|
|
1377
|
+
for (var r = t.nodes_start, i = t.nodes_end; r !== null; ) {
|
|
1378
|
+
var n = r === i ? null : (
|
|
1379
|
+
/** @type {TemplateNode} */
|
|
1380
|
+
/* @__PURE__ */ It(r)
|
|
1381
|
+
);
|
|
1382
|
+
e.append(r), r = n;
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
let We = !1;
|
|
1386
|
+
function zi(t) {
|
|
1387
|
+
We = t;
|
|
1388
|
+
}
|
|
1389
|
+
let qe = !1;
|
|
1390
|
+
function ji(t) {
|
|
1391
|
+
qe = t;
|
|
1392
|
+
}
|
|
1393
|
+
let N = null, Vt = !1;
|
|
1394
|
+
function Et(t) {
|
|
1395
|
+
N = t;
|
|
1396
|
+
}
|
|
1397
|
+
let F = null;
|
|
1398
|
+
function re(t) {
|
|
1399
|
+
F = t;
|
|
1400
|
+
}
|
|
1401
|
+
let se = null;
|
|
1402
|
+
function Ln(t) {
|
|
1403
|
+
N !== null && (se === null ? se = [t] : se.push(t));
|
|
1404
|
+
}
|
|
1405
|
+
let wt = null, St = 0, Dt = null;
|
|
1406
|
+
function fa(t) {
|
|
1407
|
+
Dt = t;
|
|
1408
|
+
}
|
|
1409
|
+
let In = 1, vr = 0, Le = vr;
|
|
1410
|
+
function Bi(t) {
|
|
1411
|
+
Le = t;
|
|
1412
|
+
}
|
|
1413
|
+
let fe = !1;
|
|
1414
|
+
function Rn() {
|
|
1415
|
+
return ++In;
|
|
1416
|
+
}
|
|
1417
|
+
function Ur(t) {
|
|
1418
|
+
var e = t.f;
|
|
1419
|
+
if ((e & Lt) !== 0)
|
|
1420
|
+
return !0;
|
|
1421
|
+
if ((e & ge) !== 0) {
|
|
1422
|
+
var r = t.deps, i = (e & Pt) !== 0;
|
|
1423
|
+
if (r !== null) {
|
|
1424
|
+
var n, o, a = (e & Nr) !== 0, c = i && F !== null && !fe, l = r.length;
|
|
1425
|
+
if ((a || c) && (F === null || (F.f & Fe) === 0)) {
|
|
1426
|
+
var s = (
|
|
1427
|
+
/** @type {Derived} */
|
|
1428
|
+
t
|
|
1429
|
+
), d = s.parent;
|
|
1430
|
+
for (n = 0; n < l; n++)
|
|
1431
|
+
o = r[n], (a || !o?.reactions?.includes(s)) && (o.reactions ?? (o.reactions = [])).push(s);
|
|
1432
|
+
a && (s.f ^= Nr), c && d !== null && (d.f & Pt) === 0 && (s.f ^= Pt);
|
|
1433
|
+
}
|
|
1434
|
+
for (n = 0; n < l; n++)
|
|
1435
|
+
if (o = r[n], Ur(
|
|
1436
|
+
/** @type {Derived} */
|
|
1437
|
+
o
|
|
1438
|
+
) && pn(
|
|
1439
|
+
/** @type {Derived} */
|
|
1440
|
+
o
|
|
1441
|
+
), o.wv > t.wv)
|
|
1442
|
+
return !0;
|
|
1443
|
+
}
|
|
1444
|
+
(!i || F !== null && !fe) && yt(t, bt);
|
|
1445
|
+
}
|
|
1446
|
+
return !1;
|
|
1447
|
+
}
|
|
1448
|
+
function Dn(t, e, r = !0) {
|
|
1449
|
+
var i = t.reactions;
|
|
1450
|
+
if (i !== null && !se?.includes(t))
|
|
1451
|
+
for (var n = 0; n < i.length; n++) {
|
|
1452
|
+
var o = i[n];
|
|
1453
|
+
(o.f & xt) !== 0 ? Dn(
|
|
1454
|
+
/** @type {Derived} */
|
|
1455
|
+
o,
|
|
1456
|
+
e,
|
|
1457
|
+
!1
|
|
1458
|
+
) : e === o && (r ? yt(o, Lt) : (o.f & bt) !== 0 && yt(o, ge), De(
|
|
1459
|
+
/** @type {Effect} */
|
|
1460
|
+
o
|
|
1461
|
+
));
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
function On(t) {
|
|
1465
|
+
var w;
|
|
1466
|
+
var e = wt, r = St, i = Dt, n = N, o = fe, a = se, c = Ht, l = Vt, s = Le, d = t.f;
|
|
1467
|
+
wt = /** @type {null | Value[]} */
|
|
1468
|
+
null, St = 0, Dt = null, fe = (d & Pt) !== 0 && (Vt || !We || N === null), N = (d & (le | me)) === 0 ? t : null, se = null, er(t.ctx), Vt = !1, Le = ++vr, t.ac !== null && (Ei(() => {
|
|
1469
|
+
t.ac.abort(Ve);
|
|
1470
|
+
}), t.ac = null);
|
|
1471
|
+
try {
|
|
1472
|
+
t.f |= Jr;
|
|
1473
|
+
var f = (
|
|
1474
|
+
/** @type {Function} */
|
|
1475
|
+
t.fn
|
|
1476
|
+
), p = f(), m = t.deps;
|
|
1477
|
+
if (wt !== null) {
|
|
1478
|
+
var h;
|
|
1479
|
+
if (Pr(t, St), m !== null && St > 0)
|
|
1480
|
+
for (m.length = St + wt.length, h = 0; h < wt.length; h++)
|
|
1481
|
+
m[St + h] = wt[h];
|
|
1482
|
+
else
|
|
1483
|
+
t.deps = m = wt;
|
|
1484
|
+
if (!fe || // Deriveds that already have reactions can cleanup, so we still add them as reactions
|
|
1485
|
+
(d & xt) !== 0 && /** @type {import('#client').Derived} */
|
|
1486
|
+
t.reactions !== null)
|
|
1487
|
+
for (h = St; h < m.length; h++)
|
|
1488
|
+
((w = m[h]).reactions ?? (w.reactions = [])).push(t);
|
|
1489
|
+
} else m !== null && St < m.length && (Pr(t, St), m.length = St);
|
|
1490
|
+
if (rn() && Dt !== null && !Vt && m !== null && (t.f & (xt | ge | Lt)) === 0)
|
|
1491
|
+
for (h = 0; h < /** @type {Source[]} */
|
|
1492
|
+
Dt.length; h++)
|
|
1493
|
+
Dn(
|
|
1494
|
+
Dt[h],
|
|
1495
|
+
/** @type {Effect} */
|
|
1496
|
+
t
|
|
1497
|
+
);
|
|
1498
|
+
return n !== null && n !== t && (vr++, Dt !== null && (i === null ? i = Dt : i.push(.../** @type {Source[]} */
|
|
1499
|
+
Dt))), (t.f & $e) !== 0 && (t.f ^= $e), p;
|
|
1500
|
+
} catch (b) {
|
|
1501
|
+
return on(b);
|
|
1502
|
+
} finally {
|
|
1503
|
+
t.f ^= Jr, wt = e, St = r, Dt = i, N = n, fe = o, se = a, er(c), Vt = l, Le = s;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
function pa(t, e) {
|
|
1507
|
+
let r = e.reactions;
|
|
1508
|
+
if (r !== null) {
|
|
1509
|
+
var i = To.call(r, t);
|
|
1510
|
+
if (i !== -1) {
|
|
1511
|
+
var n = r.length - 1;
|
|
1512
|
+
n === 0 ? r = e.reactions = null : (r[i] = r[n], r.pop());
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
r === null && (e.f & xt) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1516
|
+
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1517
|
+
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1518
|
+
(wt === null || !wt.includes(e)) && (yt(e, ge), (e.f & (Pt | Nr)) === 0 && (e.f ^= Nr), fn(
|
|
1519
|
+
/** @type {Derived} **/
|
|
1520
|
+
e
|
|
1521
|
+
), Pr(
|
|
1522
|
+
/** @type {Derived} **/
|
|
1523
|
+
e,
|
|
1524
|
+
0
|
|
1525
|
+
));
|
|
1526
|
+
}
|
|
1527
|
+
function Pr(t, e) {
|
|
1528
|
+
var r = t.deps;
|
|
1529
|
+
if (r !== null)
|
|
1530
|
+
for (var i = e; i < r.length; i++)
|
|
1531
|
+
pa(t, r[i]);
|
|
1532
|
+
}
|
|
1533
|
+
function qr(t) {
|
|
1534
|
+
var e = t.f;
|
|
1535
|
+
if ((e & Fe) === 0) {
|
|
1536
|
+
yt(t, bt);
|
|
1537
|
+
var r = F, i = We;
|
|
1538
|
+
F = t, We = !0;
|
|
1539
|
+
try {
|
|
1540
|
+
(e & Ne) !== 0 ? da(t) : Tn(t), kn(t);
|
|
1541
|
+
var n = On(t);
|
|
1542
|
+
t.teardown = typeof n == "function" ? n : null, t.wv = In;
|
|
1543
|
+
var o;
|
|
1544
|
+
Wi && Vo && (t.f & Lt) !== 0 && t.deps;
|
|
1545
|
+
} finally {
|
|
1546
|
+
We = i, F = r;
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
function u(t) {
|
|
1551
|
+
var e = t.f, r = (e & xt) !== 0;
|
|
1552
|
+
if (N !== null && !Vt) {
|
|
1553
|
+
var i = F !== null && (F.f & Fe) !== 0;
|
|
1554
|
+
if (!i && !se?.includes(t)) {
|
|
1555
|
+
var n = N.deps;
|
|
1556
|
+
if ((N.f & Jr) !== 0)
|
|
1557
|
+
t.rv < vr && (t.rv = vr, wt === null && n !== null && n[St] === t ? St++ : wt === null ? wt = [t] : (!fe || !wt.includes(t)) && wt.push(t));
|
|
1558
|
+
else {
|
|
1559
|
+
(N.deps ?? (N.deps = [])).push(t);
|
|
1560
|
+
var o = t.reactions;
|
|
1561
|
+
o === null ? t.reactions = [N] : o.includes(N) || o.push(N);
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
} else if (r && /** @type {Derived} */
|
|
1565
|
+
t.deps === null && /** @type {Derived} */
|
|
1566
|
+
t.effects === null) {
|
|
1567
|
+
var a = (
|
|
1568
|
+
/** @type {Derived} */
|
|
1569
|
+
t
|
|
1570
|
+
), c = a.parent;
|
|
1571
|
+
c !== null && (c.f & Pt) === 0 && (a.f ^= Pt);
|
|
1572
|
+
}
|
|
1573
|
+
if (qe) {
|
|
1574
|
+
if (he.has(t))
|
|
1575
|
+
return he.get(t);
|
|
1576
|
+
if (r) {
|
|
1577
|
+
a = /** @type {Derived} */
|
|
1578
|
+
t;
|
|
1579
|
+
var l = a.v;
|
|
1580
|
+
return ((a.f & bt) === 0 && a.reactions !== null || Nn(a)) && (l = Ti(a)), he.set(a, l), l;
|
|
1581
|
+
}
|
|
1582
|
+
} else if (r) {
|
|
1583
|
+
if (a = /** @type {Derived} */
|
|
1584
|
+
t, Bt?.has(a))
|
|
1585
|
+
return Bt.get(a);
|
|
1586
|
+
Ur(a) && pn(a);
|
|
1587
|
+
}
|
|
1588
|
+
if (Bt?.has(t))
|
|
1589
|
+
return Bt.get(t);
|
|
1590
|
+
if ((t.f & $e) !== 0)
|
|
1591
|
+
throw t.v;
|
|
1592
|
+
return t.v;
|
|
1593
|
+
}
|
|
1594
|
+
function Nn(t) {
|
|
1595
|
+
if (t.v === ft) return !0;
|
|
1596
|
+
if (t.deps === null) return !1;
|
|
1597
|
+
for (const e of t.deps)
|
|
1598
|
+
if (he.has(e) || (e.f & xt) !== 0 && Nn(
|
|
1599
|
+
/** @type {Derived} */
|
|
1600
|
+
e
|
|
1601
|
+
))
|
|
1602
|
+
return !0;
|
|
1603
|
+
return !1;
|
|
1604
|
+
}
|
|
1605
|
+
function Fn(t) {
|
|
1606
|
+
var e = Vt;
|
|
1607
|
+
try {
|
|
1608
|
+
return Vt = !0, t();
|
|
1609
|
+
} finally {
|
|
1610
|
+
Vt = e;
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
const ha = -7169;
|
|
1614
|
+
function yt(t, e) {
|
|
1615
|
+
t.f = t.f & ha | e;
|
|
1616
|
+
}
|
|
1617
|
+
const Pn = /* @__PURE__ */ new Set(), si = /* @__PURE__ */ new Set();
|
|
1618
|
+
function va(t) {
|
|
1619
|
+
if (!D) return;
|
|
1620
|
+
t.removeAttribute("onload"), t.removeAttribute("onerror");
|
|
1621
|
+
const e = t.__e;
|
|
1622
|
+
e !== void 0 && (t.__e = void 0, queueMicrotask(() => {
|
|
1623
|
+
t.isConnected && t.dispatchEvent(e);
|
|
1624
|
+
}));
|
|
1625
|
+
}
|
|
1626
|
+
function ma(t, e, r, i = {}) {
|
|
1627
|
+
function n(o) {
|
|
1628
|
+
if (i.capture || fr.call(e, o), !o.cancelBubble)
|
|
1629
|
+
return Ei(() => r?.call(this, o));
|
|
1630
|
+
}
|
|
1631
|
+
return t.startsWith("pointer") || t.startsWith("touch") || t === "wheel" ? rr(() => {
|
|
1632
|
+
e.addEventListener(t, n, i);
|
|
1633
|
+
}) : e.addEventListener(t, n, i), n;
|
|
1634
|
+
}
|
|
1635
|
+
function ga(t, e, r, i, n) {
|
|
1636
|
+
var o = { capture: i, passive: n }, a = ma(t, e, r, o);
|
|
1637
|
+
(e === document.body || // @ts-ignore
|
|
1638
|
+
e === window || // @ts-ignore
|
|
1639
|
+
e === document || // Firefox has quirky behavior, it can happen that we still get "canplay" events when the element is already removed
|
|
1640
|
+
e instanceof HTMLMediaElement) && yn(() => {
|
|
1641
|
+
e.removeEventListener(t, a, o);
|
|
1642
|
+
});
|
|
1643
|
+
}
|
|
1644
|
+
function qn(t) {
|
|
1645
|
+
for (var e = 0; e < t.length; e++)
|
|
1646
|
+
Pn.add(t[e]);
|
|
1647
|
+
for (var r of si)
|
|
1648
|
+
r(t);
|
|
1649
|
+
}
|
|
1650
|
+
let Vi = null;
|
|
1651
|
+
function fr(t) {
|
|
1652
|
+
var e = this, r = (
|
|
1653
|
+
/** @type {Node} */
|
|
1654
|
+
e.ownerDocument
|
|
1655
|
+
), i = t.type, n = t.composedPath?.() || [], o = (
|
|
1656
|
+
/** @type {null | Element} */
|
|
1657
|
+
n[0] || t.target
|
|
1658
|
+
);
|
|
1659
|
+
Vi = t;
|
|
1660
|
+
var a = 0, c = Vi === t && t.__root;
|
|
1661
|
+
if (c) {
|
|
1662
|
+
var l = n.indexOf(c);
|
|
1663
|
+
if (l !== -1 && (e === document || e === /** @type {any} */
|
|
1664
|
+
window)) {
|
|
1665
|
+
t.__root = e;
|
|
1666
|
+
return;
|
|
1667
|
+
}
|
|
1668
|
+
var s = n.indexOf(e);
|
|
1669
|
+
if (s === -1)
|
|
1670
|
+
return;
|
|
1671
|
+
l <= s && (a = l);
|
|
1672
|
+
}
|
|
1673
|
+
if (o = /** @type {Element} */
|
|
1674
|
+
n[a] || t.target, o !== e) {
|
|
1675
|
+
tr(t, "currentTarget", {
|
|
1676
|
+
configurable: !0,
|
|
1677
|
+
get() {
|
|
1678
|
+
return o || r;
|
|
1679
|
+
}
|
|
1680
|
+
});
|
|
1681
|
+
var d = N, f = F;
|
|
1682
|
+
Et(null), re(null);
|
|
1683
|
+
try {
|
|
1684
|
+
for (var p, m = []; o !== null; ) {
|
|
1685
|
+
var h = o.assignedSlot || o.parentNode || /** @type {any} */
|
|
1686
|
+
o.host || null;
|
|
1687
|
+
try {
|
|
1688
|
+
var w = o["__" + i];
|
|
1689
|
+
if (w != null && (!/** @type {any} */
|
|
1690
|
+
o.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1691
|
+
// -> the target could not have been disabled because it emits the event in the first place
|
|
1692
|
+
t.target === o))
|
|
1693
|
+
if (mi(w)) {
|
|
1694
|
+
var [b, ...I] = w;
|
|
1695
|
+
b.apply(o, [t, ...I]);
|
|
1696
|
+
} else
|
|
1697
|
+
w.call(o, t);
|
|
1698
|
+
} catch (y) {
|
|
1699
|
+
p ? m.push(y) : p = y;
|
|
1700
|
+
}
|
|
1701
|
+
if (t.cancelBubble || h === e || h === null)
|
|
1702
|
+
break;
|
|
1703
|
+
o = h;
|
|
1704
|
+
}
|
|
1705
|
+
if (p) {
|
|
1706
|
+
for (let y of m)
|
|
1707
|
+
queueMicrotask(() => {
|
|
1708
|
+
throw y;
|
|
1709
|
+
});
|
|
1710
|
+
throw p;
|
|
1711
|
+
}
|
|
1712
|
+
} finally {
|
|
1713
|
+
t.__root = e, delete t.currentTarget, Et(d), re(f);
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
let Rt;
|
|
1718
|
+
function wa() {
|
|
1719
|
+
Rt = void 0;
|
|
1720
|
+
}
|
|
1721
|
+
function ba(t) {
|
|
1722
|
+
let e = null, r = D;
|
|
1723
|
+
var i;
|
|
1724
|
+
if (D) {
|
|
1725
|
+
for (e = j, Rt === void 0 && (Rt = /** @type {TemplateNode} */
|
|
1726
|
+
/* @__PURE__ */ Tt(document.head)); Rt !== null && (Rt.nodeType !== we || /** @type {Comment} */
|
|
1727
|
+
Rt.data !== "["); )
|
|
1728
|
+
Rt = /** @type {TemplateNode} */
|
|
1729
|
+
/* @__PURE__ */ It(Rt);
|
|
1730
|
+
Rt === null ? $t(!1) : Rt = at(
|
|
1731
|
+
/** @type {TemplateNode} */
|
|
1732
|
+
/* @__PURE__ */ It(Rt)
|
|
1733
|
+
);
|
|
1734
|
+
}
|
|
1735
|
+
D || (i = document.head.appendChild(Zt()));
|
|
1736
|
+
try {
|
|
1737
|
+
ar(() => t(i), Ki);
|
|
1738
|
+
} finally {
|
|
1739
|
+
r && ($t(!0), Rt = j, at(
|
|
1740
|
+
/** @type {TemplateNode} */
|
|
1741
|
+
e
|
|
1742
|
+
));
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
function Mi(t) {
|
|
1746
|
+
var e = document.createElement("template");
|
|
1747
|
+
return e.innerHTML = t.replaceAll("<!>", "<!---->"), e.content;
|
|
1748
|
+
}
|
|
1749
|
+
function ee(t, e) {
|
|
1750
|
+
var r = (
|
|
1751
|
+
/** @type {Effect} */
|
|
1752
|
+
F
|
|
1753
|
+
);
|
|
1754
|
+
r.nodes_start === null && (r.nodes_start = t, r.nodes_end = e);
|
|
1755
|
+
}
|
|
1756
|
+
// @__NO_SIDE_EFFECTS__
|
|
1757
|
+
function U(t, e) {
|
|
1758
|
+
var r = (e & 1) !== 0, i = (e & 2) !== 0, n, o = !t.startsWith("<!>");
|
|
1759
|
+
return () => {
|
|
1760
|
+
if (D)
|
|
1761
|
+
return ee(j, null), j;
|
|
1762
|
+
n === void 0 && (n = Mi(o ? t : "<!>" + t), r || (n = /** @type {Node} */
|
|
1763
|
+
/* @__PURE__ */ Tt(n)));
|
|
1764
|
+
var a = (
|
|
1765
|
+
/** @type {TemplateNode} */
|
|
1766
|
+
i || mn ? document.importNode(n, !0) : n.cloneNode(!0)
|
|
1767
|
+
);
|
|
1768
|
+
if (r) {
|
|
1769
|
+
var c = (
|
|
1770
|
+
/** @type {TemplateNode} */
|
|
1771
|
+
/* @__PURE__ */ Tt(a)
|
|
1772
|
+
), l = (
|
|
1773
|
+
/** @type {TemplateNode} */
|
|
1774
|
+
a.lastChild
|
|
1775
|
+
);
|
|
1776
|
+
ee(c, l);
|
|
1777
|
+
} else
|
|
1778
|
+
ee(a, a);
|
|
1779
|
+
return a;
|
|
1780
|
+
};
|
|
1781
|
+
}
|
|
1782
|
+
// @__NO_SIDE_EFFECTS__
|
|
1783
|
+
function _a(t, e, r = "svg") {
|
|
1784
|
+
var i = !t.startsWith("<!>"), n = `<${r}>${i ? t : "<!>" + t}</${r}>`, o;
|
|
1785
|
+
return () => {
|
|
1786
|
+
if (D)
|
|
1787
|
+
return ee(j, null), j;
|
|
1788
|
+
if (!o) {
|
|
1789
|
+
var a = (
|
|
1790
|
+
/** @type {DocumentFragment} */
|
|
1791
|
+
Mi(n)
|
|
1792
|
+
), c = (
|
|
1793
|
+
/** @type {Element} */
|
|
1794
|
+
/* @__PURE__ */ Tt(a)
|
|
1795
|
+
);
|
|
1796
|
+
o = /** @type {Element} */
|
|
1797
|
+
/* @__PURE__ */ Tt(c);
|
|
1798
|
+
}
|
|
1799
|
+
var l = (
|
|
1800
|
+
/** @type {TemplateNode} */
|
|
1801
|
+
o.cloneNode(!0)
|
|
1802
|
+
);
|
|
1803
|
+
return ee(l, l), l;
|
|
1804
|
+
};
|
|
1805
|
+
}
|
|
1806
|
+
// @__NO_SIDE_EFFECTS__
|
|
1807
|
+
function Hn(t, e) {
|
|
1808
|
+
return /* @__PURE__ */ _a(t, e, "svg");
|
|
1809
|
+
}
|
|
1810
|
+
function et() {
|
|
1811
|
+
if (D)
|
|
1812
|
+
return ee(j, null), j;
|
|
1813
|
+
var t = document.createDocumentFragment(), e = document.createComment(""), r = Zt();
|
|
1814
|
+
return t.append(e, r), ee(e, r), t;
|
|
1815
|
+
}
|
|
1816
|
+
function C(t, e) {
|
|
1817
|
+
if (D) {
|
|
1818
|
+
F.nodes_end = j, Re();
|
|
1819
|
+
return;
|
|
1820
|
+
}
|
|
1821
|
+
t !== null && t.before(
|
|
1822
|
+
/** @type {Node} */
|
|
1823
|
+
e
|
|
1824
|
+
);
|
|
1825
|
+
}
|
|
1826
|
+
const ya = ["touchstart", "touchmove"];
|
|
1827
|
+
function xa(t) {
|
|
1828
|
+
return ya.includes(t);
|
|
1829
|
+
}
|
|
1830
|
+
function Qe(t, e) {
|
|
1831
|
+
var r = e == null ? "" : typeof e == "object" ? e + "" : e;
|
|
1832
|
+
r !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = r, t.nodeValue = r + "");
|
|
1833
|
+
}
|
|
1834
|
+
function zn(t, e) {
|
|
1835
|
+
return jn(t, e);
|
|
1836
|
+
}
|
|
1837
|
+
function Ca(t, e) {
|
|
1838
|
+
ai(), e.intro = e.intro ?? !1;
|
|
1839
|
+
const r = e.target, i = D, n = j;
|
|
1840
|
+
try {
|
|
1841
|
+
for (var o = (
|
|
1842
|
+
/** @type {TemplateNode} */
|
|
1843
|
+
/* @__PURE__ */ Tt(r)
|
|
1844
|
+
); o && (o.nodeType !== we || /** @type {Comment} */
|
|
1845
|
+
o.data !== "["); )
|
|
1846
|
+
o = /** @type {TemplateNode} */
|
|
1847
|
+
/* @__PURE__ */ It(o);
|
|
1848
|
+
if (!o)
|
|
1849
|
+
throw Ie;
|
|
1850
|
+
$t(!0), at(
|
|
1851
|
+
/** @type {Comment} */
|
|
1852
|
+
o
|
|
1853
|
+
);
|
|
1854
|
+
const a = jn(t, { ...e, anchor: o });
|
|
1855
|
+
return $t(!1), /** @type {Exports} */
|
|
1856
|
+
a;
|
|
1857
|
+
} catch (a) {
|
|
1858
|
+
if (a instanceof Error && a.message.split(`
|
|
1859
|
+
`).some((c) => c.startsWith("https://svelte.dev/e/")))
|
|
1860
|
+
throw a;
|
|
1861
|
+
return a !== Ie && console.warn("Failed to hydrate: ", a), e.recover === !1 && Po(), ai(), bn(r), $t(!1), zn(t, e);
|
|
1862
|
+
} finally {
|
|
1863
|
+
$t(i), at(n), wa();
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
const je = /* @__PURE__ */ new Map();
|
|
1867
|
+
function jn(t, { target: e, anchor: r, props: i = {}, events: n, context: o, intro: a = !0 }) {
|
|
1868
|
+
ai();
|
|
1869
|
+
var c = /* @__PURE__ */ new Set(), l = (f) => {
|
|
1870
|
+
for (var p = 0; p < f.length; p++) {
|
|
1871
|
+
var m = f[p];
|
|
1872
|
+
if (!c.has(m)) {
|
|
1873
|
+
c.add(m);
|
|
1874
|
+
var h = xa(m);
|
|
1875
|
+
e.addEventListener(m, fr, { passive: h });
|
|
1876
|
+
var w = je.get(m);
|
|
1877
|
+
w === void 0 ? (document.addEventListener(m, fr, { passive: h }), je.set(m, 1)) : je.set(m, w + 1);
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
};
|
|
1881
|
+
l(gi(Pn)), si.add(l);
|
|
1882
|
+
var s = void 0, d = la(() => {
|
|
1883
|
+
var f = r ?? e.appendChild(Zt());
|
|
1884
|
+
return Go(
|
|
1885
|
+
/** @type {TemplateNode} */
|
|
1886
|
+
f,
|
|
1887
|
+
{
|
|
1888
|
+
pending: () => {
|
|
1889
|
+
}
|
|
1890
|
+
},
|
|
1891
|
+
(p) => {
|
|
1892
|
+
if (o) {
|
|
1893
|
+
ht({});
|
|
1894
|
+
var m = (
|
|
1895
|
+
/** @type {ComponentContext} */
|
|
1896
|
+
Ht
|
|
1897
|
+
);
|
|
1898
|
+
m.c = o;
|
|
1899
|
+
}
|
|
1900
|
+
if (n && (i.$$events = n), D && ee(
|
|
1901
|
+
/** @type {TemplateNode} */
|
|
1902
|
+
p,
|
|
1903
|
+
null
|
|
1904
|
+
), s = t(p, i) || {}, D && (F.nodes_end = j, j === null || j.nodeType !== we || /** @type {Comment} */
|
|
1905
|
+
j.data !== "]"))
|
|
1906
|
+
throw xr(), Ie;
|
|
1907
|
+
o && vt();
|
|
1908
|
+
}
|
|
1909
|
+
), () => {
|
|
1910
|
+
for (var p of c) {
|
|
1911
|
+
e.removeEventListener(p, fr);
|
|
1912
|
+
var m = (
|
|
1913
|
+
/** @type {number} */
|
|
1914
|
+
je.get(p)
|
|
1915
|
+
);
|
|
1916
|
+
--m === 0 ? (document.removeEventListener(p, fr), je.delete(p)) : je.set(p, m);
|
|
1917
|
+
}
|
|
1918
|
+
si.delete(l), f !== r && f.parentNode?.removeChild(f);
|
|
1919
|
+
};
|
|
1920
|
+
});
|
|
1921
|
+
return li.set(s, d), s;
|
|
1922
|
+
}
|
|
1923
|
+
let li = /* @__PURE__ */ new WeakMap();
|
|
1924
|
+
function ka(t, e) {
|
|
1925
|
+
const r = li.get(t);
|
|
1926
|
+
return r ? (li.delete(t), r(e)) : Promise.resolve();
|
|
1927
|
+
}
|
|
1928
|
+
var oe, Xt, jt, _r, yr;
|
|
1929
|
+
class $i {
|
|
1930
|
+
/**
|
|
1931
|
+
* @param {TemplateNode} anchor
|
|
1932
|
+
* @param {boolean} transition
|
|
1933
|
+
*/
|
|
1934
|
+
constructor(e, r = !0) {
|
|
1935
|
+
/** @type {TemplateNode} */
|
|
1936
|
+
lt(this, "anchor");
|
|
1937
|
+
/** @type {Map<Batch, Key>} */
|
|
1938
|
+
B(this, oe, /* @__PURE__ */ new Map());
|
|
1939
|
+
/** @type {Map<Key, Effect>} */
|
|
1940
|
+
B(this, Xt, /* @__PURE__ */ new Map());
|
|
1941
|
+
/** @type {Map<Key, Branch>} */
|
|
1942
|
+
B(this, jt, /* @__PURE__ */ new Map());
|
|
1943
|
+
/**
|
|
1944
|
+
* Whether to pause (i.e. outro) on change, or destroy immediately.
|
|
1945
|
+
* This is necessary for `<svelte:element>`
|
|
1946
|
+
*/
|
|
1947
|
+
B(this, _r, !0);
|
|
1948
|
+
B(this, yr, () => {
|
|
1949
|
+
var e = (
|
|
1950
|
+
/** @type {Batch} */
|
|
1951
|
+
it
|
|
1952
|
+
);
|
|
1953
|
+
if (v(this, oe).has(e)) {
|
|
1954
|
+
var r = (
|
|
1955
|
+
/** @type {Key} */
|
|
1956
|
+
v(this, oe).get(e)
|
|
1957
|
+
), i = v(this, Xt).get(r);
|
|
1958
|
+
if (i)
|
|
1959
|
+
Si(i);
|
|
1960
|
+
else {
|
|
1961
|
+
var n = v(this, jt).get(r);
|
|
1962
|
+
n && (v(this, Xt).set(r, n.effect), v(this, jt).delete(r), n.fragment.lastChild.remove(), this.anchor.before(n.fragment), i = n.effect);
|
|
1963
|
+
}
|
|
1964
|
+
for (const [o, a] of v(this, oe)) {
|
|
1965
|
+
if (v(this, oe).delete(o), o === e)
|
|
1966
|
+
break;
|
|
1967
|
+
const c = v(this, jt).get(a);
|
|
1968
|
+
c && (_t(c.effect), v(this, jt).delete(a));
|
|
1969
|
+
}
|
|
1970
|
+
for (const [o, a] of v(this, Xt)) {
|
|
1971
|
+
if (o === r) continue;
|
|
1972
|
+
const c = () => {
|
|
1973
|
+
if (Array.from(v(this, oe).values()).includes(o)) {
|
|
1974
|
+
var s = document.createDocumentFragment();
|
|
1975
|
+
$n(a, s), s.append(Zt()), v(this, jt).set(o, { effect: a, fragment: s });
|
|
1976
|
+
} else
|
|
1977
|
+
_t(a);
|
|
1978
|
+
v(this, Xt).delete(o);
|
|
1979
|
+
};
|
|
1980
|
+
v(this, _r) || !i ? Ze(a, c, !1) : c();
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
});
|
|
1984
|
+
this.anchor = e, L(this, _r, r);
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
*
|
|
1988
|
+
* @param {any} key
|
|
1989
|
+
* @param {null | ((target: TemplateNode) => void)} fn
|
|
1990
|
+
*/
|
|
1991
|
+
ensure(e, r) {
|
|
1992
|
+
var i = (
|
|
1993
|
+
/** @type {Batch} */
|
|
1994
|
+
it
|
|
1995
|
+
), n = _n();
|
|
1996
|
+
if (r && !v(this, Xt).has(e) && !v(this, jt).has(e))
|
|
1997
|
+
if (n) {
|
|
1998
|
+
var o = document.createDocumentFragment(), a = Zt();
|
|
1999
|
+
o.append(a), v(this, jt).set(e, {
|
|
2000
|
+
effect: Ft(() => r(a)),
|
|
2001
|
+
fragment: o
|
|
2002
|
+
});
|
|
2003
|
+
} else
|
|
2004
|
+
v(this, Xt).set(
|
|
2005
|
+
e,
|
|
2006
|
+
Ft(() => r(this.anchor))
|
|
2007
|
+
);
|
|
2008
|
+
if (v(this, oe).set(i, e), n) {
|
|
2009
|
+
for (const [c, l] of v(this, Xt))
|
|
2010
|
+
c === e ? i.skipped_effects.delete(l) : i.skipped_effects.add(l);
|
|
2011
|
+
for (const [c, l] of v(this, jt))
|
|
2012
|
+
c === e ? i.skipped_effects.delete(l.effect) : i.skipped_effects.add(l.effect);
|
|
2013
|
+
i.add_callback(v(this, yr));
|
|
2014
|
+
} else
|
|
2015
|
+
D && (this.anchor = j), v(this, yr).call(this);
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
oe = new WeakMap(), Xt = new WeakMap(), jt = new WeakMap(), _r = new WeakMap(), yr = new WeakMap();
|
|
2019
|
+
function ci(t, e, ...r) {
|
|
2020
|
+
var i = new $i(t);
|
|
2021
|
+
ar(() => {
|
|
2022
|
+
const n = e() ?? null;
|
|
2023
|
+
i.ensure(n, n && ((o) => n(o, ...r)));
|
|
2024
|
+
}, or);
|
|
2025
|
+
}
|
|
2026
|
+
function z(t, e, r = !1) {
|
|
2027
|
+
D && Re();
|
|
2028
|
+
var i = new $i(t), n = r ? or : 0;
|
|
2029
|
+
function o(a, c) {
|
|
2030
|
+
if (D) {
|
|
2031
|
+
const s = Xi(t) === "[!";
|
|
2032
|
+
if (a === s) {
|
|
2033
|
+
var l = Fr();
|
|
2034
|
+
at(l), i.anchor = l, $t(!1), i.ensure(a, c), $t(!0);
|
|
2035
|
+
return;
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
i.ensure(a, c);
|
|
2039
|
+
}
|
|
2040
|
+
ar(() => {
|
|
2041
|
+
var a = !1;
|
|
2042
|
+
e((c, l = !0) => {
|
|
2043
|
+
a = !0, o(l, c);
|
|
2044
|
+
}), a || o(!1, null);
|
|
2045
|
+
}, n);
|
|
2046
|
+
}
|
|
2047
|
+
function ui(t, e) {
|
|
2048
|
+
return e;
|
|
2049
|
+
}
|
|
2050
|
+
function Ta(t, e, r) {
|
|
2051
|
+
for (var i = t.items, n = [], o = e.length, a = 0; a < o; a++)
|
|
2052
|
+
Ai(e[a].e, n, !0);
|
|
2053
|
+
var c = o > 0 && n.length === 0 && r !== null;
|
|
2054
|
+
if (c) {
|
|
2055
|
+
var l = (
|
|
2056
|
+
/** @type {Element} */
|
|
2057
|
+
/** @type {Element} */
|
|
2058
|
+
r.parentNode
|
|
2059
|
+
);
|
|
2060
|
+
bn(l), l.append(
|
|
2061
|
+
/** @type {Element} */
|
|
2062
|
+
r
|
|
2063
|
+
), i.clear(), Wt(t, e[0].prev, e[o - 1].next);
|
|
2064
|
+
}
|
|
2065
|
+
Sn(n, () => {
|
|
2066
|
+
for (var s = 0; s < o; s++) {
|
|
2067
|
+
var d = e[s];
|
|
2068
|
+
c || (i.delete(d.k), Wt(t, d.prev, d.next)), _t(d.e, !c);
|
|
2069
|
+
}
|
|
2070
|
+
});
|
|
2071
|
+
}
|
|
2072
|
+
function di(t, e, r, i, n, o = null) {
|
|
2073
|
+
var a = t, c = { flags: e, items: /* @__PURE__ */ new Map(), first: null }, l = (e & 4) !== 0;
|
|
2074
|
+
if (l) {
|
|
2075
|
+
var s = (
|
|
2076
|
+
/** @type {Element} */
|
|
2077
|
+
t
|
|
2078
|
+
);
|
|
2079
|
+
a = D ? at(
|
|
2080
|
+
/** @type {Comment | Text} */
|
|
2081
|
+
/* @__PURE__ */ Tt(s)
|
|
2082
|
+
) : s.appendChild(Zt());
|
|
2083
|
+
}
|
|
2084
|
+
D && Re();
|
|
2085
|
+
var d = null, f = !1, p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ ea(() => {
|
|
2086
|
+
var I = r();
|
|
2087
|
+
return mi(I) ? I : I == null ? [] : gi(I);
|
|
2088
|
+
}), h, w;
|
|
2089
|
+
function b() {
|
|
2090
|
+
Ea(
|
|
2091
|
+
w,
|
|
2092
|
+
h,
|
|
2093
|
+
c,
|
|
2094
|
+
p,
|
|
2095
|
+
a,
|
|
2096
|
+
n,
|
|
2097
|
+
e,
|
|
2098
|
+
i,
|
|
2099
|
+
r
|
|
2100
|
+
), o !== null && (h.length === 0 ? d ? Si(d) : d = Ft(() => o(a)) : d !== null && Ze(d, () => {
|
|
2101
|
+
d = null;
|
|
2102
|
+
}));
|
|
2103
|
+
}
|
|
2104
|
+
ar(() => {
|
|
2105
|
+
w ?? (w = /** @type {Effect} */
|
|
2106
|
+
F), h = /** @type {V[]} */
|
|
2107
|
+
u(m);
|
|
2108
|
+
var I = h.length;
|
|
2109
|
+
if (f && I === 0)
|
|
2110
|
+
return;
|
|
2111
|
+
f = I === 0;
|
|
2112
|
+
let y = !1;
|
|
2113
|
+
if (D) {
|
|
2114
|
+
var V = Xi(a) === "[!";
|
|
2115
|
+
V !== (I === 0) && (a = Fr(), at(a), $t(!1), y = !0);
|
|
2116
|
+
}
|
|
2117
|
+
if (D) {
|
|
2118
|
+
for (var E = null, _, g = 0; g < I; g++) {
|
|
2119
|
+
if (j.nodeType === we && /** @type {Comment} */
|
|
2120
|
+
j.data === "]") {
|
|
2121
|
+
a = /** @type {Comment} */
|
|
2122
|
+
j, y = !0, $t(!1);
|
|
2123
|
+
break;
|
|
2124
|
+
}
|
|
2125
|
+
var x = h[g], R = i(x, g);
|
|
2126
|
+
_ = fi(
|
|
2127
|
+
j,
|
|
2128
|
+
c,
|
|
2129
|
+
E,
|
|
2130
|
+
null,
|
|
2131
|
+
x,
|
|
2132
|
+
R,
|
|
2133
|
+
g,
|
|
2134
|
+
n,
|
|
2135
|
+
e,
|
|
2136
|
+
r
|
|
2137
|
+
), c.items.set(R, _), E = _;
|
|
2138
|
+
}
|
|
2139
|
+
I > 0 && at(Fr());
|
|
2140
|
+
}
|
|
2141
|
+
if (D)
|
|
2142
|
+
I === 0 && o && (d = Ft(() => o(a)));
|
|
2143
|
+
else if (_n()) {
|
|
2144
|
+
var K = /* @__PURE__ */ new Set(), k = (
|
|
2145
|
+
/** @type {Batch} */
|
|
2146
|
+
it
|
|
2147
|
+
);
|
|
2148
|
+
for (g = 0; g < I; g += 1) {
|
|
2149
|
+
x = h[g], R = i(x, g);
|
|
2150
|
+
var M = c.items.get(R) ?? p.get(R);
|
|
2151
|
+
M ? (e & 3) !== 0 && Bn(M, x, g, e) : (_ = fi(
|
|
2152
|
+
null,
|
|
2153
|
+
c,
|
|
2154
|
+
null,
|
|
2155
|
+
null,
|
|
2156
|
+
x,
|
|
2157
|
+
R,
|
|
2158
|
+
g,
|
|
2159
|
+
n,
|
|
2160
|
+
e,
|
|
2161
|
+
r,
|
|
2162
|
+
!0
|
|
2163
|
+
), p.set(R, _)), K.add(R);
|
|
2164
|
+
}
|
|
2165
|
+
for (const [Y, X] of c.items)
|
|
2166
|
+
K.has(Y) || k.skipped_effects.add(X.e);
|
|
2167
|
+
k.add_callback(b);
|
|
2168
|
+
} else
|
|
2169
|
+
b();
|
|
2170
|
+
y && $t(!0), u(m);
|
|
2171
|
+
}), D && (a = j);
|
|
2172
|
+
}
|
|
2173
|
+
function Ea(t, e, r, i, n, o, a, c, l) {
|
|
2174
|
+
var s = (a & 8) !== 0, d = (a & 3) !== 0, f = e.length, p = r.items, m = r.first, h = m, w, b = null, I, y = [], V = [], E, _, g, x;
|
|
2175
|
+
if (s)
|
|
2176
|
+
for (x = 0; x < f; x += 1)
|
|
2177
|
+
E = e[x], _ = c(E, x), g = p.get(_), g !== void 0 && (g.a?.measure(), (I ?? (I = /* @__PURE__ */ new Set())).add(g));
|
|
2178
|
+
for (x = 0; x < f; x += 1) {
|
|
2179
|
+
if (E = e[x], _ = c(E, x), g = p.get(_), g === void 0) {
|
|
2180
|
+
var R = i.get(_);
|
|
2181
|
+
if (R !== void 0) {
|
|
2182
|
+
i.delete(_), p.set(_, R);
|
|
2183
|
+
var K = b ? b.next : h;
|
|
2184
|
+
Wt(r, b, R), Wt(r, R, K), Wr(R, K, n), b = R;
|
|
2185
|
+
} else {
|
|
2186
|
+
var k = h ? (
|
|
2187
|
+
/** @type {TemplateNode} */
|
|
2188
|
+
h.e.nodes_start
|
|
2189
|
+
) : n;
|
|
2190
|
+
b = fi(
|
|
2191
|
+
k,
|
|
2192
|
+
r,
|
|
2193
|
+
b,
|
|
2194
|
+
b === null ? r.first : b.next,
|
|
2195
|
+
E,
|
|
2196
|
+
_,
|
|
2197
|
+
x,
|
|
2198
|
+
o,
|
|
2199
|
+
a,
|
|
2200
|
+
l
|
|
2201
|
+
);
|
|
2202
|
+
}
|
|
2203
|
+
p.set(_, b), y = [], V = [], h = b.next;
|
|
2204
|
+
continue;
|
|
2205
|
+
}
|
|
2206
|
+
if (d && Bn(g, E, x, a), (g.e.f & Ut) !== 0 && (Si(g.e), s && (g.a?.unfix(), (I ?? (I = /* @__PURE__ */ new Set())).delete(g))), g !== h) {
|
|
2207
|
+
if (w !== void 0 && w.has(g)) {
|
|
2208
|
+
if (y.length < V.length) {
|
|
2209
|
+
var M = V[0], Y;
|
|
2210
|
+
b = M.prev;
|
|
2211
|
+
var X = y[0], W = y[y.length - 1];
|
|
2212
|
+
for (Y = 0; Y < y.length; Y += 1)
|
|
2213
|
+
Wr(y[Y], M, n);
|
|
2214
|
+
for (Y = 0; Y < V.length; Y += 1)
|
|
2215
|
+
w.delete(V[Y]);
|
|
2216
|
+
Wt(r, X.prev, W.next), Wt(r, b, X), Wt(r, W, M), h = M, b = W, x -= 1, y = [], V = [];
|
|
2217
|
+
} else
|
|
2218
|
+
w.delete(g), Wr(g, h, n), Wt(r, g.prev, g.next), Wt(r, g, b === null ? r.first : b.next), Wt(r, b, g), b = g;
|
|
2219
|
+
continue;
|
|
2220
|
+
}
|
|
2221
|
+
for (y = [], V = []; h !== null && h.k !== _; )
|
|
2222
|
+
(h.e.f & Ut) === 0 && (w ?? (w = /* @__PURE__ */ new Set())).add(h), V.push(h), h = h.next;
|
|
2223
|
+
if (h === null)
|
|
2224
|
+
continue;
|
|
2225
|
+
g = h;
|
|
2226
|
+
}
|
|
2227
|
+
y.push(g), b = g, h = g.next;
|
|
2228
|
+
}
|
|
2229
|
+
if (h !== null || w !== void 0) {
|
|
2230
|
+
for (var P = w === void 0 ? [] : gi(w); h !== null; )
|
|
2231
|
+
(h.e.f & Ut) === 0 && P.push(h), h = h.next;
|
|
2232
|
+
var Z = P.length;
|
|
2233
|
+
if (Z > 0) {
|
|
2234
|
+
var At = (a & 4) !== 0 && f === 0 ? n : null;
|
|
2235
|
+
if (s) {
|
|
2236
|
+
for (x = 0; x < Z; x += 1)
|
|
2237
|
+
P[x].a?.measure();
|
|
2238
|
+
for (x = 0; x < Z; x += 1)
|
|
2239
|
+
P[x].a?.fix();
|
|
2240
|
+
}
|
|
2241
|
+
Ta(r, P, At);
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
s && rr(() => {
|
|
2245
|
+
if (I !== void 0)
|
|
2246
|
+
for (g of I)
|
|
2247
|
+
g.a?.apply();
|
|
2248
|
+
}), t.first = r.first && r.first.e, t.last = b && b.e;
|
|
2249
|
+
for (var J of i.values())
|
|
2250
|
+
_t(J.e);
|
|
2251
|
+
i.clear();
|
|
2252
|
+
}
|
|
2253
|
+
function Bn(t, e, r, i) {
|
|
2254
|
+
(i & 1) !== 0 && nr(t.v, e), (i & 2) !== 0 ? nr(
|
|
2255
|
+
/** @type {Value<number>} */
|
|
2256
|
+
t.i,
|
|
2257
|
+
r
|
|
2258
|
+
) : t.i = r;
|
|
2259
|
+
}
|
|
2260
|
+
function fi(t, e, r, i, n, o, a, c, l, s, d) {
|
|
2261
|
+
var f = (l & 1) !== 0, p = (l & 16) === 0, m = f ? p ? /* @__PURE__ */ hn(n, !1, !1) : Oe(n) : n, h = (l & 2) === 0 ? a : Oe(a), w = {
|
|
2262
|
+
i: h,
|
|
2263
|
+
v: m,
|
|
2264
|
+
k: o,
|
|
2265
|
+
a: null,
|
|
2266
|
+
// @ts-expect-error
|
|
2267
|
+
e: null,
|
|
2268
|
+
prev: r,
|
|
2269
|
+
next: i
|
|
2270
|
+
};
|
|
2271
|
+
try {
|
|
2272
|
+
if (t === null) {
|
|
2273
|
+
var b = document.createDocumentFragment();
|
|
2274
|
+
b.append(t = Zt());
|
|
2275
|
+
}
|
|
2276
|
+
return w.e = Ft(() => c(
|
|
2277
|
+
/** @type {Node} */
|
|
2278
|
+
t,
|
|
2279
|
+
m,
|
|
2280
|
+
h,
|
|
2281
|
+
s
|
|
2282
|
+
), D), w.e.prev = r && r.e, w.e.next = i && i.e, r === null ? d || (e.first = w) : (r.next = w, r.e.next = w.e), i !== null && (i.prev = w, i.e.prev = w.e), w;
|
|
2283
|
+
} finally {
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
function Wr(t, e, r) {
|
|
2287
|
+
for (var i = t.next ? (
|
|
2288
|
+
/** @type {TemplateNode} */
|
|
2289
|
+
t.next.e.nodes_start
|
|
2290
|
+
) : r, n = e ? (
|
|
2291
|
+
/** @type {TemplateNode} */
|
|
2292
|
+
e.e.nodes_start
|
|
2293
|
+
) : r, o = (
|
|
2294
|
+
/** @type {TemplateNode} */
|
|
2295
|
+
t.e.nodes_start
|
|
2296
|
+
); o !== null && o !== i; ) {
|
|
2297
|
+
var a = (
|
|
2298
|
+
/** @type {TemplateNode} */
|
|
2299
|
+
/* @__PURE__ */ It(o)
|
|
2300
|
+
);
|
|
2301
|
+
n.before(o), o = a;
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
function Wt(t, e, r) {
|
|
2305
|
+
e === null ? t.first = r : (e.next = r, e.e.next = r && r.e), r !== null && (r.prev = e, r.e.prev = e && e.e);
|
|
2306
|
+
}
|
|
2307
|
+
function Vn(t, e, r = !1, i = !1, n = !1) {
|
|
2308
|
+
var o = t, a = "";
|
|
2309
|
+
rt(() => {
|
|
2310
|
+
var c = (
|
|
2311
|
+
/** @type {Effect} */
|
|
2312
|
+
F
|
|
2313
|
+
);
|
|
2314
|
+
if (a === (a = e() ?? "")) {
|
|
2315
|
+
D && Re();
|
|
2316
|
+
return;
|
|
2317
|
+
}
|
|
2318
|
+
if (c.nodes_start !== null && (En(
|
|
2319
|
+
c.nodes_start,
|
|
2320
|
+
/** @type {TemplateNode} */
|
|
2321
|
+
c.nodes_end
|
|
2322
|
+
), c.nodes_start = c.nodes_end = null), a !== "") {
|
|
2323
|
+
if (D) {
|
|
2324
|
+
for (var l = Re(), s = l; l !== null && (l.nodeType !== we || /** @type {Comment} */
|
|
2325
|
+
l.data !== ""); )
|
|
2326
|
+
s = l, l = /** @type {TemplateNode} */
|
|
2327
|
+
/* @__PURE__ */ It(l);
|
|
2328
|
+
if (l === null)
|
|
2329
|
+
throw xr(), Ie;
|
|
2330
|
+
ee(j, s), o = at(l);
|
|
2331
|
+
return;
|
|
2332
|
+
}
|
|
2333
|
+
var d = a + "";
|
|
2334
|
+
r ? d = `<svg>${d}</svg>` : i && (d = `<math>${d}</math>`);
|
|
2335
|
+
var f = Mi(d);
|
|
2336
|
+
if ((r || i) && (f = /** @type {Element} */
|
|
2337
|
+
/* @__PURE__ */ Tt(f)), ee(
|
|
2338
|
+
/** @type {TemplateNode} */
|
|
2339
|
+
/* @__PURE__ */ Tt(f),
|
|
2340
|
+
/** @type {TemplateNode} */
|
|
2341
|
+
f.lastChild
|
|
2342
|
+
), r || i)
|
|
2343
|
+
for (; /* @__PURE__ */ Tt(f); )
|
|
2344
|
+
o.before(
|
|
2345
|
+
/** @type {Node} */
|
|
2346
|
+
/* @__PURE__ */ Tt(f)
|
|
2347
|
+
);
|
|
2348
|
+
else
|
|
2349
|
+
o.before(f);
|
|
2350
|
+
}
|
|
2351
|
+
});
|
|
2352
|
+
}
|
|
2353
|
+
function Aa(t, e, r) {
|
|
2354
|
+
D && Re();
|
|
2355
|
+
var i = new $i(t);
|
|
2356
|
+
ar(() => {
|
|
2357
|
+
var n = e() ?? null;
|
|
2358
|
+
i.ensure(n, n && ((o) => r(o, n)));
|
|
2359
|
+
}, or);
|
|
2360
|
+
}
|
|
2361
|
+
function Un(t, e) {
|
|
2362
|
+
ca(() => {
|
|
2363
|
+
var r = t.getRootNode(), i = (
|
|
2364
|
+
/** @type {ShadowRoot} */
|
|
2365
|
+
r.host ? (
|
|
2366
|
+
/** @type {ShadowRoot} */
|
|
2367
|
+
r
|
|
2368
|
+
) : (
|
|
2369
|
+
/** @type {Document} */
|
|
2370
|
+
r.head ?? /** @type {Document} */
|
|
2371
|
+
r.ownerDocument.head
|
|
2372
|
+
)
|
|
2373
|
+
);
|
|
2374
|
+
if (!i.querySelector("#" + e.hash)) {
|
|
2375
|
+
const n = document.createElement("style");
|
|
2376
|
+
n.id = e.hash, n.textContent = e.code, i.appendChild(n);
|
|
2377
|
+
}
|
|
2378
|
+
});
|
|
2379
|
+
}
|
|
2380
|
+
function Yn(t) {
|
|
2381
|
+
var e, r, i = "";
|
|
2382
|
+
if (typeof t == "string" || typeof t == "number") i += t;
|
|
2383
|
+
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
2384
|
+
var n = t.length;
|
|
2385
|
+
for (e = 0; e < n; e++) t[e] && (r = Yn(t[e])) && (i && (i += " "), i += r);
|
|
2386
|
+
} else for (r in t) t[r] && (i && (i += " "), i += r);
|
|
2387
|
+
return i;
|
|
2388
|
+
}
|
|
2389
|
+
function Sa() {
|
|
2390
|
+
for (var t, e, r = 0, i = "", n = arguments.length; r < n; r++) (t = arguments[r]) && (e = Yn(t)) && (i && (i += " "), i += e);
|
|
2391
|
+
return i;
|
|
2392
|
+
}
|
|
2393
|
+
function Yt(t) {
|
|
2394
|
+
return typeof t == "object" ? Sa(t) : t ?? "";
|
|
2395
|
+
}
|
|
2396
|
+
function Ma(t, e, r) {
|
|
2397
|
+
var i = t == null ? "" : "" + t;
|
|
2398
|
+
return e && (i = i ? i + " " + e : e), i === "" ? null : i;
|
|
2399
|
+
}
|
|
2400
|
+
function $a(t, e) {
|
|
2401
|
+
return t == null ? null : String(t);
|
|
2402
|
+
}
|
|
2403
|
+
function pt(t, e, r, i, n, o) {
|
|
2404
|
+
var a = t.__className;
|
|
2405
|
+
if (D || a !== r || a === void 0) {
|
|
2406
|
+
var c = Ma(r, i);
|
|
2407
|
+
(!D || c !== t.getAttribute("class")) && (c == null ? t.removeAttribute("class") : e ? t.className = c : t.setAttribute("class", c)), t.__className = r;
|
|
2408
|
+
}
|
|
2409
|
+
return o;
|
|
2410
|
+
}
|
|
2411
|
+
function Qr(t, e, r, i) {
|
|
2412
|
+
var n = t.__style;
|
|
2413
|
+
if (D || n !== e) {
|
|
2414
|
+
var o = $a(e);
|
|
2415
|
+
(!D || o !== t.getAttribute("style")) && (o == null ? t.removeAttribute("style") : t.style.cssText = o), t.__style = e;
|
|
2416
|
+
}
|
|
2417
|
+
return i;
|
|
2418
|
+
}
|
|
2419
|
+
const La = Symbol("is custom element"), Ia = Symbol("is html");
|
|
2420
|
+
function G(t, e, r, i) {
|
|
2421
|
+
var n = Ra(t);
|
|
2422
|
+
D && (n[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === "LINK") || n[e] !== (n[e] = r) && (e === "loading" && (t[Io] = r), r == null ? t.removeAttribute(e) : typeof r != "string" && Da(t).includes(e) ? t[e] = r : t.setAttribute(e, r));
|
|
2423
|
+
}
|
|
2424
|
+
function Ra(t) {
|
|
2425
|
+
return (
|
|
2426
|
+
/** @type {Record<string | symbol, unknown>} **/
|
|
2427
|
+
// @ts-expect-error
|
|
2428
|
+
t.__attributes ?? (t.__attributes = {
|
|
2429
|
+
[La]: t.nodeName.includes("-"),
|
|
2430
|
+
[Ia]: t.namespaceURI === ko
|
|
2431
|
+
})
|
|
2432
|
+
);
|
|
2433
|
+
}
|
|
2434
|
+
var Ui = /* @__PURE__ */ new Map();
|
|
2435
|
+
function Da(t) {
|
|
2436
|
+
var e = t.getAttribute("is") || t.nodeName, r = Ui.get(e);
|
|
2437
|
+
if (r) return r;
|
|
2438
|
+
Ui.set(e, r = []);
|
|
2439
|
+
for (var i, n = t, o = Element.prototype; o !== n; ) {
|
|
2440
|
+
i = Eo(n);
|
|
2441
|
+
for (var a in i)
|
|
2442
|
+
i[a].set && r.push(a);
|
|
2443
|
+
n = Qi(n);
|
|
2444
|
+
}
|
|
2445
|
+
return r;
|
|
2446
|
+
}
|
|
2447
|
+
function Oa(t, e, r) {
|
|
2448
|
+
if (t == null)
|
|
2449
|
+
return e(void 0), Me;
|
|
2450
|
+
const i = Fn(
|
|
2451
|
+
() => t.subscribe(
|
|
2452
|
+
e,
|
|
2453
|
+
// @ts-expect-error
|
|
2454
|
+
r
|
|
2455
|
+
)
|
|
2456
|
+
);
|
|
2457
|
+
return i.unsubscribe ? () => i.unsubscribe() : i;
|
|
2458
|
+
}
|
|
2459
|
+
const Be = [];
|
|
2460
|
+
function Cr(t, e = Me) {
|
|
2461
|
+
let r = null;
|
|
2462
|
+
const i = /* @__PURE__ */ new Set();
|
|
2463
|
+
function n(c) {
|
|
2464
|
+
if (tn(t, c) && (t = c, r)) {
|
|
2465
|
+
const l = !Be.length;
|
|
2466
|
+
for (const s of i)
|
|
2467
|
+
s[1](), Be.push(s, t);
|
|
2468
|
+
if (l) {
|
|
2469
|
+
for (let s = 0; s < Be.length; s += 2)
|
|
2470
|
+
Be[s][0](Be[s + 1]);
|
|
2471
|
+
Be.length = 0;
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
function o(c) {
|
|
2476
|
+
n(c(
|
|
2477
|
+
/** @type {T} */
|
|
2478
|
+
t
|
|
2479
|
+
));
|
|
2480
|
+
}
|
|
2481
|
+
function a(c, l = Me) {
|
|
2482
|
+
const s = [c, l];
|
|
2483
|
+
return i.add(s), i.size === 1 && (r = e(n, o) || Me), c(
|
|
2484
|
+
/** @type {T} */
|
|
2485
|
+
t
|
|
2486
|
+
), () => {
|
|
2487
|
+
i.delete(s), i.size === 0 && r && (r(), r = null);
|
|
2488
|
+
};
|
|
2489
|
+
}
|
|
2490
|
+
return { set: n, update: o, subscribe: a };
|
|
2491
|
+
}
|
|
2492
|
+
function sr(t) {
|
|
2493
|
+
let e;
|
|
2494
|
+
return Oa(t, (r) => e = r)(), e;
|
|
2495
|
+
}
|
|
2496
|
+
function A(t, e, r, i) {
|
|
2497
|
+
var n = (
|
|
2498
|
+
/** @type {V} */
|
|
2499
|
+
i
|
|
2500
|
+
), o = !0, a = () => (o && (o = !1, n = /** @type {V} */
|
|
2501
|
+
i), n), c;
|
|
2502
|
+
c = /** @type {V} */
|
|
2503
|
+
t[e], c === void 0 && i !== void 0 && (c = a());
|
|
2504
|
+
var l;
|
|
2505
|
+
l = () => {
|
|
2506
|
+
var p = (
|
|
2507
|
+
/** @type {V} */
|
|
2508
|
+
t[e]
|
|
2509
|
+
);
|
|
2510
|
+
return p === void 0 ? a() : (o = !0, p);
|
|
2511
|
+
};
|
|
2512
|
+
var s = !1, d = /* @__PURE__ */ Vr(() => (s = !1, l())), f = (
|
|
2513
|
+
/** @type {Effect} */
|
|
2514
|
+
F
|
|
2515
|
+
);
|
|
2516
|
+
return (
|
|
2517
|
+
/** @type {() => V} */
|
|
2518
|
+
(function(p, m) {
|
|
2519
|
+
if (arguments.length > 0) {
|
|
2520
|
+
const h = m ? u(d) : p;
|
|
2521
|
+
return Q(d, h), s = !0, n !== void 0 && (n = h), p;
|
|
2522
|
+
}
|
|
2523
|
+
return qe && s || (f.f & Fe) !== 0 ? d.v : u(d);
|
|
2524
|
+
})
|
|
2525
|
+
);
|
|
2526
|
+
}
|
|
2527
|
+
function Na(t) {
|
|
2528
|
+
return new Fa(t);
|
|
2529
|
+
}
|
|
2530
|
+
var ae, Nt;
|
|
2531
|
+
class Fa {
|
|
2532
|
+
/**
|
|
2533
|
+
* @param {ComponentConstructorOptions & {
|
|
2534
|
+
* component: any;
|
|
2535
|
+
* }} options
|
|
2536
|
+
*/
|
|
2537
|
+
constructor(e) {
|
|
2538
|
+
/** @type {any} */
|
|
2539
|
+
B(this, ae);
|
|
2540
|
+
/** @type {Record<string, any>} */
|
|
2541
|
+
B(this, Nt);
|
|
2542
|
+
var r = /* @__PURE__ */ new Map(), i = (o, a) => {
|
|
2543
|
+
var c = /* @__PURE__ */ hn(a, !1, !1);
|
|
2544
|
+
return r.set(o, c), c;
|
|
2545
|
+
};
|
|
2546
|
+
const n = new Proxy(
|
|
2547
|
+
{ ...e.props || {}, $$events: {} },
|
|
2548
|
+
{
|
|
2549
|
+
get(o, a) {
|
|
2550
|
+
return u(r.get(a) ?? i(a, Reflect.get(o, a)));
|
|
2551
|
+
},
|
|
2552
|
+
has(o, a) {
|
|
2553
|
+
return a === Lo ? !0 : (u(r.get(a) ?? i(a, Reflect.get(o, a))), Reflect.has(o, a));
|
|
2554
|
+
},
|
|
2555
|
+
set(o, a, c) {
|
|
2556
|
+
return Q(r.get(a) ?? i(a, c), c), Reflect.set(o, a, c);
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
);
|
|
2560
|
+
L(this, Nt, (e.hydrate ? Ca : zn)(e.component, {
|
|
2561
|
+
target: e.target,
|
|
2562
|
+
anchor: e.anchor,
|
|
2563
|
+
props: n,
|
|
2564
|
+
context: e.context,
|
|
2565
|
+
intro: e.intro ?? !1,
|
|
2566
|
+
recover: e.recover
|
|
2567
|
+
})), (!e?.props?.$$host || e.sync === !1) && T(), L(this, ae, n.$$events);
|
|
2568
|
+
for (const o of Object.keys(v(this, Nt)))
|
|
2569
|
+
o === "$set" || o === "$destroy" || o === "$on" || tr(this, o, {
|
|
2570
|
+
get() {
|
|
2571
|
+
return v(this, Nt)[o];
|
|
2572
|
+
},
|
|
2573
|
+
/** @param {any} value */
|
|
2574
|
+
set(a) {
|
|
2575
|
+
v(this, Nt)[o] = a;
|
|
2576
|
+
},
|
|
2577
|
+
enumerable: !0
|
|
2578
|
+
});
|
|
2579
|
+
v(this, Nt).$set = /** @param {Record<string, any>} next */
|
|
2580
|
+
(o) => {
|
|
2581
|
+
Object.assign(n, o);
|
|
2582
|
+
}, v(this, Nt).$destroy = () => {
|
|
2583
|
+
ka(v(this, Nt));
|
|
2584
|
+
};
|
|
2585
|
+
}
|
|
2586
|
+
/** @param {Record<string, any>} props */
|
|
2587
|
+
$set(e) {
|
|
2588
|
+
v(this, Nt).$set(e);
|
|
2589
|
+
}
|
|
2590
|
+
/**
|
|
2591
|
+
* @param {string} event
|
|
2592
|
+
* @param {(...args: any[]) => any} callback
|
|
2593
|
+
* @returns {any}
|
|
2594
|
+
*/
|
|
2595
|
+
$on(e, r) {
|
|
2596
|
+
v(this, ae)[e] = v(this, ae)[e] || [];
|
|
2597
|
+
const i = (...n) => r.call(this, ...n);
|
|
2598
|
+
return v(this, ae)[e].push(i), () => {
|
|
2599
|
+
v(this, ae)[e] = v(this, ae)[e].filter(
|
|
2600
|
+
/** @param {any} fn */
|
|
2601
|
+
(n) => n !== i
|
|
2602
|
+
);
|
|
2603
|
+
};
|
|
2604
|
+
}
|
|
2605
|
+
$destroy() {
|
|
2606
|
+
v(this, Nt).$destroy();
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
ae = new WeakMap(), Nt = new WeakMap();
|
|
2610
|
+
let Zn;
|
|
2611
|
+
typeof HTMLElement == "function" && (Zn = class extends HTMLElement {
|
|
2612
|
+
/**
|
|
2613
|
+
* @param {*} $$componentCtor
|
|
2614
|
+
* @param {*} $$slots
|
|
2615
|
+
* @param {*} use_shadow_dom
|
|
2616
|
+
*/
|
|
2617
|
+
constructor(e, r, i) {
|
|
2618
|
+
super();
|
|
2619
|
+
/** The Svelte component constructor */
|
|
2620
|
+
lt(this, "$$ctor");
|
|
2621
|
+
/** Slots */
|
|
2622
|
+
lt(this, "$$s");
|
|
2623
|
+
/** @type {any} The Svelte component instance */
|
|
2624
|
+
lt(this, "$$c");
|
|
2625
|
+
/** Whether or not the custom element is connected */
|
|
2626
|
+
lt(this, "$$cn", !1);
|
|
2627
|
+
/** @type {Record<string, any>} Component props data */
|
|
2628
|
+
lt(this, "$$d", {});
|
|
2629
|
+
/** `true` if currently in the process of reflecting component props back to attributes */
|
|
2630
|
+
lt(this, "$$r", !1);
|
|
2631
|
+
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
|
|
2632
|
+
lt(this, "$$p_d", {});
|
|
2633
|
+
/** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */
|
|
2634
|
+
lt(this, "$$l", {});
|
|
2635
|
+
/** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */
|
|
2636
|
+
lt(this, "$$l_u", /* @__PURE__ */ new Map());
|
|
2637
|
+
/** @type {any} The managed render effect for reflecting attributes */
|
|
2638
|
+
lt(this, "$$me");
|
|
2639
|
+
this.$$ctor = e, this.$$s = r, i && this.attachShadow({ mode: "open" });
|
|
2640
|
+
}
|
|
2641
|
+
/**
|
|
2642
|
+
* @param {string} type
|
|
2643
|
+
* @param {EventListenerOrEventListenerObject} listener
|
|
2644
|
+
* @param {boolean | AddEventListenerOptions} [options]
|
|
2645
|
+
*/
|
|
2646
|
+
addEventListener(e, r, i) {
|
|
2647
|
+
if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(r), this.$$c) {
|
|
2648
|
+
const n = this.$$c.$on(e, r);
|
|
2649
|
+
this.$$l_u.set(r, n);
|
|
2650
|
+
}
|
|
2651
|
+
super.addEventListener(e, r, i);
|
|
2652
|
+
}
|
|
2653
|
+
/**
|
|
2654
|
+
* @param {string} type
|
|
2655
|
+
* @param {EventListenerOrEventListenerObject} listener
|
|
2656
|
+
* @param {boolean | AddEventListenerOptions} [options]
|
|
2657
|
+
*/
|
|
2658
|
+
removeEventListener(e, r, i) {
|
|
2659
|
+
if (super.removeEventListener(e, r, i), this.$$c) {
|
|
2660
|
+
const n = this.$$l_u.get(r);
|
|
2661
|
+
n && (n(), this.$$l_u.delete(r));
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
async connectedCallback() {
|
|
2665
|
+
if (this.$$cn = !0, !this.$$c) {
|
|
2666
|
+
let e = function(n) {
|
|
2667
|
+
return (o) => {
|
|
2668
|
+
const a = document.createElement("slot");
|
|
2669
|
+
n !== "default" && (a.name = n), C(o, a);
|
|
2670
|
+
};
|
|
2671
|
+
};
|
|
2672
|
+
if (await Promise.resolve(), !this.$$cn || this.$$c)
|
|
2673
|
+
return;
|
|
2674
|
+
const r = {}, i = Pa(this);
|
|
2675
|
+
for (const n of this.$$s)
|
|
2676
|
+
n in i && (n === "default" && !this.$$d.children ? (this.$$d.children = e(n), r.default = !0) : r[n] = e(n));
|
|
2677
|
+
for (const n of this.attributes) {
|
|
2678
|
+
const o = this.$$g_p(n.name);
|
|
2679
|
+
o in this.$$d || (this.$$d[o] = Dr(o, n.value, this.$$p_d, "toProp"));
|
|
2680
|
+
}
|
|
2681
|
+
for (const n in this.$$p_d)
|
|
2682
|
+
!(n in this.$$d) && this[n] !== void 0 && (this.$$d[n] = this[n], delete this[n]);
|
|
2683
|
+
this.$$c = Na({
|
|
2684
|
+
component: this.$$ctor,
|
|
2685
|
+
target: this.shadowRoot || this,
|
|
2686
|
+
props: {
|
|
2687
|
+
...this.$$d,
|
|
2688
|
+
$$slots: r,
|
|
2689
|
+
$$host: this
|
|
2690
|
+
}
|
|
2691
|
+
}), this.$$me = sa(() => {
|
|
2692
|
+
Cn(() => {
|
|
2693
|
+
this.$$r = !0;
|
|
2694
|
+
for (const n of Or(this.$$c)) {
|
|
2695
|
+
if (!this.$$p_d[n]?.reflect) continue;
|
|
2696
|
+
this.$$d[n] = this.$$c[n];
|
|
2697
|
+
const o = Dr(
|
|
2698
|
+
n,
|
|
2699
|
+
this.$$d[n],
|
|
2700
|
+
this.$$p_d,
|
|
2701
|
+
"toAttribute"
|
|
2702
|
+
);
|
|
2703
|
+
o == null ? this.removeAttribute(this.$$p_d[n].attribute || n) : this.setAttribute(this.$$p_d[n].attribute || n, o);
|
|
2704
|
+
}
|
|
2705
|
+
this.$$r = !1;
|
|
2706
|
+
});
|
|
2707
|
+
});
|
|
2708
|
+
for (const n in this.$$l)
|
|
2709
|
+
for (const o of this.$$l[n]) {
|
|
2710
|
+
const a = this.$$c.$on(n, o);
|
|
2711
|
+
this.$$l_u.set(o, a);
|
|
2712
|
+
}
|
|
2713
|
+
this.$$l = {};
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
|
|
2717
|
+
// and setting attributes through setAttribute etc, this is helpful
|
|
2718
|
+
/**
|
|
2719
|
+
* @param {string} attr
|
|
2720
|
+
* @param {string} _oldValue
|
|
2721
|
+
* @param {string} newValue
|
|
2722
|
+
*/
|
|
2723
|
+
attributeChangedCallback(e, r, i) {
|
|
2724
|
+
this.$$r || (e = this.$$g_p(e), this.$$d[e] = Dr(e, i, this.$$p_d, "toProp"), this.$$c?.$set({ [e]: this.$$d[e] }));
|
|
2725
|
+
}
|
|
2726
|
+
disconnectedCallback() {
|
|
2727
|
+
this.$$cn = !1, Promise.resolve().then(() => {
|
|
2728
|
+
!this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0);
|
|
2729
|
+
});
|
|
2730
|
+
}
|
|
2731
|
+
/**
|
|
2732
|
+
* @param {string} attribute_name
|
|
2733
|
+
*/
|
|
2734
|
+
$$g_p(e) {
|
|
2735
|
+
return Or(this.$$p_d).find(
|
|
2736
|
+
(r) => this.$$p_d[r].attribute === e || !this.$$p_d[r].attribute && r.toLowerCase() === e
|
|
2737
|
+
) || e;
|
|
2738
|
+
}
|
|
2739
|
+
});
|
|
2740
|
+
function Dr(t, e, r, i) {
|
|
2741
|
+
const n = r[t]?.type;
|
|
2742
|
+
if (e = n === "Boolean" && typeof e != "boolean" ? e != null : e, !i || !r[t])
|
|
2743
|
+
return e;
|
|
2744
|
+
if (i === "toAttribute")
|
|
2745
|
+
switch (n) {
|
|
2746
|
+
case "Object":
|
|
2747
|
+
case "Array":
|
|
2748
|
+
return e == null ? null : JSON.stringify(e);
|
|
2749
|
+
case "Boolean":
|
|
2750
|
+
return e ? "" : null;
|
|
2751
|
+
case "Number":
|
|
2752
|
+
return e ?? null;
|
|
2753
|
+
default:
|
|
2754
|
+
return e;
|
|
2755
|
+
}
|
|
2756
|
+
else
|
|
2757
|
+
switch (n) {
|
|
2758
|
+
case "Object":
|
|
2759
|
+
case "Array":
|
|
2760
|
+
return e && JSON.parse(e);
|
|
2761
|
+
case "Boolean":
|
|
2762
|
+
return e;
|
|
2763
|
+
// conversion already handled above
|
|
2764
|
+
case "Number":
|
|
2765
|
+
return e != null ? +e : e;
|
|
2766
|
+
default:
|
|
2767
|
+
return e;
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2770
|
+
function Pa(t) {
|
|
2771
|
+
const e = {};
|
|
2772
|
+
return t.childNodes.forEach((r) => {
|
|
2773
|
+
e[
|
|
2774
|
+
/** @type {Element} node */
|
|
2775
|
+
r.slot || "default"
|
|
2776
|
+
] = !0;
|
|
2777
|
+
}), e;
|
|
2778
|
+
}
|
|
2779
|
+
function mt(t, e, r, i, n, o) {
|
|
2780
|
+
let a = class extends Zn {
|
|
2781
|
+
constructor() {
|
|
2782
|
+
super(t, r, n), this.$$p_d = e;
|
|
2783
|
+
}
|
|
2784
|
+
static get observedAttributes() {
|
|
2785
|
+
return Or(e).map(
|
|
2786
|
+
(c) => (e[c].attribute || c).toLowerCase()
|
|
2787
|
+
);
|
|
2788
|
+
}
|
|
2789
|
+
};
|
|
2790
|
+
return Or(e).forEach((c) => {
|
|
2791
|
+
tr(a.prototype, c, {
|
|
2792
|
+
get() {
|
|
2793
|
+
return this.$$c && c in this.$$c ? this.$$c[c] : this.$$d[c];
|
|
2794
|
+
},
|
|
2795
|
+
set(l) {
|
|
2796
|
+
l = Dr(c, l, e), this.$$d[c] = l;
|
|
2797
|
+
var s = this.$$c;
|
|
2798
|
+
if (s) {
|
|
2799
|
+
var d = Ye(s, c)?.get;
|
|
2800
|
+
d ? s[c] = l : s.$set({ [c]: l });
|
|
2801
|
+
}
|
|
2802
|
+
}
|
|
2803
|
+
});
|
|
2804
|
+
}), i.forEach((c) => {
|
|
2805
|
+
tr(a.prototype, c, {
|
|
2806
|
+
get() {
|
|
2807
|
+
return this.$$c?.[c];
|
|
2808
|
+
}
|
|
2809
|
+
});
|
|
2810
|
+
}), t.element = /** @type {any} */
|
|
2811
|
+
a, a;
|
|
2812
|
+
}
|
|
2813
|
+
const Wn = /* @__PURE__ */ new Map(), Qn = /* @__PURE__ */ new Map();
|
|
2814
|
+
function qa(t, e, r) {
|
|
2815
|
+
Wn.set(t, e), Qn.set(t, r);
|
|
2816
|
+
}
|
|
2817
|
+
function Ha(t, e, r) {
|
|
2818
|
+
const i = Wn.get(t);
|
|
2819
|
+
return i ? i(e, r) : null;
|
|
2820
|
+
}
|
|
2821
|
+
function za(t) {
|
|
2822
|
+
return Qn.get(t);
|
|
2823
|
+
}
|
|
2824
|
+
const Gn = Cr(null), Kn = Cr(null), Xn = (t) => `${sr(Gn)}/${t}`, Jn = (t = {}) => ({ Authorization: `Bearer ${sr(Kn)}`, ...t }), pi = async (t) => await (await fetch(Xn(t), { headers: Jn() })).json(), ja = async (t, e) => {
|
|
2825
|
+
const r = Jn({ "Content-type": "application/json" });
|
|
2826
|
+
return await (await fetch(Xn(t), {
|
|
2827
|
+
method: "PATCH",
|
|
2828
|
+
headers: r,
|
|
2829
|
+
body: JSON.stringify(e)
|
|
2830
|
+
})).json();
|
|
2831
|
+
}, Li = Cr(!1), to = Cr("h1"), eo = Cr("100%");
|
|
2832
|
+
async function Ba(t, e, r) {
|
|
2833
|
+
if (r.isPreviewMode && e)
|
|
2834
|
+
return await Va(e, r);
|
|
2835
|
+
if (t && !r.isPreviewMode)
|
|
2836
|
+
return await Ya(t);
|
|
2837
|
+
throw new Error("No session ID or item ID provided");
|
|
2838
|
+
}
|
|
2839
|
+
async function Va(t, e) {
|
|
2840
|
+
const r = !e.isPreviewModeInteractive, i = !0;
|
|
2841
|
+
let n = `?include=[html_tags${r && i ? ",correct_answer" : ""}]`;
|
|
2842
|
+
e.isPreviewContentful && (n = "?include=[html_tags,correct_answer,unpublished]&is_contentful_preview=true");
|
|
2843
|
+
const { data: o } = await pi(`items/${t}${n}`), a = Ua(o);
|
|
2844
|
+
return {
|
|
2845
|
+
...o,
|
|
2846
|
+
scoringMetadata: a,
|
|
2847
|
+
isFinished: r,
|
|
2848
|
+
// Use determined state
|
|
2849
|
+
isLocked: i,
|
|
2850
|
+
// Use determined state
|
|
2851
|
+
is_result_correct: !0,
|
|
2852
|
+
_loadType: "preview"
|
|
2853
|
+
};
|
|
2854
|
+
}
|
|
2855
|
+
function Ua(t) {
|
|
2856
|
+
if (!t.interaction) return null;
|
|
2857
|
+
const { interaction: e } = t, { type: r, options: i } = e;
|
|
2858
|
+
if (r === "multipleChoiceInteraction" && i) {
|
|
2859
|
+
const n = [];
|
|
2860
|
+
return Object.values(i).forEach((o, a) => {
|
|
2861
|
+
a === 0 && n.push(o.id);
|
|
2862
|
+
}), {
|
|
2863
|
+
hasAnswer: !0,
|
|
2864
|
+
correctAnswerIds: n,
|
|
2865
|
+
answerIds: [],
|
|
2866
|
+
// No student answers in preview
|
|
2867
|
+
interactionType: r
|
|
2868
|
+
};
|
|
2869
|
+
}
|
|
2870
|
+
return null;
|
|
2871
|
+
}
|
|
2872
|
+
async function Ya(t, e) {
|
|
2873
|
+
const r = sr(Li) ? "?skip_user_validation=true" : "", { data: i } = await pi(`sessions/${t}${r}`), {
|
|
2874
|
+
item_id: n,
|
|
2875
|
+
metadata: o,
|
|
2876
|
+
is_finished: a,
|
|
2877
|
+
is_locked: c,
|
|
2878
|
+
total_correct_answers: l
|
|
2879
|
+
} = i;
|
|
2880
|
+
if (!n)
|
|
2881
|
+
throw new Error("No item ID found in session");
|
|
2882
|
+
let s = `?include=[html_tags${a && c ? ",correct_answer" : ""}]`;
|
|
2883
|
+
const { data: d } = await pi(`items/${n}${s}`);
|
|
2884
|
+
return {
|
|
2885
|
+
...d,
|
|
2886
|
+
totalCorrectAnswers: l,
|
|
2887
|
+
metadata: o,
|
|
2888
|
+
isFinished: a,
|
|
2889
|
+
isLocked: c,
|
|
2890
|
+
_loadType: "session"
|
|
2891
|
+
};
|
|
2892
|
+
}
|
|
2893
|
+
const Za = () => {
|
|
2894
|
+
const t = window.eatSDK;
|
|
2895
|
+
if (!t)
|
|
2896
|
+
return;
|
|
2897
|
+
const { setup: e, general: r } = t.config;
|
|
2898
|
+
if (e) {
|
|
2899
|
+
const { base_url: i, app_secret: n } = e;
|
|
2900
|
+
Gn.set(String(i)), Kn.set(String(n));
|
|
2901
|
+
}
|
|
2902
|
+
if (r) {
|
|
2903
|
+
const { skip_user_validation: i, item: n } = r;
|
|
2904
|
+
Li.set(!!i);
|
|
2905
|
+
let o = "h1", a = "100%";
|
|
2906
|
+
if (n) {
|
|
2907
|
+
const c = ["h1", "h2", "h3", "h4", "h5", "h6"], { prompt_rubric_elem: l, interaction_width: s = "100%" } = n;
|
|
2908
|
+
o = l && c.includes(l) ? l : o, a = s;
|
|
2909
|
+
}
|
|
2910
|
+
to.set(o), eo.set(a);
|
|
2911
|
+
}
|
|
2912
|
+
};
|
|
2913
|
+
var Wa = /* @__PURE__ */ U('<div><div class="animate-skeleton w-full h-6 mb-2 rounded md:mb-4"></div> <div class="animate-skeleton w-full h-6 mb-12 rounded"></div> <div class="animate-skeleton w-full h-52 rounded"></div></div>');
|
|
2914
|
+
function ro(t) {
|
|
2915
|
+
var e = Wa();
|
|
2916
|
+
C(t, e);
|
|
2917
|
+
}
|
|
2918
|
+
mt(ro, {}, [], [], !0);
|
|
2919
|
+
var Qa = /* @__PURE__ */ U('<p class="p-2 border-2 border-red-600 bg-red-200 rounded"> </p>');
|
|
2920
|
+
function hi(t, e) {
|
|
2921
|
+
ht(e, !0);
|
|
2922
|
+
let r = A(e, "bannerLabel", 7, "Invalid.");
|
|
2923
|
+
var i = {
|
|
2924
|
+
get bannerLabel() {
|
|
2925
|
+
return r();
|
|
2926
|
+
},
|
|
2927
|
+
set bannerLabel(a = "Invalid.") {
|
|
2928
|
+
r(a), T();
|
|
2929
|
+
}
|
|
2930
|
+
}, n = Qa(), o = H(n, !0);
|
|
2931
|
+
return O(n), rt(() => Qe(o, r())), C(t, n), vt(i);
|
|
2932
|
+
}
|
|
2933
|
+
mt(hi, { bannerLabel: {} }, [], [], !0);
|
|
2934
|
+
const Ii = {
|
|
2935
|
+
MCQ: "multipleChoiceInteraction",
|
|
2936
|
+
CATEGORISE: "categoriseInteraction"
|
|
2937
|
+
}, Mr = {
|
|
2938
|
+
DEFAULT: "default"
|
|
2939
|
+
}, Yi = {
|
|
2940
|
+
MEDIA_FIRST: "media first"
|
|
2941
|
+
}, Ga = {
|
|
2942
|
+
IMAGE: "image"
|
|
2943
|
+
}, pe = {
|
|
2944
|
+
// Text processing utilities
|
|
2945
|
+
normalizeText: (t) => t.trim().toLowerCase().replace(/\s+/g, " "),
|
|
2946
|
+
removeDiacritics: (t) => t.normalize("NFD").replace(/[\u0300-\u036f]/g, ""),
|
|
2947
|
+
removePunctuation: (t) => t.replace(/[^\w\s]/gi, ""),
|
|
2948
|
+
// Accessibility helpers
|
|
2949
|
+
announceToScreenReader: (t) => {
|
|
2950
|
+
const e = document.createElement("div");
|
|
2951
|
+
e.setAttribute("aria-live", "polite"), e.setAttribute("aria-atomic", "true"), e.className = "sr-only", e.textContent = t, document.body.appendChild(e), setTimeout(() => document.body.removeChild(e), 1e3);
|
|
2952
|
+
},
|
|
2953
|
+
// Scoring utilities
|
|
2954
|
+
calculateScore: (t, e, r = 0) => Math.max(0, (t - r) / e),
|
|
2955
|
+
calculatePercentage: (t, e) => e > 0 ? Math.round(t / e * 100) : 0,
|
|
2956
|
+
// Feedback generation
|
|
2957
|
+
generateFeedback: (t, e) => e || (t ? "Correct! Well done." : "Not quite right. Please try again."),
|
|
2958
|
+
// State management helpers
|
|
2959
|
+
createTimestamp: () => Date.now(),
|
|
2960
|
+
updateState: (t, e) => ({
|
|
2961
|
+
...t,
|
|
2962
|
+
data: { ...t.data, ...e },
|
|
2963
|
+
lastModified: Date.now()
|
|
2964
|
+
}),
|
|
2965
|
+
// Mode determination
|
|
2966
|
+
determineInteractionMode: (t) => t ? t.mode === "review" || t.is_review ? "review" : t.mode === "preview" || t.is_preview ? "preview" : "standard" : "standard"
|
|
2967
|
+
}, Ka = {
|
|
2968
|
+
alertIcon: {
|
|
2969
|
+
width: 22,
|
|
2970
|
+
height: 20,
|
|
2971
|
+
viewBox: "0 0 22 20",
|
|
2972
|
+
fill: "none",
|
|
2973
|
+
fillRule: "evenodd",
|
|
2974
|
+
clipRule: "evenodd",
|
|
2975
|
+
path: "M9.81616 0.255055C11.1909 -0.366408 12.8298 0.181391 13.5454 1.53306L21.7676 17.064C22.4728 18.396 21.5072 19.9998 20.0001 19.9998H2.00006C0.492906 19.9998 -0.472697 18.396 0.23248 17.064L8.45475 1.53306C8.72491 1.02275 9.14223 0.605431 9.65254 0.335267L9.81616 0.255055ZM11.0001 13.9998C10.4478 13.9998 10.0001 14.4475 10.0001 14.9998C10.0001 15.5521 10.4478 15.9998 11.0001 15.9998C11.5523 15.9998 12.0001 15.5521 12.0001 14.9998C12.0001 14.4475 11.5523 13.9998 11.0001 13.9998ZM11.0001 5.99978C10.4478 5.99978 10.0001 6.4475 10.0001 6.99978V10.9998C10.0001 11.5521 10.4478 11.9998 11.0001 11.9998C11.5523 11.9998 12.0001 11.5521 12.0001 10.9998V6.99978C12.0001 6.4475 11.5523 5.99978 11.0001 5.99978Z",
|
|
2976
|
+
pathFill: "#C84414"
|
|
2977
|
+
},
|
|
2978
|
+
arrowDownCircle: {
|
|
2979
|
+
width: 20,
|
|
2980
|
+
height: 20,
|
|
2981
|
+
viewBox: "0 0 20 20",
|
|
2982
|
+
fill: "none",
|
|
2983
|
+
fillRule: "evenodd",
|
|
2984
|
+
clipRule: "evenodd",
|
|
2985
|
+
path: "M10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0ZM10 5C9.44772 5 9 5.44772 9 6V11.585L6.70711 9.29289C6.34662 8.93241 5.77939 8.90468 5.3871 9.2097L5.29289 9.29289C4.90237 9.68342 4.90237 10.3166 5.29289 10.7071L9.29289 14.7071C9.32136 14.7356 9.35153 14.7623 9.38325 14.7872C9.39016 14.7927 9.3974 14.7982 9.40469 14.8037C9.42887 14.8215 9.45372 14.8383 9.47934 14.8539C9.49139 14.8614 9.50361 14.8685 9.51594 14.8753C9.53571 14.8862 9.55611 14.8966 9.5769 14.9063C9.5939 14.9143 9.6112 14.9218 9.62866 14.9288C9.64842 14.9367 9.6682 14.9439 9.68826 14.9505C9.70315 14.9553 9.71854 14.9599 9.73401 14.9642C9.75556 14.9702 9.77725 14.9754 9.79921 14.9798C9.81662 14.9833 9.83405 14.9864 9.85153 14.989L9.88338 14.9933L9.91075 14.996C9.934 14.9981 9.95732 14.9994 9.98065 14.9998L10 15C10.0065 15 10.0129 14.9999 10.0193 14.9998C10.0427 14.9994 10.066 14.9981 10.0893 14.996C10.1097 14.9943 10.1294 14.9919 10.149 14.989C10.1659 14.9864 10.1834 14.9833 10.2007 14.9798C10.2227 14.9754 10.2444 14.9702 10.2658 14.9643C10.2815 14.9599 10.2969 14.9553 10.3121 14.9503C10.3318 14.9439 10.3516 14.9367 10.3711 14.9289C10.3888 14.9218 10.4061 14.9143 10.4232 14.9063C10.4439 14.8966 10.4643 14.8862 10.4843 14.8751C10.4964 14.8685 10.5086 14.8614 10.5207 14.854C10.5463 14.8383 10.5711 14.8215 10.5952 14.8037L10.6129 14.7903C10.6485 14.7623 10.6786 14.7356 10.7071 14.7071L14.7071 10.7071C15.0976 10.3166 15.0976 9.68342 14.7071 9.29289C14.3166 8.90237 13.6834 8.90237 13.2929 9.29289L11 11.585V6C11 5.48716 10.614 5.06449 10.1166 5.00673L10 5Z",
|
|
2986
|
+
pathFill: "currentColor"
|
|
2987
|
+
},
|
|
2988
|
+
crossIcon: {
|
|
2989
|
+
width: 12,
|
|
2990
|
+
height: 12,
|
|
2991
|
+
viewBox: "0 0 12 12",
|
|
2992
|
+
fill: "none",
|
|
2993
|
+
fillRule: "evenodd",
|
|
2994
|
+
clipRule: "evenodd",
|
|
2995
|
+
path: "M1.70711 0.292893L6 4.585L10.2929 0.292893C10.6834 -0.0976311 11.3166 -0.0976311 11.7071 0.292893C12.0976 0.683418 12.0976 1.31658 11.7071 1.70711L7.415 6L11.7071 10.2929C12.0976 10.6834 12.0976 11.3166 11.7071 11.7071C11.3166 12.0976 10.6834 12.0976 10.2929 11.7071L6 7.415L1.70711 11.7071C1.31658 12.0976 0.683418 12.0976 0.292893 11.7071C-0.0976311 11.3166 -0.0976311 10.6834 0.292893 10.2929L4.585 6L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683418 0.292893 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893Z",
|
|
2996
|
+
pathFill: "currentColor"
|
|
2997
|
+
},
|
|
2998
|
+
errorSolid: {
|
|
2999
|
+
width: 20,
|
|
3000
|
+
height: 20,
|
|
3001
|
+
viewBox: "0 0 20 20",
|
|
3002
|
+
fill: "none",
|
|
3003
|
+
fillRule: "evenodd",
|
|
3004
|
+
clipRule: "evenodd",
|
|
3005
|
+
path: "M10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0ZM7.70711 6.29289C7.31658 5.90237 6.68342 5.90237 6.29289 6.29289C5.90237 6.68342 5.90237 7.31658 6.29289 7.70711L8.585 10L6.29289 12.2929C5.93241 12.6534 5.90468 13.2206 6.2097 13.6129L6.29289 13.7071C6.68342 14.0976 7.31658 14.0976 7.70711 13.7071L10 11.415L12.2929 13.7071C12.6534 14.0676 13.2206 14.0953 13.6129 13.7903L13.7071 13.7071C14.0976 13.3166 14.0976 12.6834 13.7071 12.2929L11.415 10L13.7071 7.70711C14.0676 7.34662 14.0953 6.77939 13.7903 6.3871L13.7071 6.29289C13.3166 5.90237 12.6834 5.90237 12.2929 6.29289L10 8.585L7.70711 6.29289Z",
|
|
3006
|
+
pathFill: "currentColor"
|
|
3007
|
+
},
|
|
3008
|
+
infoSolid: {
|
|
3009
|
+
width: 20,
|
|
3010
|
+
height: 20,
|
|
3011
|
+
viewBox: "0 0 20 20",
|
|
3012
|
+
fill: "none",
|
|
3013
|
+
fillRule: "evenodd",
|
|
3014
|
+
clipRule: "evenodd",
|
|
3015
|
+
path: "M10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0ZM10 9C9.44772 9 9 9.44772 9 10V14.5C9 15.0523 9.44772 15.5 10 15.5C10.5523 15.5 11 15.0523 11 14.5V10C11 9.44772 10.5523 9 10 9ZM10 5C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7C10.5523 7 11 6.55228 11 6C11 5.44772 10.5523 5 10 5Z",
|
|
3016
|
+
pathFill: "currentColor"
|
|
3017
|
+
},
|
|
3018
|
+
smallChevronDown: {
|
|
3019
|
+
width: 8,
|
|
3020
|
+
height: 5,
|
|
3021
|
+
viewBox: "0 0 8 5",
|
|
3022
|
+
fill: "none",
|
|
3023
|
+
fillRule: "evenodd",
|
|
3024
|
+
clipRule: "evenodd",
|
|
3025
|
+
path: "M4 3.05719L6.86193 0.195262C7.12228 -0.0650874 7.54439 -0.0650874 7.80474 0.195262C8.06509 0.455612 8.06509 0.877721 7.80474 1.13807L4.4714 4.4714C4.21105 4.73175 3.78895 4.73175 3.5286 4.4714L0.195262 1.13807C-0.0650874 0.877721 -0.0650874 0.455612 0.195262 0.195262C0.455612 -0.0650874 0.877721 -0.0650874 1.13807 0.195262L4 3.05719Z",
|
|
3026
|
+
pathFill: "currentColor"
|
|
3027
|
+
},
|
|
3028
|
+
smallChevronLeft: {
|
|
3029
|
+
width: 7,
|
|
3030
|
+
height: 12,
|
|
3031
|
+
viewBox: "0 0 7 12",
|
|
3032
|
+
fill: "none",
|
|
3033
|
+
fillRule: "evenodd",
|
|
3034
|
+
clipRule: "evenodd",
|
|
3035
|
+
path: "M2.41421 6L6.70711 10.2929C7.09763 10.6834 7.09763 11.3166 6.70711 11.7071C6.31658 12.0976 5.68342 12.0976 5.29289 11.7071L0.292893 6.70711C-0.0976311 6.31658 -0.0976311 5.68342 0.292893 5.29289L5.29289 0.292893C5.68342 -0.0976311 6.31658 -0.0976311 6.70711 0.292893C7.09763 0.683418 7.09763 1.31658 6.70711 1.70711L2.41421 6Z",
|
|
3036
|
+
pathFill: "currentColor"
|
|
3037
|
+
},
|
|
3038
|
+
smallChevronRight: {
|
|
3039
|
+
width: 7,
|
|
3040
|
+
height: 12,
|
|
3041
|
+
viewBox: "0 0 7 12",
|
|
3042
|
+
fill: "none",
|
|
3043
|
+
fillRule: "evenodd",
|
|
3044
|
+
clipRule: "evenodd",
|
|
3045
|
+
path: "M4.58579 6L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683418 0.292893 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L6.70711 5.29289C7.09763 5.68342 7.09763 6.31658 6.70711 6.70711L1.70711 11.7071C1.31658 12.0976 0.683418 12.0976 0.292893 11.7071C-0.0976311 11.3166 -0.0976311 10.6834 0.292893 10.2929L4.58579 6Z",
|
|
3046
|
+
pathFill: "currentColor"
|
|
3047
|
+
},
|
|
3048
|
+
smallChevronUp: {
|
|
3049
|
+
width: 8,
|
|
3050
|
+
height: 5,
|
|
3051
|
+
viewBox: "0 0 8 5",
|
|
3052
|
+
fill: "none",
|
|
3053
|
+
fillRule: "evenodd",
|
|
3054
|
+
clipRule: "evenodd",
|
|
3055
|
+
path: "M4 1.60948L1.13807 4.4714C0.877721 4.73175 0.455612 4.73175 0.195262 4.4714C-0.0650874 4.21105 -0.0650874 3.78894 0.195262 3.5286L3.5286 0.195262C3.78895 -0.0650874 4.21105 -0.0650874 4.4714 0.195262L7.80474 3.5286C8.06509 3.78894 8.06509 4.21105 7.80474 4.4714C7.54439 4.73175 7.12228 4.73175 6.86193 4.4714L4 1.60948Z",
|
|
3056
|
+
pathFill: "currentColor"
|
|
3057
|
+
},
|
|
3058
|
+
success: {
|
|
3059
|
+
width: 15,
|
|
3060
|
+
height: 11,
|
|
3061
|
+
viewBox: "0 0 15 11",
|
|
3062
|
+
fill: "none",
|
|
3063
|
+
fillRule: "evenodd",
|
|
3064
|
+
clipRule: "evenodd",
|
|
3065
|
+
path: "M13.2929 0.292893C13.6834 -0.0976311 14.3166 -0.0976311 14.7071 0.292893C15.0976 0.683418 15.0976 1.31658 14.7071 1.70711L5.70711 10.7071C5.31658 11.0976 4.68342 11.0976 4.29289 10.7071L0.292893 6.70711C-0.0976311 6.31658 -0.0976311 5.68342 0.292893 5.29289C0.683418 4.90237 1.31658 4.90237 1.70711 5.29289L5 8.58579L13.2929 0.292893Z",
|
|
3066
|
+
pathFill: "currentColor"
|
|
3067
|
+
},
|
|
3068
|
+
successRounded: {
|
|
3069
|
+
width: 12,
|
|
3070
|
+
height: 8,
|
|
3071
|
+
viewBox: "0 0 12 8",
|
|
3072
|
+
fill: "none",
|
|
3073
|
+
fillRule: "evenodd",
|
|
3074
|
+
clipRule: "evenodd",
|
|
3075
|
+
path: "M9.79289 0.292893C10.1834 -0.0976311 10.8166 -0.0976311 11.2071 0.292893C11.5976 0.683418 11.5976 1.31658 11.2071 1.70711L5.20711 7.70711C4.81658 8.09763 4.18342 8.09763 3.79289 7.70711L0.792893 4.70711C0.402369 4.31658 0.402369 3.68342 0.792893 3.29289C1.18342 2.90237 1.81658 2.90237 2.20711 3.29289L4.5 5.58579L9.79289 0.292893Z",
|
|
3076
|
+
pathFill: "white"
|
|
3077
|
+
},
|
|
3078
|
+
successSolid: {
|
|
3079
|
+
width: 20,
|
|
3080
|
+
height: 20,
|
|
3081
|
+
viewBox: "0 0 20 20",
|
|
3082
|
+
fill: "none",
|
|
3083
|
+
fillRule: "evenodd",
|
|
3084
|
+
clipRule: "evenodd",
|
|
3085
|
+
path: "M10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10C0 4.47715 4.47715 0 10 0ZM14.7284 6.79289C14.3378 6.40237 13.7047 6.40237 13.3141 6.79289L8.02125 12.0858L6.20711 10.2716C5.81658 9.88112 5.18342 9.88112 4.79289 10.2716C4.40237 10.6622 4.40237 11.2953 4.79289 11.6859L7.31414 14.2071C7.70467 14.5976 8.33783 14.5976 8.72836 14.2071L14.7284 8.20711C15.1189 7.81658 15.1189 7.18342 14.7284 6.79289Z",
|
|
3086
|
+
pathFill: "currentColor"
|
|
3087
|
+
},
|
|
3088
|
+
switch: {
|
|
3089
|
+
width: 12,
|
|
3090
|
+
height: 16,
|
|
3091
|
+
viewBox: "0 0 12 16",
|
|
3092
|
+
fill: "none",
|
|
3093
|
+
path: "M11.0005 6.99936C10.4475 6.99936 10.0005 7.44736 10.0005 7.99936C10.0005 10.2054 8.20549 11.9994 6.00049 11.9994V10.6434C6.00049 10.0094 5.58749 9.80936 5.08449 10.1984L2.37749 12.2914C1.87449 12.6814 1.87449 13.3184 2.37749 13.7074L5.08449 15.8014C5.58749 16.1904 6.00049 15.9904 6.00049 15.3554V13.9994C9.30849 13.9994 12.0005 11.3084 12.0005 7.99936C12.0005 7.44736 11.5525 6.99936 11.0005 6.99936ZM6.91599 0.198664C6.41199 -0.190336 5.99999 0.0096643 5.99999 0.643664V1.99966C2.69099 1.99966 -1.14441e-05 4.69066 -1.14441e-05 7.99966C-1.14441e-05 8.55166 0.447989 8.99966 0.999989 8.99966C1.55199 8.99966 1.99999 8.55166 1.99999 7.99966C1.99999 5.79366 3.79399 3.99966 5.99999 3.99966V5.35566C5.99999 5.98966 6.41199 6.18966 6.91599 5.80066L9.62299 3.70766C10.126 3.31766 10.126 2.68166 9.62299 2.29166L6.91599 0.198664Z",
|
|
3094
|
+
pathFill: "currentColor"
|
|
3095
|
+
},
|
|
3096
|
+
gripVertical: {
|
|
3097
|
+
width: 6,
|
|
3098
|
+
height: 14,
|
|
3099
|
+
viewBox: "0 0 6 14",
|
|
3100
|
+
fill: "none",
|
|
3101
|
+
fillRule: "evenodd",
|
|
3102
|
+
clipRule: "evenodd",
|
|
3103
|
+
path: "M1 12C1.55228 12 2 12.4477 2 13C2 13.5523 1.55228 14 1 14C0.447715 14 0 13.5523 0 13C0 12.4477 0.447715 12 1 12ZM5 12C5.55228 12 6 12.4477 6 13C6 13.5523 5.55228 14 5 14C4.44772 14 4 13.5523 4 13C4 12.4477 4.44772 12 5 12ZM1 8C1.55228 8 2 8.44772 2 9C2 9.55228 1.55228 10 1 10C0.447715 10 0 9.55228 0 9C0 8.44772 0.447715 8 1 8ZM5 8C5.55228 8 6 8.44772 6 9C6 9.55228 5.55228 10 5 10C4.44772 10 4 9.55228 4 9C4 8.44772 4.44772 8 5 8ZM1 4C1.55228 4 2 4.44772 2 5C2 5.55228 1.55228 6 1 6C0.447715 6 0 5.55228 0 5C0 4.44772 0.447715 4 1 4ZM5 4C5.55228 4 6 4.44772 6 5C6 5.55228 5.55228 6 5 6C4.44772 6 4 5.55228 4 5C4 4.44772 4.44772 4 5 4ZM1 0C1.55228 0 2 0.447715 2 1C2 1.55228 1.55228 2 1 2C0.447715 2 0 1.55228 0 1C0 0.447715 0.447715 0 1 0ZM5 0C5.55228 0 6 0.447715 6 1C6 1.55228 5.55228 2 5 2C4.44772 2 4 1.55228 4 1C4 0.447715 4.44772 0 5 0Z",
|
|
3104
|
+
pathFill: "currentColor"
|
|
3105
|
+
}
|
|
3106
|
+
};
|
|
3107
|
+
var Xa = /* @__PURE__ */ Hn("<path></path>"), Ja = /* @__PURE__ */ Hn('<svg xmlns="http://www.w3.org/2000/svg"><!></svg>');
|
|
3108
|
+
function Ce(t, e) {
|
|
3109
|
+
ht(e, !0);
|
|
3110
|
+
let r = A(e, "width", 7, void 0), i = A(e, "height", 7, void 0), n = A(e, "svgName"), o = A(e, "className", 7, void 0), a = /* @__PURE__ */ $(() => {
|
|
3111
|
+
const f = Ka[n()] ?? {};
|
|
3112
|
+
return {
|
|
3113
|
+
width: r() ?? f.width,
|
|
3114
|
+
height: i() ?? f.height,
|
|
3115
|
+
viewBox: f.viewBox,
|
|
3116
|
+
fillRule: f.fillRule ?? void 0,
|
|
3117
|
+
clipRule: f.clipRule ?? void 0,
|
|
3118
|
+
fill: f.fill,
|
|
3119
|
+
path: f.path,
|
|
3120
|
+
pathFill: f.pathFill
|
|
3121
|
+
};
|
|
3122
|
+
});
|
|
3123
|
+
var c = {
|
|
3124
|
+
get width() {
|
|
3125
|
+
return r();
|
|
3126
|
+
},
|
|
3127
|
+
set width(f = void 0) {
|
|
3128
|
+
r(f), T();
|
|
3129
|
+
},
|
|
3130
|
+
get height() {
|
|
3131
|
+
return i();
|
|
3132
|
+
},
|
|
3133
|
+
set height(f = void 0) {
|
|
3134
|
+
i(f), T();
|
|
3135
|
+
},
|
|
3136
|
+
get svgName() {
|
|
3137
|
+
return n();
|
|
3138
|
+
},
|
|
3139
|
+
set svgName(f) {
|
|
3140
|
+
n(f), T();
|
|
3141
|
+
},
|
|
3142
|
+
get className() {
|
|
3143
|
+
return o();
|
|
3144
|
+
},
|
|
3145
|
+
set className(f = void 0) {
|
|
3146
|
+
o(f), T();
|
|
3147
|
+
}
|
|
3148
|
+
}, l = Ja(), s = H(l);
|
|
3149
|
+
{
|
|
3150
|
+
var d = (f) => {
|
|
3151
|
+
var p = Xa();
|
|
3152
|
+
rt(() => {
|
|
3153
|
+
G(p, "fill-rule", u(a).fillRule), G(p, "clip-rule", u(a).clipRule), G(p, "d", u(a).path), G(p, "fill", u(a).pathFill);
|
|
3154
|
+
}), C(f, p);
|
|
3155
|
+
};
|
|
3156
|
+
z(s, (f) => {
|
|
3157
|
+
u(a).path && f(d);
|
|
3158
|
+
});
|
|
3159
|
+
}
|
|
3160
|
+
return O(l), rt(() => {
|
|
3161
|
+
G(l, "width", u(a).width), G(l, "height", u(a).height), G(l, "viewBox", u(a).viewBox), G(l, "fill", u(a).fill), pt(l, 0, Yt(o() ?? n()));
|
|
3162
|
+
}), C(t, l), vt(c);
|
|
3163
|
+
}
|
|
3164
|
+
mt(Ce, { width: {}, height: {}, svgName: {}, className: {} }, [], [], !0);
|
|
3165
|
+
var ts = /* @__PURE__ */ U("<span><!></span>");
|
|
3166
|
+
function io(t, e) {
|
|
3167
|
+
ht(e, !0);
|
|
3168
|
+
let r = A(e, "isCorrect"), i = A(e, "size", 7, "medium"), n = /* @__PURE__ */ $(() => r() ? "successSolid" : "errorSolid"), o = /* @__PURE__ */ $(() => r() ? "text-green-900" : "text-red-900"), a = /* @__PURE__ */ $(() => i() === "small" ? "w-4 h-4" : "w-6 h-6"), c = /* @__PURE__ */ $(() => r() ? "correct-icon" : "incorrect-icon");
|
|
3169
|
+
var l = {
|
|
3170
|
+
get isCorrect() {
|
|
3171
|
+
return r();
|
|
3172
|
+
},
|
|
3173
|
+
set isCorrect(f) {
|
|
3174
|
+
r(f), T();
|
|
3175
|
+
},
|
|
3176
|
+
get size() {
|
|
3177
|
+
return i();
|
|
3178
|
+
},
|
|
3179
|
+
set size(f = "medium") {
|
|
3180
|
+
i(f), T();
|
|
3181
|
+
}
|
|
3182
|
+
}, s = ts(), d = H(s);
|
|
3183
|
+
return Ce(d, {
|
|
3184
|
+
get svgName() {
|
|
3185
|
+
return u(n);
|
|
3186
|
+
},
|
|
3187
|
+
get className() {
|
|
3188
|
+
return u(c);
|
|
3189
|
+
}
|
|
3190
|
+
}), O(s), rt(() => pt(s, 1, `${u(a) ?? ""} flex items-center justify-center ${u(o) ?? ""} p-0.5`)), C(t, s), vt(l);
|
|
3191
|
+
}
|
|
3192
|
+
mt(io, { isCorrect: {}, size: {} }, [], [], !0);
|
|
3193
|
+
var es = /* @__PURE__ */ U('<div class="flex-shrink-0 mt-0.5"><!></div>'), rs = /* @__PURE__ */ U('<h3 class="font-semibold text-sm mb-1"> </h3>'), is = /* @__PURE__ */ U('<div><!> <div class="flex-grow"><!> <div class="text-sm leading-relaxed"><!></div></div></div>');
|
|
3194
|
+
function no(t, e) {
|
|
3195
|
+
ht(e, !0);
|
|
3196
|
+
let r = A(e, "type", 7, "incorrect"), i = A(e, "message", 7, ""), n = A(e, "title", 7, ""), o = A(e, "showIcon", 7, !0), a = A(e, "isAlert", 7, !0), c = /* @__PURE__ */ $(l);
|
|
3197
|
+
function l() {
|
|
3198
|
+
const h = "p-4 rounded-lg border flex items-start gap-3";
|
|
3199
|
+
switch (r()) {
|
|
3200
|
+
case "correct":
|
|
3201
|
+
return `${h} bg-green-50 border-green-200 text-green-800`;
|
|
3202
|
+
case "incorrect":
|
|
3203
|
+
return `${h} bg-red-50 border-red-200 text-red-800`;
|
|
3204
|
+
case "skipped":
|
|
3205
|
+
return `${h} bg-yellow-50 border-yellow-200 text-yellow-800`;
|
|
3206
|
+
default:
|
|
3207
|
+
return `${h} bg-gray-50 border-gray-200 text-gray-800`;
|
|
3208
|
+
}
|
|
3209
|
+
}
|
|
3210
|
+
function s() {
|
|
3211
|
+
return r() === "correct";
|
|
3212
|
+
}
|
|
3213
|
+
var d = {
|
|
3214
|
+
get type() {
|
|
3215
|
+
return r();
|
|
3216
|
+
},
|
|
3217
|
+
set type(h = "incorrect") {
|
|
3218
|
+
r(h), T();
|
|
3219
|
+
},
|
|
3220
|
+
get message() {
|
|
3221
|
+
return i();
|
|
3222
|
+
},
|
|
3223
|
+
set message(h = "") {
|
|
3224
|
+
i(h), T();
|
|
3225
|
+
},
|
|
3226
|
+
get title() {
|
|
3227
|
+
return n();
|
|
3228
|
+
},
|
|
3229
|
+
set title(h = "") {
|
|
3230
|
+
n(h), T();
|
|
3231
|
+
},
|
|
3232
|
+
get showIcon() {
|
|
3233
|
+
return o();
|
|
3234
|
+
},
|
|
3235
|
+
set showIcon(h = !0) {
|
|
3236
|
+
o(h), T();
|
|
3237
|
+
},
|
|
3238
|
+
get isAlert() {
|
|
3239
|
+
return a();
|
|
3240
|
+
},
|
|
3241
|
+
set isAlert(h = !0) {
|
|
3242
|
+
a(h), T();
|
|
3243
|
+
}
|
|
3244
|
+
}, f = et(), p = tt(f);
|
|
3245
|
+
{
|
|
3246
|
+
var m = (h) => {
|
|
3247
|
+
var w = is(), b = H(w);
|
|
3248
|
+
{
|
|
3249
|
+
var I = (x) => {
|
|
3250
|
+
var R = es(), K = H(R);
|
|
3251
|
+
{
|
|
3252
|
+
let k = /* @__PURE__ */ $(s);
|
|
3253
|
+
io(K, {
|
|
3254
|
+
get isCorrect() {
|
|
3255
|
+
return u(k);
|
|
3256
|
+
},
|
|
3257
|
+
size: "medium"
|
|
3258
|
+
});
|
|
3259
|
+
}
|
|
3260
|
+
O(R), C(x, R);
|
|
3261
|
+
};
|
|
3262
|
+
z(b, (x) => {
|
|
3263
|
+
o() && r() !== "skipped" && x(I);
|
|
3264
|
+
});
|
|
3265
|
+
}
|
|
3266
|
+
var y = ut(b, 2), V = H(y);
|
|
3267
|
+
{
|
|
3268
|
+
var E = (x) => {
|
|
3269
|
+
var R = rs(), K = H(R, !0);
|
|
3270
|
+
O(R), rt(() => Qe(K, n())), C(x, R);
|
|
3271
|
+
};
|
|
3272
|
+
z(V, (x) => {
|
|
3273
|
+
n() && x(E);
|
|
3274
|
+
});
|
|
3275
|
+
}
|
|
3276
|
+
var _ = ut(V, 2), g = H(_);
|
|
3277
|
+
Vn(g, i), O(_), O(y), O(w), rt(() => {
|
|
3278
|
+
pt(w, 1, Yt(u(c))), G(w, "role", a() ? "alert" : "status"), G(w, "aria-live", a() ? "assertive" : "polite");
|
|
3279
|
+
}), C(h, w);
|
|
3280
|
+
};
|
|
3281
|
+
z(p, (h) => {
|
|
3282
|
+
i() && h(m);
|
|
3283
|
+
});
|
|
3284
|
+
}
|
|
3285
|
+
return C(t, f), vt(d);
|
|
3286
|
+
}
|
|
3287
|
+
mt(no, { type: {}, message: {}, title: {}, showIcon: {}, isAlert: {} }, [], [], !0);
|
|
3288
|
+
const $r = (t) => [
|
|
3289
|
+
"A",
|
|
3290
|
+
"B",
|
|
3291
|
+
"C",
|
|
3292
|
+
"D",
|
|
3293
|
+
"E",
|
|
3294
|
+
"F",
|
|
3295
|
+
"G",
|
|
3296
|
+
"H",
|
|
3297
|
+
"I",
|
|
3298
|
+
"J",
|
|
3299
|
+
"K",
|
|
3300
|
+
"L",
|
|
3301
|
+
"M",
|
|
3302
|
+
"N",
|
|
3303
|
+
"O",
|
|
3304
|
+
"P",
|
|
3305
|
+
"Q",
|
|
3306
|
+
"R",
|
|
3307
|
+
"S",
|
|
3308
|
+
"T",
|
|
3309
|
+
"U",
|
|
3310
|
+
"V",
|
|
3311
|
+
"W",
|
|
3312
|
+
"X",
|
|
3313
|
+
"Y",
|
|
3314
|
+
"Z"
|
|
3315
|
+
][t];
|
|
3316
|
+
function ns(t, e, r, i = !1) {
|
|
3317
|
+
return e ? {
|
|
3318
|
+
type: "skipped",
|
|
3319
|
+
message: r || "No answer provided",
|
|
3320
|
+
title: "Question Skipped",
|
|
3321
|
+
showIcon: !0
|
|
3322
|
+
} : t ? {
|
|
3323
|
+
type: "correct",
|
|
3324
|
+
message: r || "Correct answer!",
|
|
3325
|
+
title: i ? "Correct!" : "Well done!",
|
|
3326
|
+
showIcon: !0
|
|
3327
|
+
} : {
|
|
3328
|
+
type: "incorrect",
|
|
3329
|
+
message: r || "Incorrect answer",
|
|
3330
|
+
title: i ? "Incorrect" : "Try again",
|
|
3331
|
+
showIcon: !0
|
|
3332
|
+
};
|
|
3333
|
+
}
|
|
3334
|
+
function Ri(t, e, r) {
|
|
3335
|
+
const i = t.data.selectedOptions ?? [], n = e.correctAnswerIds ?? [], a = e.maxSelections ?? n.length ?? 1, c = !!e.isFinished, l = e.mode === "preview", s = e.mode === "interactive-preview", d = !!(r && Object.keys(r).length > 0), f = d ? Object.values(r)?.some((p) => p.media) : !1;
|
|
3336
|
+
return {
|
|
3337
|
+
selectedOptions: i,
|
|
3338
|
+
correctAnswerIds: n,
|
|
3339
|
+
totalCorrectAnswers: a,
|
|
3340
|
+
isFinished: c,
|
|
3341
|
+
isPreviewMode: l,
|
|
3342
|
+
isPreviewModeInteractive: s,
|
|
3343
|
+
hasOptions: d,
|
|
3344
|
+
hasMedia: f
|
|
3345
|
+
};
|
|
3346
|
+
}
|
|
3347
|
+
function os(t, e, r, i) {
|
|
3348
|
+
const n = Ri(t, e), o = n.selectedOptions, a = n.correctAnswerIds, c = n.totalCorrectAnswers, l = n.isFinished, s = n.isPreviewModeInteractive, d = o.length === c && r(o), f = !s && (!o.length || o.length < c && o.every((h) => a.includes(h))) || s && t.data.interactiveHasAnswered && !o.length, p = l && !s && (!r(o) || !o.length) || s && (o.length === c || !o.length && t.data.interactiveHasAnswered), m = i(o);
|
|
3349
|
+
return {
|
|
3350
|
+
isFeedbackShown: p,
|
|
3351
|
+
isPreviewModeInteractive: s,
|
|
3352
|
+
isResultCorrect: d,
|
|
3353
|
+
isSkipped: f,
|
|
3354
|
+
resultFeedback: m
|
|
3355
|
+
};
|
|
3356
|
+
}
|
|
3357
|
+
function as(t, e, r, i, n) {
|
|
3358
|
+
const o = i.data.selectedOptions ?? [], a = r.correctAnswerIds ?? [], c = !!r.isFinished, l = r.mode === "preview", s = r.mode === "interactive-preview", d = r.maxSelections ?? a.length ?? 1, f = o.includes(t.id), p = a.includes(t.id), m = c && !s || s && o.length === d || l && !s && f, h = f && (c && !s || s && o.length === d), w = d > 1 && (!c && !s || c && !f && !p || s), b = c && p && !f && (!s || s && o.length === d), I = c && f && d === 1 && !n && (!l || l && s), y = c && f && d === 1 && n && (!l || l && s && o.length === d), V = c && p && (!f || !o.length) && (!s || s && o.length === d), E = (() => {
|
|
3359
|
+
const g = ["group", "btn-mcq-option"];
|
|
3360
|
+
return n && g.push("min-w-[288px]", "max-w-[304px]", "min-h-[210px]", "md:min-w-full", "block"), !c || s ? g.push("active:raw-focus-ring-by") : g.push("finished"), f && g.push("selected"), b && g.push("missing"), m && p ? g.push("correct") : m && g.push("incorrect"), s && g.push("interactive"), g.join(" ");
|
|
3361
|
+
})(), _ = (() => {
|
|
3362
|
+
const g = ["custom-checkbox"];
|
|
3363
|
+
return f ? g.push("border-soft-blue") : g.push("border-gray-850"), (l && !s || c && !l) && g.push("preview-only"), s && o.length === d && g.push("ml-2.5"), g.join(" ");
|
|
3364
|
+
})();
|
|
3365
|
+
return {
|
|
3366
|
+
isSelected: f,
|
|
3367
|
+
isCorrect: p,
|
|
3368
|
+
isFinished: c,
|
|
3369
|
+
showResultIcon: h,
|
|
3370
|
+
showCheckbox: w,
|
|
3371
|
+
showMissingIcon: b,
|
|
3372
|
+
showStudentLabel: I,
|
|
3373
|
+
showMediaStudentLabel: y,
|
|
3374
|
+
showMissingAnswerLabel: V,
|
|
3375
|
+
shouldShowCorrectness: m,
|
|
3376
|
+
buttonClasses: E,
|
|
3377
|
+
checkboxClasses: _
|
|
3378
|
+
};
|
|
3379
|
+
}
|
|
3380
|
+
var ss = /* @__PURE__ */ U('<div aria-live="polite"><!></div>');
|
|
3381
|
+
function oo(t, e) {
|
|
3382
|
+
ht(e, !0);
|
|
3383
|
+
let r = A(e, "feedbackState"), i = /* @__PURE__ */ $(() => ns(r().isResultCorrect, r().isSkipped, r().resultFeedback, r().isPreviewModeInteractive));
|
|
3384
|
+
var n = {
|
|
3385
|
+
get feedbackState() {
|
|
3386
|
+
return r();
|
|
3387
|
+
},
|
|
3388
|
+
set feedbackState(l) {
|
|
3389
|
+
r(l), T();
|
|
3390
|
+
}
|
|
3391
|
+
}, o = et(), a = tt(o);
|
|
3392
|
+
{
|
|
3393
|
+
var c = (l) => {
|
|
3394
|
+
var s = ss(), d = H(s);
|
|
3395
|
+
{
|
|
3396
|
+
let f = /* @__PURE__ */ $(() => !r().isPreviewModeInteractive);
|
|
3397
|
+
no(d, {
|
|
3398
|
+
get type() {
|
|
3399
|
+
return u(i).type;
|
|
3400
|
+
},
|
|
3401
|
+
get message() {
|
|
3402
|
+
return u(i).message;
|
|
3403
|
+
},
|
|
3404
|
+
get title() {
|
|
3405
|
+
return u(i).title;
|
|
3406
|
+
},
|
|
3407
|
+
get showIcon() {
|
|
3408
|
+
return u(i).showIcon;
|
|
3409
|
+
},
|
|
3410
|
+
get isAlert() {
|
|
3411
|
+
return u(f);
|
|
3412
|
+
}
|
|
3413
|
+
});
|
|
3414
|
+
}
|
|
3415
|
+
O(s), C(l, s);
|
|
3416
|
+
};
|
|
3417
|
+
z(a, (l) => {
|
|
3418
|
+
r().isFeedbackShown && u(i).message && l(c);
|
|
3419
|
+
});
|
|
3420
|
+
}
|
|
3421
|
+
return C(t, o), vt(n);
|
|
3422
|
+
}
|
|
3423
|
+
mt(oo, { feedbackState: {} }, [], [], !0);
|
|
3424
|
+
var ls = /* @__PURE__ */ U("<div><!></div>");
|
|
3425
|
+
function ve(t, e) {
|
|
3426
|
+
ht(e, !0);
|
|
3427
|
+
let r = A(e, "htmlString", 7, ""), i = A(e, "otherClass", 7, ""), n = A(e, "ariaHidden", 7, !1), o = A(e, "htmlHeading", 7, ""), a = /* @__PURE__ */ $(() => c(r(), o()));
|
|
3428
|
+
function c(p, m) {
|
|
3429
|
+
if (!p) return "";
|
|
3430
|
+
let h = p.replace(/<p><\/p>/g, "");
|
|
3431
|
+
return m && (h = `<${m}>${h}</${m}>`), h;
|
|
3432
|
+
}
|
|
3433
|
+
var l = {
|
|
3434
|
+
get htmlString() {
|
|
3435
|
+
return r();
|
|
3436
|
+
},
|
|
3437
|
+
set htmlString(p = "") {
|
|
3438
|
+
r(p), T();
|
|
3439
|
+
},
|
|
3440
|
+
get otherClass() {
|
|
3441
|
+
return i();
|
|
3442
|
+
},
|
|
3443
|
+
set otherClass(p = "") {
|
|
3444
|
+
i(p), T();
|
|
3445
|
+
},
|
|
3446
|
+
get ariaHidden() {
|
|
3447
|
+
return n();
|
|
3448
|
+
},
|
|
3449
|
+
set ariaHidden(p = !1) {
|
|
3450
|
+
n(p), T();
|
|
3451
|
+
},
|
|
3452
|
+
get htmlHeading() {
|
|
3453
|
+
return o();
|
|
3454
|
+
},
|
|
3455
|
+
set htmlHeading(p = "") {
|
|
3456
|
+
o(p), T();
|
|
3457
|
+
}
|
|
3458
|
+
}, s = et(), d = tt(s);
|
|
3459
|
+
{
|
|
3460
|
+
var f = (p) => {
|
|
3461
|
+
var m = ls(), h = H(m);
|
|
3462
|
+
Vn(h, () => u(a)), O(m), rt(() => {
|
|
3463
|
+
pt(m, 1, Yt(i())), G(m, "aria-hidden", n());
|
|
3464
|
+
}), C(p, m);
|
|
3465
|
+
};
|
|
3466
|
+
z(d, (p) => {
|
|
3467
|
+
u(a) && p(f);
|
|
3468
|
+
});
|
|
3469
|
+
}
|
|
3470
|
+
return C(t, s), vt(l);
|
|
3471
|
+
}
|
|
3472
|
+
mt(
|
|
3473
|
+
ve,
|
|
3474
|
+
{
|
|
3475
|
+
htmlString: {},
|
|
3476
|
+
otherClass: {},
|
|
3477
|
+
ariaHidden: {},
|
|
3478
|
+
htmlHeading: {}
|
|
3479
|
+
},
|
|
3480
|
+
[],
|
|
3481
|
+
[],
|
|
3482
|
+
!0
|
|
3483
|
+
);
|
|
3484
|
+
function ao(t, e) {
|
|
3485
|
+
ht(e, !0);
|
|
3486
|
+
let r = A(e, "rubric"), i = /* @__PURE__ */ $(() => sr(to));
|
|
3487
|
+
var n = {
|
|
3488
|
+
get rubric() {
|
|
3489
|
+
return r();
|
|
3490
|
+
},
|
|
3491
|
+
set rubric(l) {
|
|
3492
|
+
r(l), T();
|
|
3493
|
+
}
|
|
3494
|
+
}, o = et(), a = tt(o);
|
|
3495
|
+
{
|
|
3496
|
+
var c = (l) => {
|
|
3497
|
+
ve(l, {
|
|
3498
|
+
get htmlString() {
|
|
3499
|
+
return r();
|
|
3500
|
+
},
|
|
3501
|
+
otherClass: "item-heading mb-4",
|
|
3502
|
+
get htmlHeading() {
|
|
3503
|
+
return u(i);
|
|
3504
|
+
}
|
|
3505
|
+
});
|
|
3506
|
+
};
|
|
3507
|
+
z(a, (l) => {
|
|
3508
|
+
r() && l(c);
|
|
3509
|
+
});
|
|
3510
|
+
}
|
|
3511
|
+
return C(t, o), vt(n);
|
|
3512
|
+
}
|
|
3513
|
+
mt(ao, { rubric: {} }, [], [], !0);
|
|
3514
|
+
function cs(t) {
|
|
3515
|
+
if (!t)
|
|
3516
|
+
return {
|
|
3517
|
+
fileUrl: "",
|
|
3518
|
+
fileType: "",
|
|
3519
|
+
fileAlignment: Mr.DEFAULT,
|
|
3520
|
+
altText: "",
|
|
3521
|
+
longDescription: "",
|
|
3522
|
+
caption: "",
|
|
3523
|
+
stimulusText: "",
|
|
3524
|
+
stimulusTextAlignment: Mr.DEFAULT,
|
|
3525
|
+
stimulusLayoutOrder: Yi.MEDIA_FIRST,
|
|
3526
|
+
hasMedia: !1,
|
|
3527
|
+
hasText: !1
|
|
3528
|
+
};
|
|
3529
|
+
const {
|
|
3530
|
+
asset_alignment: e,
|
|
3531
|
+
alternative_text: r,
|
|
3532
|
+
long_description: i,
|
|
3533
|
+
description: n,
|
|
3534
|
+
file: o,
|
|
3535
|
+
stimulus_text: a,
|
|
3536
|
+
stimulus_text_alignment: c,
|
|
3537
|
+
stimulus_layout_order: l
|
|
3538
|
+
} = t, s = o?.url ?? "", d = o?.content_type ?? "", f = e ?? Mr.DEFAULT, p = c ?? Mr.DEFAULT, m = l ?? Yi.MEDIA_FIRST;
|
|
3539
|
+
return {
|
|
3540
|
+
fileUrl: s,
|
|
3541
|
+
fileType: d,
|
|
3542
|
+
fileAlignment: f,
|
|
3543
|
+
altText: r ?? "",
|
|
3544
|
+
longDescription: i ?? "",
|
|
3545
|
+
caption: n ?? "",
|
|
3546
|
+
stimulusText: a ?? "",
|
|
3547
|
+
stimulusTextAlignment: p,
|
|
3548
|
+
stimulusLayoutOrder: m,
|
|
3549
|
+
hasMedia: !!s,
|
|
3550
|
+
hasText: !!a
|
|
3551
|
+
};
|
|
3552
|
+
}
|
|
3553
|
+
function us(t, e = "") {
|
|
3554
|
+
return t.replace(/<table>/g, `<div class="table-container ${e}" tabindex="0"><table>`).replace(/<\/table>/g, "</table></div>");
|
|
3555
|
+
}
|
|
3556
|
+
function so(t, e) {
|
|
3557
|
+
ht(e, !0);
|
|
3558
|
+
let r = A(e, "prompt"), i = /* @__PURE__ */ $(() => us(r()));
|
|
3559
|
+
var n = {
|
|
3560
|
+
get prompt() {
|
|
3561
|
+
return r();
|
|
3562
|
+
},
|
|
3563
|
+
set prompt(l) {
|
|
3564
|
+
r(l), T();
|
|
3565
|
+
}
|
|
3566
|
+
}, o = et(), a = tt(o);
|
|
3567
|
+
{
|
|
3568
|
+
var c = (l) => {
|
|
3569
|
+
ve(l, {
|
|
3570
|
+
get htmlString() {
|
|
3571
|
+
return u(i);
|
|
3572
|
+
},
|
|
3573
|
+
otherClass: "item-heading prompt"
|
|
3574
|
+
});
|
|
3575
|
+
};
|
|
3576
|
+
z(a, (l) => {
|
|
3577
|
+
r() && l(c);
|
|
3578
|
+
});
|
|
3579
|
+
}
|
|
3580
|
+
return C(t, o), vt(n);
|
|
3581
|
+
}
|
|
3582
|
+
mt(so, { prompt: {} }, [], [], !0);
|
|
3583
|
+
var ds = /* @__PURE__ */ U('<div class="interaction-section"><!></div>');
|
|
3584
|
+
function lo(t, e) {
|
|
3585
|
+
ht(e, !0);
|
|
3586
|
+
let r = A(e, "children");
|
|
3587
|
+
var i = {
|
|
3588
|
+
get children() {
|
|
3589
|
+
return r();
|
|
3590
|
+
},
|
|
3591
|
+
set children(a) {
|
|
3592
|
+
r(a), T();
|
|
3593
|
+
}
|
|
3594
|
+
}, n = ds(), o = H(n);
|
|
3595
|
+
return ci(o, () => r() ?? Me), O(n), C(t, n), vt(i);
|
|
3596
|
+
}
|
|
3597
|
+
mt(lo, { children: {} }, [], [], !0);
|
|
3598
|
+
function fs(t) {
|
|
3599
|
+
t.key === "Enter" && (t.preventDefault(), t.currentTarget.classList.add("active"));
|
|
3600
|
+
}
|
|
3601
|
+
function ps(t, e) {
|
|
3602
|
+
t.key === "Enter" && (t.preventDefault(), t.currentTarget.classList.remove("active"), e());
|
|
3603
|
+
}
|
|
3604
|
+
var hs = /* @__PURE__ */ U('<p class="text-lg leading-[22px] text-blue-1000 font-semibold mt-4"> </p>'), vs = /* @__PURE__ */ U('<div class="mt-6 w-full"><button class="flex items-center font-semibold leading-[1.5] outline-none group w-fit h-11 text-charcoal" aria-controls="long-description-content" aria-labelledby="image-description-label" type="button"><div class="w-6 h-6 flex items-center justify-center mr-2"><!></div> <div id="image-description-label" class="image-description-accordion group-[.active]:border-b-2">Image Description</div></button> <div id="long-description-content"><!></div></div>'), ms = /* @__PURE__ */ U('<div class="flex flex-col justify-center items-center text-center"><img loading="lazy"/> <!></div> <!>', 1), gs = /* @__PURE__ */ U('<div class="w-full"><!></div>');
|
|
3605
|
+
function vi(t, e) {
|
|
3606
|
+
ht(e, !0);
|
|
3607
|
+
let r = A(e, "fileType"), i = A(e, "fileUrl"), n = A(e, "altText", 7, ""), o = A(e, "longDescription", 7, ""), a = A(e, "fileCaption", 7, ""), c = A(e, "handleImageLoad", 7, void 0), l = /* @__PURE__ */ ct(!1), s = /* @__PURE__ */ $(() => !!i()?.trim()), d = /* @__PURE__ */ $(() => r() === Ga.IMAGE || r()?.startsWith("image/")), f = /* @__PURE__ */ $(() => !!a()?.trim()), p = /* @__PURE__ */ $(() => !!o()?.trim());
|
|
3608
|
+
function m() {
|
|
3609
|
+
Q(l, !u(l));
|
|
3610
|
+
}
|
|
3611
|
+
var h = {
|
|
3612
|
+
get fileType() {
|
|
3613
|
+
return r();
|
|
3614
|
+
},
|
|
3615
|
+
set fileType(y) {
|
|
3616
|
+
r(y), T();
|
|
3617
|
+
},
|
|
3618
|
+
get fileUrl() {
|
|
3619
|
+
return i();
|
|
3620
|
+
},
|
|
3621
|
+
set fileUrl(y) {
|
|
3622
|
+
i(y), T();
|
|
3623
|
+
},
|
|
3624
|
+
get altText() {
|
|
3625
|
+
return n();
|
|
3626
|
+
},
|
|
3627
|
+
set altText(y = "") {
|
|
3628
|
+
n(y), T();
|
|
3629
|
+
},
|
|
3630
|
+
get longDescription() {
|
|
3631
|
+
return o();
|
|
3632
|
+
},
|
|
3633
|
+
set longDescription(y = "") {
|
|
3634
|
+
o(y), T();
|
|
3635
|
+
},
|
|
3636
|
+
get fileCaption() {
|
|
3637
|
+
return a();
|
|
3638
|
+
},
|
|
3639
|
+
set fileCaption(y = "") {
|
|
3640
|
+
a(y), T();
|
|
3641
|
+
},
|
|
3642
|
+
get handleImageLoad() {
|
|
3643
|
+
return c();
|
|
3644
|
+
},
|
|
3645
|
+
set handleImageLoad(y = void 0) {
|
|
3646
|
+
c(y), T();
|
|
3647
|
+
}
|
|
3648
|
+
}, w = et(), b = tt(w);
|
|
3649
|
+
{
|
|
3650
|
+
var I = (y) => {
|
|
3651
|
+
var V = gs(), E = H(V);
|
|
3652
|
+
{
|
|
3653
|
+
var _ = (g) => {
|
|
3654
|
+
var x = ms(), R = tt(x), K = H(R), k = ut(K, 2);
|
|
3655
|
+
{
|
|
3656
|
+
var M = (W) => {
|
|
3657
|
+
var P = hs(), Z = H(P, !0);
|
|
3658
|
+
O(P), rt(() => Qe(Z, a())), C(W, P);
|
|
3659
|
+
};
|
|
3660
|
+
z(k, (W) => {
|
|
3661
|
+
u(f) && W(M);
|
|
3662
|
+
});
|
|
3663
|
+
}
|
|
3664
|
+
O(R);
|
|
3665
|
+
var Y = ut(R, 2);
|
|
3666
|
+
{
|
|
3667
|
+
var X = (W) => {
|
|
3668
|
+
var P = vs(), Z = H(P);
|
|
3669
|
+
Z.__click = m, Z.__keydown = [fs], Z.__keyup = [ps, m];
|
|
3670
|
+
var At = H(Z), J = H(At);
|
|
3671
|
+
{
|
|
3672
|
+
let ne = /* @__PURE__ */ $(() => u(l) ? "smallChevronUp" : "smallChevronDown"), be = /* @__PURE__ */ $(() => u(l) ? "collapse-icon" : "expand-icon");
|
|
3673
|
+
Ce(J, {
|
|
3674
|
+
get svgName() {
|
|
3675
|
+
return u(ne);
|
|
3676
|
+
},
|
|
3677
|
+
get className() {
|
|
3678
|
+
return u(be);
|
|
3679
|
+
},
|
|
3680
|
+
width: 12,
|
|
3681
|
+
height: 7
|
|
3682
|
+
});
|
|
3683
|
+
}
|
|
3684
|
+
O(At), ki(2), O(Z);
|
|
3685
|
+
var Ct = ut(Z, 2), st = H(Ct);
|
|
3686
|
+
ve(st, {
|
|
3687
|
+
get htmlString() {
|
|
3688
|
+
return o();
|
|
3689
|
+
},
|
|
3690
|
+
otherClass: "image-description text-left leading-[1.5]"
|
|
3691
|
+
}), O(Ct), O(P), rt(() => {
|
|
3692
|
+
G(Z, "aria-expanded", u(l)), G(Ct, "hidden", !u(l));
|
|
3693
|
+
}), C(W, P);
|
|
3694
|
+
};
|
|
3695
|
+
z(Y, (W) => {
|
|
3696
|
+
u(p) && W(X);
|
|
3697
|
+
});
|
|
3698
|
+
}
|
|
3699
|
+
rt(() => {
|
|
3700
|
+
G(K, "src", i()), G(K, "alt", n());
|
|
3701
|
+
}), ga("load", K, function(...W) {
|
|
3702
|
+
c()?.apply(this, W);
|
|
3703
|
+
}), va(K), C(g, x);
|
|
3704
|
+
};
|
|
3705
|
+
z(E, (g) => {
|
|
3706
|
+
u(d) && g(_);
|
|
3707
|
+
});
|
|
3708
|
+
}
|
|
3709
|
+
O(V), C(y, V);
|
|
3710
|
+
};
|
|
3711
|
+
z(b, (y) => {
|
|
3712
|
+
u(s) && y(I);
|
|
3713
|
+
});
|
|
3714
|
+
}
|
|
3715
|
+
return C(t, w), vt(h);
|
|
3716
|
+
}
|
|
3717
|
+
qn(["click", "keydown", "keyup"]);
|
|
3718
|
+
mt(
|
|
3719
|
+
vi,
|
|
3720
|
+
{
|
|
3721
|
+
fileType: {},
|
|
3722
|
+
fileUrl: {},
|
|
3723
|
+
altText: {},
|
|
3724
|
+
longDescription: {},
|
|
3725
|
+
fileCaption: {},
|
|
3726
|
+
handleImageLoad: {}
|
|
3727
|
+
},
|
|
3728
|
+
[],
|
|
3729
|
+
[],
|
|
3730
|
+
!0
|
|
3731
|
+
);
|
|
3732
|
+
const ws = {
|
|
3733
|
+
name: "two-column",
|
|
3734
|
+
matches: (t) => t.stimulusData.hasMedia && t.stimulusData.fileAlignment === "default" || t.stimulusData.hasText && t.stimulusData.stimulusTextAlignment === "default",
|
|
3735
|
+
build: (t) => ({
|
|
3736
|
+
sections: [
|
|
3737
|
+
{
|
|
3738
|
+
name: "rubric",
|
|
3739
|
+
component: "rubric"
|
|
3740
|
+
},
|
|
3741
|
+
{
|
|
3742
|
+
name: "stimulus-inline-text-first",
|
|
3743
|
+
component: "stimulus-text",
|
|
3744
|
+
condition: t.stimulusData.hasText && t.stimulusData.stimulusTextAlignment === "inline" && t.stimulusData.stimulusLayoutOrder === "text first",
|
|
3745
|
+
classes: ["stimulus-text-container"],
|
|
3746
|
+
styles: { "--stimulusTextWidth": "100%" }
|
|
3747
|
+
},
|
|
3748
|
+
{
|
|
3749
|
+
name: "stimulus-inline-media",
|
|
3750
|
+
component: "stimulus-media",
|
|
3751
|
+
condition: t.stimulusData.hasMedia && t.stimulusData.fileAlignment === "inline",
|
|
3752
|
+
classes: ["pb-2", "lg:pb-10"]
|
|
3753
|
+
},
|
|
3754
|
+
{
|
|
3755
|
+
name: "stimulus-inline-text-second",
|
|
3756
|
+
component: "stimulus-text",
|
|
3757
|
+
condition: t.stimulusData.hasText && t.stimulusData.stimulusTextAlignment === "inline" && t.stimulusData.stimulusLayoutOrder === "media first",
|
|
3758
|
+
classes: ["stimulus-text-container"],
|
|
3759
|
+
styles: { "--stimulusTextWidth": "100%" }
|
|
3760
|
+
},
|
|
3761
|
+
{
|
|
3762
|
+
name: "prompt",
|
|
3763
|
+
component: "prompt"
|
|
3764
|
+
},
|
|
3765
|
+
{
|
|
3766
|
+
name: "stimulus-mobile-text-first",
|
|
3767
|
+
component: "stimulus-text",
|
|
3768
|
+
condition: t.stimulusData.hasText && t.stimulusData.stimulusTextAlignment === "default" && t.stimulusData.stimulusLayoutOrder === "text first",
|
|
3769
|
+
classes: ["lg:hidden", "text-stimulus", "pb-0"]
|
|
3770
|
+
},
|
|
3771
|
+
{
|
|
3772
|
+
name: "stimulus-mobile-media",
|
|
3773
|
+
component: "stimulus-media",
|
|
3774
|
+
condition: t.stimulusData.hasMedia && t.stimulusData.fileAlignment === "default",
|
|
3775
|
+
classes: ["lg:hidden", "pt-4", "lg:pt-6"]
|
|
3776
|
+
},
|
|
3777
|
+
{
|
|
3778
|
+
name: "stimulus-mobile-text-second",
|
|
3779
|
+
component: "stimulus-text",
|
|
3780
|
+
condition: t.stimulusData.hasText && t.stimulusData.stimulusTextAlignment === "default" && t.stimulusData.stimulusLayoutOrder === "media first",
|
|
3781
|
+
classes: ["lg:hidden", "text-stimulus", "pb-0"]
|
|
3782
|
+
},
|
|
3783
|
+
{
|
|
3784
|
+
name: "divider",
|
|
3785
|
+
component: "divider",
|
|
3786
|
+
condition: t.hasDivider
|
|
3787
|
+
},
|
|
3788
|
+
{
|
|
3789
|
+
name: "interaction",
|
|
3790
|
+
component: "slot",
|
|
3791
|
+
slot: "interaction"
|
|
3792
|
+
},
|
|
3793
|
+
{
|
|
3794
|
+
name: "feedback",
|
|
3795
|
+
component: "slot",
|
|
3796
|
+
slot: "feedback"
|
|
3797
|
+
},
|
|
3798
|
+
{
|
|
3799
|
+
name: "desktop-column",
|
|
3800
|
+
component: "desktop-column",
|
|
3801
|
+
condition: t.stimulusData.hasMedia && t.stimulusData.fileAlignment === "default" || t.stimulusData.hasText && t.stimulusData.stimulusTextAlignment === "default",
|
|
3802
|
+
classes: ["hidden", "lg:block", "lg:basis-1/2", "lg:flex-1", "lg:pl-24", "h-fit"]
|
|
3803
|
+
}
|
|
3804
|
+
],
|
|
3805
|
+
containerClasses: ["lg:w-full", "lg:flex"],
|
|
3806
|
+
containerStyles: { "--interactionWidthValue": "100%" }
|
|
3807
|
+
})
|
|
3808
|
+
}, co = {
|
|
3809
|
+
name: "single-column",
|
|
3810
|
+
matches: () => !0,
|
|
3811
|
+
// Fallback
|
|
3812
|
+
build: (t) => ({
|
|
3813
|
+
sections: [
|
|
3814
|
+
{
|
|
3815
|
+
name: "rubric",
|
|
3816
|
+
component: "rubric"
|
|
3817
|
+
},
|
|
3818
|
+
{
|
|
3819
|
+
name: "stimulus-text",
|
|
3820
|
+
component: "stimulus-text",
|
|
3821
|
+
condition: t.stimulusData.hasText && t.stimulusData.stimulusTextAlignment === "inline"
|
|
3822
|
+
},
|
|
3823
|
+
{
|
|
3824
|
+
name: "stimulus-media",
|
|
3825
|
+
component: "stimulus-media",
|
|
3826
|
+
condition: t.stimulusData.hasMedia && t.stimulusData.fileAlignment === "inline"
|
|
3827
|
+
},
|
|
3828
|
+
{
|
|
3829
|
+
name: "prompt",
|
|
3830
|
+
component: "prompt"
|
|
3831
|
+
},
|
|
3832
|
+
{
|
|
3833
|
+
name: "divider",
|
|
3834
|
+
component: "divider",
|
|
3835
|
+
condition: t.hasDivider
|
|
3836
|
+
},
|
|
3837
|
+
{
|
|
3838
|
+
name: "interaction",
|
|
3839
|
+
component: "slot",
|
|
3840
|
+
slot: "interaction"
|
|
3841
|
+
},
|
|
3842
|
+
{
|
|
3843
|
+
name: "feedback",
|
|
3844
|
+
component: "slot",
|
|
3845
|
+
slot: "feedback"
|
|
3846
|
+
}
|
|
3847
|
+
],
|
|
3848
|
+
containerClasses: ["container-class"],
|
|
3849
|
+
containerStyles: { "--interactionWidthValue": "100%" }
|
|
3850
|
+
})
|
|
3851
|
+
}, bs = {
|
|
3852
|
+
name: "mcq-media",
|
|
3853
|
+
matches: (t) => t.interactionType === "mcq" && t.optionHasMedia,
|
|
3854
|
+
build: (t) => ({
|
|
3855
|
+
sections: [
|
|
3856
|
+
{ name: "rubric", component: "rubric" },
|
|
3857
|
+
{
|
|
3858
|
+
name: "stimulus-text",
|
|
3859
|
+
component: "stimulus-text",
|
|
3860
|
+
condition: t.stimulusData.hasText
|
|
3861
|
+
},
|
|
3862
|
+
{
|
|
3863
|
+
name: "stimulus-media",
|
|
3864
|
+
component: "stimulus-media",
|
|
3865
|
+
condition: t.stimulusData.hasMedia
|
|
3866
|
+
},
|
|
3867
|
+
{ name: "prompt", component: "prompt" },
|
|
3868
|
+
{ name: "divider", component: "divider", condition: t.hasDivider },
|
|
3869
|
+
{ name: "interaction", component: "slot", slot: "interaction" },
|
|
3870
|
+
{ name: "feedback", component: "slot", slot: "feedback" }
|
|
3871
|
+
],
|
|
3872
|
+
containerClasses: ["mcq-media-container"],
|
|
3873
|
+
containerStyles: { "--interactionWidthValue": "50%" }
|
|
3874
|
+
})
|
|
3875
|
+
}, _s = [
|
|
3876
|
+
bs,
|
|
3877
|
+
// Most specific first
|
|
3878
|
+
ws,
|
|
3879
|
+
// More specific
|
|
3880
|
+
co
|
|
3881
|
+
// Fallback (always matches)
|
|
3882
|
+
], ys = (t) => _s.find((e) => e.matches(t)) || co, Zi = (t) => t.condition !== !1, Gr = (t = []) => t.join(" "), Kr = (t = {}) => Object.entries(t).map(([e, r]) => `${e}:${r}`).join(";");
|
|
3883
|
+
var xs = /* @__PURE__ */ U('<div class="divider my-6"></div>'), Cs = /* @__PURE__ */ U("<div><!></div>"), ks = /* @__PURE__ */ U("<div><!> <!> <!></div>"), Ts = /* @__PURE__ */ U('<div class="prompt-container svelte-1j0p2ko"><div><div></div> <!></div></div>');
|
|
3884
|
+
const Es = {
|
|
3885
|
+
hash: "svelte-1j0p2ko",
|
|
3886
|
+
code: '.prompt-container.svelte-1j0p2ko{width:100%}@media only screen and (min-width:1196px){.prompt-container.svelte-1j0p2ko [style*="--interactionWidthValue"]:where(.svelte-1j0p2ko){max-width:var(--interactionWidthValue,100%);overflow:visible}.stimulus-text-container.svelte-1j0p2ko{max-width:none;overflow:visible;position:relative;width:var(--stimulusTextWidth,100%);z-index:1}}@media only screen and (min-width:1440px){.mcq-media-container.svelte-1j0p2ko{max-width:720px}.mcq-media-container-stimulus.svelte-1j0p2ko{max-width:1310px}}'
|
|
3887
|
+
};
|
|
3888
|
+
function uo(t, e) {
|
|
3889
|
+
ht(e, !0), Un(t, Es);
|
|
3890
|
+
let r = A(e, "rubric", 7, ""), i = A(e, "prompt", 7, ""), n = A(e, "interactionType"), o = A(e, "hasDivider", 7, !0), a = A(e, "stimulus", 7, null), c = A(e, "optionHasMedia", 7, !1), l = A(e, "interaction"), s = A(e, "feedback"), d = /* @__PURE__ */ $(() => cs(a())), f = /* @__PURE__ */ $(() => ({
|
|
3891
|
+
interactionType: n(),
|
|
3892
|
+
stimulusData: u(d),
|
|
3893
|
+
optionHasMedia: c(),
|
|
3894
|
+
rubric: r(),
|
|
3895
|
+
prompt: i(),
|
|
3896
|
+
hasDivider: o()
|
|
3897
|
+
})), p = /* @__PURE__ */ $(() => n() === Ii.CATEGORISE && !a() ? "100%" : c() ? "50%" : sr(eo)), m = /* @__PURE__ */ $(() => ys(u(f))), h = /* @__PURE__ */ $(() => u(m).build(u(f))), w = /* @__PURE__ */ $(() => ({
|
|
3898
|
+
...u(h),
|
|
3899
|
+
containerStyles: {
|
|
3900
|
+
...u(h).containerStyles,
|
|
3901
|
+
"--interactionWidthValue": u(p)
|
|
3902
|
+
}
|
|
3903
|
+
}));
|
|
3904
|
+
var b = {
|
|
3905
|
+
get rubric() {
|
|
3906
|
+
return r();
|
|
3907
|
+
},
|
|
3908
|
+
set rubric(_ = "") {
|
|
3909
|
+
r(_), T();
|
|
3910
|
+
},
|
|
3911
|
+
get prompt() {
|
|
3912
|
+
return i();
|
|
3913
|
+
},
|
|
3914
|
+
set prompt(_ = "") {
|
|
3915
|
+
i(_), T();
|
|
3916
|
+
},
|
|
3917
|
+
get interactionType() {
|
|
3918
|
+
return n();
|
|
3919
|
+
},
|
|
3920
|
+
set interactionType(_) {
|
|
3921
|
+
n(_), T();
|
|
3922
|
+
},
|
|
3923
|
+
get hasDivider() {
|
|
3924
|
+
return o();
|
|
3925
|
+
},
|
|
3926
|
+
set hasDivider(_ = !0) {
|
|
3927
|
+
o(_), T();
|
|
3928
|
+
},
|
|
3929
|
+
get stimulus() {
|
|
3930
|
+
return a();
|
|
3931
|
+
},
|
|
3932
|
+
set stimulus(_ = null) {
|
|
3933
|
+
a(_), T();
|
|
3934
|
+
},
|
|
3935
|
+
get optionHasMedia() {
|
|
3936
|
+
return c();
|
|
3937
|
+
},
|
|
3938
|
+
set optionHasMedia(_ = !1) {
|
|
3939
|
+
c(_), T();
|
|
3940
|
+
},
|
|
3941
|
+
get interaction() {
|
|
3942
|
+
return l();
|
|
3943
|
+
},
|
|
3944
|
+
set interaction(_) {
|
|
3945
|
+
l(_), T();
|
|
3946
|
+
},
|
|
3947
|
+
get feedback() {
|
|
3948
|
+
return s();
|
|
3949
|
+
},
|
|
3950
|
+
set feedback(_) {
|
|
3951
|
+
s(_), T();
|
|
3952
|
+
}
|
|
3953
|
+
}, I = Ts(), y = H(I), V = H(y);
|
|
3954
|
+
di(V, 21, () => u(w).sections, ui, (_, g) => {
|
|
3955
|
+
var x = et(), R = tt(x);
|
|
3956
|
+
{
|
|
3957
|
+
var K = (k) => {
|
|
3958
|
+
var M = Cs(), Y = H(M);
|
|
3959
|
+
{
|
|
3960
|
+
var X = (P) => {
|
|
3961
|
+
ao(P, {
|
|
3962
|
+
get rubric() {
|
|
3963
|
+
return r();
|
|
3964
|
+
}
|
|
3965
|
+
});
|
|
3966
|
+
}, W = (P) => {
|
|
3967
|
+
var Z = et(), At = tt(Z);
|
|
3968
|
+
{
|
|
3969
|
+
var J = (st) => {
|
|
3970
|
+
so(st, {
|
|
3971
|
+
get prompt() {
|
|
3972
|
+
return i();
|
|
3973
|
+
}
|
|
3974
|
+
});
|
|
3975
|
+
}, Ct = (st) => {
|
|
3976
|
+
var ne = et(), be = tt(ne);
|
|
3977
|
+
{
|
|
3978
|
+
var lr = (S) => {
|
|
3979
|
+
ve(S, {
|
|
3980
|
+
get htmlString() {
|
|
3981
|
+
return u(d).stimulusText;
|
|
3982
|
+
},
|
|
3983
|
+
otherClass: "text-stimulus py-2"
|
|
3984
|
+
});
|
|
3985
|
+
}, cr = (S) => {
|
|
3986
|
+
var q = et(), gt = tt(q);
|
|
3987
|
+
{
|
|
3988
|
+
var ur = (nt) => {
|
|
3989
|
+
vi(nt, {
|
|
3990
|
+
get fileUrl() {
|
|
3991
|
+
return u(d).fileUrl;
|
|
3992
|
+
},
|
|
3993
|
+
get fileType() {
|
|
3994
|
+
return u(d).fileType;
|
|
3995
|
+
},
|
|
3996
|
+
get altText() {
|
|
3997
|
+
return u(d).altText;
|
|
3998
|
+
},
|
|
3999
|
+
get longDescription() {
|
|
4000
|
+
return u(d).longDescription;
|
|
4001
|
+
},
|
|
4002
|
+
get fileCaption() {
|
|
4003
|
+
return u(d).caption;
|
|
4004
|
+
}
|
|
4005
|
+
});
|
|
4006
|
+
}, _e = (nt) => {
|
|
4007
|
+
var kr = et(), vo = tt(kr);
|
|
4008
|
+
{
|
|
4009
|
+
var mo = (He) => {
|
|
4010
|
+
var Tr = xs();
|
|
4011
|
+
C(He, Tr);
|
|
4012
|
+
}, go = (He) => {
|
|
4013
|
+
var Tr = et(), wo = tt(Tr);
|
|
4014
|
+
{
|
|
4015
|
+
var bo = (ze) => {
|
|
4016
|
+
lo(ze, {
|
|
4017
|
+
children: (Er, Di) => {
|
|
4018
|
+
var Ar = et(), dr = tt(Ar);
|
|
4019
|
+
ci(dr, () => l() ?? Me), C(Er, Ar);
|
|
4020
|
+
},
|
|
4021
|
+
$$slots: { default: !0 }
|
|
4022
|
+
});
|
|
4023
|
+
}, _o = (ze) => {
|
|
4024
|
+
var Er = et(), Di = tt(Er);
|
|
4025
|
+
{
|
|
4026
|
+
var Ar = (dr) => {
|
|
4027
|
+
var Oi = et(), yo = tt(Oi);
|
|
4028
|
+
ci(yo, () => s() ?? Me), C(dr, Oi);
|
|
4029
|
+
};
|
|
4030
|
+
z(
|
|
4031
|
+
Di,
|
|
4032
|
+
(dr) => {
|
|
4033
|
+
u(g).component === "slot" && u(g).slot === "feedback" && dr(Ar);
|
|
4034
|
+
},
|
|
4035
|
+
!0
|
|
4036
|
+
);
|
|
4037
|
+
}
|
|
4038
|
+
C(ze, Er);
|
|
4039
|
+
};
|
|
4040
|
+
z(
|
|
4041
|
+
wo,
|
|
4042
|
+
(ze) => {
|
|
4043
|
+
u(g).component === "slot" && u(g).slot === "interaction" ? ze(bo) : ze(_o, !1);
|
|
4044
|
+
},
|
|
4045
|
+
!0
|
|
4046
|
+
);
|
|
4047
|
+
}
|
|
4048
|
+
C(He, Tr);
|
|
4049
|
+
};
|
|
4050
|
+
z(
|
|
4051
|
+
vo,
|
|
4052
|
+
(He) => {
|
|
4053
|
+
u(g).component === "divider" ? He(mo) : He(go, !1);
|
|
4054
|
+
},
|
|
4055
|
+
!0
|
|
4056
|
+
);
|
|
4057
|
+
}
|
|
4058
|
+
C(nt, kr);
|
|
4059
|
+
};
|
|
4060
|
+
z(
|
|
4061
|
+
gt,
|
|
4062
|
+
(nt) => {
|
|
4063
|
+
u(g).component === "stimulus-media" ? nt(ur) : nt(_e, !1);
|
|
4064
|
+
},
|
|
4065
|
+
!0
|
|
4066
|
+
);
|
|
4067
|
+
}
|
|
4068
|
+
C(S, q);
|
|
4069
|
+
};
|
|
4070
|
+
z(
|
|
4071
|
+
be,
|
|
4072
|
+
(S) => {
|
|
4073
|
+
u(g).component === "stimulus-text" ? S(lr) : S(cr, !1);
|
|
4074
|
+
},
|
|
4075
|
+
!0
|
|
4076
|
+
);
|
|
4077
|
+
}
|
|
4078
|
+
C(st, ne);
|
|
4079
|
+
};
|
|
4080
|
+
z(
|
|
4081
|
+
At,
|
|
4082
|
+
(st) => {
|
|
4083
|
+
u(g).component === "prompt" ? st(J) : st(Ct, !1);
|
|
4084
|
+
},
|
|
4085
|
+
!0
|
|
4086
|
+
);
|
|
4087
|
+
}
|
|
4088
|
+
C(P, Z);
|
|
4089
|
+
};
|
|
4090
|
+
z(Y, (P) => {
|
|
4091
|
+
u(g).component === "rubric" ? P(X) : P(W, !1);
|
|
4092
|
+
});
|
|
4093
|
+
}
|
|
4094
|
+
O(M), rt(
|
|
4095
|
+
(P, Z) => {
|
|
4096
|
+
pt(M, 1, P, "svelte-1j0p2ko"), Qr(M, Z);
|
|
4097
|
+
},
|
|
4098
|
+
[
|
|
4099
|
+
() => Yt(Gr(u(g).classes)),
|
|
4100
|
+
() => Kr(u(g).styles)
|
|
4101
|
+
]
|
|
4102
|
+
), C(k, M);
|
|
4103
|
+
};
|
|
4104
|
+
z(R, (k) => {
|
|
4105
|
+
Zi(u(g)) && u(g).component !== "desktop-column" && k(K);
|
|
4106
|
+
});
|
|
4107
|
+
}
|
|
4108
|
+
C(_, x);
|
|
4109
|
+
}), O(V);
|
|
4110
|
+
var E = ut(V, 2);
|
|
4111
|
+
return di(E, 17, () => u(w).sections, ui, (_, g) => {
|
|
4112
|
+
var x = et(), R = tt(x);
|
|
4113
|
+
{
|
|
4114
|
+
var K = (k) => {
|
|
4115
|
+
var M = ks(), Y = H(M);
|
|
4116
|
+
{
|
|
4117
|
+
var X = (J) => {
|
|
4118
|
+
ve(J, {
|
|
4119
|
+
get htmlString() {
|
|
4120
|
+
return u(d).stimulusText;
|
|
4121
|
+
},
|
|
4122
|
+
otherClass: "text-stimulus pt-0"
|
|
4123
|
+
});
|
|
4124
|
+
};
|
|
4125
|
+
z(Y, (J) => {
|
|
4126
|
+
u(d).hasText && u(d).stimulusTextAlignment === "default" && u(d).stimulusLayoutOrder === "text first" && J(X);
|
|
4127
|
+
});
|
|
4128
|
+
}
|
|
4129
|
+
var W = ut(Y, 2);
|
|
4130
|
+
{
|
|
4131
|
+
var P = (J) => {
|
|
4132
|
+
vi(J, {
|
|
4133
|
+
get fileUrl() {
|
|
4134
|
+
return u(d).fileUrl;
|
|
4135
|
+
},
|
|
4136
|
+
get fileType() {
|
|
4137
|
+
return u(d).fileType;
|
|
4138
|
+
},
|
|
4139
|
+
get altText() {
|
|
4140
|
+
return u(d).altText;
|
|
4141
|
+
},
|
|
4142
|
+
get longDescription() {
|
|
4143
|
+
return u(d).longDescription;
|
|
4144
|
+
},
|
|
4145
|
+
get fileCaption() {
|
|
4146
|
+
return u(d).caption;
|
|
4147
|
+
}
|
|
4148
|
+
});
|
|
4149
|
+
};
|
|
4150
|
+
z(W, (J) => {
|
|
4151
|
+
u(d).hasMedia && u(d).fileAlignment === "default" && J(P);
|
|
4152
|
+
});
|
|
4153
|
+
}
|
|
4154
|
+
var Z = ut(W, 2);
|
|
4155
|
+
{
|
|
4156
|
+
var At = (J) => {
|
|
4157
|
+
{
|
|
4158
|
+
let Ct = /* @__PURE__ */ $(() => u(d).hasMedia ? "" : "pt-0");
|
|
4159
|
+
ve(J, {
|
|
4160
|
+
get htmlString() {
|
|
4161
|
+
return u(d).stimulusText;
|
|
4162
|
+
},
|
|
4163
|
+
get otherClass() {
|
|
4164
|
+
return `text-stimulus ${u(Ct) ?? ""}`;
|
|
4165
|
+
}
|
|
4166
|
+
});
|
|
4167
|
+
}
|
|
4168
|
+
};
|
|
4169
|
+
z(Z, (J) => {
|
|
4170
|
+
u(d).hasText && u(d).stimulusTextAlignment === "default" && u(d).stimulusLayoutOrder === "media first" && J(At);
|
|
4171
|
+
});
|
|
4172
|
+
}
|
|
4173
|
+
O(M), rt(
|
|
4174
|
+
(J, Ct) => {
|
|
4175
|
+
pt(M, 1, J, "svelte-1j0p2ko"), Qr(M, Ct);
|
|
4176
|
+
},
|
|
4177
|
+
[
|
|
4178
|
+
() => Yt(Gr(u(g).classes)),
|
|
4179
|
+
() => Kr(u(g).styles)
|
|
4180
|
+
]
|
|
4181
|
+
), C(k, M);
|
|
4182
|
+
};
|
|
4183
|
+
z(R, (k) => {
|
|
4184
|
+
Zi(u(g)) && u(g).component === "desktop-column" && k(K);
|
|
4185
|
+
});
|
|
4186
|
+
}
|
|
4187
|
+
C(_, x);
|
|
4188
|
+
}), O(y), O(I), rt(
|
|
4189
|
+
(_, g) => {
|
|
4190
|
+
pt(y, 1, _, "svelte-1j0p2ko"), Qr(y, g), pt(V, 1, `bg-transparent relative ${u(m).name === "two-column" ? "lg:basis-1/2 lg:max-w-[50%]" : ""}`);
|
|
4191
|
+
},
|
|
4192
|
+
[
|
|
4193
|
+
() => Yt(Gr(u(w).containerClasses)),
|
|
4194
|
+
() => Kr(u(w).containerStyles)
|
|
4195
|
+
]
|
|
4196
|
+
), C(t, I), vt(b);
|
|
4197
|
+
}
|
|
4198
|
+
mt(
|
|
4199
|
+
uo,
|
|
4200
|
+
{
|
|
4201
|
+
rubric: {},
|
|
4202
|
+
prompt: {},
|
|
4203
|
+
interactionType: {},
|
|
4204
|
+
hasDivider: {},
|
|
4205
|
+
stimulus: {},
|
|
4206
|
+
optionHasMedia: {},
|
|
4207
|
+
interaction: {},
|
|
4208
|
+
feedback: {}
|
|
4209
|
+
},
|
|
4210
|
+
[],
|
|
4211
|
+
[],
|
|
4212
|
+
!0
|
|
4213
|
+
);
|
|
4214
|
+
const Xr = (t) => t.replace(/<\/p>/g, " ").replace(/<[^>]*>/g, "").trim();
|
|
4215
|
+
var As = /* @__PURE__ */ U('<p class="text-charcoal text-sm leading-[19.2px] mb-2"> </p>'), Ss = (t, e, r) => e()(r().id, r().answer), Ms = /* @__PURE__ */ U('<span class="text-gray-860 text-sm mb-0.5"> </span>'), $s = /* @__PURE__ */ U('<span class="text-gray-860 text-sm mb-0.5">Missing answer:</span>'), Ls = /* @__PURE__ */ U('<span aria-hidden="true" class="text-green-900 mr-1"><!></span>'), Is = /* @__PURE__ */ U('<span aria-hidden="true"><!></span>'), Rs = /* @__PURE__ */ U('<span class="w-3 h-2 flex items-center justify-center"><!></span>'), Ds = /* @__PURE__ */ U("<span><!></span>"), Os = /* @__PURE__ */ U('<div class="w-full overflow-hidden bg-white rounded-b-lg flex items-center justify-center"><img class="min-h-[154px] max-h-[184px] w-auto max-w-full object-contain pointer-events-none" loading="lazy"/></div>'), Ns = /* @__PURE__ */ U('<!> <button><span><span class="flex items-center justify-between w-full"><span class="flex items-center"><span> </span> <span class="flex flex-col px-3 text-left"><!> <!> <!></span></span> <span class="flex items-center"><!> <!> <!></span></span></span> <!></button>', 1);
|
|
4216
|
+
function fo(t, e) {
|
|
4217
|
+
ht(e, !0);
|
|
4218
|
+
let r = A(e, "option"), i = A(e, "index"), n = A(e, "config"), o = A(e, "state"), a = A(e, "optionHasMedia", 7, !1), c = A(e, "onOptionClick"), l = /* @__PURE__ */ $(() => Ri(o(), n())), s = /* @__PURE__ */ $(() => as(r(), i(), n(), o(), a())), d = /* @__PURE__ */ $(() => u(l).totalCorrectAnswers), f = /* @__PURE__ */ $(() => u(l).correctAnswerIds), p = /* @__PURE__ */ $(() => u(l).isPreviewMode), m = /* @__PURE__ */ $(() => u(l).isPreviewModeInteractive);
|
|
4219
|
+
const h = () => {
|
|
4220
|
+
if (!u(s))
|
|
4221
|
+
return `Option ${$r(i())}: ${Xr(r().answer)}`;
|
|
4222
|
+
const S = o().data.selectedOptions ?? [];
|
|
4223
|
+
let q = `${(!u(s).isFinished || u(m)) && u(s).isSelected ? "Selected " : ""}Option ${$r(i())}: ${Xr(r().answer)}`;
|
|
4224
|
+
return u(s).isFinished && !u(p) && !u(m) ? u(s).isCorrect ? q += u(s).isSelected ? " (Correct answer)" : " (Missing Answer)" : u(s).isSelected && (q += " (Incorrect answer)") : u(p) && !u(m) ? u(s).isCorrect && (q += " (Correct answer)") : u(m) && S.length === u(d) && (u(s).isSelected ? q += u(s).isCorrect ? " (Correct answer)" : " (Incorrect answer)" : u(s).isCorrect && (q += " (Missing Answer)")), q;
|
|
4225
|
+
};
|
|
4226
|
+
let w = /* @__PURE__ */ $(() => u(s) ? h() : `Option ${$r(i())}: ${Xr(r().answer)}`);
|
|
4227
|
+
var b = {
|
|
4228
|
+
get option() {
|
|
4229
|
+
return r();
|
|
4230
|
+
},
|
|
4231
|
+
set option(S) {
|
|
4232
|
+
r(S), T();
|
|
4233
|
+
},
|
|
4234
|
+
get index() {
|
|
4235
|
+
return i();
|
|
4236
|
+
},
|
|
4237
|
+
set index(S) {
|
|
4238
|
+
i(S), T();
|
|
4239
|
+
},
|
|
4240
|
+
get config() {
|
|
4241
|
+
return n();
|
|
4242
|
+
},
|
|
4243
|
+
set config(S) {
|
|
4244
|
+
n(S), T();
|
|
4245
|
+
},
|
|
4246
|
+
get state() {
|
|
4247
|
+
return o();
|
|
4248
|
+
},
|
|
4249
|
+
set state(S) {
|
|
4250
|
+
o(S), T();
|
|
4251
|
+
},
|
|
4252
|
+
get optionHasMedia() {
|
|
4253
|
+
return a();
|
|
4254
|
+
},
|
|
4255
|
+
set optionHasMedia(S = !1) {
|
|
4256
|
+
a(S), T();
|
|
4257
|
+
},
|
|
4258
|
+
get onOptionClick() {
|
|
4259
|
+
return c();
|
|
4260
|
+
},
|
|
4261
|
+
set onOptionClick(S) {
|
|
4262
|
+
c(S), T();
|
|
4263
|
+
}
|
|
4264
|
+
}, I = Ns(), y = tt(I);
|
|
4265
|
+
{
|
|
4266
|
+
var V = (S) => {
|
|
4267
|
+
var q = As(), gt = H(q, !0);
|
|
4268
|
+
O(q), rt(() => Qe(gt, u(m) ? "Your answer:" : u(p) ? "" : "Student's answer:")), C(S, q);
|
|
4269
|
+
};
|
|
4270
|
+
z(y, (S) => {
|
|
4271
|
+
u(s)?.showStudentLabel && S(V);
|
|
4272
|
+
});
|
|
4273
|
+
}
|
|
4274
|
+
var E = ut(y, 2);
|
|
4275
|
+
E.__click = [Ss, c, r];
|
|
4276
|
+
var _ = H(E), g = H(_), x = H(g), R = H(x), K = H(R, !0);
|
|
4277
|
+
O(R);
|
|
4278
|
+
var k = ut(R, 2), M = H(k);
|
|
4279
|
+
{
|
|
4280
|
+
var Y = (S) => {
|
|
4281
|
+
var q = Ms(), gt = H(q, !0);
|
|
4282
|
+
O(q), rt(() => Qe(gt, u(m) ? "Your answer:" : u(p) ? "" : "Student's answer:")), C(S, q);
|
|
4283
|
+
};
|
|
4284
|
+
z(M, (S) => {
|
|
4285
|
+
u(s)?.showMediaStudentLabel && S(Y);
|
|
4286
|
+
});
|
|
4287
|
+
}
|
|
4288
|
+
var X = ut(M, 2);
|
|
4289
|
+
{
|
|
4290
|
+
var W = (S) => {
|
|
4291
|
+
var q = $s();
|
|
4292
|
+
C(S, q);
|
|
4293
|
+
};
|
|
4294
|
+
z(X, (S) => {
|
|
4295
|
+
u(s)?.showMissingAnswerLabel && S(W);
|
|
4296
|
+
});
|
|
4297
|
+
}
|
|
4298
|
+
var P = ut(X, 2);
|
|
4299
|
+
ve(P, {
|
|
4300
|
+
otherClass: "overflow-hidden text-ellipsis line-clamp-3",
|
|
4301
|
+
get htmlString() {
|
|
4302
|
+
return r().answer;
|
|
4303
|
+
}
|
|
4304
|
+
}), O(k), O(x);
|
|
4305
|
+
var Z = ut(x, 2), At = H(Z);
|
|
4306
|
+
{
|
|
4307
|
+
var J = (S) => {
|
|
4308
|
+
var q = Ls(), gt = H(q);
|
|
4309
|
+
Ce(gt, { svgName: "success", className: "missing-correct-icon" }), O(q), C(S, q);
|
|
4310
|
+
};
|
|
4311
|
+
z(At, (S) => {
|
|
4312
|
+
u(s)?.showMissingIcon && S(J);
|
|
4313
|
+
});
|
|
4314
|
+
}
|
|
4315
|
+
var Ct = ut(At, 2);
|
|
4316
|
+
{
|
|
4317
|
+
var st = (S) => {
|
|
4318
|
+
var q = Is(), gt = H(q);
|
|
4319
|
+
{
|
|
4320
|
+
var ur = (nt) => {
|
|
4321
|
+
Ce(nt, { svgName: "successSolid", className: "correct-icon" });
|
|
4322
|
+
}, _e = (nt) => {
|
|
4323
|
+
Ce(nt, { svgName: "errorSolid", className: "incorrect-icon" });
|
|
4324
|
+
};
|
|
4325
|
+
z(gt, (nt) => {
|
|
4326
|
+
u(f).includes(r().id) || u(p) && !u(m) ? nt(ur) : nt(_e, !1);
|
|
4327
|
+
});
|
|
4328
|
+
}
|
|
4329
|
+
O(q), rt((nt) => pt(q, 1, `${nt ?? ""} p-0.5`), [
|
|
4330
|
+
() => u(f).includes(r().id) || u(p) && !u(m) ? "text-green-900" : "text-red-900"
|
|
4331
|
+
]), C(S, q);
|
|
4332
|
+
};
|
|
4333
|
+
z(Ct, (S) => {
|
|
4334
|
+
u(s)?.showResultIcon && S(st);
|
|
4335
|
+
});
|
|
4336
|
+
}
|
|
4337
|
+
var ne = ut(Ct, 2);
|
|
4338
|
+
{
|
|
4339
|
+
var be = (S) => {
|
|
4340
|
+
var q = Ds(), gt = H(q);
|
|
4341
|
+
{
|
|
4342
|
+
var ur = (_e) => {
|
|
4343
|
+
var nt = Rs(), kr = H(nt);
|
|
4344
|
+
Ce(kr, { svgName: "successRounded", className: "selected-icon" }), O(nt), C(_e, nt);
|
|
4345
|
+
};
|
|
4346
|
+
z(gt, (_e) => {
|
|
4347
|
+
u(s)?.isSelected && _e(ur);
|
|
4348
|
+
});
|
|
4349
|
+
}
|
|
4350
|
+
O(q), rt(() => pt(q, 1, Yt(u(s)?.checkboxClasses || "custom-checkbox border-gray-850"))), C(S, q);
|
|
4351
|
+
};
|
|
4352
|
+
z(ne, (S) => {
|
|
4353
|
+
u(s)?.showCheckbox && S(be);
|
|
4354
|
+
});
|
|
4355
|
+
}
|
|
4356
|
+
O(Z), O(g), O(_);
|
|
4357
|
+
var lr = ut(_, 2);
|
|
4358
|
+
{
|
|
4359
|
+
var cr = (S) => {
|
|
4360
|
+
var q = Os(), gt = H(q);
|
|
4361
|
+
O(q), rt(() => {
|
|
4362
|
+
G(gt, "id", `img-${i() ?? ""}`), G(gt, "alt", `Graphic, ${(r().media?.alternative_text || "") ?? ""}`), G(gt, "src", r().media.file.url);
|
|
4363
|
+
}), C(S, q);
|
|
4364
|
+
};
|
|
4365
|
+
z(lr, (S) => {
|
|
4366
|
+
a() && r().media && S(cr);
|
|
4367
|
+
});
|
|
4368
|
+
}
|
|
4369
|
+
return O(E), rt(
|
|
4370
|
+
(S) => {
|
|
4371
|
+
G(E, "role", u(d) > 1 ? "checkbox" : null), G(E, "tabindex", u(d) > 1 ? 0 : null), G(E, "aria-describedby", `img-${i() ?? ""}`), G(E, "aria-checked", u(d) > 1 ? u(s)?.isSelected : null), G(E, "aria-disabled", u(s)?.isFinished && !u(m) ? "true" : null), G(E, "aria-label", u(w)), pt(E, 1, Yt(u(s)?.buttonClasses || "group btn-mcq-option")), pt(_, 1, `btn-mcq-text ${a() ? "min-h-[44px]" : ""}`), pt(R, 1, `choice ${a() ? "my-1.5" : ""}`), Qe(K, S);
|
|
4372
|
+
},
|
|
4373
|
+
[() => $r(i())]
|
|
4374
|
+
), C(t, I), vt(b);
|
|
4375
|
+
}
|
|
4376
|
+
qn(["click"]);
|
|
4377
|
+
mt(
|
|
4378
|
+
fo,
|
|
4379
|
+
{
|
|
4380
|
+
option: {},
|
|
4381
|
+
index: {},
|
|
4382
|
+
config: {},
|
|
4383
|
+
state: {},
|
|
4384
|
+
optionHasMedia: {},
|
|
4385
|
+
onOptionClick: {}
|
|
4386
|
+
},
|
|
4387
|
+
[],
|
|
4388
|
+
[],
|
|
4389
|
+
!0
|
|
4390
|
+
);
|
|
4391
|
+
var Fs = /* @__PURE__ */ U("<div><div></div> <div></div></div>"), Ps = /* @__PURE__ */ U('<div class="flex items-center justify-center p-4"><div class="text-gray-500">Loading...</div></div>');
|
|
4392
|
+
function po(t, e) {
|
|
4393
|
+
ht(e, !0);
|
|
4394
|
+
let r = A(e, "api"), i = A(e, "config"), n = A(e, "state"), o = A(e, "onoptionClick");
|
|
4395
|
+
const a = (w, b) => {
|
|
4396
|
+
o()?.(new CustomEvent("optionClick", { detail: { optionId: w, answer: b } }));
|
|
4397
|
+
};
|
|
4398
|
+
let c = /* @__PURE__ */ $(() => i().options ?? {}), l = /* @__PURE__ */ $(() => Object.values(u(c)).some((w) => w.media)), s = /* @__PURE__ */ $(() => !!i().isLocked || !!r().isLocked?.(n()));
|
|
4399
|
+
var d = {
|
|
4400
|
+
get api() {
|
|
4401
|
+
return r();
|
|
4402
|
+
},
|
|
4403
|
+
set api(w) {
|
|
4404
|
+
r(w), T();
|
|
4405
|
+
},
|
|
4406
|
+
get config() {
|
|
4407
|
+
return i();
|
|
4408
|
+
},
|
|
4409
|
+
set config(w) {
|
|
4410
|
+
i(w), T();
|
|
4411
|
+
},
|
|
4412
|
+
get state() {
|
|
4413
|
+
return n();
|
|
4414
|
+
},
|
|
4415
|
+
set state(w) {
|
|
4416
|
+
n(w), T();
|
|
4417
|
+
},
|
|
4418
|
+
get onoptionClick() {
|
|
4419
|
+
return o();
|
|
4420
|
+
},
|
|
4421
|
+
set onoptionClick(w) {
|
|
4422
|
+
o(w), T();
|
|
4423
|
+
}
|
|
4424
|
+
}, f = et(), p = tt(f);
|
|
4425
|
+
{
|
|
4426
|
+
var m = (w) => {
|
|
4427
|
+
var b = Fs(), I = H(b), y = ut(I, 2);
|
|
4428
|
+
di(y, 21, () => Object.values(u(c)), ui, (V, E, _) => {
|
|
4429
|
+
fo(V, {
|
|
4430
|
+
get option() {
|
|
4431
|
+
return u(E);
|
|
4432
|
+
},
|
|
4433
|
+
index: _,
|
|
4434
|
+
get config() {
|
|
4435
|
+
return i();
|
|
4436
|
+
},
|
|
4437
|
+
get state() {
|
|
4438
|
+
return n();
|
|
4439
|
+
},
|
|
4440
|
+
get optionHasMedia() {
|
|
4441
|
+
return u(l);
|
|
4442
|
+
},
|
|
4443
|
+
onOptionClick: a
|
|
4444
|
+
});
|
|
4445
|
+
}), O(y), O(b), rt(() => {
|
|
4446
|
+
pt(b, 1, Yt(u(l) ? "w-full" : "relative")), pt(I, 1, Yt(u(s) ? "absolute inset-0 bg-transparent z-50" : "")), pt(y, 1, Yt(u(l) ? "flex flex-col justify-start items-center md:justify-center md:items-start md:flex-none md:grid md:grid-cols-2 md:gap-x-4" : ""));
|
|
4447
|
+
}), C(w, b);
|
|
4448
|
+
}, h = (w) => {
|
|
4449
|
+
var b = Ps();
|
|
4450
|
+
C(w, b);
|
|
4451
|
+
};
|
|
4452
|
+
z(p, (w) => {
|
|
4453
|
+
u(c) ? w(m) : w(h, !1);
|
|
4454
|
+
});
|
|
4455
|
+
}
|
|
4456
|
+
return C(t, f), vt(d);
|
|
4457
|
+
}
|
|
4458
|
+
mt(po, { api: {}, config: {}, state: {}, onoptionClick: {} }, [], [], !0);
|
|
4459
|
+
function ho(t, e) {
|
|
4460
|
+
ht(e, !0);
|
|
4461
|
+
let r = A(e, "api"), i = A(e, "config"), n = A(e, "onstateChange");
|
|
4462
|
+
const o = r().hasExistingState?.() ? r().restoreState?.() : r().createInitialState?.();
|
|
4463
|
+
if (!o?.data)
|
|
4464
|
+
throw new Error("Failed to initialize MCQ state");
|
|
4465
|
+
let a = /* @__PURE__ */ ct(Ue(o)), c = /* @__PURE__ */ $(() => Ri(u(a), i(), i().options)), l = /* @__PURE__ */ $(() => u(c).selectedOptions), s = /* @__PURE__ */ $(() => u(c).totalCorrectAnswers), d = /* @__PURE__ */ $(() => u(c).isPreviewModeInteractive), f = /* @__PURE__ */ $(() => u(c).hasMedia);
|
|
4466
|
+
const p = (E) => ({
|
|
4467
|
+
answer_id: E,
|
|
4468
|
+
answer_choice: [],
|
|
4469
|
+
timestamp: Date.now()
|
|
4470
|
+
}), m = (E) => r().validate ? r().validate(p(E)).isValid : !1, h = (E) => r().validate && r().validate(p(E)).feedback || "";
|
|
4471
|
+
let w = /* @__PURE__ */ $(() => os(u(a), i(), m, h));
|
|
4472
|
+
const b = (E) => {
|
|
4473
|
+
const { optionId: _, answer: g } = E.detail;
|
|
4474
|
+
if (r().isLocked?.(u(a))) return;
|
|
4475
|
+
const x = r().selectOption?.(u(a), _, g);
|
|
4476
|
+
x && (Q(a, x.newState, !0), r().onStateChange?.(u(a)), n()?.(new CustomEvent("stateChange", {
|
|
4477
|
+
detail: {
|
|
4478
|
+
state: u(a),
|
|
4479
|
+
serialized: r().serialize?.(u(a))
|
|
4480
|
+
}
|
|
4481
|
+
})), u(d) && I(), y(_));
|
|
4482
|
+
}, I = () => {
|
|
4483
|
+
Q(a, pe.updateState(u(a), { interactiveHasAnswered: !0 }), !0), u(s) === u(l).length && setTimeout(
|
|
4484
|
+
() => {
|
|
4485
|
+
Q(a, pe.updateState(u(a), { showFeedback: !0 }), !0);
|
|
4486
|
+
},
|
|
4487
|
+
50
|
|
4488
|
+
);
|
|
4489
|
+
}, y = (E) => {
|
|
4490
|
+
const _ = u(l).includes(E);
|
|
4491
|
+
pe.announceToScreenReader(`Option ${E} ${_ ? "selected" : "deselected"}`);
|
|
4492
|
+
};
|
|
4493
|
+
var V = {
|
|
4494
|
+
get api() {
|
|
4495
|
+
return r();
|
|
4496
|
+
},
|
|
4497
|
+
set api(E) {
|
|
4498
|
+
r(E), T();
|
|
4499
|
+
},
|
|
4500
|
+
get config() {
|
|
4501
|
+
return i();
|
|
4502
|
+
},
|
|
4503
|
+
set config(E) {
|
|
4504
|
+
i(E), T();
|
|
4505
|
+
},
|
|
4506
|
+
get onstateChange() {
|
|
4507
|
+
return n();
|
|
4508
|
+
},
|
|
4509
|
+
set onstateChange(E) {
|
|
4510
|
+
n(E), T();
|
|
4511
|
+
}
|
|
4512
|
+
};
|
|
4513
|
+
{
|
|
4514
|
+
const E = (R) => {
|
|
4515
|
+
po(R, {
|
|
4516
|
+
get api() {
|
|
4517
|
+
return r();
|
|
4518
|
+
},
|
|
4519
|
+
get config() {
|
|
4520
|
+
return i();
|
|
4521
|
+
},
|
|
4522
|
+
get state() {
|
|
4523
|
+
return u(a);
|
|
4524
|
+
},
|
|
4525
|
+
onoptionClick: b
|
|
4526
|
+
});
|
|
4527
|
+
}, _ = (R) => {
|
|
4528
|
+
oo(R, {
|
|
4529
|
+
get feedbackState() {
|
|
4530
|
+
return u(w);
|
|
4531
|
+
}
|
|
4532
|
+
});
|
|
4533
|
+
};
|
|
4534
|
+
let g = /* @__PURE__ */ $(() => i().rubric?.text || ""), x = /* @__PURE__ */ $(() => i().prompt || "");
|
|
4535
|
+
uo(t, {
|
|
4536
|
+
get rubric() {
|
|
4537
|
+
return u(g);
|
|
4538
|
+
},
|
|
4539
|
+
get prompt() {
|
|
4540
|
+
return u(x);
|
|
4541
|
+
},
|
|
4542
|
+
get interactionType() {
|
|
4543
|
+
return Ii.MCQ;
|
|
4544
|
+
},
|
|
4545
|
+
get stimulus() {
|
|
4546
|
+
return i().stimulus;
|
|
4547
|
+
},
|
|
4548
|
+
get optionHasMedia() {
|
|
4549
|
+
return u(f);
|
|
4550
|
+
},
|
|
4551
|
+
hasDivider: !0,
|
|
4552
|
+
interaction: E,
|
|
4553
|
+
feedback: _,
|
|
4554
|
+
$$slots: { interaction: !0, feedback: !0 }
|
|
4555
|
+
});
|
|
4556
|
+
}
|
|
4557
|
+
return vt(V);
|
|
4558
|
+
}
|
|
4559
|
+
mt(ho, { api: {}, config: {}, onstateChange: {} }, [], [], !0);
|
|
4560
|
+
const qs = (t, e) => {
|
|
4561
|
+
const r = () => t.correctAnswerIds || Object.values(t.options).filter((s) => s.correct_choice).map((s) => s.id), i = () => t.maxSelections || r().length, n = () => t.mode === "preview", o = () => t.mode === "interactive-preview", a = () => !t.mode || t.mode === "normal", c = (s, d) => {
|
|
4562
|
+
const f = s.filter((m) => d.includes(m)).length, p = s.filter((m) => !d.includes(m)).length;
|
|
4563
|
+
return {
|
|
4564
|
+
correct: f,
|
|
4565
|
+
incorrect: p,
|
|
4566
|
+
total: d.length
|
|
4567
|
+
};
|
|
4568
|
+
}, l = (s, d) => {
|
|
4569
|
+
const { correct: f, incorrect: p, total: m } = c(s, d);
|
|
4570
|
+
return f === m && p === 0 ? t.feedback.correct || "Excellent! All correct answers selected." : t.feedback.incorrect || "Please review your selections and try again.";
|
|
4571
|
+
};
|
|
4572
|
+
return {
|
|
4573
|
+
type: "mcq",
|
|
4574
|
+
component: null,
|
|
4575
|
+
// Will be set during registration
|
|
4576
|
+
createInitialState: () => ({
|
|
4577
|
+
data: {
|
|
4578
|
+
selectedOptions: [],
|
|
4579
|
+
selectedChoices: [],
|
|
4580
|
+
showFeedback: !1,
|
|
4581
|
+
interactiveHasAnswered: !1
|
|
4582
|
+
},
|
|
4583
|
+
attempts: 0,
|
|
4584
|
+
completed: !1,
|
|
4585
|
+
lastModified: pe.createTimestamp()
|
|
4586
|
+
}),
|
|
4587
|
+
// Enhanced API methods for migration
|
|
4588
|
+
isCompleted: (s) => t.isFinished !== void 0 ? t.isFinished : s.completed || s.data.selectedOptions.length === i() && n(),
|
|
4589
|
+
isLocked: (s) => t.isLocked !== void 0 ? t.isLocked : s.completed && a(),
|
|
4590
|
+
hasExistingState: () => {
|
|
4591
|
+
const s = e?.events || e?.metadata?.interactions?.events || e?.metadata?.events;
|
|
4592
|
+
return e && s && s.length > 0;
|
|
4593
|
+
},
|
|
4594
|
+
restoreState: () => {
|
|
4595
|
+
const s = e?.events || e?.metadata?.interactions?.events || e?.metadata?.events;
|
|
4596
|
+
if (e && s && s.length > 0) {
|
|
4597
|
+
const d = s[s.length - 1], f = d.answer_id || [], p = d.answer_choice || [];
|
|
4598
|
+
return {
|
|
4599
|
+
data: {
|
|
4600
|
+
selectedOptions: Array.isArray(f) ? f : [f],
|
|
4601
|
+
selectedChoices: Array.isArray(p) ? p : [p],
|
|
4602
|
+
showFeedback: t.isFinished || !1,
|
|
4603
|
+
interactiveHasAnswered: !0
|
|
4604
|
+
},
|
|
4605
|
+
attempts: s.length,
|
|
4606
|
+
completed: t.isFinished || !1,
|
|
4607
|
+
lastModified: d.timestamp || pe.createTimestamp()
|
|
4608
|
+
};
|
|
4609
|
+
}
|
|
4610
|
+
return {
|
|
4611
|
+
data: {
|
|
4612
|
+
selectedOptions: [],
|
|
4613
|
+
selectedChoices: [],
|
|
4614
|
+
showFeedback: !1,
|
|
4615
|
+
interactiveHasAnswered: !1
|
|
4616
|
+
},
|
|
4617
|
+
attempts: 0,
|
|
4618
|
+
completed: !1,
|
|
4619
|
+
lastModified: pe.createTimestamp()
|
|
4620
|
+
};
|
|
4621
|
+
},
|
|
4622
|
+
selectOption: (s, d, f) => {
|
|
4623
|
+
const p = i();
|
|
4624
|
+
let m = [...s.data.selectedOptions], h = [...s.data.selectedChoices];
|
|
4625
|
+
if (p > 1) {
|
|
4626
|
+
const b = m.indexOf(d);
|
|
4627
|
+
b !== -1 ? (m.splice(b, 1), h.splice(b, 1)) : (m.length >= p && (m.pop(), h.pop()), m.push(d), h.push(f));
|
|
4628
|
+
} else {
|
|
4629
|
+
if (m[0] === d)
|
|
4630
|
+
return { newState: s, isValid: !0 };
|
|
4631
|
+
m = [d], h = [f];
|
|
4632
|
+
}
|
|
4633
|
+
return {
|
|
4634
|
+
newState: pe.updateState(s, {
|
|
4635
|
+
selectedOptions: m,
|
|
4636
|
+
selectedChoices: h,
|
|
4637
|
+
interactiveHasAnswered: o()
|
|
4638
|
+
}),
|
|
4639
|
+
isValid: m.length > 0
|
|
4640
|
+
};
|
|
4641
|
+
},
|
|
4642
|
+
validate: (s) => {
|
|
4643
|
+
const d = r(), f = s.answer_id, { correct: p, incorrect: m, total: h } = c(f, d);
|
|
4644
|
+
return {
|
|
4645
|
+
isValid: p === h && m === 0,
|
|
4646
|
+
score: Math.max(0, p - m),
|
|
4647
|
+
maxScore: h,
|
|
4648
|
+
feedback: l(f, d)
|
|
4649
|
+
};
|
|
4650
|
+
},
|
|
4651
|
+
serialize: (s) => ({
|
|
4652
|
+
answer_id: s.data.selectedOptions,
|
|
4653
|
+
answer_choice: s.data.selectedChoices,
|
|
4654
|
+
timestamp: s.lastModified
|
|
4655
|
+
}),
|
|
4656
|
+
deserialize: (s) => ({
|
|
4657
|
+
data: {
|
|
4658
|
+
selectedOptions: s.answer_id,
|
|
4659
|
+
selectedChoices: s.answer_choice,
|
|
4660
|
+
showFeedback: !1,
|
|
4661
|
+
interactiveHasAnswered: !1
|
|
4662
|
+
},
|
|
4663
|
+
attempts: 1,
|
|
4664
|
+
completed: !1,
|
|
4665
|
+
lastModified: s.timestamp
|
|
4666
|
+
}),
|
|
4667
|
+
onStateChange: (s) => {
|
|
4668
|
+
}
|
|
4669
|
+
};
|
|
4670
|
+
}, Hs = (t) => {
|
|
4671
|
+
const e = pe.determineInteractionMode(t), r = t?.interaction || t, i = t?.scoringMetadata, n = r?.prompt_template?.template || r?.prompt || "", o = r?.options || {}, a = r?.feedback || { correct: "", incorrect: "" }, c = {};
|
|
4672
|
+
Object.entries(o).forEach(([f, p]) => {
|
|
4673
|
+
c[f] = {
|
|
4674
|
+
...p,
|
|
4675
|
+
// Preserve existing correct_choice value, don't override to false
|
|
4676
|
+
correct_choice: p.correct_choice || !1
|
|
4677
|
+
};
|
|
4678
|
+
});
|
|
4679
|
+
let l = [], s = t?.totalCorrectAnswers;
|
|
4680
|
+
if (i?.correctAnswerIds ? (l = Array.isArray(i.correctAnswerIds) ? i.correctAnswerIds : [i.correctAnswerIds], Object.values(c).forEach((f) => {
|
|
4681
|
+
l.includes(f.id) && (f.correct_choice = !0);
|
|
4682
|
+
}), s = l.length) : (l = Object.values(c).filter((f) => f.correct_choice === !0).map((f) => f.id), s = l.length), (!s || s === 0) && (s = 1, l.length === 0)) {
|
|
4683
|
+
const f = Object.keys(c)[0];
|
|
4684
|
+
f && (l = [f], c[f].correct_choice = !0);
|
|
4685
|
+
}
|
|
4686
|
+
return {
|
|
4687
|
+
prompt: n,
|
|
4688
|
+
options: c,
|
|
4689
|
+
feedback: a,
|
|
4690
|
+
correctAnswerIds: l,
|
|
4691
|
+
maxSelections: s,
|
|
4692
|
+
mode: e === "standard" ? "normal" : e === "preview" ? "preview" : "interactive-preview",
|
|
4693
|
+
rubric: t?.rubric ? { text: t.rubric.text } : void 0,
|
|
4694
|
+
stimulus: t?.stimulus,
|
|
4695
|
+
isFinished: t?.isFinished || !1,
|
|
4696
|
+
isLocked: t?.isLocked || !1
|
|
4697
|
+
};
|
|
4698
|
+
};
|
|
4699
|
+
qa("mcq", qs, ho);
|
|
4700
|
+
var zs = /* @__PURE__ */ U('<link rel="preconnect" href="https://fonts.googleapis.com" class="svelte-1dpid58"/> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" class="svelte-1dpid58"/> <link href="https://fonts.googleapis.com/css2?family=Mulish:ital,wght@0,200..10001,200..1000&display=swap" rel="stylesheet" class="svelte-1dpid58"/>', 1);
|
|
4701
|
+
const js = {
|
|
4702
|
+
hash: "svelte-1dpid58",
|
|
4703
|
+
code: ' *, :after, :before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style:} ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style:} *, :after, :before{border:0 solid #e5e7eb;box-sizing:border-box} :after, :before{--tw-content:""} :host, html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:Mulish,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent} body{line-height:inherit;margin:0} hr{border-top-width:1px;color:inherit;height:0} abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted} h1, h2, h3, h4, h5, h6{font-size:inherit;font-weight:inherit} a{color:inherit;text-decoration:inherit} b, strong{font-weight:bolder} code, kbd, pre, samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal} small{font-size:80%} sub, sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} sub{bottom:-.25em} sup{top:-.5em} table{border-collapse:collapse;border-color:inherit;text-indent:0} button, input, optgroup, select, textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0} button, select{text-transform:none} button, input:where([type=button]), input:where([type=reset]), input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none} :-moz-focusring{outline:auto} :-moz-ui-invalid{box-shadow:none} progress{vertical-align:baseline} ::-webkit-inner-spin-button, ::-webkit-outer-spin-button{height:auto} [type=search]{-webkit-appearance:textfield;outline-offset:-2px} ::-webkit-search-decoration{-webkit-appearance:none} ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit} summary{display:list-item} blockquote, dd, dl, figure, h1, h2, h3, h4, h5, h6, hr, p, pre{margin:0} fieldset{margin:0} fieldset, legend{padding:0} menu, ol, ul{list-style:none;margin:0;padding:0} dialog{padding:0} textarea{resize:vertical} input::-moz-placeholder, textarea::-moz-placeholder{color:#9ca3af;opacity:1} input::placeholder, textarea::placeholder{color:#9ca3af;opacity:1} [role=button], button{cursor:pointer} :disabled{cursor:default} audio, canvas, embed, iframe, img, object, svg, video{display:block;vertical-align:middle} img, video{height:auto;max-width:100%} [hidden]:where(:not([hidden=until-found])){display:none} *{font-family:Mulish,sans-serif} input::-moz-selection, textarea::-moz-selection{background-color:hsla(0,0%,85%,.4)} input::selection, textarea::selection{background-color:hsla(0,0%,85%,.4)} .container{width:100%}@media (min-width:732px){ .container{max-width:732px}}@media (min-width:1196px){ .container{max-width:1196px}} .blanket-overlay{inset:0;position:absolute;--tw-bg-opacity:1;background-color:rgb(33,37,41,var(--tw-bg-opacity,1));opacity:.3} .item-heading{font-size:1.25rem;letter-spacing:-.025em;line-height:1.5rem;--tw-text-opacity:1;color:rgb(40,44,135,var(--tw-text-opacity,1))} .divider{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(218,224,224,var(--tw-border-opacity,1))}@keyframes svelte-1dpid58-pulse{50%{opacity:.5}} .animate-skeleton{animation:svelte-1dpid58-pulse 2s cubic-bezier(.4,0,.6,1) infinite;--tw-bg-opacity:1;background-color:rgb(226,232,240,var(--tw-bg-opacity,1))} .btn-mcq-option:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent);--tw-ring-opacity:1;--tw-ring-color:rgb(253 224 71/var(--tw-ring-opacity,1));--tw-ring-offset-width:2px;--tw-ring-offset-color:#212529;outline:2px solid transparent;outline-offset:2px;transition-duration:50ms} .btn-mcq-option{font-size:1rem;line-height:1.5rem;line-height:19.2px;margin-bottom:1rem;min-height:52px;width:100%;--tw-text-opacity:1;border-radius:.5rem;border-width:1px;box-sizing:border-box;color:rgb(33,37,41,var(--tw-text-opacity,1));--tw-border-opacity:1;border-color:rgb(75,85,99,var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(248,248,248,var(--tw-bg-opacity,1))} .btn-mcq-option:active{border-width:2px;--tw-border-opacity:1;border-color:rgb(59,64,240,var(--tw-border-opacity,1))}@media (hover:hover) and (pointer:fine){ .btn-mcq-option:hover{border-width:2px;--tw-border-opacity:1;border-color:rgb(59,64,240,var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(238,240,255,var(--tw-bg-opacity,1))}} .btn-mcq-text{align-items:center;display:flex;padding:.375rem .75rem;width:100%}@supports (overflow-wrap:anywhere){ .btn-mcq-text{overflow-wrap:anywhere}}@supports not (overflow-wrap:anywhere){ .btn-mcq-text{word-break:break-word}} .btn-mcq-option>span>span>span>.choice{align-items:center;border-radius:1rem;border-width:1px;display:flex;font-size:1rem;font-weight:700;height:2rem;justify-content:center;letter-spacing:.05em;line-height:1rem;width:2rem;--tw-border-opacity:1;border-color:rgb(156,163,175,var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(255,255,255,var(--tw-bg-opacity,1));padding:.5rem;--tw-text-opacity:1;color:rgb(33,37,41,var(--tw-text-opacity,1))} .btn-mcq-option.selected{border-width:2px;--tw-border-opacity:1;background-color:rgb(40,44,135,var(--tw-bg-opacity,1));border-color:rgb(40,44,135,var(--tw-border-opacity,1))} .btn-mcq-option.selected, .btn-mcq-option.selected:active{--tw-bg-opacity:1;--tw-text-opacity:1;color:rgb(255,255,255,var(--tw-text-opacity,1))} .btn-mcq-option.selected:active{background-color:rgb(84,101,251,var(--tw-bg-opacity,1))}@media (hover:hover) and (pointer:fine){ .btn-mcq-option.selected:hover{--tw-bg-opacity:1;background-color:rgb(84,101,251,var(--tw-bg-opacity,1))}} .btn-mcq-option.finished{cursor:default} .btn-mcq-option.finished:active, .btn-mcq-option.finished:hover{border-width:1px;--tw-border-opacity:1;border-color:rgb(75,85,99,var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(248,248,248,var(--tw-bg-opacity,1))} .btn-mcq-option.selected>span>span>.choice{--tw-bg-opacity:1;background-color:rgb(238,240,255,var(--tw-bg-opacity,1))} .btn-mcq-option>span>span>span>.custom-checkbox{align-items:center;border-radius:.25rem;border-width:1px;display:flex;height:1.75rem;justify-content:center;pointer-events:none;width:1.75rem;--tw-border-opacity:1;border-color:rgb(75,85,99,var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(255,255,255,var(--tw-bg-opacity,1))}@media (hover:hover) and (pointer:fine){ .btn-mcq-option:hover>span>span>span>.custom-checkbox{border-width:2px;--tw-border-opacity:1;border-color:rgb(59,64,240,var(--tw-border-opacity,1))} .btn-mcq-option:active>span>span>span>.custom-checkbox.preview-only, .btn-mcq-option:hover>span>span>span>.custom-checkbox.preview-only{border-width:1px;--tw-border-opacity:1;border-color:rgb(75,85,99,var(--tw-border-opacity,1))}} .btn-mcq-option:active>span>span>span>.custom-checkbox{border-width:2px;--tw-border-opacity:1;border-color:rgb(40,44,135,var(--tw-border-opacity,1))} .btn-mcq-option.selected>span>span>span>.custom-checkbox{border-width:0;pointer-events:none;--tw-bg-opacity:1;background-color:rgb(84,101,251,var(--tw-bg-opacity,1))}@media (hover:hover) and (pointer:fine){ .btn-mcq-option.selected:hover>span>span>span>.custom-checkbox{border-width:0;--tw-bg-opacity:1;background-color:rgb(76,91,226,var(--tw-bg-opacity,1))}} .btn-mcq-option.selected:active>span>span>span>.custom-checkbox{border-width:0;--tw-bg-opacity:1;background-color:rgb(40,44,135,var(--tw-bg-opacity,1))} .btn-mcq-option.finished:active>span>span>span>.custom-checkbox, .btn-mcq-option.finished:hover>span>span>span>.custom-checkbox{border-width:1px;--tw-border-opacity:1;border-color:rgb(75,85,99,var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(255,255,255,var(--tw-bg-opacity,1))} .btn-mcq-option.missing.\\!correct, .btn-mcq-option.missing.correct{border-width:1px;--tw-border-opacity:1;border-color:rgb(21,128,61,var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(248,248,248,var(--tw-bg-opacity,1))}@media (hover:hover) and (pointer:fine){ .btn-mcq-option.\\!correct.interactive:active, .btn-mcq-option.\\!correct.interactive:hover, .btn-mcq-option.correct.interactive:active, .btn-mcq-option.correct.interactive:hover, .btn-mcq-option.incorrect.interactive:active, .btn-mcq-option.incorrect.interactive:hover, .btn-mcq-option.missing.interactive:active, .btn-mcq-option.missing.interactive:hover{border-width:2px;--tw-border-opacity:1;border-color:rgb(59,64,240,var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(238,240,255,var(--tw-bg-opacity,1))}} .btn-mcq-option.selected.\\!correct, .btn-mcq-option.selected.correct{background-color:rgb(240,253,244,var(--tw-bg-opacity,1));border-color:rgb(21,128,61,var(--tw-border-opacity,1));border-width:1px} .btn-mcq-option.selected.\\!correct, .btn-mcq-option.selected.correct, .btn-mcq-option.selected.incorrect{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;color:rgb(33,37,41,var(--tw-text-opacity,1))} .btn-mcq-option.selected.incorrect{background-color:rgb(253,242,248,var(--tw-bg-opacity,1));border-color:rgb(190,24,93,var(--tw-border-opacity,1));border-width:1px} .btn-mcq-option.selected.\\!correct>span>span>span>.choice, .btn-mcq-option.selected.correct>span>span>span>.choice, .btn-mcq-option.selected.incorrect>span>span>span>.choice{border-width:1px;--tw-border-opacity:1;border-color:rgb(113,115,119,var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(255,255,255,var(--tw-bg-opacity,1))} .typein-textbox:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent);--tw-ring-color:rgb(84 101 251/var(--tw-ring-opacity,1));--tw-ring-offset-width:4px;transition-duration:50ms} .typein-textbox{border-radius:.5rem;border-width:1px;width:100%;--tw-border-opacity:1;border-color:rgb(75,85,99,var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(255,255,255,var(--tw-bg-opacity,1));font-size:1rem;line-height:1.5rem;padding:.75rem 1rem;--tw-text-opacity:1;color:rgb(33,37,41,var(--tw-text-opacity,1))} .typein-textbox::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(55,65,81,var(--tw-placeholder-opacity,1))} .typein-textbox::placeholder{--tw-placeholder-opacity:1;color:rgb(55,65,81,var(--tw-placeholder-opacity,1))} .typein-textbox:focus{border-width:2px;--tw-border-opacity:1;border-color:rgb(59,64,240,var(--tw-border-opacity,1))}@media (hover:hover) and (pointer:fine){ .typein-textbox:hover{border-width:2px;--tw-border-opacity:1;border-color:rgb(59,64,240,var(--tw-border-opacity,1))}} .typein-textbox:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)!important}@media (hover:hover) and (pointer:fine){ .typein-textbox:hover{transition-duration:50ms}} .typein-textbox:focus{outline-color:#212529;outline-width:2px}@media (hover:hover) and (pointer:fine){ .typein-textbox:hover{outline-color:#212529;outline-width:2px}} .typein-textbox:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(253 224 71/var(--tw-ring-opacity,1))} #dnd-action-dragged-el{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent);--tw-ring-opacity:1;--tw-ring-color:rgb(84 101 251/var(--tw-ring-opacity,1));--tw-ring-offset-width:2px;cursor:grabbing!important;transition-duration:50ms;--tw-border-opacity:1!important;border-color:rgb(93,99,107,var(--tw-border-opacity,1))!important;--tw-bg-opacity:1!important;background-color:rgb(205,208,254,var(--tw-bg-opacity,1))!important} .image-description, .text-stimulus{padding-bottom:1rem;padding-top:1rem} .text-stimulus p{font-size:1.25rem;line-height:1.75rem;padding-bottom:.5rem;--tw-text-opacity:1;color:rgb(40,44,135,var(--tw-text-opacity,1))} .image-description p{font-size:.875rem;line-height:1.25rem;padding-bottom:.5rem;--tw-text-opacity:1;color:rgb(33,37,41,var(--tw-text-opacity,1))} .text-stimulus ol, .text-stimulus ul{font-size:1rem;line-height:1.5rem;list-style-position:inside;padding-bottom:.5rem;padding-left:.5rem} .text-stimulus ol ::marker, .text-stimulus ul ::marker{color:#282c87} .text-stimulus ol::marker, .text-stimulus ul::marker{color:#282c87} .image-description ol, .image-description ul{font-size:.875rem;line-height:1.25rem;list-style-position:inside;padding-bottom:.5rem;padding-left:.5rem} .image-description ol ::marker, .image-description ul ::marker{color:#212529} .image-description ol::marker, .image-description ul::marker{color:#212529} .image-description ul, .text-stimulus ul{list-style-type:disc} .image-description ol, .text-stimulus ol{list-style-type:decimal} .image-description ul li>p, .text-stimulus ul li>p{margin-left:-.5rem} .text-stimulus ol>li>p, .text-stimulus ul>li>p{display:inline;font-size:1rem;line-height:1.5rem;padding-bottom:0;padding-top:0} .image-description ol>li>p, .image-description ul>li>p{display:inline;font-size:.875rem;line-height:1.25rem;padding-bottom:0;padding-top:0} .image-description div.table-container:focus, .text-stimulus div.table-container:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent);--tw-ring-opacity:1;--tw-ring-color:rgb(84 101 251/var(--tw-ring-opacity,1));--tw-ring-offset-width:4px;transition-duration:50ms} .image-description div.table-container, .text-stimulus div.table-container{border-radius:.5rem;overflow:auto;padding-left:.125rem;padding-right:.125rem} .image-description table, .text-stimulus table{margin-bottom:1rem;margin-top:.5rem;width:100%;--tw-border-spacing-x:0.75rem;--tw-border-spacing-y:0.75rem;border-radius:.5rem;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);overflow-x:auto;--tw-shadow:0 0 0 1px #9ca3af;--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)} .image-description table tr, .text-stimulus table tr{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(156,163,175,var(--tw-border-opacity,1))} .image-description table tr:last-child, .text-stimulus table tr:last-child{border-color:transparent} .image-description table td, .image-description table th, .text-stimulus table td, .text-stimulus table th{border-left-width:1px;min-width:140px;--tw-border-opacity:1;border-color:rgb(156,163,175,var(--tw-border-opacity,1))} .image-description table td:first-child, .image-description table th:first-child, .text-stimulus table td:first-child, .text-stimulus table th:first-child{border-style:none} .text-stimulus table td>p, .text-stimulus table th>p{font-size:1rem;line-height:1.5rem;padding:.75rem;text-align:left;--tw-text-opacity:1;color:rgb(33,37,41,var(--tw-text-opacity,1))} .image-description table td>p, .image-description table th>p{font-size:.875rem;line-height:1.25rem;padding:.75rem;text-align:left;--tw-text-opacity:1;color:rgb(33,37,41,var(--tw-text-opacity,1))} .text-stimulus table th>p{font-weight:400} .image-description table th p, .prompt p, .text-stimulus table th p{font-weight:600} .prompt p b, .prompt p b i, .prompt p b i u, .prompt p b u, .prompt p b u i, .prompt p i b, .prompt p i b u, .prompt p i u b, .prompt p u b, .prompt p u b i, .prompt p u i b, .text-stimulus table th p b, .text-stimulus table th p b i, .text-stimulus table th p b i u, .text-stimulus table th p b u, .text-stimulus table th p b u i, .text-stimulus table th p i b, .text-stimulus table th p i b u, .text-stimulus table th p i u b, .text-stimulus table th p u b, .text-stimulus table th p u b i, .text-stimulus table th p u i b{font-weight:900} .dropdown-text:not(:last-child), .dropdown:not(:last-child){margin-right:1rem} .image-description-accordion{border-bottom-width:1px;border-color:transparent;font-weight:600;--tw-text-opacity:1;color:rgb(33,37,41,var(--tw-text-opacity,1))} .group:focus .image-description-accordion{--tw-bg-opacity:1;background-color:rgb(251,217,27,var(--tw-bg-opacity,1));--tw-text-opacity:1;border-bottom-width:1px;color:rgb(0,0,0,var(--tw-text-opacity,1));outline:2px solid transparent;outline-offset:2px} .group:focus .image-description-accordion, .group:hover .image-description-accordion{--tw-border-opacity:1;border-color:rgb(0,0,0,var(--tw-border-opacity,1))} .group:active .image-description-accordion{border-bottom-width:2px} .sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap} .pointer-events-none{pointer-events:none} .visible{visibility:visible} .fixed{position:fixed} .absolute{position:absolute} .relative{position:relative} .inset-0{inset:0} .bottom-0{bottom:0} .left-0{left:0} .right-4{right:1rem} .top-1{top:.25rem} .top-1\\/2{top:50%} .top-3{top:.75rem} .top-\\[13px\\]{top:13px} .z-10{z-index:10} .z-50{z-index:50} .my-1\\.5{margin-bottom:.375rem;margin-top:.375rem} .my-6{margin-bottom:1.5rem;margin-top:1.5rem} .my-auto{margin-bottom:auto;margin-top:auto} .mb-0\\.5{margin-bottom:.125rem} .mb-1{margin-bottom:.25rem} .mb-12{margin-bottom:3rem} .mb-2{margin-bottom:.5rem} .mb-4{margin-bottom:1rem} .ml-2\\.5{margin-left:.625rem} .ml-8\\.5{margin-left:2.125rem} .mr-1{margin-right:.25rem} .mr-2{margin-right:.5rem} .mt-0\\.5{margin-top:.125rem} .mt-2{margin-top:.5rem} .mt-4{margin-top:1rem} .mt-6{margin-top:1.5rem} .line-clamp-3{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3} .block{display:block} .inline{display:inline} .flex{display:flex} .table{display:table} .contents{display:contents} .hidden{display:none} .h-11{height:2.75rem} .h-2{height:.5rem} .h-4{height:1rem} .h-52{height:13rem} .h-6{height:1.5rem} .h-fit{height:-moz-fit-content;height:fit-content} .h-full{height:100%} .max-h-\\[184px\\]{max-height:184px} .min-h-\\[154px\\]{min-height:154px} .min-h-\\[210px\\]{min-height:210px} .min-h-\\[44px\\]{min-height:44px} .w-3{width:.75rem} .w-4{width:1rem} .w-6{width:1.5rem} .w-8\\.5{width:2.125rem} .w-auto{width:auto} .w-fit{width:-moz-fit-content;width:fit-content} .w-full{width:100%} .min-w-\\[288px\\]{min-width:288px} .max-w-\\[304px\\]{max-width:304px} .max-w-full{max-width:100%} .flex-shrink-0{flex-shrink:0} .flex-grow{flex-grow:1} .-translate-y-1\\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))} .flex-col{flex-direction:column} .items-start{align-items:flex-start} .items-center{align-items:center} .justify-start{justify-content:flex-start} .justify-center{justify-content:center} .justify-between{justify-content:space-between} .gap-3{gap:.75rem} .overflow-hidden{overflow:hidden} .overflow-y-visible{overflow-y:visible} .text-ellipsis{text-overflow:ellipsis} .break-words{overflow-wrap:break-word} .rounded{border-radius:.25rem} .rounded-lg{border-radius:.5rem} .rounded-b-lg{border-bottom-right-radius:.5rem} .rounded-b-lg, .rounded-l-lg{border-bottom-left-radius:.5rem} .rounded-l-lg{border-top-left-radius:.5rem} .border{border-width:1px} .border-2{border-width:2px} .border-gray-200{--tw-border-opacity:1;border-color:rgb(217,217,217,var(--tw-border-opacity,1))} .border-gray-300{--tw-border-opacity:1;border-color:rgb(218,224,224,var(--tw-border-opacity,1))} .border-gray-850{--tw-border-opacity:1;border-color:rgb(75,85,99,var(--tw-border-opacity,1))} .border-green-200{--tw-border-opacity:1;border-color:rgb(187,247,208,var(--tw-border-opacity,1))} .border-green-900{--tw-border-opacity:1;border-color:rgb(21,128,61,var(--tw-border-opacity,1))} .border-red-200{--tw-border-opacity:1;border-color:rgb(254,202,202,var(--tw-border-opacity,1))} .border-red-600{--tw-border-opacity:1;border-color:rgb(220,38,38,var(--tw-border-opacity,1))} .border-red-900{--tw-border-opacity:1;border-color:rgb(190,24,93,var(--tw-border-opacity,1))} .border-soft-blue{--tw-border-opacity:1;border-color:rgb(84,101,251,var(--tw-border-opacity,1))} .border-yellow-200{--tw-border-opacity:1;border-color:rgb(254,240,138,var(--tw-border-opacity,1))} .bg-black{--tw-bg-opacity:1;background-color:rgb(0,0,0,var(--tw-bg-opacity,1))} .bg-gray-50{--tw-bg-opacity:1;background-color:rgb(244,244,244,var(--tw-bg-opacity,1))} .bg-green-50{--tw-bg-opacity:1;background-color:rgb(240,253,244,var(--tw-bg-opacity,1))} .bg-red-200{--tw-bg-opacity:1;background-color:rgb(254,202,202,var(--tw-bg-opacity,1))} .bg-red-50{--tw-bg-opacity:1;background-color:rgb(253,242,248,var(--tw-bg-opacity,1))} .bg-transparent{background-color:transparent} .bg-white{--tw-bg-opacity:1;background-color:rgb(255,255,255,var(--tw-bg-opacity,1))} .bg-yellow-50{--tw-bg-opacity:1;background-color:rgb(254,252,232,var(--tw-bg-opacity,1))} .object-contain{-o-object-fit:contain;object-fit:contain} .p-0\\.5{padding:.125rem} .p-2{padding:.5rem} .p-4{padding:1rem} .px-3{padding-left:.75rem;padding-right:.75rem} .py-2{padding-bottom:.5rem;padding-top:.5rem} .py-\\[9px\\]{padding-bottom:9px;padding-top:9px} .\\!pr-11{padding-right:2.75rem!important} .pb-0{padding-bottom:0} .pb-2{padding-bottom:.5rem} .pl-13\\.2{padding-left:3.125rem} .pr-4{padding-right:1rem} .pt-0{padding-top:0} .pt-4{padding-top:1rem} .text-left{text-align:left} .text-center{text-align:center} .text-base{font-size:1rem;line-height:1.5rem} .text-lg{font-size:1.125rem;line-height:1.75rem} .text-sm{font-size:.875rem;line-height:1.25rem} .font-semibold{font-weight:600} .leading-\\[1\\.5\\]{line-height:1.5} .leading-\\[19\\.2px\\]{line-height:19.2px} .leading-\\[19px\\]{line-height:19px} .leading-\\[22px\\]{line-height:22px} .leading-relaxed{line-height:1.625} .text-blue-1000{--tw-text-opacity:1;color:rgb(40,44,135,var(--tw-text-opacity,1))} .text-charcoal{--tw-text-opacity:1;color:rgb(33,37,41,var(--tw-text-opacity,1))} .text-gray-500{--tw-text-opacity:1;color:rgb(107,114,128,var(--tw-text-opacity,1))} .text-gray-800{--tw-text-opacity:1;color:rgb(93,99,107,var(--tw-text-opacity,1))} .text-gray-860{--tw-text-opacity:1;color:rgb(55,65,81,var(--tw-text-opacity,1))} .text-green-800{--tw-text-opacity:1;color:rgb(0,102,5,var(--tw-text-opacity,1))} .text-green-900{--tw-text-opacity:1;color:rgb(21,128,61,var(--tw-text-opacity,1))} .text-red-800{--tw-text-opacity:1;color:rgb(217,12,85,var(--tw-text-opacity,1))} .text-red-900{--tw-text-opacity:1;color:rgb(190,24,93,var(--tw-text-opacity,1))} .text-yellow-800{--tw-text-opacity:1;color:rgb(133,77,14,var(--tw-text-opacity,1))} .opacity-5{opacity:.05} .outline-none{outline:2px solid transparent;outline-offset:2px} .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)} .active\\:raw-focus-ring-by:active{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent);--tw-ring-opacity:1;--tw-ring-color:rgb(253 224 71/var(--tw-ring-opacity,1));--tw-ring-offset-width:2px;--tw-ring-offset-color:#212529;outline:2px solid transparent;outline-offset:2px;transition-duration:50ms} .focus\\:outline-transparent:focus{outline-color:transparent} .group.active .group-\\[\\.active\\]\\:border-b-2{border-bottom-width:2px}@media (min-width:732px){ .md\\:mb-4{margin-bottom:1rem} .md\\:ml-0{margin-left:0} .md\\:mt-0{margin-top:0} .md\\:block{display:block} .md\\:inline-block{display:inline-block} .md\\:grid{display:grid} .md\\:w-1\\/2{width:50%} .md\\:min-w-full{min-width:100%} .md\\:flex-none{flex:none} .md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))} .md\\:flex-row{flex-direction:row} .md\\:items-start{align-items:flex-start} .md\\:justify-center{justify-content:center} .md\\:gap-x-4{-moz-column-gap:1rem;column-gap:1rem} .md\\:pl-4{padding-left:1rem} .md\\:pr-4{padding-right:1rem}}@media (min-width:1196px){ .lg\\:block{display:block} .lg\\:flex{display:flex} .lg\\:hidden{display:none} .lg\\:w-full{width:100%} .lg\\:max-w-\\[50\\%\\]{max-width:50%} .lg\\:flex-1{flex:1 1 0%} .lg\\:basis-1\\/2{flex-basis:50%} .lg\\:pb-10{padding-bottom:2.5rem} .lg\\:pl-24{padding-left:6rem} .lg\\:pt-6{padding-top:1.5rem}}'
|
|
4704
|
+
};
|
|
4705
|
+
function Bs(t, e) {
|
|
4706
|
+
ht(e, !0), Un(t, js);
|
|
4707
|
+
let r = A(e, "session-id"), i = A(e, "preview-mode"), n = A(e, "item-id"), o = A(e, "preview-contentful"), a = /* @__PURE__ */ ct(null), c = /* @__PURE__ */ ct(null), l = /* @__PURE__ */ ct(!0), s = /* @__PURE__ */ ct(null), d = /* @__PURE__ */ ct(null), f = /* @__PURE__ */ ct(null), p = /* @__PURE__ */ ct(!1), m = /* @__PURE__ */ $(() => i() === "interactive" && !!n()), h = /* @__PURE__ */ $(() => ["true", "interactive"].includes(i())), w = /* @__PURE__ */ $(() => o() === "true" && u(h));
|
|
4708
|
+
Za();
|
|
4709
|
+
let b = /* @__PURE__ */ $(() => sr(Li) ? "?skip_user_validation=true" : "");
|
|
4710
|
+
aa(() => {
|
|
4711
|
+
if (!r() && !n() || !r() && !u(h)) {
|
|
4712
|
+
Q(s, "No session ID or item ID provided"), Q(l, !1);
|
|
4713
|
+
return;
|
|
4714
|
+
}
|
|
4715
|
+
return (async () => {
|
|
4716
|
+
try {
|
|
4717
|
+
console.log("PromptBuilderNew mounting:", {
|
|
4718
|
+
sessionId: r(),
|
|
4719
|
+
itemId: n(),
|
|
4720
|
+
isPreviewMode: u(h),
|
|
4721
|
+
isPreviewModeInteractive: u(m)
|
|
4722
|
+
});
|
|
4723
|
+
const M = await Ba(r(), n(), {
|
|
4724
|
+
isPreviewMode: u(h),
|
|
4725
|
+
isPreviewModeInteractive: u(m),
|
|
4726
|
+
isPreviewContentful: u(w)
|
|
4727
|
+
});
|
|
4728
|
+
if (!M)
|
|
4729
|
+
throw new Error("No data received");
|
|
4730
|
+
console.log("Loaded data structure:", JSON.stringify(M, null, 2));
|
|
4731
|
+
const Y = I(M);
|
|
4732
|
+
if (console.log("Detected interaction type:", Y), !Y)
|
|
4733
|
+
throw console.error("Data structure missing interaction.type:", M), new Error(`Unable to determine interaction type. Data structure: ${JSON.stringify(M)}`);
|
|
4734
|
+
const X = y(Y);
|
|
4735
|
+
if (console.log("Using interaction type:", X), Q(f, V(M, X), !0), Q(a, Ha(X, u(f), M), !0), Q(c, za(X), !0), !u(a) || !u(c))
|
|
4736
|
+
throw new Error(`Unknown interaction type: ${X}`);
|
|
4737
|
+
Q(d, M, !0), u(a).onMount?.(), Q(l, !1);
|
|
4738
|
+
} catch (M) {
|
|
4739
|
+
Q(s, M.message, !0), Q(l, !1), console.error("PromptBuilderNew initialization failed:", M);
|
|
4740
|
+
}
|
|
4741
|
+
})(), () => {
|
|
4742
|
+
u(a)?.onUnmount?.();
|
|
4743
|
+
};
|
|
4744
|
+
});
|
|
4745
|
+
const I = (k) => k?.interaction?.type ? k.interaction.type : k?.type ? k.type : k?.interactionType ? k.interactionType : "", y = (k) => ({
|
|
4746
|
+
[Ii.MCQ]: "mcq"
|
|
4747
|
+
// TODO: Add other interaction type mappings as they're migrated
|
|
4748
|
+
})[k] || k, V = (k, M) => {
|
|
4749
|
+
switch (M) {
|
|
4750
|
+
case "mcq":
|
|
4751
|
+
return Hs(k);
|
|
4752
|
+
default:
|
|
4753
|
+
return k?.interaction ?? {};
|
|
4754
|
+
}
|
|
4755
|
+
}, E = async (k) => {
|
|
4756
|
+
const { state: M, serialized: Y } = k.detail ?? {};
|
|
4757
|
+
if (!M || !Y || u(h) || u(m)) {
|
|
4758
|
+
(u(h) || u(m)) && console.log("Preview mode - not saving state");
|
|
4759
|
+
return;
|
|
4760
|
+
}
|
|
4761
|
+
const X = u(a)?.isLocked?.(M) ?? !1, W = u(a)?.isCompleted?.(M) ?? !1;
|
|
4762
|
+
if (!(X || W))
|
|
4763
|
+
try {
|
|
4764
|
+
Q(p, !0);
|
|
4765
|
+
const P = `sessions/${r()}${u(b)}`;
|
|
4766
|
+
await ja(P, Y);
|
|
4767
|
+
} catch (P) {
|
|
4768
|
+
console.error("Failed to save state:", P);
|
|
4769
|
+
} finally {
|
|
4770
|
+
Q(p, !1);
|
|
4771
|
+
}
|
|
4772
|
+
};
|
|
4773
|
+
var _ = {
|
|
4774
|
+
get "session-id"() {
|
|
4775
|
+
return r();
|
|
4776
|
+
},
|
|
4777
|
+
set "session-id"(k) {
|
|
4778
|
+
r(k), T();
|
|
4779
|
+
},
|
|
4780
|
+
get "preview-mode"() {
|
|
4781
|
+
return i();
|
|
4782
|
+
},
|
|
4783
|
+
set "preview-mode"(k) {
|
|
4784
|
+
i(k), T();
|
|
4785
|
+
},
|
|
4786
|
+
get "item-id"() {
|
|
4787
|
+
return n();
|
|
4788
|
+
},
|
|
4789
|
+
set "item-id"(k) {
|
|
4790
|
+
n(k), T();
|
|
4791
|
+
},
|
|
4792
|
+
get "preview-contentful"() {
|
|
4793
|
+
return o();
|
|
4794
|
+
},
|
|
4795
|
+
set "preview-contentful"(k) {
|
|
4796
|
+
o(k), T();
|
|
4797
|
+
}
|
|
4798
|
+
}, g = et();
|
|
4799
|
+
ba((k) => {
|
|
4800
|
+
var M = zs();
|
|
4801
|
+
ki(4), C(k, M);
|
|
4802
|
+
});
|
|
4803
|
+
var x = tt(g);
|
|
4804
|
+
{
|
|
4805
|
+
var R = (k) => {
|
|
4806
|
+
ro(k);
|
|
4807
|
+
}, K = (k) => {
|
|
4808
|
+
var M = et(), Y = tt(M);
|
|
4809
|
+
{
|
|
4810
|
+
var X = (P) => {
|
|
4811
|
+
hi(P, {
|
|
4812
|
+
get bannerLabel() {
|
|
4813
|
+
return u(s);
|
|
4814
|
+
}
|
|
4815
|
+
});
|
|
4816
|
+
}, W = (P) => {
|
|
4817
|
+
var Z = et(), At = tt(Z);
|
|
4818
|
+
{
|
|
4819
|
+
var J = (st) => {
|
|
4820
|
+
var ne = et(), be = tt(ne);
|
|
4821
|
+
Aa(be, () => u(c), (lr, cr) => {
|
|
4822
|
+
cr(lr, {
|
|
4823
|
+
get api() {
|
|
4824
|
+
return u(a);
|
|
4825
|
+
},
|
|
4826
|
+
get config() {
|
|
4827
|
+
return u(f);
|
|
4828
|
+
},
|
|
4829
|
+
onstateChange: E
|
|
4830
|
+
});
|
|
4831
|
+
}), C(st, ne);
|
|
4832
|
+
}, Ct = (st) => {
|
|
4833
|
+
hi(st, { bannerLabel: "Unable to load interaction" });
|
|
4834
|
+
};
|
|
4835
|
+
z(
|
|
4836
|
+
At,
|
|
4837
|
+
(st) => {
|
|
4838
|
+
u(a) && u(c) && u(f) ? st(J) : st(Ct, !1);
|
|
4839
|
+
},
|
|
4840
|
+
!0
|
|
4841
|
+
);
|
|
4842
|
+
}
|
|
4843
|
+
C(P, Z);
|
|
4844
|
+
};
|
|
4845
|
+
z(
|
|
4846
|
+
Y,
|
|
4847
|
+
(P) => {
|
|
4848
|
+
u(s) ? P(X) : P(W, !1);
|
|
4849
|
+
},
|
|
4850
|
+
!0
|
|
4851
|
+
);
|
|
4852
|
+
}
|
|
4853
|
+
C(k, M);
|
|
4854
|
+
};
|
|
4855
|
+
z(x, (k) => {
|
|
4856
|
+
u(l) ? k(R) : k(K, !1);
|
|
4857
|
+
});
|
|
4858
|
+
}
|
|
4859
|
+
return C(t, g), vt(_);
|
|
4860
|
+
}
|
|
4861
|
+
customElements.define("interaction-builder", mt(
|
|
4862
|
+
Bs,
|
|
4863
|
+
{
|
|
4864
|
+
"session-id": {},
|
|
4865
|
+
"preview-mode": {},
|
|
4866
|
+
"item-id": {},
|
|
4867
|
+
"preview-contentful": {}
|
|
4868
|
+
},
|
|
4869
|
+
[],
|
|
4870
|
+
[],
|
|
4871
|
+
!0
|
|
4872
|
+
));
|
|
4873
|
+
export {
|
|
4874
|
+
Bs as InteractionBuilder
|
|
4875
|
+
};
|