@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,12 +1,11 @@
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
6
  var VueRuntimeDOM = (function (exports) {
7
7
  'use strict';
8
8
 
9
- /*! #__NO_SIDE_EFFECTS__ */
10
9
  // @__NO_SIDE_EFFECTS__
11
10
  function makeMap(str) {
12
11
  const map = /* @__PURE__ */ Object.create(null);
@@ -62,10 +61,10 @@ var VueRuntimeDOM = (function (exports) {
62
61
  );
63
62
  const cacheStringFunction = (fn) => {
64
63
  const cache = /* @__PURE__ */ Object.create(null);
65
- return (str) => {
64
+ return ((str) => {
66
65
  const hit = cache[str];
67
66
  return hit || (cache[str] = fn(str));
68
- };
67
+ });
69
68
  };
70
69
  const camelizeRE = /-(\w)/g;
71
70
  const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
@@ -238,6 +237,9 @@ var VueRuntimeDOM = (function (exports) {
238
237
  if ((key === "width" || key === "height") && (tagName === "IMG" || tagName === "VIDEO" || tagName === "CANVAS" || tagName === "SOURCE")) {
239
238
  return true;
240
239
  }
240
+ if (key === "sandbox" && tagName === "IFRAME") {
241
+ return true;
242
+ }
241
243
  return false;
242
244
  }
243
245
 
@@ -427,6 +429,7 @@ var VueRuntimeDOM = (function (exports) {
427
429
  const notifyBuffer = [];
428
430
  let batchDepth = 0;
429
431
  let activeSub = void 0;
432
+ let globalVersion = 0;
430
433
  let notifyIndex = 0;
431
434
  let notifyBufferLength = 0;
432
435
  function setActiveSub(sub) {
@@ -449,20 +452,18 @@ var VueRuntimeDOM = (function (exports) {
449
452
  if (prevDep !== void 0 && prevDep.dep === dep) {
450
453
  return;
451
454
  }
452
- let nextDep = void 0;
453
- const recursedCheck = sub.flags & 4 /* RecursedCheck */;
454
- if (recursedCheck) {
455
- nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;
456
- if (nextDep !== void 0 && nextDep.dep === dep) {
457
- sub.depsTail = nextDep;
458
- return;
459
- }
455
+ const nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;
456
+ if (nextDep !== void 0 && nextDep.dep === dep) {
457
+ nextDep.version = globalVersion;
458
+ sub.depsTail = nextDep;
459
+ return;
460
460
  }
461
461
  const prevSub = dep.subsTail;
462
- if (prevSub !== void 0 && prevSub.sub === sub && (!recursedCheck || isValidLink(prevSub, sub))) {
462
+ if (prevSub !== void 0 && prevSub.version === globalVersion && prevSub.sub === sub) {
463
463
  return;
464
464
  }
465
465
  const newLink = sub.depsTail = dep.subsTail = {
466
+ version: globalVersion,
466
467
  dep,
467
468
  sub,
468
469
  prevDep,
@@ -568,6 +569,7 @@ var VueRuntimeDOM = (function (exports) {
568
569
  } while (true);
569
570
  }
570
571
  function startTracking(sub) {
572
+ ++globalVersion;
571
573
  sub.depsTail = void 0;
572
574
  sub.flags = sub.flags & -57 | 4 /* RecursedCheck */;
573
575
  return setActiveSub(sub);
@@ -668,18 +670,12 @@ var VueRuntimeDOM = (function (exports) {
668
670
  } while (link2 !== void 0);
669
671
  }
670
672
  function isValidLink(checkLink, sub) {
671
- const depsTail = sub.depsTail;
672
- if (depsTail !== void 0) {
673
- let link2 = sub.deps;
674
- do {
675
- if (link2 === checkLink) {
676
- return true;
677
- }
678
- if (link2 === depsTail) {
679
- break;
680
- }
681
- link2 = link2.nextDep;
682
- } while (link2 !== void 0);
673
+ let link2 = sub.depsTail;
674
+ while (link2 !== void 0) {
675
+ if (link2 === checkLink) {
676
+ return true;
677
+ }
678
+ link2 = link2.prevDep;
683
679
  }
684
680
  return false;
685
681
  }
@@ -919,7 +915,7 @@ var VueRuntimeDOM = (function (exports) {
919
915
  join(separator) {
920
916
  return reactiveReadArray(this).join(separator);
921
917
  },
922
- // keys() iterator only reads `length`, no optimisation required
918
+ // keys() iterator only reads `length`, no optimization required
923
919
  lastIndexOf(...args) {
924
920
  return searchProxy(this, "lastIndexOf", args);
925
921
  },
@@ -971,7 +967,7 @@ var VueRuntimeDOM = (function (exports) {
971
967
  iter._next = iter.next;
972
968
  iter.next = () => {
973
969
  const result = iter._next();
974
- if (result.value) {
970
+ if (!result.done) {
975
971
  result.value = wrapValue(result.value);
976
972
  }
977
973
  return result;
@@ -1102,7 +1098,8 @@ var VueRuntimeDOM = (function (exports) {
1102
1098
  return res;
1103
1099
  }
1104
1100
  if (isRef(res)) {
1105
- return targetIsArray && isIntegerKey(key) ? res : res.value;
1101
+ const value = targetIsArray && isIntegerKey(key) ? res : res.value;
1102
+ return isReadonly2 && isObject(value) ? readonly(value) : value;
1106
1103
  }
1107
1104
  if (isObject(res)) {
1108
1105
  return isReadonly2 ? readonly(res) : reactive(res);
@@ -1124,7 +1121,13 @@ var VueRuntimeDOM = (function (exports) {
1124
1121
  }
1125
1122
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
1126
1123
  if (isOldValueReadonly) {
1127
- return false;
1124
+ {
1125
+ warn$2(
1126
+ `Set operation on key "${String(key)}" failed: target is readonly.`,
1127
+ target[key]
1128
+ );
1129
+ }
1130
+ return true;
1128
1131
  } else {
1129
1132
  oldValue.value = value;
1130
1133
  return true;
@@ -1269,7 +1272,7 @@ var VueRuntimeDOM = (function (exports) {
1269
1272
  get size() {
1270
1273
  const target = this["__v_raw"];
1271
1274
  !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1272
- return Reflect.get(target, "size", target);
1275
+ return target.size;
1273
1276
  },
1274
1277
  has(key) {
1275
1278
  const target = this["__v_raw"];
@@ -1935,14 +1938,12 @@ var VueRuntimeDOM = (function (exports) {
1935
1938
  }
1936
1939
  }
1937
1940
  run(fn) {
1938
- const prevSub = setActiveSub();
1939
1941
  const prevScope = activeEffectScope;
1940
1942
  try {
1941
1943
  activeEffectScope = this;
1942
1944
  return fn();
1943
1945
  } finally {
1944
1946
  activeEffectScope = prevScope;
1945
- setActiveSub(prevSub);
1946
1947
  }
1947
1948
  }
1948
1949
  stop() {
@@ -2274,11 +2275,11 @@ var VueRuntimeDOM = (function (exports) {
2274
2275
  if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
2275
2276
  return value;
2276
2277
  }
2277
- seen = seen || /* @__PURE__ */ new Set();
2278
- if (seen.has(value)) {
2278
+ seen = seen || /* @__PURE__ */ new Map();
2279
+ if ((seen.get(value) || 0) >= depth) {
2279
2280
  return value;
2280
2281
  }
2281
- seen.add(value);
2282
+ seen.set(value, depth);
2282
2283
  depth--;
2283
2284
  if (isRef(value)) {
2284
2285
  traverse(value.value, depth, seen);
@@ -2824,8 +2825,10 @@ var VueRuntimeDOM = (function (exports) {
2824
2825
  instance.hmrRerender();
2825
2826
  } else {
2826
2827
  const i = instance;
2827
- i.renderCache = [];
2828
- i.effect.run();
2828
+ if (!(i.effect.flags & 1024)) {
2829
+ i.renderCache = [];
2830
+ i.effect.run();
2831
+ }
2829
2832
  }
2830
2833
  nextTick(() => {
2831
2834
  isHmrUpdating = false;
@@ -2838,7 +2841,7 @@ var VueRuntimeDOM = (function (exports) {
2838
2841
  newComp = normalizeClassComponent(newComp);
2839
2842
  updateComponentDef(record.initialDef, newComp);
2840
2843
  const instances = [...record.instances];
2841
- if (newComp.vapor) {
2844
+ if (newComp.__vapor) {
2842
2845
  for (const instance of instances) {
2843
2846
  instance.hmrReload(newComp);
2844
2847
  }
@@ -2867,7 +2870,10 @@ var VueRuntimeDOM = (function (exports) {
2867
2870
  if (parent.vapor) {
2868
2871
  parent.hmrRerender();
2869
2872
  } else {
2870
- parent.effect.run();
2873
+ if (!(parent.effect.flags & 1024)) {
2874
+ parent.renderCache = [];
2875
+ parent.effect.run();
2876
+ }
2871
2877
  }
2872
2878
  nextTick(() => {
2873
2879
  isHmrUpdating = false;
@@ -2977,7 +2983,6 @@ var VueRuntimeDOM = (function (exports) {
2977
2983
  _devtoolsComponentRemoved(component);
2978
2984
  }
2979
2985
  };
2980
- /*! #__NO_SIDE_EFFECTS__ */
2981
2986
  // @__NO_SIDE_EFFECTS__
2982
2987
  function createDevtoolsComponentHook(hook) {
2983
2988
  return (component) => {
@@ -3163,9 +3168,6 @@ var VueRuntimeDOM = (function (exports) {
3163
3168
  insert(mainAnchor, container, anchor);
3164
3169
  const mount = (container2, anchor2) => {
3165
3170
  if (shapeFlag & 16) {
3166
- if (parentComponent && parentComponent.isCE) {
3167
- parentComponent.ce._teleportTarget = container2;
3168
- }
3169
3171
  mountChildren(
3170
3172
  children,
3171
3173
  container2,
@@ -3187,6 +3189,9 @@ var VueRuntimeDOM = (function (exports) {
3187
3189
  } else if (namespace !== "mathml" && isTargetMathML(target)) {
3188
3190
  namespace = "mathml";
3189
3191
  }
3192
+ if (parentComponent && parentComponent.isCE) {
3193
+ (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3194
+ }
3190
3195
  if (!disabled) {
3191
3196
  mount(target, targetAnchor);
3192
3197
  updateCssVars(n2, false);
@@ -3387,26 +3392,34 @@ var VueRuntimeDOM = (function (exports) {
3387
3392
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
3388
3393
  o: { nextSibling, parentNode, querySelector, insert, createText }
3389
3394
  }, hydrateChildren) {
3395
+ function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
3396
+ vnode2.anchor = hydrateChildren(
3397
+ nextSibling(node2),
3398
+ vnode2,
3399
+ parentNode(node2),
3400
+ parentComponent,
3401
+ parentSuspense,
3402
+ slotScopeIds,
3403
+ optimized
3404
+ );
3405
+ vnode2.targetStart = targetStart;
3406
+ vnode2.targetAnchor = targetAnchor;
3407
+ }
3390
3408
  const target = vnode.target = resolveTarget(
3391
3409
  vnode.props,
3392
3410
  querySelector
3393
3411
  );
3412
+ const disabled = isTeleportDisabled(vnode.props);
3394
3413
  if (target) {
3395
- const disabled = isTeleportDisabled(vnode.props);
3396
3414
  const targetNode = target._lpa || target.firstChild;
3397
3415
  if (vnode.shapeFlag & 16) {
3398
3416
  if (disabled) {
3399
- vnode.anchor = hydrateChildren(
3400
- nextSibling(node),
3417
+ hydrateDisabledTeleport(
3418
+ node,
3401
3419
  vnode,
3402
- parentNode(node),
3403
- parentComponent,
3404
- parentSuspense,
3405
- slotScopeIds,
3406
- optimized
3420
+ targetNode,
3421
+ targetNode && nextSibling(targetNode)
3407
3422
  );
3408
- vnode.targetStart = targetNode;
3409
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
3410
3423
  } else {
3411
3424
  vnode.anchor = nextSibling(node);
3412
3425
  let targetAnchor = targetNode;
@@ -3437,6 +3450,10 @@ var VueRuntimeDOM = (function (exports) {
3437
3450
  }
3438
3451
  }
3439
3452
  updateCssVars(vnode, disabled);
3453
+ } else if (disabled) {
3454
+ if (vnode.shapeFlag & 16) {
3455
+ hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
3456
+ }
3440
3457
  }
3441
3458
  return vnode.anchor && nextSibling(vnode.anchor);
3442
3459
  }
@@ -3477,7 +3494,7 @@ var VueRuntimeDOM = (function (exports) {
3477
3494
  isMounted: false,
3478
3495
  isLeaving: false,
3479
3496
  isUnmounting: false,
3480
- leavingVNodes: /* @__PURE__ */ new Map()
3497
+ leavingNodes: /* @__PURE__ */ new Map()
3481
3498
  };
3482
3499
  onMounted(() => {
3483
3500
  state.isMounted = true;
@@ -3509,7 +3526,7 @@ var VueRuntimeDOM = (function (exports) {
3509
3526
  onAppearCancelled: TransitionHookValidator
3510
3527
  };
3511
3528
  const recursiveGetSubtree = (instance) => {
3512
- const subTree = instance.subTree;
3529
+ const subTree = instance.type.__vapor ? instance.block : instance.subTree;
3513
3530
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
3514
3531
  };
3515
3532
  const BaseTransitionImpl = {
@@ -3526,9 +3543,7 @@ var VueRuntimeDOM = (function (exports) {
3526
3543
  const child = findNonCommentChild(children);
3527
3544
  const rawProps = toRaw(props);
3528
3545
  const { mode } = rawProps;
3529
- if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
3530
- warn$1(`invalid <transition> mode: ${mode}`);
3531
- }
3546
+ checkTransitionMode(mode);
3532
3547
  if (state.isLeaving) {
3533
3548
  return emptyPlaceholder(child);
3534
3549
  }
@@ -3548,7 +3563,7 @@ var VueRuntimeDOM = (function (exports) {
3548
3563
  setTransitionHooks(innerChild, enterHooks);
3549
3564
  }
3550
3565
  let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3551
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3566
+ if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3552
3567
  let leavingHooks = resolveTransitionHooks(
3553
3568
  oldInnerChild,
3554
3569
  rawProps,
@@ -3617,15 +3632,53 @@ var VueRuntimeDOM = (function (exports) {
3617
3632
  }
3618
3633
  const BaseTransition = BaseTransitionImpl;
3619
3634
  function getLeavingNodesForType(state, vnode) {
3620
- const { leavingVNodes } = state;
3621
- let leavingVNodesCache = leavingVNodes.get(vnode.type);
3635
+ const { leavingNodes } = state;
3636
+ let leavingVNodesCache = leavingNodes.get(vnode.type);
3622
3637
  if (!leavingVNodesCache) {
3623
3638
  leavingVNodesCache = /* @__PURE__ */ Object.create(null);
3624
- leavingVNodes.set(vnode.type, leavingVNodesCache);
3639
+ leavingNodes.set(vnode.type, leavingVNodesCache);
3625
3640
  }
3626
3641
  return leavingVNodesCache;
3627
3642
  }
3628
3643
  function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3644
+ const key = String(vnode.key);
3645
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3646
+ const context = {
3647
+ setLeavingNodeCache: () => {
3648
+ leavingVNodesCache[key] = vnode;
3649
+ },
3650
+ unsetLeavingNodeCache: () => {
3651
+ if (leavingVNodesCache[key] === vnode) {
3652
+ delete leavingVNodesCache[key];
3653
+ }
3654
+ },
3655
+ earlyRemove: () => {
3656
+ const leavingVNode = leavingVNodesCache[key];
3657
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3658
+ leavingVNode.el[leaveCbKey]();
3659
+ }
3660
+ },
3661
+ cloneHooks: (vnode2) => {
3662
+ const hooks = resolveTransitionHooks(
3663
+ vnode2,
3664
+ props,
3665
+ state,
3666
+ instance,
3667
+ postClone
3668
+ );
3669
+ if (postClone) postClone(hooks);
3670
+ return hooks;
3671
+ }
3672
+ };
3673
+ return baseResolveTransitionHooks(context, props, state, instance);
3674
+ }
3675
+ function baseResolveTransitionHooks(context, props, state, instance) {
3676
+ const {
3677
+ setLeavingNodeCache,
3678
+ unsetLeavingNodeCache,
3679
+ earlyRemove,
3680
+ cloneHooks
3681
+ } = context;
3629
3682
  const {
3630
3683
  appear,
3631
3684
  mode,
@@ -3643,8 +3696,6 @@ var VueRuntimeDOM = (function (exports) {
3643
3696
  onAfterAppear,
3644
3697
  onAppearCancelled
3645
3698
  } = props;
3646
- const key = String(vnode.key);
3647
- const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3648
3699
  const callHook = (hook, args) => {
3649
3700
  hook && callWithAsyncErrorHandling(
3650
3701
  hook,
@@ -3680,10 +3731,7 @@ var VueRuntimeDOM = (function (exports) {
3680
3731
  /* cancelled */
3681
3732
  );
3682
3733
  }
3683
- const leavingVNode = leavingVNodesCache[key];
3684
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3685
- leavingVNode.el[leaveCbKey]();
3686
- }
3734
+ earlyRemove();
3687
3735
  callHook(hook, [el]);
3688
3736
  },
3689
3737
  enter(el) {
@@ -3720,7 +3768,6 @@ var VueRuntimeDOM = (function (exports) {
3720
3768
  }
3721
3769
  },
3722
3770
  leave(el, remove) {
3723
- const key2 = String(vnode.key);
3724
3771
  if (el[enterCbKey$1]) {
3725
3772
  el[enterCbKey$1](
3726
3773
  true
@@ -3742,27 +3789,17 @@ var VueRuntimeDOM = (function (exports) {
3742
3789
  callHook(onAfterLeave, [el]);
3743
3790
  }
3744
3791
  el[leaveCbKey] = void 0;
3745
- if (leavingVNodesCache[key2] === vnode) {
3746
- delete leavingVNodesCache[key2];
3747
- }
3792
+ unsetLeavingNodeCache(el);
3748
3793
  };
3749
- leavingVNodesCache[key2] = vnode;
3794
+ setLeavingNodeCache(el);
3750
3795
  if (onLeave) {
3751
3796
  callAsyncHook(onLeave, [el, done]);
3752
3797
  } else {
3753
3798
  done();
3754
3799
  }
3755
3800
  },
3756
- clone(vnode2) {
3757
- const hooks2 = resolveTransitionHooks(
3758
- vnode2,
3759
- props,
3760
- state,
3761
- instance,
3762
- postClone
3763
- );
3764
- if (postClone) postClone(hooks2);
3765
- return hooks2;
3801
+ clone(node) {
3802
+ return cloneHooks(node);
3766
3803
  }
3767
3804
  };
3768
3805
  return hooks;
@@ -3796,8 +3833,15 @@ var VueRuntimeDOM = (function (exports) {
3796
3833
  }
3797
3834
  function setTransitionHooks(vnode, hooks) {
3798
3835
  if (vnode.shapeFlag & 6 && vnode.component) {
3799
- vnode.transition = hooks;
3800
- setTransitionHooks(vnode.component.subTree, hooks);
3836
+ if (vnode.type.__vapor) {
3837
+ getVaporInterface(vnode.component, vnode).setTransitionHooks(
3838
+ vnode.component,
3839
+ hooks
3840
+ );
3841
+ } else {
3842
+ vnode.transition = hooks;
3843
+ setTransitionHooks(vnode.component.subTree, hooks);
3844
+ }
3801
3845
  } else if (vnode.shapeFlag & 128) {
3802
3846
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3803
3847
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -3827,8 +3871,12 @@ var VueRuntimeDOM = (function (exports) {
3827
3871
  }
3828
3872
  return ret;
3829
3873
  }
3874
+ function checkTransitionMode(mode) {
3875
+ if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
3876
+ warn$1(`invalid <transition> mode: ${mode}`);
3877
+ }
3878
+ }
3830
3879
 
3831
- /*! #__NO_SIDE_EFFECTS__ */
3832
3880
  // @__NO_SIDE_EFFECTS__
3833
3881
  function defineComponent(options, extraOptions) {
3834
3882
  return isFunction(options) ? (
@@ -3881,6 +3929,7 @@ var VueRuntimeDOM = (function (exports) {
3881
3929
  return ret;
3882
3930
  }
3883
3931
 
3932
+ const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
3884
3933
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3885
3934
  if (isArray(rawRef)) {
3886
3935
  rawRef.forEach(
@@ -3912,28 +3961,23 @@ var VueRuntimeDOM = (function (exports) {
3912
3961
  const oldRef = oldRawRef && oldRawRef.r;
3913
3962
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3914
3963
  const setupState = owner.setupState;
3915
- const rawSetupState = toRaw(setupState);
3916
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3917
- {
3918
- if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
3919
- warn$1(
3920
- `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
3921
- );
3922
- }
3923
- if (knownTemplateRefs.has(rawSetupState[key])) {
3924
- return false;
3925
- }
3926
- }
3927
- return hasOwn(rawSetupState, key);
3964
+ const canSetSetupRef = createCanSetSetupRefChecker(setupState);
3965
+ const canSetRef = (ref2) => {
3966
+ return !knownTemplateRefs.has(ref2);
3928
3967
  };
3929
3968
  if (oldRef != null && oldRef !== ref) {
3969
+ invalidatePendingSetRef(oldRawRef);
3930
3970
  if (isString(oldRef)) {
3931
3971
  refs[oldRef] = null;
3932
3972
  if (canSetSetupRef(oldRef)) {
3933
3973
  setupState[oldRef] = null;
3934
3974
  }
3935
3975
  } else if (isRef(oldRef)) {
3936
- oldRef.value = null;
3976
+ if (canSetRef(oldRef)) {
3977
+ oldRef.value = null;
3978
+ }
3979
+ const oldRawRefAtom = oldRawRef;
3980
+ if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
3937
3981
  }
3938
3982
  }
3939
3983
  if (isFunction(ref)) {
@@ -3944,7 +3988,7 @@ var VueRuntimeDOM = (function (exports) {
3944
3988
  if (_isString || _isRef) {
3945
3989
  const doSet = () => {
3946
3990
  if (rawRef.f) {
3947
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
3991
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
3948
3992
  if (isUnmount) {
3949
3993
  isArray(existing) && remove(existing, refValue);
3950
3994
  } else {
@@ -3955,8 +3999,11 @@ var VueRuntimeDOM = (function (exports) {
3955
3999
  setupState[ref] = refs[ref];
3956
4000
  }
3957
4001
  } else {
3958
- ref.value = [refValue];
3959
- if (rawRef.k) refs[rawRef.k] = ref.value;
4002
+ const newVal = [refValue];
4003
+ if (canSetRef(ref)) {
4004
+ ref.value = newVal;
4005
+ }
4006
+ if (rawRef.k) refs[rawRef.k] = newVal;
3960
4007
  }
3961
4008
  } else if (!existing.includes(refValue)) {
3962
4009
  existing.push(refValue);
@@ -3968,15 +4015,23 @@ var VueRuntimeDOM = (function (exports) {
3968
4015
  setupState[ref] = value;
3969
4016
  }
3970
4017
  } else if (_isRef) {
3971
- ref.value = value;
4018
+ if (canSetRef(ref)) {
4019
+ ref.value = value;
4020
+ }
3972
4021
  if (rawRef.k) refs[rawRef.k] = value;
3973
4022
  } else {
3974
4023
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
3975
4024
  }
3976
4025
  };
3977
4026
  if (value) {
3978
- queuePostRenderEffect(doSet, -1, parentSuspense);
4027
+ const job = () => {
4028
+ doSet();
4029
+ pendingSetRefMap.delete(rawRef);
4030
+ };
4031
+ pendingSetRefMap.set(rawRef, job);
4032
+ queuePostRenderEffect(job, -1, parentSuspense);
3979
4033
  } else {
4034
+ invalidatePendingSetRef(rawRef);
3980
4035
  doSet();
3981
4036
  }
3982
4037
  } else {
@@ -3984,6 +4039,29 @@ var VueRuntimeDOM = (function (exports) {
3984
4039
  }
3985
4040
  }
3986
4041
  }
4042
+ function createCanSetSetupRefChecker(setupState) {
4043
+ const rawSetupState = toRaw(setupState);
4044
+ return setupState === void 0 || setupState === EMPTY_OBJ ? NO : (key) => {
4045
+ {
4046
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4047
+ warn$1(
4048
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
4049
+ );
4050
+ }
4051
+ if (knownTemplateRefs.has(rawSetupState[key])) {
4052
+ return false;
4053
+ }
4054
+ }
4055
+ return hasOwn(rawSetupState, key);
4056
+ };
4057
+ }
4058
+ function invalidatePendingSetRef(rawRef) {
4059
+ const pendingSetRef = pendingSetRefMap.get(rawRef);
4060
+ if (pendingSetRef) {
4061
+ pendingSetRef.flags |= 4;
4062
+ pendingSetRefMap.delete(rawRef);
4063
+ }
4064
+ }
3987
4065
 
3988
4066
  let hasLoggedMismatchError = false;
3989
4067
  const logMismatchError = () => {
@@ -4128,6 +4206,12 @@ var VueRuntimeDOM = (function (exports) {
4128
4206
  );
4129
4207
  }
4130
4208
  break;
4209
+ case VaporSlot:
4210
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(
4211
+ vnode,
4212
+ node
4213
+ );
4214
+ break;
4131
4215
  default:
4132
4216
  if (shapeFlag & 1) {
4133
4217
  if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
@@ -4143,9 +4227,6 @@ var VueRuntimeDOM = (function (exports) {
4143
4227
  );
4144
4228
  }
4145
4229
  } else if (shapeFlag & 6) {
4146
- if (vnode.type.__vapor) {
4147
- throw new Error("Vapor component hydration is not supported yet.");
4148
- }
4149
4230
  vnode.slotScopeIds = slotScopeIds;
4150
4231
  const container = parentNode(node);
4151
4232
  if (isFragmentStart) {
@@ -4155,15 +4236,25 @@ var VueRuntimeDOM = (function (exports) {
4155
4236
  } else {
4156
4237
  nextNode = nextSibling(node);
4157
4238
  }
4158
- mountComponent(
4159
- vnode,
4160
- container,
4161
- null,
4162
- parentComponent,
4163
- parentSuspense,
4164
- getContainerType(container),
4165
- optimized
4166
- );
4239
+ if (vnode.type.__vapor) {
4240
+ getVaporInterface(parentComponent, vnode).hydrate(
4241
+ vnode,
4242
+ node,
4243
+ container,
4244
+ null,
4245
+ parentComponent
4246
+ );
4247
+ } else {
4248
+ mountComponent(
4249
+ vnode,
4250
+ container,
4251
+ null,
4252
+ parentComponent,
4253
+ parentSuspense,
4254
+ getContainerType(container),
4255
+ optimized
4256
+ );
4257
+ }
4167
4258
  if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4168
4259
  let subTree;
4169
4260
  if (isFragmentStart) {
@@ -4248,7 +4339,7 @@ var VueRuntimeDOM = (function (exports) {
4248
4339
  );
4249
4340
  let hasWarned = false;
4250
4341
  while (next) {
4251
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
4342
+ if (!isMismatchAllowed(el, 1)) {
4252
4343
  if (!hasWarned) {
4253
4344
  warn$1(
4254
4345
  `Hydration children mismatch on`,
@@ -4269,14 +4360,16 @@ Server rendered element contains more child nodes than client vdom.`
4269
4360
  if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4270
4361
  clientText = clientText.slice(1);
4271
4362
  }
4272
- if (el.textContent !== clientText) {
4273
- if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4363
+ const { textContent } = el;
4364
+ if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
4365
+ textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
4366
+ if (!isMismatchAllowed(el, 0)) {
4274
4367
  warn$1(
4275
4368
  `Hydration text content mismatch on`,
4276
4369
  el,
4277
4370
  `
4278
- - rendered on server: ${el.textContent}
4279
- - expected on client: ${vnode.children}`
4371
+ - rendered on server: ${textContent}
4372
+ - expected on client: ${clientText}`
4280
4373
  );
4281
4374
  logMismatchError();
4282
4375
  }
@@ -4352,7 +4445,7 @@ Server rendered element contains more child nodes than client vdom.`
4352
4445
  } else if (isText && !vnode.children) {
4353
4446
  insert(vnode.el = createText(""), container);
4354
4447
  } else {
4355
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
4448
+ if (!isMismatchAllowed(container, 1)) {
4356
4449
  if (!hasWarned) {
4357
4450
  warn$1(
4358
4451
  `Hydration children mismatch on`,
@@ -4402,7 +4495,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4402
4495
  }
4403
4496
  };
4404
4497
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
4405
- if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
4498
+ if (!isMismatchAllowed(node.parentElement, 1)) {
4406
4499
  warn$1(
4407
4500
  `Hydration node mismatch:
4408
4501
  - rendered on server:`,
@@ -4475,11 +4568,11 @@ Server rendered element contains fewer child nodes than client vdom.`
4475
4568
  parent = parent.parent;
4476
4569
  }
4477
4570
  };
4478
- const isTemplateNode = (node) => {
4479
- return node.nodeType === 1 && node.tagName === "TEMPLATE";
4480
- };
4481
4571
  return [hydrate, hydrateNode];
4482
4572
  }
4573
+ const isTemplateNode = (node) => {
4574
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4575
+ };
4483
4576
  function propHasMismatch(el, key, clientValue, vnode, instance) {
4484
4577
  let mismatchType;
4485
4578
  let mismatchKey;
@@ -4494,7 +4587,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4494
4587
  }
4495
4588
  expected = normalizeClass(clientValue);
4496
4589
  if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
4497
- mismatchType = 2 /* CLASS */;
4590
+ mismatchType = 2;
4498
4591
  mismatchKey = `class`;
4499
4592
  }
4500
4593
  } else if (key === "style") {
@@ -4513,31 +4606,43 @@ Server rendered element contains fewer child nodes than client vdom.`
4513
4606
  resolveCssVars(instance, vnode, expectedMap);
4514
4607
  }
4515
4608
  if (!isMapEqual(actualMap, expectedMap)) {
4516
- mismatchType = 3 /* STYLE */;
4609
+ mismatchType = 3;
4517
4610
  mismatchKey = "style";
4518
4611
  }
4519
- } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
4520
- if (isBooleanAttr(key)) {
4521
- actual = el.hasAttribute(key);
4522
- expected = includeBooleanAttr(clientValue);
4523
- } else if (clientValue == null) {
4524
- actual = el.hasAttribute(key);
4525
- expected = false;
4526
- } else {
4527
- if (el.hasAttribute(key)) {
4528
- actual = el.getAttribute(key);
4529
- } else if (key === "value" && el.tagName === "TEXTAREA") {
4530
- actual = el.value;
4531
- } else {
4532
- actual = false;
4533
- }
4534
- expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
4535
- }
4612
+ } else if (isValidHtmlOrSvgAttribute(el, key)) {
4613
+ ({ actual, expected } = getAttributeMismatch(el, key, clientValue));
4536
4614
  if (actual !== expected) {
4537
- mismatchType = 4 /* ATTRIBUTE */;
4615
+ mismatchType = 4;
4538
4616
  mismatchKey = key;
4539
4617
  }
4540
4618
  }
4619
+ return warnPropMismatch(el, mismatchKey, mismatchType, actual, expected);
4620
+ }
4621
+ function getAttributeMismatch(el, key, clientValue) {
4622
+ let actual;
4623
+ let expected;
4624
+ if (isBooleanAttr(key)) {
4625
+ actual = el.hasAttribute(key);
4626
+ expected = includeBooleanAttr(clientValue);
4627
+ } else if (clientValue == null) {
4628
+ actual = el.hasAttribute(key);
4629
+ expected = false;
4630
+ } else {
4631
+ if (el.hasAttribute(key)) {
4632
+ actual = el.getAttribute(key);
4633
+ } else if (key === "value" && el.tagName === "TEXTAREA") {
4634
+ actual = el.value;
4635
+ } else {
4636
+ actual = false;
4637
+ }
4638
+ expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
4639
+ }
4640
+ return { actual, expected };
4641
+ }
4642
+ function isValidHtmlOrSvgAttribute(el, key) {
4643
+ return el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key));
4644
+ }
4645
+ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
4541
4646
  if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
4542
4647
  const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
4543
4648
  const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
@@ -4609,14 +4714,14 @@ Server rendered element contains fewer child nodes than client vdom.`
4609
4714
  }
4610
4715
  const allowMismatchAttr = "data-allow-mismatch";
4611
4716
  const MismatchTypeString = {
4612
- [0 /* TEXT */]: "text",
4613
- [1 /* CHILDREN */]: "children",
4614
- [2 /* CLASS */]: "class",
4615
- [3 /* STYLE */]: "style",
4616
- [4 /* ATTRIBUTE */]: "attribute"
4717
+ [0]: "text",
4718
+ [1]: "children",
4719
+ [2]: "class",
4720
+ [3]: "style",
4721
+ [4]: "attribute"
4617
4722
  };
4618
4723
  function isMismatchAllowed(el, allowedType) {
4619
- if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
4724
+ if (allowedType === 0 || allowedType === 1) {
4620
4725
  while (el && !el.hasAttribute(allowMismatchAttr)) {
4621
4726
  el = el.parentElement;
4622
4727
  }
@@ -4628,7 +4733,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4628
4733
  return true;
4629
4734
  } else {
4630
4735
  const list = allowedAttr.split(",");
4631
- if (allowedType === 0 /* TEXT */ && list.includes("children")) {
4736
+ if (allowedType === 0 && list.includes("children")) {
4632
4737
  return true;
4633
4738
  }
4634
4739
  return list.includes(MismatchTypeString[allowedType]);
@@ -4685,7 +4790,9 @@ Server rendered element contains fewer child nodes than client vdom.`
4685
4790
  hasHydrated = true;
4686
4791
  teardown();
4687
4792
  hydrate();
4688
- e.target.dispatchEvent(new e.constructor(e.type, e));
4793
+ if (!(`$evt${e.type}` in e.target)) {
4794
+ e.target.dispatchEvent(new e.constructor(e.type, e));
4795
+ }
4689
4796
  }
4690
4797
  };
4691
4798
  const teardown = () => {
@@ -4727,104 +4834,46 @@ Server rendered element contains fewer child nodes than client vdom.`
4727
4834
  }
4728
4835
 
4729
4836
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4730
- /*! #__NO_SIDE_EFFECTS__ */
4731
4837
  // @__NO_SIDE_EFFECTS__
4732
4838
  function defineAsyncComponent(source) {
4733
- if (isFunction(source)) {
4734
- source = { loader: source };
4735
- }
4736
4839
  const {
4737
- loader,
4738
- loadingComponent,
4739
- errorComponent,
4740
- delay = 200,
4741
- hydrate: hydrateStrategy,
4742
- timeout,
4743
- // undefined = never times out
4744
- suspensible = true,
4745
- onError: userOnError
4746
- } = source;
4747
- let pendingRequest = null;
4748
- let resolvedComp;
4749
- let retries = 0;
4750
- const retry = () => {
4751
- retries++;
4752
- pendingRequest = null;
4753
- return load();
4754
- };
4755
- const load = () => {
4756
- let thisRequest;
4757
- return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
4758
- err = err instanceof Error ? err : new Error(String(err));
4759
- if (userOnError) {
4760
- return new Promise((resolve, reject) => {
4761
- const userRetry = () => resolve(retry());
4762
- const userFail = () => reject(err);
4763
- userOnError(err, userRetry, userFail, retries + 1);
4764
- });
4765
- } else {
4766
- throw err;
4767
- }
4768
- }).then((comp) => {
4769
- if (thisRequest !== pendingRequest && pendingRequest) {
4770
- return pendingRequest;
4771
- }
4772
- if (!comp) {
4773
- warn$1(
4774
- `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
4775
- );
4776
- }
4777
- if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
4778
- comp = comp.default;
4779
- }
4780
- if (comp && !isObject(comp) && !isFunction(comp)) {
4781
- throw new Error(`Invalid async component load result: ${comp}`);
4782
- }
4783
- resolvedComp = comp;
4784
- return comp;
4785
- }));
4786
- };
4840
+ load,
4841
+ getResolvedComp,
4842
+ setPendingRequest,
4843
+ source: {
4844
+ loadingComponent,
4845
+ errorComponent,
4846
+ delay,
4847
+ hydrate: hydrateStrategy,
4848
+ timeout,
4849
+ suspensible = true
4850
+ }
4851
+ } = createAsyncComponentContext(source);
4787
4852
  return defineComponent({
4788
4853
  name: "AsyncComponentWrapper",
4789
4854
  __asyncLoader: load,
4790
4855
  __asyncHydrate(el, instance, hydrate) {
4791
- let patched = false;
4792
- const doHydrate = hydrateStrategy ? () => {
4793
- const performHydrate = () => {
4794
- if (patched) {
4795
- warn$1(
4796
- `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.`
4797
- );
4798
- return;
4799
- }
4800
- hydrate();
4801
- };
4802
- const teardown = hydrateStrategy(
4803
- performHydrate,
4804
- (cb) => forEachElement(el, cb)
4805
- );
4806
- if (teardown) {
4807
- (instance.bum || (instance.bum = [])).push(teardown);
4808
- }
4809
- (instance.u || (instance.u = [])).push(() => patched = true);
4810
- } : hydrate;
4811
- if (resolvedComp) {
4812
- doHydrate();
4813
- } else {
4814
- load().then(() => !instance.isUnmounted && doHydrate());
4815
- }
4856
+ performAsyncHydrate(
4857
+ el,
4858
+ instance,
4859
+ hydrate,
4860
+ getResolvedComp,
4861
+ load,
4862
+ hydrateStrategy
4863
+ );
4816
4864
  },
4817
4865
  get __asyncResolved() {
4818
- return resolvedComp;
4866
+ return getResolvedComp();
4819
4867
  },
4820
4868
  setup() {
4821
4869
  const instance = currentInstance;
4822
4870
  markAsyncBoundary(instance);
4871
+ let resolvedComp = getResolvedComp();
4823
4872
  if (resolvedComp) {
4824
4873
  return () => createInnerComp(resolvedComp, instance);
4825
4874
  }
4826
4875
  const onError = (err) => {
4827
- pendingRequest = null;
4876
+ setPendingRequest(null);
4828
4877
  handleError(
4829
4878
  err,
4830
4879
  instance,
@@ -4842,25 +4891,11 @@ Server rendered element contains fewer child nodes than client vdom.`
4842
4891
  }) : null;
4843
4892
  });
4844
4893
  }
4845
- const loaded = ref(false);
4846
- const error = ref();
4847
- const delayed = ref(!!delay);
4848
- if (delay) {
4849
- setTimeout(() => {
4850
- delayed.value = false;
4851
- }, delay);
4852
- }
4853
- if (timeout != null) {
4854
- setTimeout(() => {
4855
- if (!loaded.value && !error.value) {
4856
- const err = new Error(
4857
- `Async component timed out after ${timeout}ms.`
4858
- );
4859
- onError(err);
4860
- error.value = err;
4861
- }
4862
- }, timeout);
4863
- }
4894
+ const { loaded, error, delayed } = useAsyncComponentState(
4895
+ delay,
4896
+ timeout,
4897
+ onError
4898
+ );
4864
4899
  load().then(() => {
4865
4900
  loaded.value = true;
4866
4901
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
@@ -4871,6 +4906,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4871
4906
  error.value = err;
4872
4907
  });
4873
4908
  return () => {
4909
+ resolvedComp = getResolvedComp();
4874
4910
  if (loaded.value && resolvedComp) {
4875
4911
  return createInnerComp(resolvedComp, instance);
4876
4912
  } else if (error.value && errorComponent) {
@@ -4878,19 +4914,124 @@ Server rendered element contains fewer child nodes than client vdom.`
4878
4914
  error: error.value
4879
4915
  });
4880
4916
  } else if (loadingComponent && !delayed.value) {
4881
- return createVNode(loadingComponent);
4917
+ return createInnerComp(
4918
+ loadingComponent,
4919
+ instance
4920
+ );
4882
4921
  }
4883
4922
  };
4884
4923
  }
4885
- });
4886
- }
4887
- function createInnerComp(comp, parent) {
4888
- const { ref: ref2, props, children, ce } = parent.vnode;
4889
- const vnode = createVNode(comp, props, children);
4890
- vnode.ref = ref2;
4891
- vnode.ce = ce;
4892
- delete parent.vnode.ce;
4893
- return vnode;
4924
+ });
4925
+ }
4926
+ function createInnerComp(comp, parent) {
4927
+ const { ref: ref2, props, children, ce } = parent.vnode;
4928
+ const vnode = createVNode(comp, props, children);
4929
+ vnode.ref = ref2;
4930
+ vnode.ce = ce;
4931
+ delete parent.vnode.ce;
4932
+ return vnode;
4933
+ }
4934
+ function createAsyncComponentContext(source) {
4935
+ if (isFunction(source)) {
4936
+ source = { loader: source };
4937
+ }
4938
+ const { loader, onError: userOnError } = source;
4939
+ let pendingRequest = null;
4940
+ let resolvedComp;
4941
+ let retries = 0;
4942
+ const retry = () => {
4943
+ retries++;
4944
+ pendingRequest = null;
4945
+ return load();
4946
+ };
4947
+ const load = () => {
4948
+ let thisRequest;
4949
+ return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
4950
+ err = err instanceof Error ? err : new Error(String(err));
4951
+ if (userOnError) {
4952
+ return new Promise((resolve, reject) => {
4953
+ const userRetry = () => resolve(retry());
4954
+ const userFail = () => reject(err);
4955
+ userOnError(err, userRetry, userFail, retries + 1);
4956
+ });
4957
+ } else {
4958
+ throw err;
4959
+ }
4960
+ }).then((comp) => {
4961
+ if (thisRequest !== pendingRequest && pendingRequest) {
4962
+ return pendingRequest;
4963
+ }
4964
+ if (!comp) {
4965
+ warn$1(
4966
+ `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
4967
+ );
4968
+ }
4969
+ if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
4970
+ comp = comp.default;
4971
+ }
4972
+ if (comp && !isObject(comp) && !isFunction(comp)) {
4973
+ throw new Error(`Invalid async component load result: ${comp}`);
4974
+ }
4975
+ resolvedComp = comp;
4976
+ return comp;
4977
+ }));
4978
+ };
4979
+ return {
4980
+ load,
4981
+ source,
4982
+ getResolvedComp: () => resolvedComp,
4983
+ setPendingRequest: (request) => pendingRequest = request
4984
+ };
4985
+ }
4986
+ const useAsyncComponentState = (delay, timeout, onError) => {
4987
+ const loaded = ref(false);
4988
+ const error = ref();
4989
+ const delayed = ref(!!delay);
4990
+ if (delay) {
4991
+ setTimeout(() => {
4992
+ delayed.value = false;
4993
+ }, delay);
4994
+ }
4995
+ if (timeout != null) {
4996
+ setTimeout(() => {
4997
+ if (!loaded.value && !error.value) {
4998
+ const err = new Error(`Async component timed out after ${timeout}ms.`);
4999
+ onError(err);
5000
+ error.value = err;
5001
+ }
5002
+ }, timeout);
5003
+ }
5004
+ return { loaded, error, delayed };
5005
+ };
5006
+ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
5007
+ let patched = false;
5008
+ (instance.bu || (instance.bu = [])).push(() => patched = true);
5009
+ const performHydrate = () => {
5010
+ if (patched) {
5011
+ {
5012
+ const resolvedComp = getResolvedComp();
5013
+ warn$1(
5014
+ `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
5015
+ );
5016
+ }
5017
+ return;
5018
+ }
5019
+ hydrate();
5020
+ };
5021
+ const doHydrate = hydrateStrategy ? () => {
5022
+ const teardown = hydrateStrategy(
5023
+ performHydrate,
5024
+ (cb) => forEachElement(el, cb)
5025
+ );
5026
+ if (teardown) {
5027
+ (instance.bum || (instance.bum = [])).push(teardown);
5028
+ }
5029
+ } : performHydrate;
5030
+ if (getResolvedComp()) {
5031
+ doHydrate();
5032
+ } else {
5033
+ load().then(() => !instance.isUnmounted && doHydrate());
5034
+ }
4894
5035
  }
4895
5036
 
4896
5037
  const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
@@ -4915,86 +5056,37 @@ Server rendered element contains fewer child nodes than client vdom.`
4915
5056
  keepAliveInstance.__v_cache = cache;
4916
5057
  }
4917
5058
  const parentSuspense = keepAliveInstance.suspense;
5059
+ const { renderer } = sharedContext;
4918
5060
  const {
4919
- renderer: {
4920
- p: patch,
4921
- m: move,
4922
- um: _unmount,
4923
- o: { createElement }
4924
- }
4925
- } = sharedContext;
5061
+ um: _unmount,
5062
+ o: { createElement }
5063
+ } = renderer;
4926
5064
  const storageContainer = createElement("div");
5065
+ sharedContext.getStorageContainer = () => storageContainer;
5066
+ sharedContext.getCachedComponent = (vnode) => {
5067
+ const key = vnode.key == null ? vnode.type : vnode.key;
5068
+ return cache.get(key);
5069
+ };
4927
5070
  sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4928
- const instance = vnode.component;
4929
- move(
5071
+ activate(
4930
5072
  vnode,
4931
5073
  container,
4932
5074
  anchor,
4933
- 0,
5075
+ renderer,
4934
5076
  keepAliveInstance,
4935
- parentSuspense
4936
- );
4937
- patch(
4938
- instance.vnode,
4939
- vnode,
4940
- container,
4941
- anchor,
4942
- instance,
4943
5077
  parentSuspense,
4944
5078
  namespace,
4945
- vnode.slotScopeIds,
4946
5079
  optimized
4947
5080
  );
4948
- queuePostRenderEffect(
4949
- () => {
4950
- instance.isDeactivated = false;
4951
- if (instance.a) {
4952
- invokeArrayFns(instance.a);
4953
- }
4954
- const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
4955
- if (vnodeHook) {
4956
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
4957
- }
4958
- },
4959
- void 0,
4960
- parentSuspense
4961
- );
4962
- {
4963
- devtoolsComponentAdded(instance);
4964
- }
4965
5081
  };
4966
5082
  sharedContext.deactivate = (vnode) => {
4967
- const instance = vnode.component;
4968
- invalidateMount(instance.m);
4969
- invalidateMount(instance.a);
4970
- move(
5083
+ deactivate(
4971
5084
  vnode,
4972
5085
  storageContainer,
4973
- null,
4974
- 1,
5086
+ renderer,
4975
5087
  keepAliveInstance,
4976
5088
  parentSuspense
4977
5089
  );
4978
- queuePostRenderEffect(
4979
- () => {
4980
- if (instance.da) {
4981
- invokeArrayFns(instance.da);
4982
- }
4983
- const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
4984
- if (vnodeHook) {
4985
- invokeVNodeHook(vnodeHook, instance.parent, vnode);
4986
- }
4987
- instance.isDeactivated = true;
4988
- },
4989
- void 0,
4990
- parentSuspense
4991
- );
4992
- {
4993
- devtoolsComponentAdded(instance);
4994
- }
4995
- {
4996
- instance.__keepAliveStorageContainer = storageContainer;
4997
- }
4998
5090
  };
4999
5091
  function unmount(vnode) {
5000
5092
  resetShapeFlag(vnode);
@@ -5141,7 +5233,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5141
5233
  function onDeactivated(hook, target) {
5142
5234
  registerKeepAliveHook(hook, "da", target);
5143
5235
  }
5144
- function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
5236
+ function registerKeepAliveHook(hook, type, target = getCurrentGenericInstance()) {
5145
5237
  const wrappedHook = hook.__wdc || (hook.__wdc = () => {
5146
5238
  let current = target;
5147
5239
  while (current) {
@@ -5155,8 +5247,9 @@ Server rendered element contains fewer child nodes than client vdom.`
5155
5247
  injectHook(type, wrappedHook, target);
5156
5248
  if (target) {
5157
5249
  let current = target.parent;
5158
- while (current && current.parent && current.parent.vnode) {
5159
- if (isKeepAlive(current.parent.vnode)) {
5250
+ while (current && current.parent) {
5251
+ let parent = current.parent;
5252
+ if (isKeepAlive(parent.vapor ? parent : parent.vnode)) {
5160
5253
  injectToKeepAliveRoot(wrappedHook, type, target, current);
5161
5254
  }
5162
5255
  current = current.parent;
@@ -5182,6 +5275,71 @@ Server rendered element contains fewer child nodes than client vdom.`
5182
5275
  function getInnerChild(vnode) {
5183
5276
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
5184
5277
  }
5278
+ function activate(vnode, container, anchor, { p: patch, m: move }, parentComponent, parentSuspense, namespace, optimized) {
5279
+ const instance = vnode.component;
5280
+ move(
5281
+ vnode,
5282
+ container,
5283
+ anchor,
5284
+ 0,
5285
+ parentComponent,
5286
+ parentSuspense
5287
+ );
5288
+ patch(
5289
+ instance.vnode,
5290
+ vnode,
5291
+ container,
5292
+ anchor,
5293
+ instance,
5294
+ parentSuspense,
5295
+ namespace,
5296
+ vnode.slotScopeIds,
5297
+ optimized
5298
+ );
5299
+ queuePostRenderEffect(
5300
+ () => {
5301
+ instance.isDeactivated = false;
5302
+ if (instance.a) {
5303
+ invokeArrayFns(instance.a);
5304
+ }
5305
+ const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
5306
+ if (vnodeHook) {
5307
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
5308
+ }
5309
+ },
5310
+ void 0,
5311
+ parentSuspense
5312
+ );
5313
+ {
5314
+ devtoolsComponentAdded(instance);
5315
+ }
5316
+ }
5317
+ function deactivate(vnode, container, { m: move }, parentComponent, parentSuspense) {
5318
+ const instance = vnode.component;
5319
+ invalidateMount(instance.m);
5320
+ invalidateMount(instance.a);
5321
+ move(vnode, container, null, 1, parentComponent, parentSuspense);
5322
+ queuePostRenderEffect(
5323
+ () => {
5324
+ if (instance.da) {
5325
+ invokeArrayFns(instance.da);
5326
+ }
5327
+ const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
5328
+ if (vnodeHook) {
5329
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
5330
+ }
5331
+ instance.isDeactivated = true;
5332
+ },
5333
+ void 0,
5334
+ parentSuspense
5335
+ );
5336
+ {
5337
+ devtoolsComponentAdded(instance);
5338
+ }
5339
+ {
5340
+ instance.__keepAliveStorageContainer = container;
5341
+ }
5342
+ }
5185
5343
 
5186
5344
  function injectHook(type, hook, target = currentInstance, prepend = false) {
5187
5345
  if (target) {
@@ -5370,12 +5528,13 @@ If this is a native custom element, make sure to exclude it from component resol
5370
5528
  return ret;
5371
5529
  }
5372
5530
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
5531
+ const hasProps = Object.keys(props).length > 0;
5373
5532
  if (name !== "default") props.name = name;
5374
5533
  return openBlock(), createBlock(
5375
5534
  Fragment,
5376
5535
  null,
5377
5536
  [createVNode("slot", props, fallback && fallback())],
5378
- 64
5537
+ hasProps ? -2 : 64
5379
5538
  );
5380
5539
  }
5381
5540
  if (slot && slot.length > 1) {
@@ -5389,6 +5548,7 @@ If this is a native custom element, make sure to exclude it from component resol
5389
5548
  }
5390
5549
  openBlock();
5391
5550
  const validSlotContent = slot && ensureValidVNode(slot(props));
5551
+ ensureVaporSlotFallback(validSlotContent, fallback);
5392
5552
  const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5393
5553
  // key attached in the `createSlots` helper, respect that
5394
5554
  validSlotContent && validSlotContent.key;
@@ -5418,6 +5578,14 @@ If this is a native custom element, make sure to exclude it from component resol
5418
5578
  return true;
5419
5579
  }) ? vnodes : null;
5420
5580
  }
5581
+ function ensureVaporSlotFallback(vnodes, fallback) {
5582
+ let vaporSlot;
5583
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
5584
+ if (!vaporSlot.fallback && fallback) {
5585
+ vaporSlot.fallback = fallback;
5586
+ }
5587
+ }
5588
+ }
5421
5589
 
5422
5590
  function toHandlers(obj, preserveCaseIfNecessary) {
5423
5591
  const ret = {};
@@ -5580,10 +5748,10 @@ If this is a native custom element, make sure to exclude it from component resol
5580
5748
  return true;
5581
5749
  },
5582
5750
  has({
5583
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
5751
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
5584
5752
  }, key) {
5585
- let normalizedProps;
5586
- 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);
5753
+ let normalizedProps, cssModules;
5754
+ 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]);
5587
5755
  },
5588
5756
  defineProperty(target, key, descriptor) {
5589
5757
  if (descriptor.get != null) {
@@ -5721,15 +5889,15 @@ If this is a native custom element, make sure to exclude it from component resol
5721
5889
  return null;
5722
5890
  }
5723
5891
  function useSlots() {
5724
- return getContext().slots;
5892
+ return getContext("useSlots").slots;
5725
5893
  }
5726
5894
  function useAttrs() {
5727
- return getContext().attrs;
5895
+ return getContext("useAttrs").attrs;
5728
5896
  }
5729
- function getContext() {
5897
+ function getContext(calledFunctionName) {
5730
5898
  const i = getCurrentGenericInstance();
5731
5899
  if (!i) {
5732
- warn$1(`useContext() called without active instance.`);
5900
+ warn$1(`${calledFunctionName}() called without active instance.`);
5733
5901
  }
5734
5902
  if (i.vapor) {
5735
5903
  return i;
@@ -5985,7 +6153,8 @@ If this is a native custom element, make sure to exclude it from component resol
5985
6153
  expose.forEach((key) => {
5986
6154
  Object.defineProperty(exposed, key, {
5987
6155
  get: () => publicThis[key],
5988
- set: (val) => publicThis[key] = val
6156
+ set: (val) => publicThis[key] = val,
6157
+ enumerable: true
5989
6158
  });
5990
6159
  });
5991
6160
  } else if (!instance.exposed) {
@@ -6855,7 +7024,7 @@ If you want to remount the same app, move your app creation logic into a factory
6855
7024
  return args.some((elem) => elem.toLowerCase() === "boolean");
6856
7025
  }
6857
7026
 
6858
- const isInternalKey = (key) => key[0] === "_" || key === "$stable";
7027
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
6859
7028
  const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
6860
7029
  const normalizeSlot = (key, rawSlot, ctx) => {
6861
7030
  if (rawSlot._n) {
@@ -6909,8 +7078,6 @@ If you want to remount the same app, move your app creation logic into a factory
6909
7078
  const initSlots = (instance, children, optimized) => {
6910
7079
  const slots = instance.slots = createInternalObject();
6911
7080
  if (instance.vnode.shapeFlag & 32) {
6912
- const cacheIndexes = children.__;
6913
- if (cacheIndexes) def(slots, "__", cacheIndexes, true);
6914
7081
  const type = children._;
6915
7082
  if (type) {
6916
7083
  assignSlots(slots, children, optimized);
@@ -6974,12 +7141,10 @@ If you want to remount the same app, move your app creation logic into a factory
6974
7141
  if (instance.appContext.config.performance && isSupported()) {
6975
7142
  const startTag = `vue-${type}-${instance.uid}`;
6976
7143
  const endTag = startTag + `:end`;
7144
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
6977
7145
  perf.mark(endTag);
6978
- perf.measure(
6979
- `<${formatComponentName(instance, instance.type)}> ${type}`,
6980
- startTag,
6981
- endTag
6982
- );
7146
+ perf.measure(measureName, startTag, endTag);
7147
+ perf.clearMeasures(measureName);
6983
7148
  perf.clearMarks(startTag);
6984
7149
  perf.clearMarks(endTag);
6985
7150
  }
@@ -7218,15 +7383,25 @@ If you want to remount the same app, move your app creation logic into a factory
7218
7383
  optimized
7219
7384
  );
7220
7385
  } else {
7221
- patchElement(
7222
- n1,
7223
- n2,
7224
- parentComponent,
7225
- parentSuspense,
7226
- namespace,
7227
- slotScopeIds,
7228
- optimized
7229
- );
7386
+ const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
7387
+ try {
7388
+ if (customElement) {
7389
+ customElement._beginPatch();
7390
+ }
7391
+ patchElement(
7392
+ n1,
7393
+ n2,
7394
+ parentComponent,
7395
+ parentSuspense,
7396
+ namespace,
7397
+ slotScopeIds,
7398
+ optimized
7399
+ );
7400
+ } finally {
7401
+ if (customElement) {
7402
+ customElement._endPatch();
7403
+ }
7404
+ }
7230
7405
  }
7231
7406
  };
7232
7407
  const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
@@ -7277,16 +7452,20 @@ If you want to remount the same app, move your app creation logic into a factory
7277
7452
  if (dirs) {
7278
7453
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7279
7454
  }
7280
- const needCallTransitionHooks = needTransition(parentSuspense, transition);
7281
- if (needCallTransitionHooks) {
7282
- transition.beforeEnter(el);
7455
+ if (transition) {
7456
+ performTransitionEnter(
7457
+ el,
7458
+ transition,
7459
+ () => hostInsert(el, container, anchor),
7460
+ parentSuspense
7461
+ );
7462
+ } else {
7463
+ hostInsert(el, container, anchor);
7283
7464
  }
7284
- hostInsert(el, container, anchor);
7285
- if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
7465
+ if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
7286
7466
  queuePostRenderEffect(
7287
7467
  () => {
7288
7468
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7289
- needCallTransitionHooks && transition.enter(el);
7290
7469
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7291
7470
  },
7292
7471
  void 0,
@@ -7303,21 +7482,9 @@ If you want to remount the same app, move your app creation logic into a factory
7303
7482
  hostSetScopeId(el, slotScopeIds[i]);
7304
7483
  }
7305
7484
  }
7306
- let subTree = parentComponent && parentComponent.subTree;
7307
- if (subTree) {
7308
- if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
7309
- subTree = filterSingleRoot(subTree.children) || subTree;
7310
- }
7311
- if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
7312
- const parentVNode = parentComponent.vnode;
7313
- setScopeId(
7314
- el,
7315
- parentVNode,
7316
- parentVNode.scopeId,
7317
- parentVNode.slotScopeIds,
7318
- parentComponent.parent
7319
- );
7320
- }
7485
+ const inheritedScopeIds = getInheritedScopeIds(vnode, parentComponent);
7486
+ for (let i = 0; i < inheritedScopeIds.length; i++) {
7487
+ hostSetScopeId(el, inheritedScopeIds[i]);
7321
7488
  }
7322
7489
  };
7323
7490
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
@@ -7558,12 +7725,21 @@ If you want to remount the same app, move your app creation logic into a factory
7558
7725
  n2.slotScopeIds = slotScopeIds;
7559
7726
  if (n2.type.__vapor) {
7560
7727
  if (n1 == null) {
7561
- getVaporInterface(parentComponent, n2).mount(
7562
- n2,
7563
- container,
7564
- anchor,
7565
- parentComponent
7566
- );
7728
+ if (n2.shapeFlag & 512) {
7729
+ getVaporInterface(parentComponent, n2).activate(
7730
+ n2,
7731
+ container,
7732
+ anchor,
7733
+ parentComponent
7734
+ );
7735
+ } else {
7736
+ getVaporInterface(parentComponent, n2).mount(
7737
+ n2,
7738
+ container,
7739
+ anchor,
7740
+ parentComponent
7741
+ );
7742
+ }
7567
7743
  } else {
7568
7744
  getVaporInterface(parentComponent, n2).update(
7569
7745
  n1,
@@ -7626,6 +7802,7 @@ If you want to remount the same app, move your app creation logic into a factory
7626
7802
  if (!initialVNode.el) {
7627
7803
  const placeholder = instance.subTree = createVNode(Comment);
7628
7804
  processCommentNode(null, placeholder, container, anchor);
7805
+ initialVNode.placeholder = placeholder.el;
7629
7806
  }
7630
7807
  } else {
7631
7808
  setupRenderEffect(
@@ -8166,7 +8343,11 @@ If you want to remount the same app, move your app creation logic into a factory
8166
8343
  for (i = toBePatched - 1; i >= 0; i--) {
8167
8344
  const nextIndex = s2 + i;
8168
8345
  const nextChild = c2[nextIndex];
8169
- const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
8346
+ const anchorVNode = c2[nextIndex + 1];
8347
+ const anchor = nextIndex + 1 < l2 ? (
8348
+ // #13559, fallback to el placeholder for unresolved async component
8349
+ anchorVNode.el || anchorVNode.placeholder
8350
+ ) : parentAnchor;
8170
8351
  if (newIndexToOldIndexMap[i] === 0) {
8171
8352
  patch(
8172
8353
  null,
@@ -8246,12 +8427,12 @@ If you want to remount the same app, move your app creation logic into a factory
8246
8427
  const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
8247
8428
  if (needTransition2) {
8248
8429
  if (moveType === 0) {
8249
- transition.beforeEnter(el);
8250
- hostInsert(el, container, anchor);
8251
- queuePostRenderEffect(
8252
- () => transition.enter(el),
8253
- void 0,
8254
- parentSuspense
8430
+ performTransitionEnter(
8431
+ el,
8432
+ transition,
8433
+ () => hostInsert(el, container, anchor),
8434
+ parentSuspense,
8435
+ true
8255
8436
  );
8256
8437
  } else {
8257
8438
  const { leave, delayLeave, afterLeave } = transition;
@@ -8263,6 +8444,12 @@ If you want to remount the same app, move your app creation logic into a factory
8263
8444
  }
8264
8445
  };
8265
8446
  const performLeave = () => {
8447
+ if (el._isLeaving) {
8448
+ el[leaveCbKey](
8449
+ true
8450
+ /* cancelled */
8451
+ );
8452
+ }
8266
8453
  leave(el, () => {
8267
8454
  remove2();
8268
8455
  afterLeave && afterLeave();
@@ -8302,7 +8489,14 @@ If you want to remount the same app, move your app creation logic into a factory
8302
8489
  parentComponent.renderCache[cacheIndex] = void 0;
8303
8490
  }
8304
8491
  if (shapeFlag & 256) {
8305
- parentComponent.ctx.deactivate(vnode);
8492
+ if (vnode.type.__vapor) {
8493
+ getVaporInterface(parentComponent, vnode).deactivate(
8494
+ vnode,
8495
+ parentComponent.ctx.getStorageContainer()
8496
+ );
8497
+ } else {
8498
+ parentComponent.ctx.deactivate(vnode);
8499
+ }
8306
8500
  return;
8307
8501
  }
8308
8502
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -8390,22 +8584,15 @@ If you want to remount the same app, move your app creation logic into a factory
8390
8584
  removeStaticNode(vnode);
8391
8585
  return;
8392
8586
  }
8393
- const performRemove = () => {
8394
- hostRemove(el);
8395
- if (transition && !transition.persisted && transition.afterLeave) {
8396
- transition.afterLeave();
8397
- }
8398
- };
8399
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
8400
- const { leave, delayLeave } = transition;
8401
- const performLeave = () => leave(el, performRemove);
8402
- if (delayLeave) {
8403
- delayLeave(vnode.el, performRemove, performLeave);
8404
- } else {
8405
- performLeave();
8406
- }
8587
+ if (transition) {
8588
+ performTransitionLeave(
8589
+ el,
8590
+ transition,
8591
+ () => hostRemove(el),
8592
+ !!(vnode.shapeFlag & 1)
8593
+ );
8407
8594
  } else {
8408
- performRemove();
8595
+ hostRemove(el);
8409
8596
  }
8410
8597
  };
8411
8598
  const removeFragment = (cur, end) => {
@@ -8421,27 +8608,12 @@ If you want to remount the same app, move your app creation logic into a factory
8421
8608
  if (instance.type.__hmrId) {
8422
8609
  unregisterHMR(instance);
8423
8610
  }
8424
- const {
8425
- bum,
8426
- scope,
8427
- effect,
8428
- subTree,
8429
- um,
8430
- m,
8431
- a,
8432
- parent,
8433
- slots: { __: slotCacheKeys }
8434
- } = instance;
8611
+ const { bum, scope, effect, subTree, um, m, a } = instance;
8435
8612
  invalidateMount(m);
8436
8613
  invalidateMount(a);
8437
8614
  if (bum) {
8438
8615
  invokeArrayFns(bum);
8439
8616
  }
8440
- if (parent && isArray(slotCacheKeys)) {
8441
- slotCacheKeys.forEach((v) => {
8442
- parent.renderCache[v] = void 0;
8443
- });
8444
- }
8445
8617
  scope.stop();
8446
8618
  if (effect) {
8447
8619
  effect.stop();
@@ -8455,12 +8627,6 @@ If you want to remount the same app, move your app creation logic into a factory
8455
8627
  void 0,
8456
8628
  parentSuspense
8457
8629
  );
8458
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
8459
- parentSuspense.deps--;
8460
- if (parentSuspense.deps === 0) {
8461
- parentSuspense.resolve();
8462
- }
8463
- }
8464
8630
  {
8465
8631
  devtoolsComponentRemoved(instance);
8466
8632
  }
@@ -8473,7 +8639,7 @@ If you want to remount the same app, move your app creation logic into a factory
8473
8639
  const getNextHostNode = (vnode) => {
8474
8640
  if (vnode.shapeFlag & 6) {
8475
8641
  if (vnode.type.__vapor) {
8476
- return hostNextSibling(vnode.component.block);
8642
+ return hostNextSibling(vnode.anchor);
8477
8643
  }
8478
8644
  return getNextHostNode(vnode.component.subTree);
8479
8645
  }
@@ -8551,6 +8717,7 @@ If you want to remount the same app, move your app creation logic into a factory
8551
8717
  return {
8552
8718
  render,
8553
8719
  hydrate,
8720
+ hydrateNode,
8554
8721
  internals,
8555
8722
  createApp: createAppAPI(
8556
8723
  mountApp,
@@ -8590,7 +8757,8 @@ If you want to remount the same app, move your app creation logic into a factory
8590
8757
  if (!shallow && c2.patchFlag !== -2)
8591
8758
  traverseStaticChildren(c1, c2);
8592
8759
  }
8593
- if (c2.type === Text) {
8760
+ if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
8761
+ c2.patchFlag !== -1) {
8594
8762
  c2.el = c1.el;
8595
8763
  }
8596
8764
  if (c2.type === Comment && !c2.el) {
@@ -8603,7 +8771,7 @@ If you want to remount the same app, move your app creation logic into a factory
8603
8771
  }
8604
8772
  }
8605
8773
  function locateNonHydratedAsyncRoot(instance) {
8606
- const subComponent = instance.subTree.component;
8774
+ const subComponent = instance.subTree && instance.subTree.component;
8607
8775
  if (subComponent) {
8608
8776
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
8609
8777
  return subComponent;
@@ -8618,6 +8786,34 @@ If you want to remount the same app, move your app creation logic into a factory
8618
8786
  hooks[i].flags |= 4;
8619
8787
  }
8620
8788
  }
8789
+ function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
8790
+ if (force || needTransition(parentSuspense, transition)) {
8791
+ transition.beforeEnter(el);
8792
+ insert();
8793
+ queuePostRenderEffect(() => transition.enter(el), void 0, parentSuspense);
8794
+ } else {
8795
+ insert();
8796
+ }
8797
+ }
8798
+ function performTransitionLeave(el, transition, remove, isElement = true) {
8799
+ const performRemove = () => {
8800
+ remove();
8801
+ if (transition && !transition.persisted && transition.afterLeave) {
8802
+ transition.afterLeave();
8803
+ }
8804
+ };
8805
+ if (isElement && transition && !transition.persisted) {
8806
+ const { leave, delayLeave } = transition;
8807
+ const performLeave = () => leave(el, performRemove);
8808
+ if (delayLeave) {
8809
+ delayLeave(el, performRemove, performLeave);
8810
+ } else {
8811
+ performLeave();
8812
+ }
8813
+ } else {
8814
+ performRemove();
8815
+ }
8816
+ }
8621
8817
  function getVaporInterface(instance, vnode) {
8622
8818
  const ctx = instance ? instance.appContext : vnode.appContext;
8623
8819
  const res = ctx && ctx.vapor;
@@ -8632,6 +8828,32 @@ app.use(vaporInteropPlugin)
8632
8828
  }
8633
8829
  return res;
8634
8830
  }
8831
+ function getInheritedScopeIds(vnode, parentComponent) {
8832
+ const inheritedScopeIds = [];
8833
+ let currentParent = parentComponent;
8834
+ let currentVNode = vnode;
8835
+ while (currentParent) {
8836
+ let subTree = currentParent.subTree;
8837
+ if (!subTree) break;
8838
+ if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
8839
+ subTree = filterSingleRoot(subTree.children) || subTree;
8840
+ }
8841
+ if (currentVNode === subTree || isSuspense(subTree.type) && (subTree.ssContent === currentVNode || subTree.ssFallback === currentVNode)) {
8842
+ const parentVNode = currentParent.vnode;
8843
+ if (parentVNode.scopeId) {
8844
+ inheritedScopeIds.push(parentVNode.scopeId);
8845
+ }
8846
+ if (parentVNode.slotScopeIds) {
8847
+ inheritedScopeIds.push(...parentVNode.slotScopeIds);
8848
+ }
8849
+ currentVNode = parentVNode;
8850
+ currentParent = currentParent.parent;
8851
+ } else {
8852
+ break;
8853
+ }
8854
+ }
8855
+ return inheritedScopeIds;
8856
+ }
8635
8857
 
8636
8858
  const ssrContextKey = Symbol.for("v-scx");
8637
8859
  const useSSRContext = () => {
@@ -8943,8 +9165,9 @@ app.use(vaporInteropPlugin)
8943
9165
  function defaultPropGetter(props, key) {
8944
9166
  return props[key];
8945
9167
  }
9168
+ const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
8946
9169
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
8947
- const cache = appContext.emitsCache;
9170
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
8948
9171
  const cached = cache.get(comp);
8949
9172
  if (cached !== void 0) {
8950
9173
  return cached;
@@ -9392,7 +9615,7 @@ app.use(vaporInteropPlugin)
9392
9615
  const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
9393
9616
  if (pendingBranch) {
9394
9617
  suspense.pendingBranch = newBranch;
9395
- if (isSameVNodeType(newBranch, pendingBranch)) {
9618
+ if (isSameVNodeType(pendingBranch, newBranch)) {
9396
9619
  patch(
9397
9620
  pendingBranch,
9398
9621
  newBranch,
@@ -9463,7 +9686,7 @@ app.use(vaporInteropPlugin)
9463
9686
  );
9464
9687
  setActiveBranch(suspense, newFallback);
9465
9688
  }
9466
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
9689
+ } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
9467
9690
  patch(
9468
9691
  activeBranch,
9469
9692
  newBranch,
@@ -9494,7 +9717,7 @@ app.use(vaporInteropPlugin)
9494
9717
  }
9495
9718
  }
9496
9719
  } else {
9497
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
9720
+ if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
9498
9721
  patch(
9499
9722
  activeBranch,
9500
9723
  newBranch,
@@ -9607,7 +9830,8 @@ app.use(vaporInteropPlugin)
9607
9830
  pendingId,
9608
9831
  effects,
9609
9832
  parentComponent: parentComponent2,
9610
- container: container2
9833
+ container: container2,
9834
+ isInFallback
9611
9835
  } = suspense;
9612
9836
  let delayEnter = false;
9613
9837
  if (suspense.isHydrating) {
@@ -9625,6 +9849,9 @@ app.use(vaporInteropPlugin)
9625
9849
  parentComponent2
9626
9850
  );
9627
9851
  queuePostFlushCb(effects);
9852
+ if (isInFallback && vnode2.ssFallback) {
9853
+ vnode2.ssFallback.el = null;
9854
+ }
9628
9855
  }
9629
9856
  };
9630
9857
  }
@@ -9633,6 +9860,9 @@ app.use(vaporInteropPlugin)
9633
9860
  anchor = next(activeBranch);
9634
9861
  }
9635
9862
  unmount(activeBranch, parentComponent2, suspense, true);
9863
+ if (!delayEnter && isInFallback && vnode2.ssFallback) {
9864
+ vnode2.ssFallback.el = null;
9865
+ }
9636
9866
  }
9637
9867
  if (!delayEnter) {
9638
9868
  move(
@@ -9757,6 +9987,7 @@ app.use(vaporInteropPlugin)
9757
9987
  optimized2
9758
9988
  );
9759
9989
  if (placeholder) {
9990
+ vnode2.placeholder = null;
9760
9991
  remove(placeholder);
9761
9992
  }
9762
9993
  updateHOCHostEl(instance, vnode2.el);
@@ -9962,15 +10193,11 @@ app.use(vaporInteropPlugin)
9962
10193
  );
9963
10194
  };
9964
10195
  const normalizeKey = ({ key }) => key != null ? key : null;
9965
- const normalizeRef = ({
9966
- ref,
9967
- ref_key,
9968
- ref_for
9969
- }) => {
10196
+ const normalizeRef = ({ ref, ref_key, ref_for }, i = currentRenderingInstance) => {
9970
10197
  if (typeof ref === "number") {
9971
10198
  ref = "" + ref;
9972
10199
  }
9973
- return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
10200
+ return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i, r: ref, k: ref_key, f: !!ref_for } : ref : null;
9974
10201
  };
9975
10202
  function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
9976
10203
  const vnode = {
@@ -10136,6 +10363,7 @@ Component that was made reactive: `,
10136
10363
  suspense: vnode.suspense,
10137
10364
  ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
10138
10365
  ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
10366
+ placeholder: vnode.placeholder,
10139
10367
  el: vnode.el,
10140
10368
  anchor: vnode.anchor,
10141
10369
  ctx: vnode.ctx,
@@ -10648,7 +10876,7 @@ Component that was made reactive: `,
10648
10876
  return instance.proxy;
10649
10877
  }
10650
10878
  }
10651
- const classifyRE = /(?:^|[-_])(\w)/g;
10879
+ const classifyRE = /(?:^|[-_])\w/g;
10652
10880
  const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
10653
10881
  function getComponentName(Component, includeInferred = true) {
10654
10882
  return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
@@ -10684,23 +10912,28 @@ Component that was made reactive: `,
10684
10912
  };
10685
10913
 
10686
10914
  function h(type, propsOrChildren, children) {
10687
- const l = arguments.length;
10688
- if (l === 2) {
10689
- if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10690
- if (isVNode(propsOrChildren)) {
10691
- return createVNode(type, null, [propsOrChildren]);
10915
+ try {
10916
+ setBlockTracking(-1);
10917
+ const l = arguments.length;
10918
+ if (l === 2) {
10919
+ if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
10920
+ if (isVNode(propsOrChildren)) {
10921
+ return createVNode(type, null, [propsOrChildren]);
10922
+ }
10923
+ return createVNode(type, propsOrChildren);
10924
+ } else {
10925
+ return createVNode(type, null, propsOrChildren);
10692
10926
  }
10693
- return createVNode(type, propsOrChildren);
10694
10927
  } else {
10695
- return createVNode(type, null, propsOrChildren);
10696
- }
10697
- } else {
10698
- if (l > 3) {
10699
- children = Array.prototype.slice.call(arguments, 2);
10700
- } else if (l === 3 && isVNode(children)) {
10701
- children = [children];
10928
+ if (l > 3) {
10929
+ children = Array.prototype.slice.call(arguments, 2);
10930
+ } else if (l === 3 && isVNode(children)) {
10931
+ children = [children];
10932
+ }
10933
+ return createVNode(type, propsOrChildren, children);
10702
10934
  }
10703
- return createVNode(type, propsOrChildren, children);
10935
+ } finally {
10936
+ setBlockTracking(1);
10704
10937
  }
10705
10938
  }
10706
10939
 
@@ -10910,7 +11143,7 @@ Component that was made reactive: `,
10910
11143
  return true;
10911
11144
  }
10912
11145
 
10913
- const version = "3.6.0-alpha.1";
11146
+ const version = "3.6.0-alpha.3";
10914
11147
  const warn = warn$1 ;
10915
11148
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10916
11149
  const devtools = devtools$1 ;
@@ -11127,11 +11360,11 @@ Component that was made reactive: `,
11127
11360
  const resolve = () => finishLeave(el, done);
11128
11361
  addTransitionClass(el, leaveFromClass);
11129
11362
  if (!el._enterCancelled) {
11130
- forceReflow();
11363
+ forceReflow(el);
11131
11364
  addTransitionClass(el, leaveActiveClass);
11132
11365
  } else {
11133
11366
  addTransitionClass(el, leaveActiveClass);
11134
- forceReflow();
11367
+ forceReflow(el);
11135
11368
  }
11136
11369
  nextFrame(() => {
11137
11370
  if (!el._isLeaving) {
@@ -11257,7 +11490,7 @@ Component that was made reactive: `,
11257
11490
  type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
11258
11491
  propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
11259
11492
  }
11260
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
11493
+ const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
11261
11494
  getStyleProperties(`${TRANSITION}Property`).toString()
11262
11495
  );
11263
11496
  return {
@@ -11277,8 +11510,9 @@ Component that was made reactive: `,
11277
11510
  if (s === "auto") return 0;
11278
11511
  return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
11279
11512
  }
11280
- function forceReflow() {
11281
- return document.body.offsetHeight;
11513
+ function forceReflow(el) {
11514
+ const targetDocument = el ? el.ownerDocument : document;
11515
+ return targetDocument.body.offsetHeight;
11282
11516
  }
11283
11517
 
11284
11518
  function patchClass(el, value, isSVG) {
@@ -11298,6 +11532,8 @@ Component that was made reactive: `,
11298
11532
  const vShowOriginalDisplay = Symbol("_vod");
11299
11533
  const vShowHidden = Symbol("_vsh");
11300
11534
  const vShow = {
11535
+ // used for prop mismatch check during hydration
11536
+ name: "show",
11301
11537
  beforeMount(el, { value }, { transition }) {
11302
11538
  el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
11303
11539
  if (transition && value) {
@@ -11331,9 +11567,6 @@ Component that was made reactive: `,
11331
11567
  setDisplay(el, value);
11332
11568
  }
11333
11569
  };
11334
- {
11335
- vShow.name = "show";
11336
- }
11337
11570
  function setDisplay(el, value) {
11338
11571
  el.style.display = value ? el[vShowOriginalDisplay] : "none";
11339
11572
  el[vShowHidden] = !value;
@@ -11412,7 +11645,7 @@ Component that was made reactive: `,
11412
11645
  }
11413
11646
  }
11414
11647
 
11415
- const displayRE = /(^|;)\s*display\s*:/;
11648
+ const displayRE = /(?:^|;)\s*display\s*:/;
11416
11649
  function patchStyle(el, prev, next) {
11417
11650
  const style = el.style;
11418
11651
  const isCssString = isString(next);
@@ -11717,11 +11950,10 @@ Expected function or array of functions, received type ${typeof value}.`
11717
11950
  }
11718
11951
 
11719
11952
  const REMOVAL = {};
11720
- /*! #__NO_SIDE_EFFECTS__ */
11721
11953
  // @__NO_SIDE_EFFECTS__
11722
11954
  function defineCustomElement(options, extraOptions, _createApp) {
11723
- const Comp = defineComponent(options, extraOptions);
11724
- if (isPlainObject(Comp)) extend(Comp, extraOptions);
11955
+ let Comp = defineComponent(options, extraOptions);
11956
+ if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
11725
11957
  class VueCustomElement extends VueElement {
11726
11958
  constructor(initialProps) {
11727
11959
  super(Comp, initialProps, _createApp);
@@ -11730,10 +11962,9 @@ Expected function or array of functions, received type ${typeof value}.`
11730
11962
  VueCustomElement.def = Comp;
11731
11963
  return VueCustomElement;
11732
11964
  }
11733
- /*! #__NO_SIDE_EFFECTS__ */
11734
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
11965
+ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
11735
11966
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
11736
- };
11967
+ });
11737
11968
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11738
11969
  };
11739
11970
  class VueElement extends BaseClass {
@@ -11757,6 +11988,8 @@ Expected function or array of functions, received type ${typeof value}.`
11757
11988
  this._nonce = this._def.nonce;
11758
11989
  this._connected = false;
11759
11990
  this._resolved = false;
11991
+ this._patching = false;
11992
+ this._dirty = false;
11760
11993
  this._numberProps = null;
11761
11994
  this._styleChildren = /* @__PURE__ */ new WeakSet();
11762
11995
  this._ob = null;
@@ -11769,7 +12002,11 @@ Expected function or array of functions, received type ${typeof value}.`
11769
12002
  );
11770
12003
  }
11771
12004
  if (_def.shadowRoot !== false) {
11772
- this.attachShadow({ mode: "open" });
12005
+ this.attachShadow(
12006
+ extend({}, _def.shadowRootOptions, {
12007
+ mode: "open"
12008
+ })
12009
+ );
11773
12010
  this._root = this.shadowRoot;
11774
12011
  } else {
11775
12012
  this._root = this;
@@ -11829,9 +12066,18 @@ Expected function or array of functions, received type ${typeof value}.`
11829
12066
  this._app && this._app.unmount();
11830
12067
  if (this._instance) this._instance.ce = void 0;
11831
12068
  this._app = this._instance = null;
12069
+ if (this._teleportTargets) {
12070
+ this._teleportTargets.clear();
12071
+ this._teleportTargets = void 0;
12072
+ }
11832
12073
  }
11833
12074
  });
11834
12075
  }
12076
+ _processMutations(mutations) {
12077
+ for (const m of mutations) {
12078
+ this._setAttr(m.attributeName);
12079
+ }
12080
+ }
11835
12081
  /**
11836
12082
  * resolve inner component definition (handle possible async component)
11837
12083
  */
@@ -11842,11 +12088,7 @@ Expected function or array of functions, received type ${typeof value}.`
11842
12088
  for (let i = 0; i < this.attributes.length; i++) {
11843
12089
  this._setAttr(this.attributes[i].name);
11844
12090
  }
11845
- this._ob = new MutationObserver((mutations) => {
11846
- for (const m of mutations) {
11847
- this._setAttr(m.attributeName);
11848
- }
11849
- });
12091
+ this._ob = new MutationObserver(this._processMutations.bind(this));
11850
12092
  this._ob.observe(this, { attributes: true });
11851
12093
  const resolve = (def, isAsync = false) => {
11852
12094
  this._resolved = true;
@@ -11923,7 +12165,7 @@ Expected function or array of functions, received type ${typeof value}.`
11923
12165
  return this._getProp(key);
11924
12166
  },
11925
12167
  set(val) {
11926
- this._setProp(key, val, true, true);
12168
+ this._setProp(key, val, true, !this._patching);
11927
12169
  }
11928
12170
  });
11929
12171
  }
@@ -11949,6 +12191,7 @@ Expected function or array of functions, received type ${typeof value}.`
11949
12191
  */
11950
12192
  _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
11951
12193
  if (val !== this._props[key]) {
12194
+ this._dirty = true;
11952
12195
  if (val === REMOVAL) {
11953
12196
  delete this._props[key];
11954
12197
  } else {
@@ -11962,7 +12205,10 @@ Expected function or array of functions, received type ${typeof value}.`
11962
12205
  }
11963
12206
  if (shouldReflect) {
11964
12207
  const ob = this._ob;
11965
- ob && ob.disconnect();
12208
+ if (ob) {
12209
+ this._processMutations(ob.takeRecords());
12210
+ ob.disconnect();
12211
+ }
11966
12212
  if (val === true) {
11967
12213
  this.setAttribute(hyphenate(key), "");
11968
12214
  } else if (typeof val === "string" || typeof val === "number") {
@@ -12066,7 +12312,7 @@ Expected function or array of functions, received type ${typeof value}.`
12066
12312
  * Only called when shadowRoot is false
12067
12313
  */
12068
12314
  _renderSlots() {
12069
- const outlets = (this._teleportTarget || this).querySelectorAll("slot");
12315
+ const outlets = this._getSlots();
12070
12316
  const scopeId = this._instance.type.__scopeId;
12071
12317
  for (let i = 0; i < outlets.length; i++) {
12072
12318
  const o = outlets[i];
@@ -12092,12 +12338,45 @@ Expected function or array of functions, received type ${typeof value}.`
12092
12338
  parent.removeChild(o);
12093
12339
  }
12094
12340
  }
12341
+ /**
12342
+ * @internal
12343
+ */
12344
+ _getSlots() {
12345
+ const roots = [this];
12346
+ if (this._teleportTargets) {
12347
+ roots.push(...this._teleportTargets);
12348
+ }
12349
+ const slots = /* @__PURE__ */ new Set();
12350
+ for (const root of roots) {
12351
+ const found = root.querySelectorAll("slot");
12352
+ for (let i = 0; i < found.length; i++) {
12353
+ slots.add(found[i]);
12354
+ }
12355
+ }
12356
+ return Array.from(slots);
12357
+ }
12095
12358
  /**
12096
12359
  * @internal
12097
12360
  */
12098
12361
  _injectChildStyle(comp) {
12099
12362
  this._applyStyles(comp.styles, comp);
12100
12363
  }
12364
+ /**
12365
+ * @internal
12366
+ */
12367
+ _beginPatch() {
12368
+ this._patching = true;
12369
+ this._dirty = false;
12370
+ }
12371
+ /**
12372
+ * @internal
12373
+ */
12374
+ _endPatch() {
12375
+ this._patching = false;
12376
+ if (this._dirty && this._instance) {
12377
+ this._update();
12378
+ }
12379
+ }
12101
12380
  /**
12102
12381
  * @internal
12103
12382
  */
@@ -12178,26 +12457,13 @@ Expected function or array of functions, received type ${typeof value}.`
12178
12457
  prevChildren = [];
12179
12458
  return;
12180
12459
  }
12181
- prevChildren.forEach(callPendingCbs);
12460
+ prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
12182
12461
  prevChildren.forEach(recordPosition);
12183
12462
  const movedChildren = prevChildren.filter(applyTranslation);
12184
- forceReflow();
12463
+ forceReflow(instance.vnode.el);
12185
12464
  movedChildren.forEach((c) => {
12186
12465
  const el = c.el;
12187
- const style = el.style;
12188
- addTransitionClass(el, moveClass);
12189
- style.transform = style.webkitTransform = style.transitionDuration = "";
12190
- const cb = el[moveCbKey] = (e) => {
12191
- if (e && e.target !== el) {
12192
- return;
12193
- }
12194
- if (!e || /transform$/.test(e.propertyName)) {
12195
- el.removeEventListener("transitionend", cb);
12196
- el[moveCbKey] = null;
12197
- removeTransitionClass(el, moveClass);
12198
- }
12199
- };
12200
- el.addEventListener("transitionend", cb);
12466
+ handleMovedChildren(el, moveClass);
12201
12467
  });
12202
12468
  prevChildren = [];
12203
12469
  });
@@ -12220,10 +12486,10 @@ Expected function or array of functions, received type ${typeof value}.`
12220
12486
  instance
12221
12487
  )
12222
12488
  );
12223
- positionMap.set(
12224
- child,
12225
- child.el.getBoundingClientRect()
12226
- );
12489
+ positionMap.set(child, {
12490
+ left: child.el.offsetLeft,
12491
+ top: child.el.offsetTop
12492
+ });
12227
12493
  }
12228
12494
  }
12229
12495
  }
@@ -12244,8 +12510,7 @@ Expected function or array of functions, received type ${typeof value}.`
12244
12510
  }
12245
12511
  });
12246
12512
  const TransitionGroup = TransitionGroupImpl;
12247
- function callPendingCbs(c) {
12248
- const el = c.el;
12513
+ function callPendingCbs(el) {
12249
12514
  if (el[moveCbKey]) {
12250
12515
  el[moveCbKey]();
12251
12516
  }
@@ -12254,19 +12519,30 @@ Expected function or array of functions, received type ${typeof value}.`
12254
12519
  }
12255
12520
  }
12256
12521
  function recordPosition(c) {
12257
- newPositionMap.set(c, c.el.getBoundingClientRect());
12522
+ newPositionMap.set(c, {
12523
+ left: c.el.offsetLeft,
12524
+ top: c.el.offsetTop
12525
+ });
12258
12526
  }
12259
12527
  function applyTranslation(c) {
12260
- const oldPos = positionMap.get(c);
12261
- const newPos = newPositionMap.get(c);
12528
+ if (baseApplyTranslation(
12529
+ positionMap.get(c),
12530
+ newPositionMap.get(c),
12531
+ c.el
12532
+ )) {
12533
+ return c;
12534
+ }
12535
+ }
12536
+ function baseApplyTranslation(oldPos, newPos, el) {
12262
12537
  const dx = oldPos.left - newPos.left;
12263
12538
  const dy = oldPos.top - newPos.top;
12264
12539
  if (dx || dy) {
12265
- const s = c.el.style;
12540
+ const s = el.style;
12266
12541
  s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
12267
12542
  s.transitionDuration = "0s";
12268
- return c;
12543
+ return true;
12269
12544
  }
12545
+ return false;
12270
12546
  }
12271
12547
  function hasCSSTransform(el, root, moveClass) {
12272
12548
  const clone = el.cloneNode();
@@ -12284,6 +12560,22 @@ Expected function or array of functions, received type ${typeof value}.`
12284
12560
  container.removeChild(clone);
12285
12561
  return hasTransform;
12286
12562
  }
12563
+ const handleMovedChildren = (el, moveClass) => {
12564
+ const style = el.style;
12565
+ addTransitionClass(el, moveClass);
12566
+ style.transform = style.webkitTransform = style.transitionDuration = "";
12567
+ const cb = el[moveCbKey] = (e) => {
12568
+ if (e && e.target !== el) {
12569
+ return;
12570
+ }
12571
+ if (!e || e.propertyName.endsWith("transform")) {
12572
+ el.removeEventListener("transitionend", cb);
12573
+ el[moveCbKey] = null;
12574
+ removeTransitionClass(el, moveClass);
12575
+ }
12576
+ };
12577
+ el.addEventListener("transitionend", cb);
12578
+ };
12287
12579
 
12288
12580
  const getModelAssigner = (vnode) => {
12289
12581
  const fn = vnode.props["onUpdate:modelValue"] || false;
@@ -12319,21 +12611,21 @@ Expected function or array of functions, received type ${typeof value}.`
12319
12611
  vModelTextUpdate(el, oldValue, value, trim, number, lazy);
12320
12612
  }
12321
12613
  };
12614
+ function castValue(value, trim, number) {
12615
+ if (trim) value = value.trim();
12616
+ if (number) value = looseToNumber(value);
12617
+ return value;
12618
+ }
12322
12619
  const vModelTextInit = (el, trim, number, lazy, set) => {
12323
12620
  addEventListener(el, lazy ? "change" : "input", (e) => {
12324
12621
  if (e.target.composing) return;
12325
- let domValue = el.value;
12326
- if (trim) {
12327
- domValue = domValue.trim();
12328
- }
12329
- if (number || el.type === "number") {
12330
- domValue = looseToNumber(domValue);
12331
- }
12332
- (0, el[assignKey])(domValue);
12622
+ (0, el[assignKey])(
12623
+ castValue(el.value, trim, number || el.type === "number")
12624
+ );
12333
12625
  });
12334
- if (trim) {
12626
+ if (trim || number) {
12335
12627
  addEventListener(el, "change", () => {
12336
- el.value = el.value.trim();
12628
+ el.value = castValue(el.value, trim, number || el.type === "number");
12337
12629
  });
12338
12630
  }
12339
12631
  if (!lazy) {
@@ -12582,13 +12874,13 @@ Expected function or array of functions, received type ${typeof value}.`
12582
12874
  const withModifiers = (fn, modifiers) => {
12583
12875
  const cache = fn._withMods || (fn._withMods = {});
12584
12876
  const cacheKey = modifiers.join(".");
12585
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
12877
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
12586
12878
  for (let i = 0; i < modifiers.length; i++) {
12587
12879
  const guard = modifierGuards[modifiers[i]];
12588
12880
  if (guard && guard(event, modifiers)) return;
12589
12881
  }
12590
12882
  return fn(event, ...args);
12591
- });
12883
+ }));
12592
12884
  };
12593
12885
  const keyNames = {
12594
12886
  esc: "escape",
@@ -12602,7 +12894,7 @@ Expected function or array of functions, received type ${typeof value}.`
12602
12894
  const withKeys = (fn, modifiers) => {
12603
12895
  const cache = fn._withKeys || (fn._withKeys = {});
12604
12896
  const cacheKey = modifiers.join(".");
12605
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
12897
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
12606
12898
  if (!("key" in event)) {
12607
12899
  return;
12608
12900
  }
@@ -12612,7 +12904,7 @@ Expected function or array of functions, received type ${typeof value}.`
12612
12904
  )) {
12613
12905
  return fn(event);
12614
12906
  }
12615
- });
12907
+ }));
12616
12908
  };
12617
12909
 
12618
12910
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -12626,13 +12918,13 @@ Expected function or array of functions, received type ${typeof value}.`
12626
12918
  enabledHydration = true;
12627
12919
  return renderer;
12628
12920
  }
12629
- const render = (...args) => {
12921
+ const render = ((...args) => {
12630
12922
  ensureRenderer().render(...args);
12631
- };
12632
- const hydrate = (...args) => {
12923
+ });
12924
+ const hydrate = ((...args) => {
12633
12925
  ensureHydrationRenderer().hydrate(...args);
12634
- };
12635
- const createApp = (...args) => {
12926
+ });
12927
+ const createApp = ((...args) => {
12636
12928
  const app = ensureRenderer().createApp(...args);
12637
12929
  {
12638
12930
  injectNativeTagCheck(app);
@@ -12657,8 +12949,8 @@ Expected function or array of functions, received type ${typeof value}.`
12657
12949
  return proxy;
12658
12950
  };
12659
12951
  return app;
12660
- };
12661
- const createSSRApp = (...args) => {
12952
+ });
12953
+ const createSSRApp = ((...args) => {
12662
12954
  const app = ensureHydrationRenderer().createApp(...args);
12663
12955
  {
12664
12956
  injectNativeTagCheck(app);
@@ -12672,7 +12964,7 @@ Expected function or array of functions, received type ${typeof value}.`
12672
12964
  }
12673
12965
  };
12674
12966
  return app;
12675
- };
12967
+ });
12676
12968
  function resolveRootNamespace(container) {
12677
12969
  if (container instanceof SVGElement) {
12678
12970
  return "svg";