vue 3.6.0-beta.12 → 3.6.0-beta.13

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.12
2
+ * vue v3.6.0-beta.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1222,9 +1222,6 @@ function targetTypeMap(rawType) {
1222
1222
  default: return 0;
1223
1223
  }
1224
1224
  }
1225
- function getTargetType(value) {
1226
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
1227
- }
1228
1225
  /* @__NO_SIDE_EFFECTS__ */
1229
1226
  function reactive(target) {
1230
1227
  if (/* @__PURE__ */ isReadonly(target)) return target;
@@ -1337,10 +1334,11 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1337
1334
  return target;
1338
1335
  }
1339
1336
  if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
1340
- const targetType = getTargetType(target);
1341
- if (targetType === 0) return target;
1337
+ if (target["__v_skip"] || !Object.isExtensible(target)) return target;
1342
1338
  const existingProxy = proxyMap.get(target);
1343
1339
  if (existingProxy) return existingProxy;
1340
+ const targetType = targetTypeMap(toRawType(target));
1341
+ if (targetType === 0) return target;
1344
1342
  const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
1345
1343
  proxyMap.set(target, proxy);
1346
1344
  return proxy;
@@ -3216,17 +3214,16 @@ const TeleportImpl = {
3216
3214
  },
3217
3215
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
3218
3216
  const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
3219
- let shouldRemove = doRemove || !isTeleportDisabled(props);
3217
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
3220
3218
  const pendingMount = pendingMounts.get(vnode);
3221
3219
  if (pendingMount) {
3222
3220
  pendingMount.flags |= 4;
3223
3221
  pendingMounts.delete(vnode);
3224
- shouldRemove = false;
3225
3222
  }
3226
3223
  if (targetStart) hostRemove(targetStart);
3227
3224
  if (targetAnchor) hostRemove(targetAnchor);
3228
3225
  doRemove && hostRemove(anchor);
