@pie-element/mc-populated-blank 0.2.13-next.3 → 0.3.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/author.js +2 -0
- package/dist/author/defaults.d.ts +74 -0
- package/dist/author/index.js +1799 -1741
- package/dist/author/index.js.map +1 -1
- package/dist/browser/author/index.js +6 -15
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/{client-B0miu8E8.js → client-6I83eQqA.js} +1045 -1063
- package/dist/browser/client-6I83eQqA.js.map +1 -0
- package/dist/browser/controller/index.js +102 -114
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +533 -636
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/i18n-CQZqUmjk.js +1542 -0
- package/dist/browser/i18n-CQZqUmjk.js.map +1 -0
- package/dist/browser/{layoutLimits-ATKOwLHb.js → layoutLimits-Bp17YP2V.js} +3 -3
- package/dist/browser/layoutLimits-Bp17YP2V.js.map +1 -0
- package/dist/browser/print/index.js +111 -85
- package/dist/browser/print/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +8 -29
- package/dist/controller/index.d.ts +79 -62
- package/dist/controller/index.js +108 -85
- package/dist/controller/index.js.map +1 -1
- package/dist/delivery/computeDisplayState.d.ts +7 -7
- package/dist/delivery/computeLayoutStyle.d.ts +0 -1
- package/dist/delivery/i18n.d.ts +8 -0
- package/dist/delivery/index.d.ts +22 -0
- package/dist/delivery/index.js +5667 -3266
- package/dist/delivery/index.js.map +1 -1
- package/dist/delivery/variant-css-map.d.ts +15 -1
- package/dist/index.iife.d.ts +0 -155
- package/dist/index.iife.js +215 -38
- package/dist/index.js +5667 -3266
- package/dist/index.js.map +1 -1
- package/dist/print/index.d.ts +4 -0
- package/dist/print/index.js +6531 -4117
- package/dist/print/index.js.map +1 -1
- package/dist/shared/layoutLimits.d.ts +1 -1
- package/dist/shared/types.d.ts +20 -18
- package/module/print.js +3883 -0
- package/module/print.js.map +1 -0
- package/package.json +15 -12
- package/print.js +2 -0
- package/dist/browser/client-B0miu8E8.js.map +0 -1
- package/dist/browser/layoutLimits-ATKOwLHb.js.map +0 -1
package/dist/author/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
1
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/disclose-version.js
|
|
2
2
|
if (typeof window !== "undefined") {
|
|
3
3
|
var _window$__svelte, _window;
|
|
4
4
|
((_window$__svelte = (_window = window).__svelte ?? (_window.__svelte = {})).v ?? (_window$__svelte.v = /* @__PURE__ */ new Set())).add("5");
|
|
5
5
|
}
|
|
6
6
|
//#endregion
|
|
7
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
7
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/constants.js
|
|
8
8
|
var HYDRATION_ERROR = {};
|
|
9
9
|
var UNINITIALIZED = Symbol("uninitialized");
|
|
10
10
|
//#endregion
|
|
11
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
11
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/shared/utils.js
|
|
12
12
|
var is_array = Array.isArray;
|
|
13
13
|
var index_of = Array.prototype.indexOf;
|
|
14
14
|
var includes = Array.prototype.includes;
|
|
@@ -44,7 +44,7 @@ function deferred() {
|
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
//#endregion
|
|
47
|
-
//#region \0@oxc-project+runtime@0.
|
|
47
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/typeof.js
|
|
48
48
|
function _typeof(o) {
|
|
49
49
|
"@babel/helpers - typeof";
|
|
50
50
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -54,7 +54,7 @@ function _typeof(o) {
|
|
|
54
54
|
}, _typeof(o);
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
|
-
//#region \0@oxc-project+runtime@0.
|
|
57
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/toPrimitive.js
|
|
58
58
|
function toPrimitive(t, r) {
|
|
59
59
|
if ("object" != _typeof(t) || !t) return t;
|
|
60
60
|
var e = t[Symbol.toPrimitive];
|
|
@@ -66,13 +66,13 @@ function toPrimitive(t, r) {
|
|
|
66
66
|
return ("string" === r ? String : Number)(t);
|
|
67
67
|
}
|
|
68
68
|
//#endregion
|
|
69
|
-
//#region \0@oxc-project+runtime@0.
|
|
69
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/toPropertyKey.js
|
|
70
70
|
function toPropertyKey(t) {
|
|
71
71
|
var i = toPrimitive(t, "string");
|
|
72
72
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
73
73
|
}
|
|
74
74
|
//#endregion
|
|
75
|
-
//#region \0@oxc-project+runtime@0.
|
|
75
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/defineProperty.js
|
|
76
76
|
function _defineProperty(e, r, t) {
|
|
77
77
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
78
78
|
value: t,
|
|
@@ -107,6 +107,8 @@ var WAS_MARKED = 65536;
|
|
|
107
107
|
var REACTION_IS_UPDATING = 1 << 21;
|
|
108
108
|
var ERROR_VALUE = 1 << 23;
|
|
109
109
|
var STATE_SYMBOL = Symbol("$state");
|
|
110
|
+
/** Marks component export objects, so that `proxy(...)` leaves them untouched */
|
|
111
|
+
var COMPONENT_SYMBOL = Symbol("component");
|
|
110
112
|
var LEGACY_PROPS = Symbol("legacy props");
|
|
111
113
|
var ATTRIBUTES_CACHE = Symbol("attributes");
|
|
112
114
|
var CLASS_CACHE = Symbol("class");
|
|
@@ -122,56 +124,6 @@ var STALE_REACTION = new class StaleReactionError extends Error {
|
|
|
122
124
|
}();
|
|
123
125
|
globalThis.document?.contentType;
|
|
124
126
|
/**
|
|
125
|
-
* Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
|
|
126
|
-
* @returns {never}
|
|
127
|
-
*/
|
|
128
|
-
function effect_update_depth_exceeded() {
|
|
129
|
-
throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Failed to hydrate the application
|
|
133
|
-
* @returns {never}
|
|
134
|
-
*/
|
|
135
|
-
function hydration_failed() {
|
|
136
|
-
throw new Error(`https://svelte.dev/e/hydration_failed`);
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value
|
|
140
|
-
* @param {string} key
|
|
141
|
-
* @returns {never}
|
|
142
|
-
*/
|
|
143
|
-
function props_invalid_value(key) {
|
|
144
|
-
throw new Error(`https://svelte.dev/e/props_invalid_value`);
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.
|
|
148
|
-
* @returns {never}
|
|
149
|
-
*/
|
|
150
|
-
function state_descriptors_fixed() {
|
|
151
|
-
throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Cannot set prototype of `$state` object
|
|
155
|
-
* @returns {never}
|
|
156
|
-
*/
|
|
157
|
-
function state_prototype_fixed() {
|
|
158
|
-
throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
|
|
162
|
-
* @returns {never}
|
|
163
|
-
*/
|
|
164
|
-
function state_unsafe_mutation() {
|
|
165
|
-
throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* A `<svelte:boundary>` `reset` function cannot be called while an error is still being handled
|
|
169
|
-
* @returns {never}
|
|
170
|
-
*/
|
|
171
|
-
function svelte_boundary_reset_onerror() {
|
|
172
|
-
throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
127
|
* Reading a derived belonging to a now-destroyed effect may result in stale values
|
|
176
128
|
*/
|
|
177
129
|
function derived_inert() {
|
|
@@ -191,7 +143,7 @@ function svelte_boundary_reset_noop() {
|
|
|
191
143
|
console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
|
|
192
144
|
}
|
|
193
145
|
//#endregion
|
|
194
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
146
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/hydration.js
|
|
195
147
|
/** @import { TemplateNode } from '#client' */
|
|
196
148
|
/**
|
|
197
149
|
* Use this variable to guard everything related to hydration code so it can be treeshaken out
|
|
@@ -250,7 +202,7 @@ function skip_nodes(remove = true) {
|
|
|
250
202
|
}
|
|
251
203
|
}
|
|
252
204
|
//#endregion
|
|
253
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
205
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/equality.js
|
|
254
206
|
/** @import { Equals } from '#client' */
|
|
255
207
|
/** @type {Equals} */
|
|
256
208
|
function equals(value) {
|
|
@@ -268,14 +220,64 @@ function safe_not_equal(a, b) {
|
|
|
268
220
|
function safe_equals(value) {
|
|
269
221
|
return !safe_not_equal(value, this.v);
|
|
270
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
|
|
225
|
+
* @returns {never}
|
|
226
|
+
*/
|
|
227
|
+
function effect_update_depth_exceeded() {
|
|
228
|
+
throw new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Failed to hydrate the application
|
|
232
|
+
* @returns {never}
|
|
233
|
+
*/
|
|
234
|
+
function hydration_failed() {
|
|
235
|
+
throw new Error(`https://svelte.dev/e/hydration_failed`);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value
|
|
239
|
+
* @param {string} key
|
|
240
|
+
* @returns {never}
|
|
241
|
+
*/
|
|
242
|
+
function props_invalid_value(key) {
|
|
243
|
+
throw new Error(`https://svelte.dev/e/props_invalid_value`);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.
|
|
247
|
+
* @returns {never}
|
|
248
|
+
*/
|
|
249
|
+
function state_descriptors_fixed() {
|
|
250
|
+
throw new Error(`https://svelte.dev/e/state_descriptors_fixed`);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Cannot set prototype of `$state` object
|
|
254
|
+
* @returns {never}
|
|
255
|
+
*/
|
|
256
|
+
function state_prototype_fixed() {
|
|
257
|
+
throw new Error(`https://svelte.dev/e/state_prototype_fixed`);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
|
|
261
|
+
* @returns {never}
|
|
262
|
+
*/
|
|
263
|
+
function state_unsafe_mutation() {
|
|
264
|
+
throw new Error(`https://svelte.dev/e/state_unsafe_mutation`);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* A `<svelte:boundary>` `reset` function cannot be called while an error is still being handled
|
|
268
|
+
* @returns {never}
|
|
269
|
+
*/
|
|
270
|
+
function svelte_boundary_reset_onerror() {
|
|
271
|
+
throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
|
|
272
|
+
}
|
|
271
273
|
//#endregion
|
|
272
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
274
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/flags/index.js
|
|
273
275
|
/** True if experimental.async=true */
|
|
274
276
|
var async_mode_flag = false;
|
|
275
277
|
/** True if we're not certain that we only have Svelte 5 code in the compilation */
|
|
276
278
|
var legacy_mode_flag = false;
|
|
277
279
|
//#endregion
|
|
278
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
280
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/context.js
|
|
279
281
|
/** @import { ComponentContext, DevStackEntry, Effect } from '#client' */
|
|
280
282
|
/** @type {ComponentContext | null} */
|
|
281
283
|
var component_context = null;
|
|
@@ -320,14 +322,22 @@ function pop(component) {
|
|
|
320
322
|
if (component !== void 0) context.x = component;
|
|
321
323
|
context.i = true;
|
|
322
324
|
component_context = context.p;
|
|
323
|
-
return component
|
|
325
|
+
return mark_as_component(component);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Add a symbol to the object (or create one if undefined) to mark it as a component so it isn't proxified.
|
|
329
|
+
* @param {any} component
|
|
330
|
+
*/
|
|
331
|
+
function mark_as_component(component = {}) {
|
|
332
|
+
define_property(component, COMPONENT_SYMBOL, { value: true });
|
|
333
|
+
return component;
|
|
324
334
|
}
|
|
325
335
|
/** @returns {boolean} */
|
|
326
336
|
function is_runes() {
|
|
327
337
|
return !legacy_mode_flag || component_context !== null && component_context.l === null;
|
|
328
338
|
}
|
|
329
339
|
//#endregion
|
|
330
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
340
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/task.js
|
|
331
341
|
/** @type {Array<() => void>} */
|
|
332
342
|
var micro_tasks = [];
|
|
333
343
|
function run_micro_tasks() {
|
|
@@ -353,39 +363,8 @@ function queue_micro_task(fn) {
|
|
|
353
363
|
function flush_tasks() {
|
|
354
364
|
while (micro_tasks.length > 0) run_micro_tasks();
|
|
355
365
|
}
|
|
356
|
-
/**
|
|
357
|
-
* @param {unknown} error
|
|
358
|
-
*/
|
|
359
|
-
function handle_error(error) {
|
|
360
|
-
var effect = active_effect;
|
|
361
|
-
if (effect === null) {
|
|
362
|
-
/** @type {Derived} */ active_reaction.f |= ERROR_VALUE;
|
|
363
|
-
return error;
|
|
364
|
-
}
|
|
365
|
-
if ((effect.f & 32768) === 0 && (effect.f & 4) === 0) throw error;
|
|
366
|
-
invoke_error_boundary(error, effect);
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* @param {unknown} error
|
|
370
|
-
* @param {Effect | null} effect
|
|
371
|
-
*/
|
|
372
|
-
function invoke_error_boundary(error, effect) {
|
|
373
|
-
while (effect !== null) {
|
|
374
|
-
if ((effect.f & 128) !== 0) {
|
|
375
|
-
if ((effect.f & 32768) === 0) throw error;
|
|
376
|
-
try {
|
|
377
|
-
/** @type {Boundary} */ effect.b.error(error);
|
|
378
|
-
return;
|
|
379
|
-
} catch (e) {
|
|
380
|
-
error = e;
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
effect = effect.parent;
|
|
384
|
-
}
|
|
385
|
-
throw error;
|
|
386
|
-
}
|
|
387
366
|
//#endregion
|
|
388
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
367
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/status.js
|
|
389
368
|
/** @import { Derived, Signal } from '#client' */
|
|
390
369
|
var STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
|
|
391
370
|
/**
|
|
@@ -404,7 +383,7 @@ function update_derived_status(derived) {
|
|
|
404
383
|
else set_signal_status(derived, MAYBE_DIRTY);
|
|
405
384
|
}
|
|
406
385
|
//#endregion
|
|
407
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
386
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/utils.js
|
|
408
387
|
/** @import { Derived, Effect, Value } from '#client' */
|
|
409
388
|
/**
|
|
410
389
|
* @param {Value[] | null} deps
|
|
@@ -432,7 +411,7 @@ function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
|
|
|
432
411
|
set_signal_status(effect, CLEAN);
|
|
433
412
|
}
|
|
434
413
|
//#endregion
|
|
435
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
414
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/store.js
|
|
436
415
|
/**
|
|
437
416
|
* We set this to `true` when updating a store so that we correctly
|
|
438
417
|
* schedule effects if the update takes place inside a `$:` effect
|
|
@@ -462,86 +441,221 @@ function capture_store_binding(fn) {
|
|
|
462
441
|
}
|
|
463
442
|
}
|
|
464
443
|
//#endregion
|
|
465
|
-
//#region
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
function _assertClassBrand(e, t, n) {
|
|
482
|
-
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
483
|
-
throw new TypeError("Private element is not present on this object");
|
|
484
|
-
}
|
|
485
|
-
//#endregion
|
|
486
|
-
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/classPrivateFieldSet2.js
|
|
487
|
-
function _classPrivateFieldSet2(s, a, r) {
|
|
488
|
-
return s.set(_assertClassBrand(s, a), r), r;
|
|
489
|
-
}
|
|
490
|
-
//#endregion
|
|
491
|
-
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/classPrivateFieldGet2.js
|
|
492
|
-
function _classPrivateFieldGet2(s, a) {
|
|
493
|
-
return s.get(_assertClassBrand(s, a));
|
|
444
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
|
|
445
|
+
/**
|
|
446
|
+
* @template T
|
|
447
|
+
* @param {() => T} fn
|
|
448
|
+
*/
|
|
449
|
+
function without_reactive_context(fn) {
|
|
450
|
+
var previous_reaction = active_reaction;
|
|
451
|
+
var previous_effect = active_effect;
|
|
452
|
+
set_active_reaction(null);
|
|
453
|
+
set_active_effect(null);
|
|
454
|
+
try {
|
|
455
|
+
return fn();
|
|
456
|
+
} finally {
|
|
457
|
+
set_active_reaction(previous_reaction);
|
|
458
|
+
set_active_effect(previous_effect);
|
|
459
|
+
}
|
|
494
460
|
}
|
|
495
|
-
//#endregion
|
|
496
|
-
//#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/reactivity/batch.js
|
|
497
|
-
/** @import { Fork } from 'svelte' */
|
|
498
|
-
/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
|
|
499
|
-
var _Batch;
|
|
500
|
-
/** @type {Batch | null} */
|
|
501
|
-
var first_batch = null;
|
|
502
|
-
/** @type {Batch | null} */
|
|
503
|
-
var last_batch = null;
|
|
504
|
-
/** @type {Batch | null} */
|
|
505
|
-
var current_batch = null;
|
|
506
461
|
/**
|
|
507
|
-
*
|
|
508
|
-
* @
|
|
462
|
+
* @template V
|
|
463
|
+
* @param {() => V} fn
|
|
464
|
+
* @returns {Derived<V>}
|
|
509
465
|
*/
|
|
510
|
-
|
|
466
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
467
|
+
function derived(fn) {
|
|
468
|
+
var flags = 2 | DIRTY;
|
|
469
|
+
if (active_effect !== null) active_effect.f |= EFFECT_PRESERVED;
|
|
470
|
+
return {
|
|
471
|
+
ctx: component_context,
|
|
472
|
+
deps: null,
|
|
473
|
+
effects: null,
|
|
474
|
+
equals,
|
|
475
|
+
f: flags,
|
|
476
|
+
fn,
|
|
477
|
+
reactions: null,
|
|
478
|
+
rv: 0,
|
|
479
|
+
v: UNINITIALIZED,
|
|
480
|
+
wv: 0,
|
|
481
|
+
parent: active_effect,
|
|
482
|
+
ac: null
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
var OBSOLETE = Symbol("obsolete");
|
|
511
486
|
/**
|
|
512
|
-
*
|
|
513
|
-
*
|
|
514
|
-
*
|
|
515
|
-
* @type {Map<Value, any> | null}
|
|
487
|
+
* @template V
|
|
488
|
+
* @param {() => V} fn
|
|
489
|
+
* @returns {Derived<V>}
|
|
516
490
|
*/
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
491
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
492
|
+
function derived_safe_equal(fn) {
|
|
493
|
+
const signal = /* @__PURE__ */ derived(fn);
|
|
494
|
+
signal.equals = safe_equals;
|
|
495
|
+
return signal;
|
|
496
|
+
}
|
|
522
497
|
/**
|
|
523
|
-
*
|
|
524
|
-
*
|
|
525
|
-
* rigamarole that would cause another turn of the flush loop.
|
|
526
|
-
* @type {Effect[] | null}
|
|
498
|
+
* @param {Derived} derived
|
|
499
|
+
* @returns {void}
|
|
527
500
|
*/
|
|
528
|
-
|
|
501
|
+
function destroy_derived_effects(derived) {
|
|
502
|
+
var effects = derived.effects;
|
|
503
|
+
if (effects !== null) {
|
|
504
|
+
derived.effects = null;
|
|
505
|
+
for (var i = 0; i < effects.length; i += 1) destroy_effect(effects[i]);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
529
508
|
/**
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
*
|
|
533
|
-
* @type {Effect[] | null}
|
|
534
|
-
* @deprecated when we get rid of legacy mode and stores, we can get rid of this
|
|
509
|
+
* @template T
|
|
510
|
+
* @param {Derived} derived
|
|
511
|
+
* @returns {T}
|
|
535
512
|
*/
|
|
536
|
-
|
|
537
|
-
var
|
|
538
|
-
var
|
|
539
|
-
var
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
513
|
+
function execute_derived(derived) {
|
|
514
|
+
var value;
|
|
515
|
+
var prev_active_effect = active_effect;
|
|
516
|
+
var parent = derived.parent;
|
|
517
|
+
if (!is_destroying_effect && parent !== null && derived.v !== UNINITIALIZED && (parent.f & 24576) !== 0) {
|
|
518
|
+
derived_inert();
|
|
519
|
+
return derived.v;
|
|
520
|
+
}
|
|
521
|
+
set_active_effect(parent);
|
|
522
|
+
try {
|
|
523
|
+
derived.f &= ~WAS_MARKED;
|
|
524
|
+
destroy_derived_effects(derived);
|
|
525
|
+
value = update_reaction(derived);
|
|
526
|
+
} finally {
|
|
527
|
+
set_active_effect(prev_active_effect);
|
|
528
|
+
}
|
|
529
|
+
return value;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* @param {Derived} derived
|
|
533
|
+
* @returns {void}
|
|
534
|
+
*/
|
|
535
|
+
function update_derived(derived) {
|
|
536
|
+
var value = execute_derived(derived);
|
|
537
|
+
if (!derived.equals(value)) {
|
|
538
|
+
derived.wv = increment_write_version();
|
|
539
|
+
if (!current_batch?.is_fork || derived.deps === null) {
|
|
540
|
+
if (current_batch !== null) {
|
|
541
|
+
current_batch.capture(derived, value, true);
|
|
542
|
+
previous_batch?.capture(derived, value, true);
|
|
543
|
+
} else derived.v = value;
|
|
544
|
+
if (derived.deps === null) {
|
|
545
|
+
set_signal_status(derived, CLEAN);
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
if (is_destroying_effect) return;
|
|
551
|
+
if (batch_values !== null) {
|
|
552
|
+
if (effect_tracking() || current_batch?.is_fork) batch_values.set(derived, value);
|
|
553
|
+
} else update_derived_status(derived);
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* @param {Derived} derived
|
|
557
|
+
*/
|
|
558
|
+
function freeze_derived_effects(derived) {
|
|
559
|
+
if (derived.effects === null) return;
|
|
560
|
+
for (const e of derived.effects) if (e.teardown || e.ac) {
|
|
561
|
+
e.teardown?.();
|
|
562
|
+
if (e.ac !== null) without_reactive_context(() => {
|
|
563
|
+
/** @type {AbortController} */ e.ac.abort(STALE_REACTION);
|
|
564
|
+
e.ac = null;
|
|
565
|
+
});
|
|
566
|
+
if (e.fn !== null) e.teardown = noop;
|
|
567
|
+
remove_reactions(e, 0);
|
|
568
|
+
destroy_effect_children(e);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* @param {Derived} derived
|
|
573
|
+
*/
|
|
574
|
+
function unfreeze_derived_effects(derived) {
|
|
575
|
+
if (derived.effects === null) return;
|
|
576
|
+
for (const e of derived.effects) if (e.teardown && e.fn !== null) update_effect(e);
|
|
577
|
+
}
|
|
578
|
+
//#endregion
|
|
579
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/checkPrivateRedeclaration.js
|
|
580
|
+
function _checkPrivateRedeclaration(e, t) {
|
|
581
|
+
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
582
|
+
}
|
|
583
|
+
//#endregion
|
|
584
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateMethodInitSpec.js
|
|
585
|
+
function _classPrivateMethodInitSpec(e, a) {
|
|
586
|
+
_checkPrivateRedeclaration(e, a), a.add(e);
|
|
587
|
+
}
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldInitSpec.js
|
|
590
|
+
function _classPrivateFieldInitSpec(e, t, a) {
|
|
591
|
+
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
592
|
+
}
|
|
593
|
+
//#endregion
|
|
594
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/assertClassBrand.js
|
|
595
|
+
function _assertClassBrand(e, t, n) {
|
|
596
|
+
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
597
|
+
throw new TypeError("Private element is not present on this object");
|
|
598
|
+
}
|
|
599
|
+
//#endregion
|
|
600
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldSet2.js
|
|
601
|
+
function _classPrivateFieldSet2(s, a, r) {
|
|
602
|
+
return s.set(_assertClassBrand(s, a), r), r;
|
|
603
|
+
}
|
|
604
|
+
//#endregion
|
|
605
|
+
//#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldGet2.js
|
|
606
|
+
function _classPrivateFieldGet2(s, a) {
|
|
607
|
+
return s.get(_assertClassBrand(s, a));
|
|
608
|
+
}
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/batch.js
|
|
611
|
+
/** @import { Fork } from 'svelte' */
|
|
612
|
+
/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
|
|
613
|
+
var _Batch;
|
|
614
|
+
/** @type {Batch | null} */
|
|
615
|
+
var first_batch = null;
|
|
616
|
+
/** @type {Batch | null} */
|
|
617
|
+
var last_batch = null;
|
|
618
|
+
/** @type {Batch | null} */
|
|
619
|
+
var current_batch = null;
|
|
620
|
+
/**
|
|
621
|
+
* This is needed to avoid overwriting inputs
|
|
622
|
+
* @type {Batch | null}
|
|
623
|
+
*/
|
|
624
|
+
var previous_batch = null;
|
|
625
|
+
/**
|
|
626
|
+
* When time travelling (i.e. working in one batch, while other batches
|
|
627
|
+
* still have ongoing work), we ignore the real values of affected
|
|
628
|
+
* signals in favour of their values within the batch
|
|
629
|
+
* @type {Map<Value, any> | null}
|
|
630
|
+
*/
|
|
631
|
+
var batch_values = null;
|
|
632
|
+
/** @type {Effect | null} */
|
|
633
|
+
var last_scheduled_effect = null;
|
|
634
|
+
var is_flushing_sync = false;
|
|
635
|
+
var is_processing = false;
|
|
636
|
+
/**
|
|
637
|
+
* During traversal, this is an array. Newly created effects are (if not immediately
|
|
638
|
+
* executed) pushed to this array, rather than going through the scheduling
|
|
639
|
+
* rigamarole that would cause another turn of the flush loop.
|
|
640
|
+
* @type {Effect[] | null}
|
|
641
|
+
*/
|
|
642
|
+
var collected_effects = null;
|
|
643
|
+
/**
|
|
644
|
+
* An array of effects that are marked during traversal as a result of a `set`
|
|
645
|
+
* (not `internal_set`) call. These will be added to the next batch and
|
|
646
|
+
* trigger another `batch.process()`
|
|
647
|
+
* @type {Effect[] | null}
|
|
648
|
+
* @deprecated when we get rid of legacy mode and stores, we can get rid of this
|
|
649
|
+
*/
|
|
650
|
+
var legacy_updates = null;
|
|
651
|
+
var flush_count = 0;
|
|
652
|
+
var uid = 1;
|
|
653
|
+
var _started = /* @__PURE__ */ new WeakMap();
|
|
654
|
+
var _prev = /* @__PURE__ */ new WeakMap();
|
|
655
|
+
var _next = /* @__PURE__ */ new WeakMap();
|
|
656
|
+
var _commit_callbacks = /* @__PURE__ */ new WeakMap();
|
|
657
|
+
var _discard_callbacks = /* @__PURE__ */ new WeakMap();
|
|
658
|
+
var _pending = /* @__PURE__ */ new WeakMap();
|
|
545
659
|
var _blocking_pending = /* @__PURE__ */ new WeakMap();
|
|
546
660
|
var _deferred = /* @__PURE__ */ new WeakMap();
|
|
547
661
|
var _roots = /* @__PURE__ */ new WeakMap();
|
|
@@ -680,6 +794,7 @@ var Batch = class Batch {
|
|
|
680
794
|
discard() {
|
|
681
795
|
for (const fn of _classPrivateFieldGet2(_discard_callbacks, this)) fn(this);
|
|
682
796
|
_classPrivateFieldGet2(_discard_callbacks, this).clear();
|
|
797
|
+
for (const deferred of this.async_deriveds.values()) deferred.reject(OBSOLETE);
|
|
683
798
|
_assertClassBrand(_Batch_brand, this, _unlink).call(this);
|
|
684
799
|
_classPrivateFieldGet2(_deferred, this)?.resolve();
|
|
685
800
|
}
|
|
@@ -890,7 +1005,10 @@ function _process() {
|
|
|
890
1005
|
const batch = next_batch;
|
|
891
1006
|
_classPrivateFieldGet2(_roots, batch).push(..._classPrivateFieldGet2(_roots, this).filter((r) => !_classPrivateFieldGet2(_roots, batch).includes(r)));
|
|
892
1007
|
} else next_batch = this;
|
|
893
|
-
if (next_batch !== null)
|
|
1008
|
+
if (next_batch !== null) {
|
|
1009
|
+
old_values.clear();
|
|
1010
|
+
_assertClassBrand(_Batch_brand, next_batch, _process).call(next_batch);
|
|
1011
|
+
}
|
|
894
1012
|
}
|
|
895
1013
|
/**
|
|
896
1014
|
* Traverse the effect tree, executing effects or stashing
|
|
@@ -951,6 +1069,7 @@ function _merge(batch) {
|
|
|
951
1069
|
const d = this.async_deriveds.get(effect);
|
|
952
1070
|
if (d) deferred.promise.then(d.resolve).catch(d.reject);
|
|
953
1071
|
}
|
|
1072
|
+
batch.async_deriveds.clear();
|
|
954
1073
|
this.transfer_effects(_classPrivateFieldGet2(_dirty_effects$1, batch), _classPrivateFieldGet2(_maybe_dirty_effects$1, batch));
|
|
955
1074
|
/**
|
|
956
1075
|
* mark all effects that depend on `batch.current`, except the
|
|
@@ -963,6 +1082,7 @@ function _merge(batch) {
|
|
|
963
1082
|
const mark = (value) => {
|
|
964
1083
|
var reactions = value.reactions;
|
|
965
1084
|
if (reactions === null) return;
|
|
1085
|
+
if ((value.f & 2) !== 0 && (value.f & 6144) === 0) return;
|
|
966
1086
|
for (const reaction of reactions) {
|
|
967
1087
|
var flags = reaction.f;
|
|
968
1088
|
if ((flags & 2) !== 0) mark(reaction);
|
|
@@ -1005,8 +1125,9 @@ function _commit() {
|
|
|
1005
1125
|
const d = batch.async_deriveds.get(effect);
|
|
1006
1126
|
if (d) deferred.promise.then(d.resolve).catch(d.reject);
|
|
1007
1127
|
}
|
|
1008
|
-
|
|
1009
|
-
|
|
1128
|
+
var current = [...batch.current.keys()].filter((source) => !batch.current.get(source)[1]);
|
|
1129
|
+
if (!_classPrivateFieldGet2(_started, batch) || current.length === 0) continue;
|
|
1130
|
+
var others = current.filter((source) => !this.current.has(source));
|
|
1010
1131
|
if (others.length === 0) {
|
|
1011
1132
|
if (is_earlier) batch.discard();
|
|
1012
1133
|
} else if (sources.length > 0) {
|
|
@@ -1202,1367 +1323,837 @@ function reset_all(effect) {
|
|
|
1202
1323
|
}
|
|
1203
1324
|
}
|
|
1204
1325
|
//#endregion
|
|
1205
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
1326
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/sources.js
|
|
1327
|
+
/** @import { Derived, Effect, Source, Value } from '#client' */
|
|
1328
|
+
/** @type {Set<Effect>} */
|
|
1329
|
+
var eager_effects = /* @__PURE__ */ new Set();
|
|
1330
|
+
/** @type {Map<Source, any>} */
|
|
1331
|
+
var old_values = /* @__PURE__ */ new Map();
|
|
1332
|
+
var eager_effects_deferred = false;
|
|
1206
1333
|
/**
|
|
1207
|
-
*
|
|
1208
|
-
*
|
|
1209
|
-
*
|
|
1210
|
-
*
|
|
1211
|
-
* the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.
|
|
1212
|
-
*
|
|
1213
|
-
* If `start` returns a cleanup function, it will be called when the effect is destroyed.
|
|
1214
|
-
*
|
|
1215
|
-
* If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects
|
|
1216
|
-
* are active, and the returned teardown function will only be called when all effects are destroyed.
|
|
1217
|
-
*
|
|
1218
|
-
* It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):
|
|
1219
|
-
*
|
|
1220
|
-
* ```js
|
|
1221
|
-
* import { createSubscriber } from 'svelte/reactivity';
|
|
1222
|
-
* import { on } from 'svelte/events';
|
|
1223
|
-
*
|
|
1224
|
-
* export class MediaQuery {
|
|
1225
|
-
* #query;
|
|
1226
|
-
* #subscribe;
|
|
1227
|
-
*
|
|
1228
|
-
* constructor(query) {
|
|
1229
|
-
* this.#query = window.matchMedia(`(${query})`);
|
|
1230
|
-
*
|
|
1231
|
-
* this.#subscribe = createSubscriber((update) => {
|
|
1232
|
-
* // when the `change` event occurs, re-run any effects that read `this.current`
|
|
1233
|
-
* const off = on(this.#query, 'change', update);
|
|
1234
|
-
*
|
|
1235
|
-
* // stop listening when all the effects are destroyed
|
|
1236
|
-
* return () => off();
|
|
1237
|
-
* });
|
|
1238
|
-
* }
|
|
1239
|
-
*
|
|
1240
|
-
* get current() {
|
|
1241
|
-
* // This makes the getter reactive, if read in an effect
|
|
1242
|
-
* this.#subscribe();
|
|
1243
|
-
*
|
|
1244
|
-
* // Return the current state of the query, whether or not we're in an effect
|
|
1245
|
-
* return this.#query.matches;
|
|
1246
|
-
* }
|
|
1247
|
-
* }
|
|
1248
|
-
* ```
|
|
1249
|
-
* @param {(update: () => void) => (() => void) | void} start
|
|
1250
|
-
* @since 5.7.0
|
|
1334
|
+
* @template V
|
|
1335
|
+
* @param {V} v
|
|
1336
|
+
* @param {Error | null} [stack]
|
|
1337
|
+
* @returns {Source<V>}
|
|
1251
1338
|
*/
|
|
1252
|
-
function
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
render_effect(() => {
|
|
1261
|
-
if (subscribers === 0) stop = untrack(() => start(() => increment(version)));
|
|
1262
|
-
subscribers += 1;
|
|
1263
|
-
return () => {
|
|
1264
|
-
queue_micro_task(() => {
|
|
1265
|
-
subscribers -= 1;
|
|
1266
|
-
if (subscribers === 0) {
|
|
1267
|
-
stop?.();
|
|
1268
|
-
stop = void 0;
|
|
1269
|
-
increment(version);
|
|
1270
|
-
}
|
|
1271
|
-
});
|
|
1272
|
-
};
|
|
1273
|
-
});
|
|
1274
|
-
}
|
|
1339
|
+
function source(v, stack) {
|
|
1340
|
+
return {
|
|
1341
|
+
f: 0,
|
|
1342
|
+
v,
|
|
1343
|
+
reactions: null,
|
|
1344
|
+
equals,
|
|
1345
|
+
rv: 0,
|
|
1346
|
+
wv: 0
|
|
1275
1347
|
};
|
|
1276
1348
|
}
|
|
1277
|
-
//#endregion
|
|
1278
|
-
//#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
|
|
1279
|
-
/** @import { Effect, Source, TemplateNode, } from '#client' */
|
|
1280
1349
|
/**
|
|
1281
|
-
* @
|
|
1282
|
-
*
|
|
1283
|
-
*
|
|
1284
|
-
* pending?: ((anchor: Node) => void) | null;
|
|
1285
|
-
* }} BoundaryProps
|
|
1350
|
+
* @template V
|
|
1351
|
+
* @param {V} v
|
|
1352
|
+
* @param {Error | null} [stack]
|
|
1286
1353
|
*/
|
|
1287
|
-
|
|
1354
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1355
|
+
function state(v, stack) {
|
|
1356
|
+
const s = source(v, stack);
|
|
1357
|
+
push_reaction_value(s);
|
|
1358
|
+
return s;
|
|
1359
|
+
}
|
|
1288
1360
|
/**
|
|
1289
|
-
* @
|
|
1290
|
-
* @param {
|
|
1291
|
-
* @param {
|
|
1292
|
-
* @
|
|
1293
|
-
* @returns {void}
|
|
1361
|
+
* @template V
|
|
1362
|
+
* @param {V} initial_value
|
|
1363
|
+
* @param {boolean} [immutable]
|
|
1364
|
+
* @returns {Source<V>}
|
|
1294
1365
|
*/
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
var
|
|
1301
|
-
|
|
1302
|
-
var _effect = /* @__PURE__ */ new WeakMap();
|
|
1303
|
-
var _main_effect = /* @__PURE__ */ new WeakMap();
|
|
1304
|
-
var _pending_effect = /* @__PURE__ */ new WeakMap();
|
|
1305
|
-
var _failed_effect = /* @__PURE__ */ new WeakMap();
|
|
1306
|
-
var _offscreen_fragment = /* @__PURE__ */ new WeakMap();
|
|
1307
|
-
var _local_pending_count = /* @__PURE__ */ new WeakMap();
|
|
1308
|
-
var _pending_count = /* @__PURE__ */ new WeakMap();
|
|
1309
|
-
var _pending_count_update_queued = /* @__PURE__ */ new WeakMap();
|
|
1310
|
-
var _dirty_effects = /* @__PURE__ */ new WeakMap();
|
|
1311
|
-
var _maybe_dirty_effects = /* @__PURE__ */ new WeakMap();
|
|
1312
|
-
var _effect_pending = /* @__PURE__ */ new WeakMap();
|
|
1313
|
-
var _effect_pending_subscriber = /* @__PURE__ */ new WeakMap();
|
|
1314
|
-
var _Boundary_brand = /* @__PURE__ */ new WeakSet();
|
|
1315
|
-
var Boundary = class {
|
|
1316
|
-
/**
|
|
1317
|
-
* @param {TemplateNode} node
|
|
1318
|
-
* @param {BoundaryProps} props
|
|
1319
|
-
* @param {((anchor: Node) => void)} children
|
|
1320
|
-
* @param {((error: unknown) => unknown) | undefined} [transform_error]
|
|
1321
|
-
*/
|
|
1322
|
-
constructor(node, props, children, transform_error) {
|
|
1323
|
-
_classPrivateMethodInitSpec(this, _Boundary_brand);
|
|
1324
|
-
_defineProperty(
|
|
1325
|
-
this,
|
|
1326
|
-
/** @type {Boundary | null} */
|
|
1327
|
-
"parent",
|
|
1328
|
-
void 0
|
|
1329
|
-
);
|
|
1330
|
-
_defineProperty(this, "is_pending", false);
|
|
1331
|
-
_defineProperty(
|
|
1332
|
-
this,
|
|
1333
|
-
/**
|
|
1334
|
-
* API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
|
|
1335
|
-
* Inherited from parent boundary, or defaults to identity.
|
|
1336
|
-
* @type {(error: unknown) => unknown}
|
|
1337
|
-
*/
|
|
1338
|
-
"transform_error",
|
|
1339
|
-
void 0
|
|
1340
|
-
);
|
|
1341
|
-
_classPrivateFieldInitSpec(this, _anchor, void 0);
|
|
1342
|
-
_classPrivateFieldInitSpec(this, _hydrate_open, hydrating ? hydrate_node : null);
|
|
1343
|
-
_classPrivateFieldInitSpec(this, _props, void 0);
|
|
1344
|
-
_classPrivateFieldInitSpec(this, _children, void 0);
|
|
1345
|
-
_classPrivateFieldInitSpec(this, _effect, void 0);
|
|
1346
|
-
_classPrivateFieldInitSpec(this, _main_effect, null);
|
|
1347
|
-
_classPrivateFieldInitSpec(this, _pending_effect, null);
|
|
1348
|
-
_classPrivateFieldInitSpec(this, _failed_effect, null);
|
|
1349
|
-
_classPrivateFieldInitSpec(this, _offscreen_fragment, null);
|
|
1350
|
-
_classPrivateFieldInitSpec(this, _local_pending_count, 0);
|
|
1351
|
-
_classPrivateFieldInitSpec(this, _pending_count, 0);
|
|
1352
|
-
_classPrivateFieldInitSpec(this, _pending_count_update_queued, false);
|
|
1353
|
-
_classPrivateFieldInitSpec(this, _dirty_effects, /* @__PURE__ */ new Set());
|
|
1354
|
-
_classPrivateFieldInitSpec(this, _maybe_dirty_effects, /* @__PURE__ */ new Set());
|
|
1355
|
-
_classPrivateFieldInitSpec(this, _effect_pending, null);
|
|
1356
|
-
_classPrivateFieldInitSpec(this, _effect_pending_subscriber, createSubscriber(() => {
|
|
1357
|
-
_classPrivateFieldSet2(_effect_pending, this, source(_classPrivateFieldGet2(_local_pending_count, this)));
|
|
1358
|
-
return () => {
|
|
1359
|
-
_classPrivateFieldSet2(_effect_pending, this, null);
|
|
1360
|
-
};
|
|
1361
|
-
}));
|
|
1362
|
-
_classPrivateFieldSet2(_anchor, this, node);
|
|
1363
|
-
_classPrivateFieldSet2(_props, this, props);
|
|
1364
|
-
_classPrivateFieldSet2(_children, this, (anchor) => {
|
|
1365
|
-
var effect = active_effect;
|
|
1366
|
-
effect.b = this;
|
|
1367
|
-
effect.f |= 128;
|
|
1368
|
-
children(anchor);
|
|
1369
|
-
});
|
|
1370
|
-
this.parent = active_effect.b;
|
|
1371
|
-
this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
|
|
1372
|
-
_classPrivateFieldSet2(_effect, this, block(() => {
|
|
1373
|
-
if (hydrating) {
|
|
1374
|
-
const comment = _classPrivateFieldGet2(_hydrate_open, this);
|
|
1375
|
-
hydrate_next();
|
|
1376
|
-
const server_rendered_pending = comment.data === "[!";
|
|
1377
|
-
if (comment.data.startsWith("[?")) {
|
|
1378
|
-
const serialized_error = JSON.parse(comment.data.slice(2));
|
|
1379
|
-
_assertClassBrand(_Boundary_brand, this, _hydrate_failed_content).call(this, serialized_error);
|
|
1380
|
-
} else if (server_rendered_pending) _assertClassBrand(_Boundary_brand, this, _hydrate_pending_content).call(this);
|
|
1381
|
-
else _assertClassBrand(_Boundary_brand, this, _hydrate_resolved_content).call(this);
|
|
1382
|
-
} else _assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
1383
|
-
}, flags));
|
|
1384
|
-
if (hydrating) _classPrivateFieldSet2(_anchor, this, hydrate_node);
|
|
1385
|
-
}
|
|
1386
|
-
/**
|
|
1387
|
-
* Defer an effect inside a pending boundary until the boundary resolves
|
|
1388
|
-
* @param {Effect} effect
|
|
1389
|
-
*/
|
|
1390
|
-
defer_effect(effect) {
|
|
1391
|
-
defer_effect(effect, _classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
|
|
1392
|
-
}
|
|
1393
|
-
/**
|
|
1394
|
-
* Returns `false` if the effect exists inside a boundary whose pending snippet is shown
|
|
1395
|
-
* @returns {boolean}
|
|
1396
|
-
*/
|
|
1397
|
-
is_rendered() {
|
|
1398
|
-
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
1399
|
-
}
|
|
1400
|
-
has_pending_snippet() {
|
|
1401
|
-
return !!_classPrivateFieldGet2(_props, this).pending;
|
|
1402
|
-
}
|
|
1403
|
-
/**
|
|
1404
|
-
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
1405
|
-
* and controls when the current `pending` snippet (if any) is removed.
|
|
1406
|
-
* Do not call from inside the class
|
|
1407
|
-
* @param {1 | -1} d
|
|
1408
|
-
* @param {Batch} batch
|
|
1409
|
-
*/
|
|
1410
|
-
update_pending_count(d, batch) {
|
|
1411
|
-
_assertClassBrand(_Boundary_brand, this, _update_pending_count).call(this, d, batch);
|
|
1412
|
-
_classPrivateFieldSet2(_local_pending_count, this, _classPrivateFieldGet2(_local_pending_count, this) + d);
|
|
1413
|
-
if (!_classPrivateFieldGet2(_effect_pending, this) || _classPrivateFieldGet2(_pending_count_update_queued, this)) return;
|
|
1414
|
-
_classPrivateFieldSet2(_pending_count_update_queued, this, true);
|
|
1415
|
-
queue_micro_task(() => {
|
|
1416
|
-
_classPrivateFieldSet2(_pending_count_update_queued, this, false);
|
|
1417
|
-
if (_classPrivateFieldGet2(_effect_pending, this)) internal_set(_classPrivateFieldGet2(_effect_pending, this), _classPrivateFieldGet2(_local_pending_count, this));
|
|
1418
|
-
});
|
|
1419
|
-
}
|
|
1420
|
-
get_effect_pending() {
|
|
1421
|
-
_classPrivateFieldGet2(_effect_pending_subscriber, this).call(this);
|
|
1422
|
-
return get(_classPrivateFieldGet2(_effect_pending, this));
|
|
1423
|
-
}
|
|
1424
|
-
/** @param {unknown} error */
|
|
1425
|
-
error(error) {
|
|
1426
|
-
if (!_classPrivateFieldGet2(_props, this).onerror && !_classPrivateFieldGet2(_props, this).failed) throw error;
|
|
1427
|
-
if (current_batch?.is_fork) {
|
|
1428
|
-
if (_classPrivateFieldGet2(_main_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_main_effect, this));
|
|
1429
|
-
if (_classPrivateFieldGet2(_pending_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_pending_effect, this));
|
|
1430
|
-
if (_classPrivateFieldGet2(_failed_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_failed_effect, this));
|
|
1431
|
-
current_batch.oncommit(() => {
|
|
1432
|
-
_assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
|
|
1433
|
-
});
|
|
1434
|
-
} else _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
|
|
1435
|
-
}
|
|
1436
|
-
};
|
|
1437
|
-
function _hydrate_resolved_content() {
|
|
1438
|
-
try {
|
|
1439
|
-
_classPrivateFieldSet2(_main_effect, this, branch(() => _classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this))));
|
|
1440
|
-
} catch (error) {
|
|
1441
|
-
this.error(error);
|
|
1366
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
1367
|
+
function mutable_source(initial_value, immutable = false, trackable = true) {
|
|
1368
|
+
const s = source(initial_value);
|
|
1369
|
+
if (!immutable) s.equals = safe_equals;
|
|
1370
|
+
if (legacy_mode_flag && trackable && component_context !== null && component_context.l !== null) {
|
|
1371
|
+
var _component_context$l;
|
|
1372
|
+
((_component_context$l = component_context.l).s ?? (_component_context$l.s = [])).push(s);
|
|
1442
1373
|
}
|
|
1374
|
+
return s;
|
|
1443
1375
|
}
|
|
1444
1376
|
/**
|
|
1445
|
-
* @
|
|
1377
|
+
* @template V
|
|
1378
|
+
* @param {Source<V>} source
|
|
1379
|
+
* @param {V} value
|
|
1380
|
+
* @param {boolean} [should_proxy]
|
|
1381
|
+
* @returns {V}
|
|
1446
1382
|
*/
|
|
1447
|
-
function
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
_classPrivateFieldSet2(_failed_effect, this, branch(() => {
|
|
1451
|
-
failed(_classPrivateFieldGet2(_anchor, this), () => error, () => () => {});
|
|
1452
|
-
}));
|
|
1383
|
+
function set(source, value, should_proxy = false) {
|
|
1384
|
+
if (active_reaction !== null && (!untracking || (active_reaction.f & 131072) !== 0) && is_runes() && (active_reaction.f & 4325394) !== 0 && (current_sources === null || !current_sources.has(source))) state_unsafe_mutation();
|
|
1385
|
+
return internal_set(source, should_proxy ? proxy(value) : value, legacy_updates);
|
|
1453
1386
|
}
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
});
|
|
1472
|
-
_assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
1387
|
+
/**
|
|
1388
|
+
* @template V
|
|
1389
|
+
* @param {Source<V>} source
|
|
1390
|
+
* @param {V} value
|
|
1391
|
+
* @param {Effect[] | null} [updated_during_traversal]
|
|
1392
|
+
* @returns {V}
|
|
1393
|
+
*/
|
|
1394
|
+
function internal_set(source, value, updated_during_traversal = null) {
|
|
1395
|
+
if (!source.equals(value)) {
|
|
1396
|
+
if (is_destroying_effect) old_values.set(source, value);
|
|
1397
|
+
else if (!old_values.has(source)) old_values.set(source, source.v);
|
|
1398
|
+
var batch = Batch.ensure();
|
|
1399
|
+
batch.capture(source, value);
|
|
1400
|
+
if ((source.f & 2) !== 0) {
|
|
1401
|
+
const derived = source;
|
|
1402
|
+
if ((source.f & 2048) !== 0) execute_derived(derived);
|
|
1403
|
+
if (batch_values === null) update_derived_status(derived);
|
|
1473
1404
|
}
|
|
1474
|
-
|
|
1405
|
+
source.wv = increment_write_version();
|
|
1406
|
+
mark_reactions(source, DIRTY, updated_during_traversal);
|
|
1407
|
+
if (is_runes() && active_effect !== null && (active_effect.f & 1024) !== 0 && (active_effect.f & 96) === 0) if (untracked_writes === null) set_untracked_writes([source]);
|
|
1408
|
+
else untracked_writes.push(source);
|
|
1409
|
+
if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) flush_eager_effects();
|
|
1410
|
+
}
|
|
1411
|
+
return value;
|
|
1475
1412
|
}
|
|
1476
|
-
function
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
const pending = _classPrivateFieldGet2(_props, this).pending;
|
|
1488
|
-
_classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
|
|
1489
|
-
} else _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
1490
|
-
} catch (error) {
|
|
1491
|
-
this.error(error);
|
|
1413
|
+
function flush_eager_effects() {
|
|
1414
|
+
eager_effects_deferred = false;
|
|
1415
|
+
for (const effect of eager_effects) {
|
|
1416
|
+
if ((effect.f & 1024) !== 0) set_signal_status(effect, MAYBE_DIRTY);
|
|
1417
|
+
let dirty;
|
|
1418
|
+
try {
|
|
1419
|
+
dirty = is_dirty(effect);
|
|
1420
|
+
} catch {
|
|
1421
|
+
dirty = true;
|
|
1422
|
+
}
|
|
1423
|
+
if (dirty) update_effect(effect);
|
|
1492
1424
|
}
|
|
1425
|
+
eager_effects.clear();
|
|
1493
1426
|
}
|
|
1494
1427
|
/**
|
|
1495
|
-
*
|
|
1428
|
+
* Silently (without using `get`) increment a source
|
|
1429
|
+
* @param {Source<number>} source
|
|
1496
1430
|
*/
|
|
1497
|
-
function
|
|
1498
|
-
|
|
1499
|
-
batch.transfer_effects(_classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
|
|
1431
|
+
function increment(source) {
|
|
1432
|
+
set(source, source.v + 1);
|
|
1500
1433
|
}
|
|
1501
1434
|
/**
|
|
1502
|
-
* @
|
|
1503
|
-
* @param {
|
|
1435
|
+
* @param {Value} signal
|
|
1436
|
+
* @param {number} status should be DIRTY or MAYBE_DIRTY
|
|
1437
|
+
* @param {Effect[] | null} updated_during_traversal
|
|
1438
|
+
* @returns {void}
|
|
1504
1439
|
*/
|
|
1505
|
-
function
|
|
1506
|
-
var
|
|
1507
|
-
|
|
1508
|
-
var
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1440
|
+
function mark_reactions(signal, status, updated_during_traversal) {
|
|
1441
|
+
var reactions = signal.reactions;
|
|
1442
|
+
if (reactions === null) return;
|
|
1443
|
+
var runes = is_runes();
|
|
1444
|
+
var length = reactions.length;
|
|
1445
|
+
for (var i = 0; i < length; i++) {
|
|
1446
|
+
var reaction = reactions[i];
|
|
1447
|
+
var flags = reaction.f;
|
|
1448
|
+
if (!runes && reaction === active_effect) continue;
|
|
1449
|
+
var not_dirty = (flags & DIRTY) === 0;
|
|
1450
|
+
if (not_dirty) set_signal_status(reaction, status);
|
|
1451
|
+
if ((flags & 131072) !== 0) eager_effects.add(reaction);
|
|
1452
|
+
else if ((flags & 2) !== 0) {
|
|
1453
|
+
var derived = reaction;
|
|
1454
|
+
batch_values?.delete(derived);
|
|
1455
|
+
if ((flags & 65536) === 0) {
|
|
1456
|
+
if (flags & 512 && (active_effect === null || (active_effect.f & 2097152) === 0)) reaction.f |= WAS_MARKED;
|
|
1457
|
+
mark_reactions(derived, MAYBE_DIRTY, updated_during_traversal);
|
|
1458
|
+
}
|
|
1459
|
+
} else if (not_dirty) {
|
|
1460
|
+
var effect = reaction;
|
|
1461
|
+
if ((flags & 16) !== 0 && eager_block_effects !== null) eager_block_effects.add(effect);
|
|
1462
|
+
if (updated_during_traversal !== null) updated_during_traversal.push(effect);
|
|
1463
|
+
else schedule_effect(effect);
|
|
1464
|
+
}
|
|
1522
1465
|
}
|
|
1523
1466
|
}
|
|
1524
1467
|
/**
|
|
1525
|
-
*
|
|
1526
|
-
*
|
|
1527
|
-
* @
|
|
1528
|
-
* @param {Batch} batch
|
|
1468
|
+
* @template T
|
|
1469
|
+
* @param {T} value
|
|
1470
|
+
* @returns {T}
|
|
1529
1471
|
*/
|
|
1530
|
-
function
|
|
1531
|
-
if (
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1472
|
+
function proxy(value) {
|
|
1473
|
+
if (typeof value !== "object" || value === null || STATE_SYMBOL in value || COMPONENT_SYMBOL in value) return value;
|
|
1474
|
+
const prototype = get_prototype_of(value);
|
|
1475
|
+
if (prototype !== object_prototype && prototype !== array_prototype) return value;
|
|
1476
|
+
/** @type {Map<any, Source<any>>} */
|
|
1477
|
+
var sources = /* @__PURE__ */ new Map();
|
|
1478
|
+
var is_proxied_array = is_array(value);
|
|
1479
|
+
var version = /* @__PURE__ */ state(0);
|
|
1480
|
+
var stack = null;
|
|
1481
|
+
var parent_version = update_version;
|
|
1482
|
+
/**
|
|
1483
|
+
* Executes the proxy in the context of the reaction it was originally created in, if any
|
|
1484
|
+
* @template T
|
|
1485
|
+
* @param {() => T} fn
|
|
1486
|
+
*/
|
|
1487
|
+
var with_parent = (fn) => {
|
|
1488
|
+
if (update_version === parent_version) return fn();
|
|
1489
|
+
var reaction = active_reaction;
|
|
1490
|
+
var version = update_version;
|
|
1491
|
+
set_active_reaction(null);
|
|
1492
|
+
set_update_version(parent_version);
|
|
1493
|
+
var result = fn();
|
|
1494
|
+
set_active_reaction(reaction);
|
|
1495
|
+
set_update_version(version);
|
|
1496
|
+
return result;
|
|
1497
|
+
};
|
|
1498
|
+
if (is_proxied_array) sources.set("length", /* @__PURE__ */ state(
|
|
1499
|
+
/** @type {any[]} */
|
|
1500
|
+
value.length,
|
|
1501
|
+
stack
|
|
1502
|
+
));
|
|
1503
|
+
return new Proxy(value, {
|
|
1504
|
+
defineProperty(_, prop, descriptor) {
|
|
1505
|
+
if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) state_descriptors_fixed();
|
|
1506
|
+
var s = sources.get(prop);
|
|
1507
|
+
if (s === void 0) with_parent(() => {
|
|
1508
|
+
var s = /* @__PURE__ */ state(descriptor.value, stack);
|
|
1509
|
+
sources.set(prop, s);
|
|
1510
|
+
return s;
|
|
1511
|
+
});
|
|
1512
|
+
else set(s, descriptor.value, true);
|
|
1513
|
+
return true;
|
|
1514
|
+
},
|
|
1515
|
+
deleteProperty(target, prop) {
|
|
1516
|
+
var s = sources.get(prop);
|
|
1517
|
+
if (s === void 0) {
|
|
1518
|
+
if (prop in target) {
|
|
1519
|
+
const s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED, stack));
|
|
1520
|
+
sources.set(prop, s);
|
|
1521
|
+
increment(version);
|
|
1522
|
+
}
|
|
1523
|
+
} else {
|
|
1524
|
+
set(s, UNINITIALIZED);
|
|
1525
|
+
increment(version);
|
|
1526
|
+
}
|
|
1527
|
+
return true;
|
|
1528
|
+
},
|
|
1529
|
+
get(target, prop, receiver) {
|
|
1530
|
+
if (prop === STATE_SYMBOL) return value;
|
|
1531
|
+
var s = sources.get(prop);
|
|
1532
|
+
var exists = prop in target;
|
|
1533
|
+
if (s === void 0 && (!exists || get_descriptor(target, prop)?.writable)) {
|
|
1534
|
+
s = with_parent(() => {
|
|
1535
|
+
return /* @__PURE__ */ state(proxy(exists ? target[prop] : UNINITIALIZED), stack);
|
|
1536
|
+
});
|
|
1537
|
+
sources.set(prop, s);
|
|
1538
|
+
}
|
|
1539
|
+
if (s !== void 0) {
|
|
1540
|
+
var v = get(s);
|
|
1541
|
+
return v === UNINITIALIZED ? void 0 : v;
|
|
1542
|
+
}
|
|
1543
|
+
return Reflect.get(target, prop, receiver);
|
|
1544
|
+
},
|
|
1545
|
+
getOwnPropertyDescriptor(target, prop) {
|
|
1546
|
+
var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
1547
|
+
if (descriptor && "value" in descriptor) {
|
|
1548
|
+
var s = sources.get(prop);
|
|
1549
|
+
if (s) descriptor.value = get(s);
|
|
1550
|
+
} else if (descriptor === void 0) {
|
|
1551
|
+
var source = sources.get(prop);
|
|
1552
|
+
var value = source?.v;
|
|
1553
|
+
if (source !== void 0 && value !== UNINITIALIZED) return {
|
|
1554
|
+
enumerable: true,
|
|
1555
|
+
configurable: true,
|
|
1556
|
+
value,
|
|
1557
|
+
writable: true
|
|
1558
|
+
};
|
|
1559
|
+
}
|
|
1560
|
+
return descriptor;
|
|
1561
|
+
},
|
|
1562
|
+
has(target, prop) {
|
|
1563
|
+
if (prop === STATE_SYMBOL) return true;
|
|
1564
|
+
var s = sources.get(prop);
|
|
1565
|
+
var has = s !== void 0 && s.v !== UNINITIALIZED || Reflect.has(target, prop);
|
|
1566
|
+
if (s !== void 0 || active_effect !== null && (!has || get_descriptor(target, prop)?.writable)) {
|
|
1567
|
+
if (s === void 0) {
|
|
1568
|
+
s = with_parent(() => {
|
|
1569
|
+
return /* @__PURE__ */ state(has ? proxy(target[prop]) : UNINITIALIZED, stack);
|
|
1570
|
+
});
|
|
1571
|
+
sources.set(prop, s);
|
|
1572
|
+
}
|
|
1573
|
+
if (get(s) === UNINITIALIZED) return false;
|
|
1574
|
+
}
|
|
1575
|
+
return has;
|
|
1576
|
+
},
|
|
1577
|
+
set(target, prop, value, receiver) {
|
|
1578
|
+
var s = sources.get(prop);
|
|
1579
|
+
var has = prop in target;
|
|
1580
|
+
if (is_proxied_array && prop === "length") for (var i = value; i < s.v; i += 1) {
|
|
1581
|
+
var other_s = sources.get(i + "");
|
|
1582
|
+
if (other_s !== void 0) set(other_s, UNINITIALIZED);
|
|
1583
|
+
else if (i in target) {
|
|
1584
|
+
other_s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED, stack));
|
|
1585
|
+
sources.set(i + "", other_s);
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
if (s === void 0) {
|
|
1589
|
+
if (!has || get_descriptor(target, prop)?.writable) {
|
|
1590
|
+
s = with_parent(() => /* @__PURE__ */ state(void 0, stack));
|
|
1591
|
+
set(s, proxy(value));
|
|
1592
|
+
sources.set(prop, s);
|
|
1593
|
+
}
|
|
1594
|
+
} else {
|
|
1595
|
+
has = s.v !== UNINITIALIZED;
|
|
1596
|
+
var p = with_parent(() => proxy(value));
|
|
1597
|
+
set(s, p);
|
|
1598
|
+
}
|
|
1599
|
+
var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
1600
|
+
if (descriptor?.set) descriptor.set.call(receiver, value);
|
|
1601
|
+
if (!has) {
|
|
1602
|
+
if (is_proxied_array && typeof prop === "string") {
|
|
1603
|
+
var ls = sources.get("length");
|
|
1604
|
+
var n = Number(prop);
|
|
1605
|
+
if (Number.isInteger(n) && n >= ls.v) set(ls, n + 1);
|
|
1606
|
+
}
|
|
1607
|
+
increment(version);
|
|
1608
|
+
}
|
|
1609
|
+
return true;
|
|
1610
|
+
},
|
|
1611
|
+
ownKeys(target) {
|
|
1612
|
+
get(version);
|
|
1613
|
+
var own_keys = Reflect.ownKeys(target).filter((key) => {
|
|
1614
|
+
var source = sources.get(key);
|
|
1615
|
+
return source === void 0 || source.v !== UNINITIALIZED;
|
|
1616
|
+
});
|
|
1617
|
+
for (var [key, source] of sources) if (source.v !== UNINITIALIZED && !(key in target)) own_keys.push(key);
|
|
1618
|
+
return own_keys;
|
|
1619
|
+
},
|
|
1620
|
+
setPrototypeOf() {
|
|
1621
|
+
state_prototype_fixed();
|
|
1547
1622
|
}
|
|
1548
|
-
}
|
|
1623
|
+
});
|
|
1549
1624
|
}
|
|
1625
|
+
//#endregion
|
|
1626
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/operations.js
|
|
1627
|
+
/** @type {Window} */
|
|
1628
|
+
var $window;
|
|
1629
|
+
/** @type {boolean} */
|
|
1630
|
+
var is_firefox;
|
|
1631
|
+
/** @type {() => Node | null} */
|
|
1632
|
+
var first_child_getter;
|
|
1633
|
+
/** @type {() => Node | null} */
|
|
1634
|
+
var next_sibling_getter;
|
|
1550
1635
|
/**
|
|
1551
|
-
*
|
|
1636
|
+
* Initialize these lazily to avoid issues when using the runtime in a server context
|
|
1637
|
+
* where these globals are not available while avoiding a separate server entry point
|
|
1552
1638
|
*/
|
|
1553
|
-
function
|
|
1554
|
-
if (
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
if (
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
set_hydrate_node(_classPrivateFieldGet2(_hydrate_open, this));
|
|
1568
|
-
next();
|
|
1569
|
-
set_hydrate_node(skip_nodes());
|
|
1639
|
+
function init_operations() {
|
|
1640
|
+
if ($window !== void 0) return;
|
|
1641
|
+
$window = window;
|
|
1642
|
+
is_firefox = /Firefox/.test(navigator.userAgent);
|
|
1643
|
+
var element_prototype = Element.prototype;
|
|
1644
|
+
var node_prototype = Node.prototype;
|
|
1645
|
+
var text_prototype = Text.prototype;
|
|
1646
|
+
first_child_getter = get_descriptor(node_prototype, "firstChild").get;
|
|
1647
|
+
next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
|
|
1648
|
+
if (is_extensible(element_prototype)) {
|
|
1649
|
+
/** @type {any} */ element_prototype[CLASS_CACHE] = void 0;
|
|
1650
|
+
/** @type {any} */ element_prototype[ATTRIBUTES_CACHE] = null;
|
|
1651
|
+
/** @type {any} */ element_prototype[STYLE_CACHE] = void 0;
|
|
1652
|
+
element_prototype.__e = void 0;
|
|
1570
1653
|
}
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
var did_reset = false;
|
|
1574
|
-
var calling_on_error = false;
|
|
1575
|
-
const reset = () => {
|
|
1576
|
-
if (did_reset) {
|
|
1577
|
-
svelte_boundary_reset_noop();
|
|
1578
|
-
return;
|
|
1579
|
-
}
|
|
1580
|
-
did_reset = true;
|
|
1581
|
-
if (calling_on_error) svelte_boundary_reset_onerror();
|
|
1582
|
-
if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
|
|
1583
|
-
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
1584
|
-
});
|
|
1585
|
-
_assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
1586
|
-
_assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
1587
|
-
});
|
|
1588
|
-
};
|
|
1589
|
-
/** @param {unknown} transformed_error */
|
|
1590
|
-
const handle_error_result = (transformed_error) => {
|
|
1591
|
-
try {
|
|
1592
|
-
calling_on_error = true;
|
|
1593
|
-
onerror?.(transformed_error, reset);
|
|
1594
|
-
calling_on_error = false;
|
|
1595
|
-
} catch (error) {
|
|
1596
|
-
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
1597
|
-
}
|
|
1598
|
-
if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
1599
|
-
try {
|
|
1600
|
-
return branch(() => {
|
|
1601
|
-
var effect = active_effect;
|
|
1602
|
-
effect.b = this;
|
|
1603
|
-
effect.f |= 128;
|
|
1604
|
-
failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
|
|
1605
|
-
});
|
|
1606
|
-
} catch (error) {
|
|
1607
|
-
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
|
|
1608
|
-
return null;
|
|
1609
|
-
}
|
|
1610
|
-
}));
|
|
1611
|
-
};
|
|
1612
|
-
queue_micro_task(() => {
|
|
1613
|
-
/** @type {unknown} */
|
|
1614
|
-
var result;
|
|
1615
|
-
try {
|
|
1616
|
-
result = this.transform_error(error);
|
|
1617
|
-
} catch (e) {
|
|
1618
|
-
invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
1619
|
-
return;
|
|
1620
|
-
}
|
|
1621
|
-
if (result !== null && typeof result === "object" && typeof result.then === "function")
|
|
1622
|
-
/** @type {any} */ result.then(
|
|
1623
|
-
handle_error_result,
|
|
1624
|
-
/** @param {unknown} e */
|
|
1625
|
-
(e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
|
|
1626
|
-
);
|
|
1627
|
-
else handle_error_result(result);
|
|
1628
|
-
});
|
|
1654
|
+
if (is_extensible(text_prototype))
|
|
1655
|
+
/** @type {any} */ text_prototype[TEXT_CACHE] = void 0;
|
|
1629
1656
|
}
|
|
1630
1657
|
/**
|
|
1631
|
-
* @
|
|
1632
|
-
* @
|
|
1633
|
-
* @returns {Derived<V>}
|
|
1658
|
+
* @param {string} value
|
|
1659
|
+
* @returns {Text}
|
|
1634
1660
|
*/
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
var flags = 2 | DIRTY;
|
|
1638
|
-
if (active_effect !== null) active_effect.f |= EFFECT_PRESERVED;
|
|
1639
|
-
return {
|
|
1640
|
-
ctx: component_context,
|
|
1641
|
-
deps: null,
|
|
1642
|
-
effects: null,
|
|
1643
|
-
equals,
|
|
1644
|
-
f: flags,
|
|
1645
|
-
fn,
|
|
1646
|
-
reactions: null,
|
|
1647
|
-
rv: 0,
|
|
1648
|
-
v: UNINITIALIZED,
|
|
1649
|
-
wv: 0,
|
|
1650
|
-
parent: active_effect,
|
|
1651
|
-
ac: null
|
|
1652
|
-
};
|
|
1661
|
+
function create_text(value = "") {
|
|
1662
|
+
return document.createTextNode(value);
|
|
1653
1663
|
}
|
|
1654
1664
|
/**
|
|
1655
|
-
* @template
|
|
1656
|
-
* @param {
|
|
1657
|
-
* @returns {Derived<V>}
|
|
1665
|
+
* @template {Node} N
|
|
1666
|
+
* @param {N} node
|
|
1658
1667
|
*/
|
|
1659
|
-
|
|
1660
|
-
function
|
|
1661
|
-
|
|
1662
|
-
signal.equals = safe_equals;
|
|
1663
|
-
return signal;
|
|
1668
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1669
|
+
function get_first_child(node) {
|
|
1670
|
+
return first_child_getter.call(node);
|
|
1664
1671
|
}
|
|
1665
1672
|
/**
|
|
1666
|
-
* @
|
|
1667
|
-
* @
|
|
1673
|
+
* @template {Node} N
|
|
1674
|
+
* @param {N} node
|
|
1668
1675
|
*/
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
derived.effects = null;
|
|
1673
|
-
for (var i = 0; i < effects.length; i += 1) destroy_effect(effects[i]);
|
|
1674
|
-
}
|
|
1676
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
1677
|
+
function get_next_sibling(node) {
|
|
1678
|
+
return next_sibling_getter.call(node);
|
|
1675
1679
|
}
|
|
1676
1680
|
/**
|
|
1677
|
-
* @template
|
|
1678
|
-
* @param {
|
|
1679
|
-
* @returns {
|
|
1681
|
+
* @template {Node} N
|
|
1682
|
+
* @param {N} node
|
|
1683
|
+
* @returns {void}
|
|
1680
1684
|
*/
|
|
1681
|
-
function
|
|
1682
|
-
|
|
1683
|
-
var prev_active_effect = active_effect;
|
|
1684
|
-
var parent = derived.parent;
|
|
1685
|
-
if (!is_destroying_effect && parent !== null && derived.v !== UNINITIALIZED && (parent.f & 24576) !== 0) {
|
|
1686
|
-
derived_inert();
|
|
1687
|
-
return derived.v;
|
|
1688
|
-
}
|
|
1689
|
-
set_active_effect(parent);
|
|
1690
|
-
try {
|
|
1691
|
-
derived.f &= ~WAS_MARKED;
|
|
1692
|
-
destroy_derived_effects(derived);
|
|
1693
|
-
value = update_reaction(derived);
|
|
1694
|
-
} finally {
|
|
1695
|
-
set_active_effect(prev_active_effect);
|
|
1696
|
-
}
|
|
1697
|
-
return value;
|
|
1685
|
+
function clear_text_content(node) {
|
|
1686
|
+
node.textContent = "";
|
|
1698
1687
|
}
|
|
1699
1688
|
/**
|
|
1700
|
-
*
|
|
1701
|
-
*
|
|
1689
|
+
* Branching here is intentional and load-bearing for perf. `createElement(tag)`
|
|
1690
|
+
* hits a fast path in Blink that `createElementNS(NAMESPACE_HTML, tag)` doesn't,
|
|
1691
|
+
* and passing an explicit `undefined` as the trailing options arg measurably
|
|
1692
|
+
* slows both APIs. Funnelling every case through a single `createElementNS(ns,
|
|
1693
|
+
* tag, options)` call would be smaller but slower on the HTML path.
|
|
1694
|
+
*
|
|
1695
|
+
* @template {keyof HTMLElementTagNameMap | string} T
|
|
1696
|
+
* @param {T} tag
|
|
1697
|
+
* @param {string} [namespace]
|
|
1698
|
+
* @param {string} [is]
|
|
1699
|
+
* @returns {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element}
|
|
1702
1700
|
*/
|
|
1703
|
-
function
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
derived.wv = increment_write_version();
|
|
1707
|
-
if (!current_batch?.is_fork || derived.deps === null) {
|
|
1708
|
-
if (current_batch !== null) {
|
|
1709
|
-
current_batch.capture(derived, value, true);
|
|
1710
|
-
previous_batch?.capture(derived, value, true);
|
|
1711
|
-
} else derived.v = value;
|
|
1712
|
-
if (derived.deps === null) {
|
|
1713
|
-
set_signal_status(derived, CLEAN);
|
|
1714
|
-
return;
|
|
1715
|
-
}
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
if (is_destroying_effect) return;
|
|
1719
|
-
if (batch_values !== null) {
|
|
1720
|
-
if (effect_tracking() || current_batch?.is_fork) batch_values.set(derived, value);
|
|
1721
|
-
} else update_derived_status(derived);
|
|
1701
|
+
function create_element(tag, namespace, is) {
|
|
1702
|
+
if (namespace == null || namespace === "http://www.w3.org/1999/xhtml") return is ? document.createElement(tag, { is }) : document.createElement(tag);
|
|
1703
|
+
return is ? document.createElementNS(namespace, tag, { is }) : document.createElementNS(namespace, tag);
|
|
1722
1704
|
}
|
|
1723
1705
|
/**
|
|
1724
|
-
* @param {
|
|
1706
|
+
* @param {unknown} error
|
|
1725
1707
|
*/
|
|
1726
|
-
function
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
if (e.fn !== null) e.teardown = noop;
|
|
1732
|
-
e.ac = null;
|
|
1733
|
-
remove_reactions(e, 0);
|
|
1734
|
-
destroy_effect_children(e);
|
|
1708
|
+
function handle_error(error) {
|
|
1709
|
+
var effect = active_effect;
|
|
1710
|
+
if (effect === null) {
|
|
1711
|
+
/** @type {Derived} */ active_reaction.f |= ERROR_VALUE;
|
|
1712
|
+
return error;
|
|
1735
1713
|
}
|
|
1714
|
+
if ((effect.f & 32768) === 0 && (effect.f & 4) === 0) throw error;
|
|
1715
|
+
invoke_error_boundary(error, effect);
|
|
1736
1716
|
}
|
|
1737
1717
|
/**
|
|
1738
|
-
* @param {
|
|
1718
|
+
* @param {unknown} error
|
|
1719
|
+
* @param {Effect | null} effect
|
|
1739
1720
|
*/
|
|
1740
|
-
function
|
|
1741
|
-
if (
|
|
1742
|
-
|
|
1721
|
+
function invoke_error_boundary(error, effect) {
|
|
1722
|
+
if (effect !== null && (effect.f & 16384) !== 0) return;
|
|
1723
|
+
while (effect !== null) {
|
|
1724
|
+
if ((effect.f & 128) !== 0 && (effect.f & 33570816) === 0) {
|
|
1725
|
+
if ((effect.f & 32768) === 0) throw error;
|
|
1726
|
+
try {
|
|
1727
|
+
/** @type {Boundary} */ effect.b.error(error);
|
|
1728
|
+
return;
|
|
1729
|
+
} catch (e) {
|
|
1730
|
+
error = e;
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
effect = effect.parent;
|
|
1734
|
+
}
|
|
1735
|
+
throw error;
|
|
1743
1736
|
}
|
|
1744
1737
|
//#endregion
|
|
1745
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
1746
|
-
/** @import { Derived, Effect,
|
|
1747
|
-
/** @type {Set<Effect>} */
|
|
1748
|
-
var eager_effects = /* @__PURE__ */ new Set();
|
|
1749
|
-
/** @type {Map<Source, any>} */
|
|
1750
|
-
var old_values = /* @__PURE__ */ new Map();
|
|
1751
|
-
var eager_effects_deferred = false;
|
|
1752
|
-
/**
|
|
1753
|
-
* @template V
|
|
1754
|
-
* @param {V} v
|
|
1755
|
-
* @param {Error | null} [stack]
|
|
1756
|
-
* @returns {Source<V>}
|
|
1757
|
-
*/
|
|
1758
|
-
function source(v, stack) {
|
|
1759
|
-
return {
|
|
1760
|
-
f: 0,
|
|
1761
|
-
v,
|
|
1762
|
-
reactions: null,
|
|
1763
|
-
equals,
|
|
1764
|
-
rv: 0,
|
|
1765
|
-
wv: 0
|
|
1766
|
-
};
|
|
1767
|
-
}
|
|
1768
|
-
/**
|
|
1769
|
-
* @template V
|
|
1770
|
-
* @param {V} v
|
|
1771
|
-
* @param {Error | null} [stack]
|
|
1772
|
-
*/
|
|
1773
|
-
/*#__NO_SIDE_EFFECTS__*/
|
|
1774
|
-
function state(v, stack) {
|
|
1775
|
-
const s = source(v, stack);
|
|
1776
|
-
push_reaction_value(s);
|
|
1777
|
-
return s;
|
|
1778
|
-
}
|
|
1738
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/effects.js
|
|
1739
|
+
/** @import { Blocker, ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */
|
|
1779
1740
|
/**
|
|
1780
|
-
* @
|
|
1781
|
-
* @param {
|
|
1782
|
-
* @param {boolean} [immutable]
|
|
1783
|
-
* @returns {Source<V>}
|
|
1741
|
+
* @param {Effect} effect
|
|
1742
|
+
* @param {Effect} parent_effect
|
|
1784
1743
|
*/
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1744
|
+
function push_effect(effect, parent_effect) {
|
|
1745
|
+
var parent_last = parent_effect.last;
|
|
1746
|
+
if (parent_last === null) parent_effect.last = parent_effect.first = effect;
|
|
1747
|
+
else {
|
|
1748
|
+
parent_last.next = effect;
|
|
1749
|
+
effect.prev = parent_last;
|
|
1750
|
+
parent_effect.last = effect;
|
|
1792
1751
|
}
|
|
1793
|
-
return s;
|
|
1794
1752
|
}
|
|
1795
1753
|
/**
|
|
1796
|
-
* @
|
|
1797
|
-
* @param {
|
|
1798
|
-
* @
|
|
1799
|
-
* @param {boolean} [should_proxy]
|
|
1800
|
-
* @returns {V}
|
|
1754
|
+
* @param {number} type
|
|
1755
|
+
* @param {null | (() => void | (() => void))} fn
|
|
1756
|
+
* @returns {Effect}
|
|
1801
1757
|
*/
|
|
1802
|
-
function
|
|
1803
|
-
|
|
1804
|
-
|
|
1758
|
+
function create_effect(type, fn) {
|
|
1759
|
+
var parent = active_effect;
|
|
1760
|
+
if (parent !== null && (parent.f & 8192) !== 0) type |= INERT;
|
|
1761
|
+
/** @type {Effect} */
|
|
1762
|
+
var effect = {
|
|
1763
|
+
ctx: component_context,
|
|
1764
|
+
deps: null,
|
|
1765
|
+
nodes: null,
|
|
1766
|
+
f: type | DIRTY | 512,
|
|
1767
|
+
first: null,
|
|
1768
|
+
fn,
|
|
1769
|
+
last: null,
|
|
1770
|
+
next: null,
|
|
1771
|
+
parent,
|
|
1772
|
+
b: parent && parent.b,
|
|
1773
|
+
prev: null,
|
|
1774
|
+
teardown: null,
|
|
1775
|
+
wv: 0,
|
|
1776
|
+
ac: null
|
|
1777
|
+
};
|
|
1778
|
+
current_batch?.register_created_effect(effect);
|
|
1779
|
+
/** @type {Effect | null} */
|
|
1780
|
+
var e = effect;
|
|
1781
|
+
if ((type & 4) !== 0) if (collected_effects !== null) collected_effects.push(effect);
|
|
1782
|
+
else Batch.ensure().schedule(effect);
|
|
1783
|
+
else if (fn !== null) {
|
|
1784
|
+
try {
|
|
1785
|
+
update_effect(effect);
|
|
1786
|
+
} catch (e) {
|
|
1787
|
+
destroy_effect(effect);
|
|
1788
|
+
throw e;
|
|
1789
|
+
}
|
|
1790
|
+
if (e.deps === null && e.teardown === null && e.nodes === null && e.first === e.last && (e.f & 524288) === 0) {
|
|
1791
|
+
e = e.first;
|
|
1792
|
+
if ((type & 16) !== 0 && (type & 65536) !== 0 && e !== null) e.f |= EFFECT_TRANSPARENT;
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
if (e !== null) {
|
|
1796
|
+
e.parent = parent;
|
|
1797
|
+
if (parent !== null) push_effect(e, parent);
|
|
1798
|
+
if (active_reaction !== null && (active_reaction.f & 2) !== 0 && (type & 64) === 0) {
|
|
1799
|
+
var derived = active_reaction;
|
|
1800
|
+
(derived.effects ?? (derived.effects = [])).push(e);
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
return effect;
|
|
1805
1804
|
}
|
|
1806
1805
|
/**
|
|
1807
|
-
*
|
|
1808
|
-
* @
|
|
1809
|
-
* @param {V} value
|
|
1810
|
-
* @param {Effect[] | null} [updated_during_traversal]
|
|
1811
|
-
* @returns {V}
|
|
1806
|
+
* Internal representation of `$effect.tracking()`
|
|
1807
|
+
* @returns {boolean}
|
|
1812
1808
|
*/
|
|
1813
|
-
function
|
|
1814
|
-
|
|
1815
|
-
old_values.set(source, is_destroying_effect ? value : source.v);
|
|
1816
|
-
var batch = Batch.ensure();
|
|
1817
|
-
batch.capture(source, value);
|
|
1818
|
-
if ((source.f & 2) !== 0) {
|
|
1819
|
-
const derived = source;
|
|
1820
|
-
if ((source.f & 2048) !== 0) execute_derived(derived);
|
|
1821
|
-
if (batch_values === null) update_derived_status(derived);
|
|
1822
|
-
}
|
|
1823
|
-
source.wv = increment_write_version();
|
|
1824
|
-
mark_reactions(source, DIRTY, updated_during_traversal);
|
|
1825
|
-
if (is_runes() && active_effect !== null && (active_effect.f & 1024) !== 0 && (active_effect.f & 96) === 0) if (untracked_writes === null) set_untracked_writes([source]);
|
|
1826
|
-
else untracked_writes.push(source);
|
|
1827
|
-
if (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) flush_eager_effects();
|
|
1828
|
-
}
|
|
1829
|
-
return value;
|
|
1809
|
+
function effect_tracking() {
|
|
1810
|
+
return active_reaction !== null && !untracking;
|
|
1830
1811
|
}
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1812
|
+
/**
|
|
1813
|
+
* @param {() => void | (() => void)} fn
|
|
1814
|
+
*/
|
|
1815
|
+
function create_user_effect(fn) {
|
|
1816
|
+
return create_effect(4 | USER_EFFECT, fn);
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* Internal representation of `$effect.root(...)`
|
|
1820
|
+
* @param {() => void | (() => void)} fn
|
|
1821
|
+
* @returns {() => void}
|
|
1822
|
+
*/
|
|
1823
|
+
function effect_root(fn) {
|
|
1824
|
+
Batch.ensure();
|
|
1825
|
+
const effect = create_effect(64 | EFFECT_PRESERVED, fn);
|
|
1826
|
+
return () => {
|
|
1827
|
+
destroy_effect(effect);
|
|
1828
|
+
};
|
|
1829
|
+
}
|
|
1830
|
+
/**
|
|
1831
|
+
* An effect root whose children can transition out
|
|
1832
|
+
* @param {() => void} fn
|
|
1833
|
+
* @returns {(options?: { outro?: boolean }) => Promise<void>}
|
|
1834
|
+
*/
|
|
1835
|
+
function component_root(fn) {
|
|
1836
|
+
Batch.ensure();
|
|
1837
|
+
const effect = create_effect(64 | EFFECT_PRESERVED, fn);
|
|
1838
|
+
return (options = {}) => {
|
|
1839
|
+
return new Promise((fulfil) => {
|
|
1840
|
+
if (options.outro) pause_effect(effect, () => {
|
|
1841
|
+
destroy_effect(effect);
|
|
1842
|
+
fulfil(void 0);
|
|
1843
|
+
});
|
|
1844
|
+
else {
|
|
1845
|
+
destroy_effect(effect);
|
|
1846
|
+
fulfil(void 0);
|
|
1847
|
+
}
|
|
1848
|
+
});
|
|
1849
|
+
};
|
|
1850
|
+
}
|
|
1851
|
+
/**
|
|
1852
|
+
* @param {() => void | (() => void)} fn
|
|
1853
|
+
* @returns {Effect}
|
|
1854
|
+
*/
|
|
1855
|
+
function effect(fn) {
|
|
1856
|
+
return create_effect(4, fn);
|
|
1857
|
+
}
|
|
1858
|
+
/**
|
|
1859
|
+
* @param {() => void | (() => void)} fn
|
|
1860
|
+
* @returns {Effect}
|
|
1861
|
+
*/
|
|
1862
|
+
function render_effect(fn, flags = 0) {
|
|
1863
|
+
return create_effect(8 | flags, fn);
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* @param {(() => void)} fn
|
|
1867
|
+
* @param {number} flags
|
|
1868
|
+
*/
|
|
1869
|
+
function block(fn, flags = 0) {
|
|
1870
|
+
return create_effect(16 | flags, fn);
|
|
1871
|
+
}
|
|
1872
|
+
/**
|
|
1873
|
+
* @param {(() => void)} fn
|
|
1874
|
+
*/
|
|
1875
|
+
function branch(fn) {
|
|
1876
|
+
return create_effect(32 | EFFECT_PRESERVED, fn);
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* @param {Effect} effect
|
|
1880
|
+
*/
|
|
1881
|
+
function execute_effect_teardown(effect) {
|
|
1882
|
+
var teardown = effect.teardown;
|
|
1883
|
+
if (teardown !== null) {
|
|
1884
|
+
const previously_destroying_effect = is_destroying_effect;
|
|
1885
|
+
const previous_reaction = active_reaction;
|
|
1886
|
+
set_is_destroying_effect(true);
|
|
1887
|
+
set_active_reaction(null);
|
|
1836
1888
|
try {
|
|
1837
|
-
|
|
1838
|
-
} catch {
|
|
1839
|
-
|
|
1889
|
+
teardown.call(null);
|
|
1890
|
+
} catch (error) {
|
|
1891
|
+
invoke_error_boundary(error, effect.parent);
|
|
1892
|
+
} finally {
|
|
1893
|
+
set_is_destroying_effect(previously_destroying_effect);
|
|
1894
|
+
set_active_reaction(previous_reaction);
|
|
1840
1895
|
}
|
|
1841
|
-
if (dirty) update_effect(effect);
|
|
1842
1896
|
}
|
|
1843
|
-
eager_effects.clear();
|
|
1844
1897
|
}
|
|
1845
1898
|
/**
|
|
1846
|
-
*
|
|
1847
|
-
* @param {
|
|
1899
|
+
* @param {Effect} signal
|
|
1900
|
+
* @param {boolean} remove_dom
|
|
1901
|
+
* @returns {void}
|
|
1848
1902
|
*/
|
|
1849
|
-
function
|
|
1850
|
-
|
|
1903
|
+
function destroy_effect_children(signal, remove_dom = false) {
|
|
1904
|
+
var effect = signal.first;
|
|
1905
|
+
signal.first = signal.last = null;
|
|
1906
|
+
while (effect !== null) {
|
|
1907
|
+
const controller = effect.ac;
|
|
1908
|
+
if (controller !== null) without_reactive_context(() => {
|
|
1909
|
+
controller.abort(STALE_REACTION);
|
|
1910
|
+
});
|
|
1911
|
+
var next = effect.next;
|
|
1912
|
+
if ((effect.f & 64) !== 0) effect.parent = null;
|
|
1913
|
+
else destroy_effect(effect, remove_dom);
|
|
1914
|
+
effect = next;
|
|
1915
|
+
}
|
|
1851
1916
|
}
|
|
1852
1917
|
/**
|
|
1853
|
-
* @param {
|
|
1854
|
-
* @param {number} status should be DIRTY or MAYBE_DIRTY
|
|
1855
|
-
* @param {Effect[] | null} updated_during_traversal
|
|
1918
|
+
* @param {Effect} signal
|
|
1856
1919
|
* @returns {void}
|
|
1857
1920
|
*/
|
|
1858
|
-
function
|
|
1859
|
-
var
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
var reaction = reactions[i];
|
|
1865
|
-
var flags = reaction.f;
|
|
1866
|
-
if (!runes && reaction === active_effect) continue;
|
|
1867
|
-
var not_dirty = (flags & DIRTY) === 0;
|
|
1868
|
-
if (not_dirty) set_signal_status(reaction, status);
|
|
1869
|
-
if ((flags & 131072) !== 0) eager_effects.add(reaction);
|
|
1870
|
-
else if ((flags & 2) !== 0) {
|
|
1871
|
-
var derived = reaction;
|
|
1872
|
-
batch_values?.delete(derived);
|
|
1873
|
-
if ((flags & 65536) === 0) {
|
|
1874
|
-
if (flags & 512 && (active_effect === null || (active_effect.f & 2097152) === 0)) reaction.f |= WAS_MARKED;
|
|
1875
|
-
mark_reactions(derived, MAYBE_DIRTY, updated_during_traversal);
|
|
1876
|
-
}
|
|
1877
|
-
} else if (not_dirty) {
|
|
1878
|
-
var effect = reaction;
|
|
1879
|
-
if ((flags & 16) !== 0 && eager_block_effects !== null) eager_block_effects.add(effect);
|
|
1880
|
-
if (updated_during_traversal !== null) updated_during_traversal.push(effect);
|
|
1881
|
-
else schedule_effect(effect);
|
|
1882
|
-
}
|
|
1921
|
+
function destroy_block_effect_children(signal) {
|
|
1922
|
+
var effect = signal.first;
|
|
1923
|
+
while (effect !== null) {
|
|
1924
|
+
var next = effect.next;
|
|
1925
|
+
if ((effect.f & 32) === 0) destroy_effect(effect);
|
|
1926
|
+
effect = next;
|
|
1883
1927
|
}
|
|
1884
1928
|
}
|
|
1885
1929
|
/**
|
|
1886
|
-
* @
|
|
1887
|
-
* @param {
|
|
1888
|
-
* @returns {
|
|
1930
|
+
* @param {Effect} effect
|
|
1931
|
+
* @param {boolean} [remove_dom]
|
|
1932
|
+
* @returns {void}
|
|
1889
1933
|
*/
|
|
1890
|
-
function
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
var
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
var reaction = active_reaction;
|
|
1908
|
-
var version = update_version;
|
|
1909
|
-
set_active_reaction(null);
|
|
1910
|
-
set_update_version(parent_version);
|
|
1911
|
-
var result = fn();
|
|
1912
|
-
set_active_reaction(reaction);
|
|
1913
|
-
set_update_version(version);
|
|
1914
|
-
return result;
|
|
1915
|
-
};
|
|
1916
|
-
if (is_proxied_array) sources.set("length", /* @__PURE__ */ state(
|
|
1917
|
-
/** @type {any[]} */
|
|
1918
|
-
value.length,
|
|
1919
|
-
stack
|
|
1920
|
-
));
|
|
1921
|
-
return new Proxy(value, {
|
|
1922
|
-
defineProperty(_, prop, descriptor) {
|
|
1923
|
-
if (!("value" in descriptor) || descriptor.configurable === false || descriptor.enumerable === false || descriptor.writable === false) state_descriptors_fixed();
|
|
1924
|
-
var s = sources.get(prop);
|
|
1925
|
-
if (s === void 0) with_parent(() => {
|
|
1926
|
-
var s = /* @__PURE__ */ state(descriptor.value, stack);
|
|
1927
|
-
sources.set(prop, s);
|
|
1928
|
-
return s;
|
|
1929
|
-
});
|
|
1930
|
-
else set(s, descriptor.value, true);
|
|
1931
|
-
return true;
|
|
1932
|
-
},
|
|
1933
|
-
deleteProperty(target, prop) {
|
|
1934
|
-
var s = sources.get(prop);
|
|
1935
|
-
if (s === void 0) {
|
|
1936
|
-
if (prop in target) {
|
|
1937
|
-
const s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED, stack));
|
|
1938
|
-
sources.set(prop, s);
|
|
1939
|
-
increment(version);
|
|
1940
|
-
}
|
|
1941
|
-
} else {
|
|
1942
|
-
set(s, UNINITIALIZED);
|
|
1943
|
-
increment(version);
|
|
1944
|
-
}
|
|
1945
|
-
return true;
|
|
1946
|
-
},
|
|
1947
|
-
get(target, prop, receiver) {
|
|
1948
|
-
if (prop === STATE_SYMBOL) return value;
|
|
1949
|
-
var s = sources.get(prop);
|
|
1950
|
-
var exists = prop in target;
|
|
1951
|
-
if (s === void 0 && (!exists || get_descriptor(target, prop)?.writable)) {
|
|
1952
|
-
s = with_parent(() => {
|
|
1953
|
-
return /* @__PURE__ */ state(proxy(exists ? target[prop] : UNINITIALIZED), stack);
|
|
1954
|
-
});
|
|
1955
|
-
sources.set(prop, s);
|
|
1956
|
-
}
|
|
1957
|
-
if (s !== void 0) {
|
|
1958
|
-
var v = get(s);
|
|
1959
|
-
return v === UNINITIALIZED ? void 0 : v;
|
|
1960
|
-
}
|
|
1961
|
-
return Reflect.get(target, prop, receiver);
|
|
1962
|
-
},
|
|
1963
|
-
getOwnPropertyDescriptor(target, prop) {
|
|
1964
|
-
var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
1965
|
-
if (descriptor && "value" in descriptor) {
|
|
1966
|
-
var s = sources.get(prop);
|
|
1967
|
-
if (s) descriptor.value = get(s);
|
|
1968
|
-
} else if (descriptor === void 0) {
|
|
1969
|
-
var source = sources.get(prop);
|
|
1970
|
-
var value = source?.v;
|
|
1971
|
-
if (source !== void 0 && value !== UNINITIALIZED) return {
|
|
1972
|
-
enumerable: true,
|
|
1973
|
-
configurable: true,
|
|
1974
|
-
value,
|
|
1975
|
-
writable: true
|
|
1976
|
-
};
|
|
1977
|
-
}
|
|
1978
|
-
return descriptor;
|
|
1979
|
-
},
|
|
1980
|
-
has(target, prop) {
|
|
1981
|
-
if (prop === STATE_SYMBOL) return true;
|
|
1982
|
-
var s = sources.get(prop);
|
|
1983
|
-
var has = s !== void 0 && s.v !== UNINITIALIZED || Reflect.has(target, prop);
|
|
1984
|
-
if (s !== void 0 || active_effect !== null && (!has || get_descriptor(target, prop)?.writable)) {
|
|
1985
|
-
if (s === void 0) {
|
|
1986
|
-
s = with_parent(() => {
|
|
1987
|
-
return /* @__PURE__ */ state(has ? proxy(target[prop]) : UNINITIALIZED, stack);
|
|
1988
|
-
});
|
|
1989
|
-
sources.set(prop, s);
|
|
1990
|
-
}
|
|
1991
|
-
if (get(s) === UNINITIALIZED) return false;
|
|
1992
|
-
}
|
|
1993
|
-
return has;
|
|
1994
|
-
},
|
|
1995
|
-
set(target, prop, value, receiver) {
|
|
1996
|
-
var s = sources.get(prop);
|
|
1997
|
-
var has = prop in target;
|
|
1998
|
-
if (is_proxied_array && prop === "length") for (var i = value; i < s.v; i += 1) {
|
|
1999
|
-
var other_s = sources.get(i + "");
|
|
2000
|
-
if (other_s !== void 0) set(other_s, UNINITIALIZED);
|
|
2001
|
-
else if (i in target) {
|
|
2002
|
-
other_s = with_parent(() => /* @__PURE__ */ state(UNINITIALIZED, stack));
|
|
2003
|
-
sources.set(i + "", other_s);
|
|
2004
|
-
}
|
|
2005
|
-
}
|
|
2006
|
-
if (s === void 0) {
|
|
2007
|
-
if (!has || get_descriptor(target, prop)?.writable) {
|
|
2008
|
-
s = with_parent(() => /* @__PURE__ */ state(void 0, stack));
|
|
2009
|
-
set(s, proxy(value));
|
|
2010
|
-
sources.set(prop, s);
|
|
2011
|
-
}
|
|
2012
|
-
} else {
|
|
2013
|
-
has = s.v !== UNINITIALIZED;
|
|
2014
|
-
var p = with_parent(() => proxy(value));
|
|
2015
|
-
set(s, p);
|
|
2016
|
-
}
|
|
2017
|
-
var descriptor = Reflect.getOwnPropertyDescriptor(target, prop);
|
|
2018
|
-
if (descriptor?.set) descriptor.set.call(receiver, value);
|
|
2019
|
-
if (!has) {
|
|
2020
|
-
if (is_proxied_array && typeof prop === "string") {
|
|
2021
|
-
var ls = sources.get("length");
|
|
2022
|
-
var n = Number(prop);
|
|
2023
|
-
if (Number.isInteger(n) && n >= ls.v) set(ls, n + 1);
|
|
2024
|
-
}
|
|
2025
|
-
increment(version);
|
|
2026
|
-
}
|
|
2027
|
-
return true;
|
|
2028
|
-
},
|
|
2029
|
-
ownKeys(target) {
|
|
2030
|
-
get(version);
|
|
2031
|
-
var own_keys = Reflect.ownKeys(target).filter((key) => {
|
|
2032
|
-
var source = sources.get(key);
|
|
2033
|
-
return source === void 0 || source.v !== UNINITIALIZED;
|
|
2034
|
-
});
|
|
2035
|
-
for (var [key, source] of sources) if (source.v !== UNINITIALIZED && !(key in target)) own_keys.push(key);
|
|
2036
|
-
return own_keys;
|
|
2037
|
-
},
|
|
2038
|
-
setPrototypeOf() {
|
|
2039
|
-
state_prototype_fixed();
|
|
2040
|
-
}
|
|
2041
|
-
});
|
|
1934
|
+
function destroy_effect(effect, remove_dom = true) {
|
|
1935
|
+
var removed = false;
|
|
1936
|
+
if ((remove_dom || (effect.f & 262144) !== 0) && effect.nodes !== null && effect.nodes.end !== null) {
|
|
1937
|
+
remove_effect_dom(effect.nodes.start, effect.nodes.end);
|
|
1938
|
+
removed = true;
|
|
1939
|
+
}
|
|
1940
|
+
effect.f |= DESTROYING;
|
|
1941
|
+
destroy_effect_children(effect, remove_dom && !removed);
|
|
1942
|
+
remove_reactions(effect, 0);
|
|
1943
|
+
var transitions = effect.nodes && effect.nodes.t;
|
|
1944
|
+
if (transitions !== null) for (const transition of transitions) transition.stop();
|
|
1945
|
+
execute_effect_teardown(effect);
|
|
1946
|
+
effect.f ^= DESTROYING;
|
|
1947
|
+
effect.f |= DESTROYED;
|
|
1948
|
+
var parent = effect.parent;
|
|
1949
|
+
if (parent !== null && parent.first !== null) unlink_effect(effect);
|
|
1950
|
+
effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = effect.b = null;
|
|
2042
1951
|
}
|
|
2043
|
-
new Set([
|
|
2044
|
-
"copyWithin",
|
|
2045
|
-
"fill",
|
|
2046
|
-
"pop",
|
|
2047
|
-
"push",
|
|
2048
|
-
"reverse",
|
|
2049
|
-
"shift",
|
|
2050
|
-
"sort",
|
|
2051
|
-
"splice",
|
|
2052
|
-
"unshift"
|
|
2053
|
-
]);
|
|
2054
|
-
//#endregion
|
|
2055
|
-
//#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/operations.js
|
|
2056
|
-
/** @type {Window} */
|
|
2057
|
-
var $window;
|
|
2058
|
-
/** @type {boolean} */
|
|
2059
|
-
var is_firefox;
|
|
2060
|
-
/** @type {() => Node | null} */
|
|
2061
|
-
var first_child_getter;
|
|
2062
|
-
/** @type {() => Node | null} */
|
|
2063
|
-
var next_sibling_getter;
|
|
2064
1952
|
/**
|
|
2065
|
-
*
|
|
2066
|
-
*
|
|
1953
|
+
*
|
|
1954
|
+
* @param {TemplateNode | null} node
|
|
1955
|
+
* @param {TemplateNode} end
|
|
2067
1956
|
*/
|
|
2068
|
-
function
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
var text_prototype = Text.prototype;
|
|
2075
|
-
first_child_getter = get_descriptor(node_prototype, "firstChild").get;
|
|
2076
|
-
next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
|
|
2077
|
-
if (is_extensible(element_prototype)) {
|
|
2078
|
-
/** @type {any} */ element_prototype[CLASS_CACHE] = void 0;
|
|
2079
|
-
/** @type {any} */ element_prototype[ATTRIBUTES_CACHE] = null;
|
|
2080
|
-
/** @type {any} */ element_prototype[STYLE_CACHE] = void 0;
|
|
2081
|
-
element_prototype.__e = void 0;
|
|
1957
|
+
function remove_effect_dom(node, end) {
|
|
1958
|
+
while (node !== null) {
|
|
1959
|
+
/** @type {TemplateNode | null} */
|
|
1960
|
+
var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
|
|
1961
|
+
node.remove();
|
|
1962
|
+
node = next;
|
|
2082
1963
|
}
|
|
2083
|
-
if (is_extensible(text_prototype))
|
|
2084
|
-
/** @type {any} */ text_prototype[TEXT_CACHE] = void 0;
|
|
2085
1964
|
}
|
|
2086
1965
|
/**
|
|
2087
|
-
*
|
|
2088
|
-
*
|
|
1966
|
+
* Detach an effect from the effect tree, freeing up memory and
|
|
1967
|
+
* reducing the amount of work that happens on subsequent traversals
|
|
1968
|
+
* @param {Effect} effect
|
|
2089
1969
|
*/
|
|
2090
|
-
function
|
|
2091
|
-
|
|
1970
|
+
function unlink_effect(effect) {
|
|
1971
|
+
var parent = effect.parent;
|
|
1972
|
+
var prev = effect.prev;
|
|
1973
|
+
var next = effect.next;
|
|
1974
|
+
if (prev !== null) prev.next = next;
|
|
1975
|
+
if (next !== null) next.prev = prev;
|
|
1976
|
+
if (parent !== null) {
|
|
1977
|
+
if (parent.first === effect) parent.first = next;
|
|
1978
|
+
if (parent.last === effect) parent.last = prev;
|
|
1979
|
+
}
|
|
2092
1980
|
}
|
|
2093
1981
|
/**
|
|
2094
|
-
*
|
|
2095
|
-
*
|
|
1982
|
+
* When a block effect is removed, we don't immediately destroy it or yank it
|
|
1983
|
+
* out of the DOM, because it might have transitions. Instead, we 'pause' it.
|
|
1984
|
+
* It stays around (in memory, and in the DOM) until outro transitions have
|
|
1985
|
+
* completed, and if the state change is reversed then we _resume_ it.
|
|
1986
|
+
* A paused effect does not update, and the DOM subtree becomes inert.
|
|
1987
|
+
* @param {Effect} effect
|
|
1988
|
+
* @param {() => void} [callback]
|
|
1989
|
+
* @param {boolean} [destroy]
|
|
2096
1990
|
*/
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
1991
|
+
function pause_effect(effect, callback, destroy = true) {
|
|
1992
|
+
/** @type {TransitionManager[]} */
|
|
1993
|
+
var transitions = [];
|
|
1994
|
+
effect.f |= 256;
|
|
1995
|
+
pause_children(effect, transitions, true);
|
|
1996
|
+
var fn = () => {
|
|
1997
|
+
if (destroy) destroy_effect(effect);
|
|
1998
|
+
if (callback) callback();
|
|
1999
|
+
};
|
|
2000
|
+
var remaining = transitions.length;
|
|
2001
|
+
if (remaining > 0) {
|
|
2002
|
+
var check = () => --remaining || fn();
|
|
2003
|
+
for (var transition of transitions) transition.out(check);
|
|
2004
|
+
} else fn();
|
|
2100
2005
|
}
|
|
2101
2006
|
/**
|
|
2102
|
-
* @
|
|
2103
|
-
* @param {
|
|
2007
|
+
* @param {Effect} effect
|
|
2008
|
+
* @param {TransitionManager[]} transitions
|
|
2009
|
+
* @param {boolean} local
|
|
2104
2010
|
*/
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2011
|
+
function pause_children(effect, transitions, local) {
|
|
2012
|
+
if ((effect.f & 8192) !== 0) return;
|
|
2013
|
+
effect.f ^= INERT;
|
|
2014
|
+
var t = effect.nodes && effect.nodes.t;
|
|
2015
|
+
if (t !== null) {
|
|
2016
|
+
for (const transition of t) if (transition.is_global || local) transitions.push(transition);
|
|
2017
|
+
}
|
|
2018
|
+
var child = effect.first;
|
|
2019
|
+
while (child !== null) {
|
|
2020
|
+
var sibling = child.next;
|
|
2021
|
+
if ((child.f & 64) === 0) {
|
|
2022
|
+
var transparent = (child.f & 65536) !== 0 || (child.f & 32) !== 0 && (effect.f & 16) !== 0;
|
|
2023
|
+
pause_children(child, transitions, transparent ? local : false);
|
|
2024
|
+
}
|
|
2025
|
+
child = sibling;
|
|
2026
|
+
}
|
|
2108
2027
|
}
|
|
2109
2028
|
/**
|
|
2110
|
-
* @
|
|
2111
|
-
* @param {
|
|
2112
|
-
* @returns {void}
|
|
2029
|
+
* @param {Effect} effect
|
|
2030
|
+
* @param {DocumentFragment} fragment
|
|
2113
2031
|
*/
|
|
2114
|
-
function
|
|
2115
|
-
|
|
2116
|
-
}
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
* @template {keyof HTMLElementTagNameMap | string} T
|
|
2125
|
-
* @param {T} tag
|
|
2126
|
-
* @param {string} [namespace]
|
|
2127
|
-
* @param {string} [is]
|
|
2128
|
-
* @returns {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element}
|
|
2129
|
-
*/
|
|
2130
|
-
function create_element(tag, namespace, is) {
|
|
2131
|
-
if (namespace == null || namespace === "http://www.w3.org/1999/xhtml") return is ? document.createElement(tag, { is }) : document.createElement(tag);
|
|
2132
|
-
return is ? document.createElementNS(namespace, tag, { is }) : document.createElementNS(namespace, tag);
|
|
2133
|
-
}
|
|
2134
|
-
//#endregion
|
|
2135
|
-
//#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
|
|
2136
|
-
/**
|
|
2137
|
-
* @template T
|
|
2138
|
-
* @param {() => T} fn
|
|
2139
|
-
*/
|
|
2140
|
-
function without_reactive_context(fn) {
|
|
2141
|
-
var previous_reaction = active_reaction;
|
|
2142
|
-
var previous_effect = active_effect;
|
|
2143
|
-
set_active_reaction(null);
|
|
2144
|
-
set_active_effect(null);
|
|
2145
|
-
try {
|
|
2146
|
-
return fn();
|
|
2147
|
-
} finally {
|
|
2148
|
-
set_active_reaction(previous_reaction);
|
|
2149
|
-
set_active_effect(previous_effect);
|
|
2032
|
+
function move_effect(effect, fragment) {
|
|
2033
|
+
if (!effect.nodes) return;
|
|
2034
|
+
/** @type {TemplateNode | null} */
|
|
2035
|
+
var node = effect.nodes.start;
|
|
2036
|
+
var end = effect.nodes.end;
|
|
2037
|
+
while (node !== null) {
|
|
2038
|
+
/** @type {TemplateNode | null} */
|
|
2039
|
+
var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
|
|
2040
|
+
fragment.append(node);
|
|
2041
|
+
node = next;
|
|
2150
2042
|
}
|
|
2151
2043
|
}
|
|
2152
2044
|
//#endregion
|
|
2153
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
2154
|
-
/** @import { Blocker, ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */
|
|
2045
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/legacy.js
|
|
2155
2046
|
/**
|
|
2156
|
-
* @
|
|
2157
|
-
* @
|
|
2047
|
+
* @type {Set<Value> | null}
|
|
2048
|
+
* @deprecated
|
|
2158
2049
|
*/
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
parent_last.next = effect;
|
|
2164
|
-
effect.prev = parent_last;
|
|
2165
|
-
parent_effect.last = effect;
|
|
2166
|
-
}
|
|
2167
|
-
}
|
|
2050
|
+
var captured_signals = null;
|
|
2051
|
+
//#endregion
|
|
2052
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/runtime.js
|
|
2053
|
+
/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
|
|
2168
2054
|
/**
|
|
2169
|
-
*
|
|
2170
|
-
* @param {null | (() => void | (() => void))} fn
|
|
2171
|
-
* @returns {Effect}
|
|
2055
|
+
* True if updating in an effect context that is reactive (i.e. not branch/root effects)
|
|
2172
2056
|
*/
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
ctx: component_context,
|
|
2179
|
-
deps: null,
|
|
2180
|
-
nodes: null,
|
|
2181
|
-
f: type | DIRTY | 512,
|
|
2182
|
-
first: null,
|
|
2183
|
-
fn,
|
|
2184
|
-
last: null,
|
|
2185
|
-
next: null,
|
|
2186
|
-
parent,
|
|
2187
|
-
b: parent && parent.b,
|
|
2188
|
-
prev: null,
|
|
2189
|
-
teardown: null,
|
|
2190
|
-
wv: 0,
|
|
2191
|
-
ac: null
|
|
2192
|
-
};
|
|
2193
|
-
current_batch?.register_created_effect(effect);
|
|
2194
|
-
/** @type {Effect | null} */
|
|
2195
|
-
var e = effect;
|
|
2196
|
-
if ((type & 4) !== 0) if (collected_effects !== null) collected_effects.push(effect);
|
|
2197
|
-
else Batch.ensure().schedule(effect);
|
|
2198
|
-
else if (fn !== null) {
|
|
2199
|
-
try {
|
|
2200
|
-
update_effect(effect);
|
|
2201
|
-
} catch (e) {
|
|
2202
|
-
destroy_effect(effect);
|
|
2203
|
-
throw e;
|
|
2204
|
-
}
|
|
2205
|
-
if (e.deps === null && e.teardown === null && e.nodes === null && e.first === e.last && (e.f & 524288) === 0) {
|
|
2206
|
-
e = e.first;
|
|
2207
|
-
if ((type & 16) !== 0 && (type & 65536) !== 0 && e !== null) e.f |= EFFECT_TRANSPARENT;
|
|
2208
|
-
}
|
|
2209
|
-
}
|
|
2210
|
-
if (e !== null) {
|
|
2211
|
-
e.parent = parent;
|
|
2212
|
-
if (parent !== null) push_effect(e, parent);
|
|
2213
|
-
if (active_reaction !== null && (active_reaction.f & 2) !== 0 && (type & 64) === 0) {
|
|
2214
|
-
var derived = active_reaction;
|
|
2215
|
-
(derived.effects ?? (derived.effects = [])).push(e);
|
|
2216
|
-
}
|
|
2217
|
-
}
|
|
2218
|
-
return effect;
|
|
2057
|
+
var is_updating_effect = false;
|
|
2058
|
+
var is_destroying_effect = false;
|
|
2059
|
+
/** @param {boolean} value */
|
|
2060
|
+
function set_is_destroying_effect(value) {
|
|
2061
|
+
is_destroying_effect = value;
|
|
2219
2062
|
}
|
|
2220
|
-
/**
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
*/
|
|
2224
|
-
function
|
|
2225
|
-
|
|
2063
|
+
/** @type {null | Reaction} */
|
|
2064
|
+
var active_reaction = null;
|
|
2065
|
+
var untracking = false;
|
|
2066
|
+
/** @param {null | Reaction} reaction */
|
|
2067
|
+
function set_active_reaction(reaction) {
|
|
2068
|
+
active_reaction = reaction;
|
|
2226
2069
|
}
|
|
2227
|
-
/**
|
|
2228
|
-
|
|
2229
|
-
*/
|
|
2230
|
-
function
|
|
2231
|
-
|
|
2070
|
+
/** @type {null | Effect} */
|
|
2071
|
+
var active_effect = null;
|
|
2072
|
+
/** @param {null | Effect} effect */
|
|
2073
|
+
function set_active_effect(effect) {
|
|
2074
|
+
active_effect = effect;
|
|
2232
2075
|
}
|
|
2233
2076
|
/**
|
|
2234
|
-
*
|
|
2235
|
-
*
|
|
2236
|
-
* @
|
|
2077
|
+
* When sources are created within a reaction, reading and writing
|
|
2078
|
+
* them within that reaction should not cause a re-run
|
|
2079
|
+
* @type {null | Set<Source>}
|
|
2237
2080
|
*/
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
destroy_effect(effect);
|
|
2243
|
-
};
|
|
2081
|
+
var current_sources = null;
|
|
2082
|
+
/** @param {Value} value */
|
|
2083
|
+
function push_reaction_value(value) {
|
|
2084
|
+
if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & 2) !== 0)) (current_sources ?? (current_sources = /* @__PURE__ */ new Set())).add(value);
|
|
2244
2085
|
}
|
|
2245
2086
|
/**
|
|
2246
|
-
*
|
|
2247
|
-
*
|
|
2248
|
-
*
|
|
2087
|
+
* The dependencies of the reaction that is currently being executed. In many cases,
|
|
2088
|
+
* the dependencies are unchanged between runs, and so this will be `null` unless
|
|
2089
|
+
* and until a new dependency is accessed — we track this via `skipped_deps`
|
|
2090
|
+
* @type {null | Value[]}
|
|
2249
2091
|
*/
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
const effect = create_effect(64 | EFFECT_PRESERVED, fn);
|
|
2253
|
-
return (options = {}) => {
|
|
2254
|
-
return new Promise((fulfil) => {
|
|
2255
|
-
if (options.outro) pause_effect(effect, () => {
|
|
2256
|
-
destroy_effect(effect);
|
|
2257
|
-
fulfil(void 0);
|
|
2258
|
-
});
|
|
2259
|
-
else {
|
|
2260
|
-
destroy_effect(effect);
|
|
2261
|
-
fulfil(void 0);
|
|
2262
|
-
}
|
|
2263
|
-
});
|
|
2264
|
-
};
|
|
2265
|
-
}
|
|
2092
|
+
var new_deps = null;
|
|
2093
|
+
var skipped_deps = 0;
|
|
2266
2094
|
/**
|
|
2267
|
-
*
|
|
2268
|
-
*
|
|
2095
|
+
* Tracks writes that the effect it's executed in doesn't listen to yet,
|
|
2096
|
+
* so that the dependency can be added to the effect later on if it then reads it
|
|
2097
|
+
* @type {null | Source[]}
|
|
2269
2098
|
*/
|
|
2270
|
-
|
|
2271
|
-
|
|
2099
|
+
var untracked_writes = null;
|
|
2100
|
+
/** @param {null | Source[]} value */
|
|
2101
|
+
function set_untracked_writes(value) {
|
|
2102
|
+
untracked_writes = value;
|
|
2272
2103
|
}
|
|
2273
2104
|
/**
|
|
2274
|
-
* @
|
|
2275
|
-
*
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2105
|
+
* @type {number} Used by sources and deriveds for handling updates.
|
|
2106
|
+
* Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing
|
|
2107
|
+
**/
|
|
2108
|
+
var write_version = 1;
|
|
2109
|
+
/** @type {number} Used to version each read of a source of derived to avoid duplicating dependencies inside a reaction */
|
|
2110
|
+
var read_version = 0;
|
|
2111
|
+
var update_version = read_version;
|
|
2112
|
+
/** @param {number} value */
|
|
2113
|
+
function set_update_version(value) {
|
|
2114
|
+
update_version = value;
|
|
2279
2115
|
}
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
* @param {number} flags
|
|
2283
|
-
*/
|
|
2284
|
-
function block(fn, flags = 0) {
|
|
2285
|
-
return create_effect(16 | flags, fn);
|
|
2116
|
+
function increment_write_version() {
|
|
2117
|
+
return ++write_version;
|
|
2286
2118
|
}
|
|
2287
2119
|
/**
|
|
2288
|
-
*
|
|
2120
|
+
* Determines whether a derived or effect is dirty.
|
|
2121
|
+
* If it is MAYBE_DIRTY, will set the status to CLEAN
|
|
2122
|
+
* @param {Reaction} reaction
|
|
2123
|
+
* @returns {boolean}
|
|
2289
2124
|
*/
|
|
2290
|
-
function
|
|
2291
|
-
|
|
2125
|
+
function is_dirty(reaction) {
|
|
2126
|
+
var flags = reaction.f;
|
|
2127
|
+
if ((flags & 2048) !== 0) return true;
|
|
2128
|
+
if (flags & 2) reaction.f &= ~WAS_MARKED;
|
|
2129
|
+
if ((flags & 4096) !== 0) {
|
|
2130
|
+
var dependencies = reaction.deps;
|
|
2131
|
+
var length = dependencies.length;
|
|
2132
|
+
for (var i = 0; i < length; i++) {
|
|
2133
|
+
var dependency = dependencies[i];
|
|
2134
|
+
if (is_dirty(dependency)) update_derived(dependency);
|
|
2135
|
+
if (dependency.wv > reaction.wv) return true;
|
|
2136
|
+
}
|
|
2137
|
+
if ((flags & 512) !== 0 && batch_values === null) set_signal_status(reaction, CLEAN);
|
|
2138
|
+
}
|
|
2139
|
+
return false;
|
|
2292
2140
|
}
|
|
2293
2141
|
/**
|
|
2142
|
+
* @param {Value} signal
|
|
2294
2143
|
* @param {Effect} effect
|
|
2144
|
+
* @param {boolean} [root]
|
|
2295
2145
|
*/
|
|
2296
|
-
function
|
|
2297
|
-
var
|
|
2298
|
-
if (
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
set_active_reaction(previous_reaction);
|
|
2308
|
-
}
|
|
2309
|
-
}
|
|
2310
|
-
}
|
|
2311
|
-
/**
|
|
2312
|
-
* @param {Effect} signal
|
|
2313
|
-
* @param {boolean} remove_dom
|
|
2314
|
-
* @returns {void}
|
|
2315
|
-
*/
|
|
2316
|
-
function destroy_effect_children(signal, remove_dom = false) {
|
|
2317
|
-
var effect = signal.first;
|
|
2318
|
-
signal.first = signal.last = null;
|
|
2319
|
-
while (effect !== null) {
|
|
2320
|
-
const controller = effect.ac;
|
|
2321
|
-
if (controller !== null) without_reactive_context(() => {
|
|
2322
|
-
controller.abort(STALE_REACTION);
|
|
2323
|
-
});
|
|
2324
|
-
var next = effect.next;
|
|
2325
|
-
if ((effect.f & 64) !== 0) effect.parent = null;
|
|
2326
|
-
else destroy_effect(effect, remove_dom);
|
|
2327
|
-
effect = next;
|
|
2328
|
-
}
|
|
2329
|
-
}
|
|
2330
|
-
/**
|
|
2331
|
-
* @param {Effect} signal
|
|
2332
|
-
* @returns {void}
|
|
2333
|
-
*/
|
|
2334
|
-
function destroy_block_effect_children(signal) {
|
|
2335
|
-
var effect = signal.first;
|
|
2336
|
-
while (effect !== null) {
|
|
2337
|
-
var next = effect.next;
|
|
2338
|
-
if ((effect.f & 32) === 0) destroy_effect(effect);
|
|
2339
|
-
effect = next;
|
|
2340
|
-
}
|
|
2341
|
-
}
|
|
2342
|
-
/**
|
|
2343
|
-
* @param {Effect} effect
|
|
2344
|
-
* @param {boolean} [remove_dom]
|
|
2345
|
-
* @returns {void}
|
|
2346
|
-
*/
|
|
2347
|
-
function destroy_effect(effect, remove_dom = true) {
|
|
2348
|
-
var removed = false;
|
|
2349
|
-
if ((remove_dom || (effect.f & 262144) !== 0) && effect.nodes !== null && effect.nodes.end !== null) {
|
|
2350
|
-
remove_effect_dom(effect.nodes.start, effect.nodes.end);
|
|
2351
|
-
removed = true;
|
|
2352
|
-
}
|
|
2353
|
-
effect.f |= DESTROYING;
|
|
2354
|
-
destroy_effect_children(effect, remove_dom && !removed);
|
|
2355
|
-
remove_reactions(effect, 0);
|
|
2356
|
-
var transitions = effect.nodes && effect.nodes.t;
|
|
2357
|
-
if (transitions !== null) for (const transition of transitions) transition.stop();
|
|
2358
|
-
execute_effect_teardown(effect);
|
|
2359
|
-
effect.f ^= DESTROYING;
|
|
2360
|
-
effect.f |= DESTROYED;
|
|
2361
|
-
var parent = effect.parent;
|
|
2362
|
-
if (parent !== null && parent.first !== null) unlink_effect(effect);
|
|
2363
|
-
effect.next = effect.prev = effect.teardown = effect.ctx = effect.deps = effect.fn = effect.nodes = effect.ac = effect.b = null;
|
|
2364
|
-
}
|
|
2365
|
-
/**
|
|
2366
|
-
*
|
|
2367
|
-
* @param {TemplateNode | null} node
|
|
2368
|
-
* @param {TemplateNode} end
|
|
2369
|
-
*/
|
|
2370
|
-
function remove_effect_dom(node, end) {
|
|
2371
|
-
while (node !== null) {
|
|
2372
|
-
/** @type {TemplateNode | null} */
|
|
2373
|
-
var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
|
|
2374
|
-
node.remove();
|
|
2375
|
-
node = next;
|
|
2376
|
-
}
|
|
2377
|
-
}
|
|
2378
|
-
/**
|
|
2379
|
-
* Detach an effect from the effect tree, freeing up memory and
|
|
2380
|
-
* reducing the amount of work that happens on subsequent traversals
|
|
2381
|
-
* @param {Effect} effect
|
|
2382
|
-
*/
|
|
2383
|
-
function unlink_effect(effect) {
|
|
2384
|
-
var parent = effect.parent;
|
|
2385
|
-
var prev = effect.prev;
|
|
2386
|
-
var next = effect.next;
|
|
2387
|
-
if (prev !== null) prev.next = next;
|
|
2388
|
-
if (next !== null) next.prev = prev;
|
|
2389
|
-
if (parent !== null) {
|
|
2390
|
-
if (parent.first === effect) parent.first = next;
|
|
2391
|
-
if (parent.last === effect) parent.last = prev;
|
|
2392
|
-
}
|
|
2393
|
-
}
|
|
2394
|
-
/**
|
|
2395
|
-
* When a block effect is removed, we don't immediately destroy it or yank it
|
|
2396
|
-
* out of the DOM, because it might have transitions. Instead, we 'pause' it.
|
|
2397
|
-
* It stays around (in memory, and in the DOM) until outro transitions have
|
|
2398
|
-
* completed, and if the state change is reversed then we _resume_ it.
|
|
2399
|
-
* A paused effect does not update, and the DOM subtree becomes inert.
|
|
2400
|
-
* @param {Effect} effect
|
|
2401
|
-
* @param {() => void} [callback]
|
|
2402
|
-
* @param {boolean} [destroy]
|
|
2403
|
-
*/
|
|
2404
|
-
function pause_effect(effect, callback, destroy = true) {
|
|
2405
|
-
/** @type {TransitionManager[]} */
|
|
2406
|
-
var transitions = [];
|
|
2407
|
-
pause_children(effect, transitions, true);
|
|
2408
|
-
var fn = () => {
|
|
2409
|
-
if (destroy) destroy_effect(effect);
|
|
2410
|
-
if (callback) callback();
|
|
2411
|
-
};
|
|
2412
|
-
var remaining = transitions.length;
|
|
2413
|
-
if (remaining > 0) {
|
|
2414
|
-
var check = () => --remaining || fn();
|
|
2415
|
-
for (var transition of transitions) transition.out(check);
|
|
2416
|
-
} else fn();
|
|
2417
|
-
}
|
|
2418
|
-
/**
|
|
2419
|
-
* @param {Effect} effect
|
|
2420
|
-
* @param {TransitionManager[]} transitions
|
|
2421
|
-
* @param {boolean} local
|
|
2422
|
-
*/
|
|
2423
|
-
function pause_children(effect, transitions, local) {
|
|
2424
|
-
if ((effect.f & 8192) !== 0) return;
|
|
2425
|
-
effect.f ^= INERT;
|
|
2426
|
-
var t = effect.nodes && effect.nodes.t;
|
|
2427
|
-
if (t !== null) {
|
|
2428
|
-
for (const transition of t) if (transition.is_global || local) transitions.push(transition);
|
|
2429
|
-
}
|
|
2430
|
-
var child = effect.first;
|
|
2431
|
-
while (child !== null) {
|
|
2432
|
-
var sibling = child.next;
|
|
2433
|
-
if ((child.f & 64) === 0) {
|
|
2434
|
-
var transparent = (child.f & 65536) !== 0 || (child.f & 32) !== 0 && (effect.f & 16) !== 0;
|
|
2435
|
-
pause_children(child, transitions, transparent ? local : false);
|
|
2436
|
-
}
|
|
2437
|
-
child = sibling;
|
|
2438
|
-
}
|
|
2439
|
-
}
|
|
2440
|
-
/**
|
|
2441
|
-
* @param {Effect} effect
|
|
2442
|
-
* @param {DocumentFragment} fragment
|
|
2443
|
-
*/
|
|
2444
|
-
function move_effect(effect, fragment) {
|
|
2445
|
-
if (!effect.nodes) return;
|
|
2446
|
-
/** @type {TemplateNode | null} */
|
|
2447
|
-
var node = effect.nodes.start;
|
|
2448
|
-
var end = effect.nodes.end;
|
|
2449
|
-
while (node !== null) {
|
|
2450
|
-
/** @type {TemplateNode | null} */
|
|
2451
|
-
var next = node === end ? null : /* @__PURE__ */ get_next_sibling(node);
|
|
2452
|
-
fragment.append(node);
|
|
2453
|
-
node = next;
|
|
2454
|
-
}
|
|
2455
|
-
}
|
|
2456
|
-
//#endregion
|
|
2457
|
-
//#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/legacy.js
|
|
2458
|
-
/**
|
|
2459
|
-
* @type {Set<Value> | null}
|
|
2460
|
-
* @deprecated
|
|
2461
|
-
*/
|
|
2462
|
-
var captured_signals = null;
|
|
2463
|
-
//#endregion
|
|
2464
|
-
//#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/runtime.js
|
|
2465
|
-
/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
|
|
2466
|
-
var is_updating_effect = false;
|
|
2467
|
-
var is_destroying_effect = false;
|
|
2468
|
-
/** @param {boolean} value */
|
|
2469
|
-
function set_is_destroying_effect(value) {
|
|
2470
|
-
is_destroying_effect = value;
|
|
2471
|
-
}
|
|
2472
|
-
/** @type {null | Reaction} */
|
|
2473
|
-
var active_reaction = null;
|
|
2474
|
-
var untracking = false;
|
|
2475
|
-
/** @param {null | Reaction} reaction */
|
|
2476
|
-
function set_active_reaction(reaction) {
|
|
2477
|
-
active_reaction = reaction;
|
|
2478
|
-
}
|
|
2479
|
-
/** @type {null | Effect} */
|
|
2480
|
-
var active_effect = null;
|
|
2481
|
-
/** @param {null | Effect} effect */
|
|
2482
|
-
function set_active_effect(effect) {
|
|
2483
|
-
active_effect = effect;
|
|
2484
|
-
}
|
|
2485
|
-
/**
|
|
2486
|
-
* When sources are created within a reaction, reading and writing
|
|
2487
|
-
* them within that reaction should not cause a re-run
|
|
2488
|
-
* @type {null | Set<Source>}
|
|
2489
|
-
*/
|
|
2490
|
-
var current_sources = null;
|
|
2491
|
-
/** @param {Value} value */
|
|
2492
|
-
function push_reaction_value(value) {
|
|
2493
|
-
if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & 2) !== 0)) (current_sources ?? (current_sources = /* @__PURE__ */ new Set())).add(value);
|
|
2494
|
-
}
|
|
2495
|
-
/**
|
|
2496
|
-
* The dependencies of the reaction that is currently being executed. In many cases,
|
|
2497
|
-
* the dependencies are unchanged between runs, and so this will be `null` unless
|
|
2498
|
-
* and until a new dependency is accessed — we track this via `skipped_deps`
|
|
2499
|
-
* @type {null | Value[]}
|
|
2500
|
-
*/
|
|
2501
|
-
var new_deps = null;
|
|
2502
|
-
var skipped_deps = 0;
|
|
2503
|
-
/**
|
|
2504
|
-
* Tracks writes that the effect it's executed in doesn't listen to yet,
|
|
2505
|
-
* so that the dependency can be added to the effect later on if it then reads it
|
|
2506
|
-
* @type {null | Source[]}
|
|
2507
|
-
*/
|
|
2508
|
-
var untracked_writes = null;
|
|
2509
|
-
/** @param {null | Source[]} value */
|
|
2510
|
-
function set_untracked_writes(value) {
|
|
2511
|
-
untracked_writes = value;
|
|
2512
|
-
}
|
|
2513
|
-
/**
|
|
2514
|
-
* @type {number} Used by sources and deriveds for handling updates.
|
|
2515
|
-
* Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing
|
|
2516
|
-
**/
|
|
2517
|
-
var write_version = 1;
|
|
2518
|
-
/** @type {number} Used to version each read of a source of derived to avoid duplicating depedencies inside a reaction */
|
|
2519
|
-
var read_version = 0;
|
|
2520
|
-
var update_version = read_version;
|
|
2521
|
-
/** @param {number} value */
|
|
2522
|
-
function set_update_version(value) {
|
|
2523
|
-
update_version = value;
|
|
2524
|
-
}
|
|
2525
|
-
function increment_write_version() {
|
|
2526
|
-
return ++write_version;
|
|
2527
|
-
}
|
|
2528
|
-
/**
|
|
2529
|
-
* Determines whether a derived or effect is dirty.
|
|
2530
|
-
* If it is MAYBE_DIRTY, will set the status to CLEAN
|
|
2531
|
-
* @param {Reaction} reaction
|
|
2532
|
-
* @returns {boolean}
|
|
2533
|
-
*/
|
|
2534
|
-
function is_dirty(reaction) {
|
|
2535
|
-
var flags = reaction.f;
|
|
2536
|
-
if ((flags & 2048) !== 0) return true;
|
|
2537
|
-
if (flags & 2) reaction.f &= ~WAS_MARKED;
|
|
2538
|
-
if ((flags & 4096) !== 0) {
|
|
2539
|
-
var dependencies = reaction.deps;
|
|
2540
|
-
var length = dependencies.length;
|
|
2541
|
-
for (var i = 0; i < length; i++) {
|
|
2542
|
-
var dependency = dependencies[i];
|
|
2543
|
-
if (is_dirty(dependency)) update_derived(dependency);
|
|
2544
|
-
if (dependency.wv > reaction.wv) return true;
|
|
2545
|
-
}
|
|
2546
|
-
if ((flags & 512) !== 0 && batch_values === null) set_signal_status(reaction, CLEAN);
|
|
2547
|
-
}
|
|
2548
|
-
return false;
|
|
2549
|
-
}
|
|
2550
|
-
/**
|
|
2551
|
-
* @param {Value} signal
|
|
2552
|
-
* @param {Effect} effect
|
|
2553
|
-
* @param {boolean} [root]
|
|
2554
|
-
*/
|
|
2555
|
-
function schedule_possible_effect_self_invalidation(signal, effect, root = true) {
|
|
2556
|
-
var reactions = signal.reactions;
|
|
2557
|
-
if (reactions === null) return;
|
|
2558
|
-
if (!async_mode_flag && current_sources !== null && current_sources.has(signal)) return;
|
|
2559
|
-
for (var i = 0; i < reactions.length; i++) {
|
|
2560
|
-
var reaction = reactions[i];
|
|
2561
|
-
if ((reaction.f & 2) !== 0) schedule_possible_effect_self_invalidation(reaction, effect, false);
|
|
2562
|
-
else if (effect === reaction) {
|
|
2563
|
-
if (root) set_signal_status(reaction, DIRTY);
|
|
2564
|
-
else if ((reaction.f & 1024) !== 0) set_signal_status(reaction, MAYBE_DIRTY);
|
|
2565
|
-
schedule_effect(reaction);
|
|
2146
|
+
function schedule_possible_effect_self_invalidation(signal, effect, root = true) {
|
|
2147
|
+
var reactions = signal.reactions;
|
|
2148
|
+
if (reactions === null) return;
|
|
2149
|
+
if (!async_mode_flag && current_sources !== null && current_sources.has(signal)) return;
|
|
2150
|
+
for (var i = 0; i < reactions.length; i++) {
|
|
2151
|
+
var reaction = reactions[i];
|
|
2152
|
+
if ((reaction.f & 2) !== 0) schedule_possible_effect_self_invalidation(reaction, effect, false);
|
|
2153
|
+
else if (effect === reaction) {
|
|
2154
|
+
if (root) set_signal_status(reaction, DIRTY);
|
|
2155
|
+
else if ((reaction.f & 1024) !== 0) set_signal_status(reaction, MAYBE_DIRTY);
|
|
2156
|
+
schedule_effect(reaction);
|
|
2566
2157
|
}
|
|
2567
2158
|
}
|
|
2568
2159
|
}
|
|
@@ -2596,24 +2187,8 @@ function update_reaction(reaction) {
|
|
|
2596
2187
|
var fn = reaction.fn;
|
|
2597
2188
|
var result = fn();
|
|
2598
2189
|
reaction.f |= REACTION_RAN;
|
|
2599
|
-
var deps = reaction
|
|
2600
|
-
var
|
|
2601
|
-
if (new_deps !== null) {
|
|
2602
|
-
var i;
|
|
2603
|
-
if (!is_fork) remove_reactions(reaction, skipped_deps);
|
|
2604
|
-
if (deps !== null && skipped_deps > 0) {
|
|
2605
|
-
deps.length = skipped_deps + new_deps.length;
|
|
2606
|
-
for (i = 0; i < new_deps.length; i++) deps[skipped_deps + i] = new_deps[i];
|
|
2607
|
-
} else reaction.deps = deps = new_deps;
|
|
2608
|
-
if (effect_tracking() && (reaction.f & 512) !== 0) for (i = skipped_deps; i < deps.length; i++) {
|
|
2609
|
-
var _deps$i;
|
|
2610
|
-
((_deps$i = deps[i]).reactions ?? (_deps$i.reactions = [])).push(reaction);
|
|
2611
|
-
}
|
|
2612
|
-
} else if (!is_fork && deps !== null && skipped_deps < deps.length) {
|
|
2613
|
-
remove_reactions(reaction, skipped_deps);
|
|
2614
|
-
deps.length = skipped_deps;
|
|
2615
|
-
}
|
|
2616
|
-
if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & 6146) === 0) for (i = 0; i < untracked_writes.length; i++) schedule_possible_effect_self_invalidation(untracked_writes[i], reaction);
|
|
2190
|
+
var deps = update_dependencies(reaction);
|
|
2191
|
+
if (is_runes() && untracked_writes !== null && !untracking && deps !== null && (reaction.f & 6146) === 0) for (var i = 0; i < untracked_writes.length; i++) schedule_possible_effect_self_invalidation(untracked_writes[i], reaction);
|
|
2617
2192
|
if (previous_reaction !== null && previous_reaction !== reaction) {
|
|
2618
2193
|
read_version++;
|
|
2619
2194
|
if (previous_reaction.deps !== null) for (let i = 0; i < previous_skipped_deps; i += 1) previous_reaction.deps[i].rv = read_version;
|
|
@@ -2624,6 +2199,7 @@ function update_reaction(reaction) {
|
|
|
2624
2199
|
if ((reaction.f & 8388608) !== 0) reaction.f ^= ERROR_VALUE;
|
|
2625
2200
|
return result;
|
|
2626
2201
|
} catch (error) {
|
|
2202
|
+
update_dependencies(reaction);
|
|
2627
2203
|
return handle_error(error);
|
|
2628
2204
|
} finally {
|
|
2629
2205
|
reaction.f ^= REACTION_IS_UPDATING;
|
|
@@ -2638,6 +2214,29 @@ function update_reaction(reaction) {
|
|
|
2638
2214
|
}
|
|
2639
2215
|
}
|
|
2640
2216
|
/**
|
|
2217
|
+
* @param {Reaction} reaction
|
|
2218
|
+
*/
|
|
2219
|
+
function update_dependencies(reaction) {
|
|
2220
|
+
var deps = reaction.deps;
|
|
2221
|
+
var is_fork = current_batch?.is_fork;
|
|
2222
|
+
if (new_deps !== null) {
|
|
2223
|
+
var i;
|
|
2224
|
+
if (!is_fork) remove_reactions(reaction, skipped_deps);
|
|
2225
|
+
if (deps !== null && skipped_deps > 0) {
|
|
2226
|
+
deps.length = skipped_deps + new_deps.length;
|
|
2227
|
+
for (i = 0; i < new_deps.length; i++) deps[skipped_deps + i] = new_deps[i];
|
|
2228
|
+
} else reaction.deps = deps = new_deps;
|
|
2229
|
+
if (effect_tracking() && (reaction.f & 512) !== 0) for (i = skipped_deps; i < deps.length; i++) {
|
|
2230
|
+
var _deps$i;
|
|
2231
|
+
((_deps$i = deps[i]).reactions ?? (_deps$i.reactions = [])).push(reaction);
|
|
2232
|
+
}
|
|
2233
|
+
} else if (!is_fork && deps !== null && skipped_deps < deps.length) {
|
|
2234
|
+
remove_reactions(reaction, skipped_deps);
|
|
2235
|
+
deps.length = skipped_deps;
|
|
2236
|
+
}
|
|
2237
|
+
return deps;
|
|
2238
|
+
}
|
|
2239
|
+
/**
|
|
2641
2240
|
* @template V
|
|
2642
2241
|
* @param {Reaction} signal
|
|
2643
2242
|
* @param {Value<V>} dependency
|
|
@@ -2656,339 +2255,808 @@ function remove_reaction(signal, dependency) {
|
|
|
2656
2255
|
}
|
|
2657
2256
|
}
|
|
2658
2257
|
}
|
|
2659
|
-
if (reactions === null && (dependency.f & 2) !== 0 && (new_deps === null || !includes.call(new_deps, dependency))) {
|
|
2660
|
-
var derived = dependency;
|
|
2661
|
-
if ((derived.f & 512) !== 0) {
|
|
2662
|
-
derived.f ^= 512;
|
|
2663
|
-
derived.f &= ~WAS_MARKED;
|
|
2664
|
-
}
|
|
2665
|
-
if (derived.v !== UNINITIALIZED) update_derived_status(derived);
|
|
2666
|
-
|
|
2667
|
-
|
|
2258
|
+
if (reactions === null && (dependency.f & 2) !== 0 && (new_deps === null || !includes.call(new_deps, dependency))) {
|
|
2259
|
+
var derived = dependency;
|
|
2260
|
+
if ((derived.f & 512) !== 0) {
|
|
2261
|
+
derived.f ^= 512;
|
|
2262
|
+
derived.f &= ~WAS_MARKED;
|
|
2263
|
+
}
|
|
2264
|
+
if (derived.v !== UNINITIALIZED) update_derived_status(derived);
|
|
2265
|
+
if (derived.ac !== null) without_reactive_context(() => {
|
|
2266
|
+
/** @type {AbortController} */ derived.ac.abort(STALE_REACTION);
|
|
2267
|
+
derived.ac = null;
|
|
2268
|
+
set_signal_status(derived, DIRTY);
|
|
2269
|
+
});
|
|
2270
|
+
freeze_derived_effects(derived);
|
|
2271
|
+
remove_reactions(derived, 0);
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
/**
|
|
2275
|
+
* @param {Reaction} signal
|
|
2276
|
+
* @param {number} start_index
|
|
2277
|
+
* @returns {void}
|
|
2278
|
+
*/
|
|
2279
|
+
function remove_reactions(signal, start_index) {
|
|
2280
|
+
var dependencies = signal.deps;
|
|
2281
|
+
if (dependencies === null) return;
|
|
2282
|
+
for (var i = start_index; i < dependencies.length; i++) remove_reaction(signal, dependencies[i]);
|
|
2283
|
+
}
|
|
2284
|
+
/**
|
|
2285
|
+
* @param {Effect} effect
|
|
2286
|
+
* @returns {void}
|
|
2287
|
+
*/
|
|
2288
|
+
function update_effect(effect) {
|
|
2289
|
+
var flags = effect.f;
|
|
2290
|
+
if ((flags & 16384) !== 0) return;
|
|
2291
|
+
set_signal_status(effect, CLEAN);
|
|
2292
|
+
var previous_effect = active_effect;
|
|
2293
|
+
var was_updating_effect = is_updating_effect;
|
|
2294
|
+
active_effect = effect;
|
|
2295
|
+
is_updating_effect = (flags & 96) === 0;
|
|
2296
|
+
try {
|
|
2297
|
+
if ((flags & 16777232) !== 0) destroy_block_effect_children(effect);
|
|
2298
|
+
else destroy_effect_children(effect);
|
|
2299
|
+
execute_effect_teardown(effect);
|
|
2300
|
+
var teardown = update_reaction(effect);
|
|
2301
|
+
effect.teardown = typeof teardown === "function" ? teardown : null;
|
|
2302
|
+
effect.wv = write_version;
|
|
2303
|
+
} finally {
|
|
2304
|
+
is_updating_effect = was_updating_effect;
|
|
2305
|
+
active_effect = previous_effect;
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
/**
|
|
2309
|
+
* @template V
|
|
2310
|
+
* @param {Value<V>} signal
|
|
2311
|
+
* @returns {V}
|
|
2312
|
+
*/
|
|
2313
|
+
function get(signal) {
|
|
2314
|
+
var is_derived = (signal.f & 2) !== 0;
|
|
2315
|
+
captured_signals?.add(signal);
|
|
2316
|
+
if (active_reaction !== null && !untracking) {
|
|
2317
|
+
if (!(active_effect !== null && (active_effect.f & 16384) !== 0) && (current_sources === null || !current_sources.has(signal))) {
|
|
2318
|
+
var deps = active_reaction.deps;
|
|
2319
|
+
if ((active_reaction.f & 2097152) !== 0) {
|
|
2320
|
+
if (signal.rv < read_version) {
|
|
2321
|
+
signal.rv = read_version;
|
|
2322
|
+
if (new_deps === null && deps !== null && deps[skipped_deps] === signal) skipped_deps++;
|
|
2323
|
+
else if (new_deps === null) new_deps = [signal];
|
|
2324
|
+
else new_deps.push(signal);
|
|
2325
|
+
}
|
|
2326
|
+
} else {
|
|
2327
|
+
var _active_reaction;
|
|
2328
|
+
(_active_reaction = active_reaction).deps ?? (_active_reaction.deps = []);
|
|
2329
|
+
if (!includes.call(active_reaction.deps, signal)) active_reaction.deps.push(signal);
|
|
2330
|
+
var reactions = signal.reactions;
|
|
2331
|
+
if (reactions === null) signal.reactions = [active_reaction];
|
|
2332
|
+
else if (!includes.call(reactions, active_reaction)) reactions.push(active_reaction);
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2336
|
+
if (is_destroying_effect && old_values.has(signal)) return old_values.get(signal);
|
|
2337
|
+
if (is_derived) {
|
|
2338
|
+
var derived = signal;
|
|
2339
|
+
if (is_destroying_effect) {
|
|
2340
|
+
var value = derived.v;
|
|
2341
|
+
if ((derived.f & 1024) === 0 && derived.reactions !== null || depends_on_old_values(derived)) value = execute_derived(derived);
|
|
2342
|
+
old_values.set(derived, value);
|
|
2343
|
+
return value;
|
|
2344
|
+
}
|
|
2345
|
+
var should_connect = (derived.f & 512) === 0 && !untracking && active_reaction !== null && (is_updating_effect || (active_reaction.f & 512) !== 0);
|
|
2346
|
+
var is_new = (derived.f & REACTION_RAN) === 0;
|
|
2347
|
+
if (is_dirty(derived)) {
|
|
2348
|
+
if (should_connect) derived.f |= 512;
|
|
2349
|
+
update_derived(derived);
|
|
2350
|
+
}
|
|
2351
|
+
if (should_connect && !is_new) {
|
|
2352
|
+
unfreeze_derived_effects(derived);
|
|
2353
|
+
reconnect(derived);
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
if (batch_values?.has(signal)) return batch_values.get(signal);
|
|
2357
|
+
if ((signal.f & 8388608) !== 0) throw signal.v;
|
|
2358
|
+
return signal.v;
|
|
2359
|
+
}
|
|
2360
|
+
/**
|
|
2361
|
+
* (Re)connect a disconnected derived, so that it is notified
|
|
2362
|
+
* of changes in `mark_reactions`
|
|
2363
|
+
* @param {Derived} derived
|
|
2364
|
+
*/
|
|
2365
|
+
function reconnect(derived) {
|
|
2366
|
+
derived.f |= 512;
|
|
2367
|
+
if (derived.deps === null) return;
|
|
2368
|
+
for (const dep of derived.deps) {
|
|
2369
|
+
(dep.reactions ?? (dep.reactions = [])).push(derived);
|
|
2370
|
+
if ((dep.f & 2) !== 0 && (dep.f & 512) === 0) {
|
|
2371
|
+
unfreeze_derived_effects(dep);
|
|
2372
|
+
reconnect(dep);
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
/** @param {Derived} derived */
|
|
2377
|
+
function depends_on_old_values(derived) {
|
|
2378
|
+
if (derived.v === UNINITIALIZED) return true;
|
|
2379
|
+
if (derived.deps === null) return false;
|
|
2380
|
+
for (const dep of derived.deps) {
|
|
2381
|
+
if (old_values.has(dep)) return true;
|
|
2382
|
+
if ((dep.f & 2) !== 0 && depends_on_old_values(dep)) return true;
|
|
2383
|
+
}
|
|
2384
|
+
return false;
|
|
2385
|
+
}
|
|
2386
|
+
/**
|
|
2387
|
+
* When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),
|
|
2388
|
+
* any state read inside `fn` will not be treated as a dependency.
|
|
2389
|
+
*
|
|
2390
|
+
* ```ts
|
|
2391
|
+
* $effect(() => {
|
|
2392
|
+
* // this will run when `data` changes, but not when `time` changes
|
|
2393
|
+
* save(data, {
|
|
2394
|
+
* timestamp: untrack(() => time)
|
|
2395
|
+
* });
|
|
2396
|
+
* });
|
|
2397
|
+
* ```
|
|
2398
|
+
* @template T
|
|
2399
|
+
* @param {() => T} fn
|
|
2400
|
+
* @returns {T}
|
|
2401
|
+
*/
|
|
2402
|
+
function untrack(fn) {
|
|
2403
|
+
var previous_untracking = untracking;
|
|
2404
|
+
try {
|
|
2405
|
+
untracking = true;
|
|
2406
|
+
return fn();
|
|
2407
|
+
} finally {
|
|
2408
|
+
untracking = previous_untracking;
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
//#endregion
|
|
2412
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/events.js
|
|
2413
|
+
/**
|
|
2414
|
+
* Used on elements, as a map of event type -> event handler,
|
|
2415
|
+
* and on events themselves to track which element handled an event
|
|
2416
|
+
*/
|
|
2417
|
+
var event_symbol = Symbol("events");
|
|
2418
|
+
/** @type {Set<string>} */
|
|
2419
|
+
var all_registered_events = /* @__PURE__ */ new Set();
|
|
2420
|
+
/** @type {Set<(events: Array<string>) => void>} */
|
|
2421
|
+
var root_event_handles = /* @__PURE__ */ new Set();
|
|
2422
|
+
var last_propagated_event = null;
|
|
2423
|
+
var last_propagated_event_clear_scheduled = false;
|
|
2424
|
+
/**
|
|
2425
|
+
* @this {EventTarget}
|
|
2426
|
+
* @param {Event} event
|
|
2427
|
+
* @returns {void}
|
|
2428
|
+
*/
|
|
2429
|
+
function handle_event_propagation(event) {
|
|
2430
|
+
var handler_element = this;
|
|
2431
|
+
var owner_document = handler_element.ownerDocument;
|
|
2432
|
+
var event_name = event.type;
|
|
2433
|
+
var path = event.composedPath?.() || [];
|
|
2434
|
+
var current_target = path[0] || event.target;
|
|
2435
|
+
last_propagated_event = event;
|
|
2436
|
+
if (!last_propagated_event_clear_scheduled) {
|
|
2437
|
+
last_propagated_event_clear_scheduled = true;
|
|
2438
|
+
setTimeout(() => {
|
|
2439
|
+
last_propagated_event_clear_scheduled = false;
|
|
2440
|
+
last_propagated_event = null;
|
|
2441
|
+
});
|
|
2442
|
+
}
|
|
2443
|
+
var path_idx = 0;
|
|
2444
|
+
var handled_at = last_propagated_event === event && event[event_symbol];
|
|
2445
|
+
if (handled_at) {
|
|
2446
|
+
var at_idx = path.indexOf(handled_at);
|
|
2447
|
+
if (at_idx !== -1 && (handler_element === document || handler_element === window)) {
|
|
2448
|
+
event[event_symbol] = handler_element;
|
|
2449
|
+
return;
|
|
2450
|
+
}
|
|
2451
|
+
var handler_idx = path.indexOf(handler_element);
|
|
2452
|
+
if (handler_idx === -1) return;
|
|
2453
|
+
if (at_idx <= handler_idx) path_idx = at_idx;
|
|
2454
|
+
}
|
|
2455
|
+
current_target = path[path_idx] || event.target;
|
|
2456
|
+
if (current_target === handler_element) return;
|
|
2457
|
+
define_property(event, "currentTarget", {
|
|
2458
|
+
configurable: true,
|
|
2459
|
+
get() {
|
|
2460
|
+
return current_target || owner_document;
|
|
2461
|
+
}
|
|
2462
|
+
});
|
|
2463
|
+
var previous_reaction = active_reaction;
|
|
2464
|
+
var previous_effect = active_effect;
|
|
2465
|
+
set_active_reaction(null);
|
|
2466
|
+
set_active_effect(null);
|
|
2467
|
+
try {
|
|
2468
|
+
/**
|
|
2469
|
+
* @type {unknown}
|
|
2470
|
+
*/
|
|
2471
|
+
var throw_error;
|
|
2472
|
+
/**
|
|
2473
|
+
* @type {unknown[]}
|
|
2474
|
+
*/
|
|
2475
|
+
var other_errors = [];
|
|
2476
|
+
while (current_target !== null) {
|
|
2477
|
+
if (current_target === handler_element) break;
|
|
2478
|
+
try {
|
|
2479
|
+
var delegated = current_target[event_symbol]?.[event_name];
|
|
2480
|
+
if (delegated != null && (!current_target.disabled || event.target === current_target)) delegated.call(current_target, event);
|
|
2481
|
+
} catch (error) {
|
|
2482
|
+
if (throw_error) other_errors.push(error);
|
|
2483
|
+
else throw_error = error;
|
|
2484
|
+
}
|
|
2485
|
+
if (event.cancelBubble) break;
|
|
2486
|
+
path_idx++;
|
|
2487
|
+
current_target = path_idx < path.length ? path[path_idx] : null;
|
|
2488
|
+
}
|
|
2489
|
+
if (throw_error) {
|
|
2490
|
+
for (let error of other_errors) queueMicrotask(() => {
|
|
2491
|
+
throw error;
|
|
2492
|
+
});
|
|
2493
|
+
throw throw_error;
|
|
2494
|
+
}
|
|
2495
|
+
} finally {
|
|
2496
|
+
event[event_symbol] = handler_element;
|
|
2497
|
+
delete event.currentTarget;
|
|
2498
|
+
set_active_reaction(previous_reaction);
|
|
2499
|
+
set_active_effect(previous_effect);
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
//#endregion
|
|
2503
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/reconciler.js
|
|
2504
|
+
var policy = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
|
|
2505
|
+
/** @param {string} html */
|
|
2506
|
+
createHTML: (html) => {
|
|
2507
|
+
return html;
|
|
2508
|
+
} });
|
|
2509
|
+
/** @param {string} html */
|
|
2510
|
+
function create_trusted_html(html) {
|
|
2511
|
+
return policy?.createHTML(html) ?? html;
|
|
2512
|
+
}
|
|
2513
|
+
/**
|
|
2514
|
+
* @param {string} html
|
|
2515
|
+
*/
|
|
2516
|
+
function create_fragment_from_html(html) {
|
|
2517
|
+
var elem = create_element("template");
|
|
2518
|
+
elem.innerHTML = create_trusted_html(html.replaceAll("<!>", "<!---->"));
|
|
2519
|
+
return elem.content;
|
|
2520
|
+
}
|
|
2521
|
+
//#endregion
|
|
2522
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/template.js
|
|
2523
|
+
/** @import { Effect, EffectNodes, TemplateNode } from '#client' */
|
|
2524
|
+
/** @import { TemplateStructure } from './types' */
|
|
2525
|
+
/**
|
|
2526
|
+
* @param {TemplateNode} start
|
|
2527
|
+
* @param {TemplateNode | null} end
|
|
2528
|
+
*/
|
|
2529
|
+
function assign_nodes(start, end) {
|
|
2530
|
+
var effect = active_effect;
|
|
2531
|
+
if (effect.nodes === null) effect.nodes = {
|
|
2532
|
+
start,
|
|
2533
|
+
end,
|
|
2534
|
+
a: null,
|
|
2535
|
+
t: null
|
|
2536
|
+
};
|
|
2537
|
+
}
|
|
2538
|
+
/**
|
|
2539
|
+
* @param {string} content
|
|
2540
|
+
* @param {number} flags
|
|
2541
|
+
* @returns {() => Node | Node[]}
|
|
2542
|
+
*/
|
|
2543
|
+
/*#__NO_SIDE_EFFECTS__*/
|
|
2544
|
+
function from_html(content, flags) {
|
|
2545
|
+
var is_fragment = (flags & 1) !== 0;
|
|
2546
|
+
var use_import_node = (flags & 2) !== 0;
|
|
2547
|
+
/** @type {Node} */
|
|
2548
|
+
var node;
|
|
2549
|
+
/**
|
|
2550
|
+
* Whether or not the first item is a text/element node. If not, we need to
|
|
2551
|
+
* create an additional comment node to act as `effect.nodes.start`
|
|
2552
|
+
*/
|
|
2553
|
+
var has_start = !content.startsWith("<!>");
|
|
2554
|
+
return () => {
|
|
2555
|
+
if (hydrating) {
|
|
2556
|
+
assign_nodes(hydrate_node, null);
|
|
2557
|
+
return hydrate_node;
|
|
2558
|
+
}
|
|
2559
|
+
if (node === void 0) {
|
|
2560
|
+
node = create_fragment_from_html(has_start ? content : "<!>" + content);
|
|
2561
|
+
if (!is_fragment) node = /* @__PURE__ */ get_first_child(node);
|
|
2562
|
+
}
|
|
2563
|
+
var clone = use_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true);
|
|
2564
|
+
if (is_fragment) {
|
|
2565
|
+
var start = /* @__PURE__ */ get_first_child(clone);
|
|
2566
|
+
var end = clone.lastChild;
|
|
2567
|
+
assign_nodes(start, end);
|
|
2568
|
+
} else assign_nodes(clone, clone);
|
|
2569
|
+
return clone;
|
|
2570
|
+
};
|
|
2571
|
+
}
|
|
2572
|
+
/**
|
|
2573
|
+
* Assign the created (or in hydration mode, traversed) dom elements to the current block
|
|
2574
|
+
* and insert the elements into the dom (in client mode).
|
|
2575
|
+
* @param {Text | Comment | Element} anchor
|
|
2576
|
+
* @param {DocumentFragment | Element} dom
|
|
2577
|
+
*/
|
|
2578
|
+
function append(anchor, dom) {
|
|
2579
|
+
if (hydrating) {
|
|
2580
|
+
var effect = active_effect;
|
|
2581
|
+
if ((effect.f & 32768) === 0 || effect.nodes.end === null) effect.nodes.end = hydrate_node;
|
|
2582
|
+
hydrate_next();
|
|
2583
|
+
return;
|
|
2584
|
+
}
|
|
2585
|
+
if (anchor === null) return;
|
|
2586
|
+
anchor.before(dom);
|
|
2587
|
+
}
|
|
2588
|
+
/**
|
|
2589
|
+
* Subset of delegated events which should be passive by default.
|
|
2590
|
+
* These two are already passive via browser defaults on window, document and body.
|
|
2591
|
+
* But since
|
|
2592
|
+
* - we're delegating them
|
|
2593
|
+
* - they happen often
|
|
2594
|
+
* - they apply to mobile which is generally less performant
|
|
2595
|
+
* we're marking them as passive by default for other elements, too.
|
|
2596
|
+
*/
|
|
2597
|
+
var PASSIVE_EVENTS = ["touchstart", "touchmove"];
|
|
2598
|
+
/**
|
|
2599
|
+
* Returns `true` if `name` is a passive event
|
|
2600
|
+
* @param {string} name
|
|
2601
|
+
*/
|
|
2602
|
+
function is_passive_event(name) {
|
|
2603
|
+
return PASSIVE_EVENTS.includes(name);
|
|
2604
|
+
}
|
|
2605
|
+
//#endregion
|
|
2606
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/reactivity/create-subscriber.js
|
|
2607
|
+
/**
|
|
2608
|
+
* Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
|
|
2609
|
+
* It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
|
|
2610
|
+
*
|
|
2611
|
+
* If `subscribe` is called inside an effect (including indirectly, for example inside a getter),
|
|
2612
|
+
* the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.
|
|
2613
|
+
*
|
|
2614
|
+
* If `start` returns a cleanup function, it will be called when the effect is destroyed.
|
|
2615
|
+
*
|
|
2616
|
+
* If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects
|
|
2617
|
+
* are active, and the returned teardown function will only be called when all effects are destroyed.
|
|
2618
|
+
*
|
|
2619
|
+
* It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):
|
|
2620
|
+
*
|
|
2621
|
+
* ```js
|
|
2622
|
+
* import { createSubscriber } from 'svelte/reactivity';
|
|
2623
|
+
* import { on } from 'svelte/events';
|
|
2624
|
+
*
|
|
2625
|
+
* export class MediaQuery {
|
|
2626
|
+
* #query;
|
|
2627
|
+
* #subscribe;
|
|
2628
|
+
*
|
|
2629
|
+
* constructor(query) {
|
|
2630
|
+
* this.#query = window.matchMedia(`(${query})`);
|
|
2631
|
+
*
|
|
2632
|
+
* this.#subscribe = createSubscriber((update) => {
|
|
2633
|
+
* // when the `change` event occurs, re-run any effects that read `this.current`
|
|
2634
|
+
* const off = on(this.#query, 'change', update);
|
|
2635
|
+
*
|
|
2636
|
+
* // stop listening when all the effects are destroyed
|
|
2637
|
+
* return () => off();
|
|
2638
|
+
* });
|
|
2639
|
+
* }
|
|
2640
|
+
*
|
|
2641
|
+
* get current() {
|
|
2642
|
+
* // This makes the getter reactive, if read in an effect
|
|
2643
|
+
* this.#subscribe();
|
|
2644
|
+
*
|
|
2645
|
+
* // Return the current state of the query, whether or not we're in an effect
|
|
2646
|
+
* return this.#query.matches;
|
|
2647
|
+
* }
|
|
2648
|
+
* }
|
|
2649
|
+
* ```
|
|
2650
|
+
* @param {(update: () => void) => (() => void) | void} start
|
|
2651
|
+
* @since 5.7.0
|
|
2652
|
+
*/
|
|
2653
|
+
function createSubscriber(start) {
|
|
2654
|
+
let subscribers = 0;
|
|
2655
|
+
let version = source(0);
|
|
2656
|
+
/** @type {(() => void) | void} */
|
|
2657
|
+
let stop;
|
|
2658
|
+
return () => {
|
|
2659
|
+
if (effect_tracking()) {
|
|
2660
|
+
get(version);
|
|
2661
|
+
render_effect(() => {
|
|
2662
|
+
if (subscribers === 0) stop = untrack(() => start(() => increment(version)));
|
|
2663
|
+
subscribers += 1;
|
|
2664
|
+
return () => {
|
|
2665
|
+
queue_micro_task(() => {
|
|
2666
|
+
subscribers -= 1;
|
|
2667
|
+
if (subscribers === 0) {
|
|
2668
|
+
stop?.();
|
|
2669
|
+
stop = void 0;
|
|
2670
|
+
increment(version);
|
|
2671
|
+
}
|
|
2672
|
+
});
|
|
2673
|
+
};
|
|
2674
|
+
});
|
|
2675
|
+
}
|
|
2676
|
+
};
|
|
2677
|
+
}
|
|
2678
|
+
//#endregion
|
|
2679
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
|
|
2680
|
+
/** @import { Effect, Source, TemplateNode, } from '#client' */
|
|
2681
|
+
/**
|
|
2682
|
+
* @typedef {{
|
|
2683
|
+
* onerror?: ((error: unknown, reset: () => void) => void) | null;
|
|
2684
|
+
* failed?: ((anchor: Node, error: () => unknown, reset: () => () => void) => void) | null;
|
|
2685
|
+
* pending?: ((anchor: Node) => void) | null;
|
|
2686
|
+
* }} BoundaryProps
|
|
2687
|
+
*/
|
|
2688
|
+
var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;
|
|
2689
|
+
/**
|
|
2690
|
+
* @param {TemplateNode} node
|
|
2691
|
+
* @param {BoundaryProps} props
|
|
2692
|
+
* @param {((anchor: Node) => void)} children
|
|
2693
|
+
* @param {((error: unknown) => unknown) | undefined} [transform_error]
|
|
2694
|
+
* @returns {void}
|
|
2695
|
+
*/
|
|
2696
|
+
function boundary(node, props, children, transform_error) {
|
|
2697
|
+
new Boundary(node, props, children, transform_error);
|
|
2698
|
+
}
|
|
2699
|
+
var _anchor = /* @__PURE__ */ new WeakMap();
|
|
2700
|
+
var _hydrate_open = /* @__PURE__ */ new WeakMap();
|
|
2701
|
+
var _props = /* @__PURE__ */ new WeakMap();
|
|
2702
|
+
var _children = /* @__PURE__ */ new WeakMap();
|
|
2703
|
+
var _effect = /* @__PURE__ */ new WeakMap();
|
|
2704
|
+
var _main_effect = /* @__PURE__ */ new WeakMap();
|
|
2705
|
+
var _pending_effect = /* @__PURE__ */ new WeakMap();
|
|
2706
|
+
var _failed_effect = /* @__PURE__ */ new WeakMap();
|
|
2707
|
+
var _offscreen_fragment = /* @__PURE__ */ new WeakMap();
|
|
2708
|
+
var _local_pending_count = /* @__PURE__ */ new WeakMap();
|
|
2709
|
+
var _pending_count = /* @__PURE__ */ new WeakMap();
|
|
2710
|
+
var _pending_count_update_queued = /* @__PURE__ */ new WeakMap();
|
|
2711
|
+
var _dirty_effects = /* @__PURE__ */ new WeakMap();
|
|
2712
|
+
var _maybe_dirty_effects = /* @__PURE__ */ new WeakMap();
|
|
2713
|
+
var _effect_pending = /* @__PURE__ */ new WeakMap();
|
|
2714
|
+
var _effect_pending_subscriber = /* @__PURE__ */ new WeakMap();
|
|
2715
|
+
var _Boundary_brand = /* @__PURE__ */ new WeakSet();
|
|
2716
|
+
var Boundary = class {
|
|
2717
|
+
/**
|
|
2718
|
+
* @param {TemplateNode} node
|
|
2719
|
+
* @param {BoundaryProps} props
|
|
2720
|
+
* @param {((anchor: Node) => void)} children
|
|
2721
|
+
* @param {((error: unknown) => unknown) | undefined} [transform_error]
|
|
2722
|
+
*/
|
|
2723
|
+
constructor(node, props, children, transform_error) {
|
|
2724
|
+
_classPrivateMethodInitSpec(this, _Boundary_brand);
|
|
2725
|
+
_defineProperty(
|
|
2726
|
+
this,
|
|
2727
|
+
/** @type {Boundary | null} */
|
|
2728
|
+
"parent",
|
|
2729
|
+
void 0
|
|
2730
|
+
);
|
|
2731
|
+
_defineProperty(this, "is_pending", false);
|
|
2732
|
+
_defineProperty(
|
|
2733
|
+
this,
|
|
2734
|
+
/**
|
|
2735
|
+
* API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
|
|
2736
|
+
* Inherited from parent boundary, or defaults to identity.
|
|
2737
|
+
* @type {(error: unknown) => unknown}
|
|
2738
|
+
*/
|
|
2739
|
+
"transform_error",
|
|
2740
|
+
void 0
|
|
2741
|
+
);
|
|
2742
|
+
_classPrivateFieldInitSpec(this, _anchor, void 0);
|
|
2743
|
+
_classPrivateFieldInitSpec(this, _hydrate_open, hydrating ? hydrate_node : null);
|
|
2744
|
+
_classPrivateFieldInitSpec(this, _props, void 0);
|
|
2745
|
+
_classPrivateFieldInitSpec(this, _children, void 0);
|
|
2746
|
+
_classPrivateFieldInitSpec(this, _effect, void 0);
|
|
2747
|
+
_classPrivateFieldInitSpec(this, _main_effect, null);
|
|
2748
|
+
_classPrivateFieldInitSpec(this, _pending_effect, null);
|
|
2749
|
+
_classPrivateFieldInitSpec(this, _failed_effect, null);
|
|
2750
|
+
_classPrivateFieldInitSpec(this, _offscreen_fragment, null);
|
|
2751
|
+
_classPrivateFieldInitSpec(this, _local_pending_count, 0);
|
|
2752
|
+
_classPrivateFieldInitSpec(this, _pending_count, 0);
|
|
2753
|
+
_classPrivateFieldInitSpec(this, _pending_count_update_queued, false);
|
|
2754
|
+
_classPrivateFieldInitSpec(this, _dirty_effects, /* @__PURE__ */ new Set());
|
|
2755
|
+
_classPrivateFieldInitSpec(this, _maybe_dirty_effects, /* @__PURE__ */ new Set());
|
|
2756
|
+
_classPrivateFieldInitSpec(this, _effect_pending, null);
|
|
2757
|
+
_classPrivateFieldInitSpec(this, _effect_pending_subscriber, createSubscriber(() => {
|
|
2758
|
+
_classPrivateFieldSet2(_effect_pending, this, source(_classPrivateFieldGet2(_local_pending_count, this)));
|
|
2759
|
+
return () => {
|
|
2760
|
+
_classPrivateFieldSet2(_effect_pending, this, null);
|
|
2761
|
+
};
|
|
2762
|
+
}));
|
|
2763
|
+
_classPrivateFieldSet2(_anchor, this, node);
|
|
2764
|
+
_classPrivateFieldSet2(_props, this, props);
|
|
2765
|
+
_classPrivateFieldSet2(_children, this, (anchor) => {
|
|
2766
|
+
var effect = active_effect;
|
|
2767
|
+
effect.b = this;
|
|
2768
|
+
effect.f |= 128;
|
|
2769
|
+
children(anchor);
|
|
2770
|
+
});
|
|
2771
|
+
this.parent = active_effect.b;
|
|
2772
|
+
this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
|
|
2773
|
+
_classPrivateFieldSet2(_effect, this, block(() => {
|
|
2774
|
+
if (hydrating) {
|
|
2775
|
+
const comment = _classPrivateFieldGet2(_hydrate_open, this);
|
|
2776
|
+
hydrate_next();
|
|
2777
|
+
const server_rendered_pending = comment.data === "[!";
|
|
2778
|
+
if (comment.data.startsWith("[?")) {
|
|
2779
|
+
const serialized_error = JSON.parse(comment.data.slice(2));
|
|
2780
|
+
_assertClassBrand(_Boundary_brand, this, _hydrate_failed_content).call(this, serialized_error);
|
|
2781
|
+
} else if (server_rendered_pending) _assertClassBrand(_Boundary_brand, this, _hydrate_pending_content).call(this);
|
|
2782
|
+
else _assertClassBrand(_Boundary_brand, this, _hydrate_resolved_content).call(this);
|
|
2783
|
+
} else _assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
2784
|
+
}, flags));
|
|
2785
|
+
if (hydrating) _classPrivateFieldSet2(_anchor, this, hydrate_node);
|
|
2786
|
+
}
|
|
2787
|
+
/**
|
|
2788
|
+
* Defer an effect inside a pending boundary until the boundary resolves
|
|
2789
|
+
* @param {Effect} effect
|
|
2790
|
+
*/
|
|
2791
|
+
defer_effect(effect) {
|
|
2792
|
+
defer_effect(effect, _classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
|
|
2668
2793
|
}
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
* @
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
function remove_reactions(signal, start_index) {
|
|
2676
|
-
var dependencies = signal.deps;
|
|
2677
|
-
if (dependencies === null) return;
|
|
2678
|
-
for (var i = start_index; i < dependencies.length; i++) remove_reaction(signal, dependencies[i]);
|
|
2679
|
-
}
|
|
2680
|
-
/**
|
|
2681
|
-
* @param {Effect} effect
|
|
2682
|
-
* @returns {void}
|
|
2683
|
-
*/
|
|
2684
|
-
function update_effect(effect) {
|
|
2685
|
-
var flags = effect.f;
|
|
2686
|
-
if ((flags & 16384) !== 0) return;
|
|
2687
|
-
set_signal_status(effect, CLEAN);
|
|
2688
|
-
var previous_effect = active_effect;
|
|
2689
|
-
var was_updating_effect = is_updating_effect;
|
|
2690
|
-
active_effect = effect;
|
|
2691
|
-
is_updating_effect = true;
|
|
2692
|
-
try {
|
|
2693
|
-
if ((flags & 16777232) !== 0) destroy_block_effect_children(effect);
|
|
2694
|
-
else destroy_effect_children(effect);
|
|
2695
|
-
execute_effect_teardown(effect);
|
|
2696
|
-
var teardown = update_reaction(effect);
|
|
2697
|
-
effect.teardown = typeof teardown === "function" ? teardown : null;
|
|
2698
|
-
effect.wv = write_version;
|
|
2699
|
-
} finally {
|
|
2700
|
-
is_updating_effect = was_updating_effect;
|
|
2701
|
-
active_effect = previous_effect;
|
|
2794
|
+
/**
|
|
2795
|
+
* Returns `false` if the effect exists inside a boundary whose pending snippet is shown
|
|
2796
|
+
* @returns {boolean}
|
|
2797
|
+
*/
|
|
2798
|
+
is_rendered() {
|
|
2799
|
+
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
2702
2800
|
}
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
* @template V
|
|
2706
|
-
* @param {Value<V>} signal
|
|
2707
|
-
* @returns {V}
|
|
2708
|
-
*/
|
|
2709
|
-
function get(signal) {
|
|
2710
|
-
var is_derived = (signal.f & 2) !== 0;
|
|
2711
|
-
captured_signals?.add(signal);
|
|
2712
|
-
if (active_reaction !== null && !untracking) {
|
|
2713
|
-
if (!(active_effect !== null && (active_effect.f & 16384) !== 0) && (current_sources === null || !current_sources.has(signal))) {
|
|
2714
|
-
var deps = active_reaction.deps;
|
|
2715
|
-
if ((active_reaction.f & 2097152) !== 0) {
|
|
2716
|
-
if (signal.rv < read_version) {
|
|
2717
|
-
signal.rv = read_version;
|
|
2718
|
-
if (new_deps === null && deps !== null && deps[skipped_deps] === signal) skipped_deps++;
|
|
2719
|
-
else if (new_deps === null) new_deps = [signal];
|
|
2720
|
-
else new_deps.push(signal);
|
|
2721
|
-
}
|
|
2722
|
-
} else {
|
|
2723
|
-
var _active_reaction;
|
|
2724
|
-
(_active_reaction = active_reaction).deps ?? (_active_reaction.deps = []);
|
|
2725
|
-
if (!includes.call(active_reaction.deps, signal)) active_reaction.deps.push(signal);
|
|
2726
|
-
var reactions = signal.reactions;
|
|
2727
|
-
if (reactions === null) signal.reactions = [active_reaction];
|
|
2728
|
-
else if (!includes.call(reactions, active_reaction)) reactions.push(active_reaction);
|
|
2729
|
-
}
|
|
2730
|
-
}
|
|
2801
|
+
has_pending_snippet() {
|
|
2802
|
+
return !!_classPrivateFieldGet2(_props, this).pending;
|
|
2731
2803
|
}
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
unfreeze_derived_effects(derived);
|
|
2749
|
-
reconnect(derived);
|
|
2750
|
-
}
|
|
2804
|
+
/**
|
|
2805
|
+
* Update the source that powers `$effect.pending()` inside this boundary,
|
|
2806
|
+
* and controls when the current `pending` snippet (if any) is removed.
|
|
2807
|
+
* Do not call from inside the class
|
|
2808
|
+
* @param {1 | -1} d
|
|
2809
|
+
* @param {Batch} batch
|
|
2810
|
+
*/
|
|
2811
|
+
update_pending_count(d, batch) {
|
|
2812
|
+
_assertClassBrand(_Boundary_brand, this, _update_pending_count).call(this, d, batch);
|
|
2813
|
+
_classPrivateFieldSet2(_local_pending_count, this, _classPrivateFieldGet2(_local_pending_count, this) + d);
|
|
2814
|
+
if (!_classPrivateFieldGet2(_effect_pending, this) || _classPrivateFieldGet2(_pending_count_update_queued, this)) return;
|
|
2815
|
+
_classPrivateFieldSet2(_pending_count_update_queued, this, true);
|
|
2816
|
+
queue_micro_task(() => {
|
|
2817
|
+
_classPrivateFieldSet2(_pending_count_update_queued, this, false);
|
|
2818
|
+
if (_classPrivateFieldGet2(_effect_pending, this)) internal_set(_classPrivateFieldGet2(_effect_pending, this), _classPrivateFieldGet2(_local_pending_count, this));
|
|
2819
|
+
});
|
|
2751
2820
|
}
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
}
|
|
2756
|
-
/**
|
|
2757
|
-
* (Re)connect a disconnected derived, so that it is notified
|
|
2758
|
-
* of changes in `mark_reactions`
|
|
2759
|
-
* @param {Derived} derived
|
|
2760
|
-
*/
|
|
2761
|
-
function reconnect(derived) {
|
|
2762
|
-
derived.f |= 512;
|
|
2763
|
-
if (derived.deps === null) return;
|
|
2764
|
-
for (const dep of derived.deps) {
|
|
2765
|
-
(dep.reactions ?? (dep.reactions = [])).push(derived);
|
|
2766
|
-
if ((dep.f & 2) !== 0 && (dep.f & 512) === 0) {
|
|
2767
|
-
unfreeze_derived_effects(dep);
|
|
2768
|
-
reconnect(dep);
|
|
2769
|
-
}
|
|
2821
|
+
get_effect_pending() {
|
|
2822
|
+
_classPrivateFieldGet2(_effect_pending_subscriber, this).call(this);
|
|
2823
|
+
return get(_classPrivateFieldGet2(_effect_pending, this));
|
|
2770
2824
|
}
|
|
2771
|
-
}
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2825
|
+
/** @param {unknown} error */
|
|
2826
|
+
error(error) {
|
|
2827
|
+
if (!_classPrivateFieldGet2(_props, this).onerror && !_classPrivateFieldGet2(_props, this).failed) throw error;
|
|
2828
|
+
if (current_batch?.is_fork) {
|
|
2829
|
+
if (_classPrivateFieldGet2(_main_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_main_effect, this));
|
|
2830
|
+
if (_classPrivateFieldGet2(_pending_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_pending_effect, this));
|
|
2831
|
+
if (_classPrivateFieldGet2(_failed_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_failed_effect, this));
|
|
2832
|
+
current_batch.oncommit(() => {
|
|
2833
|
+
_assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
|
|
2834
|
+
});
|
|
2835
|
+
} else _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
|
|
2779
2836
|
}
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
/**
|
|
2783
|
-
* When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),
|
|
2784
|
-
* any state read inside `fn` will not be treated as a dependency.
|
|
2785
|
-
*
|
|
2786
|
-
* ```ts
|
|
2787
|
-
* $effect(() => {
|
|
2788
|
-
* // this will run when `data` changes, but not when `time` changes
|
|
2789
|
-
* save(data, {
|
|
2790
|
-
* timestamp: untrack(() => time)
|
|
2791
|
-
* });
|
|
2792
|
-
* });
|
|
2793
|
-
* ```
|
|
2794
|
-
* @template T
|
|
2795
|
-
* @param {() => T} fn
|
|
2796
|
-
* @returns {T}
|
|
2797
|
-
*/
|
|
2798
|
-
function untrack(fn) {
|
|
2799
|
-
var previous_untracking = untracking;
|
|
2837
|
+
};
|
|
2838
|
+
function _hydrate_resolved_content() {
|
|
2800
2839
|
try {
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
untracking = previous_untracking;
|
|
2840
|
+
_classPrivateFieldSet2(_main_effect, this, branch(() => _classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this))));
|
|
2841
|
+
} catch (error) {
|
|
2842
|
+
this.error(error);
|
|
2805
2843
|
}
|
|
2806
2844
|
}
|
|
2807
|
-
//#endregion
|
|
2808
|
-
//#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/elements/events.js
|
|
2809
2845
|
/**
|
|
2810
|
-
*
|
|
2811
|
-
* and on events themselves to track which element handled an event
|
|
2846
|
+
* @param {unknown} error The deserialized error from the server's hydration comment
|
|
2812
2847
|
*/
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2848
|
+
function _hydrate_failed_content(error) {
|
|
2849
|
+
const failed = _classPrivateFieldGet2(_props, this).failed;
|
|
2850
|
+
const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, error);
|
|
2851
|
+
queue_micro_task(invoke_onerror);
|
|
2852
|
+
if (!failed) return;
|
|
2853
|
+
_classPrivateFieldSet2(_failed_effect, this, branch(() => {
|
|
2854
|
+
failed(_classPrivateFieldGet2(_anchor, this), () => error, () => reset);
|
|
2855
|
+
}));
|
|
2856
|
+
}
|
|
2819
2857
|
/**
|
|
2820
|
-
*
|
|
2821
|
-
*
|
|
2822
|
-
* @
|
|
2858
|
+
* Creates the `reset` function for a failed boundary, along with a function
|
|
2859
|
+
* that invokes `onerror` with it (if provided)
|
|
2860
|
+
* @param {unknown} error
|
|
2861
|
+
* @returns {{ reset: () => void, invoke_onerror: () => void }}
|
|
2823
2862
|
*/
|
|
2824
|
-
function
|
|
2825
|
-
var
|
|
2826
|
-
var
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
last_propagated_event = event;
|
|
2831
|
-
var path_idx = 0;
|
|
2832
|
-
var handled_at = last_propagated_event === event && event[event_symbol];
|
|
2833
|
-
if (handled_at) {
|
|
2834
|
-
var at_idx = path.indexOf(handled_at);
|
|
2835
|
-
if (at_idx !== -1 && (handler_element === document || handler_element === window)) {
|
|
2836
|
-
event[event_symbol] = handler_element;
|
|
2863
|
+
function _create_reset(error) {
|
|
2864
|
+
var did_reset = false;
|
|
2865
|
+
var calling_on_error = false;
|
|
2866
|
+
const reset = () => {
|
|
2867
|
+
if (did_reset) {
|
|
2868
|
+
svelte_boundary_reset_noop();
|
|
2837
2869
|
return;
|
|
2838
2870
|
}
|
|
2839
|
-
|
|
2840
|
-
if (
|
|
2841
|
-
if (
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2871
|
+
did_reset = true;
|
|
2872
|
+
if (calling_on_error) svelte_boundary_reset_onerror();
|
|
2873
|
+
if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
|
|
2874
|
+
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
2875
|
+
});
|
|
2876
|
+
_assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
2877
|
+
_assertClassBrand(_Boundary_brand, this, _render).call(this);
|
|
2878
|
+
});
|
|
2879
|
+
};
|
|
2880
|
+
const invoke_onerror = () => {
|
|
2881
|
+
try {
|
|
2882
|
+
calling_on_error = true;
|
|
2883
|
+
_classPrivateFieldGet2(_props, this).onerror?.(error, reset);
|
|
2884
|
+
calling_on_error = false;
|
|
2885
|
+
} catch (err) {
|
|
2886
|
+
invoke_error_boundary(err, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
2849
2887
|
}
|
|
2850
|
-
}
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
var
|
|
2864
|
-
|
|
2865
|
-
|
|
2888
|
+
};
|
|
2889
|
+
return {
|
|
2890
|
+
reset,
|
|
2891
|
+
invoke_onerror
|
|
2892
|
+
};
|
|
2893
|
+
}
|
|
2894
|
+
function _hydrate_pending_content() {
|
|
2895
|
+
const pending = _classPrivateFieldGet2(_props, this).pending;
|
|
2896
|
+
if (!pending) return;
|
|
2897
|
+
this.is_pending = true;
|
|
2898
|
+
_classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
|
|
2899
|
+
queue_micro_task(() => {
|
|
2900
|
+
var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
|
|
2901
|
+
var anchor = create_text();
|
|
2902
|
+
var handled = false;
|
|
2903
|
+
fragment.append(anchor);
|
|
2904
|
+
_classPrivateFieldSet2(_main_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
2866
2905
|
try {
|
|
2867
|
-
|
|
2868
|
-
if (delegated != null && (!current_target.disabled || event.target === current_target)) delegated.call(current_target, event);
|
|
2906
|
+
return branch(() => _classPrivateFieldGet2(_children, this).call(this, anchor));
|
|
2869
2907
|
} catch (error) {
|
|
2870
|
-
|
|
2871
|
-
|
|
2908
|
+
try {
|
|
2909
|
+
this.error(error);
|
|
2910
|
+
handled = true;
|
|
2911
|
+
} catch (error) {
|
|
2912
|
+
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
|
|
2913
|
+
}
|
|
2914
|
+
return null;
|
|
2872
2915
|
}
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2916
|
+
}));
|
|
2917
|
+
if (_classPrivateFieldGet2(_main_effect, this) === null) {
|
|
2918
|
+
_classPrivateFieldSet2(_offscreen_fragment, this, null);
|
|
2919
|
+
if (handled) _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
2920
|
+
return;
|
|
2876
2921
|
}
|
|
2877
|
-
if (
|
|
2878
|
-
|
|
2879
|
-
|
|
2922
|
+
if (_classPrivateFieldGet2(_pending_count, this) === 0) {
|
|
2923
|
+
_classPrivateFieldGet2(_anchor, this).before(fragment);
|
|
2924
|
+
_classPrivateFieldSet2(_offscreen_fragment, this, null);
|
|
2925
|
+
pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
|
|
2926
|
+
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
2880
2927
|
});
|
|
2881
|
-
|
|
2928
|
+
_assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
2882
2929
|
}
|
|
2883
|
-
}
|
|
2884
|
-
event[event_symbol] = handler_element;
|
|
2885
|
-
delete event.currentTarget;
|
|
2886
|
-
set_active_reaction(previous_reaction);
|
|
2887
|
-
set_active_effect(previous_effect);
|
|
2888
|
-
}
|
|
2930
|
+
});
|
|
2889
2931
|
}
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2932
|
+
function _render() {
|
|
2933
|
+
try {
|
|
2934
|
+
this.is_pending = this.has_pending_snippet();
|
|
2935
|
+
_classPrivateFieldSet2(_pending_count, this, 0);
|
|
2936
|
+
_classPrivateFieldSet2(_local_pending_count, this, 0);
|
|
2937
|
+
_classPrivateFieldSet2(_main_effect, this, branch(() => {
|
|
2938
|
+
_classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this));
|
|
2939
|
+
}));
|
|
2940
|
+
if (_classPrivateFieldGet2(_pending_count, this) > 0) {
|
|
2941
|
+
var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
|
|
2942
|
+
move_effect(_classPrivateFieldGet2(_main_effect, this), fragment);
|
|
2943
|
+
const pending = _classPrivateFieldGet2(_props, this).pending;
|
|
2944
|
+
_classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
|
|
2945
|
+
} else _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
|
|
2946
|
+
} catch (error) {
|
|
2947
|
+
this.error(error);
|
|
2948
|
+
}
|
|
2900
2949
|
}
|
|
2901
2950
|
/**
|
|
2902
|
-
* @param {
|
|
2951
|
+
* @param {Batch} batch
|
|
2903
2952
|
*/
|
|
2904
|
-
function
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
return elem.content;
|
|
2953
|
+
function _resolve(batch) {
|
|
2954
|
+
this.is_pending = false;
|
|
2955
|
+
batch.transfer_effects(_classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
|
|
2908
2956
|
}
|
|
2909
|
-
//#endregion
|
|
2910
|
-
//#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/template.js
|
|
2911
|
-
/** @import { Effect, EffectNodes, TemplateNode } from '#client' */
|
|
2912
|
-
/** @import { TemplateStructure } from './types' */
|
|
2913
2957
|
/**
|
|
2914
|
-
* @
|
|
2915
|
-
* @param {
|
|
2958
|
+
* @template T
|
|
2959
|
+
* @param {() => T} fn
|
|
2916
2960
|
*/
|
|
2917
|
-
function
|
|
2918
|
-
var
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2961
|
+
function _run(fn) {
|
|
2962
|
+
var previous_effect = active_effect;
|
|
2963
|
+
var previous_reaction = active_reaction;
|
|
2964
|
+
var previous_ctx = component_context;
|
|
2965
|
+
set_active_effect(_classPrivateFieldGet2(_effect, this));
|
|
2966
|
+
set_active_reaction(_classPrivateFieldGet2(_effect, this));
|
|
2967
|
+
set_component_context(_classPrivateFieldGet2(_effect, this).ctx);
|
|
2968
|
+
try {
|
|
2969
|
+
Batch.ensure();
|
|
2970
|
+
return fn();
|
|
2971
|
+
} finally {
|
|
2972
|
+
set_active_effect(previous_effect);
|
|
2973
|
+
set_active_reaction(previous_reaction);
|
|
2974
|
+
set_component_context(previous_ctx);
|
|
2975
|
+
}
|
|
2925
2976
|
}
|
|
2926
2977
|
/**
|
|
2927
|
-
*
|
|
2928
|
-
*
|
|
2929
|
-
* @
|
|
2978
|
+
* Updates the pending count associated with the currently visible pending snippet,
|
|
2979
|
+
* if any, such that we can replace the snippet with content once work is done
|
|
2980
|
+
* @param {1 | -1} d
|
|
2981
|
+
* @param {Batch} batch
|
|
2930
2982
|
*/
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
var node;
|
|
2937
|
-
/**
|
|
2938
|
-
* Whether or not the first item is a text/element node. If not, we need to
|
|
2939
|
-
* create an additional comment node to act as `effect.nodes.start`
|
|
2940
|
-
*/
|
|
2941
|
-
var has_start = !content.startsWith("<!>");
|
|
2942
|
-
return () => {
|
|
2943
|
-
if (hydrating) {
|
|
2944
|
-
assign_nodes(hydrate_node, null);
|
|
2945
|
-
return hydrate_node;
|
|
2983
|
+
function _update_pending_count(d, batch) {
|
|
2984
|
+
if (!this.has_pending_snippet()) {
|
|
2985
|
+
if (this.parent) {
|
|
2986
|
+
var _this$parent;
|
|
2987
|
+
_assertClassBrand(_Boundary_brand, _this$parent = this.parent, _update_pending_count).call(_this$parent, d, batch);
|
|
2946
2988
|
}
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2989
|
+
return;
|
|
2990
|
+
}
|
|
2991
|
+
_classPrivateFieldSet2(_pending_count, this, _classPrivateFieldGet2(_pending_count, this) + d);
|
|
2992
|
+
if (_classPrivateFieldGet2(_pending_count, this) === 0) {
|
|
2993
|
+
_assertClassBrand(_Boundary_brand, this, _resolve).call(this, batch);
|
|
2994
|
+
if (_classPrivateFieldGet2(_pending_effect, this)) pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
|
|
2995
|
+
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
2996
|
+
});
|
|
2997
|
+
if (_classPrivateFieldGet2(_offscreen_fragment, this)) {
|
|
2998
|
+
_classPrivateFieldGet2(_anchor, this).before(_classPrivateFieldGet2(_offscreen_fragment, this));
|
|
2999
|
+
_classPrivateFieldSet2(_offscreen_fragment, this, null);
|
|
2950
3000
|
}
|
|
2951
|
-
|
|
2952
|
-
if (is_fragment) {
|
|
2953
|
-
var start = /* @__PURE__ */ get_first_child(clone);
|
|
2954
|
-
var end = clone.lastChild;
|
|
2955
|
-
assign_nodes(start, end);
|
|
2956
|
-
} else assign_nodes(clone, clone);
|
|
2957
|
-
return clone;
|
|
2958
|
-
};
|
|
3001
|
+
}
|
|
2959
3002
|
}
|
|
2960
3003
|
/**
|
|
2961
|
-
*
|
|
2962
|
-
* and insert the elements into the dom (in client mode).
|
|
2963
|
-
* @param {Text | Comment | Element} anchor
|
|
2964
|
-
* @param {DocumentFragment | Element} dom
|
|
3004
|
+
* @param {unknown} error
|
|
2965
3005
|
*/
|
|
2966
|
-
function
|
|
3006
|
+
function _handle_error(error) {
|
|
3007
|
+
if (_classPrivateFieldGet2(_main_effect, this)) {
|
|
3008
|
+
destroy_effect(_classPrivateFieldGet2(_main_effect, this));
|
|
3009
|
+
_classPrivateFieldSet2(_main_effect, this, null);
|
|
3010
|
+
}
|
|
3011
|
+
if (_classPrivateFieldGet2(_pending_effect, this)) {
|
|
3012
|
+
destroy_effect(_classPrivateFieldGet2(_pending_effect, this));
|
|
3013
|
+
_classPrivateFieldSet2(_pending_effect, this, null);
|
|
3014
|
+
}
|
|
3015
|
+
if (_classPrivateFieldGet2(_failed_effect, this)) {
|
|
3016
|
+
destroy_effect(_classPrivateFieldGet2(_failed_effect, this));
|
|
3017
|
+
_classPrivateFieldSet2(_failed_effect, this, null);
|
|
3018
|
+
}
|
|
2967
3019
|
if (hydrating) {
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
return;
|
|
3020
|
+
set_hydrate_node(_classPrivateFieldGet2(_hydrate_open, this));
|
|
3021
|
+
next();
|
|
3022
|
+
set_hydrate_node(skip_nodes());
|
|
2972
3023
|
}
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
3024
|
+
let failed = _classPrivateFieldGet2(_props, this).failed;
|
|
3025
|
+
/** @param {unknown} transformed_error */
|
|
3026
|
+
const handle_error_result = (transformed_error) => {
|
|
3027
|
+
const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, transformed_error);
|
|
3028
|
+
invoke_onerror();
|
|
3029
|
+
if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
|
|
3030
|
+
try {
|
|
3031
|
+
return branch(() => {
|
|
3032
|
+
var effect = active_effect;
|
|
3033
|
+
effect.b = this;
|
|
3034
|
+
effect.f |= 128;
|
|
3035
|
+
failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
|
|
3036
|
+
});
|
|
3037
|
+
} catch (error) {
|
|
3038
|
+
invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
|
|
3039
|
+
return null;
|
|
3040
|
+
}
|
|
3041
|
+
}));
|
|
3042
|
+
};
|
|
3043
|
+
queue_micro_task(() => {
|
|
3044
|
+
/** @type {unknown} */
|
|
3045
|
+
var result;
|
|
3046
|
+
try {
|
|
3047
|
+
result = this.transform_error(error);
|
|
3048
|
+
} catch (e) {
|
|
3049
|
+
invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
|
|
3050
|
+
return;
|
|
3051
|
+
}
|
|
3052
|
+
if (result !== null && typeof result === "object" && typeof result.then === "function")
|
|
3053
|
+
/** @type {any} */ result.then(
|
|
3054
|
+
handle_error_result,
|
|
3055
|
+
/** @param {unknown} e */
|
|
3056
|
+
(e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
|
|
3057
|
+
);
|
|
3058
|
+
else handle_error_result(result);
|
|
3059
|
+
});
|
|
2992
3060
|
}
|
|
2993
3061
|
/**
|
|
2994
3062
|
* Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.
|
|
@@ -3080,7 +3148,7 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
|
|
|
3080
3148
|
if (events)
|
|
3081
3149
|
/** @type {any} */ props.$$events = events;
|
|
3082
3150
|
if (hydrating) assign_nodes(anchor_node, null);
|
|
3083
|
-
component = Component(anchor_node, props) ||
|
|
3151
|
+
component = Component(anchor_node, props) || mark_as_component();
|
|
3084
3152
|
if (hydrating) {
|
|
3085
3153
|
/** @type {Effect & { nodes: EffectNodes }} */ active_effect.nodes.end = hydrate_node;
|
|
3086
3154
|
if (hydrate_node === null || hydrate_node.nodeType !== 8 || hydrate_node.data !== "]") {
|
|
@@ -3166,13 +3234,14 @@ function unmount(component, options) {
|
|
|
3166
3234
|
return Promise.resolve();
|
|
3167
3235
|
}
|
|
3168
3236
|
//#endregion
|
|
3169
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
3237
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/css.js
|
|
3170
3238
|
/**
|
|
3171
3239
|
* @param {Node} anchor
|
|
3172
3240
|
* @param {{ hash: string, code: string }} css
|
|
3173
3241
|
*/
|
|
3174
3242
|
function append_styles(anchor, css) {
|
|
3175
3243
|
effect(() => {
|
|
3244
|
+
anchor = active_effect?.parent?.nodes?.start ?? anchor;
|
|
3176
3245
|
var root = anchor.getRootNode();
|
|
3177
3246
|
var target = root.host ? root : /** @type {Document} */ root.head ?? root.ownerDocument.head;
|
|
3178
3247
|
if (!target.querySelector("#" + css.hash)) {
|
|
@@ -3184,7 +3253,7 @@ function append_styles(anchor, css) {
|
|
|
3184
3253
|
});
|
|
3185
3254
|
}
|
|
3186
3255
|
//#endregion
|
|
3187
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
3256
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js
|
|
3188
3257
|
var _ResizeObserverSingleton;
|
|
3189
3258
|
var _listeners = /* @__PURE__ */ new WeakMap();
|
|
3190
3259
|
var _observer = /* @__PURE__ */ new WeakMap();
|
|
@@ -3236,7 +3305,7 @@ function _getObserver() {
|
|
|
3236
3305
|
}
|
|
3237
3306
|
_defineProperty(ResizeObserverSingleton, "entries", /* @__PURE__ */ new WeakMap());
|
|
3238
3307
|
//#endregion
|
|
3239
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
3308
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/reactivity/props.js
|
|
3240
3309
|
/** @import { Derived, Effect, Source } from './types.js' */
|
|
3241
3310
|
/**
|
|
3242
3311
|
* This function is responsible for synchronizing a possibly bound prop with the inner component state.
|
|
@@ -3329,7 +3398,7 @@ function prop(props, key, flags, fallback) {
|
|
|
3329
3398
|
});
|
|
3330
3399
|
}
|
|
3331
3400
|
//#endregion
|
|
3332
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
3401
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/legacy/legacy-client.js
|
|
3333
3402
|
/** @import { ComponentConstructorOptions, ComponentType, SvelteComponent, Component } from 'svelte' */
|
|
3334
3403
|
/**
|
|
3335
3404
|
* Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.
|
|
@@ -3448,7 +3517,7 @@ var Svelte4Component = class {
|
|
|
3448
3517
|
}
|
|
3449
3518
|
};
|
|
3450
3519
|
//#endregion
|
|
3451
|
-
//#region ../../../node_modules/.bun/svelte@5.
|
|
3520
|
+
//#region ../../../node_modules/.bun/svelte@5.57.0/node_modules/svelte/src/internal/client/dom/elements/custom-element.js
|
|
3452
3521
|
/**
|
|
3453
3522
|
* @typedef {Object} CustomElementPropDefinition
|
|
3454
3523
|
* @property {string} [attribute]
|
|
@@ -3742,7 +3811,7 @@ var $$css = {
|
|
|
3742
3811
|
function Author($$anchor, $$props) {
|
|
3743
3812
|
push($$props, true);
|
|
3744
3813
|
append_styles($$anchor, $$css);
|
|
3745
|
-
let model = prop($$props, "model", 15)
|
|
3814
|
+
let model = prop($$props, "model", 15);
|
|
3746
3815
|
var $$exports = {
|
|
3747
3816
|
get model() {
|
|
3748
3817
|
return model();
|
|
@@ -3750,22 +3819,12 @@ function Author($$anchor, $$props) {
|
|
|
3750
3819
|
set model($$value) {
|
|
3751
3820
|
model($$value);
|
|
3752
3821
|
flushSync();
|
|
3753
|
-
},
|
|
3754
|
-
get onChange() {
|
|
3755
|
-
return onChange();
|
|
3756
|
-
},
|
|
3757
|
-
set onChange($$value) {
|
|
3758
|
-
onChange($$value);
|
|
3759
|
-
flushSync();
|
|
3760
3822
|
}
|
|
3761
3823
|
};
|
|
3762
3824
|
append($$anchor, root());
|
|
3763
3825
|
return pop($$exports);
|
|
3764
3826
|
}
|
|
3765
|
-
create_custom_element(Author, {
|
|
3766
|
-
model: { type: "Object" },
|
|
3767
|
-
onChange: {}
|
|
3768
|
-
}, [], []);
|
|
3827
|
+
create_custom_element(Author, { model: { type: "Object" } }, [], []);
|
|
3769
3828
|
//#endregion
|
|
3770
3829
|
//#region src/author/index.ts
|
|
3771
3830
|
var SvelteElementClass = Author.element;
|
|
@@ -3784,7 +3843,6 @@ var McPopulatedBlankAuthor = class extends SvelteElementClass {
|
|
|
3784
3843
|
}
|
|
3785
3844
|
set onChange(fn) {
|
|
3786
3845
|
this._onChange = fn;
|
|
3787
|
-
this.onChange = fn;
|
|
3788
3846
|
}
|
|
3789
3847
|
get onChange() {
|
|
3790
3848
|
return this._onChange || (() => {});
|