octane 0.2.1 → 0.2.3

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 (50) hide show
  1. package/dist/cjs/compatibility.cjs +35 -0
  2. package/dist/cjs/component-flags.cjs +8 -1
  3. package/dist/cjs/dom-tables.cjs +2 -0
  4. package/dist/cjs/error-codes.client.generated.cjs +15 -2
  5. package/dist/cjs/error-codes.server.generated.cjs +5 -0
  6. package/dist/cjs/event-names.cjs +39 -0
  7. package/dist/cjs/index.cjs +13 -0
  8. package/dist/cjs/runtime.cjs +1224 -335
  9. package/dist/cjs/runtime.server.cjs +362 -120
  10. package/dist/cjs/server/index.cjs +22 -0
  11. package/dist/cjs/version.cjs +1 -1
  12. package/dist/compatibility.d.ts +7 -0
  13. package/dist/compatibility.js +10 -0
  14. package/dist/compiler/bundler.js +13 -30
  15. package/dist/compiler/compile-renderer-boundaries.js +1 -0
  16. package/dist/compiler/compile-universal.js +3 -0
  17. package/dist/compiler/compile.js +619 -99
  18. package/dist/compiler/hook-deps.js +100 -3
  19. package/dist/compiler/hook-names.js +1 -0
  20. package/dist/compiler/manual-hooks.js +171 -0
  21. package/dist/compiler/plain-hook-memo.js +54 -5
  22. package/dist/compiler/slot-hooks.d.ts +43 -0
  23. package/dist/compiler/slot-hooks.js +154 -35
  24. package/dist/component-flags.d.ts +1 -1
  25. package/dist/component-flags.js +8 -1
  26. package/dist/dom-tables.js +2 -0
  27. package/dist/error-codes.client.generated.d.ts +3 -1
  28. package/dist/error-codes.client.generated.js +15 -2
  29. package/dist/error-codes.server.generated.d.ts +1 -0
  30. package/dist/error-codes.server.generated.js +5 -0
  31. package/dist/event-names.d.ts +1 -0
  32. package/dist/event-names.js +15 -0
  33. package/dist/html-tree-validation.d.ts +17 -34
  34. package/dist/index.d.ts +3 -1
  35. package/dist/index.js +12 -1
  36. package/dist/jsx-runtime.d.ts +6 -1
  37. package/dist/public-types.d.ts +188 -0
  38. package/dist/public-types.js +0 -0
  39. package/dist/runtime.d.ts +109 -66
  40. package/dist/runtime.js +1221 -335
  41. package/dist/runtime.server.d.ts +39 -14
  42. package/dist/runtime.server.js +356 -120
  43. package/dist/server/index.d.ts +4 -2
  44. package/dist/server/index.js +19 -0
  45. package/dist/static/index.d.ts +2 -1
  46. package/dist/static/index.js +3 -1
  47. package/dist/universal-core.d.ts +8 -1
  48. package/dist/universal-core.js +95 -9
  49. package/dist/version.js +1 -1
  50. package/package.json +2 -1
