@fictjs/runtime 0.16.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/advanced.cjs +9 -9
  2. package/dist/advanced.d.cts +3 -3
  3. package/dist/advanced.d.ts +3 -3
  4. package/dist/advanced.js +4 -4
  5. package/dist/{binding-CQUGLLBI.d.ts → binding-BfzY9rae.d.ts} +2 -2
  6. package/dist/{binding-BlABuUiG.d.cts → binding-CDR2ERoq.d.cts} +2 -2
  7. package/dist/{chunk-CBRGOLTR.cjs → chunk-2J4INHDT.cjs} +40 -40
  8. package/dist/{chunk-CBRGOLTR.cjs.map → chunk-2J4INHDT.cjs.map} +1 -1
  9. package/dist/{chunk-BADX4WTQ.cjs → chunk-CKKZDUHM.cjs} +21 -18
  10. package/dist/chunk-CKKZDUHM.cjs.map +1 -0
  11. package/dist/{chunk-ZWQLXWSV.js → chunk-DHRRJJ6W.js} +8 -5
  12. package/dist/chunk-DHRRJJ6W.js.map +1 -0
  13. package/dist/{chunk-4P4DYWLQ.js → chunk-LFLFSJFU.js} +3 -3
  14. package/dist/{chunk-WJMZ7X46.cjs → chunk-NBDEMBBX.cjs} +47 -85
  15. package/dist/chunk-NBDEMBBX.cjs.map +1 -0
  16. package/dist/{chunk-MAHWGB55.js → chunk-OKPQWORE.js} +47 -85
  17. package/dist/chunk-OKPQWORE.js.map +1 -0
  18. package/dist/{chunk-RK2WSQYL.js → chunk-OLHZBAIF.js} +3 -3
  19. package/dist/{chunk-ZJZ6LMDN.js → chunk-R2HYEOP7.js} +470 -172
  20. package/dist/chunk-R2HYEOP7.js.map +1 -0
  21. package/dist/{chunk-AR2T7JEX.cjs → chunk-UG2IFQOY.cjs} +650 -352
  22. package/dist/chunk-UG2IFQOY.cjs.map +1 -0
  23. package/dist/{chunk-ECNK25S4.cjs → chunk-VP2WC7X3.cjs} +8 -8
  24. package/dist/{chunk-ECNK25S4.cjs.map → chunk-VP2WC7X3.cjs.map} +1 -1
  25. package/dist/{devtools-DWIZRe7L.d.cts → devtools-BwkkQ6DN.d.cts} +1 -1
  26. package/dist/{devtools-DNnnDGu1.d.ts → devtools-CK3SVU_w.d.ts} +1 -1
  27. package/dist/index.cjs +55 -42
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +4 -4
  30. package/dist/index.d.ts +4 -4
  31. package/dist/index.dev.js +260 -156
  32. package/dist/index.dev.js.map +1 -1
  33. package/dist/index.js +16 -3
  34. package/dist/index.js.map +1 -1
  35. package/dist/internal-list.cjs +4 -4
  36. package/dist/internal-list.js +3 -3
  37. package/dist/internal.cjs +5 -5
  38. package/dist/internal.d.cts +4 -4
  39. package/dist/internal.d.ts +4 -4
  40. package/dist/internal.js +4 -4
  41. package/dist/jsx-dev-runtime.cjs.map +1 -1
  42. package/dist/jsx-dev-runtime.d.cts +46 -0
  43. package/dist/jsx-dev-runtime.d.ts +46 -0
  44. package/dist/jsx-dev-runtime.js.map +1 -1
  45. package/dist/jsx-runtime.cjs.map +1 -1
  46. package/dist/jsx-runtime.d.cts +46 -0
  47. package/dist/jsx-runtime.d.ts +46 -0
  48. package/dist/jsx-runtime.js.map +1 -1
  49. package/dist/loader.cjs +143 -26
  50. package/dist/loader.cjs.map +1 -1
  51. package/dist/loader.d.cts +1 -1
  52. package/dist/loader.d.ts +1 -1
  53. package/dist/loader.js +122 -5
  54. package/dist/loader.js.map +1 -1
  55. package/dist/{props-DabFQwLR.d.ts → props-CFoQ471Y.d.ts} +47 -1
  56. package/dist/{props-tImUZAty.d.cts → props-D4tK8Gn0.d.cts} +47 -1
  57. package/dist/{resume-C5IKAIdh.d.ts → resume-C166aAVg.d.ts} +2 -2
  58. package/dist/{resume-DPZxmA95.d.cts → resume-C20cRVj9.d.cts} +2 -2
  59. package/dist/{scope-gpOMWTlf.d.ts → scope-BFzD_7hx.d.ts} +1 -1
  60. package/dist/{scope-GwC4DJ50.d.cts → scope-Ck3mTQVS.d.cts} +1 -1
  61. package/package.json +1 -1
  62. package/src/binding.ts +561 -166
  63. package/src/context.ts +8 -1
  64. package/src/dom.ts +26 -44
  65. package/src/effect.ts +9 -12
  66. package/src/error-boundary.ts +8 -0
  67. package/src/hydration.ts +25 -6
  68. package/src/jsx.ts +46 -0
  69. package/src/lifecycle.ts +31 -79
  70. package/src/loader.ts +153 -4
  71. package/src/resume.ts +5 -5
  72. package/src/signal.ts +4 -1
  73. package/src/suspense.ts +8 -0
  74. package/dist/chunk-AR2T7JEX.cjs.map +0 -1
  75. package/dist/chunk-BADX4WTQ.cjs.map +0 -1
  76. package/dist/chunk-MAHWGB55.js.map +0 -1
  77. package/dist/chunk-WJMZ7X46.cjs.map +0 -1
  78. package/dist/chunk-ZJZ6LMDN.js.map +0 -1
  79. package/dist/chunk-ZWQLXWSV.js.map +0 -1
  80. /package/dist/{chunk-4P4DYWLQ.js.map → chunk-LFLFSJFU.js.map} +0 -0
  81. /package/dist/{chunk-RK2WSQYL.js.map → chunk-OLHZBAIF.js.map} +0 -0
@@ -40,20 +40,20 @@
40
40
 
41
41
 
42
42
 
43
- var _chunkWJMZ7X46cjs = require('./chunk-WJMZ7X46.cjs');
43
+ var _chunkNBDEMBBXcjs = require('./chunk-NBDEMBBX.cjs');
44
44
 
45
45
  // src/transition.ts
46
46
  function startTransition(fn) {
47
- const prev = _chunkWJMZ7X46cjs.setTransitionContext.call(void 0, true);
47
+ const prev = _chunkNBDEMBBXcjs.setTransitionContext.call(void 0, true);
48
48
  try {
49
49
  fn();
50
50
  } finally {
51
- _chunkWJMZ7X46cjs.setTransitionContext.call(void 0, prev);
52
- _chunkWJMZ7X46cjs.scheduleFlush.call(void 0, );
51
+ _chunkNBDEMBBXcjs.setTransitionContext.call(void 0, prev);
52
+ _chunkNBDEMBBXcjs.scheduleFlush.call(void 0, );
53
53
  }
54
54
  }
