octane 0.3.1 → 0.3.2

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 (45) hide show
  1. package/dist/cjs/constants.cjs +18 -25
  2. package/dist/cjs/css.cjs +6 -0
  3. package/dist/cjs/dom-binding-protocol.cjs +37 -14
  4. package/dist/cjs/hydration/control-capture.cjs +12 -4
  5. package/dist/cjs/hydration/event-capture.cjs +6 -7
  6. package/dist/cjs/hydration-markers.cjs +40 -2
  7. package/dist/cjs/runtime-tags.cjs +55 -0
  8. package/dist/cjs/runtime.cjs +136 -113
  9. package/dist/cjs/runtime.server.cjs +34 -41
  10. package/dist/cjs/server/streamed-signals.cjs +7 -4
  11. package/dist/cjs/signals/control-binding.cjs +2 -1
  12. package/dist/cjs/stream-protocol.cjs +9 -8
  13. package/dist/cjs/version.cjs +1 -1
  14. package/dist/compiler/compile.js +70 -17
  15. package/dist/compiler/dom-bindings.js +5 -0
  16. package/dist/constants.d.ts +7 -18
  17. package/dist/constants.js +11 -9
  18. package/dist/css.d.ts +7 -0
  19. package/dist/css.js +4 -0
  20. package/dist/dom-binding-program.js +12 -5
  21. package/dist/dom-binding-protocol.d.ts +14 -1
  22. package/dist/dom-binding-protocol.js +40 -14
  23. package/dist/hydration/control-capture.d.ts +2 -0
  24. package/dist/hydration/control-capture.js +18 -5
  25. package/dist/hydration/event-capture.js +1 -2
  26. package/dist/hydration/independent-island.js +5 -5
  27. package/dist/hydration-markers.d.ts +30 -0
  28. package/dist/hydration-markers.js +27 -1
  29. package/dist/react/index.js +1 -1
  30. package/dist/react/react-compat-shared.js +5 -3
  31. package/dist/react/shared.d.ts +1 -3
  32. package/dist/react/shared.js +1 -1
  33. package/dist/runtime-tags.d.ts +34 -0
  34. package/dist/runtime-tags.js +22 -0
  35. package/dist/runtime.d.ts +5 -14
  36. package/dist/runtime.js +116 -71
  37. package/dist/runtime.server.d.ts +2 -3
  38. package/dist/runtime.server.js +25 -17
  39. package/dist/server/streamed-signals.js +7 -4
  40. package/dist/signals/control-binding.js +4 -2
  41. package/dist/stream-protocol.js +20 -9
  42. package/dist/universal-core.js +8 -4
  43. package/dist/universal-native.js +1 -1
  44. package/dist/version.js +1 -1
  45. package/package.json +3 -3
