octane 0.3.0 → 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 (55) 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/index.cjs +2 -0
  8. package/dist/cjs/runtime-tags.cjs +55 -0
  9. package/dist/cjs/runtime.cjs +235 -148
  10. package/dist/cjs/runtime.server.cjs +110 -80
  11. package/dist/cjs/server/streamed-signals.cjs +102 -64
  12. package/dist/cjs/signals/control-binding.cjs +2 -1
  13. package/dist/cjs/stream-protocol.cjs +9 -8
  14. package/dist/cjs/version.cjs +1 -1
  15. package/dist/compiler/compile.js +550 -35
  16. package/dist/compiler/dom-bindings.js +5 -0
  17. package/dist/compiler/hydrate-boundaries.js +118 -0
  18. package/dist/compiler/private-context.js +160 -0
  19. package/dist/constants.d.ts +7 -18
  20. package/dist/constants.js +11 -9
  21. package/dist/css.d.ts +7 -0
  22. package/dist/css.js +4 -0
  23. package/dist/dom-binding-program.js +12 -5
  24. package/dist/dom-binding-protocol.d.ts +14 -1
  25. package/dist/dom-binding-protocol.js +40 -14
  26. package/dist/hydration/control-capture.d.ts +2 -0
  27. package/dist/hydration/control-capture.js +18 -5
  28. package/dist/hydration/event-capture.js +1 -2
  29. package/dist/hydration/independent-island.js +5 -5
  30. package/dist/hydration/stream-delivery.d.ts +1 -1
  31. package/dist/hydration/stream-delivery.js +16 -9
  32. package/dist/hydration/stream-result-receiver.d.ts +1 -0
  33. package/dist/hydration/stream-result-receiver.js +8 -4
  34. package/dist/hydration-markers.d.ts +30 -0
  35. package/dist/hydration-markers.js +27 -1
  36. package/dist/index.d.ts +1 -1
  37. package/dist/index.js +2 -0
  38. package/dist/react/index.js +1 -1
  39. package/dist/react/react-compat-shared.js +5 -3
  40. package/dist/react/shared.d.ts +1 -3
  41. package/dist/react/shared.js +1 -1
  42. package/dist/runtime-tags.d.ts +34 -0
  43. package/dist/runtime-tags.js +22 -0
  44. package/dist/runtime.d.ts +9 -14
  45. package/dist/runtime.js +213 -106
  46. package/dist/runtime.server.d.ts +10 -5
  47. package/dist/runtime.server.js +101 -56
  48. package/dist/server/streamed-signals.d.ts +1 -0
  49. package/dist/server/streamed-signals.js +102 -64
  50. package/dist/signals/control-binding.js +4 -2
  51. package/dist/stream-protocol.js +20 -9
  52. package/dist/universal-core.js +8 -4
  53. package/dist/universal-native.js +1 -1
  54. package/dist/version.js +1 -1
  55. package/package.json +3 -3
package/dist/runtime.js CHANGED
@@ -113,6 +113,7 @@ import {
113
113
  unregisterHydrationIntentBoundary,
114
114
  wasEarlyHydrationIntentHandled
115
115
  } from "./hydration/event-capture.js";
116
+ import { isRestoredHydrationTextarea } from "./hydration/control-capture.js";
116
117
  import { sanitizeURL, sanitizeURLAttribute } from "./sanitize-url.js";