@@ -128,15 +128,18 @@ __export(runtime_exports, {
128
128
  hydrateRoot: () => hydrateRoot,
129
129
  ifBlock: () => ifBlock,
130
130
  injectStyle: () => injectStyle,
131
+ invokeManualHook: () => invokeManualHook,
131
132
  isChildrenBlock: () => isChildrenBlock,
132
133
  isValidElement: () => isValidElement,
133
134
  keyedForBlock: () => keyedForBlock,
134
135
  lazy: () => lazy,
136
+ manualHook: () => manualHook,
135
137
  mapSlot: () => mapSlot,
136
138
  markChildrenBlock: () => markChildrenBlock,
137
139
  markDangerouslySetInnerHTMLChildren: () => markDangerouslySetInnerHTMLChildren,
138
140
  markNativeChangeDiagnosticStatic: () => markNativeChangeDiagnosticStatic,
139
141
  markSingleRoot: () => markSingleRoot,
142
+ markWarm: () => markWarm,
140
143
  memo: () => memo,
141
144
  memoPublish: () => memoPublish,
142
145
  memoPublishAlways: () => memoPublishAlways,
@@ -268,6 +271,7 @@ __export(runtime_exports, {
268
271
  });
269
272
  module.exports = __toCommonJS(runtime_exports);
270
273
  var import_constants = require("./constants.cjs");
274
+ var import_event_names = require("./event-names.cjs");
271
275
  var import_has_own = require("./has-own.cjs");
272
276
  var import_head_ownership = require("./head-ownership.cjs");
273
277
  var import_resource_hint_diagnostics = require("./resource-hint-diagnostics.cjs");
@@ -343,15 +347,22 @@ function beginActiveNativeReadScope(scope) {
343
347
  const block = CURRENT_BLOCK;
344
348
  return block === null ? -1 : NATIVE_READ_DRIVER.beginScope(scope, block);
345
349
  }
350
+ function scheduleNativeRead(target) {
351
+ invalidateRender(target, target);
352
+ const retainPriority = SCHEDULED_VISIBILITY_DRIVER?.holdsNativeRead(target) === true;
353
+ if (retainPriority) TRANSITION_DEPTH++;
354
+ try {
355
+ scheduleRender(target);
356
+ } finally {
357
+ if (retainPriority) TRANSITION_DEPTH--;
358
+ }
359
+ }
346
360
  function ensureNativeReadDriver() {
347
361
  if (NATIVE_READ_DRIVER !== null) return NATIVE_READ_DRIVER;
348
362
  NATIVE_READ_DRIVER = (0, import_native_read_client.createNativeReadDriver)({
349
363
  capture: () => WIP_CAPTURE,
350
364
  cleanup: registerHookCleanup,
351
- schedule: (target) => {
352
- invalidateRender(target, target);
353
- scheduleRender(target);
354
- },
365
+ schedule: scheduleNativeRead,
355
366
  suspended: retainNativeRetryReads,
356
367
  replayRefs: (capture, owner) => replayNativeUnpublishedRefs(capture, owner),
357
368
  refDisposed: (entry) => blockSubtreeDisposed(entry.block)
@@ -440,10 +451,7 @@ function retainNativeRetryReads(block, reads) {
440
451
  if (retry2 === void 0) {
441
452
  const owner2 = current;
442
453
  retry2 = (0, import_native_read_retry.createNativeReadRetry)(() => {
443
- if (!owner2.disposed) {
444
- invalidateRender(owner2, owner2);
445
- scheduleRender(owner2);
446
- }
454
+ if (!owner2.disposed) scheduleNativeRead(owner2);
447
455
  });
448
456
  retries.set(owner2, retry2);
449
457
  const owned = retry2;
@@ -640,6 +648,9 @@ const RENDERER_REGION_DOM_OWNERS = /* @__PURE__ */ new WeakMap();
640
648
  const RENDERER_REGION_DOM_BINDINGS = /* @__PURE__ */ new WeakMap();
641
649
  const DOM_ROOT_DISPOSERS = /* @__PURE__ */ new WeakMap();
642
650
  let EFFECT_BODY_DEPTH = 0;
651
+ let CURRENT_EFFECT_PHASE = -1;
652
+ let EFFECT_COMMIT_DEPTH = 0;
653
+ let COMMIT_PHASE_ERRORS = null;
643
654
  let REF_CALLBACK_DEPTH = 0;
644
655
  let STORE_SYNC_DEPTH = 0;
645
656
  let EFFECT_EVENT_LIFECYCLE_DEPTH = 0;
@@ -653,12 +664,15 @@ function runEffectLifecycleCallback(callback) {
653
664
  EFFECT_EVENT_LIFECYCLE_DEPTH--;
654
665
  }
655
666
  }
656
- function runEffectCleanupCallback(callback) {
667
+ function runEffectCleanupCallback(callback, phase = -1) {
668
+ const previousPhase = CURRENT_EFFECT_PHASE;
669
+ CURRENT_EFFECT_PHASE = phase;
657
670
  EFFECT_BODY_DEPTH++;
658
671
  try {
659
672
  runEffectLifecycleCallback(callback);
660
673
  } finally {
661
674
  EFFECT_BODY_DEPTH--;
675
+ CURRENT_EFFECT_PHASE = previousPhase;
662
676
  }
663
677
  }
664
678
  const QUEUE = [];
@@ -677,17 +691,31 @@ function ensureTransitionSwapDriver() {
677
691
  splice: spliceWipCapture,
678
692
  begin: beginTransitionAttempt,
679
693
  end: endTransitionAttempt,
694
+ beginUrgent: beginUrgentTransitionRender,
695
+ endUrgent: endUrgentTransitionRender,
680
696
  holdRoot: holdRootTransition,
681
697
  retryRoot: retryRootTransition,
682
698
  commitRoot: commitRootTransition,
683
699
  discardRoot: discardRootTransition,
684
- keepsRoot: keepsRootTransition
700
+ keepsRoot: keepsRootTransition,
701
+ cancelEqual: cancelHeldTransitionUpdate,
702
+ hasHeld: hasHeldTransitionUpdate,
703
+ heldUpdate: getHeldTransitionUpdate,
704
+ rebaseHeld: rebaseHeldTransitionUpdate
685
705
  };
686
706
  }
687
707
  let ACTIVE_TRANSITION_ACTION_BATCH = null;
688
708
  let IN_FLIGHT_TRANSITION_ACTION_BATCH = null;
689
709
  function createTransitionActionBatch() {
690
- return { updates: /* @__PURE__ */ new Map(), pendingActions: 0, closed: false, flushed: false };
710
+ return {
711
+ updates: /* @__PURE__ */ new Map(),
712
+ pendingActions: 0,
713
+ closed: false,
714
+ flushed: false,
715
+ hook: null,
716
+ hooks: null,
717
+ hooksPending: false
718
+ };
691
719
  }
692
720
  function transitionActionBatchForUpdate() {
693
721
  if (ACTIVE_TRANSITION_ACTION_BATCH !== null) return ACTIVE_TRANSITION_ACTION_BATCH;
@@ -695,6 +723,7 @@ function transitionActionBatchForUpdate() {
695
723
  return IN_FLIGHT_TRANSITION_ACTION_BATCH;
696
724
  }
697
725
  function rebaseTransitionActionUpdate(update) {
726
+ if (update.state !== void 0 || update.reducer !== void 0) return update.value;
698
727
  if (Object.is(update.baseValue, update.slot.value)) return update.value;
699
728
  let value = update.slot.value;
700
729
  for (const operation of update.operations) value = operation(value);
@@ -703,26 +732,31 @@ function rebaseTransitionActionUpdate(update) {
703
732
  if (update.slot.pendingActionBatch !== void 0) update.slot.pendingActionValue = value;
704
733
  return value;
705
734
  }
706
- function stagedTransitionValue(slot) {
735
+ function stagedTransitionValue(slot, block) {
707
736
  const batch = transitionActionBatchForUpdate();
708
737
  if (batch === null) return slot.value;
709
738
  const update = batch.updates.get(slot);
710
- return update === void 0 ? slot.value : rebaseTransitionActionUpdate(update);
739
+ if (update !== void 0) return rebaseTransitionActionUpdate(update);
740
+ if (slot.renderTransition !== void 0) return slot.renderTransition.value;
741
+ const held = block === void 0 ? void 0 : TRANSITION_SWAP_DRIVER?.heldUpdate(slot, block);
742
+ return held === void 0 ? slot.value : held.value;
711
743
  }
712
744
  function stageTransitionValue(slot, block, operation, value, forceRender = false) {
713
745
  const batch = transitionActionBatchForUpdate();
714
- if (batch === null) return false;
746
+ if (batch === null) return null;
715
747
  const replay = typeof operation === "function" ? operation : () => operation;
716
- const current = batch.updates.get(slot);
748
+ let current = batch.updates.get(slot);
717
749
  if (current === void 0) {
718
- batch.updates.set(slot, {
750
+ current = {
751
+ batch,
719
752
  slot,
720
753
  block,
721
754
  operations: [replay],
722
755
  baseValue: slot.value,
723
756
  value,
724
757
  forceRender
725
- });
758
+ };
759
+ batch.updates.set(slot, current);
726
760
  } else {
727
761
  current.operations.push(replay);
728
762
  current.value = value;
@@ -730,23 +764,36 @@ function stageTransitionValue(slot, block, operation, value, forceRender = false
730
764
  }
731
765
  slot.pendingActionBatch = batch;
732
766
  slot.pendingActionValue = value;
733
- return true;
767
+ return current;
734
768
  }
735
769
  function flushTransitionActionBatch(batch) {
736
770
  if (batch.flushed) return;
737
771
  batch.flushed = true;
738
772
  for (const update of batch.updates.values()) {
739
773
  const { slot, block, forceRender } = update;
740
- const value = rebaseTransitionActionUpdate(update);
774
+ const value = update.state === void 0 && update.reducer === void 0 ? rebaseTransitionActionUpdate(update) : update.value;
741
775
  if (slot.pendingActionBatch === batch) {
742
776
  slot.pendingActionBatch = void 0;
743
777
  slot.pendingActionValue = void 0;
744
778
  }
745
779
  if (block.disposed) continue;
780
+ const state = update.state;
781
+ const reducer = update.reducer;
782
+ const previous = state?.renderTransition ?? reducer?.renderTransition;
783
+ if (state !== void 0 || reducer !== void 0) {
784
+ update.baseValue = previous === void 0 ? slot.value : previous.baseValue;
785
+ if (state !== void 0) {
786
+ state.updates = void 0;
787
+ } else if (reducer !== void 0) {
788
+ reducer.renderPhaseActions = void 0;
789
+ }
790
+ }
746
791
  const changed = !Object.is(slot.value, value);
747
- if (!changed && !forceRender) continue;
792
+ if (!changed && !forceRender && update.previous === void 0) continue;
748
793
  if (changed) slot.value = value;
749
- if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__)
794
+ if (update.reducer !== void 0) update.reducer.renderTransition = update;
795
+ if (update.state !== void 0) update.state.renderTransition = update;
796
+ if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__ && (changed || update.profileType !== "state"))
750
797
  (0, import_profiling.__profileSchedule)(
751
798
  block,
752
799
  update.profileType ?? (forceRender ? "reducer" : "state"),
@@ -772,6 +819,74 @@ function flushTransitionActionBatchIfReady(batch) {
772
819
  let DEFERRED_SPAWN = false;
773
820
  let TRANSITION_PENDING_COUNT = 0;
774
821
  const TRANSITION_LISTENERS = /* @__PURE__ */ new Set();
822
+ let TRANSITION_HOOK_HOLDERS = null;
823
+ function addTransitionHookToBatch(batch, hook) {
824
+ if (batch.hook === null) batch.hook = hook;
825
+ else if (batch.hook !== hook) {
826
+ const hooks = batch.hooks;
827
+ if (hooks === null) batch.hooks = [hook];
828
+ else if (hooks.includes(hook)) return;
829
+ else hooks.push(hook);
830
+ } else return;
831
+ if (batch.hooksPending) {
832
+ hook.pendingBatches++;
833
+ hook.publish(true);
834
+ }
835
+ }
836
+ function publishTransitionHookBatch(batch) {
837
+ const hook = batch.hook;
838
+ if (hook === null || batch.hooksPending) return;
839
+ batch.hooksPending = true;
840
+ hook.pendingBatches++;
841
+ hook.publish(true);
842
+ const hooks = batch.hooks;
843
+ if (hooks !== null) {
844
+ for (let i = 0; i < hooks.length; i++) {
845
+ hooks[i].pendingBatches++;
846
+ hooks[i].publish(true);
847
+ }
848
+ }
849
+ }
850
+ function finishTransitionHookBatch(batch) {
851
+ if (!batch.workComplete || batch.pendingActions !== 0 || (batch.pendingHolds ?? 0) !== 0) return;
852
+ if (!batch.hooksPending) return;
853
+ batch.hooksPending = false;
854
+ const hook = batch.hook;
855
+ if (--hook.pendingBatches === 0) hook.publish(false);
856
+ const hooks = batch.hooks;
857
+ if (hooks !== null) {
858
+ for (let i = 0; i < hooks.length; i++) {
859
+ if (--hooks[i].pendingBatches === 0) hooks[i].publish(false);
860
+ }
861
+ }
862
+ }
863
+ function holdTransitionHookBatch(holder, batch) {
864
+ if (batch.hook === null) return;
865
+ const holders = TRANSITION_HOOK_HOLDERS ??= /* @__PURE__ */ new WeakMap();
866
+ let batches = holders.get(holder);
867
+ if (batches === void 0) holders.set(holder, batches = /* @__PURE__ */ new Set());
868
+ if (batches.has(batch)) return;
869
+ batches.add(batch);
870
+ batch.pendingHolds = (batch.pendingHolds ?? 0) + 1;
871
+ publishTransitionHookBatch(batch);
872
+ }
873
+ function releaseTransitionHookHolder(holder) {
874
+ const batches = TRANSITION_HOOK_HOLDERS?.get(holder);
875
+ if (batches === void 0) return;
876
+ TRANSITION_HOOK_HOLDERS.delete(holder);
877
+ for (const batch of batches) {
878
+ batch.pendingHolds--;
879
+ finishTransitionHookBatch(batch);
880
+ }
881
+ }
882
+ function holdTransitionHooksForBlock(holder, block) {
883
+ for (const entries of FLUSHED_TRANSITION_UPDATES) {
884
+ for (const entry of entries) {
885
+ if (entry.batch !== void 0 && blockIsAncestor(entry.block, block))
886
+ holdTransitionHookBatch(holder, entry.batch);
887
+ }
888
+ }
889
+ }
775
890
  let TRANSITION_LISTENER_PUBLISH_DEPTH = 0;
776
891
  const HELD_TRANSITIONS = /* @__PURE__ */ new Set();
777
892
  const STAGED_REVEALS = /* @__PURE__ */ new Set();
@@ -780,6 +895,111 @@ let deferringStagedRevealEffects = false;
780
895
  let ACTIVE_TRANSITION_ATTEMPT = null;
781
896
  let FLUSHED_TRANSITION_UPDATES = [];
782
897
  let HELD_SYNC_TRANSITION = null;
898
+ function urgentTransitionCellUpdate(block) {
899
+ return TRANSITION_DEPTH === 0 && !(CURRENT_BLOCK === block && block.currentRenderMode === "transition") && (syncFlush || _dispatchDepth > 0 || ASYNC_TRANSITION_COUNT === 0);
900
+ }
901
+ function latestHeldTransitionUpdate(entry) {
902
+ while (entry.next?.batch?.flushed === true && !entry.next.superseded) entry = entry.next;
903
+ return entry;
904
+ }
905
+ function findHeldTransitionUpdate(slot, block) {
906
+ if (!urgentTransitionCellUpdate(block)) return;
907
+ return getHeldTransitionUpdate(slot, block);
908
+ }
909
+ function getHeldTransitionUpdate(slot, block) {
910
+ if (block.disposed) return;
911
+ const rootHeld = block.idState.renderOwner?.transition;
912
+ if (HELD_SYNC_TRANSITION === null && rootHeld === void 0 && FLUSHED_TRANSITION_UPDATES.length === 0)
913
+ return;
914
+ const groups = [HELD_SYNC_TRANSITION?.entries, rootHeld?.entries];
915
+ for (const entries of groups) {
916
+ if (entries === void 0) continue;
917
+ for (let i = entries.length - 1; i >= 0; i--) {
918
+ const entry = entries[i];
919
+ if (entry.slot === slot && !entry.superseded && Object.is(slot.value, entry.baseValue))
920
+ return latestHeldTransitionUpdate(entry);
921
+ }
922
+ }
923
+ for (let i = FLUSHED_TRANSITION_UPDATES.length - 1; i >= 0; i--) {
924
+ const entries = FLUSHED_TRANSITION_UPDATES[i];
925
+ for (let j = entries.length - 1; j >= 0; j--) {
926
+ const entry = entries[j];
927
+ if (entry.slot === slot && !entry.superseded && Object.is(slot.value, entry.baseValue) && // A completed hook render clears this pointer before the flush's
928
+ // retained-entry list is released. Returning to an old base value
929
+ // must not turn that completed update into pending work again.
930
+ (entry.state === void 0 && entry.reducer === void 0 || slot.renderTransition !== void 0))
931
+ return latestHeldTransitionUpdate(entry);
932
+ }
933
+ }
934
+ }
935
+ function hasHeldTransitionUpdate(slot, block) {
936
+ return findHeldTransitionUpdate(slot, block) !== void 0;
937
+ }
938
+ function cancelHeldTransitionUpdate(slot, block) {
939
+ if (!urgentTransitionCellUpdate(block)) return false;
940
+ const rootHeld = block.idState.renderOwner?.transition;
941
+ if (HELD_SYNC_TRANSITION === null && rootHeld === void 0 && FLUSHED_TRANSITION_UPDATES.length === 0)
942
+ return false;
943
+ let cancelled = false;
944
+ const cancel = (entries) => {
945
+ if (entries === void 0) return;
946
+ for (const entry of entries) {
947
+ if (entry.slot === slot && !entry.superseded) {
948
+ entry.superseded = true;
949
+ cancelled = true;
950
+ }
951
+ }
952
+ };
953
+ cancel(HELD_SYNC_TRANSITION?.entries);
954
+ cancel(rootHeld?.entries);
955
+ for (const entries of FLUSHED_TRANSITION_UPDATES) cancel(entries);
956
+ return cancelled;
957
+ }
958
+ function rebaseHeldTransitionUpdate(slot, block, actions, reducer) {
959
+ const entry = findHeldTransitionUpdate(slot, block);
960
+ if (entry === void 0) return;
961
+ if (slot.pendingActionBatch?.flushed === false) return;
962
+ let value = entry.value;
963
+ for (const action of actions) {
964
+ value = reducer ? reducer(value, action) : typeof action === "function" ? action(value) : action;
965
+ }
966
+ if (Object.is(value, entry.baseValue)) {
967
+ cancelHeldTransitionUpdate(slot, block);
968
+ return;
969
+ }
970
+ const changed = !Object.is(value, entry.value);
971
+ for (let current = entry; current; current = current.previous)
972
+ current.value = value;
973
+ for (const action of actions) {
974
+ entry.operations.push(
975
+ reducer ? (previous) => reducer(previous, action) : typeof action === "function" ? action : () => action
976
+ );
977
+ }
978
+ if (changed) scheduleHeldTransitionReplay(entry, block);
979
+ }
980
+ function scheduleHeldTransitionReplay(entry, block) {
981
+ const held = HELD_SYNC_TRANSITION;
982
+ if (held !== null && held.entries.includes(entry)) {
983
+ if (held.replayScheduled) return;
984
+ held.replayScheduled = true;
985
+ queueMicrotask(() => {
986
+ if (HELD_SYNC_TRANSITION !== held) return;
987
+ held.replayScheduled = false;
988
+ promoteHeldSyncTransition();
989
+ });
990
+ return;
991
+ }
992
+ const owner = block.idState.renderOwner;
993
+ const rootHeld = owner?.transition;
994
+ if (rootHeld === void 0 || !rootHeld.entries.includes(entry) || rootHeld.replayScheduled)
995
+ return;
996
+ rootHeld.replayScheduled = true;
997
+ queueMicrotask(() => {
998
+ if (owner.transition !== rootHeld) return;
999
+ rootHeld.replayScheduled = false;
1000
+ retryRootTransition(owner);
1001
+ });
1002
+ }
783
1003
  let PROMOTED_MEMO_SWAPS = null;
784
1004
  let PROMOTED_WARM_HARVEST = null;
785
1005
  function takeSingleOriginTransitionUpdates(origin) {
@@ -943,18 +1163,24 @@ function heldSyncCellsIntact(state) {
943
1163
  if (held === null || !held.holders.has(state)) return false;
944
1164
  for (let i = 0; i < held.entries.length; i++) {
945
1165
  const entry = held.entries[i];
946
- if (!Object.is(entry.slot.value, entry.baseValue)) return false;
1166
+ if (entry.superseded || !Object.is(entry.slot.value, entry.baseValue)) return false;
947
1167
  }
948
1168
  return true;
949
1169
  }
1170
+ function heldTransitionHasPendingAction(entries) {
1171
+ for (const entry of entries) {
1172
+ if (!entry.superseded && entry.slot.pendingActionBatch?.flushed === false) return true;
1173
+ }
1174
+ return false;
1175
+ }
950
1176
  function promoteHeldSyncTransition() {
951
1177
  const held = HELD_SYNC_TRANSITION;
952
- if (held === null) return false;
1178
+ if (held === null || heldTransitionHasPendingAction(held.entries)) return false;
953
1179
  HELD_SYNC_TRANSITION = null;
954
1180
  const promoted = [];
955
1181
  for (let i = 0; i < held.entries.length; i++) {
956
1182
  const entry = held.entries[i];
957
- if (!Object.is(entry.slot.value, entry.baseValue)) continue;
1183
+ if (entry.superseded || !Object.is(entry.slot.value, entry.baseValue)) continue;
958
1184
  entry.slot.value = entry.value;
959
1185
  if (!entry.block.disposed) promoted.push(entry);
960
1186
  }
@@ -990,7 +1216,7 @@ function discardHeldSyncTransition(state) {
990
1216
  function rootTransitionCellsIntact(held) {
991
1217
  for (let i = 0; i < held.entries.length; i++) {
992
1218
  const entry = held.entries[i];
993
- if (!Object.is(entry.slot.value, entry.baseValue)) return false;
1219
+ if (entry.superseded || !Object.is(entry.slot.value, entry.baseValue)) return false;
994
1220
  }
995
1221
  return true;
996
1222
  }
@@ -1037,6 +1263,9 @@ function holdRootTransition(owner, transaction, attempt) {
1037
1263
  promoted: false,
1038
1264
  cue: !continuing
1039
1265
  };
1266
+ for (const entry of entries) {
1267
+ if (entry.batch !== void 0) holdTransitionHookBatch(owner, entry.batch);
1268
+ }
1040
1269
  if (previous === void 0 || previous.promoted) tickTransitionCount(1);
1041
1270
  return true;
1042
1271
  }
@@ -1047,6 +1276,7 @@ function retryRootTransition(owner) {
1047
1276
  discardRootTransition(owner);
1048
1277
  return false;
1049
1278
  }
1279
+ if (heldTransitionHasPendingAction(held.entries)) return true;
1050
1280
  held.promoted = true;
1051
1281
  held.cue = false;
1052
1282
  if (held.memoSwaps !== null) {
@@ -1056,6 +1286,7 @@ function retryRootTransition(owner) {
1056
1286
  TRANSITION_DEPTH++;
1057
1287
  try {
1058
1288
  tickTransitionCount(-1);
1289
+ releaseTransitionHookHolder(owner);
1059
1290
  for (let i = 0; i < held.entries.length; i++) {
1060
1291
  const entry = held.entries[i];
1061
1292
  entry.slot.value = entry.value;
@@ -1091,6 +1322,7 @@ function discardRootTransition(owner) {
1091
1322
  owner.wakeable = null;
1092
1323
  owner.generation++;
1093
1324
  if (!held.promoted) tickTransitionCount(-1);
1325
+ releaseTransitionHookHolder(owner);
1094
1326
  }
1095
1327
  const JOURNAL_TEXT = 0;
1096
1328
  const JOURNAL_ATTR = 1;
@@ -2044,9 +2276,27 @@ let actScopeDepth = 0;
2044
2276
  function setIsOctaneActEnvironment(value) {
2045
2277
  IS_OCTANE_ACT_ENVIRONMENT = value;
2046
2278
  }
2279
+ function isActEnvironment() {
2280
+ return IS_OCTANE_ACT_ENVIRONMENT || globalThis.IS_REACT_ACT_ENVIRONMENT === true;
2281
+ }
2047
2282
  const NESTED_UPDATE_LIMIT = 50;
2048
2283
  const ACT_DRAIN_LIMIT = NESTED_UPDATE_LIMIT + 50;
2049
2284
  let UPDATE_CHAIN_ID = 0;
2285
+ let PASSIVE_UPDATE_COUNTS = null;
2286
+ function countPassiveUpdate(block) {
2287
+ if (process.env.NODE_ENV === "production") return;
2288
+ const counts = PASSIVE_UPDATE_COUNTS ??= /* @__PURE__ */ new WeakMap();
2289
+ let state = counts.get(block);
2290
+ if (state === void 0 || state.chain !== UPDATE_CHAIN_ID) {
2291
+ state = { chain: UPDATE_CHAIN_ID, count: 0 };
2292
+ counts.set(block, state);
2293
+ }
2294
+ if (++state.count === NESTED_UPDATE_LIMIT + 1) {
2295
+ console.error(
2296
+ "Maximum update depth exceeded. Check the dependencies of effects that schedule state updates."
2297
+ );
2298
+ }
2299
+ }
2050
2300
  function inNestedUpdateCallback() {
2051
2301
  return EFFECT_BODY_DEPTH > 0 || REF_CALLBACK_DEPTH > 0 || STORE_SYNC_DEPTH > 0;
2052
2302
  }
@@ -2076,9 +2326,23 @@ function warnCrossComponentRenderUpdate(target, source) {
2076
2326
  }
2077
2327
  function scheduleRender(block) {
2078
2328
  if (block.disposed) return;
2079
- if (process.env.NODE_ENV !== "production" && IS_OCTANE_ACT_ENVIRONMENT && actScopeDepth === 0 && !syncFlush) {
2329
+ if (process.env.NODE_ENV !== "production" && CURRENT_EFFECT_PHASE === INSERTION) {
2330
+ console.error(
2331
+ "useInsertionEffect must not schedule state updates. Move this work to a layout or passive effect."
2332
+ );
2333
+ }
2334
+ if (process.env.NODE_ENV !== "production" && isActEnvironment() && actScopeDepth === 0 && !syncFlush) {
2080
2335
  console.error(
2081
- "An update to a component was not wrapped in act(...).\n\nWhen testing, code that causes state updates should be wrapped into act(...):\n\n act(() => {\n /* fire events that update state */\n });\n /* assert on the output */\n\nThis ensures you're testing the behavior the user would see in the browser."
2336
+ `An update to ${componentName(block)} was not wrapped in act(...).
2337
+
2338
+ When testing, code that causes state updates should be wrapped into act(...):
2339
+
2340
+ act(() => {
2341
+ /* fire events that update state */
2342
+ });
2343
+ /* assert on the output */
2344
+
2345
+ This ensures you're testing the behavior the user would see in the browser.`
2082
2346
  );
2083
2347
  }
2084
2348
  const renderPhaseSelf = CURRENT_BLOCK === block;
@@ -2096,7 +2360,9 @@ function scheduleRender(block) {
2096
2360
  }
2097
2361
  return;
2098
2362
  }
2099
- if (inNestedUpdateCallback()) {
2363
+ if (CURRENT_EFFECT_PHASE === PASSIVE && !syncFlush) {
2364
+ countPassiveUpdate(block);
2365
+ } else if (inNestedUpdateCallback()) {
2100
2366
  if (block.nestedUpdateChain !== UPDATE_CHAIN_ID) {
2101
2367
  block.nestedUpdateChain = UPDATE_CHAIN_ID;
2102
2368
  block.nestedUpdateCount = 0;
@@ -2138,14 +2404,19 @@ function drainHydrationRenderPhaseUpdates(root) {
2138
2404
  QUEUE[write++] = block;
2139
2405
  continue;
2140
2406
  }
2141
- if (!block.pending || block.disposed) continue;
2142
- const seen = (renders ??= /* @__PURE__ */ new Map()).get(block) ?? 0;
2143
- if (seen >= RENDER_PHASE_UPDATE_LIMIT) {
2144
- throw new Error((0, import_error_codes_client_generated.formatClientError)(9));
2145
- }
2146
- renders.set(block, seen + 1);
2147
- block.crossRenderUpdate = false;
2407
+ if (!block.pending && !block.nestedUpdateError || block.disposed) continue;
2148
2408
  try {
2409
+ if (block.nestedUpdateError) {
2410
+ block.nestedUpdateError = false;
2411
+ throw maximumUpdateDepthError();
2412
+ }
2413
+ const seen = (renders ??= /* @__PURE__ */ new Map()).get(block) ?? 0;
2414
+ const crossRenderUpdate = block.crossRenderUpdate;
2415
+ if (seen >= (crossRenderUpdate ? NESTED_UPDATE_LIMIT : RENDER_PHASE_UPDATE_LIMIT)) {
2416
+ throw crossRenderUpdate ? maximumUpdateDepthError() : new Error((0, import_error_codes_client_generated.formatClientError)(9));
2417
+ }
2418
+ renders.set(block, seen + 1);
2419
+ block.crossRenderUpdate = false;
2149
2420
  renderBlock(block);
2150
2421
  } catch (error) {
2151
2422
  handleRenderError(block, error);
@@ -2193,12 +2464,21 @@ let SCHEDULED_VISIBILITY_DRIVER = null;
2193
2464
  function ensureScheduledVisibilityDriver() {
2194
2465
  SCHEDULED_VISIBILITY_DRIVER ??= {
2195
2466
  find: findScheduledVisibilityOwner,
2467
+ holdsNativeRead,
2196
2468
  reveal: attemptHiddenReveal,
2197
2469
  visible: renderVisibleTry,
2198
2470
  rehide: rehideActivityAfterDescendantRender,
2199
2471
  retryActivity: renderHiddenActivity
2200
2472
  };
2201
2473
  }
2474
+ function holdsNativeRead(block) {
2475
+ for (const state of HELD_TRANSITIONS) {
2476
+ const primary = state.tryBlock;
2477
+ if (state.transitionHeld && state.hiddenDom === null && primary !== null && (primary === block || blockIsAncestorOf(primary, block) || blockIsAncestorOf(block, primary)))
2478
+ return true;
2479
+ }
2480
+ return false;
2481
+ }
2202
2482
  function drainQueue() {
2203
2483
  let pendingError = null;
2204
2484
  let activitiesToRehide = null;
@@ -2242,7 +2522,7 @@ function drainQueue() {
2242
2522
  throw maximumUpdateDepthError();
2243
2523
  }
2244
2524
  if (block.drainStamp === drainId) {
2245
- if (++block.drainRenders > RENDER_PHASE_UPDATE_LIMIT) {
2525
+ if (++block.drainRenders > (crossRenderUpdate ? NESTED_UPDATE_LIMIT : RENDER_PHASE_UPDATE_LIMIT)) {
2246
2526
  throw crossRenderUpdate ? maximumUpdateDepthError() : new Error((0, import_error_codes_client_generated.formatClientError)(9));
2247
2527
  }
2248
2528
  } else {
@@ -2822,6 +3102,11 @@ function drainPassivesBeforeRender() {
2822
3102
  if (effectQueues[PASSIVE].length > 0 || pendingPassiveUnmounts.length > 0) drainPassiveEffects();
2823
3103
  }
2824
3104
  function flushSync(fn) {
3105
+ if (process.env.NODE_ENV !== "production" && (CURRENT_BLOCK !== null || EFFECT_BODY_DEPTH > 0 || REF_CALLBACK_DEPTH > 0)) {
3106
+ console.error(
3107
+ "flushSync was called while rendering or running a lifecycle callback. Move the call to an event or scheduled task."
3108
+ );
3109
+ }
2825
3110
  if (inFlush) return (0, import_read_protocol.runNativeBatch)(fn);
2826
3111
  VIEW_TRANSITION_DRIVER?.interrupt();
2827
3112
  const prevSync = syncFlush;
@@ -3034,6 +3319,7 @@ function commitEffects() {
3034
3319
  return;
3035
3320
  }
3036
3321
  const nativeFrame = NATIVE_READ_DRIVER?.pauseLifecycle() ?? -1;
3322
+ EFFECT_COMMIT_DEPTH++;
3037
3323
  try {
3038
3324
  drainEffectEventUpdates();
3039
3325
  const caughtReports = drainEffectEventCommitActions();
@@ -3051,6 +3337,7 @@ function commitEffects() {
3051
3337
  }
3052
3338
  } finally {
3053
3339
  if (nativeFrame >= 0) NATIVE_READ_DRIVER.resumeLifecycle(nativeFrame);
3340
+ finishEffectCommit();
3054
3341
  }
3055
3342
  }
3056
3343
  function schedulePassiveFlush() {
@@ -3155,15 +3442,25 @@ function compareEffectPostOrder(a, b) {
3155
3442
  if (a.scope === b.scope) return a.order - b.order || a.seq - b.seq;
3156
3443
  return comparePostOrder(a.scope.block, a.seq, b.scope.block, b.seq);
3157
3444
  }
3158
- function reportEffectError(block, error) {
3159
- const handler = findTryHandler(block);
3445
+ function finishEffectCommit() {
3446
+ if (--EFFECT_COMMIT_DEPTH !== 0 || COMMIT_PHASE_ERRORS === null) return;
3447
+ const errors = COMMIT_PHASE_ERRORS;
3448
+ COMMIT_PHASE_ERRORS = null;
3449
+ for (const { block, error, handler } of errors) reportEffectError(block, error, handler);
3450
+ }
3451
+ function reportEffectError(block, error, capturedHandler) {
3452
+ if (EFFECT_COMMIT_DEPTH > 0) {
3453
+ (COMMIT_PHASE_ERRORS ??= []).push({ block, error, handler: capturedHandler });
3454
+ return;
3455
+ }
3456
+ const handler = capturedHandler === void 0 ? findTryHandler(block) : capturedHandler;
3160
3457
  if (handler !== null) {
3161
3458
  reportCaughtError(block, error, handler(error));
3162
3459
  return;
3163
3460
  }
3164
3461
  let root = block;
3165
- while (root.parentBlock !== null) root = root.parentBlock;
3166
- if (root.kind === "root" && !root.disposed) {
3462
+ while (root !== null && root.parentBlock !== null) root = root.parentBlock;
3463
+ if (root !== null && root.kind === "root" && !root.disposed) {
3167
3464
  unmountBlock(root);
3168
3465
  drainRefDetaches();
3169
3466
  }
@@ -3183,7 +3480,7 @@ function fireEffectCleanup(e) {
3183
3480
  if (cleanup) {
3184
3481
  slot.cleanup = void 0;
3185
3482
  try {
3186
- runEffectCleanupCallback(cleanup);
3483
+ runEffectCleanupCallback(cleanup, e.phase);
3187
3484
  } catch (err) {
3188
3485
  if (err instanceof MaximumUpdateDepthError) throw err;
3189
3486
  reportEffectError(e.scope.block, err);
@@ -3200,17 +3497,27 @@ function runEffectBody(e) {
3200
3497
  slot.connectedArgs = e.args;
3201
3498
  slot.disconnected = false;
3202
3499
  try {
3500
+ const previousPhase = CURRENT_EFFECT_PHASE;
3501
+ CURRENT_EFFECT_PHASE = e.phase;
3203
3502
  EFFECT_BODY_DEPTH++;
3204
3503
  try {
3205
3504
  cleanup = e.fn.apply(null, e.args ?? []);
3206
3505
  } finally {
3207
3506
  EFFECT_BODY_DEPTH--;
3507
+ CURRENT_EFFECT_PHASE = previousPhase;
3208
3508
  }
3209
3509
  } catch (err) {
3210
3510
  if (err instanceof MaximumUpdateDepthError) throw err;
3211
3511
  reportEffectError(e.scope.block, err);
3212
3512
  return;
3213
3513
  }
3514
+ if (process.env.NODE_ENV !== "production" && cleanup !== void 0 && typeof cleanup !== "function") {
3515
+ const name = e.phase === PASSIVE ? "useEffect" : e.phase === LAYOUT ? "useLayoutEffect" : "useInsertionEffect";
3516
+ const thenable = cleanup !== null && typeof cleanup.then === "function";
3517
+ console.error(
3518
+ name + " must return a cleanup function or nothing." + (thenable ? " Start asynchronous work inside the effect and return its cleanup separately." : "")
3519
+ );
3520
+ }
3214
3521
  if (typeof cleanup === "function") {
3215
3522
  slot.cleanup = cleanup;
3216
3523
  }
@@ -3260,20 +3567,25 @@ function runLayoutEffects(q) {
3260
3567
  }
3261
3568
  }
3262
3569
  function drainPassivePhase() {
3263
- drainDeferredPassiveUnmounts();
3264
- const pending = effectQueues[PASSIVE];
3265
- if (pending.length === 0) return;
3266
- const q = pending.splice(0);
3267
- q.sort(compareEffectPostOrder);
3268
- for (let i = 0; i < q.length; i++) {
3269
- const e = q[i];
3270
- if (e.scope.block.disposed || e.fn !== null && inInactiveSubtree(e.scope.block)) continue;
3271
- fireEffectCleanup(e);
3272
- }
3273
- for (let i = 0; i < q.length; i++) {
3274
- const e = q[i];
3275
- if (e.scope.block.disposed || inInactiveSubtree(e.scope.block)) continue;
3276
- runEffectBody(e);
3570
+ EFFECT_COMMIT_DEPTH++;
3571
+ try {
3572
+ drainDeferredPassiveUnmounts();
3573
+ const pending = effectQueues[PASSIVE];
3574
+ if (pending.length === 0) return;
3575
+ const q = pending.splice(0);
3576
+ q.sort(compareEffectPostOrder);
3577
+ for (let i = 0; i < q.length; i++) {
3578
+ const e = q[i];
3579
+ if (e.scope.block.disposed || e.fn !== null && inInactiveSubtree(e.scope.block)) continue;
3580
+ fireEffectCleanup(e);
3581
+ }
3582
+ for (let i = 0; i < q.length; i++) {
3583
+ const e = q[i];
3584
+ if (e.scope.block.disposed || inInactiveSubtree(e.scope.block)) continue;
3585
+ runEffectBody(e);
3586
+ }
3587
+ } finally {
3588
+ finishEffectCommit();
3277
3589
  }
3278
3590
  }
3279
3591
  function drainEffectEventCommitActions() {
@@ -3296,14 +3608,12 @@ function drainDeferredPassiveUnmounts() {
3296
3608
  const q = pendingPassiveUnmounts.splice(0);
3297
3609
  for (let i = 0; i < q.length; i += 3) {
3298
3610
  try {
3299
- runEffectCleanupCallback(q[i]);
3611
+ runEffectCleanupCallback(q[i], PASSIVE);
3300
3612
  } catch (err) {
3301
3613
  if (err instanceof MaximumUpdateDepthError) throw err;
3302
3614
  const handler = q[i + 1];
3303
3615
  const owner = q[i + 2];
3304
- if (handler !== null) {
3305
- reportCaughtError(owner, err, handler(err));
3306
- } else if (!reportUncaughtError(owner, err)) console.error(err);
3616
+ reportEffectError(owner, err, handler);
3307
3617
  }
3308
3618
  }
3309
3619
  }
@@ -3567,10 +3877,17 @@ function createBlock(kind, parentBlock, parentNode, startMarker, endMarker, body
3567
3877
  function renderBlock(block) {
3568
3878
  const hydration = activeHydration();
3569
3879
  if (hydration !== null && !hydration.owns(block)) {
3570
- hydration.suspend(() => renderBlockInner(block));
3880
+ hydration.suspend(() => renderBlock(block));
3571
3881
  return;
3572
3882
  }
3573
- renderBlockInner(block);
3883
+ let retries = 0;
3884
+ while (renderBlockInner(block)) {
3885
+ if (block.nestedUpdateError) {
3886
+ block.nestedUpdateError = false;
3887
+ throw maximumUpdateDepthError();
3888
+ }
3889
+ if (++retries > RENDER_PHASE_UPDATE_LIMIT) throw new Error((0, import_error_codes_client_generated.formatClientError)(9));
3890
+ }
3574
3891
  }
3575
3892
  function enqueueEffectEventUpdate(entry) {
3576
3893
  EFFECT_EVENT_RENDER_TARGET.push(entry);
@@ -3595,6 +3912,45 @@ function recordCapturedRender(capture, block) {
3595
3912
  (capture.renderedBlocks ??= /* @__PURE__ */ new Set()).add(block);
3596
3913
  }
3597
3914
  }
3915
+ function beginUrgentTransitionRender(block, render) {
3916
+ const slots = /* @__PURE__ */ new Map();
3917
+ for (const entries of FLUSHED_TRANSITION_UPDATES) {
3918
+ for (const update of entries) {
3919
+ if (update.block !== block || update.superseded) continue;
3920
+ const previous = slots.get(update.slot);
3921
+ if (previous !== void 0) {
3922
+ render.cells[previous].update = update;
3923
+ } else {
3924
+ slots.set(update.slot, render.cells.length);
3925
+ render.cells.push({
3926
+ update,
3927
+ baseValue: update.baseValue,
3928
+ value: update.slot.value,
3929
+ hook: void 0
3930
+ });
3931
+ }
3932
+ }
3933
+ }
3934
+ for (const cell of render.cells) {
3935
+ cell.hook = beginUrgentTransitionCell(cell.update);
3936
+ if (cell.hook === null) cell.update.slot.value = cell.baseValue;
3937
+ }
3938
+ }
3939
+ function endUrgentTransitionRender(block, render) {
3940
+ for (let i = render.cells.length - 1; i >= 0; i--) {
3941
+ const cell = render.cells[i];
3942
+ if (cell.hook === void 0) continue;
3943
+ if (cell.hook !== null) endUrgentTransitionCell(cell.hook);
3944
+ else if (!block.disposed && !cell.update.superseded && Object.is(cell.update.slot.value, cell.baseValue))
3945
+ cell.update.slot.value = cell.value;
3946
+ }
3947
+ if (block.disposed || block.pending && block.pendingMode === "urgent") return;
3948
+ if (render.cells.length !== 0 && render.cells.every((cell) => cell.update.superseded)) return;
3949
+ block.pending = true;
3950
+ block.pendingMode = "transition";
3951
+ block.pendingDeferred = render.pendingDeferred;
3952
+ if (render.queueEpoch !== QUEUE_REINDEX_EPOCH && !QUEUE.includes(block)) QUEUE.push(block);
3953
+ }
3598
3954
  function renderBlockInner(block) {
3599
3955
  if (block.renderStatus === RENDER_INVALID) block.renderStatus = RENDER_RETRYING;
3600
3956
  if (WIP_CAPTURE !== null) recordCapturedRender(WIP_CAPTURE, block);
@@ -3618,6 +3974,8 @@ function renderBlockInner(block) {
3618
3974
  CURRENT_EFFECT_RENDER_VERSION = block.effectSlots === null ? 0 : NEXT_EFFECT_RENDER_VERSION++;
3619
3975
  CURRENT_EFFECT_REACHED = 0;
3620
3976
  const continuesParentTree = prevBlock !== null && blockIsAncestor(prevBlock, block);
3977
+ const urgentTransitionDriver = block.pending && block.pendingMode === "transition" && continuesParentTree && prevBlock.currentRenderMode === "urgent" ? TRANSITION_SWAP_DRIVER : null;
3978
+ const urgentTransitionRender = urgentTransitionDriver === null ? null : { pendingDeferred: block.pendingDeferred, queueEpoch: QUEUE_REINDEX_EPOCH, cells: [] };
3621
3979
  if (!continuesParentTree) {
3622
3980
  const replayEpisode = prevBlock === null && RESUME_REPLAY ? block.__warmEpisode : void 0;
3623
3981
  CURRENT_WARM_EPISODE = typeof replayEpisode === "number" ? replayEpisode : NEXT_WARM_EPISODE++;
@@ -3629,6 +3987,7 @@ function renderBlockInner(block) {
3629
3987
  EFFECT_EVENT_ACTION_TARGET = effectEventActionTarget;
3630
3988
  if (block.effectEventRenderVersion !== 0) block.effectEventRenderVersion++;
3631
3989
  block.pending = false;
3990
+ block.crossRenderUpdate = false;
3632
3991
  block.__thenableIdx = 0;
3633
3992
  {
3634
3993
  const tState = block.__thenables;
@@ -3639,22 +3998,29 @@ function renderBlockInner(block) {
3639
3998
  }
3640
3999
  if (block.$$ctxReads !== null) block.$$ctxReads.clear();
3641
4000
  if (block.$$ctxDirect !== null) block.$$ctxDirect.clear();
3642
- block.currentRenderMode = block.pendingMode ?? prevBlock?.currentRenderMode ?? "urgent";
3643
- block.currentRenderDeferred = block.pendingMode !== null ? block.pendingDeferred : prevBlock?.currentRenderDeferred ?? false;
4001
+ block.currentRenderMode = urgentTransitionRender !== null ? "urgent" : block.pendingMode ?? prevBlock?.currentRenderMode ?? "urgent";
4002
+ block.currentRenderDeferred = urgentTransitionRender !== null ? false : block.pendingMode !== null ? block.pendingDeferred : prevBlock?.currentRenderDeferred ?? false;
3644
4003
  block.pendingMode = null;
3645
4004
  block.pendingDeferred = false;
3646
4005
  const profileFrame = typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__ && (block.kind === "root" || block.kind === "dynamic" || block.kind === "portal") ? (0, import_profiling.__profileBeginRender)(block, block.body, block.mounted) : null;
3647
4006
  let profileDidThrow = false;
3648
4007
  let profileThrown;
3649
4008
  let renderCompleted = false;
4009
+ let renderRetry = false;
3650
4010
  NATIVE_READ_DRIVER?.beginRender(block);
3651
4011
  NATIVE_BLOCK_RETRIES?.get(block)?.clear();
3652
4012
  try {
4013
+ if (urgentTransitionRender !== null)
4014
+ urgentTransitionDriver.beginUrgent(block, urgentTransitionRender);
3653
4015
  const out = block.body(
3654
4016
  block.props,
3655
4017
  block,
3656
4018
  block.extra
3657
4019
  );
4020
+ if (block.pending && !block.crossRenderUpdate) {
4021
+ renderRetry = true;
4022
+ return true;
4023
+ }
3658
4024
  if (out !== void 0 && block.outputHandler !== null) block.outputHandler(block, out);
3659
4025
  finishEffectRender(block);
3660
4026
  if (!block.mounted) block.mounted = true;
@@ -3680,6 +4046,7 @@ function renderBlockInner(block) {
3680
4046
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__ && profileFrame !== null)
3681
4047
  (0, import_profiling.__profileEndRender)(profileFrame, profileDidThrow, profileThrown);
3682
4048
  if (!renderCompleted) {
4049
+ if (renderRetry) block.renderStatus = RENDER_INVALID;
3683
4050
  if (block.renderStatus !== RENDER_INVALID) {
3684
4051
  let owner = null;
3685
4052
  const suspension = isSuspenseException(profileThrown);
@@ -3705,7 +4072,12 @@ function renderBlockInner(block) {
3705
4072
  CURRENT_EFFECT_REACHED = prevEffectReached;
3706
4073
  CURRENT_SCOPE = prevScope;
3707
4074
  CURRENT_BLOCK = prevBlock;
3708
- NATIVE_READ_DRIVER?.endRender(block, renderCompleted, isSuspenseException(profileThrown));
4075
+ try {
4076
+ NATIVE_READ_DRIVER?.endRender(block, renderCompleted, isSuspenseException(profileThrown));
4077
+ } finally {
4078
+ if (urgentTransitionRender !== null)
4079
+ urgentTransitionDriver.endUrgent(block, urgentTransitionRender);
4080
+ }
3709
4081
  }
3710
4082
  }
3711
4083
  function returnSlotTail(block, state) {
@@ -3912,6 +4284,7 @@ class LiteBlockImpl {
3912
4284
  }
3913
4285
  }
3914
4286
  function componentSlotLite(parentScope, slotKey, host, comp, props, anchor) {
4287
+ if (CURRENT_BLOCK?.pending && !CURRENT_BLOCK.crossRenderUpdate) return;
3915
4288
  const hydration = activeHydration();
3916
4289
  let scope = parentScope.slots[slotKey];
3917
4290
  let adoptedOpen = null;
@@ -4075,7 +4448,7 @@ function unmountScope(scope, detachDom = true) {
4075
4448
  if (!passiveScheduled) schedulePassiveFlush();
4076
4449
  } else {
4077
4450
  try {
4078
- runEffectCleanupCallback(cleanup);
4451
+ runEffectCleanupCallback(cleanup, slot.phase);
4079
4452
  } catch (err) {
4080
4453
  reportTeardownError(err);
4081
4454
  }
@@ -4150,12 +4523,66 @@ function missingSlot(name) {
4150
4523
  throw new Error((0, import_error_codes_client_generated.formatClientError)(15, name));
4151
4524
  }
4152
4525
  const slotStack = [];
4526
+ let MANUAL_HOOK_DRIVER = null;
4527
+ function invokeManualHook(fn, receiver, args) {
4528
+ const driver = MANUAL_HOOK_DRIVER ??= {
4529
+ pending: slotStack[slotStack.length - 1],
4530
+ active: false
4531
+ };
4532
+ const pending = driver.pending;
4533
+ const active = driver.active;
4534
+ driver.pending = void 0;
4535
+ driver.active = true;
4536
+ try {
4537
+ if (pending === void 0) return Reflect.apply(fn, receiver, args);
4538
+ switch (args.length) {
4539
+ case 0:
4540
+ return fn.call(receiver, pending);
4541
+ case 1:
4542
+ return fn.call(receiver, args[0], pending);
4543
+ case 2:
4544
+ return fn.call(receiver, args[0], args[1], pending);
4545
+ case 3:
4546
+ return fn.call(receiver, args[0], args[1], args[2], pending);
4547
+ case 4:
4548
+ return fn.call(receiver, args[0], args[1], args[2], args[3], pending);
4549
+ default: {
4550
+ const forwarded = new Array(args.length + 1);
4551
+ for (let index = 0; index < args.length; index++) forwarded[index] = args[index];
4552
+ forwarded[args.length] = pending;
4553
+ return fn.apply(receiver, forwarded);
4554
+ }
4555
+ }
4556
+ } finally {
4557
+ driver.pending = pending;
4558
+ driver.active = active;
4559
+ }
4560
+ }
4561
+ function manualHook(fn, name) {
4562
+ function provider() {
4563
+ return invokeManualHook(fn, this, arguments);
4564
+ }
4565
+ Object.defineProperty(provider, "name", { value: name ?? fn.name, configurable: true });
4566
+ Object.defineProperty(provider, "length", { value: fn.length, configurable: true });
4567
+ return provider;
4568
+ }
4153
4569
  function withSlot(sym, fn, ...args) {
4570
+ const driver = MANUAL_HOOK_DRIVER;
4571
+ const pending = driver?.pending;
4572
+ const active = driver?.active ?? false;
4573
+ if (driver !== null) {
4574
+ driver.pending = sym;
4575
+ driver.active = false;
4576
+ }
4154
4577
  slotStack.push(sym);
4155
4578
  try {
4156
4579
  return fn(...args);
4157
4580
  } finally {
4158
4581
  slotStack.pop();
4582
+ if (MANUAL_HOOK_DRIVER !== null) {
4583
+ MANUAL_HOOK_DRIVER.pending = driver === null ? slotStack[slotStack.length - 1] : pending;
4584
+ MANUAL_HOOK_DRIVER.active = active;
4585
+ }
4159
4586
  }
4160
4587
  }
4161
4588
  function appendSlotKey(key, slot) {
@@ -4186,7 +4613,7 @@ function nativeLocalHook(name, initialize, dispose, slot) {
4186
4613
  return cell.nativeValue;
4187
4614
  }
4188
4615
  function useState(initial, slot) {
4189
- if (slot === void 0 && typeof initial === "symbol") {
4616
+ if (slot === void 0 && typeof initial === "symbol" && arguments.length === 1 && (slotStack.length === 0 || MANUAL_HOOK_DRIVER?.active === true)) {
4190
4617
  slot = initial;
4191
4618
  initial = void 0;
4192
4619
  }
@@ -4200,16 +4627,44 @@ function useState(initial, slot) {
4200
4627
  s = {
4201
4628
  value: initVal,
4202
4629
  setter: (next) => {
4203
- const previous = stagedTransitionValue(s);
4204
- const computed = typeof next === "function" ? next(previous) : next;
4205
- if (Object.is(computed, previous)) return;
4206
- if (stageTransitionValue(s, block, next, computed)) {
4630
+ if (block.disposed) return;
4631
+ if (s.pendingActionBatch !== void 0 && transitionActionBatchForUpdate() === null)
4632
+ recordUrgentActionUpdate(s, next);
4633
+ if ((s.updates !== void 0 || s.renderTransition !== void 0 || typeof next === "function" && TRANSITION_PENDING_COUNT > 0 && TRANSITION_SWAP_DRIVER?.hasHeld(s, block) || block.pending && typeof next === "function") && transitionActionBatchForUpdate() === null) {
4634
+ (s.updates ??= []).push(next);
4635
+ scheduleRender(block);
4636
+ return;
4637
+ }
4638
+ const previous = stagedTransitionValue(s, block);
4639
+ let computed;
4640
+ let failed = false;
4641
+ try {
4642
+ computed = typeof next === "function" ? next(previous) : next;
4643
+ } catch {
4644
+ if (transitionActionBatchForUpdate() === null) {
4645
+ (s.updates ??= []).push(next);
4646
+ scheduleRender(block);
4647
+ return;
4648
+ }
4649
+ computed = previous;
4650
+ failed = true;
4651
+ }
4652
+ const forceRender = failed || s.updates !== void 0 || s.renderTransition !== void 0 || s.pendingActionBatch !== void 0 || block.pending && typeof next === "function";
4653
+ if (Object.is(computed, previous) && !forceRender) {
4654
+ if (typeof next !== "function" && TRANSITION_SWAP_DRIVER?.cancelEqual(s, block)) {
4655
+ scheduleRender(block);
4656
+ }
4657
+ return;
4658
+ }
4659
+ const update = stageTransitionValue(s, block, next, computed, forceRender);
4660
+ if (update !== null) {
4661
+ if (update.state === void 0) {
4662
+ update.state = s;
4663
+ captureTransitionHookQueue(update, s);
4664
+ }
4207
4665
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__) {
4208
- const update = s.pendingActionBatch?.updates.get(s);
4209
- if (update !== void 0) {
4210
- update.profileType = "state";
4211
- update.profileSlot = slot;
4212
- }
4666
+ update.profileType = "state";
4667
+ update.profileSlot = slot;
4213
4668
  }
4214
4669
  return;
4215
4670
  }
@@ -4221,10 +4676,95 @@ function useState(initial, slot) {
4221
4676
  };
4222
4677
  ensureHooks(scope).set(slot, s);
4223
4678
  }
4679
+ if (s.renderTransition !== void 0 || s.updates !== void 0) {
4680
+ const value = readQueuedState(s);
4681
+ if (!s.urgentTransition && s.updates !== void 0 && Object.is(value, s.value))
4682
+ TRANSITION_SWAP_DRIVER?.rebaseHeld(s, block, s.updates);
4683
+ s.value = value;
4684
+ if (!s.urgentTransition) {
4685
+ if (s.renderTransition !== void 0) {
4686
+ finishQueuedTransition(s.renderTransition, s.value);
4687
+ s.renderTransition = void 0;
4688
+ }
4689
+ s.updates = void 0;
4690
+ }
4691
+ }
4224
4692
  return [s.value, s.setter];
4225
4693
  }
4694
+ function readQueuedState(state) {
4695
+ const transition = state.renderTransition;
4696
+ let value = transition === void 0 ? state.value : readQueuedTransition(transition, state.urgentTransition === true);
4697
+ if (state.updates !== void 0) {
4698
+ for (const update of state.updates)
4699
+ value = typeof update === "function" ? update(value) : update;
4700
+ }
4701
+ return value;
4702
+ }
4703
+ function readQueuedTransition(last, urgent, reducer) {
4704
+ let first = last;
4705
+ while (first.previous !== void 0) first = first.previous;
4706
+ let value = first.replayBaseValue;
4707
+ for (let entry = first; ; entry = entry.next) {
4708
+ if (entry.stateUpdates !== void 0) {
4709
+ for (const update of entry.stateUpdates)
4710
+ value = typeof update === "function" ? update(value) : update;
4711
+ }
4712
+ if (entry.reducerActions !== void 0) {
4713
+ for (const action of entry.reducerActions) value = reducer(value, action);
4714
+ }
4715
+ if ((urgent || entry.superseded) && entry.urgentOperations !== void 0) {
4716
+ for (const index of entry.urgentOperations) value = entry.operations[index](value);
4717
+ } else if (!urgent && !entry.superseded) {
4718
+ for (const operation of entry.operations) value = operation(value);
4719
+ }
4720
+ if (entry === last) return value;
4721
+ }
4722
+ }
4723
+ function captureTransitionHookQueue(update, cell) {
4724
+ update.replayBaseValue = cell.value;
4725
+ const previous = cell.renderTransition ?? TRANSITION_SWAP_DRIVER?.heldUpdate(cell, update.block);
4726
+ if (previous !== void 0) {
4727
+ update.previous = previous;
4728
+ previous.next = update;
4729
+ }
4730
+ if (update.state !== void 0) update.stateUpdates = update.state.updates?.slice();
4731
+ else update.reducerActions = update.reducer.renderPhaseActions?.slice();
4732
+ }
4733
+ function recordUrgentActionUpdate(cell, operation) {
4734
+ const update = cell.pendingActionBatch.updates.get(cell);
4735
+ if (update === void 0) return;
4736
+ (update.urgentOperations ??= []).push(update.operations.length);
4737
+ update.operations.push(
4738
+ typeof operation === "function" ? operation : () => operation
4739
+ );
4740
+ update.forceRender = true;
4741
+ }
4742
+ function finishQueuedTransition(last, value) {
4743
+ for (let entry = last; entry; entry = entry.previous) {
4744
+ entry.value = value;
4745
+ if (entry !== last && Object.is(value, entry.baseValue)) entry.superseded = true;
4746
+ }
4747
+ }
4748
+ function beginUrgentTransitionCell(update) {
4749
+ const cell = update.state ?? update.reducer;
4750
+ if (update.block.disposed || update.superseded || cell === void 0 || cell.renderTransition === void 0)
4751
+ return null;
4752
+ cell.urgentTransition = true;
4753
+ cell.value = update.baseValue;
4754
+ return { update, cell };
4755
+ }
4756
+ function endUrgentTransitionCell(snapshot) {
4757
+ const { update, cell } = snapshot;
4758
+ cell.urgentTransition = false;
4759
+ if (update.block.disposed || update.superseded) {
4760
+ cell.renderTransition = void 0;
4761
+ return;
4762
+ }
4763
+ for (let entry = update; entry; entry = entry.previous)
4764
+ entry.baseValue = cell.value;
4765
+ }
4226
4766
  function __useStateWithGetter(initial, slot) {
4227
- if (slot === void 0 && typeof initial === "symbol") {
4767
+ if (slot === void 0 && typeof initial === "symbol" && arguments.length === 1 && (slotStack.length === 0 || MANUAL_HOOK_DRIVER?.active === true)) {
4228
4768
  slot = initial;
4229
4769
  initial = void 0;
4230
4770
  }
@@ -4234,9 +4774,9 @@ function __useStateWithGetter(initial, slot) {
4234
4774
  const s = CURRENT_SCOPE.hooks.get(resolved);
4235
4775
  const getter = s.getter ?? (s.getter = () => {
4236
4776
  const batch = s.pendingActionBatch;
4237
- if (batch === void 0) return s.value;
4777
+ if (batch === void 0) return readQueuedState(s);
4238
4778
  const update = batch.updates.get(s);
4239
- return update === void 0 ? s.value : rebaseTransitionActionUpdate(update);
4779
+ return update === void 0 ? readQueuedState(s) : readQueuedTransition(update, false);
4240
4780
  });
4241
4781
  return [pair[0], pair[1], getter];
4242
4782
  }
@@ -4336,13 +4876,11 @@ function useLinkedState(source, reconcile, options, slot) {
4336
4876
  else scheduleRender(block);
4337
4877
  return;
4338
4878
  }
4339
- if (stageTransitionValue(state, block, operation, computed)) {
4879
+ const update = stageTransitionValue(state, block, operation, computed);
4880
+ if (update !== null) {
4340
4881
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__) {
4341
- const update = state.pendingActionBatch?.updates.get(state);
4342
- if (update !== void 0) {
4343
- update.profileType = "state";
4344
- update.profileSlot = slot;
4345
- }
4882
+ update.profileType = "state";
4883
+ update.profileSlot = slot;
4346
4884
  }
4347
4885
  return;
4348
4886
  }
@@ -4460,26 +4998,31 @@ function useReducer(reducer, initialArg, initOrSlot, slot) {
4460
4998
  // the component once (children then bail as usual). Per
4461
4999
  // ReactHooksWithNoopRenderer-test.js:3889.
4462
5000
  dispatch: (action) => {
4463
- if (CURRENT_BLOCK === block) {
5001
+ if (block.disposed) return;
5002
+ if (CURRENT_BLOCK === block || transitionActionBatchForUpdate() === null) {
5003
+ if (s.pendingActionBatch !== void 0 && transitionActionBatchForUpdate() === null)
5004
+ recordUrgentActionUpdate(s, (value) => s.reducer(value, action));
4464
5005
  const actions = s.renderPhaseActions ??= [];
4465
- const previous2 = actions.length === 0 ? s.value : s.renderPhaseValue;
4466
5006
  actions.push(action);
4467
- if (s.getter !== void 0) {
4468
- s.renderPhaseValue = s.reducer(previous2, action);
4469
- }
4470
5007
  scheduleRender(block);
4471
5008
  return;
4472
5009
  }
4473
- const previous = stagedTransitionValue(s);
5010
+ const previous = stagedTransitionValue(s, block);
4474
5011
  const operation = (value) => s.reducer(value, action);
4475
- const computed = operation(previous);
4476
- if (stageTransitionValue(s, block, operation, computed, true)) {
5012
+ let computed = previous;
5013
+ try {
5014
+ computed = operation(previous);
5015
+ } catch {
5016
+ }
5017
+ const update = stageTransitionValue(s, block, operation, computed, true);
5018
+ if (update !== null) {
5019
+ if (update.reducer === void 0) {
5020
+ update.reducer = s;
5021
+ captureTransitionHookQueue(update, s);
5022
+ }
4477
5023
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__) {
4478
- const update = s.pendingActionBatch?.updates.get(s);
4479
- if (update !== void 0) {
4480
- update.profileType = "reducer";
4481
- update.profileSlot = slot;
4482
- }
5024
+ update.profileType = "reducer";
5025
+ update.profileSlot = slot;
4483
5026
  }
4484
5027
  return;
4485
5028
  }
@@ -4492,17 +5035,32 @@ function useReducer(reducer, initialArg, initOrSlot, slot) {
4492
5035
  ensureHooks(scope).set(slot, s);
4493
5036
  } else {
4494
5037
  s.reducer = reducer;
4495
- const actions = s.renderPhaseActions;
4496
- if (actions !== void 0) {
4497
- let value = s.value;
4498
- for (let i = 0; i < actions.length; i++) value = reducer(value, actions[i]);
5038
+ if (s.renderTransition !== void 0 || s.renderPhaseActions !== void 0) {
5039
+ const value = readQueuedReducer(s);
5040
+ if (!s.urgentTransition && s.renderPhaseActions !== void 0 && Object.is(value, s.value))
5041
+ TRANSITION_SWAP_DRIVER?.rebaseHeld(s, block, s.renderPhaseActions, reducer);
4499
5042
  s.value = value;
4500
- s.renderPhaseActions = void 0;
4501
- s.renderPhaseValue = void 0;
5043
+ if (!s.urgentTransition) {
5044
+ if (s.renderTransition !== void 0) {
5045
+ finishQueuedTransition(s.renderTransition, s.value);
5046
+ s.renderTransition = void 0;
5047
+ }
5048
+ s.renderPhaseActions = void 0;
5049
+ }
4502
5050
  }
4503
5051
  }
4504
5052
  return [s.value, s.dispatch];
4505
5053
  }
5054
+ function readQueuedReducer(state) {
5055
+ let value = state.renderTransition === void 0 ? state.value : readQueuedTransition(
5056
+ state.renderTransition,
5057
+ state.urgentTransition === true,
5058
+ state.reducer
5059
+ );
5060
+ if (state.renderPhaseActions !== void 0)
5061
+ for (const action of state.renderPhaseActions) value = state.reducer(value, action);
5062
+ return value;
5063
+ }
4506
5064
  function __useReducerWithGetter(reducer, initialArg, initOrSlot, slot) {
4507
5065
  const resolvedInput = typeof initOrSlot === "symbol" ? initOrSlot : slot;
4508
5066
  const pair = useReducer(reducer, initialArg, initOrSlot, slot);
@@ -4510,18 +5068,26 @@ function __useReducerWithGetter(reducer, initialArg, initOrSlot, slot) {
4510
5068
  if (resolved === void 0) missingSlot("useReducer");
4511
5069
  const s = CURRENT_SCOPE.hooks.get(resolved);
4512
5070
  const getter = s.getter ?? (s.getter = () => {
4513
- if (s.renderPhaseActions !== void 0) return s.renderPhaseValue;
4514
5071
  const batch = s.pendingActionBatch;
4515
- if (batch === void 0) return s.value;
5072
+ if (batch === void 0) return readQueuedReducer(s);
4516
5073
  const update = batch.updates.get(s);
4517
- return update === void 0 ? s.value : rebaseTransitionActionUpdate(update);
5074
+ return update === void 0 ? readQueuedReducer(s) : readQueuedTransition(update, false, s.reducer);
4518
5075
  });
4519
5076
  return [pair[0], pair[1], getter];
4520
5077
  }
4521
- function depsChanged(prev, next) {
5078
+ function depsChanged(prev, next, hook = false) {
4522
5079
  if (prev === void 0 || next === void 0) return true;
4523
- if (prev.length !== next.length) return true;
4524
- for (let i = 0; i < prev.length; i++) {
5080
+ let length = prev.length;
5081
+ if (length !== next.length) {
5082
+ if (!hook) return true;
5083
+ if (process.env.NODE_ENV !== "production") {
5084
+ console.error(
5085
+ `The dependency array must keep the same length between renders (previous: ${length}, next: ${next.length}).`
5086
+ );
5087
+ }
5088
+ length = Math.min(length, next.length);
5089
+ }
5090
+ for (let i = 0; i < length; i++) {
4525
5091
  if (!Object.is(prev[i], next[i])) return true;
4526
5092
  }
4527
5093
  return false;
@@ -4588,7 +5154,7 @@ function enqueueEffect(slot, fn, deps, phase) {
4588
5154
  return;
4589
5155
  }
4590
5156
  if (prev) {
4591
- const changed = depsChanged(prev.deps, deps);
5157
+ const changed = depsChanged(prev.deps, deps, true);
4592
5158
  if (prev.active && !changed) return;
4593
5159
  if (ROOT_RENDER_TRANSACTION !== null) journalObjectOnce(prev);
4594
5160
  let reactivated = false;
@@ -4692,7 +5258,7 @@ function adoptMemoEntry(scope, slot, deps) {
4692
5258
  }
4693
5259
  function readMemoEntry(scope, slot, deps) {
4694
5260
  const prev = scope.hooks?.get(slot);
4695
- if (prev && deps !== void 0 && !depsChanged(prev.deps, deps)) {
5261
+ if (prev && deps !== void 0 && !depsChanged(prev.deps, deps, true)) {
4696
5262
  return memoEntryHit(slot, prev);
4697
5263
  }
4698
5264
  return WARM_EVER && deps !== void 0 ? adoptMemoEntry(scope, slot, deps) : null;
@@ -4707,12 +5273,21 @@ function publishMemoEntry(scope, slot, deps, value, nativeWitness) {
4707
5273
  }
4708
5274
  return value;
4709
5275
  }
5276
+ let devMemoComputeDepth = 0;
5277
+ function computeMemoWithDiagnostics(compute, deps) {
5278
+ devMemoComputeDepth++;
5279
+ try {
5280
+ return compute.apply(null, deps ?? []);
5281
+ } finally {
5282
+ devMemoComputeDepth--;
5283
+ }
5284
+ }
4710
5285
  function useMemo(compute, deps, slot) {
4711
5286
  const [d, s] = resolveHookArgs("useMemo", deps, slot);
4712
5287
  const scope = CURRENT_SCOPE;
4713
5288
  const entry = readMemoEntry(scope, s, d);
4714
5289
  if (entry !== null) return entry.value;
4715
- const value = compute.apply(null, d ?? []);
5290
+ const value = process.env.NODE_ENV !== "production" ? computeMemoWithDiagnostics(compute, d) : compute.apply(null, d ?? []);
4716
5291
  return publishMemoEntry(scope, s, d, value);
4717
5292
  }
4718
5293
  function useCallback(fn, deps, slot) {
@@ -4784,7 +5359,7 @@ function hookMemoPublishInvariant(cells, base, value) {
4784
5359
  return value;
4785
5360
  }
4786
5361
  function useRef(initial, slot) {
4787
- if (slot === void 0 && typeof initial === "symbol") {
5362
+ if (slot === void 0 && typeof initial === "symbol" && arguments.length === 1 && (slotStack.length === 0 || MANUAL_HOOK_DRIVER?.active === true)) {
4788
5363
  slot = initial;
4789
5364
  initial = void 0;
4790
5365
  }
@@ -4898,13 +5473,33 @@ function subscribeToStore(inst, subscribe) {
4898
5473
  if (checkStoreChanged(inst)) inst.forceUpdate();
4899
5474
  return subscribe(inst.onStoreChange);
4900
5475
  }
5476
+ function scheduleStoreRender(block) {
5477
+ const depth = TRANSITION_DEPTH;
5478
+ const asyncCount = ASYNC_TRANSITION_COUNT;
5479
+ TRANSITION_DEPTH = 0;
5480
+ ASYNC_TRANSITION_COUNT = 0;
5481
+ try {
5482
+ scheduleRender(block);
5483
+ } finally {
5484
+ TRANSITION_DEPTH = depth;
5485
+ ASYNC_TRANSITION_COUNT = asyncCount;
5486
+ }
5487
+ }
5488
+ let DID_WARN_UNCACHED_SNAPSHOT = false;
4901
5489
  function useSyncExternalStore(subscribe, getSnapshot, ...rest) {
4902
5490
  let slot = rest[rest.length - 1];
4903
5491
  slot = resolveSlot(slot);
4904
5492
  if (slot === void 0) missingSlot("useSyncExternalStore");
4905
5493
  const getServerSnapshot = rest.length >= 2 ? rest[0] : void 0;
4906
5494
  const subs = usesSubslots(slot);
4907
- const value = activeHydration() !== null && getServerSnapshot !== void 0 ? getServerSnapshot() : getSnapshot();
5495
+ const readSnapshot = activeHydration() !== null && getServerSnapshot !== void 0 ? getServerSnapshot : getSnapshot;
5496
+ const value = readSnapshot();
5497
+ if (process.env.NODE_ENV !== "production" && !DID_WARN_UNCACHED_SNAPSHOT && !Object.is(value, readSnapshot())) {
5498
+ DID_WARN_UNCACHED_SNAPSHOT = true;
5499
+ console.error(
5500
+ "The " + (readSnapshot === getSnapshot ? "getSnapshot" : "getServerSnapshot") + " result must be cached to avoid an infinite update loop."
5501
+ );
5502
+ }
4908
5503
  const scope = CURRENT_SCOPE;
4909
5504
  let inst = scope.hooks?.get(subs.inst);
4910
5505
  if (inst === void 0) {
@@ -4916,11 +5511,11 @@ function useSyncExternalStore(subscribe, getSnapshot, ...rest) {
4916
5511
  subscribe,
4917
5512
  forceUpdate: typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__ ? () => {
4918
5513
  if (!block.disposed) (0, import_profiling.__profileSchedule)(block, "external-store", slot);
4919
- scheduleRender(block);
4920
- } : () => scheduleRender(block),
5514
+ scheduleStoreRender(block);
5515
+ } : () => scheduleStoreRender(block),
4921
5516
  onStoreChange: () => {
4922
5517
  if (block.disposed) return;
4923
- if (CURRENT_BLOCK === null && block.pending && block.pendingMode === "urgent" && !block.pendingDeferred && !(typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__) && (process.env.NODE_ENV === "production" || !IS_OCTANE_ACT_ENVIRONMENT || actScopeDepth !== 0 || syncFlush)) {
5518
+ if (CURRENT_BLOCK === null && block.pending && block.pendingMode === "urgent" && !block.pendingDeferred && !(typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__) && (process.env.NODE_ENV === "production" || !isActEnvironment() || actScopeDepth !== 0 || syncFlush)) {
4924
5519
  return;
4925
5520
  }
4926
5521
  if (checkStoreChanged(created)) created.forceUpdate();
@@ -6084,7 +6679,8 @@ const Suspense = /* @__PURE__ */ (0, import_component_flags.markComponentFlags)(
6084
6679
  );
6085
6680
  },
6086
6681
  import_component_flags.COMPONENT_FLAG_BOUNDARY,
6087
- "Suspense"
6682
+ "Suspense",
6683
+ /* @__PURE__ */ Symbol.for("octane.suspense")
6088
6684
  );
6089
6685
  function initializeViewTransitionComponent() {
6090
6686
  return (0, import_component_flags.markComponentFlags)(
@@ -6131,6 +6727,11 @@ const ErrorBoundary = /* @__PURE__ */ (0, import_component_flags.markComponentFl
6131
6727
  );
6132
6728
  const TsrxErrorBoundary = ErrorBoundary;
6133
6729
  function use(usable) {
6730
+ if (process.env.NODE_ENV !== "production" && devMemoComputeDepth !== 0) {
6731
+ console.error(
6732
+ "Do not call use() inside a useMemo() factory. Cached factories can skip context or promise reads; call use() before useMemo() and memoize the returned value instead."
6733
+ );
6734
+ }
6134
6735
  if (usable && usable.$$kind === CONTEXT_TAG) {
6135
6736
  return useContextInternal(usable);
6136
6737
  }
@@ -6831,6 +7432,15 @@ function warmChild(comp, props) {
6831
7432
  WARM_DEPTH--;
6832
7433
  }
6833
7434
  }
7435
+ function markWarm(component, plan) {
7436
+ Object.defineProperty(component, "__warm", {
7437
+ configurable: true,
7438
+ get() {
7439
+ return this === component ? plan : void 0;
7440
+ }
7441
+ });
7442
+ return component;
7443
+ }
6834
7444
  function adoptWarmEntry(slot, deps, accept) {
6835
7445
  let b = CURRENT_BLOCK;
6836
7446
  while (b !== null) {
@@ -7129,6 +7739,8 @@ function lazy(load) {
7129
7739
  let thenable = null;
7130
7740
  let profiledComponent = null;
7131
7741
  let memoMetadataInstalled = false;
7742
+ let displayName;
7743
+ let resolvedName = "Lazy";
7132
7744
  let lazyWrapper;
7133
7745
  const initializeLazy = () => {
7134
7746
  if (status !== "uninitialized") return;
@@ -7161,16 +7773,23 @@ function lazy(load) {
7161
7773
  };
7162
7774
  const callResolvedComponent = (props, scope, extra) => {
7163
7775
  const comp = resolveLazyModule(result);
7776
+ resolvedName = comp.displayName || comp.name || "Lazy";
7164
7777
  if (comp.__memo === true) {
7165
7778
  if (!memoMetadataInstalled) {
7166
- lazyWrapper.__memo = true;
7167
- lazyWrapper.__compare = (prev, next) => {
7168
- const current = resolveLazyModule(result);
7169
- const compare = current.__compare;
7170
- const previous = (0, import_shared_value_helpers.resolveLazyDefaultProps)(current, prev);
7171
- const incoming = (0, import_shared_value_helpers.resolveLazyDefaultProps)(current, next);
7172
- return compare ? compare(previous, incoming) : shallowEqualProps(previous, incoming);
7173
- };
7779
+ Object.defineProperty(lazyWrapper, "__memo", {
7780
+ get() {
7781
+ return this === lazyWrapper;
7782
+ }
7783
+ });
7784
+ Object.defineProperty(lazyWrapper, "__compare", {
7785
+ value: (prev, next) => {
7786
+ const current = resolveLazyModule(result);
7787
+ const compare = current.__compare;
7788
+ const previous = (0, import_shared_value_helpers.resolveLazyDefaultProps)(current, prev);
7789
+ const incoming = (0, import_shared_value_helpers.resolveLazyDefaultProps)(current, next);
7790
+ return compare ? compare(previous, incoming) : shallowEqualProps(previous, incoming);
7791
+ }
7792
+ });
7174
7793
  memoMetadataInstalled = true;
7175
7794
  }
7176
7795
  scope.block.memoInChain = true;
@@ -7200,10 +7819,22 @@ function lazy(load) {
7200
7819
  }
7201
7820
  if (settledStatus === "rejected") throw result;
7202
7821
  }
7822
+ runActiveWarmPlans();
7203
7823
  throw new SuspenseException(thenable);
7204
7824
  };
7205
- lazyWrapper.__warm = initializeLazy;
7206
- Object.defineProperty(lazyWrapper, LAZY_COMPONENT, { value: true });
7825
+ markWarm(lazyWrapper, initializeLazy);
7826
+ Object.defineProperty(lazyWrapper, LAZY_COMPONENT, {
7827
+ get() {
7828
+ return this === lazyWrapper;
7829
+ }
7830
+ });
7831
+ Object.defineProperty(lazyWrapper, "displayName", {
7832
+ configurable: true,
7833
+ get: () => displayName ?? resolvedName,
7834
+ set: (value) => {
7835
+ displayName = value;
7836
+ }
7837
+ });
7207
7838
  return lazyWrapper;
7208
7839
  }
7209
7840
  function useId(slot) {
@@ -7415,6 +8046,7 @@ class HydrationCapability {
7415
8046
  warnHydrationStructuralMismatch(loc, expected, actual);
7416
8047
  }
7417
8048
  recordTextMismatch(node, loc, server) {
8049
+ if (process.env.NODE_ENV === "production" && ROOT_ERROR_HANDLERS === null) return;
7418
8050
  if (!this.textWarnings.has(node)) this.textWarnings.set(node, { loc, server });
7419
8051
  }
7420
8052
  flushTextWarnings() {
@@ -7422,7 +8054,9 @@ class HydrationCapability {
7422
8054
  if (!this.rootBlock.parentNode.contains(node)) continue;
7423
8055
  const client = node.nodeValue;
7424
8056
  if (pending.server !== client) {
7425
- warnHydrationValueMismatch(pending.loc, "text", pending.server, client);
8057
+ noteRecoverableHydrationError(() => new Error((0, import_error_codes_client_generated.formatClientError)(61)), this.rootBlock);
8058
+ if (process.env.NODE_ENV !== "production")
8059
+ warnHydrationValueMismatch(pending.loc, "text", pending.server, client);
7426
8060
  }
7427
8061
  }
7428
8062
  this.textWarnings.clear();
@@ -7681,10 +8315,20 @@ class HydrationCapability {
7681
8315
  if (first !== null && first.nodeType === 3) {
7682
8316
  const server = first.nodeValue;
7683
8317
  if (server !== text && !isTextParserNormalizedMatch(server, text) && !isHydrationSuppressed(el)) {
7684
- if (process.env.NODE_ENV !== "production")
7685
- this.recordTextMismatch(first, loc || el.__oct_loc, server);
8318
+ this.recordTextMismatch(first, loc || el.__oct_loc, server);
7686
8319
  first.nodeValue = text;
7687
8320
  }
8321
+ if (first.nextSibling !== null) {
8322
+ noteRecoverableHydrationError(() => new Error((0, import_error_codes_client_generated.formatClientError)(62)), this.rootBlock);
8323
+ if (process.env.NODE_ENV !== "production") {
8324
+ warnHydrationStructuralMismatch(
8325
+ loc || el.__oct_loc,
8326
+ "the end of the text element",
8327
+ describeHydrationNode(first.nextSibling)
8328
+ );
8329
+ }
8330
+ while (first.nextSibling !== null) el.removeChild(first.nextSibling);
8331
+ }
7688
8332
  return first;
7689
8333
  }
7690
8334
  if (this.isOpen(first)) {
@@ -7706,8 +8350,7 @@ class HydrationCapability {
7706
8350
  if (server !== text && !isTextParserNormalizedMatch(server, text)) {
7707
8351
  const host2 = posNode.parentNode;
7708
8352
  if (!isHydrationSuppressed(host2)) {
7709
- if (process.env.NODE_ENV !== "production")
7710
- this.recordTextMismatch(posNode, host2 && host2.__oct_loc, server);
8353
+ this.recordTextMismatch(posNode, host2 && host2.__oct_loc, server);
7711
8354
  posNode.nodeValue = text;
7712
8355
  }
7713
8356
  }
@@ -8894,6 +9537,7 @@ function attrNamespace(name) {
8894
9537
  return null;
8895
9538
  }
8896
9539
  function setAttribute(el, name, value) {
9540
+ if (name === "innerText" || name === "textContent") return;
8897
9541
  if (process.env.NODE_ENV !== "production" && el.__oct_loc !== void 0 && !isHtmlCustomElement(el) && typeof el.__oct_custom_is !== "string") {
8898
9542
  const warning = (0, import_aria_diagnostics.isAriaAttributeName)(name) ? (0, import_aria_diagnostics.ariaAttributeWarning)(name, el.localName) : (0, import_host_property_diagnostics.hostPropertyWarning)(name, value, el.localName, el.namespaceURI === SVG_NS);
8899
9543
  if (warning !== null) devWarnAttributeOnce(el, name, warning);
@@ -8931,6 +9575,10 @@ function setAttribute(el, name, value) {
8931
9575
  break;
8932
9576
  case 8:
8933
9577
  if ((name === "multiple" || name === "selected") && !isHtmlCustomElement(el)) {
9578
+ if (name === "selected") {
9579
+ const hydration2 = activeHydration();
9580
+ if (hydration2 !== null && !hydration2.isFresh(el)) return;
9581
+ }
8934
9582
  el[name] = value && typeof value !== "function" && typeof value !== "symbol";
8935
9583
  return;
8936
9584
  }
@@ -9114,7 +9762,7 @@ function setAriaAttribute(el, name, value) {
9114
9762
  const warning = (0, import_aria_diagnostics.ariaAttributeWarning)(name, el.localName);
9115
9763
  if (warning !== null) devWarnAttributeOnce(el, name, warning);
9116
9764
  }
9117
- const next = value == null ? null : String(value);
9765
+ const next = value == null || typeof value === "function" || typeof value === "symbol" ? null : String(value);
9118
9766
  const hydration = activeHydration();
9119
9767
  if (hydration !== null && !hydration.allowAttribute(el, name, next)) return;
9120
9768
  if (TRANSITION_JOURNAL !== null) journalAttr(el, name);
@@ -9123,7 +9771,7 @@ function setAriaAttribute(el, name, value) {
9123
9771
  }
9124
9772
  function coerceAttrValue(el, name, value) {
9125
9773
  if (name.charCodeAt(0) === 97 && name.startsWith("aria-")) {
9126
- return value == null ? null : String(value);
9774
+ return value == null || typeof value === "function" || typeof value === "symbol" ? null : String(value);
9127
9775
  }
9128
9776
  const t = typeof value;
9129
9777
  if (t === "boolean" && (0, import_constants.isEnumeratedBooleanAttr)(name)) return value ? "true" : "false";
@@ -9171,6 +9819,7 @@ function coerceAttrValue(el, name, value) {
9171
9819
  if (import_constants.POSITIVE_NUMERIC_ATTR_PROPS.has(lower) && !(Number(value) >= 1)) {
9172
9820
  return null;
9173
9821
  }
9822
+ if ((lower === "rowspan" || lower === "start") && Number.isNaN(Number(value))) return null;
9174
9823
  if (name.length > 2 && name.charCodeAt(0) === 111 && name.charCodeAt(1) === 110) {
9175
9824
  return null;
9176
9825
  }
@@ -9263,7 +9912,9 @@ function setStyleProperty(el, name, value, staticCss, previous) {
9263
9912
  }
9264
9913
  function applyStyleValue(el, style, value, prev) {
9265
9914
  if (value == null || value === false || value === "") {
9266
- if (prev != null && prev !== false && prev !== "") style.cssText = "";
9915
+ if (prev && typeof prev === "object") {
9916
+ for (const key in prev) style.removeProperty((0, import_css.styleName)(key));
9917
+ } else if (typeof prev === "string") style.cssText = "";
9267
9918
  return;
9268
9919
  }
9269
9920
  if (typeof value === "string") {
@@ -9320,10 +9971,13 @@ function isEventKey(k) {
9320
9971
  const CAPTURE_PREFIX = "$$capture:";
9321
9972
  function jsxEventName(rest) {
9322
9973
  if (rest === "DoubleClick") return "dblclick";
9974
+ if (rest === "Focus") return "focusin";
9975
+ if (rest === "Blur") return "focusout";
9323
9976
  return rest.toLowerCase();
9324
9977
  }
9325
- function eventSlot(name) {
9326
- if (!isEventKey(name)) return null;
9978
+ function eventSlot(name, el) {
9979
+ if (!isEventKey(name) || el !== void 0 && isHtmlCustomElement(el) && !(0, import_event_names.isDelegatedEventProp)(name))
9980
+ return null;
9327
9981
  let rest = name.slice(2);
9328
9982
  let capture = false;
9329
9983
  if (rest.length > 7 && rest.endsWith("Capture") && name !== "onGotPointerCapture" && name !== "onLostPointerCapture") {
@@ -9360,7 +10014,7 @@ function removeHostProp(el, name, prevValue) {
9360
10014
  );
9361
10015
  return;
9362
10016
  }
9363
- const ev = eventSlot(name);
10017
+ const ev = eventSlot(name, el);
9364
10018
  if (ev) setEventHandler(el, ev.key, null);
9365
10019
  else setAttribute(el, name, null);
9366
10020
  }
@@ -9377,8 +10031,8 @@ function snapshotSpread(value) {
9377
10031
  return snapshot;
9378
10032
  }
9379
10033
  function formActionAttributeName(el, name) {
9380
- if (el.localName === "form" && name === "action") return "action";
9381
- if ((el.localName === "button" || el.localName === "input") && (name === "formAction" || name === "formaction"))
10034
+ if (name === "action" && el.localName === "form") return "action";
10035
+ if ((name === "formAction" || name === "formaction") && (el.localName === "button" || el.localName === "input"))
9382
10036
  return "formaction";
9383
10037
  return null;
9384
10038
  }
@@ -9466,7 +10120,7 @@ function setSpread(el, value, prev, mountScope, skipDangerouslySetInnerHTML = fa
9466
10120
  devValidateHostProps(el, Object(value));
9467
10121
  }
9468
10122
  if (value != null && Object.prototype.propertyIsEnumerable.call(Object(value), "suppressHydrationWarning")) {
9469
- el.__oct_suppress = value.suppressHydrationWarning !== false;
10123
+ el.__oct_suppress = value.suppressHydrationWarning === true;
9470
10124
  }
9471
10125
  if (process.env.NODE_ENV !== "production" && value != null && Object.prototype.propertyIsEnumerable.call(Object(value), "suppressNativeChangeWarning")) {
9472
10126
  el.__oct_native_change_suppressed = value.suppressNativeChangeWarning === true;
@@ -9540,7 +10194,7 @@ function setSpread(el, value, prev, mountScope, skipDangerouslySetInnerHTML = fa
9540
10194
  );
9541
10195
  continue;
9542
10196
  }
9543
- const ev = eventSlot(k);
10197
+ const ev = eventSlot(k, el);
9544
10198
  if (ev) {
9545
10199
  if (v === pv) continue;
9546
10200
  if (ev.capture) {
@@ -9572,9 +10226,9 @@ function removeHeadEventListeners(state, attrs) {
9572
10226
  handlers.delete(name);
9573
10227
  }
9574
10228
  }
9575
- function adoptServerHeadEl(key, tag) {
10229
+ function adoptServerHeadEl(head, key, tag) {
9576
10230
  const closeKey = "/" + key;
9577
- for (let n = document.head.firstChild; n !== null; n = n.nextSibling) {
10231
+ for (let n = head.firstChild; n !== null; n = n.nextSibling) {
9578
10232
  if (n.nodeType === 8 && n.data === key) {
9579
10233
  let candidate = n.nextSibling;
9580
10234
  let match = null;
@@ -9610,10 +10264,13 @@ function headBlock(scope, slot, key, tag, attrs, text) {
9610
10264
  if (typeof document === "undefined") return;
9611
10265
  let state = scope.slots[slot];
9612
10266
  if (state === void 0) {
9613
- let el2 = adoptServerHeadEl((0, import_head_ownership.headOwnershipKey)(key, rootIdentifierPrefix(scope.block)), tag);
10267
+ const parent = scope.block.parentNode;
10268
+ const ownerDocument = parent.nodeType === 9 ? parent : parent.ownerDocument;
10269
+ const head = ownerDocument.head;
10270
+ let el2 = adoptServerHeadEl(head, (0, import_head_ownership.headOwnershipKey)(key, rootIdentifierPrefix(scope.block)), tag);
9614
10271
  if (el2 === null) {
9615
- el2 = document.createElement(tag);
9616
- document.head.appendChild(el2);
10272
+ el2 = ownerDocument.createElement(tag);
10273
+ head.appendChild(el2);
9617
10274
  }
9618
10275
  state = { el: el2 };
9619
10276
  scope.slots[slot] = state;
@@ -9738,6 +10395,7 @@ function evt0(el, key, fn) {
9738
10395
  return d;
9739
10396
  }
9740
10397
  function evt0u(d, fn) {
10398
+ if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
9741
10399
  if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
9742
10400
  d.fn = fn;
9743
10401
  }
@@ -9747,6 +10405,7 @@ function evt1(el, key, fn, a0) {
9747
10405
  return d;
9748
10406
  }
9749
10407
  function evt1u(d, fn, a0) {
10408
+ if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
9750
10409
  if (TRANSITION_JOURNAL !== null) {
9751
10410
  journalObjectOnce(d);
9752
10411
  journalObjectOnce(d.args);
@@ -9760,6 +10419,7 @@ function evt2(el, key, fn, a0, a1) {
9760
10419
  return d;
9761
10420
  }
9762
10421
  function evt2u(d, fn, a0, a1) {
10422
+ if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
9763
10423
  if (TRANSITION_JOURNAL !== null) {
9764
10424
  journalObjectOnce(d);
9765
10425
  journalObjectOnce(d.args);
@@ -9775,6 +10435,7 @@ function evtN(el, key, fn, args) {
9775
10435
  return d;
9776
10436
  }
9777
10437
  function evtNu(d, fn, args) {
10438
+ if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
9778
10439
  if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
9779
10440
  d.fn = fn;
9780
10441
  d.args = args;
@@ -10115,6 +10776,28 @@ const CURRENT_TARGET_DESCRIPTOR = {
10115
10776
  }
10116
10777
  };
10117
10778
  const CAPTURE_PATH = [];
10779
+ const CAPTURE_SLOTS = [];
10780
+ function snapshotDelegatedSlots(base, key, event) {
10781
+ const type = event.type;
10782
+ const suppressDisabled = type === "click" || type === "dblclick" || type === "mousedown" || type === "mousemove" || type === "mouseup" || type === "mouseenter" && key[2] !== "c";
10783
+ for (let index = base; index < CAPTURE_PATH.length; index++) {
10784
+ const node = CAPTURE_PATH[index];
10785
+ const slot = node[key];
10786
+ CAPTURE_SLOTS[index] = slot != null && suppressDisabled && node.disabled && (node.localName === "button" || node.localName === "input" || node.localName === "select" || node.localName === "textarea") ? null : slot;
10787
+ }
10788
+ }
10789
+ function preserveDispatchedBundle(bundle) {
10790
+ let snapshot;
10791
+ for (let index = 0; index < CAPTURE_SLOTS.length; index++) {
10792
+ if (CAPTURE_SLOTS[index] === bundle) {
10793
+ CAPTURE_SLOTS[index] = snapshot ??= {
10794
+ [EVENT_SLOT_KIND]: HANDLER_BUNDLE_KIND,
10795
+ fn: bundle.fn,
10796
+ args: bundle.args.slice()
10797
+ };
10798
+ }
10799
+ }
10800
+ }
10118
10801
  function resolvePortalEventOwner(node) {
10119
10802
  if (node.$$portalParent != null || node.parentNode === null) return;
10120
10803
  const target = node.parentNode;
@@ -10320,9 +11003,7 @@ function finishCaptureDispatch(event) {
10320
11003
  maybeFlushDiscrete(type);
10321
11004
  }
10322
11005
  };
10323
- const target = event.target;
10324
- const checkableChange = type === "change" && target?.localName === "input" && (target.type === "checkbox" || target.type === "radio");
10325
- if (checkableChange) setTimeout(fallback, 0);
11006
+ if (event.isTrusted) setTimeout(fallback, 0);
10326
11007
  else queueMicrotask(fallback);
10327
11008
  }
10328
11009
  function dispatchDelegated(event) {
@@ -10334,13 +11015,7 @@ function dispatchDelegated(event) {
10334
11015
  _dispatchDepth++;
10335
11016
  const node = event.target;
10336
11017
  const prevSubmitRec = ACTIVE_SUBMIT_DISPATCH;
10337
- const submitRec = event.type === "submit" && node != null && node.nodeName === "FORM" ? {
10338
- form: node,
10339
- event,
10340
- transitions: 0,
10341
- published: false,
10342
- intercepted: false
10343
- } : null;
11018
+ const submitRec = event.type === "submit" && node != null && node.nodeName === "FORM" ? snapshotSubmitDispatch(node, event) : null;
10344
11019
  if (submitRec !== null) ACTIVE_SUBMIT_DISPATCH = submitRec;
10345
11020
  const nativeBatch = (0, import_native_read_events.beginNativeEventBatch)(event);
10346
11021
  const pathBase = CAPTURE_PATH.length;
@@ -10350,14 +11025,17 @@ function dispatchDelegated(event) {
10350
11025
  if (delegatedCapture(event.type) && _delegatedCapture.has(event.type) && dispatchDelegatedCapture.call(this, event))
10351
11026
  return;
10352
11027
  if (!_delegated.has(event.type)) return;
11028
+ if (node?.nodeType === 1 && isHtmlCustomElement(node) && (event.type === "invalid" || EMULATED_BUBBLING_EVENTS.includes(event.type)))
11029
+ return;
10353
11030
  buildDelegatedPath(event, this);
11031
+ snapshotDelegatedSlots(pathBase, key, event);
10354
11032
  stop = Object.getOwnPropertyDescriptor(event, "stopPropagation");
10355
11033
  propagationStarted = true;
10356
11034
  beginDelegatedPropagation(event, stop, null);
10357
11035
  for (let i = pathBase; i < CAPTURE_PATH.length; i++) {
10358
11036
  const current = CAPTURE_PATH[i];
10359
11037
  if (targetOnly && current !== event.target) break;
10360
- const slot = current[key];
11038
+ const slot = CAPTURE_SLOTS[i];
10361
11039
  if (slot != null) {
10362
11040
  setCurrentTarget(event, current);
10363
11041
  fireEventSlot(slot, event);
@@ -10365,8 +11043,12 @@ function dispatchDelegated(event) {
10365
11043
  }
10366
11044
  if (targetOnly) break;
10367
11045
  }
11046
+ if (submitRec !== null && FORM_SUBMIT_DRIVER !== null && !event.defaultPrevented && CAPTURE_PATH.includes(submitRec.form, pathBase)) {
11047
+ FORM_SUBMIT_DRIVER(submitRec.form, event, submitRec.action, submitRec.submitter);
11048
+ }
10368
11049
  } finally {
10369
11050
  CAPTURE_PATH.length = pathBase;
11051
+ CAPTURE_SLOTS.length = pathBase;
10370
11052
  if (propagationStarted) endDelegatedPropagation(event, stop, null);
10371
11053
  if (submitRec !== null) {
10372
11054
  ACTIVE_SUBMIT_DISPATCH = prevSubmitRec;
@@ -10389,6 +11071,7 @@ function dispatchDelegatedCapture(event) {
10389
11071
  const key = CAPTURE_PREFIX + event.type;
10390
11072
  const pathBase = CAPTURE_PATH.length;
10391
11073
  buildDelegatedPath(event, this, path);
11074
+ snapshotDelegatedSlots(pathBase, key, event);
10392
11075
  const stop = Object.getOwnPropertyDescriptor(event, "stopPropagation");
10393
11076
  const immediate = delegatedCapture(event.type) ? Object.getOwnPropertyDescriptor(event, "stopImmediatePropagation") : null;
10394
11077
  const wasCancelled = event.cancelBubble;
@@ -10398,7 +11081,7 @@ function dispatchDelegatedCapture(event) {
10398
11081
  try {
10399
11082
  beginDelegatedPropagation(event, stop, immediate);
10400
11083
  for (let i = CAPTURE_PATH.length - 1; i >= pathBase; i--) {
10401
- const slot = CAPTURE_PATH[i][key];
11084
+ const slot = CAPTURE_SLOTS[i];
10402
11085
  if (slot != null) {
10403
11086
  setCurrentTarget(event, CAPTURE_PATH[i]);
10404
11087
  fireEventSlot(slot, event);
@@ -10408,6 +11091,7 @@ function dispatchDelegatedCapture(event) {
10408
11091
  } finally {
10409
11092
  stopped = event[PROPAGATION_FLAGS] !== 0 || !wasCancelled && event.cancelBubble;
10410
11093
  CAPTURE_PATH.length = pathBase;
11094
+ CAPTURE_SLOTS.length = pathBase;
10411
11095
  endDelegatedPropagation(event, stop, immediate);
10412
11096
  clearCurrentTarget(event);
10413
11097
  try {
@@ -10435,7 +11119,7 @@ function clearCurrentTarget(event) {
10435
11119
  delete event.currentTarget;
10436
11120
  delete event[CURRENT_TARGET_NODE];
10437
11121
  }
10438
- const IDLE_FORM_STATUS = { pending: false, data: null, method: "get", action: null };
11122
+ const IDLE_FORM_STATUS = { pending: false, data: null, method: null, action: null };
10439
11123
  const FORM_STATUS = /* @__PURE__ */ new WeakMap();
10440
11124
  const FORM_STATUS_LISTENERS = /* @__PURE__ */ new WeakMap();
10441
11125
  function setFormStatus(form, status) {
@@ -10443,7 +11127,28 @@ function setFormStatus(form, status) {
10443
11127
  const ls = FORM_STATUS_LISTENERS.get(form);
10444
11128
  if (ls) for (const l of ls) l();
10445
11129
  }
11130
+ function snapshotSubmitDispatch(form, event) {
11131
+ let submitter = event.submitter;
11132
+ let action = form.$$formAction;
11133
+ if (submitter !== null && submitter !== void 0) {
11134
+ const override = submitter.$$formAction ?? submitter.getAttribute("formaction");
11135
+ if (override != null) {
11136
+ action = override;
11137
+ submitter = null;
11138
+ }
11139
+ }
11140
+ return {
11141
+ form,
11142
+ event,
11143
+ action,
11144
+ submitter: submitter ?? null,
11145
+ transitions: 0,
11146
+ published: false,
11147
+ intercepted: false
11148
+ };
11149
+ }
10446
11150
  let ACTIVE_SUBMIT_DISPATCH = null;
11151
+ let FORM_SUBMIT_DRIVER = null;
10447
11152
  function publishManualFormPending(rec) {
10448
11153
  if (rec.intercepted || rec.transitions === 0 || !rec.event.defaultPrevented) return;
10449
11154
  const form = rec.form;
@@ -10499,30 +11204,22 @@ function flushFormResets() {
10499
11204
  PENDING_FORM_RESETS = null;
10500
11205
  for (const f of forms) resetFormNow(f);
10501
11206
  }
10502
- function setFormAction(el, name, value, prev) {
11207
+ function setFormAction(el, name, value, _prev) {
10503
11208
  if (typeof value === "function") {
10504
11209
  el.$$formAction = value;
10505
11210
  if (process.env.NODE_ENV !== "production") queueFormActionAuthoringDiagnostic(el);
10506
- if (el.nodeName === "FORM") {
10507
- if (!el.$$formSubmitWired) {
10508
- el.$$formSubmitWired = true;
10509
- el.$$submit = (event) => handleFormSubmit(el, event);
10510
- delegateEvents(["submit"]);
10511
- }
11211
+ if (!el.$$formSubmitWired) {
11212
+ el.$$formSubmitWired = true;
11213
+ FORM_SUBMIT_DRIVER = handleFormSubmit;
11214
+ delegateEvents(["submit"]);
10512
11215
  }
10513
11216
  el.removeAttribute(name);
10514
11217
  return;
10515
11218
  }
10516
11219
  el.$$formAction = void 0;
10517
- if (typeof prev === "function" && el.nodeName === "FORM") {
10518
- el.$$submit = void 0;
10519
- el.$$formSubmitWired = false;
10520
- }
10521
11220
  setAttribute(el, name, value);
10522
11221
  }
10523
- function handleFormSubmit(form, event) {
10524
- const submitter = event.submitter;
10525
- const action = submitter && submitter.$$formAction || form.$$formAction;
11222
+ function handleFormSubmit(form, event, action, submitter) {
10526
11223
  if (typeof action !== "function") return;
10527
11224
  event.preventDefault();
10528
11225
  if (ACTIVE_SUBMIT_DISPATCH !== null && ACTIVE_SUBMIT_DISPATCH.form === form)
@@ -10698,7 +11395,7 @@ function armControlled(el) {
10698
11395
  return ctrl;
10699
11396
  }
10700
11397
  function toControlledString(v) {
10701
- return typeof v === "string" ? v : String(v);
11398
+ return typeof v === "string" ? v : typeof v === "function" || typeof v === "symbol" ? "" : String(v);
10702
11399
  }
10703
11400
  function valueNeedsWrite(el, raw) {
10704
11401
  if (el.type === "number") {
@@ -10959,35 +11656,77 @@ function projectSelectValue(sel, sv, setDefaultSelected) {
10959
11656
  }
10960
11657
  if (defaultOption !== null) defaultOption.selected = true;
10961
11658
  }
10962
- function setDefaultValue(el, value) {
11659
+ function setDefaultValue(el, value, initial) {
10963
11660
  const ctrl = armControlled(el);
10964
11661
  const hydration = activeHydration();
10965
- if (hydration !== null && !hydration.isFresh(el) || value == null) return;
10966
11662
  if (el.localName === "select") {
10967
- if (!Object.is(ctrl.dvv, value)) {
11663
+ const first2 = ctrl.dvv === UNCONTROLLED;
11664
+ const multiple = el.multiple;
11665
+ const changedMultiple = ctrl.formMultiple !== multiple;
11666
+ if (first2 || changedMultiple) {
10968
11667
  if (TRANSITION_JOURNAL !== null) {
10969
11668
  journalObjectOnce(ctrl);
10970
11669
  journalBag();
10971
11670
  }
10972
11671
  ctrl.dvv = value;
10973
- queueControlledCommit(SELECT_DEFAULT_SYNCS, { el, value });
11672
+ ctrl.formMultiple = multiple;
11673
+ if (hydration !== null && !hydration.isFresh(el)) return;
11674
+ if (value != null)
11675
+ queueControlledCommit(SELECT_DEFAULT_SYNCS, { el, value });
11676
+ else if (changedMultiple)
11677
+ projectSelectValue(el, multiple ? /* @__PURE__ */ new Set() : "", false);
10974
11678
  }
10975
11679
  return;
10976
11680
  }
11681
+ const first = initial ?? !ctrl.sawV;
11682
+ const previousDefault = ctrl.dvv;
11683
+ if (TRANSITION_JOURNAL !== null) journalObjectOnce(ctrl);
11684
+ ctrl.sawV = true;
11685
+ ctrl.dvv = value;
11686
+ const hydrating = hydration !== null && !hydration.isFresh(el);
10977
11687
  if (ctrl.v !== UNCONTROLLED) return;
10978
11688
  const input = el;
11689
+ if (value == null) {
11690
+ if (previousDefault !== UNCONTROLLED && previousDefault != null) {
11691
+ if (TRANSITION_JOURNAL !== null) journalDefaultValue(input);
11692
+ if (el.localName === "input") input.removeAttribute("value");
11693
+ else input.defaultValue = "";
11694
+ }
11695
+ return;
11696
+ }
10979
11697
  const s = toControlledString(value);
10980
- if (input.defaultValue !== s) {
11698
+ if (first && !hydrating && input.value !== s) {
11699
+ if (TRANSITION_JOURNAL !== null) journalControlled(el, "value", "defaultValue");
11700
+ input.value = s;
11701
+ }
11702
+ if (input.defaultValue !== s || s === "" && el.localName === "input" && !input.hasAttribute("value")) {
10981
11703
  if (TRANSITION_JOURNAL !== null) journalDefaultValue(input);
10982
11704
  input.defaultValue = s;
10983
11705
  }
10984
11706
  }
11707
+ const DEFAULT_VALUE_BASELINE = /* @__PURE__ */ Symbol("octane.defaultValue");
10985
11708
  function setDefaultValueUncontrolled(el, value) {
10986
11709
  const hydration = activeHydration();
10987
- if (hydration !== null && !hydration.isFresh(el) || value == null) return;
10988
11710
  const input = el;
10989
- const s = toControlledString(value);
10990
- if (input.defaultValue !== s) {
11711
+ const previous = input[DEFAULT_VALUE_BASELINE];
11712
+ const s = value == null ? null : toControlledString(value);
11713
+ if (TRANSITION_JOURNAL !== null)
11714
+ TRANSITION_JOURNAL.push(JOURNAL_PROP, input, DEFAULT_VALUE_BASELINE, previous);
11715
+ input[DEFAULT_VALUE_BASELINE] = s;
11716
+ const hydrating = hydration !== null && !hydration.isFresh(el);
11717
+ if (s === null) {
11718
+ if (previous != null) {
11719
+ if (TRANSITION_JOURNAL !== null) journalDefaultValue(input);
11720
+ if (el.localName === "input") input.removeAttribute("value");
11721
+ else input.defaultValue = "";
11722
+ }
11723
+ return;
11724
+ }
11725
+ if (previous === void 0 && !hydrating && input.value !== s) {
11726
+ if (TRANSITION_JOURNAL !== null) journalControlled(el, "value", "defaultValue");
11727
+ input.value = s;
11728
+ }
11729
+ if (input.defaultValue !== s || s === "" && el.localName === "input" && !input.hasAttribute("value")) {
10991
11730
  if (TRANSITION_JOURNAL !== null) journalDefaultValue(input);
10992
11731
  input.defaultValue = s;
10993
11732
  }
@@ -11056,7 +11795,6 @@ function setFormControlSources(el, sources) {
11056
11795
  }
11057
11796
  const ctrl = armControlled(el);
11058
11797
  const first = !ctrl.formSeen;
11059
- const previousDefaultValue = ctrl.formDefaultValue;
11060
11798
  const previousDefaultChecked = ctrl.formDefaultChecked;
11061
11799
  const previousMultiple = ctrl.formMultiple;
11062
11800
  if (TRANSITION_JOURNAL !== null) {
@@ -11078,9 +11816,7 @@ function setFormControlSources(el, sources) {
11078
11816
  const defaultString = defaultValue == null ? null : toControlledString(defaultValue);
11079
11817
  setValue(input, value);
11080
11818
  if (value == null) {
11081
- if (defaultString !== null) setDefaultValue(input, defaultString);
11082
- else if (!first && previousDefaultValue !== UNCONTROLLED && previousDefaultValue != null)
11083
- input.removeAttribute("value");
11819
+ setDefaultValue(input, defaultString, first);
11084
11820
  }
11085
11821
  setChecked(input, checked);
11086
11822
  if (checked == null && defaultChecked != null) setDefaultChecked(input, defaultChecked);
@@ -11093,7 +11829,7 @@ function setFormControlSources(el, sources) {
11093
11829
  const textarea = el;
11094
11830
  setValue(textarea, value);
11095
11831
  if (value == null) {
11096
- if (defaultValue != null) setDefaultValue(textarea, defaultValue);
11832
+ if (defaultValue != null) setDefaultValue(textarea, defaultValue, first);
11097
11833
  else if (!first && textarea.defaultValue !== "") textarea.defaultValue = "";
11098
11834
  }
11099
11835
  return;
@@ -11116,7 +11852,7 @@ function setFormControlSources(el, sources) {
11116
11852
  }
11117
11853
  setSelectValue(select, value);
11118
11854
  if (defaultValue != null) setDefaultValue(select, defaultValue);
11119
- else ctrl.dvv = UNCONTROLLED;
11855
+ else if (first) ctrl.dvv = void 0;
11120
11856
  }
11121
11857
  function nativeTextChangeMessage(el, hasBubbleChange, controlled) {
11122
11858
  const changeProp = hasBubbleChange ? "onChange" : "onChangeCapture";
@@ -11400,7 +12136,9 @@ function unregisterPortalEventRange(target, portal2) {
11400
12136
  }
11401
12137
  }
11402
12138
  function portal(parentScope, slotKey, target, body, props, host, env, fragmentOwners, fragmentAnchor) {
12139
+ if (CURRENT_BLOCK?.pending && !CURRENT_BLOCK.crossRenderUpdate) return;
11403
12140
  const prev = parentScope.slots[slotKey];
12141
+ const key = portalKey(props);
11404
12142
  if (fragmentAnchor !== void 0 && fragmentOwners === void 0 && prev !== void 0 && prev.target === target) {
11405
12143
  prepareFragmentPortalInterleaving(prev);
11406
12144
  }
@@ -11409,12 +12147,13 @@ function portal(parentScope, slotKey, target, body, props, host, env, fragmentOw
11409
12147
  parentScope.block,
11410
12148
  target,
11411
12149
  body,
11412
- props,
12150
+ key === null ? props : void 0,
11413
12151
  // `host` (passed by the compiler) is the JSX element that contains the
11414
12152
  // createPortal call — the natural "logical parent" for event bubbling. When
11415
12153
  // the portal is at top level the compiler passes the block's parentNode.
11416
12154
  host || parentScope.block.parentNode,
11417
- env
12155
+ env,
12156
+ key
11418
12157
  );
11419
12158
  if (prev !== state) {
11420
12159
  journalRootProperty(parentScope.slots, String(slotKey));
@@ -11575,16 +12314,16 @@ function registerValuePortalFragmentOwners(portal2, parentBlock, anchor) {
11575
12314
  registerFragmentPortalOwners(portal2, nestedOwners ?? firstOwner, anchor);
11576
12315
  }
11577
12316
  }
11578
- function renderPortalState(prev, parentBlock, target, rawBody, rawProps, host, env) {
12317
+ function renderPortalState(prev, parentBlock, target, rawBody, rawProps, host, env, key = null) {
11579
12318
  const hydration = activeHydration();
11580
12319
  if (hydration !== null) {
11581
12320
  return hydration.suspend(
11582
- () => renderPortalState(prev, parentBlock, target, rawBody, rawProps, host, env)
12321
+ () => renderPortalState(prev, parentBlock, target, rawBody, rawProps, host, env, key)
11583
12322
  );
11584
12323
  }
11585
12324
  const norm = normalizePortalBody(rawBody, rawProps);
11586
12325
  let state = prev;
11587
- if (state === null || state.target !== target) {
12326
+ if (state === null || state.target !== target || state.key !== key) {
11588
12327
  if (state !== null) teardownPortalState(state);
11589
12328
  const start = document.createComment("portal");
11590
12329
  const end = document.createComment("/portal");
@@ -11605,7 +12344,7 @@ function renderPortalState(prev, parentBlock, target, rawBody, rawProps, host, e
11605
12344
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__) {
11606
12345
  (0, import_profiling.__profileTrackComponent)(block, profilePortalComponent(rawBody));
11607
12346
  }
11608
- state = { __kind: "portalSlotSlot", block, target, host, start, end };
12347
+ state = { __kind: "portalSlotSlot", block, target, key, host, start, end };
11609
12348
  registerPortalEventRange(target, state);
11610
12349
  activityPortalCreated?.(block);
11611
12350
  registerDelegationTarget(target);
@@ -11687,9 +12426,13 @@ function genericPortalBody(value, scope) {
11687
12426
  childSlot(scope, 0, scope.parentNode, value, scope.endMarker);
11688
12427
  }
11689
12428
  const PORTAL_TAG = /* @__PURE__ */ Symbol.for("octane.portal");
12429
+ function portalKey(value) {
12430
+ return typeof value === "string" || typeof value === "number" ? String(value) : null;
12431
+ }
11690
12432
  // @__NO_SIDE_EFFECTS__
11691
12433
  function createPortal(body, target, props = void 0) {
11692
- return { $$kind: PORTAL_TAG, body, target, props };
12434
+ const key = portalKey(props);
12435
+ return { $$kind: PORTAL_TAG, body, target, key, props: key === null ? props : void 0 };
11693
12436
  }
11694
12437
  const ELEMENT_TAG = /* @__PURE__ */ Symbol.for("octane.element");
11695
12438
  const KEYED_ELEMENT_DESCRIPTORS = /* @__PURE__ */ new WeakSet();
@@ -12108,6 +12851,7 @@ function componentSlotVoid(parentScope, slotKey, domParent, comp, props, anchor,
12108
12851
  );
12109
12852
  }
12110
12853
  function componentSlotImpl(outputHandler, parentScope, slotKey, domParent, body, identity, props, renderProps, anchor, key, singleRoot, inherit, hasKey) {
12854
+ if (CURRENT_BLOCK?.pending && !CURRENT_BLOCK.crossRenderUpdate) return;
12111
12855
  const parentBlock = parentScope.block;
12112
12856
  const hydration = activeHydration();
12113
12857
  if (hydration !== null && (anchor != null && hydration.isFresh(anchor) || hydration.isFresh(domParent))) {
@@ -12217,8 +12961,8 @@ function componentSlotImpl(outputHandler, parentScope, slotKey, domParent, body,
12217
12961
  parentScope.slots[slotKey] = state;
12218
12962
  registerSlot(parentScope, state);
12219
12963
  }
12220
- const nextKey = key === void 0 ? NO_KEY : key;
12221
- const keyChanged = key !== void 0 && state.prevKey !== NO_KEY && !Object.is(key, state.prevKey);
12964
+ const nextKey = key === void 0 ? NO_KEY : "" + key;
12965
+ const keyChanged = key !== void 0 && state.prevKey !== NO_KEY && nextKey !== state.prevKey;
12222
12966
  const replacing = identity !== state.currentComp || keyChanged;
12223
12967
  const journaledSlot = ROOT_RENDER_TRANSACTION !== null && state.block !== null && replacing;
12224
12968
  if (journaledSlot) {
@@ -12673,25 +13417,28 @@ function clearReplacedChildBlock(state, oldBlock) {
12673
13417
  }
12674
13418
  const DEOPT_KEY_WARNED_BLOCKS = /* @__PURE__ */ new WeakSet();
12675
13419
  let DEOPT_KEY_WARNED_WITHOUT_BLOCK = false;
13420
+ function warnMissingListKey(owner) {
13421
+ const warned = owner === null ? DEOPT_KEY_WARNED_WITHOUT_BLOCK : DEOPT_KEY_WARNED_BLOCKS.has(owner);
13422
+ if (!warned) {
13423
+ if (owner === null) DEOPT_KEY_WARNED_WITHOUT_BLOCK = true;
13424
+ else DEOPT_KEY_WARNED_BLOCKS.add(owner);
13425
+ console.warn(
13426
+ 'Octane: each element in an array child should have a unique "key" prop (e.g. `items.map((x) => <li key={x.id}>\u2026</li>)`). Missing keys can reconcile incorrectly on reorder \u2014 for keyed lists prefer `@for (...; key ...)`.'
13427
+ );
13428
+ }
13429
+ }
12676
13430
  function deoptKey(item, index) {
12677
13431
  const element = item != null && item.$$kind === ELEMENT_TAG;
13432
+ if (item?.$$kind === PORTAL_TAG && item.key != null) return item.key;
12678
13433
  if (element && item.key != null && !ELEMENTS_MISSING_LIST_KEY.has(item)) return item.key;
12679
13434
  if (element && process.env.NODE_ENV !== "production" && activeHydration() === null) {
12680
- const owner = CURRENT_BLOCK;
12681
- const warned = owner === null ? DEOPT_KEY_WARNED_WITHOUT_BLOCK : DEOPT_KEY_WARNED_BLOCKS.has(owner);
12682
- if (!warned) {
12683
- if (owner === null) DEOPT_KEY_WARNED_WITHOUT_BLOCK = true;
12684
- else DEOPT_KEY_WARNED_BLOCKS.add(owner);
12685
- console.warn(
12686
- 'Octane: each element in an array child should have a unique "key" prop (e.g. `items.map((x) => <li key={x.id}>\u2026</li>)`). Missing keys can reconcile incorrectly on reorder \u2014 for keyed lists prefer `@for (...; key ...)`.'
12687
- );
12688
- }
13435
+ warnMissingListKey(CURRENT_BLOCK);
12689
13436
  }
12690
13437
  return element && item.key != null ? item.key : index;
12691
13438
  }
12692
13439
  const POSITIONAL_CHILDREN = /* @__PURE__ */ new WeakSet();
12693
13440
  function deoptKeyPositional(item, index) {
12694
- return item != null && item.$$kind === ELEMENT_TAG && item.key != null ? item.key : index;
13441
+ return item != null && (item.$$kind === ELEMENT_TAG || item.$$kind === PORTAL_TAG) && item.key != null ? item.key : index;
12695
13442
  }
12696
13443
  function positionalChildren(children) {
12697
13444
  POSITIONAL_CHILDREN.add(children);
@@ -12707,6 +13454,11 @@ function noteDeoptRef(block) {
12707
13454
  }
12708
13455
  }
12709
13456
  function applyDeoptProp(el, name, v, ownerBlock) {
13457
+ const actionName = formActionAttributeName(el, name);
13458
+ if (actionName !== null) {
13459
+ setFormAction(el, actionName, v, void 0);
13460
+ return;
13461
+ }
12710
13462
  if (name === "ref") {
12711
13463
  if (v != null) {
12712
13464
  noteDeoptRef(ownerBlock);
@@ -12717,7 +13469,7 @@ function applyDeoptProp(el, name, v, ownerBlock) {
12717
13469
  } else if (name === "style") {
12718
13470
  setStyle(el, v, void 0);
12719
13471
  } else {
12720
- const ev = eventSlot(name);
13472
+ const ev = eventSlot(name, el);
12721
13473
  if (ev !== null) {
12722
13474
  setEventHandler(
12723
13475
  el,
@@ -12739,6 +13491,9 @@ function hasDangerHTML(props) {
12739
13491
  }
12740
13492
  return true;
12741
13493
  }
13494
+ function hasHostPropContent(descriptor) {
13495
+ return hasDangerHTML(descriptor.props) || descriptor.type === "textarea" && (descriptor.props?.value != null || descriptor.props?.defaultValue != null);
13496
+ }
12742
13497
  function applyDeoptProps(el, props, ownerBlock) {
12743
13498
  if (props == null) {
12744
13499
  if (process.env.NODE_ENV !== "production") queueDevFormDiagnostic(el, ownerBlock);
@@ -12747,7 +13502,7 @@ function applyDeoptProps(el, props, ownerBlock) {
12747
13502
  for (const name in props) {
12748
13503
  if (name === "key" || name === "children") continue;
12749
13504
  if (name === "suppressHydrationWarning") {
12750
- el.__oct_suppress = props[name] !== false;
13505
+ el.__oct_suppress = props[name] === true;
12751
13506
  continue;
12752
13507
  }
12753
13508
  applyDeoptProp(el, name, props[name], ownerBlock);
@@ -12768,7 +13523,7 @@ function patchDeoptProps(el, prevProps, nextProps, ownerBlock) {
12768
13523
  for (const name in nextProps) {
12769
13524
  if (name === "key" || name === "children") continue;
12770
13525
  if (name === "suppressHydrationWarning") {
12771
- el.__oct_suppress = nextProps[name] !== false;
13526
+ el.__oct_suppress = nextProps[name] === true;
12772
13527
  continue;
12773
13528
  }
12774
13529
  const nv = nextProps[name];
@@ -12835,8 +13590,13 @@ function applyHostProps(el, props, scope, state) {
12835
13590
  for (const name in props) {
12836
13591
  if (name === "key" || name === "children") continue;
12837
13592
  const v = props[name];
13593
+ const actionName = formActionAttributeName(el, name);
13594
+ if (actionName !== null) {
13595
+ setFormAction(el, actionName, v, prev?.[name]);
13596
+ continue;
13597
+ }
12838
13598
  if (name === "suppressHydrationWarning") {
12839
- el.__oct_suppress = v !== false;
13599
+ el.__oct_suppress = v === true;
12840
13600
  continue;
12841
13601
  }
12842
13602
  if (name === "ref") {
@@ -12850,7 +13610,7 @@ function applyHostProps(el, props, scope, state) {
12850
13610
  } else if (name === "style") {
12851
13611
  setStyle(el, v, prev != null ? prev.style : void 0);
12852
13612
  } else {
12853
- const ev = eventSlot(name);
13613
+ const ev = eventSlot(name, el);
12854
13614
  if (ev) {
12855
13615
  if (ev.capture) {
12856
13616
  if (!_delegatedCapture.has(ev.type)) delegateCaptureEvents([ev.type]);
@@ -12957,7 +13717,7 @@ function deoptWrapperKind(value) {
12957
13717
  return POSITIONAL_CHILDREN.has(value) ? "fragment" : "array";
12958
13718
  }
12959
13719
  function scopedDeoptKey(path, item, index, key) {
12960
- const explicit = isElementDescriptor(item) && item.key != null;
13720
+ const explicit = (isElementDescriptor(item) || item?.$$kind === PORTAL_TAG) && item.key != null;
12961
13721
  if (path.length === 0) return explicit ? "k" + String(key) : "i" + index;
12962
13722
  return JSON.stringify([path, explicit ? "key" : "index", explicit ? String(key) : index]);
12963
13723
  }
@@ -13070,6 +13830,10 @@ function reconcileDeoptNode(prev, value, ownerBlock, ns) {
13070
13830
  if (t === "string" || t === "number" || t === "bigint") {
13071
13831
  const s = String(value);
13072
13832
  if (prev !== null && prev.nodeType === 3) {
13833
+ const hydration = activeHydration();
13834
+ if (hydration !== null && !hydration.isFresh(prev.parentNode)) {
13835
+ return hydration.htextSwap(prev, s);
13836
+ }
13073
13837
  updateTextValue(prev, s);
13074
13838
  return prev;
13075
13839
  }
@@ -13087,7 +13851,7 @@ function reconcileDeoptNode(prev, value, ownerBlock, ns) {
13087
13851
  applyDeoptProps(el, value.props, ownerBlock);
13088
13852
  }
13089
13853
  setDeoptDesc(el, value);
13090
- if (!hasDangerHTML(value.props)) {
13854
+ if (!hasHostPropContent(value)) {
13091
13855
  reconcileDeoptChildren(el, value.children, ownerBlock);
13092
13856
  }
13093
13857
  return el;
@@ -13103,7 +13867,12 @@ function reconcileDeoptChildren(el, children, ownerBlock) {
13103
13867
  if (type === "string" && children !== "" || type === "number" || type === "bigint") {
13104
13868
  const first = getFirstChild(el);
13105
13869
  if (first !== null && first.nodeType === 3 && getNextSibling(first) === null && first.$$deoptKey === 0 && first.$$portalEnd == null) {
13106
- updateTextValue(first, String(children));
13870
+ const hydration = activeHydration();
13871
+ if (hydration !== null && !hydration.isFresh(el)) {
13872
+ hydration.htextSwap(first, String(children));
13873
+ } else {
13874
+ updateTextValue(first, String(children));
13875
+ }
13107
13876
  return;
13108
13877
  }
13109
13878
  }
@@ -13181,6 +13950,10 @@ function reconcileDeoptChildren(el, children, ownerBlock) {
13181
13950
  for (let i = owned.length - 1; i >= 0; i--) {
13182
13951
  const n = owned[i];
13183
13952
  if (keep === null || !keep.has(n)) {
13953
+ const hydration = activeHydration();
13954
+ if (hydration !== null && !hydration.isFresh(el)) {
13955
+ noteRecoverableHydrationError(() => new Error((0, import_error_codes_client_generated.formatClientError)(62)), ownerBlock);
13956
+ }
13184
13957
  if (journal) {
13185
13958
  journalRootChildren(el);
13186
13959
  deferRootRange(el, n, n, () => detachDeoptTreeRefs(n, null));
@@ -13411,6 +14184,7 @@ function mappedDeoptItemBody(item, scope) {
13411
14184
  function descNeedsBlocks(value) {
13412
14185
  if (typeof value === "function") return true;
13413
14186
  if (value == null || typeof value !== "object") return false;
14187
+ if (typeof value.then === "function") return true;
13414
14188
  if (Array.isArray(value)) {
13415
14189
  for (let i = 0; i < value.length; i++) {
13416
14190
  if (descNeedsBlocks(value[i])) return true;
@@ -13436,7 +14210,7 @@ function hostElementBody(d, block) {
13436
14210
  applyDeoptProps(el, d.props, block);
13437
14211
  setDeoptDesc(el, d);
13438
14212
  const savedCursor = hydration.node.nextSibling;
13439
- if (!hasDangerHTML(d.props)) {
14213
+ if (!hasHostPropContent(d)) {
13440
14214
  hydration.node = el.firstChild;
13441
14215
  childSlot(block, 0, el, d.children, null, false, el);
13442
14216
  }
@@ -13464,7 +14238,7 @@ function hostElementBody(d, block) {
13464
14238
  block.parentNode.insertBefore(el, block.endMarker);
13465
14239
  applyDeoptProps(el, d.props, block);
13466
14240
  setDeoptDesc(el, d);
13467
- if (!hasDangerHTML(d.props)) {
14241
+ if (!hasHostPropContent(d)) {
13468
14242
  hydration.suspend(() => childSlot(block, 0, el, d.children, null, false, el));
13469
14243
  }
13470
14244
  return;
@@ -13500,7 +14274,7 @@ function hostElementBody(d, block) {
13500
14274
  patchDeoptProps(el, getDeoptDesc(el)?.props ?? null, d.props, block);
13501
14275
  }
13502
14276
  setDeoptDesc(el, d);
13503
- if (!hasDangerHTML(d.props)) childSlot(block, 0, el, d.children, null, false, el);
14277
+ if (!hasHostPropContent(d)) childSlot(block, 0, el, d.children, null, false, el);
13504
14278
  }
13505
14279
  function hostStringTagBody(d, block) {
13506
14280
  const tag = d.type;
@@ -13514,7 +14288,7 @@ function hostStringTagBody(d, block) {
13514
14288
  applyDeoptProps(el, d.props, block);
13515
14289
  setDeoptDesc(el, d);
13516
14290
  const savedCursor = hydration.node.nextSibling;
13517
- if (!hasDangerHTML(d.props)) {
14291
+ if (!hasHostPropContent(d)) {
13518
14292
  hydration.node = el.firstChild;
13519
14293
  renderHostTagChildren(d, block, el);
13520
14294
  }
@@ -13542,7 +14316,7 @@ function hostStringTagBody(d, block) {
13542
14316
  block.parentNode.insertBefore(el, block.endMarker);
13543
14317
  applyDeoptProps(el, d.props, block);
13544
14318
  setDeoptDesc(el, d);
13545
- if (!hasDangerHTML(d.props)) {
14319
+ if (!hasHostPropContent(d)) {
13546
14320
  hydration.suspend(() => renderHostTagChildren(d, block, el));
13547
14321
  }
13548
14322
  return;
@@ -13556,7 +14330,7 @@ function hostStringTagBody(d, block) {
13556
14330
  patchDeoptProps(el, getDeoptDesc(el)?.props ?? null, d.props, block);
13557
14331
  }
13558
14332
  setDeoptDesc(el, d);
13559
- if (!hasDangerHTML(d.props)) renderHostTagChildren(d, block, el);
14333
+ if (!hasHostPropContent(d)) renderHostTagChildren(d, block, el);
13560
14334
  }
13561
14335
  function renderHostTagChildren(d, block, el) {
13562
14336
  const kids = d.children;
@@ -13734,6 +14508,8 @@ function mapSlot(scopeOrItems, slotOrMethod, domParent, items, method, native, c
13734
14508
  callback = native;
13735
14509
  native = mapSlot(items, method);
13736
14510
  }
14511
+ if (process.env.NODE_ENV !== "production" && ((flags ?? 0) & 64) !== 0 && items?.length > 0)
14512
+ warnMissingListKey(scopeOrItems.block);
13737
14513
  if (ownEnd === 1) ownEnd = true;
13738
14514
  if (native === true) {
13739
14515
  const previous = scopeOrItems.slots[slotOrMethod]?.forSlot;
@@ -14003,6 +14779,7 @@ function renderPreparedChildList(state, parentBlock, domParent, preparedList, hy
14003
14779
  return;
14004
14780
  }
14005
14781
  function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsHost, compactable, includeKeyedSingle = true, compiledMapBody, compiledMapKey, compiledMapFlags, compiledMapDeps, mappedFallback) {
14782
+ if (CURRENT_BLOCK?.pending && !CURRENT_BLOCK.crossRenderUpdate) return;
14006
14783
  if (value != null && includeKeyedSingle && domParent.nodeType === 1 && import_constants.VOID_ELEMENTS.has(domParent.localName) && !isPortalTarget(parentScope.block, domParent)) {
14007
14784
  throw new Error((0, import_error_codes_client_generated.formatClientError)(26, domParent.localName));
14008
14785
  }
@@ -14077,7 +14854,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
14077
14854
  slotKey,
14078
14855
  domParent,
14079
14856
  value,
14080
- anchor,
14857
+ anchor?.parentNode === domParent ? anchor : null,
14081
14858
  ownEnd,
14082
14859
  ownsHost,
14083
14860
  compactable,
@@ -14198,7 +14975,9 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
14198
14975
  portalDesc.body,
14199
14976
  portalDesc.props,
14200
14977
  // The DOM element containing this hole is the portal's logical parent.
14201
- domParent
14978
+ domParent,
14979
+ void 0,
14980
+ portalDesc.key
14202
14981
  );
14203
14982
  if (activeFragments.size !== 0 && state.end !== null) {
14204
14983
  registerValuePortalFragmentOwners(state.portal, parentBlock, state.end);
@@ -14834,7 +15613,17 @@ function memo(component, arePropsEqual) {
14834
15613
  function memoWrapper(props, scope, extra) {
14835
15614
  return component(props, scope, extra);
14836
15615
  }
14837
- memoWrapper.__memo = true;
15616
+ Object.defineProperty(memoWrapper, "type", { value: component });
15617
+ Object.defineProperty(memoWrapper, "displayName", {
15618
+ configurable: true,
15619
+ writable: true,
15620
+ value: component.displayName || component.name || "Memo"
15621
+ });
15622
+ Object.defineProperty(memoWrapper, "__memo", {
15623
+ get() {
15624
+ return this === memoWrapper;
15625
+ }
15626
+ });
14838
15627
  Object.defineProperty(memoWrapper, "defaultProps", {
14839
15628
  configurable: true,
14840
15629
  get: () => component.defaultProps,
@@ -14844,7 +15633,7 @@ function memo(component, arePropsEqual) {
14844
15633
  });
14845
15634
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__)
14846
15635
  (0, import_profiling.__profileComponentSource)(memoWrapper, component);
14847
- if (arePropsEqual) memoWrapper.__compare = arePropsEqual;
15636
+ if (arePropsEqual) Object.defineProperty(memoWrapper, "__compare", { value: arePropsEqual });
14848
15637
  return memoWrapper;
14849
15638
  }
14850
15639
  const HMR = /* @__PURE__ */ Symbol.for("octane.hmr");
@@ -14869,7 +15658,7 @@ function hmr(fn) {
14869
15658
  meta.fn = nextFn;
14870
15659
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__)
14871
15660
  (0, import_profiling.__profileComponentSource)(wrapper, meta.fn);
14872
- wrapper.__warm = meta.fn.__warm;
15661
+ markWarm(wrapper, meta.fn.__warm);
14873
15662
  const it = meta.liveBlocks.values();
14874
15663
  for (let r = it.next(); !r.done; r = it.next()) {
14875
15664
  const b = r.value;
@@ -14891,10 +15680,14 @@ function hmr(fn) {
14891
15680
  if (scope !== void 0) meta.liveBlocks.add(scope.block);
14892
15681
  return meta.fn(props, scope, extra);
14893
15682
  }
14894
- wrapper[HMR] = meta;
15683
+ Object.defineProperty(wrapper, HMR, {
15684
+ get() {
15685
+ return this === wrapper ? meta : void 0;
15686
+ }
15687
+ });
14895
15688
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__)
14896
15689
  (0, import_profiling.__profileComponentSource)(wrapper, fn);
14897
- if (fn.__warm !== void 0) wrapper.__warm = fn.__warm;
15690
+ if (fn.__warm !== void 0) markWarm(wrapper, fn.__warm);
14898
15691
  return wrapper;
14899
15692
  }
14900
15693
  let TRANSITION_FALLBACK_TIMEOUT_MS = Infinity;
@@ -15687,7 +16480,7 @@ function renderVisibleTry(state, source) {
15687
16480
  throw renderError;
15688
16481
  if (isSuspenseException(renderError)) {
15689
16482
  if (state.propagateSuspense) throw renderError;
15690
- handleSuspense(state, renderError.thenable, block, journalCheckpoint);
16483
+ handleSuspense(state, renderError.thenable, block, journalCheckpoint, source ?? block);
15691
16484
  } else switchToCatch(state, renderError, true);
15692
16485
  } else {
15693
16486
  if (capture !== null) spliceOffscreenCapture(capture);
@@ -15972,6 +16765,7 @@ function releaseHeldTransition(state) {
15972
16765
  if (state.transitionHeld) {
15973
16766
  state.transitionHeld = false;
15974
16767
  tickTransitionCount(-1);
16768
+ releaseTransitionHookHolder(state);
15975
16769
  }
15976
16770
  abandonHeldTransition(state);
15977
16771
  if (state.transitionTimeoutId !== null) {
@@ -15979,14 +16773,15 @@ function releaseHeldTransition(state) {
15979
16773
  state.transitionTimeoutId = null;
15980
16774
  }
15981
16775
  }
15982
- function handleSuspense(state, thenable, sourceBlock, journalCheckpoint = -1) {
16776
+ function handleSuspense(state, thenable, sourceBlock, journalCheckpoint = -1, transitionOrigin = sourceBlock) {
15983
16777
  ensureScheduledVisibilityDriver();
15984
16778
  const isTransition = sourceBlock.currentRenderMode === "transition";
15985
- if ((isTransition || state.transitionHeld) && state.hasResolved && state.branch === 1 && state.hiddenDom === null) {
16779
+ if (isTransition && state.hasResolved && state.branch === 1 && state.hiddenDom === null) {
15986
16780
  rollbackTransitionJournal(journalCheckpoint, state.tryBlock ?? sourceBlock);
15987
16781
  if (ACTIVE_TRANSITION_ATTEMPT !== null) {
15988
16782
  (ACTIVE_TRANSITION_ATTEMPT.heldSlots ??= /* @__PURE__ */ new Set()).add(state);
15989
16783
  }
16784
+ holdTransitionHooksForBlock(state, transitionOrigin);
15990
16785
  if (!state.transitionHeld) {
15991
16786
  state.transitionHeld = true;
15992
16787
  tickTransitionCount(1);
@@ -16007,6 +16802,7 @@ function handleSuspense(state, thenable, sourceBlock, journalCheckpoint = -1) {
16007
16802
  attachResume(state, thenable);
16008
16803
  return;
16009
16804
  }
16805
+ if (!isTransition) releaseHeldTransition(state);
16010
16806
  hideTryContentAndMountPending(state, thenable);
16011
16807
  }
16012
16808
  function invalidatePendingSuspenseEffects(owner) {
@@ -16299,7 +17095,10 @@ function commitResumeInner(state) {
16299
17095
  if (!deferringStagedRevealEffects) commitEffects();
16300
17096
  } finally {
16301
17097
  if (hiddenActivity !== null) rehideActivityAfterDescendantRender(hiddenActivity);
16302
- if (releaseHeld) tickTransitionCount(-1);
17098
+ if (releaseHeld) {
17099
+ tickTransitionCount(-1);
17100
+ releaseTransitionHookHolder(state);
17101
+ }
16303
17102
  }
16304
17103
  }
16305
17104
  function findScheduledVisibilityOwner(block, includeActivity, visibleMode = null) {
@@ -16619,6 +17418,7 @@ function attemptHiddenRevealInner(state, scheduledMode, reason = "update") {
16619
17418
  if (state.transitionHeld) {
16620
17419
  state.transitionHeld = false;
16621
17420
  tickTransitionCount(-1);
17421
+ releaseTransitionHookHolder(state);
16622
17422
  }
16623
17423
  if (HELD_TRANSITIONS.has(state)) {
16624
17424
  HELD_TRANSITIONS.delete(state);
@@ -16673,6 +17473,7 @@ function flushStagedReveals() {
16673
17473
  break;
16674
17474
  }
16675
17475
  }
17476
+ if (allVisible && heldTransitionHasPendingAction(HELD_SYNC_TRANSITION.entries)) return;
16676
17477
  if (allVisible && promoteHeldSyncTransition()) {
16677
17478
  STAGED_REVEALS.clear();
16678
17479
  flush();
@@ -16752,6 +17553,9 @@ function attachResume(state, thenable) {
16752
17553
  thenable.then(retry, retry);
16753
17554
  }
16754
17555
  function startTransition(fn) {
17556
+ runTransition(fn);
17557
+ }
17558
+ function runTransition(fn, hook) {
16755
17559
  ensureTransitionSwapDriver();
16756
17560
  TRANSITION_DEPTH++;
16757
17561
  const parentActionBatch = ACTIVE_TRANSITION_ACTION_BATCH;
@@ -16759,6 +17563,10 @@ function startTransition(fn) {
16759
17563
  const actionBatch = parentActionBatch ?? pendingActionBatch ?? createTransitionActionBatch();
16760
17564
  const ownsActionBatch = parentActionBatch === null && pendingActionBatch === null;
16761
17565
  ACTIVE_TRANSITION_ACTION_BATCH = actionBatch;
17566
+ if (hook !== void 0) {
17567
+ addTransitionHookToBatch(actionBatch, hook);
17568
+ publishTransitionHookBatch(actionBatch);
17569
+ }
16762
17570
  const submitRec = ACTIVE_SUBMIT_DISPATCH;
16763
17571
  if (submitRec !== null) submitRec.transitions++;
16764
17572
  let result;
@@ -16788,7 +17596,10 @@ function startTransition(fn) {
16788
17596
  tickTransitionCount(-1);
16789
17597
  if (submitRec !== null) settleSubmitTransition(submitRec);
16790
17598
  flushFormResets();
16791
- throw err;
17599
+ actionBatch.workComplete = true;
17600
+ finishTransitionHookBatch(actionBatch);
17601
+ reportTransitionError(err, hook);
17602
+ return;
16792
17603
  }
16793
17604
  if (result != null && typeof result.then === "function") {
16794
17605
  ASYNC_TRANSITION_COUNT++;
@@ -16802,16 +17613,31 @@ function startTransition(fn) {
16802
17613
  ASYNC_TRANSITION_COUNT--;
16803
17614
  if (submitRec !== null) settleSubmitTransition(submitRec);
16804
17615
  flushFormResets();
17616
+ queueMicrotask(() => {
17617
+ actionBatch.workComplete = true;
17618
+ finishTransitionHookBatch(actionBatch);
17619
+ });
16805
17620
  };
16806
- result.then(settle, settle);
17621
+ result.then(settle, (error) => {
17622
+ settle();
17623
+ reportTransitionError(error, hook);
17624
+ });
16807
17625
  } else {
16808
17626
  queueMicrotask(() => {
16809
17627
  tickTransitionCount(-1);
16810
17628
  if (submitRec !== null) settleSubmitTransition(submitRec);
16811
17629
  flushFormResets();
17630
+ actionBatch.workComplete = true;
17631
+ finishTransitionHookBatch(actionBatch);
16812
17632
  });
16813
17633
  }
16814
17634
  }
17635
+ function reportTransitionError(error, hook) {
17636
+ if (hook !== void 0 && !hook.block.disposed) {
17637
+ hook.error = { value: error };
17638
+ scheduleRender(hook.block);
17639
+ } else reportListenerError(error);
17640
+ }
16815
17641
  function useTransition(slot) {
16816
17642
  slot = resolveSlot(slot);
16817
17643
  if (slot === void 0) missingSlot("useTransition");
@@ -16819,22 +17645,33 @@ function useTransition(slot) {
16819
17645
  const block = CURRENT_BLOCK;
16820
17646
  let s = scope.hooks?.get(slot);
16821
17647
  if (s === void 0) {
16822
- const slotRef = { isPending: false, start: startTransition };
16823
- s = slotRef;
16824
- ensureHooks(scope).set(slot, slotRef);
16825
- const listener = () => {
16826
- const next = TRANSITION_PENDING_COUNT > 0;
16827
- if (slotRef.isPending !== next) {
16828
- slotRef.isPending = next;
16829
- if (!block.disposed) {
17648
+ const hook = {
17649
+ isPending: false,
17650
+ block,
17651
+ pendingBatches: 0,
17652
+ start: (fn) => {
17653
+ if (!block.disposed) runTransition(fn, hook);
17654
+ },
17655
+ publish: (pending) => {
17656
+ if (hook.isPending === pending || block.disposed) return;
17657
+ hook.isPending = pending;
17658
+ TRANSITION_LISTENER_PUBLISH_DEPTH++;
17659
+ try {
16830
17660
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__)
16831
17661
  (0, import_profiling.__profileSchedule)(block, "transition-pending", slot);
16832
17662
  scheduleRender(block);
17663
+ } finally {
17664
+ TRANSITION_LISTENER_PUBLISH_DEPTH--;
16833
17665
  }
16834
17666
  }
16835
17667
  };
16836
- TRANSITION_LISTENERS.add(listener);
16837
- registerHookCleanup(scope, () => TRANSITION_LISTENERS.delete(listener));
17668
+ s = hook;
17669
+ ensureHooks(scope).set(slot, hook);
17670
+ }
17671
+ if (s.error !== void 0) {
17672
+ const error = s.error.value;
17673
+ s.error = void 0;
17674
+ throw error;
16838
17675
  }
16839
17676
  return [s.isPending, s.start];
16840
17677
  }
@@ -16865,6 +17702,7 @@ function useActionState(action, initialState, permalinkOrSlot, slot) {
16865
17702
  }
16866
17703
  };
16867
17704
  const dispatch = ((payload) => {
17705
+ const outsideTransition = process.env.NODE_ENV !== "production" && transitionActionBatchForUpdate() === null && ACTIVE_SUBMIT_DISPATCH?.intercepted !== true;
16868
17706
  slotRef.pendingCount++;
16869
17707
  setPending(true);
16870
17708
  slotRef.chain = slotRef.chain.then(
@@ -16876,7 +17714,13 @@ function useActionState(action, initialState, permalinkOrSlot, slot) {
16876
17714
  startTransition(() => {
16877
17715
  let p;
16878
17716
  try {
16879
- p = Promise.resolve(slotRef.action(prevState, payload));
17717
+ const result = slotRef.action(prevState, payload);
17718
+ if (process.env.NODE_ENV !== "production" && outsideTransition && result != null && typeof result.then === "function") {
17719
+ console.error(
17720
+ "An async useActionState action was dispatched outside a transition or action. Use an action/formAction prop or wrap the dispatch in startTransition."
17721
+ );
17722
+ }
17723
+ p = Promise.resolve(result);
16880
17724
  } catch (err) {
16881
17725
  finish();
16882
17726
  const handler = findTryHandler(block);
@@ -16904,7 +17748,7 @@ function useActionState(action, initialState, permalinkOrSlot, slot) {
16904
17748
  resolveResult(prevState);
16905
17749
  }
16906
17750
  );
16907
- return p;
17751
+ return p.then(noop, noop);
16908
17752
  });
16909
17753
  })
16910
17754
  );
@@ -16992,6 +17836,11 @@ function useOptimistic(passthrough, updateFnOrSlot, slot) {
16992
17836
  updateFn,
16993
17837
  armed: false,
16994
17838
  add: (value) => {
17839
+ if (process.env.NODE_ENV !== "production" && TRANSITION_DEPTH === 0 && ASYNC_TRANSITION_COUNT === 0) {
17840
+ console.error(
17841
+ "An optimistic update was dispatched outside a transition or action. Wrap it in startTransition or call it from an action."
17842
+ );
17843
+ }
16995
17844
  slotRef.queue.push(value);
16996
17845
  if (TRANSITION_PENDING_COUNT > 0) {
16997
17846
  slotRef.armed = true;
@@ -17025,11 +17874,11 @@ function spawnDeferredSwap(s) {
17025
17874
  queueMicrotask(() => {
17026
17875
  if (!s.scheduled || s.block.disposed) return;
17027
17876
  s.scheduled = false;
17028
- if (Object.is(s.current, s.next)) return;
17029
- s.current = s.next;
17877
+ if (Object.is(s.value, s.next)) return;
17030
17878
  startTransition(() => {
17031
17879
  DEFERRED_SPAWN = true;
17032
17880
  try {
17881
+ stageTransitionValue(s, s.block, s.next, s.next, true);
17033
17882
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__) {
17034
17883
  (0, import_profiling.__profileSchedule)(s.block, "deferred-value", s.profileSlot);
17035
17884
  scheduleRender(s.block);
@@ -17040,6 +17889,14 @@ function spawnDeferredSwap(s) {
17040
17889
  });
17041
17890
  });
17042
17891
  }
17892
+ function hasHeldDeferredSwap(slot) {
17893
+ const entries = HELD_SYNC_TRANSITION?.entries ?? slot.block.idState.renderOwner?.transition?.entries;
17894
+ if (entries === void 0) return false;
17895
+ for (const entry of entries) {
17896
+ if (entry.slot === slot && Object.is(entry.value, slot.next)) return true;
17897
+ }
17898
+ return false;
17899
+ }
17043
17900
  function useDeferredValue(value, ...rest) {
17044
17901
  let slot = rest[rest.length - 1];
17045
17902
  slot = resolveSlot(slot);
@@ -17053,7 +17910,7 @@ function useDeferredValue(value, ...rest) {
17053
17910
  if (s === void 0) {
17054
17911
  if (hasInitial && !block.currentRenderDeferred) {
17055
17912
  s = {
17056
- current: initialValue,
17913
+ value: initialValue,
17057
17914
  next: value,
17058
17915
  scheduled: false,
17059
17916
  block,
@@ -17065,31 +17922,32 @@ function useDeferredValue(value, ...rest) {
17065
17922
  if (!Object.is(initialValue, value)) spawnDeferredSwap(s);
17066
17923
  return initialValue;
17067
17924
  }
17068
- s = { current: value, next: value, scheduled: false, block, wasHidden: hidden };
17925
+ s = { value, next: value, scheduled: false, block, wasHidden: hidden };
17069
17926
  if (typeof __OCTANE_PROFILE_ENABLED__ !== "undefined" && __OCTANE_PROFILE_ENABLED__)
17070
17927
  s.profileSlot = slot;
17071
17928
  ensureHooks(scope).set(slot, s);
17072
17929
  return value;
17073
17930
  }
17931
+ if (ACTIVE_TRANSITION_ATTEMPT !== null) journalObjectOnce(s);
17074
17932
  s.next = value;
17075
17933
  const wasHidden = s.wasHidden;
17076
17934
  s.wasHidden = hidden;
17077
- if (Object.is(s.current, value)) return s.current;
17935
+ if (Object.is(s.value, value)) return s.value;
17078
17936
  if (hidden || wasHidden) {
17079
17937
  if (hasInitial && !block.currentRenderDeferred && !Object.is(initialValue, value)) {
17080
- s.current = initialValue;
17938
+ s.value = initialValue;
17081
17939
  if (!s.scheduled) spawnDeferredSwap(s);
17082
17940
  return initialValue;
17083
17941
  }
17084
- s.current = value;
17942
+ s.value = value;
17085
17943
  return value;
17086
17944
  }
17087
17945
  if (block.currentRenderMode === "transition") {
17088
- s.current = value;
17946
+ s.value = value;
17089
17947
  return value;
17090
17948
  }
17091
- if (!s.scheduled) spawnDeferredSwap(s);
17092
- return s.current;
17949
+ if (!s.scheduled && !hasHeldDeferredSwap(s)) spawnDeferredSwap(s);
17950
+ return s.value;
17093
17951
  }
17094
17952
  function requestReset(state) {
17095
17953
  if (state.parentBlock.disposed || state.branch !== 0) return;
@@ -17163,6 +18021,7 @@ function switchToCatchInner(state, err, reportInline, adoptedStart, adoptedEnd)
17163
18021
  if (state.transitionHeld) {
17164
18022
  state.transitionHeld = false;
17165
18023
  tickTransitionCount(-1);
18024
+ releaseTransitionHookHolder(state);
17166
18025
  }
17167
18026
  abandonHeldTransition(state);
17168
18027
  if (state.catchBody === null) {
@@ -17324,6 +18183,7 @@ function sharesBlockBoundary(parent, start, end) {
17324
18183
  return parent !== null && start !== null && end !== null && parent.startMarker === start && parent.endMarker === end;
17325
18184
  }
17326
18185
  function renderBranchSlot(parentScope, slotKey, state, domParent, next, body, marker, env) {
18186
+ if (CURRENT_BLOCK?.pending && !CURRENT_BLOCK.crossRenderUpdate) return;
17327
18187
  const parentBlock = parentScope.block;
17328
18188
  const hydration = activeHydration();
17329
18189
  if (next !== state.branch) {
@@ -17988,6 +18848,7 @@ function queueActivityDeactivation(state, block, commitVersion) {
17988
18848
  });
17989
18849
  }
17990
18850
  function activityBlock(parentScope, slotKey, domParent, mode, body, anchor, env) {
18851
+ if (CURRENT_BLOCK?.pending && !CURRENT_BLOCK.crossRenderUpdate) return;
17991
18852
  if (mode === "hidden") ensureScheduledVisibilityDriver();
17992
18853
  const parentBlock = parentScope.block;
17993
18854
  const hydration = activeHydration();
@@ -18226,7 +19087,7 @@ function deactivateScope(scope, disconnectPassive = true) {
18226
19087
  const cleanup = e.cleanup;
18227
19088
  e.cleanup = void 0;
18228
19089
  try {
18229
- runEffectCleanupCallback(cleanup);
19090
+ runEffectCleanupCallback(cleanup, e.phase);
18230
19091
  } catch (err) {
18231
19092
  if (err instanceof MaximumUpdateDepthError) throw err;
18232
19093
  const handler = findTryHandler(scope.block);
@@ -18277,6 +19138,7 @@ function switchBlock(parentScope, slotKey, domParent, discriminant, cases, defau
18277
19138
  renderBranchSlot(parentScope, slotKey, state, domParent, nextIdx, body, "switch", env);
18278
19139
  }
18279
19140
  function forBlock(parentScope, slotKey, domParent, items, getKey, itemBody, flags, deps, emptyBody, anchor, ownEnd) {
19141
+ if (CURRENT_BLOCK?.pending && !CURRENT_BLOCK.crossRenderUpdate) return;
18280
19142
  const parentBlock = parentScope.block;
18281
19143
  const hydration = activeHydration();
18282
19144
  let state = parentScope.slots[slotKey];
@@ -18432,6 +19294,7 @@ function forBlock(parentScope, slotKey, domParent, items, getKey, itemBody, flag
18432
19294
  }
18433
19295
  }
18434
19296
  function keyedForBlock(parentScope, slotKey, domParent, items, getKey, itemBody, flags, deps, emptyBody, anchor, ownEnd, selectionBody) {
19297
+ if (CURRENT_BLOCK?.pending && !CURRENT_BLOCK.crossRenderUpdate) return;
18435
19298
  const state = parentScope.slots[slotKey];
18436
19299
  if (TRANSITION_JOURNAL !== null && ROOT_RENDER_TRANSACTION === null) {
18437
19300
  if (state !== void 0) {
@@ -18760,9 +19623,25 @@ function consumeAdoptQueuePrefix(adopt, count) {
18760
19623
  if (count < adopt.length) adopt.copyWithin(0, count);
18761
19624
  adopt.length -= count;
18762
19625
  }
19626
+ function checkedListKey(getKey) {
19627
+ const seen = /* @__PURE__ */ new Map();
19628
+ let warned = false;
19629
+ return (item, index) => {
19630
+ const key = getKey(item, index);
19631
+ if (!warned && seen.has(key) && seen.get(key) !== index) {
19632
+ warned = true;
19633
+ const label = typeof key === "object" || typeof key === "function" ? "[object identity]" : String(key);
19634
+ console.error(
19635
+ `Encountered two children with the same key, ${label}. Keys should be unique so that components maintain their identity across updates.`
19636
+ );
19637
+ } else seen.set(key, index);
19638
+ return key;
19639
+ };
19640
+ }
18763
19641
  function mountItemsLinear(parentBlock, state, items, getKey, itemBody, singleRoot, ssrMarkerless) {
18764
19642
  const newLen = items.length;
18765
19643
  if (newLen === 0) return;
19644
+ if (process.env.NODE_ENV !== "production") getKey = checkedListKey(getKey);
18766
19645
  if (TRANSITION_JOURNAL !== null) journalForSlot(state);
18767
19646
  const oldItems = state.items;
18768
19647
  const parentNode = state.end.parentNode;
@@ -18832,6 +19711,7 @@ function reconcileKeyed(parentBlock, state, items, getKey, itemBody, pure, singl
18832
19711
  mountItemsLinear(parentBlock, state, items, getKey, itemBody, singleRoot, ssrMarkerless);
18833
19712
  return;
18834
19713
  }
19714
+ if (process.env.NODE_ENV !== "production") getKey = checkedListKey(getKey);
18835
19715
  if (newLen === 0) {
18836
19716
  if (journalShape) journalForSlot(state);
18837
19717
  batchClearItems(state, oldItems);
@@ -19090,81 +19970,72 @@ function reconcileKeyed(parentBlock, state, items, getKey, itemBody, pure, singl
19090
19970
  }
19091
19971
  }
19092
19972
  const middleEndAnchor = afterMiddle ? afterMiddle.startMarker : state.end;
19093
- let nextBlock = afterMiddle;
19094
- let lastPlaced = null;
19095
- if (moved) {
19973
+ if (patched === newMidLen) {
19096
19974
  const seq = lis(sources, newMidLen);
19097
19975
  let seqIdx = seq.length - 1;
19976
+ let nextBlock = afterMiddle;
19098
19977
  for (let i = newMidLen - 1; i >= 0; i--) {
19099
- const targetIdx = i + prefixLen;
19100
- const key = newKeys[i];
19101
- const anchor = nextBlock ? nextBlock.startMarker : middleEndAnchor;
19102
- let block;
19103
- if (sources[i] === -1) {
19104
- const item = items[targetIdx];
19105
- block = mountItem(
19106
- parentBlock,
19107
- parentNode,
19108
- anchor,
19109
- item,
19110
- targetIdx,
19111
- itemBody,
19112
- state,
19113
- singleRoot,
19114
- ssrMarkerless
19115
- );
19116
- oldItems.set(key, block);
19117
- block.key = key;
19118
- state.size++;
19119
- } else if (seqIdx < 0 || i !== seq[seqIdx]) {
19120
- block = oldItems.get(key);
19121
- moveBlockBefore(block, anchor);
19122
- } else {
19123
- block = oldItems.get(key);
19124
- seqIdx--;
19125
- }
19978
+ const block = oldItems.get(newKeys[i]);
19979
+ if (seqIdx < 0 || i !== seq[seqIdx]) {
19980
+ moveBlockBefore(block, nextBlock ? nextBlock.startMarker : middleEndAnchor);
19981
+ } else seqIdx--;
19126
19982
  block.nextSibling = nextBlock;
19127
19983
  if (nextBlock) nextBlock.prevSibling = block;
19128
- if (lastPlaced === null) lastPlaced = block;
19984
+ else state.tail = block;
19129
19985
  nextBlock = block;
19130
19986
  }
19131
- } else {
19987
+ nextBlock.prevSibling = beforeMiddle;
19988
+ if (beforeMiddle) beforeMiddle.nextSibling = nextBlock;
19989
+ else state.head = nextBlock;
19990
+ return;
19991
+ }
19992
+ if (moved) {
19993
+ const seq = lis(sources, newMidLen);
19994
+ let seqIdx = seq.length - 1;
19995
+ let anchor = middleEndAnchor;
19132
19996
  for (let i = newMidLen - 1; i >= 0; i--) {
19133
- const targetIdx = i + prefixLen;
19134
- const key = newKeys[i];
19135
- const anchor = nextBlock ? nextBlock.startMarker : middleEndAnchor;
19136
- let block;
19137
- if (sources[i] === -1) {
19138
- const item = items[targetIdx];
19139
- block = mountItem(
19140
- parentBlock,
19141
- parentNode,
19142
- anchor,
19143
- item,
19144
- targetIdx,
19145
- itemBody,
19146
- state,
19147
- singleRoot,
19148
- ssrMarkerless
19149
- );
19150
- oldItems.set(key, block);
19151
- block.key = key;
19152
- state.size++;
19153
- } else {
19154
- block = oldItems.get(key);
19997
+ if (sources[i] === -1) continue;
19998
+ const block = oldItems.get(newKeys[i]);
19999
+ if (seqIdx < 0 || i !== seq[seqIdx]) moveBlockBefore(block, anchor);
20000
+ else seqIdx--;
20001
+ anchor = block.startMarker;
20002
+ }
20003
+ }
20004
+ let previous = beforeMiddle;
20005
+ let nextSurvivor = 0;
20006
+ for (let i = 0; i < newMidLen; i++) {
20007
+ const key = newKeys[i];
20008
+ let block;
20009
+ if (sources[i] === -1) {
20010
+ if (nextSurvivor <= i) {
20011
+ nextSurvivor = i + 1;
20012
+ while (nextSurvivor < newMidLen && sources[nextSurvivor] === -1) nextSurvivor++;
19155
20013
  }
19156
- block.nextSibling = nextBlock;
19157
- if (nextBlock) nextBlock.prevSibling = block;
19158
- if (lastPlaced === null) lastPlaced = block;
19159
- nextBlock = block;
19160
- }
20014
+ const anchor = nextSurvivor < newMidLen ? oldItems.get(newKeys[nextSurvivor]).startMarker : middleEndAnchor;
20015
+ const targetIdx = i + prefixLen;
20016
+ block = mountItem(
20017
+ parentBlock,
20018
+ parentNode,
20019
+ anchor,
20020
+ items[targetIdx],
20021
+ targetIdx,
20022
+ itemBody,
20023
+ state,
20024
+ singleRoot,
20025
+ ssrMarkerless
20026
+ );
20027
+ oldItems.set(key, block);
20028
+ block.key = key;
20029
+ state.size++;
20030
+ } else block = oldItems.get(key);
20031
+ block.prevSibling = previous;
20032
+ if (previous) previous.nextSibling = block;
20033
+ else state.head = block;
20034
+ previous = block;
19161
20035
  }
19162
- const newMiddleHead = nextBlock;
19163
- const newMiddleTail = lastPlaced;
19164
- newMiddleHead.prevSibling = beforeMiddle;
19165
- if (beforeMiddle) beforeMiddle.nextSibling = newMiddleHead;
19166
- else state.head = newMiddleHead;
19167
- if (!afterMiddle) state.tail = newMiddleTail;
20036
+ previous.nextSibling = afterMiddle;
20037
+ if (afterMiddle) afterMiddle.prevSibling = previous;
20038
+ else state.tail = previous;
19168
20039
  } finally {
19169
20040
  if (sources.length <= MAX_KEYED_REORDER_SCRATCH && (keyedReorderSources === null || keyedReorderSources.length < sources.length)) {
19170
20041
  keyedReorderSources = sources;
@@ -19870,8 +20741,19 @@ let ROOT_CONTAINER_OWNERS = null;
19870
20741
  const ROOT_RENDERABLE_BODY = ((value) => value === void 0 ? null : value);
19871
20742
  const EMPTY_ROOT_BODY = (() => void 0);
19872
20743
  function assertValidRootContainer(container) {
19873
- if (container === null || typeof container !== "object" || container.nodeType !== 1) {
19874
- throw new Error((0, import_error_codes_client_generated.formatClientError)(28));
20744
+ if (container === null || typeof container !== "object" || container.nodeType !== 1 && container.nodeType !== 9 && container.nodeType !== 11) {
20745
+ throw new Error((0, import_error_codes_client_generated.formatClientError)(63));
20746
+ }
20747
+ }
20748
+ function clearRootContainer(container) {
20749
+ if (container.nodeType !== 9) {
20750
+ container.textContent = "";
20751
+ return;
20752
+ }
20753
+ for (let child2 = container.firstChild; child2 !== null; ) {
20754
+ const next = child2.nextSibling;
20755
+ if (child2.nodeType !== 10) container.removeChild(child2);
20756
+ child2 = next;
19875
20757
  }
19876
20758
  }
19877
20759
  function claimRootContainer(container) {
@@ -19980,17 +20862,19 @@ function devHtmlNesting(childTag, ancestors, childLocation, ancestorLocation) {
19980
20862
  }
19981
20863
  function validateRootHtmlNesting(container, body) {
19982
20864
  if (process.env.NODE_ENV !== "production") {
19983
- if (componentSourceLoc(body) === void 0 || container.namespaceURI !== "http://www.w3.org/1999/xhtml" || container.localName === "div" || container.localName === "body" || container.localName === "html" || container.localName.includes("-")) {
20865
+ if (container.nodeType !== 1) return;
20866
+ const element = container;
20867
+ if (componentSourceLoc(body) === void 0 || element.namespaceURI !== "http://www.w3.org/1999/xhtml" || element.localName === "div" || element.localName === "body" || element.localName === "html" || element.localName.includes("-")) {
19984
20868
  return;
19985
20869
  }
19986
20870
  const root = container.firstElementChild;
19987
20871
  if (root === null) return;
19988
- if ((0, import_html_tree_validation.invalidHtmlNestingWithParent)(root.localName, container.localName) !== null) {
19989
- devHtmlNesting(root.localName, [container.localName]);
20872
+ if ((0, import_html_tree_validation.invalidHtmlNestingWithParent)(root.localName, element.localName) !== null) {
20873
+ devHtmlNesting(root.localName, [element.localName]);
19990
20874
  return;
19991
20875
  }
19992
20876
  let child2 = root.firstElementChild;
19993
- const ancestors = [root.localName, container.localName];
20877
+ const ancestors = [root.localName, element.localName];
19994
20878
  while (child2 !== null && child2.namespaceURI === "http://www.w3.org/1999/xhtml") {
19995
20879
  if ((0, import_html_tree_validation.invalidHtmlNestingWithAncestor)(child2.localName, ancestors) !== null) {
19996
20880
  devHtmlNesting(child2.localName, ancestors);
@@ -20055,7 +20939,7 @@ function makeRoot(container, rootBlock, currentBody, currentKey, idState, output
20055
20939
  const previousRoot = rootBlock;
20056
20940
  const previousBody = currentBody;
20057
20941
  const previousKey = currentKey;
20058
- const staged = previousRoot !== null && previousRoot.mounted && !previousRoot.disposed && !renderOwner.transaction.created?.has(previousRoot);
20942
+ const staged = container.nodeType !== 9 && previousRoot !== null && previousRoot.mounted && !previousRoot.disposed && !renderOwner.transaction.created?.has(previousRoot);
20059
20943
  const oldFirst = staged ? container.firstChild : null;
20060
20944
  const oldLast = staged ? container.lastChild : null;
20061
20945
  journalUndo(() => {
@@ -20080,7 +20964,7 @@ function makeRoot(container, rootBlock, currentBody, currentKey, idState, output
20080
20964
  end = document.createComment("/root");
20081
20965
  container.append(start, end);
20082
20966
  } else {
20083
- while (container.firstChild) container.removeChild(container.firstChild);
20967
+ clearRootContainer(container);
20084
20968
  }
20085
20969
  rootBlock = createBlock(
20086
20970
  "root",
@@ -20123,6 +21007,7 @@ function makeRoot(container, rootBlock, currentBody, currentKey, idState, output
20123
21007
  mountedRoot.pendingMode = mode ?? null;
20124
21008
  try {
20125
21009
  renderBlock(mountedRoot);
21010
+ if (QUEUE.length > 0) drainHydrationRenderPhaseUpdates(mountedRoot);
20126
21011
  if (process.env.NODE_ENV !== "production") {
20127
21012
  validateRootHtmlNesting(container, body);
20128
21013
  }
@@ -20241,7 +21126,8 @@ function makeRoot(container, rootBlock, currentBody, currentKey, idState, output
20241
21126
  false
20242
21127
  );
20243
21128
  drainRefDetaches();
20244
- container.textContent = "";
21129
+ clearRootContainer(container);
21130
+ drainDeferredPassiveUnmounts();
20245
21131
  rootBlock = null;
20246
21132
  currentBody = null;
20247
21133
  currentKey = null;
@@ -20400,7 +21286,7 @@ function hydrateRoot(container, bodyOrElement, propsOrOptions, rootOptions) {
20400
21286
  journalRootProperty(idState, "next");
20401
21287
  idState.next = 0;
20402
21288
  let firstNode = container.firstChild;
20403
- while (firstNode !== null && isRendererHydrationStyle(firstNode))
21289
+ while (firstNode !== null && (firstNode.nodeType === 10 || isRendererHydrationStyle(firstNode)))
20404
21290
  firstNode = firstNode.nextSibling;
20405
21291
  const hydration = new HydrationCapability(rootBlock, firstNode, seeds);
20406
21292
  if (nativeManifest !== void 0)
@@ -20433,7 +21319,7 @@ function hydrateRoot(container, bodyOrElement, propsOrOptions, rootOptions) {
20433
21319
  } catch (unhandled) {
20434
21320
  rollbackRootRender(owner.transaction);
20435
21321
  unmountBlock(rootBlock, false);
20436
- container.textContent = "";
21322
+ clearRootContainer(container);
20437
21323
  if (!reportUncaughtError(rootBlock, unhandled)) throw unhandled;
20438
21324
  return;
20439
21325
  }
@@ -20928,15 +21814,18 @@ function scriptResource(attrs) {
20928
21814
  hydrateRoot,
20929
21815
  ifBlock,
20930
21816
  injectStyle,
21817
+ invokeManualHook,
20931
21818
  isChildrenBlock,
20932
21819
  isValidElement,
20933
21820
  keyedForBlock,
20934
21821
  lazy,
21822
+ manualHook,
20935
21823
  mapSlot,
20936
21824
  markChildrenBlock,
20937
21825
  markDangerouslySetInnerHTMLChildren,
20938
21826
  markNativeChangeDiagnosticStatic,
20939
21827
  markSingleRoot,
21828
+ markWarm,
20940
21829
  memo,
20941
21830
  memoPublish,
20942
21831
  memoPublishAlways,