@vue/compat 3.5.44 → 3.5.45

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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.44
2
+ * @vue/compat v3.5.45
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -68,24 +68,20 @@ const cacheStringFunction = (fn) => {
68
68
  });
69
69
  };
70
70
  const camelizeRE = /-\w/g;
71
- const camelize = cacheStringFunction(
72
- (str) => {
73
- return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
74
- }
75
- );
71
+ const camelize = /* @__PURE__ */ cacheStringFunction((str) => {
72
+ return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
73
+ });
76
74
  const hyphenateRE = /\B([A-Z])/g;
77
- const hyphenate = cacheStringFunction(
75
+ const hyphenate = /* @__PURE__ */ cacheStringFunction(
78
76
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
79
77
  );
80
- const capitalize = cacheStringFunction((str) => {
78
+ const capitalize = /* @__PURE__ */ cacheStringFunction((str) => {
81
79
  return str.charAt(0).toUpperCase() + str.slice(1);
82
80
  });
83
- const toHandlerKey = cacheStringFunction(
84
- (str) => {
85
- const s = str ? `on${capitalize(str)}` : ``;
86
- return s;
87
- }
88
- );
81
+ const toHandlerKey = /* @__PURE__ */ cacheStringFunction((str) => {
82
+ const s = str ? `on${capitalize(str)}` : ``;
83
+ return s;
84
+ });
89
85
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
90
86
  const invokeArrayFns = (fns, ...arg) => {
91
87
  for (let i = 0; i < fns.length; i++) {
@@ -275,7 +271,7 @@ const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
275
271
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
276
272
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
277
273
 
278
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
274
+ const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
279
275
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
280
276
  const isBooleanAttr = /* @__PURE__ */ makeMap(
281
277
  specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
@@ -661,7 +657,11 @@ function getCurrentScope() {
661
657
  }
662
658
  function onScopeDispose(fn, failSilently = false) {
663
659
  if (activeEffectScope) {
664
- activeEffectScope.cleanups.push(fn);
660
+ if (activeEffectScope.active) {
661
+ activeEffectScope.cleanups.push(fn);
662
+ } else {
663
+ fn();
664
+ }
665
665
  } else if (!failSilently) {
666
666
  warn$2(
667
667
  `onScopeDispose() is called when there is no active effect scope to be associated with.`
@@ -1468,7 +1468,7 @@ function noTracking(self, method, args = []) {
1468
1468
  }
1469
1469
 
1470
1470
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
1471
- const builtInSymbols = new Set(
1471
+ const builtInSymbols = /* @__PURE__ */ new Set(
1472
1472
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
1473
1473
  );
1474
1474
  function hasOwnProperty(key) {
@@ -2678,7 +2678,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2678
2678
  const res = callWithErrorHandling(fn, instance, type, args);
2679
2679
  if (res && isPromise(res)) {
2680
2680
  res.catch((err) => {
2681
- handleError(err, instance, type);
2681
+ handleError(err, instance, type, void 0, true);
2682
2682
  });
2683
2683
  }
2684
2684
  return res;
@@ -2695,7 +2695,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2695
2695
  );
2696
2696
  }
2697
2697
  }
2698
- function handleError(err, instance, type, throwInDev = true) {
2698
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2699
2699
  const contextVNode = instance ? instance.vnode : null;
2700
2700
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2701
2701
  if (instance) {
@@ -2704,7 +2704,9 @@ function handleError(err, instance, type, throwInDev = true) {
2704
2704
  const errorInfo = ErrorTypeStrings$1[type] ;
2705
2705
  while (cur) {
2706
2706
  const errorCapturedHooks = cur.ec;
2707
- if (errorCapturedHooks) {
2707
+ if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
2708
+ // are deferred or discarded by Suspense.
2709
+ (!isAsyncError || cur.scope.active)) {
2708
2710
  for (let i = 0; i < errorCapturedHooks.length; i++) {
2709
2711
  if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
2710
2712
  return;
@@ -3032,14 +3034,32 @@ function reload(id, newComp) {
3032
3034
  instance.ceReload(newComp.styles);
3033
3035
  dirtyInstances.delete(instance);
3034
3036
  } else if (instance.parent) {
3035
- queueJob(() => {
3036
- if (!(instance.job.flags & 8)) {
3037
- isHmrUpdating = true;
3037
+ const update = () => {
3038
+ if (!instance.scope.active) return;
3039
+ const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
3040
+ if (pending) {
3041
+ pending.asyncDep.catch(NOOP).then(() => {
3042
+ if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
3043
+ queueJob(update);
3044
+ }
3045
+ });
3046
+ return;
3047
+ }
3048
+ dirtyInstances = hmrDirtyComponents.get(oldComp);
3049
+ if (!dirtyInstances) {
3050
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
3051
+ }
3052
+ dirtyInstances.add(instance);
3053
+ isHmrUpdating = true;
3054
+ try {
3038
3055
  instance.parent.update();
3056
+ } finally {
3039
3057
  isHmrUpdating = false;
3040
3058
  dirtyInstances.delete(instance);
3059
+ queuePostFlushCb(() => hmrDirtyComponents.clear());
3041
3060
  }
3042
- });
3061
+ };
3062
+ queueJob(update);
3043
3063
  } else if (instance.appContext.reload) {
3044
3064
  instance.appContext.reload();
3045
3065
  } else if (typeof window !== "undefined") {
@@ -3721,12 +3741,31 @@ function withDirectives(vnode, directives) {
3721
3741
  return vnode;
3722
3742
  }
3723
3743
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3724
- const bindings = vnode.dirs;
3744
+ let hookVNode = vnode;
3745
+ if (name === "beforeMount") {
3746
+ vnode._mount = vnode;
3747
+ } else if (name === "beforeUpdate") {
3748
+ const mount = prevVNode && prevVNode._mount;
3749
+ if (mount) {
3750
+ mount._latest = vnode;
3751
+ vnode._mount = mount;
3752
+ }
3753
+ } else if (name === "mounted") {
3754
+ const latest = vnode._latest;
3755
+ vnode._mount = vnode._latest = void 0;
3756
+ if (latest) {
3757
+ hookVNode = latest;
3758
+ latest._mount = void 0;
3759
+ }
3760
+ }
3761
+ const bindings = hookVNode.dirs;
3725
3762
  const oldBindings = prevVNode && prevVNode.dirs;
3726
3763
  for (let i = 0; i < bindings.length; i++) {
3727
- const binding = bindings[i];
3764
+ let binding = bindings[i];
3728
3765
  if (oldBindings) {
3729
3766
  binding.oldValue = oldBindings[i].value;
3767
+ } else if (name === "mounted" && binding.oldValue !== void 0) {
3768
+ binding = extend({}, binding, { oldValue: void 0 });
3730
3769
  }
3731
3770
  let hook = binding.dir[name];
3732
3771
  if (!hook) {
@@ -3737,7 +3776,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3737
3776
  callWithAsyncErrorHandling(hook, instance, 8, [
3738
3777
  vnode.el,
3739
3778
  binding,
3740
- vnode,
3779
+ hookVNode,
3741
3780
  prevVNode
3742
3781
  ]);
3743
3782
  resetTracking();
@@ -4361,13 +4400,11 @@ const BaseTransitionImpl = {
4361
4400
  if (!innerChild) {
4362
4401
  return emptyPlaceholder(child);
4363
4402
  }
4364
- let enterHooks = resolveTransitionHooks(
4403
+ const enterHooks = resolveTransitionHooks(
4365
4404
  innerChild,
4366
4405
  rawProps,
4367
4406
  state,
4368
- instance,
4369
- // #11061, ensure enterHooks is fresh after clone
4370
- (hooks) => enterHooks = hooks
4407
+ instance
4371
4408
  );
4372
4409
  if (innerChild.type !== Comment) {
4373
4410
  setTransitionHooks(innerChild, enterHooks);
@@ -4386,7 +4423,17 @@ const BaseTransitionImpl = {
4386
4423
  leavingHooks.afterLeave = () => {
4387
4424
  state.isLeaving = false;
4388
4425
  if (!(instance.job.flags & 8)) {
4389
- instance.update();
4426
+ if (instance.effect.flags & 2) {
4427
+ const job = () => {
4428
+ if (!(instance.job.flags & 8)) {
4429
+ instance.update();
4430
+ }
4431
+ };
4432
+ job.i = instance;
4433
+ queueJob(job);
4434
+ } else {
4435
+ instance.update();
4436
+ }
4390
4437
  }
4391
4438
  delete leavingHooks.afterLeave;
4392
4439
  oldInnerChild = void 0;
@@ -4453,7 +4500,7 @@ function getLeavingNodesForType(state, vnode) {
4453
4500
  }
4454
4501
  return leavingVNodesCache;
4455
4502
  }
4456
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4503
+ function resolveTransitionHooks(vnode, props, state, instance) {
4457
4504
  const {
4458
4505
  appear,
4459
4506
  mode,
@@ -4592,15 +4639,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4592
4639
  }
4593
4640
  },
4594
4641
  clone(vnode2) {
4595
- const hooks2 = resolveTransitionHooks(
4596
- vnode2,
4597
- props,
4598
- state,
4599
- instance,
4600
- postClone
4601
- );
4602
- if (postClone) postClone(hooks2);
4603
- return hooks2;
4642
+ const cloned = resolveTransitionHooks(vnode2, props, state, instance);
4643
+ cloned.afterLeave = () => {
4644
+ if (hooks.afterLeave) hooks.afterLeave();
4645
+ };
4646
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
4647
+ if (hooks.delayLeave) {
4648
+ hooks.delayLeave(el, earlyRemove, delayedLeave);
4649
+ } else {
4650
+ delayedLeave();
4651
+ }
4652
+ };
4653
+ cloned.delayedLeave = () => {
4654
+ if (hooks.delayedLeave) hooks.delayedLeave();
4655
+ };
4656
+ return cloned;
4604
4657
  }
4605
4658
  };
4606
4659
  return hooks;
@@ -4641,8 +4694,16 @@ function setTransitionHooks(vnode, hooks) {
4641
4694
  hooks
4642
4695
  );
4643
4696
  } else if (vnode.shapeFlag & 128) {
4644
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4645
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4697
+ const suspense = vnode.suspense;
4698
+ if (suspense) {
4699
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
4700
+ if (branch) {
4701
+ setTransitionHooks(branch, hooks.clone(branch));
4702
+ }
4703
+ } else {
4704
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4705
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4706
+ }
4646
4707
  } else {
4647
4708
  vnode.transition = hooks;
4648
4709
  if (vnode.type === Fragment && isArray(vnode.children)) {
@@ -5343,7 +5404,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5343
5404
  getContainerType(container),
5344
5405
  slotScopeIds
5345
5406
  );
5346
- if (parentComponent) {
5407
+ if (parentComponent && parentComponent.vnode.el === node) {
5347
5408
  parentComponent.vnode.el = vnode.el;
5348
5409
  updateHOCHostEl(parentComponent, vnode.el);
5349
5410
  }
@@ -5777,7 +5838,8 @@ function defineAsyncComponent(source) {
5777
5838
  err,
5778
5839
  instance,
5779
5840
  13,
5780
- !errorComponent
5841
+ !errorComponent,
5842
+ true
5781
5843
  );
5782
5844
  };
5783
5845
  if (suspensible && instance.suspense || isInSSRComponentSetup) {
@@ -5795,7 +5857,7 @@ function defineAsyncComponent(source) {
5795
5857
  const delayed = ref(!!delay);
5796
5858
  let timeoutTimer;
5797
5859
  let delayTimer;
5798
- onUnmounted(() => {
5860
+ onScopeDispose(() => {
5799
5861
  if (timeoutTimer != null) clearTimeout(timeoutTimer);
5800
5862
  if (delayTimer != null) clearTimeout(delayTimer);
5801
5863
  });
@@ -5923,6 +5985,12 @@ const KeepAliveImpl = {
5923
5985
  }
5924
5986
  };
5925
5987
  sharedContext.deactivate = (vnode) => {
5988
+ const cached = cache.get(
5989
+ vnode.key == null ? vnode.type : vnode.key
5990
+ );
5991
+ if (!cached || cached.component !== vnode.component) {
5992
+ return false;
5993
+ }
5926
5994
  const instance2 = vnode.component;
5927
5995
  invalidateMount(instance2.m);
5928
5996
  invalidateMount(instance2.a);
@@ -5940,6 +6008,7 @@ const KeepAliveImpl = {
5940
6008
  {
5941
6009
  devtoolsComponentAdded(instance2);
5942
6010
  }
6011
+ return true;
5943
6012
  };
5944
6013
  function unmount(vnode) {
5945
6014
  resetShapeFlag(vnode);
@@ -5979,12 +6048,17 @@ const KeepAliveImpl = {
5979
6048
  const cacheSubtree = () => {
5980
6049
  if (pendingCacheKey != null) {
5981
6050
  if (isSuspense(instance.subTree.type)) {
5982
- queuePostRenderEffect(() => {
6051
+ const cacheInnerChild = () => {
5983
6052
  const vnode = getInnerChild(instance.subTree);
5984
6053
  if (vnode.component) {
5985
6054
  cache.set(pendingCacheKey, vnode);
5986
6055
  }
5987
- }, instance.subTree.suspense);
6056
+ };
6057
+ if (instance.subTree.suspense.pendingBranch) {
6058
+ queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
6059
+ } else {
6060
+ cacheInnerChild();
6061
+ }
5988
6062
  } else {
5989
6063
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
5990
6064
  }
@@ -6119,9 +6193,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
6119
6193
  true
6120
6194
  /* prepend */
6121
6195
  );
6122
- onUnmounted(() => {
6123
- remove(keepAliveRoot[type], injected);
6124
- }, target);
6196
+ const removal = injectHook(
6197
+ "um",
6198
+ () => remove(keepAliveRoot[type], injected),
6199
+ target
6200
+ );
6201
+ removal.flags = 16;
6125
6202
  }
6126
6203
  function resetShapeFlag(vnode) {
6127
6204
  vnode.shapeFlag &= -257;
@@ -7855,7 +7932,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7855
7932
  return vm;
7856
7933
  }
7857
7934
  }
7858
- Vue.version = `2.6.14-compat:${"3.5.44"}`;
7935
+ Vue.version = `2.6.14-compat:${"3.5.45"}`;
7859
7936
  Vue.config = singletonApp.config;
7860
7937
  Vue.use = (plugin, ...options) => {
7861
7938
  if (plugin && isFunction(plugin.install)) {
@@ -9964,6 +10041,8 @@ function baseCreateRenderer(options, createHydrationFns) {
9964
10041
  const needCallTransitionHooks = needTransition(parentSuspense, transition);
9965
10042
  if (needCallTransitionHooks) {
9966
10043
  transition.beforeEnter(el);
10044
+ } else if (transition && !transition.persisted) {
10045
+ el[deferredEnterKey] = true;
9967
10046
  }
9968
10047
  hostInsert(el, container, anchor);
9969
10048
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
@@ -10462,16 +10541,23 @@ function baseCreateRenderer(options, createHydrationFns) {
10462
10541
  } else {
10463
10542
  let { next, bu, u, parent, vnode } = instance;
10464
10543
  {
10465
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
10466
- if (nonHydratedAsyncRoot) {
10544
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
10545
+ if (unresolvedAsyncRoot) {
10467
10546
  if (next) {
10468
10547
  next.el = vnode.el;
10469
10548
  updateComponentPreRender(instance, next, optimized);
10470
10549
  }
10471
- nonHydratedAsyncRoot.asyncDep.then(() => {
10472
- queuePostRenderEffect(() => {
10473
- if (!instance.isUnmounted) update();
10474
- }, parentSuspense);
10550
+ unresolvedAsyncRoot.asyncDep.then(() => {
10551
+ const retry = () => {
10552
+ if (instance.job.flags & 8) return;
10553
+ if (parentSuspense && parentSuspense.pendingBranch) {
10554
+ queuePostRenderEffect(retry, parentSuspense);
10555
+ } else {
10556
+ update();
10557
+ }
10558
+ };
10559
+ retry.flags = 16 | 32;
10560
+ queuePostRenderEffect(retry, parentSuspense);
10475
10561
  });
10476
10562
  return;
10477
10563
  }
@@ -10513,8 +10599,11 @@ function baseCreateRenderer(options, createHydrationFns) {
10513
10599
  patch(
10514
10600
  prevTree,
10515
10601
  nextTree,
10516
- // parent may have changed if it's in a teleport
10517
- hostParentNode(prevTree.el),
10602
+ // parent may have changed if it's in a teleport. a root that is a
10603
+ // pending async component only has its placeholder comment
10604
+ hostParentNode(
10605
+ prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
10606
+ ),
10518
10607
  // anchor may have changed if it's in a fragment
10519
10608
  getNextHostNode(prevTree),
10520
10609
  instance,
@@ -10960,8 +11049,7 @@ function baseCreateRenderer(options, createHydrationFns) {
10960
11049
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
10961
11050
  parentComponent.renderCache[cacheIndex] = void 0;
10962
11051
  }
10963
- if (shapeFlag & 256) {
10964
- parentComponent.ctx.deactivate(vnode);
11052
+ if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
10965
11053
  return;
10966
11054
  }
10967
11055
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -11086,7 +11174,7 @@ function baseCreateRenderer(options, createHydrationFns) {
11086
11174
  if (job) {
11087
11175
  job.flags |= 8;
11088
11176
  unmount(subTree, instance, parentSuspense, doRemove);
11089
- } else if (instance.vnode.el && subTree) {
11177
+ } else if (subTree) {
11090
11178
  subTree.transition = instance.vnode.transition;
11091
11179
  unmount(subTree, instance, parentSuspense, doRemove);
11092
11180
  }
@@ -11099,9 +11187,11 @@ function baseCreateRenderer(options, createHydrationFns) {
11099
11187
  parentSuspense
11100
11188
  );
11101
11189
  }
11102
- queuePostRenderEffect(() => {
11190
+ const markUnmounted = () => {
11103
11191
  instance.isUnmounted = true;
11104
- }, parentSuspense);
11192
+ };
11193
+ markUnmounted.flags = 16;
11194
+ queuePostRenderEffect(markUnmounted, parentSuspense);
11105
11195
  {
11106
11196
  devtoolsComponentRemoved(instance);
11107
11197
  }
@@ -11253,13 +11343,13 @@ function getSequence(arr) {
11253
11343
  }
11254
11344
  return result;
11255
11345
  }
11256
- function locateNonHydratedAsyncRoot(instance) {
11346
+ function locateUnresolvedAsyncRoot(instance) {
11257
11347
  const subComponent = instance.subTree.component;
11258
11348
  if (subComponent) {
11259
11349
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
11260
11350
  return subComponent;
11261
11351
  } else {
11262
- return locateNonHydratedAsyncRoot(subComponent);
11352
+ return locateUnresolvedAsyncRoot(subComponent);
11263
11353
  }
11264
11354
  }
11265
11355
  }
@@ -11277,11 +11367,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
11277
11367
  if (instance) {
11278
11368
  return resolveAsyncComponentPlaceholder(instance.subTree);
11279
11369
  }
11370
+ const suspense = anchorVnode.suspense;
11371
+ if (suspense && suspense.activeBranch) {
11372
+ return resolveAsyncComponentPlaceholder(suspense.activeBranch);
11373
+ }
11280
11374
  return null;
11281
11375
  }
11282
11376
 
11283
11377
  const isSuspense = (type) => type.__isSuspense;
11284
11378
  let suspenseId = 0;
11379
+ const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
11285
11380
  const SuspenseImpl = {
11286
11381
  name: "Suspense",
11287
11382
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -11303,11 +11398,22 @@ const SuspenseImpl = {
11303
11398
  rendererInternals
11304
11399
  );
11305
11400
  } else {
11306
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
11307
- n2.suspense = n1.suspense;
11308
- n2.suspense.vnode = n2;
11309
- n2.el = n1.el;
11310
- return;
11401
+ const suspense = n1.suspense;
11402
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
11403
+ const owner = suspense.parentComponent;
11404
+ const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
11405
+ if (retained ? (
11406
+ // deps can outlive the pending branch: skip only while it exists
11407
+ parentSuspense.pendingBranch && !isSameVNodeType(
11408
+ n2.ssContent,
11409
+ suspense.pendingBranch || suspense.activeBranch
11410
+ )
11411
+ ) : !suspense.isInFallback) {
11412
+ n2.suspense = suspense;
11413
+ suspense.vnode = n2;
11414
+ n2.el = n1.el;
11415
+ return;
11416
+ }
11311
11417
  }
11312
11418
  patchSuspense(
11313
11419
  n1,
@@ -11332,6 +11438,38 @@ function triggerEvent(vnode, name) {
11332
11438
  eventListener();
11333
11439
  }
11334
11440
  }
11441
+ function enterDeferred(branch) {
11442
+ const enters = [];
11443
+ collectDeferredEnters(branch, enters, true);
11444
+ if (enters.length) {
11445
+ queuePostFlushCb(enters);
11446
+ }
11447
+ }
11448
+ function collectDeferredEnters(vnode, enters, isRoot) {
11449
+ const { el, transition, children, shapeFlag } = vnode;
11450
+ if (shapeFlag & 6) {
11451
+ collectDeferredEnters(vnode.component.subTree, enters, isRoot);
11452
+ return;
11453
+ }
11454
+ if (shapeFlag & (128 | 64)) {
11455
+ return;
11456
+ }
11457
+ if (shapeFlag & 1) {
11458
+ if (!isRoot && el && el[deferredEnterKey]) {
11459
+ el[deferredEnterKey] = void 0;
11460
+ if (transition && !transition.persisted) {
11461
+ transition.beforeEnter(el);
11462
+ enters.push(() => transition.enter(el));
11463
+ }
11464
+ }
11465
+ isRoot = false;
11466
+ }
11467
+ if (shapeFlag & 16) {
11468
+ for (let i = 0; i < children.length; i++) {
11469
+ collectDeferredEnters(children[i], enters, isRoot);
11470
+ }
11471
+ }
11472
+ }
11335
11473
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
11336
11474
  const {
11337
11475
  p: patch,
@@ -11431,7 +11569,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11431
11569
  unmount(pendingBranch, parentComponent, suspense);
11432
11570
  }
11433
11571
  suspense.deps = 0;
11434
- suspense.effects.length = 0;
11572
+ discardEffects(suspense);
11435
11573
  suspense.hiddenContainer = createElement("div");
11436
11574
  if (isInFallback) {
11437
11575
  patch(
@@ -11509,11 +11647,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11509
11647
  } else {
11510
11648
  triggerEvent(n2, "onPending");
11511
11649
  suspense.pendingBranch = newBranch;
11512
- if (newBranch.shapeFlag & 512) {
11513
- suspense.pendingId = newBranch.component.suspenseId;
11514
- } else {
11515
- suspense.pendingId = suspenseId++;
11516
- }
11650
+ suspense.pendingId = suspenseId++;
11517
11651
  patch(
11518
11652
  null,
11519
11653
  newBranch,
@@ -11528,12 +11662,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
11528
11662
  if (suspense.deps <= 0) {
11529
11663
  suspense.resolve();
11530
11664
  } else {
11531
- const { timeout, pendingId } = suspense;
11665
+ const { timeout } = suspense;
11532
11666
  if (timeout > 0) {
11533
- setTimeout(() => {
11534
- if (suspense.pendingId === pendingId) {
11535
- suspense.fallback(newFallback);
11536
- }
11667
+ suspense.timeoutTimer = setTimeout(() => {
11668
+ suspense.timeoutTimer = void 0;
11669
+ suspense.fallback(suspense.vnode.ssFallback);
11537
11670
  }, timeout);
11538
11671
  } else if (timeout === 0) {
11539
11672
  suspense.fallback(newFallback);
@@ -11580,6 +11713,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11580
11713
  deps: 0,
11581
11714
  pendingId: suspenseId++,
11582
11715
  timeout: typeof timeout === "number" ? timeout : -1,
11716
+ timeoutTimer: void 0,
11583
11717
  activeBranch: null,
11584
11718
  isFallbackMountPending: false,
11585
11719
  pendingBranch: null,
@@ -11618,7 +11752,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11618
11752
  let hasUpdatedAnchor = false;
11619
11753
  if (delayEnter) {
11620
11754
  activeBranch.transition.afterLeave = () => {
11621
- if (pendingId === suspense.pendingId) {
11755
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
11756
+ enterDeferred(pendingBranch);
11622
11757
  move(
11623
11758
  pendingBranch,
11624
11759
  container2,
@@ -11633,7 +11768,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11633
11768
  };
11634
11769
  }
11635
11770
  if (activeBranch && !suspense.isFallbackMountPending) {
11636
- if (parentNode(activeBranch.el) === container2) {
11771
+ if (parentNode(
11772
+ activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
11773
+ ) === container2) {
11637
11774
  anchor = next(activeBranch);
11638
11775
  hasUpdatedAnchor = true;
11639
11776
  }
@@ -11643,13 +11780,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11643
11780
  }
11644
11781
  }
11645
11782
  if (!delayEnter) {
11783
+ enterDeferred(pendingBranch);
11646
11784
  move(pendingBranch, container2, anchor, 0);
11647
11785
  }
11648
11786
  }
11787
+ clearTimeout(suspense.timeoutTimer);
11788
+ suspense.timeoutTimer = void 0;
11649
11789
  suspense.isFallbackMountPending = false;
11650
11790
  setActiveBranch(suspense, pendingBranch);
11651
11791
  suspense.pendingBranch = null;
11652
11792
  suspense.isInFallback = false;
11793
+ let kept = 0;
11794
+ for (let i = 0; i < effects.length; i++) {
11795
+ const effect = effects[i];
11796
+ if (effect.flags & 32) {
11797
+ queuePostFlushCb(effect);
11798
+ } else {
11799
+ effects[kept++] = effect;
11800
+ }
11801
+ }
11802
+ effects.length = kept;
11653
11803
  let parent = suspense.parent;
11654
11804
  let hasUnresolvedAncestor = false;
11655
11805
  while (parent) {
@@ -11678,7 +11828,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11678
11828
  triggerEvent(vnode2, "onResolve");
11679
11829
  },
11680
11830
  fallback(fallbackVNode) {
11681
- if (!suspense.pendingBranch) {
11831
+ if (suspense.isUnmounted || !suspense.pendingBranch) {
11682
11832
  return;
11683
11833
  }
11684
11834
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
@@ -11686,7 +11836,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11686
11836
  const anchor2 = next(activeBranch);
11687
11837
  const mountFallback = () => {
11688
11838
  suspense.isFallbackMountPending = false;
11689
- if (!suspense.isInFallback) {
11839
+ if (suspense.isUnmounted || !suspense.isInFallback) {
11690
11840
  return;
11691
11841
  }
11692
11842
  const latestFallback = suspense.vnode.ssFallback;
@@ -11738,19 +11888,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11738
11888
  suspense.deps++;
11739
11889
  }
11740
11890
  const hydratedEl = instance.vnode.el;
11741
- instance.asyncDep.catch((err) => {
11742
- handleError(err, instance, 0);
11743
- }).then((asyncSetupResult) => {
11744
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
11745
- return;
11746
- }
11747
- unsetCurrentInstance();
11748
- if (!instance.scope.active) {
11749
- if (isInPendingSuspense && --suspense.deps === 0) {
11750
- suspense.resolve();
11751
- }
11752
- return;
11753
- }
11891
+ const render = (asyncSetupResult) => {
11754
11892
  instance.asyncResolved = true;
11755
11893
  const { vnode: vnode2 } = instance;
11756
11894
  {
@@ -11783,13 +11921,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11783
11921
  {
11784
11922
  popWarningContext();
11785
11923
  }
11786
- if (isInPendingSuspense && --suspense.deps === 0) {
11924
+ };
11925
+ instance.asyncDep.catch((err) => {
11926
+ handleError(err, instance, 0, false, true);
11927
+ return () => null;
11928
+ }).then((asyncSetupResult) => {
11929
+ if (instance.isUnmounted || suspense.isUnmounted) {
11930
+ return;
11931
+ }
11932
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
11933
+ unsetCurrentInstance();
11934
+ if (!instance.scope.active) {
11935
+ if (isPendingDep && --suspense.deps === 0) {
11936
+ suspense.resolve();
11937
+ }
11938
+ return;
11939
+ }
11940
+ if (!isPendingDep && suspense.pendingBranch) {
11941
+ const job = () => {
11942
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
11943
+ return;
11944
+ }
11945
+ if (suspense.pendingBranch) {
11946
+ queueEffectWithSuspense(job, suspense);
11947
+ } else {
11948
+ render(asyncSetupResult);
11949
+ }
11950
+ };
11951
+ job.flags = 16 | 32;
11952
+ queueEffectWithSuspense(job, suspense);
11953
+ return;
11954
+ }
11955
+ render(asyncSetupResult);
11956
+ if (isPendingDep && --suspense.deps === 0) {
11787
11957
  suspense.resolve();
11788
11958
  }
11789
11959
  });
11790
11960
  },
11791
11961
  unmount(parentSuspense2, doRemove) {
11792
11962
  suspense.isUnmounted = true;
11963
+ clearTimeout(suspense.timeoutTimer);
11964
+ suspense.timeoutTimer = void 0;
11965
+ if (parentSuspenseId !== void 0) {
11966
+ const parent = suspense.parent;
11967
+ const pendingId = parentSuspenseId;
11968
+ parentSuspenseId = void 0;
11969
+ queuePostFlushCb(() => {
11970
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
11971
+ parent.resolve();
11972
+ }
11973
+ });
11974
+ }
11793
11975
  if (suspense.activeBranch) {
11794
11976
  unmount(
11795
11977
  suspense.activeBranch,
@@ -11799,12 +11981,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11799
11981
  );
11800
11982
  }
11801
11983
  if (suspense.pendingBranch) {
11802
- unmount(
11803
- suspense.pendingBranch,
11804
- parentComponent,
11805
- parentSuspense2,
11806
- doRemove
11807
- );
11984
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
11985
+ discardEffects(suspense);
11808
11986
  }
11809
11987
  }
11810
11988
  };
@@ -11874,6 +12052,16 @@ function normalizeSuspenseSlot(s) {
11874
12052
  }
11875
12053
  return s;
11876
12054
  }
12055
+ function discardEffects(suspense) {
12056
+ const { effects } = suspense;
12057
+ for (let i = 0; i < effects.length; i++) {
12058
+ const effect = effects[i];
12059
+ if (effect.flags & 16) {
12060
+ queuePostFlushCb(effect);
12061
+ }
12062
+ }
12063
+ effects.length = 0;
12064
+ }
11877
12065
  function queueEffectWithSuspense(fn, suspense) {
11878
12066
  if (suspense && suspense.pendingBranch) {
11879
12067
  if (isArray(fn)) {
@@ -12189,7 +12377,8 @@ Component that was made reactive: `,
12189
12377
  }
12190
12378
  function guardReactiveProps(props) {
12191
12379
  if (!props) return null;
12192
- return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
12380
+ if (isProxy(props)) return extend({}, props);
12381
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
12193
12382
  }
12194
12383
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
12195
12384
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -12371,7 +12560,7 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
12371
12560
  ]);
12372
12561
  }
12373
12562
 
12374
- const emptyAppContext = createAppContext();
12563
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
12375
12564
  let uid = 0;
12376
12565
  function getNextUid() {
12377
12566
  return uid;
@@ -12584,7 +12773,8 @@ function setupStatefulComponent(instance, isSSR) {
12584
12773
  setInSSRSetupState(false);
12585
12774
  }
12586
12775
  }).catch((e) => {
12587
- handleError(e, instance, 0);
12776
+ handleError(e, instance, 0, void 0, true);
12777
+ instance.ssrRender = (_, push) => push("<!---->");
12588
12778
  });
12589
12779
  } else {
12590
12780
  instance.asyncDep = setupResult;
@@ -12704,11 +12894,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
12704
12894
  }
12705
12895
  }
12706
12896
  }
12897
+ const rawAttrsKey = /* @__PURE__ */ Symbol();
12707
12898
  const attrsProxyHandlers = {
12708
12899
  get(target, key) {
12709
12900
  markAttrsAccessed();
12710
12901
  track(target, "get", "");
12711
- return target[key];
12902
+ return key === rawAttrsKey ? target : target[key];
12712
12903
  },
12713
12904
  set() {
12714
12905
  warn$1(`setupContext.attrs is readonly.`);
@@ -13060,7 +13251,7 @@ function isMemoSame(cached, memo) {
13060
13251
  return true;
13061
13252
  }
13062
13253
 
13063
- const version = "3.5.44";
13254
+ const version = "3.5.45";
13064
13255
  const warn = warn$1 ;
13065
13256
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
13066
13257
  const devtools = devtools$1 ;
@@ -14894,18 +15085,18 @@ const vModelSelect = {
14894
15085
  },
14895
15086
  // set value in mounted & updated because <select> relies on its children
14896
15087
  // <option>s.
14897
- mounted(el, { value }) {
14898
- setSelected(el, value);
15088
+ mounted(el, { value, modifiers: { number } }) {
15089
+ setSelected(el, value, number);
14899
15090
  },
14900
15091
  beforeUpdate(el, { value }, vnode) {
14901
15092
  el._modelValue = value;
14902
15093
  el[assignKey] = getModelAssigner(vnode);
14903
15094
  },
14904
- updated(el, { value }) {
15095
+ updated(el, { value, modifiers: { number } }) {
14905
15096
  const pending = el._pendingValue;
14906
15097
  el._pendingValue = void 0;
14907
15098
  if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
14908
- setSelected(el, value);
15099
+ setSelected(el, value, number);
14909
15100
  }
14910
15101
  }
14911
15102
  };
@@ -14921,7 +15112,7 @@ function isSameSelectValue(value, assignedValue, multiple) {
14921
15112
  }
14922
15113
  return false;
14923
15114
  }
14924
- function setSelected(el, value) {
15115
+ function setSelected(el, value, number = false) {
14925
15116
  const isMultiple = el.multiple;
14926
15117
  const isArrayValue = isArray(value);
14927
15118
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -14942,7 +15133,7 @@ function setSelected(el, value) {
14942
15133
  option.selected = looseIndexOf(value, optionValue) > -1;
14943
15134
  }
14944
15135
  } else {
14945
- option.selected = value.has(optionValue);
15136
+ option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
14946
15137
  }
14947
15138
  } else if (looseEqual(getValue(option), value)) {
14948
15139
  if (el.selectedIndex !== i) el.selectedIndex = i;
@@ -18093,7 +18284,11 @@ function getLoc(start, end) {
18093
18284
  };
18094
18285
  }
18095
18286
  function cloneLoc(loc) {
18096
- return getLoc(loc.start.offset, loc.end.offset);
18287
+ return {
18288
+ start: extend({}, loc.start),
18289
+ end: extend({}, loc.end),
18290
+ source: loc.source
18291
+ };
18097
18292
  }
18098
18293
  function setLocEnd(loc, end) {
18099
18294
  loc.end = tokenizer.getPos(end);
@@ -22355,7 +22550,7 @@ const stringifyStatic = (children, context, parent) => {
22355
22550
  const child = children[i];
22356
22551
  const isCached = isParentCached || getCachedNode(child);
22357
22552
  if (isCached) {
22358
- const result = analyzeNode(child);
22553
+ const result = analyzeNode(child, context);
22359
22554
  if (result) {
22360
22555
  nc += result[0];
22361
22556
  ec += result[1];
@@ -22382,7 +22577,7 @@ const isStringifiableAttr = (name, ns) => {
22382
22577
  const isNonStringifiable = /* @__PURE__ */ makeMap(
22383
22578
  `caption,thead,tr,th,tbody,td,tfoot,colgroup,col`
22384
22579
  );
22385
- function analyzeNode(node) {
22580
+ function analyzeNode(node, context) {
22386
22581
  if (node.type === 1 && isNonStringifiable(node.tag)) {
22387
22582
  return false;
22388
22583
  }
@@ -22413,6 +22608,9 @@ function analyzeNode(node) {
22413
22608
  if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) {
22414
22609
  return bail();
22415
22610
  }
22611
+ if (p.arg && p.arg.isStatic && (isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && context.isCustomElement(node2.tag)) {
22612
+ return bail();
22613
+ }
22416
22614
  if (isOptionTag && isStaticArgOf(p.arg, "value") && p.exp && !p.exp.isStatic) {
22417
22615
  return bail();
22418
22616
  }
@@ -22477,13 +22675,10 @@ function stringifyElement(node, context) {
22477
22675
  res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
22478
22676
  continue;
22479
22677
  }
22480
- if ((isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && exp.content === "false") {
22481
- continue;
22482
- }
22483
22678
  let evaluated = evaluateConstant(exp);
22484
22679
  if (evaluated != null) {
22485
- const arg = p.arg && p.arg.content;
22486
- if (arg === "hidden" && typeof evaluated === "number" && !includeBooleanAttr(evaluated)) {
22680
+ const arg = p.arg.content;
22681
+ if ((isBooleanAttr(arg) || arg === "hidden") && !includeBooleanAttr(evaluated)) {
22487
22682
  continue;
22488
22683
  }
22489
22684
  if (arg === "class") {