@vue/compat 3.6.0-beta.9 → 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/compat v3.6.0-beta.9
2
+ * @vue/compat v3.6.0-rc.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -526,6 +526,13 @@ function warn$2(msg, ...args) {
526
526
  const notifyBuffer = [];
527
527
  let batchDepth = 0;
528
528
  let activeSub = void 0;
529
+ let runDepth = 0;
530
+ function incRunDepth() {
531
+ ++runDepth;
532
+ }
533
+ function decRunDepth() {
534
+ --runDepth;
535
+ }
529
536
  let globalVersion = 0;
530
537
  let notifyIndex = 0;
531
538
  let notifyBufferLength = 0;
@@ -599,8 +606,10 @@ function propagate(link) {
599
606
  const sub = link.sub;
600
607
  let flags = sub.flags;
601
608
  if (flags & 3) {
602
- if (!(flags & 60)) sub.flags = flags | 32;
603
- else if (!(flags & 12)) flags = 0;
609
+ if (!(flags & 60)) {
610
+ sub.flags = flags | 32;
611
+ if (runDepth) sub.flags |= 8;
612
+ } else if (!(flags & 12)) flags = 0;
604
613
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
605
614
  else if (!(flags & 48) && isValidLink(link, sub)) {
606
615
  sub.flags = flags | 40;
@@ -669,13 +678,13 @@ function checkDirty(link, sub) {
669
678
  let dirty = false;
670
679
  if (sub.flags & 16) dirty = true;
671
680
  else if ((depFlags & 17) === 17) {
681
+ const subs = dep.subs;
672
682
  if (dep.update()) {
673
- const subs = dep.subs;
674
683
  if (subs.nextSub !== void 0) shallowPropagate(subs);
675
684
  dirty = true;
676
685
  }
677
686
  } else if ((depFlags & 33) === 33) {
678
- if (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {
687
+ stack = {
679
688
  value: link,
680
689
  prev: stack
681
690
  };
@@ -690,15 +699,12 @@ function checkDirty(link, sub) {
690
699
  }
691
700
  while (checkDepth) {
692
701
  --checkDepth;
693
- const firstSub = sub.subs;
694
- const hasMultipleSubs = firstSub.nextSub !== void 0;
695
- if (hasMultipleSubs) {
696
- link = stack.value;
697
- stack = stack.prev;
698
- } else link = firstSub;
702
+ link = stack.value;
703
+ stack = stack.prev;
699
704
  if (dirty) {
705
+ const subs = sub.subs;
700
706
  if (sub.update()) {
701
- if (hasMultipleSubs) shallowPropagate(firstSub);
707
+ if (subs.nextSub !== void 0) shallowPropagate(subs);
702
708
  sub = link.sub;
703
709
  continue;
704
710
  }
@@ -710,7 +716,7 @@ function checkDirty(link, sub) {
710
716
  }
711
717
  dirty = false;
712
718
  }
713
- return dirty;
719
+ return dirty && !!sub.flags;
714
720
  } while (true);
715
721
  }
716
722
  function shallowPropagate(link) {
@@ -1093,7 +1099,7 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
1093
1099
  }
1094
1100
  const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
1095
1101
  const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
1096
- if (target === /* @__PURE__ */ toRaw(receiver)) {
1102
+ if (target === /* @__PURE__ */ toRaw(receiver) && result) {
1097
1103
  if (!hadKey) trigger(target, "add", key, value);
1098
1104
  else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
1099
1105
  }
@@ -1311,9 +1317,6 @@ function targetTypeMap(rawType) {
1311
1317
  default: return 0;
1312
1318
  }
1313
1319
  }
1314
- function getTargetType(value) {
1315
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
1316
- }
1317
1320
  /* @__NO_SIDE_EFFECTS__ */
1318
1321
  function reactive(target) {
1319
1322
  if (/* @__PURE__ */ isReadonly(target)) return target;
@@ -1426,10 +1429,11 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1426
1429
  return target;
1427
1430
  }
1428
1431
  if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
1429
- const targetType = getTargetType(target);
1430
- if (targetType === 0) return target;
1432
+ if (target["__v_skip"] || !Object.isExtensible(target)) return target;
1431
1433
  const existingProxy = proxyMap.get(target);
1432
1434
  if (existingProxy) return existingProxy;
1435
+ const targetType = targetTypeMap(toRawType(target));
1436
+ if (targetType === 0) return target;
1433
1437
  const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
1434
1438
  proxyMap.set(target, proxy);
1435
1439
  return proxy;
@@ -1862,9 +1866,11 @@ var ReactiveEffect = class {
1862
1866
  if (!this.active) return this.fn();
1863
1867
  cleanup(this);
1864
1868
  const prevSub = startTracking(this);
1869
+ incRunDepth();
1865
1870
  try {
1866
1871
  return this.fn();
1867
1872
  } finally {
1873
+ decRunDepth();
1868
1874
  endTracking(this, prevSub);
1869
1875
  const flags = this.flags;
1870
1876
  if ((flags & 136) === 136) {
@@ -2245,8 +2251,9 @@ var WatcherEffect = class extends ReactiveEffect {
2245
2251
  if (once && cb) {
2246
2252
  const _cb = cb;
2247
2253
  cb = (...args) => {
2248
- _cb(...args);
2254
+ const res = _cb(...args);
2249
2255
  this.stop();
2256
+ return res;
2250
2257
  };
2251
2258
  }
2252
2259
  this.cb = cb;
@@ -2262,7 +2269,7 @@ var WatcherEffect = class extends ReactiveEffect {
2262
2269
  if (!this.cb) return;
2263
2270
  const { immediate, deep, call } = this.options;
2264
2271
  if (initialRun && !immediate) return;
2265
- if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2272
+ if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2266
2273
  cleanup(this);
2267
2274
  const currentWatcher = activeWatcher;
2268
2275
  activeWatcher = this;
@@ -2579,8 +2586,8 @@ function findInsertionIndex(order, queue, start, end) {
2579
2586
  /**
2580
2587
  * @internal for runtime-vapor only
2581
2588
  */
2582
- function queueJob(job, id, isPre = false) {
2583
- if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
2589
+ function queueJob(job, id, isPre = false, order = 0) {
2590
+ 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)) {
2584
2591
  jobsLength++;
2585
2592
  queueFlush();
2586
2593
  }
@@ -2689,6 +2696,7 @@ function flushJobs(seen) {
2689
2696
  }
2690
2697
  flushIndex = 0;
2691
2698
  jobsLength = 0;
2699
+ jobs.length = 0;
2692
2700
  flushPostFlushCbs(seen);
2693
2701
  currentFlushPromise = null;
2694
2702
  if (jobsLength || postJobs.length) flushJobs(seen);
@@ -2746,6 +2754,14 @@ function createRecord(id, initialDef) {
2746
2754
  function normalizeClassComponent(component) {
2747
2755
  return isClassComponent(component) ? component.__vccOpts : component;
2748
2756
  }
2757
+ function hasDirtyAncestor(instance, dirtyInstances) {
2758
+ let parent = instance.parent;
2759
+ while (parent) {
2760
+ if (dirtyInstances.has(parent)) return true;
2761
+ parent = parent.parent;
2762
+ }
2763
+ return false;
2764
+ }
2749
2765
  function rerender(id, newRender) {
2750
2766
  const record = map.get(id);
2751
2767
  if (!record) return;
@@ -2777,42 +2793,69 @@ function reload(id, newComp) {
2777
2793
  const isVapor = record.initialDef.__vapor;
2778
2794
  updateComponentDef(record.initialDef, newComp);
2779
2795
  const instances = [...record.instances];
2780
- if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
2796
+ if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2781
2797
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2782
- for (const instance of instances) instance.hmrReload(newComp);
2783
- } else for (const instance of instances) {
2784
- const oldComp = normalizeClassComponent(instance.type);
2785
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
2786
- if (!dirtyInstances) {
2787
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2788
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2789
- }
2790
- dirtyInstances.add(instance);
2791
- hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2792
- instance.appContext.propsCache.delete(instance.type);
2793
- instance.appContext.emitsCache.delete(instance.type);
2794
- instance.appContext.optionsCache.delete(instance.type);
2795
- if (instance.ceReload) {
2796
- dirtyInstances.add(instance);
2797
- instance.ceReload(newComp.styles);
2798
- dirtyInstances.delete(instance);
2799
- } else if (instance.parent) queueJob(() => {
2800
- isHmrUpdating = true;
2798
+ const dirtyInstances = new Set(instances);
2799
+ const rerenderedParents = /* @__PURE__ */ new Set();
2800
+ for (const instance of instances) {
2801
2801
  const parent = instance.parent;
2802
- if (parent.vapor) parent.hmrRerender();
2803
- else if (!(parent.effect.flags & 1024)) {
2804
- parent.renderCache = [];
2805
- parent.effect.run();
2802
+ if (parent) {
2803
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2804
+ rerenderedParents.add(parent);
2805
+ parent.hmrRerender();
2806
+ }
2807
+ } else instance.hmrReload(newComp);
2808
+ }
2809
+ } else {
2810
+ const parentUpdates = /* @__PURE__ */ new Map();
2811
+ const dirtyInstanceSet = new Set(instances);
2812
+ for (const instance of instances) {
2813
+ const oldComp = normalizeClassComponent(instance.type);
2814
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
2815
+ if (!dirtyInstances) {
2816
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2817
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2806
2818
  }
2807
- nextTick(() => {
2808
- isHmrUpdating = false;
2819
+ dirtyInstances.add(instance);
2820
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2821
+ instance.appContext.propsCache.delete(instance.type);
2822
+ instance.appContext.emitsCache.delete(instance.type);
2823
+ instance.appContext.optionsCache.delete(instance.type);
2824
+ if (instance.ceReload) {
2825
+ dirtyInstances.add(instance);
2826
+ instance.ceReload(newComp.styles);
2827
+ dirtyInstances.delete(instance);
2828
+ } else if (instance.parent) {
2829
+ const parent = instance.parent;
2830
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
2831
+ let updates = parentUpdates.get(parent);
2832
+ if (!updates) parentUpdates.set(parent, updates = []);
2833
+ updates.push([instance, dirtyInstances]);
2834
+ }
2835
+ } else if (instance.appContext.reload) instance.appContext.reload();
2836
+ else if (typeof window !== "undefined") window.location.reload();
2837
+ else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2838
+ if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2839
+ }
2840
+ parentUpdates.forEach((updates, parent) => {
2841
+ queueJob(() => {
2842
+ isHmrUpdating = true;
2843
+ if (parent.vapor) parent.hmrRerender();
2844
+ else {
2845
+ const i = parent;
2846
+ if (!(i.effect.flags & 1024)) {
2847
+ i.renderCache = [];
2848
+ i.effect.run();
2849
+ }
2850
+ }
2851
+ nextTick(() => {
2852
+ isHmrUpdating = false;
2853
+ });
2854
+ updates.forEach(([instance, dirtyInstances]) => {
2855
+ dirtyInstances.delete(instance);
2856
+ });
2809
2857
  });
2810
- dirtyInstances.delete(instance);
2811
2858
  });
2812
- else if (instance.appContext.reload) instance.appContext.reload();
2813
- else if (typeof window !== "undefined") window.location.reload();
2814
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2815
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2816
2859
  }
2817
2860
  queuePostFlushCb(() => {
2818
2861
  hmrDirtyComponents.clear();
@@ -3280,10 +3323,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
3280
3323
  const renderFnWithContext = (...args) => {
3281
3324
  if (renderFnWithContext._d) setBlockTracking(-1);
3282
3325
  const prevInstance = setCurrentRenderingInstance(ctx);
3326
+ const prevStackSize = blockStack.length;
3283
3327
  let res;
3284
3328
  try {
3285
3329
  res = fn(...args);
3286
3330
  } finally {
3331
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
3287
3332
  setCurrentRenderingInstance(prevInstance);
3288
3333
  if (renderFnWithContext._d) setBlockTracking(1);
3289
3334
  }
@@ -3518,6 +3563,7 @@ function createPathGetter(ctx, path) {
3518
3563
  }
3519
3564
  //#endregion
3520
3565
  //#region packages/runtime-core/src/components/Teleport.ts
3566
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
3521
3567
  const TeleportEndKey = Symbol("_vte");
3522
3568
  const isTeleport = (type) => type.__isTeleport;
3523
3569
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -3543,58 +3589,70 @@ const TeleportImpl = {
3543
3589
  name: "Teleport",
3544
3590
  __isTeleport: true,
3545
3591
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
3546
- const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
3592
+ const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
3547
3593
  const disabled = isTeleportDisabled(n2.props);
3548
- let { shapeFlag, children, dynamicChildren } = n2;
3594
+ let { dynamicChildren } = n2;
3549
3595
  if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
3550
3596
  optimized = false;
3551
3597
  dynamicChildren = null;
3552
3598
  }
3599
+ const mount = (vnode, container, anchor) => {
3600
+ if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3601
+ };
3602
+ const mountToTarget = (vnode = n2) => {
3603
+ const disabled = isTeleportDisabled(vnode.props);
3604
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
3605
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
3606
+ if (target) {
3607
+ if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
3608
+ else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
3609
+ if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3610
+ if (!disabled) {
3611
+ mount(vnode, target, targetAnchor);
3612
+ updateCssVars(vnode, false);
3613
+ }
3614
+ } else if (!!(process.env.NODE_ENV !== "production") && !disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3615
+ };
3616
+ const queuePendingMount = (vnode) => {
3617
+ const mountJob = () => {
3618
+ if (pendingMounts.get(vnode) !== mountJob) return;
3619
+ pendingMounts.delete(vnode);
3620
+ if (isTeleportDisabled(vnode.props)) {
3621
+ mount(vnode, parentNode(vnode.el) || container, vnode.anchor);
3622
+ updateCssVars(vnode, true);
3623
+ }
3624
+ mountToTarget(vnode);
3625
+ };
3626
+ pendingMounts.set(vnode, mountJob);
3627
+ queuePostRenderEffect(mountJob, void 0, parentSuspense);
3628
+ };
3553
3629
  if (n1 == null) {
3554
3630
  const placeholder = n2.el = !!(process.env.NODE_ENV !== "production") ? createComment("teleport start") : createText("");
3555
3631
  const mainAnchor = n2.anchor = !!(process.env.NODE_ENV !== "production") ? createComment("teleport end") : createText("");
3556
3632
  insert(placeholder, container, anchor);
3557
3633
  insert(mainAnchor, container, anchor);
3558
- const mount = (container, anchor) => {
3559
- if (shapeFlag & 16) mountChildren(children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3560
- };
3561
- const mountToTarget = () => {
3562
- const target = n2.target = resolveTarget(n2.props, querySelector);
3563
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
3564
- if (target) {
3565
- if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
3566
- else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
3567
- if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3568
- if (!disabled) {
3569
- mount(target, targetAnchor);
3570
- updateCssVars(n2, false);
3571
- }
3572
- } else if (!!(process.env.NODE_ENV !== "production") && !disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3573
- };
3634
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3635
+ queuePendingMount(n2);
3636
+ return;
3637
+ }
3574
3638
  if (disabled) {
3575
- mount(container, mainAnchor);
3639
+ mount(n2, container, mainAnchor);
3576
3640
  updateCssVars(n2, true);
3577
3641
  }
3578
- if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3579
- n2.el.__isMounted = false;
3580
- queuePostRenderEffect(() => {
3581
- if (n2.el.__isMounted !== false) return;
3582
- mountToTarget();
3583
- delete n2.el.__isMounted;
3584
- }, void 0, parentSuspense);
3585
- } else mountToTarget();
3642
+ mountToTarget();
3586
3643
  } else {
3587
3644
  n2.el = n1.el;
3588
- n2.targetStart = n1.targetStart;
3589
3645
  const mainAnchor = n2.anchor = n1.anchor;
3590
- const target = n2.target = n1.target;
3591
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3592
- if (n1.el.__isMounted === false) {
3593
- queuePostRenderEffect(() => {
3594
- TeleportImpl.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
3595
- }, void 0, parentSuspense);
3646
+ const pendingMount = pendingMounts.get(n1);
3647
+ if (pendingMount) {
3648
+ pendingMount.flags |= 4;
3649
+ pendingMounts.delete(n1);
3650
+ queuePendingMount(n2);
3596
3651
  return;
3597
3652
  }
3653
+ n2.targetStart = n1.targetStart;
3654
+ const target = n2.target = n1.target;
3655
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3598
3656
  const wasDisabled = isTeleportDisabled(n1.props);
3599
3657
  const currentContainer = wasDisabled ? container : target;
3600
3658
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -3608,24 +3666,30 @@ const TeleportImpl = {
3608
3666
  if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
3609
3667
  else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
3610
3668
  } else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
3611
- const nextTarget = n2.target = resolveTarget(n2.props, querySelector);
3612
- if (nextTarget) moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
3613
- else if (!!(process.env.NODE_ENV !== "production")) warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
3669
+ const nextTarget = resolveTarget(n2.props, querySelector);
3670
+ if (nextTarget) {
3671
+ n2.target = nextTarget;
3672
+ moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
3673
+ } else if (!!(process.env.NODE_ENV !== "production")) warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
3614
3674
  } else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
3615
3675
  updateCssVars(n2, disabled);
3616
3676
  }
3617
3677
  },
3618
3678
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
3619
- const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
3679
+ const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
3680
+ const disabled = isTeleportDisabled(props);
3681
+ const shouldRemove = doRemove || !disabled;
3682
+ const pendingMount = pendingMounts.get(vnode);
3683
+ if (pendingMount) {
3684
+ pendingMount.flags |= 4;
3685
+ pendingMounts.delete(vnode);
3686
+ }
3620
3687
  if (targetStart) hostRemove(targetStart);
3621
3688
  if (targetAnchor) hostRemove(targetAnchor);
3622
3689
  doRemove && hostRemove(anchor);
3623
- if (shapeFlag & 16) {
3624
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3625
- for (let i = 0; i < children.length; i++) {
3626
- const child = children[i];
3627
- unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3628
- }
3690
+ if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3691
+ const child = children[i];
3692
+ unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3629
3693
  }
3630
3694
  },
3631
3695
  move: moveTeleport,
@@ -3636,7 +3700,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3636
3700
  const { el, anchor, shapeFlag, children, props } = vnode;
3637
3701
  const isReorder = moveType === 2;
3638
3702
  if (isReorder) insert(el, container, parentAnchor);
3639
- if (!isReorder || isTeleportDisabled(props)) {
3703
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3640
3704
  if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
3641
3705
  }
3642
3706
  if (isReorder) insert(anchor, container, parentAnchor);
@@ -3761,8 +3825,8 @@ const BaseTransitionImpl = {
3761
3825
  const state = useTransitionState();
3762
3826
  return () => {
3763
3827
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
3764
- if (!children || !children.length) return;
3765
- const child = findNonCommentChild(children);
3828
+ const child = children && children.length ? findNonCommentChild(children) : instance.subTree ? createCommentVNode() : void 0;
3829
+ if (!child) return;
3766
3830
  const rawProps = /* @__PURE__ */ toRaw(props);
3767
3831
  const { mode } = rawProps;
3768
3832
  checkTransitionMode(mode);
@@ -4229,7 +4293,7 @@ function createHydrationFunctions(rendererInternals) {
4229
4293
  else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
4230
4294
  break;
4231
4295
  case VaporSlot:
4232
- nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
4296
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense);
4233
4297
  break;
4234
4298
  default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) nextNode = onMismatch();
4235
4299
  else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
@@ -4239,16 +4303,31 @@ function createHydrationFunctions(rendererInternals) {
4239
4303
  if (isFragmentStart) nextNode = locateClosingAnchor(node);
4240
4304
  else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
4241
4305
  else nextNode = nextSibling(node);
4242
- if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, null, parentComponent, parentSuspense);
4243
- else mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
4244
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4245
- let subTree;
4246
- if (isFragmentStart) {
4247
- subTree = createVNode(Fragment);
4248
- subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4249
- } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
4250
- subTree.el = node;
4251
- vnode.component.subTree = subTree;
4306
+ if (vnode.type.__vapor) {
4307
+ const vnodeBeforeMountHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeBeforeMount;
4308
+ getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense, () => {
4309
+ if (vnode.dirs) {
4310
+ invokeDirectiveHook(vnode, null, parentComponent, "created");
4311
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
4312
+ }
4313
+ }, () => {
4314
+ if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, vnode);
4315
+ });
4316
+ if (vnode.dirs) queueEffectWithSuspense(() => invokeDirectiveHook(vnode, null, parentComponent, "mounted"), void 0, parentSuspense);
4317
+ const vnodeMountedHook = !isAsyncWrapper(vnode) && vnode.props && vnode.props.onVnodeMounted;
4318
+ if (vnodeMountedHook) queueEffectWithSuspense(() => invokeVNodeHook(vnodeMountedHook, parentComponent, vnode), void 0, parentSuspense);
4319
+ } else {
4320
+ mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
4321
+ const component = vnode.component;
4322
+ if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved || component.asyncDep && !component.asyncResolved) {
4323
+ let subTree;
4324
+ if (isFragmentStart) {
4325
+ subTree = createVNode(Fragment);
4326
+ subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4327
+ } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
4328
+ subTree.el = node;
4329
+ component.subTree = subTree;
4330
+ }
4252
4331
  }
4253
4332
  } else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
4254
4333
  else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
@@ -4260,9 +4339,10 @@ function createHydrationFunctions(rendererInternals) {
4260
4339
  };
4261
4340
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
4262
4341
  optimized = optimized || !!vnode.dynamicChildren;
4263
- const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
4342
+ const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
4264
4343
  const forcePatch = type === "input" || type === "option";
4265
- if (!!(process.env.NODE_ENV !== "production") || forcePatch || patchFlag !== -1) {
4344
+ const hasDynamicProps = !!dynamicProps;
4345
+ if (!!(process.env.NODE_ENV !== "production") || forcePatch || hasDynamicProps || patchFlag !== -1) {
4266
4346
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
4267
4347
  let needCallTransitionHooks = false;
4268
4348
  if (isTemplateNode(el)) {
@@ -4278,15 +4358,11 @@ function createHydrationFunctions(rendererInternals) {
4278
4358
  }
4279
4359
  if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
4280
4360
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
4281
- let hasWarned = false;
4361
+ if (next && !isMismatchAllowed(el, 1)) {
4362
+ (process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
4363
+ logMismatchError();
4364
+ }
4282
4365
  while (next) {
4283
- if (!isMismatchAllowed(el, 1)) {
4284
- if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
4285
- warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
4286
- hasWarned = true;
4287
- }
4288
- logMismatchError();
4289
- }
4290
4366
  const cur = next;
4291
4367
  next = next.nextSibling;
4292
4368
  remove(cur);
@@ -4304,11 +4380,12 @@ function createHydrationFunctions(rendererInternals) {
4304
4380
  }
4305
4381
  }
4306
4382
  if (props) {
4307
- if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & 48) {
4383
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || hasDynamicProps || !optimized || patchFlag & 48) {
4308
4384
  const isCustomElement = el.tagName.includes("-");
4385
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
4309
4386
  for (const key in props) {
4310
4387
  if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
4311
- 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);
4388
+ 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);
4312
4389
  }
4313
4390
  } else if (props.onClick) patchProp(el, "onClick", null, props.onClick, void 0, parentComponent);
4314
4391
  else if (patchFlag & 4 && /* @__PURE__ */ isReactive(props.style)) for (const key in props.style) props.style[key];
@@ -4328,7 +4405,7 @@ function createHydrationFunctions(rendererInternals) {
4328
4405
  optimized = optimized || !!parentVNode.dynamicChildren;
4329
4406
  const children = parentVNode.children;
4330
4407
  const l = children.length;
4331
- let hasWarned = false;
4408
+ let hasCheckedMismatch = false;
4332
4409
  for (let i = 0; i < l; i++) {
4333
4410
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4334
4411
  const isText = vnode.type === Text;
@@ -4342,12 +4419,12 @@ function createHydrationFunctions(rendererInternals) {
4342
4419
  node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
4343
4420
  } else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
4344
4421
  else {
4345
- if (!isMismatchAllowed(container, 1)) {
4346
- if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
4347
- warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
4348
- hasWarned = true;
4422
+ if (!hasCheckedMismatch) {
4423
+ hasCheckedMismatch = true;
4424
+ if (!isMismatchAllowed(container, 1)) {
4425
+ (process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
4426
+ logMismatchError();
4349
4427
  }
4350
- logMismatchError();
4351
4428
  }
4352
4429
  patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
4353
4430
  }
@@ -4367,7 +4444,7 @@ function createHydrationFunctions(rendererInternals) {
4367
4444
  }
4368
4445
  };
4369
4446
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
4370
- if (!isMismatchAllowed(node.parentElement, 1)) {
4447
+ if (!isNodeMismatchAllowed(node, vnode)) {
4371
4448
  (process.env.NODE_ENV !== "production" || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && 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);
4372
4449
  logMismatchError();
4373
4450
  }
@@ -4543,7 +4620,9 @@ const MismatchTypeString = {
4543
4620
  };
4544
4621
  function isMismatchAllowed(el, allowedType) {
4545
4622
  if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
4546
- const allowedAttr = el && el.getAttribute(allowMismatchAttr);
4623
+ return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
4624
+ }
4625
+ function isMismatchAllowedByAttr(allowedAttr, allowedType) {
4547
4626
  if (allowedAttr == null) return false;
4548
4627
  else if (allowedAttr === "") return true;
4549
4628
  else {
@@ -4552,6 +4631,16 @@ function isMismatchAllowed(el, allowedType) {
4552
4631
  return list.includes(MismatchTypeString[allowedType]);
4553
4632
  }
4554
4633
  }
4634
+ function isNodeMismatchAllowed(node, vnode) {
4635
+ return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
4636
+ }
4637
+ function isMismatchAllowedByNode(node) {
4638
+ return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
4639
+ }
4640
+ function isMismatchAllowedByVNode({ props }) {
4641
+ const allowedAttr = props && props[allowMismatchAttr];
4642
+ return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
4643
+ }
4555
4644
  //#endregion
4556
4645
  //#region packages/runtime-core/src/hydrationStrategies.ts
4557
4646
  let requestIdleCallback;
@@ -4670,11 +4759,16 @@ function defineAsyncComponent(source) {
4670
4759
  onError(err);
4671
4760
  return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
4672
4761
  });
4673
- const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
4762
+ const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
4674
4763
  load().then(() => {
4764
+ if (instance.isUnmounted) return;
4675
4765
  loaded.value = true;
4676
4766
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
4677
4767
  }).catch((err) => {
4768
+ if (instance.isUnmounted) {
4769
+ setPendingRequest(null);
4770
+ return;
4771
+ }
4678
4772
  onError(err);
4679
4773
  error.value = err;
4680
4774
  });
@@ -4732,14 +4826,22 @@ function createAsyncComponentContext(source) {
4732
4826
  setPendingRequest: (request) => pendingRequest = request
4733
4827
  };
4734
4828
  }
4735
- const useAsyncComponentState = (delay, timeout, onError) => {
4829
+ const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
4736
4830
  const loaded = /* @__PURE__ */ ref(false);
4737
4831
  const error = /* @__PURE__ */ ref();
4738
4832
  const delayed = /* @__PURE__ */ ref(!!delay);
4739
- if (delay) setTimeout(() => {
4833
+ let timeoutTimer;
4834
+ let delayTimer;
4835
+ if (instance) onUnmounted(() => {
4836
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
4837
+ if (delayTimer != null) clearTimeout(delayTimer);
4838
+ }, instance);
4839
+ if (delay) delayTimer = setTimeout(() => {
4840
+ if (instance && instance.isUnmounted) return;
4740
4841
  delayed.value = false;
4741
4842
  }, delay);
4742
- if (timeout != null) setTimeout(() => {
4843
+ if (timeout != null) timeoutTimer = setTimeout(() => {
4844
+ if (instance && instance.isUnmounted) return;
4743
4845
  if (!loaded.value && !error.value) {
4744
4846
  const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
4745
4847
  onError(err);
@@ -4757,6 +4859,7 @@ const useAsyncComponentState = (delay, timeout, onError) => {
4757
4859
  * @internal
4758
4860
  */
4759
4861
  function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
4862
+ const wasConnected = el.isConnected;
4760
4863
  let patched = false;
4761
4864
  (instance.bu || (instance.bu = [])).push(() => patched = true);
4762
4865
  const performHydrate = () => {
@@ -4767,6 +4870,7 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
4767
4870
  }
4768
4871
  return;
4769
4872
  }
4873
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
4770
4874
  hydrate();
4771
4875
  };
4772
4876
  const doHydrate = hydrateStrategy ? () => {
@@ -5351,8 +5455,9 @@ function createSlots(slots, dynamicSlots) {
5351
5455
  * Compiler runtime helper for rendering `<slot/>`
5352
5456
  * @private
5353
5457
  */
5354
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5458
+ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
5355
5459
  let slot = slots[name];
5460
+ if (fallback) fallback.__vdom = true;
5356
5461
  const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
5357
5462
  if (vaporSlot) {
5358
5463
  const ret = (openBlock(), createBlock(VaporSlot, props));
@@ -5360,25 +5465,35 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5360
5465
  slot: vaporSlot,
5361
5466
  fallback
5362
5467
  };
5468
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
5363
5469
  return ret;
5364
5470
  }
5365
5471
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
5366
- const hasProps = Object.keys(props).length > 0;
5367
- if (name !== "default") props.name = name;
5368
- return openBlock(), createBlock(Fragment, null, [createVNode("slot", props, fallback && fallback())], hasProps ? -2 : 64);
5472
+ const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
5473
+ const hasProps = Object.keys(slotProps).length > 0;
5474
+ if (name !== "default") slotProps.name = name;
5475
+ return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
5369
5476
  }
5370
5477
  if (!!(process.env.NODE_ENV !== "production") && slot && slot.length > 1) {
5371
5478
  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.");
5372
5479
  slot = () => [];
5373
5480
  }
5374
5481
  if (slot && slot._c) slot._d = false;
5482
+ const prevStackSize = blockStack.length;
5375
5483
  openBlock();
5376
- const validSlotContent = slot && ensureValidVNode(slot(props));
5377
- ensureVaporSlotFallback(validSlotContent, fallback);
5378
- const slotKey = props.key || validSlotContent && validSlotContent.key;
5379
- const rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
5484
+ let rendered;
5485
+ try {
5486
+ const validSlotContent = slot && ensureValidVNode(slot(props));
5487
+ ensureVaporSlotFallback(validSlotContent, fallback);
5488
+ const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
5489
+ rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
5490
+ } catch (err) {
5491
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
5492
+ throw err;
5493
+ } finally {
5494
+ if (slot && slot._c) slot._d = true;
5495
+ }
5380
5496
  if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
5381
- if (slot && slot._c) slot._d = true;
5382
5497
  return rendered;
5383
5498
  }
5384
5499
  function ensureValidVNode(vnodes) {
@@ -5391,9 +5506,7 @@ function ensureValidVNode(vnodes) {
5391
5506
  }
5392
5507
  function ensureVaporSlotFallback(vnodes, fallback) {
5393
5508
  let vaporSlot;
5394
- if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
5395
- if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
5396
- }
5509
+ if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) vaporSlot.outletFallback = fallback;
5397
5510
  }
5398
5511
  //#endregion
5399
5512
  //#region packages/runtime-core/src/helpers/toHandlers.ts
@@ -5948,26 +6061,39 @@ function createPropsRestProxy(props, excludedKeys) {
5948
6061
  function withAsyncContext(getAwaitable) {
5949
6062
  const ctx = getCurrentGenericInstance();
5950
6063
  const inSSRSetup = isInSSRComponentSetup;
6064
+ const restoreAsyncContext = ctx && ctx.restoreAsyncContext ? ctx.restoreAsyncContext.bind(ctx) : void 0;
5951
6065
  if (!!(process.env.NODE_ENV !== "production") && !ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
5952
6066
  let awaitable = getAwaitable();
5953
6067
  setCurrentInstance(null, void 0);
5954
6068
  if (inSSRSetup) setInSSRSetupState(false);
5955
6069
  const restore = () => {
6070
+ const resetStoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5956
6071
  setCurrentInstance(ctx);
5957
6072
  if (inSSRSetup) setInSSRSetupState(true);
6073
+ const reset = restoreAsyncContext && restoreAsyncContext();
6074
+ return () => {
6075
+ if (reset) reset();
6076
+ if (resetStoppedScope) resetStoppedScope.reset();
6077
+ };
5958
6078
  };
5959
6079
  const cleanup = () => {
5960
6080
  setCurrentInstance(null, void 0);
5961
6081
  if (inSSRSetup) setInSSRSetupState(false);
5962
6082
  };
5963
6083
  if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
5964
- restore();
5965
- Promise.resolve().then(() => Promise.resolve().then(cleanup));
6084
+ const reset = restore();
6085
+ Promise.resolve().then(() => Promise.resolve().then(() => {
6086
+ if (reset) reset();
6087
+ cleanup();
6088
+ }));
5966
6089
  throw e;
5967
6090
  });
5968
6091
  return [awaitable, () => {
5969
- restore();
5970
- Promise.resolve().then(cleanup);
6092
+ const reset = restore();
6093
+ Promise.resolve().then(() => {
6094
+ if (reset) reset();
6095
+ cleanup();
6096
+ });
5971
6097
  }];
5972
6098
  }
5973
6099
  //#endregion
@@ -6287,7 +6413,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6287
6413
  if (options.el) return vm.$mount(options.el);
6288
6414
  else return vm;
6289
6415
  }
6290
- Vue.version = `2.6.14-compat:3.6.0-beta.9`;
6416
+ Vue.version = `2.6.14-compat:3.6.0-rc.1`;
6291
6417
  Vue.config = singletonApp.config;
6292
6418
  Vue.use = (plugin, ...options) => {
6293
6419
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -6542,7 +6668,9 @@ function defineReactive(obj, key, val) {
6542
6668
  else Object.keys(val).forEach((key) => {
6543
6669
  try {
6544
6670
  defineReactiveSimple(val, key, val[key]);
6545
- } catch (e) {}
6671
+ } catch (e) {
6672
+ if (!!(process.env.NODE_ENV !== "production")) warn$1(`Failed making property "${key}" reactive:`, e);
6673
+ }
6546
6674
  });
6547
6675
  }
6548
6676
  const i = obj.$;
@@ -6793,12 +6921,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
6793
6921
  for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
6794
6922
  else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
6795
6923
  }
6796
- if (!parentPassedModelValue || !parentPassedModelUpdater) {
6924
+ const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
6925
+ if (!hasVModel) {
6797
6926
  localValue = value;
6798
6927
  trigger();
6799
6928
  }
6800
6929
  i.emit(`update:${name}`, emittedValue);
6801
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) trigger();
6930
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
6802
6931
  prevSetValue = value;
6803
6932
  prevEmittedValue = emittedValue;
6804
6933
  }
@@ -6911,7 +7040,8 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
6911
7040
  function isEmitListener(options, key) {
6912
7041
  if (!options || !isOn(key)) return false;
6913
7042
  if (key.startsWith(compatModelEventPrefix)) return true;
6914
- key = key.slice(2).replace(/Once$/, "");
7043
+ key = key.slice(2);
7044
+ key = key === "Once" ? key : key.replace(/Once$/, "");
6915
7045
  return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
6916
7046
  }
6917
7047
  //#endregion
@@ -7433,7 +7563,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
7433
7563
  const receivedType = toRawType(value);
7434
7564
  const expectedValue = styleValue(value, expectedType);
7435
7565
  const receivedValue = styleValue(value, receivedType);
7436
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
7566
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
7437
7567
  message += `, got ${receivedType} `;
7438
7568
  if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
7439
7569
  return message;
@@ -7442,7 +7572,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
7442
7572
  * dev only
7443
7573
  */
7444
7574
  function styleValue(value, type) {
7445
- if (type === "String") return `"${value}"`;
7575
+ if (isSymbol(value)) return value.toString();
7576
+ else if (type === "String") return `"${value}"`;
7446
7577
  else if (type === "Number") return `${Number(value)}`;
7447
7578
  else return `${value}`;
7448
7579
  }
@@ -7459,8 +7590,11 @@ function isExplicable(type) {
7459
7590
  /**
7460
7591
  * dev only
7461
7592
  */
7462
- function isBoolean(...args) {
7463
- return args.some((elem) => elem.toLowerCase() === "boolean");
7593
+ function isCoercible(...args) {
7594
+ return args.every((elem) => {
7595
+ const value = elem.toLowerCase();
7596
+ return value !== "boolean" && value !== "symbol";
7597
+ });
7464
7598
  }
7465
7599
  //#endregion
7466
7600
  //#region packages/runtime-core/src/componentSlots.ts
@@ -7797,7 +7931,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7797
7931
  if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
7798
7932
  if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
7799
7933
  parentComponent && toggleRecurse(parentComponent, true);
7800
- if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating) {
7934
+ if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
7801
7935
  patchFlag = 0;
7802
7936
  optimized = false;
7803
7937
  dynamicChildren = null;
@@ -7878,19 +8012,35 @@ function baseCreateRenderer(options, createHydrationFns) {
7878
8012
  n2.slotScopeIds = slotScopeIds;
7879
8013
  if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
7880
8014
  else {
8015
+ const vnodeBeforeMountHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeBeforeMount;
7881
8016
  getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
7882
8017
  if (n2.dirs) {
7883
8018
  invokeDirectiveHook(n2, null, parentComponent, "created");
7884
8019
  invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
7885
8020
  }
8021
+ }, () => {
8022
+ if (vnodeBeforeMountHook) invokeVNodeHook(vnodeBeforeMountHook, parentComponent, n2);
7886
8023
  });
7887
8024
  if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
8025
+ const vnodeMountedHook = !isAsyncWrapper(n2) && n2.props && n2.props.onVnodeMounted;
8026
+ if (vnodeMountedHook) {
8027
+ const scopedVNode = n2;
8028
+ queuePostRenderEffect(() => invokeVNodeHook(vnodeMountedHook, parentComponent, scopedVNode), void 0, parentSuspense);
8029
+ }
7888
8030
  }
7889
8031
  else {
7890
- getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized), () => {
8032
+ const shouldUpdate = shouldUpdateComponent(n1, n2, optimized);
8033
+ getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdate, () => {
7891
8034
  if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
8035
+ }, () => {
8036
+ const vnodeBeforeUpdateHook = n2.props && n2.props.onVnodeBeforeUpdate;
8037
+ if (vnodeBeforeUpdateHook) invokeVNodeHook(vnodeBeforeUpdateHook, parentComponent, n2, n1);
7892
8038
  });
7893
- if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, n1, parentComponent, "updated"), void 0, parentSuspense);
8039
+ const vnodeUpdatedHook = n2.props && n2.props.onVnodeUpdated;
8040
+ if (shouldUpdate && (vnodeUpdatedHook || n2.dirs)) queuePostRenderEffect(() => {
8041
+ n2.dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
8042
+ vnodeUpdatedHook && invokeVNodeHook(vnodeUpdatedHook, parentComponent, n2, n1);
8043
+ }, void 0, parentSuspense);
7894
8044
  }
7895
8045
  else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
7896
8046
  else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
@@ -8252,8 +8402,10 @@ function baseCreateRenderer(options, createHydrationFns) {
8252
8402
  else hostInsert(el, container, anchor);
8253
8403
  };
8254
8404
  const performLeave = () => {
8405
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
8255
8406
  if (el._isLeaving) el[leaveCbKey](true);
8256
- leave(el, () => {
8407
+ if (transition.persisted && !wasLeaving) remove();
8408
+ else leave(el, () => {
8257
8409
  remove();
8258
8410
  afterLeave && afterLeave();
8259
8411
  });
@@ -8284,7 +8436,10 @@ function baseCreateRenderer(options, createHydrationFns) {
8284
8436
  if (shapeFlag & 6) if (isVaporComponent(type)) {
8285
8437
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
8286
8438
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
8287
- if (dirs) queuePostRenderEffect(() => invokeDirectiveHook(vnode, null, parentComponent, "unmounted"), void 0, parentSuspense);
8439
+ if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || dirs) queuePostRenderEffect(() => {
8440
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
8441
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
8442
+ }, void 0, parentSuspense);
8288
8443
  return;
8289
8444
  } else unmountComponent(vnode.component, parentSuspense, doRemove);
8290
8445
  else {
@@ -8346,7 +8501,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8346
8501
  if (effect) {
8347
8502
  effect.stop();
8348
8503
  unmount(subTree, instance, parentSuspense, doRemove);
8349
- }
8504
+ } else if (doRemove && subTree && instance.vnode.el) remove(subTree);
8350
8505
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
8351
8506
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
8352
8507
  queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
@@ -8473,6 +8628,10 @@ function invalidateMount(hooks) {
8473
8628
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
8474
8629
  }
8475
8630
  function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
8631
+ if (force && transition.persisted && !el[leaveCbKey]) {
8632
+ insert();
8633
+ return;
8634
+ }
8476
8635
  if (force || needTransition(parentSuspense, transition)) {
8477
8636
  transition.beforeEnter(el);
8478
8637
  insert();
@@ -8677,15 +8836,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
8677
8836
  if (suspense.isHydrating) suspense.isHydrating = false;
8678
8837
  else if (!resume) {
8679
8838
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
8839
+ let hasUpdatedAnchor = false;
8680
8840
  if (delayEnter) activeBranch.transition.afterLeave = () => {
8681
8841
  if (pendingId === suspense.pendingId) {
8682
- move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
8842
+ move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
8683
8843
  queuePostFlushCb(effects);
8684
8844
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
8685
8845
  }
8686
8846
  };
8687
8847
  if (activeBranch && !suspense.isFallbackMountPending) {
8688
- if (parentNode(activeBranch.el) === container) anchor = next(activeBranch);
8848
+ if (parentNode(activeBranch.el) === container) {
8849
+ anchor = next(activeBranch);
8850
+ hasUpdatedAnchor = true;
8851
+ }
8689
8852
  unmount(activeBranch, parentComponent, suspense, true);
8690
8853
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
8691
8854
  }
@@ -8749,6 +8912,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
8749
8912
  handleError(err, instance, 0);
8750
8913
  }).then((asyncSetupResult) => {
8751
8914
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
8915
+ setCurrentInstance(null, void 0);
8752
8916
  instance.asyncResolved = true;
8753
8917
  onResolve(asyncSetupResult);
8754
8918
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
@@ -9081,12 +9245,30 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
9081
9245
  el: vnode.el,
9082
9246
  anchor: vnode.anchor,
9083
9247
  ctx: vnode.ctx,
9084
- ce: vnode.ce
9248
+ ce: vnode.ce,
9249
+ vi: vnode.vi,
9250
+ vs: cloneVaporSlotMeta(vnode),
9251
+ vb: vnode.vb
9085
9252
  };
9086
9253
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
9087
9254
  defineLegacyVNodeProperties(cloned);
9088
9255
  return cloned;
9089
9256
  }
9257
+ function cloneVaporSlotMeta(vnode) {
9258
+ const vaporSlot = vnode.vs;
9259
+ if (!vaporSlot) return vaporSlot;
9260
+ const cloned = {
9261
+ slot: vaporSlot.slot,
9262
+ fallback: vaporSlot.fallback,
9263
+ outletFallback: vaporSlot.outletFallback
9264
+ };
9265
+ if (vnode.el) {
9266
+ cloned.state = vaporSlot.state;
9267
+ cloned.ref = vaporSlot.ref;
9268
+ cloned.scope = vaporSlot.scope;
9269
+ }
9270
+ return cloned;
9271
+ }
9090
9272
  /**
9091
9273
  * Dev only, for HMR of hoisted vnodes reused in v-for
9092
9274
  * https://github.com/vitejs/vite/issues/2022
@@ -9149,6 +9331,10 @@ function normalizeChildren(vnode, children) {
9149
9331
  }
9150
9332
  }
9151
9333
  else if (isFunction(children)) {
9334
+ if (shapeFlag & 65) {
9335
+ normalizeChildren(vnode, { default: children });
9336
+ return;
9337
+ }
9152
9338
  children = {
9153
9339
  default: children,
9154
9340
  _ctx: currentRenderingInstance
@@ -9775,7 +9961,7 @@ function isMemoSame(cached, memo) {
9775
9961
  }
9776
9962
  //#endregion
9777
9963
  //#region packages/runtime-core/src/index.ts
9778
- const version = "3.6.0-beta.9";
9964
+ const version = "3.6.0-rc.1";
9779
9965
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
9780
9966
  /**
9781
9967
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -10280,7 +10466,10 @@ function patchStyle(el, prev, next) {
10280
10466
  }
10281
10467
  for (const key in next) {
10282
10468
  if (key === "display") hasControlledDisplay = true;
10283
- setStyle(style, key, next[key]);
10469
+ const value = next[key];
10470
+ if (value != null) {
10471
+ if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
10472
+ } else setStyle(style, key, "");
10284
10473
  }
10285
10474
  } else if (isCssString) {
10286
10475
  if (prev !== next) {
@@ -10330,6 +10519,14 @@ function autoPrefix(style, rawName) {
10330
10519
  }
10331
10520
  return rawName;
10332
10521
  }
10522
+ /**
10523
+ * Browsers update textarea width/height directly during native resize.
10524
+ * Only special-case this common textarea path for now; other resize scenarios
10525
+ * still follow normal vnode style patching.
10526
+ */
10527
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
10528
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
10529
+ }
10333
10530
  //#endregion
10334
10531
  //#region packages/runtime-dom/src/modules/attrs.ts
10335
10532
  const xlinkNS = "http://www.w3.org/1999/xlink";
@@ -10413,7 +10610,7 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
10413
10610
  const existingInvoker = invokers[rawName];
10414
10611
  if (nextValue && existingInvoker) existingInvoker.value = !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue;
10415
10612
  else {
10416
- const [name, options] = parseName(rawName);
10613
+ const [name, options] = parseEventName(rawName);
10417
10614
  if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(!!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue, instance), options);
10418
10615
  else if (existingInvoker) {
10419
10616
  removeEventListener(el, name, existingInvoker, options);
@@ -10421,16 +10618,15 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
10421
10618
  }
10422
10619
  }
10423
10620
  }
10424
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
10425
- function parseName(name) {
10621
+ const optionsModifierRE = /(Once|Passive|Capture)$/;
10622
+ const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
10623
+ function parseEventName(name) {
10426
10624
  let options;
10427
- if (optionsModifierRE.test(name)) {
10428
- options = {};
10429
- let m;
10430
- while (m = name.match(optionsModifierRE)) {
10431
- name = name.slice(0, name.length - m[0].length);
10432
- options[m[0].toLowerCase()] = true;
10433
- }
10625
+ let m;
10626
+ while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
10627
+ if (!options) options = {};
10628
+ name = name.slice(0, name.length - m[1].length);
10629
+ options[m[1].toLowerCase()] = true;
10434
10630
  }
10435
10631
  return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
10436
10632
  }
@@ -10441,7 +10637,21 @@ function createInvoker(initialValue, instance) {
10441
10637
  const invoker = (e) => {
10442
10638
  if (!e._vts) e._vts = Date.now();
10443
10639
  else if (e._vts <= invoker.attached) return;
10444
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
10640
+ const value = invoker.value;
10641
+ if (isArray(value)) {
10642
+ const originalStop = e.stopImmediatePropagation;
10643
+ e.stopImmediatePropagation = () => {
10644
+ originalStop.call(e);
10645
+ e._stopped = true;
10646
+ };
10647
+ const handlers = value.slice();
10648
+ const args = [e];
10649
+ for (let i = 0; i < handlers.length; i++) {
10650
+ if (e._stopped) break;
10651
+ const handler = handlers[i];
10652
+ if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
10653
+ }
10654
+ } else callWithAsyncErrorHandling(value, instance, 5, [e]);
10445
10655
  };
10446
10656
  invoker.value = initialValue;
10447
10657
  invoker.attached = getNow();
@@ -10452,16 +10662,6 @@ function sanitizeEventValue(value, propName) {
10452
10662
  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}.`);
10453
10663
  return NOOP;
10454
10664
  }
10455
- function patchStopImmediatePropagation(e, value) {
10456
- if (isArray(value)) {
10457
- const originalStop = e.stopImmediatePropagation;
10458
- e.stopImmediatePropagation = () => {
10459
- originalStop.call(e);
10460
- e._stopped = true;
10461
- };
10462
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
10463
- } else return value;
10464
- }
10465
10665
  //#endregion
10466
10666
  //#region packages/runtime-dom/src/patchProp.ts
10467
10667
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
@@ -10789,7 +10989,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
10789
10989
  replacementNodes.push(child);
10790
10990
  }
10791
10991
  parent.removeChild(o);
10792
- slotReplacements.set(o, replacementNodes);
10992
+ slotReplacements.set(o, {
10993
+ nodes: replacementNodes,
10994
+ usedFallback: !content
10995
+ });
10793
10996
  }
10794
10997
  this._updateSlotNodes(slotReplacements);
10795
10998
  }
@@ -10981,7 +11184,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
10981
11184
  prevChildren = [];
10982
11185
  if (children) for (let i = 0; i < children.length; i++) {
10983
11186
  const child = children[i];
10984
- if (child.el && child.el instanceof Element) {
11187
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
10985
11188
  prevChildren.push(child);
10986
11189
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
10987
11190
  positionMap.set(child, getPosition(child.el));
@@ -11205,7 +11408,8 @@ const vModelSelect = {
11205
11408
  mounted(el, { value }) {
11206
11409
  vModelSetSelected(el, value);
11207
11410
  },
11208
- beforeUpdate(el, _binding, vnode) {
11411
+ beforeUpdate(el, { value }, vnode) {
11412
+ el._modelValue = value;
11209
11413
  el[assignKey] = getModelAssigner(vnode);
11210
11414
  },
11211
11415
  updated(el, { value }) {
@@ -11216,10 +11420,10 @@ const vModelSelect = {
11216
11420
  * @internal
11217
11421
  */
11218
11422
  const vModelSelectInit = (el, value, number, set) => {
11219
- const isSetModel = isSet(value);
11423
+ el._modelValue = value;
11220
11424
  addEventListener(el, "change", () => {
11221
11425
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
11222
- (set || el[assignKey])(el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]);
11426
+ (set || el[assignKey])(el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]);
11223
11427
  el._assigning = true;
11224
11428
  nextTick(() => {
11225
11429
  el._assigning = false;
@@ -11230,6 +11434,7 @@ const vModelSelectInit = (el, value, number, set) => {
11230
11434
  * @internal
11231
11435
  */
11232
11436
  const vModelSetSelected = (el, value) => {
11437
+ el._modelValue = value;
11233
11438
  if (el._assigning) return;
11234
11439
  const isMultiple = el.multiple;
11235
11440
  const isArrayValue = isArray(value);
@@ -11412,6 +11617,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
11412
11617
  TransitionGroup: () => TransitionGroup,
11413
11618
  TransitionPropsValidators: () => TransitionPropsValidators,
11414
11619
  TriggerOpTypes: () => TriggerOpTypes,
11620
+ VaporSlot: () => VaporSlot,
11415
11621
  VueElement: () => VueElement,
11416
11622
  VueElementBase: () => VueElementBase,
11417
11623
  activate: () => activate,
@@ -11467,6 +11673,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
11467
11673
  endMeasure: () => endMeasure,
11468
11674
  ensureHydrationRenderer: () => ensureHydrationRenderer,
11469
11675
  ensureRenderer: () => ensureRenderer,
11676
+ ensureValidVNode: () => ensureValidVNode,
11470
11677
  ensureVaporSlotFallback: () => ensureVaporSlotFallback,
11471
11678
  expose: () => expose,
11472
11679
  flushOnAppMount: () => flushOnAppMount,
@@ -11518,6 +11725,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
11518
11725
  isValidHtmlOrSvgAttribute: () => isValidHtmlOrSvgAttribute,
11519
11726
  knownTemplateRefs: () => knownTemplateRefs,
11520
11727
  leaveCbKey: () => leaveCbKey,
11728
+ logMismatchError: () => logMismatchError,
11521
11729
  markAsyncBoundary: () => markAsyncBoundary,
11522
11730
  markRaw: () => markRaw,
11523
11731
  matches: () => matches,
@@ -11532,6 +11740,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
11532
11740
  normalizeProps: () => normalizeProps,
11533
11741
  normalizeRef: () => normalizeRef,
11534
11742
  normalizeStyle: () => normalizeStyle,
11743
+ normalizeVNode: () => normalizeVNode,
11535
11744
  onActivated: () => onActivated,
11536
11745
  onBeforeMount: () => onBeforeMount,
11537
11746
  onBeforeUnmount: () => onBeforeUnmount,
@@ -11547,6 +11756,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
11547
11756
  onUpdated: () => onUpdated,
11548
11757
  onWatcherCleanup: () => onWatcherCleanup,
11549
11758
  openBlock: () => openBlock,
11759
+ parseEventName: () => parseEventName,
11550
11760
  patchProp: () => patchProp,
11551
11761
  patchStyle: () => patchStyle,
11552
11762
  performAsyncHydrate: () => performAsyncHydrate,
@@ -13017,6 +13227,7 @@ function getUnnormalizedProps(props, callPath = []) {
13017
13227
  return [props, callPath];
13018
13228
  }
13019
13229
  function injectProp(node, prop, context) {
13230
+ if (node.type !== 13 && injectSlotKey(node, prop)) return;
13020
13231
  let propsWithInjection;
13021
13232
  /**
13022
13233
  * 1. mergeProps(...)
@@ -13055,6 +13266,20 @@ function injectProp(node, prop, context) {
13055
13266
  else if (parentCall) parentCall.arguments[0] = propsWithInjection;
13056
13267
  else node.arguments[2] = propsWithInjection;
13057
13268
  }
13269
+ function injectSlotKey(node, prop) {
13270
+ var _node$arguments, _node$arguments2, _node$arguments3;
13271
+ if (prop.key.type !== 4 || prop.key.content !== "key") return false;
13272
+ const props = node.arguments[2];
13273
+ if (props && !isString(props)) {
13274
+ const [unnormalizedProps] = getUnnormalizedProps(props);
13275
+ if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) return true;
13276
+ }
13277
+ (_node$arguments = node.arguments)[2] || (_node$arguments[2] = "{}");
13278
+ (_node$arguments2 = node.arguments)[3] || (_node$arguments2[3] = "undefined");
13279
+ (_node$arguments3 = node.arguments)[4] || (_node$arguments3[4] = "undefined");
13280
+ node.arguments[5] = prop.value;
13281
+ return true;
13282
+ }
13058
13283
  function hasProp(prop, props) {
13059
13284
  let result = false;
13060
13285
  if (prop.key.type === 4) {
@@ -13324,7 +13549,7 @@ const tokenizer = new Tokenizer(stack, {
13324
13549
  }
13325
13550
  },
13326
13551
  oncdata(start, end) {
13327
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
13552
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
13328
13553
  else emitError(1, start - 9);
13329
13554
  },
13330
13555
  onprocessinginstruction(start) {
@@ -13820,7 +14045,7 @@ function getSelfName(filename) {
13820
14045
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
13821
14046
  return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
13822
14047
  }
13823
- function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
14048
+ function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, eventDelegation = true, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
13824
14049
  const context = {
13825
14050
  filename,
13826
14051
  selfName: getSelfName(filename),
@@ -13842,6 +14067,7 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
13842
14067
  bindingMetadata,
13843
14068
  inline,
13844
14069
  isTS,
14070
+ eventDelegation,
13845
14071
  onError,
13846
14072
  onWarn,
13847
14073
  compatConfig,
@@ -13853,8 +14079,10 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
13853
14079
  imports: [],
13854
14080
  cached: [],
13855
14081
  constantCache: /* @__PURE__ */ new WeakMap(),
14082
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
13856
14083
  temps: 0,
13857
14084
  identifiers: Object.create(null),
14085
+ identifierScopes: Object.create(null),
13858
14086
  scopes: {
13859
14087
  vFor: 0,
13860
14088
  vSlot: 0,
@@ -13908,8 +14136,12 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
13908
14136
  context.parent.children.splice(removalIndex, 1);
13909
14137
  },
13910
14138
  onNodeRemoved: NOOP,
13911
- addIdentifiers(exp) {},
14139
+ addIdentifiers(exp, type = "local") {},
13912
14140
  removeIdentifiers(exp) {},
14141
+ isSlotScopeIdentifier(name) {
14142
+ const scopes = context.identifierScopes[name];
14143
+ return scopes ? scopes[scopes.length - 1] === "slot" : false;
14144
+ },
13913
14145
  hoist(exp) {
13914
14146
  if (isString(exp)) exp = createSimpleExpression(exp);
13915
14147
  context.hoists.push(exp);
@@ -14263,6 +14495,7 @@ function genNode(node, context) {
14263
14495
  case 24: break;
14264
14496
  case 25: break;
14265
14497
  case 26: break;
14498
+ /* v8 ignore start */
14266
14499
  case 10: break;
14267
14500
  default: if (!!(process.env.NODE_ENV !== "production")) {
14268
14501
  assert(false, `unhandled codegen node type: ${node.type}`);
@@ -14482,7 +14715,7 @@ const transformExpression = (node, context) => {
14482
14715
  if (dir.type === 7 && dir.name !== "for") {
14483
14716
  const exp = dir.exp;
14484
14717
  const arg = dir.arg;
14485
- if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
14718
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
14486
14719
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
14487
14720
  }
14488
14721
  }
@@ -14623,10 +14856,9 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
14623
14856
  const isTemplate = isTemplateNode$1(node);
14624
14857
  const memo = findDir(node, "memo");
14625
14858
  const keyProp = findProp(node, `key`, false, true);
14626
- const isDirKey = keyProp && keyProp.type === 7;
14859
+ keyProp && keyProp.type;
14627
14860
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
14628
- if (memo && keyExp && isDirKey) {}
14629
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
14861
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
14630
14862
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
14631
14863
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
14632
14864
  forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
@@ -15407,7 +15639,7 @@ function rewriteFilter(node, context) {
15407
15639
  const child = node.children[i];
15408
15640
  if (typeof child !== "object") continue;
15409
15641
  if (child.type === 4) parseFilter(child, context);
15410
- else if (child.type === 8) rewriteFilter(node, context);
15642
+ else if (child.type === 8) rewriteFilter(child, context);
15411
15643
  else if (child.type === 5) rewriteFilter(child.content, context);
15412
15644
  }
15413
15645
  }
@@ -15842,7 +16074,7 @@ function postTransformTransition(node, onError, hasMultipleChildren = defaultHas
15842
16074
  source: ""
15843
16075
  }));
15844
16076
  const child = node.children[0];
15845
- if (child.type === 1) {
16077
+ if (child.type === 1 && !findDir(child, "if")) {
15846
16078
  for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
15847
16079
  type: 6,
15848
16080
  name: "persisted",
@@ -16128,4 +16360,4 @@ Vue.compile = compileToFunction;
16128
16360
  var esm_index_default = Vue;
16129
16361
  const configureCompat = Vue.configureCompat;
16130
16362
  //#endregion
16131
- export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VueElement, VueElementBase, activate, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, configureCompat, createApp, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, esm_index_default as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, handleMovedChildren, hasCSSTransform, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isHydrating, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, nodeOps, normalizeClass, normalizeContainer, normalizeProps, normalizeRef, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, render, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, resolveTransitionProps, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, setVarsOnNode, shallowReactive, shallowReadonly, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, svgNS, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId, xlinkNS };
16363
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, MismatchTypes, MoveType, NULL_DYNAMIC_COMPONENT, ReactiveEffect, SchedulerJobFlags, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TransitionPropsValidators, TriggerOpTypes, VaporSlot, VueElement, VueElementBase, activate, assertNumber, baseApplyTranslation, baseEmit, baseNormalizePropsOptions, baseResolveTransitionHooks, baseUseCssVars, callPendingCbs, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, checkTransitionMode, cloneVNode, compatUtils, computed, configureCompat, createApp, createAppAPI, createAsyncComponentContext, createBlock, createCanSetSetupRefChecker, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createInternalObject, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, currentInstance, customRef, deactivate, esm_index_default as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, devtoolsComponentAdded, effect, effectScope, endMeasure, ensureHydrationRenderer, ensureRenderer, ensureValidVNode, ensureVaporSlotFallback, expose, flushOnAppMount, forceReflow, getAttributeMismatch, getComponentName, getCurrentInstance, getCurrentScope, getCurrentWatcher, getFunctionalFallthrough, getInheritedScopeIds, getTransitionRawChildren, guardReactiveProps, h, handleError, handleMovedChildren, hasCSSTransform, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, initFeatureFlags, inject, invalidateMount, invokeDirectiveHook, isAsyncWrapper, isEmitListener, isHydrating, isKeepAlive, isMapEqual, isMemoSame, isMismatchAllowed, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isSetEqual, isShallow, isTeleportDeferred, isTeleportDisabled, isTemplateNode, isTemplateRefKey, isVNode, isValidHtmlOrSvgAttribute, knownTemplateRefs, leaveCbKey, logMismatchError, markAsyncBoundary, markRaw, matches, mergeDefaults, mergeModels, mergeProps, nextTick, nextUid, nodeOps, normalizeClass, normalizeContainer, normalizeProps, normalizeRef, normalizeStyle, normalizeVNode, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, parseEventName, patchProp, patchStyle, performAsyncHydrate, performTransitionEnter, performTransitionLeave, popScopeId, popWarningContext, provide, proxyRefs, pushScopeId, pushWarningContext, queueJob, queuePostFlushCb, reactive, readonly, ref, registerHMR, registerRuntimeCompiler, render, renderList, renderSlot, resetShapeFlag, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolvePropValue, resolveTarget as resolveTeleportTarget, resolveTransitionHooks, resolveTransitionProps, setBlockTracking, setCurrentInstance, setCurrentRenderingInstance, setDevtoolsHook, setIsHydratingEnabled, setRef, setTransitionHooks, setVarsOnNode, shallowReactive, shallowReadonly, shallowRef, shouldSetAsProp, shouldSetAsPropForVueCE, shouldUpdateComponent, simpleSetCurrentInstance, ssrContextKey, ssrUtils, startMeasure, stop, svgNS, toClassSet, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toStyleMap, toValue, transformVNodeArgs, triggerRef, unref, unregisterHMR, unsafeToTrustedHTML, useAsyncComponentState, useAttrs, useCssModule, useCssVars, useHost, useId, useInstanceOption, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, validateComponentName, validateProps, version, warn, warnExtraneousAttributes, warnPropMismatch, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId, xlinkNS };