@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.
@@ -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++) {
@@ -210,7 +206,7 @@ const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
210
206
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
211
207
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
212
208
 
213
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
209
+ const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
214
210
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
215
211
  const isBooleanAttr = /* @__PURE__ */ makeMap(
216
212
  specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
@@ -558,7 +554,11 @@ function getCurrentScope() {
558
554
  }
559
555
  function onScopeDispose(fn, failSilently = false) {
560
556
  if (activeEffectScope) {
561
- activeEffectScope.cleanups.push(fn);
557
+ if (activeEffectScope.active) {
558
+ activeEffectScope.cleanups.push(fn);
559
+ } else {
560
+ fn();
561
+ }
562
562
  }
563
563
  }
564
564
 
@@ -1313,7 +1313,7 @@ function noTracking(self, method, args = []) {
1313
1313
  }
1314
1314
 
1315
1315
  const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
1316
- const builtInSymbols = new Set(
1316
+ const builtInSymbols = /* @__PURE__ */ new Set(
1317
1317
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
1318
1318
  );
1319
1319
  function hasOwnProperty(key) {
@@ -2315,7 +2315,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2315
2315
  const res = callWithErrorHandling(fn, instance, type, args);
2316
2316
  if (res && isPromise(res)) {
2317
2317
  res.catch((err) => {
2318
- handleError(err, instance, type);
2318
+ handleError(err, instance, type, void 0, true);
2319
2319
  });
2320
2320
  }
2321
2321
  return res;
@@ -2328,7 +2328,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2328
2328
  return values;
2329
2329
  }
2330
2330
  }
2331
- function handleError(err, instance, type, throwInDev = true) {
2331
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2332
2332
  const contextVNode = instance ? instance.vnode : null;
2333
2333
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2334
2334
  if (instance) {
@@ -2337,7 +2337,9 @@ function handleError(err, instance, type, throwInDev = true) {
2337
2337
  const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
2338
2338
  while (cur) {
2339
2339
  const errorCapturedHooks = cur.ec;
2340
- if (errorCapturedHooks) {
2340
+ if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
2341
+ // are deferred or discarded by Suspense.
2342
+ (!isAsyncError || cur.scope.active)) {
2341
2343
  for (let i = 0; i < errorCapturedHooks.length; i++) {
2342
2344
  if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
2343
2345
  return;
@@ -2813,12 +2815,31 @@ function withDirectives(vnode, directives) {
2813
2815
  return vnode;
2814
2816
  }
2815
2817
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
2816
- const bindings = vnode.dirs;
2818
+ let hookVNode = vnode;
2819
+ if (name === "beforeMount") {
2820
+ vnode._mount = vnode;
2821
+ } else if (name === "beforeUpdate") {
2822
+ const mount = prevVNode && prevVNode._mount;
2823
+ if (mount) {
2824
+ mount._latest = vnode;
2825
+ vnode._mount = mount;
2826
+ }
2827
+ } else if (name === "mounted") {
2828
+ const latest = vnode._latest;
2829
+ vnode._mount = vnode._latest = void 0;
2830
+ if (latest) {
2831
+ hookVNode = latest;
2832
+ latest._mount = void 0;
2833
+ }
2834
+ }
2835
+ const bindings = hookVNode.dirs;
2817
2836
  const oldBindings = prevVNode && prevVNode.dirs;
2818
2837
  for (let i = 0; i < bindings.length; i++) {
2819
- const binding = bindings[i];
2838
+ let binding = bindings[i];
2820
2839
  if (oldBindings) {
2821
2840
  binding.oldValue = oldBindings[i].value;
2841
+ } else if (name === "mounted" && binding.oldValue !== void 0) {
2842
+ binding = extend$1({}, binding, { oldValue: void 0 });
2822
2843
  }
2823
2844
  let hook = binding.dir[name];
2824
2845
  if (!hook) {
@@ -2829,7 +2850,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
2829
2850
  callWithAsyncErrorHandling(hook, instance, 8, [
2830
2851
  vnode.el,
2831
2852
  binding,
2832
- vnode,
2853
+ hookVNode,
2833
2854
  prevVNode
2834
2855
  ]);
2835
2856
  resetTracking();
@@ -3390,13 +3411,11 @@ const BaseTransitionImpl = {
3390
3411
  if (!innerChild) {
3391
3412
  return emptyPlaceholder(child);
3392
3413
  }
3393
- let enterHooks = resolveTransitionHooks(
3414
+ const enterHooks = resolveTransitionHooks(
3394
3415
  innerChild,
3395
3416
  rawProps,
3396
3417
  state,
3397
- instance,
3398
- // #11061, ensure enterHooks is fresh after clone
3399
- (hooks) => enterHooks = hooks
3418
+ instance
3400
3419
  );
3401
3420
  if (innerChild.type !== Comment) {
3402
3421
  setTransitionHooks(innerChild, enterHooks);
@@ -3415,7 +3434,17 @@ const BaseTransitionImpl = {
3415
3434
  leavingHooks.afterLeave = () => {
3416
3435
  state.isLeaving = false;
3417
3436
  if (!(instance.job.flags & 8)) {
3418
- instance.update();
3437
+ if (instance.effect.flags & 2) {
3438
+ const job = () => {
3439
+ if (!(instance.job.flags & 8)) {
3440
+ instance.update();
3441
+ }
3442
+ };
3443
+ job.i = instance;
3444
+ queueJob(job);
3445
+ } else {
3446
+ instance.update();
3447
+ }
3419
3448
  }
3420
3449
  delete leavingHooks.afterLeave;
3421
3450
  oldInnerChild = void 0;
@@ -3475,7 +3504,7 @@ function getLeavingNodesForType(state, vnode) {
3475
3504
  }
3476
3505
  return leavingVNodesCache;
3477
3506
  }
3478
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3507
+ function resolveTransitionHooks(vnode, props, state, instance) {
3479
3508
  const {
3480
3509
  appear,
3481
3510
  mode,
@@ -3614,15 +3643,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3614
3643
  }
3615
3644
  },
3616
3645
  clone(vnode2) {
3617
- const hooks2 = resolveTransitionHooks(
3618
- vnode2,
3619
- props,
3620
- state,
3621
- instance,
3622
- postClone
3623
- );
3624
- if (postClone) postClone(hooks2);
3625
- return hooks2;
3646
+ const cloned = resolveTransitionHooks(vnode2, props, state, instance);
3647
+ cloned.afterLeave = () => {
3648
+ if (hooks.afterLeave) hooks.afterLeave();
3649
+ };
3650
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
3651
+ if (hooks.delayLeave) {
3652
+ hooks.delayLeave(el, earlyRemove, delayedLeave);
3653
+ } else {
3654
+ delayedLeave();
3655
+ }
3656
+ };
3657
+ cloned.delayedLeave = () => {
3658
+ if (hooks.delayedLeave) hooks.delayedLeave();
3659
+ };
3660
+ return cloned;
3626
3661
  }
3627
3662
  };
3628
3663
  return hooks;
@@ -3663,8 +3698,16 @@ function setTransitionHooks(vnode, hooks) {
3663
3698
  hooks
3664
3699
  );
3665
3700
  } else if (vnode.shapeFlag & 128) {
3666
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3667
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3701
+ const suspense = vnode.suspense;
3702
+ if (suspense) {
3703
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
3704
+ if (branch) {
3705
+ setTransitionHooks(branch, hooks.clone(branch));
3706
+ }
3707
+ } else {
3708
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3709
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3710
+ }
3668
3711
  } else {
3669
3712
  vnode.transition = hooks;
3670
3713
  if (vnode.type === Fragment && isArray(vnode.children)) {
@@ -4289,7 +4332,7 @@ function createHydrationFunctions(rendererInternals) {
4289
4332
  getContainerType(container),
4290
4333
  slotScopeIds
4291
4334
  );
4292
- if (parentComponent) {
4335
+ if (parentComponent && parentComponent.vnode.el === node) {
4293
4336
  parentComponent.vnode.el = vnode.el;
4294
4337
  updateHOCHostEl(parentComponent, vnode.el);
4295
4338
  }
@@ -4575,7 +4618,8 @@ function defineAsyncComponent(source) {
4575
4618
  err,
4576
4619
  instance,
4577
4620
  13,
4578
- !errorComponent
4621
+ !errorComponent,
4622
+ true
4579
4623
  );
4580
4624
  };
4581
4625
  if (suspensible && instance.suspense || isInSSRComponentSetup) {
@@ -4593,7 +4637,7 @@ function defineAsyncComponent(source) {
4593
4637
  const delayed = ref(!!delay);
4594
4638
  let timeoutTimer;
4595
4639
  let delayTimer;
4596
- onUnmounted(() => {
4640
+ onScopeDispose(() => {
4597
4641
  if (timeoutTimer != null) clearTimeout(timeoutTimer);
4598
4642
  if (delayTimer != null) clearTimeout(delayTimer);
4599
4643
  });
@@ -4715,6 +4759,12 @@ const KeepAliveImpl = {
4715
4759
  }, parentSuspense);
4716
4760
  };
4717
4761
  sharedContext.deactivate = (vnode) => {
4762
+ const cached = cache.get(
4763
+ vnode.key == null ? vnode.type : vnode.key
4764
+ );
4765
+ if (!cached || cached.component !== vnode.component) {
4766
+ return false;
4767
+ }
4718
4768
  const instance2 = vnode.component;
4719
4769
  invalidateMount(instance2.m);
4720
4770
  invalidateMount(instance2.a);
@@ -4729,6 +4779,7 @@ const KeepAliveImpl = {
4729
4779
  }
4730
4780
  instance2.isDeactivated = true;
4731
4781
  }, parentSuspense);
4782
+ return true;
4732
4783
  };
4733
4784
  function unmount(vnode) {
4734
4785
  resetShapeFlag(vnode);
@@ -4768,12 +4819,17 @@ const KeepAliveImpl = {
4768
4819
  const cacheSubtree = () => {
4769
4820
  if (pendingCacheKey != null) {
4770
4821
  if (isSuspense(instance.subTree.type)) {
4771
- queuePostRenderEffect(() => {
4822
+ const cacheInnerChild = () => {
4772
4823
  const vnode = getInnerChild(instance.subTree);
4773
4824
  if (vnode.component) {
4774
4825
  cache.set(pendingCacheKey, vnode);
4775
4826
  }
4776
- }, instance.subTree.suspense);
4827
+ };
4828
+ if (instance.subTree.suspense.pendingBranch) {
4829
+ queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
4830
+ } else {
4831
+ cacheInnerChild();
4832
+ }
4777
4833
  } else {
4778
4834
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
4779
4835
  }
@@ -4905,9 +4961,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4905
4961
  true
4906
4962
  /* prepend */
4907
4963
  );
4908
- onUnmounted(() => {
4909
- remove(keepAliveRoot[type], injected);
4910
- }, target);
4964
+ const removal = injectHook(
4965
+ "um",
4966
+ () => remove(keepAliveRoot[type], injected),
4967
+ target
4968
+ );
4969
+ removal.flags = 16;
4911
4970
  }
4912
4971
  function resetShapeFlag(vnode) {
4913
4972
  vnode.shapeFlag &= -257;
@@ -6334,7 +6393,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6334
6393
  return vm;
6335
6394
  }
6336
6395
  }
6337
- Vue.version = `2.6.14-compat:${"3.5.44"}`;
6396
+ Vue.version = `2.6.14-compat:${"3.5.45"}`;
6338
6397
  Vue.config = singletonApp.config;
6339
6398
  Vue.use = (plugin, ...options) => {
6340
6399
  if (plugin && isFunction(plugin.install)) {
@@ -7959,6 +8018,8 @@ function baseCreateRenderer(options, createHydrationFns) {
7959
8018
  const needCallTransitionHooks = needTransition(parentSuspense, transition);
7960
8019
  if (needCallTransitionHooks) {
7961
8020
  transition.beforeEnter(el);
8021
+ } else if (transition && !transition.persisted) {
8022
+ el[deferredEnterKey] = true;
7962
8023
  }
7963
8024
  hostInsert(el, container, anchor);
7964
8025
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
@@ -8395,16 +8456,23 @@ function baseCreateRenderer(options, createHydrationFns) {
8395
8456
  } else {
8396
8457
  let { next, bu, u, parent, vnode } = instance;
8397
8458
  {
8398
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
8399
- if (nonHydratedAsyncRoot) {
8459
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
8460
+ if (unresolvedAsyncRoot) {
8400
8461
  if (next) {
8401
8462
  next.el = vnode.el;
8402
8463
  updateComponentPreRender(instance, next, optimized);
8403
8464
  }
8404
- nonHydratedAsyncRoot.asyncDep.then(() => {
8405
- queuePostRenderEffect(() => {
8406
- if (!instance.isUnmounted) update();
8407
- }, parentSuspense);
8465
+ unresolvedAsyncRoot.asyncDep.then(() => {
8466
+ const retry = () => {
8467
+ if (instance.job.flags & 8) return;
8468
+ if (parentSuspense && parentSuspense.pendingBranch) {
8469
+ queuePostRenderEffect(retry, parentSuspense);
8470
+ } else {
8471
+ update();
8472
+ }
8473
+ };
8474
+ retry.flags = 16 | 32;
8475
+ queuePostRenderEffect(retry, parentSuspense);
8408
8476
  });
8409
8477
  return;
8410
8478
  }
@@ -8434,8 +8502,11 @@ function baseCreateRenderer(options, createHydrationFns) {
8434
8502
  patch(
8435
8503
  prevTree,
8436
8504
  nextTree,
8437
- // parent may have changed if it's in a teleport
8438
- hostParentNode(prevTree.el),
8505
+ // parent may have changed if it's in a teleport. a root that is a
8506
+ // pending async component only has its placeholder comment
8507
+ hostParentNode(
8508
+ prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
8509
+ ),
8439
8510
  // anchor may have changed if it's in a fragment
8440
8511
  getNextHostNode(prevTree),
8441
8512
  instance,
@@ -8861,8 +8932,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8861
8932
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
8862
8933
  parentComponent.renderCache[cacheIndex] = void 0;
8863
8934
  }
8864
- if (shapeFlag & 256) {
8865
- parentComponent.ctx.deactivate(vnode);
8935
+ if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
8866
8936
  return;
8867
8937
  }
8868
8938
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
@@ -8984,7 +9054,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8984
9054
  if (job) {
8985
9055
  job.flags |= 8;
8986
9056
  unmount(subTree, instance, parentSuspense, doRemove);
8987
- } else if (instance.vnode.el && subTree) {
9057
+ } else if (subTree) {
8988
9058
  subTree.transition = instance.vnode.transition;
8989
9059
  unmount(subTree, instance, parentSuspense, doRemove);
8990
9060
  }
@@ -8997,9 +9067,11 @@ function baseCreateRenderer(options, createHydrationFns) {
8997
9067
  parentSuspense
8998
9068
  );
8999
9069
  }
9000
- queuePostRenderEffect(() => {
9070
+ const markUnmounted = () => {
9001
9071
  instance.isUnmounted = true;
9002
- }, parentSuspense);
9072
+ };
9073
+ markUnmounted.flags = 16;
9074
+ queuePostRenderEffect(markUnmounted, parentSuspense);
9003
9075
  };
9004
9076
  const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
9005
9077
  for (let i = start; i < children.length; i++) {
@@ -9145,13 +9217,13 @@ function getSequence(arr) {
9145
9217
  }
9146
9218
  return result;
9147
9219
  }
9148
- function locateNonHydratedAsyncRoot(instance) {
9220
+ function locateUnresolvedAsyncRoot(instance) {
9149
9221
  const subComponent = instance.subTree.component;
9150
9222
  if (subComponent) {
9151
9223
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
9152
9224
  return subComponent;
9153
9225
  } else {
9154
- return locateNonHydratedAsyncRoot(subComponent);
9226
+ return locateUnresolvedAsyncRoot(subComponent);
9155
9227
  }
9156
9228
  }
9157
9229
  }
@@ -9169,11 +9241,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
9169
9241
  if (instance) {
9170
9242
  return resolveAsyncComponentPlaceholder(instance.subTree);
9171
9243
  }
9244
+ const suspense = anchorVnode.suspense;
9245
+ if (suspense && suspense.activeBranch) {
9246
+ return resolveAsyncComponentPlaceholder(suspense.activeBranch);
9247
+ }
9172
9248
  return null;
9173
9249
  }
9174
9250
 
9175
9251
  const isSuspense = (type) => type.__isSuspense;
9176
9252
  let suspenseId = 0;
9253
+ const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
9177
9254
  const SuspenseImpl = {
9178
9255
  name: "Suspense",
9179
9256
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -9195,11 +9272,22 @@ const SuspenseImpl = {
9195
9272
  rendererInternals
9196
9273
  );
9197
9274
  } else {
9198
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
9199
- n2.suspense = n1.suspense;
9200
- n2.suspense.vnode = n2;
9201
- n2.el = n1.el;
9202
- return;
9275
+ const suspense = n1.suspense;
9276
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
9277
+ const owner = suspense.parentComponent;
9278
+ const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
9279
+ if (retained ? (
9280
+ // deps can outlive the pending branch: skip only while it exists
9281
+ parentSuspense.pendingBranch && !isSameVNodeType(
9282
+ n2.ssContent,
9283
+ suspense.pendingBranch || suspense.activeBranch
9284
+ )
9285
+ ) : !suspense.isInFallback) {
9286
+ n2.suspense = suspense;
9287
+ suspense.vnode = n2;
9288
+ n2.el = n1.el;
9289
+ return;
9290
+ }
9203
9291
  }
9204
9292
  patchSuspense(
9205
9293
  n1,
@@ -9224,6 +9312,38 @@ function triggerEvent(vnode, name) {
9224
9312
  eventListener();
9225
9313
  }
9226
9314
  }
9315
+ function enterDeferred(branch) {
9316
+ const enters = [];
9317
+ collectDeferredEnters(branch, enters, true);
9318
+ if (enters.length) {
9319
+ queuePostFlushCb(enters);
9320
+ }
9321
+ }
9322
+ function collectDeferredEnters(vnode, enters, isRoot) {
9323
+ const { el, transition, children, shapeFlag } = vnode;
9324
+ if (shapeFlag & 6) {
9325
+ collectDeferredEnters(vnode.component.subTree, enters, isRoot);
9326
+ return;
9327
+ }
9328
+ if (shapeFlag & (128 | 64)) {
9329
+ return;
9330
+ }
9331
+ if (shapeFlag & 1) {
9332
+ if (!isRoot && el && el[deferredEnterKey]) {
9333
+ el[deferredEnterKey] = void 0;
9334
+ if (transition && !transition.persisted) {
9335
+ transition.beforeEnter(el);
9336
+ enters.push(() => transition.enter(el));
9337
+ }
9338
+ }
9339
+ isRoot = false;
9340
+ }
9341
+ if (shapeFlag & 16) {
9342
+ for (let i = 0; i < children.length; i++) {
9343
+ collectDeferredEnters(children[i], enters, isRoot);
9344
+ }
9345
+ }
9346
+ }
9227
9347
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
9228
9348
  const {
9229
9349
  p: patch,
@@ -9323,7 +9443,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9323
9443
  unmount(pendingBranch, parentComponent, suspense);
9324
9444
  }
9325
9445
  suspense.deps = 0;
9326
- suspense.effects.length = 0;
9446
+ discardEffects(suspense);
9327
9447
  suspense.hiddenContainer = createElement("div");
9328
9448
  if (isInFallback) {
9329
9449
  patch(
@@ -9401,11 +9521,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9401
9521
  } else {
9402
9522
  triggerEvent(n2, "onPending");
9403
9523
  suspense.pendingBranch = newBranch;
9404
- if (newBranch.shapeFlag & 512) {
9405
- suspense.pendingId = newBranch.component.suspenseId;
9406
- } else {
9407
- suspense.pendingId = suspenseId++;
9408
- }
9524
+ suspense.pendingId = suspenseId++;
9409
9525
  patch(
9410
9526
  null,
9411
9527
  newBranch,
@@ -9420,12 +9536,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
9420
9536
  if (suspense.deps <= 0) {
9421
9537
  suspense.resolve();
9422
9538
  } else {
9423
- const { timeout, pendingId } = suspense;
9539
+ const { timeout } = suspense;
9424
9540
  if (timeout > 0) {
9425
- setTimeout(() => {
9426
- if (suspense.pendingId === pendingId) {
9427
- suspense.fallback(newFallback);
9428
- }
9541
+ suspense.timeoutTimer = setTimeout(() => {
9542
+ suspense.timeoutTimer = void 0;
9543
+ suspense.fallback(suspense.vnode.ssFallback);
9429
9544
  }, timeout);
9430
9545
  } else if (timeout === 0) {
9431
9546
  suspense.fallback(newFallback);
@@ -9462,6 +9577,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9462
9577
  deps: 0,
9463
9578
  pendingId: suspenseId++,
9464
9579
  timeout: typeof timeout === "number" ? timeout : -1,
9580
+ timeoutTimer: void 0,
9465
9581
  activeBranch: null,
9466
9582
  isFallbackMountPending: false,
9467
9583
  pendingBranch: null,
@@ -9488,7 +9604,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9488
9604
  let hasUpdatedAnchor = false;
9489
9605
  if (delayEnter) {
9490
9606
  activeBranch.transition.afterLeave = () => {
9491
- if (pendingId === suspense.pendingId) {
9607
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
9608
+ enterDeferred(pendingBranch);
9492
9609
  move(
9493
9610
  pendingBranch,
9494
9611
  container2,
@@ -9503,7 +9620,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9503
9620
  };
9504
9621
  }
9505
9622
  if (activeBranch && !suspense.isFallbackMountPending) {
9506
- if (parentNode(activeBranch.el) === container2) {
9623
+ if (parentNode(
9624
+ activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
9625
+ ) === container2) {
9507
9626
  anchor = next(activeBranch);
9508
9627
  hasUpdatedAnchor = true;
9509
9628
  }
@@ -9513,13 +9632,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9513
9632
  }
9514
9633
  }
9515
9634
  if (!delayEnter) {
9635
+ enterDeferred(pendingBranch);
9516
9636
  move(pendingBranch, container2, anchor, 0);
9517
9637
  }
9518
9638
  }
9639
+ clearTimeout(suspense.timeoutTimer);
9640
+ suspense.timeoutTimer = void 0;
9519
9641
  suspense.isFallbackMountPending = false;
9520
9642
  setActiveBranch(suspense, pendingBranch);
9521
9643
  suspense.pendingBranch = null;
9522
9644
  suspense.isInFallback = false;
9645
+ let kept = 0;
9646
+ for (let i = 0; i < effects.length; i++) {
9647
+ const effect = effects[i];
9648
+ if (effect.flags & 32) {
9649
+ queuePostFlushCb(effect);
9650
+ } else {
9651
+ effects[kept++] = effect;
9652
+ }
9653
+ }
9654
+ effects.length = kept;
9523
9655
  let parent = suspense.parent;
9524
9656
  let hasUnresolvedAncestor = false;
9525
9657
  while (parent) {
@@ -9548,7 +9680,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9548
9680
  triggerEvent(vnode2, "onResolve");
9549
9681
  },
9550
9682
  fallback(fallbackVNode) {
9551
- if (!suspense.pendingBranch) {
9683
+ if (suspense.isUnmounted || !suspense.pendingBranch) {
9552
9684
  return;
9553
9685
  }
9554
9686
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
@@ -9556,7 +9688,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9556
9688
  const anchor2 = next(activeBranch);
9557
9689
  const mountFallback = () => {
9558
9690
  suspense.isFallbackMountPending = false;
9559
- if (!suspense.isInFallback) {
9691
+ if (suspense.isUnmounted || !suspense.isInFallback) {
9560
9692
  return;
9561
9693
  }
9562
9694
  const latestFallback = suspense.vnode.ssFallback;
@@ -9608,19 +9740,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9608
9740
  suspense.deps++;
9609
9741
  }
9610
9742
  const hydratedEl = instance.vnode.el;
9611
- instance.asyncDep.catch((err) => {
9612
- handleError(err, instance, 0);
9613
- }).then((asyncSetupResult) => {
9614
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
9615
- return;
9616
- }
9617
- unsetCurrentInstance();
9618
- if (!instance.scope.active) {
9619
- if (isInPendingSuspense && --suspense.deps === 0) {
9620
- suspense.resolve();
9621
- }
9622
- return;
9623
- }
9743
+ const render = (asyncSetupResult) => {
9624
9744
  instance.asyncResolved = true;
9625
9745
  const { vnode: vnode2 } = instance;
9626
9746
  handleSetupResult(instance, asyncSetupResult, false);
@@ -9647,13 +9767,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9647
9767
  remove(placeholder);
9648
9768
  }
9649
9769
  updateHOCHostEl(instance, vnode2.el);
9650
- if (isInPendingSuspense && --suspense.deps === 0) {
9770
+ };
9771
+ instance.asyncDep.catch((err) => {
9772
+ handleError(err, instance, 0, false, true);
9773
+ return () => null;
9774
+ }).then((asyncSetupResult) => {
9775
+ if (instance.isUnmounted || suspense.isUnmounted) {
9776
+ return;
9777
+ }
9778
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
9779
+ unsetCurrentInstance();
9780
+ if (!instance.scope.active) {
9781
+ if (isPendingDep && --suspense.deps === 0) {
9782
+ suspense.resolve();
9783
+ }
9784
+ return;
9785
+ }
9786
+ if (!isPendingDep && suspense.pendingBranch) {
9787
+ const job = () => {
9788
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
9789
+ return;
9790
+ }
9791
+ if (suspense.pendingBranch) {
9792
+ queueEffectWithSuspense(job, suspense);
9793
+ } else {
9794
+ render(asyncSetupResult);
9795
+ }
9796
+ };
9797
+ job.flags = 16 | 32;
9798
+ queueEffectWithSuspense(job, suspense);
9799
+ return;
9800
+ }
9801
+ render(asyncSetupResult);
9802
+ if (isPendingDep && --suspense.deps === 0) {
9651
9803
  suspense.resolve();
9652
9804
  }
9653
9805
  });
9654
9806
  },
9655
9807
  unmount(parentSuspense2, doRemove) {
9656
9808
  suspense.isUnmounted = true;
9809
+ clearTimeout(suspense.timeoutTimer);
9810
+ suspense.timeoutTimer = void 0;
9811
+ if (parentSuspenseId !== void 0) {
9812
+ const parent = suspense.parent;
9813
+ const pendingId = parentSuspenseId;
9814
+ parentSuspenseId = void 0;
9815
+ queuePostFlushCb(() => {
9816
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
9817
+ parent.resolve();
9818
+ }
9819
+ });
9820
+ }
9657
9821
  if (suspense.activeBranch) {
9658
9822
  unmount(
9659
9823
  suspense.activeBranch,
@@ -9663,12 +9827,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9663
9827
  );
9664
9828
  }
9665
9829
  if (suspense.pendingBranch) {
9666
- unmount(
9667
- suspense.pendingBranch,
9668
- parentComponent,
9669
- parentSuspense2,
9670
- doRemove
9671
- );
9830
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
9831
+ discardEffects(suspense);
9672
9832
  }
9673
9833
  }
9674
9834
  };
@@ -9735,6 +9895,16 @@ function normalizeSuspenseSlot(s) {
9735
9895
  }
9736
9896
  return s;
9737
9897
  }
9898
+ function discardEffects(suspense) {
9899
+ const { effects } = suspense;
9900
+ for (let i = 0; i < effects.length; i++) {
9901
+ const effect = effects[i];
9902
+ if (effect.flags & 16) {
9903
+ queuePostFlushCb(effect);
9904
+ }
9905
+ }
9906
+ effects.length = 0;
9907
+ }
9738
9908
  function queueEffectWithSuspense(fn, suspense) {
9739
9909
  if (suspense && suspense.pendingBranch) {
9740
9910
  if (isArray(fn)) {
@@ -10007,7 +10177,8 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
10007
10177
  }
10008
10178
  function guardReactiveProps(props) {
10009
10179
  if (!props) return null;
10010
- return isProxy(props) || isInternalObject(props) ? extend$1({}, props) : props;
10180
+ if (isProxy(props)) return extend$1({}, props);
10181
+ return isInternalObject(props) ? extend$1({}, props[rawAttrsKey] || props) : props;
10011
10182
  }
10012
10183
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
10013
10184
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -10182,7 +10353,7 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
10182
10353
  ]);
10183
10354
  }
10184
10355
 
10185
- const emptyAppContext = createAppContext();
10356
+ const emptyAppContext = /* @__PURE__ */ createAppContext();
10186
10357
  let uid = 0;
10187
10358
  function getNextUid() {
10188
10359
  return uid;
@@ -10362,7 +10533,8 @@ function setupStatefulComponent(instance, isSSR) {
10362
10533
  setInSSRSetupState(false);
10363
10534
  }
10364
10535
  }).catch((e) => {
10365
- handleError(e, instance, 0);
10536
+ handleError(e, instance, 0, void 0, true);
10537
+ instance.ssrRender = (_, push) => push("<!---->");
10366
10538
  });
10367
10539
  } else {
10368
10540
  instance.asyncDep = setupResult;
@@ -10443,10 +10615,11 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
10443
10615
  }
10444
10616
  }
10445
10617
  }
10618
+ const rawAttrsKey = /* @__PURE__ */ Symbol();
10446
10619
  const attrsProxyHandlers = {
10447
10620
  get(target, key) {
10448
10621
  track(target, "get", "");
10449
- return target[key];
10622
+ return key === rawAttrsKey ? target : target[key];
10450
10623
  }
10451
10624
  };
10452
10625
  function createSetupContext(instance) {
@@ -10550,7 +10723,7 @@ function isMemoSame(cached, memo) {
10550
10723
  return true;
10551
10724
  }
10552
10725
 
10553
- const version = "3.5.44";
10726
+ const version = "3.5.45";
10554
10727
  const warn$1 = NOOP;
10555
10728
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10556
10729
  const devtools = void 0;
@@ -12280,18 +12453,18 @@ const vModelSelect = {
12280
12453
  },
12281
12454
  // set value in mounted & updated because <select> relies on its children
12282
12455
  // <option>s.
12283
- mounted(el, { value }) {
12284
- setSelected(el, value);
12456
+ mounted(el, { value, modifiers: { number } }) {
12457
+ setSelected(el, value, number);
12285
12458
  },
12286
12459
  beforeUpdate(el, { value }, vnode) {
12287
12460
  el._modelValue = value;
12288
12461
  el[assignKey] = getModelAssigner(vnode);
12289
12462
  },
12290
- updated(el, { value }) {
12463
+ updated(el, { value, modifiers: { number } }) {
12291
12464
  const pending = el._pendingValue;
12292
12465
  el._pendingValue = void 0;
12293
12466
  if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
12294
- setSelected(el, value);
12467
+ setSelected(el, value, number);
12295
12468
  }
12296
12469
  }
12297
12470
  };
@@ -12307,7 +12480,7 @@ function isSameSelectValue(value, assignedValue, multiple) {
12307
12480
  }
12308
12481
  return false;
12309
12482
  }
12310
- function setSelected(el, value) {
12483
+ function setSelected(el, value, number = false) {
12311
12484
  const isMultiple = el.multiple;
12312
12485
  const isArrayValue = isArray(value);
12313
12486
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -12325,7 +12498,7 @@ function setSelected(el, value) {
12325
12498
  option.selected = looseIndexOf(value, optionValue) > -1;
12326
12499
  }
12327
12500
  } else {
12328
- option.selected = value.has(optionValue);
12501
+ option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
12329
12502
  }
12330
12503
  } else if (looseEqual(getValue(option), value)) {
12331
12504
  if (el.selectedIndex !== i) el.selectedIndex = i;
@@ -15320,7 +15493,11 @@ function getLoc(start, end) {
15320
15493
  };
15321
15494
  }
15322
15495
  function cloneLoc(loc) {
15323
- return getLoc(loc.start.offset, loc.end.offset);
15496
+ return {
15497
+ start: extend$1({}, loc.start),
15498
+ end: extend$1({}, loc.end),
15499
+ source: loc.source
15500
+ };
15324
15501
  }
15325
15502
  function setLocEnd(loc, end) {
15326
15503
  loc.end = tokenizer.getPos(end);
@@ -19459,7 +19636,7 @@ const stringifyStatic = (children, context, parent) => {
19459
19636
  const child = children[i];
19460
19637
  const isCached = isParentCached || getCachedNode(child);
19461
19638
  if (isCached) {
19462
- const result = analyzeNode(child);
19639
+ const result = analyzeNode(child, context);
19463
19640
  if (result) {
19464
19641
  nc += result[0];
19465
19642
  ec += result[1];
@@ -19486,7 +19663,7 @@ const isStringifiableAttr = (name, ns) => {
19486
19663
  const isNonStringifiable = /* @__PURE__ */ makeMap(
19487
19664
  `caption,thead,tr,th,tbody,td,tfoot,colgroup,col`
19488
19665
  );
19489
- function analyzeNode(node) {
19666
+ function analyzeNode(node, context) {
19490
19667
  if (node.type === 1 && isNonStringifiable(node.tag)) {
19491
19668
  return false;
19492
19669
  }
@@ -19517,6 +19694,9 @@ function analyzeNode(node) {
19517
19694
  if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) {
19518
19695
  return bail();
19519
19696
  }
19697
+ if (p.arg && p.arg.isStatic && (isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && context.isCustomElement(node2.tag)) {
19698
+ return bail();
19699
+ }
19520
19700
  if (isOptionTag && isStaticArgOf(p.arg, "value") && p.exp && !p.exp.isStatic) {
19521
19701
  return bail();
19522
19702
  }
@@ -19581,13 +19761,10 @@ function stringifyElement(node, context) {
19581
19761
  res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
19582
19762
  continue;
19583
19763
  }
19584
- if ((isBooleanAttr(p.arg.content) || p.arg.content === "hidden") && exp.content === "false") {
19585
- continue;
19586
- }
19587
19764
  let evaluated = evaluateConstant(exp);
19588
19765
  if (evaluated != null) {
19589
- const arg = p.arg && p.arg.content;
19590
- if (arg === "hidden" && typeof evaluated === "number" && !includeBooleanAttr(evaluated)) {
19766
+ const arg = p.arg.content;
19767
+ if ((isBooleanAttr(arg) || arg === "hidden") && !includeBooleanAttr(evaluated)) {
19591
19768
  continue;
19592
19769
  }
19593
19770
  if (arg === "class") {