@pie-element/simple-cloze 0.1.3 → 0.1.4-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/index.d.ts +0 -1
  4. package/dist/author/index.js +14813 -20641
  5. package/dist/author/index.js.map +1 -1
  6. package/dist/browser/author/index.js +15910 -0
  7. package/dist/browser/author/index.js.map +1 -0
  8. package/dist/browser/client-Cas_f5u-.js +2315 -0
  9. package/dist/browser/client-Cas_f5u-.js.map +1 -0
  10. package/dist/browser/controller/index.js +52 -0
  11. package/dist/browser/controller/index.js.map +1 -0
  12. package/dist/browser/delivery/index.js +179 -0
  13. package/dist/browser/delivery/index.js.map +1 -0
  14. package/dist/browser/print/index.js +43 -0
  15. package/dist/browser/print/index.js.map +1 -0
  16. package/dist/controller/defaults.d.ts +0 -1
  17. package/dist/controller/index.d.ts +0 -1
  18. package/dist/controller/index.js +4 -4
  19. package/dist/controller/index.js.map +1 -1
  20. package/dist/delivery/index.d.ts +6 -1
  21. package/dist/delivery/index.js +577 -357
  22. package/dist/delivery/index.js.map +1 -1
  23. package/dist/index.d.ts +0 -1
  24. package/dist/index.iife.d.ts +0 -1
  25. package/dist/index.iife.js +3 -3
  26. package/dist/index.js +577 -357
  27. package/dist/index.js.map +1 -1
  28. package/dist/print/index.d.ts +0 -1
  29. package/dist/print/index.js +471 -314
  30. package/dist/print/index.js.map +1 -1
  31. package/dist/runtime-support.d.ts +12 -0
  32. package/dist/runtime-support.js +14 -0
  33. package/dist/runtime-support.js.map +1 -0
  34. package/package.json +33 -18
  35. package/dist/author/index.d.ts.map +0 -1
  36. package/dist/controller/defaults.d.ts.map +0 -1
  37. package/dist/controller/index.d.ts.map +0 -1
  38. package/dist/delivery/index.d.ts.map +0 -1
  39. package/dist/index.d.ts.map +0 -1
  40. package/dist/index.iife.d.ts.map +0 -1
  41. package/dist/print/index.d.ts.map +0 -1
  42. package/src/author/Author.svelte +0 -102
  43. package/src/author/index.ts +0 -28
  44. package/src/controller/defaults.ts +0 -13
  45. package/src/controller/index.ts +0 -98
  46. package/src/delivery/SimpleCloze.svelte +0 -171
  47. package/src/delivery/index.ts +0 -37
  48. package/src/index.iife.ts +0 -7
  49. package/src/index.ts +0 -1
  50. package/src/print/Print.svelte +0 -49
  51. package/src/print/index.ts +0 -18
@@ -1,16 +1,16 @@
1
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/disclose-version.js
1
+ //#region ../../../node_modules/.bun/svelte@5.56.1/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.55.1/node_modules/svelte/src/constants.js
7
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/constants.js
8
8
  var HYDRATION_ERROR = {};
9
- var UNINITIALIZED = Symbol();
9
+ var UNINITIALIZED = Symbol("uninitialized");
10
10
  var NAMESPACE_SVG = "http://www.w3.org/2000/svg";
11
11
  var NAMESPACE_MATHML = "http://www.w3.org/1998/Math/MathML";
12
12
  //#endregion
13
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/shared/utils.js
13
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/shared/utils.js
14
14
  var is_array = Array.isArray;
15
15
  var index_of = Array.prototype.indexOf;
16
16
  var includes = Array.prototype.includes;
@@ -46,7 +46,7 @@ function deferred() {
46
46
  };
47
47
  }
48
48
  //#endregion
49
- //#region \0@oxc-project+runtime@0.120.0/helpers/typeof.js
49
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/typeof.js
50
50
  function _typeof(o) {
51
51
  "@babel/helpers - typeof";
52
52
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -56,7 +56,7 @@ function _typeof(o) {
56
56
  }, _typeof(o);
57
57
  }
58
58
  //#endregion