@@ -149,6 +149,7 @@ __export(runtime_exports, {
149
149
  hostComponent: () => hostComponent,
150
150
  htext: () => htext,
151
151
  htextSwap: () => htextSwap,
152
+ hydrateClaimedBindingCaches: () => hydrateClaimedBindingCaches,
152
153
  hydrateRoot: () => hydrateRoot,
153
154
  ifBlock: () => ifBlock,
154
155
  injectStyle: () => injectStyle,
@@ -336,12 +337,15 @@ var import_profiling = require("./profiling.cjs");
336
337
  var import_devtools_hook = require("./devtools-hook.cjs");
337
338
  var import_interaction_config = require("./hydration/interaction-config.cjs");
338
339
  var import_event_capture = require("./hydration/event-capture.cjs");
340
+ var import_control_capture = require("./hydration/control-capture.cjs");
339
341
  var import_sanitize_url = require("./sanitize-url.cjs");
340
342
  var import_html_tree_validation = require("./html-tree-validation.cjs");
341
343
  var import_component_flags = require("./component-flags.cjs");
342
344
  var import_error_codes_client_generated = require("./error-codes.client.generated.cjs");
343
345
  var import_form_diagnostics = require("./form-diagnostics.cjs");
344
346
  var import_dom_binding_protocol = require("./dom-binding-protocol.cjs");
347
+ var import_hydration_markers = require("./hydration-markers.cjs");
348
+ var import_runtime_tags = require("./runtime-tags.cjs");
345
349
  var import_dom_focused_move = require("./dom-focused-move.cjs");
346
350
  var import_stream_protocol = require("./stream-protocol.cjs");
347
351
  var import_renderer_bridge = require("./renderer-bridge.cjs");
@@ -381,7 +385,7 @@ function profileTrackComponent(subject, fallback) {
381
385
  function profilePortalComponent(rawBody) {
382
386
  if (typeof rawBody === "function" && (0, import_profiling.__profileHasComponentMetadata)(rawBody)) return rawBody;
383
387
  const descriptor = rawBody;
384
- return descriptor != null && descriptor.$$kind === ELEMENT_TAG && typeof descriptor.type === "function" ? descriptor.type : null;
388
+ return descriptor != null && descriptor.$$kind === import_runtime_tags.ELEMENT_TAG && typeof descriptor.type === "function" ? descriptor.type : null;
385
389
  }
386
390
  function ensureHooks(scope) {
387
391
  return scope.hooks ?? (scope.hooks = /* @__PURE__ */ new Map());
@@ -1139,7 +1143,6 @@ let NEXT_EFFECT_RENDER_VERSION = 1;
1139
1143
  const ACTIVE_WARM_PLANS = [];
1140
1144
  let NEXT_WARM_EPISODE = 1;
1141
1145
  let CURRENT_WARM_EPISODE = 0;
1142
- const RENDERER_REGION_OWNER = /* @__PURE__ */ Symbol.for("octane.renderer-region.owner");
1143
1146
  const RENDERER_REGION_DOM_OWNERS = /* @__PURE__ */ new WeakMap();
1144
1147
  let RENDERER_REGION_OWNER_COUNT = 0;
1145
1148
  const RENDERER_REGION_DOM_BINDINGS = /* @__PURE__ */ new WeakMap();
@@ -3016,19 +3019,17 @@ function vtCaptureElements(block, owner) {
3016
3019
  }
3017
3020
  const VT_SCOPE_OWNERS = /* @__PURE__ */ new WeakMap();
3018
3021
  const VT_INVALID_SCOPE_WARNED = /* @__PURE__ */ new WeakSet();
3019
- const VT_SCOPE_STYLE_ID = "octane-view-transition-scope";
3020
- const VT_SCOPE_CSS = '[vt-scope="element"]{view-transition-scope:all!important}';
3021
3022
  const VT_SCOPE_STYLED_DOCUMENTS = /* @__PURE__ */ new WeakSet();
3022
3023
  function vtInjectScopeStyle(host) {
3023
3024
  if (DEFERRED_LAYOUT_DRIVER?.stageAction(() => vtInjectScopeStyle(host), true) === true) return;
3024
3025
  const owner = host.ownerDocument;
3025
3026
  if (VT_SCOPE_STYLED_DOCUMENTS.has(owner)) return;
3026
3027
  if ((STAGED_DOM?.view(owner) ?? owner).querySelector(
3027
- `style[data-octane="${VT_SCOPE_STYLE_ID}"],style[data-href~="octane-${VT_SCOPE_STYLE_ID}"]`
3028
+ `style[data-octane="${import_css.VIEW_TRANSITION_SCOPE_STYLE_ID}"],style[data-href~="octane-${import_css.VIEW_TRANSITION_SCOPE_STYLE_ID}"]`
3028
3029
  ) === null) {
3029
3030
  const style = (STAGED_DOM?.view(owner) ?? owner).createElement("style");
3030
- (STAGED_DOM?.view(style) ?? style).setAttribute("data-octane", VT_SCOPE_STYLE_ID);
3031
- (STAGED_DOM?.view(style) ?? style).textContent = VT_SCOPE_CSS;
3031
+ (STAGED_DOM?.view(style) ?? style).setAttribute("data-octane", import_css.VIEW_TRANSITION_SCOPE_STYLE_ID);
3032
+ (STAGED_DOM?.view(style) ?? style).textContent = import_css.VIEW_TRANSITION_SCOPE_CSS;
3032
3033
  domNode(owner.head).appendChild(style);
3033
3034
  }
3034
3035
  VT_SCOPE_STYLED_DOCUMENTS.add(owner);
@@ -6832,7 +6833,7 @@ function returnSlotTail(block, state) {
6832
6833
  return null;
6833
6834
  }
6834
6835
  function renderReturnedValue(block, out) {
6835
- const isComponentDescriptor = out !== null && out.$$kind === ELEMENT_TAG && out.key == null && typeof out.type === "function";
6836
+ const isComponentDescriptor = out !== null && out.$$kind === import_runtime_tags.ELEMENT_TAG && out.key == null && typeof out.type === "function";
6836
6837
  const existingRet = block.slots[0];
6837
6838
  let replacedStart = null;
6838
6839
  let replacedEnd = null;
@@ -8403,7 +8404,6 @@ function useEffectEvent(fn, slot) {
8403
8404
  return cell.impl.apply(void 0, args);
8404
8405
  });
8405
8406
  }
8406
- const CONTEXT_TAG = /* @__PURE__ */ Symbol.for("octane.context");
8407
8407
  // @__NO_SIDE_EFFECTS__
8408
8408
  function createContext(defaultValue) {
8409
8409
  const ctx = function ProviderBody(props, scope) {
@@ -8437,7 +8437,7 @@ function __createCompiledContext(defaultValue) {
8437
8437
  return initializeContext(ctx, defaultValue);
8438
8438
  }
8439
8439
  function initializeContext(ctx, defaultValue) {
8440
- ctx.$$kind = CONTEXT_TAG;
8440
+ ctx.$$kind = import_runtime_tags.CONTEXT_TAG;
8441
8441
  ctx.defaultValue = defaultValue;
8442
8442
  ctx.$$version = 0;
8443
8443
  (0, import_context_identity.registerContext)(ctx);
@@ -8527,7 +8527,6 @@ function provideContext(scope, context, value) {
8527
8527
  }
8528
8528
  values.set(context, value);
8529
8529
  }
8530
- const CHILDREN_BLOCK = /* @__PURE__ */ Symbol.for("octane.childrenBlock");
8531
8530
  const CHILDREN_BODY = /* @__PURE__ */ Symbol.for("octane.childrenBody");
8532
8531
  function markSingleRoot(component) {
8533
8532
  component.$$singleRoot = true;
@@ -8535,7 +8534,7 @@ function markSingleRoot(component) {
8535
8534
  }
8536
8535
  function markChildrenBlock(fn, body) {
8537
8536
  if (typeof fn === "function") {
8538
- fn[CHILDREN_BLOCK] = true;
8537
+ fn[import_runtime_tags.CHILDREN_BLOCK_TAG] = true;
8539
8538
  if (body !== void 0) fn[CHILDREN_BODY] = body;
8540
8539
  }
8541
8540
  return fn;
@@ -8544,7 +8543,7 @@ function descriptorChildren(component) {
8544
8543
  return component;
8545
8544
  }
8546
8545
  function isChildrenBlock(value) {
8547
- return typeof value === "function" && value[CHILDREN_BLOCK] === true;
8546
+ return typeof value === "function" && value[import_runtime_tags.CHILDREN_BLOCK_TAG] === true;
8548
8547
  }
8549
8548
  function childrenAsBody(children) {
8550
8549
  if (typeof children === "function") return children;
@@ -8680,7 +8679,6 @@ const HYDRATE_STRATEGY_TYPES = /* @__PURE__ */ new Set([
8680
8679
  "never",
8681
8680
  "dynamic"
8682
8681
  ]);
8683
- const HYDRATE_MARKER_SELECTOR = "[data-octane-hydrate-id]";
8684
8682
  const HYDRATE_STREAM_ERROR_ATTR = "data-oct-err";
8685
8683
  const HYDRATE_STREAM_BOUNDARY_SELECTOR = `template[${import_constants.STREAM_BOUNDARY_ATTR}]`;
8686
8684
  const HYDRATE_STREAM_SCAN_MASK = 1 | 128;
@@ -9044,7 +9042,7 @@ function installHydrateInteraction(state, strategy) {
9044
9042
  // whose strategy could not yet be evaluated. Resolved boundaries get none.
9045
9043
  (state.delegatedDynamicIntent ? import_event_capture.HYDRATE_SUPPORTED_INTERACTION_EVENTS : []);
9046
9044
  const events = new Set(ownEvents);
9047
- const descendants = domNode(state.wrapper).querySelectorAll(HYDRATE_MARKER_SELECTOR);
9045
+ const descendants = domNode(state.wrapper).querySelectorAll(import_hydration_markers.HYDRATE_MARKER_SELECTOR);
9048
9046
  for (let i = 0; i < descendants.length; i++) {
9049
9047
  const nestedEvents = hydrateMarkerInteractionEvents(descendants[i]);
9050
9048
  if (nestedEvents !== null) {
@@ -9057,7 +9055,7 @@ function installHydrateInteraction(state, strategy) {
9057
9055
  if (state.hydrated) return;
9058
9056
  const rawTarget = event.target;
9059
9057
  let target = rawTarget instanceof Element ? rawTarget : rawTarget instanceof Node ? (STAGED_DOM?.view(rawTarget) ?? rawTarget).parentElement : null;
9060
- let marker = (STAGED_DOM?.view(target) ?? target)?.closest(HYDRATE_MARKER_SELECTOR) ?? state.wrapper;
9058
+ let marker = (STAGED_DOM?.view(target) ?? target)?.closest(import_hydration_markers.HYDRATE_MARKER_SELECTOR) ?? state.wrapper;
9061
9059
  let matches = ownEvents.includes(event.type);
9062
9060
  const delegatedDynamicMarkers = [];
9063
9061
  while (marker !== null && domNode(state.wrapper).contains(marker)) {
@@ -9072,7 +9070,7 @@ function installHydrateInteraction(state, strategy) {
9072
9070
  }
9073
9071
  if (marker === state.wrapper) break;
9074
9072
  marker = domNode((STAGED_DOM?.view(marker) ?? marker).parentElement)?.closest(
9075
- HYDRATE_MARKER_SELECTOR
9073
+ import_hydration_markers.HYDRATE_MARKER_SELECTOR
9076
9074
  ) ?? null;
9077
9075
  }
9078
9076
  if (!matches) return;
@@ -9702,7 +9700,7 @@ const Suspense = /* @__PURE__ */ (0, import_component_flags.markComponentFlags)(
9702
9700
  },
9703
9701
  import_component_flags.COMPONENT_FLAG_BOUNDARY,
9704
9702
  "Suspense",
9705
- /* @__PURE__ */ Symbol.for("octane.suspense")
9703
+ import_runtime_tags.SUSPENSE_TAG
9706
9704
  );
9707
9705
  function initializeViewTransitionComponent() {
9708
9706
  return (0, import_component_flags.markComponentFlags)(
@@ -9768,7 +9766,7 @@ function use(usable) {
9768
9766
  "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."
9769
9767
  );
9770
9768
  }
9771
- if (usable && usable.$$kind === CONTEXT_TAG) {
9769
+ if (usable && usable.$$kind === import_runtime_tags.CONTEXT_TAG) {
9772
9770
  return useContextInternal(usable);
9773
9771
  }
9774
9772
  if (usable == null || typeof usable.then !== "function") {
@@ -9776,13 +9774,12 @@ function use(usable) {
9776
9774
  }
9777
9775
  return useThenable(usable);
9778
9776
  }
9779
- const REACT_FOREIGN_CONTEXT_TAG = /* @__PURE__ */ Symbol.for("react.context");
9780
9777
  function useForeignContext(usable, api) {
9781
9778
  if (usable !== null && typeof usable === "object") {
9782
9779
  const bridge = rendererRegionOwnerForBlock(CURRENT_BLOCK);
9783
9780
  const mirror = bridge?.resolveForeignContext?.(usable);
9784
9781
  if (mirror != null) return useContextInternal(mirror);
9785
- if (usable.$$typeof === REACT_FOREIGN_CONTEXT_TAG) {
9782
+ if (usable.$$typeof === import_runtime_tags.REACT_CONTEXT_TAG) {
9786
9783
  throw new Error((0, import_error_codes_client_generated.formatClientError)(18, api));
9787
9784
  }
9788
9785
  }
@@ -9792,7 +9789,7 @@ function useRendererThenable(thenable) {
9792
9789
  return useThenable(thenable, true);
9793
9790
  }
9794
9791
  function useContext(context) {
9795
- if (context && context.$$kind === CONTEXT_TAG) {
9792
+ if (context && context.$$kind === import_runtime_tags.CONTEXT_TAG) {
9796
9793
  return useContextInternal(context);
9797
9794
  }
9798
9795
  return useForeignContext(context, "useContext");
@@ -9821,7 +9818,7 @@ function rendererRegionSuspenseHandler(block) {
9821
9818
  };
9822
9819
  }
9823
9820
  function bindRendererRegionOwner(props) {
9824
- const bridge = props?.[RENDERER_REGION_OWNER];
9821
+ const bridge = props?.[import_runtime_tags.RENDERER_REGION_OWNER_TAG];
9825
9822
  if (bridge === void 0) {
9826
9823
  throw new Error((0, import_error_codes_client_generated.formatClientError)(19));
9827
9824
  }
@@ -10786,7 +10783,6 @@ function memoPublish(slot, value, ...deps) {
10786
10783
  function memoPublishAlways(slot, value) {
10787
10784
  return publishMemoEntry(CURRENT_SCOPE, slot, void 0, value);
10788
10785
  }
10789
- const LAZY_COMPONENT = /* @__PURE__ */ Symbol.for("octane.lazy");
10790
10786
  const LAZY_BODY_CHECK = /* @__PURE__ */ Symbol.for("octane.lazyBodyCheck");
10791
10787
  function markLazyBodyCheck(body, check) {
10792
10788
  Object.defineProperty(body, LAZY_BODY_CHECK, {
@@ -10801,11 +10797,11 @@ function resolveLazyModule(mod) {
10801
10797
  const defaultExport = mod.default;
10802
10798
  if (defaultExport !== void 0) comp = defaultExport;
10803
10799
  }
10804
- if (typeof comp !== "function" || comp[LAZY_COMPONENT] === true) {
10800
+ if (typeof comp !== "function" || comp[import_runtime_tags.LAZY_COMPONENT_TAG] === true) {
10805
10801
  throw new Error(
10806
10802
  (0, import_error_codes_client_generated.formatClientError)(
10807
10803
  10,
10808
- comp?.[LAZY_COMPONENT] === true ? "lazy component" : typeof comp
10804
+ comp?.[import_runtime_tags.LAZY_COMPONENT_TAG] === true ? "lazy component" : typeof comp
10809
10805
  )
10810
10806
  );
10811
10807
  }
@@ -10929,7 +10925,7 @@ function lazy(load) {
10929
10925
  const nestedCheck = current[LAZY_BODY_CHECK];
10930
10926
  return nestedCheck === void 0 || nestedCheck(scope);
10931
10927
  });
10932
- Object.defineProperty(lazyWrapper, LAZY_COMPONENT, {
10928
+ Object.defineProperty(lazyWrapper, import_runtime_tags.LAZY_COMPONENT_TAG, {
10933
10929
  get() {
10934
10930
  return this === lazyWrapper;
10935
10931
  }
@@ -10954,7 +10950,7 @@ function useId(slot) {
10954
10950
  while (owner.limit !== void 0 && owner.next >= owner.limit && owner.overflow !== void 0) {
10955
10951
  owner = owner.overflow;
10956
10952
  }
10957
- s = { id: ":" + owner.prefix + "in-" + (owner.next++).toString(36) + ":" };
10953
+ s = { id: (0, import_hydration_markers.formatUseId)(owner.prefix, owner.next++) };
10958
10954
  ensureHooks(scope).set(slot, s);
10959
10955
  }
10960
10956
  return s.id;
@@ -12250,6 +12246,8 @@ function preparePresentationSignalValue(args, frame) {
12250
12246
  runWithBlockSignalOwner(scope, () => {
12251
12247
  if (!valid()) throw new Error((0, import_error_codes_client_generated.formatClientError)(77));
12252
12248
  const before = (0, import_event_capture.snapshotHydrationControl)(element);
12249
+ const priorValue = readSignalBinding(handle);
12250
+ const restored = lease === void 0 ? (0, import_control_capture.isRestoredHydrationTextarea)(element, priorValue) : !before.composing && !lease.composing() && typeof priorValue === "string" && before.value !== priorValue.replace(/\r\n?/g, "\n");
12253
12251
  const ctrl = armControlled(element);
12254
12252
  ctrl.composing = before.composing || lease?.composing() === true;
12255
12253
  if (ctrl.composing) element.addEventListener("blur", onCtrlCompositionEnd);
@@ -12271,11 +12269,15 @@ function preparePresentationSignalValue(args, frame) {
12271
12269
  if (lease !== void 0) owner.controlLeases.delete(element);
12272
12270
  if (!binding.disposed && !scope.block.disposed) {
12273
12271
  const snapshot = (0, import_event_capture.snapshotHydrationControl)(element);
12274
- binding.value = element.value;
12275
- binding.pendingControl = snapshot.editRevision > (lease === void 0 ? 0 : before.editRevision);
12272
+ binding.value = priorValue;
12273
+ binding.pendingControl = snapshot.editRevision > (lease === void 0 ? 0 : before.editRevision) || restored;
12276
12274
  installDirectSignalControl(binding);
12277
12275
  if (!binding.pendingControl) (0, import_event_capture.consumeHydrationControl)(element, snapshot.revision);
12278
- if (binding.pendingControl) queueDirectSignalControlAdoption(binding);
12276
+ if (binding.pendingControl)
12277
+ queueDirectSignalControlAdoption(
12278
+ binding,
12279
+ lease === void 0 ? 0 : before.editRevision
12280
+ );
12279
12281
  else {
12280
12282
  const current = readSignalBinding(handle);
12281
12283
  ctrl.sawV = true;
@@ -12419,7 +12421,7 @@ function presentationWrite(writer, kind, ...args) {
12419
12421
  return result;
12420
12422
  }
12421
12423
  function bindPresentationView(view, id) {
12422
- view[BINDING_VIEW_ROOT] = "[b;" + id + ";root";
12424
+ view[BINDING_VIEW_ROOT] = (0, import_dom_binding_protocol.bindingRootMarker)(id);
12423
12425
  return (0, import_component_flags.markComponentFlags)(view, import_component_flags.COMPONENT_FLAG_BOUNDARY, view.name);
12424
12426
  }
12425
12427
  const BINDING_CHILDREN_SITE = /* @__PURE__ */ Symbol.for("octane.binding.children-site");
@@ -12449,7 +12451,8 @@ function presentationStructure(writer, kind, marker, ...args) {
12449
12451
  }
12450
12452
  const range = presentationRange(frame, start, marker, kind);
12451
12453
  const expected = args[3][BINDING_VIEW_ROOT];
12452
- if (expected !== "[b;" + range.view + ";root") presentationMiss(false);
12454
+ if (range.view === void 0 || expected !== (0, import_dom_binding_protocol.bindingRootMarker)(range.view))
12455
+ presentationMiss(false);
12453
12456
  writer(...args);
12454
12457
  }
12455
12458
  function setBindingClass(element, receipt, values) {
@@ -12469,7 +12472,7 @@ function hydrationMarkerMultiplicity(data, open) {
12469
12472
  const marker = open ? import_constants.HYDRATION_START : import_constants.HYDRATION_END;
12470
12473
  if (data === marker) return 1;
12471
12474
  if (open && (data === import_constants.HYDRATION_FOR_EMPTY || data === import_constants.HYDRATION_FOR_ITEMS)) return 1;
12472
- if (open && (data.startsWith("[b;") || data.startsWith("[f")) && (0, import_dom_binding_protocol.isBindingOpenComment)(data))
12475
+ if (open && (data.startsWith(import_dom_binding_protocol.BINDING_OPEN_PREFIX) || data.startsWith(import_hydration_markers.HYDRATION_FOR_PREFIX)) && (0, import_dom_binding_protocol.isBindingOpenComment)(data))
12473
12476
  return 1;
12474
12477
  if (data.length < 2 || data.charCodeAt(0) !== marker.charCodeAt(0)) return 0;
12475
12478
  const first = data.charCodeAt(1);
@@ -12531,7 +12534,7 @@ function ssrForMarkerState(node) {
12531
12534
  const data = (STAGED_DOM?.view(node) ?? node).data;
12532
12535
  if (data === import_constants.HYDRATION_FOR_EMPTY) return 0;
12533
12536
  if (data === import_constants.HYDRATION_FOR_ITEMS) return 1;
12534
- return (0, import_dom_binding_protocol.isBindingOpenComment)(data) && data.startsWith("[f") ? data.charCodeAt(2) === 48 ? 0 : 1 : -1;
12537
+ return (0, import_dom_binding_protocol.isForBindingOpenComment)(data) ? data.charCodeAt(import_hydration_markers.HYDRATION_FOR_ARM_INDEX) === 48 ? 0 : 1 : -1;
12535
12538
  }
12536
12539
  function child(node) {
12537
12540
  if (currentHydration !== null) return (STAGED_DOM?.view(node) ?? node).firstChild;
@@ -12565,6 +12568,46 @@ function setText(node, value) {
12565
12568
  (STAGED_DOM?.view(node) ?? node).nodeValue = text;
12566
12569
  }
12567
12570
  const DIRECT_SIGNAL_BINDING = /* @__PURE__ */ Symbol("octane.direct-signal-binding");
12571
+ const CLAIMED_BINDING_VALUE = /* @__PURE__ */ Symbol("octane.claimed-binding-value");
12572
+ function hydrateClaimedBindingCaches(scope, fields) {
12573
+ if (activeHydration() === null) return;
12574
+ const bag = scope.slots[0];
12575
+ for (let i = 0; i < fields.length; i += 3) {
12576
+ const field = fields[i];
12577
+ const node = bag[fields[i + 1]];
12578
+ const element = node.nodeType === 3 ? (STAGED_DOM?.view(node) ?? node).parentNode : node;
12579
+ const claims = import_dom_binding_claims.domBindingClaims.get(element);
12580
+ if (claims === void 0) continue;
12581
+ const channel = fields[i + 2];
12582
+ const tokenOnly = channel === "#text-token";
12583
+ let claimed = claims.has(
12584
+ tokenOnly ? "#text" : channel.startsWith("style:") ? "style:" + (0, import_css.styleName)(channel.slice(6)) : channel
12585
+ );
12586
+ if (channel === "style") {
12587
+ for (const name of claims.keys())
12588
+ if (name.startsWith("style:")) {
12589
+ claimed = true;
12590
+ break;
12591
+ }
12592
+ }
12593
+ if (!claimed) continue;
12594
+ const value = channel === "style" ? (STAGED_DOM?.view(element) ?? element).style.cssText : CLAIMED_BINDING_VALUE;
12595
+ if (typeof field === "number") {
12596
+ const slots = scope.slots[field].block.slots;
12597
+ journalRootProperty(slots, 0, slots[0]);
12598
+ slots[0] = value;
12599
+ } else {
12600
+ const cached = bag[field];
12601
+ if (cached?.[DIRECT_SIGNAL_BINDING] === true) {
12602
+ if (TRANSITION_JOURNAL !== null) journalObjectOnce(cached);
12603
+ cached.value = value;
12604
+ } else if (!tokenOnly) {
12605
+ if (TRANSITION_JOURNAL !== null) journalBag();
12606
+ bag[field] = value;
12607
+ }
12608
+ }
12609
+ }
12610
+ }
12568
12611
  function isSignalHandle(value) {
12569
12612
  return (typeof value === "object" || typeof value === "function") && value !== null && value[import_types.SIGNAL_HANDLE] === true;
12570
12613
  }
@@ -12637,7 +12680,7 @@ function writeDirectSignalBoundValue(binding, value) {
12637
12680
  const element = binding.target;
12638
12681
  const tag = element.localName;
12639
12682
  if (tag === "select") setSelectValue(element, value);
12640
- else setValue(element, value, tag === "textarea" && isWritableSignal(binding.handle));
12683
+ else setValue(element, value);
12641
12684
  }
12642
12685
  function writeDirectSignalBoundChecked(binding, value) {
12643
12686
  setChecked(binding.target, value);
@@ -12766,19 +12809,19 @@ function installDirectSignalControl(binding) {
12766
12809
  )
12767
12810
  );
12768
12811
  }
12769
- function queueDirectSignalControlAdoption(binding) {
12812
+ function queueDirectSignalControlAdoption(binding, priorEditRevision = 0) {
12770
12813
  enqueueEffectEventCommitAction(() => {
12771
12814
  if (binding.disposed || binding.scope.block.disposed || !binding.pendingControl) return;
12772
12815
  (0, import_transition_state.withoutSignalCandidate)(
12773
12816
  () => runWithBlockSignalOwner(binding.scope, () => {
12774
12817
  const element = binding.target;
12775
12818
  const snapshot = (0, import_event_capture.snapshotHydrationControl)(element);
12776
- if (snapshot.editRevision > 0 && isWritableSignal(binding.handle)) {
12819
+ if (isWritableSignal(binding.handle) && (snapshot.editRevision > priorEditRevision || element.localName === "textarea" && Object.is(readSignalBinding(binding.handle), binding.value))) {
12777
12820
  binding.handle.set(directSignalControlValue(binding, snapshot));
12778
12821
  }
12779
12822
  if (binding.disposed || binding.scope.block.disposed) return;
12780
12823
  if (!(0, import_event_capture.consumeHydrationControl)(element, snapshot.revision)) {
12781
- queueDirectSignalControlAdoption(binding);
12824
+ queueDirectSignalControlAdoption(binding, priorEditRevision);
12782
12825
  return;
12783
12826
  }
12784
12827
  binding.pendingControl = false;
@@ -12812,8 +12855,9 @@ function createDirectSignalBinding(scope, target, value, site, policy, name, att
12812
12855
  };
12813
12856
  if (text !== void 0) binding.text = text;
12814
12857
  const controlSnapshot = policy.control?.snapshot(target, site) ?? null;
12815
- binding.pendingControl = activeHydration() !== null && isWritableSignal(handle) && controlSnapshot !== null && controlSnapshot.editRevision > 0;
12816
12858
  const initial = handle === null ? value : readSignalBinding(handle);
12859
+ binding.pendingControl = activeHydration() !== null && isWritableSignal(handle) && controlSnapshot !== null && (controlSnapshot.editRevision > 0 || (0, import_control_capture.isRestoredHydrationTextarea)(target, initial));
12860
+ if (binding.pendingControl) binding.value = initial;
12817
12861
  if (!binding.pendingControl) writeDirectSignalBinding(binding, initial);
12818
12862
  if (STAGED_COMMIT_CAPTURE !== null) {
12819
12863
  DEFERRED_LAYOUT_DRIVER.stageAction(() => {
@@ -13217,10 +13261,10 @@ function applyRefValue(ref, el, prevTarget) {
13217
13261
  }
13218
13262
  ref.current = el;
13219
13263
  }
13220
- const Fragment = /* @__PURE__ */ Symbol.for("octane.Fragment");
13264
+ const Fragment = import_runtime_tags.FRAGMENT_TAG;
13221
13265
  let activityDescriptorDispatch = null;
13222
13266
  function initializeActivitySentinel() {
13223
- const type = /* @__PURE__ */ Symbol.for("octane.Activity");
13267
+ const type = import_runtime_tags.ACTIVITY_TAG;
13224
13268
  activityDescriptorDispatch = { type, body: renderActivityDescriptor };
13225
13269
  return type;
13226
13270
  }
@@ -14440,7 +14484,7 @@ function resolveHostPropSources(el, sources, props, readStyle) {
14440
14484
  if (readStyle !== void 0 && "style" in resolved) resolved.style = readStyle(resolved.style);
14441
14485
  return resolved;
14442
14486
  }
14443
- function setHostPropSources(el, sources, prev, scope, hasNestedChildren = false, readStyle, deferControl = false, writableTextareaValue = false) {
14487
+ function setHostPropSources(el, sources, prev, scope, hasNestedChildren = false, readStyle, deferControl = false) {
14444
14488
  const props = /* @__PURE__ */ new Map();
14445
14489
  const resolved = resolveHostPropSources(el, sources, props, readStyle);
14446
14490
  const tag = el.localName;
@@ -14455,8 +14499,7 @@ function setHostPropSources(el, sources, prev, scope, hasNestedChildren = false,
14455
14499
  props.get("defaultValue")?.value,
14456
14500
  props.get("checked")?.value,
14457
14501
  props.get("defaultChecked")?.value,
14458
- props.get("multiple")?.value,
14459
- writableTextareaValue
14502
+ props.get("multiple")?.value
14460
14503
  );
14461
14504
  return resolved;
14462
14505
  }
@@ -14477,14 +14520,12 @@ function resolveSignalStyle(value, handles, read) {
14477
14520
  }
14478
14521
  return copy ?? value;
14479
14522
  }
14480
- function resolveSignalHostPropSources(sources, readStyle, read = readSignalBinding, textarea = false) {
14523
+ function resolveSignalHostPropSources(sources, readStyle, read = readSignalBinding) {
14481
14524
  const handles = /* @__PURE__ */ new Set();
14482
14525
  let rows;
14483
- let writableTextareaValue = false;
14484
14526
  for (let i = 0; i < sources.length; i++) {
14485
14527
  const source = sources[i];
14486
14528
  if (!source[0]) {
14487
- if (textarea && source[1] === "value") writableTextareaValue = isWritableSignal(source[2]);
14488
14529
  const value = source[1] === "children" || source[1] === "style" && readStyle !== void 0 ? source[2] : source[1] === "style" ? resolveSignalStyle(source[2], handles, read) : isSignalHandle(source[2]) ? (handles.add(source[2]), read(source[2])) : source[2];
14489
14530
  if (value !== source[2]) {
14490
14531
  rows ??= sources.slice();
@@ -14497,7 +14538,6 @@ function resolveSignalHostPropSources(sources, readStyle, read = readSignalBindi
14497
14538
  let copy;
14498
14539
  for (const name of Object.keys(spread)) {
14499
14540
  const current = spread[name];
14500
- if (textarea && name === "value") writableTextareaValue = isWritableSignal(current);
14501
14541
  const value = name === "children" || name === "style" && readStyle !== void 0 ? current : name === "style" ? resolveSignalStyle(current, handles, read) : isSignalHandle(current) ? (handles.add(current), read(current)) : current;
14502
14542
  if (value !== current) {
14503
14543
  copy ??= { ...spread };
@@ -14509,7 +14549,7 @@ function resolveSignalHostPropSources(sources, readStyle, read = readSignalBindi
14509
14549
  rows[i] = [true, copy];
14510
14550
  }
14511
14551
  }
14512
- return textarea ? { sources: rows ?? sources, handles, writableTextareaValue } : { sources: rows ?? sources, handles };
14552
+ return { sources: rows ?? sources, handles };
14513
14553
  }
14514
14554
  function winningSignalHostControl(sources, name) {
14515
14555
  let winner;
@@ -14529,21 +14569,14 @@ function updateSignalHostPropSources(binding) {
14529
14569
  if (binding.disposed || binding.pendingControl || binding.scope.block.disposed) return;
14530
14570
  try {
14531
14571
  runWithBlockSignalOwner(binding.scope, () => {
14532
- const next = resolveSignalHostPropSources(
14533
- binding.sources,
14534
- binding.readStyle,
14535
- void 0,
14536
- binding.element.localName === "textarea"
14537
- );
14572
+ const next = resolveSignalHostPropSources(binding.sources, binding.readStyle);
14538
14573
  binding.resolved = setHostPropSources(
14539
14574
  binding.element,
14540
14575
  next.sources,
14541
14576
  binding.resolved,
14542
14577
  binding.scope,
14543
14578
  binding.hasNestedChildren,
14544
- binding.readStyle,
14545
- false,
14546
- next.writableTextareaValue
14579
+ binding.readStyle
14547
14580
  );
14548
14581
  if (process.env.NODE_ENV !== "production" && STAGED_DOM === null)
14549
14582
  drainDevFormDiagnostics(binding.element);
@@ -14680,22 +14713,22 @@ function disposeSignalHostPropSources(binding) {
14680
14713
  domNode(binding.element).removeEventListener("input", binding.input);
14681
14714
  queueOwnRefDetach(binding.resolved, binding.element);
14682
14715
  }
14683
- function queueSignalHostControlAdoption(binding) {
14716
+ function queueSignalHostControlAdoption(binding, priorValue) {
14684
14717
  enqueueEffectEventCommitAction(() => {
14685
14718
  if (binding.disposed || binding.scope.block.disposed || !binding.pendingControl) return;
14686
14719
  (0, import_transition_state.withoutSignalCandidate)(
14687
14720
  () => runWithBlockSignalOwner(binding.scope, () => {
14688
14721
  const snapshot = (0, import_event_capture.snapshotHydrationControl)(binding.element);
14689
- if (snapshot.editRevision > 0) {
14722
+ const value = winningSignalHostControl(binding.sources, "value");
14723
+ if (snapshot.editRevision > 0 || binding.element.localName === "textarea" && isWritableSignal(value) && Object.is(readSignalBinding(value), priorValue)) {
14690
14724
  const checked = winningSignalHostControl(binding.sources, "checked");
14691
- const value = winningSignalHostControl(binding.sources, "value");
14692
14725
  if (isWritableSignal(checked) && snapshot.checked !== void 0)
14693
14726
  checked.set(snapshot.checked);
14694
14727
  if (isWritableSignal(value)) value.set(snapshot.selectedValues ?? snapshot.value);
14695
14728
  }
14696
14729
  if (binding.disposed || binding.scope.block.disposed) return;
14697
14730
  if (!(0, import_event_capture.consumeHydrationControl)(binding.element, snapshot.revision)) {
14698
- queueSignalHostControlAdoption(binding);
14731
+ queueSignalHostControlAdoption(binding, priorValue);
14699
14732
  return;
14700
14733
  }
14701
14734
  binding.pendingControl = false;
@@ -14808,14 +14841,9 @@ function bindSignalHostPropSources(scope, previous, element, sources, site, hasN
14808
14841
  const controlSnapshot = isWritableSignal(valueControl) || isWritableSignal(checkedControl) ? (0, import_event_capture.snapshotHydrationControl)(element) : null;
14809
14842
  if (controlSnapshot !== null) {
14810
14843
  validateDirectSignalControl(element, site);
14811
- binding.pendingControl ||= activeHydration() !== null && controlSnapshot.editRevision > 0;
14844
+ binding.pendingControl ||= activeHydration() !== null && (controlSnapshot.editRevision > 0 || isWritableSignal(valueControl) && (0, import_control_capture.isRestoredHydrationTextarea)(element, readSignalBinding(valueControl)));
14812
14845
  }
14813
- const next = resolveSignalHostPropSources(
14814
- sources,
14815
- readStyle,
14816
- void 0,
14817
- element.localName === "textarea"
14818
- );
14846
+ const next = resolveSignalHostPropSources(sources, readStyle);
14819
14847
  binding.resolved = setHostPropSources(
14820
14848
  element,
14821
14849
  next.sources,
@@ -14823,8 +14851,7 @@ function bindSignalHostPropSources(scope, previous, element, sources, site, hasN
14823
14851
  scope,
14824
14852
  hasNestedChildren,
14825
14853
  readStyle,
14826
- binding.pendingControl,
14827
- next.writableTextareaValue
14854
+ binding.pendingControl
14828
14855
  );
14829
14856
  if (STAGED_COMMIT_CAPTURE !== null) {
14830
14857
  DEFERRED_LAYOUT_DRIVER.stageAction(() => {
@@ -14846,7 +14873,7 @@ function bindSignalHostPropSources(scope, previous, element, sources, site, hasN
14846
14873
  if (!binding.pendingControl && controlSnapshot !== null)
14847
14874
  (0, import_event_capture.consumeHydrationControl)(element, controlSnapshot.revision);
14848
14875
  }
14849
- if (binding.pendingControl) queueSignalHostControlAdoption(committed);
14876
+ if (binding.pendingControl) queueSignalHostControlAdoption(committed, binding.resolved?.value);
14850
14877
  return committed;
14851
14878
  }
14852
14879
  function isAggregatedFormControlProp(el, name) {
@@ -16492,7 +16519,7 @@ function setNativeChangeDiagnosticMetadata(el, value) {
16492
16519
  if (state !== void 0) state.staticNativeChange = false;
16493
16520
  if (value === "runtime") queueDevFormDiagnostic(el, CURRENT_SCOPE ?? void 0, true);
16494
16521
  }
16495
- function setValue(el, value, writableTextareaEcho = false) {
16522
+ function setValue(el, value) {
16496
16523
  if (CURRENT_SCOPE?.block.idState.renderOwner?.controlLeases?.has(el)) presentationMiss(false);
16497
16524
  const input = el;
16498
16525
  const ctrl = armControlled(el);
@@ -16524,17 +16551,14 @@ function setValue(el, value, writableTextareaEcho = false) {
16524
16551
  const prev = ctrl.v;
16525
16552
  ctrl.v = value;
16526
16553
  if (process.env.NODE_ENV !== "production") queueDevFormDiagnostic(el, CURRENT_SCOPE ?? void 0);
16527
- if (writableTextareaEcho) {
16528
- if ((STAGED_DOM?.view(input) ?? input).value === s) return;
16529
- if (!(ctrl.composing && Object.is(prev, value))) (STAGED_DOM?.view(input) ?? input).value = s;
16530
- if ((STAGED_DOM?.view(input) ?? input).defaultValue !== s)
16531
- (STAGED_DOM?.view(input) ?? input).defaultValue = s;
16532
- return;
16533
- }
16534
16554
  if (!(ctrl.composing && Object.is(prev, value)) && valueNeedsWrite(input, value))
16535
16555
  (STAGED_DOM?.view(input) ?? input).value = s;
16536
- if ((STAGED_DOM?.view(input) ?? input).defaultValue !== s)
16537
- (STAGED_DOM?.view(input) ?? input).defaultValue = s;
16556
+ if ((STAGED_DOM?.view(input) ?? input).defaultValue !== s) {
16557
+ const text = STAGED_DOM === null && el.localName === "textarea" ? getFirstChild(el) : null;
16558
+ if (text !== null && text.nodeType === 3 && getNextSibling(text) === null)
16559
+ domNode(text).data = s;
16560
+ else (STAGED_DOM?.view(input) ?? input).defaultValue = s;
16561
+ }
16538
16562
  }
16539
16563
  function setCheckedState(input, value, ctrl) {
16540
16564
  const first = !ctrl.sawC;
@@ -16835,7 +16859,7 @@ function setFormControlSources(el, sources) {
16835
16859
  }
16836
16860
  applyFormControlValues(el, tag, value, defaultValue, checked, defaultChecked, multiple);
16837
16861
  }
16838
- function applyFormControlValues(el, tag, value, defaultValue, checked, defaultChecked, multiple, writableTextareaValue = false) {
16862
+ function applyFormControlValues(el, tag, value, defaultValue, checked, defaultChecked, multiple) {
16839
16863
  const ctrl = armControlled(el);
16840
16864
  const first = !ctrl.formSeen;
16841
16865
  const previousMultiple = ctrl.formMultiple;
@@ -16865,7 +16889,7 @@ function applyFormControlValues(el, tag, value, defaultValue, checked, defaultCh
16865
16889
  }
16866
16890
  if (tag === "textarea") {
16867
16891
  const textarea = el;
16868
- setValue(textarea, value, writableTextareaValue);
16892
+ setValue(textarea, value);
16869
16893
  if (value == null) {
16870
16894
  if (defaultValue != null) setDefaultValue(textarea, defaultValue, first);
16871
16895
  else if (!first && (STAGED_DOM?.view(textarea) ?? textarea).defaultValue !== "")
@@ -17477,7 +17501,7 @@ function normalizePortalBody(rawBody, rawProps) {
17477
17501
  if (typeof rawBody === "function") {
17478
17502
  return { body: rawBody, props: rawProps };
17479
17503
  }
17480
- if (rawBody != null && rawBody.$$kind === ELEMENT_TAG && typeof rawBody.type === "function") {
17504
+ if (rawBody != null && rawBody.$$kind === import_runtime_tags.ELEMENT_TAG && typeof rawBody.type === "function") {
17481
17505
  return {
17482
17506
  body: rawBody.type,
17483
17507
  props: rawBody.props
@@ -17491,16 +17515,14 @@ function normalizePortalBody(rawBody, rawProps) {
17491
17515
  function genericPortalBody(value, scope) {
17492
17516
  childSlot(scope, 0, scope.parentNode, value, scope.endMarker);
17493
17517
  }
17494
- const PORTAL_TAG = /* @__PURE__ */ Symbol.for("octane.portal");
17495
17518
  function portalKey(value) {
17496
17519
  return typeof value === "string" || typeof value === "number" ? String(value) : null;
17497
17520
  }
17498
17521
  // @__NO_SIDE_EFFECTS__
17499
17522
  function createPortal(body, target, props = void 0) {
17500
17523
  const key = portalKey(props);
17501
- return { $$kind: PORTAL_TAG, body, target, key, props: key === null ? props : void 0 };
17524
+ return { $$kind: import_runtime_tags.PORTAL_TAG, body, target, key, props: key === null ? props : void 0 };
17502
17525
  }
17503
- const ELEMENT_TAG = /* @__PURE__ */ Symbol.for("octane.element");
17504
17526
  const KEYED_ELEMENT_DESCRIPTORS = /* @__PURE__ */ new WeakSet();
17505
17527
  function elementKeyWasProvided(descriptor) {
17506
17528
  return descriptor.key !== null || KEYED_ELEMENT_DESCRIPTORS.has(descriptor);
@@ -17603,7 +17625,7 @@ function copyScopedElementConfig(type, config, resolve) {
17603
17625
  return props;
17604
17626
  }
17605
17627
  function scopedElementRecord(type, props, key, ref, resolve, invocationSite) {
17606
- const descriptor = { $$kind: ELEMENT_TAG, type, props, key, ref };
17628
+ const descriptor = { $$kind: import_runtime_tags.ELEMENT_TAG, type, props, key, ref };
17607
17629
  if (invocationSite !== void 0) descriptor.__octaneInvocationSite = invocationSite;
17608
17630
  Object.defineProperty(descriptor, SCOPED_CHILDREN_RESOLVER, { value: resolve });
17609
17631
  Object.defineProperty(descriptor, "children", SCOPED_CHILDREN_PROPERTY);
@@ -17659,7 +17681,7 @@ function nativeCreateScopedValue(readElement) {
17659
17681
  return scopedValueDescriptor(createNativeScopedResolver(readElement));
17660
17682
  }
17661
17683
  function scopedValueDescriptor(resolve) {
17662
- const descriptor = { $$kind: ELEMENT_TAG };
17684
+ const descriptor = { $$kind: import_runtime_tags.ELEMENT_TAG };
17663
17685
  Object.defineProperty(descriptor, SCOPED_VALUE_RECORD, { value: resolve });
17664
17686
  Object.defineProperty(descriptor, "type", SCOPED_VALUE_PROPERTIES.type);
17665
17687
  Object.defineProperty(descriptor, "props", SCOPED_VALUE_PROPERTIES.props);
@@ -17727,7 +17749,7 @@ function createElementFromConfig(invocationSite, type, props, children = EMPTY_A
17727
17749
  (0, import_shared_value_helpers.applyElementDefaultProps)(type, p);
17728
17750
  kids = p.children;
17729
17751
  const descriptor = {
17730
- $$kind: ELEMENT_TAG,
17752
+ $$kind: import_runtime_tags.ELEMENT_TAG,
17731
17753
  type,
17732
17754
  props: p,
17733
17755
  key,
@@ -17741,10 +17763,10 @@ function createElementFromConfig(invocationSite, type, props, children = EMPTY_A
17741
17763
  return finalizeElementDescriptor(descriptor);
17742
17764
  }
17743
17765
  function isElementDescriptor(v) {
17744
- return v != null && v.$$kind === ELEMENT_TAG;
17766
+ return v != null && v.$$kind === import_runtime_tags.ELEMENT_TAG;
17745
17767
  }
17746
17768
  function isHostDescriptor(v) {
17747
- return v != null && v.$$kind === ELEMENT_TAG && typeof v.type === "string";
17769
+ return v != null && v.$$kind === import_runtime_tags.ELEMENT_TAG && typeof v.type === "string";
17748
17770
  }
17749
17771
  function isValidElement(v) {
17750
17772
  return isElementDescriptor(v);
@@ -17824,7 +17846,7 @@ function cloneElement(element, config, ...children) {
17824
17846
  );
17825
17847
  } else {
17826
17848
  descriptor = {
17827
- $$kind: ELEMENT_TAG,
17849
+ $$kind: import_runtime_tags.ELEMENT_TAG,
17828
17850
  type: element.type,
17829
17851
  props,
17830
17852
  key,
@@ -17866,7 +17888,7 @@ function cloneAndReplaceElementKey(element, key) {
17866
17888
  } else {
17867
17889
  const copiedGetter = get === SCOPED_VALUE_PROPERTIES.children.get ? () => get.call(element) : get;
17868
17890
  descriptor = {
17869
- $$kind: ELEMENT_TAG,
17891
+ $$kind: import_runtime_tags.ELEMENT_TAG,
17870
17892
  type: element.type,
17871
17893
  props: element.props,
17872
17894
  key,
@@ -17883,7 +17905,7 @@ function cloneAndReplaceElementKey(element, key) {
17883
17905
  }
17884
17906
  } else {
17885
17907
  descriptor = {
17886
- $$kind: ELEMENT_TAG,
17908
+ $$kind: import_runtime_tags.ELEMENT_TAG,
17887
17909
  type: element.type,
17888
17910
  props: element.props,
17889
17911
  key,
@@ -17926,7 +17948,7 @@ function mapIntoChildren(children, out, escapedPrefix, nameSoFar, callback, vali
17926
17948
  children = null;
17927
17949
  type = "object";
17928
17950
  }
17929
- const isLeaf = children === null || type === "string" || type === "number" || type === "bigint" || isElementDescriptor(children) || children != null && children.$$kind === PORTAL_TAG;
17951
+ const isLeaf = children === null || type === "string" || type === "number" || type === "bigint" || isElementDescriptor(children) || children != null && children.$$kind === import_runtime_tags.PORTAL_TAG;
17930
17952
  if (isLeaf) {
17931
17953
  const child2 = children;
17932
17954
  let mapped = callback(child2);
@@ -18052,7 +18074,7 @@ function componentSlot(parentScope, slotKey, domParent, comp, props, anchor, key
18052
18074
  }
18053
18075
  }
18054
18076
  const renderProps = typeof comp === "string" ? {
18055
- $$kind: ELEMENT_TAG,
18077
+ $$kind: import_runtime_tags.ELEMENT_TAG,
18056
18078
  type: comp,
18057
18079
  props,
18058
18080
  key: null,
@@ -18733,8 +18755,8 @@ function warnMissingListKey(owner) {
18733
18755
  }
18734
18756
  }
18735
18757
  function deoptKey(item, index) {
18736
- const element = item != null && item.$$kind === ELEMENT_TAG;
18737
- if (item?.$$kind === PORTAL_TAG && item.key != null) return item.key;
18758
+ const element = item != null && item.$$kind === import_runtime_tags.ELEMENT_TAG;
18759
+ if (item?.$$kind === import_runtime_tags.PORTAL_TAG && item.key != null) return item.key;
18738
18760
  if (element && item.key != null && !ELEMENTS_MISSING_LIST_KEY.has(item)) return item.key;
18739
18761
  if (element && process.env.NODE_ENV !== "production" && activeHydration() === null) {
18740
18762
  warnMissingListKey(CURRENT_BLOCK);
@@ -18743,7 +18765,7 @@ function deoptKey(item, index) {
18743
18765
  }
18744
18766
  const POSITIONAL_CHILDREN = /* @__PURE__ */ new WeakSet();
18745
18767
  function deoptKeyPositional(item, index) {
18746
- return item != null && (item.$$kind === ELEMENT_TAG || item.$$kind === PORTAL_TAG) && item.key != null ? item.key : index;
18768
+ return item != null && (item.$$kind === import_runtime_tags.ELEMENT_TAG || item.$$kind === import_runtime_tags.PORTAL_TAG) && item.key != null ? item.key : index;
18747
18769
  }
18748
18770
  function positionalChildren(children) {
18749
18771
  POSITIONAL_CHILDREN.add(children);
@@ -18995,7 +19017,7 @@ function setDeoptDesc(el, d) {
18995
19017
  const children = record.children;
18996
19018
  const previous = getDeoptDesc(el);
18997
19019
  record = sameDeoptDesc(previous, record, children) ? previous : {
18998
- $$kind: ELEMENT_TAG,
19020
+ $$kind: import_runtime_tags.ELEMENT_TAG,
18999
19021
  type: record.type,
19000
19022
  props: record.props,
19001
19023
  key: record.key,
@@ -19018,7 +19040,7 @@ function fragmentDescriptorChildren(value) {
19018
19040
  }
19019
19041
  function fragmentRefDescriptor(value) {
19020
19042
  return {
19021
- $$kind: ELEMENT_TAG,
19043
+ $$kind: import_runtime_tags.ELEMENT_TAG,
19022
19044
  type: renderFragmentRefDescriptor,
19023
19045
  props: value,
19024
19046
  key: value.key,
@@ -19083,7 +19105,7 @@ function nestedDeoptKeyPrefix(path) {
19083
19105
  return "[" + JSON.stringify(path) + ",";
19084
19106
  }
19085
19107
  function appendScopedDeoptKey(outKeys, path, item, index, key, keyPrefix) {
19086
- const explicit = (isElementDescriptor(item) || item?.$$kind === PORTAL_TAG) && item.key != null;
19108
+ const explicit = (isElementDescriptor(item) || item?.$$kind === import_runtime_tags.PORTAL_TAG) && item.key != null;
19087
19109
  if (path.length === 0) {
19088
19110
  outKeys.push(explicit ? "k" + String(key) : index);
19089
19111
  return keyPrefix;
@@ -19136,7 +19158,7 @@ function flattenReactChildContainer(outItems, outKeys, children, kind, path) {
19136
19158
  }
19137
19159
  }
19138
19160
  function singleDeoptKey(item, key) {
19139
- return (isElementDescriptor(item) || item?.$$kind === PORTAL_TAG) && item.key != null ? "k" + String(key) : 0;
19161
+ return (isElementDescriptor(item) || item?.$$kind === import_runtime_tags.PORTAL_TAG) && item.key != null ? "k" + String(key) : 0;
19140
19162
  }
19141
19163
  function prepareDeoptList(value, forceSingle = false, includeKeyedSingle = true) {
19142
19164
  if (isFragmentDescriptor(value)) {
@@ -19200,7 +19222,7 @@ function flattenDeoptChildrenKeyed(outVals, outKeys, v, prefix) {
19200
19222
  if (prefix === "") {
19201
19223
  outKeys.push(typeof k2 === "string" && k2[0] === ":" ? ":" + k2 : k2);
19202
19224
  } else {
19203
- const explicit = item?.$$kind === ELEMENT_TAG && item.key != null;
19225
+ const explicit = item?.$$kind === import_runtime_tags.ELEMENT_TAG && item.key != null;
19204
19226
  outKeys.push(prefix + ":" + (explicit ? "k" : "i") + String(k2));
19205
19227
  }
19206
19228
  }
@@ -19208,7 +19230,7 @@ function flattenDeoptChildrenKeyed(outVals, outKeys, v, prefix) {
19208
19230
  return;
19209
19231
  }
19210
19232
  outVals.push(v);
19211
- const k = v?.$$kind === ELEMENT_TAG && v.key != null ? v.key : 0;
19233
+ const k = v?.$$kind === import_runtime_tags.ELEMENT_TAG && v.key != null ? v.key : 0;
19212
19234
  outKeys.push(
19213
19235
  prefix === "" ? typeof k === "string" && k[0] === ":" ? ":" + k : k : prefix + ":i0"
19214
19236
  );
@@ -19599,12 +19621,12 @@ function descNeedsBlocks(value) {
19599
19621
  return false;
19600
19622
  }
19601
19623
  if (!isElementDescriptor(value) && (0, import_shared_value_helpers.childrenIterator)(value) !== null) return true;
19602
- if (value.$$kind === ELEMENT_TAG) {
19624
+ if (value.$$kind === import_runtime_tags.ELEMENT_TAG) {
19603
19625
  if (value.type === Fragment || activityDescriptorDispatch !== null && value.type === activityDescriptorDispatch.type)
19604
19626
  return true;
19605
19627
  return typeof value.type === "function" || descNeedsBlocks(value.children);
19606
19628
  }
19607
- if (value.$$kind === PORTAL_TAG) return true;
19629
+ if (value.$$kind === import_runtime_tags.PORTAL_TAG) return true;
19608
19630
  return false;
19609
19631
  }
19610
19632
  function hostElementBody(d, block) {
@@ -19858,7 +19880,7 @@ function compilerCacheArray(value, previous) {
19858
19880
  continue;
19859
19881
  }
19860
19882
  if (item !== null && typeof item === "object") {
19861
- if (item.$$kind !== ELEMENT_TAG) {
19883
+ if (item.$$kind !== import_runtime_tags.ELEMENT_TAG) {
19862
19884
  renderable = false;
19863
19885
  continue;
19864
19886
  }
@@ -20400,7 +20422,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
20400
20422
  return;
20401
20423
  }
20402
20424
  while (value !== null && (typeof value === "object" || typeof value === "function")) {
20403
- if (value.$$kind === CONTEXT_TAG) {
20425
+ if (value.$$kind === import_runtime_tags.CONTEXT_TAG) {
20404
20426
  value = useContextInternal(value);
20405
20427
  continue;
20406
20428
  }
@@ -20556,7 +20578,7 @@ function childSlot(parentScope, slotKey, domParent, value, anchor, ownEnd, ownsH
20556
20578
  state.start = start;
20557
20579
  state.end = end;
20558
20580
  }
20559
- const portalDesc = value != null && value.$$kind === PORTAL_TAG ? value : null;
20581
+ const portalDesc = value != null && value.$$kind === import_runtime_tags.PORTAL_TAG ? value : null;
20560
20582
  if (portalDesc === null && state.portal != null) {
20561
20583
  teardownPortalState(state.portal);
20562
20584
  state.portal = null;
@@ -28139,6 +28161,7 @@ function scriptResource(attrs) {
28139
28161
  hostComponent,
28140
28162
  htext,
28141
28163
  htextSwap,
28164
+ hydrateClaimedBindingCaches,
28142
28165
  hydrateRoot,
28143
28166
  ifBlock,
28144
28167
  injectStyle,