@vue/runtime-dom 3.6.0-alpha.1 → 3.6.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,8 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-alpha.1
2
+ * @vue/runtime-dom v3.6.0-alpha.3
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
- /*! #__NO_SIDE_EFFECTS__ */
7
6
  // @__NO_SIDE_EFFECTS__
8
7
  function makeMap(str) {
9
8
  const map = /* @__PURE__ */ Object.create(null);
@@ -59,10 +58,10 @@ const isBuiltInDirective = /* @__PURE__ */ makeMap(
59
58
  );
60
59
  const cacheStringFunction = (fn) => {
61
60
  const cache = /* @__PURE__ */ Object.create(null);
62
- return (str) => {
61
+ return ((str) => {
63
62
  const hit = cache[str];
64
63
  return hit || (cache[str] = fn(str));
65
- };
64
+ });
66
65
  };
67
66
  const camelizeRE = /-(\w)/g;
68
67
  const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
@@ -235,6 +234,9 @@ function shouldSetAsAttr(tagName, key) {
235
234
  if ((key === "width" || key === "height") && (tagName === "IMG" || tagName === "VIDEO" || tagName === "CANVAS" || tagName === "SOURCE")) {
236
235
  return true;
237
236
  }
237
+ if (key === "sandbox" && tagName === "IFRAME") {
238
+ return true;
239
+ }
238
240
  return false;
239
241
  }
240
242
 
@@ -424,6 +426,7 @@ var ReactiveFlags = /* @__PURE__ */ ((ReactiveFlags2) => {
424
426
  const notifyBuffer = [];
425
427
  let batchDepth = 0;
426
428
  let activeSub = void 0;
429
+ let globalVersion = 0;
427
430
  let notifyIndex = 0;
428
431
  let notifyBufferLength = 0;
429
432
  function setActiveSub(sub) {
@@ -446,20 +449,18 @@ function link(dep, sub) {
446
449
  if (prevDep !== void 0 && prevDep.dep === dep) {
447
450
  return;
448
451
  }
449
- let nextDep = void 0;
450
- const recursedCheck = sub.flags & 4 /* RecursedCheck */;
451
- if (recursedCheck) {
452
- nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;
453
- if (nextDep !== void 0 && nextDep.dep === dep) {
454
- sub.depsTail = nextDep;
455
- return;
456
- }
452
+ const nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;
453
+ if (nextDep !== void 0 && nextDep.dep === dep) {
454
+ nextDep.version = globalVersion;
455
+ sub.depsTail = nextDep;
456
+ return;
457
457
  }
458
458
  const prevSub = dep.subsTail;
459
- if (prevSub !== void 0 && prevSub.sub === sub && (!recursedCheck || isValidLink(prevSub, sub))) {
459
+ if (prevSub !== void 0 && prevSub.version === globalVersion && prevSub.sub === sub) {
460
460
  return;
461
461
  }
462
462
  const newLink = sub.depsTail = dep.subsTail = {
463
+ version: globalVersion,
463
464
  dep,
464
465
  sub,
465
466
  prevDep,
@@ -565,6 +566,7 @@ function propagate(link2) {
565
566
  } while (true);
566
567
  }
567
568
  function startTracking(sub) {
569
+ ++globalVersion;
568
570
  sub.depsTail = void 0;
569
571
  sub.flags = sub.flags & -57 | 4 /* RecursedCheck */;
570
572
  return setActiveSub(sub);
@@ -665,18 +667,12 @@ function shallowPropagate(link2) {
665
667
  } while (link2 !== void 0);
666
668
  }
667
669
  function isValidLink(checkLink, sub) {
668
- const depsTail = sub.depsTail;
669
- if (depsTail !== void 0) {
670
- let link2 = sub.deps;
671
- do {
672
- if (link2 === checkLink) {
673
- return true;
674
- }
675
- if (link2 === depsTail) {
676
- break;
677
- }
678
- link2 = link2.nextDep;
679
- } while (link2 !== void 0);
670
+ let link2 = sub.depsTail;
671
+ while (link2 !== void 0) {
672
+ if (link2 === checkLink) {
673
+ return true;
674
+ }
675
+ link2 = link2.prevDep;
680
676
  }
681
677
  return false;
682
678
  }
@@ -916,7 +912,7 @@ const arrayInstrumentations = {
916
912
  join(separator) {
917
913
  return reactiveReadArray(this).join(separator);
918
914
  },
919
- // keys() iterator only reads `length`, no optimisation required
915
+ // keys() iterator only reads `length`, no optimization required
920
916
  lastIndexOf(...args) {
921
917
  return searchProxy(this, "lastIndexOf", args);
922
918
  },
@@ -968,7 +964,7 @@ function iterator(self, method, wrapValue) {
968
964
  iter._next = iter.next;
969
965
  iter.next = () => {
970
966
  const result = iter._next();
971
- if (result.value) {
967
+ if (!result.done) {
972
968
  result.value = wrapValue(result.value);
973
969
  }
974
970
  return result;
@@ -1099,7 +1095,8 @@ class BaseReactiveHandler {
1099
1095
  return res;
1100
1096
  }
1101
1097
  if (isRef(res)) {
1102
- return targetIsArray && isIntegerKey(key) ? res : res.value;
1098
+ const value = targetIsArray && isIntegerKey(key) ? res : res.value;
1099
+ return isReadonly2 && isObject(value) ? readonly(value) : value;
1103
1100
  }
1104
1101
  if (isObject(res)) {
1105
1102
  return isReadonly2 ? readonly(res) : reactive(res);
@@ -1121,7 +1118,13 @@ class MutableReactiveHandler extends BaseReactiveHandler {
1121
1118
  }
1122
1119
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
1123
1120
  if (isOldValueReadonly) {
1124
- return false;
1121
+ {
1122
+ warn$2(
1123
+ `Set operation on key "${String(key)}" failed: target is readonly.`,
1124
+ target[key]
1125
+ );
1126
+ }
1127
+ return true;
1125
1128
  } else {
1126
1129
  oldValue.value = value;
1127
1130
  return true;
@@ -1266,7 +1269,7 @@ function createInstrumentations(readonly, shallow) {
1266
1269
  get size() {
1267
1270
  const target = this["__v_raw"];
1268
1271
  !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1269
- return Reflect.get(target, "size", target);
1272
+ return target.size;
1270
1273
  },
1271
1274
  has(key) {
1272
1275
  const target = this["__v_raw"];
@@ -1932,14 +1935,12 @@ class EffectScope {
1932
1935
  }
1933
1936
  }
1934
1937
  run(fn) {
1935
- const prevSub = setActiveSub();
1936
1938
  const prevScope = activeEffectScope;
1937
1939
  try {
1938
1940
  activeEffectScope = this;
1939
1941
  return fn();
1940
1942
  } finally {
1941
1943
  activeEffectScope = prevScope;
1942
- setActiveSub(prevSub);
1943
1944
  }
1944
1945
  }
1945
1946
  stop() {
@@ -2271,11 +2272,11 @@ function traverse(value, depth = Infinity, seen) {
2271
2272
  if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
2272
2273
  return value;
2273
2274
  }
2274
- seen = seen || /* @__PURE__ */ new Set();
2275
- if (seen.has(value)) {
2275
+ seen = seen || /* @__PURE__ */ new Map();
2276
+ if ((seen.get(value) || 0) >= depth) {
2276
2277
  return value;
2277
2278
  }
2278
- seen.add(value);
2279
+ seen.set(value, depth);
2279
2280
  depth--;
2280
2281
  if (isRef(value)) {
2281
2282
  traverse(value.value, depth, seen);
@@ -2821,8 +2822,10 @@ function rerender(id, newRender) {
2821
2822
  instance.hmrRerender();
2822
2823
  } else {
2823
2824
  const i = instance;
2824
- i.renderCache = [];
2825
- i.effect.run();
2825
+ if (!(i.effect.flags & 1024)) {
2826
+ i.renderCache = [];
2827
+ i.effect.run();
2828
+ }
2826
2829
  }
2827
2830
  nextTick(() => {
2828
2831
  isHmrUpdating = false;
@@ -2835,7 +2838,7 @@ function reload(id, newComp) {
2835
2838
  newComp = normalizeClassComponent(newComp);
2836
2839
  updateComponentDef(record.initialDef, newComp);
2837
2840
  const instances = [...record.instances];
2838
- if (newComp.vapor) {
2841
+ if (newComp.__vapor) {
2839
2842
  for (const instance of instances) {
2840
2843
  instance.hmrReload(newComp);
2841
2844
  }
@@ -2864,7 +2867,10 @@ function reload(id, newComp) {
2864
2867
  if (parent.vapor) {
2865
2868
  parent.hmrRerender();
2866
2869
  } else {
2867
- parent.effect.run();
2870
+ if (!(parent.effect.flags & 1024)) {
2871
+ parent.renderCache = [];
2872
+ parent.effect.run();
2873
+ }
2868
2874
  }
2869
2875
  nextTick(() => {
2870
2876
  isHmrUpdating = false;
@@ -2974,7 +2980,6 @@ const devtoolsComponentRemoved = (component) => {
2974
2980
  _devtoolsComponentRemoved(component);
2975
2981
  }
2976
2982
  };
2977
- /*! #__NO_SIDE_EFFECTS__ */
2978
2983
  // @__NO_SIDE_EFFECTS__
2979
2984
  function createDevtoolsComponentHook(hook) {
2980
2985
  return (component) => {
@@ -3160,9 +3165,6 @@ const TeleportImpl = {
3160
3165
  insert(mainAnchor, container, anchor);
3161
3166
  const mount = (container2, anchor2) => {
3162
3167
  if (shapeFlag & 16) {
3163
- if (parentComponent && parentComponent.isCE) {
3164
- parentComponent.ce._teleportTarget = container2;
3165
- }
3166
3168
  mountChildren(
3167
3169
  children,
3168
3170
  container2,
@@ -3184,6 +3186,9 @@ const TeleportImpl = {
3184
3186
  } else if (namespace !== "mathml" && isTargetMathML(target)) {
3185
3187
  namespace = "mathml";
3186
3188
  }
3189
+ if (parentComponent && parentComponent.isCE) {
3190
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3191
+ }
3187
3192
  if (!disabled) {
3188
3193
  mount(target, targetAnchor);
3189
3194
  updateCssVars(n2, false);
@@ -3384,26 +3389,34 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3384
3389
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
3385
3390
  o: { nextSibling, parentNode, querySelector, insert, createText }
3386
3391
  }, hydrateChildren) {
3392
+ function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
3393
+ vnode2.anchor = hydrateChildren(
3394
+ nextSibling(node2),
3395
+ vnode2,
3396
+ parentNode(node2),
3397
+ parentComponent,
3398
+ parentSuspense,
3399
+ slotScopeIds,
3400
+ optimized
3401
+ );
3402
+ vnode2.targetStart = targetStart;
3403
+ vnode2.targetAnchor = targetAnchor;
3404
+ }
3387
3405
  const target = vnode.target = resolveTarget(
3388
3406
  vnode.props,
3389
3407
  querySelector
3390
3408
  );
3409
+ const disabled = isTeleportDisabled(vnode.props);
3391
3410
  if (target) {
3392
- const disabled = isTeleportDisabled(vnode.props);
3393
3411
  const targetNode = target._lpa || target.firstChild;
3394
3412
  if (vnode.shapeFlag & 16) {
3395
3413
  if (disabled) {
3396
- vnode.anchor = hydrateChildren(
3397
- nextSibling(node),
3414
+ hydrateDisabledTeleport(
3415
+ node,
3398
3416
  vnode,
3399
- parentNode(node),
3400
- parentComponent,
3401
- parentSuspense,
3402
- slotScopeIds,
3403
- optimized
3417
+ targetNode,
3418
+ targetNode && nextSibling(targetNode)
3404
3419
  );
3405
- vnode.targetStart = targetNode;
3406
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
3407
3420
  } else {
3408
3421
  vnode.anchor = nextSibling(node);
3409
3422
  let targetAnchor = targetNode;
@@ -3434,6 +3447,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3434
3447
  }
3435
3448
  }
3436
3449
  updateCssVars(vnode, disabled);
3450
+ } else if (disabled) {
3451
+ if (vnode.shapeFlag & 16) {
3452
+ hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
3453
+ }
3437
3454
  }
3438
3455
  return vnode.anchor && nextSibling(vnode.anchor);
3439
3456
  }
@@ -3474,7 +3491,7 @@ function useTransitionState() {
3474
3491
  isMounted: false,
3475
3492
  isLeaving: false,
3476
3493
  isUnmounting: false,
3477
- leavingVNodes: /* @__PURE__ */ new Map()
3494
+ leavingNodes: /* @__PURE__ */ new Map()
3478
3495
  };
3479
3496
  onMounted(() => {
3480
3497
  state.isMounted = true;
@@ -3506,7 +3523,7 @@ const BaseTransitionPropsValidators = {
3506
3523
  onAppearCancelled: TransitionHookValidator
3507
3524
  };
3508
3525
  const recursiveGetSubtree = (instance) => {
3509
- const subTree = instance.subTree;
3526
+ const subTree = instance.type.__vapor ? instance.block : instance.subTree;
3510
3527
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
3511
3528
  };
3512
3529
  const BaseTransitionImpl = {
@@ -3523,9 +3540,7 @@ const BaseTransitionImpl = {
3523
3540
  const child = findNonCommentChild(children);
3524
3541
  const rawProps = toRaw(props);
3525
3542
  const { mode } = rawProps;
3526
- if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
3527
- warn$1(`invalid <transition> mode: ${mode}`);
3528
- }
3543
+ checkTransitionMode(mode);
3529
3544
  if (state.isLeaving) {
3530
3545
  return emptyPlaceholder(child);
3531
3546
  }
@@ -3545,7 +3560,7 @@ const BaseTransitionImpl = {
3545
3560
  setTransitionHooks(innerChild, enterHooks);
3546
3561
  }
3547
3562
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3548
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3563
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3549
3564
  let leavingHooks = resolveTransitionHooks(
3550
3565
  oldInnerChild,
3551
3566
  rawProps,
@@ -3614,15 +3629,53 @@ function findNonCommentChild(children) {
3614
3629
  }
3615
3630
  const BaseTransition = BaseTransitionImpl;
3616
3631
  function getLeavingNodesForType(state, vnode) {
3617
- const { leavingVNodes } = state;
3618
- let leavingVNodesCache = leavingVNodes.get(vnode.type);
3632
+ const { leavingNodes } = state;
3633
+ let leavingVNodesCache = leavingNodes.get(vnode.type);
3619
3634
  if (!leavingVNodesCache) {
3620
3635
  leavingVNodesCache = /* @__PURE__ */ Object.create(null);
3621
- leavingVNodes.set(vnode.type, leavingVNodesCache);
3636
+ leavingNodes.set(vnode.type, leavingVNodesCache);
3622
3637
  }
3623
3638
  return leavingVNodesCache;
3624
3639
  }
3625
3640
  function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3641
+ const key = String(vnode.key);
3642
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3643
+ const context = {
3644
+ setLeavingNodeCache: () => {
3645
+ leavingVNodesCache[key] = vnode;
3646
+ },
3647
+ unsetLeavingNodeCache: () => {
3648
+ if (leavingVNodesCache[key] === vnode) {
3649
+ delete leavingVNodesCache[key];
3650
+ }
3651
+ },
3652
+ earlyRemove: () => {
3653
+ const leavingVNode = leavingVNodesCache[key];
3654
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3655
+ leavingVNode.el[leaveCbKey]();
3656
+ }
3657
+ },
3658
+ cloneHooks: (vnode2) => {
3659
+ const hooks = resolveTransitionHooks(
3660
+ vnode2,
3661
+ props,
3662
+ state,
3663
+ instance,
3664
+ postClone
3665
+ );
3666
+ if (postClone) postClone(hooks);
3667
+ return hooks;
3668
+ }
3669
+ };
3670
+ return baseResolveTransitionHooks(context, props, state, instance);
3671
+ }
3672
+ function baseResolveTransitionHooks(context, props, state, instance) {
3673
+ const {
3674
+ setLeavingNodeCache,
3675
+ unsetLeavingNodeCache,
3676
+ earlyRemove,
3677
+ cloneHooks
3678
+ } = context;
3626
3679
  const {
3627
3680
  appear,
3628
3681
  mode,
@@ -3640,8 +3693,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3640
3693
  onAfterAppear,
3641
3694
  onAppearCancelled
3642
3695
  } = props;
3643
- const key = String(vnode.key);
3644
- const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3645
3696
  const callHook = (hook, args) => {
3646
3697
  hook && callWithAsyncErrorHandling(
3647
3698
  hook,
@@ -3677,10 +3728,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3677
3728
  /* cancelled */
3678
3729
  );
3679
3730
  }
3680
- const leavingVNode = leavingVNodesCache[key];
3681
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3682
- leavingVNode.el[leaveCbKey]();
3683
- }
3731
+ earlyRemove();
3684
3732
  callHook(hook, [el]);
3685
3733
  },
3686
3734
  enter(el) {
@@ -3717,7 +3765,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3717
3765
  }
3718
3766
  },
3719
3767
  leave(el, remove) {
3720
- const key2 = String(vnode.key);
3721
3768
  if (el[enterCbKey$1]) {
3722
3769
  el[enterCbKey$1](
3723
3770
  true
@@ -3739,27 +3786,17 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3739
3786
  callHook(onAfterLeave, [el]);
3740
3787
  }
3741
3788
  el[leaveCbKey] = void 0;
3742
- if (leavingVNodesCache[key2] === vnode) {
3743
- delete leavingVNodesCache[key2];
3744
- }
3789
+ unsetLeavingNodeCache(el);
3745
3790
  };
3746
- leavingVNodesCache[key2] = vnode;
3791
+ setLeavingNodeCache(el);
3747
3792
  if (onLeave) {
3748
3793
  callAsyncHook(onLeave, [el, done]);
3749
3794
  } else {
3750
3795
  done();
3751
3796
  }
3752
3797
  },
3753
- clone(vnode2) {
3754
- const hooks2 = resolveTransitionHooks(
3755
- vnode2,
3756
- props,
3757
- state,
3758
- instance,
3759
- postClone
3760
- );
3761
- if (postClone) postClone(hooks2);
3762
- return hooks2;
3798
+ clone(node) {
3799
+ return cloneHooks(node);
3763
3800
  }
3764
3801
  };
3765
3802
  return hooks;
@@ -3793,8 +3830,15 @@ function getInnerChild$1(vnode) {
3793
3830
  }
3794
3831
  function setTransitionHooks(vnode, hooks) {
3795
3832
  if (vnode.shapeFlag & 6 && vnode.component) {
3796
- vnode.transition = hooks;
3797
- setTransitionHooks(vnode.component.subTree, hooks);
3833
+ if (vnode.type.__vapor) {
3834
+ getVaporInterface(vnode.component, vnode).setTransitionHooks(
3835
+ vnode.component,
3836
+ hooks
3837
+ );
3838
+ } else {
3839
+ vnode.transition = hooks;
3840
+ setTransitionHooks(vnode.component.subTree, hooks);
3841
+ }
3798
3842
  } else if (vnode.shapeFlag & 128) {
3799
3843
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3800
3844
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -3824,8 +3868,12 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3824
3868
  }
3825
3869
  return ret;
3826
3870
  }
3871
+ function checkTransitionMode(mode) {
3872
+ if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
3873
+ warn$1(`invalid <transition> mode: ${mode}`);
3874
+ }
3875
+ }
3827
3876
 
3828
- /*! #__NO_SIDE_EFFECTS__ */
3829
3877
  // @__NO_SIDE_EFFECTS__
3830
3878
  function defineComponent(options, extraOptions) {
3831
3879
  return isFunction(options) ? (
@@ -3878,6 +3926,7 @@ function useTemplateRef(key) {
3878
3926
  return ret;
3879
3927
  }
3880
3928
 
3929
+ const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
3881
3930
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3882
3931
  if (isArray(rawRef)) {
3883
3932
  rawRef.forEach(
@@ -3909,28 +3958,23 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3909
3958
  const oldRef = oldRawRef && oldRawRef.r;
3910
3959
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3911
3960
  const setupState = owner.setupState;
3912
- const rawSetupState = toRaw(setupState);
3913
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3914
- {
3915
- if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
3916
- warn$1(
3917
- `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
3918
- );
3919
- }
3920
- if (knownTemplateRefs.has(rawSetupState[key])) {
3921
- return false;
3922
- }
3923
- }
3924
- return hasOwn(rawSetupState, key);
3961
+ const canSetSetupRef = createCanSetSetupRefChecker(setupState);
3962
+ const canSetRef = (ref2) => {
3963
+ return !knownTemplateRefs.has(ref2);
3925
3964
  };
3926
3965
  if (oldRef != null && oldRef !== ref) {
3966
+ invalidatePendingSetRef(oldRawRef);
3927
3967
  if (isString(oldRef)) {
3928
3968
  refs[oldRef] = null;
3929
3969
  if (canSetSetupRef(oldRef)) {
3930
3970
  setupState[oldRef] = null;
3931
3971
  }
3932
3972
  } else if (isRef(oldRef)) {
3933
- oldRef.value = null;
3973
+ if (canSetRef(oldRef)) {
3974
+ oldRef.value = null;
3975
+ }
3976
+ const oldRawRefAtom = oldRawRef;
3977
+ if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
3934
3978
  }
3935
3979
  }
3936
3980
  if (isFunction(ref)) {
@@ -3941,7 +3985,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3941
3985
  if (_isString || _isRef) {
3942
3986
  const doSet = () => {
3943
3987
  if (rawRef.f) {
3944
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
3988
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
3945
3989
  if (isUnmount) {
3946
3990
  isArray(existing) && remove(existing, refValue);
3947
3991
  } else {
@@ -3952,8 +3996,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3952
3996
  setupState[ref] = refs[ref];
3953
3997
  }
3954
3998
  } else {
3955
- ref.value = [refValue];
3956
- if (rawRef.k) refs[rawRef.k] = ref.value;
3999
+ const newVal = [refValue];
4000
+ if (canSetRef(ref)) {
4001
+ ref.value = newVal;
4002
+ }
4003
+ if (rawRef.k) refs[rawRef.k] = newVal;
3957
4004
  }
3958
4005
  } else if (!existing.includes(refValue)) {
3959
4006
  existing.push(refValue);
@@ -3965,15 +4012,23 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3965
4012
  setupState[ref] = value;
3966
4013
  }
3967
4014
  } else if (_isRef) {
3968
- ref.value = value;
4015
+ if (canSetRef(ref)) {
4016
+ ref.value = value;
4017
+ }
3969
4018
  if (rawRef.k) refs[rawRef.k] = value;
3970
4019
  } else {
3971
4020
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
3972
4021
  }
3973
4022
  };
3974
4023
  if (value) {
3975
- queuePostRenderEffect(doSet, -1, parentSuspense);
4024
+ const job = () => {
4025
+ doSet();
4026
+ pendingSetRefMap.delete(rawRef);
4027
+ };
4028
+ pendingSetRefMap.set(rawRef, job);
4029
+ queuePostRenderEffect(job, -1, parentSuspense);
3976
4030
  } else {
4031
+ invalidatePendingSetRef(rawRef);
3977
4032
  doSet();
3978
4033
  }
3979
4034
  } else {
@@ -3981,6 +4036,29 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3981
4036
  }
3982
4037
  }
3983
4038
  }
4039
+ function createCanSetSetupRefChecker(setupState) {
4040
+ const rawSetupState = toRaw(setupState);
4041
+ return setupState === void 0 || setupState === EMPTY_OBJ ? NO : (key) => {
4042
+ {
4043
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4044
+ warn$1(
4045
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
4046
+ );
4047
+ }
4048
+ if (knownTemplateRefs.has(rawSetupState[key])) {
4049
+ return false;
4050
+ }
4051
+ }
4052
+ return hasOwn(rawSetupState, key);
4053
+ };
4054
+ }
4055
+ function invalidatePendingSetRef(rawRef) {
4056
+ const pendingSetRef = pendingSetRefMap.get(rawRef);
4057
+ if (pendingSetRef) {
4058
+ pendingSetRef.flags |= 4;
4059
+ pendingSetRefMap.delete(rawRef);
4060
+ }
4061
+ }
3984
4062
 
3985
4063
  let hasLoggedMismatchError = false;
3986
4064
  const logMismatchError = () => {
@@ -4125,6 +4203,12 @@ function createHydrationFunctions(rendererInternals) {
4125
4203
  );
4126
4204
  }
4127
4205
  break;
4206
+ case VaporSlot:
4207
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(
4208
+ vnode,
4209
+ node
4210
+ );
4211
+ break;
4128
4212
  default:
4129
4213
  if (shapeFlag & 1) {
4130
4214
  if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
@@ -4140,9 +4224,6 @@ function createHydrationFunctions(rendererInternals) {
4140
4224
  );
4141
4225
  }
4142
4226
  } else if (shapeFlag & 6) {
4143
- if (vnode.type.__vapor) {
4144
- throw new Error("Vapor component hydration is not supported yet.");
4145
- }
4146
4227
  vnode.slotScopeIds = slotScopeIds;
4147
4228
  const container = parentNode(node);
4148
4229
  if (isFragmentStart) {
@@ -4152,15 +4233,25 @@ function createHydrationFunctions(rendererInternals) {
4152
4233
  } else {
4153
4234
  nextNode = nextSibling(node);
4154
4235
  }
4155
- mountComponent(
4156
- vnode,
4157
- container,
4158
- null,
4159
- parentComponent,
4160
- parentSuspense,
4161
- getContainerType(container),
4162
- optimized
4163
- );
4236
+ if (vnode.type.__vapor) {
4237
+ getVaporInterface(parentComponent, vnode).hydrate(
4238
+ vnode,
4239
+ node,
4240
+ container,
4241
+ null,
4242
+ parentComponent
4243
+ );
4244
+ } else {
4245
+ mountComponent(
4246
+ vnode,
4247
+ container,
4248
+ null,
4249
+ parentComponent,
4250
+ parentSuspense,
4251
+ getContainerType(container),
4252
+ optimized
4253
+ );
4254
+ }
4164
4255
  if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4165
4256
  let subTree;
4166
4257
  if (isFragmentStart) {
@@ -4245,7 +4336,7 @@ function createHydrationFunctions(rendererInternals) {
4245
4336
  );
4246
4337
  let hasWarned = false;
4247
4338
  while (next) {
4248
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
4339
+ if (!isMismatchAllowed(el, 1)) {
4249
4340
  if (!hasWarned) {
4250
4341
  warn$1(
4251
4342
  `Hydration children mismatch on`,
@@ -4266,14 +4357,16 @@ Server rendered element contains more child nodes than client vdom.`
4266
4357
  if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4267
4358
  clientText = clientText.slice(1);
4268
4359
  }
4269
- if (el.textContent !== clientText) {
4270
- if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4360
+ const { textContent } = el;
4361
+ if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
4362
+ textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
4363
+ if (!isMismatchAllowed(el, 0)) {
4271
4364
  warn$1(
4272
4365
  `Hydration text content mismatch on`,
4273
4366
  el,
4274
4367
  `
4275
- - rendered on server: ${el.textContent}
4276
- - expected on client: ${vnode.children}`
4368
+ - rendered on server: ${textContent}
4369
+ - expected on client: ${clientText}`
4277
4370
  );
4278
4371
  logMismatchError();
4279
4372
  }
@@ -4349,7 +4442,7 @@ Server rendered element contains more child nodes than client vdom.`
4349
4442
  } else if (isText && !vnode.children) {
4350
4443
  insert(vnode.el = createText(""), container);
4351
4444
  } else {
4352
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4445
+ if (!isMismatchAllowed(container, 1)) {
4353
4446
  if (!hasWarned) {
4354
4447
  warn$1(
4355
4448
  `Hydration children mismatch on`,
@@ -4399,7 +4492,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4399
4492
  }
4400
4493
  };
4401
4494
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
4402
- if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
4495
+ if (!isMismatchAllowed(node.parentElement, 1)) {
4403
4496
  warn$1(
4404
4497
  `Hydration node mismatch:
4405
4498
  - rendered on server:`,
@@ -4472,11 +4565,11 @@ Server rendered element contains fewer child nodes than client vdom.`
4472
4565
  parent = parent.parent;
4473
4566
  }
4474
4567
  };
4475
- const isTemplateNode = (node) => {
4476
- return node.nodeType === 1 && node.tagName === "TEMPLATE";
4477
- };
4478
4568
  return [hydrate, hydrateNode];
4479
4569
  }
4570
+ const isTemplateNode = (node) => {
4571
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4572
+ };
4480
4573
  function propHasMismatch(el, key, clientValue, vnode, instance) {
4481
4574
  let mismatchType;
4482
4575
  let mismatchKey;
@@ -4491,7 +4584,7 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
4491
4584
  }
4492
4585
  expected = normalizeClass(clientValue);
4493
4586
  if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
4494
- mismatchType = 2 /* CLASS */;
4587
+ mismatchType = 2;
4495
4588
  mismatchKey = `class`;
4496
4589
  }
4497
4590
  } else if (key === "style") {
@@ -4510,31 +4603,43 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
4510
4603
  resolveCssVars(instance, vnode, expectedMap);
4511
4604
  }
4512
4605
  if (!isMapEqual(actualMap, expectedMap)) {
4513
- mismatchType = 3 /* STYLE */;
4606
+ mismatchType = 3;
4514
4607
  mismatchKey = "style";
4515
4608
  }
4516
- } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
4517
- if (isBooleanAttr(key)) {
4518
- actual = el.hasAttribute(key);
4519
- expected = includeBooleanAttr(clientValue);
4520
- } else if (clientValue == null) {
4521
- actual = el.hasAttribute(key);
4522
- expected = false;
4523
- } else {
4524
- if (el.hasAttribute(key)) {
4525
- actual = el.getAttribute(key);
4526
- } else if (key === "value" && el.tagName === "TEXTAREA") {
4527
- actual = el.value;
4528
- } else {
4529
- actual = false;
4530
- }
4531
- expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
4532
- }
4609
+ } else if (isValidHtmlOrSvgAttribute(el, key)) {
4610
+ ({ actual, expected } = getAttributeMismatch(el, key, clientValue));
4533
4611
  if (actual !== expected) {
4534
- mismatchType = 4 /* ATTRIBUTE */;
4612
+ mismatchType = 4;
4535
4613
  mismatchKey = key;
4536
4614
  }
4537
4615
  }
4616
+ return warnPropMismatch(el, mismatchKey, mismatchType, actual, expected);
4617
+ }
4618
+ function getAttributeMismatch(el, key, clientValue) {
4619
+ let actual;
4620
+ let expected;
4621
+ if (isBooleanAttr(key)) {
4622
+ actual = el.hasAttribute(key);
4623
+ expected = includeBooleanAttr(clientValue);
4624
+ } else if (clientValue == null) {
4625
+ actual = el.hasAttribute(key);
4626
+ expected = false;
4627
+ } else {
4628
+ if (el.hasAttribute(key)) {
4629
+ actual = el.getAttribute(key);
4630
+ } else if (key === "value" && el.tagName === "TEXTAREA") {
4631
+ actual = el.value;
4632
+ } else {
4633
+ actual = false;
4634
+ }
4635
+ expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
4636
+ }
4637
+ return { actual, expected };
4638
+ }
4639
+ function isValidHtmlOrSvgAttribute(el, key) {
4640
+ return el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key));
4641
+ }
4642
+ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
4538
4643
  if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
4539
4644
  const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
4540
4645
  const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
@@ -4606,14 +4711,14 @@ function resolveCssVars(instance, vnode, expectedMap) {
4606
4711
  }
4607
4712
  const allowMismatchAttr = "data-allow-mismatch";
4608
4713
  const MismatchTypeString = {
4609
- [0 /* TEXT */]: "text",
4610
- [1 /* CHILDREN */]: "children",
4611
- [2 /* CLASS */]: "class",
4612
- [3 /* STYLE */]: "style",
4613
- [4 /* ATTRIBUTE */]: "attribute"
4714
+ [0]: "text",
4715
+ [1]: "children",
4716
+ [2]: "class",
4717
+ [3]: "style",
4718
+ [4]: "attribute"
4614
4719
  };
4615
4720
  function isMismatchAllowed(el, allowedType) {
4616
- if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
4721
+ if (allowedType === 0 || allowedType === 1) {
4617
4722
  while (el && !el.hasAttribute(allowMismatchAttr)) {
4618
4723
  el = el.parentElement;
4619
4724
  }
@@ -4625,7 +4730,7 @@ function isMismatchAllowed(el, allowedType) {
4625
4730
  return true;
4626
4731
  } else {
4627
4732
  const list = allowedAttr.split(",");
4628
- if (allowedType === 0 /* TEXT */ && list.includes("children")) {
4733
+ if (allowedType === 0 && list.includes("children")) {
4629
4734
  return true;
4630
4735
  }
4631
4736
  return list.includes(MismatchTypeString[allowedType]);
@@ -4682,7 +4787,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
4682
4787
  hasHydrated = true;
4683
4788
  teardown();
4684
4789
  hydrate();
4685
- e.target.dispatchEvent(new e.constructor(e.type, e));
4790
+ if (!(`$evt${e.type}` in e.target)) {
4791
+ e.target.dispatchEvent(new e.constructor(e.type, e));
4792
+ }
4686
4793
  }
4687
4794
  };
4688
4795
  const teardown = () => {
@@ -4724,104 +4831,46 @@ function forEachElement(node, cb) {
4724
4831
  }
4725
4832
 
4726
4833
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4727
- /*! #__NO_SIDE_EFFECTS__ */
4728
4834
  // @__NO_SIDE_EFFECTS__
4729
4835
  function defineAsyncComponent(source) {
4730
- if (isFunction(source)) {
4731
- source = { loader: source };
4732
- }
4733
4836
  const {
4734
- loader,
4735
- loadingComponent,
4736
- errorComponent,
4737
- delay = 200,
4738
- hydrate: hydrateStrategy,
4739
- timeout,
4740
- // undefined = never times out
4741
- suspensible = true,
4742
- onError: userOnError
4743
- } = source;
4744
- let pendingRequest = null;
4745
- let resolvedComp;
4746
- let retries = 0;
4747
- const retry = () => {
4748
- retries++;
4749
- pendingRequest = null;
4750
- return load();
4751
- };
4752
- const load = () => {
4753
- let thisRequest;
4754
- return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
4755
- err = err instanceof Error ? err : new Error(String(err));
4756
- if (userOnError) {
4757
- return new Promise((resolve, reject) => {
4758
- const userRetry = () => resolve(retry());
4759
- const userFail = () => reject(err);
4760
- userOnError(err, userRetry, userFail, retries + 1);
4761
- });
4762
- } else {
4763
- throw err;
4764
- }
4765
- }).then((comp) => {
4766
- if (thisRequest !== pendingRequest && pendingRequest) {
4767
- return pendingRequest;
4768
- }
4769
- if (!comp) {
4770
- warn$1(
4771
- `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
4772
- );
4773
- }
4774
- if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
4775
- comp = comp.default;
4776
- }
4777
- if (comp && !isObject(comp) && !isFunction(comp)) {
4778
- throw new Error(`Invalid async component load result: ${comp}`);
4779
- }
4780
- resolvedComp = comp;
4781
- return comp;
4782
- }));
4783
- };
4837
+ load,
4838
+ getResolvedComp,
4839
+ setPendingRequest,
4840
+ source: {
4841
+ loadingComponent,
4842
+ errorComponent,
4843
+ delay,
4844
+ hydrate: hydrateStrategy,
4845
+ timeout,
4846
+ suspensible = true
4847
+ }
4848
+ } = createAsyncComponentContext(source);
4784
4849
  return defineComponent({
4785
4850
  name: "AsyncComponentWrapper",
4786
4851
  __asyncLoader: load,
4787
4852
  __asyncHydrate(el, instance, hydrate) {
4788
- let patched = false;
4789
- const doHydrate = hydrateStrategy ? () => {
4790
- const performHydrate = () => {
4791
- if (patched) {
4792
- warn$1(
4793
- `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.`
4794
- );
4795
- return;
4796
- }
4797
- hydrate();
4798
- };
4799
- const teardown = hydrateStrategy(
4800
- performHydrate,
4801
- (cb) => forEachElement(el, cb)
4802
- );
4803
- if (teardown) {
4804
- (instance.bum || (instance.bum = [])).push(teardown);
4805
- }
4806
- (instance.u || (instance.u = [])).push(() => patched = true);
4807
- } : hydrate;
4808
- if (resolvedComp) {
4809
- doHydrate();
4810
- } else {
4811
- load().then(() => !instance.isUnmounted && doHydrate());
4812
- }
4853
+ performAsyncHydrate(
4854
+ el,
4855
+ instance,
4856
+ hydrate,
4857
+ getResolvedComp,
4858
+ load,
4859
+ hydrateStrategy
4860
+ );
4813
4861
  },
4814
4862
  get __asyncResolved() {
4815
- return resolvedComp;
4863
+ return getResolvedComp();
4816
4864
  },
4817
4865
  setup() {
4818
4866
  const instance = currentInstance;
4819
4867
  markAsyncBoundary(instance);
4868
+ let resolvedComp = getResolvedComp();
4820
4869
  if (resolvedComp) {
4821
4870
  return () => createInnerComp(resolvedComp, instance);
4822
4871
  }
4823
4872
  const onError = (err) => {
4824
- pendingRequest = null;
4873
+ setPendingRequest(null);
4825
4874
  handleError(
4826
4875
  err,
4827
4876
  instance,
@@ -4839,25 +4888,11 @@ function defineAsyncComponent(source) {
4839
4888
  }) : null;
4840
4889
  });
4841
4890
  }
4842
- const loaded = ref(false);
4843
- const error = ref();
4844
- const delayed = ref(!!delay);
4845
- if (delay) {
4846
- setTimeout(() => {
4847
- delayed.value = false;
4848
- }, delay);
4849
- }
4850
- if (timeout != null) {
4851
- setTimeout(() => {
4852
- if (!loaded.value && !error.value) {
4853
- const err = new Error(
4854
- `Async component timed out after ${timeout}ms.`
4855
- );
4856
- onError(err);
4857
- error.value = err;
4858
- }
4859
- }, timeout);
4860
- }
4891
+ const { loaded, error, delayed } = useAsyncComponentState(
4892
+ delay,
4893
+ timeout,
4894
+ onError
4895
+ );
4861
4896
  load().then(() => {
4862
4897
  loaded.value = true;
4863
4898
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
@@ -4868,6 +4903,7 @@ function defineAsyncComponent(source) {
4868
4903
  error.value = err;
4869
4904
  });
4870
4905
  return () => {
4906
+ resolvedComp = getResolvedComp();
4871
4907
  if (loaded.value && resolvedComp) {
4872
4908
  return createInnerComp(resolvedComp, instance);
4873
4909
  } else if (error.value && errorComponent) {
@@ -4875,19 +4911,124 @@ function defineAsyncComponent(source) {
4875
4911
  error: error.value
4876
4912
  });
4877
4913
  } else if (loadingComponent && !delayed.value) {
4878
- return createVNode(loadingComponent);
4914
+ return createInnerComp(
4915
+ loadingComponent,
4916
+ instance
4917
+ );
4879
4918
  }
4880
4919
  };
4881
4920
  }
4882
- });
4883
- }
4884
- function createInnerComp(comp, parent) {
4885
- const { ref: ref2, props, children, ce } = parent.vnode;
4886
- const vnode = createVNode(comp, props, children);
4887
- vnode.ref = ref2;
4888
- vnode.ce = ce;
4889
- delete parent.vnode.ce;
4890
- return vnode;
4921
+ });
4922
+ }
4923
+ function createInnerComp(comp, parent) {
4924
+ const { ref: ref2, props, children, ce } = parent.vnode;
4925
+ const vnode = createVNode(comp, props, children);
4926
+ vnode.ref = ref2;
4927
+ vnode.ce = ce;
4928
+ delete parent.vnode.ce;
4929
+ return vnode;
4930
+ }
4931
+ function createAsyncComponentContext(source) {
4932
+ if (isFunction(source)) {
4933
+ source = { loader: source };
4934
+ }
4935
+ const { loader, onError: userOnError } = source;
4936
+ let pendingRequest = null;
4937
+ let resolvedComp;
4938
+ let retries = 0;
4939
+ const retry = () => {
4940
+ retries++;
4941
+ pendingRequest = null;
4942
+ return load();
4943
+ };
4944
+ const load = () => {
4945
+ let thisRequest;
4946
+ return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
4947
+ err = err instanceof Error ? err : new Error(String(err));
4948
+ if (userOnError) {
4949
+ return new Promise((resolve, reject) => {
4950
+ const userRetry = () => resolve(retry());
4951
+ const userFail = () => reject(err);
4952
+ userOnError(err, userRetry, userFail, retries + 1);
4953
+ });
4954
+ } else {
4955
+ throw err;
4956
+ }
4957
+ }).then((comp) => {
4958
+ if (thisRequest !== pendingRequest && pendingRequest) {
4959
+ return pendingRequest;
4960
+ }
4961
+ if (!comp) {
4962
+ warn$1(
4963
+ `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
4964
+ );
4965
+ }
4966
+ if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
4967
+ comp = comp.default;
4968
+ }
4969
+ if (comp && !isObject(comp) && !isFunction(comp)) {
4970
+ throw new Error(`Invalid async component load result: ${comp}`);
4971
+ }
4972
+ resolvedComp = comp;
4973
+ return comp;
4974
+ }));
4975
+ };
4976
+ return {
4977
+ load,
4978
+ source,
4979
+ getResolvedComp: () => resolvedComp,
4980
+ setPendingRequest: (request) => pendingRequest = request
4981
+ };
4982
+ }
4983
+ const useAsyncComponentState = (delay, timeout, onError) => {
4984
+ const loaded = ref(false);
4985
+ const error = ref();
4986
+ const delayed = ref(!!delay);
4987
+ if (delay) {
4988
+ setTimeout(() => {
4989
+ delayed.value = false;
4990
+ }, delay);
4991
+ }
4992
+ if (timeout != null) {
4993
+ setTimeout(() => {
4994
+ if (!loaded.value && !error.value) {
4995
+ const err = new Error(`Async component timed out after ${timeout}ms.`);
4996
+ onError(err);
4997
+ error.value = err;
4998
+ }
4999
+ }, timeout);
5000
+ }
5001
+ return { loaded, error, delayed };
5002
+ };
5003
+ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
5004
+ let patched = false;
5005
+ (instance.bu || (instance.bu = [])).push(() => patched = true);
5006
+ const performHydrate = () => {
5007
+ if (patched) {
5008
+ {
5009
+ const resolvedComp = getResolvedComp();
5010
+ warn$1(
5011
+ `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
5012
+ );
5013
+ }
5014
+ return;
5015
+ }
5016
+ hydrate();
5017
+ };
5018
+ const doHydrate = hydrateStrategy ? () => {
5019
+ const teardown = hydrateStrategy(
5020
+ performHydrate,
5021
+ (cb) => forEachElement(el, cb)
5022
+ );
5023
+ if (teardown) {
5024
+ (instance.bum || (instance.bum = [])).push(teardown);
5025
+ }
5026
+ } : performHydrate;
5027
+ if (getResolvedComp()) {
5028
+ doHydrate();
5029
+ } else {
5030
+ load().then(() => !instance.isUnmounted && doHydrate());
5031
+ }
4891
5032
  }
4892
5033
 
4893
5034
  const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
@@ -4918,86 +5059,37 @@ const KeepAliveImpl = {
4918
5059
  keepAliveInstance.__v_cache = cache;
4919
5060
  }
4920
5061
  const parentSuspense = keepAliveInstance.suspense;
5062
+ const { renderer } = sharedContext;
4921
5063
  const {
4922
- renderer: {
4923
- p: patch,
4924
- m: move,
4925
- um: _unmount,
4926
- o: { createElement }
4927
- }
4928
- } = sharedContext;
5064
+ um: _unmount,
5065
+ o: { createElement }
5066
+ } = renderer;
4929
5067
  const storageContainer = createElement("div");
5068
+ sharedContext.getStorageContainer = () => storageContainer;
5069
+ sharedContext.getCachedComponent = (vnode) => {
5070
+ const key = vnode.key == null ? vnode.type : vnode.key;
5071
+ return cache.get(key);
5072
+ };
4930
5073
  sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4931
- const instance = vnode.component;
4932
- move(
5074
+ activate(
4933
5075
  vnode,
4934
5076
  container,
4935
5077
  anchor,
4936
- 0,
5078
+ renderer,
4937
5079
  keepAliveInstance,
4938
- parentSuspense
4939
- );
4940
- patch(
4941
- instance.vnode,
4942
- vnode,
4943
- container,
4944
- anchor,
4945
- instance,
4946
5080
  parentSuspense,
4947
5081
  namespace,
4948
- vnode.slotScopeIds,
4949
5082
  optimized
4950
5083
  );
4951
- queuePostRenderEffect(
4952
- () => {
4953
- instance.isDeactivated = false;
4954
- if (instance.a) {
4955
- invokeArrayFns(instance.a);
4956
- }
4957
- const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
4958
- if (vnodeHook) {
4959
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
4960
- }
4961
- },
4962
- void 0,
4963
- parentSuspense
4964
- );
4965
- {
4966
- devtoolsComponentAdded(instance);
4967
- }
4968
5084
  };
4969
5085
  sharedContext.deactivate = (vnode) => {
4970
- const instance = vnode.component;
4971
- invalidateMount(instance.m);
4972
- invalidateMount(instance.a);
4973
- move(
5086
+ deactivate(
4974
5087
  vnode,
4975
5088
  storageContainer,
4976
- null,
4977
- 1,
5089
+ renderer,
4978
5090
  keepAliveInstance,
4979
5091
  parentSuspense
4980
5092
  );
4981
- queuePostRenderEffect(
4982
- () => {
4983
- if (instance.da) {
4984
- invokeArrayFns(instance.da);
4985
- }
4986
- const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
4987
- if (vnodeHook) {
4988
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
4989
- }
4990
- instance.isDeactivated = true;
4991
- },
4992
- void 0,
4993
- parentSuspense
4994
- );
4995
- {
4996
- devtoolsComponentAdded(instance);
4997
- }
4998
- {
4999
- instance.__keepAliveStorageContainer = storageContainer;
5000
- }
5001
5093
  };
5002
5094
  function unmount(vnode) {
5003
5095
  resetShapeFlag(vnode);
@@ -5144,7 +5236,7 @@ function onActivated(hook, target) {
5144
5236
  function onDeactivated(hook, target) {
5145
5237
  registerKeepAliveHook(hook, "da", target);
5146
5238
  }
5147
- function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
5239
+ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance()) {
5148
5240
  const wrappedHook = hook.__wdc || (hook.__wdc = () => {
5149
5241
  let current = target;
5150
5242
  while (current) {
@@ -5158,8 +5250,9 @@ function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
5158
5250
  injectHook(type, wrappedHook, target);
5159
5251
  if (target) {
5160
5252
  let current = target.parent;
5161
- while (current && current.parent && current.parent.vnode) {
5162
- if (isKeepAlive(current.parent.vnode)) {
5253
+ while (current && current.parent) {
5254
+ let parent = current.parent;
5255
+ if (isKeepAlive(parent.vapor ? parent : parent.vnode)) {
5163
5256
  injectToKeepAliveRoot(wrappedHook, type, target, current);
5164
5257
  }
5165
5258
  current = current.parent;
@@ -5185,6 +5278,71 @@ function resetShapeFlag(vnode) {
5185
5278
  function getInnerChild(vnode) {
5186
5279
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
5187
5280
  }
5281
+ function activate(vnode, container, anchor, { p: patch, m: move }, parentComponent, parentSuspense, namespace, optimized) {
5282
+ const instance = vnode.component;
5283
+ move(
5284
+ vnode,
5285
+ container,
5286
+ anchor,
5287
+ 0,
5288
+ parentComponent,
5289
+ parentSuspense
5290
+ );
5291
+ patch(
5292
+ instance.vnode,
5293
+ vnode,
5294
+ container,
5295
+ anchor,
5296
+ instance,
5297
+ parentSuspense,
5298
+ namespace,
5299
+ vnode.slotScopeIds,
5300
+ optimized
5301
+ );
5302
+ queuePostRenderEffect(
5303
+ () => {
5304
+ instance.isDeactivated = false;
5305
+ if (instance.a) {
5306
+ invokeArrayFns(instance.a);
5307
+ }
5308
+ const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
5309
+ if (vnodeHook) {
5310
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
5311
+ }
5312
+ },
5313
+ void 0,
5314
+ parentSuspense
5315
+ );
5316
+ {
5317
+ devtoolsComponentAdded(instance);
5318
+ }
5319
+ }
5320
+ function deactivate(vnode, container, { m: move }, parentComponent, parentSuspense) {
5321
+ const instance = vnode.component;
5322
+ invalidateMount(instance.m);
5323
+ invalidateMount(instance.a);
5324
+ move(vnode, container, null, 1, parentComponent, parentSuspense);
5325
+ queuePostRenderEffect(
5326
+ () => {
5327
+ if (instance.da) {
5328
+ invokeArrayFns(instance.da);
5329
+ }
5330
+ const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
5331
+ if (vnodeHook) {
5332
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
5333
+ }
5334
+ instance.isDeactivated = true;
5335
+ },
5336
+ void 0,
5337
+ parentSuspense
5338
+ );
5339
+ {
5340
+ devtoolsComponentAdded(instance);
5341
+ }
5342
+ {
5343
+ instance.__keepAliveStorageContainer = container;
5344
+ }
5345
+ }
5188
5346
 
5189
5347
  function injectHook(type, hook, target = currentInstance, prepend = false) {
5190
5348
  if (target) {
@@ -5373,12 +5531,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5373
5531
  return ret;
5374
5532
  }
5375
5533
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
5534
+ const hasProps = Object.keys(props).length > 0;
5376
5535
  if (name !== "default") props.name = name;
5377
5536
  return openBlock(), createBlock(
5378
5537
  Fragment,
5379
5538
  null,
5380
5539
  [createVNode("slot", props, fallback && fallback())],
5381
- 64
5540
+ hasProps ? -2 : 64
5382
5541
  );
5383
5542
  }
5384
5543
  if (slot && slot.length > 1) {
@@ -5392,6 +5551,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5392
5551
  }
5393
5552
  openBlock();
5394
5553
  const validSlotContent = slot && ensureValidVNode(slot(props));
5554
+ ensureVaporSlotFallback(validSlotContent, fallback);
5395
5555
  const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5396
5556
  // key attached in the `createSlots` helper, respect that
5397
5557
  validSlotContent && validSlotContent.key;
@@ -5421,6 +5581,14 @@ function ensureValidVNode(vnodes) {
5421
5581
  return true;
5422
5582
  }) ? vnodes : null;
5423
5583
  }
5584
+ function ensureVaporSlotFallback(vnodes, fallback) {
5585
+ let vaporSlot;
5586
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
5587
+ if (!vaporSlot.fallback && fallback) {
5588
+ vaporSlot.fallback = fallback;
5589
+ }
5590
+ }
5591
+ }
5424
5592
 
5425
5593
  function toHandlers(obj, preserveCaseIfNecessary) {
5426
5594
  const ret = {};
@@ -5583,10 +5751,10 @@ const PublicInstanceProxyHandlers = {
5583
5751
  return true;
5584
5752
  },
5585
5753
  has({
5586
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
5754
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
5587
5755
  }, key) {
5588
- let normalizedProps;
5589
- return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
5756
+ let normalizedProps, cssModules;
5757
+ return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
5590
5758
  },
5591
5759
  defineProperty(target, key, descriptor) {
5592
5760
  if (descriptor.get != null) {
@@ -5724,15 +5892,15 @@ function withDefaults(props, defaults) {
5724
5892
  return null;
5725
5893
  }
5726
5894
  function useSlots() {
5727
- return getContext().slots;
5895
+ return getContext("useSlots").slots;
5728
5896
  }
5729
5897
  function useAttrs() {
5730
- return getContext().attrs;
5898
+ return getContext("useAttrs").attrs;
5731
5899
  }
5732
- function getContext() {
5900
+ function getContext(calledFunctionName) {
5733
5901
  const i = getCurrentGenericInstance();
5734
5902
  if (!i) {
5735
- warn$1(`useContext() called without active instance.`);
5903
+ warn$1(`${calledFunctionName}() called without active instance.`);
5736
5904
  }
5737
5905
  if (i.vapor) {
5738
5906
  return i;
@@ -5988,7 +6156,8 @@ function applyOptions(instance) {
5988
6156
  expose.forEach((key) => {
5989
6157
  Object.defineProperty(exposed, key, {
5990
6158
  get: () => publicThis[key],
5991
- set: (val) => publicThis[key] = val
6159
+ set: (val) => publicThis[key] = val,
6160
+ enumerable: true
5992
6161
  });
5993
6162
  });
5994
6163
  } else if (!instance.exposed) {
@@ -6861,7 +7030,7 @@ function isBoolean(...args) {
6861
7030
  return args.some((elem) => elem.toLowerCase() === "boolean");
6862
7031
  }
6863
7032
 
6864
- const isInternalKey = (key) => key[0] === "_" || key === "$stable";
7033
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
6865
7034
  const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
6866
7035
  const normalizeSlot = (key, rawSlot, ctx) => {
6867
7036
  if (rawSlot._n) {
@@ -6915,8 +7084,6 @@ const assignSlots = (slots, children, optimized) => {
6915
7084
  const initSlots = (instance, children, optimized) => {
6916
7085
  const slots = instance.slots = createInternalObject();
6917
7086
  if (instance.vnode.shapeFlag & 32) {
6918
- const cacheIndexes = children.__;
6919
- if (cacheIndexes) def(slots, "__", cacheIndexes, true);
6920
7087
  const type = children._;
6921
7088
  if (type) {
6922
7089
  assignSlots(slots, children, optimized);
@@ -6980,12 +7147,10 @@ function endMeasure(instance, type) {
6980
7147
  if (instance.appContext.config.performance && isSupported()) {
6981
7148
  const startTag = `vue-${type}-${instance.uid}`;
6982
7149
  const endTag = startTag + `:end`;
7150
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
6983
7151
  perf.mark(endTag);
6984
- perf.measure(
6985
- `<${formatComponentName(instance, instance.type)}> ${type}`,
6986
- startTag,
6987
- endTag
6988
- );
7152
+ perf.measure(measureName, startTag, endTag);
7153
+ perf.clearMeasures(measureName);
6989
7154
  perf.clearMarks(startTag);
6990
7155
  perf.clearMarks(endTag);
6991
7156
  }
@@ -7224,15 +7389,25 @@ function baseCreateRenderer(options, createHydrationFns) {
7224
7389
  optimized
7225
7390
  );
7226
7391
  } else {
7227
- patchElement(
7228
- n1,
7229
- n2,
7230
- parentComponent,
7231
- parentSuspense,
7232
- namespace,
7233
- slotScopeIds,
7234
- optimized
7235
- );
7392
+ const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
7393
+ try {
7394
+ if (customElement) {
7395
+ customElement._beginPatch();
7396
+ }
7397
+ patchElement(
7398
+ n1,
7399
+ n2,
7400
+ parentComponent,
7401
+ parentSuspense,
7402
+ namespace,
7403
+ slotScopeIds,
7404
+ optimized
7405
+ );
7406
+ } finally {
7407
+ if (customElement) {
7408
+ customElement._endPatch();
7409
+ }
7410
+ }
7236
7411
  }
7237
7412
  };
7238
7413
  const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
@@ -7283,16 +7458,20 @@ function baseCreateRenderer(options, createHydrationFns) {
7283
7458
  if (dirs) {
7284
7459
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7285
7460
  }
7286
- const needCallTransitionHooks = needTransition(parentSuspense, transition);
7287
- if (needCallTransitionHooks) {
7288
- transition.beforeEnter(el);
7461
+ if (transition) {
7462
+ performTransitionEnter(
7463
+ el,
7464
+ transition,
7465
+ () => hostInsert(el, container, anchor),
7466
+ parentSuspense
7467
+ );
7468
+ } else {
7469
+ hostInsert(el, container, anchor);
7289
7470
  }
7290
- hostInsert(el, container, anchor);
7291
- if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
7471
+ if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
7292
7472
  queuePostRenderEffect(
7293
7473
  () => {
7294
7474
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7295
- needCallTransitionHooks && transition.enter(el);
7296
7475
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7297
7476
  },
7298
7477
  void 0,
@@ -7309,21 +7488,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7309
7488
  hostSetScopeId(el, slotScopeIds[i]);
7310
7489
  }
7311
7490
  }
7312
- let subTree = parentComponent && parentComponent.subTree;
7313
- if (subTree) {
7314
- if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
7315
- subTree = filterSingleRoot(subTree.children) || subTree;
7316
- }
7317
- if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
7318
- const parentVNode = parentComponent.vnode;
7319
- setScopeId(
7320
- el,
7321
- parentVNode,
7322
- parentVNode.scopeId,
7323
- parentVNode.slotScopeIds,
7324
- parentComponent.parent
7325
- );
7326
- }
7491
+ const inheritedScopeIds = getInheritedScopeIds(vnode, parentComponent);
7492
+ for (let i = 0; i < inheritedScopeIds.length; i++) {
7493
+ hostSetScopeId(el, inheritedScopeIds[i]);
7327
7494
  }
7328
7495
  };
7329
7496
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
@@ -7564,12 +7731,21 @@ function baseCreateRenderer(options, createHydrationFns) {
7564
7731
  n2.slotScopeIds = slotScopeIds;
7565
7732
  if (n2.type.__vapor) {
7566
7733
  if (n1 == null) {
7567
- getVaporInterface(parentComponent, n2).mount(
7568
- n2,
7569
- container,
7570
- anchor,
7571
- parentComponent
7572
- );
7734
+ if (n2.shapeFlag & 512) {
7735
+ getVaporInterface(parentComponent, n2).activate(
7736
+ n2,
7737
+ container,
7738
+ anchor,
7739
+ parentComponent
7740
+ );
7741
+ } else {
7742
+ getVaporInterface(parentComponent, n2).mount(
7743
+ n2,
7744
+ container,
7745
+ anchor,
7746
+ parentComponent
7747
+ );
7748
+ }
7573
7749
  } else {
7574
7750
  getVaporInterface(parentComponent, n2).update(
7575
7751
  n1,
@@ -7632,6 +7808,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7632
7808
  if (!initialVNode.el) {
7633
7809
  const placeholder = instance.subTree = createVNode(Comment);
7634
7810
  processCommentNode(null, placeholder, container, anchor);
7811
+ initialVNode.placeholder = placeholder.el;
7635
7812
  }
7636
7813
  } else {
7637
7814
  setupRenderEffect(
@@ -8172,7 +8349,11 @@ function baseCreateRenderer(options, createHydrationFns) {
8172
8349
  for (i = toBePatched - 1; i >= 0; i--) {
8173
8350
  const nextIndex = s2 + i;
8174
8351
  const nextChild = c2[nextIndex];
8175
- const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
8352
+ const anchorVNode = c2[nextIndex + 1];
8353
+ const anchor = nextIndex + 1 < l2 ? (
8354
+ // #13559, fallback to el placeholder for unresolved async component
8355
+ anchorVNode.el || anchorVNode.placeholder
8356
+ ) : parentAnchor;
8176
8357
  if (newIndexToOldIndexMap[i] === 0) {
8177
8358
  patch(
8178
8359
  null,
@@ -8252,12 +8433,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8252
8433
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
8253
8434
  if (needTransition2) {
8254
8435
  if (moveType === 0) {
8255
- transition.beforeEnter(el);
8256
- hostInsert(el, container, anchor);
8257
- queuePostRenderEffect(
8258
- () => transition.enter(el),
8259
- void 0,
8260
- parentSuspense
8436
+ performTransitionEnter(
8437
+ el,
8438
+ transition,
8439
+ () => hostInsert(el, container, anchor),
8440
+ parentSuspense,
8441
+ true
8261
8442
  );
8262
8443
  } else {
8263
8444
  const { leave, delayLeave, afterLeave } = transition;
@@ -8269,6 +8450,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8269
8450
  }
8270
8451
  };
8271
8452
  const performLeave = () => {
8453
+ if (el._isLeaving) {
8454
+ el[leaveCbKey](
8455
+ true
8456
+ /* cancelled */
8457
+ );
8458
+ }
8272
8459
  leave(el, () => {
8273
8460
  remove2();
8274
8461
  afterLeave && afterLeave();
@@ -8308,7 +8495,14 @@ function baseCreateRenderer(options, createHydrationFns) {
8308
8495
  parentComponent.renderCache[cacheIndex] = void 0;
8309
8496
  }
8310
8497
  if (shapeFlag & 256) {
8311
- parentComponent.ctx.deactivate(vnode);
8498
+ if (vnode.type.__vapor) {
8499
+ getVaporInterface(parentComponent, vnode).deactivate(
8500
+ vnode,
8501
+ parentComponent.ctx.getStorageContainer()
8502
+ );
8503
+ } else {
8504
+ parentComponent.ctx.deactivate(vnode);
8505
+ }
8312
8506
  return;
8313
8507
  }
8314
8508
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -8396,22 +8590,15 @@ function baseCreateRenderer(options, createHydrationFns) {
8396
8590
  removeStaticNode(vnode);
8397
8591
  return;
8398
8592
  }
8399
- const performRemove = () => {
8400
- hostRemove(el);
8401
- if (transition && !transition.persisted && transition.afterLeave) {
8402
- transition.afterLeave();
8403
- }
8404
- };
8405
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
8406
- const { leave, delayLeave } = transition;
8407
- const performLeave = () => leave(el, performRemove);
8408
- if (delayLeave) {
8409
- delayLeave(vnode.el, performRemove, performLeave);
8410
- } else {
8411
- performLeave();
8412
- }
8593
+ if (transition) {
8594
+ performTransitionLeave(
8595
+ el,
8596
+ transition,
8597
+ () => hostRemove(el),
8598
+ !!(vnode.shapeFlag & 1)
8599
+ );
8413
8600
  } else {
8414
- performRemove();
8601
+ hostRemove(el);
8415
8602
  }
8416
8603
  };
8417
8604
  const removeFragment = (cur, end) => {
@@ -8427,27 +8614,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8427
8614
  if (instance.type.__hmrId) {
8428
8615
  unregisterHMR(instance);
8429
8616
  }
8430
- const {
8431
- bum,
8432
- scope,
8433
- effect,
8434
- subTree,
8435
- um,
8436
- m,
8437
- a,
8438
- parent,
8439
- slots: { __: slotCacheKeys }
8440
- } = instance;
8617
+ const { bum, scope, effect, subTree, um, m, a } = instance;
8441
8618
  invalidateMount(m);
8442
8619
  invalidateMount(a);
8443
8620
  if (bum) {
8444
8621
  invokeArrayFns(bum);
8445
8622
  }
8446
- if (parent && isArray(slotCacheKeys)) {
8447
- slotCacheKeys.forEach((v) => {
8448
- parent.renderCache[v] = void 0;
8449
- });
8450
- }
8451
8623
  scope.stop();
8452
8624
  if (effect) {
8453
8625
  effect.stop();
@@ -8461,12 +8633,6 @@ function baseCreateRenderer(options, createHydrationFns) {
8461
8633
  void 0,
8462
8634
  parentSuspense
8463
8635
  );
8464
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
8465
- parentSuspense.deps--;
8466
- if (parentSuspense.deps === 0) {
8467
- parentSuspense.resolve();
8468
- }
8469
- }
8470
8636
  {
8471
8637
  devtoolsComponentRemoved(instance);
8472
8638
  }
@@ -8479,7 +8645,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8479
8645
  const getNextHostNode = (vnode) => {
8480
8646
  if (vnode.shapeFlag & 6) {
8481
8647
  if (vnode.type.__vapor) {
8482
- return hostNextSibling(vnode.component.block);
8648
+ return hostNextSibling(vnode.anchor);
8483
8649
  }
8484
8650
  return getNextHostNode(vnode.component.subTree);
8485
8651
  }
@@ -8557,6 +8723,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8557
8723
  return {
8558
8724
  render,
8559
8725
  hydrate,
8726
+ hydrateNode,
8560
8727
  internals,
8561
8728
  createApp: createAppAPI(
8562
8729
  mountApp,
@@ -8596,7 +8763,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8596
8763
  if (!shallow && c2.patchFlag !== -2)
8597
8764
  traverseStaticChildren(c1, c2);
8598
8765
  }
8599
- if (c2.type === Text) {
8766
+ if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
8767
+ c2.patchFlag !== -1) {
8600
8768
  c2.el = c1.el;
8601
8769
  }
8602
8770
  if (c2.type === Comment && !c2.el) {
@@ -8609,7 +8777,7 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8609
8777
  }
8610
8778
  }
8611
8779
  function locateNonHydratedAsyncRoot(instance) {
8612
- const subComponent = instance.subTree.component;
8780
+ const subComponent = instance.subTree && instance.subTree.component;
8613
8781
  if (subComponent) {
8614
8782
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
8615
8783
  return subComponent;
@@ -8624,6 +8792,34 @@ function invalidateMount(hooks) {
8624
8792
  hooks[i].flags |= 4;
8625
8793
  }
8626
8794
  }
8795
+ function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
8796
+ if (force || needTransition(parentSuspense, transition)) {
8797
+ transition.beforeEnter(el);
8798
+ insert();
8799
+ queuePostRenderEffect(() => transition.enter(el), void 0, parentSuspense);
8800
+ } else {
8801
+ insert();
8802
+ }
8803
+ }
8804
+ function performTransitionLeave(el, transition, remove, isElement = true) {
8805
+ const performRemove = () => {
8806
+ remove();
8807
+ if (transition && !transition.persisted && transition.afterLeave) {
8808
+ transition.afterLeave();
8809
+ }
8810
+ };
8811
+ if (isElement && transition && !transition.persisted) {
8812
+ const { leave, delayLeave } = transition;
8813
+ const performLeave = () => leave(el, performRemove);
8814
+ if (delayLeave) {
8815
+ delayLeave(el, performRemove, performLeave);
8816
+ } else {
8817
+ performLeave();
8818
+ }
8819
+ } else {
8820
+ performRemove();
8821
+ }
8822
+ }
8627
8823
  function getVaporInterface(instance, vnode) {
8628
8824
  const ctx = instance ? instance.appContext : vnode.appContext;
8629
8825
  const res = ctx && ctx.vapor;
@@ -8638,6 +8834,32 @@ app.use(vaporInteropPlugin)
8638
8834
  }
8639
8835
  return res;
8640
8836
  }
8837
+ function getInheritedScopeIds(vnode, parentComponent) {
8838
+ const inheritedScopeIds = [];
8839
+ let currentParent = parentComponent;
8840
+ let currentVNode = vnode;
8841
+ while (currentParent) {
8842
+ let subTree = currentParent.subTree;
8843
+ if (!subTree) break;
8844
+ if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
8845
+ subTree = filterSingleRoot(subTree.children) || subTree;
8846
+ }
8847
+ if (currentVNode === subTree || isSuspense(subTree.type) && (subTree.ssContent === currentVNode || subTree.ssFallback === currentVNode)) {
8848
+ const parentVNode = currentParent.vnode;
8849
+ if (parentVNode.scopeId) {
8850
+ inheritedScopeIds.push(parentVNode.scopeId);
8851
+ }
8852
+ if (parentVNode.slotScopeIds) {
8853
+ inheritedScopeIds.push(...parentVNode.slotScopeIds);
8854
+ }
8855
+ currentVNode = parentVNode;
8856
+ currentParent = currentParent.parent;
8857
+ } else {
8858
+ break;
8859
+ }
8860
+ }
8861
+ return inheritedScopeIds;
8862
+ }
8641
8863
 
8642
8864
  const ssrContextKey = Symbol.for("v-scx");
8643
8865
  const useSSRContext = () => {
@@ -8977,8 +9199,9 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
8977
9199
  function defaultPropGetter(props, key) {
8978
9200
  return props[key];
8979
9201
  }
9202
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
8980
9203
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
8981
- const cache = appContext.emitsCache;
9204
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
8982
9205
  const cached = cache.get(comp);
8983
9206
  if (cached !== void 0) {
8984
9207
  return cached;
@@ -9426,7 +9649,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9426
9649
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
9427
9650
  if (pendingBranch) {
9428
9651
  suspense.pendingBranch = newBranch;
9429
- if (isSameVNodeType(newBranch, pendingBranch)) {
9652
+ if (isSameVNodeType(pendingBranch, newBranch)) {
9430
9653
  patch(
9431
9654
  pendingBranch,
9432
9655
  newBranch,
@@ -9497,7 +9720,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9497
9720
  );
9498
9721
  setActiveBranch(suspense, newFallback);
9499
9722
  }
9500
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
9723
+ } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
9501
9724
  patch(
9502
9725
  activeBranch,
9503
9726
  newBranch,
@@ -9528,7 +9751,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9528
9751
  }
9529
9752
  }
9530
9753
  } else {
9531
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
9754
+ if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
9532
9755
  patch(
9533
9756
  activeBranch,
9534
9757
  newBranch,
@@ -9641,7 +9864,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9641
9864
  pendingId,
9642
9865
  effects,
9643
9866
  parentComponent: parentComponent2,
9644
- container: container2
9867
+ container: container2,
9868
+ isInFallback
9645
9869
  } = suspense;
9646
9870
  let delayEnter = false;
9647
9871
  if (suspense.isHydrating) {
@@ -9659,6 +9883,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9659
9883
  parentComponent2
9660
9884
  );
9661
9885
  queuePostFlushCb(effects);
9886
+ if (isInFallback && vnode2.ssFallback) {
9887
+ vnode2.ssFallback.el = null;
9888
+ }
9662
9889
  }
9663
9890
  };
9664
9891
  }
@@ -9667,6 +9894,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9667
9894
  anchor = next(activeBranch);
9668
9895
  }
9669
9896
  unmount(activeBranch, parentComponent2, suspense, true);
9897
+ if (!delayEnter && isInFallback && vnode2.ssFallback) {
9898
+ vnode2.ssFallback.el = null;
9899
+ }
9670
9900
  }
9671
9901
  if (!delayEnter) {
9672
9902
  move(
@@ -9791,6 +10021,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9791
10021
  optimized2
9792
10022
  );
9793
10023
  if (placeholder) {
10024
+ vnode2.placeholder = null;
9794
10025
  remove(placeholder);
9795
10026
  }
9796
10027
  updateHOCHostEl(instance, vnode2.el);
@@ -9996,15 +10227,11 @@ const createVNodeWithArgsTransform = (...args) => {
9996
10227
  );
9997
10228
  };
9998
10229
  const normalizeKey = ({ key }) => key != null ? key : null;
9999
- const normalizeRef = ({
10000
- ref,
10001
- ref_key,
10002
- ref_for
10003
- }) => {
10230
+ const normalizeRef = ({ ref, ref_key, ref_for }, i = currentRenderingInstance) => {
10004
10231
  if (typeof ref === "number") {
10005
10232
  ref = "" + ref;
10006
10233
  }
10007
- return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
10234
+ return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i, r: ref, k: ref_key, f: !!ref_for } : ref : null;
10008
10235
  };
10009
10236
  function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
10010
10237
  const vnode = {
@@ -10170,6 +10397,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
10170
10397
  suspense: vnode.suspense,
10171
10398
  ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
10172
10399
  ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
10400
+ placeholder: vnode.placeholder,
10173
10401
  el: vnode.el,
10174
10402
  anchor: vnode.anchor,
10175
10403
  ctx: vnode.ctx,
@@ -10696,7 +10924,7 @@ function getComponentPublicInstance(instance) {
10696
10924
  return instance.proxy;
10697
10925
  }
10698
10926
  }
10699
- const classifyRE = /(?:^|[-_])(\w)/g;
10927
+ const classifyRE = /(?:^|[-_])\w/g;
10700
10928
  const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
10701
10929
  function getComponentName(Component, includeInferred = true) {
10702
10930
  return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
@@ -10732,23 +10960,28 @@ const computed = (getterOrOptions, debugOptions) => {
10732
10960
  };
10733
10961
 
10734
10962
  function h(type, propsOrChildren, children) {
10735
- const l = arguments.length;
10736
- if (l === 2) {
10737
- if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10738
- if (isVNode(propsOrChildren)) {
10739
- return createVNode(type, null, [propsOrChildren]);
10963
+ try {
10964
+ setBlockTracking(-1);
10965
+ const l = arguments.length;
10966
+ if (l === 2) {
10967
+ if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10968
+ if (isVNode(propsOrChildren)) {
10969
+ return createVNode(type, null, [propsOrChildren]);
10970
+ }
10971
+ return createVNode(type, propsOrChildren);
10972
+ } else {
10973
+ return createVNode(type, null, propsOrChildren);
10740
10974
  }
10741
- return createVNode(type, propsOrChildren);
10742
10975
  } else {
10743
- return createVNode(type, null, propsOrChildren);
10744
- }
10745
- } else {
10746
- if (l > 3) {
10747
- children = Array.prototype.slice.call(arguments, 2);
10748
- } else if (l === 3 && isVNode(children)) {
10749
- children = [children];
10976
+ if (l > 3) {
10977
+ children = Array.prototype.slice.call(arguments, 2);
10978
+ } else if (l === 3 && isVNode(children)) {
10979
+ children = [children];
10980
+ }
10981
+ return createVNode(type, propsOrChildren, children);
10750
10982
  }
10751
- return createVNode(type, propsOrChildren, children);
10983
+ } finally {
10984
+ setBlockTracking(1);
10752
10985
  }
10753
10986
  }
10754
10987
 
@@ -10958,7 +11191,7 @@ function isMemoSame(cached, memo) {
10958
11191
  return true;
10959
11192
  }
10960
11193
 
10961
- const version = "3.6.0-alpha.1";
11194
+ const version = "3.6.0-alpha.3";
10962
11195
  const warn = warn$1 ;
10963
11196
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10964
11197
  const devtools = devtools$1 ;
@@ -11187,11 +11420,11 @@ function resolveTransitionProps(rawProps) {
11187
11420
  const resolve = () => finishLeave(el, done);
11188
11421
  addTransitionClass(el, leaveFromClass);
11189
11422
  if (!el._enterCancelled) {
11190
- forceReflow();
11423
+ forceReflow(el);
11191
11424
  addTransitionClass(el, leaveActiveClass);
11192
11425
  } else {
11193
11426
  addTransitionClass(el, leaveActiveClass);
11194
- forceReflow();
11427
+ forceReflow(el);
11195
11428
  }
11196
11429
  nextFrame(() => {
11197
11430
  if (!el._isLeaving) {
@@ -11317,7 +11550,7 @@ function getTransitionInfo(el, expectedType) {
11317
11550
  type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
11318
11551
  propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
11319
11552
  }
11320
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
11553
+ const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
11321
11554
  getStyleProperties(`${TRANSITION}Property`).toString()
11322
11555
  );
11323
11556
  return {
@@ -11337,8 +11570,9 @@ function toMs(s) {
11337
11570
  if (s === "auto") return 0;
11338
11571
  return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
11339
11572
  }
11340
- function forceReflow() {
11341
- return document.body.offsetHeight;
11573
+ function forceReflow(el) {
11574
+ const targetDocument = el ? el.ownerDocument : document;
11575
+ return targetDocument.body.offsetHeight;
11342
11576
  }
11343
11577
 
11344
11578
  function patchClass(el, value, isSVG) {
@@ -11358,6 +11592,8 @@ function patchClass(el, value, isSVG) {
11358
11592
  const vShowOriginalDisplay = Symbol("_vod");
11359
11593
  const vShowHidden = Symbol("_vsh");
11360
11594
  const vShow = {
11595
+ // used for prop mismatch check during hydration
11596
+ name: "show",
11361
11597
  beforeMount(el, { value }, { transition }) {
11362
11598
  el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
11363
11599
  if (transition && value) {
@@ -11391,9 +11627,6 @@ const vShow = {
11391
11627
  setDisplay(el, value);
11392
11628
  }
11393
11629
  };
11394
- {
11395
- vShow.name = "show";
11396
- }
11397
11630
  function setDisplay(el, value) {
11398
11631
  el.style.display = value ? el[vShowOriginalDisplay] : "none";
11399
11632
  el[vShowHidden] = !value;
@@ -11479,7 +11712,7 @@ function setVarsOnNode(el, vars) {
11479
11712
  }
11480
11713
  }
11481
11714
 
11482
- const displayRE = /(^|;)\s*display\s*:/;
11715
+ const displayRE = /(?:^|;)\s*display\s*:/;
11483
11716
  function patchStyle(el, prev, next) {
11484
11717
  const style = el.style;
11485
11718
  const isCssString = isString(next);
@@ -11784,11 +12017,10 @@ function shouldSetAsProp(el, key, value, isSVG) {
11784
12017
  }
11785
12018
 
11786
12019
  const REMOVAL = {};
11787
- /*! #__NO_SIDE_EFFECTS__ */
11788
12020
  // @__NO_SIDE_EFFECTS__
11789
12021
  function defineCustomElement(options, extraOptions, _createApp) {
11790
- const Comp = defineComponent(options, extraOptions);
11791
- if (isPlainObject(Comp)) extend(Comp, extraOptions);
12022
+ let Comp = defineComponent(options, extraOptions);
12023
+ if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
11792
12024
  class VueCustomElement extends VueElement {
11793
12025
  constructor(initialProps) {
11794
12026
  super(Comp, initialProps, _createApp);
@@ -11797,10 +12029,9 @@ function defineCustomElement(options, extraOptions, _createApp) {
11797
12029
  VueCustomElement.def = Comp;
11798
12030
  return VueCustomElement;
11799
12031
  }
11800
- /*! #__NO_SIDE_EFFECTS__ */
11801
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
12032
+ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
11802
12033
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
11803
- };
12034
+ });
11804
12035
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11805
12036
  };
11806
12037
  class VueElement extends BaseClass {
@@ -11824,6 +12055,8 @@ class VueElement extends BaseClass {
11824
12055
  this._nonce = this._def.nonce;
11825
12056
  this._connected = false;
11826
12057
  this._resolved = false;
12058
+ this._patching = false;
12059
+ this._dirty = false;
11827
12060
  this._numberProps = null;
11828
12061
  this._styleChildren = /* @__PURE__ */ new WeakSet();
11829
12062
  this._ob = null;
@@ -11836,7 +12069,11 @@ class VueElement extends BaseClass {
11836
12069
  );
11837
12070
  }
11838
12071
  if (_def.shadowRoot !== false) {
11839
- this.attachShadow({ mode: "open" });
12072
+ this.attachShadow(
12073
+ extend({}, _def.shadowRootOptions, {
12074
+ mode: "open"
12075
+ })
12076
+ );
11840
12077
  this._root = this.shadowRoot;
11841
12078
  } else {
11842
12079
  this._root = this;
@@ -11896,9 +12133,18 @@ class VueElement extends BaseClass {
11896
12133
  this._app && this._app.unmount();
11897
12134
  if (this._instance) this._instance.ce = void 0;
11898
12135
  this._app = this._instance = null;
12136
+ if (this._teleportTargets) {
12137
+ this._teleportTargets.clear();
12138
+ this._teleportTargets = void 0;
12139
+ }
11899
12140
  }
11900
12141
  });
11901
12142
  }
12143
+ _processMutations(mutations) {
12144
+ for (const m of mutations) {
12145
+ this._setAttr(m.attributeName);
12146
+ }
12147
+ }
11902
12148
  /**
11903
12149
  * resolve inner component definition (handle possible async component)
11904
12150
  */
@@ -11909,11 +12155,7 @@ class VueElement extends BaseClass {
11909
12155
  for (let i = 0; i < this.attributes.length; i++) {
11910
12156
  this._setAttr(this.attributes[i].name);
11911
12157
  }
11912
- this._ob = new MutationObserver((mutations) => {
11913
- for (const m of mutations) {
11914
- this._setAttr(m.attributeName);
11915
- }
11916
- });
12158
+ this._ob = new MutationObserver(this._processMutations.bind(this));
11917
12159
  this._ob.observe(this, { attributes: true });
11918
12160
  const resolve = (def, isAsync = false) => {
11919
12161
  this._resolved = true;
@@ -11990,7 +12232,7 @@ class VueElement extends BaseClass {
11990
12232
  return this._getProp(key);
11991
12233
  },
11992
12234
  set(val) {
11993
- this._setProp(key, val, true, true);
12235
+ this._setProp(key, val, true, !this._patching);
11994
12236
  }
11995
12237
  });
11996
12238
  }
@@ -12016,6 +12258,7 @@ class VueElement extends BaseClass {
12016
12258
  */
12017
12259
  _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
12018
12260
  if (val !== this._props[key]) {
12261
+ this._dirty = true;
12019
12262
  if (val === REMOVAL) {
12020
12263
  delete this._props[key];
12021
12264
  } else {
@@ -12029,7 +12272,10 @@ class VueElement extends BaseClass {
12029
12272
  }
12030
12273
  if (shouldReflect) {
12031
12274
  const ob = this._ob;
12032
- ob && ob.disconnect();
12275
+ if (ob) {
12276
+ this._processMutations(ob.takeRecords());
12277
+ ob.disconnect();
12278
+ }
12033
12279
  if (val === true) {
12034
12280
  this.setAttribute(hyphenate(key), "");
12035
12281
  } else if (typeof val === "string" || typeof val === "number") {
@@ -12133,7 +12379,7 @@ class VueElement extends BaseClass {
12133
12379
  * Only called when shadowRoot is false
12134
12380
  */
12135
12381
  _renderSlots() {
12136
- const outlets = (this._teleportTarget || this).querySelectorAll("slot");
12382
+ const outlets = this._getSlots();
12137
12383
  const scopeId = this._instance.type.__scopeId;
12138
12384
  for (let i = 0; i < outlets.length; i++) {
12139
12385
  const o = outlets[i];
@@ -12159,12 +12405,45 @@ class VueElement extends BaseClass {
12159
12405
  parent.removeChild(o);
12160
12406
  }
12161
12407
  }
12408
+ /**
12409
+ * @internal
12410
+ */
12411
+ _getSlots() {
12412
+ const roots = [this];
12413
+ if (this._teleportTargets) {
12414
+ roots.push(...this._teleportTargets);
12415
+ }
12416
+ const slots = /* @__PURE__ */ new Set();
12417
+ for (const root of roots) {
12418
+ const found = root.querySelectorAll("slot");
12419
+ for (let i = 0; i < found.length; i++) {
12420
+ slots.add(found[i]);
12421
+ }
12422
+ }
12423
+ return Array.from(slots);
12424
+ }
12162
12425
  /**
12163
12426
  * @internal
12164
12427
  */
12165
12428
  _injectChildStyle(comp) {
12166
12429
  this._applyStyles(comp.styles, comp);
12167
12430
  }
12431
+ /**
12432
+ * @internal
12433
+ */
12434
+ _beginPatch() {
12435
+ this._patching = true;
12436
+ this._dirty = false;
12437
+ }
12438
+ /**
12439
+ * @internal
12440
+ */
12441
+ _endPatch() {
12442
+ this._patching = false;
12443
+ if (this._dirty && this._instance) {
12444
+ this._update();
12445
+ }
12446
+ }
12168
12447
  /**
12169
12448
  * @internal
12170
12449
  */
@@ -12257,26 +12536,13 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
12257
12536
  prevChildren = [];
12258
12537
  return;
12259
12538
  }
12260
- prevChildren.forEach(callPendingCbs);
12539
+ prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
12261
12540
  prevChildren.forEach(recordPosition);
12262
12541
  const movedChildren = prevChildren.filter(applyTranslation);
12263
- forceReflow();
12542
+ forceReflow(instance.vnode.el);
12264
12543
  movedChildren.forEach((c) => {
12265
12544
  const el = c.el;
12266
- const style = el.style;
12267
- addTransitionClass(el, moveClass);
12268
- style.transform = style.webkitTransform = style.transitionDuration = "";
12269
- const cb = el[moveCbKey] = (e) => {
12270
- if (e && e.target !== el) {
12271
- return;
12272
- }
12273
- if (!e || /transform$/.test(e.propertyName)) {
12274
- el.removeEventListener("transitionend", cb);
12275
- el[moveCbKey] = null;
12276
- removeTransitionClass(el, moveClass);
12277
- }
12278
- };
12279
- el.addEventListener("transitionend", cb);
12545
+ handleMovedChildren(el, moveClass);
12280
12546
  });
12281
12547
  prevChildren = [];
12282
12548
  });
@@ -12299,10 +12565,10 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
12299
12565
  instance
12300
12566
  )
12301
12567
  );
12302
- positionMap.set(
12303
- child,
12304
- child.el.getBoundingClientRect()
12305
- );
12568
+ positionMap.set(child, {
12569
+ left: child.el.offsetLeft,
12570
+ top: child.el.offsetTop
12571
+ });
12306
12572
  }
12307
12573
  }
12308
12574
  }
@@ -12323,8 +12589,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
12323
12589
  }
12324
12590
  });
12325
12591
  const TransitionGroup = TransitionGroupImpl;
12326
- function callPendingCbs(c) {
12327
- const el = c.el;
12592
+ function callPendingCbs(el) {
12328
12593
  if (el[moveCbKey]) {
12329
12594
  el[moveCbKey]();
12330
12595
  }
@@ -12333,19 +12598,30 @@ function callPendingCbs(c) {
12333
12598
  }
12334
12599
  }
12335
12600
  function recordPosition(c) {
12336
- newPositionMap.set(c, c.el.getBoundingClientRect());
12601
+ newPositionMap.set(c, {
12602
+ left: c.el.offsetLeft,
12603
+ top: c.el.offsetTop
12604
+ });
12337
12605
  }
12338
12606
  function applyTranslation(c) {
12339
- const oldPos = positionMap.get(c);
12340
- const newPos = newPositionMap.get(c);
12607
+ if (baseApplyTranslation(
12608
+ positionMap.get(c),
12609
+ newPositionMap.get(c),
12610
+ c.el
12611
+ )) {
12612
+ return c;
12613
+ }
12614
+ }
12615
+ function baseApplyTranslation(oldPos, newPos, el) {
12341
12616
  const dx = oldPos.left - newPos.left;
12342
12617
  const dy = oldPos.top - newPos.top;
12343
12618
  if (dx || dy) {
12344
- const s = c.el.style;
12619
+ const s = el.style;
12345
12620
  s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
12346
12621
  s.transitionDuration = "0s";
12347
- return c;
12622
+ return true;
12348
12623
  }
12624
+ return false;
12349
12625
  }
12350
12626
  function hasCSSTransform(el, root, moveClass) {
12351
12627
  const clone = el.cloneNode();
@@ -12363,6 +12639,22 @@ function hasCSSTransform(el, root, moveClass) {
12363
12639
  container.removeChild(clone);
12364
12640
  return hasTransform;
12365
12641
  }
12642
+ const handleMovedChildren = (el, moveClass) => {
12643
+ const style = el.style;
12644
+ addTransitionClass(el, moveClass);
12645
+ style.transform = style.webkitTransform = style.transitionDuration = "";
12646
+ const cb = el[moveCbKey] = (e) => {
12647
+ if (e && e.target !== el) {
12648
+ return;
12649
+ }
12650
+ if (!e || e.propertyName.endsWith("transform")) {
12651
+ el.removeEventListener("transitionend", cb);
12652
+ el[moveCbKey] = null;
12653
+ removeTransitionClass(el, moveClass);
12654
+ }
12655
+ };
12656
+ el.addEventListener("transitionend", cb);
12657
+ };
12366
12658
 
12367
12659
  const getModelAssigner = (vnode) => {
12368
12660
  const fn = vnode.props["onUpdate:modelValue"] || false;
@@ -12398,21 +12690,21 @@ const vModelText = {
12398
12690
  vModelTextUpdate(el, oldValue, value, trim, number, lazy);
12399
12691
  }
12400
12692
  };
12693
+ function castValue(value, trim, number) {
12694
+ if (trim) value = value.trim();
12695
+ if (number) value = looseToNumber(value);
12696
+ return value;
12697
+ }
12401
12698
  const vModelTextInit = (el, trim, number, lazy, set) => {
12402
12699
  addEventListener(el, lazy ? "change" : "input", (e) => {
12403
12700
  if (e.target.composing) return;
12404
- let domValue = el.value;
12405
- if (trim) {
12406
- domValue = domValue.trim();
12407
- }
12408
- if (number || el.type === "number") {
12409
- domValue = looseToNumber(domValue);
12410
- }
12411
- (0, el[assignKey])(domValue);
12701
+ (0, el[assignKey])(
12702
+ castValue(el.value, trim, number || el.type === "number")
12703
+ );
12412
12704
  });
12413
- if (trim) {
12705
+ if (trim || number) {
12414
12706
  addEventListener(el, "change", () => {
12415
- el.value = el.value.trim();
12707
+ el.value = castValue(el.value, trim, number || el.type === "number");
12416
12708
  });
12417
12709
  }
12418
12710
  if (!lazy) {
@@ -12695,13 +12987,13 @@ const modifierGuards = {
12695
12987
  const withModifiers = (fn, modifiers) => {
12696
12988
  const cache = fn._withMods || (fn._withMods = {});
12697
12989
  const cacheKey = modifiers.join(".");
12698
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
12990
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
12699
12991
  for (let i = 0; i < modifiers.length; i++) {
12700
12992
  const guard = modifierGuards[modifiers[i]];
12701
12993
  if (guard && guard(event, modifiers)) return;
12702
12994
  }
12703
12995
  return fn(event, ...args);
12704
- });
12996
+ }));
12705
12997
  };
12706
12998
  const keyNames = {
12707
12999
  esc: "escape",
@@ -12715,7 +13007,7 @@ const keyNames = {
12715
13007
  const withKeys = (fn, modifiers) => {
12716
13008
  const cache = fn._withKeys || (fn._withKeys = {});
12717
13009
  const cacheKey = modifiers.join(".");
12718
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
13010
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
12719
13011
  if (!("key" in event)) {
12720
13012
  return;
12721
13013
  }
@@ -12725,7 +13017,7 @@ const withKeys = (fn, modifiers) => {
12725
13017
  )) {
12726
13018
  return fn(event);
12727
13019
  }
12728
- });
13020
+ }));
12729
13021
  };
12730
13022
 
12731
13023
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -12739,13 +13031,13 @@ function ensureHydrationRenderer() {
12739
13031
  enabledHydration = true;
12740
13032
  return renderer;
12741
13033
  }
12742
- const render = (...args) => {
13034
+ const render = ((...args) => {
12743
13035
  ensureRenderer().render(...args);
12744
- };
12745
- const hydrate = (...args) => {
13036
+ });
13037
+ const hydrate = ((...args) => {
12746
13038
  ensureHydrationRenderer().hydrate(...args);
12747
- };
12748
- const createApp = (...args) => {
13039
+ });
13040
+ const createApp = ((...args) => {
12749
13041
  const app = ensureRenderer().createApp(...args);
12750
13042
  {
12751
13043
  injectNativeTagCheck(app);
@@ -12770,8 +13062,8 @@ const createApp = (...args) => {
12770
13062
  return proxy;
12771
13063
  };
12772
13064
  return app;
12773
- };
12774
- const createSSRApp = (...args) => {
13065
+ });
13066
+ const createSSRApp = ((...args) => {
12775
13067
  const app = ensureHydrationRenderer().createApp(...args);
12776
13068
  {
12777
13069
  injectNativeTagCheck(app);
@@ -12785,7 +13077,7 @@ const createSSRApp = (...args) => {
12785
13077
  }
12786
13078
  };
12787
13079
  return app;
12788
- };
13080
+ });
12789
13081
  function resolveRootNamespace(container) {
12790
13082
  if (container instanceof SVGElement) {
12791
13083
  return "svg";