@pie-element/mc-populated-blank 0.2.13 → 0.3.0-next.4

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 (61) hide show
  1. package/README.md +1 -1
  2. package/configure.js +2 -0
  3. package/dist/author/index.d.ts +0 -1
  4. package/dist/author/index.js +1235 -1092
  5. package/dist/author/index.js.map +1 -1
  6. package/dist/browser/author/index.js +50 -0
  7. package/dist/browser/author/index.js.map +1 -0
  8. package/dist/browser/client-BAfWqkS6.js +2358 -0
  9. package/dist/browser/client-BAfWqkS6.js.map +1 -0
  10. package/dist/browser/controller/index.js +219 -0
  11. package/dist/browser/controller/index.js.map +1 -0
  12. package/dist/browser/delivery/index.js +1059 -0
  13. package/dist/browser/delivery/index.js.map +1 -0
  14. package/dist/browser/layoutLimits-ATKOwLHb.js +42 -0
  15. package/dist/browser/layoutLimits-ATKOwLHb.js.map +1 -0
  16. package/dist/browser/print/index.js +125 -0
  17. package/dist/browser/print/index.js.map +1 -0
  18. package/dist/controller/defaults.d.ts +0 -2
  19. package/dist/controller/index.d.ts +0 -3
  20. package/dist/controller/index.js +0 -2
  21. package/dist/controller/index.js.map +1 -1
  22. package/dist/delivery/computeAudioMode.d.ts +0 -1
  23. package/dist/delivery/computeChoiceCorrectness.d.ts +0 -1
  24. package/dist/delivery/computeDisplayState.d.ts +0 -1
  25. package/dist/delivery/computeLayoutProfile.d.ts +0 -1
  26. package/dist/delivery/computeLayoutStyle.d.ts +0 -2
  27. package/dist/delivery/index.d.ts +0 -1
  28. package/dist/delivery/index.js +1527 -1584
  29. package/dist/delivery/index.js.map +1 -1
  30. package/dist/delivery/variant-css-map.d.ts +0 -1
  31. package/dist/index.d.ts +0 -1
  32. package/dist/index.iife.d.ts +0 -3
  33. package/dist/index.iife.js +14 -15
  34. package/dist/index.js +1527 -1584
  35. package/dist/index.js.map +1 -1
  36. package/dist/print/index.d.ts +0 -1
  37. package/dist/print/index.js +1414 -1270
  38. package/dist/print/index.js.map +1 -1
  39. package/dist/runtime-support.d.ts +12 -0
  40. package/dist/runtime-support.js +14 -0
  41. package/dist/runtime-support.js.map +1 -0
  42. package/dist/shared/layoutLimits.d.ts +0 -1
  43. package/dist/shared/types.d.ts +9 -2
  44. package/module/print.js +2312 -0
  45. package/module/print.js.map +1 -0
  46. package/package.json +40 -8
  47. package/dist/author/index.d.ts.map +0 -1
  48. package/dist/controller/defaults.d.ts.map +0 -1
  49. package/dist/controller/index.d.ts.map +0 -1
  50. package/dist/delivery/computeAudioMode.d.ts.map +0 -1
  51. package/dist/delivery/computeChoiceCorrectness.d.ts.map +0 -1
  52. package/dist/delivery/computeDisplayState.d.ts.map +0 -1
  53. package/dist/delivery/computeLayoutProfile.d.ts.map +0 -1
  54. package/dist/delivery/computeLayoutStyle.d.ts.map +0 -1
  55. package/dist/delivery/index.d.ts.map +0 -1
  56. package/dist/delivery/variant-css-map.d.ts.map +0 -1
  57. package/dist/index.d.ts.map +0 -1
  58. package/dist/index.iife.d.ts.map +0 -1
  59. package/dist/print/index.d.ts.map +0 -1
  60. package/dist/shared/layoutLimits.d.ts.map +0 -1
  61. package/dist/shared/types.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/disclose-version.js
1
+ //#region ../../../node_modules/.bun/svelte@5.56.8/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.5/node_modules/svelte/src/constants.js
7
+ //#region ../../../node_modules/.bun/svelte@5.56.8/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.5/node_modules/svelte/src/internal/shared/utils.js
13
+ //#region ../../../node_modules/.bun/svelte@5.56.8/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;
@@ -47,7 +47,7 @@ function deferred() {
47
47
  };
48
48
  }
49
49
  //#endregion
50
- //#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
50
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/typeof.js
51
51
  function _typeof(o) {
52
52
  "@babel/helpers - typeof";
53
53
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -57,7 +57,7 @@ function _typeof(o) {
57
57
  }, _typeof(o);
58
58
  }
59
59
  //#endregion
