vue 3.5.17 → 3.5.19

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 v3.5.17
2
+ * vue v3.5.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.17
2
+ * vue v3.5.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.17
2
+ * vue v3.5.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -56,10 +56,10 @@ const isBuiltInDirective = /* @__PURE__ */ makeMap(
56
56
  );
57
57
  const cacheStringFunction = (fn) => {
58
58
  const cache = /* @__PURE__ */ Object.create(null);
59
- return (str) => {
59
+ return ((str) => {
60
60
  const hit = cache[str];
61
61
  return hit || (cache[str] = fn(str));
62
- };
62
+ });
63
63
  };
64
64
  const camelizeRE = /-(\w)/g;
65
65
  const camelize = cacheStringFunction(
@@ -384,6 +384,24 @@ const stringifySymbol = (v, i = "") => {
384
384
  );
385
385
  };
386
386
 
387
+ function normalizeCssVarValue(value) {
388
+ if (value == null) {
389
+ return "initial";
390
+ }
391
+ if (typeof value === "string") {
392
+ return value === "" ? " " : value;
393
+ }
394
+ if (typeof value !== "number" || !Number.isFinite(value)) {
395
+ {
396
+ console.warn(
397
+ "[Vue warn] Invalid value used for CSS binding. Expected a string or a finite number but received:",
398
+ value
399
+ );
400
+ }
401
+ }
402
+ return String(value);
403
+ }
404
+
387
405
  function warn$2(msg, ...args) {
388
406
  console.warn(`[Vue warn] ${msg}`, ...args);
389
407
  }
@@ -1347,7 +1365,13 @@ class MutableReactiveHandler extends BaseReactiveHandler {
1347
1365
  }
1348
1366
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
1349
1367
  if (isOldValueReadonly) {
1350
- return false;
1368
+ {
1369
+ warn$2(
1370
+ `Set operation on key "${String(key)}" failed: target is readonly.`,
1371
+ target[key]
1372
+ );
1373
+ }
1374
+ return true;
1351
1375
  } else {
1352
1376
  oldValue.value = value;
1353
1377
  return true;
@@ -2714,7 +2738,9 @@ function rerender(id, newRender) {
2714
2738
  }
2715
2739
  instance.renderCache = [];
2716
2740
  isHmrUpdating = true;
2717
- instance.update();
2741
+ if (!(instance.job.flags & 8)) {
2742
+ instance.update();
2743
+ }
2718
2744
  isHmrUpdating = false;
2719
2745
  });
2720
2746
  }
@@ -3775,7 +3801,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3775
3801
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3776
3802
  const setupState = owner.setupState;
3777
3803
  const rawSetupState = toRaw(setupState);
3778
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3804
+ const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
3779
3805
  {
3780
3806
  if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
3781
3807
  warn$1(
@@ -3788,6 +3814,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3788
3814
  }
3789
3815
  return hasOwn(rawSetupState, key);
3790
3816
  };
3817
+ const canSetRef = (ref2) => {
3818
+ return !knownTemplateRefs.has(ref2);
3819
+ };
3791
3820
  if (oldRef != null && oldRef !== ref) {
3792
3821
  if (isString(oldRef)) {
3793
3822
  refs[oldRef] = null;
@@ -3795,7 +3824,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3795
3824
  setupState[oldRef] = null;
3796
3825
  }
3797
3826
  } else if (isRef(oldRef)) {
3798
- oldRef.value = null;
3827
+ if (canSetRef(oldRef)) {
3828
+ oldRef.value = null;
3829
+ }
3830
+ const oldRawRefAtom = oldRawRef;
3831
+ if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
3799
3832
  }
3800
3833
  }