3229
- if (shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3226
+ if (!pendingMount && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3230
3227
  const child = children[i];
3231
3228
  unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3232
3229
  }
@@ -3887,15 +3884,11 @@ function createHydrationFunctions(rendererInternals) {
3887
3884
  }
3888
3885
  if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
3889
3886
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
3890
- let hasWarned = false;
3887
+ if (next && !isMismatchAllowed(el, 1)) {
3888
+ warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
3889
+ logMismatchError$1();
3890
+ }
3891
3891
  while (next) {
3892
- if (!isMismatchAllowed(el, 1)) {
3893
- if (!hasWarned) {
3894
- warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
3895
- hasWarned = true;
3896
- }
3897
- logMismatchError$1();
3898
- }
3899
3892
  const cur = next;
3900
3893
  next = next.nextSibling;
3901
3894
  remove(cur);
@@ -3934,7 +3927,7 @@ function createHydrationFunctions(rendererInternals) {
3934
3927
  optimized = optimized || !!parentVNode.dynamicChildren;
3935
3928
  const children = parentVNode.children;
3936
3929
  const l = children.length;
3937
- let hasWarned = false;
3930
+ let hasCheckedMismatch = false;
3938
3931
  for (let i = 0; i < l; i++) {
3939
3932
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
3940
3933
  const isText = vnode.type === Text$1;
@@ -3948,12 +3941,12 @@ function createHydrationFunctions(rendererInternals) {
3948
3941
  node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3949
3942
  } else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
3950
3943
  else {
3951
- if (!isMismatchAllowed(container, 1)) {
3952
- if (!hasWarned) {
3944
+ if (!hasCheckedMismatch) {
3945
+ hasCheckedMismatch = true;
3946
+ if (!isMismatchAllowed(container, 1)) {
3953
3947
  warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
3954
- hasWarned = true;
3948
+ logMismatchError$1();
3955
3949
  }
3956
- logMismatchError$1();
3957
3950
  }
3958
3951
  patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
3959
3952
  }
@@ -6995,8 +6988,10 @@ function baseCreateRenderer(options, createHydrationFns) {
6995
6988
  else hostInsert(el, container, anchor);
6996
6989
  };
6997
6990
  const performLeave = () => {
6991
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
6998
6992
  if (el._isLeaving) el[leaveCbKey](true);
6999
- leave(el, () => {
6993
+ if (transition.persisted && !wasLeaving) remove();
6994
+ else leave(el, () => {
7000
6995
  remove();
7001
6996
  afterLeave && afterLeave();
7002
6997
  });
@@ -7217,6 +7212,10 @@ function invalidateMount(hooks) {
7217
7212
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
7218
7213
  }
7219
7214
  function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
7215
+ if (force && transition.persisted && !el[leaveCbKey]) {
7216
+ insert();
7217
+ return;
7218
+ }
7220
7219
  if (force || needTransition(parentSuspense, transition)) {
7221
7220
  transition.beforeEnter(el);
7222
7221
  insert();
@@ -8469,7 +8468,7 @@ function isMemoSame(cached, memo) {
8469
8468
  }
8470
8469
  //#endregion
8471
8470
  //#region packages/runtime-core/src/index.ts
8472
- const version = "3.6.0-beta.12";
8471
+ const version = "3.6.0-beta.13";
8473
8472
  const warn = warn$1;
8474
8473
  /**
8475
8474
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -9077,7 +9076,21 @@ function createInvoker$1(initialValue, instance) {
9077
9076
  const invoker = (e) => {
9078
9077
  if (!e._vts) e._vts = Date.now();
9079
9078
  else if (e._vts <= invoker.attached) return;
9080
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
9079
+ const value = invoker.value;
9080
+ if (isArray(value)) {
9081
+ const originalStop = e.stopImmediatePropagation;
9082
+ e.stopImmediatePropagation = () => {
9083
+ originalStop.call(e);
9084
+ e._stopped = true;
9085
+ };
9086
+ const handlers = value.slice();
9087
+ const args = [e];
9088
+ for (let i = 0; i < handlers.length; i++) {
9089
+ if (e._stopped) break;
9090
+ const handler = handlers[i];
9091
+ if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
9092
+ }
9093
+ } else callWithAsyncErrorHandling(value, instance, 5, [e]);
9081
9094
  };
9082
9095
  invoker.value = initialValue;
9083
9096
  invoker.attached = getNow();
@@ -9088,16 +9101,6 @@ function sanitizeEventValue(value, propName) {
9088
9101
  warn(`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?\nExpected function or array of functions, received type ${typeof value}.`);
9089
9102
  return NOOP;
9090
9103
  }
9091
- function patchStopImmediatePropagation(e, value) {
9092
- if (isArray(value)) {
9093
- const originalStop = e.stopImmediatePropagation;
9094
- e.stopImmediatePropagation = () => {
9095
- originalStop.call(e);
9096
- e._stopped = true;
9097
- };
9098
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
9099
- } else return value;
9100
- }
9101
9104
  //#endregion
9102
9105
  //#region packages/runtime-dom/src/patchProp.ts
9103
9106
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
@@ -10125,6 +10128,7 @@ function resetInsertionState() {
10125
10128
  }
10126
10129
  //#endregion
10127
10130
  //#region packages/runtime-vapor/src/dom/hydration.ts
10131
+ const START_TAG_RE = /^<([^\s/>]+)/;
10128
10132
  let isHydratingEnabled = false;
10129
10133
  function setIsHydratingEnabled$1(value) {
10130
10134
  isHydratingEnabled = value;
@@ -10247,18 +10251,18 @@ function exitHydrationCursor(cursor) {
10247
10251
  * Locate the first non-fragment-comment node and locate the next node
10248
10252
  * while handling potential fragments.
10249
10253
  */
10250
- function adoptTemplateImpl(node, template) {
10254
+ function adoptTemplateImpl(node, template, adoptChildren = false, ns) {
10251
10255
  if (!(template[0] === "<" && template[1] === "!")) {
10252
10256
  if (template.trim() === "" && isComment(node, "]") && isComment(node.previousSibling, "[")) node.before(node = /* @__PURE__ */ createTextNode());
10253
10257
  node = resolveHydrationTarget(node);
10254
10258
  }
10255
10259
  const type = node.nodeType;
10256
- if (type === 8 && !template.startsWith("<!") || type === 1 && !template.startsWith(`<` + node.tagName.toLowerCase())) node = handleMismatch(node, template);
10260
+ if (type === 8 && !template.startsWith("<!") || type === 1 && !template.startsWith(`<` + node.tagName.toLowerCase())) node = handleMismatch(node, template, adoptChildren, ns);
10257
10261
  advanceHydrationNode(node);
10258
10262
  return node;
10259
10263
  }
10260
- function locateNextNode(node) {
10261
- return isComment(node, "[") ? /* @__PURE__ */ _next(locateEndAnchor(node)) : isComment(node, "teleport start") ? /* @__PURE__ */ _next(locateEndAnchor(node, "teleport start", "teleport end")) : /* @__PURE__ */ _next(node);
10264
+ function nextLogicalSibling(node) {
10265
+ return isComment(node, "[") ? locateEndAnchor(node).nextSibling : isComment(node, "teleport start") ? locateEndAnchor(node, "teleport start", "teleport end").nextSibling : node.nextSibling;
10262
10266
  }
10263
10267
  function locateHydrationNodeImpl(consumeFragmentStart = false) {
10264
10268
  let node;
@@ -10287,18 +10291,15 @@ function locateHydrationBoundaryClose(node, closeHint = null) {
10287
10291
  let close = closeHint;
10288
10292
  if (!close || !isComment(close, "]")) if (isComment(node, "]")) close = node;
10289
10293
  else {
10290
- let candidate = locateNextNode(node);
10291
- while (candidate && !isComment(candidate, "]")) candidate = locateNextNode(candidate);
10294
+ let candidate = nextLogicalSibling(node);
10295
+ while (candidate && !isComment(candidate, "]")) candidate = nextLogicalSibling(candidate);
10292
10296
  close = candidate;
10293
10297
  }
10294
10298
  if (!close) return node;
10295
10299
  return close;
10296
10300
  }
10297
- function handleMismatch(node, template) {
10298
- if (!isMismatchAllowed(node.parentElement, 1)) {
10299
- warn(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node, "[[") ? `(start of block node)` : ``, `\n- expected on client:`, template);
10300
- logMismatchError();
10301
- }
10301
+ function handleMismatch(node, template, adoptChildren, ns) {
10302
+ warnHydrationNodeMismatch(node, template);
10302
10303
  if (isComment(node, "[")) removeFragmentNodes(node);
10303
10304
  const shouldPreserveAnchor = isHydrationAnchor(node);
10304
10305
  const container = /* @__PURE__ */ parentNode(node);
@@ -10306,17 +10307,46 @@ function handleMismatch(node, template) {
10306
10307
  if (!shouldPreserveAnchor) remove(node, container);
10307
10308
  if (template[0] !== "<") return container.insertBefore(/* @__PURE__ */ createTextNode(template), next);
10308
10309
  const t = /* @__PURE__ */ createElement("template");
10309
- t.innerHTML = template;
10310
- const newNode = (/* @__PURE__ */ _child(t.content)).cloneNode(true);
10311
- if (node.nodeType === 1) {
10312
- newNode.innerHTML = node.innerHTML;
10313
- Array.from(node.attributes).forEach((attr) => {
10314
- newNode.setAttribute(attr.name, attr.value);
10315
- });
10310
+ let newNode;
10311
+ if (ns) {
10312
+ const tag = ns === 1 ? "svg" : "math";
10313
+ t.innerHTML = `<${tag}>${template}</${tag}>`;
10314
+ newNode = (/* @__PURE__ */ _child(/* @__PURE__ */ _child(t.content))).cloneNode(true);
10315
+ } else {
10316
+ t.innerHTML = template;
10317
+ newNode = (/* @__PURE__ */ _child(t.content)).cloneNode(true);
10318
+ }
10319
+ if (adoptChildren && node.nodeType === 1 && !newNode.firstChild) {
10320
+ let child = node.firstChild;
10321
+ while (child) {
10322
+ const nextChild = child.nextSibling;
10323
+ newNode.appendChild(child);
10324
+ child = nextChild;
10325
+ }
10316
10326
  }
10317
10327
  container.insertBefore(newNode, next);
10318
10328
  return newNode;
10319
10329
  }
10330
+ function validateHydrationTarget(node, template) {
10331
+ let expectedType;
10332
+ if (template[0] !== "<") expectedType = 3;
10333
+ else if (template[1] === "!") expectedType = 8;
10334
+ else expectedType = 1;
10335
+ if (node.nodeType !== expectedType) {
10336
+ warnHydrationNodeMismatch(node, template);
10337
+ return;
10338
+ }
10339
+ if (expectedType !== 1) return;
10340
+ const match = START_TAG_RE.exec(template);
10341
+ const expectedTag = match && match[1];
10342
+ if (expectedTag && node.tagName.toLowerCase() !== expectedTag.toLowerCase()) warnHydrationNodeMismatch(node, template);
10343
+ }
10344
+ function warnHydrationNodeMismatch(node, expected) {
10345
+ if (!isMismatchAllowed(node.parentElement, 1)) {
10346
+ warn(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node, "[[") ? `(start of block node)` : ``, `\n- expected on client:`, expected);
10347
+ logMismatchError();
10348
+ }
10349
+ }
10320
10350
  let hasLoggedMismatchError = false;
10321
10351
  const logMismatchError = () => {
10322
10352
  if (hasLoggedMismatchError) return;
@@ -10358,7 +10388,7 @@ function cleanupHydrationTail(node, container) {
10358
10388
  }
10359
10389
  let current = node;
10360
10390
  while (current && current.parentNode === container) {
10361
- const next = locateNextNode(current);
10391
+ const next = nextLogicalSibling(current);
10362
10392
  removeHydrationNode(current);
10363
10393
  current = next;
10364
10394
  }
@@ -10389,7 +10419,7 @@ function finalizeHydrationBoundary(close) {
10389
10419
  let hasRemovableNode = false;
10390
10420
  while (cur && cur !== close) {
10391
10421
  if (!isHydrationAnchor(cur)) hasRemovableNode = true;
10392
- cur = locateNextNode(cur);
10422
+ cur = nextLogicalSibling(cur);
10393
10423
  }
10394
10424
  if (!cur) return;
10395
10425
  if (!hasRemovableNode) {
@@ -10398,7 +10428,7 @@ function finalizeHydrationBoundary(close) {
10398
10428
  }
10399
10429
  warnHydrationChildrenMismatch(close.parentElement);
10400
10430
  while (node && node !== close) {
10401
- const next = locateNextNode(node);
10431
+ const next = nextLogicalSibling(node);
10402
10432
  if (!isHydrationAnchor(node)) removeHydrationNode(node, close);
10403
10433
  node = next;
10404
10434
  }
@@ -10481,7 +10511,7 @@ function locateChildByLogicalIndex(parent, logicalIndex) {
10481
10511
  child.$idx = logicalIndex;
10482
10512
  return parent.$llc = child;
10483
10513
  }
10484
- child = isComment(child, "[") ? locateEndAnchor(child).nextSibling : child.nextSibling;
10514
+ child = nextLogicalSibling(child);
10485
10515
  fromIndex++;
10486
10516
  }
10487
10517
  return null;
@@ -10535,6 +10565,66 @@ function propGetter(rawProps, key) {
10535
10565
  return rawProps[key] && resolveSource(rawProps[key]);
10536
10566
  }
10537
10567
  //#endregion
10568
+ //#region packages/runtime-vapor/src/renderEffect.ts
10569
+ var RenderEffect = class extends ReactiveEffect {
10570
+ constructor(render, noLifecycle = false) {
10571
+ super(noLifecycle ? render : void 0);
10572
+ this.render = render;
10573
+ const instance = currentInstance;
10574
+ if (!this.subs && !isVaporComponent(instance)) warn("renderEffect called without active EffectScope or Vapor instance.");
10575
+ const job = () => {
10576
+ if (this.dirty) this.run();
10577
+ };
10578
+ if (instance) {
10579
+ if (!noLifecycle) {
10580
+ this.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
10581
+ this.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
10582
+ }
10583
+ if (instance.type.ce) (instance.renderEffects || (instance.renderEffects = [])).push(this);
10584
+ job.i = instance;
10585
+ }
10586
+ this.job = job;
10587
+ this.i = instance;
10588
+ this.flags |= 128;
10589
+ this.job.flags |= 2;
10590
+ }
10591
+ fn() {
10592
+ const instance = this.i;
10593
+ const scope = this.subs ? this.subs.sub : void 0;
10594
+ const hasUpdateHooks = instance && (instance.bu || instance.u);
10595
+ if (instance) startMeasure(instance, `renderEffect`);
10596
+ const prev = setCurrentInstance(instance, scope);
10597
+ try {
10598
+ if (hasUpdateHooks && instance.isMounted && !instance.isUpdating) {
10599
+ instance.isUpdating = true;
10600
+ try {
10601
+ instance.bu && invokeArrayFns(instance.bu);
10602
+ this.render();
10603
+ } catch (err) {
10604
+ instance.isUpdating = false;
10605
+ throw err;
10606
+ }
10607
+ let updateJob = this.updateJob;
10608
+ if (!updateJob) updateJob = this.updateJob = () => {
10609
+ instance.isUpdating = false;
10610
+ instance.u && invokeArrayFns(instance.u);
10611
+ };
10612
+ queuePostFlushCb(updateJob);
10613
+ } else this.render();
10614
+ } finally {
10615
+ setCurrentInstance(...prev);
10616
+ if (instance) endMeasure(instance, `renderEffect`);
10617
+ }
10618
+ }
10619
+ notify() {
10620
+ if (!(this.flags & 256)) queueJob(this.job, this.i ? this.i.uid : void 0);
10621
+ }
10622
+ };
10623
+ function renderEffect(fn, noLifecycle = false) {
10624
+ if (inOnceSlot) return fn();
10625
+ new RenderEffect(fn, noLifecycle).run();
10626
+ }
10627
+ //#endregion
10538
10628
  //#region packages/runtime-vapor/src/componentProps.ts
10539
10629
  function resolveSource(source) {
10540
10630
  return isFunction(source) ? resolveFunctionSource(source) : source;
@@ -10556,6 +10646,30 @@ function resolveFunctionSource(source) {
10556
10646
  }
10557
10647
  return source();
10558
10648
  }
10649
+ function snapshotRawProps(rawProps) {
10650
+ const snapshot = Object.create(null);
10651
+ for (const key in rawProps) if (key !== "$") snapshot[key] = resolveSource(rawProps[key]);
10652
+ const dynamicSources = rawProps.$;
10653
+ if (dynamicSources) {
10654
+ const snapshotSources = [];
10655
+ for (let i = 0; i < dynamicSources.length; i++) {
10656
+ const source = dynamicSources[i];
10657
+ const value = Object.create(null);
10658
+ if (isFunction(source)) {
10659
+ const resolved = resolveFunctionSource(source);
10660
+ for (const key in resolved) value[key] = resolved[key];
10661
+ snapshotSources[i] = () => value;
10662
+ } else {
10663
+ for (const key in source) value[key] = resolveSource(source[key]);
10664
+ snapshotSources[i] = value;
10665
+ }
10666
+ }
10667
+ const symbols = Object.getOwnPropertySymbols(dynamicSources);
10668
+ for (let i = 0; i < symbols.length; i++) snapshotSources[symbols[i]] = dynamicSources[symbols[i]];
10669
+ snapshot.$ = snapshotSources;
10670
+ }
10671
+ return snapshot;
10672
+ }
10559
10673
  function stabilizeDynamicSourceValue(oldValue, value) {
10560
10674
  if (!isPlainObject(oldValue) || !isPlainObject(value)) return value;
10561
10675
  const oldKeys = Object.keys(oldValue);
@@ -10567,7 +10681,7 @@ function stabilizeDynamicSourceValue(oldValue, value) {
10567
10681
  }
10568
10682
  return oldValue;
10569
10683
  }
10570
- function getPropsProxyHandlers(comp, once) {
10684
+ function getPropsProxyHandlers(comp) {
10571
10685
  if (comp.__propsHandlers) return comp.__propsHandlers;
10572
10686
  const propsOptions = normalizePropsOptions(comp)[0];
10573
10687
  const emitsOptions = normalizeEmitsOptions(comp);
@@ -10585,7 +10699,7 @@ function getPropsProxyHandlers(comp, once) {
10585
10699
  source = dynamicSources[i];
10586
10700
  isDynamic = isFunction(source);
10587
10701
  source = isDynamic ? resolveFunctionSource(source) : source;
10588
- for (rawKey in source) if (camelize(rawKey) === key) return resolvePropValue(propsOptions, key, isDynamic ? source[rawKey] : resolveFunctionSource(source[rawKey]), instance, resolveDefault);
10702
+ for (rawKey in source) if (camelize(rawKey) === key) return resolvePropValue(propsOptions, key, isDynamic ? source[rawKey] : resolveSource(source[rawKey]), instance, resolveDefault);
10589
10703
  }
10590
10704
  }
10591
10705
  for (const rawKey in rawProps) if (camelize(rawKey) === key) return resolvePropValue(propsOptions, key, resolveSource(rawProps[rawKey]), instance, resolveDefault);
@@ -10593,8 +10707,8 @@ function getPropsProxyHandlers(comp, once) {
10593
10707
  };
10594
10708
  const withOnceCache = (getter) => {
10595
10709
  return ((instance, key) => {
10596
- const cache = instance.oncePropsCache || (instance.oncePropsCache = {});
10597
- if (!(key in cache)) {
10710
+ const cache = instance.oncePropsCache || (instance.oncePropsCache = Object.create(null));
10711
+ if (!hasOwn(cache, key)) {
10598
10712
  pauseTracking();
10599
10713
  try {
10600
10714
  cache[key] = getter(instance, key);
@@ -10606,15 +10720,16 @@ function getPropsProxyHandlers(comp, once) {
10606
10720
  });
10607
10721
  };
10608
10722
  const getOnceProp = withOnceCache(getProp);
10723
+ const getMaybeOnceProp = (instance, key) => (instance.isOnce ? getOnceProp : getProp)(instance, key);
10609
10724
  const propsHandlers = propsOptions ? {
10610
- get: (target, key) => (once ? getOnceProp : getProp)(target, key),
10725
+ get: getMaybeOnceProp,
10611
10726
  has: (_, key) => isProp(key),
10612
10727
  ownKeys: () => Object.keys(propsOptions),
10613
10728
  getOwnPropertyDescriptor(target, key) {
10614
10729
  if (isProp(key)) return {
10615
10730
  configurable: true,
10616
10731
  enumerable: true,
10617
- get: () => (once ? getOnceProp : getProp)(target, key)
10732
+ get: () => getMaybeOnceProp(target, key)
10618
10733
  };
10619
10734
  }
10620
10735
  } : null;
@@ -10630,15 +10745,36 @@ function getPropsProxyHandlers(comp, once) {
10630
10745
  else return false;
10631
10746
  };
10632
10747
  const getOnceAttr = withOnceCache((instance, key) => getAttr(instance.rawProps, key));
10748
+ const onceAttrKeys = Symbol();
10749
+ const getAttrKeys = (target) => getKeysFromRawProps(target.rawProps).filter(isAttr);
10750
+ const getOnceAttrKeys = (target) => {
10751
+ const cache = target.oncePropsCache || (target.oncePropsCache = Object.create(null));
10752
+ if (!hasOwn(cache, onceAttrKeys)) {
10753
+ pauseTracking();
10754
+ try {
10755
+ const keys = getAttrKeys(target);
10756
+ cache[onceAttrKeys] = keys;
10757
+ for (let i = 0; i < keys.length; i++) {
10758
+ const key = keys[i];
10759
+ if (!hasOwn(cache, key)) cache[key] = getAttr(target.rawProps, key);
10760
+ }
10761
+ } finally {
10762
+ resetTracking();
10763
+ }
10764
+ }
10765
+ return cache[onceAttrKeys];
10766
+ };
10767
+ const getMaybeOnceAttrKeys = (target) => target.isOnce ? getOnceAttrKeys(target) : getAttrKeys(target);
10768
+ const getMaybeOnceAttr = (instance, key) => instance.isOnce ? getOnceAttrKeys(instance).includes(key) ? getOnceAttr(instance, key) : void 0 : getAttr(instance.rawProps, key);
10633
10769
  const attrsHandlers = {
10634
- get: (target, key) => once ? getOnceAttr(target, key) : getAttr(target.rawProps, key),
10635
- has: (target, key) => hasAttr(target.rawProps, key),
10636
- ownKeys: (target) => getKeysFromRawProps(target.rawProps).filter(isAttr),
10770
+ get: getMaybeOnceAttr,
10771
+ has: (target, key) => target.isOnce ? getOnceAttrKeys(target).includes(key) : hasAttr(target.rawProps, key),
10772
+ ownKeys: getMaybeOnceAttrKeys,
10637
10773
  getOwnPropertyDescriptor(target, key) {
10638
- if (isString(key) && hasAttr(target.rawProps, key)) return {
10774
+ if (isString(key) && (target.isOnce ? getOnceAttrKeys(target).includes(key) : hasAttr(target.rawProps, key))) return {
10639
10775
  configurable: true,
10640
10776
  enumerable: true,
10641
- get: () => once ? getOnceAttr(target, key) : getAttr(target.rawProps, key)
10777
+ get: () => getMaybeOnceAttr(target, key)
10642
10778
  };
10643
10779
  }
10644
10780
  };
@@ -10660,7 +10796,7 @@ function getAttrFromRawProps(rawProps, key) {
10660
10796
  isDynamic = isFunction(source);
10661
10797
  source = isDynamic ? resolveFunctionSource(source) : source;
10662
10798
  if (source && hasOwn(source, key)) {
10663
- const value = isDynamic ? source[key] : resolveFunctionSource(source[key]);
10799
+ const value = isDynamic ? source[key] : resolveSource(source[key]);
10664
10800
  if (merged) merged.push(value);
10665
10801
  else return value;
10666
10802
  }
@@ -10742,7 +10878,7 @@ function resolveDynamicProps(props) {
10742
10878
  const isDynamic = isFunction(source);
10743
10879
  const resolved = isDynamic ? resolveFunctionSource(source) : source;
10744
10880
  for (const key in resolved) {
10745
- const value = isDynamic ? resolved[key] : resolveFunctionSource(source[key]);
10881
+ const value = isDynamic ? resolved[key] : resolveSource(source[key]);
10746
10882
  if (key === "class" || key === "style") {
10747
10883
  const existing = mergedRawProps[key];
10748
10884
  if (isArray(existing)) existing.push(value);
@@ -10782,18 +10918,23 @@ function on(el, event, handler, options = {}) {
10782
10918
  if (isArray(handler)) handler.forEach((fn) => on(el, event, fn, options));
10783
10919
  else {
10784
10920
  if (!handler) return;
10785
- addEventListener(el, event, handler, options);
10786
- if (options.effect) onEffectCleanup(() => {
10787
- el.removeEventListener(event, handler, options);
10788
- });
10921
+ addEventListener(el, event, createInvoker(handler), options);
10922
+ }
10923
+ }
10924
+ function onBinding(el, event, handler, options = {}) {
10925
+ if (isArray(handler)) handler.forEach((fn) => onBinding(el, event, fn, options));
10926
+ else {
10927
+ if (!handler) return;
10928
+ onEffectCleanup(addEventListener(el, event, createInvoker(handler), options));
10789
10929
  }
10790
10930
  }
10791
10931
  function delegate(el, event, handler) {
10792
10932
  const key = `$evt${event}`;
10793
10933
  const existing = el[key];
10794
- if (existing) if (isArray(existing)) existing.push(handler);
10795
- else el[key] = [existing, handler];
10796
- else el[key] = handler;
10934
+ const invoker = createInvoker(handler);
10935
+ if (existing) if (isArray(existing)) existing.push(invoker);
10936
+ else el[key] = [existing, invoker];
10937
+ else el[key] = invoker;
10797
10938
  }
10798
10939
  /**
10799
10940
  * Event delegation borrowed from solid
@@ -10832,7 +10973,13 @@ const delegatedEventHandler = (e) => {
10832
10973
  }
10833
10974
  };
10834
10975
  function setDynamicEvents(el, events) {
10835
- for (const name in events) on(el, name, events[name], { effect: true });
10976
+ for (const name in events) onBinding(el, name, events[name]);
10977
+ }
10978
+ function withVaporModifiers(fn, modifiers) {
10979
+ return createInvoker(typeof fn === "function" ? withModifiers(fn, modifiers) : fn);
10980
+ }
10981
+ function withVaporKeys(fn, modifiers) {
10982
+ return createInvoker(typeof fn === "function" ? withKeys(fn, modifiers) : fn);
10836
10983
  }
10837
10984
  function createInvoker(handler) {
10838
10985
  const i = currentInstance;
@@ -10840,13 +10987,16 @@ function createInvoker(handler) {
10840
10987
  }
10841
10988
  //#endregion
10842
10989
  //#region packages/runtime-vapor/src/dom/prop.ts
10843
- const hasFallthroughKey = (key) => currentInstance.hasFallthrough && key in currentInstance.attrs;
10990
+ const shouldSkipFallthroughKey = (el, key) => {
10991
+ const instance = currentInstance;
10992
+ return !isApplyingFallthroughProps && el.$root && instance.hasFallthrough && instance.type.inheritAttrs !== false && key in instance.attrs;
10993
+ };
10844
10994
  function setProp(el, key, value) {
10845
10995
  if (key in el) setDOMProp(el, key, value);
10846
10996
  else setAttr(el, key, value);
10847
10997
  }
10848
10998
  function setAttr(el, key, value, isSVG = false) {
10849
- if (!isApplyingFallthroughProps && el.$root && hasFallthroughKey(key)) return;
10999
+ if (shouldSkipFallthroughKey(el, key)) return;
10850
11000
  if (key === "true-value") el._trueValue = value;
10851
11001
  else if (key === "false-value") el._falseValue = value;
10852
11002
  if (isHydrating$1 && !attributeHasMismatch(el, key, value)) {
@@ -10862,7 +11012,7 @@ function setAttr(el, key, value, isSVG = false) {
10862
11012
  }
10863
11013
  }
10864
11014
  function setDOMProp(el, key, value, forceHydrate = false, attrName) {
10865
- if (!isApplyingFallthroughProps && el.$root && hasFallthroughKey(key)) return;
11015
+ if (shouldSkipFallthroughKey(el, key)) return;
10866
11016
  if (isHydrating$1 && !attributeHasMismatch(el, key, value) && !shouldForceHydrate(el, key) && !forceHydrate) return;
10867
11017
  const prev = el[key];
10868
11018
  if (value === prev) return;
@@ -10980,7 +11130,7 @@ function setStyleIncremental(el, value) {
10980
11130
  patchStyle(el, el[cacheKey], el[cacheKey] = normalizedValue);
10981
11131
  }
10982
11132
  function setValue(el, value, forceHydrate = false) {
10983
- if (!isApplyingFallthroughProps && el.$root && hasFallthroughKey("value")) return;
11133
+ if (shouldSkipFallthroughKey(el, "value")) return;
10984
11134
  el._value = value;
10985
11135
  if (isHydrating$1 && !attributeHasMismatch(el, "value", getClientText(el, value)) && !shouldForceHydrate(el, "value") && !forceHydrate) return;
10986
11136
  const oldValue = el.tagName === "OPTION" ? el.getAttribute("value") : el.value;
@@ -11081,8 +11231,10 @@ function setDynamicProp(el, key, value, isSVG = false) {
11081
11231
  let forceHydrate = false;
11082
11232
  if (key === "class") setClass(el, value, isSVG);
11083
11233
  else if (key === "style") setStyle(el, value);
11084
- else if (isOn(key)) on(el, key[2].toLowerCase() + key.slice(3), value, { effect: true });
11085
- else if ((forceHydrate = key[0] === ".") ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, value, isSVG)) if (key === "innerHTML") setHtml(el, value);
11234
+ else if (isOn(key)) {
11235
+ if (shouldSkipFallthroughKey(el, key)) return;
11236
+ onBinding(el, key[2].toLowerCase() + key.slice(3), value);
11237
+ } else if ((forceHydrate = key[0] === ".") ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, value, isSVG)) if (key === "innerHTML") setHtml(el, value);
11086
11238
  else if (key === "textContent") setElementText(el, value);
11087
11239
  else if (key === "value" && canSetValueDirectly(el.tagName)) setValue(el, value, forceHydrate);
11088
11240
  else setDOMProp(el, key, value, forceHydrate);
@@ -11115,9 +11267,10 @@ function classHasMismatch(el, expected, isIncremental) {
11115
11267
  if (expected) hasMismatch = Array.from(expectedClassSet).some((cls) => !actualClassSet.has(cls));
11116
11268
  } else hasMismatch = !isSetEqual(actualClassSet, expectedClassSet);
11117
11269
  if (hasMismatch) {
11118
- warnPropMismatch(el, "class", 2, actual, expected);
11119
- logMismatchError();
11120
- return true;
11270
+ if (warnPropMismatch(el, "class", 2, actual, expected)) {
11271
+ logMismatchError();
11272
+ return true;
11273
+ }
11121
11274
  }
11122
11275
  return false;
11123
11276
  }
@@ -11133,9 +11286,10 @@ function styleHasMismatch(el, value, normalizedValue, isIncremental, instance =
11133
11286
  if (expected) hasMismatch = Array.from(expectedStyleMap.entries()).some(([key, val]) => actualStyleMap.get(key) !== val);
11134
11287
  } else hasMismatch = !isMapEqual(actualStyleMap, expectedStyleMap);
11135
11288
  if (hasMismatch) {
11136
- warnPropMismatch(el, "style", 3, actual, expected);
11137
- logMismatchError();
11138
- return true;
11289
+ if (warnPropMismatch(el, "style", 3, actual, expected)) {
11290
+ logMismatchError();
11291
+ return true;
11292
+ }
11139
11293
  }
11140
11294
  return false;
11141
11295
  }
@@ -11158,9 +11312,10 @@ function attributeHasMismatch(el, key, value) {
11158
11312
  if (isValidHtmlOrSvgAttribute(el, key)) {
11159
11313
  const { actual, expected } = getAttributeMismatch(el, key, value);
11160
11314
  if (actual !== expected) {
11161
- warnPropMismatch(el, key, 4, actual, expected);
11162
- logMismatchError();
11163
- return true;
11315
+ if (warnPropMismatch(el, key, 4, actual, expected)) {
11316
+ logMismatchError();
11317
+ return true;
11318
+ }
11164
11319
  }
11165
11320
  }
11166
11321
  return false;
@@ -11203,6 +11358,15 @@ function setComponentScopeId(instance) {
11203
11358
  * When true, renderEffect should skip creating reactive effect.
11204
11359
  */
11205
11360
  let inOnceSlot = false;
11361
+ function withOnceSlot(fn, value = true) {
11362
+ const prev = inOnceSlot;
11363
+ try {
11364
+ inOnceSlot = value;
11365
+ return fn();
11366
+ } finally {
11367
+ inOnceSlot = prev;
11368
+ }
11369
+ }
11206
11370
  /**
11207
11371
  * Current slot scopeIds for vdom interop
11208
11372
  */
@@ -11300,7 +11464,7 @@ function withVaporCtx(fn) {
11300
11464
  }
11301
11465
  };
11302
11466
  }
11303
- function createSlot(name, rawProps, fallback, noSlotted, once) {
11467
+ function createSlot(name = "default", rawProps, fallback, flags = 0) {
11304
11468
  if (isInteropEnabled && isCollectingVdomSlotVNodes) return;
11305
11469
  const _insertionParent = insertionParent;
11306
11470
  const _insertionAnchor = insertionAnchor;
@@ -11308,13 +11472,18 @@ function createSlot(name, rawProps, fallback, noSlotted, once) {
11308
11472
  let hydrationCursor = null;
11309
11473
  const instance = getScopeOwner();
11310
11474
  const rawSlots = instance.rawSlots;
11311
- const slotProps = rawProps ? new Proxy(rawProps, rawPropsProxyHandlers) : EMPTY_OBJ;
11312
- const scopeId = !noSlotted && instance.type.__scopeId;
11475
+ const scopeId = !(flags & 1) && instance.type.__scopeId;
11313
11476
  const slotScopeIds = scopeId ? [`${scopeId}-s`] : null;
11477
+ const once = !!(flags & 2);
11478
+ const slotProps = rawProps ? new Proxy(once ? snapshotRawProps(rawProps) : rawProps, rawPropsProxyHandlers) : EMPTY_OBJ;
11479
+ if (once && fallback) {
11480
+ const originalFallback = fallback;
11481
+ fallback = (...args) => withOnceSlot(() => originalFallback(...args));
11482
+ }
11314
11483
  let fragment;
11315
11484
  if (/* @__PURE__ */ isRef(rawSlots._) && isInteropEnabled) {
11316
11485
  if (isHydrating$1) hydrationCursor = enterHydrationCursor();
11317
- fragment = instance.appContext.vapor.vdomSlot(rawSlots._, name, slotProps, instance, fallback);
11486
+ fragment = instance.appContext.vapor.vdomSlot(rawSlots._, name, slotProps, instance, fallback, once);
11318
11487
  } else {
11319
11488
  if (isHydrating$1) hydrationCursor = captureHydrationCursor();
11320
11489
  const slotFragment = fragment = new SlotFragment();
@@ -11324,9 +11493,11 @@ function createSlot(name, rawProps, fallback, noSlotted, once) {
11324
11493
  const slotName = isFunction(name) ? name() : name;
11325
11494
  if (instance.ce || instance.parent && isAsyncWrapper(instance.parent) && instance.parent.ce) {
11326
11495
  const el = /* @__PURE__ */ createElement("slot");
11327
- renderEffect(() => {
11496
+ const setSlotProps = () => {
11328
11497
  setDynamicProps(el, [slotProps, slotName !== "default" ? { name: slotName } : {}]);
11329
- });
11498
+ };
11499
+ if (once) setSlotProps();
11500
+ else renderEffect(setSlotProps);
11330
11501
  if (fallback) withOwnedSlotBoundary(slotFragment.parentSlotBoundary, () => {
11331
11502
  const fallbackBlock = fallback();
11332
11503
  slotFragment.customElementFallback = fallbackBlock;
@@ -11346,12 +11517,9 @@ function createSlot(name, rawProps, fallback, noSlotted, once) {
11346
11517
  cachedSlot = slot;
11347
11518
  cachedBoundSlot = () => {
11348
11519
  const prevSlotScopeIds = setCurrentSlotScopeIds(slotScopeIds);
11349
- const prev = inOnceSlot;
11350
11520
  try {
11351
- if (once) inOnceSlot = true;
11352
- return slot(slotProps);
11521
+ return once ? withOnceSlot(() => slot(slotProps)) : slot(slotProps);
11353
11522
  } finally {
11354
- inOnceSlot = prev;
11355
11523
  setCurrentSlotScopeIds(prevSlotScopeIds);
11356
11524
  }
11357
11525
  };
@@ -11371,65 +11539,6 @@ function createSlot(name, rawProps, fallback, noSlotted, once) {
11371
11539
  return fragment;
11372
11540
  }
11373
11541
  //#endregion
11374
- //#region packages/runtime-vapor/src/renderEffect.ts
11375
- var RenderEffect = class extends ReactiveEffect {
11376
- constructor(render) {
11377
- super();
11378
- this.render = render;
11379
- const instance = currentInstance;
11380
- if (!this.subs && !isVaporComponent(instance)) warn("renderEffect called without active EffectScope or Vapor instance.");
11381
- const job = () => {
11382
- if (this.dirty) this.run();
11383
- };
11384
- this.updateJob = () => {
11385
- instance.isUpdating = false;
11386
- instance.u && invokeArrayFns(instance.u);
11387
- };
11388
- if (instance) {
11389
- this.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
11390
- this.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
11391
- if (instance.type.ce) (instance.renderEffects || (instance.renderEffects = [])).push(this);
11392
- job.i = instance;
11393
- }
11394
- this.job = job;
11395
- this.i = instance;
11396
- this.flags |= 128;
11397
- this.job.flags |= 2;
11398
- }
11399
- fn() {
11400
- const instance = this.i;
11401
- const scope = this.subs ? this.subs.sub : void 0;
11402
- const hasUpdateHooks = instance && (instance.bu || instance.u);
11403
- if (instance) startMeasure(instance, `renderEffect`);
11404
- const prev = setCurrentInstance(instance, scope);
11405
- try {
11406
- if (hasUpdateHooks && instance.isMounted && !instance.isUpdating) {
11407
- instance.isUpdating = true;
11408
- try {
11409
- instance.bu && invokeArrayFns(instance.bu);
11410
- this.render();
11411
- } catch (err) {
11412
- instance.isUpdating = false;
11413
- throw err;
11414
- }
11415
- queuePostFlushCb(this.updateJob);
11416
- } else this.render();
11417
- } finally {
11418
- setCurrentInstance(...prev);
11419
- if (instance) endMeasure(instance, `renderEffect`);
11420
- }
11421
- }
11422
- notify() {
11423
- if (!(this.flags & 256)) queueJob(this.job, this.i ? this.i.uid : void 0);
11424
- }
11425
- };
11426
- function renderEffect(fn, noLifecycle = false) {
11427
- if (inOnceSlot) return fn();
11428
- const effect = new RenderEffect(fn);
11429
- if (noLifecycle) effect.fn = fn;
11430
- effect.run();
11431
- }
11432
- //#endregion
11433
11542
  //#region packages/runtime-vapor/src/keepAlive.ts
11434
11543
  let isKeepAliveEnabled = false;
11435
11544
  let currentKeepAliveCtx = null;
@@ -11489,9 +11598,9 @@ function isVaporTransition(component) {
11489
11598
  }
11490
11599
  //#endregion
11491
11600
  //#region packages/runtime-vapor/src/fragment.ts
11601
+ const EMPTY_BLOCK = EMPTY_ARR;
11492
11602
  var VaporFragment = class {
11493
11603
  constructor(nodes) {
11494
- this.vnode = null;
11495
11604
  this.renderInstance = currentInstance;
11496
11605
  this.slotOwner = currentSlotOwner;
11497
11606
  this.inheritedSlotBoundary = currentSlotBoundary;
@@ -11500,9 +11609,15 @@ var VaporFragment = class {
11500
11609
  }
11501
11610
  runWithRenderCtx(fn, scope) {
11502
11611
  const prevInstance = setCurrentInstance(this.renderInstance, scope);
11612
+ const keepAliveCtx = isKeepAliveEnabled ? this.keepAliveCtx || null : null;
11613
+ if (currentSlotOwner === this.slotOwner && currentSlotBoundary === this.inheritedSlotBoundary && (!isKeepAliveEnabled || currentKeepAliveCtx === keepAliveCtx)) try {
11614
+ return fn();
11615
+ } finally {
11616
+ setCurrentInstance(...prevInstance);
11617
+ }
11503
11618
  const prevSlotOwner = setCurrentSlotOwner(this.slotOwner);
11504
11619
  let prevKeepAliveCtx = null;
11505
- if (isKeepAliveEnabled) prevKeepAliveCtx = setCurrentKeepAliveCtx(this.keepAliveCtx || null);
11620
+ if (isKeepAliveEnabled) prevKeepAliveCtx = setCurrentKeepAliveCtx(keepAliveCtx);
11506
11621
  const prevBoundary = setCurrentSlotBoundary(this.inheritedSlotBoundary);
11507
11622
  try {
11508
11623
  return fn();
@@ -11534,10 +11649,12 @@ var ForBlock = class extends VaporFragment {
11534
11649
  }
11535
11650
  };
11536
11651
  function getDynamicCloseOwner(isSlot, forwardedSlot, anchorLabel, nodes, currentSlotEndAnchor) {
11537
- const valid = isValidBlock(nodes);
11538
- if (isSlot) return !forwardedSlot || valid ? 1 : 3;
11652
+ if (isSlot) {
11653
+ if (!forwardedSlot) return 1;
11654
+ return isValidBlock(nodes) ? 1 : 3;
11655
+ }
11539
11656
  if (anchorLabel === "if" && isArray(nodes) && nodes.length > 1) return 1;
11540
- if (anchorLabel === "if" && !valid && currentSlotEndAnchor && isHydratingSlotFallbackActive()) return 2;
11657
+ if (anchorLabel === "if" && currentSlotEndAnchor && isHydratingSlotFallbackActive() && !isValidBlock(nodes)) return 2;
11541
11658
  return 0;
11542
11659
  }
11543
11660
  function queueAnchorInsert(parentNode$1, nextNode, createAnchor) {
@@ -11547,110 +11664,9 @@ function queueAnchorInsert(parentNode$1, nextNode, createAnchor) {
11547
11664
  });
11548
11665
  }
11549
11666
  var DynamicFragment = class extends VaporFragment {
11550
- constructor(anchorLabel, keyed = false, locate = true) {
11551
- super([]);
11552
- this.hydrate = (isEmpty = false, isSlot = false) => {
11553
- if (!isHydrating$1) return;
11554
- let advanceAfterRestore = null;
11555
- let exitHydrationBoundary;
11556
- const reuseAnchor = (anchor) => {
11557
- this.anchor = markHydrationAnchor(anchor);
11558
- if (currentHydrationNode === this.anchor) advanceHydrationNode(this.anchor);
11559
- else {
11560
- exitHydrationBoundary = enterHydrationBoundary(this.anchor);
11561
- advanceAfterRestore = this.anchor;
11562
- }
11563
- };
11564
- const createRuntimeAnchor = () => this.anchor = markHydrationAnchor(/* @__PURE__ */ createComment(this.anchorLabel));
11565
- const cleanupAndInsertRuntimeAnchor = (parentNode, nextNode, cleanupStart, cleanupUntil) => {
11566
- if (cleanupUntil) exitHydrationBoundary = enterHydrationBoundary(cleanupUntil);
11567
- else {
11568
- cleanupHydrationTail(cleanupStart);
11569
- setCurrentHydrationNode(null);
11570
- }
11571
- queueAnchorInsert(parentNode, nextNode, createRuntimeAnchor);
11572
- };
11573
- try {
11574
- if (isEmpty) {
11575
- if (isComment(currentHydrationNode, "")) {
11576
- reuseAnchor(currentHydrationNode);
11577
- return;
11578
- }
11579
- if (this.anchorLabel && currentHydrationNode && isComment(currentHydrationNode, "teleport anchor")) {
11580
- const parentNode$2 = /* @__PURE__ */ parentNode(currentHydrationNode);
11581
- const anchor = markHydrationAnchor(currentHydrationNode);
11582
- if (parentNode$2) {
11583
- queueAnchorInsert(parentNode$2, anchor, createRuntimeAnchor);
11584
- return;
11585
- }
11586
- }
11587
- if (!isSlot && this.anchorLabel && currentHydrationNode && !isHydratingSlotFallbackActive() && !isComment(currentHydrationNode, "]")) {
11588
- const parentNode$4 = /* @__PURE__ */ parentNode(currentHydrationNode);
11589
- const anchor = locateNextNode(currentHydrationNode);
11590
- const reusableAnchor = anchor && anchor.nodeType === 8 && isReusableDynamicFragmentAnchor(anchor, this.anchorLabel) && /* @__PURE__ */ parentNode(anchor) ? anchor : null;
11591
- if (parentNode$4) {
11592
- this.nodes = [];
11593
- if (reusableAnchor) reuseAnchor(reusableAnchor);
11594
- else cleanupAndInsertRuntimeAnchor(parentNode$4, anchor, currentHydrationNode, anchor);
11595
- return;
11596
- }
11597
- }
11598
- }
11599
- if (this.anchorLabel && !isValidBlock(this.nodes) && this.nodes instanceof Comment && isReusableDynamicFragmentAnchor(this.nodes, this.anchorLabel) && /* @__PURE__ */ parentNode(this.nodes)) {
11600
- const anchor = this.nodes;
11601
- this.nodes = [];
11602
- reuseAnchor(anchor);
11603
- return;
11604
- }
11605
- if (this.anchorLabel && !isValidBlock(this.nodes) && this.nodes instanceof Comment && !/* @__PURE__ */ parentNode(this.nodes) && currentHydrationNode) {
11606
- const parentNode$5 = /* @__PURE__ */ parentNode(currentHydrationNode);
11607
- const nextNode = locateNextNode(currentHydrationNode);
11608
- if (parentNode$5) {
11609
- this.nodes = [];
11610
- cleanupAndInsertRuntimeAnchor(parentNode$5, nextNode, currentHydrationNode, nextNode);
11611
- return;
11612
- }
11613
- }
11614
- const currentSlotEndAnchor = getCurrentSlotEndAnchor();
11615
- const forwardedSlot = this.forwarded;
11616
- const slotAnchor = isSlot ? currentSlotEndAnchor : null;
11617
- const closeOwner = getDynamicCloseOwner(isSlot, forwardedSlot, this.anchorLabel, this.nodes, currentSlotEndAnchor);
11618
- if (closeOwner === 1) {
11619
- const anchor = locateHydrationBoundaryClose(slotAnchor || currentHydrationNode, slotAnchor || null);
11620
- if (isComment(anchor, "]")) {
11621
- reuseAnchor(anchor);
11622
- return;
11623
- } else throw new Error(`Failed to locate ${this.anchorLabel} fragment anchor. this is likely a Vue internal bug.`);
11624
- } else if (closeOwner === 3 && currentSlotEndAnchor) {
11625
- const anchor = markHydrationAnchor(currentSlotEndAnchor);
11626
- queueAnchorInsert(anchor.parentNode, anchor.nextSibling, createRuntimeAnchor);
11627
- return;
11628
- } else if (closeOwner === 2 && currentSlotEndAnchor) {
11629
- const endAnchor = currentSlotEndAnchor;
11630
- queuePostFlushCb(() => {
11631
- const parentNode$6 = /* @__PURE__ */ parentNode(endAnchor);
11632
- if (!parentNode$6) return;
11633
- parentNode$6.insertBefore(createRuntimeAnchor(), endAnchor);
11634
- });
11635
- return;
11636
- }
11637
- let parentNode$3;
11638
- let nextNode;
11639
- if (this.anchorLabel === "if" && !isValidBlock(this.nodes) && currentSlotEndAnchor && currentHydrationNode === currentSlotEndAnchor) {
11640
- parentNode$3 = currentSlotEndAnchor.parentNode;
11641
- nextNode = currentSlotEndAnchor;
11642
- } else {
11643
- const node = findBlockNode(this.nodes);
11644
- parentNode$3 = node.parentNode;
11645
- nextNode = node.nextNode;
11646
- }
11647
- queueAnchorInsert(parentNode$3, nextNode, createRuntimeAnchor);
11648
- } finally {
11649
- exitHydrationBoundary && exitHydrationBoundary();
11650
- if (advanceAfterRestore && currentHydrationNode === advanceAfterRestore) advanceHydrationNode(advanceAfterRestore);
11651
- }
11652
- };
11653
- this.keyed = keyed;
11667
+ constructor(anchorLabel, keyed = false, locate = true, trackSlotBoundary = true) {
11668
+ super(EMPTY_BLOCK);
11669
+ if (keyed) this.keyed = true;
11654
11670
  if (isTransitionEnabled && currentInstance && isVaporTransition(currentInstance.type)) this.inTransition = true;
11655
11671
  if (isHydrating$1) {
11656
11672
  this.anchorLabel = anchorLabel;
@@ -11659,14 +11675,9 @@ var DynamicFragment = class extends VaporFragment {
11659
11675
  this.anchor = anchorLabel ? /* @__PURE__ */ createComment(anchorLabel) : /* @__PURE__ */ createTextNode();
11660
11676
  this.anchorLabel = anchorLabel;
11661
11677
  }
11662
- this.registerSlotBoundaryDirty();
11663
- }
11664
- registerSlotBoundaryDirty() {
11665
- const boundary = this.inheritedSlotBoundary;
11666
- if (!boundary) return;
11667
- (this.onUpdated || (this.onUpdated = [])).push(() => boundary.markDirty());
11678
+ if (trackSlotBoundary) trackSlotBoundaryDirtying(this);
11668
11679
  }
11669
- update(render, key = render) {
11680
+ update(render, key = render, noScope = false) {
11670
11681
  if (key === this.current) {
11671
11682
  if (isHydrating$1 && this.anchorLabel !== "slot") this.hydrate(true);
11672
11683
  return;
@@ -11674,28 +11685,29 @@ var DynamicFragment = class extends VaporFragment {
11674
11685
  const transition = isTransitionEnabled ? this.$transition : void 0;
11675
11686
  if (transition && transition.state.isLeaving) {
11676
11687
  this.current = key;
11677
- this.pending = {
11688
+ const pending = this.pending;
11689
+ if (pending) {
11690
+ pending.render = render;
11691
+ pending.key = key;
11692
+ pending.noScope = noScope;
11693
+ } else this.pending = {
11678
11694
  render,
11679
- key
11695
+ key,
11696
+ noScope
11680
11697
  };
11681
11698
  return;
11682
11699
  }
11683
11700
  const instance = currentInstance;
11684
11701
  const prevSub = setActiveSub();
11685
11702
  const parent = isHydrating$1 ? null : this.anchor.parentNode;
11686
- if (this.scope) {
11687
- if (isKeepAliveEnabled) {
11703
+ if (this.current !== void 0) {
11704
+ const scope = this.scope;
11705
+ if (scope) {
11688
11706
  let retainScope = false;
11689
- const keepAliveCtx = this.keepAliveCtx;
11690
- if (keepAliveCtx) {
11691
- const cacheKey = this.keyed ? withCurrentCacheKey(this.current, () => keepAliveCtx.processShapeFlag(this.nodes)) : keepAliveCtx.processShapeFlag(this.nodes);
11692
- if (cacheKey !== false) {
11693
- keepAliveCtx.cacheScope(cacheKey, this.current, this.scope);
11694
- retainScope = true;
11695
- }
11696
- }
11697
- if (!retainScope) this.scope.stop();
11698
- } else this.scope.stop();
11707
+ const onBeforeRemove = this.onBeforeRemove;
11708
+ if (onBeforeRemove) for (let i = 0; i < onBeforeRemove.length; i++) retainScope = onBeforeRemove[i](scope) || retainScope;
11709
+ if (!retainScope) scope.stop();
11710
+ }
11699
11711
  const mode = transition && transition.mode;
11700
11712
  if (mode && (mode !== "in-out" || mode === "in-out" && render) && (mode !== "out-in" || isValidBlock(this.nodes))) {
11701
11713
  applyTransitionLeaveHooks(this.nodes, transition, () => {
@@ -11704,8 +11716,8 @@ var DynamicFragment = class extends VaporFragment {
11704
11716
  const pending = this.pending;
11705
11717
  if (pending) {
11706
11718
  this.pending = void 0;
11707
- this.renderBranch(pending.render, transition, parent, pending.key);
11708
- } else this.renderBranch(render, transition, parent, key);
11719
+ this.renderBranch(pending.render, transition, parent, pending.key, pending.noScope);
11720
+ } else this.renderBranch(render, transition, parent, key, noScope);
11709
11721
  } finally {
11710
11722
  setCurrentInstance(...prevInstance);
11711
11723
  }
@@ -11717,27 +11729,33 @@ var DynamicFragment = class extends VaporFragment {
11717
11729
  }
11718
11730
  } else parent && remove(this.nodes, parent);
11719
11731
  }
11720
- const isRevivingDeferredBranch = isHydrating$1 && isInDeferredHydrationBoundary() && !!render && this.anchorLabel !== "slot" && !isValidBlock(this.nodes);
11721
- const reusingDeferredAnchor = isRevivingDeferredBranch && !!this.anchor && !!this.anchor.parentNode;
11722
- if (isRevivingDeferredBranch) {
11723
- let slotEndAnchor = null;
11724
- const anchor = this.anchor || (currentHydrationNode === (slotEndAnchor = getCurrentSlotEndAnchor()) ? slotEndAnchor : null);
11725
- if (anchor) setCurrentHydrationNode(markHydrationAnchor(anchor));
11732
+ let reusingDeferredAnchor = false;
11733
+ if (isHydrating$1) {
11734
+ const isRevivingDeferredBranch = isInDeferredHydrationBoundary() && !!render && this.anchorLabel !== "slot" && !isValidBlock(this.nodes);
11735
+ reusingDeferredAnchor = isRevivingDeferredBranch && !!this.anchor && !!this.anchor.parentNode;
11736
+ if (isRevivingDeferredBranch) {
11737
+ let slotEndAnchor = null;
11738
+ const anchor = this.anchor || (currentHydrationNode === (slotEndAnchor = getCurrentSlotEndAnchor()) ? slotEndAnchor : null);
11739
+ if (anchor) setCurrentHydrationNode(markHydrationAnchor(anchor));
11740
+ }
11726
11741
  }
11727
- this.renderBranch(render, transition, parent, key);
11742
+ this.renderBranch(render, transition, parent, key, noScope);
11728
11743
  setActiveSub(prevSub);
11729
11744
  if (isHydrating$1 && this.anchorLabel !== "slot" && !reusingDeferredAnchor) this.hydrate(render == null);
11730
11745
  }
11731
- renderBranch(render, transition, parent, key) {
11746
+ renderBranch(render, transition, parent, key, noScope = false) {
11732
11747
  this.current = key;
11733
11748
  if (render) {
11734
11749
  const keepAliveCtx = isKeepAliveEnabled ? this.keepAliveCtx : null;
11735
- const scope = keepAliveCtx && keepAliveCtx.getScope(this.current);
11736
- if (scope) this.scope = scope;
11737
- else this.scope = new EffectScope();
11750
+ const useScope = !noScope || !!this.hasFallthroughAttrs;
11751
+ if (useScope) {
11752
+ const scope = keepAliveCtx && keepAliveCtx.getScope(this.current);
11753
+ if (scope) this.scope = scope;
11754
+ else this.scope = new EffectScope();
11755
+ } else this.scope = void 0;
11738
11756
  const renderBranch = () => {
11739
11757
  try {
11740
- this.nodes = this.runWithRenderCtx(() => this.scope.run(render) || []);
11758
+ this.nodes = this.runWithRenderCtx(() => (useScope ? this.scope.run(render) : render()) || EMPTY_BLOCK, this.scope);
11741
11759
  } finally {
11742
11760
  const key = this.keyed ? this.current : this.$key;
11743
11761
  if (key !== void 0 && (transition || this.inTransition || keepAliveCtx)) setBlockKey(this.nodes, key);
@@ -11748,20 +11766,119 @@ var DynamicFragment = class extends VaporFragment {
11748
11766
  if (keepAliveCtx && this.keyed) withCurrentCacheKey(key, renderBranch);
11749
11767
  else renderBranch();
11750
11768
  if (parent) {
11751
- if (this.attrs) {
11752
- if (this.nodes instanceof Element) this.scope.run(() => {
11753
- renderEffect(() => applyFallthroughProps(this.nodes, this.attrs));
11754
- });
11755
- else if (this.anchorLabel === "slot" || isArray(this.nodes) && this.nodes.length) warnExtraneousAttributes(this.attrs);
11756
- }
11769
+ const onBeforeInsert = this.onBeforeInsert;
11770
+ if (onBeforeInsert) onBeforeInsert.forEach((hook) => hook(this.nodes));
11757
11771
  insert(this.nodes, parent, this.anchor);
11758
- if (keepAliveCtx && transition && transition.mode === "out-in") keepAliveCtx.cacheBlock();
11759
11772
  }
11760
11773
  } else {
11761
11774
  this.scope = void 0;
11762
- this.nodes = [];
11775
+ this.nodes = EMPTY_BLOCK;
11776
+ }
11777
+ if (parent) {
11778
+ const onUpdated = this.onUpdated;
11779
+ if (onUpdated) onUpdated.forEach((hook) => hook(this.nodes));
11780
+ }
11781
+ }
11782
+ hydrate(isEmpty = false, isSlot = false) {
11783
+ if (!isHydrating$1) return;
11784
+ let advanceAfterRestore = null;
11785
+ let exitHydrationBoundary;
11786
+ const reuseAnchor = (anchor) => {
11787
+ this.anchor = markHydrationAnchor(anchor);
11788
+ if (currentHydrationNode === this.anchor) advanceHydrationNode(this.anchor);
11789
+ else {
11790
+ exitHydrationBoundary = enterHydrationBoundary(this.anchor);
11791
+ advanceAfterRestore = this.anchor;
11792
+ }
11793
+ };
11794
+ const createRuntimeAnchor = () => this.anchor = markHydrationAnchor(/* @__PURE__ */ createComment(this.anchorLabel));
11795
+ const cleanupAndInsertRuntimeAnchor = (parentNode, nextNode, cleanupStart, cleanupUntil) => {
11796
+ if (cleanupUntil) exitHydrationBoundary = enterHydrationBoundary(cleanupUntil);
11797
+ else {
11798
+ cleanupHydrationTail(cleanupStart);
11799
+ setCurrentHydrationNode(null);
11800
+ }
11801
+ queueAnchorInsert(parentNode, nextNode, createRuntimeAnchor);
11802
+ };
11803
+ try {
11804
+ if (isEmpty) {
11805
+ if (isComment(currentHydrationNode, "")) {
11806
+ reuseAnchor(currentHydrationNode);
11807
+ return;
11808
+ }
11809
+ if (this.anchorLabel && currentHydrationNode && isComment(currentHydrationNode, "teleport anchor")) {
11810
+ const parentNode$2 = /* @__PURE__ */ parentNode(currentHydrationNode);
11811
+ const anchor = markHydrationAnchor(currentHydrationNode);
11812
+ if (parentNode$2) {
11813
+ queueAnchorInsert(parentNode$2, anchor, createRuntimeAnchor);
11814
+ return;
11815
+ }
11816
+ }
11817
+ if (!isSlot && this.anchorLabel && currentHydrationNode && !isHydratingSlotFallbackActive() && !isComment(currentHydrationNode, "]")) {
11818
+ const parentNode$4 = /* @__PURE__ */ parentNode(currentHydrationNode);
11819
+ const anchor = nextLogicalSibling(currentHydrationNode);
11820
+ const reusableAnchor = anchor && anchor.nodeType === 8 && isReusableDynamicFragmentAnchor(anchor, this.anchorLabel) && /* @__PURE__ */ parentNode(anchor) ? anchor : null;
11821
+ if (parentNode$4) {
11822
+ this.nodes = EMPTY_BLOCK;
11823
+ if (reusableAnchor) reuseAnchor(reusableAnchor);
11824
+ else cleanupAndInsertRuntimeAnchor(parentNode$4, anchor, currentHydrationNode, anchor);
11825
+ return;
11826
+ }
11827
+ }
11828
+ }
11829
+ if (this.anchorLabel && !isValidBlock(this.nodes) && this.nodes instanceof Comment && isReusableDynamicFragmentAnchor(this.nodes, this.anchorLabel) && /* @__PURE__ */ parentNode(this.nodes)) {
11830
+ const anchor = this.nodes;
11831
+ this.nodes = EMPTY_BLOCK;
11832
+ reuseAnchor(anchor);
11833
+ return;
11834
+ }
11835
+ if (this.anchorLabel && !isValidBlock(this.nodes) && this.nodes instanceof Comment && !/* @__PURE__ */ parentNode(this.nodes) && currentHydrationNode) {
11836
+ const parentNode$5 = /* @__PURE__ */ parentNode(currentHydrationNode);
11837
+ const nextNode = nextLogicalSibling(currentHydrationNode);
11838
+ if (parentNode$5) {
11839
+ this.nodes = EMPTY_BLOCK;
11840
+ cleanupAndInsertRuntimeAnchor(parentNode$5, nextNode, currentHydrationNode, nextNode);
11841
+ return;
11842
+ }
11843
+ }
11844
+ const currentSlotEndAnchor = getCurrentSlotEndAnchor();
11845
+ const forwardedSlot = isSlot ? this.forwarded : false;
11846
+ const slotAnchor = isSlot ? currentSlotEndAnchor : null;
11847
+ const closeOwner = getDynamicCloseOwner(isSlot, forwardedSlot, this.anchorLabel, this.nodes, currentSlotEndAnchor);
11848
+ if (closeOwner === 1) {
11849
+ const anchor = locateHydrationBoundaryClose(slotAnchor || currentHydrationNode, slotAnchor || null);
11850
+ if (isComment(anchor, "]")) {
11851
+ reuseAnchor(anchor);
11852
+ return;
11853
+ } else throw new Error(`Failed to locate ${this.anchorLabel} fragment anchor. this is likely a Vue internal bug.`);
11854
+ } else if (closeOwner === 3 && currentSlotEndAnchor) {
11855
+ const anchor = markHydrationAnchor(currentSlotEndAnchor);
11856
+ queueAnchorInsert(anchor.parentNode, anchor.nextSibling, createRuntimeAnchor);
11857
+ return;
11858
+ } else if (closeOwner === 2 && currentSlotEndAnchor) {
11859
+ const endAnchor = currentSlotEndAnchor;
11860
+ queuePostFlushCb(() => {
11861
+ const parentNode$6 = /* @__PURE__ */ parentNode(endAnchor);
11862
+ if (!parentNode$6) return;
11863
+ parentNode$6.insertBefore(createRuntimeAnchor(), endAnchor);
11864
+ });
11865
+ return;
11866
+ }
11867
+ let parentNode$3;
11868
+ let nextNode;
11869
+ if (this.anchorLabel === "if" && !isValidBlock(this.nodes) && currentSlotEndAnchor && currentHydrationNode === currentSlotEndAnchor) {
11870
+ parentNode$3 = currentSlotEndAnchor.parentNode;
11871
+ nextNode = currentSlotEndAnchor;
11872
+ } else {
11873
+ const node = findBlockNode(this.nodes);
11874
+ parentNode$3 = node.parentNode;
11875
+ nextNode = node.nextNode;
11876
+ }
11877
+ queueAnchorInsert(parentNode$3, nextNode, createRuntimeAnchor);
11878
+ } finally {
11879
+ exitHydrationBoundary && exitHydrationBoundary();
11880
+ if (advanceAfterRestore && currentHydrationNode === advanceAfterRestore) advanceHydrationNode(advanceAfterRestore);
11763
11881
  }
11764
- if (parent && this.onUpdated) this.onUpdated.forEach((hook) => hook(this.nodes));
11765
11882
  }
11766
11883
  };
11767
11884
  let currentSlotBoundary = null;
@@ -11967,6 +12084,13 @@ function commitSlotFallback(outlet, block, scope) {
11967
12084
  outlet.activeFallback = block;
11968
12085
  outlet.fallbackScope = scope;
11969
12086
  ensureSlotFallbackOrderHook(outlet, block);
12087
+ if (isTransitionEnabled) {
12088
+ const transitionOutlet = outlet;
12089
+ if (transitionOutlet.$transition) {
12090
+ setBlockKey(block, "_fb");
12091
+ transitionOutlet.$transition = applyTransitionHooks(block, transitionOutlet.$transition);
12092
+ }
12093
+ }
11970
12094
  insertActiveSlotFallback(outlet);
11971
12095
  }
11972
12096
  function syncActiveSlotFallback(outlet) {
@@ -12061,7 +12185,7 @@ function isReusableDynamicFragmentAnchor(node, anchorLabel) {
12061
12185
  }
12062
12186
  var SlotFragment = class extends DynamicFragment {
12063
12187
  constructor() {
12064
- super("slot", false, false);
12188
+ super("slot", false, false, false);
12065
12189
  this.disposed = false;
12066
12190
  this.forwarded = false;
12067
12191
  this.parentSlotBoundary = getCurrentSlotBoundary();
@@ -12085,7 +12209,6 @@ var SlotFragment = class extends DynamicFragment {
12085
12209
  markDirty: () => markSlotFallbackDirty(this)
12086
12210
  };
12087
12211
  }
12088
- registerSlotBoundaryDirty() {}
12089
12212
  get fallbackBlock() {
12090
12213
  return this.activeFallback;
12091
12214
  }
@@ -12208,21 +12331,32 @@ function isValidBlock(block) {
12208
12331
  }
12209
12332
  }
12210
12333
  function insert(block, parent, anchor = null, parentSuspense) {
12211
- anchor = anchor === 0 ? parent.$fc || /* @__PURE__ */ _child(parent) : anchor;
12212
12334
  if (block instanceof Node) {
12213
- if (!isHydrating$1) if (isTransitionEnabled && block instanceof Element && block.$transition && !block.$transition.disabled) performTransitionEnter(block, block.$transition, () => parent.insertBefore(block, anchor), parentSuspense);
12214
- else parent.insertBefore(block, anchor);
12215
- } else if (isVaporComponent(block)) if (block.isMounted && !block.isDeactivated) insert(block.block, parent, anchor);
12216
- else mountComponent(block, parent, anchor);
12217
- else if (isArray(block)) for (const b of block) insert(b, parent, anchor);
12218
- else {
12219
- if (block.anchor) {
12220
- insert(block.anchor, parent, anchor);
12221
- anchor = block.anchor;
12222
- }
12223
- if (block.insert) block.insert(parent, anchor, block.$transition);
12224
- else insert(block.nodes, parent, anchor, parentSuspense);
12335
+ insertNode(block, parent, anchor, parentSuspense);
12336
+ return;
12225
12337
  }
12338
+ if (isVaporComponent(block)) {
12339
+ anchor = anchor === 0 ? parent.$fc || /* @__PURE__ */ _child(parent) : anchor;
12340
+ if (block.isMounted && !block.isDeactivated) insert(block.block, parent, anchor);
12341
+ else mountComponent(block, parent, anchor);
12342
+ } else if (isArray(block)) {
12343
+ anchor = anchor === 0 ? parent.$fc || /* @__PURE__ */ _child(parent) : anchor;
12344
+ for (const b of block) insert(b, parent, anchor);
12345
+ } else insertFragment(block, parent, anchor, parentSuspense);
12346
+ }
12347
+ function insertNode(block, parent, anchor = null, parentSuspense) {
12348
+ anchor = anchor === 0 ? parent.$fc || /* @__PURE__ */ _child(parent) : anchor;
12349
+ if (!isHydrating$1) if (isTransitionEnabled && block instanceof Element && block.$transition && !block.$transition.disabled) performTransitionEnter(block, block.$transition, () => parent.insertBefore(block, anchor), parentSuspense);
12350
+ else parent.insertBefore(block, anchor);
12351
+ }
12352
+ function insertFragment(block, parent, anchor = null, parentSuspense) {
12353
+ anchor = anchor === 0 ? parent.$fc || /* @__PURE__ */ _child(parent) : anchor;
12354
+ if (block.anchor) {
12355
+ insertNode(block.anchor, parent, anchor, parentSuspense);
12356
+ anchor = block.anchor;
12357
+ }
12358
+ if (block.insert) block.insert(parent, anchor, block.$transition);
12359
+ else insert(block.nodes, parent, anchor, parentSuspense);
12226
12360
  }
12227
12361
  function move(block, parent, anchor = null, moveType = 1, parentComponent, parentSuspense) {
12228
12362
  anchor = anchor === 0 ? parent.$fc || /* @__PURE__ */ _child(parent) : anchor;
@@ -12249,16 +12383,20 @@ function prepend(parent, ...blocks) {
12249
12383
  while (i--) insert(blocks[i], parent, 0);
12250
12384
  }
12251
12385
  function remove(block, parent) {
12252
- if (block instanceof Node) if (isTransitionEnabled && block.$transition && block instanceof Element) performTransitionLeave(block, block.$transition, () => parent && parent.removeChild(block));
12253
- else parent && parent.removeChild(block);
12386
+ if (block instanceof Node) removeNode(block, parent);
12254
12387
  else if (isVaporComponent(block)) unmountComponent(block, parent);
12255
12388
  else if (isArray(block)) for (let i = 0; i < block.length; i++) remove(block[i], parent);
12256
- else {
12257
- if (block.remove) block.remove(parent, block.$transition);
12258
- else remove(block.nodes, parent);
12259
- if (block.anchor) remove(block.anchor, parent);
12260
- if (block.scope) block.scope.stop();
12261
- }
12389
+ else removeFragment(block, parent);
12390
+ }
12391
+ function removeNode(block, parent) {
12392
+ if (isTransitionEnabled && block.$transition && block instanceof Element) performTransitionLeave(block, block.$transition, () => parent && parent.removeChild(block));
12393
+ else parent && parent.removeChild(block);
12394
+ }
12395
+ function removeFragment(block, parent) {
12396
+ if (block.remove) block.remove(parent, block.$transition);
12397
+ else remove(block.nodes, parent);
12398
+ if (block.anchor) removeNode(block.anchor, parent);
12399
+ if (block.scope) block.scope.stop();
12262
12400
  }
12263
12401
  /**
12264
12402
  * dev / test only
@@ -12386,7 +12524,12 @@ function setParentSuspense(suspense) {
12386
12524
  }
12387
12525
  //#endregion
12388
12526
  //#region packages/runtime-vapor/src/component.ts
12527
+ function normalizeRawSlots(rawSlots) {
12528
+ return rawSlots && isFunction(rawSlots) ? { default: rawSlots } : rawSlots;
12529
+ }
12389
12530
  function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appContext = currentInstance && currentInstance.appContext || emptyContext, managedMount = false) {
12531
+ const wasInOnceSlot = inOnceSlot;
12532
+ if (wasInOnceSlot) once = true;
12390
12533
  if (isInteropEnabled && isCollectingVdomSlotVNodes) {
12391
12534
  if (component.__vapor) return;
12392
12535
  const owner = getScopeOwner();
@@ -12427,7 +12570,7 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
12427
12570
  if (cached) return cached;
12428
12571
  }
12429
12572
  if (isInteropEnabled && appContext.vapor && !component.__vapor) {
12430
- const frag = appContext.vapor.vdomMount(component, currentInstance, rawProps, rawSlots);
12573
+ const frag = appContext.vapor.vdomMount(component, currentInstance, rawProps, normalizeRawSlots(rawSlots), once);
12431
12574
  if (isCollectingVdomSlotVNodes) return frag;
12432
12575
  if (!isHydrating$1) {
12433
12576
  if (_insertionParent) insert(frag, _insertionParent, _insertionAnchor);
@@ -12435,7 +12578,7 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
12435
12578
  return frag;
12436
12579
  }
12437
12580
  if (isTeleportEnabled && isVaporTeleport(component)) {
12438
- const frag = component.process(rawProps, rawSlots);
12581
+ const frag = component.process(rawProps, normalizeRawSlots(rawSlots));
12439
12582
  if (_insertionParent) onScopeDispose(() => frag.dispose(), true);
12440
12583
  if (!isHydrating$1) {
12441
12584
  if (_insertionParent) insert(frag, _insertionParent, _insertionAnchor);
@@ -12461,7 +12604,10 @@ function createComponent(component, rawProps, rawSlots, isSingleRoot, once, appC
12461
12604
  hasInitMeasure = true;
12462
12605
  instance.propsOptions = normalizePropsOptions(component);
12463
12606
  instance.emitsOptions = normalizeEmitsOptions(component);
12464
- if (isHydrating$1 && isAsyncWrapper(instance) && component.__asyncHydrate && !component.__asyncResolved) component.__asyncHydrate(currentHydrationNode, instance, () => setupComponent(instance, component));
12607
+ if (isHydrating$1 && isAsyncWrapper(instance) && component.__asyncHydrate && !component.__asyncResolved) {
12608
+ const setup = () => setupComponent(instance, component);
12609
+ component.__asyncHydrate(currentHydrationNode, instance, wasInOnceSlot ? () => withOnceSlot(setup, false) : setup);
12610
+ } else if (wasInOnceSlot) withOnceSlot(() => setupComponent(instance, component), false);
12465
12611
  else setupComponent(instance, component);
12466
12612
  } finally {
12467
12613
  if (hasWarningContext) popWarningContext();
@@ -12582,6 +12728,7 @@ var VaporComponentInstance = class {
12582
12728
  }
12583
12729
  this.block = null;
12584
12730
  this.scope = new EffectScope(true);
12731
+ this.isOnce = !!once;
12585
12732
  this.emit = emit.bind(null, this);
12586
12733
  this.expose = expose.bind(null, this);
12587
12734
  this.refs = EMPTY_OBJ;
@@ -12595,15 +12742,16 @@ var VaporComponentInstance = class {
12595
12742
  this.asyncDep = null;
12596
12743
  this.asyncResolved = false;
12597
12744
  this.isMounted = this.isUnmounted = this.isUpdating = this.isDeactivated = false;
12598
- this.rawProps = rawProps || EMPTY_OBJ;
12599
- this.hasFallthrough = hasFallthroughAttrs(comp, rawProps);
12745
+ this.rawProps = this.isOnce && rawProps ? snapshotRawProps(rawProps) : rawProps || EMPTY_OBJ;
12746
+ this.hasFallthrough = hasFallthroughAttrs(comp, this.rawProps);
12600
12747
  if (rawProps || comp.props) {
12601
- const [propsHandlers, attrsHandlers] = getPropsProxyHandlers(comp, once);
12748
+ const [propsHandlers, attrsHandlers] = getPropsProxyHandlers(comp);
12602
12749
  this.attrs = new Proxy(this, attrsHandlers);
12603
12750
  this.props = comp.props ? new Proxy(this, propsHandlers) : isFunction(comp) ? this.attrs : EMPTY_OBJ;
12604
12751
  } else this.props = this.attrs = EMPTY_OBJ;
12605
- this.rawSlots = rawSlots || EMPTY_OBJ;
12606
- this.slots = rawSlots ? rawSlots.$ ? new Proxy(rawSlots, dynamicSlotsProxyHandlers) : rawSlots : EMPTY_OBJ;
12752
+ const normalizedRawSlots = normalizeRawSlots(rawSlots);
12753
+ this.rawSlots = normalizedRawSlots || EMPTY_OBJ;
12754
+ this.slots = normalizedRawSlots ? normalizedRawSlots.$ ? new Proxy(normalizedRawSlots, dynamicSlotsProxyHandlers) : normalizedRawSlots : EMPTY_OBJ;
12607
12755
  this.scopeId = getCurrentScopeId();
12608
12756
  if (comp.ce) comp.ce(this);
12609
12757
  if (this.props === this.attrs) this.accessedAttrs = true;
@@ -12628,6 +12776,14 @@ function isVaporComponent(value) {
12628
12776
  return value instanceof VaporComponentInstance;
12629
12777
  }
12630
12778
  /**
12779
+ * Resolve an asset component by name before passing it to the fallback helper;
12780
+ * a string passed directly to `createComponentWithFallback` is plain element
12781
+ * fallback, not a component name.
12782
+ */
12783
+ function createAssetComponent(name, rawProps, rawSlots, isSingleRoot, once, maybeSelfReference, appContext) {
12784
+ return createComponentWithFallback(resolveComponent(name, maybeSelfReference), rawProps, rawSlots, isSingleRoot, once, appContext);
12785
+ }
12786
+ /**
12631
12787
  * Used when a component cannot be resolved at compile time
12632
12788
  * and needs rely on runtime resolution - where it might fallback to a plain
12633
12789
  * element if the resolution fails.
@@ -12640,7 +12796,7 @@ function createComponentWithFallback(comp, rawProps, rawSlots, isSingleRoot, onc
12640
12796
  if (isComment(node, "")) advanceHydrationNode(node);
12641
12797
  return node;
12642
12798
  }
12643
- const nextAnchor = locateNextNode(currentHydrationNode);
12799
+ const nextAnchor = nextLogicalSibling(currentHydrationNode);
12644
12800
  if (nextAnchor && isReusableNullComponentAnchor(nextAnchor)) return nextAnchor;
12645
12801
  }
12646
12802
  return /* @__PURE__ */ createComment("ndc");
@@ -12652,12 +12808,17 @@ function isReusableNullComponentAnchor(node) {
12652
12808
  return isComment(node, "") || isComment(node, "dynamic-component") || isComment(node, "async component") || isComment(node, "keyed");
12653
12809
  }
12654
12810
  function createPlainElement(comp, rawProps, rawSlots, isSingleRoot, once) {
12811
+ rawSlots = normalizeRawSlots(rawSlots);
12655
12812
  const _insertionParent = insertionParent;
12656
12813
  const _insertionAnchor = insertionAnchor;
12657
12814
  let hydrationCursor = null;
12658
12815
  if (isHydrating$1) hydrationCursor = enterHydrationCursor();
12659
12816
  else resetInsertionState();
12660
- const el = isHydrating$1 ? adoptTemplate(currentHydrationNode, `<${comp}/>`) : /* @__PURE__ */ createElement(comp);
12817
+ const defaultSlot = rawSlots && getSlot(rawSlots, "default");
12818
+ const hasDynamicSlots = !!rawSlots && !!rawSlots.$;
12819
+ const adoptHydrationChildren = !!defaultSlot;
12820
+ const hydrationTemplate = hasDynamicSlots && !defaultSlot ? `<${comp}><!></${comp}>` : `<${comp}/>`;
12821
+ const el = isHydrating$1 ? adoptTemplate(currentHydrationNode, hydrationTemplate, adoptHydrationChildren) : /* @__PURE__ */ createElement(comp);
12661
12822
  el.$root = isSingleRoot;
12662
12823
  if (!isHydrating$1) {
12663
12824
  const scopeId = getCurrentScopeId();
@@ -12671,7 +12832,7 @@ function createPlainElement(comp, rawProps, rawSlots, isSingleRoot, once) {
12671
12832
  if (rawSlots) {
12672
12833
  let nextNode = null;
12673
12834
  if (isHydrating$1) {
12674
- nextNode = locateNextNode(el);
12835
+ nextNode = nextLogicalSibling(el);
12675
12836
  setCurrentHydrationNode(el.firstChild);
12676
12837
  }
12677
12838
  if (rawSlots.$) {
@@ -12792,7 +12953,7 @@ function handleSetupResult(setupResult, component, instance) {
12792
12953
  else if (setupResult === EMPTY_OBJ && component.render) instance.block = callRender(component.render, instance, setupResult);
12793
12954
  else instance.block = setupResult;
12794
12955
  if (instance.hasFallthrough && component.inheritAttrs !== false && Object.keys(instance.attrs).length) {
12795
- const root = getRootElement(instance.block, (frag) => frag.attrs = instance.attrs, false);
12956
+ const root = getRootElement(instance.block, (frag) => registerDynamicFragmentFallthroughAttrs(frag, instance.attrs), false);
12796
12957
  if (root) renderEffect(() => {
12797
12958
  const attrs = isFunction(component) && !(isTransitionEnabled ? isVaporTransition(component) : false) ? getFunctionalFallthrough(instance.attrs) : instance.attrs;
12798
12959
  if (attrs) applyFallthroughProps(root, attrs);
@@ -12805,6 +12966,15 @@ function getCurrentScopeId() {
12805
12966
  const scopeOwner = getScopeOwner();
12806
12967
  return scopeOwner ? scopeOwner.type.__scopeId : void 0;
12807
12968
  }
12969
+ function registerDynamicFragmentFallthroughAttrs(frag, attrs) {
12970
+ frag.hasFallthroughAttrs = true;
12971
+ (frag.onBeforeInsert || (frag.onBeforeInsert = [])).push((nodes) => {
12972
+ if (nodes instanceof Element) frag.scope.run(() => {
12973
+ renderEffect(() => applyFallthroughProps(nodes, attrs));
12974
+ });
12975
+ else if (frag.anchorLabel === "slot" || isArray(nodes) && nodes.length) warnExtraneousAttributes(attrs);
12976
+ });
12977
+ }
12808
12978
  //#endregion
12809
12979
  //#region packages/runtime-vapor/src/apiCreateApp.ts
12810
12980
  let _createApp;
@@ -12948,7 +13118,7 @@ function defineVaporAsyncComponent(source) {
12948
13118
  function createInnerComp(comp, parent, rawProps = parent.rawProps, rawSlots = parent.rawSlots) {
12949
13119
  const prevInstance = setCurrentInstance(parent);
12950
13120
  try {
12951
- return createComponent(comp, rawProps, rawSlots, void 0, void 0, parent.appContext);
13121
+ return createComponent(comp, rawProps, rawSlots, void 0, parent.isOnce, parent.appContext);
12952
13122
  } finally {
12953
13123
  setCurrentInstance(...prevInstance);
12954
13124
  }
@@ -13012,10 +13182,11 @@ function setDisplay(target, value) {
13012
13182
  else el.style.display = "none";
13013
13183
  else if (isHydrating$1) {
13014
13184
  if (!value && el.style.display !== "none") {
13015
- warnPropMismatch(el, "style", 3, `display: ${el.style.display}`, "display: none");
13016
- logMismatchError();
13017
- el.style.display = "none";
13018
- el[vShowOriginalDisplay] = "";
13185
+ if (warnPropMismatch(el, "style", 3, `display: ${el.style.display}`, "display: none")) {
13186
+ logMismatchError();
13187
+ el.style.display = "none";
13188
+ el[vShowOriginalDisplay] = "";
13189
+ }
13019
13190
  }
13020
13191
  } else el.style.display = value ? el[vShowOriginalDisplay] : "none";
13021
13192
  el[vShowHidden] = !value;
@@ -13165,7 +13336,7 @@ function applyResolvedTransitionHooks(block, hooks) {
13165
13336
  if (block.length === 1) block = block[0];
13166
13337
  else if (block.length === 0) return { hooks };
13167
13338
  }
13168
- if (hooks.applyGroup && block instanceof ForFragment) {
13339
+ if (hooks.applyGroup && (block instanceof ForFragment || block instanceof SlotFragment || isVaporComponent(block) && block.block instanceof SlotFragment)) {
13169
13340
  hooks.applyGroup(block, hooks.props, hooks.state, hooks.instance);
13170
13341
  return { hooks };
13171
13342
  }
@@ -13518,7 +13689,7 @@ const VaporKeepAlive = /* @__PURE__ */ withKeepAliveEnabled(/* @__PURE__ */ defi
13518
13689
  keptAliveScopes.forEach((scope) => scope.stop());
13519
13690
  keptAliveScopes.clear();
13520
13691
  });
13521
- const prevCtx = setCurrentKeepAliveCtx({
13692
+ const keepAliveCtx = {
13522
13693
  processShapeFlag,
13523
13694
  cacheBlock,
13524
13695
  cacheScope(cacheKey, scopeLookupKey, scope) {
@@ -13533,11 +13704,14 @@ const VaporKeepAlive = /* @__PURE__ */ withKeepAliveEnabled(/* @__PURE__ */ defi
13533
13704
  getScope(key) {
13534
13705
  return deleteScope(key);
13535
13706
  }
13536
- });
13707
+ };
13708
+ const prevCtx = setCurrentKeepAliveCtx(keepAliveCtx);
13537
13709
  let children = slots.default();
13538
13710
  setCurrentKeepAliveCtx(prevCtx);
13711
+ registerDynamicFragmentHooks(children, keepAliveCtx);
13539
13712
  if (isArray(children)) {
13540
13713
  children = children.filter((child) => !(child instanceof Comment));
13714
+ if (children.length === 1) registerDynamicFragmentHooks(children[0], keepAliveCtx);
13541
13715
  if (children.length > 1) {
13542
13716
  warn(`KeepAlive should contain exactly one component child.`);
13543
13717
  return children;
@@ -13546,6 +13720,20 @@ const VaporKeepAlive = /* @__PURE__ */ withKeepAliveEnabled(/* @__PURE__ */ defi
13546
13720
  return children;
13547
13721
  }
13548
13722
  }));
13723
+ function registerDynamicFragmentHooks(block, keepAliveCtx) {
13724
+ if (!isDynamicFragment(block)) return;
13725
+ (block.onBeforeRemove || (block.onBeforeRemove = [])).push((scope) => {
13726
+ const cacheKey = block.keyed ? withCurrentCacheKey(block.current, () => keepAliveCtx.processShapeFlag(block.nodes)) : keepAliveCtx.processShapeFlag(block.nodes);
13727
+ if (cacheKey !== false) {
13728
+ keepAliveCtx.cacheScope(cacheKey, block.current, scope);
13729
+ return true;
13730
+ }
13731
+ return false;
13732
+ });
13733
+ (block.onUpdated || (block.onUpdated = [])).unshift(() => {
13734
+ if (block.$transition && block.$transition.mode === "out-in") keepAliveCtx.cacheBlock(block);
13735
+ });
13736
+ }
13549
13737
  const shouldCache = (block, props, interop = false) => {
13550
13738
  const isAsync = isAsyncWrapper(interop ? block.vnode : block);
13551
13739
  const type = interop && isInteropEnabled ? block.vnode.type : block.type;
@@ -13635,7 +13823,9 @@ const vaporInteropImpl = {
13635
13823
  const instance = vnode.component = createComponent(vnode.type, { $: dynamicPropSource }, rawSlots, void 0, void 0, parentComponent ? parentComponent.appContext : vnode.appContext, true);
13636
13824
  instance.rawPropsRef = propsRef;
13637
13825
  instance.rawSlotsRef = slotsRef;
13638
- ensureVNodeHookState(instance, vnode);
13826
+ const vnodeHookState = ensureVNodeHookState(instance, vnode);
13827
+ const applyScopeId = (vnode) => setInteropVnodeScopeId(instance, vnode, instance.parent);
13828
+ vnodeHookState.postRootSyncHooks.push(applyScopeId);
13639
13829
  if (parentComponent && isKeepAlive(parentComponent)) {
13640
13830
  enableKeepAlive();
13641
13831
  instance.shapeFlag = vnode.shapeFlag;
@@ -13654,6 +13844,7 @@ const vaporInteropImpl = {
13654
13844
  vnode.dirs = null;
13655
13845
  }
13656
13846
  mountComponent(instance, container, selfAnchor);
13847
+ if (!isHydrating$1) applyScopeId(vnodeHookState.vnode);
13657
13848
  simpleSetCurrentInstance(prev);
13658
13849
  return instance;
13659
13850
  },
@@ -13674,6 +13865,7 @@ const vaporInteropImpl = {
13674
13865
  instance.rawSlotsRef.value = normalizeInteropSlots(n2.children);
13675
13866
  queuePostFlushCb(() => {
13676
13867
  syncVNodeEl(n2, instance);
13868
+ setInteropVnodeScopeId(instance, n2, instance.parent);
13677
13869
  if (!instance.isUpdating) vnodeHookState.skipVnodeHooks = false;
13678
13870
  });
13679
13871
  }
@@ -13945,13 +14137,22 @@ function appendVnodeUpdatedHook(vnode, hook) {
13945
14137
  const existing = props.onVnodeUpdated;
13946
14138
  props.onVnodeUpdated = existing ? isArray(existing) ? [...existing, hook] : [existing, hook] : hook;
13947
14139
  }
14140
+ function appendVnodeBeforeUpdateHook(vnode, hook) {
14141
+ const props = vnode.props || (vnode.props = {});
14142
+ const existing = props.onVnodeBeforeUpdate;
14143
+ props.onVnodeBeforeUpdate = existing ? isArray(existing) ? [...existing, hook] : [existing, hook] : hook;
14144
+ }
13948
14145
  function trackFragmentVNodeUpdates(frag, vnode) {
13949
- const refresh = () => {
14146
+ const beforeUpdate = () => {
14147
+ if (frag.onBeforeUpdate) for (let i = 0; i < frag.onBeforeUpdate.length; i++) frag.onBeforeUpdate[i]();
14148
+ };
14149
+ const updated = () => {
13950
14150
  frag.nodes = resolveVNodeNodes(vnode);
13951
14151
  frag.validityPending = false;
13952
14152
  if (frag.onUpdated) frag.onUpdated.forEach((m) => m());
13953
14153
  };
13954
- appendVnodeUpdatedHook(vnode, refresh);
14154
+ appendVnodeBeforeUpdateHook(vnode, beforeUpdate);
14155
+ appendVnodeUpdatedHook(vnode, updated);
13955
14156
  }
13956
14157
  /**
13957
14158
  * Mount VNode in vapor
@@ -14005,7 +14206,7 @@ function mountVNode(internals, vnode, parentComponent) {
14005
14206
  /**
14006
14207
  * Mount vdom component in vapor
14007
14208
  */
14008
- function createVDOMComponent(internals, component, parentComponent, rawProps, rawSlots) {
14209
+ function createVDOMComponent(internals, component, parentComponent, rawProps, rawSlots, once) {
14009
14210
  const suspense = parentSuspense || parentComponent && parentComponent.suspense;
14010
14211
  const useBridge = shouldUseRendererBridge(component);
14011
14212
  const comp = useBridge ? ensureRendererBridge(component) : component;
@@ -14026,7 +14227,7 @@ function createVDOMComponent(internals, component, parentComponent, rawProps, ra
14026
14227
  }
14027
14228
  setCurrentKeepAliveCtx(null);
14028
14229
  }
14029
- const wrapper = new VaporComponentInstance(useBridge ? comp : { props: component.props }, rawProps, rawSlots, parentComponent ? parentComponent.appContext : void 0, void 0);
14230
+ const wrapper = new VaporComponentInstance(useBridge ? comp : { props: component.props }, rawProps, rawSlots, parentComponent ? parentComponent.appContext : void 0, once);
14030
14231
  if (isCollectingVdomSlotVNodes) collectedVdomSlotVNodes.set(frag, createCollectedVDOMSlotVNode(component, rawProps, wrapper.slots));
14031
14232
  vnode.vi = (instance) => {
14032
14233
  instance.props = /* @__PURE__ */ shallowReactive(wrapper.props);
@@ -14197,7 +14398,7 @@ function trackSlotVNodeUpdatesWithRefresh(vnode, refresh) {
14197
14398
  /**
14198
14399
  * Mount vdom slot in vapor
14199
14400
  */
14200
- function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallback) {
14401
+ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallback, once) {
14201
14402
  const suspense = parentSuspense || parentComponent.suspense;
14202
14403
  const frag = new VaporFragment([]);
14203
14404
  trackSlotBoundaryDirtying(frag);
@@ -14242,7 +14443,7 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
14242
14443
  if (!isContentUpdateRecheck && inheritedBoundary) inheritedBoundary.markDirty();
14243
14444
  }
14244
14445
  };
14245
- localFallback = fallback ? () => fallback(internals, parentComponent) : void 0;
14446
+ localFallback = fallback ? once ? () => withOnceSlot(() => fallback(internals, parentComponent)) : () => fallback(internals, parentComponent) : void 0;
14246
14447
  const setRenderedContent = (rendered) => {
14247
14448
  contentState.rendered = rendered;
14248
14449
  if (isVNode(rendered)) {
@@ -14299,12 +14500,13 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
14299
14500
  const prev = currentInstance;
14300
14501
  simpleSetCurrentInstance(instance);
14301
14502
  try {
14302
- renderEffect(() => {
14503
+ const renderSlotContent = () => {
14303
14504
  runWithFragmentRenderCtx(frag, () => withOwnedSlotBoundary(boundary, () => {
14304
14505
  let slotContent;
14305
14506
  let slotContentValid = false;
14306
14507
  if (slotsRef.value) {
14307
- slotContent = renderSlot(slotsRef.value, isFunction(name) ? name() : name, props);
14508
+ const renderContent = () => renderSlot(slotsRef.value, isFunction(name) ? name() : name, props);
14509
+ slotContent = once ? withOnceSlot(renderContent) : renderContent();
14308
14510
  if (isVNode(slotContent)) if (slotContent.type === Fragment) {
14309
14511
  const children = slotContent.children;
14310
14512
  ensureVaporSlotFallback(children, localFallback);
@@ -14367,7 +14569,8 @@ function renderVDOMSlot(internals, slotsRef, name, props, parentComponent, fallb
14367
14569
  setRenderedContent(null);
14368
14570
  finishContentUpdate();
14369
14571
  }));
14370
- });
14572
+ };
14573
+ once ? renderSlotContent() : renderEffect(renderSlotContent);
14371
14574
  } finally {
14372
14575
  simpleSetCurrentInstance(prev);
14373
14576
  }
@@ -14664,7 +14867,8 @@ function ensureVNodeHookState(instance, vnode) {
14664
14867
  if (!state) {
14665
14868
  state = {
14666
14869
  vnode,
14667
- skipVnodeHooks: false
14870
+ skipVnodeHooks: false,
14871
+ postRootSyncHooks: []
14668
14872
  };
14669
14873
  vnodeHookStateMap.set(instance, state);
14670
14874
  (instance.bu || (instance.bu = [])).push(() => {
@@ -14672,7 +14876,11 @@ function ensureVNodeHookState(instance, vnode) {
14672
14876
  const vnodeHook = state.vnode.props && state.vnode.props.onVnodeBeforeUpdate;
14673
14877
  if (vnodeHook) callWithAsyncErrorHandling(vnodeHook, instance.parent, 7, [state.vnode, state.vnode]);
14674
14878
  });
14675
- (instance.u || (instance.u = [])).unshift(() => syncVNodeEl(state.vnode, instance));
14879
+ (instance.u || (instance.u = [])).unshift(() => {
14880
+ syncVNodeEl(state.vnode, instance);
14881
+ const hooks = state.postRootSyncHooks;
14882
+ for (let i = 0; i < hooks.length; i++) hooks[i](state.vnode);
14883
+ });
14676
14884
  instance.u.push(() => {
14677
14885
  if (state.skipVnodeHooks) {
14678
14886
  state.skipVnodeHooks = false;
@@ -14860,6 +15068,32 @@ function createInteropRawSlots(slotsRef) {
14860
15068
  });
14861
15069
  return rawSlots;
14862
15070
  }
15071
+ const interopScopeIdRootMap = /* @__PURE__ */ new WeakMap();
15072
+ const interopScopeIdFragmentMap = /* @__PURE__ */ new WeakMap();
15073
+ function trackInteropScopeIdFragment(instance, frag) {
15074
+ if (interopScopeIdFragmentMap.get(frag) === instance) return;
15075
+ interopScopeIdFragmentMap.set(frag, instance);
15076
+ (frag.onUpdated || (frag.onUpdated = [])).push(() => {
15077
+ const state = vnodeHookStateMap.get(instance);
15078
+ if (!state) return;
15079
+ syncVNodeEl(state.vnode, instance);
15080
+ setInteropVnodeScopeId(instance, state.vnode, instance.parent);
15081
+ });
15082
+ }
15083
+ function setInteropVnodeScopeId(instance, vnode, parentComponent) {
15084
+ const root = getRootElement(instance, (frag) => trackInteropScopeIdFragment(instance, frag));
15085
+ if (!root) {
15086
+ interopScopeIdRootMap.delete(instance);
15087
+ return;
15088
+ }
15089
+ if (interopScopeIdRootMap.get(instance) === root) return;
15090
+ interopScopeIdRootMap.set(instance, root);
15091
+ const scopeIds = [];
15092
+ if (vnode.scopeId) scopeIds.push(vnode.scopeId);
15093
+ if (vnode.slotScopeIds) scopeIds.push(...vnode.slotScopeIds);
15094
+ scopeIds.push(...getInheritedScopeIds(vnode, parentComponent));
15095
+ for (let i = 0; i < scopeIds.length; i++) root.setAttribute(scopeIds[i], "");
15096
+ }
14863
15097
  //#endregion
14864
15098
  //#region packages/runtime-vapor/src/components/Teleport.ts
14865
15099
  const VaporTeleportImpl = {
@@ -15203,16 +15437,19 @@ var VaporElement = class extends VueElementBase {
15203
15437
  //#region packages/runtime-vapor/src/dom/template.ts
15204
15438
  let t;
15205
15439
  /* @__NO_SIDE_EFFECTS__ */
15206
- function template(html, root, isStatic, ns) {
15440
+ function template(html, flags = 0, ns) {
15441
+ const root = !!(flags & 1);
15442
+ const isStatic = !!(flags & 2);
15207
15443
  let node;
15208
15444
  return () => {
15209
15445
  if (isHydrating$1) {
15210
15446
  let adopted = null;
15211
15447
  if (isStatic) {
15212
15448
  adopted = resolveHydrationTarget(currentHydrationNode);
15449
+ if (html !== "") validateHydrationTarget(adopted, html);
15213
15450
  node = adopted.cloneNode(true);
15214
15451
  advanceHydrationNode(adopted);
15215
- } else adopted = adoptTemplate(currentHydrationNode, html);
15452
+ } else adopted = adoptTemplate(currentHydrationNode, html, false, ns);
15216
15453
  if (root) adopted.$root = true;
15217
15454
  return adopted;
15218
15455
  }
@@ -15238,30 +15475,32 @@ function template(html, root, isStatic, ns) {
15238
15475
  }
15239
15476
  //#endregion
15240
15477
  //#region packages/runtime-vapor/src/apiCreateIf.ts
15241
- function createIf(condition, b1, b2, blockShape, once, index) {
15478
+ function createIf(condition, b1, b2, flags = 1) {
15242
15479
  const _insertionParent = insertionParent;
15243
15480
  const _insertionAnchor = insertionAnchor;
15244
15481
  if (!isHydrating$1) resetInsertionState();
15245
15482
  let hydrationCursor = null;
15246
15483
  let branchShape;
15247
15484
  let frag;
15248
- if (once) {
15485
+ if (flags & 16) {
15249
15486
  const ok = condition();
15250
15487
  if (isHydrating$1) {
15251
- branchShape = decodeIfShape(blockShape, ok);
15488
+ branchShape = decodeIfShape(flags, ok);
15252
15489
  hydrationCursor = enterHydrationCursor(branchShape === 2);
15253
15490
  }
15254
15491
  frag = ok ? b1() : b2 ? b2() : [/* @__PURE__ */ createComment("if")];
15255
15492
  } else {
15256
- const keyed = index != null;
15493
+ const index = flags >> 7;
15494
+ const keyed = index > 0;
15495
+ const keyBase = keyed ? (index - 1) * 2 : 0;
15257
15496
  frag = new DynamicFragment("if", keyed, false);
15258
15497
  renderEffect(() => {
15259
15498
  const ok = condition();
15260
15499
  if (isHydrating$1) {
15261
- branchShape = decodeIfShape(blockShape, ok);
15500
+ branchShape = decodeIfShape(flags, ok);
15262
15501
  hydrationCursor = enterHydrationCursor(branchShape === 2);
15263
15502
  }
15264
- frag.update(ok ? b1 : b2, keyed ? `${index}${ok ? 0 : 1}` : void 0);
15503
+ frag.update(ok ? b1 : b2, keyed ? keyBase + (ok ? 0 : 1) : void 0, isNoScopeBranch(flags, ok));
15265
15504
  });
15266
15505
  }
15267
15506
  if (!isHydrating$1) {
@@ -15278,6 +15517,9 @@ function createIf(condition, b1, b2, blockShape, once, index) {
15278
15517
  function decodeIfShape(shape, ok) {
15279
15518
  return shape >> (ok ? 0 : 2) & 3;
15280
15519
  }
15520
+ function isNoScopeBranch(flags, ok) {
15521
+ return !!(flags & (ok ? 32 : 64));
15522
+ }
15281
15523
  //#endregion
15282
15524
  //#region packages/runtime-vapor/src/apiCreateFragment.ts
15283
15525
  /**
@@ -15318,6 +15560,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15318
15560
  let isMounted = false;
15319
15561
  let oldBlocks = [];
15320
15562
  let newBlocks;
15563
+ let newKeys;
15321
15564
  let parent;
15322
15565
  let parentAnchor;
15323
15566
  let pendingHydrationAnchor = false;
@@ -15326,6 +15569,8 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15326
15569
  const instance = currentInstance;
15327
15570
  const canUseFastRemove = !!(flags & 1);
15328
15571
  const isComponent = !!(flags & 2);
15572
+ const isSingleNode = !!(flags & 8);
15573
+ const isFragment = !!(flags & 16);
15329
15574
  const slotOwner = currentSlotOwner;
15330
15575
  if (!instance) warn("createFor() can only be used inside setup()");
15331
15576
  if (!isComponent) onScopeDispose(() => {
@@ -15339,7 +15584,13 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15339
15584
  const newLength = source.values.length;
15340
15585
  const oldLength = oldBlocks.length;
15341
15586
  newBlocks = new Array(newLength);
15587
+ newKeys = void 0;
15588
+ if (getKey) {
15589
+ newKeys = new Array(newLength);
15590
+ for (let i = 0; i < newLength; i++) newKeys[i] = getKey(...getItem(source, i));
15591
+ }
15342
15592
  const prevSub = setActiveSub();
15593
+ if (isMounted && frag.onBeforeUpdate) for (let i = 0; i < frag.onBeforeUpdate.length; i++) frag.onBeforeUpdate[i]();
15343
15594
  if (!isMounted) {
15344
15595
  isMounted = true;
15345
15596
  if (isHydrating$1) hydrateList(source, newLength);
@@ -15364,7 +15615,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15364
15615
  {
15365
15616
  const keyToIndexMap = /* @__PURE__ */ new Map();
15366
15617
  for (let i = 0; i < newLength; i++) {
15367
- const key = getKey(...getItem(source, i));
15618
+ const key = newKeys[i];
15368
15619
  if (key != null) {
15369
15620
  if (keyToIndexMap.has(key)) warn(`Duplicate keys found during update:`, JSON.stringify(key), `Make sure keys are unique.`);
15370
15621
  keyToIndexMap.set(key, i);
@@ -15380,7 +15631,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15380
15631
  while (endOffset < commonLength) {
15381
15632
  const index = newLength - endOffset - 1;
15382
15633
  const item = getItem(source, index);
15383
- const key = getKey(...item);
15634
+ const key = newKeys[index];
15384
15635
  const existingBlock = oldBlocks[oldLength - endOffset - 1];
15385
15636
  if (existingBlock.key !== key) break;
15386
15637
  update(existingBlock, ...item);
@@ -15392,7 +15643,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15392
15643
  const e3 = newLength - endOffset;
15393
15644
  for (let i = 0; i < e1; i++) {
15394
15645
  const currentItem = getItem(source, i);
15395
- const currentKey = getKey(...currentItem);
15646
+ const currentKey = newKeys[i];
15396
15647
  const oldBlock = oldBlocks[i];
15397
15648
  const oldKey = oldBlock.key;
15398
15649
  if (oldKey === currentKey) update(newBlocks[i] = oldBlock, currentItem[0]);
@@ -15408,7 +15659,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15408
15659
  for (let i = e1; i < e2; i++) oldKeyIndexPairs[oldKeyIndexPairsLength++] = [oldBlocks[i].key, i];
15409
15660
  for (let i = e1; i < e3; i++) {
15410
15661
  const blockItem = getItem(source, i);
15411
- const blockKey = getKey(...blockItem);
15662
+ const blockKey = newKeys[i];
15412
15663
  queuedBlocks[queuedBlocksLength++] = [
15413
15664
  i,
15414
15665
  blockItem,
@@ -15474,7 +15725,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15474
15725
  const { item, key } = action;
15475
15726
  moveLink(mount(source, index, anchorNode, item, key), nextBlock.prev, nextBlock);
15476
15727
  } else if (action.block.next !== nextBlock) {
15477
- insert(action.block, parent, anchorNode);
15728
+ insertForBlock(action.block, anchorNode);
15478
15729
  moveLink(action.block, nextBlock.prev, nextBlock);
15479
15730
  }
15480
15731
  } else if ("source" in action) {
@@ -15485,7 +15736,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15485
15736
  } else if (action.block.next !== void 0) {
15486
15737
  let anchorNode = anchor ? normalizeAnchor(anchor.nodes) : parentAnchor;
15487
15738
  if (!anchorNode.parentNode) anchorNode = parentAnchor;
15488
- insert(action.block, parent, anchorNode);
15739
+ insertForBlock(action.block, anchorNode);
15489
15740
  moveLink(action.block, blocksTail);
15490
15741
  blocksTail = action.block;
15491
15742
  }
@@ -15501,7 +15752,9 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15501
15752
  };
15502
15753
  const needKey = renderItem.length > 1;
15503
15754
  const needIndex = renderItem.length > 2;
15504
- const mount = (source, idx, anchor = parentAnchor, [item, key, index] = getItem(source, idx), key2 = getKey && getKey(item, key, index)) => {
15755
+ const insertForBlock = isSingleNode ? (block, anchor) => insertNode(block.nodes, parent, anchor) : isFragment ? (block, anchor) => insertFragment(block.nodes, parent, anchor) : (block, anchor) => insert(block.nodes, parent, anchor);
15756
+ const removeForBlock = isSingleNode ? (block) => removeNode(block.nodes, parent) : isFragment ? (block) => removeFragment(block.nodes, parent) : (block) => remove(block.nodes, parent);
15757
+ const mount = (source, idx, anchor = parentAnchor, [item, key, index] = getItem(source, idx), key2 = newKeys ? newKeys[idx] : getKey && getKey(item, key, index)) => {
15505
15758
  const itemRef = /* @__PURE__ */ shallowRef(item);
15506
15759
  const keyRef = needKey ? /* @__PURE__ */ shallowRef(key) : void 0;
15507
15760
  const indexRef = needIndex ? /* @__PURE__ */ shallowRef(index) : void 0;
@@ -15518,8 +15771,11 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15518
15771
  }
15519
15772
  }
15520
15773
  const block = newBlocks[idx] = new ForBlock(nodes, scope, itemRef, keyRef, indexRef, key2);
15521
- if (isTransitionEnabled && frag.$transition) applyTransitionHooks(block.nodes, frag.$transition);
15522
- if (parent) insert(block.nodes, parent, anchor);
15774
+ if (isTransitionEnabled && frag.$transition) {
15775
+ if (frag.$transition.applyGroup) setBlockKey(block.nodes, block.key);
15776
+ applyTransitionHooks(block.nodes, frag.$transition);
15777
+ }
15778
+ if (parent) insertForBlock(block, anchor);
15523
15779
  return block;
15524
15780
  };
15525
15781
  function hydrateList(source, newLength) {
@@ -15543,7 +15799,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15543
15799
  if (isComment(currentHydrationNode, "]")) {
15544
15800
  nextNode = markHydrationAnchor(currentHydrationNode);
15545
15801
  setCurrentHydrationNode(nextNode);
15546
- } else nextNode = locateNextNode(currentHydrationNode);
15802
+ } else nextNode = nextLogicalSibling(currentHydrationNode);
15547
15803
  mount(source, i);
15548
15804
  if (nextNode) setCurrentHydrationNode(nextNode);
15549
15805
  }
@@ -15580,7 +15836,7 @@ const createFor = (src, renderItem, getKey, flags = 0) => {
15580
15836
  };
15581
15837
  const unmount = (block, doRemove = true) => {
15582
15838
  if (!isComponent) block.scope.stop();
15583
- if (doRemove) remove(block.nodes, parent);
15839
+ if (doRemove) removeForBlock(block);
15584
15840
  };
15585
15841
  if (flags & 4) renderList();
15586
15842
  else renderEffect(() => {
@@ -15734,9 +15990,18 @@ function getItem({ keys, values, needsWrap, isReadonlySource }, idx) {
15734
15990
  }
15735
15991
  function normalizeAnchor(node) {
15736
15992
  if (node instanceof Node) return node;
15737
- else if (isArray(node)) return normalizeAnchor(node[0]);
15738
- else if (isVaporComponent(node)) return normalizeAnchor(node.block);
15739
- else return normalizeAnchor(node.nodes);
15993
+ else if (isArray(node)) {
15994
+ for (let i = 0; i < node.length; i++) {
15995
+ const anchor = normalizeAnchor(node[i]);
15996
+ if (anchor) return anchor;
15997
+ }
15998
+ return;
15999
+ } else if (isVaporComponent(node)) return normalizeAnchor(node.block);
16000
+ else {
16001
+ const getEffectiveOutput = node.getEffectiveOutput;
16002
+ const nodes = getEffectiveOutput ? getEffectiveOutput.call(node) : node.nodes;
16003
+ return isValidBlock(nodes) ? normalizeAnchor(nodes) : node.anchor || normalizeAnchor(nodes);
16004
+ }
15740
16005
  }
15741
16006
  function getRestElement(val, keys) {
15742
16007
  const res = {};
@@ -15751,6 +16016,10 @@ function isForBlock(block) {
15751
16016
  }
15752
16017
  //#endregion
15753
16018
  //#region packages/runtime-vapor/src/apiTemplateRef.ts
16019
+ function getTemplateRefUpdateFragment(el) {
16020
+ if (isDynamicFragment(el)) return el;
16021
+ if (isVaporComponent(el) && isAsyncWrapper(el)) return el.block;
16022
+ }
15754
16023
  function ensureCleanup(el) {
15755
16024
  let cleanupRef = refCleanups.get(el);
15756
16025
  if (!cleanupRef) {
@@ -15768,8 +16037,8 @@ function createTemplateRefSetter() {
15768
16037
  const oldRefMap = /* @__PURE__ */ new WeakMap();
15769
16038
  const setRefMap = /* @__PURE__ */ new WeakMap();
15770
16039
  return (el, ref, refFor, refKey) => {
15771
- if (isDynamicFragment(el) || isVaporComponent(el) && isAsyncWrapper(el)) {
15772
- const frag = isDynamicFragment(el) ? el : el.block;
16040
+ const frag = getTemplateRefUpdateFragment(el);
16041
+ if (frag) {
15773
16042
  const doSet = () => {
15774
16043
  if (isVaporComponent(el) && el.isDeactivated) return;
15775
16044
  oldRefMap.set(el, setRef$1(instance, el, ref, oldRefMap.get(el), refFor, refKey));
@@ -15784,6 +16053,19 @@ function createTemplateRefSetter() {
15784
16053
  return oldRef;
15785
16054
  };
15786
16055
  }
16056
+ function setStaticTemplateRef(el, ref, refFor, refKey) {
16057
+ const instance = currentInstance;
16058
+ const oldRef = setRef$1(instance, el, ref, void 0, refFor, refKey);
16059
+ const frag = getTemplateRefUpdateFragment(el);
16060
+ if (frag) (frag.onUpdated || (frag.onUpdated = [])).push(() => {
16061
+ if (isVaporComponent(el) && el.isDeactivated) return;
16062
+ setRef$1(instance, el, ref, oldRef, refFor, refKey);
16063
+ });
16064
+ return oldRef;
16065
+ }
16066
+ function setTemplateRefBinding(el, getter, setter = createTemplateRefSetter(), refFor, refKey) {
16067
+ renderEffect(() => setter(el, getter(), refFor, refKey));
16068
+ }
15787
16069
  /**
15788
16070
  * Function for handling a template ref
15789
16071
  */
@@ -15924,6 +16206,7 @@ function createDynamicComponent(getter, rawProps, rawSlots, isSingleRoot, once)
15924
16206
  if (!isHydrating$1) resetInsertionState();
15925
16207
  const hydrationCursor = isHydrating$1 ? captureHydrationCursor() : null;
15926
16208
  const frag = new DynamicFragment("dynamic-component");
16209
+ const normalizedRawSlots = normalizeRawSlots(rawSlots);
15927
16210
  const scopeOwner = getScopeOwner();
15928
16211
  const renderFn = () => {
15929
16212
  const value = getter();
@@ -15943,7 +16226,7 @@ function createDynamicComponent(getter, rawProps, rawSlots, isSingleRoot, once)
15943
16226
  }
15944
16227
  return frag;
15945
16228
  }
15946
- return createComponentWithFallback(withScopeOwner(scopeOwner, () => resolveDynamicComponent(value)), rawProps, rawSlots, isSingleRoot, once, appContext);
16229
+ return createComponentWithFallback(withScopeOwner(scopeOwner, () => resolveDynamicComponent(value)), rawProps, normalizedRawSlots, isSingleRoot, once, appContext);
15947
16230
  }, value);
15948
16231
  };
15949
16232
  if (once) renderFn();
@@ -16043,6 +16326,7 @@ function withVaporDirectives(node, dirs) {
16043
16326
  //#region packages/runtime-vapor/src/components/TransitionGroup.ts
16044
16327
  const positionMap = /* @__PURE__ */ new WeakMap();
16045
16328
  const newPositionMap = /* @__PURE__ */ new WeakMap();
16329
+ const transitionGroupUpdateOwnerMap = /* @__PURE__ */ new WeakMap();
16046
16330
  let isForHydrationAnchorResolverRegistered = false;
16047
16331
  let currentForHydrationContainer;
16048
16332
  function ensureForHydrationAnchorResolver() {
@@ -16073,16 +16357,18 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
16073
16357
  ensureTransitionHooksRegistered();
16074
16358
  const instance = currentInstance;
16075
16359
  const state = useTransitionState();
16076
- let cssTransitionProps = resolveTransitionProps(props);
16360
+ let cssTransitionProps;
16077
16361
  const propsProxy = new Proxy({}, { get(_, key) {
16078
16362
  return cssTransitionProps[key];
16079
16363
  } });
16080
- renderEffect(() => {
16081
- cssTransitionProps = resolveTransitionProps(props);
16082
- });
16083
- let prevChildren;
16364
+ renderEffect(() => cssTransitionProps = resolveTransitionProps(props), true);
16365
+ let prevChildren = [];
16366
+ let isUpdatePending = false;
16367
+ let isUpdatedPending = false;
16084
16368
  let slottedBlock = [];
16085
- onBeforeUpdate(() => {
16369
+ const beforeUpdate = () => {
16370
+ if (isUpdatePending) return;
16371
+ isUpdatePending = true;
16086
16372
  prevChildren = [];
16087
16373
  const children = getTransitionBlocks(slottedBlock);
16088
16374
  for (let i = 0; i < children.length; i++) {
@@ -16094,8 +16380,11 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
16094
16380
  positionMap.set(child, el.getBoundingClientRect());
16095
16381
  }
16096
16382
  }
16097
- });
16098
- onUpdated(() => {
16383
+ };
16384
+ const flushUpdated = () => {
16385
+ isUpdatedPending = false;
16386
+ if (!isUpdatePending) return;
16387
+ isUpdatePending = false;
16099
16388
  if (!prevChildren.length) return;
16100
16389
  const moveClass = props.moveClass || `${props.name || "v"}-move`;
16101
16390
  const firstChild = getFirstConnectedChild(prevChildren);
@@ -16112,7 +16401,14 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
16112
16401
  forceReflow();
16113
16402
  movedChildren.forEach((c) => handleMovedChildren(getTransitionElement(c), moveClass));
16114
16403
  prevChildren = [];
16115
- });
16404
+ };
16405
+ const updated = () => {
16406
+ if (!isUpdatePending || isUpdatedPending) return;
16407
+ isUpdatedPending = true;
16408
+ queuePostFlushCb(flushUpdated);
16409
+ };
16410
+ onBeforeUpdate(beforeUpdate);
16411
+ onUpdated(updated);
16116
16412
  const frag = new DynamicFragment("transition-group");
16117
16413
  let currentTag;
16118
16414
  let currentSlot;
@@ -16128,7 +16424,7 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
16128
16424
  ensureForHydrationAnchorResolver();
16129
16425
  prevForHydrationContainer = currentForHydrationContainer;
16130
16426
  currentForHydrationContainer = container;
16131
- nextNode = locateNextNode(container);
16427
+ nextNode = nextLogicalSibling(container);
16132
16428
  setCurrentHydrationNode(container.firstChild || container);
16133
16429
  }
16134
16430
  let block = slottedBlock;
@@ -16136,7 +16432,10 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
16136
16432
  try {
16137
16433
  frag.update(() => {
16138
16434
  block = slot && slot() || [];
16139
- transitionBlocks = applyGroupTransitionHooks(block, propsProxy, state, instance);
16435
+ transitionBlocks = applyGroupTransitionHooks(block, propsProxy, state, instance, {
16436
+ beforeUpdate,
16437
+ updated
16438
+ });
16140
16439
  if (container) {
16141
16440
  if (!isHydrating$1) insert(block, container);
16142
16441
  return container;
@@ -16158,9 +16457,9 @@ const VaporTransitionGroup = /* @__PURE__ */ decorate(/* @__PURE__ */ defineVapo
16158
16457
  return frag;
16159
16458
  }
16160
16459
  }));
16161
- function applyGroupTransitionHooks(block, props, state, instance) {
16460
+ function applyGroupTransitionHooks(block, props, state, instance, updateHooks) {
16162
16461
  const fragments = [];
16163
- const children = getTransitionBlocks(block, (frag) => fragments.push(frag));
16462
+ const children = getTransitionBlocks(block, (frag) => fragments.push(frag), (owner) => trackTransitionGroupUpdate(owner, updateHooks));
16164
16463
  for (let i = 0; i < children.length; i++) {
16165
16464
  const child = children[i];
16166
16465
  if (isValidTransitionBlock(child)) if (child.$key != null) setTransitionHooks$1(child, resolveTransitionHooks$1(child, props, state, instance));
@@ -16168,11 +16467,45 @@ function applyGroupTransitionHooks(block, props, state, instance) {
16168
16467
  }
16169
16468
  fragments.forEach((frag) => {
16170
16469
  const hooks = resolveTransitionHooks$1(frag, props, state, instance);
16171
- hooks.applyGroup = applyGroupTransitionHooks;
16470
+ hooks.applyGroup = (block, props, state, instance) => applyGroupTransitionHooks(block, props, state, instance, updateHooks);
16172
16471
  frag.$transition = hooks;
16173
16472
  });
16174
16473
  return children;
16175
16474
  }
16475
+ function trackTransitionGroupUpdate(owner, updateHooks) {
16476
+ const registeredHooks = transitionGroupUpdateOwnerMap.get(owner);
16477
+ if (registeredHooks) {
16478
+ registeredHooks.beforeUpdate = updateHooks.beforeUpdate;
16479
+ registeredHooks.updated = updateHooks.updated;
16480
+ return;
16481
+ }
16482
+ transitionGroupUpdateOwnerMap.set(owner, updateHooks);
16483
+ if (isFragment(owner)) {
16484
+ (owner.onBeforeUpdate || (owner.onBeforeUpdate = [])).push(() => updateHooks.beforeUpdate());
16485
+ (owner.onUpdated || (owner.onUpdated = [])).push(() => updateHooks.updated());
16486
+ } else {
16487
+ let isPending = false;
16488
+ const flushUpdated = () => {
16489
+ isPending = false;
16490
+ updateHooks.updated();
16491
+ };
16492
+ owner.scope.run(() => {
16493
+ watch$1(() => {
16494
+ const prev = setCurrentInstance(owner, owner.scope);
16495
+ try {
16496
+ return resolveDynamicProps(owner.rawProps);
16497
+ } finally {
16498
+ setCurrentInstance(...prev);
16499
+ }
16500
+ }, () => {
16501
+ if (isPending) return;
16502
+ isPending = true;
16503
+ updateHooks.beforeUpdate();
16504
+ queuePostFlushCb(flushUpdated);
16505
+ });
16506
+ });
16507
+ }
16508
+ }
16176
16509
  function inheritKey(children, key) {
16177
16510
  if (key === void 0 || children.length === 0) return;
16178
16511
  for (let i = 0; i < children.length; i++) {
@@ -16180,25 +16513,30 @@ function inheritKey(children, key) {
16180
16513
  child.$key = String(key) + String(child.$key != null ? child.$key : i);
16181
16514
  }
16182
16515
  }
16183
- function getTransitionBlocks(block, onFragment) {
16516
+ function getTransitionBlocks(block, onFragment, onUpdateOwner) {
16184
16517
  let children = [];
16185
16518
  if (block instanceof Element) children.push(block);
16186
16519
  else if (isVaporComponent(block)) {
16187
- const blocks = getTransitionBlocks(block.block, onFragment);
16520
+ const isRootSlot = block.block instanceof SlotFragment;
16521
+ if (onUpdateOwner && !isRootSlot) onUpdateOwner(block);
16522
+ const blocks = getTransitionBlocks(block.block, onFragment, isRootSlot ? onUpdateOwner : void 0);
16188
16523
  inheritKey(blocks, block.$key);
16189
16524
  children.push(...blocks);
16190
16525
  } else if (isArray(block)) for (let i = 0; i < block.length; i++) {
16191
16526
  const b = block[i];
16192
- const blocks = getTransitionBlocks(b, onFragment);
16527
+ const blocks = getTransitionBlocks(b, onFragment, onUpdateOwner);
16193
16528
  if (isForBlock(b)) blocks.forEach((block) => block.$key = b.key);
16194
16529
  children.push(...blocks);
16195
16530
  }
16196
- else if (isFragment(block)) if (isInteropEnabled && block.vnode) children.push(block);
16197
- else {
16531
+ else if (isFragment(block)) {
16198
16532
  if (onFragment) onFragment(block);
16199
- const blocks = getTransitionBlocks(block.nodes, onFragment);
16200
- inheritKey(blocks, block.$key);
16201
- children.push(...blocks);
16533
+ if (onUpdateOwner) onUpdateOwner(block);
16534
+ if (isInteropEnabled && block.vnode) children.push(block);
16535
+ else {
16536
+ const blocks = getTransitionBlocks(block.nodes, onFragment, onUpdateOwner);
16537
+ inheritKey(blocks, block.$key);
16538
+ children.push(...blocks);
16539
+ }
16202
16540
  }
16203
16541
  return children;
16204
16542
  }
@@ -16225,4 +16563,4 @@ function getFirstConnectedChild(children) {
16225
16563
  }
16226
16564
  }
16227
16565
  //#endregion
16228
- export { BaseTransition, BaseTransitionPropsValidators, Comment$1 as Comment, DeprecationTypes, DynamicFragment, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text$1 as Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VaporElement, VaporFragment, VaporKeepAlive, VaporSlot, VaporTeleport, VaporTransition, VaporTransitionGroup, VueElement, VueElementBase, activate, applyCheckboxModel, applyDynamicModel, applyRadioModel, applySelectModel, applyTextModel, applyVShow, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, child, cloneVNode, compatUtils, compile, computed, createApp, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createComponent, createComponentWithFallback, createDynamicComponent, createElementBlock, createBaseVNode as createElementVNode, createFor, createForSlots, createHydrationRenderer, createIf, createInternalObject, createInvoker, createKeyedFragment, createPlainElement, createPropsRestProxy, createRenderer, createSSRApp, createSelector, createSlot, createSlots, createStaticVNode, createTemplateRefSetter, createTextNode, createTextVNode, createVNode, createVaporApp, createVaporSSRApp, currentInstance, customRef, deactivate, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, defineVaporAsyncComponent, defineVaporComponent, defineVaporCustomElement, defineVaporSSRCustomElement, delegate, delegateEvents, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getDefaultValue, getFunctionalFallthrough, getInheritedScopeIds, getRestElement, getTransitionRawChildren, guardReactiveProps, h, handleError, handleMovedChildren, hasCSSTransform, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, initFeatureFlags, inject, insert, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isFragment, isHydrating, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, isVaporComponent, knownTemplateRefs, leaveCbKey, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, next, nextTick, nextUid, nodeOps, normalizeClass, normalizeContainer, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, nthChild, on, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepend, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, remove, render, renderEffect, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, resolveTransitionProps, setAttr, setBlockHtml, setBlockKey, setBlockText, setBlockTracking, setClass, setClassName, setCurrentInstance, setCurrentRenderingInstance, setDOMProp, setDevtoolsHook, setDynamicEvents, setDynamicProps, setElementText, setHtml, setInsertionState, setIsHydratingEnabled, setProp, setRef, setStyle, setText, setTransitionHooks, setValue, setVarsOnNode, shallowReactive, shallowReadonly, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, svgNS, template, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, txt, unref, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, useVaporCssVars, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, validateComponentName, validateProps, vaporInteropPlugin, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId, withVaporCtx, withVaporDirectives, xlinkNS };
16566
+ export { BaseTransition, BaseTransitionPropsValidators, Comment$1 as Comment, DeprecationTypes, DynamicFragment, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text$1 as Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VaporElement, VaporFragment, VaporKeepAlive, VaporSlot, VaporTeleport, VaporTransition, VaporTransitionGroup, VueElement, VueElementBase, activate, applyCheckboxModel, applyDynamicModel, applyRadioModel, applySelectModel, applyTextModel, applyVShow, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, child, cloneVNode, compatUtils, compile, computed, createApp, createAppAPI, createAssetComponent, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createComponent, createComponentWithFallback, createDynamicComponent, createElementBlock, createBaseVNode as createElementVNode, createFor, createForSlots, createHydrationRenderer, createIf, createInternalObject, createInvoker, createKeyedFragment, createPlainElement, createPropsRestProxy, createRenderer, createSSRApp, createSelector, createSlot, createSlots, createStaticVNode, createTemplateRefSetter, createTextNode, createTextVNode, createVNode, createVaporApp, createVaporSSRApp, currentInstance, customRef, deactivate, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, defineVaporAsyncComponent, defineVaporComponent, defineVaporCustomElement, defineVaporSSRCustomElement, delegate, delegateEvents, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getDefaultValue, getFunctionalFallthrough, getInheritedScopeIds, getRestElement, getTransitionRawChildren, guardReactiveProps, h, handleError, handleMovedChildren, hasCSSTransform, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, initFeatureFlags, inject, insert, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isFragment, isHydrating, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, isVaporComponent, knownTemplateRefs, leaveCbKey, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, next, nextTick, nextUid, nodeOps, normalizeClass, normalizeContainer, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, nthChild, on, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onBinding, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, prepend, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, remove, render, renderEffect, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, resolveTransitionProps, setAttr, setBlockHtml, setBlockKey, setBlockText, setBlockTracking, setClass, setClassName, setCurrentInstance, setCurrentRenderingInstance, setDOMProp, setDevtoolsHook, setDynamicEvents, setDynamicProps, setElementText, setHtml, setInsertionState, setIsHydratingEnabled, setProp, setRef, setStaticTemplateRef, setStyle, setTemplateRefBinding, setText, setTransitionHooks, setValue, setVarsOnNode, shallowReactive, shallowReadonly, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, svgNS, template, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, txt, unref, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, useVaporCssVars, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, validateComponentName, validateProps, vaporInteropPlugin, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId, withVaporCtx, withVaporDirectives, withVaporKeys, withVaporModifiers, xlinkNS };