117
118
  import {
118
119
  invalidHtmlNestingWithAncestor,
@@ -126,7 +127,30 @@ import {
126
127
  } from "./component-flags.js";
127
128
  import { formatClientError } from "./error-codes.client.generated.js";
128
129
  import { formAuthoringDiagnostics } from "./form-diagnostics.js";
129
- import { isBindingOpenComment } from "./dom-binding-protocol.js";
130
+ import {
131
+ bindingRootMarker,
132
+ BINDING_OPEN_PREFIX,
133
+ isBindingOpenComment,
134
+ isForBindingOpenComment
135
+ } from "./dom-binding-protocol.js";
136
+ import {
137
+ formatUseId,
138
+ HYDRATION_FOR_ARM_INDEX,
139
+ HYDRATION_FOR_PREFIX,
140
+ HYDRATE_MARKER_SELECTOR
141
+ } from "./hydration-markers.js";
142
+ import {
143
+ ACTIVITY_TAG,
144
+ CHILDREN_BLOCK_TAG as CHILDREN_BLOCK,
145
+ CONTEXT_TAG,
146
+ ELEMENT_TAG,
147
+ FRAGMENT_TAG,
148
+ LAZY_COMPONENT_TAG as LAZY_COMPONENT,
149
+ PORTAL_TAG,
150
+ REACT_CONTEXT_TAG as REACT_FOREIGN_CONTEXT_TAG,
151
+ RENDERER_REGION_OWNER_TAG as RENDERER_REGION_OWNER,
152
+ SUSPENSE_TAG
153
+ } from "./runtime-tags.js";
130
154
  import { moveNativeNodeBefore } from "./dom-focused-move.js";
131
155
  import {
132
156
  HYDRATE_STREAM_TOKEN_ATTR,
@@ -972,7 +996,6 @@ let NEXT_EFFECT_RENDER_VERSION = 1;
972
996
  const ACTIVE_WARM_PLANS = [];
973
997
  let NEXT_WARM_EPISODE = 1;
974
998
  let CURRENT_WARM_EPISODE = 0;
975
- const RENDERER_REGION_OWNER = /* @__PURE__ */ Symbol.for("octane.renderer-region.owner");
976
999
  const RENDERER_REGION_DOM_OWNERS = /* @__PURE__ */ new WeakMap();
977
1000
  let RENDERER_REGION_OWNER_COUNT = 0;
978
1001
  const RENDERER_REGION_DOM_BINDINGS = /* @__PURE__ */ new WeakMap();
@@ -2849,8 +2872,6 @@ function vtCaptureElements(block, owner) {
2849
2872
  }
2850
2873
  const VT_SCOPE_OWNERS = /* @__PURE__ */ new WeakMap();
2851
2874
  const VT_INVALID_SCOPE_WARNED = /* @__PURE__ */ new WeakSet();
2852
- const VT_SCOPE_STYLE_ID = "octane-view-transition-scope";
2853
- const VT_SCOPE_CSS = '[vt-scope="element"]{view-transition-scope:all!important}';
2854
2875
  const VT_SCOPE_STYLED_DOCUMENTS = /* @__PURE__ */ new WeakSet();
2855
2876
  function vtInjectScopeStyle(host) {
2856
2877
  if (DEFERRED_LAYOUT_DRIVER?.stageAction(() => vtInjectScopeStyle(host), true) === true) return;
@@ -8236,12 +8257,39 @@ function useEffectEvent(fn, slot) {
8236
8257
  return cell.impl.apply(void 0, args);
8237
8258
  });
8238
8259
  }
8239
- const CONTEXT_TAG = /* @__PURE__ */ Symbol.for("octane.context");
8240
8260
  // @__NO_SIDE_EFFECTS__
8241
8261
  function createContext(defaultValue) {
8242
8262
  const ctx = function ProviderBody(props, scope) {
8243
8263
  return renderClientContextProvider(ctx, props, scope);
8244
8264
  };
8265
+ return initializeContext(ctx, defaultValue);
8266
+ }
8267
+ // @__NO_SIDE_EFFECTS__
8268
+ function __createCompiledContext(defaultValue) {
8269
+ const ctx = function ProviderBody(props, scope) {
8270
+ provideContext(scope, ctx, props.value);
8271
+ const children = props.children;
8272
+ if (children == null) return;
8273
+ const dialect = children[CHILDREN_BODY] ?? children;
8274
+ const previous = scope.hooks?.get(CHILDREN_DIALECT_SLOT);
8275
+ if (previous !== dialect) {
8276
+ if (previous !== void 0 && (previous === 2 || dialect === 2)) {
8277
+ resetScopeChildren(scope);
8278
+ if (scope.block.disposed) return;
8279
+ } else if (previous !== void 0) {
8280
+ invalidateSharedBodyOutput(scope);
8281
+ if (TRANSITION_JOURNAL !== null && !ROOT_RENDER_ROLLBACK) {
8282
+ const hooks = scope.hooks;
8283
+ journalUndo(() => hooks.set(CHILDREN_DIALECT_SLOT, previous));
8284
+ }
8285
+ }
8286
+ ensureHooks(scope).set(CHILDREN_DIALECT_SLOT, dialect);
8287
+ }
8288
+ renderSharedBody(children, void 0, scope, void 0);
8289
+ };
8290
+ return initializeContext(ctx, defaultValue);
8291
+ }
8292
+ function initializeContext(ctx, defaultValue) {
8245
8293
  ctx.$$kind = CONTEXT_TAG;
8246
8294
  ctx.defaultValue = defaultValue;
8247
8295
  ctx.$$version = 0;
@@ -8332,7 +8380,6 @@ function provideContext(scope, context, value) {
8332
8380
  }
8333
8381
  values.set(context, value);
8334
8382
  }
8335
- const CHILDREN_BLOCK = /* @__PURE__ */ Symbol.for("octane.childrenBlock");
8336
8383
  const CHILDREN_BODY = /* @__PURE__ */ Symbol.for("octane.childrenBody");
8337
8384
  function markSingleRoot(component) {
8338
8385
  component.$$singleRoot = true;
@@ -8485,7 +8532,6 @@ const HYDRATE_STRATEGY_TYPES = /* @__PURE__ */ new Set([
8485
8532
  "never",
8486
8533
  "dynamic"
8487
8534
  ]);
8488
- const HYDRATE_MARKER_SELECTOR = "[data-octane-hydrate-id]";
8489
8535
  const HYDRATE_STREAM_ERROR_ATTR = "data-oct-err";
8490
8536
  const HYDRATE_STREAM_BOUNDARY_SELECTOR = `template[${STREAM_BOUNDARY_ATTR}]`;
8491
8537
  const HYDRATE_STREAM_SCAN_MASK = 1 | 128;
@@ -8620,7 +8666,23 @@ function renderHydrateChild(state, scope, extra) {
8620
8666
  }
8621
8667
  childrenAsBody(state.props.children)(void 0, scope, extra);
8622
8668
  }
8669
+ function renderCompiledHydrateChild(state, scope, extra) {
8670
+ if (state.loadedBody !== null) {
8671
+ state.loadedBody(state.props.__data, scope, extra);
8672
+ } else {
8673
+ state.props.children(void 0, scope, extra);
8674
+ }
8675
+ }
8676
+ const EMPTY_HYDRATE_PENDING = () => void 0;
8623
8677
  function hydrateBoundaryBody(state) {
8678
+ return createHydrateBoundaryBody(state, renderHydrateChild, (_props, scope) => {
8679
+ childSlot(scope, 0, scope.block.parentNode, state.props.fallback, scope.block.endMarker);
8680
+ });
8681
+ }
8682
+ function compiledHydrateBoundaryBody(state) {
8683
+ return createHydrateBoundaryBody(state, renderCompiledHydrateChild, EMPTY_HYDRATE_PENDING);
8684
+ }
8685
+ function createHydrateBoundaryBody(state, renderChild, pendingBody) {
8624
8686
  const contentBody = (_props, scope, extra) => {
8625
8687
  try {
8626
8688
  if (state.loadedBody === null) {
@@ -8632,7 +8694,7 @@ function hydrateBoundaryBody(state) {
8632
8694
  if (thenable.status !== "fulfilled") throw new SuspenseException(thenable);
8633
8695
  }
8634
8696
  }
8635
- renderHydrateChild(state, scope, extra);
8697
+ renderChild(state, scope, extra);
8636
8698
  } catch (error) {
8637
8699
  const hydration = activeHydration();
8638
8700
  if (!state.serverPreserved || state.hydrated || hydration === null || !isSuspenseException(error)) {
@@ -8644,9 +8706,6 @@ function hydrateBoundaryBody(state) {
8644
8706
  state.hydrated = true;
8645
8707
  useEffect(notifyHydrateBoundary, [state, scope], HYDRATE_NOTIFY_SLOT);
8646
8708
  };
8647
- const pendingBody = (_props, scope) => {
8648
- childSlot(scope, 0, scope.block.parentNode, state.props.fallback, scope.block.endMarker);
8649
- };
8650
8709
  return (_props, scope) => {
8651
8710
  tryBlock(
8652
8711
  scope,
@@ -9042,7 +9101,7 @@ function findHydrateSeedSidecar(wrapper, attribute = HYDRATE_SEED_ATTR) {
9042
9101
  }
9043
9102
  return null;
9044
9103
  }
9045
- function createHydrateSlot(props, scope, boundaryId) {
9104
+ function createHydrateSlot(props, scope, boundaryId, boundaryBody) {
9046
9105
  const parentBlock = scope.block;
9047
9106
  const parentNode = parentBlock.parentNode;
9048
9107
  const hydration = activeHydration();
@@ -9160,7 +9219,7 @@ function createHydrateSlot(props, scope, boundaryId) {
9160
9219
  scope.slots[0] = state;
9161
9220
  registerSlot(scope, state);
9162
9221
  if (!state.independent) registerHydrationIntentBoundary(wrapper, intentBoundary);
9163
- block.body = hydrateBoundaryBody(state);
9222
+ block.body = boundaryBody(state);
9164
9223
  const initialStrategy = resolveHydrateStrategy(state);
9165
9224
  const pendingIntents = state.independent ? void 0 : takePendingHydrationIntents(wrapper);
9166
9225
  if (state.independent) {
@@ -9417,7 +9476,7 @@ function notifyHydrateBoundary(state, scope) {
9417
9476
  }
9418
9477
  }
9419
9478
  }
9420
- function initializeHydrateComponent() {
9479
+ function initializeHydrateComponent(boundaryBody) {
9421
9480
  const hydrate = markComponentFlags(
9422
9481
  function Hydrate2(rawProps, scope) {
9423
9482
  const props = rawProps;
@@ -9425,7 +9484,7 @@ function initializeHydrateComponent() {
9425
9484
  let state = scope.slots[0];
9426
9485
  let renderedChild = false;
9427
9486
  if (state === void 0) {
9428
- state = createHydrateSlot(props, scope, boundaryId);
9487
+ state = createHydrateSlot(props, scope, boundaryId, boundaryBody);
9429
9488
  } else {
9430
9489
  if (state.independent !== (props.__independent !== void 0)) {
9431
9490
  throw new Error(formatClientError(66));
@@ -9474,7 +9533,8 @@ function initializeHydrateComponent() {
9474
9533
  Object.defineProperty(hydrate, "__octanePermanentStatic", { value: permanentStatic });
9475
9534
  return hydrate;
9476
9535
  }
9477
- const Hydrate = /* @__PURE__ */ initializeHydrateComponent();
9536
+ const Hydrate = /* @__PURE__ */ initializeHydrateComponent(hydrateBoundaryBody);
9537
+ const __HydrateCompiled = /* @__PURE__ */ initializeHydrateComponent(compiledHydrateBoundaryBody);
9478
9538
  const Suspense = /* @__PURE__ */ markComponentFlags(
9479
9539
  function Suspense2(props, scope) {
9480
9540
  const block = scope.block;
@@ -9493,7 +9553,7 @@ const Suspense = /* @__PURE__ */ markComponentFlags(
9493
9553
  },
9494
9554
  COMPONENT_FLAG_BOUNDARY,
9495
9555
  "Suspense",
9496
- /* @__PURE__ */ Symbol.for("octane.suspense")
9556
+ SUSPENSE_TAG
9497
9557
  );
9498
9558
  function initializeViewTransitionComponent() {
9499
9559
  return markComponentFlags(
@@ -9567,7 +9627,6 @@ function use(usable) {
9567
9627
  }
9568
9628
  return useThenable(usable);
9569
9629
  }
9570
- const REACT_FOREIGN_CONTEXT_TAG = /* @__PURE__ */ Symbol.for("react.context");
9571
9630
  function useForeignContext(usable, api) {
9572
9631
  if (usable !== null && typeof usable === "object") {
9573
9632
  const bridge = rendererRegionOwnerForBlock(CURRENT_BLOCK);
@@ -10577,7 +10636,6 @@ function memoPublish(slot, value, ...deps) {
10577
10636
  function memoPublishAlways(slot, value) {
10578
10637
  return publishMemoEntry(CURRENT_SCOPE, slot, void 0, value);
10579
10638
  }
10580
- const LAZY_COMPONENT = /* @__PURE__ */ Symbol.for("octane.lazy");
10581
10639
  const LAZY_BODY_CHECK = /* @__PURE__ */ Symbol.for("octane.lazyBodyCheck");
10582
10640
  function markLazyBodyCheck(body, check) {
10583
10641
  Object.defineProperty(body, LAZY_BODY_CHECK, {
@@ -10745,7 +10803,7 @@ function useId(slot) {
10745
10803
  while (owner.limit !== void 0 && owner.next >= owner.limit && owner.overflow !== void 0) {
10746
10804
  owner = owner.overflow;
10747
10805
  }
10748
- s = { id: ":" + owner.prefix + "in-" + (owner.next++).toString(36) + ":" };
10806
+ s = { id: formatUseId(owner.prefix, owner.next++) };
10749
10807
  ensureHooks(scope).set(slot, s);
10750
10808
  }
10751
10809
  return s.id;
@@ -12041,6 +12099,8 @@ function preparePresentationSignalValue(args, frame) {
12041
12099
  runWithBlockSignalOwner(scope, () => {
12042
12100
  if (!valid()) throw new Error(formatClientError(77));
12043
12101
  const before = snapshotHydrationControl(element);
12102
+ const priorValue = readSignalBinding(handle);
12103
+ const restored = lease === void 0 ? isRestoredHydrationTextarea(element, priorValue) : !before.composing && !lease.composing() && typeof priorValue === "string" && before.value !== priorValue.replace(/\r\n?/g, "\n");
12044
12104
  const ctrl = armControlled(element);
12045
12105
  ctrl.composing = before.composing || lease?.composing() === true;
12046
12106
  if (ctrl.composing) element.addEventListener("blur", onCtrlCompositionEnd);
@@ -12062,11 +12122,15 @@ function preparePresentationSignalValue(args, frame) {
12062
12122
  if (lease !== void 0) owner.controlLeases.delete(element);
12063
12123
  if (!binding.disposed && !scope.block.disposed) {
12064
12124
  const snapshot = snapshotHydrationControl(element);
12065
- binding.value = element.value;
12066
- binding.pendingControl = snapshot.editRevision > (lease === void 0 ? 0 : before.editRevision);
12125
+ binding.value = priorValue;
12126
+ binding.pendingControl = snapshot.editRevision > (lease === void 0 ? 0 : before.editRevision) || restored;
12067
12127
  installDirectSignalControl(binding);
12068
12128
  if (!binding.pendingControl) consumeHydrationControl(element, snapshot.revision);
12069
- if (binding.pendingControl) queueDirectSignalControlAdoption(binding);
12129
+ if (binding.pendingControl)
12130
+ queueDirectSignalControlAdoption(
12131
+ binding,
12132
+ lease === void 0 ? 0 : before.editRevision
12133
+ );
12070
12134
  else {
12071
12135
  const current = readSignalBinding(handle);
12072
12136
  ctrl.sawV = true;
@@ -12210,7 +12274,7 @@ function presentationWrite(writer, kind, ...args) {
12210
12274
  return result;
12211
12275
  }
12212
12276
  function bindPresentationView(view, id) {
12213
- view[BINDING_VIEW_ROOT] = "[b;" + id + ";root";
12277
+ view[BINDING_VIEW_ROOT] = bindingRootMarker(id);
12214
12278
  return markComponentFlags(view, COMPONENT_FLAG_BOUNDARY, view.name);
12215
12279
  }
12216
12280
  const BINDING_CHILDREN_SITE = /* @__PURE__ */ Symbol.for("octane.binding.children-site");
@@ -12240,7 +12304,8 @@ function presentationStructure(writer, kind, marker, ...args) {
12240
12304
  }
12241
12305
  const range = presentationRange(frame, start, marker, kind);
12242
12306
  const expected = args[3][BINDING_VIEW_ROOT];
12243
- if (expected !== "[b;" + range.view + ";root") presentationMiss(false);
12307
+ if (range.view === void 0 || expected !== bindingRootMarker(range.view))
12308
+ presentationMiss(false);
12244
12309
  writer(...args);
12245
12310
  }
12246
12311
  function setBindingClass(element, receipt, values) {
@@ -12260,7 +12325,7 @@ function hydrationMarkerMultiplicity(data, open) {
12260
12325
  const marker = open ? HYDRATION_START : HYDRATION_END;
12261
12326
  if (data === marker) return 1;
12262
12327
  if (open && (data === HYDRATION_FOR_EMPTY || data === HYDRATION_FOR_ITEMS)) return 1;
12263
- if (open && (data.startsWith("[b;") || data.startsWith("[f")) && isBindingOpenComment(data))
12328
+ if (open && (data.startsWith(BINDING_OPEN_PREFIX) || data.startsWith(HYDRATION_FOR_PREFIX)) && isBindingOpenComment(data))
12264
12329
  return 1;
12265
12330
  if (data.length < 2 || data.charCodeAt(0) !== marker.charCodeAt(0)) return 0;
12266
12331
  const first = data.charCodeAt(1);
@@ -12322,7 +12387,7 @@ function ssrForMarkerState(node) {
12322
12387
  const data = (STAGED_DOM?.view(node) ?? node).data;
12323
12388
  if (data === HYDRATION_FOR_EMPTY) return 0;
12324
12389
  if (data === HYDRATION_FOR_ITEMS) return 1;
12325
- return isBindingOpenComment(data) && data.startsWith("[f") ? data.charCodeAt(2) === 48 ? 0 : 1 : -1;
12390
+ return isForBindingOpenComment(data) ? data.charCodeAt(HYDRATION_FOR_ARM_INDEX) === 48 ? 0 : 1 : -1;
12326
12391
  }
12327
12392
  function child(node) {
12328
12393
  if (currentHydration !== null) return (STAGED_DOM?.view(node) ?? node).firstChild;
@@ -12356,6 +12421,46 @@ function setText(node, value) {
12356
12421
  (STAGED_DOM?.view(node) ?? node).nodeValue = text;
12357
12422
  }
12358
12423
  const DIRECT_SIGNAL_BINDING = /* @__PURE__ */ Symbol("octane.direct-signal-binding");
12424
+ const CLAIMED_BINDING_VALUE = /* @__PURE__ */ Symbol("octane.claimed-binding-value");
12425
+ function hydrateClaimedBindingCaches(scope, fields) {
12426
+ if (activeHydration() === null) return;
12427
+ const bag = scope.slots[0];
12428
+ for (let i = 0; i < fields.length; i += 3) {
12429
+ const field = fields[i];
12430
+ const node = bag[fields[i + 1]];
12431
+ const element = node.nodeType === 3 ? (STAGED_DOM?.view(node) ?? node).parentNode : node;
12432
+ const claims = domBindingClaims.get(element);
12433
+ if (claims === void 0) continue;
12434
+ const channel = fields[i + 2];
12435
+ const tokenOnly = channel === "#text-token";
12436
+ let claimed = claims.has(
12437
+ tokenOnly ? "#text" : channel.startsWith("style:") ? "style:" + styleName(channel.slice(6)) : channel
12438
+ );
12439
+ if (channel === "style") {
12440
+ for (const name of claims.keys())
12441
+ if (name.startsWith("style:")) {
12442
+ claimed = true;
12443
+ break;
12444
+ }
12445
+ }
12446
+ if (!claimed) continue;
12447
+ const value = channel === "style" ? (STAGED_DOM?.view(element) ?? element).style.cssText : CLAIMED_BINDING_VALUE;
12448
+ if (typeof field === "number") {
12449
+ const slots = scope.slots[field].block.slots;
12450
+ journalRootProperty(slots, 0, slots[0]);
12451
+ slots[0] = value;
12452
+ } else {
12453
+ const cached = bag[field];
12454
+ if (cached?.[DIRECT_SIGNAL_BINDING] === true) {
12455
+ if (TRANSITION_JOURNAL !== null) journalObjectOnce(cached);
12456
+ cached.value = value;
12457
+ } else if (!tokenOnly) {
12458
+ if (TRANSITION_JOURNAL !== null) journalBag();
12459
+ bag[field] = value;
12460
+ }
12461
+ }
12462
+ }
12463
+ }
12359
12464
  function isSignalHandle(value) {
12360
12465
  return (typeof value === "object" || typeof value === "function") && value !== null && value[SIGNAL_HANDLE] === true;
12361
12466
  }
@@ -12428,7 +12533,7 @@ function writeDirectSignalBoundValue(binding, value) {
12428
12533
  const element = binding.target;
12429
12534
  const tag = element.localName;
12430
12535
  if (tag === "select") setSelectValue(element, value);
12431
- else setValue(element, value, tag === "textarea" && isWritableSignal(binding.handle));
12536
+ else setValue(element, value);
12432
12537
  }
12433
12538
  function writeDirectSignalBoundChecked(binding, value) {
12434
12539
  setChecked(binding.target, value);
@@ -12557,19 +12662,19 @@ function installDirectSignalControl(binding) {
12557
12662
  )
12558
12663
  );
12559
12664
  }
12560
- function queueDirectSignalControlAdoption(binding) {
12665
+ function queueDirectSignalControlAdoption(binding, priorEditRevision = 0) {
12561
12666
  enqueueEffectEventCommitAction(() => {
12562
12667
  if (binding.disposed || binding.scope.block.disposed || !binding.pendingControl) return;
12563
12668
  withoutSignalCandidate(
12564
12669
  () => runWithBlockSignalOwner(binding.scope, () => {
12565
12670
  const element = binding.target;
12566
12671
  const snapshot = snapshotHydrationControl(element);
12567
- if (snapshot.editRevision > 0 && isWritableSignal(binding.handle)) {
12672
+ if (isWritableSignal(binding.handle) && (snapshot.editRevision > priorEditRevision || element.localName === "textarea" && Object.is(readSignalBinding(binding.handle), binding.value))) {
12568
12673
  binding.handle.set(directSignalControlValue(binding, snapshot));
12569
12674
  }
12570
12675
  if (binding.disposed || binding.scope.block.disposed) return;
12571
12676
  if (!consumeHydrationControl(element, snapshot.revision)) {
12572
- queueDirectSignalControlAdoption(binding);
12677
+ queueDirectSignalControlAdoption(binding, priorEditRevision);
12573
12678
  return;
12574
12679
  }
12575
12680
  binding.pendingControl = false;
@@ -12603,8 +12708,9 @@ function createDirectSignalBinding(scope, target, value, site, policy, name, att
12603
12708
  };
12604
12709
  if (text !== void 0) binding.text = text;
12605
12710
  const controlSnapshot = policy.control?.snapshot(target, site) ?? null;
12606
- binding.pendingControl = activeHydration() !== null && isWritableSignal(handle) && controlSnapshot !== null && controlSnapshot.editRevision > 0;
12607
12711
  const initial = handle === null ? value : readSignalBinding(handle);
12712
+ binding.pendingControl = activeHydration() !== null && isWritableSignal(handle) && controlSnapshot !== null && (controlSnapshot.editRevision > 0 || isRestoredHydrationTextarea(target, initial));
12713
+ if (binding.pendingControl) binding.value = initial;
12608
12714
  if (!binding.pendingControl) writeDirectSignalBinding(binding, initial);
12609
12715
  if (STAGED_COMMIT_CAPTURE !== null) {
12610
12716
  DEFERRED_LAYOUT_DRIVER.stageAction(() => {
@@ -12712,6 +12818,8 @@ function bindSignalText(scope, previous, position, value, site, onlyChild = fals
12712
12818
  );
12713
12819
  }
12714
12820
  function bindSignalAttribute(scope, previous, element, name, value, site, attributeKind = "attr") {
12821
+ if (previous === value && value !== void 0 && (value === null || typeof value !== "object" && typeof value !== "function"))
12822
+ return previous;
12715
12823
  return bindDirectSignal(
12716
12824
  scope,
12717
12825
  previous,
@@ -13006,10 +13114,10 @@ function applyRefValue(ref, el, prevTarget) {
13006
13114
  }
13007
13115
  ref.current = el;
13008
13116
  }
13009
- const Fragment = /* @__PURE__ */ Symbol.for("octane.Fragment");
13117
+ const Fragment = FRAGMENT_TAG;
13010
13118
  let activityDescriptorDispatch = null;
13011
13119
  function initializeActivitySentinel() {
13012
- const type = /* @__PURE__ */ Symbol.for("octane.Activity");
13120
+ const type = ACTIVITY_TAG;
13013
13121
  activityDescriptorDispatch = { type, body: renderActivityDescriptor };
13014
13122
  return type;
13015
13123
  }
@@ -13933,7 +14041,9 @@ import {
13933
14041
  devWarnStyleProperty,
13934
14042
  mergeClass,
13935
14043
  normalizeClass,
13936
- styleName
14044
+ styleName,
14045
+ VIEW_TRANSITION_SCOPE_CSS as VT_SCOPE_CSS,
14046
+ VIEW_TRANSITION_SCOPE_STYLE_ID as VT_SCOPE_STYLE_ID
13937
14047
  } from "./css.js";
13938
14048
  function setClassName(el, value) {
13939
14049
  const cls = normalizeClass(value);
@@ -13990,7 +14100,14 @@ function setStyleProperty(el, name, value, staticCss, previous) {
13990
14100
  }
13991
14101
  const remove = value == null || typeof value === "boolean";
13992
14102
  if (remove && previous === CURRENT_SCOPE) return;
13993
- if (TRANSITION_JOURNAL !== null) journalAttr(el, "style");
14103
+ if (TRANSITION_JOURNAL !== null) {
14104
+ const log = TRANSITION_JOURNAL;
14105
+ let tail = log.length - 4;
14106
+ if (log[tail] === JOURNAL_BAG && log[tail + 1] === CURRENT_SCOPE?.slots[0]) tail -= 4;
14107
+ if (tail < TRANSITION_JOURNAL_CHECKPOINT || log[tail] !== JOURNAL_ATTR || log[tail + 1] !== el || log[tail + 2] !== "style")
14108
+ journalAttr(el, "style");
14109
+ else journalBag();
14110
+ }
13994
14111
  if (hiddenStyleWriter !== null && hiddenStyleWriter(el, value, previous, name)) return;
13995
14112
  const style = (STAGED_DOM?.view(el) ?? el).style;
13996
14113
  if (remove) style.removeProperty(styleName(name));
@@ -14229,7 +14346,7 @@ function resolveHostPropSources(el, sources, props, readStyle) {
14229
14346
  if (readStyle !== void 0 && "style" in resolved) resolved.style = readStyle(resolved.style);
14230
14347
  return resolved;
14231
14348
  }
14232
- function setHostPropSources(el, sources, prev, scope, hasNestedChildren = false, readStyle, deferControl = false, writableTextareaValue = false) {
14349
+ function setHostPropSources(el, sources, prev, scope, hasNestedChildren = false, readStyle, deferControl = false) {
14233
14350
  const props = /* @__PURE__ */ new Map();
14234
14351
  const resolved = resolveHostPropSources(el, sources, props, readStyle);
14235
14352
  const tag = el.localName;
@@ -14244,8 +14361,7 @@ function setHostPropSources(el, sources, prev, scope, hasNestedChildren = false,
14244
14361
  props.get("defaultValue")?.value,
14245
14362
  props.get("checked")?.value,
14246
14363
  props.get("defaultChecked")?.value,
14247
- props.get("multiple")?.value,
14248
- writableTextareaValue
14364
+ props.get("multiple")?.value
14249
14365
  );
14250
14366
  return resolved;
14251
14367
  }
@@ -14266,14 +14382,12 @@ function resolveSignalStyle(value, handles, read) {
14266
14382
  }
14267
14383
  return copy ?? value;
14268
14384
  }
14269
- function resolveSignalHostPropSources(sources, readStyle, read = readSignalBinding, textarea = false) {
14385
+ function resolveSignalHostPropSources(sources, readStyle, read = readSignalBinding) {
14270
14386
  const handles = /* @__PURE__ */ new Set();
14271
14387
  let rows;
14272
- let writableTextareaValue = false;
14273
14388
  for (let i = 0; i < sources.length; i++) {
14274
14389
  const source = sources[i];
14275
14390
  if (!source[0]) {
14276
- if (textarea && source[1] === "value") writableTextareaValue = isWritableSignal(source[2]);
14277
14391
  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];
14278
14392
  if (value !== source[2]) {
14279
14393
  rows ??= sources.slice();
@@ -14286,7 +14400,6 @@ function resolveSignalHostPropSources(sources, readStyle, read = readSignalBindi
14286
14400
  let copy;
14287
14401
  for (const name of Object.keys(spread)) {
14288
14402
  const current = spread[name];
14289
- if (textarea && name === "value") writableTextareaValue = isWritableSignal(current);
14290
14403
  const value = name === "children" || name === "style" && readStyle !== void 0 ? current : name === "style" ? resolveSignalStyle(current, handles, read) : isSignalHandle(current) ? (handles.add(current), read(current)) : current;
14291
14404
  if (value !== current) {
14292
14405
  copy ??= { ...spread };
@@ -14298,7 +14411,7 @@ function resolveSignalHostPropSources(sources, readStyle, read = readSignalBindi
14298
14411
  rows[i] = [true, copy];
14299
14412
  }
14300
14413
  }
14301
- return textarea ? { sources: rows ?? sources, handles, writableTextareaValue } : { sources: rows ?? sources, handles };
14414
+ return { sources: rows ?? sources, handles };
14302
14415
  }
14303
14416
  function winningSignalHostControl(sources, name) {
14304
14417
  let winner;
@@ -14318,21 +14431,14 @@ function updateSignalHostPropSources(binding) {
14318
14431
  if (binding.disposed || binding.pendingControl || binding.scope.block.disposed) return;
14319
14432
  try {
14320
14433
  runWithBlockSignalOwner(binding.scope, () => {
14321
- const next = resolveSignalHostPropSources(
14322
- binding.sources,
14323
- binding.readStyle,
14324
- void 0,
14325
- binding.element.localName === "textarea"
14326
- );
14434
+ const next = resolveSignalHostPropSources(binding.sources, binding.readStyle);
14327
14435
  binding.resolved = setHostPropSources(
14328
14436
  binding.element,
14329
14437
  next.sources,
14330
14438
  binding.resolved,
14331
14439
  binding.scope,
14332
14440
  binding.hasNestedChildren,
14333
- binding.readStyle,
14334
- false,
14335
- next.writableTextareaValue
14441
+ binding.readStyle
14336
14442
  );
14337
14443
  if (process.env.NODE_ENV !== "production" && STAGED_DOM === null)
14338
14444
  drainDevFormDiagnostics(binding.element);
@@ -14469,22 +14575,22 @@ function disposeSignalHostPropSources(binding) {
14469
14575
  domNode(binding.element).removeEventListener("input", binding.input);
14470
14576
  queueOwnRefDetach(binding.resolved, binding.element);
14471
14577
  }
14472
- function queueSignalHostControlAdoption(binding) {
14578
+ function queueSignalHostControlAdoption(binding, priorValue) {
14473
14579
  enqueueEffectEventCommitAction(() => {
14474
14580
  if (binding.disposed || binding.scope.block.disposed || !binding.pendingControl) return;
14475
14581
  withoutSignalCandidate(
14476
14582
  () => runWithBlockSignalOwner(binding.scope, () => {
14477
14583
  const snapshot = snapshotHydrationControl(binding.element);
14478
- if (snapshot.editRevision > 0) {
14584
+ const value = winningSignalHostControl(binding.sources, "value");
14585
+ if (snapshot.editRevision > 0 || binding.element.localName === "textarea" && isWritableSignal(value) && Object.is(readSignalBinding(value), priorValue)) {
14479
14586
  const checked = winningSignalHostControl(binding.sources, "checked");
14480
- const value = winningSignalHostControl(binding.sources, "value");
14481
14587
  if (isWritableSignal(checked) && snapshot.checked !== void 0)
14482
14588
  checked.set(snapshot.checked);
14483
14589
  if (isWritableSignal(value)) value.set(snapshot.selectedValues ?? snapshot.value);
14484
14590
  }
14485
14591
  if (binding.disposed || binding.scope.block.disposed) return;
14486
14592
  if (!consumeHydrationControl(binding.element, snapshot.revision)) {
14487
- queueSignalHostControlAdoption(binding);
14593
+ queueSignalHostControlAdoption(binding, priorValue);
14488
14594
  return;
14489
14595
  }
14490
14596
  binding.pendingControl = false;
@@ -14597,14 +14703,9 @@ function bindSignalHostPropSources(scope, previous, element, sources, site, hasN
14597
14703
  const controlSnapshot = isWritableSignal(valueControl) || isWritableSignal(checkedControl) ? snapshotHydrationControl(element) : null;
14598
14704
  if (controlSnapshot !== null) {
14599
14705
  validateDirectSignalControl(element, site);
14600
- binding.pendingControl ||= activeHydration() !== null && controlSnapshot.editRevision > 0;
14706
+ binding.pendingControl ||= activeHydration() !== null && (controlSnapshot.editRevision > 0 || isWritableSignal(valueControl) && isRestoredHydrationTextarea(element, readSignalBinding(valueControl)));
14601
14707
  }
14602
- const next = resolveSignalHostPropSources(
14603
- sources,
14604
- readStyle,
14605
- void 0,
14606
- element.localName === "textarea"
14607
- );
14708
+ const next = resolveSignalHostPropSources(sources, readStyle);
14608
14709
  binding.resolved = setHostPropSources(
14609
14710
  element,
14610
14711
  next.sources,
@@ -14612,8 +14713,7 @@ function bindSignalHostPropSources(scope, previous, element, sources, site, hasN
14612
14713
  scope,
14613
14714
  hasNestedChildren,
14614
14715
  readStyle,
14615
- binding.pendingControl,
14616
- next.writableTextareaValue
14716
+ binding.pendingControl
14617
14717
  );
14618
14718
  if (STAGED_COMMIT_CAPTURE !== null) {
14619
14719
  DEFERRED_LAYOUT_DRIVER.stageAction(() => {
@@ -14635,7 +14735,7 @@ function bindSignalHostPropSources(scope, previous, element, sources, site, hasN
14635
14735
  if (!binding.pendingControl && controlSnapshot !== null)
14636
14736
  consumeHydrationControl(element, controlSnapshot.revision);
14637
14737
  }
14638
- if (binding.pendingControl) queueSignalHostControlAdoption(committed);
14738
+ if (binding.pendingControl) queueSignalHostControlAdoption(committed, binding.resolved?.value);
14639
14739
  return committed;
14640
14740
  }
14641
14741
  function isAggregatedFormControlProp(el, name) {
@@ -15031,14 +15131,16 @@ function setEventHandler(el, key, handler) {
15031
15131
  SCOPE_SIGNAL_OWNERS.set(owner, false);
15032
15132
  const owners = SIGNAL_EVENT_OWNERS ??= /* @__PURE__ */ new WeakMap();
15033
15133
  if (STAGED_COMMIT_CAPTURE !== null)
15034
- DEFERRED_LAYOUT_DRIVER.stageAction(() => owners.set(el, owner));
15134
+ DEFERRED_LAYOUT_DRIVER.stageAction(() => {
15135
+ if (owners.get(el) !== owner) owners.set(el, owner);
15136
+ });
15035
15137
  else {
15036
- if (TRANSITION_JOURNAL !== null) {
15037
- const previous = owners.get(el);
15038
- if (previous !== owner)
15138
+ const previous = owners.get(el);
15139
+ if (previous !== owner) {
15140
+ if (TRANSITION_JOURNAL !== null)
15039
15141
  TRANSITION_JOURNAL.push(JOURNAL_EVENT_OWNER, owners, el, previous);
15142
+ owners.set(el, owner);
15040
15143
  }
15041
- owners.set(el, owner);
15042
15144
  }
15043
15145
  }
15044
15146
  }
@@ -15050,9 +15152,11 @@ function evt0(el, key, fn) {
15050
15152
  }
15051
15153
  function evt0u(d, fn) {
15052
15154
  if (STAGED_COMMIT_CAPTURE !== null) d = DEFERRED_LAYOUT_DRIVER.projectEventBundle(d);
15053
- if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
15054
- if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
15055
- d.fn = fn;
15155
+ if (d.fn !== fn) {
15156
+ if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
15157
+ if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
15158
+ d.fn = fn;
15159
+ }
15056
15160
  if ((SIGNAL_BINDINGS_ENABLED || signalDocumentEnabled || activeSynchronousSignalOwner !== null || activeSignalOwnerEnvironment !== void 0 || SIGNAL_EVENT_OWNERS !== null) && (activeSynchronousSignalOwner !== null || activeSignalOwnerEnvironment !== void 0 || STAGED_COMMIT_CAPTURE !== null || signalDocumentEnabled || CURRENT_SCOPE?.block.idState.renderOwner?.signalOwner !== void 0 || SIGNAL_EVENT_OWNERS?.get(d.el) !== CURRENT_SCOPE))
15057
15161
  setEventHandler(d.el);
15058
15162
  }
@@ -15063,10 +15167,12 @@ function evt1(el, key, fn, a0) {
15063
15167
  }
15064
15168
  function evt1u(d, fn, a0) {
15065
15169
  if (STAGED_COMMIT_CAPTURE !== null) d = DEFERRED_LAYOUT_DRIVER.projectEventBundle(d);
15066
- if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
15067
- if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
15068
- d.fn = fn;
15069
- d.a0 = a0;
15170
+ if (d.fn !== fn || !Object.is(d.a0, a0)) {
15171
+ if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
15172
+ if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
15173
+ d.fn = fn;
15174
+ d.a0 = a0;
15175
+ }
15070
15176
  if ((SIGNAL_BINDINGS_ENABLED || signalDocumentEnabled || activeSynchronousSignalOwner !== null || activeSignalOwnerEnvironment !== void 0 || SIGNAL_EVENT_OWNERS !== null) && (activeSynchronousSignalOwner !== null || activeSignalOwnerEnvironment !== void 0 || STAGED_COMMIT_CAPTURE !== null || signalDocumentEnabled || CURRENT_SCOPE?.block.idState.renderOwner?.signalOwner !== void 0 || SIGNAL_EVENT_OWNERS?.get(d.el) !== CURRENT_SCOPE))
15071
15177
  setEventHandler(d.el);
15072
15178
  }
@@ -15077,11 +15183,13 @@ function evt2(el, key, fn, a0, a1) {
15077
15183
  }
15078
15184
  function evt2u(d, fn, a0, a1) {
15079
15185
  if (STAGED_COMMIT_CAPTURE !== null) d = DEFERRED_LAYOUT_DRIVER.projectEventBundle(d);
15080
- if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
15081
- if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
15082
- d.fn = fn;
15083
- d.a0 = a0;
15084
- d.a1 = a1;
15186
+ if (d.fn !== fn || !Object.is(d.a0, a0) || !Object.is(d.a1, a1)) {
15187
+ if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
15188
+ if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
15189
+ d.fn = fn;
15190
+ d.a0 = a0;
15191
+ d.a1 = a1;
15192
+ }
15085
15193
  if ((SIGNAL_BINDINGS_ENABLED || signalDocumentEnabled || activeSynchronousSignalOwner !== null || activeSignalOwnerEnvironment !== void 0 || SIGNAL_EVENT_OWNERS !== null) && (activeSynchronousSignalOwner !== null || activeSignalOwnerEnvironment !== void 0 || STAGED_COMMIT_CAPTURE !== null || signalDocumentEnabled || CURRENT_SCOPE?.block.idState.renderOwner?.signalOwner !== void 0 || SIGNAL_EVENT_OWNERS?.get(d.el) !== CURRENT_SCOPE))
15086
15194
  setEventHandler(d.el);
15087
15195
  }
@@ -15102,10 +15210,12 @@ function evtN(el, key, fn, args) {
15102
15210
  }
15103
15211
  function evtNu(d, fn, args) {
15104
15212
  if (STAGED_COMMIT_CAPTURE !== null) d = DEFERRED_LAYOUT_DRIVER.projectEventBundle(d);
15105
- if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
15106
- if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
15107
- d.fn = fn;
15108
- d.args = args;
15213
+ if (d.fn !== fn || d.args !== args) {
15214
+ if (_dispatchDepth !== 0) preserveDispatchedBundle(d);
15215
+ if (TRANSITION_JOURNAL !== null) journalObjectOnce(d);
15216
+ d.fn = fn;
15217
+ d.args = args;
15218
+ }
15109
15219
  if ((SIGNAL_BINDINGS_ENABLED || signalDocumentEnabled || activeSynchronousSignalOwner !== null || activeSignalOwnerEnvironment !== void 0 || SIGNAL_EVENT_OWNERS !== null) && (activeSynchronousSignalOwner !== null || activeSignalOwnerEnvironment !== void 0 || STAGED_COMMIT_CAPTURE !== null || signalDocumentEnabled || CURRENT_SCOPE?.block.idState.renderOwner?.signalOwner !== void 0 || SIGNAL_EVENT_OWNERS?.get(d.el) !== CURRENT_SCOPE))
15110
15220
  setEventHandler(d.el);
15111
15221
  }
@@ -16271,7 +16381,7 @@ function setNativeChangeDiagnosticMetadata(el, value) {
16271
16381
  if (state !== void 0) state.staticNativeChange = false;
16272
16382
  if (value === "runtime") queueDevFormDiagnostic(el, CURRENT_SCOPE ?? void 0, true);
16273
16383
  }
16274
- function setValue(el, value, writableTextareaEcho = false) {
16384
+ function setValue(el, value) {
16275
16385
  if (CURRENT_SCOPE?.block.idState.renderOwner?.controlLeases?.has(el)) presentationMiss(false);
16276
16386
  const input = el;
16277
16387
  const ctrl = armControlled(el);
@@ -16303,17 +16413,14 @@ function setValue(el, value, writableTextareaEcho = false) {
16303
16413
  const prev = ctrl.v;
16304
16414
  ctrl.v = value;
16305
16415
  if (process.env.NODE_ENV !== "production") queueDevFormDiagnostic(el, CURRENT_SCOPE ?? void 0);
16306
- if (writableTextareaEcho) {
16307
- if ((STAGED_DOM?.view(input) ?? input).value === s) return;
16308
- if (!(ctrl.composing && Object.is(prev, value))) (STAGED_DOM?.view(input) ?? input).value = s;
16309
- if ((STAGED_DOM?.view(input) ?? input).defaultValue !== s)
16310
- (STAGED_DOM?.view(input) ?? input).defaultValue = s;
16311
- return;
16312
- }
16313
16416
  if (!(ctrl.composing && Object.is(prev, value)) && valueNeedsWrite(input, value))
16314
16417
  (STAGED_DOM?.view(input) ?? input).value = s;
16315
- if ((STAGED_DOM?.view(input) ?? input).defaultValue !== s)
16316
- (STAGED_DOM?.view(input) ?? input).defaultValue = s;
16418
+ if ((STAGED_DOM?.view(input) ?? input).defaultValue !== s) {
16419
+ const text = STAGED_DOM === null && el.localName === "textarea" ? getFirstChild(el) : null;
16420
+ if (text !== null && text.nodeType === 3 && getNextSibling(text) === null)
16421
+ domNode(text).data = s;
16422
+ else (STAGED_DOM?.view(input) ?? input).defaultValue = s;
16423
+ }
16317
16424
  }
16318
16425
  function setCheckedState(input, value, ctrl) {
16319
16426
  const first = !ctrl.sawC;
@@ -16614,7 +16721,7 @@ function setFormControlSources(el, sources) {
16614
16721
  }
16615
16722
  applyFormControlValues(el, tag, value, defaultValue, checked, defaultChecked, multiple);
16616
16723
  }
16617
- function applyFormControlValues(el, tag, value, defaultValue, checked, defaultChecked, multiple, writableTextareaValue = false) {
16724
+ function applyFormControlValues(el, tag, value, defaultValue, checked, defaultChecked, multiple) {
16618
16725
  const ctrl = armControlled(el);
16619
16726
  const first = !ctrl.formSeen;
16620
16727
  const previousMultiple = ctrl.formMultiple;
@@ -16644,7 +16751,7 @@ function applyFormControlValues(el, tag, value, defaultValue, checked, defaultCh
16644
16751
  }
16645
16752
  if (tag === "textarea") {
16646
16753
  const textarea = el;
16647
- setValue(textarea, value, writableTextareaValue);
16754
+ setValue(textarea, value);
16648
16755
  if (value == null) {
16649
16756
  if (defaultValue != null) setDefaultValue(textarea, defaultValue, first);
16650
16757
  else if (!first && (STAGED_DOM?.view(textarea) ?? textarea).defaultValue !== "")
@@ -17270,7 +17377,6 @@ function normalizePortalBody(rawBody, rawProps) {
17270
17377
  function genericPortalBody(value, scope) {
17271
17378
  childSlot(scope, 0, scope.parentNode, value, scope.endMarker);
17272
17379
  }
17273
- const PORTAL_TAG = /* @__PURE__ */ Symbol.for("octane.portal");
17274
17380
  function portalKey(value) {
17275
17381
  return typeof value === "string" || typeof value === "number" ? String(value) : null;
17276
17382
  }
@@ -17279,7 +17385,6 @@ function createPortal(body, target, props = void 0) {
17279
17385
  const key = portalKey(props);
17280
17386
  return { $$kind: PORTAL_TAG, body, target, key, props: key === null ? props : void 0 };
17281
17387
  }
17282
- const ELEMENT_TAG = /* @__PURE__ */ Symbol.for("octane.element");
17283
17388
  const KEYED_ELEMENT_DESCRIPTORS = /* @__PURE__ */ new WeakSet();
17284
17389
  function elementKeyWasProvided(descriptor) {
17285
17390
  return descriptor.key !== null || KEYED_ELEMENT_DESCRIPTORS.has(descriptor);
@@ -24932,6 +25037,7 @@ function forBlock(parentScope, slotKey, domParent, inputItems, getKey, itemBody,
24932
25037
  parentScope.slots[slotKey] = state;
24933
25038
  registerSlot(parentScope, state);
24934
25039
  }
25040
+ if (hydration !== null && state.size === 0) hydration.node = getNextSibling(state.start);
24935
25041
  const serverMarkerState = hydration?.markerState(state.start) ?? -1;
24936
25042
  if (ROOT_RENDER_TRANSACTION !== null && state.env !== deps)
24937
25043
  journalRootProperty(state, "env", state.env);
@@ -25025,6 +25131,7 @@ function forBlock(parentScope, slotKey, domParent, inputItems, getKey, itemBody,
25025
25131
  (f & 2) !== 0,
25026
25132
  (f & 16) !== 0
25027
25133
  );
25134
+ if (hydration !== null) discardLeftoverHydrationItems(state.end, hydration);
25028
25135
  } else {
25029
25136
  reconcileKeyed(
25030
25137
  parentBlock,
@@ -25039,10 +25146,7 @@ function forBlock(parentScope, slotKey, domParent, inputItems, getKey, itemBody,
25039
25146
  (f & 16) !== 0
25040
25147
  );
25041
25148
  }
25042
- if (hydration !== null) {
25043
- discardLeftoverHydrationItems(state.end, hydration);
25044
- hydration.node = getNextSibling(state.end);
25045
- }
25149
+ if (hydration !== null) hydration.node = getNextSibling(state.end);
25046
25150
  }
25047
25151
  function keyedForBlock(parentScope, slotKey, domParent, items, getKey, itemBody, flags, deps, emptyBody, anchor, ownEnd, selectionBody) {
25048
25152
  if (CURRENT_BLOCK?.pending && !CURRENT_BLOCK.crossRenderUpdate) return;
@@ -27800,6 +27904,8 @@ export {
27800
27904
  TsrxErrorBoundary,
27801
27905
  ViewTransition,
27802
27906
  ViewTransitionPseudoElement,
27907
+ __HydrateCompiled,
27908
+ __createCompiledContext,
27803
27909
  __createVoidRoot,
27804
27910
  __hydrateVoidRoot,
27805
27911
  __useLinkedStateWithGetter,
@@ -27916,6 +28022,7 @@ export {
27916
28022
  hostComponent,
27917
28023
  htext,
27918
28024
  htextSwap,
28025
+ hydrateClaimedBindingCaches,
27919
28026
  hydrateRoot,
27920
28027
  ifBlock,
27921
28028
  injectStyle,