55
55
  function useTransition() {
56
- const pending = _chunkWJMZ7X46cjs.signal.call(void 0, false);
56
+ const pending = _chunkNBDEMBBXcjs.signal.call(void 0, false);
57
57
  let pendingCount = 0;
58
58
  const beginPending = () => {
59
59
  pendingCount += 1;
@@ -104,10 +104,10 @@ function useTransition() {
104
104
  return [() => pending(), start];
105
105
  }
106
106
  function useDeferredValue(getValue) {
107
- const deferredValue = _chunkWJMZ7X46cjs.signal.call(void 0, getValue());
108
- _chunkWJMZ7X46cjs.createEffect.call(void 0, () => {
107
+ const deferredValue = _chunkNBDEMBBXcjs.signal.call(void 0, getValue());
108
+ _chunkNBDEMBBXcjs.createEffect.call(void 0, () => {
109
109
  const newValue = getValue();
110
- const currentDeferred = _chunkWJMZ7X46cjs.untrack.call(void 0, () => deferredValue());
110
+ const currentDeferred = _chunkNBDEMBBXcjs.untrack.call(void 0, () => deferredValue());
111
111
  if (currentDeferred !== newValue) {
112
112
  startTransition(() => {
113
113
  deferredValue(newValue);
@@ -119,10 +119,10 @@ function useDeferredValue(getValue) {
119
119
 
120
120
  // src/scheduler.ts
121
121
  function batch2(fn) {
122
- return _chunkWJMZ7X46cjs.batch.call(void 0, fn);
122
+ return _chunkNBDEMBBXcjs.batch.call(void 0, fn);
123
123
  }
124
124
  function untrack2(fn) {
125
- return _chunkWJMZ7X46cjs.untrack.call(void 0, fn);
125
+ return _chunkNBDEMBBXcjs.untrack.call(void 0, fn);
126
126
  }
127
127
 
128
128
  // src/jsx.ts
@@ -340,7 +340,7 @@ function withHydration(root, fn) {
340
340
  owner
341
341
  });
342
342
  try {
343
- fn();
343
+ return fn();
344
344
  } finally {
345
345
  hydrationStack.pop();
346
346
  }
@@ -352,7 +352,7 @@ function withHydrationRange(start, end, owner, fn) {
352
352
  owner
353
353
  });
354
354
  try {
355
- fn();
355
+ return fn();
356
356
  } finally {
357
357
  hydrationStack.pop();
358
358
  }
@@ -383,6 +383,18 @@ function claimNodes(templateRoot, fallback) {
383
383
  }
384
384
  return frag;
385
385
  }
386
+ function claimText(value, fallback) {
387
+ const ctx = hydrationStack[hydrationStack.length - 1];
388
+ if (!ctx || !ctx.cursor || ctx.cursor === ctx.boundary || ctx.cursor.nodeType !== Node.TEXT_NODE) {
389
+ return fallback();
390
+ }
391
+ const text = ctx.cursor;
392
+ ctx.cursor = text.nextSibling;
393
+ if (text.data !== value) {
394
+ text.data = value;
395
+ }
396
+ return text;
397
+ }
386
398
  function isHydratingActive() {
387
399
  return hydrationStack.length > 0;
388
400
  }
@@ -395,7 +407,9 @@ var PROP_CACHE = Symbol("fict:prop");
395
407
  var STYLE_CACHE = Symbol("fict:style");
396
408
  var CLASS_STATE_CACHE = Symbol("fict:class-state");
397
409
  var CLASS_VALUE_CACHE = Symbol("fict:class-value");
398
- var EVENT_TUPLE_LISTENER_CACHE = Symbol("fict:event-tuple-listener-cache");
410
+ var EVENT_LISTENER_CACHE = Symbol("fict:event-listener-cache");
411
+ var REF_ASSIGN_CACHE = Symbol("fict:ref-assign-cache");
412
+ var CHILDREN_BINDING_CACHE = Symbol("fict:children-binding-cache");
399
413
  var NON_REACTIVE_FN_MARKER = Symbol.for("fict:non-reactive-fn");
400
414
  var REACTIVE_FN_MARKER = Symbol.for("fict:reactive-fn");
401
415
  var NON_REACTIVE_FN_REGISTRY_KEY = Symbol.for("fict:non-reactive-fn-registry");
@@ -423,17 +437,21 @@ function isExplicitReactiveFn(value) {
423
437
  if (typeof value !== "function") return false;
424
438
  return value[REACTIVE_FN_MARKER] === true;
425
439
  }
440
+ var registeredCreateElement;
441
+ function registerCreateElement(fn) {
442
+ registeredCreateElement = fn;
443
+ }
426
444
  function isReactive(value) {
427
445
  if (typeof value !== "function") return false;
428
446
  if (isNonReactiveFn(value)) return false;
429
- if (_chunkWJMZ7X46cjs.isSignal.call(void 0, value) || _chunkWJMZ7X46cjs.isComputed.call(void 0, value)) return true;
447
+ if (_chunkNBDEMBBXcjs.isSignal.call(void 0, value) || _chunkNBDEMBBXcjs.isComputed.call(void 0, value)) return true;
430
448
  if (isExplicitReactiveFn(value)) return true;
431
- if (_chunkWJMZ7X46cjs.isEffect.call(void 0, value) || _chunkWJMZ7X46cjs.isEffectScope.call(void 0, value)) return false;
449
+ if (_chunkNBDEMBBXcjs.isEffect.call(void 0, value) || _chunkNBDEMBBXcjs.isEffectScope.call(void 0, value)) return false;
432
450
  return value.length === 0;
433
451
  }
434
452
  function isStrictlyReactive(value) {
435
453
  if (typeof value !== "function") return false;
436
- return _chunkWJMZ7X46cjs.isSignal.call(void 0, value) || _chunkWJMZ7X46cjs.isComputed.call(void 0, value) || isPropGetterFn(value) || isExplicitReactiveFn(value);
454
+ return _chunkNBDEMBBXcjs.isSignal.call(void 0, value) || _chunkNBDEMBBXcjs.isComputed.call(void 0, value) || isPropGetterFn(value) || isExplicitReactiveFn(value);
437
455
  }
438
456
  var PROP_GETTER_MARKER = Symbol.for("fict:prop-getter");
439
457
  function isPropGetterFn(value) {
@@ -497,7 +515,7 @@ function createTextBinding(value, owner) {
497
515
  const textOwnerDocument = owner && "nodeType" in owner ? owner.nodeType === 9 ? owner : _nullishCoalesce(owner.ownerDocument, () => ( document)) : document;
498
516
  const text = textOwnerDocument.createTextNode("");
499
517
  if (isReactive(value)) {
500
- _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => {
518
+ _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => {
501
519
  setText(text, value());
502
520
  });
503
521
  } else {
@@ -506,7 +524,7 @@ function createTextBinding(value, owner) {
506
524
  return text;
507
525
  }
508
526
  function bindText(textNode, getValue) {
509
- return _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => setText(textNode, getValue()));
527
+ return _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => setText(textNode, getValue()));
510
528
  }
511
529
  function setText(textNode, value) {
512
530
  const next = formatTextValue(value);
@@ -526,7 +544,7 @@ function formatTextValue(value) {
526
544
  }
527
545
  function createAttributeBinding(el, key, value, setter) {
528
546
  if (isReactive(value)) {
529
- _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => {
547
+ _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => {
530
548
  setter(el, key, value());
531
549
  });
532
550
  } else {
@@ -534,7 +552,7 @@ function createAttributeBinding(el, key, value, setter) {
534
552
  }
535
553
  }
536
554
  function bindAttribute(el, key, getValue) {
537
- return _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => setAttr(el, key, getValue()));
555
+ return _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => setAttr(el, key, getValue()));
538
556
  }
539
557
  function setAttr(el, key, value) {
540
558
  const cacheTarget = el;
@@ -550,7 +568,7 @@ function setAttr(el, key, value) {
550
568
  }
551
569
  }
552
570
  function bindProperty(el, key, getValue) {
553
- return _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => setProp(el, key, getValue()));
571
+ return _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => setProp(el, key, getValue()));
554
572
  }
555
573
  function setProp(el, key, value) {
556
574
  const cacheTarget = el;
@@ -567,7 +585,7 @@ function setProp(el, key, value) {
567
585
  }
568
586
  function createStyleBinding(el, value) {
569
587
  if (isReactive(value)) {
570
- _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => {
588
+ _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => {
571
589
  setStyle(el, value());
572
590
  });
573
591
  } else {
@@ -575,7 +593,7 @@ function createStyleBinding(el, value) {
575
593
  }
576
594
  }
577
595
  function bindStyle(el, getValue) {
578
- return _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => setStyle(el, getValue()));
596
+ return _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => setStyle(el, getValue()));
579
597
  }
580
598
  function setStyle(el, value) {
581
599
  const target = el;
@@ -630,7 +648,7 @@ function applyStyle(el, value, prev) {
630
648
  }
631
649
  }
632
650
  }
633
- var isUnitlessStyleProperty = isDev ? (prop2) => _chunkWJMZ7X46cjs.UnitlessStyles.has(prop2) : (prop2) => prop2 === "opacity" || prop2 === "zIndex";
651
+ var isUnitlessStyleProperty = isDev ? (prop2) => _chunkNBDEMBBXcjs.UnitlessStyles.has(prop2) : (prop2) => prop2 === "opacity" || prop2 === "zIndex";
634
652
  function normalizeStyleProperty(prop2) {
635
653
  const cached = STYLE_PROP_CACHE.get(prop2);
636
654
  if (cached) return cached;
@@ -640,7 +658,7 @@ function normalizeStyleProperty(prop2) {
640
658
  }
641
659
  function createClassBinding(el, value) {
642
660
  if (isReactive(value)) {
643
- _chunkWJMZ7X46cjs.createRenderEffect.call(void 0,
661
+ _chunkNBDEMBBXcjs.createRenderEffect.call(void 0,
644
662
  () => setClass(el, value())
645
663
  );
646
664
  } else {
@@ -648,7 +666,7 @@ function createClassBinding(el, value) {
648
666
  }
649
667
  }
650
668
  function bindClass(el, getValue) {
651
- return _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => setClass(el, getValue()));
669
+ return _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => setClass(el, getValue()));
652
670
  }
653
671
  function setClass(el, value) {
654
672
  const cache = el;
@@ -709,7 +727,7 @@ function classList(node, value, prev = {}) {
709
727
  return applyClass(node, value, prev);
710
728
  }
711
729
  function insert(parent, getValue, markerOrCreateElement, createElementFn) {
712
- const hostRoot = _chunkWJMZ7X46cjs.getCurrentRoot.call(void 0, );
730
+ const hostRoot = _chunkNBDEMBBXcjs.getCurrentRoot.call(void 0, );
713
731
  const parentOwnerDocument = _nullishCoalesce(parent.ownerDocument, () => ( document));
714
732
  let marker;
715
733
  let ownsMarker = false;
@@ -750,13 +768,13 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
750
768
  insertNodesBefore(parentNode, [currentText], marker);
751
769
  currentNodes = [currentText];
752
770
  };
753
- const dispose = _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => {
771
+ const dispose = _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => {
754
772
  const value = getValue();
755
773
  const parentNode = marker.parentNode;
756
774
  const isPrimitive = value == null || value === false || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
757
775
  if (isPrimitive) {
758
776
  if (currentRoot) {
759
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, currentRoot);
777
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, currentRoot);
760
778
  currentRoot = null;
761
779
  }
762
780
  if (!parentNode) {
@@ -769,12 +787,12 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
769
787
  return;
770
788
  }
771
789
  if (currentRoot) {
772
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, currentRoot);
790
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, currentRoot);
773
791
  currentRoot = null;
774
792
  }
775
793
  clearCurrentNodes();
776
- const root = _chunkWJMZ7X46cjs.createRootContext.call(void 0, hostRoot);
777
- const prev = _chunkWJMZ7X46cjs.pushRoot.call(void 0, root);
794
+ const root = _chunkNBDEMBBXcjs.createRootContext.call(void 0, hostRoot);
795
+ const prev = _chunkNBDEMBBXcjs.pushRoot.call(void 0, root);
778
796
  let nodes;
779
797
  let handledError = false;
780
798
  try {
@@ -802,28 +820,28 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
802
820
  nodes = toNodeArray(newNode, ownerDocument);
803
821
  if (root.suspended) {
804
822
  handledError = true;
805
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
823
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
806
824
  return;
807
825
  }
808
826
  if (parentNode) {
809
827
  insertNodesBefore(parentNode, nodes, marker);
810
828
  }
811
829
  } catch (err) {
812
- if (_chunkWJMZ7X46cjs.handleSuspend.call(void 0, err, root)) {
830
+ if (_chunkNBDEMBBXcjs.handleSuspend.call(void 0, err, root)) {
813
831
  handledError = true;
814
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
832
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
815
833
  return;
816
834
  }
817
- if (_chunkWJMZ7X46cjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
835
+ if (_chunkNBDEMBBXcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
818
836
  handledError = true;
819
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
837
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
820
838
  return;
821
839
  }
822
840
  throw err;
823
841
  } finally {
824
- _chunkWJMZ7X46cjs.popRoot.call(void 0, prev);
842
+ _chunkNBDEMBBXcjs.popRoot.call(void 0, prev);
825
843
  if (!handledError) {
826
- _chunkWJMZ7X46cjs.flushOnMount.call(void 0, root);
844
+ _chunkNBDEMBBXcjs.flushOnMount.call(void 0, root);
827
845
  }
828
846
  }
829
847
  currentRoot = root;
@@ -832,7 +850,7 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
832
850
  return () => {
833
851
  dispose();
834
852
  if (currentRoot) {
835
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, currentRoot);
853
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, currentRoot);
836
854
  currentRoot = null;
837
855
  }
838
856
  clearCurrentNodes();
@@ -842,12 +860,12 @@ function insert(parent, getValue, markerOrCreateElement, createElementFn) {
842
860
  };
843
861
  }
844
862
  function insertBetween(start, end, getValue, createElementFn) {
845
- const hostRoot = _chunkWJMZ7X46cjs.getCurrentRoot.call(void 0, );
863
+ const hostRoot = _chunkNBDEMBBXcjs.getCurrentRoot.call(void 0, );
846
864
  const markerOwnerDocument = _nullishCoalesce(_nullishCoalesce(start.ownerDocument, () => ( end.ownerDocument)), () => ( document));
847
865
  let currentNodes = [];
848
866
  let currentText = null;
849
867
  let currentRoot = null;
850
- let initialHydrating = _chunkWJMZ7X46cjs.__fictIsHydrating.call(void 0, );
868
+ let initialHydrating = _chunkNBDEMBBXcjs.__fictIsHydrating.call(void 0, );
851
869
  const collectBetween = () => {
852
870
  const nodes = [];
853
871
  let cursor = start.nextSibling;
@@ -883,7 +901,7 @@ function insertBetween(start, end, getValue, createElementFn) {
883
901
  currentNodes = [currentText];
884
902
  }
885
903
  };
886
- const dispose = _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => {
904
+ const dispose = _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => {
887
905
  const value = getValue();
888
906
  const parentNode = start.parentNode;
889
907
  const isPrimitive = value == null || value === false || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
@@ -897,7 +915,7 @@ function insertBetween(start, end, getValue, createElementFn) {
897
915
  }
898
916
  }
899
917
  if (currentRoot) {
900
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, currentRoot);
918
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, currentRoot);
901
919
  currentRoot = null;
902
920
  }
903
921
  if (!parentNode) {
@@ -911,12 +929,12 @@ function insertBetween(start, end, getValue, createElementFn) {
911
929
  return;
912
930
  }
913
931
  if (currentRoot) {
914
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, currentRoot);
932
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, currentRoot);
915
933
  currentRoot = null;
916
934
  }
917
935
  clearCurrentNodes();
918
- const root = _chunkWJMZ7X46cjs.createRootContext.call(void 0, hostRoot);
919
- const prev = _chunkWJMZ7X46cjs.pushRoot.call(void 0, root);
936
+ const root = _chunkNBDEMBBXcjs.createRootContext.call(void 0, hostRoot);
937
+ const prev = _chunkNBDEMBBXcjs.pushRoot.call(void 0, root);
920
938
  let nodes;
921
939
  let handledError = false;
922
940
  try {
@@ -956,28 +974,28 @@ function insertBetween(start, end, getValue, createElementFn) {
956
974
  nodes = toNodeArray(newNode, ownerDocument);
957
975
  if (root.suspended) {
958
976
  handledError = true;
959
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
977
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
960
978
  return;
961
979
  }
962
980
  if (parentNode && !initialHydrating) {
963
981
  insertNodesBefore(parentNode, nodes, end);
964
982
  }
965
983
  } catch (err) {
966
- if (_chunkWJMZ7X46cjs.handleSuspend.call(void 0, err, root)) {
984
+ if (_chunkNBDEMBBXcjs.handleSuspend.call(void 0, err, root)) {
967
985
  handledError = true;
968
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
986
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
969
987
  return;
970
988
  }
971
- if (_chunkWJMZ7X46cjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
989
+ if (_chunkNBDEMBBXcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
972
990
  handledError = true;
973
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
991
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
974
992
  return;
975
993
  }
976
994
  throw err;
977
995
  } finally {
978
- _chunkWJMZ7X46cjs.popRoot.call(void 0, prev);
996
+ _chunkNBDEMBBXcjs.popRoot.call(void 0, prev);
979
997
  if (!handledError) {
980
- _chunkWJMZ7X46cjs.flushOnMount.call(void 0, root);
998
+ _chunkNBDEMBBXcjs.flushOnMount.call(void 0, root);
981
999
  }
982
1000
  }
983
1001
  currentRoot = root;
@@ -987,7 +1005,7 @@ function insertBetween(start, end, getValue, createElementFn) {
987
1005
  return () => {
988
1006
  dispose();
989
1007
  if (currentRoot) {
990
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, currentRoot);
1008
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, currentRoot);
991
1009
  currentRoot = null;
992
1010
  }
993
1011
  clearCurrentNodes();
@@ -996,10 +1014,10 @@ function insertBetween(start, end, getValue, createElementFn) {
996
1014
  function createChildBinding(parent, getValue, createElementFn) {
997
1015
  const marker = (_nullishCoalesce(parent.ownerDocument, () => ( document))).createComment("fict:child");
998
1016
  parent.appendChild(marker);
999
- const hostRoot = _chunkWJMZ7X46cjs.getCurrentRoot.call(void 0, );
1000
- const dispose = _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => {
1001
- const root = _chunkWJMZ7X46cjs.createRootContext.call(void 0, hostRoot);
1002
- const prev = _chunkWJMZ7X46cjs.pushRoot.call(void 0, root);
1017
+ const hostRoot = _chunkNBDEMBBXcjs.getCurrentRoot.call(void 0, );
1018
+ const dispose = _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => {
1019
+ const root = _chunkNBDEMBBXcjs.createRootContext.call(void 0, hostRoot);
1020
+ const prev = _chunkNBDEMBBXcjs.pushRoot.call(void 0, root);
1003
1021
  let nodes = [];
1004
1022
  let handledError = false;
1005
1023
  try {
@@ -1014,25 +1032,25 @@ function createChildBinding(parent, getValue, createElementFn) {
1014
1032
  insertNodesBefore(parentNode, nodes, marker);
1015
1033
  }
1016
1034
  return () => {
1017
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
1035
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
1018
1036
  removeNodes(nodes);
1019
1037
  };
1020
1038
  } catch (err) {
1021
- if (_chunkWJMZ7X46cjs.handleSuspend.call(void 0, err, root)) {
1039
+ if (_chunkNBDEMBBXcjs.handleSuspend.call(void 0, err, root)) {
1022
1040
  handledError = true;
1023
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
1041
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
1024
1042
  return;
1025
1043
  }
1026
- if (_chunkWJMZ7X46cjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
1044
+ if (_chunkNBDEMBBXcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
1027
1045
  handledError = true;
1028
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
1046
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
1029
1047
  return;
1030
1048
  }
1031
1049
  throw err;
1032
1050
  } finally {
1033
- _chunkWJMZ7X46cjs.popRoot.call(void 0, prev);
1051
+ _chunkNBDEMBBXcjs.popRoot.call(void 0, prev);
1034
1052
  if (!handledError) {
1035
- _chunkWJMZ7X46cjs.flushOnMount.call(void 0, root);
1053
+ _chunkNBDEMBBXcjs.flushOnMount.call(void 0, root);
1036
1054
  }
1037
1055
  }
1038
1056
  });
@@ -1045,7 +1063,7 @@ function createChildBinding(parent, getValue, createElementFn) {
1045
1063
  };
1046
1064
  }
1047
1065
  function delegateEvents(eventNames, doc = window.document) {
1048
- const e = doc[_chunkWJMZ7X46cjs.$$EVENTS] || (doc[_chunkWJMZ7X46cjs.$$EVENTS] = /* @__PURE__ */ new Set());
1066
+ const e = doc[_chunkNBDEMBBXcjs.$$EVENTS] || (doc[_chunkNBDEMBBXcjs.$$EVENTS] = /* @__PURE__ */ new Set());
1049
1067
  for (let i = 0, l = eventNames.length; i < l; i++) {
1050
1068
  const name = eventNames[i];
1051
1069
  if (!e.has(name)) {
@@ -1055,12 +1073,12 @@ function delegateEvents(eventNames, doc = window.document) {
1055
1073
  }
1056
1074
  }
1057
1075
  function clearDelegatedEvents(doc = window.document) {
1058
- const e = doc[_chunkWJMZ7X46cjs.$$EVENTS];
1076
+ const e = doc[_chunkNBDEMBBXcjs.$$EVENTS];
1059
1077
  if (e) {
1060
1078
  for (const name of e.keys()) {
1061
1079
  doc.removeEventListener(name, globalEventHandler);
1062
1080
  }
1063
- delete doc[_chunkWJMZ7X46cjs.$$EVENTS];
1081
+ delete doc[_chunkNBDEMBBXcjs.$$EVENTS];
1064
1082
  }
1065
1083
  }
1066
1084
  function globalEventHandler(e) {
@@ -1085,26 +1103,18 @@ function globalEventHandler(e) {
1085
1103
  if (!node) return false;
1086
1104
  const handler = node[key];
1087
1105
  if (handler && !node.disabled) {
1088
- const resolveData = (value) => {
1089
- if (typeof value === "function") {
1090
- try {
1091
- const fn = value;
1092
- return fn.length > 0 ? fn(e) : fn();
1093
- } catch (e12) {
1094
- return value();
1095
- }
1096
- }
1097
- return value;
1098
- };
1099
1106
  const rawData = node[dataKey];
1100
1107
  const hasData = rawData !== void 0;
1101
- const resolvedNodeData = hasData ? resolveData(rawData) : void 0;
1108
+ const resolvedNodeData = hasData ? resolveEventData(rawData, e) : void 0;
1102
1109
  batch2(() => {
1103
1110
  if (typeof handler === "function") {
1104
1111
  callEventHandler(handler, e, node, hasData ? resolvedNodeData : void 0);
1105
1112
  } else if (Array.isArray(handler)) {
1106
- const tupleData = resolveData(handler[1]);
1107
- callEventHandler(handler[0], e, node, tupleData);
1113
+ const tupleHandler = resolveEventHandlerValue(
1114
+ handler[0]
1115
+ );
1116
+ const tupleData = resolveEventData(handler[1], e);
1117
+ callEventHandler(tupleHandler, e, node, tupleData);
1108
1118
  }
1109
1119
  });
1110
1120
  if (e.cancelBubble) return false;
@@ -1152,145 +1162,445 @@ function globalEventHandler(e) {
1152
1162
  }
1153
1163
  retarget(oriTarget);
1154
1164
  }
1155
- function addEventListener(node, name, handler, delegate) {
1165
+ function addEventListener(node, name, handler, delegate, options) {
1156
1166
  if (delegate) {
1157
1167
  const key = `$$${name}`;
1158
1168
  const dataKey = `${key}Data`;
1169
+ const rootRef2 = _chunkNBDEMBBXcjs.getCurrentRoot.call(void 0, );
1170
+ const delegationDocument = resolveDelegationDocument(node, rootRef2);
1171
+ delegateEvents([name], delegationDocument);
1159
1172
  if (handler == null) {
1160
1173
  ;
1161
1174
  node[key] = void 0;
1162
1175
  node[dataKey] = void 0;
1163
1176
  return;
1164
1177
  }
1165
- if (Array.isArray(handler)) {
1166
- ;
1167
- node[key] = handler[0];
1168
- node[dataKey] = handler[1];
1169
- } else {
1170
- ;
1171
- node[key] = handler;
1172
- node[dataKey] = void 0;
1173
- }
1178
+ ;
1179
+ node[key] = createEventInvoker(
1180
+ name,
1181
+ handler,
1182
+ node,
1183
+ rootRef2
1184
+ );
1185
+ node[dataKey] = void 0;
1174
1186
  return;
1175
1187
  }
1188
+ removeStoredEventListener(node, name, options);
1176
1189
  if (handler == null) return;
1177
- if (Array.isArray(handler)) {
1178
- const store = getTupleEventListenerStore(node);
1179
- const existing = store.get(name);
1180
- if (existing) {
1181
- node.removeEventListener(name, existing);
1182
- }
1183
- const handlerFn = handler[0];
1184
- const wrapped = (e) => handlerFn.call(node, handler[1], e);
1185
- store.set(name, wrapped);
1186
- node.addEventListener(name, wrapped);
1187
- return;
1190
+ const rootRef = _chunkNBDEMBBXcjs.getCurrentRoot.call(void 0, );
1191
+ const wrapped = createEventInvoker(name, handler, node, rootRef);
1192
+ node.addEventListener(name, wrapped, options);
1193
+ getStoredEventListenerStore(node).set(getEventListenerStoreKey(name, options), {
1194
+ listener: wrapped,
1195
+ options
1196
+ });
1197
+ }
1198
+ function resolveDelegationDocument(node, rootRef) {
1199
+ const nodeDocument = _nullishCoalesce(node.ownerDocument, () => ( void 0));
1200
+ if (_optionalChain([rootRef, 'optionalAccess', _18 => _18.ownerDocument]) && _optionalChain([nodeDocument, 'optionalAccess', _19 => _19.defaultView]) == null) {
1201
+ return rootRef.ownerDocument;
1188
1202
  }
1189
- node.addEventListener(name, handler);
1203
+ return _nullishCoalesce(_nullishCoalesce(nodeDocument, () => ( _optionalChain([rootRef, 'optionalAccess', _20 => _20.ownerDocument]))), () => ( document));
1190
1204
  }
1191
- function getTupleEventListenerStore(node) {
1205
+ function getStoredEventListenerStore(node) {
1192
1206
  const host = node;
1193
- if (!host[EVENT_TUPLE_LISTENER_CACHE]) {
1194
- host[EVENT_TUPLE_LISTENER_CACHE] = /* @__PURE__ */ new Map();
1207
+ if (!host[EVENT_LISTENER_CACHE]) {
1208
+ host[EVENT_LISTENER_CACHE] = /* @__PURE__ */ new Map();
1195
1209
  }
1196
- return host[EVENT_TUPLE_LISTENER_CACHE];
1210
+ return host[EVENT_LISTENER_CACHE];
1211
+ }
1212
+ function getEventListenerStoreKey(name, options) {
1213
+ const capture = typeof options === "boolean" ? options : _optionalChain([options, 'optionalAccess', _21 => _21.capture]) === true;
1214
+ const passive = typeof options === "object" && _optionalChain([options, 'optionalAccess', _22 => _22.passive]) === true;
1215
+ const once = typeof options === "object" && _optionalChain([options, 'optionalAccess', _23 => _23.once]) === true;
1216
+ return `${name}:${capture ? 1 : 0}:${passive ? 1 : 0}:${once ? 1 : 0}`;
1197
1217
  }
1198
- function removeStoredTupleEventListener(node, name) {
1218
+ function removeStoredEventListener(node, name, options) {
1199
1219
  const host = node;
1200
- const store = host[EVENT_TUPLE_LISTENER_CACHE];
1220
+ const store = host[EVENT_LISTENER_CACHE];
1201
1221
  if (!store) return;
1202
- const wrapped = store.get(name);
1203
- if (!wrapped) return;
1204
- node.removeEventListener(name, wrapped);
1205
- store.delete(name);
1222
+ const entry = store.get(getEventListenerStoreKey(name, options));
1223
+ if (!entry) return;
1224
+ node.removeEventListener(name, entry.listener, entry.options);
1225
+ store.delete(getEventListenerStoreKey(name, options));
1206
1226
  if (store.size === 0) {
1207
- delete host[EVENT_TUPLE_LISTENER_CACHE];
1227
+ delete host[EVENT_LISTENER_CACHE];
1208
1228
  }
1209
1229
  }
1210
- function bindEvent(el, eventName, handler, options) {
1211
- if (handler == null) return () => {
1212
- };
1213
- const rootRef = _chunkWJMZ7X46cjs.getCurrentRoot.call(void 0, );
1214
- const shouldDelegate = options == null && _chunkWJMZ7X46cjs.DelegatedEvents.has(eventName);
1215
- if (shouldDelegate) {
1216
- const key = `$$${eventName}`;
1217
- delegateEvents([eventName]);
1218
- const resolveHandler = isStrictlyReactive(handler) ? handler : () => handler;
1219
- el[key] = function(...args) {
1220
- try {
1221
- const fn = resolveHandler();
1222
- callEventHandler(fn, args[0], el);
1223
- } catch (err) {
1224
- if (!_chunkWJMZ7X46cjs.handleError.call(void 0, err, { source: "event", eventName }, rootRef)) {
1225
- throw err;
1226
- }
1227
- }
1228
- };
1229
- return () => {
1230
- el[key] = void 0;
1231
- };
1230
+ function resolveEventData(value, event) {
1231
+ if (typeof value !== "function") return value;
1232
+ if (isReactive(value)) {
1233
+ return value();
1232
1234
  }
1233
- const getHandler = isStrictlyReactive(handler) ? handler : () => handler;
1234
- const wrapped = (event) => {
1235
+ try {
1236
+ const fn = value;
1237
+ return fn.length > 0 ? fn(event) : fn();
1238
+ } catch (e12) {
1239
+ return value();
1240
+ }
1241
+ }
1242
+ function resolveEventHandlerValue(value) {
1243
+ if (isStrictlyReactive(value)) {
1244
+ return value();
1245
+ }
1246
+ return value;
1247
+ }
1248
+ function createEventInvoker(eventName, handler, node, rootRef) {
1249
+ return (event) => {
1235
1250
  try {
1236
- const resolved = getHandler();
1237
- callEventHandler(resolved, event, el);
1251
+ if (Array.isArray(handler)) {
1252
+ const resolvedHandler2 = resolveEventHandlerValue(
1253
+ handler[0]
1254
+ );
1255
+ const data = resolveEventData(handler[1], event);
1256
+ callEventHandler(resolvedHandler2, event, node, data);
1257
+ return;
1258
+ }
1259
+ const resolvedHandler = resolveEventHandlerValue(
1260
+ handler
1261
+ );
1262
+ callEventHandler(resolvedHandler, event, node);
1238
1263
  } catch (err) {
1239
- if (_chunkWJMZ7X46cjs.handleError.call(void 0, err, { source: "event", eventName }, rootRef)) {
1264
+ if (_chunkNBDEMBBXcjs.handleError.call(void 0, err, { source: "event", eventName }, rootRef)) {
1240
1265
  return;
1241
1266
  }
1242
1267
  throw err;
1243
1268
  }
1244
1269
  };
1245
- el.addEventListener(eventName, wrapped, options);
1246
- const cleanup = () => el.removeEventListener(eventName, wrapped, options);
1247
- _chunkWJMZ7X46cjs.registerRootCleanup.call(void 0, cleanup);
1270
+ }
1271
+ function bindEvent(el, eventName, handler, options) {
1272
+ if (handler == null) return () => {
1273
+ };
1274
+ const shouldDelegate = options == null && _chunkNBDEMBBXcjs.DelegatedEvents.has(eventName);
1275
+ if (shouldDelegate) {
1276
+ addEventListener(el, eventName, handler, true);
1277
+ return () => {
1278
+ addEventListener(el, eventName, null, true);
1279
+ };
1280
+ }
1281
+ addEventListener(
1282
+ el,
1283
+ eventName,
1284
+ handler,
1285
+ false,
1286
+ options
1287
+ );
1288
+ const cleanup = () => removeStoredEventListener(el, eventName, options);
1289
+ _chunkNBDEMBBXcjs.registerRootCleanup.call(void 0, cleanup);
1248
1290
  return cleanup;
1249
1291
  }
1250
- function bindRef(el, ref) {
1292
+ function bindRef(el, ref, registerCleanup = true) {
1251
1293
  if (ref == null) return () => {
1252
1294
  };
1253
1295
  const getRef = isReactive(ref) ? ref : () => ref;
1254
- const applyRef2 = (refValue) => {
1296
+ let currentRef;
1297
+ const applyRefValue = (refValue, value) => {
1255
1298
  if (refValue == null) return;
1256
1299
  if (typeof refValue === "function") {
1257
1300
  ;
1258
- refValue(el);
1301
+ refValue(value);
1259
1302
  } else if (typeof refValue === "object" && "current" in refValue) {
1260
1303
  ;
1261
- refValue.current = el;
1304
+ refValue.current = value;
1262
1305
  }
1263
1306
  };
1264
- const initialRef = getRef();
1265
- applyRef2(initialRef);
1307
+ const clearCurrentRef = () => {
1308
+ if (currentRef == null) return;
1309
+ applyRefValue(currentRef, null);
1310
+ currentRef = void 0;
1311
+ };
1312
+ const syncRef = (nextRef) => {
1313
+ if (nextRef === currentRef) return;
1314
+ clearCurrentRef();
1315
+ currentRef = nextRef;
1316
+ applyRefValue(currentRef, el);
1317
+ };
1318
+ let disposeTracking;
1266
1319
  if (isReactive(ref)) {
1267
- const cleanup2 = _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => {
1268
- const currentRef = getRef();
1269
- applyRef2(currentRef);
1320
+ disposeTracking = _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => {
1321
+ syncRef(getRef());
1270
1322
  });
1271
- _chunkWJMZ7X46cjs.registerRootCleanup.call(void 0, cleanup2);
1272
- const nullifyCleanup = () => {
1273
- const currentRef = getRef();
1274
- if (currentRef && typeof currentRef === "object" && "current" in currentRef) {
1275
- ;
1276
- currentRef.current = null;
1277
- }
1278
- };
1279
- _chunkWJMZ7X46cjs.registerRootCleanup.call(void 0, nullifyCleanup);
1280
- return () => {
1281
- cleanup2();
1282
- nullifyCleanup();
1283
- };
1323
+ } else {
1324
+ syncRef(getRef());
1325
+ }
1326
+ if (registerCleanup) {
1327
+ _chunkNBDEMBBXcjs.registerRootCleanup.call(void 0, clearCurrentRef);
1328
+ }
1329
+ return () => {
1330
+ _optionalChain([disposeTracking, 'optionalCall', _24 => _24()]);
1331
+ clearCurrentRef();
1332
+ };
1333
+ }
1334
+ function resolveAssignedChildrenValue(value) {
1335
+ if (typeof value === "function") {
1336
+ return isReactive(value) ? value() : null;
1337
+ }
1338
+ return _nullishCoalesce(value, () => ( null));
1339
+ }
1340
+ function resolveAssignedRefValue(value) {
1341
+ if (isReactive(value)) {
1342
+ return value();
1284
1343
  }
1285
- const cleanup = () => {
1286
- const refValue = getRef();
1287
- if (refValue && typeof refValue === "object" && "current" in refValue) {
1344
+ return value;
1345
+ }
1346
+ function createAssignedRefState(node, owner, initialValue) {
1347
+ const valueSignal = _chunkNBDEMBBXcjs.signal.call(void 0, initialValue);
1348
+ let currentRef;
1349
+ const applyRefValue = (refValue, value) => {
1350
+ if (refValue == null) return;
1351
+ if (typeof refValue === "function") {
1288
1352
  ;
1289
- refValue.current = null;
1353
+ refValue(value);
1354
+ } else if (typeof refValue === "object" && "current" in refValue) {
1355
+ ;
1356
+ refValue.current = value;
1290
1357
  }
1291
1358
  };
1292
- _chunkWJMZ7X46cjs.registerRootCleanup.call(void 0, cleanup);
1293
- return cleanup;
1359
+ const clearCurrentRef = () => {
1360
+ if (currentRef == null) return;
1361
+ applyRefValue(currentRef, null);
1362
+ currentRef = void 0;
1363
+ };
1364
+ const syncRef = (nextRef) => {
1365
+ if (nextRef === currentRef) return;
1366
+ clearCurrentRef();
1367
+ currentRef = nextRef;
1368
+ applyRefValue(currentRef, node);
1369
+ };
1370
+ const disposeTracking = _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => {
1371
+ syncRef(resolveAssignedRefValue(valueSignal()));
1372
+ });
1373
+ return {
1374
+ cleanup: () => {
1375
+ disposeTracking();
1376
+ clearCurrentRef();
1377
+ },
1378
+ owner,
1379
+ registeredCleanup: false,
1380
+ value: (next) => {
1381
+ valueSignal(next);
1382
+ syncRef(resolveAssignedRefValue(next));
1383
+ }
1384
+ };
1385
+ }
1386
+ function bindAssignedChildren(node, getValue, createElementFn) {
1387
+ const hostRoot = _chunkNBDEMBBXcjs.getCurrentRoot.call(void 0, );
1388
+ const createFn = _nullishCoalesce(createElementFn, () => ( registeredCreateElement));
1389
+ let currentNodes = [];
1390
+ let currentText = null;
1391
+ let currentRoot = null;
1392
+ let initialHydrating = _chunkNBDEMBBXcjs.__fictIsHydrating.call(void 0, );
1393
+ const collectCurrentChildren = () => Array.from(node.childNodes);
1394
+ const clearCurrentNodes = () => {
1395
+ if (currentRoot) {
1396
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, currentRoot);
1397
+ currentRoot = null;
1398
+ }
1399
+ if (currentNodes.length > 0) {
1400
+ removeNodes(currentNodes);
1401
+ currentNodes = [];
1402
+ }
1403
+ currentText = null;
1404
+ };
1405
+ const setTextNode = (textValue, shouldInsert) => {
1406
+ if (!shouldInsert) {
1407
+ clearCurrentNodes();
1408
+ if (node.childNodes.length > 0) {
1409
+ node.replaceChildren();
1410
+ }
1411
+ initialHydrating = false;
1412
+ return;
1413
+ }
1414
+ if (initialHydrating && isHydratingActive()) {
1415
+ const hydratedNodes = collectCurrentChildren();
1416
+ if (hydratedNodes.length === 1 && _optionalChain([hydratedNodes, 'access', _25 => _25[0], 'optionalAccess', _26 => _26.nodeType]) === Node.TEXT_NODE) {
1417
+ const hydratedText = hydratedNodes[0];
1418
+ if (hydratedText.data !== textValue) {
1419
+ hydratedText.data = textValue;
1420
+ }
1421
+ currentText = hydratedText;
1422
+ currentNodes = [hydratedText];
1423
+ initialHydrating = false;
1424
+ return;
1425
+ }
1426
+ }
1427
+ const textNode = _nullishCoalesce(currentText, () => ( (_nullishCoalesce(node.ownerDocument, () => ( document))).createTextNode(textValue)));
1428
+ if (textNode.data !== textValue) {
1429
+ textNode.data = textValue;
1430
+ }
1431
+ if (currentNodes.length === 1 && currentNodes[0] === textNode) {
1432
+ currentText = textNode;
1433
+ return;
1434
+ }
1435
+ if (currentRoot) {
1436
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, currentRoot);
1437
+ currentRoot = null;
1438
+ }
1439
+ if (currentNodes.length > 0) {
1440
+ removeNodes(currentNodes);
1441
+ currentNodes = [];
1442
+ }
1443
+ node.replaceChildren(textNode);
1444
+ currentText = textNode;
1445
+ currentNodes = [textNode];
1446
+ initialHydrating = false;
1447
+ };
1448
+ const dispose = _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => {
1449
+ const value = getValue();
1450
+ const isPrimitive = value == null || value === false || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
1451
+ if (isPrimitive) {
1452
+ const textValue = value == null || value === false ? "" : String(value);
1453
+ const shouldInsert = value != null && value !== false;
1454
+ setTextNode(textValue, shouldInsert);
1455
+ return;
1456
+ }
1457
+ clearCurrentNodes();
1458
+ const root = _chunkNBDEMBBXcjs.createRootContext.call(void 0, hostRoot);
1459
+ const prev = _chunkNBDEMBBXcjs.pushRoot.call(void 0, root);
1460
+ let nodes;
1461
+ let currentHydratedNodes;
1462
+ let handledError = false;
1463
+ try {
1464
+ const ownerDocument = _nullishCoalesce(_nullishCoalesce(node.ownerDocument, () => ( _optionalChain([hostRoot, 'optionalAccess', _27 => _27.ownerDocument]))), () => ( document));
1465
+ const createValue = () => {
1466
+ if (value instanceof Node) {
1467
+ return value;
1468
+ }
1469
+ if (Array.isArray(value)) {
1470
+ if (value.every((v) => v instanceof Node)) {
1471
+ return value;
1472
+ }
1473
+ if (createFn) {
1474
+ const mapped = [];
1475
+ for (const item of value) {
1476
+ mapped.push(...toNodeArray(createFn(item), ownerDocument));
1477
+ }
1478
+ return mapped;
1479
+ }
1480
+ return ownerDocument.createTextNode(String(value));
1481
+ }
1482
+ return createFn ? createFn(value) : ownerDocument.createTextNode(String(value));
1483
+ };
1484
+ const newNode = initialHydrating && isHydratingActive() ? withHydration(node, () => createValue()) : createValue();
1485
+ nodes = toNodeArray(newNode, ownerDocument);
1486
+ if (root.suspended) {
1487
+ handledError = true;
1488
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
1489
+ return;
1490
+ }
1491
+ if (initialHydrating) {
1492
+ const hydratedNodes = collectCurrentChildren();
1493
+ const reuseHydratedNodes = hydratedNodes.length === nodes.length && nodes.every((candidate, index) => candidate === hydratedNodes[index]);
1494
+ if (reuseHydratedNodes) {
1495
+ currentHydratedNodes = hydratedNodes;
1496
+ } else {
1497
+ node.replaceChildren(...nodes);
1498
+ }
1499
+ } else {
1500
+ node.replaceChildren(...nodes);
1501
+ }
1502
+ } catch (err) {
1503
+ if (_chunkNBDEMBBXcjs.handleSuspend.call(void 0, err, root)) {
1504
+ handledError = true;
1505
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
1506
+ return;
1507
+ }
1508
+ if (_chunkNBDEMBBXcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
1509
+ handledError = true;
1510
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
1511
+ return;
1512
+ }
1513
+ throw err;
1514
+ } finally {
1515
+ _chunkNBDEMBBXcjs.popRoot.call(void 0, prev);
1516
+ if (!handledError) {
1517
+ _chunkNBDEMBBXcjs.flushOnMount.call(void 0, root);
1518
+ }
1519
+ }
1520
+ currentRoot = root;
1521
+ currentNodes = _nullishCoalesce(currentHydratedNodes, () => ( nodes));
1522
+ initialHydrating = false;
1523
+ });
1524
+ return () => {
1525
+ dispose();
1526
+ clearCurrentNodes();
1527
+ };
1528
+ }
1529
+ function updateChildrenBinding(node, value, createElementFn) {
1530
+ const host = node;
1531
+ const createFn = _nullishCoalesce(createElementFn, () => ( registeredCreateElement));
1532
+ const owner = _chunkNBDEMBBXcjs.getCurrentRoot.call(void 0, );
1533
+ let state = host[CHILDREN_BINDING_CACHE];
1534
+ if (state && state.owner !== owner) {
1535
+ _optionalChain([state, 'access', _28 => _28.cleanup, 'optionalCall', _29 => _29()]);
1536
+ state.cleanup = void 0;
1537
+ delete host[CHILDREN_BINDING_CACHE];
1538
+ state = void 0;
1539
+ }
1540
+ if (!state) {
1541
+ const valueSignal = _chunkNBDEMBBXcjs.signal.call(void 0, value);
1542
+ const cleanup = bindAssignedChildren(
1543
+ node,
1544
+ () => resolveAssignedChildrenValue(valueSignal()),
1545
+ createFn
1546
+ );
1547
+ const nextState = {
1548
+ cleanup,
1549
+ owner,
1550
+ value: valueSignal
1551
+ };
1552
+ state = nextState;
1553
+ host[CHILDREN_BINDING_CACHE] = nextState;
1554
+ _chunkNBDEMBBXcjs.registerRootCleanup.call(void 0, () => {
1555
+ _optionalChain([state, 'optionalAccess', _30 => _30.cleanup, 'optionalCall', _31 => _31()]);
1556
+ if (state) {
1557
+ state.cleanup = void 0;
1558
+ }
1559
+ if (host[CHILDREN_BINDING_CACHE] === state) {
1560
+ delete host[CHILDREN_BINDING_CACHE];
1561
+ }
1562
+ });
1563
+ return;
1564
+ }
1565
+ state.value(value);
1566
+ }
1567
+ function updateAssignedRefBinding(node, value) {
1568
+ const host = node;
1569
+ const owner = _chunkNBDEMBBXcjs.getCurrentRoot.call(void 0, );
1570
+ let state = host[REF_ASSIGN_CACHE];
1571
+ if (state && state.owner !== owner) {
1572
+ _optionalChain([state, 'access', _32 => _32.cleanup, 'optionalCall', _33 => _33()]);
1573
+ state.cleanup = void 0;
1574
+ delete host[REF_ASSIGN_CACHE];
1575
+ state = void 0;
1576
+ }
1577
+ if (!state && value == null) {
1578
+ return;
1579
+ }
1580
+ if (!state) {
1581
+ state = createAssignedRefState(node, owner, value);
1582
+ host[REF_ASSIGN_CACHE] = state;
1583
+ }
1584
+ _optionalChain([state, 'access', _34 => _34.value, 'optionalCall', _35 => _35(value)]);
1585
+ if (value == null) {
1586
+ if (!state.registeredCleanup) {
1587
+ _optionalChain([state, 'access', _36 => _36.cleanup, 'optionalCall', _37 => _37()]);
1588
+ state.cleanup = void 0;
1589
+ delete host[REF_ASSIGN_CACHE];
1590
+ }
1591
+ return;
1592
+ }
1593
+ if (!state.registeredCleanup && _chunkNBDEMBBXcjs.getCurrentRoot.call(void 0, )) {
1594
+ state.registeredCleanup = true;
1595
+ _chunkNBDEMBBXcjs.registerRootCleanup.call(void 0, () => {
1596
+ _optionalChain([state, 'access', _38 => _38.cleanup, 'optionalCall', _39 => _39()]);
1597
+ state.cleanup = void 0;
1598
+ state.value = void 0;
1599
+ if (host[REF_ASSIGN_CACHE] === state) {
1600
+ delete host[REF_ASSIGN_CACHE];
1601
+ }
1602
+ });
1603
+ }
1294
1604
  }
1295
1605
  function spread(node, props = {}, isSVG = false, skipChildren = false, exclude = []) {
1296
1606
  const prevProps = {};
@@ -1300,44 +1610,40 @@ function spread(node, props = {}, isSVG = false, skipChildren = false, exclude =
1300
1610
  if (!next || typeof next !== "object") return {};
1301
1611
  return next;
1302
1612
  };
1303
- if (!skipChildren) {
1304
- _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => {
1305
- const nextProps = resolveProps();
1306
- if ("children" in nextProps) {
1307
- prevProps.children = nextProps.children;
1308
- }
1309
- });
1310
- }
1311
- _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => {
1312
- const nextProps = resolveProps();
1313
- if (typeof nextProps.ref === "function") {
1314
- ;
1315
- nextProps.ref(node);
1316
- }
1317
- });
1318
- _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => {
1319
- assign(node, resolveProps(), isSVG, true, prevProps, true, excludedProps);
1613
+ bindRef(
1614
+ node,
1615
+ _nullishCoalesce((typeof props === "function" ? () => resolveProps().ref : resolveProps().ref), () => ( null))
1616
+ );
1617
+ _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => {
1618
+ assign(node, resolveProps(), isSVG, skipChildren, prevProps, true, excludedProps);
1320
1619
  });
1321
1620
  return prevProps;
1322
1621
  }
1323
1622
  function assign(node, props, isSVG = false, skipChildren = false, prevProps = {}, skipRef = false, excludedProps) {
1324
1623
  props = props || {};
1325
1624
  for (const prop2 in prevProps) {
1326
- if (_optionalChain([excludedProps, 'optionalAccess', _18 => _18.has, 'call', _19 => _19(prop2)])) continue;
1625
+ if (_optionalChain([excludedProps, 'optionalAccess', _40 => _40.has, 'call', _41 => _41(prop2)])) continue;
1327
1626
  if (!(prop2 in props)) {
1328
- if (prop2 === "children") continue;
1627
+ if (prop2 === "children") {
1628
+ if (!skipChildren) {
1629
+ updateChildrenBinding(node, void 0);
1630
+ prevProps.children = void 0;
1631
+ }
1632
+ continue;
1633
+ }
1329
1634
  prevProps[prop2] = assignProp(node, prop2, null, prevProps[prop2], isSVG, skipRef, props);
1330
1635
  }
1331
1636
  }
1332
1637
  for (const prop2 in props) {
1333
- if (_optionalChain([excludedProps, 'optionalAccess', _20 => _20.has, 'call', _21 => _21(prop2)])) continue;
1638
+ if (_optionalChain([excludedProps, 'optionalAccess', _42 => _42.has, 'call', _43 => _43(prop2)])) continue;
1639
+ const value = props[prop2];
1334
1640
  if (prop2 === "children") {
1335
1641
  if (!skipChildren) {
1642
+ updateChildrenBinding(node, value);
1336
1643
  prevProps.children = props.children;
1337
1644
  }
1338
1645
  continue;
1339
1646
  }
1340
- const value = props[prop2];
1341
1647
  prevProps[prop2] = assignProp(node, prop2, value, prevProps[prop2], isSVG, skipRef, props);
1342
1648
  }
1343
1649
  }
@@ -1351,9 +1657,8 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
1351
1657
  }
1352
1658
  if (value === prev) return prev;
1353
1659
  if (prop2 === "ref") {
1354
- if (!skipRef && typeof value === "function") {
1355
- ;
1356
- value(node);
1660
+ if (!skipRef) {
1661
+ updateAssignedRefBinding(node, value);
1357
1662
  }
1358
1663
  return value;
1359
1664
  }
@@ -1363,34 +1668,41 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
1363
1668
  node.setAttribute(prop2, value);
1364
1669
  return value;
1365
1670
  }
1366
- if (prev && typeof prev !== "string") node.removeEventListener(eventName, prev);
1367
- if (value) node.addEventListener(eventName, value);
1671
+ if (prev && typeof prev !== "string") removeStoredEventListener(node, eventName);
1672
+ addEventListener(
1673
+ node,
1674
+ eventName,
1675
+ value,
1676
+ false
1677
+ );
1368
1678
  return value;
1369
1679
  }
1370
1680
  if (prop2.slice(0, 10) === "oncapture:") {
1371
1681
  const eventName = prop2.slice(10);
1372
- if (prev) node.removeEventListener(eventName, prev, true);
1373
- if (value) node.addEventListener(eventName, value, true);
1682
+ if (prev) removeStoredEventListener(node, eventName, true);
1683
+ addEventListener(
1684
+ node,
1685
+ eventName,
1686
+ value,
1687
+ false,
1688
+ true
1689
+ );
1374
1690
  return value;
1375
1691
  }
1376
1692
  if (prop2.slice(0, 2) === "on") {
1377
1693
  const eventName = prop2.slice(2).toLowerCase();
1378
- const shouldDelegate = _chunkWJMZ7X46cjs.DelegatedEvents.has(eventName);
1694
+ const shouldDelegate = _chunkNBDEMBBXcjs.DelegatedEvents.has(eventName);
1379
1695
  if (!shouldDelegate && prev) {
1380
- if (Array.isArray(prev)) {
1381
- removeStoredTupleEventListener(node, eventName);
1382
- } else {
1383
- node.removeEventListener(eventName, prev);
1384
- }
1696
+ removeStoredEventListener(node, eventName);
1385
1697
  }
1386
1698
  if (shouldDelegate || value) {
1387
1699
  addEventListener(
1388
1700
  node,
1389
1701
  eventName,
1390
1702
  value,
1391
- shouldDelegate
1703
+ shouldDelegate,
1704
+ false
1392
1705
  );
1393
- if (shouldDelegate) delegateEvents([eventName]);
1394
1706
  }
1395
1707
  return value;
1396
1708
  }
@@ -1416,9 +1728,9 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
1416
1728
  }
1417
1729
  const isCE = node.nodeName.includes("-") || "is" in props;
1418
1730
  if (!isSVG) {
1419
- const propAlias = isDev ? _chunkWJMZ7X46cjs.getPropAlias.call(void 0, prop2, node.tagName) : void 0;
1420
- const isProperty = isDev ? _chunkWJMZ7X46cjs.Properties.has(prop2) : prop2 in node;
1421
- const isChildProp = isDev ? _chunkWJMZ7X46cjs.ChildProperties.has(prop2) : prop2 === "innerHTML" || prop2 === "textContent" || prop2 === "innerText" || prop2 === "children";
1731
+ const propAlias = isDev ? _chunkNBDEMBBXcjs.getPropAlias.call(void 0, prop2, node.tagName) : void 0;
1732
+ const isProperty = isDev ? _chunkNBDEMBBXcjs.Properties.has(prop2) : prop2 in node;
1733
+ const isChildProp = isDev ? _chunkNBDEMBBXcjs.ChildProperties.has(prop2) : prop2 === "innerHTML" || prop2 === "textContent" || prop2 === "innerText" || prop2 === "children";
1422
1734
  if (propAlias || isProperty || isChildProp || isCE) {
1423
1735
  const propName = propAlias || prop2;
1424
1736
  if (isCE && !isProperty && !isChildProp && !propAlias) {
@@ -1433,7 +1745,7 @@ function assignProp(node, prop2, value, prev, isSVG, skipRef, props) {
1433
1745
  }
1434
1746
  if (isSVG && prop2.indexOf(":") > -1) {
1435
1747
  const [prefix, name] = prop2.split(":");
1436
- const ns = _chunkWJMZ7X46cjs.SVGNamespace[prefix];
1748
+ const ns = _chunkNBDEMBBXcjs.SVGNamespace[prefix];
1437
1749
  if (ns) {
1438
1750
  if (value == null) node.removeAttributeNS(ns, name);
1439
1751
  else node.setAttributeNS(ns, name, String(value));
@@ -1449,10 +1761,10 @@ function toPropertyName(name) {
1449
1761
  return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());
1450
1762
  }
1451
1763
  function createConditional(condition, renderTrue, createElementFn, renderFalse, startOverride, endOverride, options) {
1452
- const trackBranchReads = _optionalChain([options, 'optionalAccess', _22 => _22.trackBranchReads]) === true;
1453
- const hostRoot = _chunkWJMZ7X46cjs.getCurrentRoot.call(void 0, );
1764
+ const trackBranchReads = _optionalChain([options, 'optionalAccess', _44 => _44.trackBranchReads]) === true;
1765
+ const hostRoot = _chunkNBDEMBBXcjs.getCurrentRoot.call(void 0, );
1454
1766
  const useProvided = !!(startOverride && endOverride);
1455
- const markerOwnerDocument = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([startOverride, 'optionalAccess', _23 => _23.ownerDocument]), () => ( _optionalChain([endOverride, 'optionalAccess', _24 => _24.ownerDocument]))), () => ( _optionalChain([hostRoot, 'optionalAccess', _25 => _25.ownerDocument]))), () => ( document));
1767
+ const markerOwnerDocument = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([startOverride, 'optionalAccess', _45 => _45.ownerDocument]), () => ( _optionalChain([endOverride, 'optionalAccess', _46 => _46.ownerDocument]))), () => ( _optionalChain([hostRoot, 'optionalAccess', _47 => _47.ownerDocument]))), () => ( document));
1456
1768
  const startMarker = useProvided ? startOverride : markerOwnerDocument.createComment("fict:cond:start");
1457
1769
  const endMarker = useProvided ? endOverride : markerOwnerDocument.createComment("fict:cond:end");
1458
1770
  const fragment = useProvided ? startMarker : markerOwnerDocument.createDocumentFragment();
@@ -1464,7 +1776,7 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1464
1776
  let currentRoot = null;
1465
1777
  let lastCondition = void 0;
1466
1778
  let pendingRender = false;
1467
- let initialHydrating = _chunkWJMZ7X46cjs.__fictIsHydrating.call(void 0, );
1779
+ let initialHydrating = _chunkNBDEMBBXcjs.__fictIsHydrating.call(void 0, );
1468
1780
  const collectBetween = () => {
1469
1781
  const nodes = [];
1470
1782
  let cursor = startMarker.nextSibling;
@@ -1474,7 +1786,7 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1474
1786
  }
1475
1787
  return nodes;
1476
1788
  };
1477
- const conditionMemo = _chunkWJMZ7X46cjs.computed.call(void 0, condition);
1789
+ const conditionMemo = _chunkNBDEMBBXcjs.computed.call(void 0, condition);
1478
1790
  const runConditional = () => {
1479
1791
  const cond = conditionMemo();
1480
1792
  const parent = startMarker.parentNode;
@@ -1491,8 +1803,8 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1491
1803
  currentNodes = collectBetween();
1492
1804
  return;
1493
1805
  }
1494
- const root2 = _chunkWJMZ7X46cjs.createRootContext.call(void 0, hostRoot);
1495
- const prev2 = _chunkWJMZ7X46cjs.pushRoot.call(void 0, root2);
1806
+ const root2 = _chunkNBDEMBBXcjs.createRootContext.call(void 0, hostRoot);
1807
+ const prev2 = _chunkNBDEMBBXcjs.pushRoot.call(void 0, root2);
1496
1808
  let handledError2 = false;
1497
1809
  try {
1498
1810
  withHydrationRange(
@@ -1500,7 +1812,7 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1500
1812
  endMarker,
1501
1813
  _nullishCoalesce(parent.ownerDocument, () => ( markerOwnerDocument)),
1502
1814
  () => {
1503
- const output = trackBranchReads ? render3() : _chunkWJMZ7X46cjs.untrack.call(void 0, render3);
1815
+ const output = trackBranchReads ? render3() : _chunkNBDEMBBXcjs.untrack.call(void 0, render3);
1504
1816
  if (output == null || output === false) {
1505
1817
  return;
1506
1818
  }
@@ -1509,21 +1821,21 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1509
1821
  );
1510
1822
  currentNodes = collectBetween();
1511
1823
  } catch (err) {
1512
- if (_chunkWJMZ7X46cjs.handleSuspend.call(void 0, err, root2)) {
1824
+ if (_chunkNBDEMBBXcjs.handleSuspend.call(void 0, err, root2)) {
1513
1825
  handledError2 = true;
1514
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root2);
1826
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root2);
1515
1827
  return;
1516
1828
  }
1517
- if (_chunkWJMZ7X46cjs.handleError.call(void 0, err, { source: "renderChild" }, root2)) {
1829
+ if (_chunkNBDEMBBXcjs.handleError.call(void 0, err, { source: "renderChild" }, root2)) {
1518
1830
  handledError2 = true;
1519
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root2);
1831
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root2);
1520
1832
  return;
1521
1833
  }
1522
1834
  throw err;
1523
1835
  } finally {
1524
- _chunkWJMZ7X46cjs.popRoot.call(void 0, prev2);
1836
+ _chunkNBDEMBBXcjs.popRoot.call(void 0, prev2);
1525
1837
  if (!handledError2) {
1526
- _chunkWJMZ7X46cjs.flushOnMount.call(void 0, root2);
1838
+ _chunkNBDEMBBXcjs.flushOnMount.call(void 0, root2);
1527
1839
  currentRoot = root2;
1528
1840
  } else {
1529
1841
  currentRoot = null;
@@ -1544,8 +1856,8 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1544
1856
  return;
1545
1857
  }
1546
1858
  let patched = false;
1547
- const scratchRoot = _chunkWJMZ7X46cjs.createRootContext.call(void 0, hostRoot);
1548
- const prevScratch = _chunkWJMZ7X46cjs.pushRoot.call(void 0, scratchRoot);
1859
+ const scratchRoot = _chunkNBDEMBBXcjs.createRootContext.call(void 0, hostRoot);
1860
+ const prevScratch = _chunkNBDEMBBXcjs.pushRoot.call(void 0, scratchRoot);
1549
1861
  let handledPatchError = false;
1550
1862
  let scratchOutput;
1551
1863
  try {
@@ -1559,36 +1871,36 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1559
1871
  patched = _patchFragmentChildren(currentNodes, output);
1560
1872
  }
1561
1873
  if (!patched && _isFragmentVNode(output)) {
1562
- patched = _patchFragmentChildren(currentNodes, _optionalChain([output, 'access', _26 => _26.props, 'optionalAccess', _27 => _27.children]));
1874
+ patched = _patchFragmentChildren(currentNodes, _optionalChain([output, 'access', _48 => _48.props, 'optionalAccess', _49 => _49.children]));
1563
1875
  }
1564
1876
  }
1565
1877
  } catch (err) {
1566
- if (_chunkWJMZ7X46cjs.handleSuspend.call(void 0, err, scratchRoot)) {
1878
+ if (_chunkNBDEMBBXcjs.handleSuspend.call(void 0, err, scratchRoot)) {
1567
1879
  handledPatchError = true;
1568
- } else if (_chunkWJMZ7X46cjs.handleError.call(void 0, err, { source: "renderChild" }, scratchRoot)) {
1880
+ } else if (_chunkNBDEMBBXcjs.handleError.call(void 0, err, { source: "renderChild" }, scratchRoot)) {
1569
1881
  handledPatchError = true;
1570
1882
  } else {
1571
1883
  throw err;
1572
1884
  }
1573
1885
  } finally {
1574
- _chunkWJMZ7X46cjs.popRoot.call(void 0, prevScratch);
1886
+ _chunkNBDEMBBXcjs.popRoot.call(void 0, prevScratch);
1575
1887
  }
1576
1888
  if (handledPatchError) {
1577
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, scratchRoot);
1889
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, scratchRoot);
1578
1890
  return;
1579
1891
  }
1580
1892
  if (patched) {
1581
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, scratchRoot);
1893
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, scratchRoot);
1582
1894
  return;
1583
1895
  }
1584
1896
  lastCondition = cond;
1585
1897
  if (currentRoot) {
1586
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, currentRoot);
1898
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, currentRoot);
1587
1899
  currentRoot = null;
1588
1900
  }
1589
1901
  removeNodes(currentNodes);
1590
1902
  currentNodes = [];
1591
- const prev2 = _chunkWJMZ7X46cjs.pushRoot.call(void 0, scratchRoot);
1903
+ const prev2 = _chunkNBDEMBBXcjs.pushRoot.call(void 0, scratchRoot);
1592
1904
  let handledError2 = false;
1593
1905
  try {
1594
1906
  if (scratchOutput == null || scratchOutput === false) {
@@ -1599,21 +1911,21 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1599
1911
  insertNodesBefore(parent, nodes, endMarker);
1600
1912
  currentNodes = nodes;
1601
1913
  } catch (err) {
1602
- if (_chunkWJMZ7X46cjs.handleSuspend.call(void 0, err, scratchRoot)) {
1914
+ if (_chunkNBDEMBBXcjs.handleSuspend.call(void 0, err, scratchRoot)) {
1603
1915
  handledError2 = true;
1604
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, scratchRoot);
1916
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, scratchRoot);
1605
1917
  return;
1606
1918
  }
1607
- if (_chunkWJMZ7X46cjs.handleError.call(void 0, err, { source: "renderChild" }, scratchRoot)) {
1919
+ if (_chunkNBDEMBBXcjs.handleError.call(void 0, err, { source: "renderChild" }, scratchRoot)) {
1608
1920
  handledError2 = true;
1609
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, scratchRoot);
1921
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, scratchRoot);
1610
1922
  return;
1611
1923
  }
1612
1924
  throw err;
1613
1925
  } finally {
1614
- _chunkWJMZ7X46cjs.popRoot.call(void 0, prev2);
1926
+ _chunkNBDEMBBXcjs.popRoot.call(void 0, prev2);
1615
1927
  if (!handledError2) {
1616
- _chunkWJMZ7X46cjs.flushOnMount.call(void 0, scratchRoot);
1928
+ _chunkNBDEMBBXcjs.flushOnMount.call(void 0, scratchRoot);
1617
1929
  currentRoot = scratchRoot;
1618
1930
  } else {
1619
1931
  currentRoot = null;
@@ -1623,7 +1935,7 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1623
1935
  }
1624
1936
  lastCondition = cond;
1625
1937
  if (currentRoot) {
1626
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, currentRoot);
1938
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, currentRoot);
1627
1939
  currentRoot = null;
1628
1940
  }
1629
1941
  removeNodes(currentNodes);
@@ -1632,11 +1944,11 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1632
1944
  if (!render2) {
1633
1945
  return;
1634
1946
  }
1635
- const root = _chunkWJMZ7X46cjs.createRootContext.call(void 0, hostRoot);
1636
- const prev = _chunkWJMZ7X46cjs.pushRoot.call(void 0, root);
1947
+ const root = _chunkNBDEMBBXcjs.createRootContext.call(void 0, hostRoot);
1948
+ const prev = _chunkNBDEMBBXcjs.pushRoot.call(void 0, root);
1637
1949
  let handledError = false;
1638
1950
  try {
1639
- const output = trackBranchReads ? render2() : _chunkWJMZ7X46cjs.untrack.call(void 0, render2);
1951
+ const output = trackBranchReads ? render2() : _chunkNBDEMBBXcjs.untrack.call(void 0, render2);
1640
1952
  if (output == null || output === false) {
1641
1953
  return;
1642
1954
  }
@@ -1645,28 +1957,28 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1645
1957
  insertNodesBefore(parent, nodes, endMarker);
1646
1958
  currentNodes = nodes;
1647
1959
  } catch (err) {
1648
- if (_chunkWJMZ7X46cjs.handleSuspend.call(void 0, err, root)) {
1960
+ if (_chunkNBDEMBBXcjs.handleSuspend.call(void 0, err, root)) {
1649
1961
  handledError = true;
1650
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
1962
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
1651
1963
  return;
1652
1964
  }
1653
- if (_chunkWJMZ7X46cjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
1965
+ if (_chunkNBDEMBBXcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
1654
1966
  handledError = true;
1655
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
1967
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
1656
1968
  return;
1657
1969
  }
1658
1970
  throw err;
1659
1971
  } finally {
1660
- _chunkWJMZ7X46cjs.popRoot.call(void 0, prev);
1972
+ _chunkNBDEMBBXcjs.popRoot.call(void 0, prev);
1661
1973
  if (!handledError) {
1662
- _chunkWJMZ7X46cjs.flushOnMount.call(void 0, root);
1974
+ _chunkNBDEMBBXcjs.flushOnMount.call(void 0, root);
1663
1975
  currentRoot = root;
1664
1976
  } else {
1665
1977
  currentRoot = null;
1666
1978
  }
1667
1979
  }
1668
1980
  };
1669
- const dispose = _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, runConditional);
1981
+ const dispose = _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, runConditional);
1670
1982
  return {
1671
1983
  marker: fragment,
1672
1984
  flush: () => {
@@ -1677,40 +1989,40 @@ function createConditional(condition, renderTrue, createElementFn, renderFalse,
1677
1989
  dispose: () => {
1678
1990
  dispose();
1679
1991
  if (currentRoot) {
1680
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, currentRoot);
1992
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, currentRoot);
1681
1993
  }
1682
1994
  removeNodes(currentNodes);
1683
1995
  currentNodes = [];
1684
- _optionalChain([startMarker, 'access', _28 => _28.parentNode, 'optionalAccess', _29 => _29.removeChild, 'call', _30 => _30(startMarker)]);
1685
- _optionalChain([endMarker, 'access', _31 => _31.parentNode, 'optionalAccess', _32 => _32.removeChild, 'call', _33 => _33(endMarker)]);
1996
+ _optionalChain([startMarker, 'access', _50 => _50.parentNode, 'optionalAccess', _51 => _51.removeChild, 'call', _52 => _52(startMarker)]);
1997
+ _optionalChain([endMarker, 'access', _53 => _53.parentNode, 'optionalAccess', _54 => _54.removeChild, 'call', _55 => _55(endMarker)]);
1686
1998
  }
1687
1999
  };
1688
2000
  }
1689
2001
  function createShow(el, condition, displayValue) {
1690
2002
  const originalDisplay = _nullishCoalesce(displayValue, () => ( el.style.display));
1691
- _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => {
2003
+ _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => {
1692
2004
  el.style.display = condition() ? originalDisplay : "none";
1693
2005
  });
1694
2006
  }
1695
2007
  function createPortal(container, render2, createElementFn) {
1696
- const parentRoot = _chunkWJMZ7X46cjs.getCurrentRoot.call(void 0, );
2008
+ const parentRoot = _chunkNBDEMBBXcjs.getCurrentRoot.call(void 0, );
1697
2009
  const markerOwnerDocument = _nullishCoalesce(container.ownerDocument, () => ( document));
1698
2010
  const marker = markerOwnerDocument.createComment("fict:portal");
1699
2011
  container.appendChild(marker);
1700
2012
  let currentNodes = [];
1701
2013
  let currentRoot = null;
1702
- const dispose = _chunkWJMZ7X46cjs.createRenderEffect.call(void 0, () => {
2014
+ const dispose = _chunkNBDEMBBXcjs.createRenderEffect.call(void 0, () => {
1703
2015
  if (currentRoot) {
1704
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, currentRoot);
2016
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, currentRoot);
1705
2017
  currentRoot = null;
1706
2018
  }
1707
2019
  if (currentNodes.length > 0) {
1708
2020
  removeNodes(currentNodes);
1709
2021
  currentNodes = [];
1710
2022
  }
1711
- const root = _chunkWJMZ7X46cjs.createRootContext.call(void 0, parentRoot);
1712
- root.ownerDocument = _nullishCoalesce(_nullishCoalesce(container.ownerDocument, () => ( _optionalChain([parentRoot, 'optionalAccess', _34 => _34.ownerDocument]))), () => ( document));
1713
- const prev = _chunkWJMZ7X46cjs.pushRoot.call(void 0, root);
2023
+ const root = _chunkNBDEMBBXcjs.createRootContext.call(void 0, parentRoot);
2024
+ root.ownerDocument = _nullishCoalesce(_nullishCoalesce(container.ownerDocument, () => ( _optionalChain([parentRoot, 'optionalAccess', _56 => _56.ownerDocument]))), () => ( document));
2025
+ const prev = _chunkNBDEMBBXcjs.pushRoot.call(void 0, root);
1714
2026
  let handledError = false;
1715
2027
  try {
1716
2028
  const output = render2();
@@ -1723,23 +2035,23 @@ function createPortal(container, render2, createElementFn) {
1723
2035
  currentNodes = nodes;
1724
2036
  }
1725
2037
  } catch (err) {
1726
- if (_chunkWJMZ7X46cjs.handleSuspend.call(void 0, err, root)) {
2038
+ if (_chunkNBDEMBBXcjs.handleSuspend.call(void 0, err, root)) {
1727
2039
  handledError = true;
1728
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
2040
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
1729
2041
  currentNodes = [];
1730
2042
  return;
1731
2043
  }
1732
- if (_chunkWJMZ7X46cjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
2044
+ if (_chunkNBDEMBBXcjs.handleError.call(void 0, err, { source: "renderChild" }, root)) {
1733
2045
  handledError = true;
1734
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
2046
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
1735
2047
  currentNodes = [];
1736
2048
  return;
1737
2049
  }
1738
2050
  throw err;
1739
2051
  } finally {
1740
- _chunkWJMZ7X46cjs.popRoot.call(void 0, prev);
2052
+ _chunkNBDEMBBXcjs.popRoot.call(void 0, prev);
1741
2053
  if (!handledError) {
1742
- _chunkWJMZ7X46cjs.flushOnMount.call(void 0, root);
2054
+ _chunkNBDEMBBXcjs.flushOnMount.call(void 0, root);
1743
2055
  currentRoot = root;
1744
2056
  } else {
1745
2057
  currentRoot = null;
@@ -1749,12 +2061,12 @@ function createPortal(container, render2, createElementFn) {
1749
2061
  const portalDispose = () => {
1750
2062
  dispose();
1751
2063
  if (currentRoot) {
1752
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, currentRoot);
2064
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, currentRoot);
1753
2065
  }
1754
2066
  if (currentNodes.length > 0) {
1755
2067
  removeNodes(currentNodes);
1756
2068
  }
1757
- _optionalChain([marker, 'access', _35 => _35.parentNode, 'optionalAccess', _36 => _36.removeChild, 'call', _37 => _37(marker)]);
2069
+ _optionalChain([marker, 'access', _57 => _57.parentNode, 'optionalAccess', _58 => _58.removeChild, 'call', _59 => _59(marker)]);
1758
2070
  };
1759
2071
  if (parentRoot) {
1760
2072
  parentRoot.destroyCallbacks.push(portalDispose);
@@ -1768,7 +2080,7 @@ function patchElement(el, output) {
1768
2080
  if (output && typeof output === "object" && !(output instanceof Node)) {
1769
2081
  const vnode = output;
1770
2082
  if (typeof vnode.type === "string" && vnode.type.toLowerCase() === el.tagName.toLowerCase()) {
1771
- const children = _optionalChain([vnode, 'access', _38 => _38.props, 'optionalAccess', _39 => _39.children]);
2083
+ const children = _optionalChain([vnode, 'access', _60 => _60.props, 'optionalAccess', _61 => _61.children]);
1772
2084
  const props = _nullishCoalesce(vnode.props, () => ( {}));
1773
2085
  for (const [key, value] of Object.entries(props)) {
1774
2086
  if (key === "children" || key === "key") continue;
@@ -1837,7 +2149,7 @@ function normalizeChildren(children, result = []) {
1837
2149
  return result;
1838
2150
  }
1839
2151
  if (_isFragmentVNode(children)) {
1840
- return normalizeChildren(_optionalChain([children, 'access', _40 => _40.props, 'optionalAccess', _41 => _41.children]), result);
2152
+ return normalizeChildren(_optionalChain([children, 'access', _62 => _62.props, 'optionalAccess', _63 => _63.children]), result);
1841
2153
  }
1842
2154
  result.push(children);
1843
2155
  return result;
@@ -1913,10 +2225,10 @@ function isExplicitReactiveFn2(value) {
1913
2225
  function normalizePropsFunction(value) {
1914
2226
  if (typeof value !== "function") return value;
1915
2227
  if (value.length !== 0) return value;
1916
- if (isPropGetter(value) || _chunkWJMZ7X46cjs.isSignal.call(void 0, value) || _chunkWJMZ7X46cjs.isComputed.call(void 0, value) || isExplicitReactiveFn2(value)) {
2228
+ if (isPropGetter(value) || _chunkNBDEMBBXcjs.isSignal.call(void 0, value) || _chunkNBDEMBBXcjs.isComputed.call(void 0, value) || isExplicitReactiveFn2(value)) {
1917
2229
  return value;
1918
2230
  }
1919
- if (_chunkWJMZ7X46cjs.isEffect.call(void 0, value) || _chunkWJMZ7X46cjs.isEffectScope.call(void 0, value) || isNonReactiveFn2(value)) return value;
2231
+ if (_chunkNBDEMBBXcjs.isEffect.call(void 0, value) || _chunkNBDEMBBXcjs.isEffectScope.call(void 0, value) || isNonReactiveFn2(value)) return value;
1920
2232
  return markNonReactiveFn(value);
1921
2233
  }
1922
2234
  function createPropsProxy(props) {
@@ -2053,9 +2365,9 @@ function prop(getter, options) {
2053
2365
  return getter;
2054
2366
  }
2055
2367
  const fn = getter;
2056
- const unwrap2 = _optionalChain([options, 'optionalAccess', _42 => _42.unwrap]) !== false;
2368
+ const unwrap2 = _optionalChain([options, 'optionalAccess', _64 => _64.unwrap]) !== false;
2057
2369
  return __fictProp(
2058
- _chunkWJMZ7X46cjs.createMemo.call(void 0, () => {
2370
+ _chunkNBDEMBBXcjs.createMemo.call(void 0, () => {
2059
2371
  const value = fn();
2060
2372
  if (unwrap2 && isPropGetter(value)) {
2061
2373
  return value();
@@ -2068,7 +2380,7 @@ function prop(getter, options) {
2068
2380
  // src/dom.ts
2069
2381
  var SVG_NS = "http://www.w3.org/2000/svg";
2070
2382
  var MATHML_NS = "http://www.w3.org/1998/Math/MathML";
2071
- var isDev2 = typeof __DEV__ !== "undefined" ? __DEV__ : typeof process !== "undefined" && _optionalChain([process, 'access', _43 => _43.env, 'optionalAccess', _44 => _44.NODE_ENV]) !== "production";
2383
+ var isDev2 = typeof __DEV__ !== "undefined" ? __DEV__ : typeof process !== "undefined" && _optionalChain([process, 'access', _65 => _65.env, 'optionalAccess', _66 => _66.NODE_ENV]) !== "production";
2072
2384
  var nextComponentId = 1;
2073
2385
  function collectComponentMountElements(node) {
2074
2386
  if (node instanceof DocumentFragment) {
@@ -2097,13 +2409,13 @@ function annotateComponentElements(elements, componentId, componentName) {
2097
2409
  }
2098
2410
  }
2099
2411
  function render(view, container) {
2100
- const root = _chunkWJMZ7X46cjs.createRootContext.call(void 0, );
2412
+ const root = _chunkNBDEMBBXcjs.createRootContext.call(void 0, );
2101
2413
  root.ownerDocument = _nullishCoalesce(container.ownerDocument, () => ( document));
2102
- const prev = _chunkWJMZ7X46cjs.pushRoot.call(void 0, root);
2414
+ const prev = _chunkNBDEMBBXcjs.pushRoot.call(void 0, root);
2103
2415
  let dom = void 0;
2104
2416
  try {
2105
2417
  const output = view();
2106
- if (_chunkWJMZ7X46cjs.__fictIsHydrating.call(void 0, )) {
2418
+ if (_chunkNBDEMBBXcjs.__fictIsHydrating.call(void 0, )) {
2107
2419
  withHydration(container, () => {
2108
2420
  dom = createElement(output);
2109
2421
  });
@@ -2111,75 +2423,82 @@ function render(view, container) {
2111
2423
  dom = createElement(output);
2112
2424
  }
2113
2425
  } finally {
2114
- _chunkWJMZ7X46cjs.popRoot.call(void 0, prev);
2426
+ _chunkNBDEMBBXcjs.popRoot.call(void 0, prev);
2115
2427
  }
2116
- if (!_chunkWJMZ7X46cjs.__fictIsHydrating.call(void 0, )) {
2428
+ if (!_chunkNBDEMBBXcjs.__fictIsHydrating.call(void 0, )) {
2117
2429
  container.replaceChildren(dom);
2118
2430
  }
2119
2431
  container.setAttribute("data-fict-fine-grained", "1");
2120
- _chunkWJMZ7X46cjs.flushOnMount.call(void 0, root);
2432
+ _chunkNBDEMBBXcjs.flushOnMount.call(void 0, root);
2121
2433
  const teardown = () => {
2122
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
2434
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
2123
2435
  container.innerHTML = "";
2124
2436
  };
2125
2437
  return teardown;
2126
2438
  }
2127
2439
  function hydrateComponent(view, container) {
2128
- const root = _chunkWJMZ7X46cjs.createRootContext.call(void 0, );
2440
+ const root = _chunkNBDEMBBXcjs.createRootContext.call(void 0, );
2129
2441
  root.ownerDocument = _nullishCoalesce(container.ownerDocument, () => ( document));
2130
- const prev = _chunkWJMZ7X46cjs.pushRoot.call(void 0, root);
2131
- _chunkWJMZ7X46cjs.__fictEnterHydration.call(void 0, );
2442
+ const prev = _chunkNBDEMBBXcjs.pushRoot.call(void 0, root);
2443
+ _chunkNBDEMBBXcjs.__fictEnterHydration.call(void 0, );
2132
2444
  try {
2133
2445
  withHydration(container, () => {
2134
2446
  view();
2135
2447
  });
2136
2448
  } finally {
2137
- _chunkWJMZ7X46cjs.__fictExitHydration.call(void 0, );
2138
- _chunkWJMZ7X46cjs.popRoot.call(void 0, prev);
2449
+ _chunkNBDEMBBXcjs.__fictExitHydration.call(void 0, );
2450
+ _chunkNBDEMBBXcjs.popRoot.call(void 0, prev);
2139
2451
  }
2140
2452
  container.setAttribute("data-fict-fine-grained", "1");
2141
- _chunkWJMZ7X46cjs.flushOnMount.call(void 0, root);
2453
+ _chunkNBDEMBBXcjs.flushOnMount.call(void 0, root);
2142
2454
  const teardown = () => {
2143
- _chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
2455
+ _chunkNBDEMBBXcjs.destroyRoot.call(void 0, root);
2144
2456
  };
2145
2457
  return teardown;
2146
2458
  }
2147
2459
  function createElement(node) {
2148
2460
  return createElementWithContext(node, null, resolveOwnerDocument());
2149
2461
  }
2462
+ registerCreateElement(createElement);
2150
2463
  function resolveNamespace(tagName, namespace) {
2151
2464
  if (tagName === "svg") return "svg";
2152
2465
  if (tagName === "math") return "mathml";
2153
2466
  if (namespace === "mathml") return "mathml";
2154
2467
  if (namespace === "svg") return "svg";
2155
- if (isDev2 && _chunkWJMZ7X46cjs.SVGElements.has(tagName)) return "svg";
2468
+ if (isDev2 && _chunkNBDEMBBXcjs.SVGElements.has(tagName)) return "svg";
2156
2469
  return null;
2157
2470
  }
2158
2471
  function resolveOwnerDocument(ownerDocument) {
2159
- return _nullishCoalesce(_nullishCoalesce(ownerDocument, () => ( _optionalChain([_chunkWJMZ7X46cjs.getCurrentRoot.call(void 0, ), 'optionalAccess', _45 => _45.ownerDocument]))), () => ( document));
2472
+ return _nullishCoalesce(_nullishCoalesce(ownerDocument, () => ( _optionalChain([_chunkNBDEMBBXcjs.getCurrentRoot.call(void 0, ), 'optionalAccess', _67 => _67.ownerDocument]))), () => ( document));
2473
+ }
2474
+ function createTextNodeWithHydration(value, ownerDocument) {
2475
+ if (!isHydratingActive()) {
2476
+ return ownerDocument.createTextNode(value);
2477
+ }
2478
+ return claimText(value, () => ownerDocument.createTextNode(value));
2160
2479
  }
2161
2480
  function createElementWithContext(node, namespace, ownerDocument) {
2162
2481
  if (node instanceof Node) {
2163
2482
  return node;
2164
2483
  }
2165
2484
  if (node === null || node === void 0 || node === false) {
2166
- return ownerDocument.createTextNode("");
2485
+ return createTextNodeWithHydration("", ownerDocument);
2167
2486
  }
2168
2487
  if (isReactive(node)) {
2169
2488
  const resolved = node();
2170
2489
  if (resolved === node) {
2171
- return ownerDocument.createTextNode("");
2490
+ return createTextNodeWithHydration("", ownerDocument);
2172
2491
  }
2173
2492
  return createElementWithContext(resolved, namespace, ownerDocument);
2174
2493
  }
2175
2494
  if (typeof node === "function") {
2176
- return ownerDocument.createTextNode("");
2495
+ return createTextNodeWithHydration("", ownerDocument);
2177
2496
  }
2178
2497
  if (typeof node === "object" && node !== null && !(node instanceof Node)) {
2179
2498
  if ("marker" in node) {
2180
2499
  const handle = node;
2181
2500
  if (typeof handle.dispose === "function") {
2182
- _chunkWJMZ7X46cjs.registerRootCleanup.call(void 0, handle.dispose);
2501
+ _chunkNBDEMBBXcjs.registerRootCleanup.call(void 0, handle.dispose);
2183
2502
  }
2184
2503
  if (typeof handle.flush === "function") {
2185
2504
  const runFlush = () => handle.flush && handle.flush();
@@ -2200,10 +2519,10 @@ function createElementWithContext(node, namespace, ownerDocument) {
2200
2519
  return frag;
2201
2520
  }
2202
2521
  if (typeof node === "string" || typeof node === "number") {
2203
- return ownerDocument.createTextNode(String(node));
2522
+ return createTextNodeWithHydration(String(node), ownerDocument);
2204
2523
  }
2205
2524
  if (typeof node === "boolean") {
2206
- return ownerDocument.createTextNode("");
2525
+ return createTextNodeWithHydration("", ownerDocument);
2207
2526
  }
2208
2527
  const vnode = node;
2209
2528
  if (typeof vnode.type === "function") {
@@ -2230,14 +2549,14 @@ function createElementWithContext(node, namespace, ownerDocument) {
2230
2549
  }
2231
2550
  });
2232
2551
  const props = createPropsProxy(baseProps);
2233
- const hook = isDev2 ? _chunkWJMZ7X46cjs.getDevtoolsHook.call(void 0, ) : void 0;
2552
+ const hook = isDev2 ? _chunkNBDEMBBXcjs.getDevtoolsHook.call(void 0, ) : void 0;
2234
2553
  const componentName = vnode.type.name || "Anonymous";
2235
- const parentId = hook ? _chunkWJMZ7X46cjs.__fictGetCurrentComponentId.call(void 0, ) : void 0;
2554
+ const parentId = hook ? _chunkNBDEMBBXcjs.__fictGetCurrentComponentId.call(void 0, ) : void 0;
2236
2555
  const componentId = hook ? nextComponentId++ : void 0;
2237
- if (_optionalChain([hook, 'optionalAccess', _46 => _46.registerComponent]) && componentId !== void 0) {
2556
+ if (_optionalChain([hook, 'optionalAccess', _68 => _68.registerComponent]) && componentId !== void 0) {
2238
2557
  hook.registerComponent(componentId, componentName, parentId);
2239
2558
  }
2240
- const ctx = _chunkWJMZ7X46cjs.__fictPushContext.call(void 0, );
2559
+ const ctx = _chunkNBDEMBBXcjs.__fictPushContext.call(void 0, );
2241
2560
  if (componentId !== void 0) {
2242
2561
  ctx.componentId = componentId;
2243
2562
  if (parentId !== void 0) {
@@ -2248,15 +2567,15 @@ function createElementWithContext(node, namespace, ownerDocument) {
2248
2567
  const rendered = vnode.type(props);
2249
2568
  let mountElements;
2250
2569
  if (hook && componentId !== void 0) {
2251
- _optionalChain([hook, 'access', _47 => _47.componentRender, 'optionalCall', _48 => _48(componentId)]);
2570
+ _optionalChain([hook, 'access', _69 => _69.componentRender, 'optionalCall', _70 => _70(componentId)]);
2252
2571
  }
2253
2572
  if (hook && componentId !== void 0) {
2254
- _chunkWJMZ7X46cjs.onMount.call(void 0, () => {
2255
- _optionalChain([hook, 'access', _49 => _49.componentMount, 'optionalCall', _50 => _50(componentId, mountElements)]);
2573
+ _chunkNBDEMBBXcjs.onMount.call(void 0, () => {
2574
+ _optionalChain([hook, 'access', _71 => _71.componentMount, 'optionalCall', _72 => _72(componentId, mountElements)]);
2256
2575
  });
2257
- _chunkWJMZ7X46cjs.onCleanup.call(void 0, () => _optionalChain([hook, 'access', _51 => _51.componentUnmount, 'optionalCall', _52 => _52(componentId)]));
2576
+ _chunkNBDEMBBXcjs.onCleanup.call(void 0, () => _optionalChain([hook, 'access', _73 => _73.componentUnmount, 'optionalCall', _74 => _74(componentId)]));
2258
2577
  }
2259
- if (_chunkWJMZ7X46cjs.__fictIsResumable.call(void 0, ) && !_chunkWJMZ7X46cjs.__fictIsHydrating.call(void 0, )) {
2578
+ if (_chunkNBDEMBBXcjs.__fictIsResumable.call(void 0, ) && !_chunkNBDEMBBXcjs.__fictIsHydrating.call(void 0, )) {
2260
2579
  const content = createElementWithContext(rendered, namespace, ownerDocument);
2261
2580
  const host = namespace === "svg" ? ownerDocument.createElementNS(SVG_NS, "fict-host") : namespace === "mathml" ? ownerDocument.createElementNS(MATHML_NS, "fict-host") : ownerDocument.createElement("fict-host");
2262
2581
  host.setAttribute("data-fict-host", "");
@@ -2265,9 +2584,9 @@ function createElementWithContext(node, namespace, ownerDocument) {
2265
2584
  host.style.display = "contents";
2266
2585
  }
2267
2586
  const meta = vnode.type.__fictMeta;
2268
- const typeKey = (_nullishCoalesce(_optionalChain([meta, 'optionalAccess', _53 => _53.id]), () => ( vnode.type.name))) || "Anonymous";
2269
- _chunkWJMZ7X46cjs.__fictRegisterScope.call(void 0, ctx, host, typeKey, rawProps);
2270
- if (_optionalChain([meta, 'optionalAccess', _54 => _54.resume])) {
2587
+ const typeKey = (_nullishCoalesce(_optionalChain([meta, 'optionalAccess', _75 => _75.id]), () => ( vnode.type.name))) || "Anonymous";
2588
+ _chunkNBDEMBBXcjs.__fictRegisterScope.call(void 0, ctx, host, typeKey, rawProps);
2589
+ if (_optionalChain([meta, 'optionalAccess', _76 => _76.resume])) {
2271
2590
  host.setAttribute("data-fict-h", meta.resume);
2272
2591
  }
2273
2592
  if (content instanceof DocumentFragment) {
@@ -2288,18 +2607,18 @@ function createElementWithContext(node, namespace, ownerDocument) {
2288
2607
  }
2289
2608
  return componentRoot;
2290
2609
  } catch (err) {
2291
- if (_chunkWJMZ7X46cjs.handleSuspend.call(void 0, err)) {
2610
+ if (_chunkNBDEMBBXcjs.handleSuspend.call(void 0, err)) {
2292
2611
  return ownerDocument.createComment("fict:suspend");
2293
2612
  }
2294
- _chunkWJMZ7X46cjs.handleError.call(void 0, err, { source: "render", componentName: vnode.type.name });
2613
+ _chunkNBDEMBBXcjs.handleError.call(void 0, err, { source: "render", componentName: vnode.type.name });
2295
2614
  throw err;
2296
2615
  } finally {
2297
- _chunkWJMZ7X46cjs.__fictPopContext.call(void 0, );
2616
+ _chunkNBDEMBBXcjs.__fictPopContext.call(void 0, );
2298
2617
  }
2299
2618
  }
2300
2619
  if (vnode.type === Fragment) {
2301
2620
  const frag = ownerDocument.createDocumentFragment();
2302
- const children = _optionalChain([vnode, 'access', _55 => _55.props, 'optionalAccess', _56 => _56.children]);
2621
+ const children = _optionalChain([vnode, 'access', _77 => _77.props, 'optionalAccess', _78 => _78.children]);
2303
2622
  appendChildren(frag, children, namespace, ownerDocument);
2304
2623
  return frag;
2305
2624
  }
@@ -2309,7 +2628,7 @@ function createElementWithContext(node, namespace, ownerDocument) {
2309
2628
  applyProps(el, _nullishCoalesce(vnode.props, () => ( {})), resolvedNamespace === "svg");
2310
2629
  appendChildren(
2311
2630
  el,
2312
- _optionalChain([vnode, 'access', _57 => _57.props, 'optionalAccess', _58 => _58.children]),
2631
+ _optionalChain([vnode, 'access', _79 => _79.props, 'optionalAccess', _80 => _80.children]),
2313
2632
  tagName === "foreignObject" ? null : resolvedNamespace,
2314
2633
  ownerDocument
2315
2634
  );
@@ -2389,7 +2708,7 @@ function appendChildNode(parent, child, namespace, ownerDocument) {
2389
2708
  }
2390
2709
  if (isBindingHandle(child)) {
2391
2710
  appendChildNode(parent, child.marker, namespace, parentOwnerDocument);
2392
- _optionalChain([child, 'access', _59 => _59.flush, 'optionalCall', _60 => _60()]);
2711
+ _optionalChain([child, 'access', _81 => _81.flush, 'optionalCall', _82 => _82()]);
2393
2712
  return;
2394
2713
  }
2395
2714
  if (typeof child === "function") {
@@ -2412,7 +2731,7 @@ function appendChildNode(parent, child, namespace, ownerDocument) {
2412
2731
  }
2413
2732
  let domNode;
2414
2733
  if (typeof child !== "object" || child === null) {
2415
- domNode = parentOwnerDocument.createTextNode(String(_nullishCoalesce(child, () => ( ""))));
2734
+ domNode = createTextNodeWithHydration(String(_nullishCoalesce(child, () => ( ""))), parentOwnerDocument);
2416
2735
  } else {
2417
2736
  domNode = createElementWithContext(child, namespace, parentOwnerDocument);
2418
2737
  }
@@ -2448,33 +2767,12 @@ function appendChildren(parent, children, namespace, ownerDocument) {
2448
2767
  appendChildNode(parent, children, namespace, ownerDocument);
2449
2768
  }
2450
2769
  function applyRef(el, value) {
2451
- if (typeof value === "function") {
2452
- const refFn = value;
2453
- refFn(el);
2454
- const root = _chunkWJMZ7X46cjs.getCurrentRoot.call(void 0, );
2455
- if (root) {
2456
- _chunkWJMZ7X46cjs.registerRootCleanup.call(void 0, () => {
2457
- refFn(null);
2458
- });
2459
- } else if (isDev2) {
2460
- console.warn(
2461
- "[fict] Ref applied outside of a root context. The ref cleanup (setting to null) will not run automatically. Consider using createRoot() or ensure the element is created within a component."
2462
- );
2463
- }
2464
- } else if (value && typeof value === "object" && "current" in value) {
2465
- const refObj = value;
2466
- refObj.current = el;
2467
- const root = _chunkWJMZ7X46cjs.getCurrentRoot.call(void 0, );
2468
- if (root) {
2469
- _chunkWJMZ7X46cjs.registerRootCleanup.call(void 0, () => {
2470
- refObj.current = null;
2471
- });
2472
- } else if (isDev2) {
2473
- console.warn(
2474
- "[fict] Ref applied outside of a root context. The ref cleanup (setting to null) will not run automatically. Consider using createRoot() or ensure the element is created within a component."
2475
- );
2476
- }
2770
+ if (!_chunkNBDEMBBXcjs.getCurrentRoot.call(void 0, ) && isDev2) {
2771
+ console.warn(
2772
+ "[fict] Ref applied outside of a root context. The ref cleanup (setting to null) will not run automatically. Consider using createRoot() or ensure the element is created within a component."
2773
+ );
2477
2774
  }
2775
+ bindRef(el, value);
2478
2776
  }
2479
2777
  function applyProps(el, props, isSVG = false) {
2480
2778
  props = unwrapProps(props);
@@ -2540,7 +2838,7 @@ function applyProps(el, props, isSVG = false) {
2540
2838
  }
2541
2839
  continue;
2542
2840
  }
2543
- if (isDev2 && _chunkWJMZ7X46cjs.ChildProperties.has(key) || key === "innerHTML" || key === "textContent" || key === "innerText" || key === "children") {
2841
+ if (isDev2 && _chunkNBDEMBBXcjs.ChildProperties.has(key) || key === "innerHTML" || key === "textContent" || key === "innerText" || key === "children") {
2544
2842
  createAttributeBinding(el, key, value, setProperty);
2545
2843
  continue;
2546
2844
  }
@@ -2556,8 +2854,8 @@ function applyProps(el, props, isSVG = false) {
2556
2854
  createAttributeBinding(el, key.slice(5), value, setProperty);
2557
2855
  continue;
2558
2856
  }
2559
- const propAlias = !isSVG && isDev2 ? _chunkWJMZ7X46cjs.getPropAlias.call(void 0, key, tagName) : void 0;
2560
- const isProperty = !isSVG ? isDev2 ? _chunkWJMZ7X46cjs.Properties.has(key) : key in el : false;
2857
+ const propAlias = !isSVG && isDev2 ? _chunkNBDEMBBXcjs.getPropAlias.call(void 0, key, tagName) : void 0;
2858
+ const isProperty = !isSVG ? isDev2 ? _chunkNBDEMBBXcjs.Properties.has(key) : key in el : false;
2561
2859
  if (propAlias || isProperty || isCE && !isSVG) {
2562
2860
  const propName = propAlias || key;
2563
2861
  if (isCE && !isProperty && !propAlias) {
@@ -2574,7 +2872,7 @@ function applyProps(el, props, isSVG = false) {
2574
2872
  }
2575
2873
  if (isSVG && key.indexOf(":") > -1) {
2576
2874
  const [prefix, name] = key.split(":");
2577
- const ns = _chunkWJMZ7X46cjs.SVGNamespace[prefix];
2875
+ const ns = _chunkNBDEMBBXcjs.SVGNamespace[prefix];
2578
2876
  if (ns) {
2579
2877
  createAttributeBinding(
2580
2878
  el,
@@ -2717,4 +3015,4 @@ function eventNameFromProp(key) {
2717
3015
 
2718
3016
 
2719
3017
  exports.startTransition = startTransition; exports.useTransition = useTransition; exports.useDeferredValue = useDeferredValue; exports.batch = batch2; exports.untrack = untrack2; exports.Fragment = Fragment; exports.withHydrationRange = withHydrationRange; exports.isHydratingActive = isHydratingActive; exports.toNodeArray = toNodeArray; exports.insertNodesBefore = insertNodesBefore; exports.removeNodes = removeNodes; exports.getSlotEnd = getSlotEnd; exports.resolvePath = resolvePath; exports.isReactive = isReactive; exports.nonReactive = nonReactive; exports.reactive = reactive; exports.unwrap = unwrap; exports.callEventHandler = callEventHandler; exports.createTextBinding = createTextBinding; exports.bindText = bindText; exports.setText = setText; exports.createAttributeBinding = createAttributeBinding; exports.bindAttribute = bindAttribute; exports.setAttr = setAttr; exports.bindProperty = bindProperty; exports.setProp = setProp; exports.createStyleBinding = createStyleBinding; exports.bindStyle = bindStyle; exports.setStyle = setStyle; exports.createClassBinding = createClassBinding; exports.bindClass = bindClass; exports.setClass = setClass; exports.classList = classList; exports.insert = insert; exports.insertBetween = insertBetween; exports.createChildBinding = createChildBinding; exports.delegateEvents = delegateEvents; exports.clearDelegatedEvents = clearDelegatedEvents; exports.addEventListener = addEventListener; exports.bindEvent = bindEvent; exports.bindRef = bindRef; exports.spread = spread; exports.assign = assign; exports.createConditional = createConditional; exports.createShow = createShow; exports.createPortal = createPortal; exports.__fictProp = __fictProp; exports.createPropsProxy = createPropsProxy; exports.__fictPropsRest = __fictPropsRest; exports.mergeProps = mergeProps; exports.keyed = keyed; exports.prop = prop; exports.render = render; exports.hydrateComponent = hydrateComponent; exports.createElement = createElement; exports.template = template;
2720
- //# sourceMappingURL=chunk-AR2T7JEX.cjs.map
3018
+ //# sourceMappingURL=chunk-UG2IFQOY.cjs.map