@vue/runtime-dom 3.6.0-alpha.2 → 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.2
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,17 +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.version === globalVersion && prevSub.sub === sub) {
460
+ return;
461
+ }
459
462
  const newLink = sub.depsTail = dep.subsTail = {
463
+ version: globalVersion,
460
464
  dep,
461
465
  sub,
462
466
  prevDep,
@@ -562,6 +566,7 @@ function propagate(link2) {
562
566
  } while (true);
563
567
  }
564
568
  function startTracking(sub) {
569
+ ++globalVersion;
565
570
  sub.depsTail = void 0;
566
571
  sub.flags = sub.flags & -57 | 4 /* RecursedCheck */;
567
572
  return setActiveSub(sub);
@@ -662,18 +667,12 @@ function shallowPropagate(link2) {
662
667
  } while (link2 !== void 0);
663
668
  }
664
669
  function isValidLink(checkLink, sub) {
665
- const depsTail = sub.depsTail;
666
- if (depsTail !== void 0) {
667
- let link2 = sub.deps;
668
- do {
669
- if (link2 === checkLink) {
670
- return true;
671
- }
672
- if (link2 === depsTail) {
673
- break;
674
- }
675
- link2 = link2.nextDep;
676
- } 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;
677
676
  }
678
677
  return false;
679
678
  }