3801
3834
  if (isFunction(ref)) {
@@ -3806,7 +3839,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3806
3839
  if (_isString || _isRef) {
3807
3840
  const doSet = () => {
3808
3841
  if (rawRef.f) {
3809
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
3842
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
3810
3843
  if (isUnmount) {
3811
3844
  isArray(existing) && remove(existing, refValue);
3812
3845
  } else {
@@ -3817,8 +3850,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3817
3850
  setupState[ref] = refs[ref];
3818
3851
  }
3819
3852
  } else {
3820
- ref.value = [refValue];
3821
- if (rawRef.k) refs[rawRef.k] = ref.value;
3853
+ const newVal = [refValue];
3854
+ if (canSetRef(ref)) {
3855
+ ref.value = newVal;
3856
+ }
3857
+ if (rawRef.k) refs[rawRef.k] = newVal;
3822
3858
  }
3823
3859
  } else if (!existing.includes(refValue)) {
3824
3860
  existing.push(refValue);
@@ -3830,7 +3866,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3830
3866
  setupState[ref] = value;
3831
3867
  }
3832
3868
  } else if (_isRef) {
3833
- ref.value = value;
3869
+ if (canSetRef(ref)) {
3870
+ ref.value = value;
3871
+ }
3834
3872
  if (rawRef.k) refs[rawRef.k] = value;
3835
3873
  } else {
3836
3874
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
@@ -4451,10 +4489,8 @@ function resolveCssVars(instance, vnode, expectedMap) {
4451
4489
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
4452
4490
  const cssVars = instance.getCssVars();
4453
4491
  for (const key in cssVars) {
4454
- expectedMap.set(
4455
- `--${getEscapedCssVarName(key)}`,
4456
- String(cssVars[key])
4457
- );
4492
+ const value = normalizeCssVarValue(cssVars[key]);
4493
+ expectedMap.set(`--${getEscapedCssVarName(key)}`, value);
4458
4494
  }
4459
4495
  }
4460
4496
  if (vnode === root && instance.parent) {
@@ -4643,16 +4679,19 @@ function defineAsyncComponent(source) {
4643
4679
  __asyncLoader: load,
4644
4680
  __asyncHydrate(el, instance, hydrate) {
4645
4681
  let patched = false;
4646
- const doHydrate = hydrateStrategy ? () => {
4647
- const performHydrate = () => {
4648
- if (patched) {
4682
+ (instance.bu || (instance.bu = [])).push(() => patched = true);
4683
+ const performHydrate = () => {
4684
+ if (patched) {
4685
+ {
4649
4686
  warn$1(
4650
- `Skipping lazy hydration for component '${getComponentName(resolvedComp)}': it was updated before lazy hydration performed.`
4687
+ `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.`
4651
4688
  );
4652
- return;
4653
4689
  }
4654
- hydrate();
4655
- };
4690
+ return;
4691
+ }
4692
+ hydrate();
4693
+ };
4694
+ const doHydrate = hydrateStrategy ? () => {
4656
4695
  const teardown = hydrateStrategy(
4657
4696
  performHydrate,
4658
4697
  (cb) => forEachElement(el, cb)
@@ -4660,8 +4699,7 @@ function defineAsyncComponent(source) {
4660
4699
  if (teardown) {
4661
4700
  (instance.bum || (instance.bum = [])).push(teardown);
4662
4701
  }
4663
- (instance.u || (instance.u = [])).push(() => patched = true);
4664
- } : hydrate;
4702
+ } : performHydrate;
4665
4703
  if (resolvedComp) {
4666
4704
  doHydrate();
4667
4705
  } else {
@@ -5399,10 +5437,10 @@ const PublicInstanceProxyHandlers = {
5399
5437
  return true;
5400
5438
  },
5401
5439
  has({
5402
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
5440
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
5403
5441
  }, key) {
5404
- let normalizedProps;
5405
- return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
5442
+ let normalizedProps, cssModules;
5443
+ return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
5406
5444
  },
5407
5445
  defineProperty(target, key, descriptor) {
5408
5446
  if (descriptor.get != null) {
@@ -5540,15 +5578,15 @@ function withDefaults(props, defaults) {
5540
5578
  return null;
5541
5579
  }
5542
5580
  function useSlots() {
5543
- return getContext().slots;
5581
+ return getContext("useSlots").slots;
5544
5582
  }
5545
5583
  function useAttrs() {
5546
- return getContext().attrs;
5584
+ return getContext("useAttrs").attrs;
5547
5585
  }
5548
- function getContext() {
5586
+ function getContext(calledFunctionName) {
5549
5587
  const i = getCurrentInstance();
5550
5588
  if (!i) {
5551
- warn$1(`useContext() called without active instance.`);
5589
+ warn$1(`${calledFunctionName}() called without active instance.`);
5552
5590
  }
5553
5591
  return i.setupContext || (i.setupContext = createSetupContext(i));
5554
5592
  }
@@ -5799,7 +5837,8 @@ function applyOptions(instance) {
5799
5837
  expose.forEach((key) => {
5800
5838
  Object.defineProperty(exposed, key, {
5801
5839
  get: () => publicThis[key],
5802
- set: (val) => publicThis[key] = val
5840
+ set: (val) => publicThis[key] = val,
5841
+ enumerable: true
5803
5842
  });
5804
5843
  });
5805
5844
  } else if (!instance.exposed) {
@@ -6249,7 +6288,7 @@ function provide(key, value) {
6249
6288
  }
6250
6289
  }
6251
6290
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
6252
- const instance = currentInstance || currentRenderingInstance;
6291
+ const instance = getCurrentInstance();
6253
6292
  if (instance || currentApp) {
6254
6293
  let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
6255
6294
  if (provides && key in provides) {
@@ -6264,7 +6303,7 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
6264
6303
  }
6265
6304
  }
6266
6305
  function hasInjectionContext() {
6267
- return !!(currentInstance || currentRenderingInstance || currentApp);
6306
+ return !!(getCurrentInstance() || currentApp);
6268
6307
  }
6269
6308
 
6270
6309
  const internalObjectProto = {};
@@ -6678,7 +6717,7 @@ function isBoolean(...args) {
6678
6717
  return args.some((elem) => elem.toLowerCase() === "boolean");
6679
6718
  }
6680
6719
 
6681
- const isInternalKey = (key) => key[0] === "_" || key === "$stable";
6720
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
6682
6721
  const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
6683
6722
  const normalizeSlot = (key, rawSlot, ctx) => {
6684
6723
  if (rawSlot._n) {
@@ -6732,8 +6771,6 @@ const assignSlots = (slots, children, optimized) => {
6732
6771
  const initSlots = (instance, children, optimized) => {
6733
6772
  const slots = instance.slots = createInternalObject();
6734
6773
  if (instance.vnode.shapeFlag & 32) {
6735
- const cacheIndexes = children.__;
6736
- if (cacheIndexes) def(slots, "__", cacheIndexes, true);
6737
6774
  const type = children._;
6738
6775
  if (type) {
6739
6776
  assignSlots(slots, children, optimized);
@@ -6794,12 +6831,10 @@ function endMeasure(instance, type) {
6794
6831
  if (instance.appContext.config.performance && isSupported()) {
6795
6832
  const startTag = `vue-${type}-${instance.uid}`;
6796
6833
  const endTag = startTag + `:end`;
6834
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
6797
6835
  perf.mark(endTag);
6798
- perf.measure(
6799
- `<${formatComponentName(instance, instance.type)}> ${type}`,
6800
- startTag,
6801
- endTag
6802
- );
6836
+ perf.measure(measureName, startTag, endTag);
6837
+ perf.clearMeasures(measureName);
6803
6838
  perf.clearMarks(startTag);
6804
6839
  perf.clearMarks(endTag);
6805
6840
  }
@@ -7420,6 +7455,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7420
7455
  if (!initialVNode.el) {
7421
7456
  const placeholder = instance.subTree = createVNode(Comment);
7422
7457
  processCommentNode(null, placeholder, container, anchor);
7458
+ initialVNode.placeholder = placeholder.el;
7423
7459
  }
7424
7460
  } else {
7425
7461
  setupRenderEffect(
@@ -7921,7 +7957,11 @@ function baseCreateRenderer(options, createHydrationFns) {
7921
7957
  for (i = toBePatched - 1; i >= 0; i--) {
7922
7958
  const nextIndex = s2 + i;
7923
7959
  const nextChild = c2[nextIndex];
7924
- const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
7960
+ const anchorVNode = c2[nextIndex + 1];
7961
+ const anchor = nextIndex + 1 < l2 ? (
7962
+ // #13559, fallback to el placeholder for unresolved async component
7963
+ anchorVNode.el || anchorVNode.placeholder
7964
+ ) : parentAnchor;
7925
7965
  if (newIndexToOldIndexMap[i] === 0) {
7926
7966
  patch(
7927
7967
  null,
@@ -7986,6 +8026,12 @@ function baseCreateRenderer(options, createHydrationFns) {
7986
8026
  }
7987
8027
  };
7988
8028
  const performLeave = () => {
8029
+ if (el._isLeaving) {
8030
+ el[leaveCbKey](
8031
+ true
8032
+ /* cancelled */
8033
+ );
8034
+ }
7989
8035
  leave(el, () => {
7990
8036
  remove2();
7991
8037
  afterLeave && afterLeave();
@@ -8131,27 +8177,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8131
8177
  if (instance.type.__hmrId) {
8132
8178
  unregisterHMR(instance);
8133
8179
  }
8134
- const {
8135
- bum,
8136
- scope,
8137
- job,
8138
- subTree,
8139
- um,
8140
- m,
8141
- a,
8142
- parent,
8143
- slots: { __: slotCacheKeys }
8144
- } = instance;
8180
+ const { bum, scope, job, subTree, um, m, a } = instance;
8145
8181
  invalidateMount(m);
8146
8182
  invalidateMount(a);
8147
8183
  if (bum) {
8148
8184
  invokeArrayFns(bum);
8149
8185
  }
8150
- if (parent && isArray(slotCacheKeys)) {
8151
- slotCacheKeys.forEach((v) => {
8152
- parent.renderCache[v] = void 0;
8153
- });
8154
- }
8155
8186
  scope.stop();
8156
8187
  if (job) {
8157
8188
  job.flags |= 8;
@@ -8163,12 +8194,6 @@ function baseCreateRenderer(options, createHydrationFns) {
8163
8194
  queuePostRenderEffect(() => {
8164
8195
  instance.isUnmounted = true;
8165
8196
  }, parentSuspense);
8166
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
8167
- parentSuspense.deps--;
8168
- if (parentSuspense.deps === 0) {
8169
- parentSuspense.resolve();
8170
- }
8171
- }
8172
8197
  {
8173
8198
  devtoolsComponentRemoved(instance);
8174
8199
  }
@@ -8269,7 +8294,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8269
8294
  if (!shallow && c2.patchFlag !== -2)
8270
8295
  traverseStaticChildren(c1, c2);
8271
8296
  }
8272
- if (c2.type === Text) {
8297
+ if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
8298
+ c2.patchFlag !== -1) {
8273
8299
  c2.el = c1.el;
8274
8300
  }
8275
8301
  if (c2.type === Comment && !c2.el) {
@@ -9814,6 +9840,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
9814
9840
  suspense: vnode.suspense,
9815
9841
  ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
9816
9842
  ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
9843
+ placeholder: vnode.placeholder,
9817
9844
  el: vnode.el,
9818
9845
  anchor: vnode.anchor,
9819
9846
  ctx: vnode.ctx,
@@ -10605,7 +10632,7 @@ function isMemoSame(cached, memo) {
10605
10632
  return true;
10606
10633
  }
10607
10634
 
10608
- const version = "3.5.17";
10635
+ const version = "3.5.19";
10609
10636
  const warn = warn$1 ;
10610
10637
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10611
10638
  const devtools = devtools$1 ;
@@ -11118,8 +11145,9 @@ function setVarsOnNode(el, vars) {
11118
11145
  const style = el.style;
11119
11146
  let cssText = "";
11120
11147
  for (const key in vars) {
11121
- style.setProperty(`--${key}`, vars[key]);
11122
- cssText += `--${key}: ${vars[key]};`;
11148
+ const value = normalizeCssVarValue(vars[key]);
11149
+ style.setProperty(`--${key}`, value);
11150
+ cssText += `--${key}: ${value};`;
11123
11151
  }
11124
11152
  style[CSS_VAR_TEXT] = cssText;
11125
11153
  }
@@ -11461,10 +11489,10 @@ function defineCustomElement(options, extraOptions, _createApp) {
11461
11489
  VueCustomElement.def = Comp;
11462
11490
  return VueCustomElement;
11463
11491
  }
11464
- /*! #__NO_SIDE_EFFECTS__ */
11465
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
11492
+
11493
+ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
11466
11494
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
11467
- };
11495
+ });
11468
11496
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11469
11497
  };
11470
11498
  class VueElement extends BaseClass {
@@ -12325,13 +12353,13 @@ const modifierGuards = {
12325
12353
  const withModifiers = (fn, modifiers) => {
12326
12354
  const cache = fn._withMods || (fn._withMods = {});
12327
12355
  const cacheKey = modifiers.join(".");
12328
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
12356
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
12329
12357
  for (let i = 0; i < modifiers.length; i++) {
12330
12358
  const guard = modifierGuards[modifiers[i]];
12331
12359
  if (guard && guard(event, modifiers)) return;
12332
12360
  }
12333
12361
  return fn(event, ...args);
12334
- });
12362
+ }));
12335
12363
  };
12336
12364
  const keyNames = {
12337
12365
  esc: "escape",
@@ -12345,7 +12373,7 @@ const keyNames = {
12345
12373
  const withKeys = (fn, modifiers) => {
12346
12374
  const cache = fn._withKeys || (fn._withKeys = {});
12347
12375
  const cacheKey = modifiers.join(".");
12348
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
12376
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
12349
12377
  if (!("key" in event)) {
12350
12378
  return;
12351
12379
  }
@@ -12355,7 +12383,7 @@ const withKeys = (fn, modifiers) => {
12355
12383
  )) {
12356
12384
  return fn(event);
12357
12385
  }
12358
- });
12386
+ }));
12359
12387
  };
12360
12388
 
12361
12389
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -12369,13 +12397,13 @@ function ensureHydrationRenderer() {
12369
12397
  enabledHydration = true;
12370
12398
  return renderer;
12371
12399
  }
12372
- const render = (...args) => {
12400
+ const render = ((...args) => {
12373
12401
  ensureRenderer().render(...args);
12374
- };
12375
- const hydrate = (...args) => {
12402
+ });
12403
+ const hydrate = ((...args) => {
12376
12404
  ensureHydrationRenderer().hydrate(...args);
12377
- };
12378
- const createApp = (...args) => {
12405
+ });
12406
+ const createApp = ((...args) => {
12379
12407
  const app = ensureRenderer().createApp(...args);
12380
12408
  {
12381
12409
  injectNativeTagCheck(app);
@@ -12400,8 +12428,8 @@ const createApp = (...args) => {
12400
12428
  return proxy;
12401
12429
  };
12402
12430
  return app;
12403
- };
12404
- const createSSRApp = (...args) => {
12431
+ });
12432
+ const createSSRApp = ((...args) => {
12405
12433
  const app = ensureHydrationRenderer().createApp(...args);
12406
12434
  {
12407
12435
  injectNativeTagCheck(app);
@@ -12415,7 +12443,7 @@ const createSSRApp = (...args) => {
12415
12443
  }
12416
12444
  };
12417
12445
  return app;
12418
- };
12446
+ });
12419
12447
  function resolveRootNamespace(container) {
12420
12448
  if (container instanceof SVGElement) {
12421
12449
  return "svg";
@@ -13834,7 +13862,7 @@ function isCoreComponent(tag) {
13834
13862
  return BASE_TRANSITION;
13835
13863
  }
13836
13864
  }
13837
- const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/;
13865
+ const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
13838
13866
  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
13839
13867
  const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
13840
13868
  const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
@@ -13946,6 +13974,9 @@ function hasDynamicKeyVBind(node) {
13946
13974
  function isText$1(node) {
13947
13975
  return node.type === 5 || node.type === 2;
13948
13976
  }
13977
+ function isVPre(p) {
13978
+ return p.type === 7 && p.name === "pre";
13979
+ }
13949
13980
  function isVSlot(p) {
13950
13981
  return p.type === 7 && p.name === "slot";
13951
13982
  }
@@ -14204,7 +14235,7 @@ const tokenizer = new Tokenizer(stack, {
14204
14235
  ondirarg(start, end) {
14205
14236
  if (start === end) return;
14206
14237
  const arg = getSlice(start, end);
14207
- if (inVPre) {
14238
+ if (inVPre && !isVPre(currentProp)) {
14208
14239
  currentProp.name += arg;
14209
14240
  setLocEnd(currentProp.nameLoc, end);
14210
14241
  } else {
@@ -14219,7 +14250,7 @@ const tokenizer = new Tokenizer(stack, {
14219
14250
  },
14220
14251
  ondirmodifier(start, end) {
14221
14252
  const mod = getSlice(start, end);
14222
- if (inVPre) {
14253
+ if (inVPre && !isVPre(currentProp)) {
14223
14254
  currentProp.name += "." + mod;
14224
14255
  setLocEnd(currentProp.nameLoc, end);
14225
14256
  } else if (currentProp.name === "slot") {
@@ -14764,6 +14795,11 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14764
14795
  } else if (child.type === 12) {
14765
14796
  const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
14766
14797
  if (constantType >= 2) {
14798
+ if (child.codegenNode.type === 14 && child.codegenNode.arguments.length > 0) {
14799
+ child.codegenNode.arguments.push(
14800
+ -1 + (` /* ${PatchFlagNames[-1]} */` )
14801
+ );
14802
+ }
14767
14803
  toCache.push(child);
14768
14804
  continue;
14769
14805
  }
@@ -14792,7 +14828,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14792
14828
  }
14793
14829
  }
14794
14830
  let cachedAsArray = false;
14795
- const slotCacheKeys = [];
14796
14831
  if (toCache.length === children.length && node.type === 1) {
14797
14832
  if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
14798
14833
  node.codegenNode.children = getCacheExpression(
@@ -14802,7 +14837,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14802
14837
  } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
14803
14838
  const slot = getSlotNode(node.codegenNode, "default");
14804
14839
  if (slot) {
14805
- slotCacheKeys.push(context.cached.length);
14806
14840
  slot.returns = getCacheExpression(
14807
14841
  createArrayExpression(slot.returns)
14808
14842
  );
@@ -14812,7 +14846,6 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14812
14846
  const slotName = findDir(node, "slot", true);
14813
14847
  const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
14814
14848
  if (slot) {
14815
- slotCacheKeys.push(context.cached.length);
14816
14849
  slot.returns = getCacheExpression(
14817
14850
  createArrayExpression(slot.returns)
14818
14851
  );
@@ -14822,23 +14855,12 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14822
14855
  }
14823
14856
  if (!cachedAsArray) {
14824
14857
  for (const child of toCache) {
14825
- slotCacheKeys.push(context.cached.length);
14826
14858
  child.codegenNode = context.cache(child.codegenNode);
14827
14859
  }
14828
14860
  }
14829
- if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
14830
- node.codegenNode.children.properties.push(
14831
- createObjectProperty(
14832
- `__`,
14833
- createSimpleExpression(JSON.stringify(slotCacheKeys), false)
14834
- )
14835
- );
14836
- }
14837
14861
  function getCacheExpression(value) {
14838
14862
  const exp = context.cache(value);
14839
- if (inFor && context.hmr) {
14840
- exp.needArraySpread = true;
14841
- }
14863
+ exp.needArraySpread = true;
14842
14864
  return exp;
14843
14865
  }
14844
14866
  function getSlotNode(node2, name) {
@@ -16020,7 +16042,7 @@ function processIf(node, dir, context, processCodegen) {
16020
16042
  continue;
16021
16043
  }
16022
16044
  if (sibling && sibling.type === 9) {
16023
- if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
16045
+ if ((dir.name === "else-if" || dir.name === "else") && sibling.branches[sibling.branches.length - 1].condition === void 0) {
16024
16046
  context.onError(
16025
16047
  createCompilerError(30, node.loc)
16026
16048
  );
@@ -16199,7 +16221,7 @@ const transformBind = (dir, _node, context) => {
16199
16221
  arg.children.unshift(`(`);
16200
16222
  arg.children.push(`) || ""`);
16201
16223
  } else if (!arg.isStatic) {
16202
- arg.content = `${arg.content} || ""`;
16224
+ arg.content = arg.content ? `${arg.content} || ""` : `""`;
16203
16225
  }
16204
16226
  if (modifiers.some((mod) => mod.content === "camel")) {
16205
16227
  if (arg.type === 4) {
@@ -17526,7 +17548,7 @@ const seen = /* @__PURE__ */ new WeakSet();
17526
17548
  const transformMemo = (node, context) => {
17527
17549
  if (node.type === 1) {
17528
17550
  const dir = findDir(node, "memo");
17529
- if (!dir || seen.has(node)) {
17551
+ if (!dir || seen.has(node) || context.inSSR) {
17530
17552
  return;
17531
17553
  }
17532
17554
  seen.add(node);