@pie-players/pie-tool-graph 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/tool-graph.js +3489 -0
- package/dist/tool-graph.js.map +1 -0
- package/index.ts +8 -0
- package/package.json +62 -0
- package/tool-graph.svelte +878 -0
|
@@ -0,0 +1,3489 @@
|
|
|
1
|
+
var Bs = Object.defineProperty;
|
|
2
|
+
var Ur = (e) => {
|
|
3
|
+
throw TypeError(e);
|
|
4
|
+
};
|
|
5
|
+
var Gs = (e, t, n) => t in e ? Bs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
6
|
+
var j = (e, t, n) => Gs(e, typeof t != "symbol" ? t + "" : t, n), ur = (e, t, n) => t.has(e) || Ur("Cannot " + n);
|
|
7
|
+
var u = (e, t, n) => (ur(e, t, "read from private field"), n ? n.call(e) : t.get(e)), T = (e, t, n) => t.has(e) ? Ur("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), E = (e, t, n, i) => (ur(e, t, "write to private field"), i ? i.call(e, n) : t.set(e, n), n), U = (e, t, n) => (ur(e, t, "access private method"), n);
|
|
8
|
+
var hi;
|
|
9
|
+
typeof window < "u" && ((hi = window.__svelte ?? (window.__svelte = {})).v ?? (hi.v = /* @__PURE__ */ new Set())).add("5");
|
|
10
|
+
const Ws = 1, qs = 2, vi = 4, Ys = 8, Us = 16, Xs = 1, Ks = 2, pi = "[", Yn = "[!", Cr = "]", Jt = {}, Q = /* @__PURE__ */ Symbol(), Js = "http://www.w3.org/1999/xhtml", hr = !1;
|
|
11
|
+
var _i = Array.isArray, Qs = Array.prototype.indexOf, Qt = Array.prototype.includes, Un = Array.from, Fn = Object.keys, jn = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, Zs = Object.getOwnPropertyDescriptors, el = Object.prototype, tl = Array.prototype, gi = Object.getPrototypeOf, Xr = Object.isExtensible;
|
|
12
|
+
function nl(e) {
|
|
13
|
+
for (var t = 0; t < e.length; t++)
|
|
14
|
+
e[t]();
|
|
15
|
+
}
|
|
16
|
+
function mi() {
|
|
17
|
+
var e, t, n = new Promise((i, r) => {
|
|
18
|
+
e = i, t = r;
|
|
19
|
+
});
|
|
20
|
+
return { promise: n, resolve: e, reject: t };
|
|
21
|
+
}
|
|
22
|
+
const ee = 2, Vn = 4, Xn = 8, wi = 1 << 24, lt = 16, ze = 32, wt = 64, Ar = 128, Ee = 512, K = 1024, ie = 2048, at = 4096, _e = 8192, nt = 16384, Kn = 32768, Zt = 65536, Kr = 1 << 17, bi = 1 << 18, Lt = 1 << 19, rl = 1 << 20, Ze = 1 << 25, Rt = 32768, vr = 1 << 21, Or = 1 << 22, pt = 1 << 23, In = /* @__PURE__ */ Symbol("$state"), il = /* @__PURE__ */ Symbol("legacy props"), sl = /* @__PURE__ */ Symbol(""), Vt = new class extends Error {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
j(this, "name", "StaleReactionError");
|
|
26
|
+
j(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
27
|
+
}
|
|
28
|
+
}(), Jn = 3, rn = 8;
|
|
29
|
+
function ll(e) {
|
|
30
|
+
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
|
|
31
|
+
}
|
|
32
|
+
function al() {
|
|
33
|
+
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
34
|
+
}
|
|
35
|
+
function ol(e) {
|
|
36
|
+
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
37
|
+
}
|
|
38
|
+
function fl() {
|
|
39
|
+
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
40
|
+
}
|
|
41
|
+
function ul(e) {
|
|
42
|
+
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
43
|
+
}
|
|
44
|
+
function cl() {
|
|
45
|
+
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
46
|
+
}
|
|
47
|
+
function dl() {
|
|
48
|
+
throw new Error("https://svelte.dev/e/hydration_failed");
|
|
49
|
+
}
|
|
50
|
+
function hl() {
|
|
51
|
+
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
52
|
+
}
|
|
53
|
+
function vl() {
|
|
54
|
+
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
55
|
+
}
|
|
56
|
+
function pl() {
|
|
57
|
+
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
58
|
+
}
|
|
59
|
+
function _l() {
|
|
60
|
+
throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
|
|
61
|
+
}
|
|
62
|
+
function Qn(e) {
|
|
63
|
+
console.warn("https://svelte.dev/e/hydration_mismatch");
|
|
64
|
+
}
|
|
65
|
+
function gl() {
|
|
66
|
+
console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
|
|
67
|
+
}
|
|
68
|
+
let O = !1;
|
|
69
|
+
function et(e) {
|
|
70
|
+
O = e;
|
|
71
|
+
}
|
|
72
|
+
let M;
|
|
73
|
+
function ue(e) {
|
|
74
|
+
if (e === null)
|
|
75
|
+
throw Qn(), Jt;
|
|
76
|
+
return M = e;
|
|
77
|
+
}
|
|
78
|
+
function En() {
|
|
79
|
+
return ue(/* @__PURE__ */ He(M));
|
|
80
|
+
}
|
|
81
|
+
function H(e) {
|
|
82
|
+
if (O) {
|
|
83
|
+
if (/* @__PURE__ */ He(M) !== null)
|
|
84
|
+
throw Qn(), Jt;
|
|
85
|
+
M = e;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function ml(e = 1) {
|
|
89
|
+
if (O) {
|
|
90
|
+
for (var t = e, n = M; t--; )
|
|
91
|
+
n = /** @type {TemplateNode} */
|
|
92
|
+
/* @__PURE__ */ He(n);
|
|
93
|
+
M = n;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function Hn(e = !0) {
|
|
97
|
+
for (var t = 0, n = M; ; ) {
|
|
98
|
+
if (n.nodeType === rn) {
|
|
99
|
+
var i = (
|
|
100
|
+
/** @type {Comment} */
|
|
101
|
+
n.data
|
|
102
|
+
);
|
|
103
|
+
if (i === Cr) {
|
|
104
|
+
if (t === 0) return n;
|
|
105
|
+
t -= 1;
|
|
106
|
+
} else (i === pi || i === Yn) && (t += 1);
|
|
107
|
+
}
|
|
108
|
+
var r = (
|
|
109
|
+
/** @type {TemplateNode} */
|
|
110
|
+
/* @__PURE__ */ He(n)
|
|
111
|
+
);
|
|
112
|
+
e && n.remove(), n = r;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function yi(e) {
|
|
116
|
+
if (!e || e.nodeType !== rn)
|
|
117
|
+
throw Qn(), Jt;
|
|
118
|
+
return (
|
|
119
|
+
/** @type {Comment} */
|
|
120
|
+
e.data
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
function Ei(e) {
|
|
124
|
+
return e === this.v;
|
|
125
|
+
}
|
|
126
|
+
function wl(e, t) {
|
|
127
|
+
return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
|
|
128
|
+
}
|
|
129
|
+
function $i(e) {
|
|
130
|
+
return !wl(e, this.v);
|
|
131
|
+
}
|
|
132
|
+
let bl = !1, ge = null;
|
|
133
|
+
function en(e) {
|
|
134
|
+
ge = e;
|
|
135
|
+
}
|
|
136
|
+
function Zn(e, t = !1, n) {
|
|
137
|
+
ge = {
|
|
138
|
+
p: ge,
|
|
139
|
+
i: !1,
|
|
140
|
+
c: null,
|
|
141
|
+
e: null,
|
|
142
|
+
s: e,
|
|
143
|
+
x: null,
|
|
144
|
+
l: null
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function er(e) {
|
|
148
|
+
var t = (
|
|
149
|
+
/** @type {ComponentContext} */
|
|
150
|
+
ge
|
|
151
|
+
), n = t.e;
|
|
152
|
+
if (n !== null) {
|
|
153
|
+
t.e = null;
|
|
154
|
+
for (var i of n)
|
|
155
|
+
Ui(i);
|
|
156
|
+
}
|
|
157
|
+
return e !== void 0 && (t.x = e), t.i = !0, ge = t.p, e ?? /** @type {T} */
|
|
158
|
+
{};
|
|
159
|
+
}
|
|
160
|
+
function xi() {
|
|
161
|
+
return !0;
|
|
162
|
+
}
|
|
163
|
+
let $t = [];
|
|
164
|
+
function ki() {
|
|
165
|
+
var e = $t;
|
|
166
|
+
$t = [], nl(e);
|
|
167
|
+
}
|
|
168
|
+
function Fe(e) {
|
|
169
|
+
if ($t.length === 0 && !hn) {
|
|
170
|
+
var t = $t;
|
|
171
|
+
queueMicrotask(() => {
|
|
172
|
+
t === $t && ki();
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
$t.push(e);
|
|
176
|
+
}
|
|
177
|
+
function yl() {
|
|
178
|
+
for (; $t.length > 0; )
|
|
179
|
+
ki();
|
|
180
|
+
}
|
|
181
|
+
function Ti(e) {
|
|
182
|
+
var t = z;
|
|
183
|
+
if (t === null)
|
|
184
|
+
return A.f |= pt, e;
|
|
185
|
+
if ((t.f & Kn) === 0) {
|
|
186
|
+
if ((t.f & Ar) === 0)
|
|
187
|
+
throw e;
|
|
188
|
+
t.b.error(e);
|
|
189
|
+
} else
|
|
190
|
+
tn(e, t);
|
|
191
|
+
}
|
|
192
|
+
function tn(e, t) {
|
|
193
|
+
for (; t !== null; ) {
|
|
194
|
+
if ((t.f & Ar) !== 0)
|
|
195
|
+
try {
|
|
196
|
+
t.b.error(e);
|
|
197
|
+
return;
|
|
198
|
+
} catch (n) {
|
|
199
|
+
e = n;
|
|
200
|
+
}
|
|
201
|
+
t = t.parent;
|
|
202
|
+
}
|
|
203
|
+
throw e;
|
|
204
|
+
}
|
|
205
|
+
const El = -7169;
|
|
206
|
+
function W(e, t) {
|
|
207
|
+
e.f = e.f & El | t;
|
|
208
|
+
}
|
|
209
|
+
function Mr(e) {
|
|
210
|
+
(e.f & Ee) !== 0 || e.deps === null ? W(e, K) : W(e, at);
|
|
211
|
+
}
|
|
212
|
+
function Si(e) {
|
|
213
|
+
if (e !== null)
|
|
214
|
+
for (const t of e)
|
|
215
|
+
(t.f & ee) === 0 || (t.f & Rt) === 0 || (t.f ^= Rt, Si(
|
|
216
|
+
/** @type {Derived} */
|
|
217
|
+
t.deps
|
|
218
|
+
));
|
|
219
|
+
}
|
|
220
|
+
function Ci(e, t, n) {
|
|
221
|
+
(e.f & ie) !== 0 ? t.add(e) : (e.f & at) !== 0 && n.add(e), Si(e.deps), W(e, K);
|
|
222
|
+
}
|
|
223
|
+
const zn = /* @__PURE__ */ new Set();
|
|
224
|
+
let N = null, pr = null, Ae = null, ve = [], tr = null, _r = !1, hn = !1;
|
|
225
|
+
var Gt, Wt, kt, qt, gn, mn, Tt, Yt, Ve, gr, mr, Ai;
|
|
226
|
+
const Fr = class Fr {
|
|
227
|
+
constructor() {
|
|
228
|
+
T(this, Ve);
|
|
229
|
+
j(this, "committed", !1);
|
|
230
|
+
/**
|
|
231
|
+
* The current values of any sources that are updated in this batch
|
|
232
|
+
* They keys of this map are identical to `this.#previous`
|
|
233
|
+
* @type {Map<Source, any>}
|
|
234
|
+
*/
|
|
235
|
+
j(this, "current", /* @__PURE__ */ new Map());
|
|
236
|
+
/**
|
|
237
|
+
* The values of any sources that are updated in this batch _before_ those updates took place.
|
|
238
|
+
* They keys of this map are identical to `this.#current`
|
|
239
|
+
* @type {Map<Source, any>}
|
|
240
|
+
*/
|
|
241
|
+
j(this, "previous", /* @__PURE__ */ new Map());
|
|
242
|
+
/**
|
|
243
|
+
* When the batch is committed (and the DOM is updated), we need to remove old branches
|
|
244
|
+
* and append new ones by calling the functions added inside (if/each/key/etc) blocks
|
|
245
|
+
* @type {Set<() => void>}
|
|
246
|
+
*/
|
|
247
|
+
T(this, Gt, /* @__PURE__ */ new Set());
|
|
248
|
+
/**
|
|
249
|
+
* If a fork is discarded, we need to destroy any effects that are no longer needed
|
|
250
|
+
* @type {Set<(batch: Batch) => void>}
|
|
251
|
+
*/
|
|
252
|
+
T(this, Wt, /* @__PURE__ */ new Set());
|
|
253
|
+
/**
|
|
254
|
+
* The number of async effects that are currently in flight
|
|
255
|
+
*/
|
|
256
|
+
T(this, kt, 0);
|
|
257
|
+
/**
|
|
258
|
+
* The number of async effects that are currently in flight, _not_ inside a pending boundary
|
|
259
|
+
*/
|
|
260
|
+
T(this, qt, 0);
|
|
261
|
+
/**
|
|
262
|
+
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
263
|
+
* TODO replace with Promise.withResolvers once supported widely enough
|
|
264
|
+
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
265
|
+
*/
|
|
266
|
+
T(this, gn, null);
|
|
267
|
+
/**
|
|
268
|
+
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
269
|
+
* @type {Set<Effect>}
|
|
270
|
+
*/
|
|
271
|
+
T(this, mn, /* @__PURE__ */ new Set());
|
|
272
|
+
/**
|
|
273
|
+
* Deferred effects that are MAYBE_DIRTY
|
|
274
|
+
* @type {Set<Effect>}
|
|
275
|
+
*/
|
|
276
|
+
T(this, Tt, /* @__PURE__ */ new Set());
|
|
277
|
+
/**
|
|
278
|
+
* A set of branches that still exist, but will be destroyed when this batch
|
|
279
|
+
* is committed — we skip over these during `process`
|
|
280
|
+
* @type {Set<Effect>}
|
|
281
|
+
*/
|
|
282
|
+
j(this, "skipped_effects", /* @__PURE__ */ new Set());
|
|
283
|
+
j(this, "is_fork", !1);
|
|
284
|
+
T(this, Yt, !1);
|
|
285
|
+
}
|
|
286
|
+
is_deferred() {
|
|
287
|
+
return this.is_fork || u(this, qt) > 0;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
*
|
|
291
|
+
* @param {Effect[]} root_effects
|
|
292
|
+
*/
|
|
293
|
+
process(t) {
|
|
294
|
+
ve = [], this.apply();
|
|
295
|
+
var n = [], i = [];
|
|
296
|
+
for (const r of t)
|
|
297
|
+
U(this, Ve, gr).call(this, r, n, i);
|
|
298
|
+
if (this.is_deferred()) {
|
|
299
|
+
U(this, Ve, mr).call(this, i), U(this, Ve, mr).call(this, n);
|
|
300
|
+
for (const r of this.skipped_effects)
|
|
301
|
+
Ri(r);
|
|
302
|
+
} else {
|
|
303
|
+
for (const r of u(this, Gt)) r();
|
|
304
|
+
u(this, Gt).clear(), u(this, kt) === 0 && U(this, Ve, Ai).call(this), pr = this, N = null, Jr(i), Jr(n), pr = null, u(this, gn)?.resolve();
|
|
305
|
+
}
|
|
306
|
+
Ae = null;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Associate a change to a given source with the current
|
|
310
|
+
* batch, noting its previous and current values
|
|
311
|
+
* @param {Source} source
|
|
312
|
+
* @param {any} value
|
|
313
|
+
*/
|
|
314
|
+
capture(t, n) {
|
|
315
|
+
n !== Q && !this.previous.has(t) && this.previous.set(t, n), (t.f & pt) === 0 && (this.current.set(t, t.v), Ae?.set(t, t.v));
|
|
316
|
+
}
|
|
317
|
+
activate() {
|
|
318
|
+
N = this, this.apply();
|
|
319
|
+
}
|
|
320
|
+
deactivate() {
|
|
321
|
+
N === this && (N = null, Ae = null);
|
|
322
|
+
}
|
|
323
|
+
flush() {
|
|
324
|
+
if (this.activate(), ve.length > 0) {
|
|
325
|
+
if (Oi(), N !== null && N !== this)
|
|
326
|
+
return;
|
|
327
|
+
} else u(this, kt) === 0 && this.process([]);
|
|
328
|
+
this.deactivate();
|
|
329
|
+
}
|
|
330
|
+
discard() {
|
|
331
|
+
for (const t of u(this, Wt)) t(this);
|
|
332
|
+
u(this, Wt).clear();
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
*
|
|
336
|
+
* @param {boolean} blocking
|
|
337
|
+
*/
|
|
338
|
+
increment(t) {
|
|
339
|
+
E(this, kt, u(this, kt) + 1), t && E(this, qt, u(this, qt) + 1);
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
*
|
|
343
|
+
* @param {boolean} blocking
|
|
344
|
+
*/
|
|
345
|
+
decrement(t) {
|
|
346
|
+
E(this, kt, u(this, kt) - 1), t && E(this, qt, u(this, qt) - 1), !u(this, Yt) && (E(this, Yt, !0), Fe(() => {
|
|
347
|
+
E(this, Yt, !1), this.is_deferred() ? ve.length > 0 && this.flush() : this.revive();
|
|
348
|
+
}));
|
|
349
|
+
}
|
|
350
|
+
revive() {
|
|
351
|
+
for (const t of u(this, mn))
|
|
352
|
+
u(this, Tt).delete(t), W(t, ie), it(t);
|
|
353
|
+
for (const t of u(this, Tt))
|
|
354
|
+
W(t, at), it(t);
|
|
355
|
+
this.flush();
|
|
356
|
+
}
|
|
357
|
+
/** @param {() => void} fn */
|
|
358
|
+
oncommit(t) {
|
|
359
|
+
u(this, Gt).add(t);
|
|
360
|
+
}
|
|
361
|
+
/** @param {(batch: Batch) => void} fn */
|
|
362
|
+
ondiscard(t) {
|
|
363
|
+
u(this, Wt).add(t);
|
|
364
|
+
}
|
|
365
|
+
settled() {
|
|
366
|
+
return (u(this, gn) ?? E(this, gn, mi())).promise;
|
|
367
|
+
}
|
|
368
|
+
static ensure() {
|
|
369
|
+
if (N === null) {
|
|
370
|
+
const t = N = new Fr();
|
|
371
|
+
zn.add(N), hn || Fe(() => {
|
|
372
|
+
N === t && t.flush();
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
return N;
|
|
376
|
+
}
|
|
377
|
+
apply() {
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
Gt = new WeakMap(), Wt = new WeakMap(), kt = new WeakMap(), qt = new WeakMap(), gn = new WeakMap(), mn = new WeakMap(), Tt = new WeakMap(), Yt = new WeakMap(), Ve = new WeakSet(), /**
|
|
381
|
+
* Traverse the effect tree, executing effects or stashing
|
|
382
|
+
* them for later execution as appropriate
|
|
383
|
+
* @param {Effect} root
|
|
384
|
+
* @param {Effect[]} effects
|
|
385
|
+
* @param {Effect[]} render_effects
|
|
386
|
+
*/
|
|
387
|
+
gr = function(t, n, i) {
|
|
388
|
+
t.f ^= K;
|
|
389
|
+
for (var r = t.first, s = null; r !== null; ) {
|
|
390
|
+
var l = r.f, a = (l & (ze | wt)) !== 0, o = a && (l & K) !== 0, c = o || (l & _e) !== 0 || this.skipped_effects.has(r);
|
|
391
|
+
if (!c && r.fn !== null) {
|
|
392
|
+
a ? r.f ^= K : s !== null && (l & (Vn | Xn | wi)) !== 0 ? s.b.defer_effect(r) : (l & Vn) !== 0 ? n.push(r) : $n(r) && ((l & lt) !== 0 && u(this, Tt).add(r), _n(r));
|
|
393
|
+
var d = r.first;
|
|
394
|
+
if (d !== null) {
|
|
395
|
+
r = d;
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
var _ = r.parent;
|
|
400
|
+
for (r = r.next; r === null && _ !== null; )
|
|
401
|
+
_ === s && (s = null), r = _.next, _ = _.parent;
|
|
402
|
+
}
|
|
403
|
+
}, /**
|
|
404
|
+
* @param {Effect[]} effects
|
|
405
|
+
*/
|
|
406
|
+
mr = function(t) {
|
|
407
|
+
for (var n = 0; n < t.length; n += 1)
|
|
408
|
+
Ci(t[n], u(this, mn), u(this, Tt));
|
|
409
|
+
}, Ai = function() {
|
|
410
|
+
var r;
|
|
411
|
+
if (zn.size > 1) {
|
|
412
|
+
this.previous.clear();
|
|
413
|
+
var t = Ae, n = !0;
|
|
414
|
+
for (const s of zn) {
|
|
415
|
+
if (s === this) {
|
|
416
|
+
n = !1;
|
|
417
|
+
continue;
|
|
418
|
+
}
|
|
419
|
+
const l = [];
|
|
420
|
+
for (const [o, c] of this.current) {
|
|
421
|
+
if (s.current.has(o))
|
|
422
|
+
if (n && c !== s.current.get(o))
|
|
423
|
+
s.current.set(o, c);
|
|
424
|
+
else
|
|
425
|
+
continue;
|
|
426
|
+
l.push(o);
|
|
427
|
+
}
|
|
428
|
+
if (l.length === 0)
|
|
429
|
+
continue;
|
|
430
|
+
const a = [...s.current.keys()].filter((o) => !this.current.has(o));
|
|
431
|
+
if (a.length > 0) {
|
|
432
|
+
var i = ve;
|
|
433
|
+
ve = [];
|
|
434
|
+
const o = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
|
|
435
|
+
for (const d of l)
|
|
436
|
+
Mi(d, a, o, c);
|
|
437
|
+
if (ve.length > 0) {
|
|
438
|
+
N = s, s.apply();
|
|
439
|
+
for (const d of ve)
|
|
440
|
+
U(r = s, Ve, gr).call(r, d, [], []);
|
|
441
|
+
s.deactivate();
|
|
442
|
+
}
|
|
443
|
+
ve = i;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
N = null, Ae = t;
|
|
447
|
+
}
|
|
448
|
+
this.committed = !0, zn.delete(this);
|
|
449
|
+
};
|
|
450
|
+
let rt = Fr;
|
|
451
|
+
function pe(e) {
|
|
452
|
+
var t = hn;
|
|
453
|
+
hn = !0;
|
|
454
|
+
try {
|
|
455
|
+
for (var n; ; ) {
|
|
456
|
+
if (yl(), ve.length === 0 && (N?.flush(), ve.length === 0))
|
|
457
|
+
return tr = null, /** @type {T} */
|
|
458
|
+
n;
|
|
459
|
+
Oi();
|
|
460
|
+
}
|
|
461
|
+
} finally {
|
|
462
|
+
hn = t;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
function Oi() {
|
|
466
|
+
_r = !0;
|
|
467
|
+
var e = null;
|
|
468
|
+
try {
|
|
469
|
+
for (var t = 0; ve.length > 0; ) {
|
|
470
|
+
var n = rt.ensure();
|
|
471
|
+
if (t++ > 1e3) {
|
|
472
|
+
var i, r;
|
|
473
|
+
$l();
|
|
474
|
+
}
|
|
475
|
+
n.process(ve), _t.clear();
|
|
476
|
+
}
|
|
477
|
+
} finally {
|
|
478
|
+
_r = !1, tr = null;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
function $l() {
|
|
482
|
+
try {
|
|
483
|
+
cl();
|
|
484
|
+
} catch (e) {
|
|
485
|
+
tn(e, tr);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
let Ye = null;
|
|
489
|
+
function Jr(e) {
|
|
490
|
+
var t = e.length;
|
|
491
|
+
if (t !== 0) {
|
|
492
|
+
for (var n = 0; n < t; ) {
|
|
493
|
+
var i = e[n++];
|
|
494
|
+
if ((i.f & (nt | _e)) === 0 && $n(i) && (Ye = /* @__PURE__ */ new Set(), _n(i), i.deps === null && i.first === null && i.nodes === null && (i.teardown === null && i.ac === null ? Qi(i) : i.fn = null), Ye?.size > 0)) {
|
|
495
|
+
_t.clear();
|
|
496
|
+
for (const r of Ye) {
|
|
497
|
+
if ((r.f & (nt | _e)) !== 0) continue;
|
|
498
|
+
const s = [r];
|
|
499
|
+
let l = r.parent;
|
|
500
|
+
for (; l !== null; )
|
|
501
|
+
Ye.has(l) && (Ye.delete(l), s.push(l)), l = l.parent;
|
|
502
|
+
for (let a = s.length - 1; a >= 0; a--) {
|
|
503
|
+
const o = s[a];
|
|
504
|
+
(o.f & (nt | _e)) === 0 && _n(o);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
Ye.clear();
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
Ye = null;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
function Mi(e, t, n, i) {
|
|
514
|
+
if (!n.has(e) && (n.add(e), e.reactions !== null))
|
|
515
|
+
for (const r of e.reactions) {
|
|
516
|
+
const s = r.f;
|
|
517
|
+
(s & ee) !== 0 ? Mi(
|
|
518
|
+
/** @type {Derived} */
|
|
519
|
+
r,
|
|
520
|
+
t,
|
|
521
|
+
n,
|
|
522
|
+
i
|
|
523
|
+
) : (s & (Or | lt)) !== 0 && (s & ie) === 0 && zi(r, t, i) && (W(r, ie), it(
|
|
524
|
+
/** @type {Effect} */
|
|
525
|
+
r
|
|
526
|
+
));
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
function zi(e, t, n) {
|
|
530
|
+
const i = n.get(e);
|
|
531
|
+
if (i !== void 0) return i;
|
|
532
|
+
if (e.deps !== null)
|
|
533
|
+
for (const r of e.deps) {
|
|
534
|
+
if (Qt.call(t, r))
|
|
535
|
+
return !0;
|
|
536
|
+
if ((r.f & ee) !== 0 && zi(
|
|
537
|
+
/** @type {Derived} */
|
|
538
|
+
r,
|
|
539
|
+
t,
|
|
540
|
+
n
|
|
541
|
+
))
|
|
542
|
+
return n.set(
|
|
543
|
+
/** @type {Derived} */
|
|
544
|
+
r,
|
|
545
|
+
!0
|
|
546
|
+
), !0;
|
|
547
|
+
}
|
|
548
|
+
return n.set(e, !1), !1;
|
|
549
|
+
}
|
|
550
|
+
function it(e) {
|
|
551
|
+
for (var t = tr = e; t.parent !== null; ) {
|
|
552
|
+
t = t.parent;
|
|
553
|
+
var n = t.f;
|
|
554
|
+
if (_r && t === z && (n & lt) !== 0 && (n & bi) === 0)
|
|
555
|
+
return;
|
|
556
|
+
if ((n & (wt | ze)) !== 0) {
|
|
557
|
+
if ((n & K) === 0) return;
|
|
558
|
+
t.f ^= K;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
ve.push(t);
|
|
562
|
+
}
|
|
563
|
+
function Ri(e) {
|
|
564
|
+
if (!((e.f & ze) !== 0 && (e.f & K) !== 0)) {
|
|
565
|
+
W(e, K);
|
|
566
|
+
for (var t = e.first; t !== null; )
|
|
567
|
+
Ri(t), t = t.next;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
function xl(e) {
|
|
571
|
+
let t = 0, n = It(0), i;
|
|
572
|
+
return () => {
|
|
573
|
+
Ir() && (f(n), ir(() => (t === 0 && (i = sr(() => e(() => vn(n)))), t += 1, () => {
|
|
574
|
+
Fe(() => {
|
|
575
|
+
t -= 1, t === 0 && (i?.(), i = void 0, vn(n));
|
|
576
|
+
});
|
|
577
|
+
})));
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
var kl = Zt | Lt | Ar;
|
|
581
|
+
function Tl(e, t, n) {
|
|
582
|
+
new Sl(e, t, n);
|
|
583
|
+
}
|
|
584
|
+
var de, wn, Le, St, Ne, we, oe, Pe, Xe, vt, Ct, Ke, Ut, At, Xt, Kt, Je, Wn, B, Ii, Li, wr, Ln, Nn, br;
|
|
585
|
+
class Sl {
|
|
586
|
+
/**
|
|
587
|
+
* @param {TemplateNode} node
|
|
588
|
+
* @param {BoundaryProps} props
|
|
589
|
+
* @param {((anchor: Node) => void)} children
|
|
590
|
+
*/
|
|
591
|
+
constructor(t, n, i) {
|
|
592
|
+
T(this, B);
|
|
593
|
+
/** @type {Boundary | null} */
|
|
594
|
+
j(this, "parent");
|
|
595
|
+
j(this, "is_pending", !1);
|
|
596
|
+
/** @type {TemplateNode} */
|
|
597
|
+
T(this, de);
|
|
598
|
+
/** @type {TemplateNode | null} */
|
|
599
|
+
T(this, wn, O ? M : null);
|
|
600
|
+
/** @type {BoundaryProps} */
|
|
601
|
+
T(this, Le);
|
|
602
|
+
/** @type {((anchor: Node) => void)} */
|
|
603
|
+
T(this, St);
|
|
604
|
+
/** @type {Effect} */
|
|
605
|
+
T(this, Ne);
|
|
606
|
+
/** @type {Effect | null} */
|
|
607
|
+
T(this, we, null);
|
|
608
|
+
/** @type {Effect | null} */
|
|
609
|
+
T(this, oe, null);
|
|
610
|
+
/** @type {Effect | null} */
|
|
611
|
+
T(this, Pe, null);
|
|
612
|
+
/** @type {DocumentFragment | null} */
|
|
613
|
+
T(this, Xe, null);
|
|
614
|
+
/** @type {TemplateNode | null} */
|
|
615
|
+
T(this, vt, null);
|
|
616
|
+
T(this, Ct, 0);
|
|
617
|
+
T(this, Ke, 0);
|
|
618
|
+
T(this, Ut, !1);
|
|
619
|
+
T(this, At, !1);
|
|
620
|
+
/** @type {Set<Effect>} */
|
|
621
|
+
T(this, Xt, /* @__PURE__ */ new Set());
|
|
622
|
+
/** @type {Set<Effect>} */
|
|
623
|
+
T(this, Kt, /* @__PURE__ */ new Set());
|
|
624
|
+
/**
|
|
625
|
+
* A source containing the number of pending async deriveds/expressions.
|
|
626
|
+
* Only created if `$effect.pending()` is used inside the boundary,
|
|
627
|
+
* otherwise updating the source results in needless `Batch.ensure()`
|
|
628
|
+
* calls followed by no-op flushes
|
|
629
|
+
* @type {Source<number> | null}
|
|
630
|
+
*/
|
|
631
|
+
T(this, Je, null);
|
|
632
|
+
T(this, Wn, xl(() => (E(this, Je, It(u(this, Ct))), () => {
|
|
633
|
+
E(this, Je, null);
|
|
634
|
+
})));
|
|
635
|
+
E(this, de, t), E(this, Le, n), E(this, St, i), this.parent = /** @type {Effect} */
|
|
636
|
+
z.b, this.is_pending = !!u(this, Le).pending, E(this, Ne, Lr(() => {
|
|
637
|
+
if (z.b = this, O) {
|
|
638
|
+
const s = u(this, wn);
|
|
639
|
+
En(), /** @type {Comment} */
|
|
640
|
+
s.nodeType === rn && /** @type {Comment} */
|
|
641
|
+
s.data === Yn ? U(this, B, Li).call(this) : (U(this, B, Ii).call(this), u(this, Ke) === 0 && (this.is_pending = !1));
|
|
642
|
+
} else {
|
|
643
|
+
var r = U(this, B, wr).call(this);
|
|
644
|
+
try {
|
|
645
|
+
E(this, we, ye(() => i(r)));
|
|
646
|
+
} catch (s) {
|
|
647
|
+
this.error(s);
|
|
648
|
+
}
|
|
649
|
+
u(this, Ke) > 0 ? U(this, B, Nn).call(this) : this.is_pending = !1;
|
|
650
|
+
}
|
|
651
|
+
return () => {
|
|
652
|
+
u(this, vt)?.remove();
|
|
653
|
+
};
|
|
654
|
+
}, kl)), O && E(this, de, M);
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Defer an effect inside a pending boundary until the boundary resolves
|
|
658
|
+
* @param {Effect} effect
|
|
659
|
+
*/
|
|
660
|
+
defer_effect(t) {
|
|
661
|
+
Ci(t, u(this, Xt), u(this, Kt));
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* Returns `false` if the effect exists inside a boundary whose pending snippet is shown
|
|
665
|
+
* @returns {boolean}
|
|
666
|
+
*/
|
|
667
|
+
is_rendered() {
|
|
668
|
+
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
669
|
+
}
|
|
670
|
+
has_pending_snippet() {
|
|
671
|
+
return !!u(this, Le).pending;
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
675
|
+
* and controls when the current `pending` snippet (if any) is removed.
|
|
676
|
+
* Do not call from inside the class
|
|
677
|
+
* @param {1 | -1} d
|
|
678
|
+
*/
|
|
679
|
+
update_pending_count(t) {
|
|
680
|
+
U(this, B, br).call(this, t), E(this, Ct, u(this, Ct) + t), !(!u(this, Je) || u(this, Ut)) && (E(this, Ut, !0), Fe(() => {
|
|
681
|
+
E(this, Ut, !1), u(this, Je) && nn(u(this, Je), u(this, Ct));
|
|
682
|
+
}));
|
|
683
|
+
}
|
|
684
|
+
get_effect_pending() {
|
|
685
|
+
return u(this, Wn).call(this), f(
|
|
686
|
+
/** @type {Source<number>} */
|
|
687
|
+
u(this, Je)
|
|
688
|
+
);
|
|
689
|
+
}
|
|
690
|
+
/** @param {unknown} error */
|
|
691
|
+
error(t) {
|
|
692
|
+
var n = u(this, Le).onerror;
|
|
693
|
+
let i = u(this, Le).failed;
|
|
694
|
+
if (u(this, At) || !n && !i)
|
|
695
|
+
throw t;
|
|
696
|
+
u(this, we) && (re(u(this, we)), E(this, we, null)), u(this, oe) && (re(u(this, oe)), E(this, oe, null)), u(this, Pe) && (re(u(this, Pe)), E(this, Pe, null)), O && (ue(
|
|
697
|
+
/** @type {TemplateNode} */
|
|
698
|
+
u(this, wn)
|
|
699
|
+
), ml(), ue(Hn()));
|
|
700
|
+
var r = !1, s = !1;
|
|
701
|
+
const l = () => {
|
|
702
|
+
if (r) {
|
|
703
|
+
gl();
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
706
|
+
r = !0, s && _l(), rt.ensure(), E(this, Ct, 0), u(this, Pe) !== null && Mt(u(this, Pe), () => {
|
|
707
|
+
E(this, Pe, null);
|
|
708
|
+
}), this.is_pending = this.has_pending_snippet(), E(this, we, U(this, B, Ln).call(this, () => (E(this, At, !1), ye(() => u(this, St).call(this, u(this, de)))))), u(this, Ke) > 0 ? U(this, B, Nn).call(this) : this.is_pending = !1;
|
|
709
|
+
};
|
|
710
|
+
Fe(() => {
|
|
711
|
+
try {
|
|
712
|
+
s = !0, n?.(t, l), s = !1;
|
|
713
|
+
} catch (a) {
|
|
714
|
+
tn(a, u(this, Ne) && u(this, Ne).parent);
|
|
715
|
+
}
|
|
716
|
+
i && E(this, Pe, U(this, B, Ln).call(this, () => {
|
|
717
|
+
rt.ensure(), E(this, At, !0);
|
|
718
|
+
try {
|
|
719
|
+
return ye(() => {
|
|
720
|
+
i(
|
|
721
|
+
u(this, de),
|
|
722
|
+
() => t,
|
|
723
|
+
() => l
|
|
724
|
+
);
|
|
725
|
+
});
|
|
726
|
+
} catch (a) {
|
|
727
|
+
return tn(
|
|
728
|
+
a,
|
|
729
|
+
/** @type {Effect} */
|
|
730
|
+
u(this, Ne).parent
|
|
731
|
+
), null;
|
|
732
|
+
} finally {
|
|
733
|
+
E(this, At, !1);
|
|
734
|
+
}
|
|
735
|
+
}));
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
de = new WeakMap(), wn = new WeakMap(), Le = new WeakMap(), St = new WeakMap(), Ne = new WeakMap(), we = new WeakMap(), oe = new WeakMap(), Pe = new WeakMap(), Xe = new WeakMap(), vt = new WeakMap(), Ct = new WeakMap(), Ke = new WeakMap(), Ut = new WeakMap(), At = new WeakMap(), Xt = new WeakMap(), Kt = new WeakMap(), Je = new WeakMap(), Wn = new WeakMap(), B = new WeakSet(), Ii = function() {
|
|
740
|
+
try {
|
|
741
|
+
E(this, we, ye(() => u(this, St).call(this, u(this, de))));
|
|
742
|
+
} catch (t) {
|
|
743
|
+
this.error(t);
|
|
744
|
+
}
|
|
745
|
+
}, Li = function() {
|
|
746
|
+
const t = u(this, Le).pending;
|
|
747
|
+
t && (E(this, oe, ye(() => t(u(this, de)))), Fe(() => {
|
|
748
|
+
var n = U(this, B, wr).call(this);
|
|
749
|
+
E(this, we, U(this, B, Ln).call(this, () => (rt.ensure(), ye(() => u(this, St).call(this, n))))), u(this, Ke) > 0 ? U(this, B, Nn).call(this) : (Mt(
|
|
750
|
+
/** @type {Effect} */
|
|
751
|
+
u(this, oe),
|
|
752
|
+
() => {
|
|
753
|
+
E(this, oe, null);
|
|
754
|
+
}
|
|
755
|
+
), this.is_pending = !1);
|
|
756
|
+
}));
|
|
757
|
+
}, wr = function() {
|
|
758
|
+
var t = u(this, de);
|
|
759
|
+
return this.is_pending && (E(this, vt, $e()), u(this, de).before(u(this, vt)), t = u(this, vt)), t;
|
|
760
|
+
}, /**
|
|
761
|
+
* @param {() => Effect | null} fn
|
|
762
|
+
*/
|
|
763
|
+
Ln = function(t) {
|
|
764
|
+
var n = z, i = A, r = ge;
|
|
765
|
+
je(u(this, Ne)), ke(u(this, Ne)), en(u(this, Ne).ctx);
|
|
766
|
+
try {
|
|
767
|
+
return t();
|
|
768
|
+
} catch (s) {
|
|
769
|
+
return Ti(s), null;
|
|
770
|
+
} finally {
|
|
771
|
+
je(n), ke(i), en(r);
|
|
772
|
+
}
|
|
773
|
+
}, Nn = function() {
|
|
774
|
+
const t = (
|
|
775
|
+
/** @type {(anchor: Node) => void} */
|
|
776
|
+
u(this, Le).pending
|
|
777
|
+
);
|
|
778
|
+
u(this, we) !== null && (E(this, Xe, document.createDocumentFragment()), u(this, Xe).append(
|
|
779
|
+
/** @type {TemplateNode} */
|
|
780
|
+
u(this, vt)
|
|
781
|
+
), ts(u(this, we), u(this, Xe))), u(this, oe) === null && E(this, oe, ye(() => t(u(this, de))));
|
|
782
|
+
}, /**
|
|
783
|
+
* Updates the pending count associated with the currently visible pending snippet,
|
|
784
|
+
* if any, such that we can replace the snippet with content once work is done
|
|
785
|
+
* @param {1 | -1} d
|
|
786
|
+
*/
|
|
787
|
+
br = function(t) {
|
|
788
|
+
var n;
|
|
789
|
+
if (!this.has_pending_snippet()) {
|
|
790
|
+
this.parent && U(n = this.parent, B, br).call(n, t);
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
if (E(this, Ke, u(this, Ke) + t), u(this, Ke) === 0) {
|
|
794
|
+
this.is_pending = !1;
|
|
795
|
+
for (const i of u(this, Xt))
|
|
796
|
+
W(i, ie), it(i);
|
|
797
|
+
for (const i of u(this, Kt))
|
|
798
|
+
W(i, at), it(i);
|
|
799
|
+
u(this, Xt).clear(), u(this, Kt).clear(), u(this, oe) && Mt(u(this, oe), () => {
|
|
800
|
+
E(this, oe, null);
|
|
801
|
+
}), u(this, Xe) && (u(this, de).before(u(this, Xe)), E(this, Xe, null));
|
|
802
|
+
}
|
|
803
|
+
};
|
|
804
|
+
function Cl(e, t, n, i) {
|
|
805
|
+
const r = nr;
|
|
806
|
+
var s = e.filter((h) => !h.settled);
|
|
807
|
+
if (n.length === 0 && s.length === 0) {
|
|
808
|
+
i(t.map(r));
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
var l = N, a = (
|
|
812
|
+
/** @type {Effect} */
|
|
813
|
+
z
|
|
814
|
+
), o = Al(), c = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((h) => h.promise)) : null;
|
|
815
|
+
function d(h) {
|
|
816
|
+
o();
|
|
817
|
+
try {
|
|
818
|
+
i(h);
|
|
819
|
+
} catch (p) {
|
|
820
|
+
(a.f & nt) === 0 && tn(p, a);
|
|
821
|
+
}
|
|
822
|
+
l?.deactivate(), yr();
|
|
823
|
+
}
|
|
824
|
+
if (n.length === 0) {
|
|
825
|
+
c.then(() => d(t.map(r)));
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
function _() {
|
|
829
|
+
o(), Promise.all(n.map((h) => /* @__PURE__ */ Ol(h))).then((h) => d([...t.map(r), ...h])).catch((h) => tn(h, a));
|
|
830
|
+
}
|
|
831
|
+
c ? c.then(_) : _();
|
|
832
|
+
}
|
|
833
|
+
function Al() {
|
|
834
|
+
var e = z, t = A, n = ge, i = N;
|
|
835
|
+
return function(s = !0) {
|
|
836
|
+
je(e), ke(t), en(n), s && i?.activate();
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
function yr() {
|
|
840
|
+
je(null), ke(null), en(null);
|
|
841
|
+
}
|
|
842
|
+
// @__NO_SIDE_EFFECTS__
|
|
843
|
+
function nr(e) {
|
|
844
|
+
var t = ee | ie, n = A !== null && (A.f & ee) !== 0 ? (
|
|
845
|
+
/** @type {Derived} */
|
|
846
|
+
A
|
|
847
|
+
) : null;
|
|
848
|
+
return z !== null && (z.f |= Lt), {
|
|
849
|
+
ctx: ge,
|
|
850
|
+
deps: null,
|
|
851
|
+
effects: null,
|
|
852
|
+
equals: Ei,
|
|
853
|
+
f: t,
|
|
854
|
+
fn: e,
|
|
855
|
+
reactions: null,
|
|
856
|
+
rv: 0,
|
|
857
|
+
v: (
|
|
858
|
+
/** @type {V} */
|
|
859
|
+
Q
|
|
860
|
+
),
|
|
861
|
+
wv: 0,
|
|
862
|
+
parent: n ?? z,
|
|
863
|
+
ac: null
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
// @__NO_SIDE_EFFECTS__
|
|
867
|
+
function Ol(e, t, n) {
|
|
868
|
+
let i = (
|
|
869
|
+
/** @type {Effect | null} */
|
|
870
|
+
z
|
|
871
|
+
);
|
|
872
|
+
i === null && al();
|
|
873
|
+
var r = (
|
|
874
|
+
/** @type {Boundary} */
|
|
875
|
+
i.b
|
|
876
|
+
), s = (
|
|
877
|
+
/** @type {Promise<V>} */
|
|
878
|
+
/** @type {unknown} */
|
|
879
|
+
void 0
|
|
880
|
+
), l = It(
|
|
881
|
+
/** @type {V} */
|
|
882
|
+
Q
|
|
883
|
+
), a = !A, o = /* @__PURE__ */ new Map();
|
|
884
|
+
return jl(() => {
|
|
885
|
+
var c = mi();
|
|
886
|
+
s = c.promise;
|
|
887
|
+
try {
|
|
888
|
+
Promise.resolve(e()).then(c.resolve, c.reject).then(() => {
|
|
889
|
+
d === N && d.committed && d.deactivate(), yr();
|
|
890
|
+
});
|
|
891
|
+
} catch (p) {
|
|
892
|
+
c.reject(p), yr();
|
|
893
|
+
}
|
|
894
|
+
var d = (
|
|
895
|
+
/** @type {Batch} */
|
|
896
|
+
N
|
|
897
|
+
);
|
|
898
|
+
if (a) {
|
|
899
|
+
var _ = r.is_rendered();
|
|
900
|
+
r.update_pending_count(1), d.increment(_), o.get(d)?.reject(Vt), o.delete(d), o.set(d, c);
|
|
901
|
+
}
|
|
902
|
+
const h = (p, g = void 0) => {
|
|
903
|
+
if (d.activate(), g)
|
|
904
|
+
g !== Vt && (l.f |= pt, nn(l, g));
|
|
905
|
+
else {
|
|
906
|
+
(l.f & pt) !== 0 && (l.f ^= pt), nn(l, p);
|
|
907
|
+
for (const [x, v] of o) {
|
|
908
|
+
if (o.delete(x), x === d) break;
|
|
909
|
+
v.reject(Vt);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
a && (r.update_pending_count(-1), d.decrement(_));
|
|
913
|
+
};
|
|
914
|
+
c.promise.then(h, (p) => h(null, p || "unknown"));
|
|
915
|
+
}), Yi(() => {
|
|
916
|
+
for (const c of o.values())
|
|
917
|
+
c.reject(Vt);
|
|
918
|
+
}), new Promise((c) => {
|
|
919
|
+
function d(_) {
|
|
920
|
+
function h() {
|
|
921
|
+
_ === s ? c(l) : d(s);
|
|
922
|
+
}
|
|
923
|
+
_.then(h, h);
|
|
924
|
+
}
|
|
925
|
+
d(s);
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
// @__NO_SIDE_EFFECTS__
|
|
929
|
+
function fn(e) {
|
|
930
|
+
const t = /* @__PURE__ */ nr(e);
|
|
931
|
+
return ns(t), t;
|
|
932
|
+
}
|
|
933
|
+
// @__NO_SIDE_EFFECTS__
|
|
934
|
+
function Ml(e) {
|
|
935
|
+
const t = /* @__PURE__ */ nr(e);
|
|
936
|
+
return t.equals = $i, t;
|
|
937
|
+
}
|
|
938
|
+
function Ni(e) {
|
|
939
|
+
var t = e.effects;
|
|
940
|
+
if (t !== null) {
|
|
941
|
+
e.effects = null;
|
|
942
|
+
for (var n = 0; n < t.length; n += 1)
|
|
943
|
+
re(
|
|
944
|
+
/** @type {Effect} */
|
|
945
|
+
t[n]
|
|
946
|
+
);
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
function zl(e) {
|
|
950
|
+
for (var t = e.parent; t !== null; ) {
|
|
951
|
+
if ((t.f & ee) === 0)
|
|
952
|
+
return (t.f & nt) === 0 ? (
|
|
953
|
+
/** @type {Effect} */
|
|
954
|
+
t
|
|
955
|
+
) : null;
|
|
956
|
+
t = t.parent;
|
|
957
|
+
}
|
|
958
|
+
return null;
|
|
959
|
+
}
|
|
960
|
+
function zr(e) {
|
|
961
|
+
var t, n = z;
|
|
962
|
+
je(zl(e));
|
|
963
|
+
try {
|
|
964
|
+
e.f &= ~Rt, Ni(e), t = ls(e);
|
|
965
|
+
} finally {
|
|
966
|
+
je(n);
|
|
967
|
+
}
|
|
968
|
+
return t;
|
|
969
|
+
}
|
|
970
|
+
function Pi(e) {
|
|
971
|
+
var t = zr(e);
|
|
972
|
+
if (!e.equals(t) && (e.wv = is(), (!N?.is_fork || e.deps === null) && (e.v = t, e.deps === null))) {
|
|
973
|
+
W(e, K);
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
976
|
+
mt || (Ae !== null ? (Ir() || N?.is_fork) && Ae.set(e, t) : Mr(e));
|
|
977
|
+
}
|
|
978
|
+
let Er = /* @__PURE__ */ new Set();
|
|
979
|
+
const _t = /* @__PURE__ */ new Map();
|
|
980
|
+
let Di = !1;
|
|
981
|
+
function It(e, t) {
|
|
982
|
+
var n = {
|
|
983
|
+
f: 0,
|
|
984
|
+
// TODO ideally we could skip this altogether, but it causes type errors
|
|
985
|
+
v: e,
|
|
986
|
+
reactions: null,
|
|
987
|
+
equals: Ei,
|
|
988
|
+
rv: 0,
|
|
989
|
+
wv: 0
|
|
990
|
+
};
|
|
991
|
+
return n;
|
|
992
|
+
}
|
|
993
|
+
// @__NO_SIDE_EFFECTS__
|
|
994
|
+
function I(e, t) {
|
|
995
|
+
const n = It(e);
|
|
996
|
+
return ns(n), n;
|
|
997
|
+
}
|
|
998
|
+
// @__NO_SIDE_EFFECTS__
|
|
999
|
+
function Fi(e, t = !1, n = !0) {
|
|
1000
|
+
const i = It(e);
|
|
1001
|
+
return t || (i.equals = $i), i;
|
|
1002
|
+
}
|
|
1003
|
+
function w(e, t, n = !1) {
|
|
1004
|
+
A !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
1005
|
+
// to ensure we error if state is set inside an inspect effect
|
|
1006
|
+
(!Oe || (A.f & Kr) !== 0) && xi() && (A.f & (ee | lt | Or | Kr)) !== 0 && (xe === null || !Qt.call(xe, e)) && pl();
|
|
1007
|
+
let i = n ? tt(t) : t;
|
|
1008
|
+
return nn(e, i);
|
|
1009
|
+
}
|
|
1010
|
+
function nn(e, t) {
|
|
1011
|
+
if (!e.equals(t)) {
|
|
1012
|
+
var n = e.v;
|
|
1013
|
+
mt ? _t.set(e, t) : _t.set(e, n), e.v = t;
|
|
1014
|
+
var i = rt.ensure();
|
|
1015
|
+
if (i.capture(e, n), (e.f & ee) !== 0) {
|
|
1016
|
+
const r = (
|
|
1017
|
+
/** @type {Derived} */
|
|
1018
|
+
e
|
|
1019
|
+
);
|
|
1020
|
+
(e.f & ie) !== 0 && zr(r), Mr(r);
|
|
1021
|
+
}
|
|
1022
|
+
e.wv = is(), ji(e, ie), z !== null && (z.f & K) !== 0 && (z.f & (ze | wt)) === 0 && (me === null ? Bl([e]) : me.push(e)), !i.is_fork && Er.size > 0 && !Di && Rl();
|
|
1023
|
+
}
|
|
1024
|
+
return t;
|
|
1025
|
+
}
|
|
1026
|
+
function Rl() {
|
|
1027
|
+
Di = !1;
|
|
1028
|
+
for (const e of Er)
|
|
1029
|
+
(e.f & K) !== 0 && W(e, at), $n(e) && _n(e);
|
|
1030
|
+
Er.clear();
|
|
1031
|
+
}
|
|
1032
|
+
function Il(e, t = 1) {
|
|
1033
|
+
var n = f(e), i = t === 1 ? n++ : n--;
|
|
1034
|
+
return w(e, n), i;
|
|
1035
|
+
}
|
|
1036
|
+
function vn(e) {
|
|
1037
|
+
w(e, e.v + 1);
|
|
1038
|
+
}
|
|
1039
|
+
function ji(e, t) {
|
|
1040
|
+
var n = e.reactions;
|
|
1041
|
+
if (n !== null)
|
|
1042
|
+
for (var i = n.length, r = 0; r < i; r++) {
|
|
1043
|
+
var s = n[r], l = s.f, a = (l & ie) === 0;
|
|
1044
|
+
if (a && W(s, t), (l & ee) !== 0) {
|
|
1045
|
+
var o = (
|
|
1046
|
+
/** @type {Derived} */
|
|
1047
|
+
s
|
|
1048
|
+
);
|
|
1049
|
+
Ae?.delete(o), (l & Rt) === 0 && (l & Ee && (s.f |= Rt), ji(o, at));
|
|
1050
|
+
} else a && ((l & lt) !== 0 && Ye !== null && Ye.add(
|
|
1051
|
+
/** @type {Effect} */
|
|
1052
|
+
s
|
|
1053
|
+
), it(
|
|
1054
|
+
/** @type {Effect} */
|
|
1055
|
+
s
|
|
1056
|
+
));
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
function tt(e) {
|
|
1060
|
+
if (typeof e != "object" || e === null || In in e)
|
|
1061
|
+
return e;
|
|
1062
|
+
const t = gi(e);
|
|
1063
|
+
if (t !== el && t !== tl)
|
|
1064
|
+
return e;
|
|
1065
|
+
var n = /* @__PURE__ */ new Map(), i = _i(e), r = /* @__PURE__ */ I(0), s = zt, l = (a) => {
|
|
1066
|
+
if (zt === s)
|
|
1067
|
+
return a();
|
|
1068
|
+
var o = A, c = zt;
|
|
1069
|
+
ke(null), ti(s);
|
|
1070
|
+
var d = a();
|
|
1071
|
+
return ke(o), ti(c), d;
|
|
1072
|
+
};
|
|
1073
|
+
return i && n.set("length", /* @__PURE__ */ I(
|
|
1074
|
+
/** @type {any[]} */
|
|
1075
|
+
e.length
|
|
1076
|
+
)), new Proxy(
|
|
1077
|
+
/** @type {any} */
|
|
1078
|
+
e,
|
|
1079
|
+
{
|
|
1080
|
+
defineProperty(a, o, c) {
|
|
1081
|
+
(!("value" in c) || c.configurable === !1 || c.enumerable === !1 || c.writable === !1) && hl();
|
|
1082
|
+
var d = n.get(o);
|
|
1083
|
+
return d === void 0 ? d = l(() => {
|
|
1084
|
+
var _ = /* @__PURE__ */ I(c.value);
|
|
1085
|
+
return n.set(o, _), _;
|
|
1086
|
+
}) : w(d, c.value, !0), !0;
|
|
1087
|
+
},
|
|
1088
|
+
deleteProperty(a, o) {
|
|
1089
|
+
var c = n.get(o);
|
|
1090
|
+
if (c === void 0) {
|
|
1091
|
+
if (o in a) {
|
|
1092
|
+
const d = l(() => /* @__PURE__ */ I(Q));
|
|
1093
|
+
n.set(o, d), vn(r);
|
|
1094
|
+
}
|
|
1095
|
+
} else
|
|
1096
|
+
w(c, Q), vn(r);
|
|
1097
|
+
return !0;
|
|
1098
|
+
},
|
|
1099
|
+
get(a, o, c) {
|
|
1100
|
+
if (o === In)
|
|
1101
|
+
return e;
|
|
1102
|
+
var d = n.get(o), _ = o in a;
|
|
1103
|
+
if (d === void 0 && (!_ || Ht(a, o)?.writable) && (d = l(() => {
|
|
1104
|
+
var p = tt(_ ? a[o] : Q), g = /* @__PURE__ */ I(p);
|
|
1105
|
+
return g;
|
|
1106
|
+
}), n.set(o, d)), d !== void 0) {
|
|
1107
|
+
var h = f(d);
|
|
1108
|
+
return h === Q ? void 0 : h;
|
|
1109
|
+
}
|
|
1110
|
+
return Reflect.get(a, o, c);
|
|
1111
|
+
},
|
|
1112
|
+
getOwnPropertyDescriptor(a, o) {
|
|
1113
|
+
var c = Reflect.getOwnPropertyDescriptor(a, o);
|
|
1114
|
+
if (c && "value" in c) {
|
|
1115
|
+
var d = n.get(o);
|
|
1116
|
+
d && (c.value = f(d));
|
|
1117
|
+
} else if (c === void 0) {
|
|
1118
|
+
var _ = n.get(o), h = _?.v;
|
|
1119
|
+
if (_ !== void 0 && h !== Q)
|
|
1120
|
+
return {
|
|
1121
|
+
enumerable: !0,
|
|
1122
|
+
configurable: !0,
|
|
1123
|
+
value: h,
|
|
1124
|
+
writable: !0
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
return c;
|
|
1128
|
+
},
|
|
1129
|
+
has(a, o) {
|
|
1130
|
+
if (o === In)
|
|
1131
|
+
return !0;
|
|
1132
|
+
var c = n.get(o), d = c !== void 0 && c.v !== Q || Reflect.has(a, o);
|
|
1133
|
+
if (c !== void 0 || z !== null && (!d || Ht(a, o)?.writable)) {
|
|
1134
|
+
c === void 0 && (c = l(() => {
|
|
1135
|
+
var h = d ? tt(a[o]) : Q, p = /* @__PURE__ */ I(h);
|
|
1136
|
+
return p;
|
|
1137
|
+
}), n.set(o, c));
|
|
1138
|
+
var _ = f(c);
|
|
1139
|
+
if (_ === Q)
|
|
1140
|
+
return !1;
|
|
1141
|
+
}
|
|
1142
|
+
return d;
|
|
1143
|
+
},
|
|
1144
|
+
set(a, o, c, d) {
|
|
1145
|
+
var _ = n.get(o), h = o in a;
|
|
1146
|
+
if (i && o === "length")
|
|
1147
|
+
for (var p = c; p < /** @type {Source<number>} */
|
|
1148
|
+
_.v; p += 1) {
|
|
1149
|
+
var g = n.get(p + "");
|
|
1150
|
+
g !== void 0 ? w(g, Q) : p in a && (g = l(() => /* @__PURE__ */ I(Q)), n.set(p + "", g));
|
|
1151
|
+
}
|
|
1152
|
+
if (_ === void 0)
|
|
1153
|
+
(!h || Ht(a, o)?.writable) && (_ = l(() => /* @__PURE__ */ I(void 0)), w(_, tt(c)), n.set(o, _));
|
|
1154
|
+
else {
|
|
1155
|
+
h = _.v !== Q;
|
|
1156
|
+
var x = l(() => tt(c));
|
|
1157
|
+
w(_, x);
|
|
1158
|
+
}
|
|
1159
|
+
var v = Reflect.getOwnPropertyDescriptor(a, o);
|
|
1160
|
+
if (v?.set && v.set.call(d, c), !h) {
|
|
1161
|
+
if (i && typeof o == "string") {
|
|
1162
|
+
var b = (
|
|
1163
|
+
/** @type {Source<number>} */
|
|
1164
|
+
n.get("length")
|
|
1165
|
+
), te = Number(o);
|
|
1166
|
+
Number.isInteger(te) && te >= b.v && w(b, te + 1);
|
|
1167
|
+
}
|
|
1168
|
+
vn(r);
|
|
1169
|
+
}
|
|
1170
|
+
return !0;
|
|
1171
|
+
},
|
|
1172
|
+
ownKeys(a) {
|
|
1173
|
+
f(r);
|
|
1174
|
+
var o = Reflect.ownKeys(a).filter((_) => {
|
|
1175
|
+
var h = n.get(_);
|
|
1176
|
+
return h === void 0 || h.v !== Q;
|
|
1177
|
+
});
|
|
1178
|
+
for (var [c, d] of n)
|
|
1179
|
+
d.v !== Q && !(c in a) && o.push(c);
|
|
1180
|
+
return o;
|
|
1181
|
+
},
|
|
1182
|
+
setPrototypeOf() {
|
|
1183
|
+
vl();
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
);
|
|
1187
|
+
}
|
|
1188
|
+
var Qr, Vi, Hi, Bi;
|
|
1189
|
+
function $r() {
|
|
1190
|
+
if (Qr === void 0) {
|
|
1191
|
+
Qr = window, Vi = /Firefox/.test(navigator.userAgent);
|
|
1192
|
+
var e = Element.prototype, t = Node.prototype, n = Text.prototype;
|
|
1193
|
+
Hi = Ht(t, "firstChild").get, Bi = Ht(t, "nextSibling").get, Xr(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), Xr(n) && (n.__t = void 0);
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
function $e(e = "") {
|
|
1197
|
+
return document.createTextNode(e);
|
|
1198
|
+
}
|
|
1199
|
+
// @__NO_SIDE_EFFECTS__
|
|
1200
|
+
function st(e) {
|
|
1201
|
+
return (
|
|
1202
|
+
/** @type {TemplateNode | null} */
|
|
1203
|
+
Hi.call(e)
|
|
1204
|
+
);
|
|
1205
|
+
}
|
|
1206
|
+
// @__NO_SIDE_EFFECTS__
|
|
1207
|
+
function He(e) {
|
|
1208
|
+
return (
|
|
1209
|
+
/** @type {TemplateNode | null} */
|
|
1210
|
+
Bi.call(e)
|
|
1211
|
+
);
|
|
1212
|
+
}
|
|
1213
|
+
function Z(e, t) {
|
|
1214
|
+
if (!O)
|
|
1215
|
+
return /* @__PURE__ */ st(e);
|
|
1216
|
+
var n = /* @__PURE__ */ st(M);
|
|
1217
|
+
if (n === null)
|
|
1218
|
+
n = M.appendChild($e());
|
|
1219
|
+
else if (t && n.nodeType !== Jn) {
|
|
1220
|
+
var i = $e();
|
|
1221
|
+
return n?.before(i), ue(i), i;
|
|
1222
|
+
}
|
|
1223
|
+
return t && Rr(
|
|
1224
|
+
/** @type {Text} */
|
|
1225
|
+
n
|
|
1226
|
+
), ue(n), n;
|
|
1227
|
+
}
|
|
1228
|
+
function Ue(e, t = !1) {
|
|
1229
|
+
if (!O) {
|
|
1230
|
+
var n = /* @__PURE__ */ st(e);
|
|
1231
|
+
return n instanceof Comment && n.data === "" ? /* @__PURE__ */ He(n) : n;
|
|
1232
|
+
}
|
|
1233
|
+
if (t) {
|
|
1234
|
+
if (M?.nodeType !== Jn) {
|
|
1235
|
+
var i = $e();
|
|
1236
|
+
return M?.before(i), ue(i), i;
|
|
1237
|
+
}
|
|
1238
|
+
Rr(
|
|
1239
|
+
/** @type {Text} */
|
|
1240
|
+
M
|
|
1241
|
+
);
|
|
1242
|
+
}
|
|
1243
|
+
return M;
|
|
1244
|
+
}
|
|
1245
|
+
function X(e, t = 1, n = !1) {
|
|
1246
|
+
let i = O ? M : e;
|
|
1247
|
+
for (var r; t--; )
|
|
1248
|
+
r = i, i = /** @type {TemplateNode} */
|
|
1249
|
+
/* @__PURE__ */ He(i);
|
|
1250
|
+
if (!O)
|
|
1251
|
+
return i;
|
|
1252
|
+
if (n) {
|
|
1253
|
+
if (i?.nodeType !== Jn) {
|
|
1254
|
+
var s = $e();
|
|
1255
|
+
return i === null ? r?.after(s) : i.before(s), ue(s), s;
|
|
1256
|
+
}
|
|
1257
|
+
Rr(
|
|
1258
|
+
/** @type {Text} */
|
|
1259
|
+
i
|
|
1260
|
+
);
|
|
1261
|
+
}
|
|
1262
|
+
return ue(i), i;
|
|
1263
|
+
}
|
|
1264
|
+
function Gi(e) {
|
|
1265
|
+
e.textContent = "";
|
|
1266
|
+
}
|
|
1267
|
+
function Wi() {
|
|
1268
|
+
return !1;
|
|
1269
|
+
}
|
|
1270
|
+
function Rr(e) {
|
|
1271
|
+
if (
|
|
1272
|
+
/** @type {string} */
|
|
1273
|
+
e.nodeValue.length < 65536
|
|
1274
|
+
)
|
|
1275
|
+
return;
|
|
1276
|
+
let t = e.nextSibling;
|
|
1277
|
+
for (; t !== null && t.nodeType === Jn; )
|
|
1278
|
+
t.remove(), e.nodeValue += /** @type {string} */
|
|
1279
|
+
t.nodeValue, t = e.nextSibling;
|
|
1280
|
+
}
|
|
1281
|
+
let Zr = !1;
|
|
1282
|
+
function qi() {
|
|
1283
|
+
Zr || (Zr = !0, document.addEventListener(
|
|
1284
|
+
"reset",
|
|
1285
|
+
(e) => {
|
|
1286
|
+
Promise.resolve().then(() => {
|
|
1287
|
+
if (!e.defaultPrevented)
|
|
1288
|
+
for (
|
|
1289
|
+
const t of
|
|
1290
|
+
/**@type {HTMLFormElement} */
|
|
1291
|
+
e.target.elements
|
|
1292
|
+
)
|
|
1293
|
+
t.__on_r?.();
|
|
1294
|
+
});
|
|
1295
|
+
},
|
|
1296
|
+
// In the capture phase to guarantee we get noticed of it (no possibility of stopPropagation)
|
|
1297
|
+
{ capture: !0 }
|
|
1298
|
+
));
|
|
1299
|
+
}
|
|
1300
|
+
function rr(e) {
|
|
1301
|
+
var t = A, n = z;
|
|
1302
|
+
ke(null), je(null);
|
|
1303
|
+
try {
|
|
1304
|
+
return e();
|
|
1305
|
+
} finally {
|
|
1306
|
+
ke(t), je(n);
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
function Ll(e, t, n, i = n) {
|
|
1310
|
+
e.addEventListener(t, () => rr(n));
|
|
1311
|
+
const r = e.__on_r;
|
|
1312
|
+
r ? e.__on_r = () => {
|
|
1313
|
+
r(), i(!0);
|
|
1314
|
+
} : e.__on_r = () => i(!0), qi();
|
|
1315
|
+
}
|
|
1316
|
+
function Nl(e) {
|
|
1317
|
+
z === null && (A === null && ul(), fl()), mt && ol();
|
|
1318
|
+
}
|
|
1319
|
+
function Pl(e, t) {
|
|
1320
|
+
var n = t.last;
|
|
1321
|
+
n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
|
|
1322
|
+
}
|
|
1323
|
+
function Be(e, t, n) {
|
|
1324
|
+
var i = z;
|
|
1325
|
+
i !== null && (i.f & _e) !== 0 && (e |= _e);
|
|
1326
|
+
var r = {
|
|
1327
|
+
ctx: ge,
|
|
1328
|
+
deps: null,
|
|
1329
|
+
nodes: null,
|
|
1330
|
+
f: e | ie | Ee,
|
|
1331
|
+
first: null,
|
|
1332
|
+
fn: t,
|
|
1333
|
+
last: null,
|
|
1334
|
+
next: null,
|
|
1335
|
+
parent: i,
|
|
1336
|
+
b: i && i.b,
|
|
1337
|
+
prev: null,
|
|
1338
|
+
teardown: null,
|
|
1339
|
+
wv: 0,
|
|
1340
|
+
ac: null
|
|
1341
|
+
};
|
|
1342
|
+
if (n)
|
|
1343
|
+
try {
|
|
1344
|
+
_n(r), r.f |= Kn;
|
|
1345
|
+
} catch (a) {
|
|
1346
|
+
throw re(r), a;
|
|
1347
|
+
}
|
|
1348
|
+
else t !== null && it(r);
|
|
1349
|
+
var s = r;
|
|
1350
|
+
if (n && s.deps === null && s.teardown === null && s.nodes === null && s.first === s.last && // either `null`, or a singular child
|
|
1351
|
+
(s.f & Lt) === 0 && (s = s.first, (e & lt) !== 0 && (e & Zt) !== 0 && s !== null && (s.f |= Zt)), s !== null && (s.parent = i, i !== null && Pl(s, i), A !== null && (A.f & ee) !== 0 && (e & wt) === 0)) {
|
|
1352
|
+
var l = (
|
|
1353
|
+
/** @type {Derived} */
|
|
1354
|
+
A
|
|
1355
|
+
);
|
|
1356
|
+
(l.effects ?? (l.effects = [])).push(s);
|
|
1357
|
+
}
|
|
1358
|
+
return r;
|
|
1359
|
+
}
|
|
1360
|
+
function Ir() {
|
|
1361
|
+
return A !== null && !Oe;
|
|
1362
|
+
}
|
|
1363
|
+
function Yi(e) {
|
|
1364
|
+
const t = Be(Xn, null, !1);
|
|
1365
|
+
return W(t, K), t.teardown = e, t;
|
|
1366
|
+
}
|
|
1367
|
+
function Bt(e) {
|
|
1368
|
+
Nl();
|
|
1369
|
+
var t = (
|
|
1370
|
+
/** @type {Effect} */
|
|
1371
|
+
z.f
|
|
1372
|
+
), n = !A && (t & ze) !== 0 && (t & Kn) === 0;
|
|
1373
|
+
if (n) {
|
|
1374
|
+
var i = (
|
|
1375
|
+
/** @type {ComponentContext} */
|
|
1376
|
+
ge
|
|
1377
|
+
);
|
|
1378
|
+
(i.e ?? (i.e = [])).push(e);
|
|
1379
|
+
} else
|
|
1380
|
+
return Ui(e);
|
|
1381
|
+
}
|
|
1382
|
+
function Ui(e) {
|
|
1383
|
+
return Be(Vn | rl, e, !1);
|
|
1384
|
+
}
|
|
1385
|
+
function Dl(e) {
|
|
1386
|
+
rt.ensure();
|
|
1387
|
+
const t = Be(wt | Lt, e, !0);
|
|
1388
|
+
return () => {
|
|
1389
|
+
re(t);
|
|
1390
|
+
};
|
|
1391
|
+
}
|
|
1392
|
+
function Fl(e) {
|
|
1393
|
+
rt.ensure();
|
|
1394
|
+
const t = Be(wt | Lt, e, !0);
|
|
1395
|
+
return (n = {}) => new Promise((i) => {
|
|
1396
|
+
n.outro ? Mt(t, () => {
|
|
1397
|
+
re(t), i(void 0);
|
|
1398
|
+
}) : (re(t), i(void 0));
|
|
1399
|
+
});
|
|
1400
|
+
}
|
|
1401
|
+
function Xi(e) {
|
|
1402
|
+
return Be(Vn, e, !1);
|
|
1403
|
+
}
|
|
1404
|
+
function jl(e) {
|
|
1405
|
+
return Be(Or | Lt, e, !0);
|
|
1406
|
+
}
|
|
1407
|
+
function ir(e, t = 0) {
|
|
1408
|
+
return Be(Xn | t, e, !0);
|
|
1409
|
+
}
|
|
1410
|
+
function Se(e, t = [], n = [], i = []) {
|
|
1411
|
+
Cl(i, t, n, (r) => {
|
|
1412
|
+
Be(Xn, () => e(...r.map(f)), !0);
|
|
1413
|
+
});
|
|
1414
|
+
}
|
|
1415
|
+
function Lr(e, t = 0) {
|
|
1416
|
+
var n = Be(lt | t, e, !0);
|
|
1417
|
+
return n;
|
|
1418
|
+
}
|
|
1419
|
+
function ye(e) {
|
|
1420
|
+
return Be(ze | Lt, e, !0);
|
|
1421
|
+
}
|
|
1422
|
+
function Ki(e) {
|
|
1423
|
+
var t = e.teardown;
|
|
1424
|
+
if (t !== null) {
|
|
1425
|
+
const n = mt, i = A;
|
|
1426
|
+
ei(!0), ke(null);
|
|
1427
|
+
try {
|
|
1428
|
+
t.call(null);
|
|
1429
|
+
} finally {
|
|
1430
|
+
ei(n), ke(i);
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
function Ji(e, t = !1) {
|
|
1435
|
+
var n = e.first;
|
|
1436
|
+
for (e.first = e.last = null; n !== null; ) {
|
|
1437
|
+
const r = n.ac;
|
|
1438
|
+
r !== null && rr(() => {
|
|
1439
|
+
r.abort(Vt);
|
|
1440
|
+
});
|
|
1441
|
+
var i = n.next;
|
|
1442
|
+
(n.f & wt) !== 0 ? n.parent = null : re(n, t), n = i;
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
function Vl(e) {
|
|
1446
|
+
for (var t = e.first; t !== null; ) {
|
|
1447
|
+
var n = t.next;
|
|
1448
|
+
(t.f & ze) === 0 && re(t), t = n;
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
function re(e, t = !0) {
|
|
1452
|
+
var n = !1;
|
|
1453
|
+
(t || (e.f & bi) !== 0) && e.nodes !== null && e.nodes.end !== null && (Hl(
|
|
1454
|
+
e.nodes.start,
|
|
1455
|
+
/** @type {TemplateNode} */
|
|
1456
|
+
e.nodes.end
|
|
1457
|
+
), n = !0), Ji(e, t && !n), Bn(e, 0), W(e, nt);
|
|
1458
|
+
var i = e.nodes && e.nodes.t;
|
|
1459
|
+
if (i !== null)
|
|
1460
|
+
for (const s of i)
|
|
1461
|
+
s.stop();
|
|
1462
|
+
Ki(e);
|
|
1463
|
+
var r = e.parent;
|
|
1464
|
+
r !== null && r.first !== null && Qi(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null;
|
|
1465
|
+
}
|
|
1466
|
+
function Hl(e, t) {
|
|
1467
|
+
for (; e !== null; ) {
|
|
1468
|
+
var n = e === t ? null : /* @__PURE__ */ He(e);
|
|
1469
|
+
e.remove(), e = n;
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
function Qi(e) {
|
|
1473
|
+
var t = e.parent, n = e.prev, i = e.next;
|
|
1474
|
+
n !== null && (n.next = i), i !== null && (i.prev = n), t !== null && (t.first === e && (t.first = i), t.last === e && (t.last = n));
|
|
1475
|
+
}
|
|
1476
|
+
function Mt(e, t, n = !0) {
|
|
1477
|
+
var i = [];
|
|
1478
|
+
Zi(e, i, !0);
|
|
1479
|
+
var r = () => {
|
|
1480
|
+
n && re(e), t && t();
|
|
1481
|
+
}, s = i.length;
|
|
1482
|
+
if (s > 0) {
|
|
1483
|
+
var l = () => --s || r();
|
|
1484
|
+
for (var a of i)
|
|
1485
|
+
a.out(l);
|
|
1486
|
+
} else
|
|
1487
|
+
r();
|
|
1488
|
+
}
|
|
1489
|
+
function Zi(e, t, n) {
|
|
1490
|
+
if ((e.f & _e) === 0) {
|
|
1491
|
+
e.f ^= _e;
|
|
1492
|
+
var i = e.nodes && e.nodes.t;
|
|
1493
|
+
if (i !== null)
|
|
1494
|
+
for (const a of i)
|
|
1495
|
+
(a.is_global || n) && t.push(a);
|
|
1496
|
+
for (var r = e.first; r !== null; ) {
|
|
1497
|
+
var s = r.next, l = (r.f & Zt) !== 0 || // If this is a branch effect without a block effect parent,
|
|
1498
|
+
// it means the parent block effect was pruned. In that case,
|
|
1499
|
+
// transparency information was transferred to the branch effect.
|
|
1500
|
+
(r.f & ze) !== 0 && (e.f & lt) !== 0;
|
|
1501
|
+
Zi(r, t, l ? n : !1), r = s;
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
function Nr(e) {
|
|
1506
|
+
es(e, !0);
|
|
1507
|
+
}
|
|
1508
|
+
function es(e, t) {
|
|
1509
|
+
if ((e.f & _e) !== 0) {
|
|
1510
|
+
e.f ^= _e, (e.f & K) === 0 && (W(e, ie), it(e));
|
|
1511
|
+
for (var n = e.first; n !== null; ) {
|
|
1512
|
+
var i = n.next, r = (n.f & Zt) !== 0 || (n.f & ze) !== 0;
|
|
1513
|
+
es(n, r ? t : !1), n = i;
|
|
1514
|
+
}
|
|
1515
|
+
var s = e.nodes && e.nodes.t;
|
|
1516
|
+
if (s !== null)
|
|
1517
|
+
for (const l of s)
|
|
1518
|
+
(l.is_global || t) && l.in();
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
function ts(e, t) {
|
|
1522
|
+
if (e.nodes)
|
|
1523
|
+
for (var n = e.nodes.start, i = e.nodes.end; n !== null; ) {
|
|
1524
|
+
var r = n === i ? null : /* @__PURE__ */ He(n);
|
|
1525
|
+
t.append(n), n = r;
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
let Pn = !1, mt = !1;
|
|
1529
|
+
function ei(e) {
|
|
1530
|
+
mt = e;
|
|
1531
|
+
}
|
|
1532
|
+
let A = null, Oe = !1;
|
|
1533
|
+
function ke(e) {
|
|
1534
|
+
A = e;
|
|
1535
|
+
}
|
|
1536
|
+
let z = null;
|
|
1537
|
+
function je(e) {
|
|
1538
|
+
z = e;
|
|
1539
|
+
}
|
|
1540
|
+
let xe = null;
|
|
1541
|
+
function ns(e) {
|
|
1542
|
+
A !== null && (xe === null ? xe = [e] : xe.push(e));
|
|
1543
|
+
}
|
|
1544
|
+
let fe = null, ce = 0, me = null;
|
|
1545
|
+
function Bl(e) {
|
|
1546
|
+
me = e;
|
|
1547
|
+
}
|
|
1548
|
+
let rs = 1, xt = 0, zt = xt;
|
|
1549
|
+
function ti(e) {
|
|
1550
|
+
zt = e;
|
|
1551
|
+
}
|
|
1552
|
+
function is() {
|
|
1553
|
+
return ++rs;
|
|
1554
|
+
}
|
|
1555
|
+
function $n(e) {
|
|
1556
|
+
var t = e.f;
|
|
1557
|
+
if ((t & ie) !== 0)
|
|
1558
|
+
return !0;
|
|
1559
|
+
if (t & ee && (e.f &= ~Rt), (t & at) !== 0) {
|
|
1560
|
+
for (var n = (
|
|
1561
|
+
/** @type {Value[]} */
|
|
1562
|
+
e.deps
|
|
1563
|
+
), i = n.length, r = 0; r < i; r++) {
|
|
1564
|
+
var s = n[r];
|
|
1565
|
+
if ($n(
|
|
1566
|
+
/** @type {Derived} */
|
|
1567
|
+
s
|
|
1568
|
+
) && Pi(
|
|
1569
|
+
/** @type {Derived} */
|
|
1570
|
+
s
|
|
1571
|
+
), s.wv > e.wv)
|
|
1572
|
+
return !0;
|
|
1573
|
+
}
|
|
1574
|
+
(t & Ee) !== 0 && // During time traveling we don't want to reset the status so that
|
|
1575
|
+
// traversal of the graph in the other batches still happens
|
|
1576
|
+
Ae === null && W(e, K);
|
|
1577
|
+
}
|
|
1578
|
+
return !1;
|
|
1579
|
+
}
|
|
1580
|
+
function ss(e, t, n = !0) {
|
|
1581
|
+
var i = e.reactions;
|
|
1582
|
+
if (i !== null && !(xe !== null && Qt.call(xe, e)))
|
|
1583
|
+
for (var r = 0; r < i.length; r++) {
|
|
1584
|
+
var s = i[r];
|
|
1585
|
+
(s.f & ee) !== 0 ? ss(
|
|
1586
|
+
/** @type {Derived} */
|
|
1587
|
+
s,
|
|
1588
|
+
t,
|
|
1589
|
+
!1
|
|
1590
|
+
) : t === s && (n ? W(s, ie) : (s.f & K) !== 0 && W(s, at), it(
|
|
1591
|
+
/** @type {Effect} */
|
|
1592
|
+
s
|
|
1593
|
+
));
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
function ls(e) {
|
|
1597
|
+
var x;
|
|
1598
|
+
var t = fe, n = ce, i = me, r = A, s = xe, l = ge, a = Oe, o = zt, c = e.f;
|
|
1599
|
+
fe = /** @type {null | Value[]} */
|
|
1600
|
+
null, ce = 0, me = null, A = (c & (ze | wt)) === 0 ? e : null, xe = null, en(e.ctx), Oe = !1, zt = ++xt, e.ac !== null && (rr(() => {
|
|
1601
|
+
e.ac.abort(Vt);
|
|
1602
|
+
}), e.ac = null);
|
|
1603
|
+
try {
|
|
1604
|
+
e.f |= vr;
|
|
1605
|
+
var d = (
|
|
1606
|
+
/** @type {Function} */
|
|
1607
|
+
e.fn
|
|
1608
|
+
), _ = d(), h = e.deps, p = N?.is_fork;
|
|
1609
|
+
if (fe !== null) {
|
|
1610
|
+
var g;
|
|
1611
|
+
if (p || Bn(e, ce), h !== null && ce > 0)
|
|
1612
|
+
for (h.length = ce + fe.length, g = 0; g < fe.length; g++)
|
|
1613
|
+
h[ce + g] = fe[g];
|
|
1614
|
+
else
|
|
1615
|
+
e.deps = h = fe;
|
|
1616
|
+
if (Ir() && (e.f & Ee) !== 0)
|
|
1617
|
+
for (g = ce; g < h.length; g++)
|
|
1618
|
+
((x = h[g]).reactions ?? (x.reactions = [])).push(e);
|
|
1619
|
+
} else !p && h !== null && ce < h.length && (Bn(e, ce), h.length = ce);
|
|
1620
|
+
if (xi() && me !== null && !Oe && h !== null && (e.f & (ee | at | ie)) === 0)
|
|
1621
|
+
for (g = 0; g < /** @type {Source[]} */
|
|
1622
|
+
me.length; g++)
|
|
1623
|
+
ss(
|
|
1624
|
+
me[g],
|
|
1625
|
+
/** @type {Effect} */
|
|
1626
|
+
e
|
|
1627
|
+
);
|
|
1628
|
+
if (r !== null && r !== e) {
|
|
1629
|
+
if (xt++, r.deps !== null)
|
|
1630
|
+
for (let v = 0; v < n; v += 1)
|
|
1631
|
+
r.deps[v].rv = xt;
|
|
1632
|
+
if (t !== null)
|
|
1633
|
+
for (const v of t)
|
|
1634
|
+
v.rv = xt;
|
|
1635
|
+
me !== null && (i === null ? i = me : i.push(.../** @type {Source[]} */
|
|
1636
|
+
me));
|
|
1637
|
+
}
|
|
1638
|
+
return (e.f & pt) !== 0 && (e.f ^= pt), _;
|
|
1639
|
+
} catch (v) {
|
|
1640
|
+
return Ti(v);
|
|
1641
|
+
} finally {
|
|
1642
|
+
e.f ^= vr, fe = t, ce = n, me = i, A = r, xe = s, en(l), Oe = a, zt = o;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
function Gl(e, t) {
|
|
1646
|
+
let n = t.reactions;
|
|
1647
|
+
if (n !== null) {
|
|
1648
|
+
var i = Qs.call(n, e);
|
|
1649
|
+
if (i !== -1) {
|
|
1650
|
+
var r = n.length - 1;
|
|
1651
|
+
r === 0 ? n = t.reactions = null : (n[i] = n[r], n.pop());
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
if (n === null && (t.f & ee) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
1655
|
+
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
1656
|
+
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
1657
|
+
(fe === null || !Qt.call(fe, t))) {
|
|
1658
|
+
var s = (
|
|
1659
|
+
/** @type {Derived} */
|
|
1660
|
+
t
|
|
1661
|
+
);
|
|
1662
|
+
(s.f & Ee) !== 0 && (s.f ^= Ee, s.f &= ~Rt), Mr(s), Ni(s), Bn(s, 0);
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
function Bn(e, t) {
|
|
1666
|
+
var n = e.deps;
|
|
1667
|
+
if (n !== null)
|
|
1668
|
+
for (var i = t; i < n.length; i++)
|
|
1669
|
+
Gl(e, n[i]);
|
|
1670
|
+
}
|
|
1671
|
+
function _n(e) {
|
|
1672
|
+
var t = e.f;
|
|
1673
|
+
if ((t & nt) === 0) {
|
|
1674
|
+
W(e, K);
|
|
1675
|
+
var n = z, i = Pn;
|
|
1676
|
+
z = e, Pn = !0;
|
|
1677
|
+
try {
|
|
1678
|
+
(t & (lt | wi)) !== 0 ? Vl(e) : Ji(e), Ki(e);
|
|
1679
|
+
var r = ls(e);
|
|
1680
|
+
e.teardown = typeof r == "function" ? r : null, e.wv = rs;
|
|
1681
|
+
var s;
|
|
1682
|
+
hr && bl && (e.f & ie) !== 0 && e.deps;
|
|
1683
|
+
} finally {
|
|
1684
|
+
Pn = i, z = n;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
async function Wl() {
|
|
1689
|
+
await Promise.resolve(), pe();
|
|
1690
|
+
}
|
|
1691
|
+
function f(e) {
|
|
1692
|
+
var t = e.f, n = (t & ee) !== 0;
|
|
1693
|
+
if (A !== null && !Oe) {
|
|
1694
|
+
var i = z !== null && (z.f & nt) !== 0;
|
|
1695
|
+
if (!i && (xe === null || !Qt.call(xe, e))) {
|
|
1696
|
+
var r = A.deps;
|
|
1697
|
+
if ((A.f & vr) !== 0)
|
|
1698
|
+
e.rv < xt && (e.rv = xt, fe === null && r !== null && r[ce] === e ? ce++ : fe === null ? fe = [e] : fe.push(e));
|
|
1699
|
+
else {
|
|
1700
|
+
(A.deps ?? (A.deps = [])).push(e);
|
|
1701
|
+
var s = e.reactions;
|
|
1702
|
+
s === null ? e.reactions = [A] : Qt.call(s, A) || s.push(A);
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
if (mt && _t.has(e))
|
|
1707
|
+
return _t.get(e);
|
|
1708
|
+
if (n) {
|
|
1709
|
+
var l = (
|
|
1710
|
+
/** @type {Derived} */
|
|
1711
|
+
e
|
|
1712
|
+
);
|
|
1713
|
+
if (mt) {
|
|
1714
|
+
var a = l.v;
|
|
1715
|
+
return ((l.f & K) === 0 && l.reactions !== null || os(l)) && (a = zr(l)), _t.set(l, a), a;
|
|
1716
|
+
}
|
|
1717
|
+
var o = (l.f & Ee) === 0 && !Oe && A !== null && (Pn || (A.f & Ee) !== 0), c = l.deps === null;
|
|
1718
|
+
$n(l) && (o && (l.f |= Ee), Pi(l)), o && !c && as(l);
|
|
1719
|
+
}
|
|
1720
|
+
if (Ae?.has(e))
|
|
1721
|
+
return Ae.get(e);
|
|
1722
|
+
if ((e.f & pt) !== 0)
|
|
1723
|
+
throw e.v;
|
|
1724
|
+
return e.v;
|
|
1725
|
+
}
|
|
1726
|
+
function as(e) {
|
|
1727
|
+
if (e.deps !== null) {
|
|
1728
|
+
e.f |= Ee;
|
|
1729
|
+
for (const t of e.deps)
|
|
1730
|
+
(t.reactions ?? (t.reactions = [])).push(e), (t.f & ee) !== 0 && (t.f & Ee) === 0 && as(
|
|
1731
|
+
/** @type {Derived} */
|
|
1732
|
+
t
|
|
1733
|
+
);
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
function os(e) {
|
|
1737
|
+
if (e.v === Q) return !0;
|
|
1738
|
+
if (e.deps === null) return !1;
|
|
1739
|
+
for (const t of e.deps)
|
|
1740
|
+
if (_t.has(t) || (t.f & ee) !== 0 && os(
|
|
1741
|
+
/** @type {Derived} */
|
|
1742
|
+
t
|
|
1743
|
+
))
|
|
1744
|
+
return !0;
|
|
1745
|
+
return !1;
|
|
1746
|
+
}
|
|
1747
|
+
function sr(e) {
|
|
1748
|
+
var t = Oe;
|
|
1749
|
+
try {
|
|
1750
|
+
return Oe = !0, e();
|
|
1751
|
+
} finally {
|
|
1752
|
+
Oe = t;
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
const fs = /* @__PURE__ */ new Set(), xr = /* @__PURE__ */ new Set();
|
|
1756
|
+
function ql(e, t, n, i = {}) {
|
|
1757
|
+
function r(s) {
|
|
1758
|
+
if (i.capture || cn.call(t, s), !s.cancelBubble)
|
|
1759
|
+
return rr(() => n?.call(this, s));
|
|
1760
|
+
}
|
|
1761
|
+
return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? Fe(() => {
|
|
1762
|
+
t.addEventListener(e, r, i);
|
|
1763
|
+
}) : t.addEventListener(e, r, i), r;
|
|
1764
|
+
}
|
|
1765
|
+
function Yl(e, t, n, i, r) {
|
|
1766
|
+
var s = { capture: i, passive: r }, l = ql(e, t, n, s);
|
|
1767
|
+
(t === document.body || // @ts-ignore
|
|
1768
|
+
t === window || // @ts-ignore
|
|
1769
|
+
t === document || // Firefox has quirky behavior, it can happen that we still get "canplay" events when the element is already removed
|
|
1770
|
+
t instanceof HTMLMediaElement) && Yi(() => {
|
|
1771
|
+
t.removeEventListener(e, l, s);
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1774
|
+
function Pr(e) {
|
|
1775
|
+
for (var t = 0; t < e.length; t++)
|
|
1776
|
+
fs.add(e[t]);
|
|
1777
|
+
for (var n of xr)
|
|
1778
|
+
n(e);
|
|
1779
|
+
}
|
|
1780
|
+
let ni = null;
|
|
1781
|
+
function cn(e) {
|
|
1782
|
+
var t = this, n = (
|
|
1783
|
+
/** @type {Node} */
|
|
1784
|
+
t.ownerDocument
|
|
1785
|
+
), i = e.type, r = e.composedPath?.() || [], s = (
|
|
1786
|
+
/** @type {null | Element} */
|
|
1787
|
+
r[0] || e.target
|
|
1788
|
+
);
|
|
1789
|
+
ni = e;
|
|
1790
|
+
var l = 0, a = ni === e && e.__root;
|
|
1791
|
+
if (a) {
|
|
1792
|
+
var o = r.indexOf(a);
|
|
1793
|
+
if (o !== -1 && (t === document || t === /** @type {any} */
|
|
1794
|
+
window)) {
|
|
1795
|
+
e.__root = t;
|
|
1796
|
+
return;
|
|
1797
|
+
}
|
|
1798
|
+
var c = r.indexOf(t);
|
|
1799
|
+
if (c === -1)
|
|
1800
|
+
return;
|
|
1801
|
+
o <= c && (l = o);
|
|
1802
|
+
}
|
|
1803
|
+
if (s = /** @type {Element} */
|
|
1804
|
+
r[l] || e.target, s !== t) {
|
|
1805
|
+
jn(e, "currentTarget", {
|
|
1806
|
+
configurable: !0,
|
|
1807
|
+
get() {
|
|
1808
|
+
return s || n;
|
|
1809
|
+
}
|
|
1810
|
+
});
|
|
1811
|
+
var d = A, _ = z;
|
|
1812
|
+
ke(null), je(null);
|
|
1813
|
+
try {
|
|
1814
|
+
for (var h, p = []; s !== null; ) {
|
|
1815
|
+
var g = s.assignedSlot || s.parentNode || /** @type {any} */
|
|
1816
|
+
s.host || null;
|
|
1817
|
+
try {
|
|
1818
|
+
var x = s["__" + i];
|
|
1819
|
+
x != null && (!/** @type {any} */
|
|
1820
|
+
s.disabled || // DOM could've been updated already by the time this is reached, so we check this as well
|
|
1821
|
+
// -> the target could not have been disabled because it emits the event in the first place
|
|
1822
|
+
e.target === s) && x.call(s, e);
|
|
1823
|
+
} catch (v) {
|
|
1824
|
+
h ? p.push(v) : h = v;
|
|
1825
|
+
}
|
|
1826
|
+
if (e.cancelBubble || g === t || g === null)
|
|
1827
|
+
break;
|
|
1828
|
+
s = g;
|
|
1829
|
+
}
|
|
1830
|
+
if (h) {
|
|
1831
|
+
for (let v of p)
|
|
1832
|
+
queueMicrotask(() => {
|
|
1833
|
+
throw v;
|
|
1834
|
+
});
|
|
1835
|
+
throw h;
|
|
1836
|
+
}
|
|
1837
|
+
} finally {
|
|
1838
|
+
e.__root = t, delete e.currentTarget, ke(d), je(_);
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
function us(e) {
|
|
1843
|
+
var t = document.createElement("template");
|
|
1844
|
+
return t.innerHTML = e.replaceAll("<!>", "<!---->"), t.content;
|
|
1845
|
+
}
|
|
1846
|
+
function gt(e, t) {
|
|
1847
|
+
var n = (
|
|
1848
|
+
/** @type {Effect} */
|
|
1849
|
+
z
|
|
1850
|
+
);
|
|
1851
|
+
n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null });
|
|
1852
|
+
}
|
|
1853
|
+
// @__NO_SIDE_EFFECTS__
|
|
1854
|
+
function xn(e, t) {
|
|
1855
|
+
var n = (t & Xs) !== 0, i = (t & Ks) !== 0, r, s = !e.startsWith("<!>");
|
|
1856
|
+
return () => {
|
|
1857
|
+
if (O)
|
|
1858
|
+
return gt(M, null), M;
|
|
1859
|
+
r === void 0 && (r = us(s ? e : "<!>" + e), n || (r = /** @type {TemplateNode} */
|
|
1860
|
+
/* @__PURE__ */ st(r)));
|
|
1861
|
+
var l = (
|
|
1862
|
+
/** @type {TemplateNode} */
|
|
1863
|
+
i || Vi ? document.importNode(r, !0) : r.cloneNode(!0)
|
|
1864
|
+
);
|
|
1865
|
+
if (n) {
|
|
1866
|
+
var a = (
|
|
1867
|
+
/** @type {TemplateNode} */
|
|
1868
|
+
/* @__PURE__ */ st(l)
|
|
1869
|
+
), o = (
|
|
1870
|
+
/** @type {TemplateNode} */
|
|
1871
|
+
l.lastChild
|
|
1872
|
+
);
|
|
1873
|
+
gt(a, o);
|
|
1874
|
+
} else
|
|
1875
|
+
gt(l, l);
|
|
1876
|
+
return l;
|
|
1877
|
+
};
|
|
1878
|
+
}
|
|
1879
|
+
// @__NO_SIDE_EFFECTS__
|
|
1880
|
+
function Ul(e, t, n = "svg") {
|
|
1881
|
+
var i = !e.startsWith("<!>"), r = `<${n}>${i ? e : "<!>" + e}</${n}>`, s;
|
|
1882
|
+
return () => {
|
|
1883
|
+
if (O)
|
|
1884
|
+
return gt(M, null), M;
|
|
1885
|
+
if (!s) {
|
|
1886
|
+
var l = (
|
|
1887
|
+
/** @type {DocumentFragment} */
|
|
1888
|
+
us(r)
|
|
1889
|
+
), a = (
|
|
1890
|
+
/** @type {Element} */
|
|
1891
|
+
/* @__PURE__ */ st(l)
|
|
1892
|
+
);
|
|
1893
|
+
s = /** @type {Element} */
|
|
1894
|
+
/* @__PURE__ */ st(a);
|
|
1895
|
+
}
|
|
1896
|
+
var o = (
|
|
1897
|
+
/** @type {TemplateNode} */
|
|
1898
|
+
s.cloneNode(!0)
|
|
1899
|
+
);
|
|
1900
|
+
return gt(o, o), o;
|
|
1901
|
+
};
|
|
1902
|
+
}
|
|
1903
|
+
// @__NO_SIDE_EFFECTS__
|
|
1904
|
+
function Re(e, t) {
|
|
1905
|
+
return /* @__PURE__ */ Ul(e, t, "svg");
|
|
1906
|
+
}
|
|
1907
|
+
function Et() {
|
|
1908
|
+
if (O)
|
|
1909
|
+
return gt(M, null), M;
|
|
1910
|
+
var e = document.createDocumentFragment(), t = document.createComment(""), n = $e();
|
|
1911
|
+
return e.append(t, n), gt(t, n), e;
|
|
1912
|
+
}
|
|
1913
|
+
function D(e, t) {
|
|
1914
|
+
if (O) {
|
|
1915
|
+
var n = (
|
|
1916
|
+
/** @type {Effect & { nodes: EffectNodes }} */
|
|
1917
|
+
z
|
|
1918
|
+
);
|
|
1919
|
+
((n.f & Kn) === 0 || n.nodes.end === null) && (n.nodes.end = M), En();
|
|
1920
|
+
return;
|
|
1921
|
+
}
|
|
1922
|
+
e !== null && e.before(
|
|
1923
|
+
/** @type {Node} */
|
|
1924
|
+
t
|
|
1925
|
+
);
|
|
1926
|
+
}
|
|
1927
|
+
const Xl = ["touchstart", "touchmove"];
|
|
1928
|
+
function Kl(e) {
|
|
1929
|
+
return Xl.includes(e);
|
|
1930
|
+
}
|
|
1931
|
+
function cs(e, t) {
|
|
1932
|
+
var n = t == null ? "" : typeof t == "object" ? t + "" : t;
|
|
1933
|
+
n !== (e.__t ?? (e.__t = e.nodeValue)) && (e.__t = n, e.nodeValue = n + "");
|
|
1934
|
+
}
|
|
1935
|
+
function ds(e, t) {
|
|
1936
|
+
return hs(e, t);
|
|
1937
|
+
}
|
|
1938
|
+
function Jl(e, t) {
|
|
1939
|
+
$r(), t.intro = t.intro ?? !1;
|
|
1940
|
+
const n = t.target, i = O, r = M;
|
|
1941
|
+
try {
|
|
1942
|
+
for (var s = /* @__PURE__ */ st(n); s && (s.nodeType !== rn || /** @type {Comment} */
|
|
1943
|
+
s.data !== pi); )
|
|
1944
|
+
s = /* @__PURE__ */ He(s);
|
|
1945
|
+
if (!s)
|
|
1946
|
+
throw Jt;
|
|
1947
|
+
et(!0), ue(
|
|
1948
|
+
/** @type {Comment} */
|
|
1949
|
+
s
|
|
1950
|
+
);
|
|
1951
|
+
const l = hs(e, { ...t, anchor: s });
|
|
1952
|
+
return et(!1), /** @type {Exports} */
|
|
1953
|
+
l;
|
|
1954
|
+
} catch (l) {
|
|
1955
|
+
if (l instanceof Error && l.message.split(`
|
|
1956
|
+
`).some((a) => a.startsWith("https://svelte.dev/e/")))
|
|
1957
|
+
throw l;
|
|
1958
|
+
return l !== Jt && console.warn("Failed to hydrate: ", l), t.recover === !1 && dl(), $r(), Gi(n), et(!1), ds(e, t);
|
|
1959
|
+
} finally {
|
|
1960
|
+
et(i), ue(r);
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
const jt = /* @__PURE__ */ new Map();
|
|
1964
|
+
function hs(e, { target: t, anchor: n, props: i = {}, events: r, context: s, intro: l = !0 }) {
|
|
1965
|
+
$r();
|
|
1966
|
+
var a = /* @__PURE__ */ new Set(), o = (_) => {
|
|
1967
|
+
for (var h = 0; h < _.length; h++) {
|
|
1968
|
+
var p = _[h];
|
|
1969
|
+
if (!a.has(p)) {
|
|
1970
|
+
a.add(p);
|
|
1971
|
+
var g = Kl(p);
|
|
1972
|
+
t.addEventListener(p, cn, { passive: g });
|
|
1973
|
+
var x = jt.get(p);
|
|
1974
|
+
x === void 0 ? (document.addEventListener(p, cn, { passive: g }), jt.set(p, 1)) : jt.set(p, x + 1);
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
};
|
|
1978
|
+
o(Un(fs)), xr.add(o);
|
|
1979
|
+
var c = void 0, d = Fl(() => {
|
|
1980
|
+
var _ = n ?? t.appendChild($e());
|
|
1981
|
+
return Tl(
|
|
1982
|
+
/** @type {TemplateNode} */
|
|
1983
|
+
_,
|
|
1984
|
+
{
|
|
1985
|
+
pending: () => {
|
|
1986
|
+
}
|
|
1987
|
+
},
|
|
1988
|
+
(h) => {
|
|
1989
|
+
if (s) {
|
|
1990
|
+
Zn({});
|
|
1991
|
+
var p = (
|
|
1992
|
+
/** @type {ComponentContext} */
|
|
1993
|
+
ge
|
|
1994
|
+
);
|
|
1995
|
+
p.c = s;
|
|
1996
|
+
}
|
|
1997
|
+
if (r && (i.$$events = r), O && gt(
|
|
1998
|
+
/** @type {TemplateNode} */
|
|
1999
|
+
h,
|
|
2000
|
+
null
|
|
2001
|
+
), c = e(h, i) || {}, O && (z.nodes.end = M, M === null || M.nodeType !== rn || /** @type {Comment} */
|
|
2002
|
+
M.data !== Cr))
|
|
2003
|
+
throw Qn(), Jt;
|
|
2004
|
+
s && er();
|
|
2005
|
+
}
|
|
2006
|
+
), () => {
|
|
2007
|
+
for (var h of a) {
|
|
2008
|
+
t.removeEventListener(h, cn);
|
|
2009
|
+
var p = (
|
|
2010
|
+
/** @type {number} */
|
|
2011
|
+
jt.get(h)
|
|
2012
|
+
);
|
|
2013
|
+
--p === 0 ? (document.removeEventListener(h, cn), jt.delete(h)) : jt.set(h, p);
|
|
2014
|
+
}
|
|
2015
|
+
xr.delete(o), _ !== n && _.parentNode?.removeChild(_);
|
|
2016
|
+
};
|
|
2017
|
+
});
|
|
2018
|
+
return kr.set(c, d), c;
|
|
2019
|
+
}
|
|
2020
|
+
let kr = /* @__PURE__ */ new WeakMap();
|
|
2021
|
+
function Ql(e, t) {
|
|
2022
|
+
const n = kr.get(e);
|
|
2023
|
+
return n ? (kr.delete(e), n(t)) : Promise.resolve();
|
|
2024
|
+
}
|
|
2025
|
+
var Ce, De, he, Ot, bn, yn, qn;
|
|
2026
|
+
class Zl {
|
|
2027
|
+
/**
|
|
2028
|
+
* @param {TemplateNode} anchor
|
|
2029
|
+
* @param {boolean} transition
|
|
2030
|
+
*/
|
|
2031
|
+
constructor(t, n = !0) {
|
|
2032
|
+
/** @type {TemplateNode} */
|
|
2033
|
+
j(this, "anchor");
|
|
2034
|
+
/** @type {Map<Batch, Key>} */
|
|
2035
|
+
T(this, Ce, /* @__PURE__ */ new Map());
|
|
2036
|
+
/**
|
|
2037
|
+
* Map of keys to effects that are currently rendered in the DOM.
|
|
2038
|
+
* These effects are visible and actively part of the document tree.
|
|
2039
|
+
* Example:
|
|
2040
|
+
* ```
|
|
2041
|
+
* {#if condition}
|
|
2042
|
+
* foo
|
|
2043
|
+
* {:else}
|
|
2044
|
+
* bar
|
|
2045
|
+
* {/if}
|
|
2046
|
+
* ```
|
|
2047
|
+
* Can result in the entries `true->Effect` and `false->Effect`
|
|
2048
|
+
* @type {Map<Key, Effect>}
|
|
2049
|
+
*/
|
|
2050
|
+
T(this, De, /* @__PURE__ */ new Map());
|
|
2051
|
+
/**
|
|
2052
|
+
* Similar to #onscreen with respect to the keys, but contains branches that are not yet
|
|
2053
|
+
* in the DOM, because their insertion is deferred.
|
|
2054
|
+
* @type {Map<Key, Branch>}
|
|
2055
|
+
*/
|
|
2056
|
+
T(this, he, /* @__PURE__ */ new Map());
|
|
2057
|
+
/**
|
|
2058
|
+
* Keys of effects that are currently outroing
|
|
2059
|
+
* @type {Set<Key>}
|
|
2060
|
+
*/
|
|
2061
|
+
T(this, Ot, /* @__PURE__ */ new Set());
|
|
2062
|
+
/**
|
|
2063
|
+
* Whether to pause (i.e. outro) on change, or destroy immediately.
|
|
2064
|
+
* This is necessary for `<svelte:element>`
|
|
2065
|
+
*/
|
|
2066
|
+
T(this, bn, !0);
|
|
2067
|
+
T(this, yn, () => {
|
|
2068
|
+
var t = (
|
|
2069
|
+
/** @type {Batch} */
|
|
2070
|
+
N
|
|
2071
|
+
);
|
|
2072
|
+
if (u(this, Ce).has(t)) {
|
|
2073
|
+
var n = (
|
|
2074
|
+
/** @type {Key} */
|
|
2075
|
+
u(this, Ce).get(t)
|
|
2076
|
+
), i = u(this, De).get(n);
|
|
2077
|
+
if (i)
|
|
2078
|
+
Nr(i), u(this, Ot).delete(n);
|
|
2079
|
+
else {
|
|
2080
|
+
var r = u(this, he).get(n);
|
|
2081
|
+
r && (u(this, De).set(n, r.effect), u(this, he).delete(n), r.fragment.lastChild.remove(), this.anchor.before(r.fragment), i = r.effect);
|
|
2082
|
+
}
|
|
2083
|
+
for (const [s, l] of u(this, Ce)) {
|
|
2084
|
+
if (u(this, Ce).delete(s), s === t)
|
|
2085
|
+
break;
|
|
2086
|
+
const a = u(this, he).get(l);
|
|
2087
|
+
a && (re(a.effect), u(this, he).delete(l));
|
|
2088
|
+
}
|
|
2089
|
+
for (const [s, l] of u(this, De)) {
|
|
2090
|
+
if (s === n || u(this, Ot).has(s)) continue;
|
|
2091
|
+
const a = () => {
|
|
2092
|
+
if (Array.from(u(this, Ce).values()).includes(s)) {
|
|
2093
|
+
var c = document.createDocumentFragment();
|
|
2094
|
+
ts(l, c), c.append($e()), u(this, he).set(s, { effect: l, fragment: c });
|
|
2095
|
+
} else
|
|
2096
|
+
re(l);
|
|
2097
|
+
u(this, Ot).delete(s), u(this, De).delete(s);
|
|
2098
|
+
};
|
|
2099
|
+
u(this, bn) || !i ? (u(this, Ot).add(s), Mt(l, a, !1)) : a();
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
});
|
|
2103
|
+
/**
|
|
2104
|
+
* @param {Batch} batch
|
|
2105
|
+
*/
|
|
2106
|
+
T(this, qn, (t) => {
|
|
2107
|
+
u(this, Ce).delete(t);
|
|
2108
|
+
const n = Array.from(u(this, Ce).values());
|
|
2109
|
+
for (const [i, r] of u(this, he))
|
|
2110
|
+
n.includes(i) || (re(r.effect), u(this, he).delete(i));
|
|
2111
|
+
});
|
|
2112
|
+
this.anchor = t, E(this, bn, n);
|
|
2113
|
+
}
|
|
2114
|
+
/**
|
|
2115
|
+
*
|
|
2116
|
+
* @param {any} key
|
|
2117
|
+
* @param {null | ((target: TemplateNode) => void)} fn
|
|
2118
|
+
*/
|
|
2119
|
+
ensure(t, n) {
|
|
2120
|
+
var i = (
|
|
2121
|
+
/** @type {Batch} */
|
|
2122
|
+
N
|
|
2123
|
+
), r = Wi();
|
|
2124
|
+
if (n && !u(this, De).has(t) && !u(this, he).has(t))
|
|
2125
|
+
if (r) {
|
|
2126
|
+
var s = document.createDocumentFragment(), l = $e();
|
|
2127
|
+
s.append(l), u(this, he).set(t, {
|
|
2128
|
+
effect: ye(() => n(l)),
|
|
2129
|
+
fragment: s
|
|
2130
|
+
});
|
|
2131
|
+
} else
|
|
2132
|
+
u(this, De).set(
|
|
2133
|
+
t,
|
|
2134
|
+
ye(() => n(this.anchor))
|
|
2135
|
+
);
|
|
2136
|
+
if (u(this, Ce).set(i, t), r) {
|
|
2137
|
+
for (const [a, o] of u(this, De))
|
|
2138
|
+
a === t ? i.skipped_effects.delete(o) : i.skipped_effects.add(o);
|
|
2139
|
+
for (const [a, o] of u(this, he))
|
|
2140
|
+
a === t ? i.skipped_effects.delete(o.effect) : i.skipped_effects.add(o.effect);
|
|
2141
|
+
i.oncommit(u(this, yn)), i.ondiscard(u(this, qn));
|
|
2142
|
+
} else
|
|
2143
|
+
O && (this.anchor = M), u(this, yn).call(this);
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
Ce = new WeakMap(), De = new WeakMap(), he = new WeakMap(), Ot = new WeakMap(), bn = new WeakMap(), yn = new WeakMap(), qn = new WeakMap();
|
|
2147
|
+
function vs(e) {
|
|
2148
|
+
ge === null && ll(), Bt(() => {
|
|
2149
|
+
const t = sr(e);
|
|
2150
|
+
if (typeof t == "function") return (
|
|
2151
|
+
/** @type {() => void} */
|
|
2152
|
+
t
|
|
2153
|
+
);
|
|
2154
|
+
});
|
|
2155
|
+
}
|
|
2156
|
+
function qe(e, t, n = !1) {
|
|
2157
|
+
O && En();
|
|
2158
|
+
var i = new Zl(e), r = n ? Zt : 0;
|
|
2159
|
+
function s(l, a) {
|
|
2160
|
+
if (O) {
|
|
2161
|
+
const c = yi(e) === Yn;
|
|
2162
|
+
if (l === c) {
|
|
2163
|
+
var o = Hn();
|
|
2164
|
+
ue(o), i.anchor = o, et(!1), i.ensure(l, a), et(!0);
|
|
2165
|
+
return;
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
i.ensure(l, a);
|
|
2169
|
+
}
|
|
2170
|
+
Lr(() => {
|
|
2171
|
+
var l = !1;
|
|
2172
|
+
t((a, o = !0) => {
|
|
2173
|
+
l = !0, s(o, a);
|
|
2174
|
+
}), l || s(!1, null);
|
|
2175
|
+
}, r);
|
|
2176
|
+
}
|
|
2177
|
+
function Rn(e, t) {
|
|
2178
|
+
return t;
|
|
2179
|
+
}
|
|
2180
|
+
function ea(e, t, n) {
|
|
2181
|
+
for (var i = [], r = t.length, s, l = t.length, a = 0; a < r; a++) {
|
|
2182
|
+
let _ = t[a];
|
|
2183
|
+
Mt(
|
|
2184
|
+
_,
|
|
2185
|
+
() => {
|
|
2186
|
+
if (s) {
|
|
2187
|
+
if (s.pending.delete(_), s.done.add(_), s.pending.size === 0) {
|
|
2188
|
+
var h = (
|
|
2189
|
+
/** @type {Set<EachOutroGroup>} */
|
|
2190
|
+
e.outrogroups
|
|
2191
|
+
);
|
|
2192
|
+
Tr(Un(s.done)), h.delete(s), h.size === 0 && (e.outrogroups = null);
|
|
2193
|
+
}
|
|
2194
|
+
} else
|
|
2195
|
+
l -= 1;
|
|
2196
|
+
},
|
|
2197
|
+
!1
|
|
2198
|
+
);
|
|
2199
|
+
}
|
|
2200
|
+
if (l === 0) {
|
|
2201
|
+
var o = i.length === 0 && n !== null;
|
|
2202
|
+
if (o) {
|
|
2203
|
+
var c = (
|
|
2204
|
+
/** @type {Element} */
|
|
2205
|
+
n
|
|
2206
|
+
), d = (
|
|
2207
|
+
/** @type {Element} */
|
|
2208
|
+
c.parentNode
|
|
2209
|
+
);
|
|
2210
|
+
Gi(d), d.append(c), e.items.clear();
|
|
2211
|
+
}
|
|
2212
|
+
Tr(t, !o);
|
|
2213
|
+
} else
|
|
2214
|
+
s = {
|
|
2215
|
+
pending: new Set(t),
|
|
2216
|
+
done: /* @__PURE__ */ new Set()
|
|
2217
|
+
}, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(s);
|
|
2218
|
+
}
|
|
2219
|
+
function Tr(e, t = !0) {
|
|
2220
|
+
for (var n = 0; n < e.length; n++)
|
|
2221
|
+
re(e[n], t);
|
|
2222
|
+
}
|
|
2223
|
+
var ri;
|
|
2224
|
+
function yt(e, t, n, i, r, s = null) {
|
|
2225
|
+
var l = e, a = /* @__PURE__ */ new Map(), o = (t & vi) !== 0;
|
|
2226
|
+
if (o) {
|
|
2227
|
+
var c = (
|
|
2228
|
+
/** @type {Element} */
|
|
2229
|
+
e
|
|
2230
|
+
);
|
|
2231
|
+
l = O ? ue(/* @__PURE__ */ st(c)) : c.appendChild($e());
|
|
2232
|
+
}
|
|
2233
|
+
O && En();
|
|
2234
|
+
var d = null, _ = /* @__PURE__ */ Ml(() => {
|
|
2235
|
+
var b = n();
|
|
2236
|
+
return _i(b) ? b : b == null ? [] : Un(b);
|
|
2237
|
+
}), h, p = !0;
|
|
2238
|
+
function g() {
|
|
2239
|
+
v.fallback = d, ta(v, h, l, t, i), d !== null && (h.length === 0 ? (d.f & Ze) === 0 ? Nr(d) : (d.f ^= Ze, dn(d, null, l)) : Mt(d, () => {
|
|
2240
|
+
d = null;
|
|
2241
|
+
}));
|
|
2242
|
+
}
|
|
2243
|
+
var x = Lr(() => {
|
|
2244
|
+
h = /** @type {V[]} */
|
|
2245
|
+
f(_);
|
|
2246
|
+
var b = h.length;
|
|
2247
|
+
let te = !1;
|
|
2248
|
+
if (O) {
|
|
2249
|
+
var se = yi(l) === Yn;
|
|
2250
|
+
se !== (b === 0) && (l = Hn(), ue(l), et(!1), te = !0);
|
|
2251
|
+
}
|
|
2252
|
+
for (var P = /* @__PURE__ */ new Set(), q = (
|
|
2253
|
+
/** @type {Batch} */
|
|
2254
|
+
N
|
|
2255
|
+
), J = Wi(), F = 0; F < b; F += 1) {
|
|
2256
|
+
O && M.nodeType === rn && /** @type {Comment} */
|
|
2257
|
+
M.data === Cr && (l = /** @type {Comment} */
|
|
2258
|
+
M, te = !0, et(!1));
|
|
2259
|
+
var Te = h[F], Ie = i(Te, F), V = p ? null : a.get(Ie);
|
|
2260
|
+
V ? (V.v && nn(V.v, Te), V.i && nn(V.i, F), J && q.skipped_effects.delete(V.e)) : (V = na(
|
|
2261
|
+
a,
|
|
2262
|
+
p ? l : ri ?? (ri = $e()),
|
|
2263
|
+
Te,
|
|
2264
|
+
Ie,
|
|
2265
|
+
F,
|
|
2266
|
+
r,
|
|
2267
|
+
t,
|
|
2268
|
+
n
|
|
2269
|
+
), p || (V.e.f |= Ze), a.set(Ie, V)), P.add(Ie);
|
|
2270
|
+
}
|
|
2271
|
+
if (b === 0 && s && !d && (p ? d = ye(() => s(l)) : (d = ye(() => s(ri ?? (ri = $e()))), d.f |= Ze)), O && b > 0 && ue(Hn()), !p)
|
|
2272
|
+
if (J) {
|
|
2273
|
+
for (const [sn, Nt] of a)
|
|
2274
|
+
P.has(sn) || q.skipped_effects.add(Nt.e);
|
|
2275
|
+
q.oncommit(g), q.ondiscard(() => {
|
|
2276
|
+
});
|
|
2277
|
+
} else
|
|
2278
|
+
g();
|
|
2279
|
+
te && et(!0), f(_);
|
|
2280
|
+
}), v = { effect: x, items: a, outrogroups: null, fallback: d };
|
|
2281
|
+
p = !1, O && (l = M);
|
|
2282
|
+
}
|
|
2283
|
+
function un(e) {
|
|
2284
|
+
for (; e !== null && (e.f & ze) === 0; )
|
|
2285
|
+
e = e.next;
|
|
2286
|
+
return e;
|
|
2287
|
+
}
|
|
2288
|
+
function ta(e, t, n, i, r) {
|
|
2289
|
+
var s = (i & Ys) !== 0, l = t.length, a = e.items, o = un(e.effect.first), c, d = null, _, h = [], p = [], g, x, v, b;
|
|
2290
|
+
if (s)
|
|
2291
|
+
for (b = 0; b < l; b += 1)
|
|
2292
|
+
g = t[b], x = r(g, b), v = /** @type {EachItem} */
|
|
2293
|
+
a.get(x).e, (v.f & Ze) === 0 && (v.nodes?.a?.measure(), (_ ?? (_ = /* @__PURE__ */ new Set())).add(v));
|
|
2294
|
+
for (b = 0; b < l; b += 1) {
|
|
2295
|
+
if (g = t[b], x = r(g, b), v = /** @type {EachItem} */
|
|
2296
|
+
a.get(x).e, e.outrogroups !== null)
|
|
2297
|
+
for (const V of e.outrogroups)
|
|
2298
|
+
V.pending.delete(v), V.done.delete(v);
|
|
2299
|
+
if ((v.f & Ze) !== 0)
|
|
2300
|
+
if (v.f ^= Ze, v === o)
|
|
2301
|
+
dn(v, null, n);
|
|
2302
|
+
else {
|
|
2303
|
+
var te = d ? d.next : o;
|
|
2304
|
+
v === e.effect.last && (e.effect.last = v.prev), v.prev && (v.prev.next = v.next), v.next && (v.next.prev = v.prev), ht(e, d, v), ht(e, v, te), dn(v, te, n), d = v, h = [], p = [], o = un(d.next);
|
|
2305
|
+
continue;
|
|
2306
|
+
}
|
|
2307
|
+
if ((v.f & _e) !== 0 && (Nr(v), s && (v.nodes?.a?.unfix(), (_ ?? (_ = /* @__PURE__ */ new Set())).delete(v))), v !== o) {
|
|
2308
|
+
if (c !== void 0 && c.has(v)) {
|
|
2309
|
+
if (h.length < p.length) {
|
|
2310
|
+
var se = p[0], P;
|
|
2311
|
+
d = se.prev;
|
|
2312
|
+
var q = h[0], J = h[h.length - 1];
|
|
2313
|
+
for (P = 0; P < h.length; P += 1)
|
|
2314
|
+
dn(h[P], se, n);
|
|
2315
|
+
for (P = 0; P < p.length; P += 1)
|
|
2316
|
+
c.delete(p[P]);
|
|
2317
|
+
ht(e, q.prev, J.next), ht(e, d, q), ht(e, J, se), o = se, d = J, b -= 1, h = [], p = [];
|
|
2318
|
+
} else
|
|
2319
|
+
c.delete(v), dn(v, o, n), ht(e, v.prev, v.next), ht(e, v, d === null ? e.effect.first : d.next), ht(e, d, v), d = v;
|
|
2320
|
+
continue;
|
|
2321
|
+
}
|
|
2322
|
+
for (h = [], p = []; o !== null && o !== v; )
|
|
2323
|
+
(c ?? (c = /* @__PURE__ */ new Set())).add(o), p.push(o), o = un(o.next);
|
|
2324
|
+
if (o === null)
|
|
2325
|
+
continue;
|
|
2326
|
+
}
|
|
2327
|
+
(v.f & Ze) === 0 && h.push(v), d = v, o = un(v.next);
|
|
2328
|
+
}
|
|
2329
|
+
if (e.outrogroups !== null) {
|
|
2330
|
+
for (const V of e.outrogroups)
|
|
2331
|
+
V.pending.size === 0 && (Tr(Un(V.done)), e.outrogroups?.delete(V));
|
|
2332
|
+
e.outrogroups.size === 0 && (e.outrogroups = null);
|
|
2333
|
+
}
|
|
2334
|
+
if (o !== null || c !== void 0) {
|
|
2335
|
+
var F = [];
|
|
2336
|
+
if (c !== void 0)
|
|
2337
|
+
for (v of c)
|
|
2338
|
+
(v.f & _e) === 0 && F.push(v);
|
|
2339
|
+
for (; o !== null; )
|
|
2340
|
+
(o.f & _e) === 0 && o !== e.fallback && F.push(o), o = un(o.next);
|
|
2341
|
+
var Te = F.length;
|
|
2342
|
+
if (Te > 0) {
|
|
2343
|
+
var Ie = (i & vi) !== 0 && l === 0 ? n : null;
|
|
2344
|
+
if (s) {
|
|
2345
|
+
for (b = 0; b < Te; b += 1)
|
|
2346
|
+
F[b].nodes?.a?.measure();
|
|
2347
|
+
for (b = 0; b < Te; b += 1)
|
|
2348
|
+
F[b].nodes?.a?.fix();
|
|
2349
|
+
}
|
|
2350
|
+
ea(e, F, Ie);
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
s && Fe(() => {
|
|
2354
|
+
if (_ !== void 0)
|
|
2355
|
+
for (v of _)
|
|
2356
|
+
v.nodes?.a?.apply();
|
|
2357
|
+
});
|
|
2358
|
+
}
|
|
2359
|
+
function na(e, t, n, i, r, s, l, a) {
|
|
2360
|
+
var o = (l & Ws) !== 0 ? (l & Us) === 0 ? /* @__PURE__ */ Fi(n, !1, !1) : It(n) : null, c = (l & qs) !== 0 ? It(r) : null;
|
|
2361
|
+
return {
|
|
2362
|
+
v: o,
|
|
2363
|
+
i: c,
|
|
2364
|
+
e: ye(() => (s(t, o ?? n, c ?? r, a), () => {
|
|
2365
|
+
e.delete(i);
|
|
2366
|
+
}))
|
|
2367
|
+
};
|
|
2368
|
+
}
|
|
2369
|
+
function dn(e, t, n) {
|
|
2370
|
+
if (e.nodes)
|
|
2371
|
+
for (var i = e.nodes.start, r = e.nodes.end, s = t && (t.f & Ze) === 0 ? (
|
|
2372
|
+
/** @type {EffectNodes} */
|
|
2373
|
+
t.nodes.start
|
|
2374
|
+
) : n; i !== null; ) {
|
|
2375
|
+
var l = (
|
|
2376
|
+
/** @type {TemplateNode} */
|
|
2377
|
+
/* @__PURE__ */ He(i)
|
|
2378
|
+
);
|
|
2379
|
+
if (s.before(i), i === r)
|
|
2380
|
+
return;
|
|
2381
|
+
i = l;
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
function ht(e, t, n) {
|
|
2385
|
+
t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t;
|
|
2386
|
+
}
|
|
2387
|
+
function ra(e, t, n, i, r) {
|
|
2388
|
+
O && En();
|
|
2389
|
+
var s = t.$$slots?.[n], l = !1;
|
|
2390
|
+
s === !0 && (s = t.children, l = !0), s === void 0 || s(e, l ? () => i : i);
|
|
2391
|
+
}
|
|
2392
|
+
function ia(e, t) {
|
|
2393
|
+
Xi(() => {
|
|
2394
|
+
var n = e.getRootNode(), i = (
|
|
2395
|
+
/** @type {ShadowRoot} */
|
|
2396
|
+
n.host ? (
|
|
2397
|
+
/** @type {ShadowRoot} */
|
|
2398
|
+
n
|
|
2399
|
+
) : (
|
|
2400
|
+
/** @type {Document} */
|
|
2401
|
+
n.head ?? /** @type {Document} */
|
|
2402
|
+
n.ownerDocument.head
|
|
2403
|
+
)
|
|
2404
|
+
);
|
|
2405
|
+
if (!i.querySelector("#" + t.hash)) {
|
|
2406
|
+
const r = document.createElement("style");
|
|
2407
|
+
r.id = t.hash, r.textContent = t.code, i.appendChild(r);
|
|
2408
|
+
}
|
|
2409
|
+
});
|
|
2410
|
+
}
|
|
2411
|
+
const ii = [...`
|
|
2412
|
+
\r\f \v\uFEFF`];
|
|
2413
|
+
function sa(e, t, n) {
|
|
2414
|
+
var i = e == null ? "" : "" + e;
|
|
2415
|
+
if (n) {
|
|
2416
|
+
for (var r in n)
|
|
2417
|
+
if (n[r])
|
|
2418
|
+
i = i ? i + " " + r : r;
|
|
2419
|
+
else if (i.length)
|
|
2420
|
+
for (var s = r.length, l = 0; (l = i.indexOf(r, l)) >= 0; ) {
|
|
2421
|
+
var a = l + s;
|
|
2422
|
+
(l === 0 || ii.includes(i[l - 1])) && (a === i.length || ii.includes(i[a])) ? i = (l === 0 ? "" : i.substring(0, l)) + i.substring(a + 1) : l = a;
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
return i === "" ? null : i;
|
|
2426
|
+
}
|
|
2427
|
+
function la(e, t) {
|
|
2428
|
+
return e == null ? null : String(e);
|
|
2429
|
+
}
|
|
2430
|
+
function si(e, t, n, i, r, s) {
|
|
2431
|
+
var l = e.__className;
|
|
2432
|
+
if (O || l !== n || l === void 0) {
|
|
2433
|
+
var a = sa(n, i, s);
|
|
2434
|
+
(!O || a !== e.getAttribute("class")) && (a == null ? e.removeAttribute("class") : t ? e.className = a : e.setAttribute("class", a)), e.__className = n;
|
|
2435
|
+
} else if (s && r !== s)
|
|
2436
|
+
for (var o in s) {
|
|
2437
|
+
var c = !!s[o];
|
|
2438
|
+
(r == null || c !== !!r[o]) && e.classList.toggle(o, c);
|
|
2439
|
+
}
|
|
2440
|
+
return s;
|
|
2441
|
+
}
|
|
2442
|
+
function Sr(e, t, n, i) {
|
|
2443
|
+
var r = e.__style;
|
|
2444
|
+
if (O || r !== t) {
|
|
2445
|
+
var s = la(t);
|
|
2446
|
+
(!O || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t;
|
|
2447
|
+
}
|
|
2448
|
+
return i;
|
|
2449
|
+
}
|
|
2450
|
+
const aa = /* @__PURE__ */ Symbol("is custom element"), oa = /* @__PURE__ */ Symbol("is html");
|
|
2451
|
+
function li(e) {
|
|
2452
|
+
if (O) {
|
|
2453
|
+
var t = !1, n = () => {
|
|
2454
|
+
if (!t) {
|
|
2455
|
+
if (t = !0, e.hasAttribute("value")) {
|
|
2456
|
+
var i = e.value;
|
|
2457
|
+
R(e, "value", null), e.value = i;
|
|
2458
|
+
}
|
|
2459
|
+
if (e.hasAttribute("checked")) {
|
|
2460
|
+
var r = e.checked;
|
|
2461
|
+
R(e, "checked", null), e.checked = r;
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
};
|
|
2465
|
+
e.__on_r = n, Fe(n), qi();
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
function R(e, t, n, i) {
|
|
2469
|
+
var r = fa(e);
|
|
2470
|
+
O && (r[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === "LINK") || r[t] !== (r[t] = n) && (t === "loading" && (e[sl] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && ua(e).includes(t) ? e[t] = n : e.setAttribute(t, n));
|
|
2471
|
+
}
|
|
2472
|
+
function fa(e) {
|
|
2473
|
+
return (
|
|
2474
|
+
/** @type {Record<string | symbol, unknown>} **/
|
|
2475
|
+
// @ts-expect-error
|
|
2476
|
+
e.__attributes ?? (e.__attributes = {
|
|
2477
|
+
[aa]: e.nodeName.includes("-"),
|
|
2478
|
+
[oa]: e.namespaceURI === Js
|
|
2479
|
+
})
|
|
2480
|
+
);
|
|
2481
|
+
}
|
|
2482
|
+
var ai = /* @__PURE__ */ new Map();
|
|
2483
|
+
function ua(e) {
|
|
2484
|
+
var t = e.getAttribute("is") || e.nodeName, n = ai.get(t);
|
|
2485
|
+
if (n) return n;
|
|
2486
|
+
ai.set(t, n = []);
|
|
2487
|
+
for (var i, r = e, s = Element.prototype; s !== r; ) {
|
|
2488
|
+
i = Zs(r);
|
|
2489
|
+
for (var l in i)
|
|
2490
|
+
i[l].set && n.push(l);
|
|
2491
|
+
r = gi(r);
|
|
2492
|
+
}
|
|
2493
|
+
return n;
|
|
2494
|
+
}
|
|
2495
|
+
function oi(e, t, n = t) {
|
|
2496
|
+
var i = /* @__PURE__ */ new WeakSet();
|
|
2497
|
+
Ll(e, "input", async (r) => {
|
|
2498
|
+
var s = r ? e.defaultValue : e.value;
|
|
2499
|
+
if (s = cr(e) ? dr(s) : s, n(s), N !== null && i.add(N), await Wl(), s !== (s = t())) {
|
|
2500
|
+
var l = e.selectionStart, a = e.selectionEnd, o = e.value.length;
|
|
2501
|
+
if (e.value = s ?? "", a !== null) {
|
|
2502
|
+
var c = e.value.length;
|
|
2503
|
+
l === a && a === o && c > o ? (e.selectionStart = c, e.selectionEnd = c) : (e.selectionStart = l, e.selectionEnd = Math.min(a, c));
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
}), // If we are hydrating and the value has since changed,
|
|
2507
|
+
// then use the updated value from the input instead.
|
|
2508
|
+
(O && e.defaultValue !== e.value || // If defaultValue is set, then value == defaultValue
|
|
2509
|
+
// TODO Svelte 6: remove input.value check and set to empty string?
|
|
2510
|
+
sr(t) == null && e.value) && (n(cr(e) ? dr(e.value) : e.value), N !== null && i.add(N)), ir(() => {
|
|
2511
|
+
var r = t();
|
|
2512
|
+
if (e === document.activeElement) {
|
|
2513
|
+
var s = (
|
|
2514
|
+
/** @type {Batch} */
|
|
2515
|
+
pr ?? N
|
|
2516
|
+
);
|
|
2517
|
+
if (i.has(s))
|
|
2518
|
+
return;
|
|
2519
|
+
}
|
|
2520
|
+
cr(e) && r === dr(e.value) || e.type === "date" && !r && !e.value || r !== e.value && (e.value = r ?? "");
|
|
2521
|
+
});
|
|
2522
|
+
}
|
|
2523
|
+
function cr(e) {
|
|
2524
|
+
var t = e.type;
|
|
2525
|
+
return t === "number" || t === "range";
|
|
2526
|
+
}
|
|
2527
|
+
function dr(e) {
|
|
2528
|
+
return e === "" ? null : +e;
|
|
2529
|
+
}
|
|
2530
|
+
function fi(e, t) {
|
|
2531
|
+
return e === t || e?.[In] === t;
|
|
2532
|
+
}
|
|
2533
|
+
function pn(e = {}, t, n, i) {
|
|
2534
|
+
return Xi(() => {
|
|
2535
|
+
var r, s;
|
|
2536
|
+
return ir(() => {
|
|
2537
|
+
r = s, s = [], sr(() => {
|
|
2538
|
+
e !== n(...s) && (t(e, ...s), r && fi(n(...r), e) && t(null, ...r));
|
|
2539
|
+
});
|
|
2540
|
+
}), () => {
|
|
2541
|
+
Fe(() => {
|
|
2542
|
+
s && fi(n(...s), e) && t(null, ...s);
|
|
2543
|
+
});
|
|
2544
|
+
};
|
|
2545
|
+
}), e;
|
|
2546
|
+
}
|
|
2547
|
+
function Me(e, t, n, i) {
|
|
2548
|
+
var r = (
|
|
2549
|
+
/** @type {V} */
|
|
2550
|
+
i
|
|
2551
|
+
), s = !0, l = () => (s && (s = !1, r = /** @type {V} */
|
|
2552
|
+
i), r), a;
|
|
2553
|
+
a = /** @type {V} */
|
|
2554
|
+
e[t], a === void 0 && i !== void 0 && (a = l());
|
|
2555
|
+
var o;
|
|
2556
|
+
o = () => {
|
|
2557
|
+
var h = (
|
|
2558
|
+
/** @type {V} */
|
|
2559
|
+
e[t]
|
|
2560
|
+
);
|
|
2561
|
+
return h === void 0 ? l() : (s = !0, h);
|
|
2562
|
+
};
|
|
2563
|
+
var c = !1, d = /* @__PURE__ */ nr(() => (c = !1, o())), _ = (
|
|
2564
|
+
/** @type {Effect} */
|
|
2565
|
+
z
|
|
2566
|
+
);
|
|
2567
|
+
return (
|
|
2568
|
+
/** @type {() => V} */
|
|
2569
|
+
(function(h, p) {
|
|
2570
|
+
if (arguments.length > 0) {
|
|
2571
|
+
const g = p ? f(d) : h;
|
|
2572
|
+
return w(d, g), c = !0, r !== void 0 && (r = g), h;
|
|
2573
|
+
}
|
|
2574
|
+
return mt && c || (_.f & nt) !== 0 ? d.v : f(d);
|
|
2575
|
+
})
|
|
2576
|
+
);
|
|
2577
|
+
}
|
|
2578
|
+
function ca(e) {
|
|
2579
|
+
return new da(e);
|
|
2580
|
+
}
|
|
2581
|
+
var Qe, be;
|
|
2582
|
+
class da {
|
|
2583
|
+
/**
|
|
2584
|
+
* @param {ComponentConstructorOptions & {
|
|
2585
|
+
* component: any;
|
|
2586
|
+
* }} options
|
|
2587
|
+
*/
|
|
2588
|
+
constructor(t) {
|
|
2589
|
+
/** @type {any} */
|
|
2590
|
+
T(this, Qe);
|
|
2591
|
+
/** @type {Record<string, any>} */
|
|
2592
|
+
T(this, be);
|
|
2593
|
+
var n = /* @__PURE__ */ new Map(), i = (s, l) => {
|
|
2594
|
+
var a = /* @__PURE__ */ Fi(l, !1, !1);
|
|
2595
|
+
return n.set(s, a), a;
|
|
2596
|
+
};
|
|
2597
|
+
const r = new Proxy(
|
|
2598
|
+
{ ...t.props || {}, $$events: {} },
|
|
2599
|
+
{
|
|
2600
|
+
get(s, l) {
|
|
2601
|
+
return f(n.get(l) ?? i(l, Reflect.get(s, l)));
|
|
2602
|
+
},
|
|
2603
|
+
has(s, l) {
|
|
2604
|
+
return l === il ? !0 : (f(n.get(l) ?? i(l, Reflect.get(s, l))), Reflect.has(s, l));
|
|
2605
|
+
},
|
|
2606
|
+
set(s, l, a) {
|
|
2607
|
+
return w(n.get(l) ?? i(l, a), a), Reflect.set(s, l, a);
|
|
2608
|
+
}
|
|
2609
|
+
}
|
|
2610
|
+
);
|
|
2611
|
+
E(this, be, (t.hydrate ? Jl : ds)(t.component, {
|
|
2612
|
+
target: t.target,
|
|
2613
|
+
anchor: t.anchor,
|
|
2614
|
+
props: r,
|
|
2615
|
+
context: t.context,
|
|
2616
|
+
intro: t.intro ?? !1,
|
|
2617
|
+
recover: t.recover
|
|
2618
|
+
})), (!t?.props?.$$host || t.sync === !1) && pe(), E(this, Qe, r.$$events);
|
|
2619
|
+
for (const s of Object.keys(u(this, be)))
|
|
2620
|
+
s === "$set" || s === "$destroy" || s === "$on" || jn(this, s, {
|
|
2621
|
+
get() {
|
|
2622
|
+
return u(this, be)[s];
|
|
2623
|
+
},
|
|
2624
|
+
/** @param {any} value */
|
|
2625
|
+
set(l) {
|
|
2626
|
+
u(this, be)[s] = l;
|
|
2627
|
+
},
|
|
2628
|
+
enumerable: !0
|
|
2629
|
+
});
|
|
2630
|
+
u(this, be).$set = /** @param {Record<string, any>} next */
|
|
2631
|
+
(s) => {
|
|
2632
|
+
Object.assign(r, s);
|
|
2633
|
+
}, u(this, be).$destroy = () => {
|
|
2634
|
+
Ql(u(this, be));
|
|
2635
|
+
};
|
|
2636
|
+
}
|
|
2637
|
+
/** @param {Record<string, any>} props */
|
|
2638
|
+
$set(t) {
|
|
2639
|
+
u(this, be).$set(t);
|
|
2640
|
+
}
|
|
2641
|
+
/**
|
|
2642
|
+
* @param {string} event
|
|
2643
|
+
* @param {(...args: any[]) => any} callback
|
|
2644
|
+
* @returns {any}
|
|
2645
|
+
*/
|
|
2646
|
+
$on(t, n) {
|
|
2647
|
+
u(this, Qe)[t] = u(this, Qe)[t] || [];
|
|
2648
|
+
const i = (...r) => n.call(this, ...r);
|
|
2649
|
+
return u(this, Qe)[t].push(i), () => {
|
|
2650
|
+
u(this, Qe)[t] = u(this, Qe)[t].filter(
|
|
2651
|
+
/** @param {any} fn */
|
|
2652
|
+
(r) => r !== i
|
|
2653
|
+
);
|
|
2654
|
+
};
|
|
2655
|
+
}
|
|
2656
|
+
$destroy() {
|
|
2657
|
+
u(this, be).$destroy();
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
Qe = new WeakMap(), be = new WeakMap();
|
|
2661
|
+
let ps;
|
|
2662
|
+
typeof HTMLElement == "function" && (ps = class extends HTMLElement {
|
|
2663
|
+
/**
|
|
2664
|
+
* @param {*} $$componentCtor
|
|
2665
|
+
* @param {*} $$slots
|
|
2666
|
+
* @param {ShadowRootInit | undefined} shadow_root_init
|
|
2667
|
+
*/
|
|
2668
|
+
constructor(t, n, i) {
|
|
2669
|
+
super();
|
|
2670
|
+
/** The Svelte component constructor */
|
|
2671
|
+
j(this, "$$ctor");
|
|
2672
|
+
/** Slots */
|
|
2673
|
+
j(this, "$$s");
|
|
2674
|
+
/** @type {any} The Svelte component instance */
|
|
2675
|
+
j(this, "$$c");
|
|
2676
|
+
/** Whether or not the custom element is connected */
|
|
2677
|
+
j(this, "$$cn", !1);
|
|
2678
|
+
/** @type {Record<string, any>} Component props data */
|
|
2679
|
+
j(this, "$$d", {});
|
|
2680
|
+
/** `true` if currently in the process of reflecting component props back to attributes */
|
|
2681
|
+
j(this, "$$r", !1);
|
|
2682
|
+
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
|
|
2683
|
+
j(this, "$$p_d", {});
|
|
2684
|
+
/** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */
|
|
2685
|
+
j(this, "$$l", {});
|
|
2686
|
+
/** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */
|
|
2687
|
+
j(this, "$$l_u", /* @__PURE__ */ new Map());
|
|
2688
|
+
/** @type {any} The managed render effect for reflecting attributes */
|
|
2689
|
+
j(this, "$$me");
|
|
2690
|
+
/** @type {ShadowRoot | null} The ShadowRoot of the custom element */
|
|
2691
|
+
j(this, "$$shadowRoot", null);
|
|
2692
|
+
this.$$ctor = t, this.$$s = n, i && (this.$$shadowRoot = this.attachShadow(i));
|
|
2693
|
+
}
|
|
2694
|
+
/**
|
|
2695
|
+
* @param {string} type
|
|
2696
|
+
* @param {EventListenerOrEventListenerObject} listener
|
|
2697
|
+
* @param {boolean | AddEventListenerOptions} [options]
|
|
2698
|
+
*/
|
|
2699
|
+
addEventListener(t, n, i) {
|
|
2700
|
+
if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(n), this.$$c) {
|
|
2701
|
+
const r = this.$$c.$on(t, n);
|
|
2702
|
+
this.$$l_u.set(n, r);
|
|
2703
|
+
}
|
|
2704
|
+
super.addEventListener(t, n, i);
|
|
2705
|
+
}
|
|
2706
|
+
/**
|
|
2707
|
+
* @param {string} type
|
|
2708
|
+
* @param {EventListenerOrEventListenerObject} listener
|
|
2709
|
+
* @param {boolean | AddEventListenerOptions} [options]
|
|
2710
|
+
*/
|
|
2711
|
+
removeEventListener(t, n, i) {
|
|
2712
|
+
if (super.removeEventListener(t, n, i), this.$$c) {
|
|
2713
|
+
const r = this.$$l_u.get(n);
|
|
2714
|
+
r && (r(), this.$$l_u.delete(n));
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
async connectedCallback() {
|
|
2718
|
+
if (this.$$cn = !0, !this.$$c) {
|
|
2719
|
+
let t = function(r) {
|
|
2720
|
+
return (s) => {
|
|
2721
|
+
const l = document.createElement("slot");
|
|
2722
|
+
r !== "default" && (l.name = r), D(s, l);
|
|
2723
|
+
};
|
|
2724
|
+
};
|
|
2725
|
+
if (await Promise.resolve(), !this.$$cn || this.$$c)
|
|
2726
|
+
return;
|
|
2727
|
+
const n = {}, i = ha(this);
|
|
2728
|
+
for (const r of this.$$s)
|
|
2729
|
+
r in i && (r === "default" && !this.$$d.children ? (this.$$d.children = t(r), n.default = !0) : n[r] = t(r));
|
|
2730
|
+
for (const r of this.attributes) {
|
|
2731
|
+
const s = this.$$g_p(r.name);
|
|
2732
|
+
s in this.$$d || (this.$$d[s] = Dn(s, r.value, this.$$p_d, "toProp"));
|
|
2733
|
+
}
|
|
2734
|
+
for (const r in this.$$p_d)
|
|
2735
|
+
!(r in this.$$d) && this[r] !== void 0 && (this.$$d[r] = this[r], delete this[r]);
|
|
2736
|
+
this.$$c = ca({
|
|
2737
|
+
component: this.$$ctor,
|
|
2738
|
+
target: this.$$shadowRoot || this,
|
|
2739
|
+
props: {
|
|
2740
|
+
...this.$$d,
|
|
2741
|
+
$$slots: n,
|
|
2742
|
+
$$host: this
|
|
2743
|
+
}
|
|
2744
|
+
}), this.$$me = Dl(() => {
|
|
2745
|
+
ir(() => {
|
|
2746
|
+
this.$$r = !0;
|
|
2747
|
+
for (const r of Fn(this.$$c)) {
|
|
2748
|
+
if (!this.$$p_d[r]?.reflect) continue;
|
|
2749
|
+
this.$$d[r] = this.$$c[r];
|
|
2750
|
+
const s = Dn(
|
|
2751
|
+
r,
|
|
2752
|
+
this.$$d[r],
|
|
2753
|
+
this.$$p_d,
|
|
2754
|
+
"toAttribute"
|
|
2755
|
+
);
|
|
2756
|
+
s == null ? this.removeAttribute(this.$$p_d[r].attribute || r) : this.setAttribute(this.$$p_d[r].attribute || r, s);
|
|
2757
|
+
}
|
|
2758
|
+
this.$$r = !1;
|
|
2759
|
+
});
|
|
2760
|
+
});
|
|
2761
|
+
for (const r in this.$$l)
|
|
2762
|
+
for (const s of this.$$l[r]) {
|
|
2763
|
+
const l = this.$$c.$on(r, s);
|
|
2764
|
+
this.$$l_u.set(s, l);
|
|
2765
|
+
}
|
|
2766
|
+
this.$$l = {};
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
// We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
|
|
2770
|
+
// and setting attributes through setAttribute etc, this is helpful
|
|
2771
|
+
/**
|
|
2772
|
+
* @param {string} attr
|
|
2773
|
+
* @param {string} _oldValue
|
|
2774
|
+
* @param {string} newValue
|
|
2775
|
+
*/
|
|
2776
|
+
attributeChangedCallback(t, n, i) {
|
|
2777
|
+
this.$$r || (t = this.$$g_p(t), this.$$d[t] = Dn(t, i, this.$$p_d, "toProp"), this.$$c?.$set({ [t]: this.$$d[t] }));
|
|
2778
|
+
}
|
|
2779
|
+
disconnectedCallback() {
|
|
2780
|
+
this.$$cn = !1, Promise.resolve().then(() => {
|
|
2781
|
+
!this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0);
|
|
2782
|
+
});
|
|
2783
|
+
}
|
|
2784
|
+
/**
|
|
2785
|
+
* @param {string} attribute_name
|
|
2786
|
+
*/
|
|
2787
|
+
$$g_p(t) {
|
|
2788
|
+
return Fn(this.$$p_d).find(
|
|
2789
|
+
(n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t
|
|
2790
|
+
) || t;
|
|
2791
|
+
}
|
|
2792
|
+
});
|
|
2793
|
+
function Dn(e, t, n, i) {
|
|
2794
|
+
const r = n[e]?.type;
|
|
2795
|
+
if (t = r === "Boolean" && typeof t != "boolean" ? t != null : t, !i || !n[e])
|
|
2796
|
+
return t;
|
|
2797
|
+
if (i === "toAttribute")
|
|
2798
|
+
switch (r) {
|
|
2799
|
+
case "Object":
|
|
2800
|
+
case "Array":
|
|
2801
|
+
return t == null ? null : JSON.stringify(t);
|
|
2802
|
+
case "Boolean":
|
|
2803
|
+
return t ? "" : null;
|
|
2804
|
+
case "Number":
|
|
2805
|
+
return t ?? null;
|
|
2806
|
+
default:
|
|
2807
|
+
return t;
|
|
2808
|
+
}
|
|
2809
|
+
else
|
|
2810
|
+
switch (r) {
|
|
2811
|
+
case "Object":
|
|
2812
|
+
case "Array":
|
|
2813
|
+
return t && JSON.parse(t);
|
|
2814
|
+
case "Boolean":
|
|
2815
|
+
return t;
|
|
2816
|
+
// conversion already handled above
|
|
2817
|
+
case "Number":
|
|
2818
|
+
return t != null ? +t : t;
|
|
2819
|
+
default:
|
|
2820
|
+
return t;
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
function ha(e) {
|
|
2824
|
+
const t = {};
|
|
2825
|
+
return e.childNodes.forEach((n) => {
|
|
2826
|
+
t[
|
|
2827
|
+
/** @type {Element} node */
|
|
2828
|
+
n.slot || "default"
|
|
2829
|
+
] = !0;
|
|
2830
|
+
}), t;
|
|
2831
|
+
}
|
|
2832
|
+
function Dr(e, t, n, i, r, s) {
|
|
2833
|
+
let l = class extends ps {
|
|
2834
|
+
constructor() {
|
|
2835
|
+
super(e, n, r), this.$$p_d = t;
|
|
2836
|
+
}
|
|
2837
|
+
static get observedAttributes() {
|
|
2838
|
+
return Fn(t).map(
|
|
2839
|
+
(a) => (t[a].attribute || a).toLowerCase()
|
|
2840
|
+
);
|
|
2841
|
+
}
|
|
2842
|
+
};
|
|
2843
|
+
return Fn(t).forEach((a) => {
|
|
2844
|
+
jn(l.prototype, a, {
|
|
2845
|
+
get() {
|
|
2846
|
+
return this.$$c && a in this.$$c ? this.$$c[a] : this.$$d[a];
|
|
2847
|
+
},
|
|
2848
|
+
set(o) {
|
|
2849
|
+
o = Dn(a, o, t), this.$$d[a] = o;
|
|
2850
|
+
var c = this.$$c;
|
|
2851
|
+
if (c) {
|
|
2852
|
+
var d = Ht(c, a)?.get;
|
|
2853
|
+
d ? c[a] = o : c.$set({ [a]: o });
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
});
|
|
2857
|
+
}), i.forEach((a) => {
|
|
2858
|
+
jn(l.prototype, a, {
|
|
2859
|
+
get() {
|
|
2860
|
+
return this.$$c?.[a];
|
|
2861
|
+
}
|
|
2862
|
+
});
|
|
2863
|
+
}), e.element = /** @type {any} */
|
|
2864
|
+
l, l;
|
|
2865
|
+
}
|
|
2866
|
+
var ui;
|
|
2867
|
+
(function(e) {
|
|
2868
|
+
e.TTS_WORD = "tts-word", e.TTS_SENTENCE = "tts-sentence", e.ANNOTATION = "annotation";
|
|
2869
|
+
})(ui || (ui = {}));
|
|
2870
|
+
var ci;
|
|
2871
|
+
(function(e) {
|
|
2872
|
+
e.YELLOW = "yellow", e.GREEN = "green", e.BLUE = "blue", e.PINK = "pink", e.ORANGE = "orange";
|
|
2873
|
+
})(ci || (ci = {}));
|
|
2874
|
+
const va = {
|
|
2875
|
+
// Standard QTI 3.0 PNP supports
|
|
2876
|
+
textToSpeech: "pie-tool-text-to-speech",
|
|
2877
|
+
calculator: "pie-tool-calculator",
|
|
2878
|
+
ruler: "pie-tool-ruler",
|
|
2879
|
+
protractor: "pie-tool-protractor",
|
|
2880
|
+
highlighter: "pie-tool-annotation-toolbar",
|
|
2881
|
+
lineReader: "pie-tool-line-reader",
|
|
2882
|
+
magnifier: "pie-tool-magnifier",
|
|
2883
|
+
colorContrast: "pie-theme-contrast",
|
|
2884
|
+
answerMasking: "pie-tool-answer-eliminator",
|
|
2885
|
+
dictionaryLookup: "pie-tool-dictionary",
|
|
2886
|
+
// Common extensions (not in QTI standard but widely used)
|
|
2887
|
+
graphingCalculator: "pie-tool-calculator",
|
|
2888
|
+
scientificCalculator: "pie-tool-calculator",
|
|
2889
|
+
basicCalculator: "pie-tool-calculator"
|
|
2890
|
+
};
|
|
2891
|
+
Object.fromEntries(Object.entries(va).map(([e, t]) => [t, e]));
|
|
2892
|
+
var Gn;
|
|
2893
|
+
(function(e) {
|
|
2894
|
+
e[e.BASE = 0] = "BASE", e[e.TOOL = 1e3] = "TOOL", e[e.MODAL = 2e3] = "MODAL", e[e.CONTROL = 3e3] = "CONTROL", e[e.HIGHLIGHT = 4e3] = "HIGHLIGHT";
|
|
2895
|
+
})(Gn || (Gn = {}));
|
|
2896
|
+
var di;
|
|
2897
|
+
(function(e) {
|
|
2898
|
+
e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
|
|
2899
|
+
})(di || (di = {}));
|
|
2900
|
+
var pa = /* @__PURE__ */ xn('<button type="button" class="btn btn-ghost btn-sm btn-circle"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"></path><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></button>');
|
|
2901
|
+
function _s(e, t) {
|
|
2902
|
+
Zn(t, !0);
|
|
2903
|
+
let n = Me(t, "buttonEl", 7, null), i = Me(t, "onClick"), r = Me(t, "ariaLabel", 7, "Settings"), s = Me(t, "active", 7, !1);
|
|
2904
|
+
var l = {
|
|
2905
|
+
get buttonEl() {
|
|
2906
|
+
return n();
|
|
2907
|
+
},
|
|
2908
|
+
set buttonEl(o = null) {
|
|
2909
|
+
n(o), pe();
|
|
2910
|
+
},
|
|
2911
|
+
get onClick() {
|
|
2912
|
+
return i();
|
|
2913
|
+
},
|
|
2914
|
+
set onClick(o) {
|
|
2915
|
+
i(o), pe();
|
|
2916
|
+
},
|
|
2917
|
+
get ariaLabel() {
|
|
2918
|
+
return r();
|
|
2919
|
+
},
|
|
2920
|
+
set ariaLabel(o = "Settings") {
|
|
2921
|
+
r(o), pe();
|
|
2922
|
+
},
|
|
2923
|
+
get active() {
|
|
2924
|
+
return s();
|
|
2925
|
+
},
|
|
2926
|
+
set active(o = !1) {
|
|
2927
|
+
s(o), pe();
|
|
2928
|
+
}
|
|
2929
|
+
}, a = pa();
|
|
2930
|
+
return a.__click = function(...o) {
|
|
2931
|
+
i()?.apply(this, o);
|
|
2932
|
+
}, pn(a, (o) => n(o), () => n()), Se(() => {
|
|
2933
|
+
R(a, "aria-label", r()), R(a, "aria-pressed", s());
|
|
2934
|
+
}), D(e, a), er(l);
|
|
2935
|
+
}
|
|
2936
|
+
Pr(["click"]);
|
|
2937
|
+
Dr(_s, { buttonEl: {}, onClick: {}, ariaLabel: {}, active: {} }, [], [], { mode: "open" });
|
|
2938
|
+
var _a = /* @__PURE__ */ xn('<div class="fixed inset-0" aria-hidden="true" style="z-index: 4000;"></div> <div class="tool-settings-panel fixed w-80 rounded-box bg-base-100 shadow p-3 text-base-content" role="dialog" tabindex="-1"><div class="flex items-center justify-between gap-2 mb-2"><h2 class="font-semibold text-sm"> </h2> <button type="button" class="btn btn-ghost btn-xs" aria-label="Close settings">Close</button></div> <div class="text-sm"><!></div></div>', 1);
|
|
2939
|
+
function gs(e, t) {
|
|
2940
|
+
Zn(t, !0);
|
|
2941
|
+
let n = Me(t, "open"), i = Me(t, "title", 7, "Settings"), r = Me(t, "onClose"), s = Me(t, "anchorEl", 7, null), l = /* @__PURE__ */ I(null), a = /* @__PURE__ */ I(null);
|
|
2942
|
+
function o(p) {
|
|
2943
|
+
p.key === "Escape" && r()();
|
|
2944
|
+
}
|
|
2945
|
+
Bt(() => {
|
|
2946
|
+
n() && queueMicrotask(() => f(l)?.focus?.());
|
|
2947
|
+
}), Bt(() => {
|
|
2948
|
+
if (n() && s()) {
|
|
2949
|
+
const p = s().getBoundingClientRect(), g = 320, x = 8, v = p.right + x;
|
|
2950
|
+
v + g <= window.innerWidth ? w(a, { top: p.top, left: v }, !0) : w(
|
|
2951
|
+
a,
|
|
2952
|
+
{
|
|
2953
|
+
top: p.top,
|
|
2954
|
+
right: window.innerWidth - p.left + x
|
|
2955
|
+
},
|
|
2956
|
+
!0
|
|
2957
|
+
);
|
|
2958
|
+
} else
|
|
2959
|
+
w(a, null);
|
|
2960
|
+
}), vs(() => {
|
|
2961
|
+
const p = (g) => {
|
|
2962
|
+
if (!n()) return;
|
|
2963
|
+
const x = g.target;
|
|
2964
|
+
x && (f(l)?.contains(x) || s()?.contains(x) || r()());
|
|
2965
|
+
};
|
|
2966
|
+
return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
|
|
2967
|
+
});
|
|
2968
|
+
var c = {
|
|
2969
|
+
get open() {
|
|
2970
|
+
return n();
|
|
2971
|
+
},
|
|
2972
|
+
set open(p) {
|
|
2973
|
+
n(p), pe();
|
|
2974
|
+
},
|
|
2975
|
+
get title() {
|
|
2976
|
+
return i();
|
|
2977
|
+
},
|
|
2978
|
+
set title(p = "Settings") {
|
|
2979
|
+
i(p), pe();
|
|
2980
|
+
},
|
|
2981
|
+
get onClose() {
|
|
2982
|
+
return r();
|
|
2983
|
+
},
|
|
2984
|
+
set onClose(p) {
|
|
2985
|
+
r(p), pe();
|
|
2986
|
+
},
|
|
2987
|
+
get anchorEl() {
|
|
2988
|
+
return s();
|
|
2989
|
+
},
|
|
2990
|
+
set anchorEl(p = null) {
|
|
2991
|
+
s(p), pe();
|
|
2992
|
+
}
|
|
2993
|
+
}, d = Et(), _ = Ue(d);
|
|
2994
|
+
{
|
|
2995
|
+
var h = (p) => {
|
|
2996
|
+
var g = _a(), x = Ue(g);
|
|
2997
|
+
x.__mousedown = function(...F) {
|
|
2998
|
+
r()?.apply(this, F);
|
|
2999
|
+
};
|
|
3000
|
+
var v = X(x, 2);
|
|
3001
|
+
v.__keydown = o;
|
|
3002
|
+
var b = Z(v), te = Z(b), se = Z(te, !0);
|
|
3003
|
+
H(te);
|
|
3004
|
+
var P = X(te, 2);
|
|
3005
|
+
P.__click = function(...F) {
|
|
3006
|
+
r()?.apply(this, F);
|
|
3007
|
+
}, H(b);
|
|
3008
|
+
var q = X(b, 2), J = Z(q);
|
|
3009
|
+
ra(J, t, "default", {}), H(q), H(v), pn(v, (F) => w(l, F), () => f(l)), Se(() => {
|
|
3010
|
+
R(v, "aria-label", i()), Sr(v, `z-index: 4100; ${f(a) ? `top: ${f(a).top}px; ${f(a).left !== void 0 ? `left: ${f(a).left}px;` : `right: ${f(a).right}px;`}` : "top: 4rem; right: 1rem;"}`), cs(se, i());
|
|
3011
|
+
}), D(p, g);
|
|
3012
|
+
};
|
|
3013
|
+
qe(_, (p) => {
|
|
3014
|
+
n() && p(h);
|
|
3015
|
+
});
|
|
3016
|
+
}
|
|
3017
|
+
return D(e, d), er(c);
|
|
3018
|
+
}
|
|
3019
|
+
Pr(["mousedown", "keydown", "click"]);
|
|
3020
|
+
Dr(gs, { open: {}, title: {}, onClose: {}, anchorEl: {} }, ["default"], [], { mode: "open" });
|
|
3021
|
+
var ga = /* @__PURE__ */ Re('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"></path></svg>'), ma = /* @__PURE__ */ Re('<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'), wa = /* @__PURE__ */ Re('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>'), ba = /* @__PURE__ */ Re('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg>'), ya = /* @__PURE__ */ xn('<button type="button"><span class="tool-icon svelte-7afz7f" aria-hidden="true"><!></span> <span class="tool-label svelte-7afz7f"> </span></button>'), Ea = /* @__PURE__ */ Re('<line x1="0" class="grid-line grid-line-minor svelte-7afz7f"></line>'), $a = /* @__PURE__ */ Re('<line x1="0" class="grid-line grid-line-major svelte-7afz7f"></line>'), xa = /* @__PURE__ */ Re('<line y1="0" y2="100" class="grid-line grid-line-minor svelte-7afz7f"></line>'), ka = /* @__PURE__ */ Re('<line y1="0" y2="100" class="grid-line grid-line-major svelte-7afz7f"></line>'), Ta = /* @__PURE__ */ Re('<line class="user-line svelte-7afz7f"></line>'), Sa = /* @__PURE__ */ Re('<circle r="2"></circle>'), Ca = /* @__PURE__ */ Re('<line class="temp-line svelte-7afz7f"></line>'), Aa = /* @__PURE__ */ xn('<fieldset class="setting-group svelte-7afz7f"><legend class="svelte-7afz7f">Canvas</legend> <label><span class="setting-label svelte-7afz7f">Grid Opacity</span> <input type="range" min="0" max="1" step="0.1" aria-label="Grid opacity"/></label></fieldset>'), Oa = /* @__PURE__ */ xn('<div class="graph-tool-container svelte-7afz7f" role="dialog" tabindex="-1" aria-label="Graph Tool - Draw points and lines on a coordinate grid"><div class="graph-header svelte-7afz7f"><h3 id="graph-tool-title" class="graph-title svelte-7afz7f">Graph Tool</h3> <div class="header-controls svelte-7afz7f"><!></div></div> <div class="graph-toolbar svelte-7afz7f"><div class="tool-buttons svelte-7afz7f"></div> <div class="transparency-control svelte-7afz7f"><label for="grid-opacity" class="svelte-7afz7f">Grid:</label> <input type="range" id="grid-opacity" min="0" max="1" step="0.1" aria-label="Grid opacity" class="svelte-7afz7f"/></div></div> <div class="graph-canvas-wrapper svelte-7afz7f" role="img" tabindex="0" aria-label="Graph canvas - Use tools to add points and draw lines"><svg class="graph-canvas svelte-7afz7f" preserveAspectRatio="xMinYMin meet" aria-hidden="true"><g class="grid-lines" aria-hidden="true"><!><!><!><!></g><g class="lines"></g><g class="points"></g><!></svg></div></div> <!>', 1);
|
|
3022
|
+
const Ma = {
|
|
3023
|
+
hash: "svelte-7afz7f",
|
|
3024
|
+
code: `.graph-tool-container.svelte-7afz7f {position:fixed;background:white;box-shadow:0 10px 40px rgba(0, 0, 0, 0.3);user-select:none;touch-action:none;border-radius:12px;overflow:hidden;z-index:2000; /* ZIndexLayer.MODAL */min-width:500px;display:flex;flex-direction:column;}
|
|
3025
|
+
|
|
3026
|
+
/* Header (matching production implementation: dark teal) */.graph-header.svelte-7afz7f {padding:12px 16px;background:var(--pie-primary-dark, #2c3e50); /* Dark teal-like color */color:var(--pie-white, white);display:flex;justify-content:space-between;align-items:center;cursor:move;user-select:none;border-radius:12px 12px 0 0;}.graph-title.svelte-7afz7f {font-weight:600;font-size:16px;color:var(--pie-white, white);margin:0;}.header-controls.svelte-7afz7f {display:flex;gap:8px;align-items:center;}
|
|
3027
|
+
|
|
3028
|
+
/* Toolbar (matching production implementation: lighter teal) */.graph-toolbar.svelte-7afz7f {padding:8px;background:var(--pie-primary-light, #5a7fa3); /* Lighter teal-like color */display:flex;gap:16px;align-items:center;flex-wrap:wrap;}.tool-buttons.svelte-7afz7f {display:flex;gap:4px;flex:1;}.tool-button.svelte-7afz7f {flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px 12px;background:rgba(255, 255, 255, 0.2);border:2px solid transparent;border-radius:4px;cursor:pointer;color:white;font-size:12px;transition:all 0.2s;}.tool-button.svelte-7afz7f:hover {background:rgba(255, 255, 255, 0.3);}.tool-button.active.svelte-7afz7f {background:white;color:var(--pie-primary-dark, #2c3e50);border-color:var(--pie-primary-dark, #2c3e50);}.tool-icon.svelte-7afz7f {width:20px;height:20px;display:flex;align-items:center;justify-content:center;}.tool-label.svelte-7afz7f {font-size:11px;font-weight:500;}.transparency-control.svelte-7afz7f {display:flex;align-items:center;gap:8px;color:white;font-size:12px;padding-left:8px;}.transparency-control.svelte-7afz7f label:where(.svelte-7afz7f) {font-weight:500;}.transparency-control.svelte-7afz7f input[type='range']:where(.svelte-7afz7f) {width:100px;cursor:pointer;}
|
|
3029
|
+
|
|
3030
|
+
/* Canvas wrapper */.graph-canvas-wrapper.svelte-7afz7f {flex:1;background:white;display:flex;align-items:center;justify-content:center;overflow:hidden;}.graph-canvas.svelte-7afz7f {display:block;width:100%;height:100%;}
|
|
3031
|
+
|
|
3032
|
+
/* Grid lines (matching production implementation: dark gray) */.grid-line.svelte-7afz7f {stroke:var(--pie-primary-console, #666);vector-effect:non-scaling-stroke;}.grid-line-major.svelte-7afz7f {stroke:var(--pie-primary-dark-console, #333);stroke-width:0.75;}.grid-line-minor.svelte-7afz7f {stroke:var(--pie-primary-light-console, #ccc);stroke-width:0.5;}
|
|
3033
|
+
|
|
3034
|
+
/* User drawing styles */.user-point.svelte-7afz7f {cursor:pointer;fill:var(--pie-primary, #3f51b5);stroke:var(--pie-primary-dark, #2c3e50);stroke-width:0.5;vector-effect:non-scaling-stroke;}.user-point.highlight.svelte-7afz7f {fill:var(--pie-warning, #ffc107);stroke:var(--pie-warning-dark, #ff9800);}.user-line.svelte-7afz7f {stroke:var(--pie-dark-gray, #333);stroke-linecap:round;stroke-width:1;vector-effect:non-scaling-stroke;}.temp-line.svelte-7afz7f {pointer-events:none;stroke:var(--pie-success, #4caf50);stroke-dasharray:2, 2;stroke-width:0.75;vector-effect:non-scaling-stroke;}.setting-group.svelte-7afz7f {border:1px solid var(--pie-border, #ccc);border-radius:4px;padding:12px;margin-bottom:16px;}.setting-group.svelte-7afz7f legend:where(.svelte-7afz7f) {font-weight:600;padding:0 8px;}.setting-label.svelte-7afz7f {display:block;margin-bottom:8px;font-weight:500;}`
|
|
3035
|
+
};
|
|
3036
|
+
function za(e, t) {
|
|
3037
|
+
Zn(t, !0), ia(e, Ma);
|
|
3038
|
+
let n = Me(t, "visible", 7, !1), i = Me(t, "toolId", 7, "graph"), r = Me(t, "coordinator");
|
|
3039
|
+
const s = typeof window < "u";
|
|
3040
|
+
let l = /* @__PURE__ */ I(void 0), a = /* @__PURE__ */ I(void 0), o = /* @__PURE__ */ I(void 0), c = /* @__PURE__ */ I(void 0), d = /* @__PURE__ */ I(!1), _ = /* @__PURE__ */ I(tt(s ? window.innerWidth / 2 : 400)), h = /* @__PURE__ */ I(tt(s ? window.innerHeight / 2 : 300)), p = /* @__PURE__ */ I(700), g = /* @__PURE__ */ I(
|
|
3041
|
+
550
|
|
3042
|
+
// Production implementation uses 550px height
|
|
3043
|
+
), x = /* @__PURE__ */ I("selector"), v = /* @__PURE__ */ I(tt([])), b = /* @__PURE__ */ I(tt([])), te = /* @__PURE__ */ I(1), se = /* @__PURE__ */ I(1), P = /* @__PURE__ */ I(null), q = /* @__PURE__ */ I(null), J = /* @__PURE__ */ I(null), F = /* @__PURE__ */ I(!1);
|
|
3044
|
+
const Te = 5, Ie = 5, V = 100 / Te, sn = V / Ie;
|
|
3045
|
+
let Nt = /* @__PURE__ */ I(0), kn = /* @__PURE__ */ I(0), ln = /* @__PURE__ */ fn(() => {
|
|
3046
|
+
if (f(kn) <= 0 || f(Nt) <= 0)
|
|
3047
|
+
return 100;
|
|
3048
|
+
const m = f(
|
|
3049
|
+
kn
|
|
3050
|
+
// (viewBox height is 100)
|
|
3051
|
+
) / 100, k = f(Nt) / m;
|
|
3052
|
+
return Math.max(100, k);
|
|
3053
|
+
});
|
|
3054
|
+
const ms = [
|
|
3055
|
+
{
|
|
3056
|
+
name: "selector",
|
|
3057
|
+
icon: "selector",
|
|
3058
|
+
label: "Selector",
|
|
3059
|
+
title: "Selector: Click and drag points to move them or associated lines."
|
|
3060
|
+
},
|
|
3061
|
+
{
|
|
3062
|
+
name: "point",
|
|
3063
|
+
icon: "point",
|
|
3064
|
+
label: "Point",
|
|
3065
|
+
title: "Point: Click on the grid to add points."
|
|
3066
|
+
},
|
|
3067
|
+
{
|
|
3068
|
+
name: "line",
|
|
3069
|
+
icon: "line",
|
|
3070
|
+
label: "Line",
|
|
3071
|
+
title: "Line: Click a starting point, then an ending point to draw a line."
|
|
3072
|
+
},
|
|
3073
|
+
{
|
|
3074
|
+
name: "delete",
|
|
3075
|
+
icon: "delete",
|
|
3076
|
+
label: "Delete",
|
|
3077
|
+
title: "Delete: Click on a point to delete it and any connected lines."
|
|
3078
|
+
}
|
|
3079
|
+
];
|
|
3080
|
+
function lr() {
|
|
3081
|
+
return Il(te);
|
|
3082
|
+
}
|
|
3083
|
+
function Tn(m) {
|
|
3084
|
+
if (m !== null)
|
|
3085
|
+
return f(v).find((k) => k.id === m);
|
|
3086
|
+
}
|
|
3087
|
+
function jr(m) {
|
|
3088
|
+
if (!f(o)) return null;
|
|
3089
|
+
const k = f(o).createSVGPoint();
|
|
3090
|
+
k.x = m.clientX, k.y = m.clientY;
|
|
3091
|
+
const L = f(o).getScreenCTM();
|
|
3092
|
+
if (!L) return null;
|
|
3093
|
+
try {
|
|
3094
|
+
const S = k.matrixTransform(L.inverse());
|
|
3095
|
+
return S.y = Math.max(0, Math.min(100, S.y)), S.x = Math.max(0, Math.min(f(ln), S.x)), { x: S.x, y: S.y };
|
|
3096
|
+
} catch (S) {
|
|
3097
|
+
return console.error("Error transforming point:", S), null;
|
|
3098
|
+
}
|
|
3099
|
+
}
|
|
3100
|
+
function Vr(m, k = 5) {
|
|
3101
|
+
const L = k * k;
|
|
3102
|
+
let S = null, G = 1 / 0;
|
|
3103
|
+
for (const Y of f(v)) {
|
|
3104
|
+
const le = Y.x - m.x, ft = Y.y - m.y, ut = le * le + ft * ft;
|
|
3105
|
+
ut < G && ut < L && (G = ut, S = Y);
|
|
3106
|
+
}
|
|
3107
|
+
return S;
|
|
3108
|
+
}
|
|
3109
|
+
function ws(m) {
|
|
3110
|
+
return m === f(P) || m === f(q);
|
|
3111
|
+
}
|
|
3112
|
+
let Sn = /* @__PURE__ */ fn(() => {
|
|
3113
|
+
const m = {
|
|
3114
|
+
majorVertical: [],
|
|
3115
|
+
majorHorizontal: [],
|
|
3116
|
+
minorVertical: [],
|
|
3117
|
+
minorHorizontal: []
|
|
3118
|
+
}, k = f(ln);
|
|
3119
|
+
for (let S = 0; S <= Te; S++) {
|
|
3120
|
+
const G = S * V;
|
|
3121
|
+
if (m.majorHorizontal.push(G), S < Te)
|
|
3122
|
+
for (let Y = 1; Y < Ie; Y++)
|
|
3123
|
+
m.minorHorizontal.push(G + Y * sn);
|
|
3124
|
+
}
|
|
3125
|
+
let L = 0;
|
|
3126
|
+
for (; L <= k; ) {
|
|
3127
|
+
if (m.majorVertical.push(L), L < k)
|
|
3128
|
+
for (let S = 1; S < Ie; S++) {
|
|
3129
|
+
const G = L + S * sn;
|
|
3130
|
+
if (G <= k)
|
|
3131
|
+
m.minorVertical.push(G);
|
|
3132
|
+
else
|
|
3133
|
+
break;
|
|
3134
|
+
}
|
|
3135
|
+
L += V;
|
|
3136
|
+
}
|
|
3137
|
+
return m;
|
|
3138
|
+
});
|
|
3139
|
+
function bs(m) {
|
|
3140
|
+
w(x, m, !0), w(P, null), w(q, null), w(J, null);
|
|
3141
|
+
}
|
|
3142
|
+
function Hr(m) {
|
|
3143
|
+
const k = jr(m);
|
|
3144
|
+
if (!k) return;
|
|
3145
|
+
const L = Vr(k, sn);
|
|
3146
|
+
switch (f(x)) {
|
|
3147
|
+
case "point":
|
|
3148
|
+
w(
|
|
3149
|
+
v,
|
|
3150
|
+
[
|
|
3151
|
+
...f(v),
|
|
3152
|
+
{ id: lr(), x: k.x, y: k.y }
|
|
3153
|
+
],
|
|
3154
|
+
!0
|
|
3155
|
+
);
|
|
3156
|
+
break;
|
|
3157
|
+
case "line":
|
|
3158
|
+
const S = L ?? { id: lr(), x: k.x, y: k.y };
|
|
3159
|
+
L || w(v, [...f(
|
|
3160
|
+
v
|
|
3161
|
+
// Add if it's a new location
|
|
3162
|
+
), S], !0), f(P) === null ? w(P, S.id, !0) : (f(P) !== S.id && (f(b).some((le) => le.p1Id === f(P) && le.p2Id === S.id || le.p1Id === S.id && le.p2Id === f(P)) || w(
|
|
3163
|
+
b,
|
|
3164
|
+
[
|
|
3165
|
+
...f(b),
|
|
3166
|
+
{
|
|
3167
|
+
id: lr(),
|
|
3168
|
+
p1Id: f(P),
|
|
3169
|
+
p2Id: S.id
|
|
3170
|
+
}
|
|
3171
|
+
],
|
|
3172
|
+
!0
|
|
3173
|
+
)), w(P, null), w(J, null));
|
|
3174
|
+
break;
|
|
3175
|
+
case "delete":
|
|
3176
|
+
const G = Vr(k, 2);
|
|
3177
|
+
G && (w(v, f(v).filter((Y) => Y.id !== G.id), !0), w(b, f(b).filter((Y) => Y.p1Id !== G.id && Y.p2Id !== G.id), !0));
|
|
3178
|
+
break;
|
|
3179
|
+
case "selector":
|
|
3180
|
+
w(
|
|
3181
|
+
P,
|
|
3182
|
+
null
|
|
3183
|
+
// Cancel line drawing if clicking away
|
|
3184
|
+
), w(J, null);
|
|
3185
|
+
break;
|
|
3186
|
+
}
|
|
3187
|
+
}
|
|
3188
|
+
function ys(m, k) {
|
|
3189
|
+
f(x) === "selector" && (w(q, m, !0), k.target.setPointerCapture(k.pointerId));
|
|
3190
|
+
}
|
|
3191
|
+
function Es(m) {
|
|
3192
|
+
const k = jr(m);
|
|
3193
|
+
if (k && (w(
|
|
3194
|
+
J,
|
|
3195
|
+
k,
|
|
3196
|
+
// Update for temp line drawing
|
|
3197
|
+
!0
|
|
3198
|
+
), f(q) !== null && f(x) === "selector")) {
|
|
3199
|
+
const L = Tn(f(q));
|
|
3200
|
+
L && (L.x = k.x, L.y = k.y, w(
|
|
3201
|
+
v,
|
|
3202
|
+
// Trigger reactivity
|
|
3203
|
+
f(v),
|
|
3204
|
+
!0
|
|
3205
|
+
));
|
|
3206
|
+
}
|
|
3207
|
+
}
|
|
3208
|
+
function Br(m) {
|
|
3209
|
+
f(q) !== null && (m.target?.hasPointerCapture(m.pointerId) && m.target.releasePointerCapture(m.pointerId), w(q, null)), (f(x) !== "line" || f(P) === null) && w(J, null);
|
|
3210
|
+
}
|
|
3211
|
+
function $s() {
|
|
3212
|
+
w(d, !f(d));
|
|
3213
|
+
}
|
|
3214
|
+
function xs() {
|
|
3215
|
+
w(d, !1);
|
|
3216
|
+
}
|
|
3217
|
+
function ks(m) {
|
|
3218
|
+
const k = m.target;
|
|
3219
|
+
if (k.closest(".graph-header") && !k.closest(".tool-settings-button") && f(l)) {
|
|
3220
|
+
let G = function(le) {
|
|
3221
|
+
let ft = le.clientX - L, ut = le.clientY - S;
|
|
3222
|
+
const an = (f(l)?.offsetWidth || f(p)) / 2, ct = (f(l)?.offsetHeight || f(g)) / 2;
|
|
3223
|
+
w(_, Math.max(an, Math.min(ft, window.innerWidth - an)), !0), w(h, Math.max(ct, Math.min(ut, window.innerHeight - ct)), !0);
|
|
3224
|
+
}, Y = function() {
|
|
3225
|
+
f(l) && f(l).releasePointerCapture(m.pointerId), f(l)?.removeEventListener("pointermove", G), f(l)?.removeEventListener("pointerup", Y);
|
|
3226
|
+
};
|
|
3227
|
+
f(l).setPointerCapture(m.pointerId);
|
|
3228
|
+
const L = m.clientX - f(_), S = m.clientY - f(h);
|
|
3229
|
+
f(l).addEventListener("pointermove", G), f(l).addEventListener("pointerup", Y), r()?.bringToFront(f(l));
|
|
3230
|
+
}
|
|
3231
|
+
}
|
|
3232
|
+
let ot = null;
|
|
3233
|
+
Bt(() => {
|
|
3234
|
+
if (f(a))
|
|
3235
|
+
return ot || (ot = new ResizeObserver((m) => {
|
|
3236
|
+
const k = m[0], { width: L, height: S } = k.contentRect;
|
|
3237
|
+
(Math.abs(f(Nt) - L) > 0.1 || Math.abs(f(kn) - S) > 0.1) && (w(Nt, L, !0), w(kn, S, !0));
|
|
3238
|
+
})), ot.observe(f(a)), () => {
|
|
3239
|
+
ot && ot.disconnect();
|
|
3240
|
+
};
|
|
3241
|
+
}), Bt(() => {
|
|
3242
|
+
r() && i() && !f(F) && (f(l) ? r().registerTool(i(), "Graph Tool", f(l), Gn.MODAL) : r().registerTool(i(), "Graph Tool", void 0, Gn.MODAL), w(F, !0));
|
|
3243
|
+
}), Bt(() => {
|
|
3244
|
+
r() && f(l) && i() && (r().updateToolElement(i(), f(l)), r().bringToFront(f(l)));
|
|
3245
|
+
}), vs(() => () => {
|
|
3246
|
+
ot && (ot.disconnect(), ot = null), r() && i() && r().unregisterTool(i());
|
|
3247
|
+
});
|
|
3248
|
+
var Ts = {
|
|
3249
|
+
get visible() {
|
|
3250
|
+
return n();
|
|
3251
|
+
},
|
|
3252
|
+
set visible(m = !1) {
|
|
3253
|
+
n(m), pe();
|
|
3254
|
+
},
|
|
3255
|
+
get toolId() {
|
|
3256
|
+
return i();
|
|
3257
|
+
},
|
|
3258
|
+
set toolId(m = "graph") {
|
|
3259
|
+
i(m), pe();
|
|
3260
|
+
},
|
|
3261
|
+
get coordinator() {
|
|
3262
|
+
return r();
|
|
3263
|
+
},
|
|
3264
|
+
set coordinator(m) {
|
|
3265
|
+
r(m), pe();
|
|
3266
|
+
}
|
|
3267
|
+
}, Gr = Et(), Ss = Ue(Gr);
|
|
3268
|
+
{
|
|
3269
|
+
var Cs = (m) => {
|
|
3270
|
+
var k = Oa(), L = Ue(k);
|
|
3271
|
+
L.__pointerdown = ks;
|
|
3272
|
+
var S = Z(L), G = X(Z(S), 2), Y = Z(G);
|
|
3273
|
+
_s(Y, {
|
|
3274
|
+
onClick: $s,
|
|
3275
|
+
ariaLabel: "Graph tool settings",
|
|
3276
|
+
get active() {
|
|
3277
|
+
return f(d);
|
|
3278
|
+
},
|
|
3279
|
+
get buttonEl() {
|
|
3280
|
+
return f(c);
|
|
3281
|
+
},
|
|
3282
|
+
set buttonEl($) {
|
|
3283
|
+
w(c, $, !0);
|
|
3284
|
+
}
|
|
3285
|
+
}), H(G), H(S);
|
|
3286
|
+
var le = X(S, 2), ft = Z(le);
|
|
3287
|
+
yt(ft, 21, () => ms, ($) => $.name, ($, C) => {
|
|
3288
|
+
var y = ya();
|
|
3289
|
+
let ae;
|
|
3290
|
+
y.__click = () => bs(f(C).name);
|
|
3291
|
+
var ne = Z(y), Ge = Z(ne);
|
|
3292
|
+
{
|
|
3293
|
+
var We = (Pt) => {
|
|
3294
|
+
var An = ga();
|
|
3295
|
+
D(Pt, An);
|
|
3296
|
+
}, on = (Pt) => {
|
|
3297
|
+
var An = Et(), Is = Ue(An);
|
|
3298
|
+
{
|
|
3299
|
+
var Ls = (Dt) => {
|
|
3300
|
+
var On = ma();
|
|
3301
|
+
D(Dt, On);
|
|
3302
|
+
}, Ns = (Dt) => {
|
|
3303
|
+
var On = Et(), Ps = Ue(On);
|
|
3304
|
+
{
|
|
3305
|
+
var Ds = (Ft) => {
|
|
3306
|
+
var Mn = wa();
|
|
3307
|
+
D(Ft, Mn);
|
|
3308
|
+
}, Fs = (Ft) => {
|
|
3309
|
+
var Mn = Et(), js = Ue(Mn);
|
|
3310
|
+
{
|
|
3311
|
+
var Vs = (fr) => {
|
|
3312
|
+
var Hs = ba();
|
|
3313
|
+
D(fr, Hs);
|
|
3314
|
+
};
|
|
3315
|
+
qe(
|
|
3316
|
+
js,
|
|
3317
|
+
(fr) => {
|
|
3318
|
+
f(C).name === "delete" && fr(Vs);
|
|
3319
|
+
},
|
|
3320
|
+
!0
|
|
3321
|
+
);
|
|
3322
|
+
}
|
|
3323
|
+
D(Ft, Mn);
|
|
3324
|
+
};
|
|
3325
|
+
qe(
|
|
3326
|
+
Ps,
|
|
3327
|
+
(Ft) => {
|
|
3328
|
+
f(C).name === "line" ? Ft(Ds) : Ft(Fs, !1);
|
|
3329
|
+
},
|
|
3330
|
+
!0
|
|
3331
|
+
);
|
|
3332
|
+
}
|
|
3333
|
+
D(Dt, On);
|
|
3334
|
+
};
|
|
3335
|
+
qe(
|
|
3336
|
+
Is,
|
|
3337
|
+
(Dt) => {
|
|
3338
|
+
f(C).name === "point" ? Dt(Ls) : Dt(Ns, !1);
|
|
3339
|
+
},
|
|
3340
|
+
!0
|
|
3341
|
+
);
|
|
3342
|
+
}
|
|
3343
|
+
D(Pt, An);
|
|
3344
|
+
};
|
|
3345
|
+
qe(Ge, (Pt) => {
|
|
3346
|
+
f(C).name === "selector" ? Pt(We) : Pt(on, !1);
|
|
3347
|
+
});
|
|
3348
|
+
}
|
|
3349
|
+
H(ne);
|
|
3350
|
+
var dt = X(ne, 2), Rs = Z(dt, !0);
|
|
3351
|
+
H(dt), H(y), Se(() => {
|
|
3352
|
+
ae = si(y, 1, "tool-button svelte-7afz7f", null, ae, { active: f(x) === f(C).name }), R(y, "title", f(C).title), R(y, "aria-label", f(C).title), R(y, "aria-pressed", f(x) === f(C).name), cs(Rs, f(C).label);
|
|
3353
|
+
}), D($, y);
|
|
3354
|
+
}), H(ft);
|
|
3355
|
+
var ut = X(ft, 2), an = X(Z(ut), 2);
|
|
3356
|
+
li(an), H(ut), H(le);
|
|
3357
|
+
var ct = X(le, 2);
|
|
3358
|
+
ct.__click = Hr, ct.__keydown = ($) => {
|
|
3359
|
+
($.key === "Enter" || $.key === " ") && ($.preventDefault(), Hr($));
|
|
3360
|
+
};
|
|
3361
|
+
var bt = Z(ct);
|
|
3362
|
+
bt.__pointermove = Es, bt.__pointerup = Br;
|
|
3363
|
+
var Cn = Z(bt), Wr = Z(Cn);
|
|
3364
|
+
yt(Wr, 17, () => f(Sn).minorHorizontal, Rn, ($, C) => {
|
|
3365
|
+
var y = Ea();
|
|
3366
|
+
Se(() => {
|
|
3367
|
+
R(y, "y1", f(C)), R(y, "x2", f(ln)), R(y, "y2", f(C));
|
|
3368
|
+
}), D($, y);
|
|
3369
|
+
});
|
|
3370
|
+
var qr = X(Wr);
|
|
3371
|
+
yt(qr, 17, () => f(Sn).majorHorizontal, Rn, ($, C) => {
|
|
3372
|
+
var y = $a();
|
|
3373
|
+
Se(() => {
|
|
3374
|
+
R(y, "y1", f(C)), R(y, "x2", f(ln)), R(y, "y2", f(C));
|
|
3375
|
+
}), D($, y);
|
|
3376
|
+
});
|
|
3377
|
+
var Yr = X(qr);
|
|
3378
|
+
yt(Yr, 17, () => f(Sn).minorVertical, Rn, ($, C) => {
|
|
3379
|
+
var y = xa();
|
|
3380
|
+
Se(() => {
|
|
3381
|
+
R(y, "x1", f(C)), R(y, "x2", f(C));
|
|
3382
|
+
}), D($, y);
|
|
3383
|
+
});
|
|
3384
|
+
var As = X(Yr);
|
|
3385
|
+
yt(As, 17, () => f(Sn).majorVertical, Rn, ($, C) => {
|
|
3386
|
+
var y = ka();
|
|
3387
|
+
Se(() => {
|
|
3388
|
+
R(y, "x1", f(C)), R(y, "x2", f(C));
|
|
3389
|
+
}), D($, y);
|
|
3390
|
+
}), H(Cn);
|
|
3391
|
+
var ar = X(Cn);
|
|
3392
|
+
yt(ar, 21, () => f(b), ($) => $.id, ($, C) => {
|
|
3393
|
+
const y = /* @__PURE__ */ fn(() => Tn(f(C).p1Id)), ae = /* @__PURE__ */ fn(() => Tn(f(C).p2Id));
|
|
3394
|
+
var ne = Et(), Ge = Ue(ne);
|
|
3395
|
+
{
|
|
3396
|
+
var We = (on) => {
|
|
3397
|
+
var dt = Ta();
|
|
3398
|
+
Se(() => {
|
|
3399
|
+
R(dt, "x1", f(y).x), R(dt, "y1", f(y).y), R(dt, "x2", f(ae).x), R(dt, "y2", f(ae).y);
|
|
3400
|
+
}), D(on, dt);
|
|
3401
|
+
};
|
|
3402
|
+
qe(Ge, (on) => {
|
|
3403
|
+
f(y) && f(ae) && on(We);
|
|
3404
|
+
});
|
|
3405
|
+
}
|
|
3406
|
+
D($, ne);
|
|
3407
|
+
}), H(ar);
|
|
3408
|
+
var or = X(ar);
|
|
3409
|
+
yt(or, 21, () => f(v), ($) => $.id, ($, C) => {
|
|
3410
|
+
var y = Sa();
|
|
3411
|
+
let ae;
|
|
3412
|
+
y.__pointerdown = (ne) => {
|
|
3413
|
+
ne.stopPropagation(), ys(f(C).id, ne);
|
|
3414
|
+
}, Se(
|
|
3415
|
+
(ne) => {
|
|
3416
|
+
R(y, "cx", f(C).x), R(y, "cy", f(C).y), ae = si(y, 0, "user-point svelte-7afz7f", null, ae, ne), R(y, "data-id", f(C).id);
|
|
3417
|
+
},
|
|
3418
|
+
[() => ({ highlight: ws(f(C).id) })]
|
|
3419
|
+
), D($, y);
|
|
3420
|
+
}), H(or);
|
|
3421
|
+
var Os = X(or);
|
|
3422
|
+
{
|
|
3423
|
+
var Ms = ($) => {
|
|
3424
|
+
const C = /* @__PURE__ */ fn(() => Tn(f(P)));
|
|
3425
|
+
var y = Et(), ae = Ue(y);
|
|
3426
|
+
{
|
|
3427
|
+
var ne = (Ge) => {
|
|
3428
|
+
var We = Ca();
|
|
3429
|
+
Se(() => {
|
|
3430
|
+
R(We, "x1", f(C).x), R(We, "y1", f(C).y), R(We, "x2", f(J).x), R(We, "y2", f(J).y);
|
|
3431
|
+
}), D(Ge, We);
|
|
3432
|
+
};
|
|
3433
|
+
qe(ae, (Ge) => {
|
|
3434
|
+
f(C) && Ge(ne);
|
|
3435
|
+
});
|
|
3436
|
+
}
|
|
3437
|
+
D($, y);
|
|
3438
|
+
};
|
|
3439
|
+
qe(Os, ($) => {
|
|
3440
|
+
f(P) && f(J) && $(Ms);
|
|
3441
|
+
});
|
|
3442
|
+
}
|
|
3443
|
+
H(bt), pn(bt, ($) => w(o, $), () => f(o)), H(ct), pn(ct, ($) => w(a, $), () => f(a)), H(L), pn(L, ($) => w(l, $), () => f(l));
|
|
3444
|
+
var zs = X(L, 2);
|
|
3445
|
+
gs(zs, {
|
|
3446
|
+
get open() {
|
|
3447
|
+
return f(d);
|
|
3448
|
+
},
|
|
3449
|
+
title: "Graph Tool Settings",
|
|
3450
|
+
onClose: xs,
|
|
3451
|
+
get anchorEl() {
|
|
3452
|
+
return f(c);
|
|
3453
|
+
},
|
|
3454
|
+
children: ($, C) => {
|
|
3455
|
+
var y = Aa(), ae = X(Z(y), 2), ne = X(Z(ae), 2);
|
|
3456
|
+
li(ne), H(ae), H(y), oi(ne, () => f(se), (Ge) => w(se, Ge)), D($, y);
|
|
3457
|
+
},
|
|
3458
|
+
$$slots: { default: !0 }
|
|
3459
|
+
}), Se(() => {
|
|
3460
|
+
Sr(L, `left: ${f(_) ?? ""}px; top: ${f(h) ?? ""}px; width: ${f(p) ?? ""}px; height: ${f(g) ?? ""}px; transform: translate(-50%, -50%);`), R(bt, "viewBox", `0 0 ${f(ln) ?? ""} 100`), Sr(Cn, `opacity: ${f(se) ?? ""}`);
|
|
3461
|
+
}), oi(an, () => f(se), ($) => w(se, $)), Yl("pointerleave", bt, Br), D(m, k);
|
|
3462
|
+
};
|
|
3463
|
+
qe(Ss, (m) => {
|
|
3464
|
+
n() && m(Cs);
|
|
3465
|
+
});
|
|
3466
|
+
}
|
|
3467
|
+
return D(e, Gr), er(Ts);
|
|
3468
|
+
}
|
|
3469
|
+
Pr([
|
|
3470
|
+
"pointerdown",
|
|
3471
|
+
"click",
|
|
3472
|
+
"keydown",
|
|
3473
|
+
"pointermove",
|
|
3474
|
+
"pointerup"
|
|
3475
|
+
]);
|
|
3476
|
+
customElements.define("pie-tool-graph", Dr(
|
|
3477
|
+
za,
|
|
3478
|
+
{
|
|
3479
|
+
visible: { attribute: "visible", type: "Boolean" },
|
|
3480
|
+
toolId: { attribute: "tool-id", type: "String" },
|
|
3481
|
+
coordinator: { type: "Object" }
|
|
3482
|
+
},
|
|
3483
|
+
[],
|
|
3484
|
+
[]
|
|
3485
|
+
));
|
|
3486
|
+
export {
|
|
3487
|
+
za as default
|
|
3488
|
+
};
|
|
3489
|
+
//# sourceMappingURL=tool-graph.js.map
|