@@ -913,7 +912,7 @@ const arrayInstrumentations = {
913
912
  join(separator) {
914
913
  return reactiveReadArray(this).join(separator);
915
914
  },
916
- // keys() iterator only reads `length`, no optimisation required
915
+ // keys() iterator only reads `length`, no optimization required
917
916
  lastIndexOf(...args) {
918
917
  return searchProxy(this, "lastIndexOf", args);
919
918
  },
@@ -965,7 +964,7 @@ function iterator(self, method, wrapValue) {
965
964
  iter._next = iter.next;
966
965
  iter.next = () => {
967
966
  const result = iter._next();
968
- if (result.value) {
967
+ if (!result.done) {
969
968
  result.value = wrapValue(result.value);
970
969
  }
971
970
  return result;
@@ -1096,7 +1095,8 @@ class BaseReactiveHandler {
1096
1095
  return res;
1097
1096
  }
1098
1097
  if (isRef(res)) {
1099
- return targetIsArray && isIntegerKey(key) ? res : res.value;
1098
+ const value = targetIsArray && isIntegerKey(key) ? res : res.value;
1099
+ return isReadonly2 && isObject(value) ? readonly(value) : value;
1100
1100
  }
1101
1101
  if (isObject(res)) {
1102
1102
  return isReadonly2 ? readonly(res) : reactive(res);
@@ -1118,7 +1118,13 @@ class MutableReactiveHandler extends BaseReactiveHandler {
1118
1118
  }
1119
1119
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
1120
1120
  if (isOldValueReadonly) {
1121
- 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;
1122
1128
  } else {
1123
1129
  oldValue.value = value;
1124
1130
  return true;
@@ -1263,7 +1269,7 @@ function createInstrumentations(readonly, shallow) {
1263
1269
  get size() {
1264
1270
  const target = this["__v_raw"];
1265
1271
  !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1266
- return Reflect.get(target, "size", target);
1272
+ return target.size;
1267
1273
  },
1268
1274
  has(key) {
1269
1275
  const target = this["__v_raw"];
@@ -2266,11 +2272,11 @@ function traverse(value, depth = Infinity, seen) {
2266
2272
  if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
2267
2273
  return value;
2268
2274
  }
2269
- seen = seen || /* @__PURE__ */ new Set();
2270
- if (seen.has(value)) {
2275
+ seen = seen || /* @__PURE__ */ new Map();
2276
+ if ((seen.get(value) || 0) >= depth) {
2271
2277
  return value;
2272
2278
  }
2273
- seen.add(value);
2279
+ seen.set(value, depth);
2274
2280
  depth--;
2275
2281
  if (isRef(value)) {
2276
2282
  traverse(value.value, depth, seen);
@@ -2816,8 +2822,10 @@ function rerender(id, newRender) {
2816
2822
  instance.hmrRerender();
2817
2823
  } else {
2818
2824
  const i = instance;
2819
- i.renderCache = [];
2820
- i.effect.run();
2825
+ if (!(i.effect.flags & 1024)) {
2826
+ i.renderCache = [];
2827
+ i.effect.run();
2828
+ }
2821
2829
  }
2822
2830
  nextTick(() => {
2823
2831
  isHmrUpdating = false;
@@ -2859,7 +2867,10 @@ function reload(id, newComp) {
2859
2867
  if (parent.vapor) {
2860
2868
  parent.hmrRerender();
2861
2869
  } else {
2862
- parent.effect.run();
2870
+ if (!(parent.effect.flags & 1024)) {
2871
+ parent.renderCache = [];
2872
+ parent.effect.run();
2873
+ }
2863
2874
  }
2864
2875
  nextTick(() => {
2865
2876
  isHmrUpdating = false;
@@ -2969,7 +2980,6 @@ const devtoolsComponentRemoved = (component) => {
2969
2980
  _devtoolsComponentRemoved(component);
2970
2981
  }
2971
2982
  };
2972
- /*! #__NO_SIDE_EFFECTS__ */
2973
2983
  // @__NO_SIDE_EFFECTS__
2974
2984
  function createDevtoolsComponentHook(hook) {
2975
2985
  return (component) => {
@@ -3155,9 +3165,6 @@ const TeleportImpl = {
3155
3165
  insert(mainAnchor, container, anchor);
3156
3166
  const mount = (container2, anchor2) => {
3157
3167
  if (shapeFlag & 16) {
3158
- if (parentComponent && parentComponent.isCE) {
3159
- parentComponent.ce._teleportTarget = container2;
3160
- }
3161
3168
  mountChildren(
3162
3169
  children,
3163
3170
  container2,
@@ -3179,6 +3186,9 @@ const TeleportImpl = {
3179
3186
  } else if (namespace !== "mathml" && isTargetMathML(target)) {
3180
3187
  namespace = "mathml";
3181
3188
  }
3189
+ if (parentComponent && parentComponent.isCE) {
3190
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3191
+ }
3182
3192
  if (!disabled) {
3183
3193
  mount(target, targetAnchor);
3184
3194
  updateCssVars(n2, false);
@@ -3379,26 +3389,34 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3379
3389
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
3380
3390
  o: { nextSibling, parentNode, querySelector, insert, createText }
3381
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
+ }
3382
3405
  const target = vnode.target = resolveTarget(
3383
3406
  vnode.props,
3384
3407
  querySelector
3385
3408
  );
3409
+ const disabled = isTeleportDisabled(vnode.props);
3386
3410
  if (target) {
3387
- const disabled = isTeleportDisabled(vnode.props);
3388
3411
  const targetNode = target._lpa || target.firstChild;
3389
3412
  if (vnode.shapeFlag & 16) {
3390
3413
  if (disabled) {
3391
- vnode.anchor = hydrateChildren(
3392
- nextSibling(node),
3414
+ hydrateDisabledTeleport(
3415
+ node,
3393
3416
  vnode,
3394
- parentNode(node),
3395
- parentComponent,
3396
- parentSuspense,
3397
- slotScopeIds,
3398
- optimized
3417
+ targetNode,
3418
+ targetNode && nextSibling(targetNode)
3399
3419
  );
3400
- vnode.targetStart = targetNode;
3401
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
3402
3420
  } else {
3403
3421
  vnode.anchor = nextSibling(node);
3404
3422
  let targetAnchor = targetNode;
@@ -3429,6 +3447,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3429
3447
  }
3430
3448
  }
3431
3449
  updateCssVars(vnode, disabled);
3450
+ } else if (disabled) {
3451
+ if (vnode.shapeFlag & 16) {
3452
+ hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
3453
+ }
3432
3454
  }
3433
3455
  return vnode.anchor && nextSibling(vnode.anchor);
3434
3456
  }
@@ -3469,7 +3491,7 @@ function useTransitionState() {
3469
3491
  isMounted: false,
3470
3492
  isLeaving: false,
3471
3493
  isUnmounting: false,
3472
- leavingVNodes: /* @__PURE__ */ new Map()
3494
+ leavingNodes: /* @__PURE__ */ new Map()
3473
3495
  };
3474
3496
  onMounted(() => {
3475
3497
  state.isMounted = true;
@@ -3501,7 +3523,7 @@ const BaseTransitionPropsValidators = {
3501
3523
  onAppearCancelled: TransitionHookValidator
3502
3524
  };
3503
3525
  const recursiveGetSubtree = (instance) => {
3504
- const subTree = instance.subTree;
3526
+ const subTree = instance.type.__vapor ? instance.block : instance.subTree;
3505
3527
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
3506
3528
  };
3507
3529
  const BaseTransitionImpl = {
@@ -3518,9 +3540,7 @@ const BaseTransitionImpl = {
3518
3540
  const child = findNonCommentChild(children);
3519
3541
  const rawProps = toRaw(props);
3520
3542
  const { mode } = rawProps;
3521
- if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
3522
- warn$1(`invalid <transition> mode: ${mode}`);
3523
- }
3543
+ checkTransitionMode(mode);
3524
3544
  if (state.isLeaving) {
3525
3545
  return emptyPlaceholder(child);
3526
3546
  }
@@ -3540,7 +3560,7 @@ const BaseTransitionImpl = {
3540
3560
  setTransitionHooks(innerChild, enterHooks);
3541
3561
  }
3542
3562
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3543
- 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) {
3544
3564
  let leavingHooks = resolveTransitionHooks(
3545
3565
  oldInnerChild,
3546
3566
  rawProps,
@@ -3609,15 +3629,53 @@ function findNonCommentChild(children) {
3609
3629
  }
3610
3630
  const BaseTransition = BaseTransitionImpl;
3611
3631
  function getLeavingNodesForType(state, vnode) {
3612
- const { leavingVNodes } = state;
3613
- let leavingVNodesCache = leavingVNodes.get(vnode.type);
3632
+ const { leavingNodes } = state;
3633
+ let leavingVNodesCache = leavingNodes.get(vnode.type);
3614
3634
  if (!leavingVNodesCache) {
3615
3635
  leavingVNodesCache = /* @__PURE__ */ Object.create(null);
3616
- leavingVNodes.set(vnode.type, leavingVNodesCache);
3636
+ leavingNodes.set(vnode.type, leavingVNodesCache);
3617
3637
  }
3618
3638
  return leavingVNodesCache;
3619
3639
  }
3620
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;
3621
3679
  const {
3622
3680
  appear,
3623
3681
  mode,
@@ -3635,8 +3693,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3635
3693
  onAfterAppear,
3636
3694
  onAppearCancelled
3637
3695
  } = props;
3638
- const key = String(vnode.key);
3639
- const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3640
3696
  const callHook = (hook, args) => {
3641
3697
  hook && callWithAsyncErrorHandling(
3642
3698
  hook,
@@ -3672,10 +3728,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3672
3728
  /* cancelled */
3673
3729
  );
3674
3730
  }
3675
- const leavingVNode = leavingVNodesCache[key];
3676
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3677
- leavingVNode.el[leaveCbKey]();
3678
- }
3731
+ earlyRemove();
3679
3732
  callHook(hook, [el]);
3680
3733
  },
3681
3734
  enter(el) {
@@ -3712,7 +3765,6 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3712
3765
  }
3713
3766
  },
3714
3767
  leave(el, remove) {
3715
- const key2 = String(vnode.key);
3716
3768
  if (el[enterCbKey$1]) {
3717
3769
  el[enterCbKey$1](
3718
3770
  true
@@ -3734,27 +3786,17 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3734
3786
  callHook(onAfterLeave, [el]);
3735
3787
  }
3736
3788
  el[leaveCbKey] = void 0;
3737
- if (leavingVNodesCache[key2] === vnode) {
3738
- delete leavingVNodesCache[key2];
3739
- }
3789
+ unsetLeavingNodeCache(el);
3740
3790
  };
3741
- leavingVNodesCache[key2] = vnode;
3791
+ setLeavingNodeCache(el);
3742
3792
  if (onLeave) {
3743
3793
  callAsyncHook(onLeave, [el, done]);
3744
3794
  } else {
3745
3795
  done();
3746
3796
  }
3747
3797
  },
3748
- clone(vnode2) {
3749
- const hooks2 = resolveTransitionHooks(
3750
- vnode2,
3751
- props,
3752
- state,
3753
- instance,
3754
- postClone
3755
- );
3756
- if (postClone) postClone(hooks2);
3757
- return hooks2;
3798
+ clone(node) {
3799
+ return cloneHooks(node);
3758
3800
  }
3759
3801
  };
3760
3802
  return hooks;
@@ -3788,8 +3830,15 @@ function getInnerChild$1(vnode) {
3788
3830
  }
3789
3831
  function setTransitionHooks(vnode, hooks) {
3790
3832
  if (vnode.shapeFlag & 6 && vnode.component) {
3791
- vnode.transition = hooks;
3792
- 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
+ }
3793
3842
  } else if (vnode.shapeFlag & 128) {
3794
3843
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3795
3844
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -3819,8 +3868,12 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3819
3868
  }
3820
3869
  return ret;
3821
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
+ }
3822
3876
 
3823
- /*! #__NO_SIDE_EFFECTS__ */
3824
3877
  // @__NO_SIDE_EFFECTS__
3825
3878
  function defineComponent(options, extraOptions) {
3826
3879
  return isFunction(options) ? (
@@ -3873,6 +3926,7 @@ function useTemplateRef(key) {
3873
3926
  return ret;
3874
3927
  }
3875
3928
 
3929
+ const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
3876
3930
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3877
3931
  if (isArray(rawRef)) {
3878
3932
  rawRef.forEach(
@@ -3904,28 +3958,23 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3904
3958
  const oldRef = oldRawRef && oldRawRef.r;
3905
3959
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3906
3960
  const setupState = owner.setupState;
3907
- const rawSetupState = toRaw(setupState);
3908
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3909
- {
3910
- if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
3911
- warn$1(
3912
- `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
3913
- );
3914
- }
3915
- if (knownTemplateRefs.has(rawSetupState[key])) {
3916
- return false;
3917
- }
3918
- }
3919
- return hasOwn(rawSetupState, key);
3961
+ const canSetSetupRef = createCanSetSetupRefChecker(setupState);
3962
+ const canSetRef = (ref2) => {
3963
+ return !knownTemplateRefs.has(ref2);
3920
3964
  };
3921
3965
  if (oldRef != null && oldRef !== ref) {
3966
+ invalidatePendingSetRef(oldRawRef);
3922
3967
  if (isString(oldRef)) {
3923
3968
  refs[oldRef] = null;
3924
3969
  if (canSetSetupRef(oldRef)) {
3925
3970
  setupState[oldRef] = null;
3926
3971
  }
3927
3972
  } else if (isRef(oldRef)) {
3928
- oldRef.value = null;
3973
+ if (canSetRef(oldRef)) {
3974
+ oldRef.value = null;
3975
+ }
3976
+ const oldRawRefAtom = oldRawRef;
3977
+ if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
3929
3978
  }
3930
3979
  }
3931
3980
  if (isFunction(ref)) {
@@ -3936,7 +3985,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3936
3985
  if (_isString || _isRef) {
3937
3986
  const doSet = () => {
3938
3987
  if (rawRef.f) {
3939
- 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];
3940
3989
  if (isUnmount) {
3941
3990
  isArray(existing) && remove(existing, refValue);
3942
3991
  } else {
@@ -3947,8 +3996,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3947
3996
  setupState[ref] = refs[ref];
3948
3997
  }
3949
3998
  } else {
3950
- ref.value = [refValue];
3951
- 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;
3952
4004
  }
3953
4005
  } else if (!existing.includes(refValue)) {
3954
4006
  existing.push(refValue);
@@ -3960,15 +4012,23 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3960
4012
  setupState[ref] = value;
3961
4013
  }
3962
4014
  } else if (_isRef) {
3963
- ref.value = value;
4015
+ if (canSetRef(ref)) {
4016
+ ref.value = value;
4017
+ }
3964
4018
  if (rawRef.k) refs[rawRef.k] = value;
3965
4019
  } else {
3966
4020
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
3967
4021
  }
3968
4022
  };
3969
4023
  if (value) {
3970
- queuePostRenderEffect(doSet, -1, parentSuspense);
4024
+ const job = () => {
4025
+ doSet();
4026
+ pendingSetRefMap.delete(rawRef);
4027
+ };
4028
+ pendingSetRefMap.set(rawRef, job);
4029
+ queuePostRenderEffect(job, -1, parentSuspense);
3971
4030
  } else {
4031
+ invalidatePendingSetRef(rawRef);
3972
4032
  doSet();
3973
4033
  }
3974
4034
  } else {
@@ -3976,6 +4036,29 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3976
4036
  }
3977
4037
  }
3978
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
+ }
3979
4062
 
3980
4063
  let hasLoggedMismatchError = false;
3981
4064
  const logMismatchError = () => {
@@ -4120,6 +4203,12 @@ function createHydrationFunctions(rendererInternals) {
4120
4203
  );
4121
4204
  }
4122
4205
  break;
4206
+ case VaporSlot:
4207
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(
4208
+ vnode,
4209
+ node
4210
+ );
4211
+ break;
4123
4212
  default:
4124
4213
  if (shapeFlag & 1) {
4125
4214
  if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
@@ -4135,9 +4224,6 @@ function createHydrationFunctions(rendererInternals) {
4135
4224
  );
4136
4225
  }
4137
4226
  } else if (shapeFlag & 6) {
4138
- if (vnode.type.__vapor) {
4139
- throw new Error("Vapor component hydration is not supported yet.");
4140
- }
4141
4227
  vnode.slotScopeIds = slotScopeIds;
4142
4228
  const container = parentNode(node);
4143
4229
  if (isFragmentStart) {
@@ -4147,15 +4233,25 @@ function createHydrationFunctions(rendererInternals) {
4147
4233
  } else {
4148
4234
  nextNode = nextSibling(node);
4149
4235
  }
4150
- mountComponent(
4151
- vnode,
4152
- container,
4153
- null,
4154
- parentComponent,
4155
- parentSuspense,
4156
- getContainerType(container),
4157
- optimized
4158
- );
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
+ }
4159
4255
  if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4160
4256
  let subTree;
4161
4257
  if (isFragmentStart) {
@@ -4240,7 +4336,7 @@ function createHydrationFunctions(rendererInternals) {
4240
4336
  );
4241
4337
  let hasWarned = false;
4242
4338
  while (next) {
4243
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
4339
+ if (!isMismatchAllowed(el, 1)) {
4244
4340
  if (!hasWarned) {
4245
4341
  warn$1(
4246
4342
  `Hydration children mismatch on`,
@@ -4261,14 +4357,16 @@ Server rendered element contains more child nodes than client vdom.`
4261
4357
  if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4262
4358
  clientText = clientText.slice(1);
4263
4359
  }
4264
- if (el.textContent !== clientText) {
4265
- 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)) {
4266
4364
  warn$1(
4267
4365
  `Hydration text content mismatch on`,
4268
4366
  el,
4269
4367
  `
4270
- - rendered on server: ${el.textContent}
4271
- - expected on client: ${vnode.children}`
4368
+ - rendered on server: ${textContent}
4369
+ - expected on client: ${clientText}`
4272
4370
  );
4273
4371
  logMismatchError();
4274
4372
  }
@@ -4344,7 +4442,7 @@ Server rendered element contains more child nodes than client vdom.`
4344
4442
  } else if (isText && !vnode.children) {
4345
4443
  insert(vnode.el = createText(""), container);
4346
4444
  } else {
4347
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4445
+ if (!isMismatchAllowed(container, 1)) {
4348
4446
  if (!hasWarned) {
4349
4447
  warn$1(
4350
4448
  `Hydration children mismatch on`,
@@ -4394,7 +4492,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4394
4492
  }
4395
4493
  };
4396
4494
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
4397
- if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
4495
+ if (!isMismatchAllowed(node.parentElement, 1)) {
4398
4496
  warn$1(
4399
4497
  `Hydration node mismatch:
4400
4498
  - rendered on server:`,
@@ -4467,11 +4565,11 @@ Server rendered element contains fewer child nodes than client vdom.`
4467
4565
  parent = parent.parent;
4468
4566
  }
4469
4567
  };
4470
- const isTemplateNode = (node) => {
4471
- return node.nodeType === 1 && node.tagName === "TEMPLATE";
4472
- };
4473
4568
  return [hydrate, hydrateNode];
4474
4569
  }
4570
+ const isTemplateNode = (node) => {
4571
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4572
+ };
4475
4573
  function propHasMismatch(el, key, clientValue, vnode, instance) {
4476
4574
  let mismatchType;
4477
4575
  let mismatchKey;
@@ -4486,7 +4584,7 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
4486
4584
  }
4487
4585
  expected = normalizeClass(clientValue);
4488
4586
  if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
4489
- mismatchType = 2 /* CLASS */;
4587
+ mismatchType = 2;
4490
4588
  mismatchKey = `class`;
4491
4589
  }
4492
4590
  } else if (key === "style") {
@@ -4505,31 +4603,43 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
4505
4603
  resolveCssVars(instance, vnode, expectedMap);
4506
4604
  }
4507
4605
  if (!isMapEqual(actualMap, expectedMap)) {
4508
- mismatchType = 3 /* STYLE */;
4606
+ mismatchType = 3;
4509
4607
  mismatchKey = "style";
4510
4608
  }
4511
- } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
4512
- if (isBooleanAttr(key)) {
4513
- actual = el.hasAttribute(key);
4514
- expected = includeBooleanAttr(clientValue);
4515
- } else if (clientValue == null) {
4516
- actual = el.hasAttribute(key);
4517
- expected = false;
4518
- } else {
4519
- if (el.hasAttribute(key)) {
4520
- actual = el.getAttribute(key);
4521
- } else if (key === "value" && el.tagName === "TEXTAREA") {
4522
- actual = el.value;
4523
- } else {
4524
- actual = false;
4525
- }
4526
- expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
4527
- }
4609
+ } else if (isValidHtmlOrSvgAttribute(el, key)) {
4610
+ ({ actual, expected } = getAttributeMismatch(el, key, clientValue));
4528
4611
  if (actual !== expected) {
4529
- mismatchType = 4 /* ATTRIBUTE */;
4612
+ mismatchType = 4;
4530
4613
  mismatchKey = key;
4531
4614
  }
4532
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) {
4533
4643
  if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
4534
4644
  const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
4535
4645
  const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
@@ -4601,14 +4711,14 @@ function resolveCssVars(instance, vnode, expectedMap) {
4601
4711
  }
4602
4712
  const allowMismatchAttr = "data-allow-mismatch";
4603
4713
  const MismatchTypeString = {
4604
- [0 /* TEXT */]: "text",
4605
- [1 /* CHILDREN */]: "children",
4606
- [2 /* CLASS */]: "class",
4607
- [3 /* STYLE */]: "style",
4608
- [4 /* ATTRIBUTE */]: "attribute"
4714
+ [0]: "text",
4715
+ [1]: "children",
4716
+ [2]: "class",
4717
+ [3]: "style",
4718
+ [4]: "attribute"
4609
4719
  };
4610
4720
  function isMismatchAllowed(el, allowedType) {
4611
- if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
4721
+ if (allowedType === 0 || allowedType === 1) {
4612
4722
  while (el && !el.hasAttribute(allowMismatchAttr)) {
4613
4723
  el = el.parentElement;
4614
4724
  }
@@ -4620,7 +4730,7 @@ function isMismatchAllowed(el, allowedType) {
4620
4730
  return true;
4621
4731
  } else {
4622
4732
  const list = allowedAttr.split(",");
4623
- if (allowedType === 0 /* TEXT */ && list.includes("children")) {
4733
+ if (allowedType === 0 && list.includes("children")) {
4624
4734
  return true;
4625
4735
  }
4626
4736
  return list.includes(MismatchTypeString[allowedType]);
@@ -4677,7 +4787,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
4677
4787
  hasHydrated = true;
4678
4788
  teardown();
4679
4789
  hydrate();
4680
- 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
+ }
4681
4793
  }
4682
4794
  };
4683
4795
  const teardown = () => {
@@ -4719,104 +4831,46 @@ function forEachElement(node, cb) {
4719
4831
  }
4720
4832
 
4721
4833
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4722
- /*! #__NO_SIDE_EFFECTS__ */
4723
4834
  // @__NO_SIDE_EFFECTS__
4724
4835
  function defineAsyncComponent(source) {
4725
- if (isFunction(source)) {
4726
- source = { loader: source };
4727
- }
4728
4836
  const {
4729
- loader,
4730
- loadingComponent,
4731
- errorComponent,
4732
- delay = 200,
4733
- hydrate: hydrateStrategy,
4734
- timeout,
4735
- // undefined = never times out
4736
- suspensible = true,
4737
- onError: userOnError
4738
- } = source;
4739
- let pendingRequest = null;
4740
- let resolvedComp;
4741
- let retries = 0;
4742
- const retry = () => {
4743
- retries++;
4744
- pendingRequest = null;
4745
- return load();
4746
- };
4747
- const load = () => {
4748
- let thisRequest;
4749
- return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
4750
- err = err instanceof Error ? err : new Error(String(err));
4751
- if (userOnError) {
4752
- return new Promise((resolve, reject) => {
4753
- const userRetry = () => resolve(retry());
4754
- const userFail = () => reject(err);
4755
- userOnError(err, userRetry, userFail, retries + 1);
4756
- });
4757
- } else {
4758
- throw err;
4759
- }
4760
- }).then((comp) => {
4761
- if (thisRequest !== pendingRequest && pendingRequest) {
4762
- return pendingRequest;
4763
- }
4764
- if (!comp) {
4765
- warn$1(
4766
- `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
4767
- );
4768
- }
4769
- if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
4770
- comp = comp.default;
4771
- }
4772
- if (comp && !isObject(comp) && !isFunction(comp)) {
4773
- throw new Error(`Invalid async component load result: ${comp}`);
4774
- }
4775
- resolvedComp = comp;
4776
- return comp;
4777
- }));
4778
- };
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);
4779
4849
  return defineComponent({
4780
4850
  name: "AsyncComponentWrapper",
4781
4851
  __asyncLoader: load,
4782
4852
  __asyncHydrate(el, instance, hydrate) {
4783
- let patched = false;
4784
- const doHydrate = hydrateStrategy ? () => {
4785
- const performHydrate = () => {
4786
- if (patched) {
4787
- warn$1(
4788
- `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.`
4789
- );
4790
- return;
4791
- }
4792
- hydrate();
4793
- };
4794
- const teardown = hydrateStrategy(
4795
- performHydrate,
4796
- (cb) => forEachElement(el, cb)
4797
- );
4798
- if (teardown) {
4799
- (instance.bum || (instance.bum = [])).push(teardown);
4800
- }
4801
- (instance.u || (instance.u = [])).push(() => patched = true);
4802
- } : hydrate;
4803
- if (resolvedComp) {
4804
- doHydrate();
4805
- } else {
4806
- load().then(() => !instance.isUnmounted && doHydrate());
4807
- }
4853
+ performAsyncHydrate(
4854
+ el,
4855
+ instance,
4856
+ hydrate,
4857
+ getResolvedComp,
4858
+ load,
4859
+ hydrateStrategy
4860
+ );
4808
4861
  },
4809
4862
  get __asyncResolved() {
4810
- return resolvedComp;
4863
+ return getResolvedComp();
4811
4864
  },
4812
4865
  setup() {
4813
4866
  const instance = currentInstance;
4814
4867
  markAsyncBoundary(instance);
4868
+ let resolvedComp = getResolvedComp();
4815
4869
  if (resolvedComp) {
4816
4870
  return () => createInnerComp(resolvedComp, instance);
4817
4871
  }
4818
4872
  const onError = (err) => {
4819
- pendingRequest = null;
4873
+ setPendingRequest(null);
4820
4874
  handleError(
4821
4875
  err,
4822
4876
  instance,
@@ -4834,25 +4888,11 @@ function defineAsyncComponent(source) {
4834
4888
  }) : null;
4835
4889
  });
4836
4890
  }
4837
- const loaded = ref(false);
4838
- const error = ref();
4839
- const delayed = ref(!!delay);
4840
- if (delay) {
4841
- setTimeout(() => {
4842
- delayed.value = false;
4843
- }, delay);
4844
- }
4845
- if (timeout != null) {
4846
- setTimeout(() => {
4847
- if (!loaded.value && !error.value) {
4848
- const err = new Error(
4849
- `Async component timed out after ${timeout}ms.`
4850
- );
4851
- onError(err);
4852
- error.value = err;
4853
- }
4854
- }, timeout);
4855
- }
4891
+ const { loaded, error, delayed } = useAsyncComponentState(
4892
+ delay,
4893
+ timeout,
4894
+ onError
4895
+ );
4856
4896
  load().then(() => {
4857
4897
  loaded.value = true;
4858
4898
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
@@ -4863,6 +4903,7 @@ function defineAsyncComponent(source) {
4863
4903
  error.value = err;
4864
4904
  });
4865
4905
  return () => {
4906
+ resolvedComp = getResolvedComp();
4866
4907
  if (loaded.value && resolvedComp) {
4867
4908
  return createInnerComp(resolvedComp, instance);
4868
4909
  } else if (error.value && errorComponent) {
@@ -4870,19 +4911,124 @@ function defineAsyncComponent(source) {
4870
4911
  error: error.value
4871
4912
  });
4872
4913
  } else if (loadingComponent && !delayed.value) {
4873
- return createVNode(loadingComponent);
4914
+ return createInnerComp(
4915
+ loadingComponent,
4916
+ instance
4917
+ );
4874
4918
  }
4875
4919
  };
4876
4920
  }
4877
- });
4878
- }
4879
- function createInnerComp(comp, parent) {
4880
- const { ref: ref2, props, children, ce } = parent.vnode;
4881
- const vnode = createVNode(comp, props, children);
4882
- vnode.ref = ref2;
4883
- vnode.ce = ce;
4884
- delete parent.vnode.ce;
4885
- 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
+ }
4886
5032
  }
4887
5033
 
4888
5034
  const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
@@ -4913,86 +5059,37 @@ const KeepAliveImpl = {
4913
5059
  keepAliveInstance.__v_cache = cache;
4914
5060
  }
4915
5061
  const parentSuspense = keepAliveInstance.suspense;
5062
+ const { renderer } = sharedContext;
4916
5063
  const {
4917
- renderer: {
4918
- p: patch,
4919
- m: move,
4920
- um: _unmount,
4921
- o: { createElement }
4922
- }
4923
- } = sharedContext;
5064
+ um: _unmount,
5065
+ o: { createElement }
5066
+ } = renderer;
4924
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
+ };
4925
5073
  sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4926
- const instance = vnode.component;
4927
- move(
5074
+ activate(
4928
5075
  vnode,
4929
5076
  container,
4930
5077
  anchor,
4931
- 0,
5078
+ renderer,
4932
5079
  keepAliveInstance,
4933
- parentSuspense
4934
- );
4935
- patch(
4936
- instance.vnode,
4937
- vnode,
4938
- container,
4939
- anchor,
4940
- instance,
4941
5080
  parentSuspense,
4942
5081
  namespace,
4943
- vnode.slotScopeIds,
4944
5082
  optimized
4945
5083
  );
4946
- queuePostRenderEffect(
4947
- () => {
4948
- instance.isDeactivated = false;
4949
- if (instance.a) {
4950
- invokeArrayFns(instance.a);
4951
- }
4952
- const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
4953
- if (vnodeHook) {
4954
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
4955
- }
4956
- },
4957
- void 0,
4958
- parentSuspense
4959
- );
4960
- {
4961
- devtoolsComponentAdded(instance);
4962
- }
4963
5084
  };
4964
5085
  sharedContext.deactivate = (vnode) => {
4965
- const instance = vnode.component;
4966
- invalidateMount(instance.m);
4967
- invalidateMount(instance.a);
4968
- move(
5086
+ deactivate(
4969
5087
  vnode,
4970
5088
  storageContainer,
4971
- null,
4972
- 1,
5089
+ renderer,
4973
5090
  keepAliveInstance,
4974
5091
  parentSuspense
4975
5092
  );
4976
- queuePostRenderEffect(
4977
- () => {
4978
- if (instance.da) {
4979
- invokeArrayFns(instance.da);
4980
- }
4981
- const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
4982
- if (vnodeHook) {
4983
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
4984
- }
4985
- instance.isDeactivated = true;
4986
- },
4987
- void 0,
4988
- parentSuspense
4989
- );
4990
- {
4991
- devtoolsComponentAdded(instance);
4992
- }
4993
- {
4994
- instance.__keepAliveStorageContainer = storageContainer;
4995
- }
4996
5093
  };
4997
5094
  function unmount(vnode) {
4998
5095
  resetShapeFlag(vnode);
@@ -5139,7 +5236,7 @@ function onActivated(hook, target) {
5139
5236
  function onDeactivated(hook, target) {
5140
5237
  registerKeepAliveHook(hook, "da", target);
5141
5238
  }
5142
- function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
5239
+ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance()) {
5143
5240
  const wrappedHook = hook.__wdc || (hook.__wdc = () => {
5144
5241
  let current = target;
5145
5242
  while (current) {
@@ -5153,8 +5250,9 @@ function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
5153
5250
  injectHook(type, wrappedHook, target);
5154
5251
  if (target) {
5155
5252
  let current = target.parent;
5156
- while (current && current.parent && current.parent.vnode) {
5157
- if (isKeepAlive(current.parent.vnode)) {
5253
+ while (current && current.parent) {
5254
+ let parent = current.parent;
5255
+ if (isKeepAlive(parent.vapor ? parent : parent.vnode)) {
5158
5256
  injectToKeepAliveRoot(wrappedHook, type, target, current);
5159
5257
  }
5160
5258
  current = current.parent;
@@ -5180,6 +5278,71 @@ function resetShapeFlag(vnode) {
5180
5278
  function getInnerChild(vnode) {
5181
5279
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
5182
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
+ }
5183
5346
 
5184
5347
  function injectHook(type, hook, target = currentInstance, prepend = false) {
5185
5348
  if (target) {
@@ -5368,12 +5531,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5368
5531
  return ret;
5369
5532
  }
5370
5533
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
5534
+ const hasProps = Object.keys(props).length > 0;
5371
5535
  if (name !== "default") props.name = name;
5372
5536
  return openBlock(), createBlock(
5373
5537
  Fragment,
5374
5538
  null,
5375
5539
  [createVNode("slot", props, fallback && fallback())],
5376
- 64
5540
+ hasProps ? -2 : 64
5377
5541
  );
5378
5542
  }
5379
5543
  if (slot && slot.length > 1) {
@@ -5387,6 +5551,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5387
5551
  }
5388
5552
  openBlock();
5389
5553
  const validSlotContent = slot && ensureValidVNode(slot(props));
5554
+ ensureVaporSlotFallback(validSlotContent, fallback);
5390
5555
  const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5391
5556
  // key attached in the `createSlots` helper, respect that
5392
5557
  validSlotContent && validSlotContent.key;
@@ -5416,6 +5581,14 @@ function ensureValidVNode(vnodes) {
5416
5581
  return true;
5417
5582
  }) ? vnodes : null;
5418
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
+ }
5419
5592
 
5420
5593
  function toHandlers(obj, preserveCaseIfNecessary) {
5421
5594
  const ret = {};
@@ -5578,10 +5751,10 @@ const PublicInstanceProxyHandlers = {
5578
5751
  return true;
5579
5752
  },
5580
5753
  has({
5581
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
5754
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
5582
5755
  }, key) {
5583
- let normalizedProps;
5584
- 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]);
5585
5758
  },
5586
5759
  defineProperty(target, key, descriptor) {
5587
5760
  if (descriptor.get != null) {
@@ -5719,15 +5892,15 @@ function withDefaults(props, defaults) {
5719
5892
  return null;
5720
5893
  }
5721
5894
  function useSlots() {
5722
- return getContext().slots;
5895
+ return getContext("useSlots").slots;
5723
5896
  }
5724
5897
  function useAttrs() {
5725
- return getContext().attrs;
5898
+ return getContext("useAttrs").attrs;
5726
5899
  }
5727
- function getContext() {
5900
+ function getContext(calledFunctionName) {
5728
5901
  const i = getCurrentGenericInstance();
5729
5902
  if (!i) {
5730
- warn$1(`useContext() called without active instance.`);
5903
+ warn$1(`${calledFunctionName}() called without active instance.`);
5731
5904
  }
5732
5905
  if (i.vapor) {
5733
5906
  return i;
@@ -5983,7 +6156,8 @@ function applyOptions(instance) {
5983
6156
  expose.forEach((key) => {
5984
6157
  Object.defineProperty(exposed, key, {
5985
6158
  get: () => publicThis[key],
5986
- set: (val) => publicThis[key] = val
6159
+ set: (val) => publicThis[key] = val,
6160
+ enumerable: true
5987
6161
  });
5988
6162
  });
5989
6163
  } else if (!instance.exposed) {
@@ -6856,7 +7030,7 @@ function isBoolean(...args) {
6856
7030
  return args.some((elem) => elem.toLowerCase() === "boolean");
6857
7031
  }
6858
7032
 
6859
- const isInternalKey = (key) => key[0] === "_" || key === "$stable";
7033
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
6860
7034
  const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
6861
7035
  const normalizeSlot = (key, rawSlot, ctx) => {
6862
7036
  if (rawSlot._n) {
@@ -6910,8 +7084,6 @@ const assignSlots = (slots, children, optimized) => {
6910
7084
  const initSlots = (instance, children, optimized) => {
6911
7085
  const slots = instance.slots = createInternalObject();
6912
7086
  if (instance.vnode.shapeFlag & 32) {
6913
- const cacheIndexes = children.__;
6914
- if (cacheIndexes) def(slots, "__", cacheIndexes, true);
6915
7087
  const type = children._;
6916
7088
  if (type) {
6917
7089
  assignSlots(slots, children, optimized);
@@ -6975,12 +7147,10 @@ function endMeasure(instance, type) {
6975
7147
  if (instance.appContext.config.performance && isSupported()) {
6976
7148
  const startTag = `vue-${type}-${instance.uid}`;
6977
7149
  const endTag = startTag + `:end`;
7150
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
6978
7151
  perf.mark(endTag);
6979
- perf.measure(
6980
- `<${formatComponentName(instance, instance.type)}> ${type}`,
6981
- startTag,
6982
- endTag
6983
- );
7152
+ perf.measure(measureName, startTag, endTag);
7153
+ perf.clearMeasures(measureName);
6984
7154
  perf.clearMarks(startTag);
6985
7155
  perf.clearMarks(endTag);
6986
7156
  }
@@ -7219,15 +7389,25 @@ function baseCreateRenderer(options, createHydrationFns) {
7219
7389
  optimized
7220
7390
  );
7221
7391
  } else {
7222
- patchElement(
7223
- n1,
7224
- n2,
7225
- parentComponent,
7226
- parentSuspense,
7227
- namespace,
7228
- slotScopeIds,
7229
- optimized
7230
- );
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
+ }
7231
7411
  }
7232
7412
  };
7233
7413
  const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
@@ -7278,16 +7458,20 @@ function baseCreateRenderer(options, createHydrationFns) {
7278
7458
  if (dirs) {
7279
7459
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7280
7460
  }
7281
- const needCallTransitionHooks = needTransition(parentSuspense, transition);
7282
- if (needCallTransitionHooks) {
7283
- 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);
7284
7470
  }
7285
- hostInsert(el, container, anchor);
7286
- if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
7471
+ if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
7287
7472
  queuePostRenderEffect(
7288
7473
  () => {
7289
7474
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7290
- needCallTransitionHooks && transition.enter(el);
7291
7475
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7292
7476
  },
7293
7477
  void 0,
@@ -7304,21 +7488,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7304
7488
  hostSetScopeId(el, slotScopeIds[i]);
7305
7489
  }
7306
7490
  }
7307
- let subTree = parentComponent && parentComponent.subTree;
7308
- if (subTree) {
7309
- if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
7310
- subTree = filterSingleRoot(subTree.children) || subTree;
7311
- }
7312
- if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
7313
- const parentVNode = parentComponent.vnode;
7314
- setScopeId(
7315
- el,
7316
- parentVNode,
7317
- parentVNode.scopeId,
7318
- parentVNode.slotScopeIds,
7319
- parentComponent.parent
7320
- );
7321
- }
7491
+ const inheritedScopeIds = getInheritedScopeIds(vnode, parentComponent);
7492
+ for (let i = 0; i < inheritedScopeIds.length; i++) {
7493
+ hostSetScopeId(el, inheritedScopeIds[i]);
7322
7494
  }
7323
7495
  };
7324
7496
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
@@ -7559,12 +7731,21 @@ function baseCreateRenderer(options, createHydrationFns) {
7559
7731
  n2.slotScopeIds = slotScopeIds;
7560
7732
  if (n2.type.__vapor) {
7561
7733
  if (n1 == null) {
7562
- getVaporInterface(parentComponent, n2).mount(
7563
- n2,
7564
- container,
7565
- anchor,
7566
- parentComponent
7567
- );
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
+ }
7568
7749
  } else {
7569
7750
  getVaporInterface(parentComponent, n2).update(
7570
7751
  n1,
@@ -7627,6 +7808,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7627
7808
  if (!initialVNode.el) {
7628
7809
  const placeholder = instance.subTree = createVNode(Comment);
7629
7810
  processCommentNode(null, placeholder, container, anchor);
7811
+ initialVNode.placeholder = placeholder.el;
7630
7812
  }
7631
7813
  } else {
7632
7814
  setupRenderEffect(
@@ -8167,7 +8349,11 @@ function baseCreateRenderer(options, createHydrationFns) {
8167
8349
  for (i = toBePatched - 1; i >= 0; i--) {
8168
8350
  const nextIndex = s2 + i;
8169
8351
  const nextChild = c2[nextIndex];
8170
- 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;
8171
8357
  if (newIndexToOldIndexMap[i] === 0) {
8172
8358
  patch(
8173
8359
  null,
@@ -8247,12 +8433,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8247
8433
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
8248
8434
  if (needTransition2) {
8249
8435
  if (moveType === 0) {
8250
- transition.beforeEnter(el);
8251
- hostInsert(el, container, anchor);
8252
- queuePostRenderEffect(
8253
- () => transition.enter(el),
8254
- void 0,
8255
- parentSuspense
8436
+ performTransitionEnter(
8437
+ el,
8438
+ transition,
8439
+ () => hostInsert(el, container, anchor),
8440
+ parentSuspense,
8441
+ true
8256
8442
  );
8257
8443
  } else {
8258
8444
  const { leave, delayLeave, afterLeave } = transition;
@@ -8264,6 +8450,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8264
8450
  }
8265
8451
  };
8266
8452
  const performLeave = () => {
8453
+ if (el._isLeaving) {
8454
+ el[leaveCbKey](
8455
+ true
8456
+ /* cancelled */
8457
+ );
8458
+ }
8267
8459
  leave(el, () => {
8268
8460
  remove2();
8269
8461
  afterLeave && afterLeave();
@@ -8303,7 +8495,14 @@ function baseCreateRenderer(options, createHydrationFns) {
8303
8495
  parentComponent.renderCache[cacheIndex] = void 0;
8304
8496
  }
8305
8497
  if (shapeFlag & 256) {
8306
- 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
+ }
8307
8506
  return;
8308
8507
  }
8309
8508
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -8391,22 +8590,15 @@ function baseCreateRenderer(options, createHydrationFns) {
8391
8590
  removeStaticNode(vnode);
8392
8591
  return;
8393
8592
  }
8394
- const performRemove = () => {
8395
- hostRemove(el);
8396
- if (transition && !transition.persisted && transition.afterLeave) {
8397
- transition.afterLeave();
8398
- }
8399
- };
8400
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
8401
- const { leave, delayLeave } = transition;
8402
- const performLeave = () => leave(el, performRemove);
8403
- if (delayLeave) {
8404
- delayLeave(vnode.el, performRemove, performLeave);
8405
- } else {
8406
- performLeave();
8407
- }
8593
+ if (transition) {
8594
+ performTransitionLeave(
8595
+ el,
8596
+ transition,
8597
+ () => hostRemove(el),
8598
+ !!(vnode.shapeFlag & 1)
8599
+ );
8408
8600
  } else {
8409
- performRemove();
8601
+ hostRemove(el);
8410
8602
  }
8411
8603
  };
8412
8604
  const removeFragment = (cur, end) => {
@@ -8422,27 +8614,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8422
8614
  if (instance.type.__hmrId) {
8423
8615
  unregisterHMR(instance);
8424
8616
  }
8425
- const {
8426
- bum,
8427
- scope,
8428
- effect,
8429
- subTree,
8430
- um,
8431
- m,
8432
- a,
8433
- parent,
8434
- slots: { __: slotCacheKeys }
8435
- } = instance;
8617
+ const { bum, scope, effect, subTree, um, m, a } = instance;
8436
8618
  invalidateMount(m);
8437
8619
  invalidateMount(a);
8438
8620
  if (bum) {
8439
8621
  invokeArrayFns(bum);
8440
8622
  }
8441
- if (parent && isArray(slotCacheKeys)) {
8442
- slotCacheKeys.forEach((v) => {
8443
- parent.renderCache[v] = void 0;
8444
- });
8445
- }
8446
8623
  scope.stop();
8447
8624
  if (effect) {
8448
8625
  effect.stop();
@@ -8456,12 +8633,6 @@ function baseCreateRenderer(options, createHydrationFns) {
8456
8633
  void 0,
8457
8634
  parentSuspense
8458
8635
  );
8459
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
8460
- parentSuspense.deps--;
8461
- if (parentSuspense.deps === 0) {
8462
- parentSuspense.resolve();
8463
- }
8464
- }
8465
8636
  {
8466
8637
  devtoolsComponentRemoved(instance);
8467
8638
  }
@@ -8474,7 +8645,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8474
8645
  const getNextHostNode = (vnode) => {
8475
8646
  if (vnode.shapeFlag & 6) {
8476
8647
  if (vnode.type.__vapor) {
8477
- return hostNextSibling(vnode.component.block);
8648
+ return hostNextSibling(vnode.anchor);
8478
8649
  }
8479
8650
  return getNextHostNode(vnode.component.subTree);
8480
8651
  }
@@ -8552,6 +8723,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8552
8723
  return {
8553
8724
  render,
8554
8725
  hydrate,
8726
+ hydrateNode,
8555
8727
  internals,
8556
8728
  createApp: createAppAPI(
8557
8729
  mountApp,
@@ -8591,7 +8763,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8591
8763
  if (!shallow && c2.patchFlag !== -2)
8592
8764
  traverseStaticChildren(c1, c2);
8593
8765
  }
8594
- if (c2.type === Text) {
8766
+ if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
8767
+ c2.patchFlag !== -1) {
8595
8768
  c2.el = c1.el;
8596
8769
  }
8597
8770
  if (c2.type === Comment && !c2.el) {
@@ -8604,7 +8777,7 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8604
8777
  }
8605
8778
  }
8606
8779
  function locateNonHydratedAsyncRoot(instance) {
8607
- const subComponent = instance.vapor ? null : instance.subTree.component;
8780
+ const subComponent = instance.subTree && instance.subTree.component;
8608
8781
  if (subComponent) {
8609
8782
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
8610
8783
  return subComponent;
@@ -8619,6 +8792,34 @@ function invalidateMount(hooks) {
8619
8792
  hooks[i].flags |= 4;
8620
8793
  }
8621
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
+ }
8622
8823
  function getVaporInterface(instance, vnode) {
8623
8824
  const ctx = instance ? instance.appContext : vnode.appContext;
8624
8825
  const res = ctx && ctx.vapor;
@@ -8633,6 +8834,32 @@ app.use(vaporInteropPlugin)
8633
8834
  }
8634
8835
  return res;
8635
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
+ }
8636
8863
 
8637
8864
  const ssrContextKey = Symbol.for("v-scx");
8638
8865
  const useSSRContext = () => {
@@ -8972,8 +9199,9 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
8972
9199
  function defaultPropGetter(props, key) {
8973
9200
  return props[key];
8974
9201
  }
9202
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
8975
9203
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
8976
- const cache = appContext.emitsCache;
9204
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
8977
9205
  const cached = cache.get(comp);
8978
9206
  if (cached !== void 0) {
8979
9207
  return cached;
@@ -9421,7 +9649,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9421
9649
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
9422
9650
  if (pendingBranch) {
9423
9651
  suspense.pendingBranch = newBranch;
9424
- if (isSameVNodeType(newBranch, pendingBranch)) {
9652
+ if (isSameVNodeType(pendingBranch, newBranch)) {
9425
9653
  patch(
9426
9654
  pendingBranch,
9427
9655
  newBranch,
@@ -9492,7 +9720,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9492
9720
  );
9493
9721
  setActiveBranch(suspense, newFallback);
9494
9722
  }
9495
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
9723
+ } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
9496
9724
  patch(
9497
9725
  activeBranch,
9498
9726
  newBranch,
@@ -9523,7 +9751,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9523
9751
  }
9524
9752
  }
9525
9753
  } else {
9526
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
9754
+ if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
9527
9755
  patch(
9528
9756
  activeBranch,
9529
9757
  newBranch,
@@ -9636,7 +9864,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9636
9864
  pendingId,
9637
9865
  effects,
9638
9866
  parentComponent: parentComponent2,
9639
- container: container2
9867
+ container: container2,
9868
+ isInFallback
9640
9869
  } = suspense;
9641
9870
  let delayEnter = false;
9642
9871
  if (suspense.isHydrating) {
@@ -9654,6 +9883,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9654
9883
  parentComponent2
9655
9884
  );
9656
9885
  queuePostFlushCb(effects);
9886
+ if (isInFallback && vnode2.ssFallback) {
9887
+ vnode2.ssFallback.el = null;
9888
+ }
9657
9889
  }
9658
9890
  };
9659
9891
  }
@@ -9662,6 +9894,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9662
9894
  anchor = next(activeBranch);
9663
9895
  }
9664
9896
  unmount(activeBranch, parentComponent2, suspense, true);
9897
+ if (!delayEnter && isInFallback && vnode2.ssFallback) {
9898
+ vnode2.ssFallback.el = null;
9899
+ }
9665
9900
  }
9666
9901
  if (!delayEnter) {
9667
9902
  move(
@@ -9786,6 +10021,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9786
10021
  optimized2
9787
10022
  );
9788
10023
  if (placeholder) {
10024
+ vnode2.placeholder = null;
9789
10025
  remove(placeholder);
9790
10026
  }
9791
10027
  updateHOCHostEl(instance, vnode2.el);
@@ -9991,15 +10227,11 @@ const createVNodeWithArgsTransform = (...args) => {
9991
10227
  );
9992
10228
  };
9993
10229
  const normalizeKey = ({ key }) => key != null ? key : null;
9994
- const normalizeRef = ({
9995
- ref,
9996
- ref_key,
9997
- ref_for
9998
- }) => {
10230
+ const normalizeRef = ({ ref, ref_key, ref_for }, i = currentRenderingInstance) => {
9999
10231
  if (typeof ref === "number") {
10000
10232
  ref = "" + ref;
10001
10233
  }
10002
- 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;
10003
10235
  };
10004
10236
  function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
10005
10237
  const vnode = {
@@ -10165,6 +10397,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
10165
10397
  suspense: vnode.suspense,
10166
10398
  ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
10167
10399
  ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
10400
+ placeholder: vnode.placeholder,
10168
10401
  el: vnode.el,
10169
10402
  anchor: vnode.anchor,
10170
10403
  ctx: vnode.ctx,
@@ -10691,7 +10924,7 @@ function getComponentPublicInstance(instance) {
10691
10924
  return instance.proxy;
10692
10925
  }
10693
10926
  }
10694
- const classifyRE = /(?:^|[-_])(\w)/g;
10927
+ const classifyRE = /(?:^|[-_])\w/g;
10695
10928
  const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
10696
10929
  function getComponentName(Component, includeInferred = true) {
10697
10930
  return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
@@ -10727,23 +10960,28 @@ const computed = (getterOrOptions, debugOptions) => {
10727
10960
  };
10728
10961
 
10729
10962
  function h(type, propsOrChildren, children) {
10730
- const l = arguments.length;
10731
- if (l === 2) {
10732
- if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10733
- if (isVNode(propsOrChildren)) {
10734
- 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);
10735
10974
  }
10736
- return createVNode(type, propsOrChildren);
10737
10975
  } else {
10738
- return createVNode(type, null, propsOrChildren);
10739
- }
10740
- } else {
10741
- if (l > 3) {
10742
- children = Array.prototype.slice.call(arguments, 2);
10743
- } else if (l === 3 && isVNode(children)) {
10744
- 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);
10745
10982
  }
10746
- return createVNode(type, propsOrChildren, children);
10983
+ } finally {
10984
+ setBlockTracking(1);
10747
10985
  }
10748
10986
  }
10749
10987
 
@@ -10953,7 +11191,7 @@ function isMemoSame(cached, memo) {
10953
11191
  return true;
10954
11192
  }
10955
11193
 
10956
- const version = "3.6.0-alpha.2";
11194
+ const version = "3.6.0-alpha.3";
10957
11195
  const warn = warn$1 ;
10958
11196
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10959
11197
  const devtools = devtools$1 ;
@@ -11182,11 +11420,11 @@ function resolveTransitionProps(rawProps) {
11182
11420
  const resolve = () => finishLeave(el, done);
11183
11421
  addTransitionClass(el, leaveFromClass);
11184
11422
  if (!el._enterCancelled) {
11185
- forceReflow();
11423
+ forceReflow(el);
11186
11424
  addTransitionClass(el, leaveActiveClass);
11187
11425
  } else {
11188
11426
  addTransitionClass(el, leaveActiveClass);
11189
- forceReflow();
11427
+ forceReflow(el);
11190
11428
  }
11191
11429
  nextFrame(() => {
11192
11430
  if (!el._isLeaving) {
@@ -11312,7 +11550,7 @@ function getTransitionInfo(el, expectedType) {
11312
11550
  type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
11313
11551
  propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
11314
11552
  }
11315
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
11553
+ const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
11316
11554
  getStyleProperties(`${TRANSITION}Property`).toString()
11317
11555
  );
11318
11556
  return {
@@ -11332,8 +11570,9 @@ function toMs(s) {
11332
11570
  if (s === "auto") return 0;
11333
11571
  return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
11334
11572
  }
11335
- function forceReflow() {
11336
- return document.body.offsetHeight;
11573
+ function forceReflow(el) {
11574
+ const targetDocument = el ? el.ownerDocument : document;
11575
+ return targetDocument.body.offsetHeight;
11337
11576
  }
11338
11577
 
11339
11578
  function patchClass(el, value, isSVG) {
@@ -11353,6 +11592,8 @@ function patchClass(el, value, isSVG) {
11353
11592
  const vShowOriginalDisplay = Symbol("_vod");
11354
11593
  const vShowHidden = Symbol("_vsh");
11355
11594
  const vShow = {
11595
+ // used for prop mismatch check during hydration
11596
+ name: "show",
11356
11597
  beforeMount(el, { value }, { transition }) {
11357
11598
  el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
11358
11599
  if (transition && value) {
@@ -11386,9 +11627,6 @@ const vShow = {
11386
11627
  setDisplay(el, value);
11387
11628
  }
11388
11629
  };
11389
- {
11390
- vShow.name = "show";
11391
- }
11392
11630
  function setDisplay(el, value) {
11393
11631
  el.style.display = value ? el[vShowOriginalDisplay] : "none";
11394
11632
  el[vShowHidden] = !value;
@@ -11474,7 +11712,7 @@ function setVarsOnNode(el, vars) {
11474
11712
  }
11475
11713
  }
11476
11714
 
11477
- const displayRE = /(^|;)\s*display\s*:/;
11715
+ const displayRE = /(?:^|;)\s*display\s*:/;
11478
11716
  function patchStyle(el, prev, next) {
11479
11717
  const style = el.style;
11480
11718
  const isCssString = isString(next);
@@ -11779,11 +12017,10 @@ function shouldSetAsProp(el, key, value, isSVG) {
11779
12017
  }
11780
12018
 
11781
12019
  const REMOVAL = {};
11782
- /*! #__NO_SIDE_EFFECTS__ */
11783
12020
  // @__NO_SIDE_EFFECTS__
11784
12021
  function defineCustomElement(options, extraOptions, _createApp) {
11785
- const Comp = defineComponent(options, extraOptions);
11786
- if (isPlainObject(Comp)) extend(Comp, extraOptions);
12022
+ let Comp = defineComponent(options, extraOptions);
12023
+ if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
11787
12024
  class VueCustomElement extends VueElement {
11788
12025
  constructor(initialProps) {
11789
12026
  super(Comp, initialProps, _createApp);
@@ -11792,10 +12029,9 @@ function defineCustomElement(options, extraOptions, _createApp) {
11792
12029
  VueCustomElement.def = Comp;
11793
12030
  return VueCustomElement;
11794
12031
  }
11795
- /*! #__NO_SIDE_EFFECTS__ */
11796
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
12032
+ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
11797
12033
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
11798
- };
12034
+ });
11799
12035
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11800
12036
  };
11801
12037
  class VueElement extends BaseClass {
@@ -11819,6 +12055,8 @@ class VueElement extends BaseClass {
11819
12055
  this._nonce = this._def.nonce;
11820
12056
  this._connected = false;
11821
12057
  this._resolved = false;
12058
+ this._patching = false;
12059
+ this._dirty = false;
11822
12060
  this._numberProps = null;
11823
12061
  this._styleChildren = /* @__PURE__ */ new WeakSet();
11824
12062
  this._ob = null;
@@ -11831,7 +12069,11 @@ class VueElement extends BaseClass {
11831
12069
  );
11832
12070
  }
11833
12071
  if (_def.shadowRoot !== false) {
11834
- this.attachShadow({ mode: "open" });
12072
+ this.attachShadow(
12073
+ extend({}, _def.shadowRootOptions, {
12074
+ mode: "open"
12075
+ })
12076
+ );
11835
12077
  this._root = this.shadowRoot;
11836
12078
  } else {
11837
12079
  this._root = this;
@@ -11891,9 +12133,18 @@ class VueElement extends BaseClass {
11891
12133
  this._app && this._app.unmount();
11892
12134
  if (this._instance) this._instance.ce = void 0;
11893
12135
  this._app = this._instance = null;
12136
+ if (this._teleportTargets) {
12137
+ this._teleportTargets.clear();
12138
+ this._teleportTargets = void 0;
12139
+ }
11894
12140
  }
11895
12141
  });
11896
12142
  }
12143
+ _processMutations(mutations) {
12144
+ for (const m of mutations) {
12145
+ this._setAttr(m.attributeName);
12146
+ }
12147
+ }
11897
12148
  /**
11898
12149
  * resolve inner component definition (handle possible async component)
11899
12150
  */
@@ -11904,11 +12155,7 @@ class VueElement extends BaseClass {
11904
12155
  for (let i = 0; i < this.attributes.length; i++) {
11905
12156
  this._setAttr(this.attributes[i].name);
11906
12157
  }
11907
- this._ob = new MutationObserver((mutations) => {
11908
- for (const m of mutations) {
11909
- this._setAttr(m.attributeName);
11910
- }
11911
- });
12158
+ this._ob = new MutationObserver(this._processMutations.bind(this));
11912
12159
  this._ob.observe(this, { attributes: true });
11913
12160
  const resolve = (def, isAsync = false) => {
11914
12161
  this._resolved = true;
@@ -11985,7 +12232,7 @@ class VueElement extends BaseClass {
11985
12232
  return this._getProp(key);
11986
12233
  },
11987
12234
  set(val) {
11988
- this._setProp(key, val, true, true);
12235
+ this._setProp(key, val, true, !this._patching);
11989
12236
  }
11990
12237
  });
11991
12238
  }
@@ -12011,6 +12258,7 @@ class VueElement extends BaseClass {
12011
12258
  */
12012
12259
  _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
12013
12260
  if (val !== this._props[key]) {
12261
+ this._dirty = true;
12014
12262
  if (val === REMOVAL) {
12015
12263
  delete this._props[key];
12016
12264
  } else {
@@ -12024,7 +12272,10 @@ class VueElement extends BaseClass {
12024
12272
  }
12025
12273
  if (shouldReflect) {
12026
12274
  const ob = this._ob;
12027
- ob && ob.disconnect();
12275
+ if (ob) {
12276
+ this._processMutations(ob.takeRecords());
12277
+ ob.disconnect();
12278
+ }
12028
12279
  if (val === true) {
12029
12280
  this.setAttribute(hyphenate(key), "");
12030
12281
  } else if (typeof val === "string" || typeof val === "number") {
@@ -12128,7 +12379,7 @@ class VueElement extends BaseClass {
12128
12379
  * Only called when shadowRoot is false
12129
12380
  */
12130
12381
  _renderSlots() {
12131
- const outlets = (this._teleportTarget || this).querySelectorAll("slot");
12382
+ const outlets = this._getSlots();
12132
12383
  const scopeId = this._instance.type.__scopeId;
12133
12384
  for (let i = 0; i < outlets.length; i++) {
12134
12385
  const o = outlets[i];
@@ -12154,12 +12405,45 @@ class VueElement extends BaseClass {
12154
12405
  parent.removeChild(o);
12155
12406
  }
12156
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
+ }
12157
12425
  /**
12158
12426
  * @internal
12159
12427
  */
12160
12428
  _injectChildStyle(comp) {
12161
12429
  this._applyStyles(comp.styles, comp);
12162
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
+ }
12163
12447
  /**
12164
12448
  * @internal
12165
12449
  */
@@ -12252,26 +12536,13 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
12252
12536
  prevChildren = [];
12253
12537
  return;
12254
12538
  }
12255
- prevChildren.forEach(callPendingCbs);
12539
+ prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
12256
12540
  prevChildren.forEach(recordPosition);
12257
12541
  const movedChildren = prevChildren.filter(applyTranslation);
12258
- forceReflow();
12542
+ forceReflow(instance.vnode.el);
12259
12543
  movedChildren.forEach((c) => {
12260
12544
  const el = c.el;
12261
- const style = el.style;
12262
- addTransitionClass(el, moveClass);
12263
- style.transform = style.webkitTransform = style.transitionDuration = "";
12264
- const cb = el[moveCbKey] = (e) => {
12265
- if (e && e.target !== el) {
12266
- return;
12267
- }
12268
- if (!e || /transform$/.test(e.propertyName)) {
12269
- el.removeEventListener("transitionend", cb);
12270
- el[moveCbKey] = null;
12271
- removeTransitionClass(el, moveClass);
12272
- }
12273
- };
12274
- el.addEventListener("transitionend", cb);
12545
+ handleMovedChildren(el, moveClass);
12275
12546
  });
12276
12547
  prevChildren = [];
12277
12548
  });
@@ -12294,10 +12565,10 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
12294
12565
  instance
12295
12566
  )
12296
12567
  );
12297
- positionMap.set(
12298
- child,
12299
- child.el.getBoundingClientRect()
12300
- );
12568
+ positionMap.set(child, {
12569
+ left: child.el.offsetLeft,
12570
+ top: child.el.offsetTop
12571
+ });
12301
12572
  }
12302
12573
  }
12303
12574
  }
@@ -12318,8 +12589,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
12318
12589
  }
12319
12590
  });
12320
12591
  const TransitionGroup = TransitionGroupImpl;
12321
- function callPendingCbs(c) {
12322
- const el = c.el;
12592
+ function callPendingCbs(el) {
12323
12593
  if (el[moveCbKey]) {
12324
12594
  el[moveCbKey]();
12325
12595
  }
@@ -12328,19 +12598,30 @@ function callPendingCbs(c) {
12328
12598
  }
12329
12599
  }
12330
12600
  function recordPosition(c) {
12331
- newPositionMap.set(c, c.el.getBoundingClientRect());
12601
+ newPositionMap.set(c, {
12602
+ left: c.el.offsetLeft,
12603
+ top: c.el.offsetTop
12604
+ });
12332
12605
  }
12333
12606
  function applyTranslation(c) {
12334
- const oldPos = positionMap.get(c);
12335
- 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) {
12336
12616
  const dx = oldPos.left - newPos.left;
12337
12617
  const dy = oldPos.top - newPos.top;
12338
12618
  if (dx || dy) {
12339
- const s = c.el.style;
12619
+ const s = el.style;
12340
12620
  s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
12341
12621
  s.transitionDuration = "0s";
12342
- return c;
12622
+ return true;
12343
12623
  }
12624
+ return false;
12344
12625
  }
12345
12626
  function hasCSSTransform(el, root, moveClass) {
12346
12627
  const clone = el.cloneNode();
@@ -12358,6 +12639,22 @@ function hasCSSTransform(el, root, moveClass) {
12358
12639
  container.removeChild(clone);
12359
12640
  return hasTransform;
12360
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
+ };
12361
12658
 
12362
12659
  const getModelAssigner = (vnode) => {
12363
12660
  const fn = vnode.props["onUpdate:modelValue"] || false;
@@ -12393,21 +12690,21 @@ const vModelText = {
12393
12690
  vModelTextUpdate(el, oldValue, value, trim, number, lazy);
12394
12691
  }
12395
12692
  };
12693
+ function castValue(value, trim, number) {
12694
+ if (trim) value = value.trim();
12695
+ if (number) value = looseToNumber(value);
12696
+ return value;
12697
+ }
12396
12698
  const vModelTextInit = (el, trim, number, lazy, set) => {
12397
12699
  addEventListener(el, lazy ? "change" : "input", (e) => {
12398
12700
  if (e.target.composing) return;
12399
- let domValue = el.value;
12400
- if (trim) {
12401
- domValue = domValue.trim();
12402
- }
12403
- if (number || el.type === "number") {
12404
- domValue = looseToNumber(domValue);
12405
- }
12406
- (0, el[assignKey])(domValue);
12701
+ (0, el[assignKey])(
12702
+ castValue(el.value, trim, number || el.type === "number")
12703
+ );
12407
12704
  });
12408
- if (trim) {
12705
+ if (trim || number) {
12409
12706
  addEventListener(el, "change", () => {
12410
- el.value = el.value.trim();
12707
+ el.value = castValue(el.value, trim, number || el.type === "number");
12411
12708
  });
12412
12709
  }
12413
12710
  if (!lazy) {
@@ -12690,13 +12987,13 @@ const modifierGuards = {
12690
12987
  const withModifiers = (fn, modifiers) => {
12691
12988
  const cache = fn._withMods || (fn._withMods = {});
12692
12989
  const cacheKey = modifiers.join(".");
12693
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
12990
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
12694
12991
  for (let i = 0; i < modifiers.length; i++) {
12695
12992
  const guard = modifierGuards[modifiers[i]];
12696
12993
  if (guard && guard(event, modifiers)) return;
12697
12994
  }
12698
12995
  return fn(event, ...args);
12699
- });
12996
+ }));
12700
12997
  };
12701
12998
  const keyNames = {
12702
12999
  esc: "escape",
@@ -12710,7 +13007,7 @@ const keyNames = {
12710
13007
  const withKeys = (fn, modifiers) => {
12711
13008
  const cache = fn._withKeys || (fn._withKeys = {});
12712
13009
  const cacheKey = modifiers.join(".");
12713
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
13010
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
12714
13011
  if (!("key" in event)) {
12715
13012
  return;
12716
13013
  }
@@ -12720,7 +13017,7 @@ const withKeys = (fn, modifiers) => {
12720
13017
  )) {
12721
13018
  return fn(event);
12722
13019
  }
12723
- });
13020
+ }));
12724
13021
  };
12725
13022
 
12726
13023
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -12734,13 +13031,13 @@ function ensureHydrationRenderer() {
12734
13031
  enabledHydration = true;
12735
13032
  return renderer;
12736
13033
  }
12737
- const render = (...args) => {
13034
+ const render = ((...args) => {
12738
13035
  ensureRenderer().render(...args);
12739
- };
12740
- const hydrate = (...args) => {
13036
+ });
13037
+ const hydrate = ((...args) => {
12741
13038
  ensureHydrationRenderer().hydrate(...args);
12742
- };
12743
- const createApp = (...args) => {
13039
+ });
13040
+ const createApp = ((...args) => {
12744
13041
  const app = ensureRenderer().createApp(...args);
12745
13042
  {
12746
13043
  injectNativeTagCheck(app);
@@ -12765,8 +13062,8 @@ const createApp = (...args) => {
12765
13062
  return proxy;
12766
13063
  };
12767
13064
  return app;
12768
- };
12769
- const createSSRApp = (...args) => {
13065
+ });
13066
+ const createSSRApp = ((...args) => {
12770
13067
  const app = ensureHydrationRenderer().createApp(...args);
12771
13068
  {
12772
13069
  injectNativeTagCheck(app);
@@ -12780,7 +13077,7 @@ const createSSRApp = (...args) => {
12780
13077
  }
12781
13078
  };
12782
13079
  return app;
12783
- };
13080
+ });
12784
13081
  function resolveRootNamespace(container) {
12785
13082
  if (container instanceof SVGElement) {
12786
13083
  return "svg";