@vue/runtime-dom 3.6.0-beta.8 → 3.6.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-beta.8
2
+ * @vue/runtime-dom v3.6.0-rc.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -433,6 +433,13 @@ var VueRuntimeDOM = (function(exports) {
433
433
  const notifyBuffer = [];
434
434
  let batchDepth = 0;
435
435
  let activeSub = void 0;
436
+ let runDepth = 0;
437
+ function incRunDepth() {
438
+ ++runDepth;
439
+ }
440
+ function decRunDepth() {
441
+ --runDepth;
442
+ }
436
443
  let globalVersion = 0;
437
444
  let notifyIndex = 0;
438
445
  let notifyBufferLength = 0;
@@ -506,8 +513,10 @@ var VueRuntimeDOM = (function(exports) {
506
513
  const sub = link.sub;
507
514
  let flags = sub.flags;
508
515
  if (flags & 3) {
509
- if (!(flags & 60)) sub.flags = flags | 32;
510
- else if (!(flags & 12)) flags = 0;
516
+ if (!(flags & 60)) {
517
+ sub.flags = flags | 32;
518
+ if (runDepth) sub.flags |= 8;
519
+ } else if (!(flags & 12)) flags = 0;
511
520
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
512
521
  else if (!(flags & 48) && isValidLink(link, sub)) {
513
522
  sub.flags = flags | 40;
@@ -576,13 +585,13 @@ var VueRuntimeDOM = (function(exports) {
576
585
  let dirty = false;
577
586
  if (sub.flags & 16) dirty = true;
578
587
  else if ((depFlags & 17) === 17) {
588
+ const subs = dep.subs;
579
589
  if (dep.update()) {
580
- const subs = dep.subs;
581
590
  if (subs.nextSub !== void 0) shallowPropagate(subs);
582
591
  dirty = true;
583
592
  }
584
593
  } else if ((depFlags & 33) === 33) {
585
- if (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {
594
+ stack = {
586
595
  value: link,
587
596
  prev: stack
588
597
  };
@@ -597,15 +606,12 @@ var VueRuntimeDOM = (function(exports) {
597
606
  }
598
607
  while (checkDepth) {
599
608
  --checkDepth;
600
- const firstSub = sub.subs;
601
- const hasMultipleSubs = firstSub.nextSub !== void 0;
602
- if (hasMultipleSubs) {
603
- link = stack.value;
604
- stack = stack.prev;
605
- } else link = firstSub;
609
+ link = stack.value;
610
+ stack = stack.prev;
606
611
  if (dirty) {
612
+ const subs = sub.subs;
607
613
  if (sub.update()) {
608
- if (hasMultipleSubs) shallowPropagate(firstSub);
614
+ if (subs.nextSub !== void 0) shallowPropagate(subs);
609
615
  sub = link.sub;
610
616
  continue;
611
617
  }
@@ -617,7 +623,7 @@ var VueRuntimeDOM = (function(exports) {
617
623
  }
618
624
  dirty = false;
619
625
  }
620
- return dirty;
626
+ return dirty && !!sub.flags;
621
627
  } while (true);
622
628
  }
623
629
  function shallowPropagate(link) {
@@ -1000,7 +1006,7 @@ var VueRuntimeDOM = (function(exports) {
1000
1006
  }
1001
1007
  const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
1002
1008
  const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
1003
- if (target === /* @__PURE__ */ toRaw(receiver)) {
1009
+ if (target === /* @__PURE__ */ toRaw(receiver) && result) {
1004
1010
  if (!hadKey) trigger(target, "add", key, value);
1005
1011
  else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
1006
1012
  }
@@ -1218,9 +1224,6 @@ var VueRuntimeDOM = (function(exports) {
1218
1224
  default: return 0;
1219
1225
  }
1220
1226
  }
1221
- function getTargetType(value) {
1222
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
1223
- }
1224
1227
  /* @__NO_SIDE_EFFECTS__ */
1225
1228
  function reactive(target) {
1226
1229
  if (/* @__PURE__ */ isReadonly(target)) return target;
@@ -1333,10 +1336,11 @@ var VueRuntimeDOM = (function(exports) {
1333
1336
  return target;
1334
1337
  }
1335
1338
  if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
1336
- const targetType = getTargetType(target);
1337
- if (targetType === 0) return target;
1339
+ if (target["__v_skip"] || !Object.isExtensible(target)) return target;
1338
1340
  const existingProxy = proxyMap.get(target);
1339
1341
  if (existingProxy) return existingProxy;
1342
+ const targetType = targetTypeMap(toRawType(target));
1343
+ if (targetType === 0) return target;
1340
1344
  const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
1341
1345
  proxyMap.set(target, proxy);
1342
1346
  return proxy;
@@ -1684,16 +1688,16 @@ var VueRuntimeDOM = (function(exports) {
1684
1688
  return ret;
1685
1689
  }
1686
1690
  var ObjectRefImpl = class {
1687
- constructor(_object, _key, _defaultValue) {
1691
+ constructor(_object, key, _defaultValue) {
1688
1692
  this._object = _object;
1689
- this._key = _key;
1690
1693
  this._defaultValue = _defaultValue;
1691
1694
  this["__v_isRef"] = true;
1692
1695
  this._value = void 0;
1696
+ this._key = isSymbol(key) ? key : String(key);
1693
1697
  this._raw = /* @__PURE__ */ toRaw(_object);
1694
1698
  let shallow = true;
1695
1699
  let obj = _object;
1696
- if (!isArray(_object) || !isIntegerKey(String(_key))) do
1700
+ if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) do
1697
1701
  shallow = !/* @__PURE__ */ isProxy(obj) || /* @__PURE__ */ isShallow(obj);
1698
1702
  while (shallow && (obj = obj["__v_raw"]));
1699
1703
  this._shallow = shallow;
@@ -1769,9 +1773,11 @@ var VueRuntimeDOM = (function(exports) {
1769
1773
  if (!this.active) return this.fn();
1770
1774
  cleanup(this);
1771
1775
  const prevSub = startTracking(this);
1776
+ incRunDepth();
1772
1777
  try {
1773
1778
  return this.fn();
1774
1779
  } finally {
1780
+ decRunDepth();
1775
1781
  endTracking(this, prevSub);
1776
1782
  const flags = this.flags;
1777
1783
  if ((flags & 136) === 136) {
@@ -2152,8 +2158,9 @@ var VueRuntimeDOM = (function(exports) {
2152
2158
  if (once && cb) {
2153
2159
  const _cb = cb;
2154
2160
  cb = (...args) => {
2155
- _cb(...args);
2161
+ const res = _cb(...args);
2156
2162
  this.stop();
2163
+ return res;
2157
2164
  };
2158
2165
  }
2159
2166
  this.cb = cb;
@@ -2167,7 +2174,7 @@ var VueRuntimeDOM = (function(exports) {
2167
2174
  if (!this.cb) return;
2168
2175
  const { immediate, deep, call } = this.options;
2169
2176
  if (initialRun && !immediate) return;
2170
- if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2177
+ if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2171
2178
  cleanup(this);
2172
2179
  const currentWatcher = activeWatcher;
2173
2180
  activeWatcher = this;
@@ -2474,8 +2481,8 @@ var VueRuntimeDOM = (function(exports) {
2474
2481
  /**
2475
2482
  * @internal for runtime-vapor only
2476
2483
  */
2477
- function queueJob(job, id, isPre = false) {
2478
- if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
2484
+ function queueJob(job, id, isPre = false, order = 0) {
2485
+ if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : order ? id * 2 + 1 + order / (order + 1) : id * 2 + 1, jobs, jobsLength, flushIndex)) {
2479
2486
  jobsLength++;
2480
2487
  queueFlush();
2481
2488
  }
@@ -2584,6 +2591,7 @@ var VueRuntimeDOM = (function(exports) {
2584
2591
  }
2585
2592
  flushIndex = 0;
2586
2593
  jobsLength = 0;
2594
+ jobs.length = 0;
2587
2595
  flushPostFlushCbs(seen);
2588
2596
  currentFlushPromise = null;
2589
2597
  if (jobsLength || postJobs.length) flushJobs(seen);
@@ -2603,6 +2611,13 @@ var VueRuntimeDOM = (function(exports) {
2603
2611
  //#endregion
2604
2612
  //#region packages/runtime-core/src/hmr.ts
2605
2613
  let isHmrUpdating = false;
2614
+ const setHmrUpdating = (v) => {
2615
+ try {
2616
+ return isHmrUpdating;
2617
+ } finally {
2618
+ isHmrUpdating = v;
2619
+ }
2620
+ };
2606
2621
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2607
2622
  const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
2608
2623
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
@@ -2634,6 +2649,14 @@ var VueRuntimeDOM = (function(exports) {
2634
2649
  function normalizeClassComponent(component) {
2635
2650
  return isClassComponent(component) ? component.__vccOpts : component;
2636
2651
  }
2652
+ function hasDirtyAncestor(instance, dirtyInstances) {
2653
+ let parent = instance.parent;
2654
+ while (parent) {
2655
+ if (dirtyInstances.has(parent)) return true;
2656
+ parent = parent.parent;
2657
+ }
2658
+ return false;
2659
+ }
2637
2660
  function rerender(id, newRender) {
2638
2661
  const record = map.get(id);
2639
2662
  if (!record) return;
@@ -2665,42 +2688,69 @@ var VueRuntimeDOM = (function(exports) {
2665
2688
  const isVapor = record.initialDef.__vapor;
2666
2689
  updateComponentDef(record.initialDef, newComp);
2667
2690
  const instances = [...record.instances];
2668
- if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
2691
+ if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2669
2692
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2670
- for (const instance of instances) instance.hmrReload(newComp);
2671
- } else for (const instance of instances) {
2672
- const oldComp = normalizeClassComponent(instance.type);
2673
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
2674
- if (!dirtyInstances) {
2675
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2676
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2677
- }
2678
- dirtyInstances.add(instance);
2679
- hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2680
- instance.appContext.propsCache.delete(instance.type);
2681
- instance.appContext.emitsCache.delete(instance.type);
2682
- instance.appContext.optionsCache.delete(instance.type);
2683
- if (instance.ceReload) {
2684
- dirtyInstances.add(instance);
2685
- instance.ceReload(newComp.styles);
2686
- dirtyInstances.delete(instance);
2687
- } else if (instance.parent) queueJob(() => {
2688
- isHmrUpdating = true;
2693
+ const dirtyInstances = new Set(instances);
2694
+ const rerenderedParents = /* @__PURE__ */ new Set();
2695
+ for (const instance of instances) {
2689
2696
  const parent = instance.parent;
2690
- if (parent.vapor) parent.hmrRerender();
2691
- else if (!(parent.effect.flags & 1024)) {
2692
- parent.renderCache = [];
2693
- parent.effect.run();
2697
+ if (parent) {
2698
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2699
+ rerenderedParents.add(parent);
2700
+ parent.hmrRerender();
2701
+ }
2702
+ } else instance.hmrReload(newComp);
2703
+ }
2704
+ } else {
2705
+ const parentUpdates = /* @__PURE__ */ new Map();
2706
+ const dirtyInstanceSet = new Set(instances);
2707
+ for (const instance of instances) {
2708
+ const oldComp = normalizeClassComponent(instance.type);
2709
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
2710
+ if (!dirtyInstances) {
2711
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2712
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2694
2713
  }
2695
- nextTick(() => {
2696
- isHmrUpdating = false;
2714
+ dirtyInstances.add(instance);
2715
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2716
+ instance.appContext.propsCache.delete(instance.type);
2717
+ instance.appContext.emitsCache.delete(instance.type);
2718
+ instance.appContext.optionsCache.delete(instance.type);
2719
+ if (instance.ceReload) {
2720
+ dirtyInstances.add(instance);
2721
+ instance.ceReload(newComp.styles);
2722
+ dirtyInstances.delete(instance);
2723
+ } else if (instance.parent) {
2724
+ const parent = instance.parent;
2725
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
2726
+ let updates = parentUpdates.get(parent);
2727
+ if (!updates) parentUpdates.set(parent, updates = []);
2728
+ updates.push([instance, dirtyInstances]);
2729
+ }
2730
+ } else if (instance.appContext.reload) instance.appContext.reload();
2731
+ else if (typeof window !== "undefined") window.location.reload();
2732
+ else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2733
+ if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2734
+ }
2735
+ parentUpdates.forEach((updates, parent) => {
2736
+ queueJob(() => {
2737
+ isHmrUpdating = true;
2738
+ if (parent.vapor) parent.hmrRerender();
2739
+ else {
2740
+ const i = parent;
2741
+ if (!(i.effect.flags & 1024)) {
2742
+ i.renderCache = [];
2743
+ i.effect.run();
2744
+ }
2745
+ }
2746
+ nextTick(() => {
2747
+ isHmrUpdating = false;
2748
+ });
2749
+ updates.forEach(([instance, dirtyInstances]) => {
2750
+ dirtyInstances.delete(instance);
2751
+ });
2697
2752
  });
2698
- dirtyInstances.delete(instance);
2699
2753
  });
2700
- else if (instance.appContext.reload) instance.appContext.reload();
2701
- else if (typeof window !== "undefined") window.location.reload();
2702
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2703
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2704
2754
  }
2705
2755
  queuePostFlushCb(() => {
2706
2756
  hmrDirtyComponents.clear();
@@ -2843,10 +2893,12 @@ var VueRuntimeDOM = (function(exports) {
2843
2893
  const renderFnWithContext = (...args) => {
2844
2894
  if (renderFnWithContext._d) setBlockTracking(-1);
2845
2895
  const prevInstance = setCurrentRenderingInstance(ctx);
2896
+ const prevStackSize = blockStack.length;
2846
2897
  let res;
2847
2898
  try {
2848
2899
  res = fn(...args);
2849
2900
  } finally {
2901
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
2850
2902
  setCurrentRenderingInstance(prevInstance);
2851
2903
  if (renderFnWithContext._d) setBlockTracking(1);
2852
2904
  }
@@ -3030,6 +3082,7 @@ var VueRuntimeDOM = (function(exports) {
3030
3082
  }
3031
3083
  //#endregion
3032
3084
  //#region packages/runtime-core/src/components/Teleport.ts
3085
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
3033
3086
  const TeleportEndKey = Symbol("_vte");
3034
3087
  const isTeleport = (type) => type.__isTeleport;
3035
3088
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -3055,55 +3108,68 @@ var VueRuntimeDOM = (function(exports) {
3055
3108
  name: "Teleport",
3056
3109
  __isTeleport: true,
3057
3110
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
3058
- const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
3111
+ const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
3059
3112
  const disabled = isTeleportDisabled(n2.props);
3060
- let { shapeFlag, children, dynamicChildren } = n2;
3113
+ let { dynamicChildren } = n2;
3061
3114
  if (isHmrUpdating) {
3062
3115
  optimized = false;
3063
3116
  dynamicChildren = null;
3064
3117
  }
3118
+ const mount = (vnode, container, anchor) => {
3119
+ if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3120
+ };
3121
+ const mountToTarget = (vnode = n2) => {
3122
+ const disabled = isTeleportDisabled(vnode.props);
3123
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
3124
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
3125
+ if (target) {
3126
+ if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
3127
+ else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
3128
+ if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3129
+ if (!disabled) {
3130
+ mount(vnode, target, targetAnchor);
3131
+ updateCssVars(vnode, false);
3132
+ }
3133
+ } else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3134
+ };
3135
+ const queuePendingMount = (vnode) => {
3136
+ const mountJob = () => {
3137
+ if (pendingMounts.get(vnode) !== mountJob) return;
3138
+ pendingMounts.delete(vnode);
3139
+ if (isTeleportDisabled(vnode.props)) {
3140
+ mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
3141
+ updateCssVars(vnode, true);
3142
+ }
3143
+ mountToTarget(vnode);
3144
+ };
3145
+ pendingMounts.set(vnode, mountJob);
3146
+ queuePostRenderEffect(mountJob, void 0, parentSuspense);
3147
+ };
3065
3148
  if (n1 == null) {
3066
3149
  const placeholder = n2.el = createComment("teleport start");
3067
3150
  const mainAnchor = n2.anchor = createComment("teleport end");
3068
3151
  insert(placeholder, container, anchor);
3069
3152
  insert(mainAnchor, container, anchor);
3070
- const mount = (container, anchor) => {
3071
- if (shapeFlag & 16) mountChildren(children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3072
- };
3073
- const mountToTarget = () => {
3074
- const target = n2.target = resolveTarget(n2.props, querySelector);
3075
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
3076
- if (target) {
3077
- if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
3078
- else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
3079
- if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3080
- if (!disabled) {
3081
- mount(target, targetAnchor);
3082
- updateCssVars(n2, false);
3083
- }
3084
- } else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3085
- };
3153
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3154
+ queuePendingMount(n2);
3155
+ return;
3156
+ }
3086
3157
  if (disabled) {
3087
- mount(container, mainAnchor);
3158
+ mount(n2, container, mainAnchor);
3088
3159
  updateCssVars(n2, true);
3089
3160
  }
3090
- if (isTeleportDeferred(n2.props)) {
3091
- n2.el.__isMounted = false;
3092
- queuePostRenderEffect(() => {
3093
- mountToTarget();
3094
- delete n2.el.__isMounted;
3095
- }, void 0, parentSuspense);
3096
- } else mountToTarget();
3161
+ mountToTarget();
3097
3162
  } else {
3098
- if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
3099
- queuePostRenderEffect(() => {
3100
- TeleportImpl.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
3101
- }, void 0, parentSuspense);
3163
+ n2.el = n1.el;
3164
+ const mainAnchor = n2.anchor = n1.anchor;
3165
+ const pendingMount = pendingMounts.get(n1);
3166
+ if (pendingMount) {
3167
+ pendingMount.flags |= 4;
3168
+ pendingMounts.delete(n1);
3169
+ queuePendingMount(n2);
3102
3170
  return;
3103
3171
  }
3104
- n2.el = n1.el;
3105
3172
  n2.targetStart = n1.targetStart;
3106
- const mainAnchor = n2.anchor = n1.anchor;
3107
3173
  const target = n2.target = n1.target;
3108
3174
  const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3109
3175
  const wasDisabled = isTeleportDisabled(n1.props);
@@ -3119,26 +3185,30 @@ var VueRuntimeDOM = (function(exports) {
3119
3185
  if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
3120
3186
  else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
3121
3187
  } else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
3122
- const nextTarget = n2.target = resolveTarget(n2.props, querySelector);
3123
- if (nextTarget) moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
3124
- else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
3188
+ const nextTarget = resolveTarget(n2.props, querySelector);
3189
+ if (nextTarget) {
3190
+ n2.target = nextTarget;
3191
+ moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
3192
+ } else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
3125
3193
  } else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
3126
3194
  updateCssVars(n2, disabled);
3127
3195
  }
3128
3196
  },
3129
3197
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
3130
3198
  const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
3131
- if (target) {
3132
- hostRemove(targetStart);
3133
- hostRemove(targetAnchor);
3134
- }
3199
+ const disabled = isTeleportDisabled(props);
3200
+ const shouldRemove = doRemove || !disabled;
3201
+ const pendingMount = pendingMounts.get(vnode);
3202
+ if (pendingMount) {
3203
+ pendingMount.flags |= 4;
3204
+ pendingMounts.delete(vnode);
3205
+ }
3206
+ if (targetStart) hostRemove(targetStart);
3207
+ if (targetAnchor) hostRemove(targetAnchor);
3135
3208
  doRemove && hostRemove(anchor);
3136
- if (shapeFlag & 16) {
3137
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3138
- for (let i = 0; i < children.length; i++) {
3139
- const child = children[i];
3140
- unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3141
- }
3209
+ if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3210
+ const child = children[i];
3211
+ unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3142
3212
  }
3143
3213
  },
3144
3214
  move: moveTeleport,
@@ -3149,7 +3219,7 @@ var VueRuntimeDOM = (function(exports) {
3149
3219
  const { el, anchor, shapeFlag, children, props } = vnode;
3150
3220
  const isReorder = moveType === 2;
3151
3221
  if (isReorder) insert(el, container, parentAnchor);
3152
- if (!isReorder || isTeleportDisabled(props)) {
3222
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3153
3223
  if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
3154
3224
  }
3155
3225
  if (isReorder) insert(anchor, container, parentAnchor);
@@ -3274,8 +3344,8 @@ var VueRuntimeDOM = (function(exports) {
3274
3344
  const state = useTransitionState();
3275
3345
  return () => {
3276
3346
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3277
- if (!children || !children.length) return;
3278
- const child = findNonCommentChild(children);
3347
+ const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3348
+ if (!child) return;
3279
3349
  const rawProps = /* @__PURE__ */ toRaw(props);
3280
3350
  const { mode } = rawProps;
3281
3351
  checkTransitionMode(mode);
@@ -3390,7 +3460,7 @@ var VueRuntimeDOM = (function(exports) {
3390
3460
  callHook(hook, [el]);
3391
3461
  },
3392
3462
  enter(el) {
3393
- if (isLeaving()) return;
3463
+ if (!isHmrUpdating && isLeaving()) return;
3394
3464
  let hook = onEnter;
3395
3465
  let afterHook = onAfterEnter;
3396
3466
  let cancelHook = onEnterCancelled;
@@ -3727,7 +3797,7 @@ var VueRuntimeDOM = (function(exports) {
3727
3797
  else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3728
3798
  break;
3729
3799
  case VaporSlot:
3730
- nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
3800
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
3731
3801
  break;
3732
3802
  default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
3733
3803
  else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
@@ -3737,16 +3807,31 @@ var VueRuntimeDOM = (function(exports) {
3737
3807
  if (isFragmentStart) nextNode = locateClosingAnchor(node);
3738
3808
  else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
3739
3809
  else nextNode = nextSibling(node);
3740
- if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, null, parentComponent, parentSuspense);
3741
- else mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
3742
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
3743
- let subTree;
3744
- if (isFragmentStart) {
3745
- subTree = createVNode(Fragment);
3746
- subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
3747
- } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
3748
- subTree.el = node;
3749
- vnode.component.subTree = subTree;
3810
+ if (vnode.type.__vapor) {
3811
+ const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
3812
+ getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
3813
+ if (vnode.dirs) {
3814
+ invokeDirectiveHook(vnode, null, parentComponent, "created");
3815
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
3816
+ }
3817
+ }, () => {
3818
+ if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
3819
+ });
3820
+ if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
3821
+ const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
3822
+ if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
3823
+ } else {
3824
+ mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
3825
+ const component = vnode.component;
3826
+ if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
3827
+ let subTree;
3828
+ if (isFragmentStart) {
3829
+ subTree = createVNode(Fragment);
3830
+ subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
3831
+ } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
3832
+ subTree.el = node;
3833
+ component.subTree = subTree;
3834
+ }
3750
3835
  }
3751
3836
  } else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
3752
3837
  else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
@@ -3758,7 +3843,7 @@ var VueRuntimeDOM = (function(exports) {
3758
3843
  };
3759
3844
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
3760
3845
  optimized = optimized || !!vnode.dynamicChildren;
3761
- const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
3846
+ const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
3762
3847
  const forcePatch = type === "input" || type === "option";
3763
3848
  {
3764
3849
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
@@ -3776,15 +3861,11 @@ var VueRuntimeDOM = (function(exports) {
3776
3861
  }
3777
3862
  if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
3778
3863
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
3779
- let hasWarned = false;
3864
+ if (next && !isMismatchAllowed(el, 1)) {
3865
+ warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
3866
+ logMismatchError();
3867
+ }
3780
3868
  while (next) {
3781
- if (!isMismatchAllowed(el, 1)) {
3782
- if (!hasWarned) {
3783
- warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
3784
- hasWarned = true;
3785
- }
3786
- logMismatchError();
3787
- }
3788
3869
  const cur = next;
3789
3870
  next = next.nextSibling;
3790
3871
  remove(cur);
@@ -3803,9 +3884,10 @@ var VueRuntimeDOM = (function(exports) {
3803
3884
  }
3804
3885
  if (props) {
3805
3886
  const isCustomElement = el.tagName.includes("-");
3887
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
3806
3888
  for (const key in props) {
3807
3889
  if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
3808
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key)) patchProp(el, key, null, props[key], void 0, parentComponent);
3890
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) patchProp(el, key, null, props[key], namespace, parentComponent);
3809
3891
  }
3810
3892
  }
3811
3893
  let vnodeHooks;
@@ -3823,7 +3905,7 @@ var VueRuntimeDOM = (function(exports) {
3823
3905
  optimized = optimized || !!parentVNode.dynamicChildren;
3824
3906
  const children = parentVNode.children;
3825
3907
  const l = children.length;
3826
- let hasWarned = false;
3908
+ let hasCheckedMismatch = false;
3827
3909
  for (let i = 0; i < l; i++) {
3828
3910
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
3829
3911
  const isText = vnode.type === Text;
@@ -3837,12 +3919,12 @@ var VueRuntimeDOM = (function(exports) {
3837
3919
  node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3838
3920
  } else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
3839
3921
  else {
3840
- if (!isMismatchAllowed(container, 1)) {
3841
- if (!hasWarned) {
3922
+ if (!hasCheckedMismatch) {
3923
+ hasCheckedMismatch = true;
3924
+ if (!isMismatchAllowed(container, 1)) {
3842
3925
  warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
3843
- hasWarned = true;
3926
+ logMismatchError();
3844
3927
  }
3845
- logMismatchError();
3846
3928
  }
3847
3929
  patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
3848
3930
  }
@@ -3862,7 +3944,7 @@ var VueRuntimeDOM = (function(exports) {
3862
3944
  }
3863
3945
  };
3864
3946
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
3865
- if (!isMismatchAllowed(node.parentElement, 1)) {
3947
+ if (!isNodeMismatchAllowed(node, vnode)) {
3866
3948
  warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
3867
3949
  logMismatchError();
3868
3950
  }
@@ -4026,7 +4108,9 @@ var VueRuntimeDOM = (function(exports) {
4026
4108
  };
4027
4109
  function isMismatchAllowed(el, allowedType) {
4028
4110
  if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
4029
- const allowedAttr = el && el.getAttribute(allowMismatchAttr);
4111
+ return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
4112
+ }
4113
+ function isMismatchAllowedByAttr(allowedAttr, allowedType) {
4030
4114
  if (allowedAttr == null) return false;
4031
4115
  else if (allowedAttr === "") return true;
4032
4116
  else {
@@ -4035,6 +4119,16 @@ var VueRuntimeDOM = (function(exports) {
4035
4119
  return list.includes(MismatchTypeString[allowedType]);
4036
4120
  }
4037
4121
  }
4122
+ function isNodeMismatchAllowed(node, vnode) {
4123
+ return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
4124
+ }
4125
+ function isMismatchAllowedByNode(node) {
4126
+ return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
4127
+ }
4128
+ function isMismatchAllowedByVNode({ props }) {
4129
+ const allowedAttr = props && props[allowMismatchAttr];
4130
+ return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
4131
+ }
4038
4132
  //#endregion
4039
4133
  //#region packages/runtime-core/src/hydrationStrategies.ts
4040
4134
  let requestIdleCallback;
@@ -4153,11 +4247,16 @@ var VueRuntimeDOM = (function(exports) {
4153
4247
  onError(err);
4154
4248
  return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
4155
4249
  });
4156
- const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
4250
+ const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
4157
4251
  load().then(() => {
4252
+ if (instance.isUnmounted) return;
4158
4253
  loaded.value = true;
4159
4254
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
4160
4255
  }).catch((err) => {
4256
+ if (instance.isUnmounted) {
4257
+ setPendingRequest(null);
4258
+ return;
4259
+ }
4161
4260
  onError(err);
4162
4261
  error.value = err;
4163
4262
  });
@@ -4215,14 +4314,22 @@ var VueRuntimeDOM = (function(exports) {
4215
4314
  setPendingRequest: (request) => pendingRequest = request
4216
4315
  };
4217
4316
  }
4218
- const useAsyncComponentState = (delay, timeout, onError) => {
4317
+ const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
4219
4318
  const loaded = /* @__PURE__ */ ref(false);
4220
4319
  const error = /* @__PURE__ */ ref();
4221
4320
  const delayed = /* @__PURE__ */ ref(!!delay);
4222
- if (delay) setTimeout(() => {
4321
+ let timeoutTimer;
4322
+ let delayTimer;
4323
+ if (instance) onUnmounted(() => {
4324
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
4325
+ if (delayTimer != null) clearTimeout(delayTimer);
4326
+ }, instance);
4327
+ if (delay) delayTimer = setTimeout(() => {
4328
+ if (instance && instance.isUnmounted) return;
4223
4329
  delayed.value = false;
4224
4330
  }, delay);
4225
- if (timeout != null) setTimeout(() => {
4331
+ if (timeout != null) timeoutTimer = setTimeout(() => {
4332
+ if (instance && instance.isUnmounted) return;
4226
4333
  if (!loaded.value && !error.value) {
4227
4334
  const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
4228
4335
  onError(err);
@@ -4240,6 +4347,7 @@ var VueRuntimeDOM = (function(exports) {
4240
4347
  * @internal
4241
4348
  */
4242
4349
  function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
4350
+ const wasConnected = el.isConnected;
4243
4351
  let patched = false;
4244
4352
  (instance.bu || (instance.bu = [])).push(() => patched = true);
4245
4353
  const performHydrate = () => {
@@ -4250,6 +4358,7 @@ var VueRuntimeDOM = (function(exports) {
4250
4358
  }
4251
4359
  return;
4252
4360
  }
4361
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
4253
4362
  hydrate();
4254
4363
  };
4255
4364
  const doHydrate = hydrateStrategy ? () => {
@@ -4615,8 +4724,9 @@ var VueRuntimeDOM = (function(exports) {
4615
4724
  * Compiler runtime helper for rendering `<slot/>`
4616
4725
  * @private
4617
4726
  */
4618
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4727
+ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
4619
4728
  let slot = slots[name];
4729
+ if (fallback) fallback.__vdom = true;
4620
4730
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
4621
4731
  if (vaporSlot) {
4622
4732
  const ret = (openBlock(), createBlock(VaporSlot, props));
@@ -4624,25 +4734,35 @@ var VueRuntimeDOM = (function(exports) {
4624
4734
  slot: vaporSlot,
4625
4735
  fallback
4626
4736
  };
4737
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
4627
4738
  return ret;
4628
4739
  }
4629
4740
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
4630
- const hasProps = Object.keys(props).length > 0;
4631
- if (name !== "default") props.name = name;
4632
- return openBlock(), createBlock(Fragment, null, [createVNode("slot", props, fallback && fallback())], hasProps ? -2 : 64);
4741
+ const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
4742
+ const hasProps = Object.keys(slotProps).length > 0;
4743
+ if (name !== "default") slotProps.name = name;
4744
+ return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
4633
4745
  }
4634
4746
  if (slot && slot.length > 1) {
4635
4747
  warn$1("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.");
4636
4748
  slot = () => [];
4637
4749
  }
4638
4750
  if (slot && slot._c) slot._d = false;
4751
+ const prevStackSize = blockStack.length;
4639
4752
  openBlock();
4640
- const validSlotContent = slot && ensureValidVNode(slot(props));
4641
- ensureVaporSlotFallback(validSlotContent, fallback);
4642
- const slotKey = props.key || validSlotContent && validSlotContent.key;
4643
- const rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
4753
+ let rendered;
4754
+ try {
4755
+ const validSlotContent = slot && ensureValidVNode(slot(props));
4756
+ ensureVaporSlotFallback(validSlotContent, fallback);
4757
+ const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
4758
+ rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
4759
+ } catch (err) {
4760
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
4761
+ throw err;
4762
+ } finally {
4763
+ if (slot && slot._c) slot._d = true;
4764
+ }
4644
4765
  if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
4645
- if (slot && slot._c) slot._d = true;
4646
4766
  return rendered;
4647
4767
  }
4648
4768
  function ensureValidVNode(vnodes) {
@@ -4655,9 +4775,7 @@ var VueRuntimeDOM = (function(exports) {
4655
4775
  }
4656
4776
  function ensureVaporSlotFallback(vnodes, fallback) {
4657
4777
  let vaporSlot;
4658
- if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
4659
- if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
4660
- }
4778
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
4661
4779
  }
4662
4780
  //#endregion
4663
4781
  //#region packages/runtime-core/src/helpers/toHandlers.ts
@@ -5023,26 +5141,39 @@ var VueRuntimeDOM = (function(exports) {
5023
5141
  function withAsyncContext(getAwaitable) {
5024
5142
  const ctx = getCurrentGenericInstance();
5025
5143
  const inSSRSetup = isInSSRComponentSetup;
5144
+ const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
5026
5145
  if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
5027
5146
  let awaitable = getAwaitable();
5028
5147
  setCurrentInstance(null, void 0);
5029
5148
  if (inSSRSetup) setInSSRSetupState(false);
5030
5149
  const restore = () => {
5150
+ const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5031
5151
  setCurrentInstance(ctx);
5032
5152
  if (inSSRSetup) setInSSRSetupState(true);
5153
+ const reset = restoreAsyncContext && restoreAsyncContext();
5154
+ return () => {
5155
+ if (reset) reset();
5156
+ if (resetStoppedScope) resetStoppedScope.reset();
5157
+ };
5033
5158
  };
5034
5159
  const cleanup = () => {
5035
5160
  setCurrentInstance(null, void 0);
5036
5161
  if (inSSRSetup) setInSSRSetupState(false);
5037
5162
  };
5038
5163
  if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
5039
- restore();
5040
- Promise.resolve().then(() => Promise.resolve().then(cleanup));
5164
+ const reset = restore();
5165
+ Promise.resolve().then(() => Promise.resolve().then(() => {
5166
+ if (reset) reset();
5167
+ cleanup();
5168
+ }));
5041
5169
  throw e;
5042
5170
  });
5043
5171
  return [awaitable, () => {
5044
- restore();
5045
- Promise.resolve().then(cleanup);
5172
+ const reset = restore();
5173
+ Promise.resolve().then(() => {
5174
+ if (reset) reset();
5175
+ cleanup();
5176
+ });
5046
5177
  }];
5047
5178
  }
5048
5179
  //#endregion
@@ -5466,12 +5597,13 @@ var VueRuntimeDOM = (function(exports) {
5466
5597
  for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
5467
5598
  else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
5468
5599
  }
5469
- if (!parentPassedModelValue || !parentPassedModelUpdater) {
5600
+ const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
5601
+ if (!hasVModel) {
5470
5602
  localValue = value;
5471
5603
  trigger();
5472
5604
  }
5473
5605
  i.emit(`update:${name}`, emittedValue);
5474
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) trigger();
5606
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
5475
5607
  prevSetValue = value;
5476
5608
  prevEmittedValue = emittedValue;
5477
5609
  }
@@ -5578,7 +5710,8 @@ var VueRuntimeDOM = (function(exports) {
5578
5710
  */
5579
5711
  function isEmitListener(options, key) {
5580
5712
  if (!options || !isOn(key)) return false;
5581
- key = key.slice(2).replace(/Once$/, "");
5713
+ key = key.slice(2);
5714
+ key = key === "Once" ? key : key.replace(/Once$/, "");
5582
5715
  return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
5583
5716
  }
5584
5717
  //#endregion
@@ -5762,15 +5895,19 @@ var VueRuntimeDOM = (function(exports) {
5762
5895
  if (key === "style" && isObject(nextProp) && isObject(prevProp)) return !looseEqual(nextProp, prevProp);
5763
5896
  return nextProp !== prevProp;
5764
5897
  }
5765
- function updateHOCHostEl({ vnode, parent }, el) {
5898
+ function updateHOCHostEl({ vnode, parent, suspense }, el) {
5766
5899
  while (parent && !parent.vapor) {
5767
5900
  const root = parent.subTree;
5768
- if (root.suspense && root.suspense.activeBranch === vnode) root.el = vnode.el;
5901
+ if (root.suspense && root.suspense.activeBranch === vnode) {
5902
+ root.suspense.vnode.el = root.el = el;
5903
+ vnode = root;
5904
+ }
5769
5905
  if (root === vnode) {
5770
5906
  (vnode = parent.vnode).el = el;
5771
5907
  parent = parent.parent;
5772
5908
  } else break;
5773
5909
  }
5910
+ if (suspense && suspense.activeBranch === vnode) suspense.vnode.el = el;
5774
5911
  }
5775
5912
  //#endregion
5776
5913
  //#region packages/runtime-core/src/internalObject.ts
@@ -6049,7 +6186,7 @@ var VueRuntimeDOM = (function(exports) {
6049
6186
  const receivedType = toRawType(value);
6050
6187
  const expectedValue = styleValue(value, expectedType);
6051
6188
  const receivedValue = styleValue(value, receivedType);
6052
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
6189
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
6053
6190
  message += `, got ${receivedType} `;
6054
6191
  if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
6055
6192
  return message;
@@ -6058,7 +6195,8 @@ var VueRuntimeDOM = (function(exports) {
6058
6195
  * dev only
6059
6196
  */
6060
6197
  function styleValue(value, type) {
6061
- if (type === "String") return `"${value}"`;
6198
+ if (isSymbol(value)) return value.toString();
6199
+ else if (type === "String") return `"${value}"`;
6062
6200
  else if (type === "Number") return `${Number(value)}`;
6063
6201
  else return `${value}`;
6064
6202
  }
@@ -6075,8 +6213,11 @@ var VueRuntimeDOM = (function(exports) {
6075
6213
  /**
6076
6214
  * dev only
6077
6215
  */
6078
- function isBoolean(...args) {
6079
- return args.some((elem) => elem.toLowerCase() === "boolean");
6216
+ function isCoercible(...args) {
6217
+ return args.every((elem) => {
6218
+ const value = elem.toLowerCase();
6219
+ return value !== "boolean" && value !== "symbol";
6220
+ });
6080
6221
  }
6081
6222
  //#endregion
6082
6223
  //#region packages/runtime-core/src/componentSlots.ts
@@ -6346,10 +6487,19 @@ var VueRuntimeDOM = (function(exports) {
6346
6487
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6347
6488
  if (transition) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
6348
6489
  else hostInsert(el, container, anchor);
6349
- if ((vnodeHook = props && props.onVnodeMounted) || dirs) queuePostRenderEffect(() => {
6350
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
6351
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6352
- }, void 0, parentSuspense);
6490
+ if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
6491
+ const isHmr = isHmrUpdating;
6492
+ queuePostRenderEffect(() => {
6493
+ let prev;
6494
+ prev = setHmrUpdating(isHmr);
6495
+ try {
6496
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
6497
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6498
+ } finally {
6499
+ setHmrUpdating(prev);
6500
+ }
6501
+ }, void 0, parentSuspense);
6502
+ }
6353
6503
  };
6354
6504
  const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
6355
6505
  if (scopeId) hostSetScopeId(el, scopeId);
@@ -6372,7 +6522,7 @@ var VueRuntimeDOM = (function(exports) {
6372
6522
  if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
6373
6523
  if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
6374
6524
  parentComponent && toggleRecurse(parentComponent, true);
6375
- if (isHmrUpdating) {
6525
+ if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
6376
6526
  patchFlag = 0;
6377
6527
  optimized = false;
6378
6528
  dynamicChildren = null;
@@ -6452,19 +6602,35 @@ var VueRuntimeDOM = (function(exports) {
6452
6602
  n2.slotScopeIds = slotScopeIds;
6453
6603
  if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
6454
6604
  else {
6605
+ const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
6455
6606
  getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
6456
6607
  if (n2.dirs) {
6457
6608
  invokeDirectiveHook(n2, null, parentComponent, "created");
6458
6609
  invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
6459
6610
  }
6611
+ }, () => {
6612
+ if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
6460
6613
  });
6461
6614
  if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
6615
+ const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
6616
+ if (vnodeMountedHook) {
6617
+ const scopedVNode = n2;
6618
+ queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
6619
+ }
6462
6620
  }
6463
6621
  else {
6464
- getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized), () => {
6622
+ const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
6623
+ getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
6465
6624
  if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
6625
+ }, () => {
6626
+ const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
6627
+ if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
6466
6628
  });
6467
- if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, n1, parentComponent, "updated"), void 0, parentSuspense);
6629
+ const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
6630
+ if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
6631
+ n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
6632
+ vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
6633
+ }, void 0, parentSuspense);
6468
6634
  }
6469
6635
  else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
6470
6636
  else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
@@ -6810,8 +6976,10 @@ var VueRuntimeDOM = (function(exports) {
6810
6976
  else hostInsert(el, container, anchor);
6811
6977
  };
6812
6978
  const performLeave = () => {
6979
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
6813
6980
  if (el._isLeaving) el[leaveCbKey](true);
6814
- leave(el, () => {
6981
+ if (transition.persisted && !wasLeaving) remove();
6982
+ else leave(el, () => {
6815
6983
  remove();
6816
6984
  afterLeave && afterLeave();
6817
6985
  });
@@ -6822,7 +6990,7 @@ var VueRuntimeDOM = (function(exports) {
6822
6990
  else hostInsert(el, container, anchor);
6823
6991
  };
6824
6992
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
6825
- const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex } = vnode;
6993
+ const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
6826
6994
  if (patchFlag === -2) optimized = false;
6827
6995
  if (ref != null) {
6828
6996
  const prevSub = setActiveSub();
@@ -6842,7 +7010,10 @@ var VueRuntimeDOM = (function(exports) {
6842
7010
  if (shapeFlag & 6) if (isVaporComponent(type)) {
6843
7011
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
6844
7012
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
6845
- if (dirs) queuePostRenderEffect(() => invokeDirectiveHook(vnode, null, parentComponent, "unmounted"), void 0, parentSuspense);
7013
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
7014
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
7015
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7016
+ }, void 0, parentSuspense);
6846
7017
  return;
6847
7018
  } else unmountComponent(vnode.component, parentSuspense, doRemove);
6848
7019
  else {
@@ -6860,9 +7031,11 @@ var VueRuntimeDOM = (function(exports) {
6860
7031
  }
6861
7032
  if (doRemove) remove(vnode);
6862
7033
  }
6863
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) queuePostRenderEffect(() => {
7034
+ const shouldInvalidateMemo = memo != null && cacheIndex == null;
7035
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) queuePostRenderEffect(() => {
6864
7036
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
6865
7037
  shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
7038
+ if (shouldInvalidateMemo) vnode.el = null;
6866
7039
  }, void 0, parentSuspense);
6867
7040
  };
6868
7041
  const remove = (vnode) => {
@@ -6901,7 +7074,7 @@ var VueRuntimeDOM = (function(exports) {
6901
7074
  if (effect) {
6902
7075
  effect.stop();
6903
7076
  unmount(subTree, instance, parentSuspense, doRemove);
6904
- }
7077
+ } else if (doRemove && subTree && instance.vnode.el) remove(subTree);
6905
7078
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
6906
7079
  queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
6907
7080
  devtoolsComponentRemoved(instance);
@@ -7027,6 +7200,10 @@ var VueRuntimeDOM = (function(exports) {
7027
7200
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
7028
7201
  }
7029
7202
  function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
7203
+ if (force && transition.persisted && !el[leaveCbKey]) {
7204
+ insert();
7205
+ return;
7206
+ }
7030
7207
  if (force || needTransition(parentSuspense, transition)) {
7031
7208
  transition.beforeEnter(el);
7032
7209
  insert();
@@ -7215,6 +7392,7 @@ var VueRuntimeDOM = (function(exports) {
7215
7392
  pendingId: suspenseId++,
7216
7393
  timeout: typeof timeout === "number" ? timeout : -1,
7217
7394
  activeBranch: null,
7395
+ isFallbackMountPending: false,
7218
7396
  pendingBranch: null,
7219
7397
  isInFallback: !isHydrating,
7220
7398
  isHydrating,
@@ -7228,20 +7406,25 @@ var VueRuntimeDOM = (function(exports) {
7228
7406
  if (suspense.isHydrating) suspense.isHydrating = false;
7229
7407
  else if (!resume) {
7230
7408
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
7409
+ let hasUpdatedAnchor = false;
7231
7410
  if (delayEnter) activeBranch.transition.afterLeave = () => {
7232
7411
  if (pendingId === suspense.pendingId) {
7233
- move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7412
+ move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
7234
7413
  queuePostFlushCb(effects);
7235
7414
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
7236
7415
  }
7237
7416
  };
7238
- if (activeBranch) {
7239
- if (parentNode(activeBranch.el) === container) anchor = next(activeBranch);
7417
+ if (activeBranch && !suspense.isFallbackMountPending) {
7418
+ if (parentNode(activeBranch.el) === container) {
7419
+ anchor = next(activeBranch);
7420
+ hasUpdatedAnchor = true;
7421
+ }
7240
7422
  unmount(activeBranch, parentComponent, suspense, true);
7241
7423
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
7242
7424
  }
7243
7425
  if (!delayEnter) move(pendingBranch, container, anchor, 0, parentComponent);
7244
7426
  }
7427
+ suspense.isFallbackMountPending = false;
7245
7428
  setActiveBranch(suspense, pendingBranch);
7246
7429
  suspense.pendingBranch = null;
7247
7430
  suspense.isInFallback = false;
@@ -7271,12 +7454,16 @@ var VueRuntimeDOM = (function(exports) {
7271
7454
  triggerEvent(vnode, "onFallback");
7272
7455
  const anchor = next(activeBranch);
7273
7456
  const mountFallback = () => {
7457
+ suspense.isFallbackMountPending = false;
7274
7458
  if (!suspense.isInFallback) return;
7275
7459
  patch(null, fallbackVNode, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
7276
7460
  setActiveBranch(suspense, fallbackVNode);
7277
7461
  };
7278
7462
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
7279
- if (delayEnter) activeBranch.transition.afterLeave = mountFallback;
7463
+ if (delayEnter) {
7464
+ suspense.isFallbackMountPending = true;
7465
+ activeBranch.transition.afterLeave = mountFallback;
7466
+ }
7280
7467
  suspense.isInFallback = true;
7281
7468
  unmount(activeBranch, parentComponent, null, true);
7282
7469
  if (!delayEnter) mountFallback();
@@ -7295,6 +7482,7 @@ var VueRuntimeDOM = (function(exports) {
7295
7482
  handleError(err, instance, 0);
7296
7483
  }).then((asyncSetupResult) => {
7297
7484
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
7485
+ setCurrentInstance(null, void 0);
7298
7486
  instance.asyncResolved = true;
7299
7487
  onResolve(asyncSetupResult);
7300
7488
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
@@ -7584,11 +7772,29 @@ var VueRuntimeDOM = (function(exports) {
7584
7772
  el: vnode.el,
7585
7773
  anchor: vnode.anchor,
7586
7774
  ctx: vnode.ctx,
7587
- ce: vnode.ce
7775
+ ce: vnode.ce,
7776
+ vi: vnode.vi,
7777
+ vs: cloneVaporSlotMeta(vnode),
7778
+ vb: vnode.vb
7588
7779
  };
7589
7780
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
7590
7781
  return cloned;
7591
7782
  }
7783
+ function cloneVaporSlotMeta(vnode) {
7784
+ const vaporSlot = vnode.vs;
7785
+ if (!vaporSlot) return vaporSlot;
7786
+ const cloned = {
7787
+ slot: vaporSlot.slot,
7788
+ fallback: vaporSlot.fallback,
7789
+ outletFallback: vaporSlot.outletFallback
7790
+ };
7791
+ if (vnode.el) {
7792
+ cloned.state = vaporSlot.state;
7793
+ cloned.ref = vaporSlot.ref;
7794
+ cloned.scope = vaporSlot.scope;
7795
+ }
7796
+ return cloned;
7797
+ }
7592
7798
  /**
7593
7799
  * Dev only, for HMR of hoisted vnodes reused in v-for
7594
7800
  * https://github.com/vitejs/vite/issues/2022
@@ -7651,6 +7857,10 @@ var VueRuntimeDOM = (function(exports) {
7651
7857
  }
7652
7858
  }
7653
7859
  else if (isFunction(children)) {
7860
+ if (shapeFlag & 65) {
7861
+ normalizeChildren(vnode, { default: children });
7862
+ return;
7863
+ }
7654
7864
  children = {
7655
7865
  default: children,
7656
7866
  _ctx: currentRenderingInstance
@@ -7677,6 +7887,7 @@ var VueRuntimeDOM = (function(exports) {
7677
7887
  const existing = ret[key];
7678
7888
  const incoming = toMerge[key];
7679
7889
  if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) ret[key] = existing ? [].concat(existing, incoming) : incoming;
7890
+ else if (incoming == null && existing == null && !isModelListener(key)) ret[key] = incoming;
7680
7891
  } else if (key !== "") ret[key] = toMerge[key];
7681
7892
  }
7682
7893
  return ret;
@@ -8243,7 +8454,7 @@ var VueRuntimeDOM = (function(exports) {
8243
8454
  }
8244
8455
  //#endregion
8245
8456
  //#region packages/runtime-core/src/index.ts
8246
- const version = "3.6.0-beta.8";
8457
+ const version = "3.6.0-rc.1";
8247
8458
  const warn = warn$1;
8248
8459
  /**
8249
8460
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8706,7 +8917,10 @@ var VueRuntimeDOM = (function(exports) {
8706
8917
  }
8707
8918
  for (const key in next) {
8708
8919
  if (key === "display") hasControlledDisplay = true;
8709
- setStyle(style, key, next[key]);
8920
+ const value = next[key];
8921
+ if (value != null) {
8922
+ if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
8923
+ } else setStyle(style, key, "");
8710
8924
  }
8711
8925
  } else if (isCssString) {
8712
8926
  if (prev !== next) {
@@ -8754,6 +8968,14 @@ var VueRuntimeDOM = (function(exports) {
8754
8968
  }
8755
8969
  return rawName;
8756
8970
  }
8971
+ /**
8972
+ * Browsers update textarea width/height directly during native resize.
8973
+ * Only special-case this common textarea path for now; other resize scenarios
8974
+ * still follow normal vnode style patching.
8975
+ */
8976
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
8977
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
8978
+ }
8757
8979
  //#endregion
8758
8980
  //#region packages/runtime-dom/src/modules/attrs.ts
8759
8981
  const xlinkNS = "http://www.w3.org/1999/xlink";
@@ -8812,7 +9034,7 @@ var VueRuntimeDOM = (function(exports) {
8812
9034
  const existingInvoker = invokers[rawName];
8813
9035
  if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
8814
9036
  else {
8815
- const [name, options] = parseName(rawName);
9037
+ const [name, options] = parseEventName(rawName);
8816
9038
  if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
8817
9039
  else if (existingInvoker) {
8818
9040
  removeEventListener(el, name, existingInvoker, options);
@@ -8820,16 +9042,15 @@ var VueRuntimeDOM = (function(exports) {
8820
9042
  }
8821
9043
  }
8822
9044
  }
8823
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
8824
- function parseName(name) {
9045
+ const optionsModifierRE = /(Once|Passive|Capture)$/;
9046
+ const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
9047
+ function parseEventName(name) {
8825
9048
  let options;
8826
- if (optionsModifierRE.test(name)) {
8827
- options = {};
8828
- let m;
8829
- while (m = name.match(optionsModifierRE)) {
8830
- name = name.slice(0, name.length - m[0].length);
8831
- options[m[0].toLowerCase()] = true;
8832
- }
9049
+ let m;
9050
+ while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
9051
+ if (!options) options = {};
9052
+ name = name.slice(0, name.length - m[1].length);
9053
+ options[m[1].toLowerCase()] = true;
8833
9054
  }
8834
9055
  return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
8835
9056
  }
@@ -8840,7 +9061,21 @@ var VueRuntimeDOM = (function(exports) {
8840
9061
  const invoker = (e) => {
8841
9062
  if (!e._vts) e._vts = Date.now();
8842
9063
  else if (e._vts <= invoker.attached) return;
8843
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
9064
+ const value = invoker.value;
9065
+ if (isArray(value)) {
9066
+ const originalStop = e.stopImmediatePropagation;
9067
+ e.stopImmediatePropagation = () => {
9068
+ originalStop.call(e);
9069
+ e._stopped = true;
9070
+ };
9071
+ const handlers = value.slice();
9072
+ const args = [e];
9073
+ for (let i = 0; i < handlers.length; i++) {
9074
+ if (e._stopped) break;
9075
+ const handler = handlers[i];
9076
+ if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
9077
+ }
9078
+ } else callWithAsyncErrorHandling(value, instance, 5, [e]);
8844
9079
  };
8845
9080
  invoker.value = initialValue;
8846
9081
  invoker.attached = getNow();
@@ -8851,16 +9086,6 @@ var VueRuntimeDOM = (function(exports) {
8851
9086
  warn(`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?\nExpected function or array of functions, received type ${typeof value}.`);
8852
9087
  return NOOP;
8853
9088
  }
8854
- function patchStopImmediatePropagation(e, value) {
8855
- if (isArray(value)) {
8856
- const originalStop = e.stopImmediatePropagation;
8857
- e.stopImmediatePropagation = () => {
8858
- originalStop.call(e);
8859
- e._stopped = true;
8860
- };
8861
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
8862
- } else return value;
8863
- }
8864
9089
  //#endregion
8865
9090
  //#region packages/runtime-dom/src/patchProp.ts
8866
9091
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
@@ -9188,7 +9413,10 @@ var VueRuntimeDOM = (function(exports) {
9188
9413
  replacementNodes.push(child);
9189
9414
  }
9190
9415
  parent.removeChild(o);
9191
- slotReplacements.set(o, replacementNodes);
9416
+ slotReplacements.set(o, {
9417
+ nodes: replacementNodes,
9418
+ usedFallback: !content
9419
+ });
9192
9420
  }
9193
9421
  this._updateSlotNodes(slotReplacements);
9194
9422
  }
@@ -9360,7 +9588,7 @@ var VueRuntimeDOM = (function(exports) {
9360
9588
  prevChildren = [];
9361
9589
  if (children) for (let i = 0; i < children.length; i++) {
9362
9590
  const child = children[i];
9363
- if (child.el && child.el instanceof Element) {
9591
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
9364
9592
  prevChildren.push(child);
9365
9593
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
9366
9594
  positionMap.set(child, getPosition(child.el));
@@ -9501,7 +9729,8 @@ var VueRuntimeDOM = (function(exports) {
9501
9729
  const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
9502
9730
  const newValue = value == null ? "" : value;
9503
9731
  if (elValue === newValue) return;
9504
- if (document.activeElement === el && el.type !== "range") {
9732
+ const rootNode = el.getRootNode();
9733
+ if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement === el && el.type !== "range") {
9505
9734
  if (lazy && value === oldValue) return;
9506
9735
  if (trim && el.value.trim() === newValue) return;
9507
9736
  }
@@ -9583,7 +9812,8 @@ var VueRuntimeDOM = (function(exports) {
9583
9812
  mounted(el, { value }) {
9584
9813
  vModelSetSelected(el, value);
9585
9814
  },
9586
- beforeUpdate(el, _binding, vnode) {
9815
+ beforeUpdate(el, { value }, vnode) {
9816
+ el._modelValue = value;
9587
9817
  el[assignKey] = getModelAssigner(vnode);
9588
9818
  },
9589
9819
  updated(el, { value }) {
@@ -9594,10 +9824,10 @@ var VueRuntimeDOM = (function(exports) {
9594
9824
  * @internal
9595
9825
  */
9596
9826
  const vModelSelectInit = (el, value, number, set) => {
9597
- const isSetModel = isSet(value);
9827
+ el._modelValue = value;
9598
9828
  addEventListener(el, "change", () => {
9599
9829
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
9600
- (set || el[assignKey])(el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]);
9830
+ (set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
9601
9831
  el._assigning = true;
9602
9832
  nextTick(() => {
9603
9833
  el._assigning = false;
@@ -9608,6 +9838,7 @@ var VueRuntimeDOM = (function(exports) {
9608
9838
  * @internal
9609
9839
  */
9610
9840
  const vModelSetSelected = (el, value) => {
9841
+ el._modelValue = value;
9611
9842
  if (el._assigning) return;
9612
9843
  const isMultiple = el.multiple;
9613
9844
  const isArrayValue = isArray(value);