60
- //#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
60
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/toPrimitive.js
61
61
  function toPrimitive(t, r) {
62
62
  if ("object" != _typeof(t) || !t) return t;
63
63
  var e = t[Symbol.toPrimitive];
@@ -69,13 +69,13 @@ function toPrimitive(t, r) {
69
69
  return ("string" === r ? String : Number)(t);
70
70
  }
71
71
  //#endregion
72
- //#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
72
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/toPropertyKey.js
73
73
  function toPropertyKey(t) {
74
74
  var i = toPrimitive(t, "string");
75
75
  return "symbol" == _typeof(i) ? i : i + "";
76
76
  }
77
77
  //#endregion
78
- //#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
78
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/defineProperty.js
79
79
  function _defineProperty(e, r, t) {
80
80
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
81
81
  value: t,
@@ -114,6 +114,11 @@ var ERROR_VALUE = 1 << 23;
114
114
  var STATE_SYMBOL = Symbol("$state");
115
115
  var LEGACY_PROPS = Symbol("legacy props");
116
116
  var LOADING_ATTR_SYMBOL = Symbol("");
117
+ var ATTRIBUTES_CACHE = Symbol("attributes");
118
+ var CLASS_CACHE = Symbol("class");
119
+ var STYLE_CACHE = Symbol("style");
120
+ var TEXT_CACHE = Symbol("text");
121
+ var FORM_RESET_HANDLER = Symbol("form reset");
117
122
  /** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */
118
123
  var STALE_REACTION = new class StaleReactionError extends Error {
119
124
  constructor(..._args) {
@@ -124,7 +129,7 @@ var STALE_REACTION = new class StaleReactionError extends Error {
124
129
  }();
125
130
  var IS_XHTML = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
126
131
  //#endregion
127
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/errors.js
132
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/errors.js
128
133
  /**
129
134
  * Cannot create a `$derived(...)` with an `await` expression outside of an effect tree
130
135
  * @returns {never}
@@ -235,7 +240,7 @@ function svelte_boundary_reset_noop() {
235
240
  console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
236
241
  }
237
242
  //#endregion
238
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/hydration.js
243
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/hydration.js
239
244
  /** @import { TemplateNode } from '#client' */
240
245
  /**
241
246
  * Use this variable to guard everything related to hydration code so it can be treeshaken out
@@ -314,7 +319,7 @@ function read_hydration_instruction(node) {
314
319
  return node.data;
315
320
  }
316
321
  //#endregion
317
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/equality.js
322
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/equality.js
318
323
  /** @import { Equals } from '#client' */
319
324
  /** @type {Equals} */
320
325
  function equals(value) {
@@ -333,13 +338,13 @@ function safe_equals(value) {
333
338
  return !safe_not_equal(value, this.v);
334
339
  }
335
340
  //#endregion
336
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/flags/index.js
341
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/flags/index.js
337
342
  /** True if experimental.async=true */
338
343
  var async_mode_flag = false;
339
344
  /** True if we're not certain that we only have Svelte 5 code in the compilation */
340
345
  var legacy_mode_flag = false;
341
346
  //#endregion
342
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/context.js
347
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/context.js
343
348
  /** @import { ComponentContext, DevStackEntry, Effect } from '#client' */
344
349
  /** @type {ComponentContext | null} */
345
350
  var component_context = null;
@@ -391,7 +396,7 @@ function is_runes() {
391
396
  return !legacy_mode_flag || component_context !== null && component_context.l === null;
392
397
  }
393
398
  //#endregion
394
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/task.js
399
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/task.js
395
400
  /** @type {Array<() => void>} */
396
401
  var micro_tasks = [];
397
402
  function run_micro_tasks() {
@@ -434,6 +439,7 @@ function handle_error(error) {
434
439
  * @param {Effect | null} effect
435
440
  */
436
441
  function invoke_error_boundary(error, effect) {
442
+ if (effect !== null && (effect.f & 16384) !== 0) return;
437
443
  while (effect !== null) {
438
444
  if ((effect.f & 128) !== 0) {
439
445
  if ((effect.f & 32768) === 0) throw error;
@@ -449,7 +455,7 @@ function invoke_error_boundary(error, effect) {
449
455
  throw error;
450
456
  }
451
457
  //#endregion
452
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/status.js
458
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/status.js
453
459
  /** @import { Derived, Signal } from '#client' */
454
460
  var STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
455
461
  /**
@@ -468,7 +474,7 @@ function update_derived_status(derived) {
468
474
  else set_signal_status(derived, MAYBE_DIRTY);
469
475
  }
470
476
  //#endregion
471
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/utils.js
477
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/utils.js
472
478
  /** @import { Derived, Effect, Value } from '#client' */
473
479
  /**
474
480
  * @param {Value[] | null} deps
@@ -496,7 +502,7 @@ function defer_effect(effect, dirty_effects, maybe_dirty_effects) {
496
502
  set_signal_status(effect, CLEAN);
497
503
  }
498
504
  //#endregion
499
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/store.js
505
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/store.js
500
506
  /**
501
507
  * We set this to `true` when updating a store so that we correctly
502
508
  * schedule effects if the update takes place inside a `$:` effect
@@ -526,1375 +532,1517 @@ function capture_store_binding(fn) {
526
532
  }
527
533
  }
528
534
  //#endregion
529
- //#region \0@oxc-project+runtime@0.129.0/helpers/checkPrivateRedeclaration.js
535
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/misc.js
536
+ var listening_to_form_reset = false;
537
+ function add_form_reset_listener() {
538
+ if (!listening_to_form_reset) {
539
+ listening_to_form_reset = true;
540
+ document.addEventListener("reset", (evt) => {
541
+ Promise.resolve().then(() => {
542
+ if (!evt.defaultPrevented) for (const e of evt.target.elements)
543
+ /** @type {any} */ e[FORM_RESET_HANDLER]?.();
544
+ });
545
+ }, { capture: true });
546
+ }
547
+ }
548
+ //#endregion
549
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
550
+ /**
551
+ * @template T
552
+ * @param {() => T} fn
553
+ */
554
+ function without_reactive_context(fn) {
555
+ var previous_reaction = active_reaction;
556
+ var previous_effect = active_effect;
557
+ set_active_reaction(null);
558
+ set_active_effect(null);
559
+ try {
560
+ return fn();
561
+ } finally {
562
+ set_active_reaction(previous_reaction);
563
+ set_active_effect(previous_effect);
564
+ }
565
+ }
566
+ //#endregion
567
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/reactivity/create-subscriber.js
568
+ /**
569
+ * Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
570
+ * It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
571
+ *
572
+ * If `subscribe` is called inside an effect (including indirectly, for example inside a getter),
573
+ * the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.
574
+ *
575
+ * If `start` returns a cleanup function, it will be called when the effect is destroyed.
576
+ *
577
+ * If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects
578
+ * are active, and the returned teardown function will only be called when all effects are destroyed.
579
+ *
580
+ * It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):
581
+ *
582
+ * ```js
583
+ * import { createSubscriber } from 'svelte/reactivity';
584
+ * import { on } from 'svelte/events';
585
+ *
586
+ * export class MediaQuery {
587
+ * #query;
588
+ * #subscribe;
589
+ *
590
+ * constructor(query) {
591
+ * this.#query = window.matchMedia(`(${query})`);
592
+ *
593
+ * this.#subscribe = createSubscriber((update) => {
594
+ * // when the `change` event occurs, re-run any effects that read `this.current`
595
+ * const off = on(this.#query, 'change', update);
596
+ *
597
+ * // stop listening when all the effects are destroyed
598
+ * return () => off();
599
+ * });
600
+ * }
601
+ *
602
+ * get current() {
603
+ * // This makes the getter reactive, if read in an effect
604
+ * this.#subscribe();
605
+ *
606
+ * // Return the current state of the query, whether or not we're in an effect
607
+ * return this.#query.matches;
608
+ * }
609
+ * }
610
+ * ```
611
+ * @param {(update: () => void) => (() => void) | void} start
612
+ * @since 5.7.0
613
+ */
614
+ function createSubscriber(start) {
615
+ let subscribers = 0;
616
+ let version = source(0);
617
+ /** @type {(() => void) | void} */
618
+ let stop;
619
+ return () => {
620
+ if (effect_tracking()) {
621
+ get(version);
622
+ render_effect(() => {
623
+ if (subscribers === 0) stop = untrack(() => start(() => increment(version)));
624
+ subscribers += 1;
625
+ return () => {
626
+ queue_micro_task(() => {
627
+ subscribers -= 1;
628
+ if (subscribers === 0) {
629
+ stop?.();
630
+ stop = void 0;
631
+ increment(version);
632
+ }
633
+ });
634
+ };
635
+ });
636
+ }
637
+ };
638
+ }
639
+ //#endregion
640
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/checkPrivateRedeclaration.js
530
641
  function _checkPrivateRedeclaration(e, t) {
531
642
  if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
532
643
  }
533
644
  //#endregion
534
- //#region \0@oxc-project+runtime@0.129.0/helpers/classPrivateMethodInitSpec.js
645
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateMethodInitSpec.js
535
646
  function _classPrivateMethodInitSpec(e, a) {
536
647
  _checkPrivateRedeclaration(e, a), a.add(e);
537
648
  }
538
649
  //#endregion
539
- //#region \0@oxc-project+runtime@0.129.0/helpers/classPrivateFieldInitSpec.js
650
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldInitSpec.js
540
651
  function _classPrivateFieldInitSpec(e, t, a) {
541
652
  _checkPrivateRedeclaration(e, t), t.set(e, a);
542
653
  }
543
654
  //#endregion
544
- //#region \0@oxc-project+runtime@0.129.0/helpers/assertClassBrand.js
655
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/assertClassBrand.js
545
656
  function _assertClassBrand(e, t, n) {
546
657
  if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
547
658
  throw new TypeError("Private element is not present on this object");
548
659
  }
549
660
  //#endregion
550
- //#region \0@oxc-project+runtime@0.129.0/helpers/classPrivateFieldGet2.js
551
- function _classPrivateFieldGet2(s, a) {
552
- return s.get(_assertClassBrand(s, a));
553
- }
554
- //#endregion
555
- //#region \0@oxc-project+runtime@0.129.0/helpers/classPrivateFieldSet2.js
661
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldSet2.js
556
662
  function _classPrivateFieldSet2(s, a, r) {
557
663
  return s.set(_assertClassBrand(s, a), r), r;
558
664
  }
559
665
  //#endregion
560
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/batch.js
561
- /** @import { Fork } from 'svelte' */
562
- /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
563
- var _Batch;
564
- /** @type {Set<Batch>} */
565
- var batches = /* @__PURE__ */ new Set();
566
- /** @type {Batch | null} */
567
- var current_batch = null;
568
- /**
569
- * When time travelling (i.e. working in one batch, while other batches
570
- * still have ongoing work), we ignore the real values of affected
571
- * signals in favour of their values within the batch
572
- * @type {Map<Value, any> | null}
573
- */
574
- var batch_values = null;
575
- /** @type {Effect | null} */
576
- var last_scheduled_effect = null;
577
- var is_flushing_sync = false;
578
- var is_processing = false;
666
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/classPrivateFieldGet2.js
667
+ function _classPrivateFieldGet2(s, a) {
668
+ return s.get(_assertClassBrand(s, a));
669
+ }
670
+ //#endregion
671
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
672
+ /** @import { Effect, Source, TemplateNode, } from '#client' */
579
673
  /**
580
- * During traversal, this is an array. Newly created effects are (if not immediately
581
- * executed) pushed to this array, rather than going through the scheduling
582
- * rigamarole that would cause another turn of the flush loop.
583
- * @type {Effect[] | null}
674
+ * @typedef {{
675
+ * onerror?: ((error: unknown, reset: () => void) => void) | null;
676
+ * failed?: ((anchor: Node, error: () => unknown, reset: () => () => void) => void) | null;
677
+ * pending?: ((anchor: Node) => void) | null;
678
+ * }} BoundaryProps
584
679
  */
585
- var collected_effects = null;
680
+ var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;
586
681
  /**
587
- * An array of effects that are marked during traversal as a result of a `set`
588
- * (not `internal_set`) call. These will be added to the next batch and
589
- * trigger another `batch.process()`
590
- * @type {Effect[] | null}
591
- * @deprecated when we get rid of legacy mode and stores, we can get rid of this
682
+ * @param {TemplateNode} node
683
+ * @param {BoundaryProps} props
684
+ * @param {((anchor: Node) => void)} children
685
+ * @param {((error: unknown) => unknown) | undefined} [transform_error]
686
+ * @returns {void}
592
687
  */
593
- var legacy_updates = null;
594
- var flush_count = 0;
595
- var uid = 1;
596
- var _commit_callbacks = /* @__PURE__ */ new WeakMap();
597
- var _discard_callbacks = /* @__PURE__ */ new WeakMap();
598
- var _fork_commit_callbacks = /* @__PURE__ */ new WeakMap();
599
- var _pending = /* @__PURE__ */ new WeakMap();
600
- var _blocking_pending = /* @__PURE__ */ new WeakMap();
601
- var _deferred = /* @__PURE__ */ new WeakMap();
602
- var _roots = /* @__PURE__ */ new WeakMap();
603
- var _new_effects = /* @__PURE__ */ new WeakMap();
688
+ function boundary(node, props, children, transform_error) {
689
+ new Boundary(node, props, children, transform_error);
690
+ }
691
+ var _anchor = /* @__PURE__ */ new WeakMap();
692
+ var _hydrate_open = /* @__PURE__ */ new WeakMap();
693
+ var _props = /* @__PURE__ */ new WeakMap();
694
+ var _children = /* @__PURE__ */ new WeakMap();
695
+ var _effect = /* @__PURE__ */ new WeakMap();
696
+ var _main_effect = /* @__PURE__ */ new WeakMap();
697
+ var _pending_effect = /* @__PURE__ */ new WeakMap();
698
+ var _failed_effect = /* @__PURE__ */ new WeakMap();
699
+ var _offscreen_fragment = /* @__PURE__ */ new WeakMap();
700
+ var _local_pending_count = /* @__PURE__ */ new WeakMap();
701
+ var _pending_count = /* @__PURE__ */ new WeakMap();
702
+ var _pending_count_update_queued = /* @__PURE__ */ new WeakMap();
604
703
  var _dirty_effects$1 = /* @__PURE__ */ new WeakMap();
605
704
  var _maybe_dirty_effects$1 = /* @__PURE__ */ new WeakMap();
606
- var _skipped_branches = /* @__PURE__ */ new WeakMap();
607
- var _unskipped_branches = /* @__PURE__ */ new WeakMap();
608
- var _decrement_queued = /* @__PURE__ */ new WeakMap();
609
- var _blockers = /* @__PURE__ */ new WeakMap();
610
- var _Batch_brand = /* @__PURE__ */ new WeakSet();
611
- var Batch = class Batch {
612
- constructor() {
613
- _classPrivateMethodInitSpec(this, _Batch_brand);
614
- _defineProperty(this, "id", uid++);
705
+ var _effect_pending = /* @__PURE__ */ new WeakMap();
706
+ var _effect_pending_subscriber = /* @__PURE__ */ new WeakMap();
707
+ var _Boundary_brand = /* @__PURE__ */ new WeakSet();
708
+ var Boundary = class {
709
+ /**
710
+ * @param {TemplateNode} node
711
+ * @param {BoundaryProps} props
712
+ * @param {((anchor: Node) => void)} children
713
+ * @param {((error: unknown) => unknown) | undefined} [transform_error]
714
+ */
715
+ constructor(node, props, children, transform_error) {
716
+ _classPrivateMethodInitSpec(this, _Boundary_brand);
615
717
  _defineProperty(
616
718
  this,
617
- /**
618
- * The current values of any signals that are updated in this batch.
619
- * Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment)
620
- * They keys of this map are identical to `this.#previous`
621
- * @type {Map<Value, [any, boolean]>}
622
- */
623
- "current",
624
- /* @__PURE__ */ new Map()
719
+ /** @type {Boundary | null} */
720
+ "parent",
721
+ void 0
625
722
  );
723
+ _defineProperty(this, "is_pending", false);
626
724
  _defineProperty(
627
725
  this,
628
726
  /**
629
- * The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place.
630
- * They keys of this map are identical to `this.#current`
631
- * @type {Map<Value, any>}
727
+ * API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
728
+ * Inherited from parent boundary, or defaults to identity.
729
+ * @type {(error: unknown) => unknown}
632
730
  */
633
- "previous",
634
- /* @__PURE__ */ new Map()
731
+ "transform_error",
732
+ void 0
635
733
  );
636
- _classPrivateFieldInitSpec(this, _commit_callbacks, /* @__PURE__ */ new Set());
637
- _classPrivateFieldInitSpec(this, _discard_callbacks, /* @__PURE__ */ new Set());
638
- _classPrivateFieldInitSpec(this, _fork_commit_callbacks, /* @__PURE__ */ new Set());
639
- _classPrivateFieldInitSpec(this, _pending, /* @__PURE__ */ new Map());
640
- _classPrivateFieldInitSpec(this, _blocking_pending, /* @__PURE__ */ new Map());
641
- _classPrivateFieldInitSpec(this, _deferred, null);
642
- _classPrivateFieldInitSpec(this, _roots, []);
643
- _classPrivateFieldInitSpec(this, _new_effects, []);
734
+ _classPrivateFieldInitSpec(this, _anchor, void 0);
735
+ _classPrivateFieldInitSpec(this, _hydrate_open, hydrating ? hydrate_node : null);
736
+ _classPrivateFieldInitSpec(this, _props, void 0);
737
+ _classPrivateFieldInitSpec(this, _children, void 0);
738
+ _classPrivateFieldInitSpec(this, _effect, void 0);
739
+ _classPrivateFieldInitSpec(this, _main_effect, null);
740
+ _classPrivateFieldInitSpec(this, _pending_effect, null);
741
+ _classPrivateFieldInitSpec(this, _failed_effect, null);
742
+ _classPrivateFieldInitSpec(this, _offscreen_fragment, null);
743
+ _classPrivateFieldInitSpec(this, _local_pending_count, 0);
744
+ _classPrivateFieldInitSpec(this, _pending_count, 0);
745
+ _classPrivateFieldInitSpec(this, _pending_count_update_queued, false);
644
746
  _classPrivateFieldInitSpec(this, _dirty_effects$1, /* @__PURE__ */ new Set());
645
747
  _classPrivateFieldInitSpec(this, _maybe_dirty_effects$1, /* @__PURE__ */ new Set());
646
- _classPrivateFieldInitSpec(this, _skipped_branches, /* @__PURE__ */ new Map());
647
- _classPrivateFieldInitSpec(this, _unskipped_branches, /* @__PURE__ */ new Set());
648
- _defineProperty(this, "is_fork", false);
649
- _classPrivateFieldInitSpec(this, _decrement_queued, false);
650
- _classPrivateFieldInitSpec(this, _blockers, /* @__PURE__ */ new Set());
651
- }
652
- /**
653
- * Add an effect to the #skipped_branches map and reset its children
654
- * @param {Effect} effect
655
- */
656
- skip_effect(effect) {
657
- if (!_classPrivateFieldGet2(_skipped_branches, this).has(effect)) _classPrivateFieldGet2(_skipped_branches, this).set(effect, {
658
- d: [],
659
- m: []
748
+ _classPrivateFieldInitSpec(this, _effect_pending, null);
749
+ _classPrivateFieldInitSpec(this, _effect_pending_subscriber, createSubscriber(() => {
750
+ _classPrivateFieldSet2(_effect_pending, this, source(_classPrivateFieldGet2(_local_pending_count, this)));
751
+ return () => {
752
+ _classPrivateFieldSet2(_effect_pending, this, null);
753
+ };
754
+ }));
755
+ _classPrivateFieldSet2(_anchor, this, node);
756
+ _classPrivateFieldSet2(_props, this, props);
757
+ _classPrivateFieldSet2(_children, this, (anchor) => {
758
+ var effect = active_effect;
759
+ effect.b = this;
760
+ effect.f |= 128;
761
+ children(anchor);
660
762
  });
661
- _classPrivateFieldGet2(_unskipped_branches, this).delete(effect);
763
+ this.parent = active_effect.b;
764
+ this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
765
+ _classPrivateFieldSet2(_effect, this, block(() => {
766
+ if (hydrating) {
767
+ const comment = _classPrivateFieldGet2(_hydrate_open, this);
768
+ hydrate_next();
769
+ const server_rendered_pending = comment.data === "[!";
770
+ if (comment.data.startsWith("[?")) {
771
+ const serialized_error = JSON.parse(comment.data.slice(2));
772
+ _assertClassBrand(_Boundary_brand, this, _hydrate_failed_content).call(this, serialized_error);
773
+ } else if (server_rendered_pending) _assertClassBrand(_Boundary_brand, this, _hydrate_pending_content).call(this);
774
+ else _assertClassBrand(_Boundary_brand, this, _hydrate_resolved_content).call(this);
775
+ } else _assertClassBrand(_Boundary_brand, this, _render).call(this);
776
+ }, flags));
777
+ if (hydrating) _classPrivateFieldSet2(_anchor, this, hydrate_node);
662
778
  }
663
779
  /**
664
- * Remove an effect from the #skipped_branches map and reschedule
665
- * any tracked dirty/maybe_dirty child effects
780
+ * Defer an effect inside a pending boundary until the boundary resolves
666
781
  * @param {Effect} effect
667
- * @param {(e: Effect) => void} callback
668
- */
669
- unskip_effect(effect, callback = (e) => this.schedule(e)) {
670
- var tracked = _classPrivateFieldGet2(_skipped_branches, this).get(effect);
671
- if (tracked) {
672
- _classPrivateFieldGet2(_skipped_branches, this).delete(effect);
673
- for (var e of tracked.d) {
674
- set_signal_status(e, DIRTY);
675
- callback(e);
676
- }
677
- for (e of tracked.m) {
678
- set_signal_status(e, MAYBE_DIRTY);
679
- callback(e);
680
- }
681
- }
682
- _classPrivateFieldGet2(_unskipped_branches, this).add(effect);
683
- }
684
- /**
685
- * Associate a change to a given source with the current
686
- * batch, noting its previous and current values
687
- * @param {Value} source
688
- * @param {any} value
689
- * @param {boolean} [is_derived]
690
782
  */
691
- capture(source, value, is_derived = false) {
692
- if (source.v !== UNINITIALIZED && !this.previous.has(source)) this.previous.set(source, source.v);
693
- if ((source.f & 8388608) === 0) {
694
- this.current.set(source, [value, is_derived]);
695
- batch_values?.set(source, value);
696
- }
697
- if (!this.is_fork) source.v = value;
698
- }
699
- activate() {
700
- current_batch = this;
701
- }
702
- deactivate() {
703
- current_batch = null;
704
- batch_values = null;
705
- }
706
- flush() {
707
- try {
708
- is_processing = true;
709
- current_batch = this;
710
- _assertClassBrand(_Batch_brand, this, _process).call(this);
711
- } finally {
712
- flush_count = 0;
713
- last_scheduled_effect = null;
714
- collected_effects = null;
715
- legacy_updates = null;
716
- is_processing = false;
717
- current_batch = null;
718
- batch_values = null;
719
- old_values.clear();
720
- }
721
- }
722
- discard() {
723
- for (const fn of _classPrivateFieldGet2(_discard_callbacks, this)) fn(this);
724
- _classPrivateFieldGet2(_discard_callbacks, this).clear();
725
- _classPrivateFieldGet2(_fork_commit_callbacks, this).clear();
726
- batches.delete(this);
783
+ defer_effect(effect) {
784
+ defer_effect(effect, _classPrivateFieldGet2(_dirty_effects$1, this), _classPrivateFieldGet2(_maybe_dirty_effects$1, this));
727
785
  }
728
786
  /**
729
- * @param {Effect} effect
787
+ * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
788
+ * @returns {boolean}
730
789
  */
731
- register_created_effect(effect) {
732
- _classPrivateFieldGet2(_new_effects, this).push(effect);
790
+ is_rendered() {
791
+ return !this.is_pending && (!this.parent || this.parent.is_rendered());
733
792
  }
734
- /**
735
- * @param {boolean} blocking
736
- * @param {Effect} effect
737
- */
738
- increment(blocking, effect) {
739
- let pending_count = _classPrivateFieldGet2(_pending, this).get(effect) ?? 0;
740
- _classPrivateFieldGet2(_pending, this).set(effect, pending_count + 1);
741
- if (blocking) {
742
- let blocking_pending_count = _classPrivateFieldGet2(_blocking_pending, this).get(effect) ?? 0;
743
- _classPrivateFieldGet2(_blocking_pending, this).set(effect, blocking_pending_count + 1);
744
- }
793
+ has_pending_snippet() {
794
+ return !!_classPrivateFieldGet2(_props, this).pending;
745
795
  }
746
796
  /**
747
- * @param {boolean} blocking
748
- * @param {Effect} effect
749
- * @param {boolean} skip - whether to skip updates (because this is triggered by a stale reaction)
797
+ * Update the source that powers `$effect.pending()` inside this boundary,
798
+ * and controls when the current `pending` snippet (if any) is removed.
799
+ * Do not call from inside the class
800
+ * @param {1 | -1} d
801
+ * @param {Batch} batch
750
802
  */
751
- decrement(blocking, effect, skip) {
752
- let pending_count = _classPrivateFieldGet2(_pending, this).get(effect) ?? 0;
753
- if (pending_count === 1) _classPrivateFieldGet2(_pending, this).delete(effect);
754
- else _classPrivateFieldGet2(_pending, this).set(effect, pending_count - 1);
755
- if (blocking) {
756
- let blocking_pending_count = _classPrivateFieldGet2(_blocking_pending, this).get(effect) ?? 0;
757
- if (blocking_pending_count === 1) _classPrivateFieldGet2(_blocking_pending, this).delete(effect);
758
- else _classPrivateFieldGet2(_blocking_pending, this).set(effect, blocking_pending_count - 1);
759
- }
760
- if (_classPrivateFieldGet2(_decrement_queued, this) || skip) return;
761
- _classPrivateFieldSet2(_decrement_queued, this, true);
803
+ update_pending_count(d, batch) {
804
+ _assertClassBrand(_Boundary_brand, this, _update_pending_count).call(this, d, batch);
805
+ _classPrivateFieldSet2(_local_pending_count, this, _classPrivateFieldGet2(_local_pending_count, this) + d);
806
+ if (!_classPrivateFieldGet2(_effect_pending, this) || _classPrivateFieldGet2(_pending_count_update_queued, this)) return;
807
+ _classPrivateFieldSet2(_pending_count_update_queued, this, true);
762
808
  queue_micro_task(() => {
763
- _classPrivateFieldSet2(_decrement_queued, this, false);
764
- this.flush();
809
+ _classPrivateFieldSet2(_pending_count_update_queued, this, false);
810
+ if (_classPrivateFieldGet2(_effect_pending, this)) internal_set(_classPrivateFieldGet2(_effect_pending, this), _classPrivateFieldGet2(_local_pending_count, this));
765
811
  });
766
812
  }
767
- /**
768
- * @param {Set<Effect>} dirty_effects
769
- * @param {Set<Effect>} maybe_dirty_effects
770
- */
771
- transfer_effects(dirty_effects, maybe_dirty_effects) {
772
- for (const e of dirty_effects) _classPrivateFieldGet2(_dirty_effects$1, this).add(e);
773
- for (const e of maybe_dirty_effects) _classPrivateFieldGet2(_maybe_dirty_effects$1, this).add(e);
774
- dirty_effects.clear();
775
- maybe_dirty_effects.clear();
776
- }
777
- /** @param {(batch: Batch) => void} fn */
778
- oncommit(fn) {
779
- _classPrivateFieldGet2(_commit_callbacks, this).add(fn);
780
- }
781
- /** @param {(batch: Batch) => void} fn */
782
- ondiscard(fn) {
783
- _classPrivateFieldGet2(_discard_callbacks, this).add(fn);
784
- }
785
- /** @param {(batch: Batch) => void} fn */
786
- on_fork_commit(fn) {
787
- _classPrivateFieldGet2(_fork_commit_callbacks, this).add(fn);
788
- }
789
- run_fork_commit_callbacks() {
790
- for (const fn of _classPrivateFieldGet2(_fork_commit_callbacks, this)) fn(this);
791
- _classPrivateFieldGet2(_fork_commit_callbacks, this).clear();
813
+ get_effect_pending() {
814
+ _classPrivateFieldGet2(_effect_pending_subscriber, this).call(this);
815
+ return get(_classPrivateFieldGet2(_effect_pending, this));
792
816
  }
793
- settled() {
794
- return (_classPrivateFieldGet2(_deferred, this) ?? _classPrivateFieldSet2(_deferred, this, deferred())).promise;
817
+ /** @param {unknown} error */
818
+ error(error) {
819
+ if (!_classPrivateFieldGet2(_props, this).onerror && !_classPrivateFieldGet2(_props, this).failed) throw error;
820
+ if (current_batch?.is_fork) {
821
+ if (_classPrivateFieldGet2(_main_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_main_effect, this));
822
+ if (_classPrivateFieldGet2(_pending_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_pending_effect, this));
823
+ if (_classPrivateFieldGet2(_failed_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_failed_effect, this));
824
+ current_batch.oncommit(() => {
825
+ _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
826
+ });
827
+ } else _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
795
828
  }
796
- static ensure() {
797
- if (current_batch === null) {
798
- const batch = current_batch = new Batch();
799
- if (!is_processing) {
800
- batches.add(current_batch);
801
- if (!is_flushing_sync) queue_micro_task(() => {
802
- if (current_batch !== batch) return;
803
- batch.flush();
804
- });
805
- }
806
- }
807
- return current_batch;
829
+ };
830
+ function _hydrate_resolved_content() {
831
+ try {
832
+ _classPrivateFieldSet2(_main_effect, this, branch(() => _classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this))));
833
+ } catch (error) {
834
+ this.error(error);
808
835
  }
809
- apply() {
810
- if (!async_mode_flag || !this.is_fork && batches.size === 1) {
811
- batch_values = null;
836
+ }
837
+ /**
838
+ * @param {unknown} error The deserialized error from the server's hydration comment
839
+ */
840
+ function _hydrate_failed_content(error) {
841
+ const failed = _classPrivateFieldGet2(_props, this).failed;
842
+ const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, error);
843
+ queue_micro_task(invoke_onerror);
844
+ if (!failed) return;
845
+ _classPrivateFieldSet2(_failed_effect, this, branch(() => {
846
+ failed(_classPrivateFieldGet2(_anchor, this), () => error, () => reset);
847
+ }));
848
+ }
849
+ /**
850
+ * Creates the `reset` function for a failed boundary, along with a function
851
+ * that invokes `onerror` with it (if provided)
852
+ * @param {unknown} error
853
+ * @returns {{ reset: () => void, invoke_onerror: () => void }}
854
+ */
855
+ function _create_reset(error) {
856
+ var did_reset = false;
857
+ var calling_on_error = false;
858
+ const reset = () => {
859
+ if (did_reset) {
860
+ svelte_boundary_reset_noop();
812
861
  return;
813
862
  }
814
- batch_values = /* @__PURE__ */ new Map();
815
- for (const [source, [value]] of this.current) batch_values.set(source, value);
816
- for (const batch of batches) {
817
- if (batch === this || batch.is_fork) continue;
818
- var intersects = false;
819
- var differs = false;
820
- if (batch.id < this.id) for (const [source, [, is_derived]] of batch.current) {
821
- if (is_derived) continue;
822
- intersects || (intersects = this.current.has(source));
823
- differs || (differs = !this.current.has(source));
824
- }
825
- if (intersects && differs) _classPrivateFieldGet2(_blockers, this).add(batch);
826
- else for (const [source, previous] of batch.previous) if (!batch_values.has(source)) batch_values.set(source, previous);
827
- }
828
- }
829
- /**
830
- *
831
- * @param {Effect} effect
832
- */
833
- schedule(effect) {
834
- last_scheduled_effect = effect;
835
- if (effect.b?.is_pending && (effect.f & 16777228) !== 0 && (effect.f & 32768) === 0) {
836
- effect.b.defer_effect(effect);
837
- return;
863
+ did_reset = true;
864
+ if (calling_on_error) svelte_boundary_reset_onerror();
865
+ if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
866
+ _classPrivateFieldSet2(_failed_effect, this, null);
867
+ });
868
+ _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
869
+ _assertClassBrand(_Boundary_brand, this, _render).call(this);
870
+ });
871
+ };
872
+ const invoke_onerror = () => {
873
+ try {
874
+ calling_on_error = true;
875
+ _classPrivateFieldGet2(_props, this).onerror?.(error, reset);
876
+ calling_on_error = false;
877
+ } catch (err) {
878
+ invoke_error_boundary(err, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
838
879
  }
839
- var e = effect;
840
- while (e.parent !== null) {
841
- e = e.parent;
842
- var flags = e.f;
843
- if (collected_effects !== null && e === active_effect) {
844
- if (async_mode_flag) return;
845
- if ((active_reaction === null || (active_reaction.f & 2) === 0) && !legacy_is_updating_store) return;
846
- }
847
- if ((flags & 96) !== 0) {
848
- if ((flags & 1024) === 0) return;
849
- e.f ^= CLEAN;
850
- }
880
+ };
881
+ return {
882
+ reset,
883
+ invoke_onerror
884
+ };
885
+ }
886
+ function _hydrate_pending_content() {
887
+ const pending = _classPrivateFieldGet2(_props, this).pending;
888
+ if (!pending) return;
889
+ this.is_pending = true;
890
+ _classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
891
+ queue_micro_task(() => {
892
+ var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
893
+ var anchor = create_text();
894
+ fragment.append(anchor);
895
+ _classPrivateFieldSet2(_main_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
896
+ return branch(() => _classPrivateFieldGet2(_children, this).call(this, anchor));
897
+ }));
898
+ if (_classPrivateFieldGet2(_pending_count, this) === 0) {
899
+ _classPrivateFieldGet2(_anchor, this).before(fragment);
900
+ _classPrivateFieldSet2(_offscreen_fragment, this, null);
901
+ pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
902
+ _classPrivateFieldSet2(_pending_effect, this, null);
903
+ });
904
+ _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
851
905
  }
852
- _classPrivateFieldGet2(_roots, this).push(e);
853
- }
854
- };
855
- _Batch = Batch;
856
- function _is_deferred() {
857
- return this.is_fork || _classPrivateFieldGet2(_blocking_pending, this).size > 0;
906
+ });
858
907
  }
859
- function _is_blocked() {
860
- for (const batch of _classPrivateFieldGet2(_blockers, this)) for (const effect of _classPrivateFieldGet2(_blocking_pending, batch).keys()) {
861
- var skipped = false;
862
- var e = effect;
863
- while (e.parent !== null) {
864
- if (_classPrivateFieldGet2(_skipped_branches, this).has(e)) {
865
- skipped = true;
866
- break;
867
- }
868
- e = e.parent;
869
- }
870
- if (!skipped) return true;
908
+ function _render() {
909
+ try {
910
+ this.is_pending = this.has_pending_snippet();
911
+ _classPrivateFieldSet2(_pending_count, this, 0);
912
+ _classPrivateFieldSet2(_local_pending_count, this, 0);
913
+ _classPrivateFieldSet2(_main_effect, this, branch(() => {
914
+ _classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this));
915
+ }));
916
+ if (_classPrivateFieldGet2(_pending_count, this) > 0) {
917
+ var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
918
+ move_effect(_classPrivateFieldGet2(_main_effect, this), fragment);
919
+ const pending = _classPrivateFieldGet2(_props, this).pending;
920
+ _classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
921
+ } else _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
922
+ } catch (error) {
923
+ this.error(error);
871
924
  }
872
- return false;
873
925
  }
874
- function _process() {
875
- if (flush_count++ > 1e3) {
876
- batches.delete(this);
877
- infinite_loop_guard();
878
- }
879
- if (!_assertClassBrand(_Batch_brand, this, _is_deferred).call(this)) {
880
- for (const e of _classPrivateFieldGet2(_dirty_effects$1, this)) {
881
- _classPrivateFieldGet2(_maybe_dirty_effects$1, this).delete(e);
882
- set_signal_status(e, DIRTY);
883
- this.schedule(e);
884
- }
885
- for (const e of _classPrivateFieldGet2(_maybe_dirty_effects$1, this)) {
886
- set_signal_status(e, MAYBE_DIRTY);
887
- this.schedule(e);
888
- }
889
- }
890
- const roots = _classPrivateFieldGet2(_roots, this);
891
- _classPrivateFieldSet2(_roots, this, []);
892
- this.apply();
893
- /** @type {Effect[]} */
894
- var effects = collected_effects = [];
895
- /** @type {Effect[]} */
896
- var render_effects = [];
897
- /**
898
- * @type {Effect[]}
899
- * @deprecated when we get rid of legacy mode and stores, we can get rid of this
900
- */
901
- var updates = legacy_updates = [];
902
- for (const root of roots) try {
903
- _assertClassBrand(_Batch_brand, this, _traverse).call(this, root, effects, render_effects);
904
- } catch (e) {
905
- reset_all(root);
906
- throw e;
907
- }
908
- current_batch = null;
909
- if (updates.length > 0) {
910
- var batch = _Batch.ensure();
911
- for (const e of updates) batch.schedule(e);
912
- }
913
- collected_effects = null;
914
- legacy_updates = null;
915
- if (_assertClassBrand(_Batch_brand, this, _is_deferred).call(this) || _assertClassBrand(_Batch_brand, this, _is_blocked).call(this)) {
916
- _assertClassBrand(_Batch_brand, this, _defer_effects).call(this, render_effects);
917
- _assertClassBrand(_Batch_brand, this, _defer_effects).call(this, effects);
918
- for (const [e, t] of _classPrivateFieldGet2(_skipped_branches, this)) reset_branch(e, t);
919
- } else {
920
- if (_classPrivateFieldGet2(_pending, this).size === 0) batches.delete(this);
921
- _classPrivateFieldGet2(_dirty_effects$1, this).clear();
922
- _classPrivateFieldGet2(_maybe_dirty_effects$1, this).clear();
923
- for (const fn of _classPrivateFieldGet2(_commit_callbacks, this)) fn(this);
924
- _classPrivateFieldGet2(_commit_callbacks, this).clear();
925
- flush_queued_effects(render_effects);
926
- flush_queued_effects(effects);
927
- _classPrivateFieldGet2(_deferred, this)?.resolve();
928
- }
929
- var next_batch = current_batch;
930
- if (_classPrivateFieldGet2(_roots, this).length > 0) {
931
- const batch = next_batch ?? (next_batch = this);
932
- _classPrivateFieldGet2(_roots, batch).push(..._classPrivateFieldGet2(_roots, this).filter((r) => !_classPrivateFieldGet2(_roots, batch).includes(r)));
933
- }
934
- if (next_batch !== null) {
935
- batches.add(next_batch);
936
- _assertClassBrand(_Batch_brand, next_batch, _process).call(next_batch);
937
- }
938
- if (async_mode_flag && !batches.has(this)) _assertClassBrand(_Batch_brand, this, _commit$1).call(this);
926
+ /**
927
+ * @param {Batch} batch
928
+ */
929
+ function _resolve(batch) {
930
+ this.is_pending = false;
931
+ batch.transfer_effects(_classPrivateFieldGet2(_dirty_effects$1, this), _classPrivateFieldGet2(_maybe_dirty_effects$1, this));
939
932
  }
940
933
  /**
941
- * Traverse the effect tree, executing effects or stashing
942
- * them for later execution as appropriate
943
- * @param {Effect} root
944
- * @param {Effect[]} effects
945
- * @param {Effect[]} render_effects
934
+ * @template T
935
+ * @param {() => T} fn
946
936
  */
947
- function _traverse(root, effects, render_effects) {
948
- root.f ^= CLEAN;
949
- var effect = root.first;
950
- while (effect !== null) {
951
- var flags = effect.f;
952
- var is_branch = (flags & 96) !== 0;
953
- if (!(is_branch && (flags & 1024) !== 0 || (flags & 8192) !== 0 || _classPrivateFieldGet2(_skipped_branches, this).has(effect)) && effect.fn !== null) {
954
- if (is_branch) effect.f ^= CLEAN;
955
- else if ((flags & 4) !== 0) effects.push(effect);
956
- else if (async_mode_flag && (flags & 16777224) !== 0) render_effects.push(effect);
957
- else if (is_dirty(effect)) {
958
- if ((flags & 16) !== 0) _classPrivateFieldGet2(_maybe_dirty_effects$1, this).add(effect);
959
- update_effect(effect);
960
- }
961
- var child = effect.first;
962
- if (child !== null) {
963
- effect = child;
964
- continue;
965
- }
966
- }
967
- while (effect !== null) {
968
- var next = effect.next;
969
- if (next !== null) {
970
- effect = next;
971
- break;
972
- }
973
- effect = effect.parent;
974
- }
937
+ function _run(fn) {
938
+ var previous_effect = active_effect;
939
+ var previous_reaction = active_reaction;
940
+ var previous_ctx = component_context;
941
+ set_active_effect(_classPrivateFieldGet2(_effect, this));
942
+ set_active_reaction(_classPrivateFieldGet2(_effect, this));
943
+ set_component_context(_classPrivateFieldGet2(_effect, this).ctx);
944
+ try {
945
+ Batch.ensure();
946
+ return fn();
947
+ } catch (e) {
948
+ handle_error(e);
949
+ return null;
950
+ } finally {
951
+ set_active_effect(previous_effect);
952
+ set_active_reaction(previous_reaction);
953
+ set_component_context(previous_ctx);
975
954
  }
976
955
  }
977
956
  /**
978
- * @param {Effect[]} effects
957
+ * Updates the pending count associated with the currently visible pending snippet,
958
+ * if any, such that we can replace the snippet with content once work is done
959
+ * @param {1 | -1} d
960
+ * @param {Batch} batch
979
961
  */
980
- function _defer_effects(effects) {
981
- for (var i = 0; i < effects.length; i += 1) defer_effect(effects[i], _classPrivateFieldGet2(_dirty_effects$1, this), _classPrivateFieldGet2(_maybe_dirty_effects$1, this));
982
- }
983
- function _commit$1() {
984
- for (const batch of batches) {
985
- var is_earlier = batch.id < this.id;
986
- /** @type {Source[]} */
987
- var sources = [];
988
- for (const [source, [value, is_derived]] of this.current) {
989
- if (batch.current.has(source)) {
990
- var batch_value = batch.current.get(source)[0];
991
- if (is_earlier && value !== batch_value) batch.current.set(source, [value, is_derived]);
992
- else continue;
993
- }
994
- sources.push(source);
995
- }
996
- var others = [...batch.current.keys()].filter((s) => !this.current.has(s));
997
- if (others.length === 0) {
998
- if (is_earlier) batch.discard();
999
- } else if (sources.length > 0) {
1000
- if (is_earlier) for (const unskipped of _classPrivateFieldGet2(_unskipped_branches, this)) batch.unskip_effect(unskipped, (e) => {
1001
- if ((e.f & 4194320) !== 0) batch.schedule(e);
1002
- else _assertClassBrand(_Batch_brand, batch, _defer_effects).call(batch, [e]);
1003
- });
1004
- batch.activate();
1005
- /** @type {Set<Value>} */
1006
- var marked = /* @__PURE__ */ new Set();
1007
- /** @type {Map<Reaction, boolean>} */
1008
- var checked = /* @__PURE__ */ new Map();
1009
- for (var source of sources) mark_effects(source, others, marked, checked);
1010
- checked = /* @__PURE__ */ new Map();
1011
- var current_unequal = [...batch.current.keys()].filter((c) => this.current.has(c) ? this.current.get(c)[0] !== c : true);
1012
- for (const effect of _classPrivateFieldGet2(_new_effects, this)) if ((effect.f & 155648) === 0 && depends_on(effect, current_unequal, checked)) if ((effect.f & 4194320) !== 0) {
1013
- set_signal_status(effect, DIRTY);
1014
- batch.schedule(effect);
1015
- } else _classPrivateFieldGet2(_dirty_effects$1, batch).add(effect);
1016
- if (_classPrivateFieldGet2(_roots, batch).length > 0) {
1017
- batch.apply();
1018
- for (var root of _classPrivateFieldGet2(_roots, batch)) _assertClassBrand(_Batch_brand, batch, _traverse).call(batch, root, [], []);
1019
- _classPrivateFieldSet2(_roots, batch, []);
1020
- }
1021
- batch.deactivate();
962
+ function _update_pending_count(d, batch) {
963
+ if (!this.has_pending_snippet()) {
964
+ if (this.parent) {
965
+ var _this$parent;
966
+ _assertClassBrand(_Boundary_brand, _this$parent = this.parent, _update_pending_count).call(_this$parent, d, batch);
1022
967
  }
968
+ return;
1023
969
  }
1024
- for (const batch of batches) if (_classPrivateFieldGet2(_blockers, batch).has(this)) {
1025
- _classPrivateFieldGet2(_blockers, batch).delete(this);
1026
- if (_classPrivateFieldGet2(_blockers, batch).size === 0 && !_assertClassBrand(_Batch_brand, batch, _is_deferred).call(batch)) {
1027
- batch.activate();
1028
- _assertClassBrand(_Batch_brand, batch, _process).call(batch);
970
+ _classPrivateFieldSet2(_pending_count, this, _classPrivateFieldGet2(_pending_count, this) + d);
971
+ if (_classPrivateFieldGet2(_pending_count, this) === 0) {
972
+ _assertClassBrand(_Boundary_brand, this, _resolve).call(this, batch);
973
+ if (_classPrivateFieldGet2(_pending_effect, this)) pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
974
+ _classPrivateFieldSet2(_pending_effect, this, null);
975
+ });
976
+ if (_classPrivateFieldGet2(_offscreen_fragment, this)) {
977
+ _classPrivateFieldGet2(_anchor, this).before(_classPrivateFieldGet2(_offscreen_fragment, this));
978
+ _classPrivateFieldSet2(_offscreen_fragment, this, null);
1029
979
  }
1030
980
  }
1031
981
  }
1032
982
  /**
1033
- * Synchronously flush any pending updates.
1034
- * Returns void if no callback is provided, otherwise returns the result of calling the callback.
1035
- * @template [T=void]
1036
- * @param {(() => T) | undefined} [fn]
1037
- * @returns {T}
983
+ * @param {unknown} error
1038
984
  */
1039
- function flushSync(fn) {
1040
- var was_flushing_sync = is_flushing_sync;
1041
- is_flushing_sync = true;
1042
- try {
1043
- var result;
1044
- if (fn) {
1045
- if (current_batch !== null && !current_batch.is_fork) current_batch.flush();
1046
- result = fn();
1047
- }
1048
- while (true) {
1049
- flush_tasks();
1050
- if (current_batch === null) return result;
1051
- current_batch.flush();
1052
- }
1053
- } finally {
1054
- is_flushing_sync = was_flushing_sync;
985
+ function _handle_error(error) {
986
+ if (_classPrivateFieldGet2(_main_effect, this)) {
987
+ destroy_effect(_classPrivateFieldGet2(_main_effect, this));
988
+ _classPrivateFieldSet2(_main_effect, this, null);
1055
989
  }
1056
- }
1057
- function infinite_loop_guard() {
1058
- try {
1059
- effect_update_depth_exceeded();
1060
- } catch (error) {
1061
- invoke_error_boundary(error, last_scheduled_effect);
990
+ if (_classPrivateFieldGet2(_pending_effect, this)) {
991
+ destroy_effect(_classPrivateFieldGet2(_pending_effect, this));
992
+ _classPrivateFieldSet2(_pending_effect, this, null);
993
+ }
994
+ if (_classPrivateFieldGet2(_failed_effect, this)) {
995
+ destroy_effect(_classPrivateFieldGet2(_failed_effect, this));
996
+ _classPrivateFieldSet2(_failed_effect, this, null);
997
+ }
998
+ if (hydrating) {
999
+ set_hydrate_node(_classPrivateFieldGet2(_hydrate_open, this));
1000
+ next();
1001
+ set_hydrate_node(skip_nodes());
1062
1002
  }
1003
+ let failed = _classPrivateFieldGet2(_props, this).failed;
1004
+ /** @param {unknown} transformed_error */
1005
+ const handle_error_result = (transformed_error) => {
1006
+ const { reset, invoke_onerror } = _assertClassBrand(_Boundary_brand, this, _create_reset).call(this, transformed_error);
1007
+ invoke_onerror();
1008
+ if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
1009
+ try {
1010
+ return branch(() => {
1011
+ var effect = active_effect;
1012
+ effect.b = this;
1013
+ effect.f |= 128;
1014
+ failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
1015
+ });
1016
+ } catch (error) {
1017
+ invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
1018
+ return null;
1019
+ }
1020
+ }));
1021
+ };
1022
+ queue_micro_task(() => {
1023
+ /** @type {unknown} */
1024
+ var result;
1025
+ try {
1026
+ result = this.transform_error(error);
1027
+ } catch (e) {
1028
+ invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
1029
+ return;
1030
+ }
1031
+ if (result !== null && typeof result === "object" && typeof result.then === "function")
1032
+ /** @type {any} */ result.then(
1033
+ handle_error_result,
1034
+ /** @param {unknown} e */
1035
+ (e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
1036
+ );
1037
+ else handle_error_result(result);
1038
+ });
1063
1039
  }
1064
- /** @type {Set<Effect> | null} */
1065
- var eager_block_effects = null;
1040
+ //#endregion
1041
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/async.js
1042
+ /** @import { Blocker, Effect, Source, Value } from '#client' */
1066
1043
  /**
1067
- * @param {Array<Effect>} effects
1068
- * @returns {void}
1044
+ * @param {Blocker[]} blockers
1045
+ * @param {Array<() => any>} sync
1046
+ * @param {Array<() => Promise<any>>} async
1047
+ * @param {(values: Value[]) => any} fn
1069
1048
  */
1070
- function flush_queued_effects(effects) {
1071
- var length = effects.length;
1072
- if (length === 0) return;
1073
- var i = 0;
1074
- while (i < length) {
1075
- var effect = effects[i++];
1076
- if ((effect.f & 24576) === 0 && is_dirty(effect)) {
1077
- eager_block_effects = /* @__PURE__ */ new Set();
1078
- update_effect(effect);
1079
- if (effect.deps === null && effect.first === null && effect.nodes === null && effect.teardown === null && effect.ac === null) unlink_effect(effect);
1080
- if (eager_block_effects?.size > 0) {
1081
- old_values.clear();
1082
- for (const e of eager_block_effects) {
1083
- if ((e.f & 24576) !== 0) continue;
1084
- /** @type {Effect[]} */
1085
- const ordered_effects = [e];
1086
- let ancestor = e.parent;
1087
- while (ancestor !== null) {
1088
- if (eager_block_effects.has(ancestor)) {
1089
- eager_block_effects.delete(ancestor);
1090
- ordered_effects.push(ancestor);
1091
- }
1092
- ancestor = ancestor.parent;
1093
- }
1094
- for (let j = ordered_effects.length - 1; j >= 0; j--) {
1095
- const e = ordered_effects[j];
1096
- if ((e.f & 24576) !== 0) continue;
1097
- update_effect(e);
1098
- }
1099
- }
1100
- eager_block_effects.clear();
1101
- }
1049
+ function flatten(blockers, sync, async, fn) {
1050
+ const d = is_runes() ? derived : derived_safe_equal;
1051
+ var pending = blockers.filter((b) => !b.settled);
1052
+ var deriveds = sync.map(d);
1053
+ if (async.length === 0 && pending.length === 0) {
1054
+ fn(deriveds);
1055
+ return;
1056
+ }
1057
+ var parent = active_effect;
1058
+ var restore = capture();
1059
+ var blocker_promise = pending.length === 1 ? pending[0].promise : pending.length > 1 ? Promise.all(pending.map((b) => b.promise)) : null;
1060
+ /**
1061
+ * @param {Source[]} async
1062
+ */
1063
+ function finish(async) {
1064
+ if ((parent.f & 16384) !== 0) return;
1065
+ restore();
1066
+ try {
1067
+ fn([...deriveds, ...async]);
1068
+ } catch (error) {
1069
+ invoke_error_boundary(error, parent);
1102
1070
  }
1071
+ unset_context();
1103
1072
  }
1104
- eager_block_effects = null;
1073
+ var decrement_pending = increment_pending();
1074
+ if (async.length === 0) {
1075
+ /** @type {Promise<any>} */ blocker_promise.then(() => finish([])).finally(decrement_pending);
1076
+ return;
1077
+ }
1078
+ function run() {
1079
+ Promise.all(async.map((expression) => /* @__PURE__ */ async_derived(expression))).then(finish).catch((error) => invoke_error_boundary(error, parent)).finally(decrement_pending);
1080
+ }
1081
+ if (blocker_promise) blocker_promise.then(() => {
1082
+ restore();
1083
+ run();
1084
+ unset_context();
1085
+ });
1086
+ else run();
1105
1087
  }
1106
1088
  /**
1107
- * This is similar to `mark_reactions`, but it only marks async/block effects
1108
- * depending on `value` and at least one of the other `sources`, so that
1109
- * these effects can re-run after another batch has been committed
1110
- * @param {Value} value
1111
- * @param {Source[]} sources
1112
- * @param {Set<Value>} marked
1113
- * @param {Map<Reaction, boolean>} checked
1089
+ * Captures the current effect context so that we can restore it after
1090
+ * some asynchronous work has happened (so that e.g. `await a + b`
1091
+ * causes `b` to be registered as a dependency).
1114
1092
  */
1115
- function mark_effects(value, sources, marked, checked) {
1116
- if (marked.has(value)) return;
1117
- marked.add(value);
1118
- if (value.reactions !== null) for (const reaction of value.reactions) {
1119
- const flags = reaction.f;
1120
- if ((flags & 2) !== 0) mark_effects(reaction, sources, marked, checked);
1121
- else if ((flags & 4194320) !== 0 && (flags & 2048) === 0 && depends_on(reaction, sources, checked)) {
1122
- set_signal_status(reaction, DIRTY);
1123
- schedule_effect(reaction);
1093
+ function capture() {
1094
+ var previous_effect = active_effect;
1095
+ var previous_reaction = active_reaction;
1096
+ var previous_component_context = component_context;
1097
+ var previous_batch = current_batch;
1098
+ return function restore(activate_batch = true) {
1099
+ set_active_effect(previous_effect);
1100
+ set_active_reaction(previous_reaction);
1101
+ set_component_context(previous_component_context);
1102
+ if (activate_batch && (previous_effect.f & 16384) === 0) {
1103
+ previous_batch?.activate();
1104
+ previous_batch?.apply();
1124
1105
  }
1125
- }
1106
+ };
1107
+ }
1108
+ function unset_context(deactivate_batch = true) {
1109
+ set_active_effect(null);
1110
+ set_active_reaction(null);
1111
+ set_component_context(null);
1112
+ if (deactivate_batch) current_batch?.deactivate();
1126
1113
  }
1127
1114
  /**
1128
- * @param {Reaction} reaction
1129
- * @param {Source[]} sources
1130
- * @param {Map<Reaction, boolean>} checked
1115
+ * @returns {(skip?: boolean) => void}
1131
1116
  */
1132
- function depends_on(reaction, sources, checked) {
1133
- const depends = checked.get(reaction);
1134
- if (depends !== void 0) return depends;
1135
- if (reaction.deps !== null) for (const dep of reaction.deps) {
1136
- if (includes.call(sources, dep)) return true;
1137
- if ((dep.f & 2) !== 0 && depends_on(dep, sources, checked)) {
1138
- checked.set(dep, true);
1139
- return true;
1117
+ function increment_pending() {
1118
+ var effect = active_effect;
1119
+ var boundary = effect.b;
1120
+ var batch = current_batch;
1121
+ var blocking = !!boundary?.is_rendered();
1122
+ boundary?.update_pending_count(1, batch);
1123
+ batch.increment(blocking, effect);
1124
+ return () => {
1125
+ boundary?.update_pending_count(-1, batch);
1126
+ batch.decrement(blocking, effect);
1127
+ };
1128
+ }
1129
+ /**
1130
+ * @template V
1131
+ * @param {() => V} fn
1132
+ * @returns {Derived<V>}
1133
+ */
1134
+ /*#__NO_SIDE_EFFECTS__*/
1135
+ function derived(fn) {
1136
+ var flags = 2 | DIRTY;
1137
+ if (active_effect !== null) active_effect.f |= EFFECT_PRESERVED;
1138
+ return {
1139
+ ctx: component_context,
1140
+ deps: null,
1141
+ effects: null,
1142
+ equals,
1143
+ f: flags,
1144
+ fn,
1145
+ reactions: null,
1146
+ rv: 0,
1147
+ v: UNINITIALIZED,
1148
+ wv: 0,
1149
+ parent: active_effect,
1150
+ ac: null
1151
+ };
1152
+ }
1153
+ var OBSOLETE = Symbol("obsolete");
1154
+ /**
1155
+ * @template V
1156
+ * @param {() => V | Promise<V>} fn
1157
+ * @param {string} [label]
1158
+ * @param {string} [location] If provided, print a warning if the value is not read immediately after update
1159
+ * @returns {Promise<Source<V>>}
1160
+ */
1161
+ /*#__NO_SIDE_EFFECTS__*/
1162
+ function async_derived(fn, label, location) {
1163
+ let parent = active_effect;
1164
+ if (parent === null) async_derived_orphan();
1165
+ var promise = void 0;
1166
+ var signal = source(UNINITIALIZED);
1167
+ var should_suspend = !active_reaction;
1168
+ /** @type {Set<ReturnType<typeof deferred<V>>>} */
1169
+ var deferreds = /* @__PURE__ */ new Set();
1170
+ async_effect(() => {
1171
+ var effect = active_effect;
1172
+ /** @type {ReturnType<typeof deferred<V>>} */
1173
+ var d = deferred();
1174
+ promise = d.promise;
1175
+ try {
1176
+ Promise.resolve(fn()).then(d.resolve, (e) => {
1177
+ if (e !== STALE_REACTION) d.reject(e);
1178
+ }).finally(unset_context);
1179
+ } catch (error) {
1180
+ d.reject(error);
1181
+ unset_context();
1140
1182
  }
1141
- }
1142
- checked.set(reaction, false);
1143
- return false;
1183
+ var batch = current_batch;
1184
+ if (should_suspend) {
1185
+ if ((effect.f & 32768) !== 0) var decrement_pending = increment_pending();
1186
+ if (parent.b?.is_rendered()) batch.async_deriveds.get(effect)?.reject(OBSOLETE);
1187
+ else for (const d of deferreds.values()) d.reject(OBSOLETE);
1188
+ deferreds.add(d);
1189
+ batch.async_deriveds.set(effect, d);
1190
+ }
1191
+ /**
1192
+ * @param {any} value
1193
+ * @param {unknown} error
1194
+ */
1195
+ const handler = (value, error = void 0) => {
1196
+ decrement_pending?.();
1197
+ deferreds.delete(d);
1198
+ if (error === OBSOLETE) return;
1199
+ batch.activate();
1200
+ if (error) {
1201
+ signal.f |= ERROR_VALUE;
1202
+ internal_set(signal, error);
1203
+ } else {
1204
+ if ((signal.f & 8388608) !== 0) signal.f ^= ERROR_VALUE;
1205
+ internal_set(signal, value);
1206
+ }
1207
+ batch.deactivate();
1208
+ };
1209
+ d.promise.then(handler, (e) => handler(null, e || "unknown"));
1210
+ });
1211
+ teardown(() => {
1212
+ for (const d of deferreds) d.reject(OBSOLETE);
1213
+ });
1214
+ return new Promise((fulfil) => {
1215
+ /** @param {Promise<V>} p */
1216
+ function next(p) {
1217
+ function go() {
1218
+ if (p === promise) fulfil(signal);
1219
+ else next(promise);
1220
+ }
1221
+ p.then(go, go);
1222
+ }
1223
+ next(promise);
1224
+ });
1144
1225
  }
1145
1226
  /**
1146
- * @param {Effect} effect
1147
- * @returns {void}
1227
+ * @template V
1228
+ * @param {() => V} fn
1229
+ * @returns {Derived<V>}
1148
1230
  */
1149
- function schedule_effect(effect) {
1150
- /** @type {Batch} */ current_batch.schedule(effect);
1231
+ /*#__NO_SIDE_EFFECTS__*/
1232
+ function user_derived(fn) {
1233
+ const d = /* @__PURE__ */ derived(fn);
1234
+ if (!async_mode_flag) push_reaction_value(d);
1235
+ return d;
1151
1236
  }
1152
1237
  /**
1153
- * Mark all the effects inside a skipped branch CLEAN, so that
1154
- * they can be correctly rescheduled later. Tracks dirty and maybe_dirty
1155
- * effects so they can be rescheduled if the branch survives.
1156
- * @param {Effect} effect
1157
- * @param {{ d: Effect[], m: Effect[] }} tracked
1238
+ * @template V
1239
+ * @param {() => V} fn
1240
+ * @returns {Derived<V>}
1158
1241
  */
1159
- function reset_branch(effect, tracked) {
1160
- if ((effect.f & 32) !== 0 && (effect.f & 1024) !== 0) return;
1161
- if ((effect.f & 2048) !== 0) tracked.d.push(effect);
1162
- else if ((effect.f & 4096) !== 0) tracked.m.push(effect);
1163
- set_signal_status(effect, CLEAN);
1164
- var e = effect.first;
1165
- while (e !== null) {
1166
- reset_branch(e, tracked);
1167
- e = e.next;
1168
- }
1242
+ /*#__NO_SIDE_EFFECTS__*/
1243
+ function derived_safe_equal(fn) {
1244
+ const signal = /* @__PURE__ */ derived(fn);
1245
+ signal.equals = safe_equals;
1246
+ return signal;
1169
1247
  }
1170
1248
  /**
1171
- * Mark an entire effect tree clean following an error
1172
- * @param {Effect} effect
1249
+ * @param {Derived} derived
1250
+ * @returns {void}
1173
1251
  */
1174
- function reset_all(effect) {
1175
- set_signal_status(effect, CLEAN);
1176
- var e = effect.first;
1177
- while (e !== null) {
1178
- reset_all(e);
1179
- e = e.next;
1252
+ function destroy_derived_effects(derived) {
1253
+ var effects = derived.effects;
1254
+ if (effects !== null) {
1255
+ derived.effects = null;
1256
+ for (var i = 0; i < effects.length; i += 1) destroy_effect(effects[i]);
1180
1257
  }
1181
1258
  }
1182
- //#endregion
1183
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/reactivity/create-subscriber.js
1184
1259
  /**
1185
- * Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.
1186
- * It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.
1187
- *
1188
- * If `subscribe` is called inside an effect (including indirectly, for example inside a getter),
1189
- * the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.
1190
- *
1191
- * If `start` returns a cleanup function, it will be called when the effect is destroyed.
1192
- *
1193
- * If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects
1194
- * are active, and the returned teardown function will only be called when all effects are destroyed.
1195
- *
1196
- * It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):
1197
- *
1198
- * ```js
1199
- * import { createSubscriber } from 'svelte/reactivity';
1200
- * import { on } from 'svelte/events';
1201
- *
1202
- * export class MediaQuery {
1203
- * #query;
1204
- * #subscribe;
1205
- *
1206
- * constructor(query) {
1207
- * this.#query = window.matchMedia(`(${query})`);
1208
- *
1209
- * this.#subscribe = createSubscriber((update) => {
1210
- * // when the `change` event occurs, re-run any effects that read `this.current`
1211
- * const off = on(this.#query, 'change', update);
1212
- *
1213
- * // stop listening when all the effects are destroyed
1214
- * return () => off();
1215
- * });
1216
- * }
1217
- *
1218
- * get current() {
1219
- * // This makes the getter reactive, if read in an effect
1220
- * this.#subscribe();
1221
- *
1222
- * // Return the current state of the query, whether or not we're in an effect
1223
- * return this.#query.matches;
1224
- * }
1225
- * }
1226
- * ```
1227
- * @param {(update: () => void) => (() => void) | void} start
1228
- * @since 5.7.0
1260
+ * @template T
1261
+ * @param {Derived} derived
1262
+ * @returns {T}
1229
1263
  */
1230
- function createSubscriber(start) {
1231
- let subscribers = 0;
1232
- let version = source(0);
1233
- /** @type {(() => void) | void} */
1234
- let stop;
1235
- return () => {
1236
- if (effect_tracking()) {
1237
- get(version);
1238
- render_effect(() => {
1239
- if (subscribers === 0) stop = untrack(() => start(() => increment(version)));
1240
- subscribers += 1;
1241
- return () => {
1242
- queue_micro_task(() => {
1243
- subscribers -= 1;
1244
- if (subscribers === 0) {
1245
- stop?.();
1246
- stop = void 0;
1247
- increment(version);
1248
- }
1249
- });
1250
- };
1251
- });
1264
+ function execute_derived(derived) {
1265
+ var value;
1266
+ var prev_active_effect = active_effect;
1267
+ var parent = derived.parent;
1268
+ if (!is_destroying_effect && parent !== null && derived.v !== UNINITIALIZED && (parent.f & 24576) !== 0) {
1269
+ derived_inert();
1270
+ return derived.v;
1271
+ }
1272
+ set_active_effect(parent);
1273
+ try {
1274
+ derived.f &= ~WAS_MARKED;
1275
+ destroy_derived_effects(derived);
1276
+ value = update_reaction(derived);
1277
+ } finally {
1278
+ set_active_effect(prev_active_effect);
1279
+ }
1280
+ return value;
1281
+ }
1282
+ /**
1283
+ * @param {Derived} derived
1284
+ * @returns {void}
1285
+ */
1286
+ function update_derived(derived) {
1287
+ var value = execute_derived(derived);
1288
+ if (!derived.equals(value)) {
1289
+ derived.wv = increment_write_version();
1290
+ if (!current_batch?.is_fork || derived.deps === null) {
1291
+ if (current_batch !== null) {
1292
+ current_batch.capture(derived, value, true);
1293
+ previous_batch?.capture(derived, value, true);
1294
+ } else derived.v = value;
1295
+ if (derived.deps === null) {
1296
+ set_signal_status(derived, CLEAN);
1297
+ return;
1298
+ }
1252
1299
  }
1253
- };
1300
+ }
1301
+ if (is_destroying_effect) return;
1302
+ if (batch_values !== null) {
1303
+ if (effect_tracking() || current_batch?.is_fork) batch_values.set(derived, value);
1304
+ } else update_derived_status(derived);
1254
1305
  }
1255
- //#endregion
1256
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/blocks/boundary.js
1257
- /** @import { Effect, Source, TemplateNode, } from '#client' */
1258
1306
  /**
1259
- * @typedef {{
1260
- * onerror?: (error: unknown, reset: () => void) => void;
1261
- * failed?: (anchor: Node, error: () => unknown, reset: () => () => void) => void;
1262
- * pending?: (anchor: Node) => void;
1263
- * }} BoundaryProps
1307
+ * @param {Derived} derived
1264
1308
  */
1265
- var flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;
1309
+ function freeze_derived_effects(derived) {
1310
+ if (derived.effects === null) return;
1311
+ for (const e of derived.effects) if (e.teardown || e.ac) {
1312
+ e.teardown?.();
1313
+ if (e.ac !== null) without_reactive_context(() => {
1314
+ /** @type {AbortController} */ e.ac.abort(STALE_REACTION);
1315
+ e.ac = null;
1316
+ });
1317
+ if (e.fn !== null) e.teardown = noop;
1318
+ remove_reactions(e, 0);
1319
+ destroy_effect_children(e);
1320
+ }
1321
+ }
1266
1322
  /**
1267
- * @param {TemplateNode} node
1268
- * @param {BoundaryProps} props
1269
- * @param {((anchor: Node) => void)} children
1270
- * @param {((error: unknown) => unknown) | undefined} [transform_error]
1271
- * @returns {void}
1323
+ * @param {Derived} derived
1272
1324
  */
1273
- function boundary(node, props, children, transform_error) {
1274
- new Boundary(node, props, children, transform_error);
1325
+ function unfreeze_derived_effects(derived) {
1326
+ if (derived.effects === null) return;
1327
+ for (const e of derived.effects) if (e.teardown && e.fn !== null) update_effect(e);
1275
1328
  }
1276
- var _anchor = /* @__PURE__ */ new WeakMap();
1277
- var _hydrate_open = /* @__PURE__ */ new WeakMap();
1278
- var _props = /* @__PURE__ */ new WeakMap();
1279
- var _children = /* @__PURE__ */ new WeakMap();
1280
- var _effect = /* @__PURE__ */ new WeakMap();
1281
- var _main_effect = /* @__PURE__ */ new WeakMap();
1282
- var _pending_effect = /* @__PURE__ */ new WeakMap();
1283
- var _failed_effect = /* @__PURE__ */ new WeakMap();
1284
- var _offscreen_fragment = /* @__PURE__ */ new WeakMap();
1285
- var _local_pending_count = /* @__PURE__ */ new WeakMap();
1286
- var _pending_count = /* @__PURE__ */ new WeakMap();
1287
- var _pending_count_update_queued = /* @__PURE__ */ new WeakMap();
1329
+ //#endregion
1330
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/batch.js
1331
+ /** @import { Fork } from 'svelte' */
1332
+ /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
1333
+ var _Batch;
1334
+ /** @type {Batch | null} */
1335
+ var first_batch = null;
1336
+ /** @type {Batch | null} */
1337
+ var last_batch = null;
1338
+ /** @type {Batch | null} */
1339
+ var current_batch = null;
1340
+ /**
1341
+ * This is needed to avoid overwriting inputs
1342
+ * @type {Batch | null}
1343
+ */
1344
+ var previous_batch = null;
1345
+ /**
1346
+ * When time travelling (i.e. working in one batch, while other batches
1347
+ * still have ongoing work), we ignore the real values of affected
1348
+ * signals in favour of their values within the batch
1349
+ * @type {Map<Value, any> | null}
1350
+ */
1351
+ var batch_values = null;
1352
+ /** @type {Effect | null} */
1353
+ var last_scheduled_effect = null;
1354
+ var is_flushing_sync = false;
1355
+ var is_processing = false;
1356
+ /**
1357
+ * During traversal, this is an array. Newly created effects are (if not immediately
1358
+ * executed) pushed to this array, rather than going through the scheduling
1359
+ * rigamarole that would cause another turn of the flush loop.
1360
+ * @type {Effect[] | null}
1361
+ */
1362
+ var collected_effects = null;
1363
+ /**
1364
+ * An array of effects that are marked during traversal as a result of a `set`
1365
+ * (not `internal_set`) call. These will be added to the next batch and
1366
+ * trigger another `batch.process()`
1367
+ * @type {Effect[] | null}
1368
+ * @deprecated when we get rid of legacy mode and stores, we can get rid of this
1369
+ */
1370
+ var legacy_updates = null;
1371
+ var flush_count = 0;
1372
+ var uid = 1;
1373
+ var _started = /* @__PURE__ */ new WeakMap();
1374
+ var _prev = /* @__PURE__ */ new WeakMap();
1375
+ var _next = /* @__PURE__ */ new WeakMap();
1376
+ var _commit_callbacks = /* @__PURE__ */ new WeakMap();
1377
+ var _discard_callbacks = /* @__PURE__ */ new WeakMap();
1378
+ var _pending = /* @__PURE__ */ new WeakMap();
1379
+ var _blocking_pending = /* @__PURE__ */ new WeakMap();
1380
+ var _deferred = /* @__PURE__ */ new WeakMap();
1381
+ var _roots = /* @__PURE__ */ new WeakMap();
1382
+ var _new_effects = /* @__PURE__ */ new WeakMap();
1288
1383
  var _dirty_effects = /* @__PURE__ */ new WeakMap();
1289
1384
  var _maybe_dirty_effects = /* @__PURE__ */ new WeakMap();
1290
- var _effect_pending = /* @__PURE__ */ new WeakMap();
1291
- var _effect_pending_subscriber = /* @__PURE__ */ new WeakMap();
1292
- var _Boundary_brand = /* @__PURE__ */ new WeakSet();
1293
- var Boundary = class {
1294
- /**
1295
- * @param {TemplateNode} node
1296
- * @param {BoundaryProps} props
1297
- * @param {((anchor: Node) => void)} children
1298
- * @param {((error: unknown) => unknown) | undefined} [transform_error]
1299
- */
1300
- constructor(node, props, children, transform_error) {
1301
- _classPrivateMethodInitSpec(this, _Boundary_brand);
1385
+ var _skipped_branches = /* @__PURE__ */ new WeakMap();
1386
+ var _unskipped_branches = /* @__PURE__ */ new WeakMap();
1387
+ var _decrement_queued = /* @__PURE__ */ new WeakMap();
1388
+ var _Batch_brand = /* @__PURE__ */ new WeakSet();
1389
+ var Batch = class Batch {
1390
+ constructor() {
1391
+ _classPrivateMethodInitSpec(this, _Batch_brand);
1392
+ _defineProperty(this, "id", uid++);
1393
+ _classPrivateFieldInitSpec(this, _started, false);
1394
+ _defineProperty(this, "linked", true);
1395
+ _classPrivateFieldInitSpec(this, _prev, null);
1396
+ _classPrivateFieldInitSpec(this, _next, null);
1302
1397
  _defineProperty(
1303
1398
  this,
1304
- /** @type {Boundary | null} */
1305
- "parent",
1306
- void 0
1399
+ /** @type {Map<Effect, ReturnType<typeof deferred<any>>>} */
1400
+ "async_deriveds",
1401
+ /* @__PURE__ */ new Map()
1307
1402
  );
1308
- _defineProperty(this, "is_pending", false);
1309
1403
  _defineProperty(
1310
1404
  this,
1311
1405
  /**
1312
- * API-level transformError transform function. Transforms errors before they reach the `failed` snippet.
1313
- * Inherited from parent boundary, or defaults to identity.
1314
- * @type {(error: unknown) => unknown}
1406
+ * The current values of any signals that are updated in this batch.
1407
+ * Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment)
1408
+ * They keys of this map are identical to `this.#previous`
1409
+ * @type {Map<Value, [any, boolean]>}
1315
1410
  */
1316
- "transform_error",
1317
- void 0
1411
+ "current",
1412
+ /* @__PURE__ */ new Map()
1318
1413
  );
1319
- _classPrivateFieldInitSpec(this, _anchor, void 0);
1320
- _classPrivateFieldInitSpec(this, _hydrate_open, hydrating ? hydrate_node : null);
1321
- _classPrivateFieldInitSpec(this, _props, void 0);
1322
- _classPrivateFieldInitSpec(this, _children, void 0);
1323
- _classPrivateFieldInitSpec(this, _effect, void 0);
1324
- _classPrivateFieldInitSpec(this, _main_effect, null);
1325
- _classPrivateFieldInitSpec(this, _pending_effect, null);
1326
- _classPrivateFieldInitSpec(this, _failed_effect, null);
1327
- _classPrivateFieldInitSpec(this, _offscreen_fragment, null);
1328
- _classPrivateFieldInitSpec(this, _local_pending_count, 0);
1329
- _classPrivateFieldInitSpec(this, _pending_count, 0);
1330
- _classPrivateFieldInitSpec(this, _pending_count_update_queued, false);
1414
+ _defineProperty(
1415
+ this,
1416
+ /**
1417
+ * The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place.
1418
+ * They keys of this map are identical to `this.#current`
1419
+ * @type {Map<Value, any>}
1420
+ */
1421
+ "previous",
1422
+ /* @__PURE__ */ new Map()
1423
+ );
1424
+ _classPrivateFieldInitSpec(this, _commit_callbacks, /* @__PURE__ */ new Set());
1425
+ _classPrivateFieldInitSpec(this, _discard_callbacks, /* @__PURE__ */ new Set());
1426
+ _classPrivateFieldInitSpec(this, _pending, 0);
1427
+ _classPrivateFieldInitSpec(this, _blocking_pending, /* @__PURE__ */ new Map());
1428
+ _classPrivateFieldInitSpec(this, _deferred, null);
1429
+ _classPrivateFieldInitSpec(this, _roots, []);
1430
+ _classPrivateFieldInitSpec(this, _new_effects, []);
1331
1431
  _classPrivateFieldInitSpec(this, _dirty_effects, /* @__PURE__ */ new Set());
1332
1432
  _classPrivateFieldInitSpec(this, _maybe_dirty_effects, /* @__PURE__ */ new Set());
1333
- _classPrivateFieldInitSpec(this, _effect_pending, null);
1334
- _classPrivateFieldInitSpec(this, _effect_pending_subscriber, createSubscriber(() => {
1335
- _classPrivateFieldSet2(_effect_pending, this, source(_classPrivateFieldGet2(_local_pending_count, this)));
1336
- return () => {
1337
- _classPrivateFieldSet2(_effect_pending, this, null);
1338
- };
1339
- }));
1340
- _classPrivateFieldSet2(_anchor, this, node);
1341
- _classPrivateFieldSet2(_props, this, props);
1342
- _classPrivateFieldSet2(_children, this, (anchor) => {
1343
- var effect = active_effect;
1344
- effect.b = this;
1345
- effect.f |= 128;
1346
- children(anchor);
1347
- });
1348
- this.parent = active_effect.b;
1349
- this.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);
1350
- _classPrivateFieldSet2(_effect, this, block(() => {
1351
- if (hydrating) {
1352
- const comment = _classPrivateFieldGet2(_hydrate_open, this);
1353
- hydrate_next();
1354
- const server_rendered_pending = comment.data === "[!";
1355
- if (comment.data.startsWith("[?")) {
1356
- const serialized_error = JSON.parse(comment.data.slice(2));
1357
- _assertClassBrand(_Boundary_brand, this, _hydrate_failed_content).call(this, serialized_error);
1358
- } else if (server_rendered_pending) _assertClassBrand(_Boundary_brand, this, _hydrate_pending_content).call(this);
1359
- else _assertClassBrand(_Boundary_brand, this, _hydrate_resolved_content).call(this);
1360
- } else _assertClassBrand(_Boundary_brand, this, _render).call(this);
1361
- }, flags));
1362
- if (hydrating) _classPrivateFieldSet2(_anchor, this, hydrate_node);
1433
+ _classPrivateFieldInitSpec(this, _skipped_branches, /* @__PURE__ */ new Map());
1434
+ _classPrivateFieldInitSpec(this, _unskipped_branches, /* @__PURE__ */ new Set());
1435
+ _defineProperty(this, "is_fork", false);
1436
+ _classPrivateFieldInitSpec(this, _decrement_queued, false);
1437
+ if (last_batch === null) first_batch = last_batch = this;
1438
+ else {
1439
+ _classPrivateFieldSet2(_next, last_batch, this);
1440
+ _classPrivateFieldSet2(_prev, this, last_batch);
1441
+ }
1442
+ last_batch = this;
1363
1443
  }
1364
1444
  /**
1365
- * Defer an effect inside a pending boundary until the boundary resolves
1445
+ * Add an effect to the #skipped_branches map and reset its children
1366
1446
  * @param {Effect} effect
1367
1447
  */
1368
- defer_effect(effect) {
1369
- defer_effect(effect, _classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
1448
+ skip_effect(effect) {
1449
+ if (!_classPrivateFieldGet2(_skipped_branches, this).has(effect)) _classPrivateFieldGet2(_skipped_branches, this).set(effect, {
1450
+ d: [],
1451
+ m: []
1452
+ });
1453
+ _classPrivateFieldGet2(_unskipped_branches, this).delete(effect);
1370
1454
  }
1371
1455
  /**
1372
- * Returns `false` if the effect exists inside a boundary whose pending snippet is shown
1373
- * @returns {boolean}
1456
+ * Remove an effect from the #skipped_branches map and reschedule
1457
+ * any tracked dirty/maybe_dirty child effects
1458
+ * @param {Effect} effect
1459
+ * @param {(e: Effect) => void} callback
1374
1460
  */
1375
- is_rendered() {
1376
- return !this.is_pending && (!this.parent || this.parent.is_rendered());
1377
- }
1378
- has_pending_snippet() {
1379
- return !!_classPrivateFieldGet2(_props, this).pending;
1461
+ unskip_effect(effect, callback = (e) => this.schedule(e)) {
1462
+ var tracked = _classPrivateFieldGet2(_skipped_branches, this).get(effect);
1463
+ if (tracked) {
1464
+ _classPrivateFieldGet2(_skipped_branches, this).delete(effect);
1465
+ for (var e of tracked.d) {
1466
+ set_signal_status(e, DIRTY);
1467
+ callback(e);
1468
+ }
1469
+ for (e of tracked.m) {
1470
+ set_signal_status(e, MAYBE_DIRTY);
1471
+ callback(e);
1472
+ }
1473
+ }
1474
+ _classPrivateFieldGet2(_unskipped_branches, this).add(effect);
1380
1475
  }
1381
1476
  /**
1382
- * Update the source that powers `$effect.pending()` inside this boundary,
1383
- * and controls when the current `pending` snippet (if any) is removed.
1384
- * Do not call from inside the class
1385
- * @param {1 | -1} d
1386
- * @param {Batch} batch
1477
+ * Associate a change to a given source with the current
1478
+ * batch, noting its previous and current values
1479
+ * @param {Value} source
1480
+ * @param {any} value
1481
+ * @param {boolean} [is_derived]
1387
1482
  */
1388
- update_pending_count(d, batch) {
1389
- _assertClassBrand(_Boundary_brand, this, _update_pending_count).call(this, d, batch);
1390
- _classPrivateFieldSet2(_local_pending_count, this, _classPrivateFieldGet2(_local_pending_count, this) + d);
1391
- if (!_classPrivateFieldGet2(_effect_pending, this) || _classPrivateFieldGet2(_pending_count_update_queued, this)) return;
1392
- _classPrivateFieldSet2(_pending_count_update_queued, this, true);
1393
- queue_micro_task(() => {
1394
- _classPrivateFieldSet2(_pending_count_update_queued, this, false);
1395
- if (_classPrivateFieldGet2(_effect_pending, this)) internal_set(_classPrivateFieldGet2(_effect_pending, this), _classPrivateFieldGet2(_local_pending_count, this));
1396
- });
1397
- }
1398
- get_effect_pending() {
1399
- _classPrivateFieldGet2(_effect_pending_subscriber, this).call(this);
1400
- return get(_classPrivateFieldGet2(_effect_pending, this));
1483
+ capture(source, value, is_derived = false) {
1484
+ if (source.v !== UNINITIALIZED && !this.previous.has(source)) this.previous.set(source, source.v);
1485
+ if ((source.f & 8388608) === 0) {
1486
+ this.current.set(source, [value, is_derived]);
1487
+ batch_values?.set(source, value);
1488
+ }
1489
+ if (!this.is_fork) source.v = value;
1401
1490
  }
1402
- /** @param {unknown} error */
1403
- error(error) {
1404
- if (!_classPrivateFieldGet2(_props, this).onerror && !_classPrivateFieldGet2(_props, this).failed) throw error;
1405
- if (current_batch?.is_fork) {
1406
- if (_classPrivateFieldGet2(_main_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_main_effect, this));
1407
- if (_classPrivateFieldGet2(_pending_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_pending_effect, this));
1408
- if (_classPrivateFieldGet2(_failed_effect, this)) current_batch.skip_effect(_classPrivateFieldGet2(_failed_effect, this));
1409
- current_batch.on_fork_commit(() => {
1410
- _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
1411
- });
1412
- } else _assertClassBrand(_Boundary_brand, this, _handle_error).call(this, error);
1491
+ activate() {
1492
+ current_batch = this;
1413
1493
  }
1414
- };
1415
- function _hydrate_resolved_content() {
1416
- try {
1417
- _classPrivateFieldSet2(_main_effect, this, branch(() => _classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this))));
1418
- } catch (error) {
1419
- this.error(error);
1494
+ deactivate() {
1495
+ current_batch = null;
1496
+ batch_values = null;
1420
1497
  }
1421
- }
1422
- /**
1423
- * @param {unknown} error The deserialized error from the server's hydration comment
1424
- */
1425
- function _hydrate_failed_content(error) {
1426
- const failed = _classPrivateFieldGet2(_props, this).failed;
1427
- if (!failed) return;
1428
- _classPrivateFieldSet2(_failed_effect, this, branch(() => {
1429
- failed(_classPrivateFieldGet2(_anchor, this), () => error, () => () => {});
1430
- }));
1431
- }
1432
- function _hydrate_pending_content() {
1433
- const pending = _classPrivateFieldGet2(_props, this).pending;
1434
- if (!pending) return;
1435
- this.is_pending = true;
1436
- _classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
1437
- queue_micro_task(() => {
1438
- var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
1439
- var anchor = create_text();
1440
- fragment.append(anchor);
1441
- _classPrivateFieldSet2(_main_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
1442
- return branch(() => _classPrivateFieldGet2(_children, this).call(this, anchor));
1443
- }));
1444
- if (_classPrivateFieldGet2(_pending_count, this) === 0) {
1445
- _classPrivateFieldGet2(_anchor, this).before(fragment);
1446
- _classPrivateFieldSet2(_offscreen_fragment, this, null);
1447
- pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
1448
- _classPrivateFieldSet2(_pending_effect, this, null);
1449
- });
1450
- _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
1498
+ flush() {
1499
+ try {
1500
+ is_processing = true;
1501
+ current_batch = this;
1502
+ _assertClassBrand(_Batch_brand, this, _process).call(this);
1503
+ } finally {
1504
+ flush_count = 0;
1505
+ last_scheduled_effect = null;
1506
+ collected_effects = null;
1507
+ legacy_updates = null;
1508
+ is_processing = false;
1509
+ current_batch = null;
1510
+ batch_values = null;
1511
+ old_values.clear();
1451
1512
  }
1452
- });
1453
- }
1454
- function _render() {
1455
- try {
1456
- this.is_pending = this.has_pending_snippet();
1457
- _classPrivateFieldSet2(_pending_count, this, 0);
1458
- _classPrivateFieldSet2(_local_pending_count, this, 0);
1459
- _classPrivateFieldSet2(_main_effect, this, branch(() => {
1460
- _classPrivateFieldGet2(_children, this).call(this, _classPrivateFieldGet2(_anchor, this));
1461
- }));
1462
- if (_classPrivateFieldGet2(_pending_count, this) > 0) {
1463
- var fragment = _classPrivateFieldSet2(_offscreen_fragment, this, document.createDocumentFragment());
1464
- move_effect(_classPrivateFieldGet2(_main_effect, this), fragment);
1465
- const pending = _classPrivateFieldGet2(_props, this).pending;
1466
- _classPrivateFieldSet2(_pending_effect, this, branch(() => pending(_classPrivateFieldGet2(_anchor, this))));
1467
- } else _assertClassBrand(_Boundary_brand, this, _resolve).call(this, current_batch);
1468
- } catch (error) {
1469
- this.error(error);
1470
1513
  }
1471
- }
1472
- /**
1473
- * @param {Batch} batch
1474
- */
1475
- function _resolve(batch) {
1476
- this.is_pending = false;
1477
- batch.transfer_effects(_classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
1478
- }
1479
- /**
1480
- * @template T
1481
- * @param {() => T} fn
1482
- */
1483
- function _run(fn) {
1484
- var previous_effect = active_effect;
1485
- var previous_reaction = active_reaction;
1486
- var previous_ctx = component_context;
1487
- set_active_effect(_classPrivateFieldGet2(_effect, this));
1488
- set_active_reaction(_classPrivateFieldGet2(_effect, this));
1489
- set_component_context(_classPrivateFieldGet2(_effect, this).ctx);
1490
- try {
1491
- Batch.ensure();
1492
- return fn();
1493
- } catch (e) {
1494
- handle_error(e);
1495
- return null;
1496
- } finally {
1497
- set_active_effect(previous_effect);
1498
- set_active_reaction(previous_reaction);
1499
- set_component_context(previous_ctx);
1514
+ discard() {
1515
+ for (const fn of _classPrivateFieldGet2(_discard_callbacks, this)) fn(this);
1516
+ _classPrivateFieldGet2(_discard_callbacks, this).clear();
1517
+ for (const deferred of this.async_deriveds.values()) deferred.reject(OBSOLETE);
1518
+ _assertClassBrand(_Batch_brand, this, _unlink).call(this);
1519
+ _classPrivateFieldGet2(_deferred, this)?.resolve();
1500
1520
  }
1501
- }
1502
- /**
1503
- * Updates the pending count associated with the currently visible pending snippet,
1504
- * if any, such that we can replace the snippet with content once work is done
1505
- * @param {1 | -1} d
1506
- * @param {Batch} batch
1507
- */
1508
- function _update_pending_count(d, batch) {
1509
- if (!this.has_pending_snippet()) {
1510
- if (this.parent) {
1511
- var _this$parent;
1512
- _assertClassBrand(_Boundary_brand, _this$parent = this.parent, _update_pending_count).call(_this$parent, d, batch);
1521
+ /**
1522
+ * @param {Effect} effect
1523
+ */
1524
+ register_created_effect(effect) {
1525
+ _classPrivateFieldGet2(_new_effects, this).push(effect);
1526
+ }
1527
+ /**
1528
+ * @param {boolean} blocking
1529
+ * @param {Effect} effect
1530
+ */
1531
+ increment(blocking, effect) {
1532
+ _classPrivateFieldSet2(_pending, this, _classPrivateFieldGet2(_pending, this) + 1);
1533
+ if (blocking) {
1534
+ let blocking_pending_count = _classPrivateFieldGet2(_blocking_pending, this).get(effect) ?? 0;
1535
+ _classPrivateFieldGet2(_blocking_pending, this).set(effect, blocking_pending_count + 1);
1513
1536
  }
1514
- return;
1515
1537
  }
1516
- _classPrivateFieldSet2(_pending_count, this, _classPrivateFieldGet2(_pending_count, this) + d);
1517
- if (_classPrivateFieldGet2(_pending_count, this) === 0) {
1518
- _assertClassBrand(_Boundary_brand, this, _resolve).call(this, batch);
1519
- if (_classPrivateFieldGet2(_pending_effect, this)) pause_effect(_classPrivateFieldGet2(_pending_effect, this), () => {
1520
- _classPrivateFieldSet2(_pending_effect, this, null);
1521
- });
1522
- if (_classPrivateFieldGet2(_offscreen_fragment, this)) {
1523
- _classPrivateFieldGet2(_anchor, this).before(_classPrivateFieldGet2(_offscreen_fragment, this));
1524
- _classPrivateFieldSet2(_offscreen_fragment, this, null);
1538
+ /**
1539
+ * @param {boolean} blocking
1540
+ * @param {Effect} effect
1541
+ */
1542
+ decrement(blocking, effect) {
1543
+ _classPrivateFieldSet2(_pending, this, _classPrivateFieldGet2(_pending, this) - 1);
1544
+ if (blocking) {
1545
+ let blocking_pending_count = _classPrivateFieldGet2(_blocking_pending, this).get(effect) ?? 0;
1546
+ if (blocking_pending_count === 1) _classPrivateFieldGet2(_blocking_pending, this).delete(effect);
1547
+ else _classPrivateFieldGet2(_blocking_pending, this).set(effect, blocking_pending_count - 1);
1525
1548
  }
1549
+ if (_classPrivateFieldGet2(_decrement_queued, this)) return;
1550
+ _classPrivateFieldSet2(_decrement_queued, this, true);
1551
+ queue_micro_task(() => {
1552
+ _classPrivateFieldSet2(_decrement_queued, this, false);
1553
+ if (this.linked) this.flush();
1554
+ });
1526
1555
  }
1527
- }
1528
- /**
1529
- * @param {unknown} error
1530
- */
1531
- function _handle_error(error) {
1532
- if (_classPrivateFieldGet2(_main_effect, this)) {
1533
- destroy_effect(_classPrivateFieldGet2(_main_effect, this));
1534
- _classPrivateFieldSet2(_main_effect, this, null);
1556
+ /**
1557
+ * @param {Set<Effect>} dirty_effects
1558
+ * @param {Set<Effect>} maybe_dirty_effects
1559
+ */
1560
+ transfer_effects(dirty_effects, maybe_dirty_effects) {
1561
+ for (const e of dirty_effects) _classPrivateFieldGet2(_dirty_effects, this).add(e);
1562
+ for (const e of maybe_dirty_effects) _classPrivateFieldGet2(_maybe_dirty_effects, this).add(e);
1563
+ dirty_effects.clear();
1564
+ maybe_dirty_effects.clear();
1535
1565
  }
1536
- if (_classPrivateFieldGet2(_pending_effect, this)) {
1537
- destroy_effect(_classPrivateFieldGet2(_pending_effect, this));
1538
- _classPrivateFieldSet2(_pending_effect, this, null);
1566
+ /** @param {(batch: Batch) => void} fn */
1567
+ oncommit(fn) {
1568
+ _classPrivateFieldGet2(_commit_callbacks, this).add(fn);
1539
1569
  }
1540
- if (_classPrivateFieldGet2(_failed_effect, this)) {
1541
- destroy_effect(_classPrivateFieldGet2(_failed_effect, this));
1542
- _classPrivateFieldSet2(_failed_effect, this, null);
1570
+ /** @param {(batch: Batch) => void} fn */
1571
+ ondiscard(fn) {
1572
+ _classPrivateFieldGet2(_discard_callbacks, this).add(fn);
1543
1573
  }
1544
- if (hydrating) {
1545
- set_hydrate_node(_classPrivateFieldGet2(_hydrate_open, this));
1546
- next();
1547
- set_hydrate_node(skip_nodes());
1574
+ settled() {
1575
+ return (_classPrivateFieldGet2(_deferred, this) ?? _classPrivateFieldSet2(_deferred, this, deferred())).promise;
1548
1576
  }
1549
- var onerror = _classPrivateFieldGet2(_props, this).onerror;
1550
- let failed = _classPrivateFieldGet2(_props, this).failed;
1551
- var did_reset = false;
1552
- var calling_on_error = false;
1553
- const reset = () => {
1554
- if (did_reset) {
1555
- svelte_boundary_reset_noop();
1556
- return;
1577
+ static ensure() {
1578
+ if (current_batch === null) {
1579
+ const batch = current_batch = new Batch();
1580
+ if (!is_processing && !is_flushing_sync) queue_micro_task(() => {
1581
+ if (!_classPrivateFieldGet2(_started, batch)) batch.flush();
1582
+ });
1557
1583
  }
1558
- did_reset = true;
1559
- if (calling_on_error) svelte_boundary_reset_onerror();
1560
- if (_classPrivateFieldGet2(_failed_effect, this) !== null) pause_effect(_classPrivateFieldGet2(_failed_effect, this), () => {
1561
- _classPrivateFieldSet2(_failed_effect, this, null);
1562
- });
1563
- _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
1564
- _assertClassBrand(_Boundary_brand, this, _render).call(this);
1565
- });
1566
- };
1567
- /** @param {unknown} transformed_error */
1568
- const handle_error_result = (transformed_error) => {
1569
- try {
1570
- calling_on_error = true;
1571
- onerror?.(transformed_error, reset);
1572
- calling_on_error = false;
1573
- } catch (error) {
1574
- invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
1584
+ return current_batch;
1585
+ }
1586
+ apply() {
1587
+ if (!async_mode_flag || !this.is_fork && _classPrivateFieldGet2(_prev, this) === null && _classPrivateFieldGet2(_next, this) === null) {
1588
+ batch_values = null;
1589
+ return;
1575
1590
  }
1576
- if (failed) _classPrivateFieldSet2(_failed_effect, this, _assertClassBrand(_Boundary_brand, this, _run).call(this, () => {
1577
- try {
1578
- return branch(() => {
1579
- var effect = active_effect;
1580
- effect.b = this;
1581
- effect.f |= 128;
1582
- failed(_classPrivateFieldGet2(_anchor, this), () => transformed_error, () => reset);
1583
- });
1584
- } catch (error) {
1585
- invoke_error_boundary(error, _classPrivateFieldGet2(_effect, this).parent);
1586
- return null;
1591
+ batch_values = /* @__PURE__ */ new Map();
1592
+ for (const [source, [value]] of this.current) batch_values.set(source, value);
1593
+ for (let batch = first_batch; batch !== null; batch = _classPrivateFieldGet2(_next, batch)) {
1594
+ if (batch === this || batch.is_fork) continue;
1595
+ var intersects = false;
1596
+ if (batch.id < this.id) for (const [source, [, is_derived]] of batch.current) {
1597
+ if (is_derived) continue;
1598
+ if (this.current.has(source)) {
1599
+ intersects = true;
1600
+ break;
1601
+ }
1587
1602
  }
1588
- }));
1589
- };
1590
- queue_micro_task(() => {
1591
- /** @type {unknown} */
1592
- var result;
1593
- try {
1594
- result = this.transform_error(error);
1595
- } catch (e) {
1596
- invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent);
1603
+ if (!intersects) {
1604
+ for (const [source, previous] of batch.previous) if (!batch_values.has(source)) batch_values.set(source, previous);
1605
+ }
1606
+ }
1607
+ }
1608
+ /**
1609
+ *
1610
+ * @param {Effect} effect
1611
+ */
1612
+ schedule(effect) {
1613
+ last_scheduled_effect = effect;
1614
+ if (effect.b?.is_pending && (effect.f & 16777228) !== 0 && (effect.f & 32768) === 0) {
1615
+ effect.b.defer_effect(effect);
1597
1616
  return;
1598
1617
  }
1599
- if (result !== null && typeof result === "object" && typeof result.then === "function")
1600
- /** @type {any} */ result.then(
1601
- handle_error_result,
1602
- /** @param {unknown} e */
1603
- (e) => invoke_error_boundary(e, _classPrivateFieldGet2(_effect, this) && _classPrivateFieldGet2(_effect, this).parent)
1604
- );
1605
- else handle_error_result(result);
1606
- });
1607
- }
1608
- //#endregion
1609
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/async.js
1610
- /** @import { Blocker, Effect, Value } from '#client' */
1611
- /**
1612
- * @param {Blocker[]} blockers
1613
- * @param {Array<() => any>} sync
1614
- * @param {Array<() => Promise<any>>} async
1615
- * @param {(values: Value[]) => any} fn
1616
- */
1617
- function flatten(blockers, sync, async, fn) {
1618
- const d = is_runes() ? derived : derived_safe_equal;
1619
- var pending = blockers.filter((b) => !b.settled);
1620
- if (async.length === 0 && pending.length === 0) {
1621
- fn(sync.map(d));
1622
- return;
1618
+ var e = effect;
1619
+ while (e.parent !== null) {
1620
+ e = e.parent;
1621
+ var flags = e.f;
1622
+ if (collected_effects !== null && e === active_effect) {
1623
+ if (async_mode_flag) return;
1624
+ if ((active_reaction === null || (active_reaction.f & 2) === 0) && !legacy_is_updating_store) return;
1625
+ }
1626
+ if ((flags & 96) !== 0) {
1627
+ if ((flags & 1024) === 0) return;
1628
+ e.f ^= CLEAN;
1629
+ }
1630
+ }
1631
+ _classPrivateFieldGet2(_roots, this).push(e);
1623
1632
  }
1624
- var parent = active_effect;
1625
- var restore = capture();
1626
- var blocker_promise = pending.length === 1 ? pending[0].promise : pending.length > 1 ? Promise.all(pending.map((b) => b.promise)) : null;
1627
- /** @param {Value[]} values */
1628
- function finish(values) {
1629
- restore();
1630
- try {
1631
- fn(values);
1632
- } catch (error) {
1633
- if ((parent.f & 16384) === 0) invoke_error_boundary(error, parent);
1633
+ };
1634
+ _Batch = Batch;
1635
+ function _is_deferred() {
1636
+ if (this.is_fork) return true;
1637
+ for (const effect of _classPrivateFieldGet2(_blocking_pending, this).keys()) {
1638
+ var e = effect;
1639
+ var skipped = false;
1640
+ while (e.parent !== null) {
1641
+ if (_classPrivateFieldGet2(_skipped_branches, this).has(e)) {
1642
+ skipped = true;
1643
+ break;
1644
+ }
1645
+ e = e.parent;
1634
1646
  }
1635
- unset_context();
1647
+ if (!skipped) return true;
1636
1648
  }
1637
- if (async.length === 0) {
1638
- /** @type {Promise<any>} */ blocker_promise.then(() => finish(sync.map(d)));
1649
+ return false;
1650
+ }
1651
+ function _process() {
1652
+ _classPrivateFieldSet2(_started, this, true);
1653
+ if (flush_count++ > 1e3) {
1654
+ _assertClassBrand(_Batch_brand, this, _unlink).call(this);
1655
+ infinite_loop_guard();
1656
+ }
1657
+ for (const e of _classPrivateFieldGet2(_dirty_effects, this)) {
1658
+ _classPrivateFieldGet2(_maybe_dirty_effects, this).delete(e);
1659
+ set_signal_status(e, DIRTY);
1660
+ this.schedule(e);
1661
+ }
1662
+ for (const e of _classPrivateFieldGet2(_maybe_dirty_effects, this)) {
1663
+ set_signal_status(e, MAYBE_DIRTY);
1664
+ this.schedule(e);
1665
+ }
1666
+ const roots = _classPrivateFieldGet2(_roots, this);
1667
+ _classPrivateFieldSet2(_roots, this, []);
1668
+ this.apply();
1669
+ /** @type {Effect[]} */
1670
+ var effects = collected_effects = [];
1671
+ /** @type {Effect[]} */
1672
+ var render_effects = [];
1673
+ /**
1674
+ * @type {Effect[]}
1675
+ * @deprecated when we get rid of legacy mode and stores, we can get rid of this
1676
+ */
1677
+ var updates = legacy_updates = [];
1678
+ for (const root of roots) try {
1679
+ _assertClassBrand(_Batch_brand, this, _traverse).call(this, root, effects, render_effects);
1680
+ } catch (e) {
1681
+ reset_all(root);
1682
+ if (!_assertClassBrand(_Batch_brand, this, _is_deferred).call(this)) this.discard();
1683
+ throw e;
1684
+ }
1685
+ current_batch = null;
1686
+ if (updates.length > 0) {
1687
+ var batch = _Batch.ensure();
1688
+ for (const e of updates) batch.schedule(e);
1689
+ }
1690
+ collected_effects = null;
1691
+ legacy_updates = null;
1692
+ if (_assertClassBrand(_Batch_brand, this, _is_deferred).call(this)) {
1693
+ _assertClassBrand(_Batch_brand, this, _defer_effects).call(this, render_effects);
1694
+ _assertClassBrand(_Batch_brand, this, _defer_effects).call(this, effects);
1695
+ for (const [e, t] of _classPrivateFieldGet2(_skipped_branches, this)) reset_branch(e, t);
1696
+ if (updates.length > 0)
1697
+ /** @type {Batch} */ _assertClassBrand(_Batch_brand, current_batch, _process).call(current_batch);
1639
1698
  return;
1640
1699
  }
1641
- var decrement_pending = increment_pending();
1642
- function run() {
1643
- 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());
1700
+ const earlier_batch = _assertClassBrand(_Batch_brand, this, _find_earlier_batch).call(this);
1701
+ if (earlier_batch) {
1702
+ _assertClassBrand(_Batch_brand, this, _defer_effects).call(this, render_effects);
1703
+ _assertClassBrand(_Batch_brand, this, _defer_effects).call(this, effects);
1704
+ _assertClassBrand(_Batch_brand, earlier_batch, _merge).call(earlier_batch, this);
1705
+ return;
1644
1706
  }
1645
- if (blocker_promise) blocker_promise.then(() => {
1646
- restore();
1647
- run();
1648
- unset_context();
1649
- });
1650
- else run();
1707
+ _classPrivateFieldGet2(_dirty_effects, this).clear();
1708
+ _classPrivateFieldGet2(_maybe_dirty_effects, this).clear();
1709
+ for (const fn of _classPrivateFieldGet2(_commit_callbacks, this)) fn(this);
1710
+ _classPrivateFieldGet2(_commit_callbacks, this).clear();
1711
+ previous_batch = this;
1712
+ flush_queued_effects(render_effects);
1713
+ flush_queued_effects(effects);
1714
+ previous_batch = null;
1715
+ _classPrivateFieldGet2(_deferred, this)?.resolve();
1716
+ var next_batch = current_batch;
1717
+ if (_classPrivateFieldGet2(_pending, this) === 0 && (_classPrivateFieldGet2(_roots, this).length === 0 || next_batch !== null)) {
1718
+ _assertClassBrand(_Batch_brand, this, _unlink).call(this);
1719
+ if (async_mode_flag) {
1720
+ _assertClassBrand(_Batch_brand, this, _commit$1).call(this);
1721
+ current_batch = next_batch;
1722
+ }
1723
+ }
1724
+ if (_classPrivateFieldGet2(_roots, this).length > 0) if (next_batch !== null) {
1725
+ const batch = next_batch;
1726
+ _classPrivateFieldGet2(_roots, batch).push(..._classPrivateFieldGet2(_roots, this).filter((r) => !_classPrivateFieldGet2(_roots, batch).includes(r)));
1727
+ } else next_batch = this;
1728
+ if (next_batch !== null) _assertClassBrand(_Batch_brand, next_batch, _process).call(next_batch);
1651
1729
  }
1652
1730
  /**
1653
- * Captures the current effect context so that we can restore it after
1654
- * some asynchronous work has happened (so that e.g. `await a + b`
1655
- * causes `b` to be registered as a dependency).
1731
+ * Traverse the effect tree, executing effects or stashing
1732
+ * them for later execution as appropriate
1733
+ * @param {Effect} root
1734
+ * @param {Effect[]} effects
1735
+ * @param {Effect[]} render_effects
1656
1736
  */
1657
- function capture() {
1658
- var previous_effect = active_effect;
1659
- var previous_reaction = active_reaction;
1660
- var previous_component_context = component_context;
1661
- var previous_batch = current_batch;
1662
- return function restore(activate_batch = true) {
1663
- set_active_effect(previous_effect);
1664
- set_active_reaction(previous_reaction);
1665
- set_component_context(previous_component_context);
1666
- if (activate_batch && (previous_effect.f & 16384) === 0) {
1667
- previous_batch?.activate();
1668
- previous_batch?.apply();
1737
+ function _traverse(root, effects, render_effects) {
1738
+ root.f ^= CLEAN;
1739
+ var effect = root.first;
1740
+ while (effect !== null) {
1741
+ var flags = effect.f;
1742
+ var is_branch = (flags & 96) !== 0;
1743
+ if (!(is_branch && (flags & 1024) !== 0 || (flags & 8192) !== 0 || _classPrivateFieldGet2(_skipped_branches, this).has(effect)) && effect.fn !== null) {
1744
+ if (is_branch) effect.f ^= CLEAN;
1745
+ else if ((flags & 4) !== 0) effects.push(effect);
1746
+ else if (async_mode_flag && (flags & 16777224) !== 0) render_effects.push(effect);
1747
+ else if (is_dirty(effect)) {
1748
+ if ((flags & 16) !== 0) _classPrivateFieldGet2(_maybe_dirty_effects, this).add(effect);
1749
+ update_effect(effect);
1750
+ }
1751
+ var child = effect.first;
1752
+ if (child !== null) {
1753
+ effect = child;
1754
+ continue;
1755
+ }
1669
1756
  }
1670
- };
1757
+ while (effect !== null) {
1758
+ var next = effect.next;
1759
+ if (next !== null) {
1760
+ effect = next;
1761
+ break;
1762
+ }
1763
+ effect = effect.parent;
1764
+ }
1765
+ }
1671
1766
  }
1672
- function unset_context(deactivate_batch = true) {
1673
- set_active_effect(null);
1674
- set_active_reaction(null);
1675
- set_component_context(null);
1676
- if (deactivate_batch) current_batch?.deactivate();
1767
+ function _find_earlier_batch() {
1768
+ var batch = _classPrivateFieldGet2(_prev, this);
1769
+ while (batch !== null) {
1770
+ if (!batch.is_fork) {
1771
+ for (const [value, [, is_derived]] of this.current) if (batch.current.has(value) && !is_derived) return batch;
1772
+ }
1773
+ batch = _classPrivateFieldGet2(_prev, batch);
1774
+ }
1775
+ return null;
1677
1776
  }
1678
1777
  /**
1679
- * @returns {(skip?: boolean) => void}
1778
+ * @param {Batch} batch
1680
1779
  */
1681
- function increment_pending() {
1682
- var effect = active_effect;
1683
- var boundary = effect.b;
1684
- var batch = current_batch;
1685
- var blocking = boundary.is_rendered();
1686
- boundary.update_pending_count(1, batch);
1687
- batch.increment(blocking, effect);
1688
- return (skip = false) => {
1689
- boundary.update_pending_count(-1, batch);
1690
- batch.decrement(blocking, effect, skip);
1780
+ function _merge(batch) {
1781
+ for (const [source, value] of batch.current) {
1782
+ if (!this.previous.has(source) && batch.previous.has(source)) this.previous.set(source, batch.previous.get(source));
1783
+ this.current.set(source, value);
1784
+ }
1785
+ for (const [effect, deferred] of batch.async_deriveds) {
1786
+ const d = this.async_deriveds.get(effect);
1787
+ if (d) deferred.promise.then(d.resolve).catch(d.reject);
1788
+ }
1789
+ batch.async_deriveds.clear();
1790
+ this.transfer_effects(_classPrivateFieldGet2(_dirty_effects, batch), _classPrivateFieldGet2(_maybe_dirty_effects, batch));
1791
+ /**
1792
+ * mark all effects that depend on `batch.current`, except the
1793
+ * async effects that we just resolved (TODO unless they depend
1794
+ * on values in this batch that are NOT in the later batch?).
1795
+ * Through this we also will populate the correct #skipped_branches,
1796
+ * oncommit callbacks etc, so we don't need to merge them separately.
1797
+ * @param {Value} value
1798
+ */
1799
+ const mark = (value) => {
1800
+ var reactions = value.reactions;
1801
+ if (reactions === null) return;
1802
+ if ((value.f & 2) !== 0 && (value.f & 6144) === 0) return;
1803
+ for (const reaction of reactions) {
1804
+ var flags = reaction.f;
1805
+ if ((flags & 2) !== 0) mark(reaction);
1806
+ else {
1807
+ var effect = reaction;
1808
+ if (flags & 4194320 && !this.async_deriveds.has(effect)) {
1809
+ _classPrivateFieldGet2(_maybe_dirty_effects, this).delete(effect);
1810
+ set_signal_status(effect, DIRTY);
1811
+ this.schedule(effect);
1812
+ }
1813
+ }
1814
+ }
1691
1815
  };
1816
+ for (const source of this.current.keys()) mark(source);
1817
+ this.oncommit(() => batch.discard());
1818
+ _assertClassBrand(_Batch_brand, batch, _unlink).call(batch);
1819
+ current_batch = this;
1820
+ _assertClassBrand(_Batch_brand, this, _process).call(this);
1692
1821
  }
1693
1822
  /**
1694
- * @template V
1695
- * @param {() => V} fn
1696
- * @returns {Derived<V>}
1823
+ * @param {Effect[]} effects
1697
1824
  */
1698
- /* @__NO_SIDE_EFFECTS__ */
1699
- function derived(fn) {
1700
- var flags = 2 | DIRTY;
1701
- if (active_effect !== null) active_effect.f |= EFFECT_PRESERVED;
1702
- return {
1703
- ctx: component_context,
1704
- deps: null,
1705
- effects: null,
1706
- equals,
1707
- f: flags,
1708
- fn,
1709
- reactions: null,
1710
- rv: 0,
1711
- v: UNINITIALIZED,
1712
- wv: 0,
1713
- parent: active_effect,
1714
- ac: null
1715
- };
1825
+ function _defer_effects(effects) {
1826
+ for (var i = 0; i < effects.length; i += 1) defer_effect(effects[i], _classPrivateFieldGet2(_dirty_effects, this), _classPrivateFieldGet2(_maybe_dirty_effects, this));
1716
1827
  }
1717
- /**
1718
- * @template V
1719
- * @param {() => V | Promise<V>} fn
1720
- * @param {string} [label]
1721
- * @param {string} [location] If provided, print a warning if the value is not read immediately after update
1722
- * @returns {Promise<Source<V>>}
1723
- */
1724
- /* @__NO_SIDE_EFFECTS__ */
1725
- function async_derived(fn, label, location) {
1726
- let parent = active_effect;
1727
- if (parent === null) async_derived_orphan();
1728
- var promise = void 0;
1729
- var signal = source(UNINITIALIZED);
1730
- var should_suspend = !active_reaction;
1731
- /** @type {Map<Batch, ReturnType<typeof deferred<V>>>} */
1732
- var deferreds = /* @__PURE__ */ new Map();
1733
- async_effect(() => {
1734
- var effect = active_effect;
1735
- /** @type {ReturnType<typeof deferred<V>>} */
1736
- var d = deferred();
1737
- promise = d.promise;
1738
- try {
1739
- Promise.resolve(fn()).then(d.resolve, d.reject).finally(unset_context);
1740
- } catch (error) {
1741
- d.reject(error);
1742
- unset_context();
1743
- }
1744
- var batch = current_batch;
1745
- if (should_suspend) {
1746
- if ((effect.f & 32768) !== 0) var decrement_pending = increment_pending();
1747
- if (parent.b.is_rendered()) {
1748
- deferreds.get(batch)?.reject(STALE_REACTION);
1749
- deferreds.delete(batch);
1750
- } else {
1751
- for (const d of deferreds.values()) d.reject(STALE_REACTION);
1752
- deferreds.clear();
1828
+ function _commit$1() {
1829
+ for (let batch = first_batch; batch !== null; batch = _classPrivateFieldGet2(_next, batch)) {
1830
+ var is_earlier = batch.id < this.id;
1831
+ /** @type {Source[]} */
1832
+ var sources = [];
1833
+ for (const [source, [value, is_derived]] of this.current) {
1834
+ if (batch.current.has(source)) {
1835
+ var batch_value = batch.current.get(source)[0];
1836
+ if (is_earlier && value !== batch_value) batch.current.set(source, [value, is_derived]);
1837
+ else continue;
1753
1838
  }
1754
- deferreds.set(batch, d);
1839
+ sources.push(source);
1755
1840
  }
1756
- /**
1757
- * @param {any} value
1758
- * @param {unknown} error
1759
- */
1760
- const handler = (value, error = void 0) => {
1761
- if (decrement_pending) decrement_pending(error === STALE_REACTION);
1762
- if (error === STALE_REACTION || (effect.f & 16384) !== 0) return;
1841
+ if (is_earlier) for (const [effect, deferred] of this.async_deriveds) {
1842
+ const d = batch.async_deriveds.get(effect);
1843
+ if (d) deferred.promise.then(d.resolve).catch(d.reject);
1844
+ }
1845
+ var current = [...batch.current.keys()].filter((source) => !batch.current.get(source)[1]);
1846
+ if (!_classPrivateFieldGet2(_started, batch) || current.length === 0) continue;
1847
+ var others = current.filter((source) => !this.current.has(source));
1848
+ if (others.length === 0) {
1849
+ if (is_earlier) batch.discard();
1850
+ } else if (sources.length > 0) {
1851
+ if (is_earlier) for (const unskipped of _classPrivateFieldGet2(_unskipped_branches, this)) batch.unskip_effect(unskipped, (e) => {
1852
+ if ((e.f & 4194320) !== 0) batch.schedule(e);
1853
+ else _assertClassBrand(_Batch_brand, batch, _defer_effects).call(batch, [e]);
1854
+ });
1763
1855
  batch.activate();
1764
- if (error) {
1765
- signal.f |= ERROR_VALUE;
1766
- internal_set(signal, error);
1767
- } else {
1768
- if ((signal.f & 8388608) !== 0) signal.f ^= ERROR_VALUE;
1769
- internal_set(signal, value);
1770
- for (const [b, d] of deferreds) {
1771
- deferreds.delete(b);
1772
- if (b === batch) break;
1773
- d.reject(STALE_REACTION);
1774
- }
1856
+ /** @type {Set<Value>} */
1857
+ var marked = /* @__PURE__ */ new Set();
1858
+ /** @type {Map<Reaction, boolean>} */
1859
+ var checked = /* @__PURE__ */ new Map();
1860
+ for (var source of sources) mark_effects(source, others, marked, checked);
1861
+ checked = /* @__PURE__ */ new Map();
1862
+ var current_unequal = [...batch.current].filter(([c, v1]) => {
1863
+ const v2 = this.current.get(c);
1864
+ if (!v2) return true;
1865
+ return v2[0] !== v1[0] || v2[1] !== v1[1];
1866
+ }).map(([c]) => c);
1867
+ if (current_unequal.length > 0) {
1868
+ for (const effect of _classPrivateFieldGet2(_new_effects, this)) if ((effect.f & 155648) === 0 && depends_on(effect, current_unequal, checked)) if ((effect.f & 4194320) !== 0) {
1869
+ set_signal_status(effect, DIRTY);
1870
+ batch.schedule(effect);
1871
+ } else _classPrivateFieldGet2(_dirty_effects, batch).add(effect);
1775
1872
  }
1776
- batch.deactivate();
1777
- };
1778
- d.promise.then(handler, (e) => handler(null, e || "unknown"));
1779
- });
1780
- teardown(() => {
1781
- for (const d of deferreds.values()) d.reject(STALE_REACTION);
1782
- });
1783
- return new Promise((fulfil) => {
1784
- /** @param {Promise<V>} p */
1785
- function next(p) {
1786
- function go() {
1787
- if (p === promise) fulfil(signal);
1788
- else next(promise);
1873
+ if (_classPrivateFieldGet2(_roots, batch).length > 0 && !_classPrivateFieldGet2(_decrement_queued, batch)) {
1874
+ batch.apply();
1875
+ for (var root of _classPrivateFieldGet2(_roots, batch)) _assertClassBrand(_Batch_brand, batch, _traverse).call(batch, root, [], []);
1876
+ _classPrivateFieldSet2(_roots, batch, []);
1789
1877
  }
1790
- p.then(go, go);
1878
+ batch.deactivate();
1791
1879
  }
1792
- next(promise);
1793
- });
1880
+ }
1881
+ }
1882
+ function _unlink() {
1883
+ if (!this.linked) return;
1884
+ var prev = _classPrivateFieldGet2(_prev, this);
1885
+ var next = _classPrivateFieldGet2(_next, this);
1886
+ if (prev === null) first_batch = next;
1887
+ else _classPrivateFieldSet2(_next, prev, next);
1888
+ if (next === null) last_batch = prev;
1889
+ else _classPrivateFieldSet2(_prev, next, prev);
1890
+ this.linked = false;
1891
+ }
1892
+ /**
1893
+ * Synchronously flush any pending updates.
1894
+ * Returns void if no callback is provided, otherwise returns the result of calling the callback.
1895
+ * @template [T=void]
1896
+ * @param {(() => T) | undefined} [fn]
1897
+ * @returns {T}
1898
+ */
1899
+ function flushSync(fn) {
1900
+ var was_flushing_sync = is_flushing_sync;
1901
+ is_flushing_sync = true;
1902
+ try {
1903
+ var result;
1904
+ if (fn) {
1905
+ if (current_batch !== null && !current_batch.is_fork) current_batch.flush();
1906
+ result = fn();
1907
+ }
1908
+ while (true) {
1909
+ flush_tasks();
1910
+ if (current_batch === null) return result;
1911
+ current_batch.flush();
1912
+ }
1913
+ } finally {
1914
+ is_flushing_sync = was_flushing_sync;
1915
+ }
1794
1916
  }
1795
- /**
1796
- * @template V
1797
- * @param {() => V} fn
1798
- * @returns {Derived<V>}
1799
- */
1800
- /* @__NO_SIDE_EFFECTS__ */
1801
- function user_derived(fn) {
1802
- const d = /* @__PURE__ */ derived(fn);
1803
- if (!async_mode_flag) push_reaction_value(d);
1804
- return d;
1917
+ function infinite_loop_guard() {
1918
+ try {
1919
+ effect_update_depth_exceeded();
1920
+ } catch (error) {
1921
+ invoke_error_boundary(error, last_scheduled_effect);
1922
+ }
1805
1923
  }
1924
+ /** @type {Set<Effect> | null} */
1925
+ var eager_block_effects = null;
1806
1926
  /**
1807
- * @template V
1808
- * @param {() => V} fn
1809
- * @returns {Derived<V>}
1927
+ * @param {Array<Effect>} effects
1928
+ * @returns {void}
1810
1929
  */
1811
- /* @__NO_SIDE_EFFECTS__ */
1812
- function derived_safe_equal(fn) {
1813
- const signal = /* @__PURE__ */ derived(fn);
1814
- signal.equals = safe_equals;
1815
- return signal;
1930
+ function flush_queued_effects(effects) {
1931
+ var length = effects.length;
1932
+ if (length === 0) return;
1933
+ var i = 0;
1934
+ while (i < length) {
1935
+ var effect = effects[i++];
1936
+ if ((effect.f & 24576) === 0 && is_dirty(effect)) {
1937
+ eager_block_effects = /* @__PURE__ */ new Set();
1938
+ update_effect(effect);
1939
+ if (effect.deps === null && effect.first === null && effect.nodes === null && effect.teardown === null && effect.ac === null) unlink_effect(effect);
1940
+ if (eager_block_effects?.size > 0) {
1941
+ old_values.clear();
1942
+ for (const e of eager_block_effects) {
1943
+ if ((e.f & 24576) !== 0) continue;
1944
+ /** @type {Effect[]} */
1945
+ const ordered_effects = [e];
1946
+ let ancestor = e.parent;
1947
+ while (ancestor !== null) {
1948
+ if (eager_block_effects.has(ancestor)) {
1949
+ eager_block_effects.delete(ancestor);
1950
+ ordered_effects.push(ancestor);
1951
+ }
1952
+ ancestor = ancestor.parent;
1953
+ }
1954
+ for (let j = ordered_effects.length - 1; j >= 0; j--) {
1955
+ const e = ordered_effects[j];
1956
+ if ((e.f & 24576) !== 0) continue;
1957
+ update_effect(e);
1958
+ }
1959
+ }
1960
+ eager_block_effects.clear();
1961
+ }
1962
+ }
1963
+ }
1964
+ eager_block_effects = null;
1816
1965
  }
1817
1966
  /**
1818
- * @param {Derived} derived
1819
- * @returns {void}
1967
+ * This is similar to `mark_reactions`, but it only marks async/block effects
1968
+ * depending on `value` and at least one of the other `sources`, so that
1969
+ * these effects can re-run after another batch has been committed
1970
+ * @param {Value} value
1971
+ * @param {Source[]} sources
1972
+ * @param {Set<Value>} marked
1973
+ * @param {Map<Reaction, boolean>} checked
1820
1974
  */
1821
- function destroy_derived_effects(derived) {
1822
- var effects = derived.effects;
1823
- if (effects !== null) {
1824
- derived.effects = null;
1825
- for (var i = 0; i < effects.length; i += 1) destroy_effect(effects[i]);
1975
+ function mark_effects(value, sources, marked, checked) {
1976
+ if (marked.has(value)) return;
1977
+ marked.add(value);
1978
+ if (value.reactions !== null) for (const reaction of value.reactions) {
1979
+ const flags = reaction.f;
1980
+ if ((flags & 2) !== 0) mark_effects(reaction, sources, marked, checked);
1981
+ else if ((flags & 4194320) !== 0 && (flags & 2048) === 0 && depends_on(reaction, sources, checked)) {
1982
+ set_signal_status(reaction, DIRTY);
1983
+ schedule_effect(reaction);
1984
+ }
1826
1985
  }
1827
1986
  }
1828
1987
  /**
1829
- * @template T
1830
- * @param {Derived} derived
1831
- * @returns {T}
1988
+ * @param {Reaction} reaction
1989
+ * @param {Source[]} sources
1990
+ * @param {Map<Reaction, boolean>} checked
1832
1991
  */
1833
- function execute_derived(derived) {
1834
- var value;
1835
- var prev_active_effect = active_effect;
1836
- var parent = derived.parent;
1837
- if (!is_destroying_effect && parent !== null && (parent.f & 24576) !== 0) {
1838
- derived_inert();
1839
- return derived.v;
1840
- }
1841
- set_active_effect(parent);
1842
- try {
1843
- derived.f &= ~WAS_MARKED;
1844
- destroy_derived_effects(derived);
1845
- value = update_reaction(derived);
1846
- } finally {
1847
- set_active_effect(prev_active_effect);
1992
+ function depends_on(reaction, sources, checked) {
1993
+ const depends = checked.get(reaction);
1994
+ if (depends !== void 0) return depends;
1995
+ if (reaction.deps !== null) for (const dep of reaction.deps) {
1996
+ if (includes.call(sources, dep)) return true;
1997
+ if ((dep.f & 2) !== 0 && depends_on(dep, sources, checked)) {
1998
+ checked.set(dep, true);
1999
+ return true;
2000
+ }
1848
2001
  }
1849
- return value;
2002
+ checked.set(reaction, false);
2003
+ return false;
1850
2004
  }
1851
2005
  /**
1852
- * @param {Derived} derived
2006
+ * @param {Effect} effect
1853
2007
  * @returns {void}
1854
2008
  */
1855
- function update_derived(derived) {
1856
- var value = execute_derived(derived);
1857
- if (!derived.equals(value)) {
1858
- derived.wv = increment_write_version();
1859
- if (!current_batch?.is_fork || derived.deps === null) {
1860
- if (current_batch !== null) current_batch.capture(derived, value, true);
1861
- else derived.v = value;
1862
- if (derived.deps === null) {
1863
- set_signal_status(derived, CLEAN);
1864
- return;
1865
- }
1866
- }
1867
- }
1868
- if (is_destroying_effect) return;
1869
- if (batch_values !== null) {
1870
- if (effect_tracking() || current_batch?.is_fork) batch_values.set(derived, value);
1871
- } else update_derived_status(derived);
2009
+ function schedule_effect(effect) {
2010
+ /** @type {Batch} */ current_batch.schedule(effect);
1872
2011
  }
1873
2012
  /**
1874
- * @param {Derived} derived
2013
+ * Mark all the effects inside a skipped branch CLEAN, so that
2014
+ * they can be correctly rescheduled later. Tracks dirty and maybe_dirty
2015
+ * effects so they can be rescheduled if the branch survives.
2016
+ * @param {Effect} effect
2017
+ * @param {{ d: Effect[], m: Effect[] }} tracked
1875
2018
  */
1876
- function freeze_derived_effects(derived) {
1877
- if (derived.effects === null) return;
1878
- for (const e of derived.effects) if (e.teardown || e.ac) {
1879
- e.teardown?.();
1880
- e.ac?.abort(STALE_REACTION);
1881
- e.teardown = noop;
1882
- e.ac = null;
1883
- remove_reactions(e, 0);
1884
- destroy_effect_children(e);
2019
+ function reset_branch(effect, tracked) {
2020
+ if ((effect.f & 32) !== 0 && (effect.f & 1024) !== 0) return;
2021
+ if ((effect.f & 2048) !== 0) tracked.d.push(effect);
2022
+ else if ((effect.f & 4096) !== 0) tracked.m.push(effect);
2023
+ set_signal_status(effect, CLEAN);
2024
+ var e = effect.first;
2025
+ while (e !== null) {
2026
+ reset_branch(e, tracked);
2027
+ e = e.next;
1885
2028
  }
1886
2029
  }
1887
2030
  /**
1888
- * @param {Derived} derived
2031
+ * Mark an entire effect tree clean following an error
2032
+ * @param {Effect} effect
1889
2033
  */
1890
- function unfreeze_derived_effects(derived) {
1891
- if (derived.effects === null) return;
1892
- for (const e of derived.effects) if (e.teardown) update_effect(e);
2034
+ function reset_all(effect) {
2035
+ set_signal_status(effect, CLEAN);
2036
+ var e = effect.first;
2037
+ while (e !== null) {
2038
+ reset_all(e);
2039
+ e = e.next;
2040
+ }
1893
2041
  }
1894
2042
  //#endregion
1895
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/sources.js
2043
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/sources.js
1896
2044
  /** @import { Derived, Effect, Source, Value } from '#client' */
1897
- /** @type {Set<any>} */
2045
+ /** @type {Set<Effect>} */
1898
2046
  var eager_effects = /* @__PURE__ */ new Set();
1899
2047
  /** @type {Map<Source, any>} */
1900
2048
  var old_values = /* @__PURE__ */ new Map();
@@ -1920,7 +2068,7 @@ function source(v, stack) {
1920
2068
  * @param {V} v
1921
2069
  * @param {Error | null} [stack]
1922
2070
  */
1923
- /* @__NO_SIDE_EFFECTS__ */
2071
+ /*#__NO_SIDE_EFFECTS__*/
1924
2072
  function state(v, stack) {
1925
2073
  const s = source(v, stack);
1926
2074
  push_reaction_value(s);
@@ -1932,7 +2080,7 @@ function state(v, stack) {
1932
2080
  * @param {boolean} [immutable]
1933
2081
  * @returns {Source<V>}
1934
2082
  */
1935
- /* @__NO_SIDE_EFFECTS__ */
2083
+ /*#__NO_SIDE_EFFECTS__*/
1936
2084
  function mutable_source(initial_value, immutable = false, trackable = true) {
1937
2085
  const s = source(initial_value);
1938
2086
  if (!immutable) s.equals = safe_equals;
@@ -1950,7 +2098,7 @@ function mutable_source(initial_value, immutable = false, trackable = true) {
1950
2098
  * @returns {V}
1951
2099
  */
1952
2100
  function set(source, value, should_proxy = false) {
1953
- 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();
2101
+ 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();
1954
2102
  return internal_set(source, should_proxy ? proxy(value) : value, legacy_updates);
1955
2103
  }
1956
2104
  /**
@@ -1982,7 +2130,13 @@ function flush_eager_effects() {
1982
2130
  eager_effects_deferred = false;
1983
2131
  for (const effect of eager_effects) {
1984
2132
  if ((effect.f & 1024) !== 0) set_signal_status(effect, MAYBE_DIRTY);
1985
- if (is_dirty(effect)) update_effect(effect);
2133
+ let dirty;
2134
+ try {
2135
+ dirty = is_dirty(effect);
2136
+ } catch {
2137
+ dirty = true;
2138
+ }
2139
+ if (dirty) update_effect(effect);
1986
2140
  }
1987
2141
  eager_effects.clear();
1988
2142
  }
@@ -2010,7 +2164,8 @@ function mark_reactions(signal, status, updated_during_traversal) {
2010
2164
  if (!runes && reaction === active_effect) continue;
2011
2165
  var not_dirty = (flags & DIRTY) === 0;
2012
2166
  if (not_dirty) set_signal_status(reaction, status);
2013
- if ((flags & 2) !== 0) {
2167
+ if ((flags & 131072) !== 0) eager_effects.add(reaction);
2168
+ else if ((flags & 2) !== 0) {
2014
2169
  var derived = reaction;
2015
2170
  batch_values?.delete(derived);
2016
2171
  if ((flags & 65536) === 0) {
@@ -2184,7 +2339,7 @@ function proxy(value) {
2184
2339
  });
2185
2340
  }
2186
2341
  //#endregion
2187
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/operations.js
2342
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/operations.js
2188
2343
  /** @import { Effect, TemplateNode } from '#client' */
2189
2344
  /** @type {Window} */
2190
2345
  var $window;
@@ -2208,13 +2363,13 @@ function init_operations() {
2208
2363
  first_child_getter = get_descriptor(node_prototype, "firstChild").get;
2209
2364
  next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
2210
2365
  if (is_extensible(element_prototype)) {
2211
- element_prototype.__click = void 0;
2212
- element_prototype.__className = void 0;
2213
- element_prototype.__attributes = null;
2214
- element_prototype.__style = void 0;
2366
+ /** @type {any} */ element_prototype[CLASS_CACHE] = void 0;
2367
+ /** @type {any} */ element_prototype[ATTRIBUTES_CACHE] = null;
2368
+ /** @type {any} */ element_prototype[STYLE_CACHE] = void 0;
2215
2369
  element_prototype.__e = void 0;
2216
2370
  }
2217
- if (is_extensible(text_prototype)) text_prototype.__t = void 0;
2371
+ if (is_extensible(text_prototype))
2372
+ /** @type {any} */ text_prototype[TEXT_CACHE] = void 0;
2218
2373
  }
2219
2374
  /**
2220
2375
  * @param {string} value
@@ -2227,7 +2382,7 @@ function create_text(value = "") {
2227
2382
  * @template {Node} N
2228
2383
  * @param {N} node
2229
2384
  */
2230
- /* @__NO_SIDE_EFFECTS__ */
2385
+ /*@__NO_SIDE_EFFECTS__*/
2231
2386
  function get_first_child(node) {
2232
2387
  return first_child_getter.call(node);
2233
2388
  }
@@ -2235,7 +2390,7 @@ function get_first_child(node) {
2235
2390
  * @template {Node} N
2236
2391
  * @param {N} node
2237
2392
  */
2238
- /* @__NO_SIDE_EFFECTS__ */
2393
+ /*@__NO_SIDE_EFFECTS__*/
2239
2394
  function get_next_sibling(node) {
2240
2395
  return next_sibling_getter.call(node);
2241
2396
  }
@@ -2331,6 +2486,12 @@ function should_defer_append() {
2331
2486
  return (active_effect.f & REACTION_RAN) !== 0;
2332
2487
  }
2333
2488
  /**
2489
+ * Branching here is intentional and load-bearing for perf. `createElement(tag)`
2490
+ * hits a fast path in Blink that `createElementNS(NAMESPACE_HTML, tag)` doesn't,
2491
+ * and passing an explicit `undefined` as the trailing options arg measurably
2492
+ * slows both APIs. Funnelling every case through a single `createElementNS(ns,
2493
+ * tag, options)` call would be smaller but slower on the HTML path.
2494
+ *
2334
2495
  * @template {keyof HTMLElementTagNameMap | string} T
2335
2496
  * @param {T} tag
2336
2497
  * @param {string} [namespace]
@@ -2338,8 +2499,8 @@ function should_defer_append() {
2338
2499
  * @returns {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element}
2339
2500
  */
2340
2501
  function create_element(tag, namespace, is) {
2341
- let options = is ? { is } : void 0;
2342
- return document.createElementNS(namespace ?? "http://www.w3.org/1999/xhtml", tag, options);
2502
+ if (namespace == null || namespace === "http://www.w3.org/1999/xhtml") return is ? document.createElement(tag, { is }) : document.createElement(tag);
2503
+ return is ? document.createElementNS(namespace, tag, { is }) : document.createElementNS(namespace, tag);
2343
2504
  }
2344
2505
  /**
2345
2506
  * Browsers split text nodes larger than 65536 bytes when parsing.
@@ -2356,38 +2517,7 @@ function merge_text_nodes(text) {
2356
2517
  }
2357
2518
  }
2358
2519
  //#endregion
2359
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/misc.js
2360
- var listening_to_form_reset = false;
2361
- function add_form_reset_listener() {
2362
- if (!listening_to_form_reset) {
2363
- listening_to_form_reset = true;
2364
- document.addEventListener("reset", (evt) => {
2365
- Promise.resolve().then(() => {
2366
- if (!evt.defaultPrevented) for (const e of evt.target.elements) e.__on_r?.();
2367
- });
2368
- }, { capture: true });
2369
- }
2370
- }
2371
- //#endregion
2372
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js
2373
- /**
2374
- * @template T
2375
- * @param {() => T} fn
2376
- */
2377
- function without_reactive_context(fn) {
2378
- var previous_reaction = active_reaction;
2379
- var previous_effect = active_effect;
2380
- set_active_reaction(null);
2381
- set_active_effect(null);
2382
- try {
2383
- return fn();
2384
- } finally {
2385
- set_active_reaction(previous_reaction);
2386
- set_active_effect(previous_effect);
2387
- }
2388
- }
2389
- //#endregion
2390
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/effects.js
2520
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/effects.js
2391
2521
  /** @import { Blocker, ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */
2392
2522
  /**
2393
2523
  * @param {'$effect' | '$effect.pre' | '$inspect'} rune
@@ -2487,7 +2617,7 @@ function teardown(fn) {
2487
2617
  function user_effect(fn) {
2488
2618
  validate_effect("$effect");
2489
2619
  var flags = active_effect.f;
2490
- if (!active_reaction && (flags & 32) !== 0 && (flags & 32768) === 0) {
2620
+ if (!active_reaction && (flags & 32) !== 0 && component_context !== null && !component_context.i) {
2491
2621
  var context = component_context;
2492
2622
  (context.e ?? (context.e = [])).push(fn);
2493
2623
  } else return create_user_effect(fn);
@@ -2560,7 +2690,9 @@ function render_effect(fn, flags = 0) {
2560
2690
  */
2561
2691
  function template_effect(fn, sync = [], async = [], blockers = []) {
2562
2692
  flatten(blockers, sync, async, (values) => {
2563
- create_effect(8, () => fn(...values.map(get)));
2693
+ create_effect(8, () => {
2694
+ fn(...values.map(get));
2695
+ });
2564
2696
  });
2565
2697
  }
2566
2698
  /**
@@ -2636,7 +2768,7 @@ function destroy_effect(effect, remove_dom = true) {
2636
2768
  remove_effect_dom(effect.nodes.start, effect.nodes.end);
2637
2769
  removed = true;
2638
2770
  }
2639
- set_signal_status(effect, DESTROYING);
2771
+ effect.f |= DESTROYING;
2640
2772
  destroy_effect_children(effect, remove_dom && !removed);
2641
2773
  remove_reactions(effect, 0);
2642
2774
  var transitions = effect.nodes && effect.nodes.t;
@@ -2771,15 +2903,18 @@ function move_effect(effect, fragment) {
2771
2903
  }
2772
2904
  }
2773
2905
  //#endregion
2774
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/legacy.js
2906
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/legacy.js
2775
2907
  /**
2776
2908
  * @type {Set<Value> | null}
2777
2909
  * @deprecated
2778
2910
  */
2779
2911
  var captured_signals = null;
2780
2912
  //#endregion
2781
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/runtime.js
2913
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/runtime.js
2782
2914
  /** @import { Derived, Effect, Reaction, Source, Value } from '#client' */
2915
+ /**
2916
+ * True if updating in an effect context that is reactive (i.e. not branch/root effects)
2917
+ */
2783
2918
  var is_updating_effect = false;
2784
2919
  var is_destroying_effect = false;
2785
2920
  /** @param {boolean} value */
@@ -2802,13 +2937,12 @@ function set_active_effect(effect) {
2802
2937
  /**
2803
2938
  * When sources are created within a reaction, reading and writing
2804
2939
  * them within that reaction should not cause a re-run
2805
- * @type {null | Source[]}
2940
+ * @type {null | Set<Source>}
2806
2941
  */
2807
2942
  var current_sources = null;
2808
2943
  /** @param {Value} value */
2809
2944
  function push_reaction_value(value) {
2810
- if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & 2) !== 0)) if (current_sources === null) current_sources = [value];
2811
- else current_sources.push(value);
2945
+ if (active_reaction !== null && (!async_mode_flag || (active_reaction.f & 2) !== 0)) (current_sources ?? (current_sources = /* @__PURE__ */ new Set())).add(value);
2812
2946
  }
2813
2947
  /**
2814
2948
  * The dependencies of the reaction that is currently being executed. In many cases,
@@ -2873,7 +3007,7 @@ function is_dirty(reaction) {
2873
3007
  function schedule_possible_effect_self_invalidation(signal, effect, root = true) {
2874
3008
  var reactions = signal.reactions;
2875
3009
  if (reactions === null) return;
2876
- if (!async_mode_flag && current_sources !== null && includes.call(current_sources, signal)) return;
3010
+ if (!async_mode_flag && current_sources !== null && current_sources.has(signal)) return;
2877
3011
  for (var i = 0; i < reactions.length; i++) {
2878
3012
  var reaction = reactions[i];
2879
3013
  if ((reaction.f & 2) !== 0) schedule_possible_effect_self_invalidation(reaction, effect, false);
@@ -2981,6 +3115,11 @@ function remove_reaction(signal, dependency) {
2981
3115
  derived.f &= ~WAS_MARKED;
2982
3116
  }
2983
3117
  if (derived.v !== UNINITIALIZED) update_derived_status(derived);
3118
+ if (derived.ac !== null) without_reactive_context(() => {
3119
+ /** @type {AbortController} */ derived.ac.abort(STALE_REACTION);
3120
+ derived.ac = null;
3121
+ set_signal_status(derived, DIRTY);
3122
+ });
2984
3123
  freeze_derived_effects(derived);
2985
3124
  remove_reactions(derived, 0);
2986
3125
  }
@@ -3006,7 +3145,7 @@ function update_effect(effect) {
3006
3145
  var previous_effect = active_effect;
3007
3146
  var was_updating_effect = is_updating_effect;
3008
3147
  active_effect = effect;
3009
- is_updating_effect = true;
3148
+ is_updating_effect = (flags & 96) === 0;
3010
3149
  try {
3011
3150
  if ((flags & 16777232) !== 0) destroy_block_effect_children(effect);
3012
3151
  else destroy_effect_children(effect);
@@ -3028,7 +3167,7 @@ function get(signal) {
3028
3167
  var is_derived = (signal.f & 2) !== 0;
3029
3168
  captured_signals?.add(signal);
3030
3169
  if (active_reaction !== null && !untracking) {
3031
- if (!(active_effect !== null && (active_effect.f & 16384) !== 0) && (current_sources === null || !includes.call(current_sources, signal))) {
3170
+ if (!(active_effect !== null && (active_effect.f & 16384) !== 0) && (current_sources === null || !current_sources.has(signal))) {
3032
3171
  var deps = active_reaction.deps;
3033
3172
  if ((active_reaction.f & 2097152) !== 0) {
3034
3173
  if (signal.rv < read_version) {
@@ -3039,7 +3178,8 @@ function get(signal) {
3039
3178
  }
3040
3179
  } else {
3041
3180
  var _active_reaction;
3042
- ((_active_reaction = active_reaction).deps ?? (_active_reaction.deps = [])).push(signal);
3181
+ (_active_reaction = active_reaction).deps ?? (_active_reaction.deps = []);
3182
+ if (!includes.call(active_reaction.deps, signal)) active_reaction.deps.push(signal);
3043
3183
  var reactions = signal.reactions;
3044
3184
  if (reactions === null) signal.reactions = [active_reaction];
3045
3185
  else if (!includes.call(reactions, active_reaction)) reactions.push(active_reaction);
@@ -3122,7 +3262,7 @@ function untrack(fn) {
3122
3262
  }
3123
3263
  }
3124
3264
  //#endregion
3125
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/events.js
3265
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/events.js
3126
3266
  /**
3127
3267
  * Used on elements, as a map of event type -> event handler,
3128
3268
  * and on events themselves to track which element handled an event
@@ -3179,8 +3319,7 @@ function handle_event_propagation(event) {
3179
3319
  */
3180
3320
  var other_errors = [];
3181
3321
  while (current_target !== null) {
3182
- /** @type {null | Element} */
3183
- var parent_element = current_target.assignedSlot || current_target.parentNode || current_target.host || null;
3322
+ if (current_target === handler_element) break;
3184
3323
  try {
3185
3324
  var delegated = current_target[event_symbol]?.[event_name];
3186
3325
  if (delegated != null && (!current_target.disabled || event.target === current_target)) delegated.call(current_target, event);
@@ -3188,8 +3327,9 @@ function handle_event_propagation(event) {
3188
3327
  if (throw_error) other_errors.push(error);
3189
3328
  else throw_error = error;
3190
3329
  }
3191
- if (event.cancelBubble || parent_element === handler_element || parent_element === null) break;
3192
- current_target = parent_element;
3330
+ if (event.cancelBubble) break;
3331
+ path_idx++;
3332
+ current_target = path_idx < path.length ? path[path_idx] : null;
3193
3333
  }
3194
3334
  if (throw_error) {
3195
3335
  for (let error of other_errors) queueMicrotask(() => {
@@ -3205,7 +3345,7 @@ function handle_event_propagation(event) {
3205
3345
  }
3206
3346
  }
3207
3347
  //#endregion
3208
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/reconciler.js
3348
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/reconciler.js
3209
3349
  var policy = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", {
3210
3350
  /** @param {string} html */
3211
3351
  createHTML: (html) => {
@@ -3224,7 +3364,7 @@ function create_fragment_from_html(html) {
3224
3364
  return elem.content;
3225
3365
  }
3226
3366
  //#endregion
3227
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/template.js
3367
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/template.js
3228
3368
  /** @import { Effect, EffectNodes, TemplateNode } from '#client' */
3229
3369
  /** @import { TemplateStructure } from './types' */
3230
3370
  /**
@@ -3245,7 +3385,7 @@ function assign_nodes(start, end) {
3245
3385
  * @param {number} flags
3246
3386
  * @returns {() => Node | Node[]}
3247
3387
  */
3248
- /* @__NO_SIDE_EFFECTS__ */
3388
+ /*#__NO_SIDE_EFFECTS__*/
3249
3389
  function from_html(content, flags) {
3250
3390
  var is_fragment = (flags & 1) !== 0;
3251
3391
  var use_import_node = (flags & 2) !== 0;
@@ -3280,7 +3420,7 @@ function from_html(content, flags) {
3280
3420
  * @param {'svg' | 'math'} ns
3281
3421
  * @returns {() => Node | Node[]}
3282
3422
  */
3283
- /* @__NO_SIDE_EFFECTS__ */
3423
+ /*#__NO_SIDE_EFFECTS__*/
3284
3424
  function from_namespace(content, flags, ns = "svg") {
3285
3425
  /**
3286
3426
  * Whether or not the first item is a text/element node. If not, we need to
@@ -3316,7 +3456,7 @@ function from_namespace(content, flags, ns = "svg") {
3316
3456
  * @param {string} content
3317
3457
  * @param {number} flags
3318
3458
  */
3319
- /* @__NO_SIDE_EFFECTS__ */
3459
+ /*#__NO_SIDE_EFFECTS__*/
3320
3460
  function from_svg(content, flags) {
3321
3461
  return /* @__PURE__ */ from_namespace(content, flags, "svg");
3322
3462
  }
@@ -3375,8 +3515,8 @@ function is_passive_event(name) {
3375
3515
  */
3376
3516
  function set_text(text, value) {
3377
3517
  var str = value == null ? "" : typeof value === "object" ? `${value}` : value;
3378
- if (str !== (text.__t ?? (text.__t = text.nodeValue))) {
3379
- text.__t = str;
3518
+ if (str !== (text[TEXT_CACHE] ?? (text[TEXT_CACHE] = text.nodeValue))) {
3519
+ /** @type {any} */ text[TEXT_CACHE] = str;
3380
3520
  text.nodeValue = `${str}`;
3381
3521
  }
3382
3522
  }
@@ -3556,7 +3696,7 @@ function unmount(component, options) {
3556
3696
  return Promise.resolve();
3557
3697
  }
3558
3698
  //#endregion
3559
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/blocks/branches.js
3699
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/blocks/branches.js
3560
3700
  /** @import { Effect, TemplateNode } from '#client' */
3561
3701
  var _batches = /* @__PURE__ */ new WeakMap();
3562
3702
  var _onscreen = /* @__PURE__ */ new WeakMap();
@@ -3598,6 +3738,7 @@ var BranchManager = class {
3598
3738
  } else {
3599
3739
  var offscreen = _classPrivateFieldGet2(_offscreen, this).get(key);
3600
3740
  if (offscreen) {
3741
+ resume_effect(offscreen.effect);
3601
3742
  _classPrivateFieldGet2(_onscreen, this).set(key, offscreen.effect);
3602
3743
  _classPrivateFieldGet2(_offscreen, this).delete(key);
3603
3744
  /** @type {TemplateNode} */ offscreen.fragment.lastChild.remove();
@@ -3678,7 +3819,7 @@ var BranchManager = class {
3678
3819
  }
3679
3820
  };
3680
3821
  //#endregion
3681
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/blocks/if.js
3822
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/blocks/if.js
3682
3823
  /** @import { TemplateNode } from '#client' */
3683
3824
  /**
3684
3825
  * @param {TemplateNode} node
@@ -3724,7 +3865,7 @@ function if_block(node, fn, elseif = false) {
3724
3865
  }, flags);
3725
3866
  }
3726
3867
  //#endregion
3727
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/blocks/each.js
3868
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/blocks/each.js
3728
3869
  /** @import { EachItem, EachOutroGroup, EachState, Effect, EffectNodes, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */
3729
3870
  /** @import { Batch } from '../../reactivity/batch.js'; */
3730
3871
  /**
@@ -4189,7 +4330,7 @@ function html(node, get_value, is_controlled = false, svg = false, mathml = fals
4189
4330
  });
4190
4331
  }
4191
4332
  //#endregion
4192
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/css.js
4333
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/css.js
4193
4334
  /**
4194
4335
  * @param {Node} anchor
4195
4336
  * @param {{ hash: string, code: string }} css
@@ -4207,7 +4348,7 @@ function append_styles$1(anchor, css) {
4207
4348
  });
4208
4349
  }
4209
4350
  //#endregion
4210
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/shared/attributes.js
4351
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/shared/attributes.js
4211
4352
  var whitespace = [..." \n\r\f\xA0\v"];
4212
4353
  /**
4213
4354
  * @param {any} value
@@ -4317,7 +4458,7 @@ function to_style(value, styles) {
4317
4458
  return value == null ? null : String(value);
4318
4459
  }
4319
4460
  //#endregion
4320
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/class.js
4461
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/class.js
4321
4462
  /**
4322
4463
  * @param {Element} dom
4323
4464
  * @param {boolean | number} is_html
@@ -4328,13 +4469,13 @@ function to_style(value, styles) {
4328
4469
  * @returns {Record<string, boolean> | undefined}
4329
4470
  */
4330
4471
  function set_class(dom, is_html, value, hash, prev_classes, next_classes) {
4331
- var prev = dom.__className;
4472
+ var prev = dom[CLASS_CACHE];
4332
4473
  if (hydrating || prev !== value || prev === void 0) {
4333
4474
  var next_class_name = to_class(value, hash, next_classes);
4334
4475
  if (!hydrating || next_class_name !== dom.getAttribute("class")) if (next_class_name == null) dom.removeAttribute("class");
4335
4476
  else if (is_html) dom.className = next_class_name;
4336
4477
  else dom.setAttribute("class", next_class_name);
4337
- dom.__className = value;
4478
+ /** @type {any} */ dom[CLASS_CACHE] = value;
4338
4479
  } else if (next_classes && prev_classes !== next_classes) for (var key in next_classes) {
4339
4480
  var is_present = !!next_classes[key];
4340
4481
  if (prev_classes == null || is_present !== !!prev_classes[key]) dom.classList.toggle(key, is_present);
@@ -4342,7 +4483,7 @@ function set_class(dom, is_html, value, hash, prev_classes, next_classes) {
4342
4483
  return next_classes;
4343
4484
  }
4344
4485
  //#endregion
4345
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/style.js
4486
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/style.js
4346
4487
  /**
4347
4488
  * @param {Element & ElementCSSInlineStyle} dom
4348
4489
  * @param {Record<string, any>} prev
@@ -4363,12 +4504,12 @@ function update_styles(dom, prev = {}, next, priority) {
4363
4504
  * @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [next_styles]
4364
4505
  */
4365
4506
  function set_style(dom, value, prev_styles, next_styles) {
4366
- var prev = dom.__style;
4507
+ var prev = dom[STYLE_CACHE];
4367
4508
  if (hydrating || prev !== value) {
4368
4509
  var next_style_attr = to_style(value, next_styles);
4369
4510
  if (!hydrating || next_style_attr !== dom.getAttribute("style")) if (next_style_attr == null) dom.removeAttribute("style");
4370
4511
  else dom.style.cssText = next_style_attr;
4371
- dom.__style = value;
4512
+ /** @type {any} */ dom[STYLE_CACHE] = value;
4372
4513
  } else if (next_styles) if (Array.isArray(next_styles)) {
4373
4514
  update_styles(dom, prev_styles?.[0], next_styles[0]);
4374
4515
  update_styles(dom, prev_styles?.[1], next_styles[1], "important");
@@ -4376,7 +4517,7 @@ function set_style(dom, value, prev_styles, next_styles) {
4376
4517
  return next_styles;
4377
4518
  }
4378
4519
  //#endregion
4379
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/attributes.js
4520
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/attributes.js
4380
4521
  /** @import { Blocker, Effect } from '#client' */
4381
4522
  var IS_CUSTOM_ELEMENT = Symbol("is custom element");
4382
4523
  var IS_HTML = Symbol("is html");
@@ -4405,7 +4546,7 @@ function remove_input_defaults(input) {
4405
4546
  input.checked = checked;
4406
4547
  }
4407
4548
  };
4408
- input.__on_r = remove_defaults;
4549
+ /** @type {any} */ input[FORM_RESET_HANDLER] = remove_defaults;
4409
4550
  queue_micro_task(remove_defaults);
4410
4551
  add_form_reset_listener();
4411
4552
  }
@@ -4453,7 +4594,7 @@ function set_attribute(element, attribute, value, skip_warning) {
4453
4594
  * @param {Element} element
4454
4595
  */
4455
4596
  function get_attributes(element) {
4456
- return element.__attributes ?? (element.__attributes = {
4597
+ return element[ATTRIBUTES_CACHE] ?? (element[ATTRIBUTES_CACHE] = {
4457
4598
  [IS_CUSTOM_ELEMENT]: element.nodeName.includes("-"),
4458
4599
  [IS_HTML]: element.namespaceURI === "http://www.w3.org/1999/xhtml"
4459
4600
  });
@@ -4471,13 +4612,13 @@ function get_setters(element) {
4471
4612
  var element_proto = Element.prototype;
4472
4613
  while (element_proto !== proto) {
4473
4614
  descriptors = get_descriptors(proto);
4474
- for (var key in descriptors) if (descriptors[key].set) setters.push(key);
4615
+ for (var key in descriptors) if (descriptors[key].set && key !== "innerHTML" && key !== "textContent" && key !== "innerText") setters.push(key);
4475
4616
  proto = get_prototype_of(proto);
4476
4617
  }
4477
4618
  return setters;
4478
4619
  }
4479
4620
  //#endregion
4480
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js
4621
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js
4481
4622
  var _ResizeObserverSingleton;
4482
4623
  var _listeners = /* @__PURE__ */ new WeakMap();
4483
4624
  var _observer = /* @__PURE__ */ new WeakMap();
@@ -4529,7 +4670,7 @@ function _getObserver() {
4529
4670
  }
4530
4671
  _defineProperty(ResizeObserverSingleton, "entries", /* @__PURE__ */ new WeakMap());
4531
4672
  //#endregion
4532
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/bindings/this.js
4673
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/bindings/this.js
4533
4674
  /** @import { ComponentContext, Effect } from '#client' */
4534
4675
  /**
4535
4676
  * @param {any} bound_value
@@ -4559,7 +4700,7 @@ function bind_this(element_or_component = {}, update, get_value, get_parts) {
4559
4700
  old_parts = parts;
4560
4701
  parts = get_parts?.() || [];
4561
4702
  untrack(() => {
4562
- if (element_or_component !== get_value(...parts)) {
4703
+ if (!is_bound_this(get_value(...parts), element_or_component)) {
4563
4704
  update(element_or_component, ...parts);
4564
4705
  if (old_parts && is_bound_this(get_value(...old_parts), element_or_component)) update(null, ...old_parts);
4565
4706
  }
@@ -4581,8 +4722,8 @@ function bind_this(element_or_component = {}, update, get_value, get_parts) {
4581
4722
  return element_or_component;
4582
4723
  }
4583
4724
  //#endregion
4584
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/reactivity/props.js
4585
- /** @import { Effect, Source } from './types.js' */
4725
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/reactivity/props.js
4726
+ /** @import { Derived, Effect, Source } from './types.js' */
4586
4727
  /**
4587
4728
  * This function is responsible for synchronizing a possibly bound prop with the inner component state.
4588
4729
  * It is used whenever the compiler sees that the component writes to the prop, or when it has a default prop_value.
@@ -4599,7 +4740,12 @@ function prop(props, key, flags, fallback) {
4599
4740
  var lazy = (flags & 16) !== 0;
4600
4741
  var fallback_value = fallback;
4601
4742
  var fallback_dirty = true;
4743
+ var fallback_signal = void 0;
4602
4744
  var get_fallback = () => {
4745
+ if (lazy && runes) {
4746
+ fallback_signal ?? (fallback_signal = /* @__PURE__ */ derived(fallback));
4747
+ return get(fallback_signal);
4748
+ }
4603
4749
  if (fallback_dirty) {
4604
4750
  fallback_dirty = false;
4605
4751
  fallback_value = lazy ? untrack(fallback) : fallback;
@@ -4669,7 +4815,7 @@ function prop(props, key, flags, fallback) {
4669
4815
  });
4670
4816
  }
4671
4817
  //#endregion
4672
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/legacy/legacy-client.js
4818
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/legacy/legacy-client.js
4673
4819
  /** @import { ComponentConstructorOptions, ComponentType, SvelteComponent, Component } from 'svelte' */
4674
4820
  /**
4675
4821
  * Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.
@@ -4788,7 +4934,7 @@ var Svelte4Component = class {
4788
4934
  }
4789
4935
  };
4790
4936
  //#endregion
4791
- //#region ../../../node_modules/.bun/svelte@5.55.5/node_modules/svelte/src/internal/client/dom/elements/custom-element.js
4937
+ //#region ../../../node_modules/.bun/svelte@5.56.8/node_modules/svelte/src/internal/client/dom/elements/custom-element.js
4792
4938
  /**
4793
4939
  * @typedef {Object} CustomElementPropDefinition
4794
4940
  * @property {string} [attribute]
@@ -5073,114 +5219,9 @@ function create_custom_element(Component, props_definition, slots, exports, shad
5073
5219
  return Class;
5074
5220
  }
5075
5221
  //#endregion
5076
- //#region ../../lib-svelte/styling/dist/index2.js
5077
- var e$1 = {
5078
- 50: "#e8f5e9",
5079
- 500: "#4caf50"
5080
- }, t$2 = {
5081
- 200: "#9fa8da",
5082
- 500: "#3f51b5",
5083
- 800: "#283593"
5084
- }, n$1 = { 500: "#ff9800" }, r$1 = {
5085
- 200: "#f48fb1",
5086
- 900: "#880e4f",
5087
- A400: "#f50057"
5088
- }, i = {
5089
- 50: "#ffebee",
5090
- 700: "#d32f2f"
5091
- }, a = {
5092
- TEXT: "black",
5093
- DISABLED: "grey",
5094
- DISABLED_SECONDARY: "#ABABAB",
5095
- CORRECT: e$1[500],
5096
- CORRECT_SECONDARY: e$1[50],
5097
- CORRECT_TERTIARY: "#0EA449",
5098
- CORRECT_WITH_ICON: "#087D38",
5099
- INCORRECT: n$1[500],
5100
- INCORRECT_SECONDARY: i[50],
5101
- INCORRECT_WITH_ICON: "#BF0D00",
5102
- MISSING: i[700],
5103
- MISSING_WITH_ICON: "#6A78A1",
5104
- PRIMARY: t$2[500],
5105
- PRIMARY_LIGHT: t$2[200],
5106
- PRIMARY_DARK: t$2[800],
5107
- SECONDARY: r$1.A400,
5108
- SECONDARY_LIGHT: r$1[200],
5109
- SECONDARY_DARK: r$1[900],
5110
- TERTIARY: "#146EB3",
5111
- TERTIARY_LIGHT: "#D0E2F0",
5112
- BACKGROUND: "rgba(255,255,255,0)",
5113
- BACKGROUND_DARK: "#ECEDF1",
5114
- DROPDOWN_BACKGROUND: "#E0E1E6",
5115
- SECONDARY_BACKGROUND: "rgba(241,241,241,1)",
5116
- BORDER: "#9A9A9A",
5117
- BORDER_LIGHT: "#D1D1D1",
5118
- BORDER_DARK: "#646464",
5119
- BORDER_GRAY: "#7E8494",
5120
- BLACK: "#000000",
5121
- WHITE: "#ffffff",
5122
- TRANSPARENT: "transparent",
5123
- FOCUS_CHECKED: "#BBDEFB",
5124
- FOCUS_CHECKED_BORDER: "#1565C0",
5125
- FOCUS_UNCHECKED: "#E0E0E0",
5126
- FOCUS_UNCHECKED_BORDER: "#757575",
5127
- BLUE_GREY100: "#F3F5F7",
5128
- BLUE_GREY300: "#C0C3CF",
5129
- BLUE_GREY600: "#7E8494",
5130
- BLUE_GREY900: "#152452",
5131
- FADED_PRIMARY: "#DCDAFB"
5132
- };
5133
- Object.freeze(a);
5134
- var o = (e) => (...t) => {
5135
- let n = t.pop();
5136
- return t.reduceRight((t, n) => `var(--${e}-${n}, ${t})`, n);
5137
- }, s = o("pie"), c = () => s("text", a.TEXT), l = () => s("disabled", a.DISABLED), u = () => s("disabled-secondary", a.DISABLED_SECONDARY), d = () => s("correct", a.CORRECT), f = () => s("correct-secondary", a.CORRECT_SECONDARY), p = () => s("correct-tertiary", a.CORRECT_TERTIARY), m = () => s("correct-icon", a.CORRECT_WITH_ICON), h = () => s("incorrect", a.INCORRECT), g = () => s("incorrect-icon", a.INCORRECT_WITH_ICON), _ = () => s("incorrect-secondary", a.INCORRECT_SECONDARY), v = () => s("missing", a.MISSING), y = () => s("missing-icon", a.MISSING_WITH_ICON), b = () => s("primary", a.PRIMARY), x = () => s("primary-light", a.PRIMARY_LIGHT), S = () => s("primary-dark", a.PRIMARY_DARK), C = () => s("primary-text", "text", a.TEXT), w = () => s("faded-primary", a.FADED_PRIMARY), T = () => s("secondary", a.SECONDARY), E = () => s("secondary-light", a.SECONDARY_LIGHT), D = () => s("secondary-dark", a.SECONDARY_DARK), O = () => s("secondary-text", "text", a.TEXT), k = () => s("background", a.BACKGROUND), A = () => s("background-dark", a.BACKGROUND_DARK), j = () => s("secondary-background", a.SECONDARY_BACKGROUND), M = () => s("dropdown-background", a.DROPDOWN_BACKGROUND), N = () => s("tertiary", a.TERTIARY), P = () => s("tertiary-light", a.TERTIARY_LIGHT), F = () => s("border", a.BORDER), I = () => s("border-light", a.BORDER_LIGHT), L = () => s("border-dark", a.BORDER_DARK), R = () => s("border-gray", a.BORDER_GRAY), z = () => s("black", a.BLACK), B = () => s("white", a.WHITE), V = () => a.TRANSPARENT, H = () => s("focus-checked", a.FOCUS_CHECKED), U = () => s("focus-checked-border", a.FOCUS_CHECKED_BORDER), W = () => s("focus-unchecked", a.FOCUS_UNCHECKED), G = () => s("focus-unchecked-border", a.FOCUS_UNCHECKED_BORDER), K = () => s("blue-grey-100", a.BLUE_GREY100), q = () => s("blue-grey-300", a.BLUE_GREY300), J = () => s("blue-grey-600", a.BLUE_GREY600), Y = () => s("blue-grey-900", a.BLUE_GREY900), Z = {
5138
- text: c,
5139
- disabled: l,
5140
- disabledSecondary: u,
5141
- correct: d,
5142
- correctSecondary: f,
5143
- correctTertiary: p,
5144
- correctWithIcon: m,
5145
- incorrect: h,
5146
- incorrectWithIcon: g,
5147
- incorrectSecondary: _,
5148
- missing: v,
5149
- missingWithIcon: y,
5150
- primary: b,
5151
- primaryLight: x,
5152
- primaryDark: S,
5153
- primaryText: C,
5154
- fadedPrimary: w,
5155
- secondary: T,
5156
- secondaryLight: E,
5157
- secondaryDark: D,
5158
- secondaryText: O,
5159
- background: k,
5160
- backgroundDark: A,
5161
- secondaryBackground: j,
5162
- dropdownBackground: M,
5163
- tertiary: N,
5164
- tertiaryLight: P,
5165
- border: F,
5166
- borderLight: I,
5167
- borderDark: L,
5168
- borderGray: R,
5169
- black: z,
5170
- white: B,
5171
- transparent: V,
5172
- focusChecked: H,
5173
- focusCheckedBorder: U,
5174
- focusUnchecked: W,
5175
- focusUncheckedBorder: G,
5176
- blueGrey100: K,
5177
- blueGrey300: q,
5178
- blueGrey600: J,
5179
- blueGrey900: Y
5180
- };
5181
- //#endregion
5182
5222
  //#region ../../lib-svelte/delivery-events/dist/index2.js
5183
- var _e, _e2;
5223
+ var _e;
5224
+ var _e2;
5184
5225
  var e = (_e = class e extends CustomEvent {
5185
5226
  constructor(t, n, r) {
5186
5227
  super(e.TYPE, {
@@ -5193,7 +5234,8 @@ var e = (_e = class e extends CustomEvent {
5193
5234
  }
5194
5235
  }), this.component = t, this.complete = n;
5195
5236
  }
5196
- }, _e.TYPE = "model-set", _e), t$1 = (_e2 = class e extends CustomEvent {
5237
+ }, _e.TYPE = "model-set", _e);
5238
+ var t$1 = (_e2 = class e extends CustomEvent {
5197
5239
  constructor(t, n) {
5198
5240
  super(e.TYPE, {
5199
5241
  bubbles: !0,
@@ -5236,11 +5278,11 @@ function computeAudioMode(params) {
5236
5278
  }
5237
5279
  //#endregion
5238
5280
  //#region src/delivery/AudioPlayer.svelte
5239
- var root_2$3 = /* @__PURE__ */ from_html(`<audio class="sr-only pie-audio-player svelte-ypdwb3" preload="metadata" aria-hidden="true" tabindex="-1"></audio> <button class="listen-button pie-listen-button rli-feature-audio svelte-ypdwb3" type="button"><img/> <img/></button>`, 1);
5240
- var root_4$2 = /* @__PURE__ */ from_html(`<button class="mt-2 text-sm underline pie-audio-autoplay-enable" type="button"> </button>`);
5241
- var root_3$3 = /* @__PURE__ */ from_html(`<audio controls="" class="w-full max-w-md pie-audio-player" preload="metadata"><track kind="captions"/></audio> <!>`, 1);
5242
- var root_5$2 = /* @__PURE__ */ from_html(`<p class="text-sm text-red-700 pie-audio-error" role="alert"> </p>`);
5243
- var root_1$3 = /* @__PURE__ */ from_html(`<div class="mb-4 audio-container pie-audio-container"><!></div>`);
5281
+ var root$3 = /* @__PURE__ */ from_html(`<audio class="sr-only pie-audio-player svelte-ypdwb3" preload="metadata" aria-hidden="true" tabindex="-1"></audio> <button class="listen-button pie-listen-button rli-feature-audio svelte-ypdwb3" type="button"><img/> <img/></button>`, 1);
5282
+ var root_1$3 = /* @__PURE__ */ from_html(`<button class="mt-2 text-sm underline pie-audio-autoplay-enable" type="button"> </button>`);
5283
+ var root_2$3 = /* @__PURE__ */ from_html(`<audio controls="" class="w-full max-w-md pie-audio-player" preload="metadata"><track kind="captions"/></audio> <!>`, 1);
5284
+ var root_3$3 = /* @__PURE__ */ from_html(`<p class="text-sm text-red-700 pie-audio-error" role="alert"> </p>`);
5285
+ var root_4$2 = /* @__PURE__ */ from_html(`<div class="mb-4 audio-container pie-audio-container"><!></div>`);
5244
5286
  var $$css$3 = {
5245
5287
  hash: "svelte-ypdwb3",
5246
5288
  code: ".listen-button.svelte-ypdwb3 {width:var(--mpb-listen-button-size, 128px);height:var(--mpb-listen-button-size, 128px);border:0;padding:0;background-color:transparent;cursor:pointer;z-index:1;}.listen-button.svelte-ypdwb3:hover {background-color:#e2f1fe;}.listen-feature-icon.svelte-ypdwb3 {width:var(--mpb-listen-button-size, 128px);height:var(--mpb-listen-button-size, 128px);object-fit:contain;display:none;}.listen-feature-icon.listen-active.svelte-ypdwb3 {display:block;}.sr-only.svelte-ypdwb3 {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}"
@@ -5254,7 +5296,7 @@ function AudioPlayer($$anchor, $$props) {
5254
5296
  BLOCKED: "blocked",
5255
5297
  PAUSED: "paused"
5256
5298
  };
5257
- let hasAudio = prop($$props, "hasAudio", 7, false), audioUrl = prop($$props, "audioUrl", 7), useFeatureButtonAudio = prop($$props, "useFeatureButtonAudio", 7, false), autoplayEnabled = prop($$props, "autoplayEnabled", 7, false), audioTranscript = prop($$props, "audioTranscript", 7), showVisibleTranscript = prop($$props, "showVisibleTranscript", 7), transcriptId = prop($$props, "transcriptId", 7), featureAudioSkin = prop($$props, "featureAudioSkin", 7), uiText = prop($$props, "uiText", 7), locale = prop($$props, "locale", 7, ""), onaudiostarted = prop($$props, "onaudiostarted", 7), onaudioended = prop($$props, "onaudioended", 7);
5299
+ let hasAudio = prop($$props, "hasAudio", 7, false), audioUrl = prop($$props, "audioUrl", 7), useFeatureButtonAudio = prop($$props, "useFeatureButtonAudio", 7, false), autoplayEnabled = prop($$props, "autoplayEnabled", 7, false), featureAudioSkin = prop($$props, "featureAudioSkin", 7), uiText = prop($$props, "uiText", 7), locale = prop($$props, "locale", 7, ""), onaudiostarted = prop($$props, "onaudiostarted", 7), onaudioended = prop($$props, "onaudioended", 7);
5258
5300
  let audioEl = /* @__PURE__ */ state(null);
5259
5301
  let featureAudioButtonEl = /* @__PURE__ */ state(null);
5260
5302
  let autoplayEnableButtonEl = /* @__PURE__ */ state(null);
@@ -5345,27 +5387,6 @@ function AudioPlayer($$anchor, $$props) {
5345
5387
  autoplayEnabled($$value);
5346
5388
  flushSync();
5347
5389
  },
5348
- get audioTranscript() {
5349
- return audioTranscript();
5350
- },
5351
- set audioTranscript($$value) {
5352
- audioTranscript($$value);
5353
- flushSync();
5354
- },
5355
- get showVisibleTranscript() {
5356
- return showVisibleTranscript();
5357
- },
5358
- set showVisibleTranscript($$value) {
5359
- showVisibleTranscript($$value);
5360
- flushSync();
5361
- },
5362
- get transcriptId() {
5363
- return transcriptId();
5364
- },
5365
- set transcriptId($$value) {
5366
- transcriptId($$value);
5367
- flushSync();
5368
- },
5369
5390
  get featureAudioSkin() {
5370
5391
  return featureAudioSkin();
5371
5392
  },
@@ -5405,10 +5426,10 @@ function AudioPlayer($$anchor, $$props) {
5405
5426
  var fragment = comment();
5406
5427
  var node = first_child(fragment);
5407
5428
  var consequent_4 = ($$anchor) => {
5408
- var div = root_1$3();
5429
+ var div = root_4$2();
5409
5430
  var node_1 = child(div);
5410
5431
  var consequent = ($$anchor) => {
5411
- var fragment_1 = root_2$3();
5432
+ var fragment_1 = root$3();
5412
5433
  var audio = first_child(fragment_1);
5413
5434
  bind_this(audio, ($$value) => set(audioEl, $$value), () => get(audioEl));
5414
5435
  var button = sibling(audio, 2);
@@ -5433,12 +5454,12 @@ function AudioPlayer($$anchor, $$props) {
5433
5454
  append($$anchor, fragment_1);
5434
5455
  };
5435
5456
  var consequent_2 = ($$anchor) => {
5436
- var fragment_2 = root_3$3();
5457
+ var fragment_2 = root_2$3();
5437
5458
  var audio_1 = first_child(fragment_2);
5438
5459
  bind_this(audio_1, ($$value) => set(audioEl, $$value), () => get(audioEl));
5439
5460
  var node_2 = sibling(audio_1, 2);
5440
5461
  var consequent_1 = ($$anchor) => {
5441
- var button_1 = root_4$2();
5462
+ var button_1 = root_1$3();
5442
5463
  var text = child(button_1, true);
5443
5464
  reset(button_1);
5444
5465
  bind_this(button_1, ($$value) => set(autoplayEnableButtonEl, $$value), () => get(autoplayEnableButtonEl));
@@ -5448,14 +5469,11 @@ function AudioPlayer($$anchor, $$props) {
5448
5469
  if_block(node_2, ($$render) => {
5449
5470
  if (get(autoPlayPromptOpen)) $$render(consequent_1);
5450
5471
  });
5451
- template_effect(() => {
5452
- set_attribute(audio_1, "src", audioUrl());
5453
- set_attribute(audio_1, "aria-describedby", audioTranscript() ? transcriptId() : void 0);
5454
- });
5472
+ template_effect(() => set_attribute(audio_1, "src", audioUrl()));
5455
5473
  append($$anchor, fragment_2);
5456
5474
  };
5457
5475
  var consequent_3 = ($$anchor) => {
5458
- var p = root_5$2();
5476
+ var p = root_3$3();
5459
5477
  var text_1 = child(p, true);
5460
5478
  reset(p);
5461
5479
  template_effect(() => set_text(text_1, get(audioErrorMessage)));
@@ -5480,9 +5498,6 @@ create_custom_element(AudioPlayer, {
5480
5498
  audioUrl: {},
5481
5499
  useFeatureButtonAudio: {},
5482
5500
  autoplayEnabled: {},
5483
- audioTranscript: {},
5484
- showVisibleTranscript: {},
5485
- transcriptId: {},
5486
5501
  featureAudioSkin: {},
5487
5502
  uiText: {},
5488
5503
  locale: {},
@@ -5491,13 +5506,13 @@ create_custom_element(AudioPlayer, {
5491
5506
  }, [], [], { mode: "open" });
5492
5507
  //#endregion
5493
5508
  //#region src/delivery/ClozeMarker.svelte
5494
- var root_1$2 = /* @__PURE__ */ from_html(`<img class="w-auto object-contain pie-blank-image" style="max-height:var(--mpb-selected-image-max-height, 4rem);"/>`);
5495
- var root_2$2 = /* @__PURE__ */ from_html(`<span class="cloze-marker-value pie-blank-value svelte-d9l5tb"></span>`);
5496
- var root_3$2 = /* @__PURE__ */ from_html(`<span class="cloze-marker-empty svelte-d9l5tb" aria-hidden="true">&nbsp;</span>`);
5497
- var root$2 = /* @__PURE__ */ from_html(`<span role="status" aria-live="polite" aria-atomic="true"><!></span>`);
5509
+ var root$2 = /* @__PURE__ */ from_html(`<img class="w-auto object-contain pie-blank-image" style="max-height:var(--mpb-selected-image-max-height, 4rem);"/>`);
5510
+ var root_1$2 = /* @__PURE__ */ from_html(`<span class="cloze-marker-value pie-blank-value svelte-d9l5tb"></span>`);
5511
+ var root_2$2 = /* @__PURE__ */ from_html(`<span class="cloze-marker-empty svelte-d9l5tb" aria-hidden="true">&nbsp;</span>`);
5512
+ var root_3$2 = /* @__PURE__ */ from_html(`<span role="status" aria-live="polite" aria-atomic="true"><!></span>`);
5498
5513
  var $$css$2 = {
5499
5514
  hash: "svelte-d9l5tb",
5500
- code: ".cloze-marker.svelte-d9l5tb {display:inline-flex;align-items:center;justify-content:center;text-align:center;vertical-align:baseline;}.cloze-marker.svelte-d9l5tb:focus-within {outline:2px solid var(--pie-focus, #2563eb);outline-offset:2px;}.cloze-marker-standalone.svelte-d9l5tb {width:var(--mpb-blank-standalone-width, 7rem);}.cloze-marker-empty.svelte-d9l5tb {display:inline-block;min-width:4ch;}.cloze-marker-value.svelte-d9l5tb {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}.cloze-marker-value.svelte-d9l5tb p {margin:0;}"
5515
+ code: ".cloze-marker.svelte-d9l5tb {display:inline-flex;align-items:center;justify-content:center;text-align:center;vertical-align:baseline;}.cloze-marker.svelte-d9l5tb:focus-within {outline:2px solid var(--mpb-focus-ring, #1565c0);outline-offset:2px;}.cloze-marker-standalone.svelte-d9l5tb {width:var(--mpb-blank-standalone-width, 7rem);}.cloze-marker-empty.svelte-d9l5tb {display:inline-block;min-width:4ch;}.cloze-marker-value.svelte-d9l5tb {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}.cloze-marker-value.svelte-d9l5tb p {margin:0;}"
5501
5516
  };
5502
5517
  function ClozeMarker($$anchor, $$props) {
5503
5518
  push($$props, true);
@@ -5554,10 +5569,10 @@ function ClozeMarker($$anchor, $$props) {
5554
5569
  flushSync();
5555
5570
  }
5556
5571
  };
5557
- var span = root$2();
5572
+ var span = root_3$2();
5558
5573
  var node = child(span);
5559
5574
  var consequent = ($$anchor) => {
5560
- var img = root_1$2();
5575
+ var img = root$2();
5561
5576
  template_effect(() => {
5562
5577
  set_attribute(img, "src", displayChoice().imageUrl);
5563
5578
  set_attribute(img, "alt", displayChoice().imageAlt || "Selected answer image");
@@ -5565,13 +5580,13 @@ function ClozeMarker($$anchor, $$props) {
5565
5580
  append($$anchor, img);
5566
5581
  };
5567
5582
  var consequent_1 = ($$anchor) => {
5568
- var span_1 = root_2$2();
5583
+ var span_1 = root_1$2();
5569
5584
  html(span_1, displayChoiceLabelHtml, true);
5570
5585
  reset(span_1);
5571
5586
  append($$anchor, span_1);
5572
5587
  };
5573
5588
  var alternate = ($$anchor) => {
5574
- append($$anchor, root_3$2());
5589
+ append($$anchor, root_2$2());
5575
5590
  };
5576
5591
  if_block(node, ($$render) => {
5577
5592
  if (choiceMode() === "image" && displayChoice()?.imageUrl) $$render(consequent);
@@ -5598,17 +5613,15 @@ create_custom_element(ClozeMarker, {
5598
5613
  }, [], [], { mode: "open" });
5599
5614
  //#endregion
5600
5615
  //#region src/delivery/ChoiceRow.svelte
5601
- var root_2$1 = /* @__PURE__ */ from_html(`<img class="object-contain pie-choice-image" style="max-height:var(--mpb-choice-image-max-height, 5rem);"/>`);
5602
- var root_3$1 = /* @__PURE__ */ from_html(`<span class="choice-html pie-choice-label svelte-8xu1pt"></span>`);
5603
- var root_1$1 = /* @__PURE__ */ from_html(`<label class="cursor-pointer choice-tile text-center pie-choice-tile svelte-8xu1pt"><span class="choice-tile-content pie-choice-tile-content svelte-8xu1pt"><!></span> <input type="radio" class="choice-radio-bottom pie-choice-radio pie-choice-radio-bottom svelte-8xu1pt"/></label>`);
5604
- var root_5$1 = /* @__PURE__ */ from_html(`<img class="object-contain pie-choice-image" style="max-height:var(--mpb-choice-image-max-height, 5rem);"/>`);
5605
- var root_6$1 = /* @__PURE__ */ from_html(`<span class="choice-html pie-choice-label svelte-8xu1pt"></span>`);
5606
- var root_4$1 = /* @__PURE__ */ from_html(`<input type="radio" class="choice-radio-inline pie-choice-radio pie-choice-radio-inline svelte-8xu1pt"/> <label class="cursor-pointer flex-1 pie-choice-label-wrap svelte-8xu1pt"><!></label>`, 1);
5607
- var root_7$1 = /* @__PURE__ */ from_html(`<span aria-hidden="true"> </span>`);
5608
- var root$1 = /* @__PURE__ */ from_html(`<div style="gap:var(--mpb-choice-row-gap, 0.5rem);"><!> <!></div>`);
5616
+ var root$1 = /* @__PURE__ */ from_html(`<img class="object-contain pie-choice-image" style="max-height:var(--mpb-choice-image-max-height, 5rem);"/>`);
5617
+ var root_1$1 = /* @__PURE__ */ from_html(`<span class="choice-html pie-choice-label svelte-8xu1pt"></span>`);
5618
+ var root_2$1 = /* @__PURE__ */ from_html(`<label class="cursor-pointer choice-tile text-center pie-choice-tile svelte-8xu1pt"><span class="choice-tile-content pie-choice-tile-content svelte-8xu1pt"><!></span> <input type="radio" class="choice-radio-bottom pie-choice-radio pie-choice-radio-bottom svelte-8xu1pt"/></label>`);
5619
+ var root_3$1 = /* @__PURE__ */ from_html(`<input type="radio" class="choice-radio-inline pie-choice-radio pie-choice-radio-inline svelte-8xu1pt"/> <label class="cursor-pointer flex-1 pie-choice-label-wrap svelte-8xu1pt"><!></label>`, 1);
5620
+ var root_4$1 = /* @__PURE__ */ from_html(`<span aria-hidden="true"> </span>`);
5621
+ var root_5$1 = /* @__PURE__ */ from_html(`<div style="gap:var(--mpb-choice-row-gap, 0.5rem);"><!> <!></div>`);
5609
5622
  var $$css$1 = {
5610
5623
  hash: "svelte-8xu1pt",
5611
- code: ".choice-row-horizontal.svelte-8xu1pt {flex-direction:column;align-items:center;width:min(var(--mpb-choice-width-px, 170px), var(--mpb-choice-width-vw, 30vw));min-height:var(--mpb-choice-tile-min-height, 11rem);gap:0;}.choice-tile.svelte-8xu1pt {display:flex;flex-direction:column;justify-content:space-between;align-items:center;width:100%;min-height:var(--mpb-choice-tile-min-height, 11rem);padding:0.8rem 0.65rem 0.5rem;border-radius:8px;background:transparent;transition:background-color 120ms ease-in-out;}.choice-tile-content.svelte-8xu1pt {width:100%;display:flex;align-items:center;justify-content:center;min-height:var(--mpb-choice-content-min-height, 7.5rem);}.choice-row-horizontal.svelte-8xu1pt:hover .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-hover-bg, var(--pie-correct-answer-choice-hover-bg, #f2f2f2));}.pie-choice-horizontal.svelte-8xu1pt:not(.is-selected):not(:hover) .pie-choice-tile:where(.svelte-8xu1pt) {background:transparent;}.choice-row-horizontal.is-selected.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-selected-bg, var(--pie-correct-answer-choice-selected-bg, #fcfcd3));}.choice-row-horizontal.is-selected.svelte-8xu1pt:hover .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-selected-bg, var(--pie-correct-answer-choice-selected-bg, #fcfcd3));}.pie-choice.svelte-8xu1pt:not(.pie-choice-horizontal):hover .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-correct-answer-choice-hover-bg, #ececec);}.pie-choice.svelte-8xu1pt:not(.pie-choice-horizontal):not(.is-selected):not(:hover) .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:transparent;}.pie-choice:not(.pie-choice-horizontal).is-selected.svelte-8xu1pt .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-correct-answer-choice-selected-bg, #f1f1f1);border-radius:6px;}.pie-choice:not(.pie-choice-horizontal).is-selected.svelte-8xu1pt:hover .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-correct-answer-choice-selected-bg, #f1f1f1);}.pie-choice.choice-correct.svelte-8xu1pt {border-left:3px solid var(--pie-correct-answer-choice-correct-border, #0ea449);}.pie-choice.choice-incorrect.svelte-8xu1pt {border-left:3px solid var(--pie-correct-answer-choice-incorrect-border, #bf0d00);}.pie-choice-horizontal.choice-correct.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--pie-correct-answer-choice-correct-bg, #e8f5e9);}.pie-choice-horizontal.choice-incorrect.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--pie-correct-answer-choice-incorrect-bg, #ffebee);}.pie-choice-feedback-badge.svelte-8xu1pt {margin-left:auto;display:inline-flex;align-items:center;justify-content:center;width:1.1rem;height:1.1rem;border-radius:9999px;font-size:0.72rem;line-height:1;font-weight:700;color:var(--pie-correct-answer-feedback-glyph-color, #fff);}.pie-choice-feedback-correct.svelte-8xu1pt {background:var(--pie-correct-answer-feedback-correct-bg, #087d38);}.pie-choice-feedback-incorrect.svelte-8xu1pt {background:var(--pie-correct-answer-feedback-incorrect-bg, #bf0d00);}.choice-row-horizontal.svelte-8xu1pt p {margin:0;text-align:center;}.choice-html.svelte-8xu1pt p {margin:0;}.choice-html.svelte-8xu1pt {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}.choice-radio-bottom.svelte-8xu1pt {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);padding:var(--mpb-choice-radio-padding, 0px);}.choice-radio-inline.svelte-8xu1pt {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);}"
5624
+ code: ".choice-row-horizontal.svelte-8xu1pt {flex-direction:column;align-items:center;width:min(var(--mpb-choice-width-px, 170px), var(--mpb-choice-width-vw, 30vw));min-height:var(--mpb-choice-tile-min-height, 11rem);gap:0;}.choice-tile.svelte-8xu1pt {display:flex;flex-direction:column;justify-content:space-between;align-items:center;width:100%;min-height:var(--mpb-choice-tile-min-height, 11rem);padding:0.8rem 0.65rem 0.5rem;border-radius:8px;background:transparent;transition:background-color 120ms ease-in-out;}.choice-tile-content.svelte-8xu1pt {width:100%;display:flex;align-items:center;justify-content:center;min-height:var(--mpb-choice-content-min-height, 7.5rem);}.choice-row-horizontal.svelte-8xu1pt:hover .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-hover-bg, var(--pie-background-dark, #ecedf1));}.pie-choice-horizontal.svelte-8xu1pt:not(.is-selected):not(:hover) .pie-choice-tile:where(.svelte-8xu1pt) {background:transparent;}.choice-row-horizontal.is-selected.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-selected-bg, var(--pie-secondary-background, rgba(241, 241, 241, 1)));}.choice-row-horizontal.is-selected.svelte-8xu1pt:hover .choice-tile:where(.svelte-8xu1pt) {background:var(--mpb-choice-selected-bg, var(--pie-secondary-background, rgba(241, 241, 241, 1)));}.pie-choice.svelte-8xu1pt:not(.pie-choice-horizontal):hover .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-background-dark, #ecedf1);}.pie-choice.svelte-8xu1pt:not(.pie-choice-horizontal):not(.is-selected):not(:hover) .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:transparent;}.pie-choice:not(.pie-choice-horizontal).is-selected.svelte-8xu1pt .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-secondary-background, rgba(241, 241, 241, 1));border-radius:6px;}.pie-choice:not(.pie-choice-horizontal).is-selected.svelte-8xu1pt:hover .pie-choice-label-wrap:where(.svelte-8xu1pt) {background:var(--pie-secondary-background, rgba(241, 241, 241, 1));}.pie-choice.choice-correct.svelte-8xu1pt {border-left:3px solid var(--pie-correct-tertiary, #0ea449);}.pie-choice.choice-incorrect.svelte-8xu1pt {border-left:3px solid var(--pie-incorrect-icon, #bf0d00);}.pie-choice-horizontal.choice-correct.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--pie-correct-secondary, #e8f5e9);}.pie-choice-horizontal.choice-incorrect.svelte-8xu1pt .choice-tile:where(.svelte-8xu1pt) {background:var(--pie-incorrect-secondary, #ffebee);}.pie-choice-feedback-badge.svelte-8xu1pt {margin-left:auto;display:inline-flex;align-items:center;justify-content:center;width:1.1rem;height:1.1rem;border-radius:9999px;font-size:0.72rem;line-height:1;font-weight:700;color:var(--pie-white, #ffffff);}.pie-choice-feedback-correct.svelte-8xu1pt {background:var(--pie-correct-icon, #087d38);}.pie-choice-feedback-incorrect.svelte-8xu1pt {background:var(--pie-incorrect-icon, #bf0d00);}.choice-row-horizontal.svelte-8xu1pt p {margin:0;text-align:center;}.choice-html.svelte-8xu1pt p {margin:0;}.choice-html.svelte-8xu1pt {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}.choice-radio-bottom.svelte-8xu1pt {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);padding:var(--mpb-choice-radio-padding, 0px);}.choice-radio-inline.svelte-8xu1pt {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);}"
5612
5625
  };
5613
5626
  function ChoiceRow($$anchor, $$props) {
5614
5627
  push($$props, true);
@@ -5679,14 +5692,14 @@ function ChoiceRow($$anchor, $$props) {
5679
5692
  flushSync();
5680
5693
  }
5681
5694
  };
5682
- var div = root$1();
5695
+ var div = root_5$1();
5683
5696
  var node = child(div);
5684
5697
  var consequent_1 = ($$anchor) => {
5685
- var label = root_1$1();
5698
+ var label = root_2$1();
5686
5699
  var span = child(label);
5687
5700
  var node_1 = child(span);
5688
5701
  var consequent = ($$anchor) => {
5689
- var img = root_2$1();
5702
+ var img = root$1();
5690
5703
  template_effect(() => {
5691
5704
  set_attribute(img, "src", choice().imageUrl);
5692
5705
  set_attribute(img, "alt", choice().imageAlt || `Choice ${choice().id}`);
@@ -5694,7 +5707,7 @@ function ChoiceRow($$anchor, $$props) {
5694
5707
  append($$anchor, img);
5695
5708
  };
5696
5709
  var alternate = ($$anchor) => {
5697
- var span_1 = root_3$1();
5710
+ var span_1 = root_1$1();
5698
5711
  html(span_1, () => choice().labelHtml || "", true);
5699
5712
  reset(span_1);
5700
5713
  append($$anchor, span_1);
@@ -5718,13 +5731,13 @@ function ChoiceRow($$anchor, $$props) {
5718
5731
  append($$anchor, label);
5719
5732
  };
5720
5733
  var alternate_2 = ($$anchor) => {
5721
- var fragment = root_4$1();
5734
+ var fragment = root_3$1();
5722
5735
  var input_1 = first_child(fragment);
5723
5736
  remove_input_defaults(input_1);
5724
5737
  var label_1 = sibling(input_1, 2);
5725
5738
  var node_2 = child(label_1);
5726
5739
  var consequent_2 = ($$anchor) => {
5727
- var img_1 = root_5$1();
5740
+ var img_1 = root$1();
5728
5741
  template_effect(() => {
5729
5742
  set_attribute(img_1, "src", choice().imageUrl);
5730
5743
  set_attribute(img_1, "alt", choice().imageAlt || `Choice ${choice().id}`);
@@ -5732,7 +5745,7 @@ function ChoiceRow($$anchor, $$props) {
5732
5745
  append($$anchor, img_1);
5733
5746
  };
5734
5747
  var alternate_1 = ($$anchor) => {
5735
- var span_2 = root_6$1();
5748
+ var span_2 = root_1$1();
5736
5749
  html(span_2, () => choice().labelHtml || "", true);
5737
5750
  reset(span_2);
5738
5751
  append($$anchor, span_2);
@@ -5758,7 +5771,7 @@ function ChoiceRow($$anchor, $$props) {
5758
5771
  });
5759
5772
  var node_3 = sibling(node, 2);
5760
5773
  var consequent_3 = ($$anchor) => {
5761
- var span_3 = root_7$1();
5774
+ var span_3 = root_4$1();
5762
5775
  var text = child(span_3, true);
5763
5776
  reset(span_3);
5764
5777
  template_effect(() => {
@@ -5821,7 +5834,7 @@ function computeChoiceCorrectness(params) {
5821
5834
  //#endregion
5822
5835
  //#region src/delivery/computeLayoutProfile.ts
5823
5836
  var BLANK_TOKEN = "{{blank}}";
5824
- var FEATURE_BUTTON_PROFILES = new Set([
5837
+ var FEATURE_BUTTON_PROFILES = /* @__PURE__ */ new Set([
5825
5838
  "audio_blank_only",
5826
5839
  "stimulus_image_blank",
5827
5840
  "token_sequence"
@@ -6047,7 +6060,7 @@ var DEFAULT_LAYOUT_PROFILE_PRESETS = {
6047
6060
  }
6048
6061
  };
6049
6062
  function computeLayoutStyle(params) {
6050
- const { layoutProfile, isBlankOnlyTemplate, correctAnswerStyleVars } = params;
6063
+ const { layoutProfile, isBlankOnlyTemplate } = params;
6051
6064
  const configured = params.configuredLimits && typeof params.configuredLimits === "object" ? params.configuredLimits : {};
6052
6065
  const customPresets = params.customProfilePresets && typeof params.customProfilePresets === "object" ? params.customProfilePresets : {};
6053
6066
  const customForProfile = customPresets[layoutProfile] && typeof customPresets[layoutProfile] === "object" ? customPresets[layoutProfile] : {};
@@ -6069,7 +6082,7 @@ function computeLayoutStyle(params) {
6069
6082
  const blankWidth = wideBlankProfiles.includes(layoutProfile) ? `${l.blankWideWidthRem}rem` : isBlankOnlyTemplate ? `${l.blankStandaloneWidthRem}rem` : "auto";
6070
6083
  const blankBorderWidth = wideUnderlineProfiles.includes(layoutProfile) ? `${l.blankUnderlineWideWidthPx}px` : `${l.blankUnderlineWidthPx}px`;
6071
6084
  return {
6072
- rootStyle: [...Object.keys(CSS_VAR_SPEC).map((key) => `${CSS_VAR_SPEC[key].varName}:${l[key]}${CSS_VAR_SPEC[key].unit}`), correctAnswerStyleVars].join(";"),
6085
+ rootStyle: Object.keys(CSS_VAR_SPEC).map((key) => `${CSS_VAR_SPEC[key].varName}:${l[key]}${CSS_VAR_SPEC[key].unit}`).join(";"),
6073
6086
  blankWidth,
6074
6087
  blankBorderWidth,
6075
6088
  legendMaxChars: l.legendMaxChars
@@ -6154,7 +6167,7 @@ var VARIANT_BY_CUSTOM_TYPE = {
6154
6167
  variantId: "sel-vic",
6155
6168
  variantClass: "variant-sel-vic",
6156
6169
  sourceUrl: "https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_vic/0.0.1/question.css",
6157
- cssText: "/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_vic/0.0.1/question.css */\n/* Reference layout: web-ItemBankViewer/learnosity/templates/Renaissance/sel_vic/scss/main.scss + vic.scss */\n.mc-populated-blank-root.variant-sel-vic {\n font-family: Starial, Arial, sans-serif;\n /* LSY chain: .lrn_widget (14px host) → .sel-vic { 1.5em } = 21px.\n PIE collapses both LSY layers into this single variant-root selector, so\n the resolved value is set directly. See CONTOOL-2567. */\n font-size: 21px;\n max-width: 800px;\n margin-inline: auto;\n --mpb-inline-grid-column-gap: 1rem;\n --mpb-inline-grid-row-gap: 0.5rem;\n --mpb-inline-template-margin-top: 0.2rem;\n --mpb-inline-choices-margin-top: 0.2rem;\n --pie-correct-answer-choice-hover-bg: #e2e2e2;\n --pie-correct-answer-choice-selected-bg: #fcfcd3;\n}\n\n.mc-populated-blank-root.variant-sel-vic .pie-audio-transcript {\n font-family: Roboto, Arial, sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n}\n\n.mc-populated-blank-root.variant-sel-vic .pie-template-line,\n.mc-populated-blank-root.variant-sel-vic .pie-blank-value,\n.mc-populated-blank-root.variant-sel-vic .pie-choice-label {\n line-height: 123%;\n}\n\n/* sel_vic/main.scss: template left ~75%, audio right ~25% on the same row.\n Svelte scoping prevents the component-internal grid-area rule from reaching\n .audio-container inside AudioPlayer, so we override it here via the global\n .pie-audio-container class which is not subject to scope hashing. */\n.mc-populated-blank-root.variant-sel-vic .pie-audio-container {\n grid-area: audio;\n margin: 0;\n justify-self: end;\n align-self: start;\n min-height: 128px;\n}\n\n/* vic.scss: sentence and cloze sit inline — the <p> wrapper must not break to\n a new line before the blank slot. */\n.mc-populated-blank-root.variant-sel-vic .pie-template-line p {\n display: inline;\n margin: 0;\n}\n\n/* LSY .rli-vic-answer has no text-align rule and inherits start; PIE's\n inline_sentence layout sets text-align:center on .template-line via a\n Svelte-scoped selector with specificity (0,4,0), so we need to match or\n exceed that. Pin sel-vic back to start so wrapped lines stay left-aligned.\n See CONTOOL-2573. */\n.mc-populated-blank-root.variant-sel-vic.layout-inline_sentence .pie-template-line.template-line {\n text-align: start;\n}\n\n/* vic.scss: .rli-vic-cloze { margin-left: 6px; margin-right: 6px } gives the\n cloze breathing room from adjacent text or punctuation. The PIE markup uses\n Tailwind-style mx-1 in the class list, but mc-populated-blank does not\n compile Tailwind, so that class is a no-op. Set the inline margin\n explicitly so the cloze→trailing-punctuation gap matches LSY. See\n CONTOOL-2572. */\n.mc-populated-blank-root.variant-sel-vic .pie-template-line .pie-blank-slot {\n margin-left: 6px;\n margin-right: 6px;\n}\n\n/* vic.scss: .rli-vic-cloze > .rli-vic-content-element { color: #cc3333 } */\n.mc-populated-blank-root.variant-sel-vic .pie-blank-value {\n color: #cc3333;\n}\n\n/* sel_vic/main.scss: .sel-vic { max-width: 800px } — the fieldset/choices must\n also be constrained so rows don't span beyond 800px. */\n.mc-populated-blank-root.variant-sel-vic .pie-choices-fieldset {\n max-width: 800px;\n width: 100%;\n}\n\n/* vic.scss: distractor label text sits to the right of the radio — no centering. */\n.mc-populated-blank-root.variant-sel-vic .pie-choice-label {\n text-align: left;\n justify-content: flex-start;\n}\n\n/* vic.scss: .rli-vic-selected { background-color: #fcfcd3 } on the full row. */\n.mc-populated-blank-root.variant-sel-vic .pie-choice.is-selected {\n background-color: #fcfcd3;\n border-radius: 6px;\n}\n\n.mc-populated-blank-root.variant-sel-vic .pie-choice.is-selected .pie-choice-label-wrap {\n background-color: transparent;\n}\n\n/* Selected state must win over hover. */\n.mc-populated-blank-root.variant-sel-vic .pie-choice:not(.pie-choice-horizontal).is-selected:hover {\n background-color: #fcfcd3;\n}\n\n/* vic.scss: .rli-vic-distractor:hover { background-color: #F2F2F2 } on the full row. */\n.mc-populated-blank-root.variant-sel-vic .pie-choice:not(.pie-choice-horizontal):hover {\n background-color: #f2f2f2;\n border-radius: 6px;\n}\n\n.mc-populated-blank-root.variant-sel-vic\n .pie-choice:not(.pie-choice-horizontal):hover\n .pie-choice-label-wrap {\n background-color: transparent;\n}\n\n@media (min-width: 620px) {\n .mc-populated-blank-root.variant-sel-vic .pie-audio-transcript {\n min-width: 620px;\n max-width: 800px;\n transform: translateX(-55px);\n }\n}\n"
6170
+ cssText: "/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_vic/0.0.1/question.css */\n/* Reference layout: web-ItemBankViewer/learnosity/templates/Renaissance/sel_vic/scss/main.scss + vic.scss */\n.mc-populated-blank-root.variant-sel-vic {\n font-family: Starial, Arial, sans-serif;\n /* LSY chain: .lrn_widget (14px host) → .sel-vic { 1.5em } = 21px.\n PIE collapses both LSY layers into this single variant-root selector, so\n the resolved value is set directly. See CONTOOL-2567. */\n font-size: 21px;\n max-width: 800px;\n margin-inline: auto;\n --mpb-inline-grid-column-gap: 1rem;\n --mpb-inline-grid-row-gap: 0.5rem;\n --mpb-inline-template-margin-top: 0.2rem;\n --mpb-inline-choices-margin-top: 0.2rem;\n}\n\n.mc-populated-blank-root.variant-sel-vic .pie-audio-transcript {\n font-family: Roboto, Arial, sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n}\n\n.mc-populated-blank-root.variant-sel-vic .pie-template-line,\n.mc-populated-blank-root.variant-sel-vic .pie-blank-value,\n.mc-populated-blank-root.variant-sel-vic .pie-choice-label {\n line-height: 123%;\n}\n\n/* sel_vic/main.scss: template left ~75%, audio right ~25% on the same row.\n Svelte scoping prevents the component-internal grid-area rule from reaching\n .audio-container inside AudioPlayer, so we override it here via the global\n .pie-audio-container class which is not subject to scope hashing. */\n.mc-populated-blank-root.variant-sel-vic .pie-audio-container {\n grid-area: audio;\n margin: 0;\n justify-self: end;\n align-self: start;\n min-height: 128px;\n}\n\n/* vic.scss: sentence and cloze sit inline — the <p> wrapper must not break to\n a new line before the blank slot. */\n.mc-populated-blank-root.variant-sel-vic .pie-template-line p {\n display: inline;\n margin: 0;\n}\n\n/* LSY .rli-vic-answer has no text-align rule and inherits start; PIE's\n inline_sentence layout sets text-align:center on .template-line via a\n Svelte-scoped selector with specificity (0,4,0), so we need to match or\n exceed that. Pin sel-vic back to start so wrapped lines stay left-aligned.\n See CONTOOL-2573. */\n.mc-populated-blank-root.variant-sel-vic.layout-inline_sentence .pie-template-line.template-line {\n text-align: start;\n}\n\n/* vic.scss: .rli-vic-cloze { margin-left: 6px; margin-right: 6px } gives the\n cloze breathing room from adjacent text or punctuation. The PIE markup uses\n Tailwind-style mx-1 in the class list, but mc-populated-blank does not\n compile Tailwind, so that class is a no-op. Set the inline margin\n explicitly so the cloze→trailing-punctuation gap matches LSY. See\n CONTOOL-2572. */\n.mc-populated-blank-root.variant-sel-vic .pie-template-line .pie-blank-slot {\n margin-left: 6px;\n margin-right: 6px;\n}\n\n/* vic.scss: .rli-vic-cloze > .rli-vic-content-element { color: #cc3333 } */\n.mc-populated-blank-root.variant-sel-vic .pie-blank-value {\n color: #cc3333;\n}\n\n/* sel_vic/main.scss: .sel-vic { max-width: 800px } — the fieldset/choices must\n also be constrained so rows don't span beyond 800px. */\n.mc-populated-blank-root.variant-sel-vic .pie-choices-fieldset {\n max-width: 800px;\n width: 100%;\n}\n\n/* vic.scss: distractor label text sits to the right of the radio — no centering. */\n.mc-populated-blank-root.variant-sel-vic .pie-choice-label {\n text-align: left;\n justify-content: flex-start;\n}\n\n/* vic.scss: .rli-vic-selected { background-color: #fcfcd3 } on the full row. */\n.mc-populated-blank-root.variant-sel-vic .pie-choice.is-selected {\n background-color: #fcfcd3;\n border-radius: 6px;\n}\n\n.mc-populated-blank-root.variant-sel-vic .pie-choice.is-selected .pie-choice-label-wrap {\n background-color: transparent;\n}\n\n/* Selected state must win over hover. */\n.mc-populated-blank-root.variant-sel-vic .pie-choice:not(.pie-choice-horizontal).is-selected:hover {\n background-color: #fcfcd3;\n}\n\n/* vic.scss: .rli-vic-distractor:hover { background-color: #F2F2F2 } on the full row. */\n.mc-populated-blank-root.variant-sel-vic .pie-choice:not(.pie-choice-horizontal):hover {\n background-color: #f2f2f2;\n border-radius: 6px;\n}\n\n.mc-populated-blank-root.variant-sel-vic\n .pie-choice:not(.pie-choice-horizontal):hover\n .pie-choice-label-wrap {\n background-color: transparent;\n}\n\n@media (min-width: 620px) {\n .mc-populated-blank-root.variant-sel-vic .pie-audio-transcript {\n min-width: 620px;\n max-width: 800px;\n transform: translateX(-55px);\n }\n}\n"
6158
6171
  },
6159
6172
  "sel_r1-_gplusggg": {
6160
6173
  variantId: "sel-r1-gplusggg",
@@ -6196,7 +6209,7 @@ var getVariantCssConfig = (customType) => {
6196
6209
  var getVariantRootClass = (customType) => {
6197
6210
  return getVariantCssConfig(customType)?.variantClass || "";
6198
6211
  };
6199
- var SEL_R1_VARIANT_IDS = new Set([
6212
+ var SEL_R1_VARIANT_IDS = /* @__PURE__ */ new Set([
6200
6213
  "sel-r1-plusggg",
6201
6214
  "sel-r1-gplusggg",
6202
6215
  "sel-r1-g-stem",
@@ -6223,18 +6236,17 @@ var ensureVariantCssInjected = (config) => {
6223
6236
  };
6224
6237
  //#endregion
6225
6238
  //#region src/delivery/McPopulatedBlank.svelte
6226
- var root_1 = /* @__PURE__ */ from_html(`<div class="mb-4 prose pie-prompt"></div>`);
6227
- var root_2 = /* @__PURE__ */ from_html(`<p> </p>`);
6228
- var root_4 = /* @__PURE__ */ from_svg(`<svg class="pie-correct-answer-toggle-svg svelte-6wlbb4" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-283 359 34 35"><circle cx="-266" cy="375.9" r="14" fill="var(--pie-correct-answer-toggle-icon-open-bg, #bce2ff)"></circle><path d="M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z" fill="var(--pie-correct-answer-toggle-icon-open-bg, #bce2ff)"></path><polygon points="-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6" fill="var(--pie-correct-answer-toggle-icon-glyph-color, #1a9cff)"></polygon></svg>`);
6229
- var root_5 = /* @__PURE__ */ from_svg(`<svg class="pie-correct-answer-toggle-svg svelte-6wlbb4" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-129.5 127 34 35"><path d="M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z" fill="#D0CAC5" stroke="#E6E3E0" stroke-width="0.75"></path><path d="M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z" fill="#B3ABA4" stroke="#CDC7C2" stroke-width="0.5"></path><circle cx="-114.2" cy="143.5" r="14" fill="white"></circle><path d="M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z" fill="var(--pie-correct-answer-toggle-icon-closed-bg, #bce2ff)"></path><polygon points="-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2" fill="var(--pie-correct-answer-toggle-icon-glyph-color, #1a9cff)"></polygon></svg>`);
6239
+ var root = /* @__PURE__ */ from_html(`<div class="mb-4 prose pie-prompt"></div>`);
6240
+ var root_1 = /* @__PURE__ */ from_svg(`<svg class="pie-correct-answer-toggle-svg svelte-6wlbb4" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-283 359 34 35"><circle cx="-266" cy="375.9" r="14" fill="var(--pie-tertiary-light, #d0e2f0)"></circle><path d="M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z" fill="var(--pie-tertiary-light, #d0e2f0)"></path><polygon points="-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6" fill="var(--pie-tertiary, #146eb3)"></polygon></svg>`);
6241
+ var root_2 = /* @__PURE__ */ from_svg(`<svg class="pie-correct-answer-toggle-svg svelte-6wlbb4" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-129.5 127 34 35"><path d="M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z" fill="#D0CAC5" stroke="#E6E3E0" stroke-width="0.75"></path><path d="M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z" fill="#B3ABA4" stroke="#CDC7C2" stroke-width="0.5"></path><circle cx="-114.2" cy="143.5" r="14" fill="white"></circle><path d="M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z" fill="var(--pie-background-dark, #ecedf1)"></path><polygon points="-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2" fill="var(--pie-tertiary, #146eb3)"></polygon></svg>`);
6230
6242
  var root_3 = /* @__PURE__ */ from_html(`<div class="pie-correct-answer-toggle-row svelte-6wlbb4"><button type="button" class="mb-3 pie-toggle-correct-answer svelte-6wlbb4" style="gap:var(--mpb-toggle-button-gap, 0.5rem);" data-testid="show-correct-answer"><span class="pie-correct-answer-toggle-content svelte-6wlbb4"><span class="pie-correct-answer-toggle-icon-holder svelte-6wlbb4" aria-hidden="true"><!></span> <span class="pie-correct-answer-toggle-label svelte-6wlbb4"> </span></span></button></div>`);
6231
- var root_6 = /* @__PURE__ */ from_html(`<div class="mb-3 prose prose-p:my-1 sentence-line pie-sentence-line svelte-6wlbb4"></div>`);
6232
- var root_7 = /* @__PURE__ */ from_html(`<div class="mb-4 template-line pie-template-line svelte-6wlbb4"><!><!><!></div>`);
6233
- var root_8 = /* @__PURE__ */ from_html(`<p class="sr-only pie-result-feedback svelte-6wlbb4" role="status" aria-live="polite"> </p>`);
6234
- var root = /* @__PURE__ */ from_html(`<div><!> <!> <!> <!> <!> <!> <!> <fieldset class="border-0 p-0 m-0 pie-choices-fieldset svelte-6wlbb4"><legend class="sr-only pie-choices-legend svelte-6wlbb4"> </legend> <div style="gap:var(--mpb-choice-group-gap, 0.5rem);" role="radiogroup" tabindex="-1"></div></fieldset></div>`);
6243
+ var root_4 = /* @__PURE__ */ from_html(`<div class="mb-3 prose prose-p:my-1 sentence-line pie-sentence-line svelte-6wlbb4"></div>`);
6244
+ var root_5 = /* @__PURE__ */ from_html(`<div class="mb-4 template-line pie-template-line svelte-6wlbb4"><!><!><!></div>`);
6245
+ var root_6 = /* @__PURE__ */ from_html(`<p class="sr-only pie-result-feedback svelte-6wlbb4" role="status" aria-live="polite"> </p>`);
6246
+ var root_7 = /* @__PURE__ */ from_html(`<div><!> <!> <!> <!> <!> <!> <fieldset class="border-0 p-0 m-0 pie-choices-fieldset svelte-6wlbb4"><legend class="sr-only pie-choices-legend svelte-6wlbb4"> </legend> <div style="gap:var(--mpb-choice-group-gap, 0.5rem);" role="radiogroup" tabindex="-1"></div></fieldset></div>`);
6235
6247
  var $$css = {
6236
6248
  hash: "svelte-6wlbb4",
6237
- code: ".sr-only.svelte-6wlbb4 {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}.mc-populated-blank-root.svelte-6wlbb4 .prose {max-width:none;}.pie-toggle-correct-answer.svelte-6wlbb4 {width:100%;cursor:pointer;border:0;background:transparent;padding:0;display:flex;justify-content:center;text-align:center;color:var(--pie-correct-answer-toggle-label-color, var(--pie-text, black));}.pie-correct-answer-toggle-row.svelte-6wlbb4 {width:100%;display:flex;justify-content:flex-end;}.pie-correct-answer-toggle-content.svelte-6wlbb4 {display:flex;margin:0 auto;align-items:center;}.pie-correct-answer-toggle-icon-holder.svelte-6wlbb4 {width:25px;margin-right:5px;display:inline-flex;align-items:center;justify-content:center;}.pie-correct-answer-toggle-svg.svelte-6wlbb4 {width:25px;height:25px;}.pie-correct-answer-toggle-label.svelte-6wlbb4 {width:fit-content;min-width:140px;align-self:center;vertical-align:middle;font-weight:400;user-select:none;}.pie-toggle-correct-answer.svelte-6wlbb4:hover .pie-correct-answer-toggle-label:where(.svelte-6wlbb4),\n .pie-toggle-correct-answer.svelte-6wlbb4:focus-visible .pie-correct-answer-toggle-label:where(.svelte-6wlbb4) {text-decoration:underline;}.template-line.svelte-6wlbb4 {white-space:pre-wrap;}.template-line.svelte-6wlbb4 p {margin:0;}.layout-audio_blank_only.svelte-6wlbb4 .pie-audio-container,\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-container {display:flex;width:min(100%, var(--mpb-audio-instructions-max-width, 875px));margin-left:auto;margin-right:auto;justify-content:flex-end;}.layout-audio_blank_only.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {text-align:center;margin:var(--mpb-audio-blank-template-margin-top, 0.8rem) 0\n var(--mpb-audio-blank-template-margin-bottom, 1.8rem);}.layout-audio_blank_only.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {display:flex;justify-content:center;}.layout-audio_blank_only.svelte-6wlbb4 .pie-blank-slot,\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-blank-slot {width:var(--mpb-blank-wide-width, 10rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 6px);min-height:160px;padding-bottom:4px;}.layout-stimulus_image_blank.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-stimulus-min-column, 210px), 1fr) auto;grid-template-areas:'transcript transcript'\n 'sentence audio'\n '. template'\n 'choices choices';column-gap:var(--mpb-stimulus-grid-column-gap, 2rem);row-gap:var(--mpb-stimulus-grid-row-gap, 0.7rem);align-items:start;}.layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-transcript:where(.svelte-6wlbb4) {grid-area:transcript;}.layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-container {grid-area:audio;margin:0;}.layout-stimulus_image_blank.svelte-6wlbb4 .sentence-line:where(.svelte-6wlbb4) {grid-area:sentence;margin:var(--mpb-stimulus-sentence-margin-top, 0.2rem) 0 0;}.layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:0;text-align:center;justify-self:center;}.layout-stimulus_image_blank.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-stimulus-choices-margin-top, 0.9rem);}.layout-token_sequence.svelte-6wlbb4 {display:grid;grid-template-columns:1fr auto;grid-template-areas:'transcript audio'\n 'template template'\n 'choices choices';column-gap:var(--mpb-token-grid-column-gap, 1.5rem);row-gap:var(--mpb-token-grid-row-gap, 0.8rem);align-items:start;}.layout-token_sequence.svelte-6wlbb4 .pie-audio-transcript:where(.svelte-6wlbb4) {grid-area:transcript;}.layout-token_sequence.svelte-6wlbb4 .pie-audio-container {grid-area:audio;margin:0;justify-self:end;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-token-template-margin-top, 0.6rem) 0 0;justify-self:center;text-align:center;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) span + span {margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 .pie-blank-slot {width:var(--mpb-blank-standalone-width, 7rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 4px);margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-token-choices-margin-top, 0.2rem);}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-text-min-column, 260px), 1fr) auto;grid-template-areas:'transcript transcript'\n 'template audio'\n 'choices choices';column-gap:var(--mpb-inline-grid-column-gap, 1.5rem);row-gap:var(--mpb-inline-grid-row-gap, 0.65rem);align-items:start;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-audio-transcript:where(.svelte-6wlbb4) {grid-area:transcript;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-audio-container {grid-area:audio;margin:0;justify-self:end;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-inline-template-margin-top, 0.45rem) 0 0;text-align:center;justify-self:center;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-inline-choices-margin-top, 0.25rem);}\n\n /* Match Learnosity responsive behavior for CQT audio-blank layouts:\n at smaller widths, audio control shifts left and answer tiles stack. */\n @media (max-width: 760px) {.layout-audio_blank_only.svelte-6wlbb4 .pie-audio-container,\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-container,\n .layout-token_sequence.svelte-6wlbb4 .pie-audio-container,\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-audio-container {width:100%;margin-left:0;margin-right:0;justify-content:flex-start;justify-self:start;}.layout-audio_blank_only.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4) {flex-direction:column;align-items:flex-start;justify-content:flex-start;}.layout-audio_blank_only.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4) {width:min(100%, var(--mpb-narrow-choice-max-width, 230px));align-items:flex-start;}\n }"
6249
+ code: ".sr-only.svelte-6wlbb4 {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}.mc-populated-blank-root.svelte-6wlbb4 {--mpb-focus-ring: var(\n --pie-focus-outline,\n var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565c0))\n );}.mc-populated-blank-root.svelte-6wlbb4 .prose {max-width:none;}.pie-toggle-correct-answer.svelte-6wlbb4 {width:100%;cursor:pointer;border:0;background:transparent;padding:0;display:flex;justify-content:center;text-align:center;color:var(--pie-text, black);}.pie-correct-answer-toggle-row.svelte-6wlbb4 {width:100%;display:flex;justify-content:flex-end;}.pie-correct-answer-toggle-content.svelte-6wlbb4 {display:flex;margin:0 auto;align-items:center;}.pie-correct-answer-toggle-icon-holder.svelte-6wlbb4 {width:25px;margin-right:5px;display:inline-flex;align-items:center;justify-content:center;}.pie-correct-answer-toggle-svg.svelte-6wlbb4 {width:25px;height:25px;}.pie-correct-answer-toggle-label.svelte-6wlbb4 {width:fit-content;min-width:140px;align-self:center;vertical-align:middle;font-weight:400;user-select:none;}.pie-toggle-correct-answer.svelte-6wlbb4:hover .pie-correct-answer-toggle-label:where(.svelte-6wlbb4),\n .pie-toggle-correct-answer.svelte-6wlbb4:focus-visible .pie-correct-answer-toggle-label:where(.svelte-6wlbb4) {text-decoration:underline;}.template-line.svelte-6wlbb4 {white-space:pre-wrap;}.template-line.svelte-6wlbb4 p {margin:0;display:inline;}.layout-audio_blank_only.svelte-6wlbb4 .pie-audio-container,\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-container {display:flex;width:min(100%, var(--mpb-audio-instructions-max-width, 875px));margin-left:auto;margin-right:auto;justify-content:flex-end;}.layout-audio_blank_only.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {text-align:center;margin:var(--mpb-audio-blank-template-margin-top, 0.8rem) 0\n var(--mpb-audio-blank-template-margin-bottom, 1.8rem);}.layout-audio_blank_only.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {display:flex;justify-content:center;}.layout-audio_blank_only.svelte-6wlbb4 .pie-blank-slot,\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-blank-slot {width:var(--mpb-blank-wide-width, 10rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 6px);min-height:160px;padding-bottom:4px;}.layout-stimulus_image_blank.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-stimulus-min-column, 210px), 1fr) auto;grid-template-areas:'sentence audio'\n '. template'\n 'choices choices';column-gap:var(--mpb-stimulus-grid-column-gap, 2rem);row-gap:var(--mpb-stimulus-grid-row-gap, 0.7rem);align-items:start;}.layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-container {grid-area:audio;margin:0;}.layout-stimulus_image_blank.svelte-6wlbb4 .sentence-line:where(.svelte-6wlbb4) {grid-area:sentence;margin:var(--mpb-stimulus-sentence-margin-top, 0.2rem) 0 0;}.layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:0;text-align:center;justify-self:center;}.layout-stimulus_image_blank.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-stimulus-choices-margin-top, 0.9rem);}.layout-token_sequence.svelte-6wlbb4 {display:grid;grid-template-columns:1fr auto;grid-template-areas:'audio audio'\n 'template template'\n 'choices choices';column-gap:var(--mpb-token-grid-column-gap, 1.5rem);row-gap:var(--mpb-token-grid-row-gap, 0.8rem);align-items:start;}.layout-token_sequence.svelte-6wlbb4 .pie-audio-container {grid-area:audio;margin:0;justify-self:end;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-token-template-margin-top, 0.6rem) 0 0;justify-self:center;text-align:center;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) span + span {margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 .pie-blank-slot {width:var(--mpb-blank-standalone-width, 7rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 4px);margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-token-choices-margin-top, 0.2rem);}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-text-min-column, 260px), 1fr) auto;grid-template-areas:'template audio'\n 'choices choices';column-gap:var(--mpb-inline-grid-column-gap, 1.5rem);row-gap:var(--mpb-inline-grid-row-gap, 0.65rem);align-items:start;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-audio-container {grid-area:audio;margin:0;justify-self:end;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-inline-template-margin-top, 0.45rem) 0 0;text-align:center;justify-self:center;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-inline-choices-margin-top, 0.25rem);}\n\n /* Match Learnosity responsive behavior for CQT audio-blank layouts:\n at smaller widths, audio control shifts left and answer tiles stack. */\n @media (max-width: 760px) {.layout-audio_blank_only.svelte-6wlbb4 .pie-audio-container,\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-audio-container,\n .layout-token_sequence.svelte-6wlbb4 .pie-audio-container,\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-audio-container {width:100%;margin-left:0;margin-right:0;justify-content:flex-start;justify-self:start;}.layout-audio_blank_only.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4) {flex-direction:column;align-items:flex-start;justify-content:flex-start;}.layout-audio_blank_only.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4) {width:min(100%, var(--mpb-narrow-choice-max-width, 230px));align-items:flex-start;}\n }"
6238
6250
  };
6239
6251
  function McPopulatedBlank($$anchor, $$props) {
6240
6252
  push($$props, true);
@@ -6246,15 +6258,13 @@ function McPopulatedBlank($$anchor, $$props) {
6246
6258
  showCorrectAnswer: "Show correct answer",
6247
6259
  hideCorrectAnswer: "Hide correct answer",
6248
6260
  clickToEnableAutoplay: "Click to enable audio autoplay",
6249
- audioResourceUnavailable: "Audio is enabled but no playable audio URL is configured.",
6250
- transcriptLabel: "Transcript"
6261
+ audioResourceUnavailable: "Audio is enabled but no playable audio URL is configured."
6251
6262
  };
6252
6263
  let model = prop($$props, "model", 7), session = prop($$props, "session", 7);
6253
6264
  let localChoiceId = /* @__PURE__ */ state("");
6254
6265
  let toggleCorrectAnswerButtonEl = /* @__PURE__ */ state(null);
6255
6266
  let choicesGroupEl = /* @__PURE__ */ state(null);
6256
6267
  let rootEl = /* @__PURE__ */ state(null);
6257
- let ancestorHasTranscriptClass = /* @__PURE__ */ state(false);
6258
6268
  const instanceId = `mc-populated-blank-${Math.random().toString(36).slice(2, 10)}`;
6259
6269
  const deliveryMode = /* @__PURE__ */ user_derived(() => (model()?.mode || model()?.env?.mode || "").toString());
6260
6270
  const isEvaluateMode = /* @__PURE__ */ user_derived(() => get(deliveryMode) === "evaluate");
@@ -6278,28 +6288,11 @@ function McPopulatedBlank($$anchor, $$props) {
6278
6288
  const isHorizontalChoices = /* @__PURE__ */ user_derived(() => get(layoutProfileFlags).isHorizontalChoices);
6279
6289
  const hasInlineSentenceAudioLayout = /* @__PURE__ */ user_derived(() => get(layoutProfileFlags).hasInlineSentenceAudioLayout);
6280
6290
  const useFeatureButtonAudio = /* @__PURE__ */ user_derived(() => get(layoutProfileFlags).useFeatureButtonAudio);
6281
- const showVisibleTranscript = /* @__PURE__ */ user_derived(() => get(ancestorHasTranscriptClass));
6282
- const correctAnswerStyleVars = /* @__PURE__ */ user_derived(() => [
6283
- `--pie-correct-answer-toggle-label-color:${Z.text()}`,
6284
- `--pie-correct-answer-toggle-icon-open-bg:${Z.tertiaryLight()}`,
6285
- `--pie-correct-answer-toggle-icon-closed-bg:${Z.backgroundDark()}`,
6286
- `--pie-correct-answer-toggle-icon-glyph-color:${Z.tertiary()}`,
6287
- `--pie-correct-answer-choice-hover-bg:${Z.backgroundDark()}`,
6288
- `--pie-correct-answer-choice-selected-bg:${Z.secondaryBackground()}`,
6289
- `--pie-correct-answer-choice-correct-bg:${Z.correctSecondary()}`,
6290
- `--pie-correct-answer-choice-incorrect-bg:${Z.incorrectSecondary()}`,
6291
- `--pie-correct-answer-choice-correct-border:${Z.correctTertiary()}`,
6292
- `--pie-correct-answer-choice-incorrect-border:${Z.incorrectWithIcon()}`,
6293
- `--pie-correct-answer-feedback-correct-bg:${Z.correctWithIcon()}`,
6294
- `--pie-correct-answer-feedback-incorrect-bg:${Z.incorrectWithIcon()}`,
6295
- `--pie-correct-answer-feedback-glyph-color:${Z.white()}`
6296
- ].join(";"));
6297
6291
  const layout = /* @__PURE__ */ user_derived(() => computeLayoutStyle({
6298
6292
  layoutProfile: get(layoutProfile),
6299
6293
  isBlankOnlyTemplate: get(isBlankOnlyTemplate),
6300
6294
  configuredLimits: model()?.layoutLimits,
6301
- customProfilePresets: model()?.layoutProfilePresets,
6302
- correctAnswerStyleVars: get(correctAnswerStyleVars)
6295
+ customProfilePresets: model()?.layoutProfilePresets
6303
6296
  }));
6304
6297
  const choices = /* @__PURE__ */ user_derived(() => Array.isArray(model()?.choices) ? model().choices : []);
6305
6298
  const choiceMode = /* @__PURE__ */ user_derived(() => model()?.choiceMode || "text");
@@ -6332,7 +6325,6 @@ function McPopulatedBlank($$anchor, $$props) {
6332
6325
  ...model()?.uiText || {}
6333
6326
  }));
6334
6327
  const promptId = /* @__PURE__ */ user_derived(() => `${instanceId}-prompt`);
6335
- const transcriptId = /* @__PURE__ */ user_derived(() => `${instanceId}-transcript`);
6336
6328
  const legendId = /* @__PURE__ */ user_derived(() => `${instanceId}-choices-legend`);
6337
6329
  const resultId = /* @__PURE__ */ user_derived(() => `${instanceId}-result`);
6338
6330
  const legendText = /* @__PURE__ */ user_derived(() => computeLegendText({
@@ -6347,12 +6339,7 @@ function McPopulatedBlank($$anchor, $$props) {
6347
6339
  if (explicit) return explicit;
6348
6340
  return get(legendText);
6349
6341
  });
6350
- const templateDescribedBy = /* @__PURE__ */ user_derived(() => {
6351
- const ids = [];
6352
- if (model()?.prompt) ids.push(get(promptId));
6353
- if (model()?.hasAudio && model()?.audioTranscript) ids.push(get(transcriptId));
6354
- return ids.length ? ids.join(" ") : void 0;
6355
- });
6342
+ const templateDescribedBy = /* @__PURE__ */ user_derived(() => model()?.prompt ? get(promptId) : void 0);
6356
6343
  const lang = /* @__PURE__ */ user_derived(() => {
6357
6344
  const locale = model()?.locale || "";
6358
6345
  return locale ? locale.slice(0, 2) : "en";
@@ -6450,8 +6437,7 @@ function McPopulatedBlank($$anchor, $$props) {
6450
6437
  const group = get(choicesGroupEl);
6451
6438
  if (!group) return;
6452
6439
  const handleChange = (e) => {
6453
- const target = e.target;
6454
- if (!target || target.type !== "radio") return;
6440
+ if (e.target?.type !== "radio") return;
6455
6441
  onRadioChange(e);
6456
6442
  };
6457
6443
  const handleKeydown = (e) => onRadioGroupKeydown(e);
@@ -6465,24 +6451,6 @@ function McPopulatedBlank($$anchor, $$props) {
6465
6451
  user_effect(() => {
6466
6452
  ensureVariantCssInjected(get(variantCssConfig));
6467
6453
  });
6468
- user_effect(() => {
6469
- const el = get(rootEl);
6470
- if (!el) return;
6471
- const check = () => {
6472
- set(ancestorHasTranscriptClass, !!el.closest(".rli-with-audio-transcript"));
6473
- };
6474
- check();
6475
- const observer = new MutationObserver(check);
6476
- let node = el.parentElement;
6477
- while (node) {
6478
- observer.observe(node, {
6479
- attributes: true,
6480
- attributeFilter: ["class"]
6481
- });
6482
- node = node.parentElement;
6483
- }
6484
- return () => observer.disconnect();
6485
- });
6486
6454
  var $$exports = {
6487
6455
  get model() {
6488
6456
  return model();
@@ -6499,53 +6467,38 @@ function McPopulatedBlank($$anchor, $$props) {
6499
6467
  flushSync();
6500
6468
  }
6501
6469
  };
6502
- var div = root();
6503
- var node_1 = child(div);
6470
+ var div = root_7();
6471
+ var node = child(div);
6504
6472
  var consequent = ($$anchor) => {
6505
- var div_1 = root_1();
6473
+ var div_1 = root();
6506
6474
  html(div_1, () => model().prompt, true);
6507
6475
  reset(div_1);
6508
6476
  template_effect(() => set_attribute(div_1, "id", get(promptId)));
6509
6477
  append($$anchor, div_1);
6510
6478
  };
6511
- if_block(node_1, ($$render) => {
6479
+ if_block(node, ($$render) => {
6512
6480
  if (model()?.prompt) $$render(consequent);
6513
6481
  });
6514
- var node_2 = sibling(node_1, 2);
6515
- var consequent_1 = ($$anchor) => {
6516
- var p = root_2();
6517
- var text = child(p, true);
6518
- reset(p);
6519
- template_effect(() => {
6520
- set_class(p, 1, `text-sm mb-3 text-gray-700 text-center pie-audio-transcript ${get(showVisibleTranscript) ? "" : "sr-only"}`, "svelte-6wlbb4");
6521
- set_attribute(p, "id", get(transcriptId));
6522
- set_text(text, model().audioTranscript);
6523
- });
6524
- append($$anchor, p);
6525
- };
6526
- if_block(node_2, ($$render) => {
6527
- if (model()?.audioTranscript) $$render(consequent_1);
6528
- });
6529
- var node_3 = sibling(node_2, 2);
6530
- var consequent_3 = ($$anchor) => {
6482
+ var node_1 = sibling(node, 2);
6483
+ var consequent_2 = ($$anchor) => {
6531
6484
  var div_2 = root_3();
6532
6485
  var button = child(div_2);
6533
6486
  var span = child(button);
6534
6487
  var span_1 = child(span);
6535
- var node_4 = child(span_1);
6536
- var consequent_2 = ($$anchor) => {
6537
- append($$anchor, root_4());
6488
+ var node_2 = child(span_1);
6489
+ var consequent_1 = ($$anchor) => {
6490
+ append($$anchor, root_1());
6538
6491
  };
6539
6492
  var alternate = ($$anchor) => {
6540
- append($$anchor, root_5());
6493
+ append($$anchor, root_2());
6541
6494
  };
6542
- if_block(node_4, ($$render) => {
6543
- if (get(showCorrectAnswer)) $$render(consequent_2);
6495
+ if_block(node_2, ($$render) => {
6496
+ if (get(showCorrectAnswer)) $$render(consequent_1);
6544
6497
  else $$render(alternate, -1);
6545
6498
  });
6546
6499
  reset(span_1);
6547
6500
  var span_2 = sibling(span_1, 2);
6548
- var text_1 = child(span_2, true);
6501
+ var text = child(span_2, true);
6549
6502
  reset(span_2);
6550
6503
  reset(span);
6551
6504
  reset(button);
@@ -6553,21 +6506,20 @@ function McPopulatedBlank($$anchor, $$props) {
6553
6506
  reset(div_2);
6554
6507
  template_effect(() => {
6555
6508
  set_attribute(button, "aria-pressed", get(showCorrectAnswer));
6556
- set_text(text_1, get(showCorrectAnswer) ? get(uiText).hideCorrectAnswer : get(uiText).showCorrectAnswer);
6509
+ set_text(text, get(showCorrectAnswer) ? get(uiText).hideCorrectAnswer : get(uiText).showCorrectAnswer);
6557
6510
  });
6558
6511
  append($$anchor, div_2);
6559
6512
  };
6560
- if_block(node_3, ($$render) => {
6561
- if (get(shouldShowCorrectAnswerToggle)) $$render(consequent_3);
6513
+ if_block(node_1, ($$render) => {
6514
+ if (get(shouldShowCorrectAnswerToggle)) $$render(consequent_2);
6562
6515
  });
6563
- var node_5 = sibling(node_3, 2);
6516
+ var node_3 = sibling(node_1, 2);
6564
6517
  {
6565
6518
  let $0 = /* @__PURE__ */ user_derived(() => !!model()?.hasAudio);
6566
6519
  let $1 = /* @__PURE__ */ user_derived(() => model()?.audioUrl);
6567
6520
  let $2 = /* @__PURE__ */ user_derived(() => !!model()?.autoplayAudioEnabled);
6568
- let $3 = /* @__PURE__ */ user_derived(() => model()?.audioTranscript);
6569
- let $4 = /* @__PURE__ */ user_derived(() => model()?.locale);
6570
- AudioPlayer(node_5, {
6521
+ let $3 = /* @__PURE__ */ user_derived(() => model()?.locale);
6522
+ AudioPlayer(node_3, {
6571
6523
  get hasAudio() {
6572
6524
  return get($0);
6573
6525
  },
@@ -6580,15 +6532,6 @@ function McPopulatedBlank($$anchor, $$props) {
6580
6532
  get autoplayEnabled() {
6581
6533
  return get($2);
6582
6534
  },
6583
- get audioTranscript() {
6584
- return get($3);
6585
- },
6586
- get showVisibleTranscript() {
6587
- return get(showVisibleTranscript);
6588
- },
6589
- get transcriptId() {
6590
- return get(transcriptId);
6591
- },
6592
6535
  get featureAudioSkin() {
6593
6536
  return get(featureAudioSkin);
6594
6537
  },
@@ -6596,30 +6539,30 @@ function McPopulatedBlank($$anchor, $$props) {
6596
6539
  return get(uiText);
6597
6540
  },
6598
6541
  get locale() {
6599
- return get($4);
6542
+ return get($3);
6600
6543
  },
6601
6544
  onaudiostarted: onAudioStarted,
6602
6545
  onaudioended: onAudioEnded
6603
6546
  });
6604
6547
  }
6605
- var node_6 = sibling(node_5, 2);
6606
- var consequent_4 = ($$anchor) => {
6607
- var div_3 = root_6();
6548
+ var node_4 = sibling(node_3, 2);
6549
+ var consequent_3 = ($$anchor) => {
6550
+ var div_3 = root_4();
6608
6551
  html(div_3, () => model().sentenceHtml, true);
6609
6552
  reset(div_3);
6610
6553
  template_effect(() => set_attribute(div_3, "aria-describedby", get(templateDescribedBy)));
6611
6554
  append($$anchor, div_3);
6612
6555
  };
6613
- if_block(node_6, ($$render) => {
6614
- if (model()?.sentenceHtml) $$render(consequent_4);
6556
+ if_block(node_4, ($$render) => {
6557
+ if (model()?.sentenceHtml) $$render(consequent_3);
6615
6558
  });
6616
- var node_7 = sibling(node_6, 2);
6617
- var consequent_5 = ($$anchor) => {
6618
- var div_4 = root_7();
6619
- var node_8 = child(div_4);
6620
- html(node_8, () => get(templateParts).before);
6621
- var node_9 = sibling(node_8);
6622
- ClozeMarker(node_9, {
6559
+ var node_5 = sibling(node_4, 2);
6560
+ var consequent_4 = ($$anchor) => {
6561
+ var div_4 = root_5();
6562
+ var node_6 = child(div_4);
6563
+ html(node_6, () => get(templateParts).before);
6564
+ var node_7 = sibling(node_6);
6565
+ ClozeMarker(node_7, {
6623
6566
  get choiceMode() {
6624
6567
  return get(choiceMode);
6625
6568
  },
@@ -6642,31 +6585,31 @@ function McPopulatedBlank($$anchor, $$props) {
6642
6585
  return get(uiText).selectedAnswerInSentence;
6643
6586
  }
6644
6587
  });
6645
- html(sibling(node_9), () => get(templateParts).after);
6588
+ html(sibling(node_7), () => get(templateParts).after);
6646
6589
  reset(div_4);
6647
6590
  template_effect(() => set_attribute(div_4, "aria-describedby", get(templateDescribedBy)));
6648
6591
  append($$anchor, div_4);
6649
6592
  };
6650
- if_block(node_7, ($$render) => {
6651
- if (!get(isAudioOnlyMode)) $$render(consequent_5);
6593
+ if_block(node_5, ($$render) => {
6594
+ if (!get(isAudioOnlyMode)) $$render(consequent_4);
6652
6595
  });
6653
- var node_11 = sibling(node_7, 2);
6654
- var consequent_6 = ($$anchor) => {
6655
- var p_1 = root_8();
6656
- var text_2 = child(p_1, true);
6657
- reset(p_1);
6596
+ var node_9 = sibling(node_5, 2);
6597
+ var consequent_5 = ($$anchor) => {
6598
+ var p = root_6();
6599
+ var text_1 = child(p, true);
6600
+ reset(p);
6658
6601
  template_effect(() => {
6659
- set_attribute(p_1, "id", get(resultId));
6660
- set_text(text_2, get(resultText));
6602
+ set_attribute(p, "id", get(resultId));
6603
+ set_text(text_1, get(resultText));
6661
6604
  });
6662
- append($$anchor, p_1);
6605
+ append($$anchor, p);
6663
6606
  };
6664
- if_block(node_11, ($$render) => {
6665
- if (get(resultText)) $$render(consequent_6);
6607
+ if_block(node_9, ($$render) => {
6608
+ if (get(resultText)) $$render(consequent_5);
6666
6609
  });
6667
- var fieldset = sibling(node_11, 2);
6610
+ var fieldset = sibling(node_9, 2);
6668
6611
  var legend = child(fieldset);
6669
- var text_3 = child(legend, true);
6612
+ var text_2 = child(legend, true);
6670
6613
  reset(legend);
6671
6614
  var div_5 = sibling(legend, 2);
6672
6615
  each(div_5, 21, () => get(choices), (c) => c.id, ($$anchor, c) => {
@@ -6716,7 +6659,7 @@ function McPopulatedBlank($$anchor, $$props) {
6716
6659
  set_style(div, get(layout).rootStyle);
6717
6660
  fieldset.disabled = model()?.disabled;
6718
6661
  set_attribute(legend, "id", get(legendId));
6719
- set_text(text_3, get(legendText));
6662
+ set_text(text_2, get(legendText));
6720
6663
  set_class(div_5, 1, `pie-choices ${get(isHorizontalChoices) ? "flex flex-row flex-wrap items-start justify-center" : "flex flex-col"}`, "svelte-6wlbb4");
6721
6664
  set_attribute(div_5, "aria-labelledby", get(choicesGroupLabelledBy));
6722
6665
  set_attribute(div_5, "aria-label", get(choicesGroupAriaLabel));