59
- //#region \0@oxc-project+runtime@0.120.0/helpers/toPrimitive.js
59
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPrimitive.js
60
60
  function toPrimitive(t, r) {
61
61
  if ("object" != _typeof(t) || !t) return t;
62
62
  var e = t[Symbol.toPrimitive];
@@ -68,13 +68,13 @@ function toPrimitive(t, r) {
68
68
  return ("string" === r ? String : Number)(t);
69
69
  }
70
70
  //#endregion
71
- //#region \0@oxc-project+runtime@0.120.0/helpers/toPropertyKey.js
71
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/toPropertyKey.js
72
72
  function toPropertyKey(t) {
73
73
  var i = toPrimitive(t, "string");
74
74
  return "symbol" == _typeof(i) ? i : i + "";
75
75
  }
76
76
  //#endregion
77
- //#region \0@oxc-project+runtime@0.120.0/helpers/defineProperty.js
77
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/defineProperty.js
78
78
  function _defineProperty(e, r, t) {
79
79
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
80
80
  value: t,
@@ -102,7 +102,8 @@ var USER_EFFECT = 1 << 20;
102
102
  /**
103
103
  * Tells that we marked this derived and its reactions as visited during the "mark as (maybe) dirty"-phase.
104
104
  * Will be lifted during execution of the derived and during checking its dirty state (both are necessary
105
- * because a derived might be checked but not executed).
105
+ * because a derived might be checked but not executed). This is a pure performance optimization flag and
106
+ * should not be used for any other purpose!
106
107
  */
107
108
  var WAS_MARKED = 65536;
108
109
  var REACTION_IS_UPDATING = 1 << 21;
@@ -110,6 +111,10 @@ var ASYNC = 1 << 22;
110
111
  var ERROR_VALUE = 1 << 23;
111
112
  var STATE_SYMBOL = Symbol("$state");
112
113
  var LEGACY_PROPS = Symbol("legacy props");
114
+ var ATTRIBUTES_CACHE = Symbol("attributes");
115
+ var CLASS_CACHE = Symbol("class");
116
+ var STYLE_CACHE = Symbol("style");
117
+ var TEXT_CACHE = Symbol("text");
113
118
  /** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */
114
119
  var STALE_REACTION = new class StaleReactionError extends Error {
115
120
  constructor(..._args) {
@@ -120,7 +125,7 @@ var STALE_REACTION = new class StaleReactionError extends Error {
120
125
  }();
121
126
  globalThis.document?.contentType;
122
127
  //#endregion
123
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/errors.js
128
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/errors.js
124
129
  /**
125
130
  * Cannot create a `$derived(...)` with an `await` expression outside of an effect tree
126
131
  * @returns {never}
@@ -202,6 +207,12 @@ function svelte_boundary_reset_onerror() {
202
207
  throw new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);
203
208
  }
204
209
  /**
210
+ * Reading a derived belonging to a now-destroyed effect may result in stale values
211
+ */
212
+ function derived_inert() {
213
+ console.warn(`https://svelte.dev/e/derived_inert`);
214
+ }
215
+ /**
205
216
  * Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near %location%
206
217
  * @param {string | undefined | null} [location]
207
218
  */
@@ -215,7 +226,7 @@ function svelte_boundary_reset_noop() {
215
226
  console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
216
227
  }
217
228
  //#endregion
218
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/dom/hydration.js
229
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/hydration.js
219
230
  /** @import { TemplateNode } from '#client' */
220
231
  /**
221
232
  * Use this variable to guard everything related to hydration code so it can be treeshaken out
@@ -294,7 +305,7 @@ function read_hydration_instruction(node) {
294
305
  return node.data;
295
306
  }
296
307
  //#endregion
297
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/reactivity/equality.js
308
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/reactivity/equality.js
298
309
  /** @import { Equals } from '#client' */
299
310
  /** @type {Equals} */
300
311
  function equals(value) {
@@ -313,13 +324,13 @@ function safe_equals(value) {
313
324
  return !safe_not_equal(value, this.v);
314
325
  }
315
326
  //#endregion
316
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/flags/index.js
327
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/flags/index.js
317
328
  /** True if experimental.async=true */
318
329
  var async_mode_flag = false;
319
330
  /** True if we're not certain that we only have Svelte 5 code in the compilation */
320
331
  var legacy_mode_flag = false;
321
332
  //#endregion
322
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/context.js
333
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/context.js
323
334
  /** @import { ComponentContext, DevStackEntry, Effect } from '#client' */
324
335
  /** @type {ComponentContext | null} */
325
336
  var component_context = null;
@@ -371,7 +382,7 @@ function is_runes() {
371
382
  return !legacy_mode_flag || component_context !== null && component_context.l === null;
372
383
  }
373
384
  //#endregion
374
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/dom/task.js
385
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/task.js
375
386
  /** @type {Array<() => void>} */
376
387
  var micro_tasks = [];
377
388
  function run_micro_tasks() {
@@ -429,7 +440,7 @@ function invoke_error_boundary(error, effect) {
429
440
  throw error;
430
441
  }
431
442
  //#endregion
432
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/reactivity/status.js
443
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/reactivity/status.js
433
444
  /** @import { Derived, Signal } from '#client' */
434
445
  var STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
435
446
  /**
@@ -448,7 +459,7 @@ function update_derived_status(derived) {
448
459
  else set_signal_status(derived, MAYBE_DIRTY);
449
460
  }
450
461
  //#endregion
451
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/reactivity/utils.js
462
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/reactivity/utils.js
452
463
  /** @import { Derived, Effect, Value } from '#client' */
453
464
  /**
454
465
  * @param {Value[] | null} deps
@@ -476,7 +487,7 @@ function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
476
487
  set_signal_status(effect, CLEAN);
477
488
  }
478
489
  //#endregion
479
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/reactivity/store.js
490
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/reactivity/store.js
480
491
  /**
481
492
  * We set this to `true` when updating a store so that we correctly
482
493
  * schedule effects if the update takes place inside a `$:` effect
@@ -506,46 +517,53 @@ function capture_store_binding(fn) {
506
517
  }
507
518
  }
508
519
  //#endregion
509
- //#region \0@oxc-project+runtime@0.120.0/helpers/checkPrivateRedeclaration.js
520
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/checkPrivateRedeclaration.js
510
521
  function _checkPrivateRedeclaration(e, t) {
511
522
  if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
512
523
  }
513
524
  //#endregion
514
- //#region \0@oxc-project+runtime@0.120.0/helpers/classPrivateMethodInitSpec.js
525
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/classPrivateMethodInitSpec.js
515
526
  function _classPrivateMethodInitSpec(e, a) {
516
527
  _checkPrivateRedeclaration(e, a), a.add(e);
517
528
  }
518
529
  //#endregion
519
- //#region \0@oxc-project+runtime@0.120.0/helpers/classPrivateFieldInitSpec.js
530
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/classPrivateFieldInitSpec.js
520
531
  function _classPrivateFieldInitSpec(e, t, a) {
521
532
  _checkPrivateRedeclaration(e, t), t.set(e, a);
522
533
  }
523
534
  //#endregion
524
- //#region \0@oxc-project+runtime@0.120.0/helpers/assertClassBrand.js
535
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/assertClassBrand.js
525
536
  function _assertClassBrand(e, t, n) {
526
537
  if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
527
538
  throw new TypeError("Private element is not present on this object");
528
539
  }
529
540
  //#endregion
530
- //#region \0@oxc-project+runtime@0.120.0/helpers/classPrivateFieldGet2.js
531
- function _classPrivateFieldGet2(s, a) {
532
- return s.get(_assertClassBrand(s, a));
533
- }
534
- //#endregion
535
- //#region \0@oxc-project+runtime@0.120.0/helpers/classPrivateFieldSet2.js
541
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/classPrivateFieldSet2.js
536
542
  function _classPrivateFieldSet2(s, a, r) {
537
543
  return s.set(_assertClassBrand(s, a), r), r;
538
544
  }
539
545
  //#endregion
540
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/reactivity/batch.js
546
+ //#region \0@oxc-project+runtime@0.133.0/helpers/esm/classPrivateFieldGet2.js
547
+ function _classPrivateFieldGet2(s, a) {
548
+ return s.get(_assertClassBrand(s, a));
549
+ }
550
+ //#endregion
551
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/reactivity/batch.js
541
552
  /** @import { Fork } from 'svelte' */
542
553
  /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
543
554
  var _Batch;
544
- /** @type {Set<Batch>} */
545
- var batches = /* @__PURE__ */ new Set();
555
+ /** @type {Batch | null} */
556
+ var first_batch = null;
557
+ /** @type {Batch | null} */
558
+ var last_batch = null;
546
559
  /** @type {Batch | null} */
547
560
  var current_batch = null;
548
561
  /**
562
+ * This is needed to avoid overwriting inputs
563
+ * @type {Batch | null}
564
+ */
565
+ var previous_batch = null;
566
+ /**
549
567
  * When time travelling (i.e. working in one batch, while other batches
550
568
  * still have ongoing work), we ignore the real values of affected
551
569
  * signals in favour of their values within the batch
@@ -573,6 +591,9 @@ var collected_effects = null;
573
591
  var legacy_updates = null;
574
592
  var flush_count = 0;
575
593
  var uid = 1;
594
+ var _started = /* @__PURE__ */ new WeakMap();
595
+ var _prev = /* @__PURE__ */ new WeakMap();
596
+ var _next = /* @__PURE__ */ new WeakMap();
576
597
  var _commit_callbacks = /* @__PURE__ */ new WeakMap();
577
598
  var _discard_callbacks = /* @__PURE__ */ new WeakMap();
578
599
  var _pending = /* @__PURE__ */ new WeakMap();
@@ -583,13 +604,23 @@ var _new_effects = /* @__PURE__ */ new WeakMap();
583
604
  var _dirty_effects$1 = /* @__PURE__ */ new WeakMap();
584
605
  var _maybe_dirty_effects$1 = /* @__PURE__ */ new WeakMap();
585
606
  var _skipped_branches = /* @__PURE__ */ new WeakMap();
607
+ var _unskipped_branches = /* @__PURE__ */ new WeakMap();
586
608
  var _decrement_queued = /* @__PURE__ */ new WeakMap();
587
- var _blockers = /* @__PURE__ */ new WeakMap();
588
609
  var _Batch_brand = /* @__PURE__ */ new WeakSet();
589
610
  var Batch = class Batch {
590
611
  constructor() {
591
612
  _classPrivateMethodInitSpec(this, _Batch_brand);
592
613
  _defineProperty(this, "id", uid++);
614
+ _classPrivateFieldInitSpec(this, _started, false);
615
+ _defineProperty(this, "linked", true);
616
+ _classPrivateFieldInitSpec(this, _prev, null);
617
+ _classPrivateFieldInitSpec(this, _next, null);
618
+ _defineProperty(
619
+ this,
620
+ /** @type {Map<Effect, ReturnType<typeof deferred<any>>>} */
621
+ "async_deriveds",
622
+ /* @__PURE__ */ new Map()
623
+ );
593
624
  _defineProperty(
594
625
  this,
595
626
  /**
@@ -613,7 +644,7 @@ var Batch = class Batch {
613
644
  );
614
645
  _classPrivateFieldInitSpec(this, _commit_callbacks, /* @__PURE__ */ new Set());
615
646
  _classPrivateFieldInitSpec(this, _discard_callbacks, /* @__PURE__ */ new Set());
616
- _classPrivateFieldInitSpec(this, _pending, /* @__PURE__ */ new Map());
647
+ _classPrivateFieldInitSpec(this, _pending, 0);
617
648
  _classPrivateFieldInitSpec(this, _blocking_pending, /* @__PURE__ */ new Map());
618
649
  _classPrivateFieldInitSpec(this, _deferred, null);
619
650
  _classPrivateFieldInitSpec(this, _roots, []);
@@ -621,9 +652,15 @@ var Batch = class Batch {
621
652
  _classPrivateFieldInitSpec(this, _dirty_effects$1, /* @__PURE__ */ new Set());
622
653
  _classPrivateFieldInitSpec(this, _maybe_dirty_effects$1, /* @__PURE__ */ new Set());
623
654
  _classPrivateFieldInitSpec(this, _skipped_branches, /* @__PURE__ */ new Map());
655
+ _classPrivateFieldInitSpec(this, _unskipped_branches, /* @__PURE__ */ new Set());
624
656
  _defineProperty(this, "is_fork", false);
625
657
  _classPrivateFieldInitSpec(this, _decrement_queued, false);
626
- _classPrivateFieldInitSpec(this, _blockers, /* @__PURE__ */ new Set());
658
+ if (last_batch === null) first_batch = last_batch = this;
659
+ else {
660
+ _classPrivateFieldSet2(_next, last_batch, this);
661
+ _classPrivateFieldSet2(_prev, this, last_batch);
662
+ }
663
+ last_batch = this;
627
664
  }
628
665
  /**
629
666
  * Add an effect to the #skipped_branches map and reset its children
@@ -634,39 +671,43 @@ var Batch = class Batch {
634
671
  d: [],
635
672
  m: []
636
673
  });
674
+ _classPrivateFieldGet2(_unskipped_branches, this).delete(effect);
637
675
  }
638
676
  /**
639
677
  * Remove an effect from the #skipped_branches map and reschedule
640
678
  * any tracked dirty/maybe_dirty child effects
641
679
  * @param {Effect} effect
680
+ * @param {(e: Effect) => void} callback
642
681
  */
643
- unskip_effect(effect) {
682
+ unskip_effect(effect, callback = (e) => this.schedule(e)) {
644
683
  var tracked = _classPrivateFieldGet2(_skipped_branches, this).get(effect);
645
684
  if (tracked) {
646
685
  _classPrivateFieldGet2(_skipped_branches, this).delete(effect);
647
686
  for (var e of tracked.d) {
648
687
  set_signal_status(e, DIRTY);
649
- this.schedule(e);
688
+ callback(e);
650
689
  }
651
690
  for (e of tracked.m) {
652
691
  set_signal_status(e, MAYBE_DIRTY);
653
- this.schedule(e);
692
+ callback(e);
654
693
  }
655
694
  }
695
+ _classPrivateFieldGet2(_unskipped_branches, this).add(effect);
656
696
  }
657
697
  /**
658
698
  * Associate a change to a given source with the current
659
699
  * batch, noting its previous and current values
660
700
  * @param {Value} source
661
- * @param {any} old_value
701
+ * @param {any} value
662
702
  * @param {boolean} [is_derived]
663
703
  */
664
- capture(source, old_value, is_derived = false) {
665
- if (old_value !== UNINITIALIZED && !this.previous.has(source)) this.previous.set(source, old_value);
704
+ capture(source, value, is_derived = false) {
705
+ if (source.v !== UNINITIALIZED && !this.previous.has(source)) this.previous.set(source, source.v);
666
706
  if ((source.f & 8388608) === 0) {
667
- this.current.set(source, [source.v, is_derived]);
668
- batch_values?.set(source, source.v);
707
+ this.current.set(source, [value, is_derived]);
708
+ batch_values?.set(source, value);
669
709
  }
710
+ if (!this.is_fork) source.v = value;
670
711
  }
671
712
  activate() {
672
713
  current_batch = this;
@@ -694,7 +735,8 @@ var Batch = class Batch {
694
735
  discard() {
695
736
  for (const fn of _classPrivateFieldGet2(_discard_callbacks, this)) fn(this);
696
737
  _classPrivateFieldGet2(_discard_callbacks, this).clear();
697
- batches.delete(this);
738
+ _assertClassBrand(_Batch_brand, this, _unlink).call(this);
739
+ _classPrivateFieldGet2(_deferred, this)?.resolve();
698
740
  }
699
741
  /**
700
742
  * @param {Effect} effect
@@ -707,8 +749,7 @@ var Batch = class Batch {
707
749
  * @param {Effect} effect
708
750
  */
709
751
  increment(blocking, effect) {
710
- let pending_count = _classPrivateFieldGet2(_pending, this).get(effect) ?? 0;
711
- _classPrivateFieldGet2(_pending, this).set(effect, pending_count + 1);
752
+ _classPrivateFieldSet2(_pending, this, _classPrivateFieldGet2(_pending, this) + 1);
712
753
  if (blocking) {
713
754
  let blocking_pending_count = _classPrivateFieldGet2(_blocking_pending, this).get(effect) ?? 0;
714
755
  _classPrivateFieldGet2(_blocking_pending, this).set(effect, blocking_pending_count + 1);
@@ -717,22 +758,19 @@ var Batch = class Batch {
717
758
  /**
718
759
  * @param {boolean} blocking
719
760
  * @param {Effect} effect
720
- * @param {boolean} skip - whether to skip updates (because this is triggered by a stale reaction)
721
761
  */
722
- decrement(blocking, effect, skip) {
723
- let pending_count = _classPrivateFieldGet2(_pending, this).get(effect) ?? 0;
724
- if (pending_count === 1) _classPrivateFieldGet2(_pending, this).delete(effect);
725
- else _classPrivateFieldGet2(_pending, this).set(effect, pending_count - 1);
762
+ decrement(blocking, effect) {
763
+ _classPrivateFieldSet2(_pending, this, _classPrivateFieldGet2(_pending, this) - 1);
726
764
  if (blocking) {
727
765
  let blocking_pending_count = _classPrivateFieldGet2(_blocking_pending, this).get(effect) ?? 0;
728
766
  if (blocking_pending_count === 1) _classPrivateFieldGet2(_blocking_pending, this).delete(effect);
729
767
  else _classPrivateFieldGet2(_blocking_pending, this).set(effect, blocking_pending_count - 1);
730
768
  }
731
- if (_classPrivateFieldGet2(_decrement_queued, this) || skip) return;
769
+ if (_classPrivateFieldGet2(_decrement_queued, this)) return;
732
770
  _classPrivateFieldSet2(_decrement_queued, this, true);
733
771
  queue_micro_task(() => {
734
772
  _classPrivateFieldSet2(_decrement_queued, this, false);
735
- this.flush();
773
+ if (this.linked) this.flush();
736
774
  });
737
775
  }
738
776
  /**
@@ -759,34 +797,32 @@ var Batch = class Batch {
759
797
  static ensure() {
760
798
  if (current_batch === null) {
761
799
  const batch = current_batch = new Batch();
762
- if (!is_processing) {
763
- batches.add(current_batch);
764
- if (!is_flushing_sync) queue_micro_task(() => {
765
- if (current_batch !== batch) return;
766
- batch.flush();
767
- });
768
- }
800
+ if (!is_processing && !is_flushing_sync) queue_micro_task(() => {
801
+ if (!_classPrivateFieldGet2(_started, batch)) batch.flush();
802
+ });
769
803
  }
770
804
  return current_batch;
771
805
  }
772
806
  apply() {
773
- if (!async_mode_flag || !this.is_fork && batches.size === 1) {
807
+ if (!async_mode_flag || !this.is_fork && _classPrivateFieldGet2(_prev, this) === null && _classPrivateFieldGet2(_next, this) === null) {
774
808
  batch_values = null;
775
809
  return;
776
810
  }
777
811
  batch_values = /* @__PURE__ */ new Map();
778
812
  for (const [source, [value]] of this.current) batch_values.set(source, value);
779
- for (const batch of batches) {
813
+ for (let batch = first_batch; batch !== null; batch = _classPrivateFieldGet2(_next, batch)) {
780
814
  if (batch === this || batch.is_fork) continue;
781
815
  var intersects = false;
782
- var differs = false;
783
816
  if (batch.id < this.id) for (const [source, [, is_derived]] of batch.current) {
784
817
  if (is_derived) continue;
785
- intersects || (intersects = this.current.has(source));
786
- differs || (differs = !this.current.has(source));
818
+ if (this.current.has(source)) {
819
+ intersects = true;
820
+ break;
821
+ }
822
+ }
823
+ if (!intersects) {
824
+ for (const [source, previous] of batch.previous) if (!batch_values.has(source)) batch_values.set(source, previous);
787
825
  }
788
- if (intersects && differs) _classPrivateFieldGet2(_blockers, this).add(batch);
789
- else for (const [source, previous] of batch.previous) if (!batch_values.has(source)) batch_values.set(source, previous);
790
826
  }
791
827
  }
792
828
  /**
@@ -817,12 +853,10 @@ var Batch = class Batch {
817
853
  };
818
854
  _Batch = Batch;
819
855
  function _is_deferred() {
820
- return this.is_fork || _classPrivateFieldGet2(_blocking_pending, this).size > 0;
821
- }
822
- function _is_blocked() {
823
- for (const batch of _classPrivateFieldGet2(_blockers, this)) for (const effect of _classPrivateFieldGet2(_blocking_pending, batch).keys()) {
824
- var skipped = false;
856
+ if (this.is_fork) return true;
857
+ for (const effect of _classPrivateFieldGet2(_blocking_pending, this).keys()) {
825
858
  var e = effect;
859
+ var skipped = false;
826
860
  while (e.parent !== null) {
827
861
  if (_classPrivateFieldGet2(_skipped_branches, this).has(e)) {
828
862
  skipped = true;
@@ -835,20 +869,19 @@ function _is_blocked() {
835
869
  return false;
836
870
  }
837
871
  function _process() {
872
+ _classPrivateFieldSet2(_started, this, true);
838
873
  if (flush_count++ > 1e3) {
839
- batches.delete(this);
874
+ _assertClassBrand(_Batch_brand, this, _unlink).call(this);
840
875
  infinite_loop_guard();
841
876
  }
842
- if (!_assertClassBrand(_Batch_brand, this, _is_deferred).call(this)) {
843
- for (const e of _classPrivateFieldGet2(_dirty_effects$1, this)) {
844
- _classPrivateFieldGet2(_maybe_dirty_effects$1, this).delete(e);
845
- set_signal_status(e, DIRTY);
846
- this.schedule(e);
847
- }
848
- for (const e of _classPrivateFieldGet2(_maybe_dirty_effects$1, this)) {
849
- set_signal_status(e, MAYBE_DIRTY);
850
- this.schedule(e);
851
- }
877
+ for (const e of _classPrivateFieldGet2(_dirty_effects$1, this)) {
878
+ _classPrivateFieldGet2(_maybe_dirty_effects$1, this).delete(e);
879
+ set_signal_status(e, DIRTY);
880
+ this.schedule(e);
881
+ }
882
+ for (const e of _classPrivateFieldGet2(_maybe_dirty_effects$1, this)) {
883
+ set_signal_status(e, MAYBE_DIRTY);
884
+ this.schedule(e);
852
885
  }
853
886
  const roots = _classPrivateFieldGet2(_roots, this);
854
887
  _classPrivateFieldSet2(_roots, this, []);
@@ -866,6 +899,7 @@ function _process() {
866
899
  _assertClassBrand(_Batch_brand, this, _traverse).call(this, root, effects, render_effects);
867
900
  } catch (e) {
868
901
  reset_all(root);
902
+ if (!_assertClassBrand(_Batch_brand, this, _is_deferred).call(this)) this.discard();
869
903
  throw e;
870
904
  }
871
905
  current_batch = null;
@@ -875,30 +909,43 @@ function _process() {
875
909
  }
876
910
  collected_effects = null;
877
911
  legacy_updates = null;
878
- if (_assertClassBrand(_Batch_brand, this, _is_deferred).call(this) || _assertClassBrand(_Batch_brand, this, _is_blocked).call(this)) {
912
+ if (_assertClassBrand(_Batch_brand, this, _is_deferred).call(this)) {
879
913
  _assertClassBrand(_Batch_brand, this, _defer_effects).call(this, render_effects);
880
914
  _assertClassBrand(_Batch_brand, this, _defer_effects).call(this, effects);
881
915
  for (const [e, t] of _classPrivateFieldGet2(_skipped_branches, this)) reset_branch(e, t);
882
- } else {
883
- if (_classPrivateFieldGet2(_pending, this).size === 0) batches.delete(this);
884
- _classPrivateFieldGet2(_dirty_effects$1, this).clear();
885
- _classPrivateFieldGet2(_maybe_dirty_effects$1, this).clear();
886
- for (const fn of _classPrivateFieldGet2(_commit_callbacks, this)) fn(this);
887
- _classPrivateFieldGet2(_commit_callbacks, this).clear();
888
- flush_queued_effects(render_effects);
889
- flush_queued_effects(effects);
890
- _classPrivateFieldGet2(_deferred, this)?.resolve();
916
+ if (updates.length > 0)
917
+ /** @type {Batch} */ _assertClassBrand(_Batch_brand, current_batch, _process).call(current_batch);
918
+ return;
891
919
  }
892
- var next_batch = current_batch;
893
- if (_classPrivateFieldGet2(_roots, this).length > 0) {
894
- const batch = next_batch ?? (next_batch = this);
895
- _classPrivateFieldGet2(_roots, batch).push(..._classPrivateFieldGet2(_roots, this).filter((r) => !_classPrivateFieldGet2(_roots, batch).includes(r)));
920
+ const earlier_batch = _assertClassBrand(_Batch_brand, this, _find_earlier_batch).call(this);
921
+ if (earlier_batch) {
922
+ _assertClassBrand(_Batch_brand, this, _defer_effects).call(this, render_effects);
923
+ _assertClassBrand(_Batch_brand, this, _defer_effects).call(this, effects);
924
+ _assertClassBrand(_Batch_brand, earlier_batch, _merge).call(earlier_batch, this);
925
+ return;
896
926
  }
897
- if (next_batch !== null) {
898
- batches.add(next_batch);
899
- _assertClassBrand(_Batch_brand, next_batch, _process).call(next_batch);
927
+ _classPrivateFieldGet2(_dirty_effects$1, this).clear();
928
+ _classPrivateFieldGet2(_maybe_dirty_effects$1, this).clear();
929
+ for (const fn of _classPrivateFieldGet2(_commit_callbacks, this)) fn(this);
930
+ _classPrivateFieldGet2(_commit_callbacks, this).clear();
931
+ previous_batch = this;
932
+ flush_queued_effects(render_effects);
933
+ flush_queued_effects(effects);
934
+ previous_batch = null;
935
+ _classPrivateFieldGet2(_deferred, this)?.resolve();
936
+ var next_batch = current_batch;
937
+ if (_classPrivateFieldGet2(_pending, this) === 0 && (_classPrivateFieldGet2(_roots, this).length === 0 || next_batch !== null)) {
938
+ _assertClassBrand(_Batch_brand, this, _unlink).call(this);
939
+ if (async_mode_flag) {
940
+ _assertClassBrand(_Batch_brand, this, _commit$1).call(this);
941
+ current_batch = next_batch;
942
+ }
900
943
  }
901
- if (!batches.has(this)) _assertClassBrand(_Batch_brand, this, _commit$1).call(this);
944
+ if (_classPrivateFieldGet2(_roots, this).length > 0) if (next_batch !== null) {
945
+ const batch = next_batch;
946
+ _classPrivateFieldGet2(_roots, batch).push(..._classPrivateFieldGet2(_roots, this).filter((r) => !_classPrivateFieldGet2(_roots, batch).includes(r)));
947
+ } else next_batch = this;
948
+ if (next_batch !== null) _assertClassBrand(_Batch_brand, next_batch, _process).call(next_batch);
902
949
  }
903
950
  /**
904
951
  * Traverse the effect tree, executing effects or stashing
@@ -937,6 +984,59 @@ function _traverse(root, effects, render_effects) {
937
984
  }
938
985
  }
939
986
  }
987
+ function _find_earlier_batch() {
988
+ var batch = _classPrivateFieldGet2(_prev, this);
989
+ while (batch !== null) {
990
+ if (!batch.is_fork) {
991
+ for (const [value, [, is_derived]] of this.current) if (batch.current.has(value) && !is_derived) return batch;
992
+ }
993
+ batch = _classPrivateFieldGet2(_prev, batch);
994
+ }
995
+ return null;
996
+ }
997
+ /**
998
+ * @param {Batch} batch
999
+ */
1000
+ function _merge(batch) {
1001
+ for (const [source, value] of batch.current) {
1002
+ if (!this.previous.has(source) && batch.previous.has(source)) this.previous.set(source, batch.previous.get(source));
1003
+ this.current.set(source, value);
1004
+ }
1005
+ for (const [effect, deferred] of batch.async_deriveds) {
1006
+ const d = this.async_deriveds.get(effect);
1007
+ if (d) deferred.promise.then(d.resolve).catch(d.reject);
1008
+ }
1009
+ this.transfer_effects(_classPrivateFieldGet2(_dirty_effects$1, batch), _classPrivateFieldGet2(_maybe_dirty_effects$1, batch));
1010
+ /**
1011
+ * mark all effects that depend on `batch.current`, except the
1012
+ * async effects that we just resolved (TODO unless they depend
1013
+ * on values in this batch that are NOT in the later batch?).
1014
+ * Through this we also will populate the correct #skipped_branches,
1015
+ * oncommit callbacks etc, so we don't need to merge them separately.
1016
+ * @param {Value} value
1017
+ */
1018
+ const mark = (value) => {
1019
+ var reactions = value.reactions;
1020
+ if (reactions === null) return;
1021
+ for (const reaction of reactions) {
1022
+ var flags = reaction.f;
1023
+ if ((flags & 2) !== 0) mark(reaction);
1024
+ else {
1025
+ var effect = reaction;
1026
+ if (flags & 4194320 && !this.async_deriveds.has(effect)) {
1027
+ _classPrivateFieldGet2(_maybe_dirty_effects$1, this).delete(effect);
1028
+ set_signal_status(effect, DIRTY);
1029
+ this.schedule(effect);
1030
+ }
1031
+ }
1032
+ }
1033
+ };
1034
+ for (const source of this.current.keys()) mark(source);
1035
+ this.oncommit(() => batch.discard());
1036
+ _assertClassBrand(_Batch_brand, batch, _unlink).call(batch);
1037
+ current_batch = this;
1038
+ _assertClassBrand(_Batch_brand, this, _process).call(this);
1039
+ }
940
1040
  /**
941
1041
  * @param {Effect[]} effects
942
1042
  */
@@ -944,7 +1044,7 @@ function _defer_effects(effects) {
944
1044
  for (var i = 0; i < effects.length; i += 1) defer_effect(effects[i], _classPrivateFieldGet2(_dirty_effects$1, this), _classPrivateFieldGet2(_maybe_dirty_effects$1, this));
945
1045
  }
946
1046
  function _commit$1() {
947
- for (const batch of batches) {
1047
+ for (let batch = first_batch; batch !== null; batch = _classPrivateFieldGet2(_next, batch)) {
948
1048
  var is_earlier = batch.id < this.id;
949
1049
  /** @type {Source[]} */
950
1050
  var sources = [];
@@ -956,10 +1056,19 @@ function _commit$1() {
956
1056
  }
957
1057
  sources.push(source);
958
1058
  }
959
- var others = [...batch.current.keys()].filter((s) => !this.current.has(s));
1059
+ if (is_earlier) for (const [effect, deferred] of this.async_deriveds) {
1060
+ const d = batch.async_deriveds.get(effect);
1061
+ if (d) deferred.promise.then(d.resolve).catch(d.reject);
1062
+ }
1063
+ if (!_classPrivateFieldGet2(_started, batch)) continue;
1064
+ var others = [...batch.current.keys()].filter((s) => !batch.current.get(s)[1] && !this.current.has(s));
960
1065
  if (others.length === 0) {
961
1066
  if (is_earlier) batch.discard();
962
1067
  } else if (sources.length > 0) {
1068
+ if (is_earlier) for (const unskipped of _classPrivateFieldGet2(_unskipped_branches, this)) batch.unskip_effect(unskipped, (e) => {
1069
+ if ((e.f & 4194320) !== 0) batch.schedule(e);
1070
+ else _assertClassBrand(_Batch_brand, batch, _defer_effects).call(batch, [e]);
1071
+ });
963
1072
  batch.activate();
964
1073
  /** @type {Set<Value>} */
965
1074
  var marked = /* @__PURE__ */ new Set();
@@ -967,12 +1076,18 @@ function _commit$1() {
967
1076
  var checked = /* @__PURE__ */ new Map();
968
1077
  for (var source of sources) mark_effects(source, others, marked, checked);
969
1078
  checked = /* @__PURE__ */ new Map();
970
- var current_unequal = [...batch.current.keys()].filter((c) => this.current.has(c) ? this.current.get(c)[0] !== c : true);
971
- for (const effect of _classPrivateFieldGet2(_new_effects, this)) if ((effect.f & 155648) === 0 && depends_on(effect, current_unequal, checked)) if ((effect.f & 4194320) !== 0) {
972
- set_signal_status(effect, DIRTY);
973
- batch.schedule(effect);
974
- } else _classPrivateFieldGet2(_dirty_effects$1, batch).add(effect);
975
- if (_classPrivateFieldGet2(_roots, batch).length > 0) {
1079
+ var current_unequal = [...batch.current].filter(([c, v1]) => {
1080
+ const v2 = this.current.get(c);
1081
+ if (!v2) return true;
1082
+ return v2[0] !== v1[0] || v2[1] !== v1[1];
1083
+ }).map(([c]) => c);
1084
+ if (current_unequal.length > 0) {
1085
+ for (const effect of _classPrivateFieldGet2(_new_effects, this)) if ((effect.f & 155648) === 0 && depends_on(effect, current_unequal, checked)) if ((effect.f & 4194320) !== 0) {
1086
+ set_signal_status(effect, DIRTY);
1087
+ batch.schedule(effect);
1088
+ } else _classPrivateFieldGet2(_dirty_effects$1, batch).add(effect);
1089
+ }
1090
+ if (_classPrivateFieldGet2(_roots, batch).length > 0 && !_classPrivateFieldGet2(_decrement_queued, batch)) {
976
1091
  batch.apply();
977
1092
  for (var root of _classPrivateFieldGet2(_roots, batch)) _assertClassBrand(_Batch_brand, batch, _traverse).call(batch, root, [], []);
978
1093
  _classPrivateFieldSet2(_roots, batch, []);
@@ -980,13 +1095,16 @@ function _commit$1() {
980
1095
  batch.deactivate();
981
1096
  }
982
1097
  }
983
- for (const batch of batches) if (_classPrivateFieldGet2(_blockers, batch).has(this)) {
984
- _classPrivateFieldGet2(_blockers, batch).delete(this);
985
- if (_classPrivateFieldGet2(_blockers, batch).size === 0 && !_assertClassBrand(_Batch_brand, batch, _is_deferred).call(batch)) {
986
- batch.activate();
987
- _assertClassBrand(_Batch_brand, batch, _process).call(batch);
988
- }
989
- }
1098
+ }
1099
+ function _unlink() {
1100
+ if (!this.linked) return;
1101
+ var prev = _classPrivateFieldGet2(_prev, this);
1102
+ var next = _classPrivateFieldGet2(_next, this);
1103
+ if (prev === null) first_batch = next;
1104
+ else _classPrivateFieldSet2(_next, prev, next);
1105
+ if (next === null) last_batch = prev;
1106
+ else _classPrivateFieldSet2(_prev, next, prev);
1107
+ this.linked = false;
990
1108
  }
991
1109
  /**
992
1110
  * Synchronously flush any pending updates.
@@ -1139,7 +1257,7 @@ function reset_all(effect) {
1139
1257
  }
1140
1258
  }
1141
1259
  //#endregion
1142
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/reactivity/create-subscriber.js
1260
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/reactivity/create-subscriber.js
1143
1261
  /**
1144
1262
  * Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
1145
1263
  * It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
@@ -1212,13 +1330,13 @@ function createSubscriber(start) {
1212
1330
  };
1213
1331
  }
1214
1332
  //#endregion
1215
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
1333
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
1216
1334
  /** @import { Effect, Source, TemplateNode, } from '#client' */
1217
1335
  /**
1218
1336
  * @typedef {{
1219
- * onerror?: (error: unknown, reset: () => void) => void;
1220
- * failed?: (anchor: Node, error: () => unknown, reset: () => () => void) => void;
1221
- * pending?: (anchor: Node) => void;
1337
+ * onerror?: ((error: unknown, reset: () => void) => void) | null;
1338
+ * failed?: ((anchor: Node, error: () => unknown, reset: () => () => void) => void) | null;
1339
+ * pending?: ((anchor: Node) => void) | null;
1222
1340
  * }} BoundaryProps
1223
1341
  */
1224
1342
  var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;
@@ -1360,82 +1478,15 @@ var Boundary = class {
1360
1478
  }
1361
1479
  /** @param {unknown} error */
1362
1480
  error(error) {
1363
- var onerror = _classPrivateFieldGet2(_props, this).onerror;
1364
- let failed = _classPrivateFieldGet2(_props, this).failed;
1365
- if (!onerror && !failed) throw error;
1366
- if (_classPrivateFieldGet2(_main_effect, this)) {
1367
- destroy_effect(_classPrivateFieldGet2(_main_effect, this));
1368
- _classPrivateFieldSet2(_main_effect, this, null);
1369
- }
1370
- if (_classPrivateFieldGet2(_pending_effect, this)) {
1371
- destroy_effect(_classPrivateFieldGet2(_pending_effect, this));
1372
- _classPrivateFieldSet2(_pending_effect, this, null);
1373
- }
1374
- if (_classPrivateFieldGet2(_failed_effect, this)) {
1375
- destroy_effect(_classPrivateFieldGet2(_failed_effect, this));
1376
- _classPrivateFieldSet2(_failed_effect, this, null);
1377
- }
1378
- if (hydrating) {
1379
- set_hydrate_node(_classPrivateFieldGet2(_hydrate_open, this));
1380
- next();
1381
- set_hydrate_node(skip_nodes());
1382
- }
1383
- var did_reset = false;
1384
- var calling_on_error = false;
1385
- const reset = () => {
1386
- if (did_reset) {
1387
- svelte_boundary_reset_noop();
1388
- return;
1389
- }
1390
- did_reset = true;
1391
- if (calling_on_error) svelte_boundary_reset_onerror();
1392
- if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
1393
- _classPrivateFieldSet2(_failed_effect, this, null);
1394
- });
1395
- _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
1396
- _assertClassBrand(_Boundary_brand, this, _render).call(this);
1481
+ if (!_classPrivateFieldGet2(_props, this).onerror && !_classPrivateFieldGet2(_props, this).failed) throw error;
1482
+ if (current_batch?.is_fork) {
1483
+ if (_classPrivateFieldGet2(_main_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_main_effect, this));
1484
+ if (_classPrivateFieldGet2(_pending_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_pending_effect, this));
1485
+ if (_classPrivateFieldGet2(_failed_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_failed_effect, this));
1486
+ current_batch.oncommit(() => {
1487
+ _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
1397
1488
  });
1398
- };
1399
- /** @param {unknown} transformed_error */
1400
- const handle_error_result = (transformed_error) => {
1401
- try {
1402
- calling_on_error = true;
1403
- onerror?.(transformed_error, reset);
1404
- calling_on_error = false;
1405
- } catch (error) {
1406
- invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
1407
- }
1408
- if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
1409
- try {
1410
- return branch(() => {
1411
- var effect = active_effect;
1412
- effect.b = this;
1413
- effect.f |= 128;
1414
- failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
1415
- });
1416
- } catch (error) {
1417
- invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
1418
- return null;
1419
- }
1420
- }));
1421
- };
1422
- queue_micro_task(() => {
1423
- /** @type {unknown} */
1424
- var result;
1425
- try {
1426
- result = this.transform_error(error);
1427
- } catch (e) {
1428
- invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
1429
- return;
1430
- }
1431
- if (result !== null && typeof result === "object" && typeof result.then === "function")
1432
- /** @type {any} */ result.then(
1433
- handle_error_result,
1434
- /** @param {unknown} e */
1435
- (e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
1436
- );
1437
- else handle_error_result(result);
1438
- });
1489
+ } else _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
1439
1490
  }
1440
1491
  };
1441
1492
  function _hydrate_resolved_content() {
@@ -1551,9 +1602,89 @@ function _update_pending_count(d, batch) {
1551
1602
  }
1552
1603
  }
1553
1604
  }
1605
+ /**
1606
+ * @param {unknown} error
1607
+ */
1608
+ function _handle_error(error) {
1609
+ if (_classPrivateFieldGet2(_main_effect, this)) {
1610
+ destroy_effect(_classPrivateFieldGet2(_main_effect, this));
1611
+ _classPrivateFieldSet2(_main_effect, this, null);
1612
+ }
1613
+ if (_classPrivateFieldGet2(_pending_effect, this)) {
1614
+ destroy_effect(_classPrivateFieldGet2(_pending_effect, this));
1615
+ _classPrivateFieldSet2(_pending_effect, this, null);
1616
+ }
1617
+ if (_classPrivateFieldGet2(_failed_effect, this)) {
1618
+ destroy_effect(_classPrivateFieldGet2(_failed_effect, this));
1619
+ _classPrivateFieldSet2(_failed_effect, this, null);
1620
+ }
1621
+ if (hydrating) {
1622
+ set_hydrate_node(_classPrivateFieldGet2(_hydrate_open, this));
1623
+ next();
1624
+ set_hydrate_node(skip_nodes());
1625
+ }
1626
+ var onerror = _classPrivateFieldGet2(_props, this).onerror;
1627
+ let failed = _classPrivateFieldGet2(_props, this).failed;
1628
+ var did_reset = false;
1629
+ var calling_on_error = false;
1630
+ const reset = () => {
1631
+ if (did_reset) {
1632
+ svelte_boundary_reset_noop();
1633
+ return;
1634
+ }
1635
+ did_reset = true;
1636
+ if (calling_on_error) svelte_boundary_reset_onerror();
1637
+ if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
1638
+ _classPrivateFieldSet2(_failed_effect, this, null);
1639
+ });
1640
+ _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
1641
+ _assertClassBrand(_Boundary_brand, this, _render).call(this);
1642
+ });
1643
+ };
1644
+ /** @param {unknown} transformed_error */
1645
+ const handle_error_result = (transformed_error) => {
1646
+ try {
1647
+ calling_on_error = true;
1648
+ onerror?.(transformed_error, reset);
1649
+ calling_on_error = false;
1650
+ } catch (error) {
1651
+ invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
1652
+ }
1653
+ if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
1654
+ try {
1655
+ return branch(() => {
1656
+ var effect = active_effect;
1657
+ effect.b = this;
1658
+ effect.f |= 128;
1659
+ failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
1660
+ });
1661
+ } catch (error) {
1662
+ invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
1663
+ return null;
1664
+ }
1665
+ }));
1666
+ };
1667
+ queue_micro_task(() => {
1668
+ /** @type {unknown} */
1669
+ var result;
1670
+ try {
1671
+ result = this.transform_error(error);
1672
+ } catch (e) {
1673
+ invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
1674
+ return;
1675
+ }
1676
+ if (result !== null && typeof result === "object" && typeof result.then === "function")
1677
+ /** @type {any} */ result.then(
1678
+ handle_error_result,
1679
+ /** @param {unknown} e */
1680
+ (e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
1681
+ );
1682
+ else handle_error_result(result);
1683
+ });
1684
+ }
1554
1685
  //#endregion
1555
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/reactivity/async.js
1556
- /** @import { Blocker, Effect, Value } from '#client' */
1686
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/reactivity/async.js
1687
+ /** @import { Blocker, Effect, Source, Value } from '#client' */
1557
1688
  /**
1558
1689
  * @param {Blocker[]} blockers
1559
1690
  * @param {Array<() => any>} sync
@@ -1563,30 +1694,34 @@ function _update_pending_count(d, batch) {
1563
1694
  function flatten(blockers, sync, async, fn) {
1564
1695
  const d = is_runes() ? derived : derived_safe_equal;
1565
1696
  var pending = blockers.filter((b) => !b.settled);
1697
+ var deriveds = sync.map(d);
1566
1698
  if (async.length === 0 && pending.length === 0) {
1567
- fn(sync.map(d));
1699
+ fn(deriveds);
1568
1700
  return;
1569
1701
  }
1570
1702
  var parent = active_effect;
1571
1703
  var restore = capture();
1572
1704
  var blocker_promise = pending.length === 1 ? pending[0].promise : pending.length > 1 ? Promise.all(pending.map((b) => b.promise)) : null;
1573
- /** @param {Value[]} values */
1574
- function finish(values) {
1705
+ /**
1706
+ * @param {Source[]} async
1707
+ */
1708
+ function finish(async) {
1709
+ if ((parent.f & 16384) !== 0) return;
1575
1710
  restore();
1576
1711
  try {
1577
- fn(values);
1712
+ fn([...deriveds, ...async]);
1578
1713
  } catch (error) {
1579
- if ((parent.f & 16384) === 0) invoke_error_boundary(error, parent);
1714
+ invoke_error_boundary(error, parent);
1580
1715
  }
1581
1716
  unset_context();
1582
1717
  }
1718
+ var decrement_pending = increment_pending();
1583
1719
  if (async.length === 0) {
1584
- /** @type {Promise<any>} */ blocker_promise.then(() => finish(sync.map(d)));
1720
+ /** @type {Promise<any>} */ blocker_promise.then(() => finish([])).finally(decrement_pending);
1585
1721
  return;
1586
1722
  }
1587
- var decrement_pending = increment_pending();
1588
1723
  function run() {
1589
- Promise.all(async.map((expression) => /* @__PURE__ */ async_derived(expression))).then((result) => finish([...sync.map(d), ...result])).catch((error) => invoke_error_boundary(error, parent)).finally(() => decrement_pending());
1724
+ Promise.all(async.map((expression) => /* @__PURE__ */ async_derived(expression))).then(finish).catch((error) => invoke_error_boundary(error, parent)).finally(decrement_pending);
1590
1725
  }
1591
1726
  if (blocker_promise) blocker_promise.then(() => {
1592
1727
  restore();
@@ -1628,12 +1763,12 @@ function increment_pending() {
1628
1763
  var effect = active_effect;
1629
1764
  var boundary = effect.b;
1630
1765
  var batch = current_batch;
1631
- var blocking = boundary.is_rendered();
1632
- boundary.update_pending_count(1, batch);
1766
+ var blocking = !!boundary?.is_rendered();
1767
+ boundary?.update_pending_count(1, batch);
1633
1768
  batch.increment(blocking, effect);
1634
- return (skip = false) => {
1635
- boundary.update_pending_count(-1, batch);
1636
- batch.decrement(blocking, effect, skip);
1769
+ return () => {
1770
+ boundary?.update_pending_count(-1, batch);
1771
+ batch.decrement(blocking, effect);
1637
1772
  };
1638
1773
  }
1639
1774
  /**
@@ -1641,10 +1776,9 @@ function increment_pending() {
1641
1776
  * @param {() => V} fn
1642
1777
  * @returns {Derived<V>}
1643
1778
  */
1644
- /* @__NO_SIDE_EFFECTS__ */
1779
+ /*#__NO_SIDE_EFFECTS__*/
1645
1780
  function derived(fn) {
1646
1781
  var flags = 2 | DIRTY;
1647
- var parent_derived = active_reaction !== null && (active_reaction.f & 2) !== 0 ? active_reaction : null;
1648
1782
  if (active_effect !== null) active_effect.f |= EFFECT_PRESERVED;
1649
1783
  return {
1650
1784
  ctx: component_context,
@@ -1657,10 +1791,11 @@ function derived(fn) {
1657
1791
  rv: 0,
1658
1792
  v: UNINITIALIZED,
1659
1793
  wv: 0,
1660
- parent: parent_derived ?? active_effect,
1794
+ parent: active_effect,
1661
1795
  ac: null
1662
1796
  };
1663
1797
  }
1798
+ var OBSOLETE = Symbol("obsolete");
1664
1799
  /**
1665
1800
  * @template V
1666
1801
  * @param {() => V | Promise<V>} fn
@@ -1668,22 +1803,24 @@ function derived(fn) {
1668
1803
  * @param {string} [location] If provided, print a warning if the value is not read immediately after update
1669
1804
  * @returns {Promise<Source<V>>}
1670
1805
  */
1671
- /* @__NO_SIDE_EFFECTS__ */
1806
+ /*#__NO_SIDE_EFFECTS__*/
1672
1807
  function async_derived(fn, label, location) {
1673
1808
  let parent = active_effect;
1674
1809
  if (parent === null) async_derived_orphan();
1675
1810
  var promise = void 0;
1676
1811
  var signal = source(UNINITIALIZED);
1677
1812
  var should_suspend = !active_reaction;
1678
- /** @type {Map<Batch, ReturnType<typeof deferred<V>>>} */
1679
- var deferreds = /* @__PURE__ */ new Map();
1813
+ /** @type {Set<ReturnType<typeof deferred<V>>>} */
1814
+ var deferreds = /* @__PURE__ */ new Set();
1680
1815
  async_effect(() => {
1681
1816
  var effect = active_effect;
1682
1817
  /** @type {ReturnType<typeof deferred<V>>} */
1683
1818
  var d = deferred();
1684
1819
  promise = d.promise;
1685
1820
  try {
1686
- Promise.resolve(fn()).then(d.resolve, d.reject).finally(unset_context);
1821
+ Promise.resolve(fn()).then(d.resolve, (e) => {
1822
+ if (e !== STALE_REACTION) d.reject(e);
1823
+ }).finally(unset_context);
1687
1824
  } catch (error) {
1688
1825
  d.reject(error);
1689
1826
  unset_context();
@@ -1691,22 +1828,19 @@ function async_derived(fn, label, location) {
1691
1828
  var batch = current_batch;
1692
1829
  if (should_suspend) {
1693
1830
  if ((effect.f & 32768) !== 0) var decrement_pending = increment_pending();
1694
- if (parent.b.is_rendered()) {
1695
- deferreds.get(batch)?.reject(STALE_REACTION);
1696
- deferreds.delete(batch);
1697
- } else {
1698
- for (const d of deferreds.values()) d.reject(STALE_REACTION);
1699
- deferreds.clear();
1700
- }
1701
- deferreds.set(batch, d);
1831
+ if (parent.b?.is_rendered()) batch.async_deriveds.get(effect)?.reject(OBSOLETE);
1832
+ else for (const d of deferreds.values()) d.reject(OBSOLETE);
1833
+ deferreds.add(d);
1834
+ batch.async_deriveds.set(effect, d);
1702
1835
  }
1703
1836
  /**
1704
1837
  * @param {any} value
1705
1838
  * @param {unknown} error
1706
1839
  */
1707
1840
  const handler = (value, error = void 0) => {
1708
- if (decrement_pending) decrement_pending(error === STALE_REACTION);
1709
- if (error === STALE_REACTION || (effect.f & 16384) !== 0) return;
1841
+ decrement_pending?.();
1842
+ deferreds.delete(d);
1843
+ if (error === OBSOLETE) return;
1710
1844
  batch.activate();
1711
1845
  if (error) {
1712
1846
  signal.f |= ERROR_VALUE;
@@ -1714,18 +1848,13 @@ function async_derived(fn, label, location) {
1714
1848
  } else {
1715
1849
  if ((signal.f & 8388608) !== 0) signal.f ^= ERROR_VALUE;
1716
1850
  internal_set(signal, value);
1717
- for (const [b, d] of deferreds) {
1718
- deferreds.delete(b);
1719
- if (b === batch) break;
1720
- d.reject(STALE_REACTION);
1721
- }
1722
1851
  }
1723
1852
  batch.deactivate();
1724
1853
  };
1725
1854
  d.promise.then(handler, (e) => handler(null, e || "unknown"));
1726
1855
  });
1727
1856
  teardown(() => {
1728
- for (const d of deferreds.values()) d.reject(STALE_REACTION);
1857
+ for (const d of deferreds) d.reject(OBSOLETE);
1729
1858
  });
1730
1859
  return new Promise((fulfil) => {
1731
1860
  /** @param {Promise<V>} p */
@@ -1744,7 +1873,7 @@ function async_derived(fn, label, location) {
1744
1873
  * @param {() => V} fn
1745
1874
  * @returns {Derived<V>}
1746
1875
  */
1747
- /* @__NO_SIDE_EFFECTS__ */
1876
+ /*#__NO_SIDE_EFFECTS__*/
1748
1877
  function derived_safe_equal(fn) {
1749
1878
  const signal = /* @__PURE__ */ derived(fn);
1750
1879
  signal.equals = safe_equals;
@@ -1762,18 +1891,6 @@ function destroy_derived_effects(derived) {
1762
1891
  }
1763
1892
  }
1764
1893
  /**
1765
- * @param {Derived} derived
1766
- * @returns {Effect | null}
1767
- */
1768
- function get_derived_parent_effect(derived) {
1769
- var parent = derived.parent;
1770
- while (parent !== null) {
1771
- if ((parent.f & 2) === 0) return (parent.f & 16384) === 0 ? parent : null;
1772
- parent = parent.parent;
1773
- }
1774
- return null;
1775
- }
1776
- /**
1777
1894
  * @template T
1778
1895
  * @param {Derived} derived
1779
1896
  * @returns {T}
@@ -1781,7 +1898,12 @@ function get_derived_parent_effect(derived) {
1781
1898
  function execute_derived(derived) {
1782
1899
  var value;
1783
1900
  var prev_active_effect = active_effect;
1784
- set_active_effect(get_derived_parent_effect(derived));
1901
+ var parent = derived.parent;
1902
+ if (!is_destroying_effect && parent !== null && derived.v !== UNINITIALIZED && (parent.f & 24576) !== 0) {
1903
+ derived_inert();
1904
+ return derived.v;
1905
+ }
1906
+ set_active_effect(parent);
1785
1907
  try {
1786
1908
  derived.f &= ~WAS_MARKED;
1787
1909
  destroy_derived_effects(derived);
@@ -1796,13 +1918,14 @@ function execute_derived(derived) {
1796
1918
  * @returns {void}
1797
1919
  */
1798
1920
  function update_derived(derived) {
1799
- var old_value = derived.v;
1800
1921
  var value = execute_derived(derived);
1801
1922
  if (!derived.equals(value)) {
1802
1923
  derived.wv = increment_write_version();
1803
1924
  if (!current_batch?.is_fork || derived.deps === null) {
1804
- derived.v = value;
1805
- current_batch?.capture(derived, old_value, true);
1925
+ if (current_batch !== null) {
1926
+ current_batch.capture(derived, value, true);
1927
+ previous_batch?.capture(derived, value, true);
1928
+ } else derived.v = value;
1806
1929
  if (derived.deps === null) {
1807
1930
  set_signal_status(derived, CLEAN);
1808
1931
  return;
@@ -1822,7 +1945,7 @@ function freeze_derived_effects(derived) {
1822
1945
  for (const e of derived.effects) if (e.teardown || e.ac) {
1823
1946
  e.teardown?.();
1824
1947
  e.ac?.abort(STALE_REACTION);
1825
- e.teardown = noop;
1948
+ if (e.fn !== null) e.teardown = noop;
1826
1949
  e.ac = null;
1827
1950
  remove_reactions(e, 0);
1828
1951
  destroy_effect_children(e);
@@ -1833,12 +1956,12 @@ function freeze_derived_effects(derived) {
1833
1956
  */
1834
1957
  function unfreeze_derived_effects(derived) {
1835
1958
  if (derived.effects === null) return;
1836
- for (const e of derived.effects) if (e.teardown) update_effect(e);
1959
+ for (const e of derived.effects) if (e.teardown && e.fn !== null) update_effect(e);
1837
1960
  }
1838
1961
  //#endregion
1839
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/reactivity/sources.js
1962
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/reactivity/sources.js
1840
1963
  /** @import { Derived, Effect, Source, Value } from '#client' */
1841
- /** @type {Set<any>} */
1964
+ /** @type {Set<Effect>} */
1842
1965
  var eager_effects = /* @__PURE__ */ new Set();
1843
1966
  /** @type {Map<Source, any>} */
1844
1967
  var old_values = /* @__PURE__ */ new Map();
@@ -1864,7 +1987,7 @@ function source(v, stack) {
1864
1987
  * @param {V} v
1865
1988
  * @param {Error | null} [stack]
1866
1989
  */
1867
- /* @__NO_SIDE_EFFECTS__ */
1990
+ /*#__NO_SIDE_EFFECTS__*/
1868
1991
  function state(v, stack) {
1869
1992
  const s = source(v, stack);
1870
1993
  push_reaction_value(s);
@@ -1876,7 +1999,7 @@ function state(v, stack) {
1876
1999
  * @param {boolean} [immutable]
1877
2000
  * @returns {Source<V>}
1878
2001
  */
1879
- /* @__NO_SIDE_EFFECTS__ */
2002
+ /*#__NO_SIDE_EFFECTS__*/
1880
2003
  function mutable_source(initial_value, immutable = false, trackable = true) {
1881
2004
  const s = source(initial_value);
1882
2005
  if (!immutable) s.equals = safe_equals;
@@ -1894,7 +2017,7 @@ function mutable_source(initial_value, immutable = false, trackable = true) {
1894
2017
  * @returns {V}
1895
2018
  */
1896
2019
  function set(source, value, should_proxy = false) {
1897
- if (active_reaction !== null && (!untracking || (active_reaction.f & 131072) !== 0) && is_runes() && (active_reaction.f & 4325394) !== 0 && (current_sources === null || !includes.call(current_sources, source))) state_unsafe_mutation();
2020
+ 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();
1898
2021
  return internal_set(source, should_proxy ? proxy(value) : value, legacy_updates);
1899
2022
  }
1900
2023
  /**
@@ -1906,12 +2029,9 @@ function set(source, value, should_proxy = false) {
1906
2029
  */
1907
2030
  function internal_set(source, value, updated_during_traversal = null) {
1908
2031
  if (!source.equals(value)) {
1909
- var old_value = source.v;
1910
- if (is_destroying_effect) old_values.set(source, value);
1911
- else old_values.set(source, old_value);
1912
- source.v = value;
2032
+ old_values.set(source, is_destroying_effect ? value : source.v);
1913
2033
  var batch = Batch.ensure();
1914
- batch.capture(source, old_value);
2034
+ batch.capture(source, value);
1915
2035
  if ((source.f & 2) !== 0) {
1916
2036
  const derived = source;
1917
2037
  if ((source.f & 2048) !== 0) execute_derived(derived);
@@ -1929,7 +2049,13 @@ function flush_eager_effects() {
1929
2049
  eager_effects_deferred = false;
1930
2050
  for (const effect of eager_effects) {
1931
2051
  if ((effect.f & 1024) !== 0) set_signal_status(effect, MAYBE_DIRTY);
1932
- if (is_dirty(effect)) update_effect(effect);
2052
+ let dirty;
2053
+ try {
2054
+ dirty = is_dirty(effect);
2055
+ } catch {
2056
+ dirty = true;
2057
+ }
2058
+ if (dirty) update_effect(effect);
1933
2059
  }
1934
2060
  eager_effects.clear();
1935
2061
  }
@@ -1957,11 +2083,12 @@ function mark_reactions(signal, status, updated_during_traversal) {
1957
2083
  if (!runes && reaction === active_effect) continue;
1958
2084
  var not_dirty = (flags & DIRTY) === 0;
1959
2085
  if (not_dirty) set_signal_status(reaction, status);
1960
- if ((flags & 2) !== 0) {
2086
+ if ((flags & 131072) !== 0) eager_effects.add(reaction);
2087
+ else if ((flags & 2) !== 0) {
1961
2088
  var derived = reaction;
1962
2089
  batch_values?.delete(derived);
1963
2090
  if ((flags & 65536) === 0) {
1964
- if (flags & 512) reaction.f |= WAS_MARKED;
2091
+ if (flags & 512 && (active_effect === null || (active_effect.f & 2097152) === 0)) reaction.f |= WAS_MARKED;
1965
2092
  mark_reactions(derived, MAYBE_DIRTY, updated_during_traversal);
1966
2093
  }
1967
2094
  } else if (not_dirty) {
@@ -2130,8 +2257,19 @@ function proxy(value) {
2130
2257
  }
2131
2258
  });
2132
2259
  }
2260
+ new Set([
2261
+ "copyWithin",
2262
+ "fill",
2263
+ "pop",
2264
+ "push",
2265
+ "reverse",
2266
+ "shift",
2267
+ "sort",
2268
+ "splice",
2269
+ "unshift"
2270
+ ]);
2133
2271
  //#endregion
2134
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/dom/operations.js
2272
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/operations.js
2135
2273
  /** @import { Effect, TemplateNode } from '#client' */
2136
2274
  /** @type {Window} */
2137
2275
  var $window;
@@ -2155,13 +2293,13 @@ function init_operations() {
2155
2293
  first_child_getter = get_descriptor(node_prototype, "firstChild").get;
2156
2294
  next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
2157
2295
  if (is_extensible(element_prototype)) {
2158
- element_prototype.__click = void 0;
2159
- element_prototype.__className = void 0;
2160
- element_prototype.__attributes = null;
2161
- element_prototype.__style = void 0;
2296
+ /** @type {any} */ element_prototype[CLASS_CACHE] = void 0;
2297
+ /** @type {any} */ element_prototype[ATTRIBUTES_CACHE] = null;
2298
+ /** @type {any} */ element_prototype[STYLE_CACHE] = void 0;
2162
2299
  element_prototype.__e = void 0;
2163
2300
  }
2164
- if (is_extensible(text_prototype)) text_prototype.__t = void 0;
2301
+ if (is_extensible(text_prototype))
2302
+ /** @type {any} */ text_prototype[TEXT_CACHE] = void 0;
2165
2303
  }
2166
2304
  /**
2167
2305
  * @param {string} value
@@ -2174,7 +2312,7 @@ function create_text(value = "") {
2174
2312
  * @template {Node} N
2175
2313
  * @param {N} node
2176
2314
  */
2177
- /* @__NO_SIDE_EFFECTS__ */
2315
+ /*@__NO_SIDE_EFFECTS__*/
2178
2316
  function get_first_child(node) {
2179
2317
  return first_child_getter.call(node);
2180
2318
  }
@@ -2182,7 +2320,7 @@ function get_first_child(node) {
2182
2320
  * @template {Node} N
2183
2321
  * @param {N} node
2184
2322
  */
2185
- /* @__NO_SIDE_EFFECTS__ */
2323
+ /*@__NO_SIDE_EFFECTS__*/
2186
2324
  function get_next_sibling(node) {
2187
2325
  return next_sibling_getter.call(node);
2188
2326
  }
@@ -2227,6 +2365,12 @@ function should_defer_append() {
2227
2365
  return (active_effect.f & REACTION_RAN) !== 0;
2228
2366
  }
2229
2367
  /**
2368
+ * Branching here is intentional and load-bearing for perf. `createElement(tag)`
2369
+ * hits a fast path in Blink that `createElementNS(NAMESPACE_HTML, tag)` doesn't,
2370
+ * and passing an explicit `undefined` as the trailing options arg measurably
2371
+ * slows both APIs. Funnelling every case through a single `createElementNS(ns,
2372
+ * tag, options)` call would be smaller but slower on the HTML path.
2373
+ *
2230
2374
  * @template {keyof HTMLElementTagNameMap | string} T
2231
2375
  * @param {T} tag
2232
2376
  * @param {string} [namespace]
@@ -2234,8 +2378,8 @@ function should_defer_append() {
2234
2378
  * @returns {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element}
2235
2379
  */
2236
2380
  function create_element(tag, namespace, is) {
2237
- let options = is ? { is } : void 0;
2238
- return document.createElementNS(namespace ?? "http://www.w3.org/1999/xhtml", tag, options);
2381
+ if (namespace == null || namespace === "http://www.w3.org/1999/xhtml") return is ? document.createElement(tag, { is }) : document.createElement(tag);
2382
+ return is ? document.createElementNS(namespace, tag, { is }) : document.createElementNS(namespace, tag);
2239
2383
  }
2240
2384
  /**
2241
2385
  * Browsers split text nodes larger than 65536 bytes when parsing.
@@ -2252,7 +2396,7 @@ function merge_text_nodes(text) {
2252
2396
  }
2253
2397
  }
2254
2398
  //#endregion
2255
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
2399
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
2256
2400
  /**
2257
2401
  * @template T
2258
2402
  * @param {() => T} fn
@@ -2270,7 +2414,7 @@ function without_reactive_context(fn) {
2270
2414
  }
2271
2415
  }
2272
2416
  //#endregion
2273
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/reactivity/effects.js
2417
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/reactivity/effects.js
2274
2418
  /** @import { Blocker, ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */
2275
2419
  /**
2276
2420
  * @param {'$effect' | '$effect.pre' | '$inspect'} rune
@@ -2370,7 +2514,7 @@ function teardown(fn) {
2370
2514
  function user_effect(fn) {
2371
2515
  validate_effect("$effect");
2372
2516
  var flags = active_effect.f;
2373
- if (!active_reaction && (flags & 32) !== 0 && (flags & 32768) === 0) {
2517
+ if (!active_reaction && (flags & 32) !== 0 && component_context !== null && !component_context.i) {
2374
2518
  var context = component_context;
2375
2519
  (context.e ?? (context.e = [])).push(fn);
2376
2520
  } else return create_user_effect(fn);
@@ -2443,7 +2587,9 @@ function render_effect(fn, flags = 0) {
2443
2587
  */
2444
2588
  function template_effect(fn, sync = [], async = [], blockers = []) {
2445
2589
  flatten(blockers, sync, async, (values) => {
2446
- create_effect(8, () => fn(...values.map(get)));
2590
+ create_effect(8, () => {
2591
+ fn(...values.map(get));
2592
+ });
2447
2593
  });
2448
2594
  }
2449
2595
  /**
@@ -2519,7 +2665,7 @@ function destroy_effect(effect, remove_dom = true) {
2519
2665
  remove_effect_dom(effect.nodes.start, effect.nodes.end);
2520
2666
  removed = true;
2521
2667
  }
2522
- set_signal_status(effect, DESTROYING);
2668
+ effect.f |= DESTROYING;
2523
2669
  destroy_effect_children(effect, remove_dom && !removed);
2524
2670
  remove_reactions(effect, 0);
2525
2671
  var transitions = effect.nodes && effect.nodes.t;
@@ -2599,8 +2745,10 @@ function pause_children(effect, transitions, local) {
2599
2745
  var child = effect.first;
2600
2746
  while (child !== null) {
2601
2747
  var sibling = child.next;
2602
- var transparent = (child.f & 65536) !== 0 || (child.f & 32) !== 0 && (effect.f & 16) !== 0;
2603
- pause_children(child, transitions, transparent ? local : false);
2748
+ if ((child.f & 64) === 0) {
2749
+ var transparent = (child.f & 65536) !== 0 || (child.f & 32) !== 0 && (effect.f & 16) !== 0;
2750
+ pause_children(child, transitions, transparent ? local : false);
2751
+ }
2604
2752
  child = sibling;
2605
2753
  }
2606
2754
  }
@@ -2652,14 +2800,14 @@ function move_effect(effect, fragment) {
2652
2800
  }
2653
2801
  }
2654
2802
  //#endregion
2655
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/legacy.js
2803
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/legacy.js
2656
2804
  /**
2657
2805
  * @type {Set<Value> | null}
2658
2806
  * @deprecated
2659
2807
  */
2660
2808
  var captured_signals = null;
2661
2809
  //#endregion
2662
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/runtime.js
2810
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/runtime.js
2663
2811
  /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
2664
2812
  var is_updating_effect = false;
2665
2813
  var is_destroying_effect = false;
@@ -2683,13 +2831,12 @@ function set_active_effect(effect) {
2683
2831
  /**
2684
2832
  * When sources are created within a reaction, reading and writing
2685
2833
  * them within that reaction should not cause a re-run
2686
- * @type {null | Source[]}
2834
+ * @type {null | Set<Source>}
2687
2835
  */
2688
2836
  var current_sources = null;
2689
2837
  /** @param {Value} value */
2690
2838
  function push_reaction_value(value) {
2691
- if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & 2) !== 0)) if (current_sources === null) current_sources = [value];
2692
- else current_sources.push(value);
2839
+ if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & 2) !== 0)) (current_sources ?? (current_sources = /* @__PURE__ */ new Set())).add(value);
2693
2840
  }
2694
2841
  /**
2695
2842
  * The dependencies of the reaction that is currently being executed. In many cases,
@@ -2754,7 +2901,7 @@ function is_dirty(reaction) {
2754
2901
  function schedule_possible_effect_self_invalidation(signal, effect, root = true) {
2755
2902
  var reactions = signal.reactions;
2756
2903
  if (reactions === null) return;
2757
- if (!async_mode_flag && current_sources !== null && includes.call(current_sources, signal)) return;
2904
+ if (!async_mode_flag && current_sources !== null && current_sources.has(signal)) return;
2758
2905
  for (var i = 0; i < reactions.length; i++) {
2759
2906
  var reaction = reactions[i];
2760
2907
  if ((reaction.f & 2) !== 0) schedule_possible_effect_self_invalidation(reaction, effect, false);
@@ -2861,7 +3008,7 @@ function remove_reaction(signal, dependency) {
2861
3008
  derived.f ^= 512;
2862
3009
  derived.f &= ~WAS_MARKED;
2863
3010
  }
2864
- update_derived_status(derived);
3011
+ if (derived.v !== UNINITIALIZED) update_derived_status(derived);
2865
3012
  freeze_derived_effects(derived);
2866
3013
  remove_reactions(derived, 0);
2867
3014
  }
@@ -2909,7 +3056,7 @@ function get(signal) {
2909
3056
  var is_derived = (signal.f & 2) !== 0;
2910
3057
  captured_signals?.add(signal);
2911
3058
  if (active_reaction !== null && !untracking) {
2912
- if (!(active_effect !== null && (active_effect.f & 16384) !== 0) && (current_sources === null || !includes.call(current_sources, signal))) {
3059
+ if (!(active_effect !== null && (active_effect.f & 16384) !== 0) && (current_sources === null || !current_sources.has(signal))) {
2913
3060
  var deps = active_reaction.deps;
2914
3061
  if ((active_reaction.f & 2097152) !== 0) {
2915
3062
  if (signal.rv < read_version) {
@@ -2920,7 +3067,8 @@ function get(signal) {
2920
3067
  }
2921
3068
  } else {
2922
3069
  var _active_reaction;
2923
- ((_active_reaction = active_reaction).deps ?? (_active_reaction.deps = [])).push(signal);
3070
+ (_active_reaction = active_reaction).deps ?? (_active_reaction.deps = []);
3071
+ if (!includes.call(active_reaction.deps, signal)) active_reaction.deps.push(signal);
2924
3072
  var reactions = signal.reactions;
2925
3073
  if (reactions === null) signal.reactions = [active_reaction];
2926
3074
  else if (!includes.call(reactions, active_reaction)) reactions.push(active_reaction);
@@ -3003,7 +3151,7 @@ function untrack(fn) {
3003
3151
  }
3004
3152
  }
3005
3153
  //#endregion
3006
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/dom/elements/events.js
3154
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/elements/events.js
3007
3155
  /**
3008
3156
  * Used on elements, as a map of event type -> event handler,
3009
3157
  * and on events themselves to track which element handled an event
@@ -3060,8 +3208,7 @@ function handle_event_propagation(event) {
3060
3208
  */
3061
3209
  var other_errors = [];
3062
3210
  while (current_target !== null) {
3063
- /** @type {null | Element} */
3064
- var parent_element = current_target.assignedSlot || current_target.parentNode || current_target.host || null;
3211
+ if (current_target === handler_element) break;
3065
3212
  try {
3066
3213
  var delegated = current_target[event_symbol]?.[event_name];
3067
3214
  if (delegated != null && (!current_target.disabled || event.target === current_target)) delegated.call(current_target, event);
@@ -3069,8 +3216,9 @@ function handle_event_propagation(event) {
3069
3216
  if (throw_error) other_errors.push(error);
3070
3217
  else throw_error = error;
3071
3218
  }
3072
- if (event.cancelBubble || parent_element === handler_element || parent_element === null) break;
3073
- current_target = parent_element;
3219
+ if (event.cancelBubble) break;
3220
+ path_idx++;
3221
+ current_target = path_idx < path.length ? path[path_idx] : null;
3074
3222
  }
3075
3223
  if (throw_error) {
3076
3224
  for (let error of other_errors) queueMicrotask(() => {
@@ -3086,8 +3234,10 @@ function handle_event_propagation(event) {
3086
3234
  }
3087
3235
  }
3088
3236
  //#endregion
3089
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/dom/reconciler.js
3090
- var policy = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (html) => {
3237
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/reconciler.js
3238
+ var policy = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
3239
+ /** @param {string} html */
3240
+ createHTML: (html) => {
3091
3241
  return html;
3092
3242
  } });
3093
3243
  /** @param {string} html */
@@ -3103,7 +3253,7 @@ function create_fragment_from_html(html) {
3103
3253
  return elem.content;
3104
3254
  }
3105
3255
  //#endregion
3106
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/dom/template.js
3256
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/template.js
3107
3257
  /** @import { Effect, EffectNodes, TemplateNode } from '#client' */
3108
3258
  /** @import { TemplateStructure } from './types' */
3109
3259
  /**
@@ -3124,7 +3274,7 @@ function assign_nodes(start, end) {
3124
3274
  * @param {number} flags
3125
3275
  * @returns {() => Node | Node[]}
3126
3276
  */
3127
- /* @__NO_SIDE_EFFECTS__ */
3277
+ /*#__NO_SIDE_EFFECTS__*/
3128
3278
  function from_html(content, flags) {
3129
3279
  var is_fragment = (flags & 1) !== 0;
3130
3280
  var use_import_node = (flags & 2) !== 0;
@@ -3362,7 +3512,7 @@ function unmount(component, options) {
3362
3512
  return Promise.resolve();
3363
3513
  }
3364
3514
  //#endregion
3365
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/dom/blocks/branches.js
3515
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/blocks/branches.js
3366
3516
  /** @import { Effect, TemplateNode } from '#client' */
3367
3517
  var _batches = /* @__PURE__ */ new WeakMap();
3368
3518
  var _onscreen = /* @__PURE__ */ new WeakMap();
@@ -3404,6 +3554,7 @@ var BranchManager = class {
3404
3554
  } else {
3405
3555
  var offscreen = _classPrivateFieldGet2(_offscreen, this).get(key);
3406
3556
  if (offscreen) {
3557
+ resume_effect(offscreen.effect);
3407
3558
  _classPrivateFieldGet2(_onscreen, this).set(key, offscreen.effect);
3408
3559
  _classPrivateFieldGet2(_offscreen, this).delete(key);
3409
3560
  /** @type {TemplateNode} */ offscreen.fragment.lastChild.remove();
@@ -3484,7 +3635,7 @@ var BranchManager = class {
3484
3635
  }
3485
3636
  };
3486
3637
  //#endregion
3487
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/dom/blocks/if.js
3638
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/blocks/if.js
3488
3639
  /** @import { TemplateNode } from '#client' */
3489
3640
  /**
3490
3641
  * @param {TemplateNode} node
@@ -3583,14 +3734,14 @@ function html(node, get_value, is_controlled = false, svg = false, mathml = fals
3583
3734
  var wrapper = create_element(svg ? "svg" : mathml ? "math" : "template", svg ? NAMESPACE_SVG : mathml ? NAMESPACE_MATHML : void 0);
3584
3735
  wrapper.innerHTML = value;
3585
3736
  /** @type {DocumentFragment | Element} */
3586
- var node = svg || mathml ? wrapper : wrapper.content;
3737
+ var node = svg || mathml ? wrapper : /** @type {HTMLTemplateElement} */ wrapper.content;
3587
3738
  assign_nodes(/* @__PURE__ */ get_first_child(node), node.lastChild);
3588
3739
  if (svg || mathml) while (/* @__PURE__ */ get_first_child(node)) anchor.before(/* @__PURE__ */ get_first_child(node));
3589
3740
  else anchor.before(node);
3590
3741
  });
3591
3742
  }
3592
3743
  //#endregion
3593
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/dom/css.js
3744
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/css.js
3594
3745
  /**
3595
3746
  * @param {Node} anchor
3596
3747
  * @param {{ hash: string, code: string }} css
@@ -3598,7 +3749,7 @@ function html(node, get_value, is_controlled = false, svg = false, mathml = fals
3598
3749
  function append_styles(anchor, css) {
3599
3750
  effect(() => {
3600
3751
  var root = anchor.getRootNode();
3601
- var target = root.host ? root : root.head ?? root.ownerDocument.head;
3752
+ var target = root.host ? root : /** @type {Document} */ root.head ?? root.ownerDocument.head;
3602
3753
  if (!target.querySelector("#" + css.hash)) {
3603
3754
  const style = create_element("style");
3604
3755
  style.id = css.hash;
@@ -3608,7 +3759,7 @@ function append_styles(anchor, css) {
3608
3759
  });
3609
3760
  }
3610
3761
  //#endregion
3611
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js
3762
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js
3612
3763
  var _ResizeObserverSingleton;
3613
3764
  var _listeners = /* @__PURE__ */ new WeakMap();
3614
3765
  var _observer = /* @__PURE__ */ new WeakMap();
@@ -3660,8 +3811,8 @@ function _getObserver() {
3660
3811
  }
3661
3812
  _defineProperty(ResizeObserverSingleton, "entries", /* @__PURE__ */ new WeakMap());
3662
3813
  //#endregion
3663
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/reactivity/props.js
3664
- /** @import { Effect, Source } from './types.js' */
3814
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/reactivity/props.js
3815
+ /** @import { Derived, Effect, Source } from './types.js' */
3665
3816
  /**
3666
3817
  * This function is responsible for synchronizing a possibly bound prop with the inner component state.
3667
3818
  * It is used whenever the compiler sees that the component writes to the prop, or when it has a default prop_value.
@@ -3678,7 +3829,12 @@ function prop(props, key, flags, fallback) {
3678
3829
  var lazy = (flags & 16) !== 0;
3679
3830
  var fallback_value = fallback;
3680
3831
  var fallback_dirty = true;
3832
+ var fallback_signal = void 0;
3681
3833
  var get_fallback = () => {
3834
+ if (lazy && runes) {
3835
+ fallback_signal ?? (fallback_signal = /* @__PURE__ */ derived(fallback));
3836
+ return get(fallback_signal);
3837
+ }
3682
3838
  if (fallback_dirty) {
3683
3839
  fallback_dirty = false;
3684
3840
  fallback_value = lazy ? untrack(fallback) : fallback;
@@ -3748,7 +3904,7 @@ function prop(props, key, flags, fallback) {
3748
3904
  });
3749
3905
  }
3750
3906
  //#endregion
3751
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/legacy/legacy-client.js
3907
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/legacy/legacy-client.js
3752
3908
  /** @import { ComponentConstructorOptions, ComponentType, SvelteComponent, Component } from 'svelte' */
3753
3909
  /**
3754
3910
  * Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.
@@ -3827,6 +3983,7 @@ var Svelte4Component = class {
3827
3983
  get() {
3828
3984
  return _classPrivateFieldGet2(_instance, this)[key];
3829
3985
  },
3986
+ /** @param {any} value */
3830
3987
  set(value) {
3831
3988
  _classPrivateFieldGet2(_instance, this)[key] = value;
3832
3989
  },
@@ -3866,7 +4023,7 @@ var Svelte4Component = class {
3866
4023
  }
3867
4024
  };
3868
4025
  //#endregion
3869
- //#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/client/dom/elements/custom-element.js
4026
+ //#region ../../../node_modules/.bun/svelte@5.56.1/node_modules/svelte/src/internal/client/dom/elements/custom-element.js
3870
4027
  /**
3871
4028
  * @typedef {Object} CustomElementPropDefinition
3872
4029
  * @property {string} [attribute]
@@ -4152,8 +4309,8 @@ function create_custom_element(Component, props_definition, slots, exports, shad
4152
4309
  }
4153
4310
  //#endregion
4154
4311
  //#region src/print/Print.svelte
4155
- var root_1 = /* @__PURE__ */ from_html(`<div class="mb-4 prose prose-sm svelte-1fx5wwa"></div>`);
4156
- var root = /* @__PURE__ */ from_html(`<div class="p-4 print:p-0"><!> <div class="inline-block"><input type="text" placeholder="______________________" class="px-3 py-2 border-b-2 border-gray-400 bg-transparent print:border-black svelte-1fx5wwa" style="border-top: none; border-left: none; border-right: none;" disabled=""/></div></div>`);
4312
+ var root = /* @__PURE__ */ from_html(`<div class="mb-4 prose prose-sm svelte-1fx5wwa"></div>`);
4313
+ var root_1 = /* @__PURE__ */ from_html(`<div class="p-4 print:p-0"><!> <div class="inline-block"><input type="text" placeholder="______________________" class="px-3 py-2 border-b-2 border-gray-400 bg-transparent print:border-black svelte-1fx5wwa" style="border-top: none; border-left: none; border-right: none;" disabled=""/></div></div>`);
4157
4314
  var $$css = {
4158
4315
  hash: "svelte-1fx5wwa",
4159
4316
  code: "\n @media print {input.svelte-1fx5wwa {border-color:black !important;}\n }.prose.svelte-1fx5wwa p {margin:0.5em 0;}.prose.svelte-1fx5wwa strong {font-weight:600;}"
@@ -4175,10 +4332,10 @@ function Print($$anchor, $$props) {
4175
4332
  flushSync();
4176
4333
  }
4177
4334
  };
4178
- var div = root();
4335
+ var div = root_1();
4179
4336
  var node = child(div);
4180
4337
  var consequent = ($$anchor) => {
4181
- var div_1 = root_1();
4338
+ var div_1 = root();
4182
4339
  html(div_1, () => get(prompt), true);
4183
4340
  reset(div_1);
4184
4341
  append($$anchor, div_1);