mertani-web-toolkit 0.1.0
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/LICENSE +22 -0
- package/README.md +111 -0
- package/dist/index.es.js +1092 -0
- package/dist/index.umd.js +1 -0
- package/dist/mockServiceWorker.js +344 -0
- package/dist/vite.svg +1 -0
- package/package.json +42 -0
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,1092 @@
|
|
|
1
|
+
typeof window < "u" && ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add("5");
|
|
2
|
+
const Xt = 2, w = Symbol(), Pt = !1;
|
|
3
|
+
var te = Array.isArray, ee = Array.prototype.indexOf, xt = Object.defineProperty, ut = Object.getOwnPropertyDescriptor, ne = Object.prototype, re = Array.prototype, le = Object.getPrototypeOf;
|
|
4
|
+
function se() {
|
|
5
|
+
var t, e, n = new Promise((r, l) => {
|
|
6
|
+
t = r, e = l;
|
|
7
|
+
});
|
|
8
|
+
return { promise: n, resolve: t, reject: e };
|
|
9
|
+
}
|
|
10
|
+
const E = 2, ie = 4, fe = 8, z = 16, G = 32, Y = 64, At = 128, T = 256, Q = 512, b = 1024, O = 2048, D = 4096, X = 8192, B = 16384, Ct = 32768, kt = 1 << 17, ue = 1 << 18, dt = 1 << 19, vt = 1 << 21, pt = 1 << 22, M = 1 << 23, at = Symbol("$state"), wt = new class extends Error {
|
|
11
|
+
name = "StaleReactionError";
|
|
12
|
+
message = "The reaction that called `getAbortSignal()` was re-run or destroyed";
|
|
13
|
+
}();
|
|
14
|
+
function ae() {
|
|
15
|
+
throw new Error("https://svelte.dev/e/await_outside_boundary");
|
|
16
|
+
}
|
|
17
|
+
function oe() {
|
|
18
|
+
throw new Error("https://svelte.dev/e/async_derived_orphan");
|
|
19
|
+
}
|
|
20
|
+
function ce() {
|
|
21
|
+
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
22
|
+
}
|
|
23
|
+
function ve() {
|
|
24
|
+
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
25
|
+
}
|
|
26
|
+
function _e() {
|
|
27
|
+
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
28
|
+
}
|
|
29
|
+
function he() {
|
|
30
|
+
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
31
|
+
}
|
|
32
|
+
function Dt(t) {
|
|
33
|
+
return t === this.v;
|
|
34
|
+
}
|
|
35
|
+
let de = !1, Z = null;
|
|
36
|
+
function tt(t) {
|
|
37
|
+
Z = t;
|
|
38
|
+
}
|
|
39
|
+
function Ft() {
|
|
40
|
+
return !0;
|
|
41
|
+
}
|
|
42
|
+
const pe = /* @__PURE__ */ new WeakMap();
|
|
43
|
+
function we(t) {
|
|
44
|
+
var e = _;
|
|
45
|
+
if (e === null)
|
|
46
|
+
return v.f |= M, t;
|
|
47
|
+
if ((e.f & Ct) === 0) {
|
|
48
|
+
if ((e.f & At) === 0)
|
|
49
|
+
throw !e.parent && t instanceof Error && It(t), t;
|
|
50
|
+
e.b.error(t);
|
|
51
|
+
} else
|
|
52
|
+
gt(t, e);
|
|
53
|
+
}
|
|
54
|
+
function gt(t, e) {
|
|
55
|
+
for (; e !== null; ) {
|
|
56
|
+
if ((e.f & At) !== 0)
|
|
57
|
+
try {
|
|
58
|
+
e.b.error(t);
|
|
59
|
+
return;
|
|
60
|
+
} catch (n) {
|
|
61
|
+
t = n;
|
|
62
|
+
}
|
|
63
|
+
e = e.parent;
|
|
64
|
+
}
|
|
65
|
+
throw t instanceof Error && It(t), t;
|
|
66
|
+
}
|
|
67
|
+
function It(t) {
|
|
68
|
+
const e = pe.get(t);
|
|
69
|
+
e && (xt(t, "message", {
|
|
70
|
+
value: e.message
|
|
71
|
+
}), xt(t, "stack", {
|
|
72
|
+
value: e.stack
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
function ge() {
|
|
76
|
+
for (var t = (
|
|
77
|
+
/** @type {Effect} */
|
|
78
|
+
_.b
|
|
79
|
+
); t !== null && !t.has_pending_snippet(); )
|
|
80
|
+
t = t.parent;
|
|
81
|
+
return t === null && ae(), t;
|
|
82
|
+
}
|
|
83
|
+
// @__NO_SIDE_EFFECTS__
|
|
84
|
+
function ye(t) {
|
|
85
|
+
var e = E | O, n = v !== null && (v.f & E) !== 0 ? (
|
|
86
|
+
/** @type {Derived} */
|
|
87
|
+
v
|
|
88
|
+
) : null;
|
|
89
|
+
return _ === null || n !== null && (n.f & T) !== 0 ? e |= T : _.f |= dt, {
|
|
90
|
+
ctx: Z,
|
|
91
|
+
deps: null,
|
|
92
|
+
effects: null,
|
|
93
|
+
equals: Dt,
|
|
94
|
+
f: e,
|
|
95
|
+
fn: t,
|
|
96
|
+
reactions: null,
|
|
97
|
+
rv: 0,
|
|
98
|
+
v: (
|
|
99
|
+
/** @type {V} */
|
|
100
|
+
w
|
|
101
|
+
),
|
|
102
|
+
wv: 0,
|
|
103
|
+
parent: n ?? _,
|
|
104
|
+
ac: null
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
// @__NO_SIDE_EFFECTS__
|
|
108
|
+
function be(t, e) {
|
|
109
|
+
let n = (
|
|
110
|
+
/** @type {Effect | null} */
|
|
111
|
+
_
|
|
112
|
+
);
|
|
113
|
+
n === null && oe();
|
|
114
|
+
var r = (
|
|
115
|
+
/** @type {Boundary} */
|
|
116
|
+
n.b
|
|
117
|
+
), l = (
|
|
118
|
+
/** @type {Promise<V>} */
|
|
119
|
+
/** @type {unknown} */
|
|
120
|
+
void 0
|
|
121
|
+
), f = Ut(
|
|
122
|
+
/** @type {V} */
|
|
123
|
+
w
|
|
124
|
+
), u = null, a = !v;
|
|
125
|
+
return Ce(() => {
|
|
126
|
+
try {
|
|
127
|
+
var s = t();
|
|
128
|
+
u && Promise.resolve(s).catch(() => {
|
|
129
|
+
});
|
|
130
|
+
} catch (h) {
|
|
131
|
+
s = Promise.reject(h);
|
|
132
|
+
}
|
|
133
|
+
var i = () => s;
|
|
134
|
+
l = u?.then(i, i) ?? Promise.resolve(s), u = l;
|
|
135
|
+
var o = (
|
|
136
|
+
/** @type {Batch} */
|
|
137
|
+
g
|
|
138
|
+
), c = r.pending;
|
|
139
|
+
a && (r.update_pending_count(1), c || o.increment());
|
|
140
|
+
const p = (h, d = void 0) => {
|
|
141
|
+
u = null, c || o.activate(), d ? d !== wt && (f.f |= M, ht(f, d)) : ((f.f & M) !== 0 && (f.f ^= M), ht(f, h)), a && (r.update_pending_count(-1), c || o.decrement()), qt();
|
|
142
|
+
};
|
|
143
|
+
if (l.then(p, (h) => p(null, h || "unknown")), o)
|
|
144
|
+
return () => {
|
|
145
|
+
queueMicrotask(() => o.neuter());
|
|
146
|
+
};
|
|
147
|
+
}), new Promise((s) => {
|
|
148
|
+
function i(o) {
|
|
149
|
+
function c() {
|
|
150
|
+
o === l ? s(f) : i(l);
|
|
151
|
+
}
|
|
152
|
+
o.then(c, c);
|
|
153
|
+
}
|
|
154
|
+
i(l);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function jt(t) {
|
|
158
|
+
var e = t.effects;
|
|
159
|
+
if (e !== null) {
|
|
160
|
+
t.effects = null;
|
|
161
|
+
for (var n = 0; n < e.length; n += 1)
|
|
162
|
+
lt(
|
|
163
|
+
/** @type {Effect} */
|
|
164
|
+
e[n]
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function me(t) {
|
|
169
|
+
for (var e = t.parent; e !== null; ) {
|
|
170
|
+
if ((e.f & E) === 0)
|
|
171
|
+
return (
|
|
172
|
+
/** @type {Effect} */
|
|
173
|
+
e
|
|
174
|
+
);
|
|
175
|
+
e = e.parent;
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
function yt(t) {
|
|
180
|
+
var e, n = _;
|
|
181
|
+
V(me(t));
|
|
182
|
+
try {
|
|
183
|
+
jt(t), e = Jt(t);
|
|
184
|
+
} finally {
|
|
185
|
+
V(n);
|
|
186
|
+
}
|
|
187
|
+
return e;
|
|
188
|
+
}
|
|
189
|
+
function Mt(t) {
|
|
190
|
+
var e = yt(t);
|
|
191
|
+
if (t.equals(e) || (t.v = e, t.wv = Gt()), !J) {
|
|
192
|
+
var n = (P || (t.f & T) !== 0) && t.deps !== null ? D : b;
|
|
193
|
+
k(t, n);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function Ee(t, e, n) {
|
|
197
|
+
const r = ye;
|
|
198
|
+
if (e.length === 0) {
|
|
199
|
+
n(t.map(r));
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
var l = g, f = (
|
|
203
|
+
/** @type {Effect} */
|
|
204
|
+
_
|
|
205
|
+
), u = xe(), a = ge();
|
|
206
|
+
Promise.all(e.map((s) => /* @__PURE__ */ be(s))).then((s) => {
|
|
207
|
+
l?.activate(), u();
|
|
208
|
+
try {
|
|
209
|
+
n([...t.map(r), ...s]);
|
|
210
|
+
} catch (i) {
|
|
211
|
+
(f.f & B) === 0 && gt(i, f);
|
|
212
|
+
}
|
|
213
|
+
l?.deactivate(), qt();
|
|
214
|
+
}).catch((s) => {
|
|
215
|
+
a.error(s);
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
function xe() {
|
|
219
|
+
var t = _, e = v, n = Z, r = g;
|
|
220
|
+
return function() {
|
|
221
|
+
V(t), C(e), tt(n), r?.activate();
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function qt() {
|
|
225
|
+
V(null), C(null), tt(null);
|
|
226
|
+
}
|
|
227
|
+
const ot = /* @__PURE__ */ new Set();
|
|
228
|
+
let g = null, Tt = /* @__PURE__ */ new Set(), et = [];
|
|
229
|
+
function Lt() {
|
|
230
|
+
const t = (
|
|
231
|
+
/** @type {() => void} */
|
|
232
|
+
et.shift()
|
|
233
|
+
);
|
|
234
|
+
et.length > 0 && queueMicrotask(Lt), t();
|
|
235
|
+
}
|
|
236
|
+
let H = [], bt = null, _t = !1;
|
|
237
|
+
class W {
|
|
238
|
+
/**
|
|
239
|
+
* The current values of any sources that are updated in this batch
|
|
240
|
+
* They keys of this map are identical to `this.#previous`
|
|
241
|
+
* @type {Map<Source, any>}
|
|
242
|
+
*/
|
|
243
|
+
current = /* @__PURE__ */ new Map();
|
|
244
|
+
/**
|
|
245
|
+
* The values of any sources that are updated in this batch _before_ those updates took place.
|
|
246
|
+
* They keys of this map are identical to `this.#current`
|
|
247
|
+
* @type {Map<Source, any>}
|
|
248
|
+
*/
|
|
249
|
+
#u = /* @__PURE__ */ new Map();
|
|
250
|
+
/**
|
|
251
|
+
* When the batch is committed (and the DOM is updated), we need to remove old branches
|
|
252
|
+
* and append new ones by calling the functions added inside (if/each/key/etc) blocks
|
|
253
|
+
* @type {Set<() => void>}
|
|
254
|
+
*/
|
|
255
|
+
#l = /* @__PURE__ */ new Set();
|
|
256
|
+
/**
|
|
257
|
+
* The number of async effects that are currently in flight
|
|
258
|
+
*/
|
|
259
|
+
#t = 0;
|
|
260
|
+
/**
|
|
261
|
+
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
262
|
+
* TODO replace with Promise.withResolvers once supported widely enough
|
|
263
|
+
* @type {{ promise: Promise<void>, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}
|
|
264
|
+
*/
|
|
265
|
+
#a = null;
|
|
266
|
+
/**
|
|
267
|
+
* True if an async effect inside this batch resolved and
|
|
268
|
+
* its parent branch was already deleted
|
|
269
|
+
*/
|
|
270
|
+
#o = !1;
|
|
271
|
+
/**
|
|
272
|
+
* Async effects (created inside `async_derived`) encountered during processing.
|
|
273
|
+
* These run after the rest of the batch has updated, since they should
|
|
274
|
+
* always have the latest values
|
|
275
|
+
* @type {Effect[]}
|
|
276
|
+
*/
|
|
277
|
+
#n = [];
|
|
278
|
+
/**
|
|
279
|
+
* The same as `#async_effects`, but for effects inside a newly-created
|
|
280
|
+
* `<svelte:boundary>` — these do not prevent the batch from committing
|
|
281
|
+
* @type {Effect[]}
|
|
282
|
+
*/
|
|
283
|
+
#s = [];
|
|
284
|
+
/**
|
|
285
|
+
* Template effects and `$effect.pre` effects, which run when
|
|
286
|
+
* a batch is committed
|
|
287
|
+
* @type {Effect[]}
|
|
288
|
+
*/
|
|
289
|
+
#r = [];
|
|
290
|
+
/**
|
|
291
|
+
* The same as `#render_effects`, but for `$effect` (which runs after)
|
|
292
|
+
* @type {Effect[]}
|
|
293
|
+
*/
|
|
294
|
+
#e = [];
|
|
295
|
+
/**
|
|
296
|
+
* Block effects, which may need to re-run on subsequent flushes
|
|
297
|
+
* in order to update internal sources (e.g. each block items)
|
|
298
|
+
* @type {Effect[]}
|
|
299
|
+
*/
|
|
300
|
+
#i = [];
|
|
301
|
+
/**
|
|
302
|
+
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
303
|
+
* @type {Effect[]}
|
|
304
|
+
*/
|
|
305
|
+
#c = [];
|
|
306
|
+
/**
|
|
307
|
+
* Deferred effects that are MAYBE_DIRTY
|
|
308
|
+
* @type {Effect[]}
|
|
309
|
+
*/
|
|
310
|
+
#v = [];
|
|
311
|
+
/**
|
|
312
|
+
* A set of branches that still exist, but will be destroyed when this batch
|
|
313
|
+
* is committed — we skip over these during `process`
|
|
314
|
+
* @type {Set<Effect>}
|
|
315
|
+
*/
|
|
316
|
+
skipped_effects = /* @__PURE__ */ new Set();
|
|
317
|
+
/**
|
|
318
|
+
*
|
|
319
|
+
* @param {Effect[]} root_effects
|
|
320
|
+
*/
|
|
321
|
+
process(e) {
|
|
322
|
+
H = [];
|
|
323
|
+
for (const l of e)
|
|
324
|
+
this.#h(l);
|
|
325
|
+
if (this.#n.length === 0 && this.#t === 0) {
|
|
326
|
+
this.#_();
|
|
327
|
+
var n = this.#r, r = this.#e;
|
|
328
|
+
this.#r = [], this.#e = [], this.#i = [], g = null, Ot(n), Ot(r), g === null ? g = this : ot.delete(this), this.#a?.resolve();
|
|
329
|
+
} else
|
|
330
|
+
this.#f(this.#r), this.#f(this.#e), this.#f(this.#i);
|
|
331
|
+
for (const l of this.#n)
|
|
332
|
+
U(l);
|
|
333
|
+
for (const l of this.#s)
|
|
334
|
+
U(l);
|
|
335
|
+
this.#n = [], this.#s = [];
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Traverse the effect tree, executing effects or stashing
|
|
339
|
+
* them for later execution as appropriate
|
|
340
|
+
* @param {Effect} root
|
|
341
|
+
*/
|
|
342
|
+
#h(e) {
|
|
343
|
+
e.f ^= b;
|
|
344
|
+
for (var n = e.first; n !== null; ) {
|
|
345
|
+
var r = n.f, l = (r & (G | Y)) !== 0, f = l && (r & b) !== 0, u = f || (r & X) !== 0 || this.skipped_effects.has(n);
|
|
346
|
+
if (!u && n.fn !== null) {
|
|
347
|
+
if (l)
|
|
348
|
+
n.f ^= b;
|
|
349
|
+
else if ((r & ie) !== 0)
|
|
350
|
+
this.#e.push(n);
|
|
351
|
+
else if ((r & b) === 0)
|
|
352
|
+
if ((r & pt) !== 0) {
|
|
353
|
+
var a = n.b?.pending ? this.#s : this.#n;
|
|
354
|
+
a.push(n);
|
|
355
|
+
} else st(n) && ((n.f & z) !== 0 && this.#i.push(n), U(n));
|
|
356
|
+
var s = n.first;
|
|
357
|
+
if (s !== null) {
|
|
358
|
+
n = s;
|
|
359
|
+
continue;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
var i = n.parent;
|
|
363
|
+
for (n = n.next; n === null && i !== null; )
|
|
364
|
+
n = i.next, i = i.parent;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* @param {Effect[]} effects
|
|
369
|
+
*/
|
|
370
|
+
#f(e) {
|
|
371
|
+
for (const n of e)
|
|
372
|
+
((n.f & O) !== 0 ? this.#c : this.#v).push(n), k(n, b);
|
|
373
|
+
e.length = 0;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Associate a change to a given source with the current
|
|
377
|
+
* batch, noting its previous and current values
|
|
378
|
+
* @param {Source} source
|
|
379
|
+
* @param {any} value
|
|
380
|
+
*/
|
|
381
|
+
capture(e, n) {
|
|
382
|
+
this.#u.has(e) || this.#u.set(e, n), this.current.set(e, e.v);
|
|
383
|
+
}
|
|
384
|
+
activate() {
|
|
385
|
+
g = this;
|
|
386
|
+
}
|
|
387
|
+
deactivate() {
|
|
388
|
+
g = null;
|
|
389
|
+
for (const e of Tt)
|
|
390
|
+
if (Tt.delete(e), e(), g !== null)
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
neuter() {
|
|
394
|
+
this.#o = !0;
|
|
395
|
+
}
|
|
396
|
+
flush() {
|
|
397
|
+
H.length > 0 ? ke() : this.#_(), g === this && (this.#t === 0 && ot.delete(this), this.deactivate());
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Append and remove branches to/from the DOM
|
|
401
|
+
*/
|
|
402
|
+
#_() {
|
|
403
|
+
if (!this.#o)
|
|
404
|
+
for (const e of this.#l)
|
|
405
|
+
e();
|
|
406
|
+
this.#l.clear();
|
|
407
|
+
}
|
|
408
|
+
increment() {
|
|
409
|
+
this.#t += 1;
|
|
410
|
+
}
|
|
411
|
+
decrement() {
|
|
412
|
+
if (this.#t -= 1, this.#t === 0) {
|
|
413
|
+
for (const e of this.#c)
|
|
414
|
+
k(e, O), nt(e);
|
|
415
|
+
for (const e of this.#v)
|
|
416
|
+
k(e, D), nt(e);
|
|
417
|
+
this.#r = [], this.#e = [], this.flush();
|
|
418
|
+
} else
|
|
419
|
+
this.deactivate();
|
|
420
|
+
}
|
|
421
|
+
/** @param {() => void} fn */
|
|
422
|
+
add_callback(e) {
|
|
423
|
+
this.#l.add(e);
|
|
424
|
+
}
|
|
425
|
+
settled() {
|
|
426
|
+
return (this.#a ??= se()).promise;
|
|
427
|
+
}
|
|
428
|
+
static ensure() {
|
|
429
|
+
if (g === null) {
|
|
430
|
+
const e = g = new W();
|
|
431
|
+
ot.add(g), W.enqueue(() => {
|
|
432
|
+
g === e && e.flush();
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
return g;
|
|
436
|
+
}
|
|
437
|
+
/** @param {() => void} task */
|
|
438
|
+
static enqueue(e) {
|
|
439
|
+
et.length === 0 && queueMicrotask(Lt), et.unshift(e);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
function ke() {
|
|
443
|
+
var t = L;
|
|
444
|
+
_t = !0;
|
|
445
|
+
try {
|
|
446
|
+
var e = 0;
|
|
447
|
+
for (St(!0); H.length > 0; ) {
|
|
448
|
+
var n = W.ensure();
|
|
449
|
+
if (e++ > 1e3) {
|
|
450
|
+
var r, l;
|
|
451
|
+
Te();
|
|
452
|
+
}
|
|
453
|
+
n.process(H), A.clear();
|
|
454
|
+
}
|
|
455
|
+
} finally {
|
|
456
|
+
_t = !1, St(t), bt = null;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
function Te() {
|
|
460
|
+
try {
|
|
461
|
+
ce();
|
|
462
|
+
} catch (t) {
|
|
463
|
+
gt(t, bt);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
let F = null;
|
|
467
|
+
function Ot(t) {
|
|
468
|
+
var e = t.length;
|
|
469
|
+
if (e !== 0) {
|
|
470
|
+
for (var n = 0; n < e; ) {
|
|
471
|
+
var r = t[n++];
|
|
472
|
+
if ((r.f & (B | X)) === 0 && st(r) && (F = [], U(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null && r.ac === null ? $t(r) : r.fn = null), F?.length > 0)) {
|
|
473
|
+
A.clear();
|
|
474
|
+
for (const l of F)
|
|
475
|
+
U(l);
|
|
476
|
+
F = [];
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
F = null;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
function nt(t) {
|
|
483
|
+
for (var e = bt = t; e.parent !== null; ) {
|
|
484
|
+
e = e.parent;
|
|
485
|
+
var n = e.f;
|
|
486
|
+
if (_t && e === _ && (n & z) !== 0)
|
|
487
|
+
return;
|
|
488
|
+
if ((n & (Y | G)) !== 0) {
|
|
489
|
+
if ((n & b) === 0) return;
|
|
490
|
+
e.f ^= b;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
H.push(e);
|
|
494
|
+
}
|
|
495
|
+
const A = /* @__PURE__ */ new Map();
|
|
496
|
+
function Ut(t, e) {
|
|
497
|
+
var n = {
|
|
498
|
+
f: 0,
|
|
499
|
+
// TODO ideally we could skip this altogether, but it causes type errors
|
|
500
|
+
v: t,
|
|
501
|
+
reactions: null,
|
|
502
|
+
equals: Dt,
|
|
503
|
+
rv: 0,
|
|
504
|
+
wv: 0
|
|
505
|
+
};
|
|
506
|
+
return n;
|
|
507
|
+
}
|
|
508
|
+
// @__NO_SIDE_EFFECTS__
|
|
509
|
+
function S(t, e) {
|
|
510
|
+
const n = Ut(t);
|
|
511
|
+
return je(n), n;
|
|
512
|
+
}
|
|
513
|
+
function N(t, e, n = !1) {
|
|
514
|
+
v !== null && // since we are untracking the function inside `$inspect.with` we need to add this check
|
|
515
|
+
// to ensure we error if state is set inside an inspect effect
|
|
516
|
+
(!I || (v.f & kt) !== 0) && Ft() && (v.f & (E | z | pt | kt)) !== 0 && !R?.includes(t) && he();
|
|
517
|
+
let r = n ? K(e) : e;
|
|
518
|
+
return ht(t, r);
|
|
519
|
+
}
|
|
520
|
+
function ht(t, e) {
|
|
521
|
+
if (!t.equals(e)) {
|
|
522
|
+
var n = t.v;
|
|
523
|
+
J ? A.set(t, e) : A.set(t, n), t.v = e;
|
|
524
|
+
var r = W.ensure();
|
|
525
|
+
r.capture(t, n), (t.f & E) !== 0 && ((t.f & O) !== 0 && yt(
|
|
526
|
+
/** @type {Derived} */
|
|
527
|
+
t
|
|
528
|
+
), k(t, (t.f & T) === 0 ? b : D)), t.wv = Gt(), Vt(t, O), _ !== null && (_.f & b) !== 0 && (_.f & (G | Y)) === 0 && (x === null ? Me([t]) : x.push(t));
|
|
529
|
+
}
|
|
530
|
+
return e;
|
|
531
|
+
}
|
|
532
|
+
function ct(t) {
|
|
533
|
+
N(t, t.v + 1);
|
|
534
|
+
}
|
|
535
|
+
function Vt(t, e) {
|
|
536
|
+
var n = t.reactions;
|
|
537
|
+
if (n !== null)
|
|
538
|
+
for (var r = n.length, l = 0; l < r; l++) {
|
|
539
|
+
var f = n[l], u = f.f, a = (u & O) === 0;
|
|
540
|
+
a && k(f, e), (u & E) !== 0 ? Vt(
|
|
541
|
+
/** @type {Derived} */
|
|
542
|
+
f,
|
|
543
|
+
D
|
|
544
|
+
) : a && ((u & z) !== 0 && F !== null && F.push(
|
|
545
|
+
/** @type {Effect} */
|
|
546
|
+
f
|
|
547
|
+
), nt(
|
|
548
|
+
/** @type {Effect} */
|
|
549
|
+
f
|
|
550
|
+
));
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
function K(t) {
|
|
554
|
+
if (typeof t != "object" || t === null || at in t)
|
|
555
|
+
return t;
|
|
556
|
+
const e = le(t);
|
|
557
|
+
if (e !== ne && e !== re)
|
|
558
|
+
return t;
|
|
559
|
+
var n = /* @__PURE__ */ new Map(), r = te(t), l = /* @__PURE__ */ S(0), f = q, u = (a) => {
|
|
560
|
+
if (q === f)
|
|
561
|
+
return a();
|
|
562
|
+
var s = v, i = q;
|
|
563
|
+
C(null), Nt(f);
|
|
564
|
+
var o = a();
|
|
565
|
+
return C(s), Nt(i), o;
|
|
566
|
+
};
|
|
567
|
+
return r && n.set("length", /* @__PURE__ */ S(
|
|
568
|
+
/** @type {any[]} */
|
|
569
|
+
t.length
|
|
570
|
+
)), new Proxy(
|
|
571
|
+
/** @type {any} */
|
|
572
|
+
t,
|
|
573
|
+
{
|
|
574
|
+
defineProperty(a, s, i) {
|
|
575
|
+
(!("value" in i) || i.configurable === !1 || i.enumerable === !1 || i.writable === !1) && ve();
|
|
576
|
+
var o = n.get(s);
|
|
577
|
+
return o === void 0 ? o = u(() => {
|
|
578
|
+
var c = /* @__PURE__ */ S(i.value);
|
|
579
|
+
return n.set(s, c), c;
|
|
580
|
+
}) : N(o, i.value, !0), !0;
|
|
581
|
+
},
|
|
582
|
+
deleteProperty(a, s) {
|
|
583
|
+
var i = n.get(s);
|
|
584
|
+
if (i === void 0) {
|
|
585
|
+
if (s in a) {
|
|
586
|
+
const o = u(() => /* @__PURE__ */ S(w));
|
|
587
|
+
n.set(s, o), ct(l);
|
|
588
|
+
}
|
|
589
|
+
} else
|
|
590
|
+
N(i, w), ct(l);
|
|
591
|
+
return !0;
|
|
592
|
+
},
|
|
593
|
+
get(a, s, i) {
|
|
594
|
+
if (s === at)
|
|
595
|
+
return t;
|
|
596
|
+
var o = n.get(s), c = s in a;
|
|
597
|
+
if (o === void 0 && (!c || ut(a, s)?.writable) && (o = u(() => {
|
|
598
|
+
var h = K(c ? a[s] : w), d = /* @__PURE__ */ S(h);
|
|
599
|
+
return d;
|
|
600
|
+
}), n.set(s, o)), o !== void 0) {
|
|
601
|
+
var p = j(o);
|
|
602
|
+
return p === w ? void 0 : p;
|
|
603
|
+
}
|
|
604
|
+
return Reflect.get(a, s, i);
|
|
605
|
+
},
|
|
606
|
+
getOwnPropertyDescriptor(a, s) {
|
|
607
|
+
var i = Reflect.getOwnPropertyDescriptor(a, s);
|
|
608
|
+
if (i && "value" in i) {
|
|
609
|
+
var o = n.get(s);
|
|
610
|
+
o && (i.value = j(o));
|
|
611
|
+
} else if (i === void 0) {
|
|
612
|
+
var c = n.get(s), p = c?.v;
|
|
613
|
+
if (c !== void 0 && p !== w)
|
|
614
|
+
return {
|
|
615
|
+
enumerable: !0,
|
|
616
|
+
configurable: !0,
|
|
617
|
+
value: p,
|
|
618
|
+
writable: !0
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
return i;
|
|
622
|
+
},
|
|
623
|
+
has(a, s) {
|
|
624
|
+
if (s === at)
|
|
625
|
+
return !0;
|
|
626
|
+
var i = n.get(s), o = i !== void 0 && i.v !== w || Reflect.has(a, s);
|
|
627
|
+
if (i !== void 0 || _ !== null && (!o || ut(a, s)?.writable)) {
|
|
628
|
+
i === void 0 && (i = u(() => {
|
|
629
|
+
var p = o ? K(a[s]) : w, h = /* @__PURE__ */ S(p);
|
|
630
|
+
return h;
|
|
631
|
+
}), n.set(s, i));
|
|
632
|
+
var c = j(i);
|
|
633
|
+
if (c === w)
|
|
634
|
+
return !1;
|
|
635
|
+
}
|
|
636
|
+
return o;
|
|
637
|
+
},
|
|
638
|
+
set(a, s, i, o) {
|
|
639
|
+
var c = n.get(s), p = s in a;
|
|
640
|
+
if (r && s === "length")
|
|
641
|
+
for (var h = i; h < /** @type {Source<number>} */
|
|
642
|
+
c.v; h += 1) {
|
|
643
|
+
var d = n.get(h + "");
|
|
644
|
+
d !== void 0 ? N(d, w) : h in a && (d = u(() => /* @__PURE__ */ S(w)), n.set(h + "", d));
|
|
645
|
+
}
|
|
646
|
+
if (c === void 0)
|
|
647
|
+
(!p || ut(a, s)?.writable) && (c = u(() => /* @__PURE__ */ S(void 0)), N(c, K(i)), n.set(s, c));
|
|
648
|
+
else {
|
|
649
|
+
p = c.v !== w;
|
|
650
|
+
var it = u(() => K(i));
|
|
651
|
+
N(c, it);
|
|
652
|
+
}
|
|
653
|
+
var mt = Reflect.getOwnPropertyDescriptor(a, s);
|
|
654
|
+
if (mt?.set && mt.set.call(o, i), !p) {
|
|
655
|
+
if (r && typeof s == "string") {
|
|
656
|
+
var Et = (
|
|
657
|
+
/** @type {Source<number>} */
|
|
658
|
+
n.get("length")
|
|
659
|
+
), ft = Number(s);
|
|
660
|
+
Number.isInteger(ft) && ft >= Et.v && N(Et, ft + 1);
|
|
661
|
+
}
|
|
662
|
+
ct(l);
|
|
663
|
+
}
|
|
664
|
+
return !0;
|
|
665
|
+
},
|
|
666
|
+
ownKeys(a) {
|
|
667
|
+
j(l);
|
|
668
|
+
var s = Reflect.ownKeys(a).filter((c) => {
|
|
669
|
+
var p = n.get(c);
|
|
670
|
+
return p === void 0 || p.v !== w;
|
|
671
|
+
});
|
|
672
|
+
for (var [i, o] of n)
|
|
673
|
+
o.v !== w && !(i in a) && s.push(i);
|
|
674
|
+
return s;
|
|
675
|
+
},
|
|
676
|
+
setPrototypeOf() {
|
|
677
|
+
_e();
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
);
|
|
681
|
+
}
|
|
682
|
+
var Oe, Se, Re;
|
|
683
|
+
// @__NO_SIDE_EFFECTS__
|
|
684
|
+
function Yt(t) {
|
|
685
|
+
return Se.call(t);
|
|
686
|
+
}
|
|
687
|
+
// @__NO_SIDE_EFFECTS__
|
|
688
|
+
function Ne(t) {
|
|
689
|
+
return Re.call(t);
|
|
690
|
+
}
|
|
691
|
+
function Pe(t, e) {
|
|
692
|
+
return /* @__PURE__ */ Yt(t);
|
|
693
|
+
}
|
|
694
|
+
function Bt(t) {
|
|
695
|
+
var e = v, n = _;
|
|
696
|
+
C(null), V(null);
|
|
697
|
+
try {
|
|
698
|
+
return t();
|
|
699
|
+
} finally {
|
|
700
|
+
C(e), V(n);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
function Ae(t, e) {
|
|
704
|
+
var n = e.last;
|
|
705
|
+
n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t);
|
|
706
|
+
}
|
|
707
|
+
function Kt(t, e, n, r = !0) {
|
|
708
|
+
var l = _;
|
|
709
|
+
l !== null && (l.f & X) !== 0 && (t |= X);
|
|
710
|
+
var f = {
|
|
711
|
+
ctx: Z,
|
|
712
|
+
deps: null,
|
|
713
|
+
nodes_start: null,
|
|
714
|
+
nodes_end: null,
|
|
715
|
+
f: t | O,
|
|
716
|
+
first: null,
|
|
717
|
+
fn: e,
|
|
718
|
+
last: null,
|
|
719
|
+
next: null,
|
|
720
|
+
parent: l,
|
|
721
|
+
b: l && l.b,
|
|
722
|
+
prev: null,
|
|
723
|
+
teardown: null,
|
|
724
|
+
transitions: null,
|
|
725
|
+
wv: 0,
|
|
726
|
+
ac: null
|
|
727
|
+
};
|
|
728
|
+
try {
|
|
729
|
+
U(f), f.f |= Ct;
|
|
730
|
+
} catch (s) {
|
|
731
|
+
throw lt(f), s;
|
|
732
|
+
}
|
|
733
|
+
if (r) {
|
|
734
|
+
var u = f;
|
|
735
|
+
if (u.deps === null && u.teardown === null && u.nodes_start === null && u.first === u.last && // either `null`, or a singular child
|
|
736
|
+
(u.f & dt) === 0 && (u = u.first), u !== null && (u.parent = l, l !== null && Ae(u, l), v !== null && (v.f & E) !== 0 && (t & Y) === 0)) {
|
|
737
|
+
var a = (
|
|
738
|
+
/** @type {Derived} */
|
|
739
|
+
v
|
|
740
|
+
);
|
|
741
|
+
(a.effects ??= []).push(u);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
return f;
|
|
745
|
+
}
|
|
746
|
+
function Ce(t) {
|
|
747
|
+
return Kt(pt | dt, t);
|
|
748
|
+
}
|
|
749
|
+
function De(t, e = [], n = []) {
|
|
750
|
+
Ee(e, n, (r) => {
|
|
751
|
+
Kt(fe, () => t(...r.map(j)), !0);
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
function Ht(t) {
|
|
755
|
+
var e = t.teardown;
|
|
756
|
+
if (e !== null) {
|
|
757
|
+
const n = J, r = v;
|
|
758
|
+
Rt(!0), C(null);
|
|
759
|
+
try {
|
|
760
|
+
e.call(null);
|
|
761
|
+
} finally {
|
|
762
|
+
Rt(n), C(r);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
function Wt(t, e = !1) {
|
|
767
|
+
var n = t.first;
|
|
768
|
+
for (t.first = t.last = null; n !== null; ) {
|
|
769
|
+
const l = n.ac;
|
|
770
|
+
l !== null && Bt(() => {
|
|
771
|
+
l.abort(wt);
|
|
772
|
+
});
|
|
773
|
+
var r = n.next;
|
|
774
|
+
(n.f & Y) !== 0 ? n.parent = null : lt(n, e), n = r;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
function Fe(t) {
|
|
778
|
+
for (var e = t.first; e !== null; ) {
|
|
779
|
+
var n = e.next;
|
|
780
|
+
(e.f & G) === 0 && lt(e), e = n;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
function lt(t, e = !0) {
|
|
784
|
+
var n = !1;
|
|
785
|
+
(e || (t.f & ue) !== 0) && t.nodes_start !== null && t.nodes_end !== null && (Ie(
|
|
786
|
+
t.nodes_start,
|
|
787
|
+
/** @type {TemplateNode} */
|
|
788
|
+
t.nodes_end
|
|
789
|
+
), n = !0), Wt(t, e && !n), rt(t, 0), k(t, B);
|
|
790
|
+
var r = t.transitions;
|
|
791
|
+
if (r !== null)
|
|
792
|
+
for (const f of r)
|
|
793
|
+
f.stop();
|
|
794
|
+
Ht(t);
|
|
795
|
+
var l = t.parent;
|
|
796
|
+
l !== null && l.first !== null && $t(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = t.ac = null;
|
|
797
|
+
}
|
|
798
|
+
function Ie(t, e) {
|
|
799
|
+
for (; t !== null; ) {
|
|
800
|
+
var n = t === e ? null : (
|
|
801
|
+
/** @type {TemplateNode} */
|
|
802
|
+
/* @__PURE__ */ Ne(t)
|
|
803
|
+
);
|
|
804
|
+
t.remove(), t = n;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
function $t(t) {
|
|
808
|
+
var e = t.parent, n = t.prev, r = t.next;
|
|
809
|
+
n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n));
|
|
810
|
+
}
|
|
811
|
+
let L = !1;
|
|
812
|
+
function St(t) {
|
|
813
|
+
L = t;
|
|
814
|
+
}
|
|
815
|
+
let J = !1;
|
|
816
|
+
function Rt(t) {
|
|
817
|
+
J = t;
|
|
818
|
+
}
|
|
819
|
+
let v = null, I = !1;
|
|
820
|
+
function C(t) {
|
|
821
|
+
v = t;
|
|
822
|
+
}
|
|
823
|
+
let _ = null;
|
|
824
|
+
function V(t) {
|
|
825
|
+
_ = t;
|
|
826
|
+
}
|
|
827
|
+
let R = null;
|
|
828
|
+
function je(t) {
|
|
829
|
+
v !== null && (R === null ? R = [t] : R.push(t));
|
|
830
|
+
}
|
|
831
|
+
let y = null, m = 0, x = null;
|
|
832
|
+
function Me(t) {
|
|
833
|
+
x = t;
|
|
834
|
+
}
|
|
835
|
+
let zt = 1, $ = 0, q = $;
|
|
836
|
+
function Nt(t) {
|
|
837
|
+
q = t;
|
|
838
|
+
}
|
|
839
|
+
let P = !1;
|
|
840
|
+
function Gt() {
|
|
841
|
+
return ++zt;
|
|
842
|
+
}
|
|
843
|
+
function st(t) {
|
|
844
|
+
var e = t.f;
|
|
845
|
+
if ((e & O) !== 0)
|
|
846
|
+
return !0;
|
|
847
|
+
if ((e & D) !== 0) {
|
|
848
|
+
var n = t.deps, r = (e & T) !== 0;
|
|
849
|
+
if (n !== null) {
|
|
850
|
+
var l, f, u = (e & Q) !== 0, a = r && _ !== null && !P, s = n.length;
|
|
851
|
+
if ((u || a) && (_ === null || (_.f & B) === 0)) {
|
|
852
|
+
var i = (
|
|
853
|
+
/** @type {Derived} */
|
|
854
|
+
t
|
|
855
|
+
), o = i.parent;
|
|
856
|
+
for (l = 0; l < s; l++)
|
|
857
|
+
f = n[l], (u || !f?.reactions?.includes(i)) && (f.reactions ??= []).push(i);
|
|
858
|
+
u && (i.f ^= Q), a && o !== null && (o.f & T) === 0 && (i.f ^= T);
|
|
859
|
+
}
|
|
860
|
+
for (l = 0; l < s; l++)
|
|
861
|
+
if (f = n[l], st(
|
|
862
|
+
/** @type {Derived} */
|
|
863
|
+
f
|
|
864
|
+
) && Mt(
|
|
865
|
+
/** @type {Derived} */
|
|
866
|
+
f
|
|
867
|
+
), f.wv > t.wv)
|
|
868
|
+
return !0;
|
|
869
|
+
}
|
|
870
|
+
(!r || _ !== null && !P) && k(t, b);
|
|
871
|
+
}
|
|
872
|
+
return !1;
|
|
873
|
+
}
|
|
874
|
+
function Zt(t, e, n = !0) {
|
|
875
|
+
var r = t.reactions;
|
|
876
|
+
if (r !== null && !R?.includes(t))
|
|
877
|
+
for (var l = 0; l < r.length; l++) {
|
|
878
|
+
var f = r[l];
|
|
879
|
+
(f.f & E) !== 0 ? Zt(
|
|
880
|
+
/** @type {Derived} */
|
|
881
|
+
f,
|
|
882
|
+
e,
|
|
883
|
+
!1
|
|
884
|
+
) : e === f && (n ? k(f, O) : (f.f & b) !== 0 && k(f, D), nt(
|
|
885
|
+
/** @type {Effect} */
|
|
886
|
+
f
|
|
887
|
+
));
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
function Jt(t) {
|
|
891
|
+
var e = y, n = m, r = x, l = v, f = P, u = R, a = Z, s = I, i = q, o = t.f;
|
|
892
|
+
y = /** @type {null | Value[]} */
|
|
893
|
+
null, m = 0, x = null, P = (o & T) !== 0 && (I || !L || v === null), v = (o & (G | Y)) === 0 ? t : null, R = null, tt(t.ctx), I = !1, q = ++$, t.ac !== null && (Bt(() => {
|
|
894
|
+
t.ac.abort(wt);
|
|
895
|
+
}), t.ac = null);
|
|
896
|
+
try {
|
|
897
|
+
t.f |= vt;
|
|
898
|
+
var c = (
|
|
899
|
+
/** @type {Function} */
|
|
900
|
+
t.fn
|
|
901
|
+
), p = c(), h = t.deps;
|
|
902
|
+
if (y !== null) {
|
|
903
|
+
var d;
|
|
904
|
+
if (rt(t, m), h !== null && m > 0)
|
|
905
|
+
for (h.length = m + y.length, d = 0; d < y.length; d++)
|
|
906
|
+
h[m + d] = y[d];
|
|
907
|
+
else
|
|
908
|
+
t.deps = h = y;
|
|
909
|
+
if (!P || // Deriveds that already have reactions can cleanup, so we still add them as reactions
|
|
910
|
+
(o & E) !== 0 && /** @type {import('#client').Derived} */
|
|
911
|
+
t.reactions !== null)
|
|
912
|
+
for (d = m; d < h.length; d++)
|
|
913
|
+
(h[d].reactions ??= []).push(t);
|
|
914
|
+
} else h !== null && m < h.length && (rt(t, m), h.length = m);
|
|
915
|
+
if (Ft() && x !== null && !I && h !== null && (t.f & (E | D | O)) === 0)
|
|
916
|
+
for (d = 0; d < /** @type {Source[]} */
|
|
917
|
+
x.length; d++)
|
|
918
|
+
Zt(
|
|
919
|
+
x[d],
|
|
920
|
+
/** @type {Effect} */
|
|
921
|
+
t
|
|
922
|
+
);
|
|
923
|
+
return l !== null && l !== t && ($++, x !== null && (r === null ? r = x : r.push(.../** @type {Source[]} */
|
|
924
|
+
x))), (t.f & M) !== 0 && (t.f ^= M), p;
|
|
925
|
+
} catch (it) {
|
|
926
|
+
return we(it);
|
|
927
|
+
} finally {
|
|
928
|
+
t.f ^= vt, y = e, m = n, x = r, v = l, P = f, R = u, tt(a), I = s, q = i;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
function qe(t, e) {
|
|
932
|
+
let n = e.reactions;
|
|
933
|
+
if (n !== null) {
|
|
934
|
+
var r = ee.call(n, t);
|
|
935
|
+
if (r !== -1) {
|
|
936
|
+
var l = n.length - 1;
|
|
937
|
+
l === 0 ? n = e.reactions = null : (n[r] = n[l], n.pop());
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
n === null && (e.f & E) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear
|
|
941
|
+
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
|
|
942
|
+
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
|
|
943
|
+
(y === null || !y.includes(e)) && (k(e, D), (e.f & (T | Q)) === 0 && (e.f ^= Q), jt(
|
|
944
|
+
/** @type {Derived} **/
|
|
945
|
+
e
|
|
946
|
+
), rt(
|
|
947
|
+
/** @type {Derived} **/
|
|
948
|
+
e,
|
|
949
|
+
0
|
|
950
|
+
));
|
|
951
|
+
}
|
|
952
|
+
function rt(t, e) {
|
|
953
|
+
var n = t.deps;
|
|
954
|
+
if (n !== null)
|
|
955
|
+
for (var r = e; r < n.length; r++)
|
|
956
|
+
qe(t, n[r]);
|
|
957
|
+
}
|
|
958
|
+
function U(t) {
|
|
959
|
+
var e = t.f;
|
|
960
|
+
if ((e & B) === 0) {
|
|
961
|
+
k(t, b);
|
|
962
|
+
var n = _, r = L;
|
|
963
|
+
_ = t, L = !0;
|
|
964
|
+
try {
|
|
965
|
+
(e & z) !== 0 ? Fe(t) : Wt(t), Ht(t);
|
|
966
|
+
var l = Jt(t);
|
|
967
|
+
t.teardown = typeof l == "function" ? l : null, t.wv = zt;
|
|
968
|
+
var f;
|
|
969
|
+
Pt && de && (t.f & O) !== 0 && t.deps;
|
|
970
|
+
} finally {
|
|
971
|
+
L = r, _ = n;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
function j(t) {
|
|
976
|
+
var e = t.f, n = (e & E) !== 0;
|
|
977
|
+
if (v !== null && !I) {
|
|
978
|
+
var r = _ !== null && (_.f & B) !== 0;
|
|
979
|
+
if (!r && !R?.includes(t)) {
|
|
980
|
+
var l = v.deps;
|
|
981
|
+
if ((v.f & vt) !== 0)
|
|
982
|
+
t.rv < $ && (t.rv = $, y === null && l !== null && l[m] === t ? m++ : y === null ? y = [t] : (!P || !y.includes(t)) && y.push(t));
|
|
983
|
+
else {
|
|
984
|
+
(v.deps ??= []).push(t);
|
|
985
|
+
var f = t.reactions;
|
|
986
|
+
f === null ? t.reactions = [v] : f.includes(v) || f.push(v);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
} else if (n && /** @type {Derived} */
|
|
990
|
+
t.deps === null && /** @type {Derived} */
|
|
991
|
+
t.effects === null) {
|
|
992
|
+
var u = (
|
|
993
|
+
/** @type {Derived} */
|
|
994
|
+
t
|
|
995
|
+
), a = u.parent;
|
|
996
|
+
a !== null && (a.f & T) === 0 && (u.f ^= T);
|
|
997
|
+
}
|
|
998
|
+
if (J) {
|
|
999
|
+
if (A.has(t))
|
|
1000
|
+
return A.get(t);
|
|
1001
|
+
if (n) {
|
|
1002
|
+
u = /** @type {Derived} */
|
|
1003
|
+
t;
|
|
1004
|
+
var s = u.v;
|
|
1005
|
+
return ((u.f & b) === 0 && u.reactions !== null || Qt(u)) && (s = yt(u)), A.set(u, s), s;
|
|
1006
|
+
}
|
|
1007
|
+
} else n && (u = /** @type {Derived} */
|
|
1008
|
+
t, st(u) && Mt(u));
|
|
1009
|
+
if ((t.f & M) !== 0)
|
|
1010
|
+
throw t.v;
|
|
1011
|
+
return t.v;
|
|
1012
|
+
}
|
|
1013
|
+
function Qt(t) {
|
|
1014
|
+
if (t.v === w) return !0;
|
|
1015
|
+
if (t.deps === null) return !1;
|
|
1016
|
+
for (const e of t.deps)
|
|
1017
|
+
if (A.has(e) || (e.f & E) !== 0 && Qt(
|
|
1018
|
+
/** @type {Derived} */
|
|
1019
|
+
e
|
|
1020
|
+
))
|
|
1021
|
+
return !0;
|
|
1022
|
+
return !1;
|
|
1023
|
+
}
|
|
1024
|
+
const Le = -7169;
|
|
1025
|
+
function k(t, e) {
|
|
1026
|
+
t.f = t.f & Le | e;
|
|
1027
|
+
}
|
|
1028
|
+
const Ue = /* @__PURE__ */ new Set(), Ve = /* @__PURE__ */ new Set();
|
|
1029
|
+
function Ye(t) {
|
|
1030
|
+
for (var e = 0; e < t.length; e++)
|
|
1031
|
+
Ue.add(t[e]);
|
|
1032
|
+
for (var n of Ve)
|
|
1033
|
+
n(t);
|
|
1034
|
+
}
|
|
1035
|
+
function Be(t) {
|
|
1036
|
+
var e = document.createElement("template");
|
|
1037
|
+
return e.innerHTML = t.replaceAll("<!>", "<!---->"), e.content;
|
|
1038
|
+
}
|
|
1039
|
+
function Ke(t, e) {
|
|
1040
|
+
var n = (
|
|
1041
|
+
/** @type {Effect} */
|
|
1042
|
+
_
|
|
1043
|
+
);
|
|
1044
|
+
n.nodes_start === null && (n.nodes_start = t, n.nodes_end = e);
|
|
1045
|
+
}
|
|
1046
|
+
// @__NO_SIDE_EFFECTS__
|
|
1047
|
+
function He(t, e) {
|
|
1048
|
+
var n = (e & Xt) !== 0, r, l = !t.startsWith("<!>");
|
|
1049
|
+
return () => {
|
|
1050
|
+
r === void 0 && (r = Be(l ? t : "<!>" + t), r = /** @type {Node} */
|
|
1051
|
+
/* @__PURE__ */ Yt(r));
|
|
1052
|
+
var f = (
|
|
1053
|
+
/** @type {TemplateNode} */
|
|
1054
|
+
n || Oe ? document.importNode(r, !0) : r.cloneNode(!0)
|
|
1055
|
+
);
|
|
1056
|
+
return Ke(f, f), f;
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
function We(t, e) {
|
|
1060
|
+
t !== null && t.before(
|
|
1061
|
+
/** @type {Node} */
|
|
1062
|
+
e
|
|
1063
|
+
);
|
|
1064
|
+
}
|
|
1065
|
+
function $e(t, e) {
|
|
1066
|
+
var n = e == null ? "" : typeof e == "object" ? e + "" : e;
|
|
1067
|
+
n !== (t.__t ??= t.nodeValue) && (t.__t = n, t.nodeValue = n + "");
|
|
1068
|
+
}
|
|
1069
|
+
const ze = (t, e) => {
|
|
1070
|
+
N(e, j(e) + 1);
|
|
1071
|
+
};
|
|
1072
|
+
var Ge = /* @__PURE__ */ He("<button> </button>");
|
|
1073
|
+
function Ze(t) {
|
|
1074
|
+
let e = /* @__PURE__ */ S(0);
|
|
1075
|
+
var n = Ge();
|
|
1076
|
+
n.__click = [ze, e];
|
|
1077
|
+
var r = Pe(n);
|
|
1078
|
+
De(() => $e(r, `count is ${j(e) ?? ""}`)), We(t, n);
|
|
1079
|
+
}
|
|
1080
|
+
Ye(["click"]);
|
|
1081
|
+
const Je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1082
|
+
__proto__: null,
|
|
1083
|
+
default: Ze
|
|
1084
|
+
}, Symbol.toStringTag, { value: "Module" })), Xe = Object.fromEntries(
|
|
1085
|
+
Object.entries(/* @__PURE__ */ Object.assign({ "./lib/Counter.svelte": Je })).map(
|
|
1086
|
+
([t, e]) => [t.replace("./lib/", ""), e.default]
|
|
1087
|
+
)
|
|
1088
|
+
);
|
|
1089
|
+
export {
|
|
1090
|
+
Ze as Counter,
|
|
1091
|
+
Xe as components
|
|
1092
|
+
};
|