vue 3.3.0-alpha.2 → 3.3.0-alpha.3

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.
@@ -1465,7 +1465,7 @@ function warn(msg, ...args) {
1465
1465
  callWithErrorHandling(
1466
1466
  appWarnHandler,
1467
1467
  instance,
1468
- 11,
1468
+ "11",
1469
1469
  [
1470
1470
  msg + args.join(""),
1471
1471
  instance && instance.proxy,
@@ -1578,21 +1578,21 @@ const ErrorTypeStrings = {
1578
1578
  ["ec"]: "errorCaptured hook",
1579
1579
  ["rtc"]: "renderTracked hook",
1580
1580
  ["rtg"]: "renderTriggered hook",
1581
- [0]: "setup function",
1582
- [1]: "render function",
1583
- [2]: "watcher getter",
1584
- [3]: "watcher callback",
1585
- [4]: "watcher cleanup function",
1586
- [5]: "native event handler",
1587
- [6]: "component event handler",
1588
- [7]: "vnode hook",
1589
- [8]: "directive hook",
1590
- [9]: "transition hook",
1591
- [10]: "app errorHandler",
1592
- [11]: "app warnHandler",
1593
- [12]: "ref function",
1594
- [13]: "async component loader",
1595
- [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
1581
+ ["0"]: "setup function",
1582
+ ["1"]: "render function",
1583
+ ["2"]: "watcher getter",
1584
+ ["3"]: "watcher callback",
1585
+ ["4"]: "watcher cleanup function",
1586
+ ["5"]: "native event handler",
1587
+ ["6"]: "component event handler",
1588
+ ["7"]: "vnode hook",
1589
+ ["8"]: "directive hook",
1590
+ ["9"]: "transition hook",
1591
+ ["10"]: "app errorHandler",
1592
+ ["11"]: "app warnHandler",
1593
+ ["12"]: "ref function",
1594
+ ["13"]: "async component loader",
1595
+ ["14"]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
1596
1596
  };
1597
1597
  function callWithErrorHandling(fn, instance, type, args) {
1598
1598
  let res;
@@ -1641,7 +1641,7 @@ function handleError(err, instance, type, throwInDev = true) {
1641
1641
  callWithErrorHandling(
1642
1642
  appErrorHandler,
1643
1643
  null,
1644
- 10,
1644
+ "10",
1645
1645
  [err, exposedInstance, errorInfo]
1646
1646
  );
1647
1647
  return;
@@ -1794,7 +1794,7 @@ function flushJobs(seen) {
1794
1794
  if (check(job)) {
1795
1795
  continue;
1796
1796
  }
1797
- callWithErrorHandling(job, null, 14);
1797
+ callWithErrorHandling(job, null, "14");
1798
1798
  }
1799
1799
  }
1800
1800
  } finally {
@@ -2102,7 +2102,7 @@ function emit(instance, event, ...rawArgs) {
2102
2102
  callWithAsyncErrorHandling(
2103
2103
  handler,
2104
2104
  instance,
2105
- 6,
2105
+ "6",
2106
2106
  args
2107
2107
  );
2108
2108
  }
@@ -2117,7 +2117,7 @@ function emit(instance, event, ...rawArgs) {
2117
2117
  callWithAsyncErrorHandling(
2118
2118
  onceHandler,
2119
2119
  instance,
2120
- 6,
2120
+ "6",
2121
2121
  args
2122
2122
  );
2123
2123
  }
@@ -2288,7 +2288,7 @@ function renderComponentRoot(instance) {
2288
2288
  }
2289
2289
  } catch (err) {
2290
2290
  blockStack.length = 0;
2291
- handleError(err, instance, 1);
2291
+ handleError(err, instance, "1");
2292
2292
  result = createVNode(Comment);
2293
2293
  }
2294
2294
  let root = result;
@@ -2799,7 +2799,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
2799
2799
  if (delayEnter) {
2800
2800
  activeBranch.transition.afterLeave = () => {
2801
2801
  if (pendingId === suspense.pendingId) {
2802
- move(pendingBranch, container2, anchor2, 0);
2802
+ move(pendingBranch, container2, anchor2, "0");
2803
2803
  }
2804
2804
  };
2805
2805
  }
@@ -2809,7 +2809,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
2809
2809
  unmount(activeBranch, parentComponent2, suspense, true);
2810
2810
  }
2811
2811
  if (!delayEnter) {
2812
- move(pendingBranch, container2, anchor2, 0);
2812
+ move(pendingBranch, container2, anchor2, "0");
2813
2813
  }
2814
2814
  }
2815
2815
  setActiveBranch(suspense, pendingBranch);
@@ -2887,7 +2887,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
2887
2887
  }
2888
2888
  const hydratedEl = instance.vnode.el;
2889
2889
  instance.asyncDep.catch((err) => {
2890
- handleError(err, instance, 0);
2890
+ handleError(err, instance, "0");
2891
2891
  }).then((asyncSetupResult) => {
2892
2892
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
2893
2893
  return;
@@ -3131,14 +3131,14 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3131
3131
  } else if (isReactive(s)) {
3132
3132
  return traverse(s);
3133
3133
  } else if (isFunction(s)) {
3134
- return callWithErrorHandling(s, instance, 2);
3134
+ return callWithErrorHandling(s, instance, "2");
3135
3135
  } else {
3136
3136
  warnInvalidSource(s);
3137
3137
  }
3138
3138
  });
3139
3139
  } else if (isFunction(source)) {
3140
3140
  if (cb) {
3141
- getter = () => callWithErrorHandling(source, instance, 2);
3141
+ getter = () => callWithErrorHandling(source, instance, "2");
3142
3142
  } else {
3143
3143
  getter = () => {
3144
3144
  if (instance && instance.isUnmounted) {
@@ -3150,7 +3150,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3150
3150
  return callWithAsyncErrorHandling(
3151
3151
  source,
3152
3152
  instance,
3153
- 3,
3153
+ "3",
3154
3154
  [onCleanup]
3155
3155
  );
3156
3156
  };
@@ -3166,7 +3166,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3166
3166
  let cleanup;
3167
3167
  let onCleanup = (fn) => {
3168
3168
  cleanup = effect.onStop = () => {
3169
- callWithErrorHandling(fn, instance, 4);
3169
+ callWithErrorHandling(fn, instance, "4");
3170
3170
  };
3171
3171
  };
3172
3172
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -3182,7 +3182,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3182
3182
  if (cleanup) {
3183
3183
  cleanup();
3184
3184
  }
3185
- callWithAsyncErrorHandling(cb, instance, 3, [
3185
+ callWithAsyncErrorHandling(cb, instance, "3", [
3186
3186
  newValue,
3187
3187
  // pass undefined as the old value when it's changed for the first time
3188
3188
  oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
@@ -3457,7 +3457,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
3457
3457
  hook && callWithAsyncErrorHandling(
3458
3458
  hook,
3459
3459
  instance,
3460
- 9,
3460
+ "9",
3461
3461
  args
3462
3462
  );
3463
3463
  };
@@ -3689,7 +3689,7 @@ function defineAsyncComponent(source) {
3689
3689
  handleError(
3690
3690
  err,
3691
3691
  instance,
3692
- 13,
3692
+ "13",
3693
3693
  !errorComponent
3694
3694
  /* do not throw in dev if user provided error component */
3695
3695
  );
@@ -3788,7 +3788,7 @@ const KeepAliveImpl = {
3788
3788
  const storageContainer = createElement("div");
3789
3789
  sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
3790
3790
  const instance2 = vnode.component;
3791
- move(vnode, container, anchor, 0, parentSuspense);
3791
+ move(vnode, container, anchor, "0", parentSuspense);
3792
3792
  patch(
3793
3793
  instance2.vnode,
3794
3794
  vnode,
@@ -3816,7 +3816,7 @@ const KeepAliveImpl = {
3816
3816
  };
3817
3817
  sharedContext.deactivate = (vnode) => {
3818
3818
  const instance2 = vnode.component;
3819
- move(vnode, storageContainer, null, 1, parentSuspense);
3819
+ move(vnode, storageContainer, null, "1", parentSuspense);
3820
3820
  queuePostRenderEffect(() => {
3821
3821
  if (instance2.da) {
3822
3822
  invokeArrayFns(instance2.da);
@@ -4095,7 +4095,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
4095
4095
  let hook = binding.dir[name];
4096
4096
  if (hook) {
4097
4097
  pauseTracking();
4098
- callWithAsyncErrorHandling(hook, instance, 8, [
4098
+ callWithAsyncErrorHandling(hook, instance, "8", [
4099
4099
  vnode.el,
4100
4100
  binding,
4101
4101
  vnode,
@@ -5640,7 +5640,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
5640
5640
  }
5641
5641
  }
5642
5642
  if (isFunction(ref)) {
5643
- callWithErrorHandling(ref, owner, 12, [value, refs]);
5643
+ callWithErrorHandling(ref, owner, "12", [value, refs]);
5644
5644
  } else {
5645
5645
  const _isString = isString(ref);
5646
5646
  const _isRef = isRef(ref);
@@ -7288,7 +7288,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7288
7288
  );
7289
7289
  } else if (moved) {
7290
7290
  if (j < 0 || i !== increasingNewIndexSequence[j]) {
7291
- move(nextChild, container, anchor, 2);
7291
+ move(nextChild, container, anchor, "2");
7292
7292
  } else {
7293
7293
  j--;
7294
7294
  }
@@ -7322,9 +7322,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7322
7322
  moveStaticNode(vnode, container, anchor);
7323
7323
  return;
7324
7324
  }
7325
- const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
7325
+ const needTransition = moveType !== "2" && shapeFlag & 1 && transition;
7326
7326
  if (needTransition) {
7327
- if (moveType === 0) {
7327
+ if (moveType === "0") {
7328
7328
  transition.beforeEnter(el);
7329
7329
  hostInsert(el, container, anchor);
7330
7330
  queuePostRenderEffect(() => transition.enter(el), parentSuspense);
@@ -7722,7 +7722,7 @@ const TeleportImpl = {
7722
7722
  container,
7723
7723
  mainAnchor,
7724
7724
  internals,
7725
- 1
7725
+ "1"
7726
7726
  );
7727
7727
  }
7728
7728
  } else {
@@ -7737,7 +7737,7 @@ const TeleportImpl = {
7737
7737
  nextTarget,
7738
7738
  null,
7739
7739
  internals,
7740
- 0
7740
+ "0"
7741
7741
  );
7742
7742
  } else {
7743
7743
  warn(
@@ -7752,7 +7752,7 @@ const TeleportImpl = {
7752
7752
  target,
7753
7753
  targetAnchor,
7754
7754
  internals,
7755
- 1
7755
+ "1"
7756
7756
  );
7757
7757
  }
7758
7758
  }
@@ -7783,12 +7783,12 @@ const TeleportImpl = {
7783
7783
  move: moveTeleport,
7784
7784
  hydrate: hydrateTeleport
7785
7785
  };
7786
- function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
7787
- if (moveType === 0) {
7786
+ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = "2") {
7787
+ if (moveType === "0") {
7788
7788
  insert(vnode.targetAnchor, container, parentAnchor);
7789
7789
  }
7790
7790
  const { el, anchor, shapeFlag, children, props } = vnode;
7791
- const isReorder = moveType === 2;
7791
+ const isReorder = moveType === "2";
7792
7792
  if (isReorder) {
7793
7793
  insert(el, container, parentAnchor);
7794
7794
  }
@@ -7799,7 +7799,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
7799
7799
  children[i],
7800
7800
  container,
7801
7801
  parentAnchor,
7802
- 2
7802
+ "2"
7803
7803
  );
7804
7804
  }
7805
7805
  }
@@ -8227,7 +8227,7 @@ function mergeProps(...args) {
8227
8227
  return ret;
8228
8228
  }
8229
8229
  function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
8230
- callWithAsyncErrorHandling(hook, instance, 7, [
8230
+ callWithAsyncErrorHandling(hook, instance, "7", [
8231
8231
  vnode,
8232
8232
  prevVNode
8233
8233
  ]);
@@ -8393,7 +8393,7 @@ function setupStatefulComponent(instance, isSSR) {
8393
8393
  const setupResult = callWithErrorHandling(
8394
8394
  setup,
8395
8395
  instance,
8396
- 0,
8396
+ "0",
8397
8397
  [shallowReadonly(instance.props) , setupContext]
8398
8398
  );
8399
8399
  resetTracking();
@@ -8404,7 +8404,7 @@ function setupStatefulComponent(instance, isSSR) {
8404
8404
  return setupResult.then((resolvedResult) => {
8405
8405
  handleSetupResult(instance, resolvedResult, isSSR);
8406
8406
  }).catch((e) => {
8407
- handleError(e, instance, 0);
8407
+ handleError(e, instance, "0");
8408
8408
  });
8409
8409
  } else {
8410
8410
  instance.asyncDep = setupResult;
@@ -8944,7 +8944,7 @@ function isMemoSame(cached, memo) {
8944
8944
  return true;
8945
8945
  }
8946
8946
 
8947
- const version = "3.3.0-alpha.2";
8947
+ const version = "3.3.0-alpha.3";
8948
8948
  const ssrUtils = null;
8949
8949
  const resolveFilter = null;
8950
8950
  const compatUtils = null;
@@ -9226,7 +9226,7 @@ function createInvoker(initialValue, instance) {
9226
9226
  callWithAsyncErrorHandling(
9227
9227
  patchStopImmediatePropagation(e, invoker.value),
9228
9228
  instance,
9229
- 5,
9229
+ "5",
9230
9230
  [e]
9231
9231
  );
9232
9232
  };
@@ -10590,63 +10590,63 @@ function createCompilerError(code, loc, messages, additionalMessage) {
10590
10590
  }
10591
10591
  const errorMessages = {
10592
10592
  // parse errors
10593
- [0]: "Illegal comment.",
10594
- [1]: "CDATA section is allowed only in XML context.",
10595
- [2]: "Duplicate attribute.",
10596
- [3]: "End tag cannot have attributes.",
10597
- [4]: "Illegal '/' in tags.",
10598
- [5]: "Unexpected EOF in tag.",
10599
- [6]: "Unexpected EOF in CDATA section.",
10600
- [7]: "Unexpected EOF in comment.",
10601
- [8]: "Unexpected EOF in script.",
10602
- [9]: "Unexpected EOF in tag.",
10603
- [10]: "Incorrectly closed comment.",
10604
- [11]: "Incorrectly opened comment.",
10605
- [12]: "Illegal tag name. Use '&lt;' to print '<'.",
10606
- [13]: "Attribute value was expected.",
10607
- [14]: "End tag name was expected.",
10608
- [15]: "Whitespace was expected.",
10609
- [16]: "Unexpected '<!--' in comment.",
10610
- [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
10611
- [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
10612
- [19]: "Attribute name cannot start with '='.",
10613
- [21]: "'<?' is allowed only in XML context.",
10614
- [20]: `Unexpected null character.`,
10615
- [22]: "Illegal '/' in tags.",
10593
+ ["0"]: "Illegal comment.",
10594
+ ["1"]: "CDATA section is allowed only in XML context.",
10595
+ ["2"]: "Duplicate attribute.",
10596
+ ["3"]: "End tag cannot have attributes.",
10597
+ ["4"]: "Illegal '/' in tags.",
10598
+ ["5"]: "Unexpected EOF in tag.",
10599
+ ["6"]: "Unexpected EOF in CDATA section.",
10600
+ ["7"]: "Unexpected EOF in comment.",
10601
+ ["8"]: "Unexpected EOF in script.",
10602
+ ["9"]: "Unexpected EOF in tag.",
10603
+ ["10"]: "Incorrectly closed comment.",
10604
+ ["11"]: "Incorrectly opened comment.",
10605
+ ["12"]: "Illegal tag name. Use '&lt;' to print '<'.",
10606
+ ["13"]: "Attribute value was expected.",
10607
+ ["14"]: "End tag name was expected.",
10608
+ ["15"]: "Whitespace was expected.",
10609
+ ["16"]: "Unexpected '<!--' in comment.",
10610
+ ["17"]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
10611
+ ["18"]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
10612
+ ["19"]: "Attribute name cannot start with '='.",
10613
+ ["21"]: "'<?' is allowed only in XML context.",
10614
+ ["20"]: `Unexpected null character.`,
10615
+ ["22"]: "Illegal '/' in tags.",
10616
10616
  // Vue-specific parse errors
10617
- [23]: "Invalid end tag.",
10618
- [24]: "Element is missing end tag.",
10619
- [25]: "Interpolation end sign was not found.",
10620
- [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
10621
- [26]: "Legal directive name was expected.",
10617
+ ["23"]: "Invalid end tag.",
10618
+ ["24"]: "Element is missing end tag.",
10619
+ ["25"]: "Interpolation end sign was not found.",
10620
+ ["27"]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
10621
+ ["26"]: "Legal directive name was expected.",
10622
10622
  // transform errors
10623
- [28]: `v-if/v-else-if is missing expression.`,
10624
- [29]: `v-if/else branches must use unique keys.`,
10625
- [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
10626
- [31]: `v-for is missing expression.`,
10627
- [32]: `v-for has invalid expression.`,
10628
- [33]: `<template v-for> key should be placed on the <template> tag.`,
10629
- [34]: `v-bind is missing expression.`,
10630
- [35]: `v-on is missing expression.`,
10631
- [36]: `Unexpected custom directive on <slot> outlet.`,
10632
- [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
10633
- [38]: `Duplicate slot names found. `,
10634
- [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
10635
- [40]: `v-slot can only be used on components or <template> tags.`,
10636
- [41]: `v-model is missing expression.`,
10637
- [42]: `v-model value must be a valid JavaScript member expression.`,
10638
- [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
10639
- [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
10623
+ ["28"]: `v-if/v-else-if is missing expression.`,
10624
+ ["29"]: `v-if/else branches must use unique keys.`,
10625
+ ["30"]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
10626
+ ["31"]: `v-for is missing expression.`,
10627
+ ["32"]: `v-for has invalid expression.`,
10628
+ ["33"]: `<template v-for> key should be placed on the <template> tag.`,
10629
+ ["34"]: `v-bind is missing expression.`,
10630
+ ["35"]: `v-on is missing expression.`,
10631
+ ["36"]: `Unexpected custom directive on <slot> outlet.`,
10632
+ ["37"]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
10633
+ ["38"]: `Duplicate slot names found. `,
10634
+ ["39"]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
10635
+ ["40"]: `v-slot can only be used on components or <template> tags.`,
10636
+ ["41"]: `v-model is missing expression.`,
10637
+ ["42"]: `v-model value must be a valid JavaScript member expression.`,
10638
+ ["43"]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
10639
+ ["44"]: `v-model cannot be used on a prop, because local prop bindings are not writable.
10640
10640
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
10641
- [45]: `Error parsing JavaScript expression: `,
10642
- [46]: `<KeepAlive> expects exactly one child component.`,
10641
+ ["45"]: `Error parsing JavaScript expression: `,
10642
+ ["46"]: `<KeepAlive> expects exactly one child component.`,
10643
10643
  // generic errors
10644
- [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
10645
- [48]: `ES module mode is not supported in this build of compiler.`,
10646
- [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
10647
- [50]: `"scopeId" option is only supported in module mode.`,
10644
+ ["47"]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
10645
+ ["48"]: `ES module mode is not supported in this build of compiler.`,
10646
+ ["49"]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
10647
+ ["50"]: `"scopeId" option is only supported in module mode.`,
10648
10648
  // just to fulfill types
10649
- [51]: ``
10649
+ ["51"]: ``
10650
10650
  };
10651
10651
 
10652
10652
  const FRAGMENT = Symbol(`Fragment` );
@@ -10744,7 +10744,7 @@ const locStub = {
10744
10744
  };
10745
10745
  function createRoot(children, loc = locStub) {
10746
10746
  return {
10747
- type: 0,
10747
+ type: "0",
10748
10748
  children,
10749
10749
  helpers: /* @__PURE__ */ new Set(),
10750
10750
  components: [],
@@ -10770,7 +10770,7 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
10770
10770
  }
10771
10771
  }
10772
10772
  return {
10773
- type: 13,
10773
+ type: "13",
10774
10774
  tag,
10775
10775
  props,
10776
10776
  children,
@@ -10785,21 +10785,21 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
10785
10785
  }
10786
10786
  function createArrayExpression(elements, loc = locStub) {
10787
10787
  return {
10788
- type: 17,
10788
+ type: "17",
10789
10789
  loc,
10790
10790
  elements
10791
10791
  };
10792
10792
  }
10793
10793
  function createObjectExpression(properties, loc = locStub) {
10794
10794
  return {
10795
- type: 15,
10795
+ type: "15",
10796
10796
  loc,
10797
10797
  properties
10798
10798
  };
10799
10799
  }
10800
10800
  function createObjectProperty(key, value) {
10801
10801
  return {
10802
- type: 16,
10802
+ type: "16",
10803
10803
  loc: locStub,
10804
10804
  key: isString(key) ? createSimpleExpression(key, true) : key,
10805
10805
  value
@@ -10807,23 +10807,23 @@ function createObjectProperty(key, value) {
10807
10807
  }
10808
10808
  function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
10809
10809
  return {
10810
- type: 4,
10810
+ type: "4",
10811
10811
  loc,
10812
10812
  content,
10813
10813
  isStatic,
10814
- constType: isStatic ? 3 : constType
10814
+ constType: isStatic ? "3" : constType
10815
10815
  };
10816
10816
  }
10817
10817
  function createCompoundExpression(children, loc = locStub) {
10818
10818
  return {
10819
- type: 8,
10819
+ type: "8",
10820
10820
  loc,
10821
10821
  children
10822
10822
  };
10823
10823
  }
10824
10824
  function createCallExpression(callee, args = [], loc = locStub) {
10825
10825
  return {
10826
- type: 14,
10826
+ type: "14",
10827
10827
  loc,
10828
10828
  callee,
10829
10829
  arguments: args
@@ -10831,7 +10831,7 @@ function createCallExpression(callee, args = [], loc = locStub) {
10831
10831
  }
10832
10832
  function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
10833
10833
  return {
10834
- type: 18,
10834
+ type: "18",
10835
10835
  params,
10836
10836
  returns,
10837
10837
  newline,
@@ -10841,7 +10841,7 @@ function createFunctionExpression(params, returns = void 0, newline = false, isS
10841
10841
  }
10842
10842
  function createConditionalExpression(test, consequent, alternate, newline = true) {
10843
10843
  return {
10844
- type: 19,
10844
+ type: "19",
10845
10845
  test,
10846
10846
  consequent,
10847
10847
  alternate,
@@ -10851,7 +10851,7 @@ function createConditionalExpression(test, consequent, alternate, newline = true
10851
10851
  }
10852
10852
  function createCacheExpression(index, value, isVNode = false) {
10853
10853
  return {
10854
- type: 20,
10854
+ type: "20",
10855
10855
  index,
10856
10856
  value,
10857
10857
  isVNode,
@@ -10860,13 +10860,13 @@ function createCacheExpression(index, value, isVNode = false) {
10860
10860
  }
10861
10861
  function createBlockStatement(body) {
10862
10862
  return {
10863
- type: 21,
10863
+ type: "21",
10864
10864
  body,
10865
10865
  loc: locStub
10866
10866
  };
10867
10867
  }
10868
10868
 
10869
- const isStaticExp = (p) => p.type === 4 && p.isStatic;
10869
+ const isStaticExp = (p) => p.type === "4" && p.isStatic;
10870
10870
  const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
10871
10871
  function isCoreComponent(tag) {
10872
10872
  if (isBuiltInType(tag, "Teleport")) {
@@ -10992,7 +10992,7 @@ function assert(condition, msg) {
10992
10992
  function findDir(node, name, allowEmpty = false) {
10993
10993
  for (let i = 0; i < node.props.length; i++) {
10994
10994
  const p = node.props[i];
10995
- if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
10995
+ if (p.type === "7" && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
10996
10996
  return p;
10997
10997
  }
10998
10998
  }
@@ -11000,7 +11000,7 @@ function findDir(node, name, allowEmpty = false) {
11000
11000
  function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
11001
11001
  for (let i = 0; i < node.props.length; i++) {
11002
11002
  const p = node.props[i];
11003
- if (p.type === 6) {
11003
+ if (p.type === "6") {
11004
11004
  if (dynamicOnly)
11005
11005
  continue;
11006
11006
  if (p.name === name && (p.value || allowEmpty)) {
@@ -11016,23 +11016,23 @@ function isStaticArgOf(arg, name) {
11016
11016
  }
11017
11017
  function hasDynamicKeyVBind(node) {
11018
11018
  return node.props.some(
11019
- (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj"
11020
- p.arg.type !== 4 || // v-bind:[_ctx.foo]
11019
+ (p) => p.type === "7" && p.name === "bind" && (!p.arg || // v-bind="obj"
11020
+ p.arg.type !== "4" || // v-bind:[_ctx.foo]
11021
11021
  !p.arg.isStatic)
11022
11022
  // v-bind:[foo]
11023
11023
  );
11024
11024
  }
11025
11025
  function isText$1(node) {
11026
- return node.type === 5 || node.type === "text";
11026
+ return node.type === "5" || node.type === "2";
11027
11027
  }
11028
11028
  function isVSlot(p) {
11029
- return p.type === 7 && p.name === "slot";
11029
+ return p.type === "7" && p.name === "slot";
11030
11030
  }
11031
11031
  function isTemplateNode(node) {
11032
- return node.type === "element" && node.tagType === 3;
11032
+ return node.type === "1" && node.tagType === "3";
11033
11033
  }
11034
11034
  function isSlotOutlet(node) {
11035
- return node.type === "element" && node.tagType === 2;
11035
+ return node.type === "1" && node.tagType === "2";
11036
11036
  }
11037
11037
  function getVNodeHelper(ssr, isComponent) {
11038
11038
  return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
@@ -11042,7 +11042,7 @@ function getVNodeBlockHelper(ssr, isComponent) {
11042
11042
  }
11043
11043
  const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
11044
11044
  function getUnnormalizedProps(props, callPath = []) {
11045
- if (props && !isString(props) && props.type === 14) {
11045
+ if (props && !isString(props) && props.type === "14") {
11046
11046
  const callee = props.callee;
11047
11047
  if (!isString(callee) && propsHelperSet.has(callee)) {
11048
11048
  return getUnnormalizedProps(
@@ -11055,10 +11055,10 @@ function getUnnormalizedProps(props, callPath = []) {
11055
11055
  }
11056
11056
  function injectProp(node, prop, context) {
11057
11057
  let propsWithInjection;
11058
- let props = node.type === 13 ? node.props : node.arguments[2];
11058
+ let props = node.type === "13" ? node.props : node.arguments[2];
11059
11059
  let callPath = [];
11060
11060
  let parentCall;
11061
- if (props && !isString(props) && props.type === 14) {
11061
+ if (props && !isString(props) && props.type === "14") {
11062
11062
  const ret = getUnnormalizedProps(props);
11063
11063
  props = ret[0];
11064
11064
  callPath = ret[1];
@@ -11066,9 +11066,9 @@ function injectProp(node, prop, context) {
11066
11066
  }
11067
11067
  if (props == null || isString(props)) {
11068
11068
  propsWithInjection = createObjectExpression([prop]);
11069
- } else if (props.type === 14) {
11069
+ } else if (props.type === "14") {
11070
11070
  const first = props.arguments[0];
11071
- if (!isString(first) && first.type === 15) {
11071
+ if (!isString(first) && first.type === "15") {
11072
11072
  if (!hasProp(prop, first)) {
11073
11073
  first.properties.unshift(prop);
11074
11074
  }
@@ -11083,7 +11083,7 @@ function injectProp(node, prop, context) {
11083
11083
  }
11084
11084
  }
11085
11085
  !propsWithInjection && (propsWithInjection = props);
11086
- } else if (props.type === 15) {
11086
+ } else if (props.type === "15") {
11087
11087
  if (!hasProp(prop, props)) {
11088
11088
  props.properties.unshift(prop);
11089
11089
  }
@@ -11097,7 +11097,7 @@ function injectProp(node, prop, context) {
11097
11097
  parentCall = callPath[callPath.length - 2];
11098
11098
  }
11099
11099
  }
11100
- if (node.type === 13) {
11100
+ if (node.type === "13") {
11101
11101
  if (parentCall) {
11102
11102
  parentCall.arguments[0] = propsWithInjection;
11103
11103
  } else {
@@ -11113,10 +11113,10 @@ function injectProp(node, prop, context) {
11113
11113
  }
11114
11114
  function hasProp(prop, props) {
11115
11115
  let result = false;
11116
- if (prop.key.type === 4) {
11116
+ if (prop.key.type === "4") {
11117
11117
  const propKeyName = prop.key.content;
11118
11118
  result = props.properties.some(
11119
- (p) => p.key.type === 4 && p.key.content === propKeyName
11119
+ (p) => p.key.type === "4" && p.key.content === propKeyName
11120
11120
  );
11121
11121
  }
11122
11122
  return result;
@@ -11127,7 +11127,7 @@ function toValidAssetId(name, type) {
11127
11127
  })}`;
11128
11128
  }
11129
11129
  function getMemoedVNodeCall(node) {
11130
- if (node.type === 14 && node.callee === WITH_MEMO) {
11130
+ if (node.type === "14" && node.callee === WITH_MEMO) {
11131
11131
  return node.arguments[1].returns;
11132
11132
  } else {
11133
11133
  return node;
@@ -11152,8 +11152,8 @@ const decodeMap = {
11152
11152
  };
11153
11153
  const defaultParserOptions = {
11154
11154
  delimiters: [`{{`, `}}`],
11155
- getNamespace: () => 0,
11156
- getTextMode: () => 0,
11155
+ getNamespace: () => "0",
11156
+ getTextMode: () => "0",
11157
11157
  isVoidTag: NO,
11158
11158
  isPreTag: NO,
11159
11159
  isCustomElement: NO,
@@ -11166,7 +11166,7 @@ function baseParse(content, options = {}) {
11166
11166
  const context = createParserContext(content, options);
11167
11167
  const start = getCursor(context);
11168
11168
  return createRoot(
11169
- parseChildren(context, 0, []),
11169
+ parseChildren(context, "0", []),
11170
11170
  getSelection(context, start)
11171
11171
  );
11172
11172
  }
@@ -11190,48 +11190,48 @@ function createParserContext(content, rawOptions) {
11190
11190
  }
11191
11191
  function parseChildren(context, mode, ancestors) {
11192
11192
  const parent = last(ancestors);
11193
- const ns = parent ? parent.ns : 0;
11193
+ const ns = parent ? parent.ns : "0";
11194
11194
  const nodes = [];
11195
11195
  while (!isEnd(context, mode, ancestors)) {
11196
11196
  const s = context.source;
11197
11197
  let node = void 0;
11198
- if (mode === 0 || mode === 1) {
11198
+ if (mode === "0" || mode === "1") {
11199
11199
  if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {
11200
11200
  node = parseInterpolation(context, mode);
11201
- } else if (mode === 0 && s[0] === "<") {
11201
+ } else if (mode === "0" && s[0] === "<") {
11202
11202
  if (s.length === 1) {
11203
- emitError(context, 5, 1);
11203
+ emitError(context, "5", 1);
11204
11204
  } else if (s[1] === "!") {
11205
11205
  if (startsWith(s, "<!--")) {
11206
11206
  node = parseComment(context);
11207
11207
  } else if (startsWith(s, "<!DOCTYPE")) {
11208
11208
  node = parseBogusComment(context);
11209
11209
  } else if (startsWith(s, "<![CDATA[")) {
11210
- if (ns !== 0) {
11210
+ if (ns !== "0") {
11211
11211
  node = parseCDATA(context, ancestors);
11212
11212
  } else {
11213
- emitError(context, 1);
11213
+ emitError(context, "1");
11214
11214
  node = parseBogusComment(context);
11215
11215
  }
11216
11216
  } else {
11217
- emitError(context, 11);
11217
+ emitError(context, "11");
11218
11218
  node = parseBogusComment(context);
11219
11219
  }
11220
11220
  } else if (s[1] === "/") {
11221
11221
  if (s.length === 2) {
11222
- emitError(context, 5, 2);
11222
+ emitError(context, "5", 2);
11223
11223
  } else if (s[2] === ">") {
11224
- emitError(context, 14, 2);
11224
+ emitError(context, "14", 2);
11225
11225
  advanceBy(context, 3);
11226
11226
  continue;
11227
11227
  } else if (/[a-z]/i.test(s[2])) {
11228
- emitError(context, 23);
11228
+ emitError(context, "23");
11229
11229
  parseTag(context, TagType.End, parent);
11230
11230
  continue;
11231
11231
  } else {
11232
11232
  emitError(
11233
11233
  context,
11234
- 12,
11234
+ "12",
11235
11235
  2
11236
11236
  );
11237
11237
  node = parseBogusComment(context);
@@ -11241,12 +11241,12 @@ function parseChildren(context, mode, ancestors) {
11241
11241
  } else if (s[1] === "?") {
11242
11242
  emitError(
11243
11243
  context,
11244
- 21,
11244
+ "21",
11245
11245
  1
11246
11246
  );
11247
11247
  node = parseBogusComment(context);
11248
11248
  } else {
11249
- emitError(context, 12, 1);
11249
+ emitError(context, "12", 1);
11250
11250
  }
11251
11251
  }
11252
11252
  }
@@ -11262,16 +11262,16 @@ function parseChildren(context, mode, ancestors) {
11262
11262
  }
11263
11263
  }
11264
11264
  let removedWhitespace = false;
11265
- if (mode !== 2 && mode !== 1) {
11265
+ if (mode !== "2" && mode !== "1") {
11266
11266
  const shouldCondense = context.options.whitespace !== "preserve";
11267
11267
  for (let i = 0; i < nodes.length; i++) {
11268
11268
  const node = nodes[i];
11269
- if (node.type === "text") {
11269
+ if (node.type === "2") {
11270
11270
  if (!context.inPre) {
11271
11271
  if (!/[^\t\r\n\f ]/.test(node.content)) {
11272
11272
  const prev = nodes[i - 1];
11273
11273
  const next = nodes[i + 1];
11274
- if (!prev || !next || shouldCondense && (prev.type === "comment" && next.type === "comment" || prev.type === "comment" && next.type === "element" || prev.type === "element" && next.type === "comment" || prev.type === "element" && next.type === "element" && /[\r\n]/.test(node.content))) {
11274
+ if (!prev || !next || shouldCondense && (prev.type === "3" && next.type === "3" || prev.type === "3" && next.type === "1" || prev.type === "1" && next.type === "3" || prev.type === "1" && next.type === "1" && /[\r\n]/.test(node.content))) {
11275
11275
  removedWhitespace = true;
11276
11276
  nodes[i] = null;
11277
11277
  } else {
@@ -11283,14 +11283,14 @@ function parseChildren(context, mode, ancestors) {
11283
11283
  } else {
11284
11284
  node.content = node.content.replace(/\r\n/g, "\n");
11285
11285
  }
11286
- } else if (node.type === "comment" && !context.options.comments) {
11286
+ } else if (node.type === "3" && !context.options.comments) {
11287
11287
  removedWhitespace = true;
11288
11288
  nodes[i] = null;
11289
11289
  }
11290
11290
  }
11291
11291
  if (context.inPre && parent && context.options.isPreTag(parent.tag)) {
11292
11292
  const first = nodes[0];
11293
- if (first && first.type === "text") {
11293
+ if (first && first.type === "2") {
11294
11294
  first.content = first.content.replace(/^\r?\n/, "");
11295
11295
  }
11296
11296
  }
@@ -11298,9 +11298,9 @@ function parseChildren(context, mode, ancestors) {
11298
11298
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
11299
11299
  }
11300
11300
  function pushNode(nodes, node) {
11301
- if (node.type === "text") {
11301
+ if (node.type === "2") {
11302
11302
  const prev = last(nodes);
11303
- if (prev && prev.type === "text" && prev.loc.end.offset === node.loc.start.offset) {
11303
+ if (prev && prev.type === "2" && prev.loc.end.offset === node.loc.start.offset) {
11304
11304
  prev.content += node.content;
11305
11305
  prev.loc.end = node.loc.end;
11306
11306
  prev.loc.source += node.loc.source;
@@ -11311,9 +11311,9 @@ function pushNode(nodes, node) {
11311
11311
  }
11312
11312
  function parseCDATA(context, ancestors) {
11313
11313
  advanceBy(context, 9);
11314
- const nodes = parseChildren(context, 3, ancestors);
11314
+ const nodes = parseChildren(context, "3", ancestors);
11315
11315
  if (context.source.length === 0) {
11316
- emitError(context, 6);
11316
+ emitError(context, "6");
11317
11317
  } else {
11318
11318
  advanceBy(context, 3);
11319
11319
  }
@@ -11326,13 +11326,13 @@ function parseComment(context) {
11326
11326
  if (!match) {
11327
11327
  content = context.source.slice(4);
11328
11328
  advanceBy(context, context.source.length);
11329
- emitError(context, 7);
11329
+ emitError(context, "7");
11330
11330
  } else {
11331
11331
  if (match.index <= 3) {
11332
- emitError(context, 0);
11332
+ emitError(context, "0");
11333
11333
  }
11334
11334
  if (match[1]) {
11335
- emitError(context, 10);
11335
+ emitError(context, "10");
11336
11336
  }
11337
11337
  content = context.source.slice(4, match.index);
11338
11338
  const s = context.source.slice(0, match.index);
@@ -11340,14 +11340,14 @@ function parseComment(context) {
11340
11340
  while ((nestedIndex = s.indexOf("<!--", prevIndex)) !== -1) {
11341
11341
  advanceBy(context, nestedIndex - prevIndex + 1);
11342
11342
  if (nestedIndex + 4 < s.length) {
11343
- emitError(context, 16);
11343
+ emitError(context, "16");
11344
11344
  }
11345
11345
  prevIndex = nestedIndex + 1;
11346
11346
  }
11347
11347
  advanceBy(context, match.index + match[0].length - prevIndex + 1);
11348
11348
  }
11349
11349
  return {
11350
- type: "comment",
11350
+ type: "3",
11351
11351
  content,
11352
11352
  loc: getSelection(context, start)
11353
11353
  };
@@ -11365,7 +11365,7 @@ function parseBogusComment(context) {
11365
11365
  advanceBy(context, closeIndex + 1);
11366
11366
  }
11367
11367
  return {
11368
- type: "comment",
11368
+ type: "3",
11369
11369
  content,
11370
11370
  loc: getSelection(context, start)
11371
11371
  };
@@ -11394,11 +11394,11 @@ function parseElement(context, ancestors) {
11394
11394
  if (startsWithEndTagOpen(context.source, element.tag)) {
11395
11395
  parseTag(context, TagType.End, parent);
11396
11396
  } else {
11397
- emitError(context, 24, 0, element.loc.start);
11397
+ emitError(context, "24", 0, element.loc.start);
11398
11398
  if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
11399
11399
  const first = children[0];
11400
11400
  if (first && startsWith(first.loc.source, "<!--")) {
11401
- emitError(context, 8);
11401
+ emitError(context, "8");
11402
11402
  }
11403
11403
  }
11404
11404
  }
@@ -11432,7 +11432,7 @@ function parseTag(context, type, parent) {
11432
11432
  context.inPre = true;
11433
11433
  }
11434
11434
  let props = parseAttributes(context, type);
11435
- if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === 7 && p.name === "pre")) {
11435
+ if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === "7" && p.name === "pre")) {
11436
11436
  context.inVPre = true;
11437
11437
  extend(context, cursor);
11438
11438
  context.source = currentSource;
@@ -11440,33 +11440,33 @@ function parseTag(context, type, parent) {
11440
11440
  }
11441
11441
  let isSelfClosing = false;
11442
11442
  if (context.source.length === 0) {
11443
- emitError(context, 9);
11443
+ emitError(context, "9");
11444
11444
  } else {
11445
11445
  isSelfClosing = startsWith(context.source, "/>");
11446
11446
  if (type === 1 /* End */ && isSelfClosing) {
11447
- emitError(context, 4);
11447
+ emitError(context, "4");
11448
11448
  }
11449
11449
  advanceBy(context, isSelfClosing ? 2 : 1);
11450
11450
  }
11451
11451
  if (type === 1 /* End */) {
11452
11452
  return;
11453
11453
  }
11454
- let tagType = 0;
11454
+ let tagType = "0";
11455
11455
  if (!context.inVPre) {
11456
11456
  if (tag === "slot") {
11457
- tagType = 2;
11457
+ tagType = "2";
11458
11458
  } else if (tag === "template") {
11459
11459
  if (props.some(
11460
- (p) => p.type === 7 && isSpecialTemplateDirective(p.name)
11460
+ (p) => p.type === "7" && isSpecialTemplateDirective(p.name)
11461
11461
  )) {
11462
- tagType = 3;
11462
+ tagType = "3";
11463
11463
  }
11464
11464
  } else if (isComponent(tag, props, context)) {
11465
- tagType = 1;
11465
+ tagType = "1";
11466
11466
  }
11467
11467
  }
11468
11468
  return {
11469
- type: "element",
11469
+ type: "1",
11470
11470
  ns,
11471
11471
  tag,
11472
11472
  tagType,
@@ -11488,7 +11488,7 @@ function isComponent(tag, props, context) {
11488
11488
  }
11489
11489
  for (let i = 0; i < props.length; i++) {
11490
11490
  const p = props[i];
11491
- if (p.type === 6) {
11491
+ if (p.type === "6") {
11492
11492
  if (p.name === "is" && p.value) {
11493
11493
  if (p.value.content.startsWith("vue:")) {
11494
11494
  return true;
@@ -11511,23 +11511,23 @@ function parseAttributes(context, type) {
11511
11511
  const attributeNames = /* @__PURE__ */ new Set();
11512
11512
  while (context.source.length > 0 && !startsWith(context.source, ">") && !startsWith(context.source, "/>")) {
11513
11513
  if (startsWith(context.source, "/")) {
11514
- emitError(context, 22);
11514
+ emitError(context, "22");
11515
11515
  advanceBy(context, 1);
11516
11516
  advanceSpaces(context);
11517
11517
  continue;
11518
11518
  }
11519
11519
  if (type === 1 /* End */) {
11520
- emitError(context, 3);
11520
+ emitError(context, "3");
11521
11521
  }
11522
11522
  const attr = parseAttribute(context, attributeNames);
11523
- if (attr.type === 6 && attr.value && attr.name === "class") {
11523
+ if (attr.type === "6" && attr.value && attr.name === "class") {
11524
11524
  attr.value.content = attr.value.content.replace(/\s+/g, " ").trim();
11525
11525
  }
11526
11526
  if (type === 0 /* Start */) {
11527
11527
  props.push(attr);
11528
11528
  }
11529
11529
  if (/^[^\t\r\n\f />]/.test(context.source)) {
11530
- emitError(context, 15);
11530
+ emitError(context, "15");
11531
11531
  }
11532
11532
  advanceSpaces(context);
11533
11533
  }
@@ -11538,11 +11538,11 @@ function parseAttribute(context, nameSet) {
11538
11538
  const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source);
11539
11539
  const name = match[0];
11540
11540
  if (nameSet.has(name)) {
11541
- emitError(context, 2);
11541
+ emitError(context, "2");
11542
11542
  }
11543
11543
  nameSet.add(name);
11544
11544
  if (name[0] === "=") {
11545
- emitError(context, 19);
11545
+ emitError(context, "19");
11546
11546
  }
11547
11547
  {
11548
11548
  const pattern = /["'<]/g;
@@ -11550,7 +11550,7 @@ function parseAttribute(context, nameSet) {
11550
11550
  while (m = pattern.exec(name)) {
11551
11551
  emitError(
11552
11552
  context,
11553
- 17,
11553
+ "17",
11554
11554
  m.index
11555
11555
  );
11556
11556
  }
@@ -11563,7 +11563,7 @@ function parseAttribute(context, nameSet) {
11563
11563
  advanceSpaces(context);
11564
11564
  value = parseAttributeValue(context);
11565
11565
  if (!value) {
11566
- emitError(context, 13);
11566
+ emitError(context, "13");
11567
11567
  }
11568
11568
  }
11569
11569
  const loc = getSelection(context, start);
@@ -11593,7 +11593,7 @@ function parseAttribute(context, nameSet) {
11593
11593
  if (!content.endsWith("]")) {
11594
11594
  emitError(
11595
11595
  context,
11596
- 27
11596
+ "27"
11597
11597
  );
11598
11598
  content = content.slice(1);
11599
11599
  } else {
@@ -11603,10 +11603,10 @@ function parseAttribute(context, nameSet) {
11603
11603
  content += match2[3] || "";
11604
11604
  }
11605
11605
  arg = {
11606
- type: 4,
11606
+ type: "4",
11607
11607
  content,
11608
11608
  isStatic,
11609
- constType: isStatic ? 3 : 0,
11609
+ constType: isStatic ? "3" : 0,
11610
11610
  loc: loc2
11611
11611
  };
11612
11612
  }
@@ -11621,10 +11621,10 @@ function parseAttribute(context, nameSet) {
11621
11621
  if (isPropShorthand)
11622
11622
  modifiers.push("prop");
11623
11623
  return {
11624
- type: 7,
11624
+ type: "7",
11625
11625
  name: dirName,
11626
11626
  exp: value && {
11627
- type: 4,
11627
+ type: "4",
11628
11628
  content: value.content,
11629
11629
  isStatic: false,
11630
11630
  // Treat as non-constant by default. This can be potentially set to
@@ -11638,13 +11638,13 @@ function parseAttribute(context, nameSet) {
11638
11638
  };
11639
11639
  }
11640
11640
  if (!context.inVPre && startsWith(name, "v-")) {
11641
- emitError(context, 26);
11641
+ emitError(context, "26");
11642
11642
  }
11643
11643
  return {
11644
- type: 6,
11644
+ type: "6",
11645
11645
  name,
11646
11646
  value: value && {
11647
- type: "text",
11647
+ type: "2",
11648
11648
  content: value.content,
11649
11649
  loc: value.loc
11650
11650
  },
@@ -11663,10 +11663,10 @@ function parseAttributeValue(context) {
11663
11663
  content = parseTextData(
11664
11664
  context,
11665
11665
  context.source.length,
11666
- 4
11666
+ "4"
11667
11667
  );
11668
11668
  } else {
11669
- content = parseTextData(context, endIndex, 4);
11669
+ content = parseTextData(context, endIndex, "4");
11670
11670
  advanceBy(context, 1);
11671
11671
  }
11672
11672
  } else {
@@ -11679,11 +11679,11 @@ function parseAttributeValue(context) {
11679
11679
  while (m = unexpectedChars.exec(match[0])) {
11680
11680
  emitError(
11681
11681
  context,
11682
- 18,
11682
+ "18",
11683
11683
  m.index
11684
11684
  );
11685
11685
  }
11686
- content = parseTextData(context, match[0].length, 4);
11686
+ content = parseTextData(context, match[0].length, "4");
11687
11687
  }
11688
11688
  return { content, isQuoted, loc: getSelection(context, start) };
11689
11689
  }
@@ -11691,7 +11691,7 @@ function parseInterpolation(context, mode) {
11691
11691
  const [open, close] = context.options.delimiters;
11692
11692
  const closeIndex = context.source.indexOf(close, open.length);
11693
11693
  if (closeIndex === -1) {
11694
- emitError(context, 25);
11694
+ emitError(context, "25");
11695
11695
  return void 0;
11696
11696
  }
11697
11697
  const start = getCursor(context);
@@ -11710,9 +11710,9 @@ function parseInterpolation(context, mode) {
11710
11710
  advancePositionWithMutation(innerEnd, rawContent, endOffset);
11711
11711
  advanceBy(context, close.length);
11712
11712
  return {
11713
- type: 5,
11713
+ type: "5",
11714
11714
  content: {
11715
- type: 4,
11715
+ type: "4",
11716
11716
  isStatic: false,
11717
11717
  // Set `isConstant` to false by default and will decide in transformExpression
11718
11718
  constType: 0,
@@ -11723,7 +11723,7 @@ function parseInterpolation(context, mode) {
11723
11723
  };
11724
11724
  }
11725
11725
  function parseText(context, mode) {
11726
- const endTokens = mode === 3 ? ["]]>"] : ["<", context.options.delimiters[0]];
11726
+ const endTokens = mode === "3" ? ["]]>"] : ["<", context.options.delimiters[0]];
11727
11727
  let endIndex = context.source.length;
11728
11728
  for (let i = 0; i < endTokens.length; i++) {
11729
11729
  const index = context.source.indexOf(endTokens[i], 1);
@@ -11734,7 +11734,7 @@ function parseText(context, mode) {
11734
11734
  const start = getCursor(context);
11735
11735
  const content = parseTextData(context, endIndex, mode);
11736
11736
  return {
11737
- type: "text",
11737
+ type: "2",
11738
11738
  content,
11739
11739
  loc: getSelection(context, start)
11740
11740
  };
@@ -11742,12 +11742,12 @@ function parseText(context, mode) {
11742
11742
  function parseTextData(context, length, mode) {
11743
11743
  const rawText = context.source.slice(0, length);
11744
11744
  advanceBy(context, length);
11745
- if (mode === 2 || mode === 3 || !rawText.includes("&")) {
11745
+ if (mode === "2" || mode === "3" || !rawText.includes("&")) {
11746
11746
  return rawText;
11747
11747
  } else {
11748
11748
  return context.options.decodeEntities(
11749
11749
  rawText,
11750
- mode === 4
11750
+ mode === "4"
11751
11751
  );
11752
11752
  }
11753
11753
  }
@@ -11803,7 +11803,7 @@ function emitError(context, code, offset, loc = getCursor(context)) {
11803
11803
  function isEnd(context, mode, ancestors) {
11804
11804
  const s = context.source;
11805
11805
  switch (mode) {
11806
- case 0:
11806
+ case "0":
11807
11807
  if (startsWith(s, "</")) {
11808
11808
  for (let i = ancestors.length - 1; i >= 0; --i) {
11809
11809
  if (startsWithEndTagOpen(s, ancestors[i].tag)) {
@@ -11812,15 +11812,15 @@ function isEnd(context, mode, ancestors) {
11812
11812
  }
11813
11813
  }
11814
11814
  break;
11815
- case 1:
11816
- case 2: {
11815
+ case "1":
11816
+ case "2": {
11817
11817
  const parent = last(ancestors);
11818
11818
  if (parent && startsWithEndTagOpen(s, parent.tag)) {
11819
11819
  return true;
11820
11820
  }
11821
11821
  break;
11822
11822
  }
11823
- case 3:
11823
+ case "3":
11824
11824
  if (startsWith(s, "]]>")) {
11825
11825
  return true;
11826
11826
  }
@@ -11843,7 +11843,7 @@ function hoistStatic(root, context) {
11843
11843
  }
11844
11844
  function isSingleElementRoot(root, child) {
11845
11845
  const { children } = root;
11846
- return children.length === 1 && child.type === "element" && !isSlotOutlet(child);
11846
+ return children.length === 1 && child.type === "1" && !isSlotOutlet(child);
11847
11847
  }
11848
11848
  function walk(node, context, doNotHoistNode = false) {
11849
11849
  const { children } = node;
@@ -11851,10 +11851,10 @@ function walk(node, context, doNotHoistNode = false) {
11851
11851
  let hoistedCount = 0;
11852
11852
  for (let i = 0; i < children.length; i++) {
11853
11853
  const child = children[i];
11854
- if (child.type === "element" && child.tagType === 0) {
11854
+ if (child.type === "1" && child.tagType === "0") {
11855
11855
  const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
11856
11856
  if (constantType > 0) {
11857
- if (constantType >= 2) {
11857
+ if (constantType >= "2") {
11858
11858
  child.codegenNode.patchFlag = -1 + (` /* HOISTED */` );
11859
11859
  child.codegenNode = context.hoist(child.codegenNode);
11860
11860
  hoistedCount++;
@@ -11862,9 +11862,9 @@ function walk(node, context, doNotHoistNode = false) {
11862
11862
  }
11863
11863
  } else {
11864
11864
  const codegenNode = child.codegenNode;
11865
- if (codegenNode.type === 13) {
11865
+ if (codegenNode.type === "13") {
11866
11866
  const flag = getPatchFlag(codegenNode);
11867
- if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
11867
+ if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= "2") {
11868
11868
  const props = getNodeProps(child);
11869
11869
  if (props) {
11870
11870
  codegenNode.props = context.hoist(props);
@@ -11876,8 +11876,8 @@ function walk(node, context, doNotHoistNode = false) {
11876
11876
  }
11877
11877
  }
11878
11878
  }
11879
- if (child.type === "element") {
11880
- const isComponent = child.tagType === 1;
11879
+ if (child.type === "1") {
11880
+ const isComponent = child.tagType === "1";
11881
11881
  if (isComponent) {
11882
11882
  context.scopes.vSlot++;
11883
11883
  }
@@ -11885,9 +11885,9 @@ function walk(node, context, doNotHoistNode = false) {
11885
11885
  if (isComponent) {
11886
11886
  context.scopes.vSlot--;
11887
11887
  }
11888
- } else if (child.type === 11) {
11888
+ } else if (child.type === "11") {
11889
11889
  walk(child, context, child.children.length === 1);
11890
- } else if (child.type === 9) {
11890
+ } else if (child.type === "9") {
11891
11891
  for (let i2 = 0; i2 < child.branches.length; i2++) {
11892
11892
  walk(
11893
11893
  child.branches[i2],
@@ -11900,7 +11900,7 @@ function walk(node, context, doNotHoistNode = false) {
11900
11900
  if (hoistedCount && context.transformHoist) {
11901
11901
  context.transformHoist(children, context, node);
11902
11902
  }
11903
- if (hoistedCount && hoistedCount === originalCount && node.type === "element" && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
11903
+ if (hoistedCount && hoistedCount === originalCount && node.type === "1" && node.tagType === "0" && node.codegenNode && node.codegenNode.type === "13" && isArray(node.codegenNode.children)) {
11904
11904
  node.codegenNode.children = context.hoist(
11905
11905
  createArrayExpression(node.codegenNode.children)
11906
11906
  );
@@ -11909,8 +11909,8 @@ function walk(node, context, doNotHoistNode = false) {
11909
11909
  function getConstantType(node, context) {
11910
11910
  const { constantCache } = context;
11911
11911
  switch (node.type) {
11912
- case "element":
11913
- if (node.tagType !== 0) {
11912
+ case "1":
11913
+ if (node.tagType !== "0") {
11914
11914
  return 0;
11915
11915
  }
11916
11916
  const cached = constantCache.get(node);
@@ -11918,7 +11918,7 @@ function getConstantType(node, context) {
11918
11918
  return cached;
11919
11919
  }
11920
11920
  const codegenNode = node.codegenNode;
11921
- if (codegenNode.type !== 13) {
11921
+ if (codegenNode.type !== "13") {
11922
11922
  return 0;
11923
11923
  }
11924
11924
  if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject") {
@@ -11926,7 +11926,7 @@ function getConstantType(node, context) {
11926
11926
  }
11927
11927
  const flag = getPatchFlag(codegenNode);
11928
11928
  if (!flag) {
11929
- let returnType2 = 3;
11929
+ let returnType2 = "3";
11930
11930
  const generatedPropsType = getGeneratedPropsConstantType(node, context);
11931
11931
  if (generatedPropsType === 0) {
11932
11932
  constantCache.set(node, 0);
@@ -11945,10 +11945,10 @@ function getConstantType(node, context) {
11945
11945
  returnType2 = childType;
11946
11946
  }
11947
11947
  }
11948
- if (returnType2 > 1) {
11948
+ if (returnType2 > "1") {
11949
11949
  for (let i = 0; i < node.props.length; i++) {
11950
11950
  const p = node.props[i];
11951
- if (p.type === 7 && p.name === "bind" && p.exp) {
11951
+ if (p.type === "7" && p.name === "bind" && p.exp) {
11952
11952
  const expType = getConstantType(p.exp, context);
11953
11953
  if (expType === 0) {
11954
11954
  constantCache.set(node, 0);
@@ -11963,7 +11963,7 @@ function getConstantType(node, context) {
11963
11963
  if (codegenNode.isBlock) {
11964
11964
  for (let i = 0; i < node.props.length; i++) {
11965
11965
  const p = node.props[i];
11966
- if (p.type === 7) {
11966
+ if (p.type === "7") {
11967
11967
  constantCache.set(node, 0);
11968
11968
  return 0;
11969
11969
  }
@@ -11981,20 +11981,20 @@ function getConstantType(node, context) {
11981
11981
  constantCache.set(node, 0);
11982
11982
  return 0;
11983
11983
  }
11984
- case "text":
11985
- case "comment":
11986
- return 3;
11987
- case 9:
11988
- case 11:
11989
- case 10:
11984
+ case "2":
11985
+ case "3":
11986
+ return "3";
11987
+ case "9":
11988
+ case "11":
11989
+ case "10":
11990
11990
  return 0;
11991
- case 5:
11992
- case 12:
11991
+ case "5":
11992
+ case "12":
11993
11993
  return getConstantType(node.content, context);
11994
- case 4:
11994
+ case "4":
11995
11995
  return node.constType;
11996
- case 8:
11997
- let returnType = 3;
11996
+ case "8":
11997
+ let returnType = "3";
11998
11998
  for (let i = 0; i < node.children.length; i++) {
11999
11999
  const child = node.children[i];
12000
12000
  if (isString(child) || isSymbol(child)) {
@@ -12019,20 +12019,20 @@ const allowHoistedHelperSet = /* @__PURE__ */ new Set([
12019
12019
  GUARD_REACTIVE_PROPS
12020
12020
  ]);
12021
12021
  function getConstantTypeOfHelperCall(value, context) {
12022
- if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
12022
+ if (value.type === "14" && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
12023
12023
  const arg = value.arguments[0];
12024
- if (arg.type === 4) {
12024
+ if (arg.type === "4") {
12025
12025
  return getConstantType(arg, context);
12026
- } else if (arg.type === 14) {
12026
+ } else if (arg.type === "14") {
12027
12027
  return getConstantTypeOfHelperCall(arg, context);
12028
12028
  }
12029
12029
  }
12030
12030
  return 0;
12031
12031
  }
12032
12032
  function getGeneratedPropsConstantType(node, context) {
12033
- let returnType = 3;
12033
+ let returnType = "3";
12034
12034
  const props = getNodeProps(node);
12035
- if (props && props.type === 15) {
12035
+ if (props && props.type === "15") {
12036
12036
  const { properties } = props;
12037
12037
  for (let i = 0; i < properties.length; i++) {
12038
12038
  const { key, value } = properties[i];
@@ -12044,9 +12044,9 @@ function getGeneratedPropsConstantType(node, context) {
12044
12044
  returnType = keyType;
12045
12045
  }
12046
12046
  let valueType;
12047
- if (value.type === 4) {
12047
+ if (value.type === "4") {
12048
12048
  valueType = getConstantType(value, context);
12049
- } else if (value.type === 14) {
12049
+ } else if (value.type === "14") {
12050
12050
  valueType = getConstantTypeOfHelperCall(value, context);
12051
12051
  } else {
12052
12052
  valueType = 0;
@@ -12063,7 +12063,7 @@ function getGeneratedPropsConstantType(node, context) {
12063
12063
  }
12064
12064
  function getNodeProps(node) {
12065
12065
  const codegenNode = node.codegenNode;
12066
- if (codegenNode.type === 13) {
12066
+ if (codegenNode.type === "13") {
12067
12067
  return codegenNode.props;
12068
12068
  }
12069
12069
  }
@@ -12205,7 +12205,7 @@ function createTransformContext(root, {
12205
12205
  `_hoisted_${context.hoists.length}`,
12206
12206
  false,
12207
12207
  exp.loc,
12208
- 2
12208
+ "2"
12209
12209
  );
12210
12210
  identifier.hoisted = exp;
12211
12211
  return identifier;
@@ -12240,7 +12240,7 @@ function createRootCodegen(root, context) {
12240
12240
  const child = children[0];
12241
12241
  if (isSingleElementRoot(root, child) && child.codegenNode) {
12242
12242
  const codegenNode = child.codegenNode;
12243
- if (codegenNode.type === 13) {
12243
+ if (codegenNode.type === "13") {
12244
12244
  makeBlock(codegenNode, context);
12245
12245
  }
12246
12246
  root.codegenNode = codegenNode;
@@ -12250,7 +12250,7 @@ function createRootCodegen(root, context) {
12250
12250
  } else if (children.length > 1) {
12251
12251
  let patchFlag = 64;
12252
12252
  let patchFlagText = PatchFlagNames[64];
12253
- if (children.filter((c) => c.type !== "comment").length === 1) {
12253
+ if (children.filter((c) => c.type !== "3").length === 1) {
12254
12254
  patchFlag |= 2048;
12255
12255
  patchFlagText += `, ${PatchFlagNames[2048]}`;
12256
12256
  }
@@ -12304,25 +12304,25 @@ function traverseNode(node, context) {
12304
12304
  }
12305
12305
  }
12306
12306
  switch (node.type) {
12307
- case "comment":
12307
+ case "3":
12308
12308
  if (!context.ssr) {
12309
12309
  context.helper(CREATE_COMMENT);
12310
12310
  }
12311
12311
  break;
12312
- case 5:
12312
+ case "5":
12313
12313
  if (!context.ssr) {
12314
12314
  context.helper(TO_DISPLAY_STRING);
12315
12315
  }
12316
12316
  break;
12317
- case 9:
12317
+ case "9":
12318
12318
  for (let i2 = 0; i2 < node.branches.length; i2++) {
12319
12319
  traverseNode(node.branches[i2], context);
12320
12320
  }
12321
12321
  break;
12322
- case 10:
12323
- case 11:
12324
- case "element":
12325
- case 0:
12322
+ case "10":
12323
+ case "11":
12324
+ case "1":
12325
+ case "0":
12326
12326
  traverseChildren(node, context);
12327
12327
  break;
12328
12328
  }
@@ -12335,15 +12335,15 @@ function traverseNode(node, context) {
12335
12335
  function createStructuralDirectiveTransform(name, fn) {
12336
12336
  const matches = isString(name) ? (n) => n === name : (n) => name.test(n);
12337
12337
  return (node, context) => {
12338
- if (node.type === "element") {
12338
+ if (node.type === "1") {
12339
12339
  const { props } = node;
12340
- if (node.tagType === 3 && props.some(isVSlot)) {
12340
+ if (node.tagType === "3" && props.some(isVSlot)) {
12341
12341
  return;
12342
12342
  }
12343
12343
  const exitFns = [];
12344
12344
  for (let i = 0; i < props.length; i++) {
12345
12345
  const prop = props[i];
12346
- if (prop.type === 7 && matches(prop.name)) {
12346
+ if (prop.type === "7" && matches(prop.name)) {
12347
12347
  props.splice(i, 1);
12348
12348
  i--;
12349
12349
  const onExit = fn(node, prop, context);
@@ -12573,7 +12573,7 @@ function genHoists(hoists, context) {
12573
12573
  context.pure = false;
12574
12574
  }
12575
12575
  function isText(n) {
12576
- return isString(n) || n.type === 4 || n.type === "text" || n.type === 5 || n.type === 8;
12576
+ return isString(n) || n.type === "4" || n.type === "2" || n.type === "5" || n.type === "8";
12577
12577
  }
12578
12578
  function genNodeListAsArray(nodes, context) {
12579
12579
  const multilines = nodes.length > 3 || nodes.some((n) => isArray(n) || !isText(n));
@@ -12614,68 +12614,68 @@ function genNode(node, context) {
12614
12614
  return;
12615
12615
  }
12616
12616
  switch (node.type) {
12617
- case "element":
12618
- case 9:
12619
- case 11:
12617
+ case "1":
12618
+ case "9":
12619
+ case "11":
12620
12620
  assert(
12621
12621
  node.codegenNode != null,
12622
12622
  `Codegen node is missing for element/if/for node. Apply appropriate transforms first.`
12623
12623
  );
12624
12624
  genNode(node.codegenNode, context);
12625
12625
  break;
12626
- case "text":
12626
+ case "2":
12627
12627
  genText(node, context);
12628
12628
  break;
12629
- case 4:
12629
+ case "4":
12630
12630
  genExpression(node, context);
12631
12631
  break;
12632
- case 5:
12632
+ case "5":
12633
12633
  genInterpolation(node, context);
12634
12634
  break;
12635
- case 12:
12635
+ case "12":
12636
12636
  genNode(node.codegenNode, context);
12637
12637
  break;
12638
- case 8:
12638
+ case "8":
12639
12639
  genCompoundExpression(node, context);
12640
12640
  break;
12641
- case "comment":
12641
+ case "3":
12642
12642
  genComment(node, context);
12643
12643
  break;
12644
- case 13:
12644
+ case "13":
12645
12645
  genVNodeCall(node, context);
12646
12646
  break;
12647
- case 14:
12647
+ case "14":
12648
12648
  genCallExpression(node, context);
12649
12649
  break;
12650
- case 15:
12650
+ case "15":
12651
12651
  genObjectExpression(node, context);
12652
12652
  break;
12653
- case 17:
12653
+ case "17":
12654
12654
  genArrayExpression(node, context);
12655
12655
  break;
12656
- case 18:
12656
+ case "18":
12657
12657
  genFunctionExpression(node, context);
12658
12658
  break;
12659
- case 19:
12659
+ case "19":
12660
12660
  genConditionalExpression(node, context);
12661
12661
  break;
12662
- case 20:
12662
+ case "20":
12663
12663
  genCacheExpression(node, context);
12664
12664
  break;
12665
- case 21:
12665
+ case "21":
12666
12666
  genNodeList(node.body, context, true, false);
12667
12667
  break;
12668
- case 22:
12668
+ case "22":
12669
12669
  break;
12670
- case 23:
12670
+ case "23":
12671
12671
  break;
12672
- case 24:
12672
+ case "24":
12673
12673
  break;
12674
- case 25:
12674
+ case "25":
12675
12675
  break;
12676
- case 26:
12676
+ case "26":
12677
12677
  break;
12678
- case 10:
12678
+ case "10":
12679
12679
  break;
12680
12680
  default:
12681
12681
  {
@@ -12712,7 +12712,7 @@ function genCompoundExpression(node, context) {
12712
12712
  }
12713
12713
  function genExpressionAsPropertyKey(node, context) {
12714
12714
  const { push } = context;
12715
- if (node.type === 8) {
12715
+ if (node.type === "8") {
12716
12716
  push(`[`);
12717
12717
  genCompoundExpression(node, context);
12718
12718
  push(`]`);
@@ -12793,7 +12793,7 @@ function genObjectExpression(node, context) {
12793
12793
  push(`{}`, node);
12794
12794
  return;
12795
12795
  }
12796
- const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4);
12796
+ const multilines = properties.length > 1 || properties.some((p) => p.value.type !== "4");
12797
12797
  push(multilines ? `{` : `{ `);
12798
12798
  multilines && indent();
12799
12799
  for (let i = 0; i < properties.length; i++) {
@@ -12852,7 +12852,7 @@ function genFunctionExpression(node, context) {
12852
12852
  function genConditionalExpression(node, context) {
12853
12853
  const { test, consequent, alternate, newline: needNewline } = node;
12854
12854
  const { push, indent, deindent, newline } = context;
12855
- if (test.type === 4) {
12855
+ if (test.type === "4") {
12856
12856
  const needsParens = !isSimpleIdentifier(test.content);
12857
12857
  needsParens && push(`(`);
12858
12858
  genExpression(test, context);
@@ -12871,7 +12871,7 @@ function genConditionalExpression(node, context) {
12871
12871
  needNewline && newline();
12872
12872
  needNewline || push(` `);
12873
12873
  push(`: `);
12874
- const isNested = alternate.type === 19;
12874
+ const isNested = alternate.type === "19";
12875
12875
  if (!isNested) {
12876
12876
  context.indentLevel++;
12877
12877
  }
@@ -12926,7 +12926,7 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
12926
12926
  }
12927
12927
  context.onError(
12928
12928
  createCompilerError(
12929
- 45,
12929
+ "45",
12930
12930
  node.loc,
12931
12931
  void 0,
12932
12932
  message
@@ -12936,18 +12936,18 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
12936
12936
  }
12937
12937
 
12938
12938
  const transformExpression = (node, context) => {
12939
- if (node.type === 5) {
12939
+ if (node.type === "5") {
12940
12940
  node.content = processExpression(
12941
12941
  node.content,
12942
12942
  context
12943
12943
  );
12944
- } else if (node.type === "element") {
12944
+ } else if (node.type === "1") {
12945
12945
  for (let i = 0; i < node.props.length; i++) {
12946
12946
  const dir = node.props[i];
12947
- if (dir.type === 7 && dir.name !== "for") {
12947
+ if (dir.type === "7" && dir.name !== "for") {
12948
12948
  const exp = dir.exp;
12949
12949
  const arg = dir.arg;
12950
- if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
12950
+ if (exp && exp.type === "4" && !(dir.name === "on" && arg)) {
12951
12951
  dir.exp = processExpression(
12952
12952
  exp,
12953
12953
  context,
@@ -12955,7 +12955,7 @@ const transformExpression = (node, context) => {
12955
12955
  dir.name === "slot"
12956
12956
  );
12957
12957
  }
12958
- if (arg && arg.type === 4 && !arg.isStatic) {
12958
+ if (arg && arg.type === "4" && !arg.isStatic) {
12959
12959
  dir.arg = processExpression(arg, context);
12960
12960
  }
12961
12961
  }
@@ -12980,7 +12980,7 @@ const transformIf = createStructuralDirectiveTransform(
12980
12980
  let key = 0;
12981
12981
  while (i-- >= 0) {
12982
12982
  const sibling = siblings[i];
12983
- if (sibling && sibling.type === 9) {
12983
+ if (sibling && sibling.type === "9") {
12984
12984
  key += sibling.branches.length;
12985
12985
  }
12986
12986
  }
@@ -13007,7 +13007,7 @@ function processIf(node, dir, context, processCodegen) {
13007
13007
  if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
13008
13008
  const loc = dir.exp ? dir.exp.loc : node.loc;
13009
13009
  context.onError(
13010
- createCompilerError(28, dir.loc)
13010
+ createCompilerError("28", dir.loc)
13011
13011
  );
13012
13012
  dir.exp = createSimpleExpression(`true`, false, loc);
13013
13013
  }
@@ -13017,7 +13017,7 @@ function processIf(node, dir, context, processCodegen) {
13017
13017
  if (dir.name === "if") {
13018
13018
  const branch = createIfBranch(node, dir);
13019
13019
  const ifNode = {
13020
- type: 9,
13020
+ type: "9",
13021
13021
  loc: node.loc,
13022
13022
  branches: [branch]
13023
13023
  };
@@ -13031,25 +13031,25 @@ function processIf(node, dir, context, processCodegen) {
13031
13031
  let i = siblings.indexOf(node);
13032
13032
  while (i-- >= -1) {
13033
13033
  const sibling = siblings[i];
13034
- if (sibling && sibling.type === "comment") {
13034
+ if (sibling && sibling.type === "3") {
13035
13035
  context.removeNode(sibling);
13036
13036
  comments.unshift(sibling);
13037
13037
  continue;
13038
13038
  }
13039
- if (sibling && sibling.type === "text" && !sibling.content.trim().length) {
13039
+ if (sibling && sibling.type === "2" && !sibling.content.trim().length) {
13040
13040
  context.removeNode(sibling);
13041
13041
  continue;
13042
13042
  }
13043
- if (sibling && sibling.type === 9) {
13043
+ if (sibling && sibling.type === "9") {
13044
13044
  if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
13045
13045
  context.onError(
13046
- createCompilerError(30, node.loc)
13046
+ createCompilerError("30", node.loc)
13047
13047
  );
13048
13048
  }
13049
13049
  context.removeNode();
13050
13050
  const branch = createIfBranch(node, dir);
13051
13051
  if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition>
13052
- !(context.parent && context.parent.type === "element" && isBuiltInType(context.parent.tag, "transition"))) {
13052
+ !(context.parent && context.parent.type === "1" && isBuiltInType(context.parent.tag, "transition"))) {
13053
13053
  branch.children = [...comments, ...branch.children];
13054
13054
  }
13055
13055
  {
@@ -13059,7 +13059,7 @@ function processIf(node, dir, context, processCodegen) {
13059
13059
  if (isSameKey(userKey, key)) {
13060
13060
  context.onError(
13061
13061
  createCompilerError(
13062
- 29,
13062
+ "29",
13063
13063
  branch.userKey.loc
13064
13064
  )
13065
13065
  );
@@ -13075,7 +13075,7 @@ function processIf(node, dir, context, processCodegen) {
13075
13075
  context.currentNode = null;
13076
13076
  } else {
13077
13077
  context.onError(
13078
- createCompilerError(30, node.loc)
13078
+ createCompilerError("30", node.loc)
13079
13079
  );
13080
13080
  }
13081
13081
  break;
@@ -13083,9 +13083,9 @@ function processIf(node, dir, context, processCodegen) {
13083
13083
  }
13084
13084
  }
13085
13085
  function createIfBranch(node, dir) {
13086
- const isTemplateIf = node.tagType === 3;
13086
+ const isTemplateIf = node.tagType === "3";
13087
13087
  return {
13088
- type: 10,
13088
+ type: "10",
13089
13089
  loc: node.loc,
13090
13090
  condition: dir.name === "else" ? void 0 : dir.exp,
13091
13091
  children: isTemplateIf && !findDir(node, "for") ? node.children : [node],
@@ -13117,21 +13117,21 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
13117
13117
  `${keyIndex}`,
13118
13118
  false,
13119
13119
  locStub,
13120
- 2
13120
+ "2"
13121
13121
  )
13122
13122
  );
13123
13123
  const { children } = branch;
13124
13124
  const firstChild = children[0];
13125
- const needFragmentWrapper = children.length !== 1 || firstChild.type !== "element";
13125
+ const needFragmentWrapper = children.length !== 1 || firstChild.type !== "1";
13126
13126
  if (needFragmentWrapper) {
13127
- if (children.length === 1 && firstChild.type === 11) {
13127
+ if (children.length === 1 && firstChild.type === "11") {
13128
13128
  const vnodeCall = firstChild.codegenNode;
13129
13129
  injectProp(vnodeCall, keyProperty, context);
13130
13130
  return vnodeCall;
13131
13131
  } else {
13132
13132
  let patchFlag = 64;
13133
13133
  let patchFlagText = PatchFlagNames[64];
13134
- if (!branch.isTemplateIf && children.filter((c) => c.type !== "comment").length === 1) {
13134
+ if (!branch.isTemplateIf && children.filter((c) => c.type !== "3").length === 1) {
13135
13135
  patchFlag |= 2048;
13136
13136
  patchFlagText += `, ${PatchFlagNames[2048]}`;
13137
13137
  }
@@ -13152,7 +13152,7 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
13152
13152
  } else {
13153
13153
  const ret = firstChild.codegenNode;
13154
13154
  const vnodeCall = getMemoedVNodeCall(ret);
13155
- if (vnodeCall.type === 13) {
13155
+ if (vnodeCall.type === "13") {
13156
13156
  makeBlock(vnodeCall, context);
13157
13157
  }
13158
13158
  injectProp(vnodeCall, keyProperty, context);
@@ -13163,7 +13163,7 @@ function isSameKey(a, b) {
13163
13163
  if (!a || a.type !== b.type) {
13164
13164
  return false;
13165
13165
  }
13166
- if (a.type === 6) {
13166
+ if (a.type === "6") {
13167
13167
  if (a.value.content !== b.value.content) {
13168
13168
  return false;
13169
13169
  }
@@ -13173,7 +13173,7 @@ function isSameKey(a, b) {
13173
13173
  if (exp.type !== branchExp.type) {
13174
13174
  return false;
13175
13175
  }
13176
- if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
13176
+ if (exp.type !== "4" || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
13177
13177
  return false;
13178
13178
  }
13179
13179
  }
@@ -13181,13 +13181,13 @@ function isSameKey(a, b) {
13181
13181
  }
13182
13182
  function getParentCondition(node) {
13183
13183
  while (true) {
13184
- if (node.type === 19) {
13185
- if (node.alternate.type === 19) {
13184
+ if (node.type === "19") {
13185
+ if (node.alternate.type === "19") {
13186
13186
  node = node.alternate;
13187
13187
  } else {
13188
13188
  return node;
13189
13189
  }
13190
- } else if (node.type === 20) {
13190
+ } else if (node.type === "20") {
13191
13191
  node = node.value;
13192
13192
  }
13193
13193
  }
@@ -13204,9 +13204,9 @@ const transformFor = createStructuralDirectiveTransform(
13204
13204
  const isTemplate = isTemplateNode(node);
13205
13205
  const memo = findDir(node, "memo");
13206
13206
  const keyProp = findProp(node, `key`);
13207
- const keyExp = keyProp && (keyProp.type === 6 ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp);
13207
+ const keyExp = keyProp && (keyProp.type === "6" ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp);
13208
13208
  const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
13209
- const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
13209
+ const isStableFragment = forNode.source.type === "4" && forNode.source.constType > 0;
13210
13210
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
13211
13211
  forNode.codegenNode = createVNodeCall(
13212
13212
  context,
@@ -13226,12 +13226,12 @@ const transformFor = createStructuralDirectiveTransform(
13226
13226
  const { children } = forNode;
13227
13227
  if (isTemplate) {
13228
13228
  node.children.some((c) => {
13229
- if (c.type === "element") {
13229
+ if (c.type === "1") {
13230
13230
  const key = findProp(c, "key");
13231
13231
  if (key) {
13232
13232
  context.onError(
13233
13233
  createCompilerError(
13234
- 33,
13234
+ "33",
13235
13235
  key.loc
13236
13236
  )
13237
13237
  );
@@ -13240,7 +13240,7 @@ const transformFor = createStructuralDirectiveTransform(
13240
13240
  }
13241
13241
  });
13242
13242
  }
13243
- const needFragmentWrapper = children.length !== 1 || children[0].type !== "element";
13243
+ const needFragmentWrapper = children.length !== 1 || children[0].type !== "1";
13244
13244
  const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;
13245
13245
  if (slotOutlet) {
13246
13246
  childBlock = slotOutlet.codegenNode;
@@ -13327,7 +13327,7 @@ const transformFor = createStructuralDirectiveTransform(
13327
13327
  function processFor(node, dir, context, processCodegen) {
13328
13328
  if (!dir.exp) {
13329
13329
  context.onError(
13330
- createCompilerError(31, dir.loc)
13330
+ createCompilerError("31", dir.loc)
13331
13331
  );
13332
13332
  return;
13333
13333
  }
@@ -13339,14 +13339,14 @@ function processFor(node, dir, context, processCodegen) {
13339
13339
  );
13340
13340
  if (!parseResult) {
13341
13341
  context.onError(
13342
- createCompilerError(32, dir.loc)
13342
+ createCompilerError("32", dir.loc)
13343
13343
  );
13344
13344
  return;
13345
13345
  }
13346
13346
  const { addIdentifiers, removeIdentifiers, scopes } = context;
13347
13347
  const { source, value, key, index } = parseResult;
13348
13348
  const forNode = {
13349
- type: 11,
13349
+ type: "11",
13350
13350
  loc: dir.loc,
13351
13351
  source,
13352
13352
  valueAlias: value,
@@ -13459,7 +13459,7 @@ function createParamsList(args) {
13459
13459
 
13460
13460
  const defaultFallback = createSimpleExpression(`undefined`, false);
13461
13461
  const trackSlotScopes = (node, context) => {
13462
- if (node.type === "element" && (node.tagType === 1 || node.tagType === 3)) {
13462
+ if (node.type === "1" && (node.tagType === "1" || node.tagType === "3")) {
13463
13463
  const vSlot = findDir(node, "slot");
13464
13464
  if (vSlot) {
13465
13465
  vSlot.exp;
@@ -13505,14 +13505,14 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13505
13505
  const slotElement = children[i];
13506
13506
  let slotDir;
13507
13507
  if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) {
13508
- if (slotElement.type !== "comment") {
13508
+ if (slotElement.type !== "3") {
13509
13509
  implicitDefaultChildren.push(slotElement);
13510
13510
  }
13511
13511
  continue;
13512
13512
  }
13513
13513
  if (onComponentSlot) {
13514
13514
  context.onError(
13515
- createCompilerError(37, slotDir.loc)
13515
+ createCompilerError("37", slotDir.loc)
13516
13516
  );
13517
13517
  break;
13518
13518
  }
@@ -13552,7 +13552,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13552
13552
  let prev;
13553
13553
  while (j--) {
13554
13554
  prev = children[j];
13555
- if (prev.type !== "comment") {
13555
+ if (prev.type !== "3") {
13556
13556
  break;
13557
13557
  }
13558
13558
  }
@@ -13560,7 +13560,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13560
13560
  children.splice(i, 1);
13561
13561
  i--;
13562
13562
  let conditional = dynamicSlots[dynamicSlots.length - 1];
13563
- while (conditional.alternate.type === 19) {
13563
+ while (conditional.alternate.type === "19") {
13564
13564
  conditional = conditional.alternate;
13565
13565
  }
13566
13566
  conditional.alternate = vElse.exp ? createConditionalExpression(
@@ -13574,7 +13574,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13574
13574
  ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++);
13575
13575
  } else {
13576
13576
  context.onError(
13577
- createCompilerError(30, vElse.loc)
13577
+ createCompilerError("30", vElse.loc)
13578
13578
  );
13579
13579
  }
13580
13580
  } else if (vFor = findDir(slotElement, "for")) {
@@ -13594,7 +13594,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13594
13594
  );
13595
13595
  } else {
13596
13596
  context.onError(
13597
- createCompilerError(32, vFor.loc)
13597
+ createCompilerError("32", vFor.loc)
13598
13598
  );
13599
13599
  }
13600
13600
  } else {
@@ -13602,7 +13602,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13602
13602
  if (seenSlotNames.has(staticSlotName)) {
13603
13603
  context.onError(
13604
13604
  createCompilerError(
13605
- 38,
13605
+ "38",
13606
13606
  dirLoc
13607
13607
  )
13608
13608
  );
@@ -13630,7 +13630,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
13630
13630
  if (hasNamedDefaultSlot) {
13631
13631
  context.onError(
13632
13632
  createCompilerError(
13633
- 39,
13633
+ "39",
13634
13634
  implicitDefaultChildren[0].loc
13635
13635
  )
13636
13636
  );
@@ -13683,17 +13683,17 @@ function hasForwardedSlots(children) {
13683
13683
  for (let i = 0; i < children.length; i++) {
13684
13684
  const child = children[i];
13685
13685
  switch (child.type) {
13686
- case "element":
13687
- if (child.tagType === 2 || hasForwardedSlots(child.children)) {
13686
+ case "1":
13687
+ if (child.tagType === "2" || hasForwardedSlots(child.children)) {
13688
13688
  return true;
13689
13689
  }
13690
13690
  break;
13691
- case 9:
13691
+ case "9":
13692
13692
  if (hasForwardedSlots(child.branches))
13693
13693
  return true;
13694
13694
  break;
13695
- case 10:
13696
- case 11:
13695
+ case "10":
13696
+ case "11":
13697
13697
  if (hasForwardedSlots(child.children))
13698
13698
  return true;
13699
13699
  break;
@@ -13702,20 +13702,20 @@ function hasForwardedSlots(children) {
13702
13702
  return false;
13703
13703
  }
13704
13704
  function isNonWhitespaceContent(node) {
13705
- if (node.type !== "text" && node.type !== 12)
13705
+ if (node.type !== "2" && node.type !== "12")
13706
13706
  return true;
13707
- return node.type === "text" ? !!node.content.trim() : isNonWhitespaceContent(node.content);
13707
+ return node.type === "2" ? !!node.content.trim() : isNonWhitespaceContent(node.content);
13708
13708
  }
13709
13709
 
13710
13710
  const directiveImportMap = /* @__PURE__ */ new WeakMap();
13711
13711
  const transformElement = (node, context) => {
13712
13712
  return function postTransformElement() {
13713
13713
  node = context.currentNode;
13714
- if (!(node.type === "element" && (node.tagType === 0 || node.tagType === 1))) {
13714
+ if (!(node.type === "1" && (node.tagType === "0" || node.tagType === "1"))) {
13715
13715
  return;
13716
13716
  }
13717
13717
  const { tag, props } = node;
13718
- const isComponent = node.tagType === 1;
13718
+ const isComponent = node.tagType === "1";
13719
13719
  let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`;
13720
13720
  const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
13721
13721
  let vnodeProps;
@@ -13758,7 +13758,7 @@ const transformElement = (node, context) => {
13758
13758
  patchFlag |= 1024;
13759
13759
  if (node.children.length > 1) {
13760
13760
  context.onError(
13761
- createCompilerError(46, {
13761
+ createCompilerError("46", {
13762
13762
  start: node.children[0].loc.start,
13763
13763
  end: node.children[node.children.length - 1].loc.end,
13764
13764
  source: ""
@@ -13778,11 +13778,11 @@ const transformElement = (node, context) => {
13778
13778
  } else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
13779
13779
  const child = node.children[0];
13780
13780
  const type = child.type;
13781
- const hasDynamicTextChild = type === 5 || type === 8;
13781
+ const hasDynamicTextChild = type === "5" || type === "8";
13782
13782
  if (hasDynamicTextChild && getConstantType(child, context) === 0) {
13783
13783
  patchFlag |= 1;
13784
13784
  }
13785
- if (hasDynamicTextChild || type === "text") {
13785
+ if (hasDynamicTextChild || type === "2") {
13786
13786
  vnodeChildren = child;
13787
13787
  } else {
13788
13788
  vnodeChildren = node.children;
@@ -13825,13 +13825,13 @@ function resolveComponentType(node, context, ssr = false) {
13825
13825
  const isProp = findProp(node, "is");
13826
13826
  if (isProp) {
13827
13827
  if (isExplicitDynamic || false) {
13828
- const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
13828
+ const exp = isProp.type === "6" ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
13829
13829
  if (exp) {
13830
13830
  return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
13831
13831
  exp
13832
13832
  ]);
13833
13833
  }
13834
- } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) {
13834
+ } else if (isProp.type === "6" && isProp.value.content.startsWith("vue:")) {
13835
13835
  tag = isProp.value.content.slice(4);
13836
13836
  }
13837
13837
  }
@@ -13890,7 +13890,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
13890
13890
  if (isEventHandler && isReservedProp(name)) {
13891
13891
  hasVnodeHook = true;
13892
13892
  }
13893
- if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
13893
+ if (value.type === "20" || (value.type === "4" || value.type === "8") && getConstantType(value, context) > 0) {
13894
13894
  return;
13895
13895
  }
13896
13896
  if (name === "ref") {
@@ -13911,7 +13911,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
13911
13911
  };
13912
13912
  for (let i = 0; i < props.length; i++) {
13913
13913
  const prop = props[i];
13914
- if (prop.type === 6) {
13914
+ if (prop.type === "6") {
13915
13915
  const { loc, name, value } = prop;
13916
13916
  let isStatic = true;
13917
13917
  if (name === "ref") {
@@ -13949,7 +13949,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
13949
13949
  if (name === "slot") {
13950
13950
  if (!isComponent) {
13951
13951
  context.onError(
13952
- createCompilerError(40, loc)
13952
+ createCompilerError("40", loc)
13953
13953
  );
13954
13954
  }
13955
13955
  continue;
@@ -13987,7 +13987,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
13987
13987
  mergeArgs.push(exp);
13988
13988
  } else {
13989
13989
  pushMergeArg({
13990
- type: 14,
13990
+ type: "14",
13991
13991
  loc,
13992
13992
  callee: context.helper(TO_HANDLERS),
13993
13993
  arguments: isComponent ? [exp] : [exp, `true`]
@@ -13996,7 +13996,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
13996
13996
  } else {
13997
13997
  context.onError(
13998
13998
  createCompilerError(
13999
- isVBind ? 34 : 35,
13999
+ isVBind ? "34" : "35",
14000
14000
  loc
14001
14001
  )
14002
14002
  );
@@ -14065,7 +14065,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14065
14065
  }
14066
14066
  if (!context.inSSR && propsExpression) {
14067
14067
  switch (propsExpression.type) {
14068
- case 15:
14068
+ case "15":
14069
14069
  let classKeyIndex = -1;
14070
14070
  let styleKeyIndex = -1;
14071
14071
  let hasDynamicKey = false;
@@ -14092,9 +14092,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14092
14092
  }
14093
14093
  if (styleProp && // the static style is compiled into an object,
14094
14094
  // so use `hasStyleBinding` to ensure that it is a dynamic style binding
14095
- (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
14095
+ (hasStyleBinding || styleProp.value.type === "4" && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
14096
14096
  // v-bind:style with static literal object
14097
- styleProp.value.type === 17)) {
14097
+ styleProp.value.type === "17")) {
14098
14098
  styleProp.value = createCallExpression(
14099
14099
  context.helper(NORMALIZE_STYLE),
14100
14100
  [styleProp.value]
@@ -14107,7 +14107,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14107
14107
  );
14108
14108
  }
14109
14109
  break;
14110
- case 14:
14110
+ case "14":
14111
14111
  break;
14112
14112
  default:
14113
14113
  propsExpression = createCallExpression(
@@ -14134,7 +14134,7 @@ function dedupeProperties(properties) {
14134
14134
  const deduped = [];
14135
14135
  for (let i = 0; i < properties.length; i++) {
14136
14136
  const prop = properties[i];
14137
- if (prop.key.type === 8 || !prop.key.isStatic) {
14137
+ if (prop.key.type === "8" || !prop.key.isStatic) {
14138
14138
  deduped.push(prop);
14139
14139
  continue;
14140
14140
  }
@@ -14152,7 +14152,7 @@ function dedupeProperties(properties) {
14152
14152
  return deduped;
14153
14153
  }
14154
14154
  function mergeAsArray(existing, incoming) {
14155
- if (existing.value.type === 17) {
14155
+ if (existing.value.type === "17") {
14156
14156
  existing.value.elements.push(incoming.value);
14157
14157
  } else {
14158
14158
  existing.value = createArrayExpression(
@@ -14251,7 +14251,7 @@ function processSlotOutlet(node, context) {
14251
14251
  const nonNameProps = [];
14252
14252
  for (let i = 0; i < node.props.length; i++) {
14253
14253
  const p = node.props[i];
14254
- if (p.type === 6) {
14254
+ if (p.type === "6") {
14255
14255
  if (p.value) {
14256
14256
  if (p.name === "name") {
14257
14257
  slotName = JSON.stringify(p.value.content);
@@ -14284,7 +14284,7 @@ function processSlotOutlet(node, context) {
14284
14284
  if (directives.length) {
14285
14285
  context.onError(
14286
14286
  createCompilerError(
14287
- 36,
14287
+ "36",
14288
14288
  directives[0].loc
14289
14289
  )
14290
14290
  );
@@ -14300,16 +14300,16 @@ const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+
14300
14300
  const transformOn$1 = (dir, node, context, augmentor) => {
14301
14301
  const { loc, modifiers, arg } = dir;
14302
14302
  if (!dir.exp && !modifiers.length) {
14303
- context.onError(createCompilerError(35, loc));
14303
+ context.onError(createCompilerError("35", loc));
14304
14304
  }
14305
14305
  let eventName;
14306
- if (arg.type === 4) {
14306
+ if (arg.type === "4") {
14307
14307
  if (arg.isStatic) {
14308
14308
  let rawName = arg.content;
14309
14309
  if (rawName.startsWith("vue:")) {
14310
14310
  rawName = `vnode-${rawName.slice(4)}`;
14311
14311
  }
14312
- const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
14312
+ const eventString = node.tagType !== "0" || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
14313
14313
  // for non-element and vnode lifecycle event listeners, auto convert
14314
14314
  // it to camelCase. See issue #2249
14315
14315
  toHandlerKey(camelize(rawName))
@@ -14377,14 +14377,14 @@ const transformOn$1 = (dir, node, context, augmentor) => {
14377
14377
  const transformBind = (dir, _node, context) => {
14378
14378
  const { exp, modifiers, loc } = dir;
14379
14379
  const arg = dir.arg;
14380
- if (arg.type !== 4) {
14380
+ if (arg.type !== "4") {
14381
14381
  arg.children.unshift(`(`);
14382
14382
  arg.children.push(`) || ""`);
14383
14383
  } else if (!arg.isStatic) {
14384
14384
  arg.content = `${arg.content} || ""`;
14385
14385
  }
14386
14386
  if (modifiers.includes("camel")) {
14387
- if (arg.type === 4) {
14387
+ if (arg.type === "4") {
14388
14388
  if (arg.isStatic) {
14389
14389
  arg.content = camelize(arg.content);
14390
14390
  } else {
@@ -14403,8 +14403,8 @@ const transformBind = (dir, _node, context) => {
14403
14403
  injectPrefix(arg, "^");
14404
14404
  }
14405
14405
  }
14406
- if (!exp || exp.type === 4 && !exp.content.trim()) {
14407
- context.onError(createCompilerError(34, loc));
14406
+ if (!exp || exp.type === "4" && !exp.content.trim()) {
14407
+ context.onError(createCompilerError("34", loc));
14408
14408
  return {
14409
14409
  props: [createObjectProperty(arg, createSimpleExpression("", true, loc))]
14410
14410
  };
@@ -14414,7 +14414,7 @@ const transformBind = (dir, _node, context) => {
14414
14414
  };
14415
14415
  };
14416
14416
  const injectPrefix = (arg, prefix) => {
14417
- if (arg.type === 4) {
14417
+ if (arg.type === "4") {
14418
14418
  if (arg.isStatic) {
14419
14419
  arg.content = prefix + arg.content;
14420
14420
  } else {
@@ -14427,7 +14427,7 @@ const injectPrefix = (arg, prefix) => {
14427
14427
  };
14428
14428
 
14429
14429
  const transformText = (node, context) => {
14430
- if (node.type === 0 || node.type === "element" || node.type === 11 || node.type === 10) {
14430
+ if (node.type === "0" || node.type === "1" || node.type === "11" || node.type === "10") {
14431
14431
  return () => {
14432
14432
  const children = node.children;
14433
14433
  let currentContainer = void 0;
@@ -14459,13 +14459,13 @@ const transformText = (node, context) => {
14459
14459
  // as-is since the runtime has dedicated fast path for this by directly
14460
14460
  // setting textContent of the element.
14461
14461
  // for component root it's always normalized anyway.
14462
- children.length === 1 && (node.type === 0 || node.type === "element" && node.tagType === 0 && // #3756
14462
+ children.length === 1 && (node.type === "0" || node.type === "1" && node.tagType === "0" && // #3756
14463
14463
  // custom directives can potentially add DOM elements arbitrarily,
14464
14464
  // we need to avoid setting textContent of the element at runtime
14465
14465
  // to avoid accidentally overwriting the DOM elements added
14466
14466
  // by the user through custom directives.
14467
14467
  !node.props.find(
14468
- (p) => p.type === 7 && !context.directiveTransforms[p.name]
14468
+ (p) => p.type === "7" && !context.directiveTransforms[p.name]
14469
14469
  ) && // in compat mode, <template> tags with no special directives
14470
14470
  // will be rendered as a fragment so its children must be
14471
14471
  // converted into vnodes.
@@ -14474,9 +14474,9 @@ const transformText = (node, context) => {
14474
14474
  }
14475
14475
  for (let i = 0; i < children.length; i++) {
14476
14476
  const child = children[i];
14477
- if (isText$1(child) || child.type === 8) {
14477
+ if (isText$1(child) || child.type === "8") {
14478
14478
  const callArgs = [];
14479
- if (child.type !== "text" || child.content !== " ") {
14479
+ if (child.type !== "2" || child.content !== " ") {
14480
14480
  callArgs.push(child);
14481
14481
  }
14482
14482
  if (!context.ssr && getConstantType(child, context) === 0) {
@@ -14485,7 +14485,7 @@ const transformText = (node, context) => {
14485
14485
  );
14486
14486
  }
14487
14487
  children[i] = {
14488
- type: 12,
14488
+ type: "12",
14489
14489
  content: child,
14490
14490
  loc: child.loc,
14491
14491
  codegenNode: createCallExpression(
@@ -14501,7 +14501,7 @@ const transformText = (node, context) => {
14501
14501
 
14502
14502
  const seen$1 = /* @__PURE__ */ new WeakSet();
14503
14503
  const transformOnce = (node, context) => {
14504
- if (node.type === "element" && findDir(node, "once", true)) {
14504
+ if (node.type === "1" && findDir(node, "once", true)) {
14505
14505
  if (seen$1.has(node) || context.inVOnce) {
14506
14506
  return;
14507
14507
  }
@@ -14526,21 +14526,21 @@ const transformModel$1 = (dir, node, context) => {
14526
14526
  const { exp, arg } = dir;
14527
14527
  if (!exp) {
14528
14528
  context.onError(
14529
- createCompilerError(41, dir.loc)
14529
+ createCompilerError("41", dir.loc)
14530
14530
  );
14531
14531
  return createTransformProps();
14532
14532
  }
14533
14533
  const rawExp = exp.loc.source;
14534
- const expString = exp.type === 4 ? exp.content : rawExp;
14534
+ const expString = exp.type === "4" ? exp.content : rawExp;
14535
14535
  const bindingType = context.bindingMetadata[rawExp];
14536
14536
  if (bindingType === "props" || bindingType === "props-aliased") {
14537
- context.onError(createCompilerError(44, exp.loc));
14537
+ context.onError(createCompilerError("44", exp.loc));
14538
14538
  return createTransformProps();
14539
14539
  }
14540
14540
  const maybeRef = false;
14541
14541
  if (!expString.trim() || !isMemberExpression(expString) && !maybeRef) {
14542
14542
  context.onError(
14543
- createCompilerError(42, exp.loc)
14543
+ createCompilerError("42", exp.loc)
14544
14544
  );
14545
14545
  return createTransformProps();
14546
14546
  }
@@ -14561,7 +14561,7 @@ const transformModel$1 = (dir, node, context) => {
14561
14561
  // "onUpdate:modelValue": $event => (foo = $event)
14562
14562
  createObjectProperty(eventName, assignmentExp)
14563
14563
  ];
14564
- if (dir.modifiers.length && node.tagType === 1) {
14564
+ if (dir.modifiers.length && node.tagType === "1") {
14565
14565
  const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
14566
14566
  const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
14567
14567
  props.push(
@@ -14571,7 +14571,7 @@ const transformModel$1 = (dir, node, context) => {
14571
14571
  `{ ${modifiers} }`,
14572
14572
  false,
14573
14573
  dir.loc,
14574
- 2
14574
+ "2"
14575
14575
  )
14576
14576
  )
14577
14577
  );
@@ -14584,7 +14584,7 @@ function createTransformProps(props = []) {
14584
14584
 
14585
14585
  const seen = /* @__PURE__ */ new WeakSet();
14586
14586
  const transformMemo = (node, context) => {
14587
- if (node.type === "element") {
14587
+ if (node.type === "1") {
14588
14588
  const dir = findDir(node, "memo");
14589
14589
  if (!dir || seen.has(node)) {
14590
14590
  return;
@@ -14592,8 +14592,8 @@ const transformMemo = (node, context) => {
14592
14592
  seen.add(node);
14593
14593
  return () => {
14594
14594
  const codegenNode = node.codegenNode || context.currentNode.codegenNode;
14595
- if (codegenNode && codegenNode.type === 13) {
14596
- if (node.tagType !== 1) {
14595
+ if (codegenNode && codegenNode.type === "13") {
14596
+ if (node.tagType !== "1") {
14597
14597
  makeBlock(codegenNode, context);
14598
14598
  }
14599
14599
  node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
@@ -14633,17 +14633,17 @@ function baseCompile(template, options = {}) {
14633
14633
  const isModuleMode = options.mode === "module";
14634
14634
  {
14635
14635
  if (options.prefixIdentifiers === true) {
14636
- onError(createCompilerError(47));
14636
+ onError(createCompilerError("47"));
14637
14637
  } else if (isModuleMode) {
14638
- onError(createCompilerError(48));
14638
+ onError(createCompilerError("48"));
14639
14639
  }
14640
14640
  }
14641
14641
  const prefixIdentifiers = false;
14642
14642
  if (options.cacheHandlers) {
14643
- onError(createCompilerError(49));
14643
+ onError(createCompilerError("49"));
14644
14644
  }
14645
14645
  if (options.scopeId && !isModuleMode) {
14646
- onError(createCompilerError(50));
14646
+ onError(createCompilerError("50"));
14647
14647
  }
14648
14648
  const ast = isString(template) ? baseParse(template, options) : template;
14649
14649
  const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
@@ -14730,30 +14730,30 @@ const parserOptions = {
14730
14730
  // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
14731
14731
  getNamespace(tag, parent) {
14732
14732
  let ns = parent ? parent.ns : 0;
14733
- if (parent && ns === 2) {
14733
+ if (parent && ns === "2") {
14734
14734
  if (parent.tag === "annotation-xml") {
14735
14735
  if (tag === "svg") {
14736
- return 1;
14736
+ return "1";
14737
14737
  }
14738
14738
  if (parent.props.some(
14739
- (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
14739
+ (a) => a.type === "6" && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
14740
14740
  )) {
14741
14741
  ns = 0;
14742
14742
  }
14743
14743
  } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
14744
14744
  ns = 0;
14745
14745
  }
14746
- } else if (parent && ns === 1) {
14746
+ } else if (parent && ns === "1") {
14747
14747
  if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
14748
14748
  ns = 0;
14749
14749
  }
14750
14750
  }
14751
14751
  if (ns === 0) {
14752
14752
  if (tag === "svg") {
14753
- return 1;
14753
+ return "1";
14754
14754
  }
14755
14755
  if (tag === "math") {
14756
- return 2;
14756
+ return "2";
14757
14757
  }
14758
14758
  }
14759
14759
  return ns;
@@ -14762,22 +14762,22 @@ const parserOptions = {
14762
14762
  getTextMode({ tag, ns }) {
14763
14763
  if (ns === 0) {
14764
14764
  if (tag === "textarea" || tag === "title") {
14765
- return 1;
14765
+ return "1";
14766
14766
  }
14767
14767
  if (isRawTextContainer(tag)) {
14768
- return 2;
14768
+ return "2";
14769
14769
  }
14770
14770
  }
14771
- return 0;
14771
+ return "0";
14772
14772
  }
14773
14773
  };
14774
14774
 
14775
14775
  const transformStyle = (node) => {
14776
- if (node.type === "element") {
14776
+ if (node.type === "1") {
14777
14777
  node.props.forEach((p, i) => {
14778
- if (p.type === 6 && p.name === "style" && p.value) {
14778
+ if (p.type === "6" && p.name === "style" && p.value) {
14779
14779
  node.props[i] = {
14780
- type: 7,
14780
+ type: "7",
14781
14781
  name: `bind`,
14782
14782
  arg: createSimpleExpression(`style`, true, p.loc),
14783
14783
  exp: parseInlineCSS(p.value.content, p.loc),
@@ -14794,7 +14794,7 @@ const parseInlineCSS = (cssText, loc) => {
14794
14794
  JSON.stringify(normalized),
14795
14795
  false,
14796
14796
  loc,
14797
- 3
14797
+ "3"
14798
14798
  );
14799
14799
  };
14800
14800
 
@@ -14807,16 +14807,16 @@ function createDOMCompilerError(code, loc) {
14807
14807
  }
14808
14808
  const DOMErrorMessages = {
14809
14809
  [51]: `v-html is missing expression.`,
14810
- [52]: `v-html will override element children.`,
14811
- [53]: `v-text is missing expression.`,
14812
- [54]: `v-text will override element children.`,
14813
- [55]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
14814
- [56]: `v-model argument is not supported on plain elements.`,
14815
- [57]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
14816
- [58]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
14817
- [59]: `v-show is missing expression.`,
14818
- [60]: `<Transition> expects exactly one child element or component.`,
14819
- [61]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
14810
+ ["52"]: `v-html will override element children.`,
14811
+ ["53"]: `v-text is missing expression.`,
14812
+ ["54"]: `v-text will override element children.`,
14813
+ ["55"]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
14814
+ ["56"]: `v-model argument is not supported on plain elements.`,
14815
+ ["57"]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
14816
+ ["58"]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
14817
+ ["59"]: `v-show is missing expression.`,
14818
+ ["60"]: `<Transition> expects exactly one child element or component.`,
14819
+ ["61"]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
14820
14820
  };
14821
14821
 
14822
14822
  const transformVHtml = (dir, node, context) => {
@@ -14828,7 +14828,7 @@ const transformVHtml = (dir, node, context) => {
14828
14828
  }
14829
14829
  if (node.children.length) {
14830
14830
  context.onError(
14831
- createDOMCompilerError(52, loc)
14831
+ createDOMCompilerError("52", loc)
14832
14832
  );
14833
14833
  node.children.length = 0;
14834
14834
  }
@@ -14846,12 +14846,12 @@ const transformVText = (dir, node, context) => {
14846
14846
  const { exp, loc } = dir;
14847
14847
  if (!exp) {
14848
14848
  context.onError(
14849
- createDOMCompilerError(53, loc)
14849
+ createDOMCompilerError("53", loc)
14850
14850
  );
14851
14851
  }
14852
14852
  if (node.children.length) {
14853
14853
  context.onError(
14854
- createDOMCompilerError(54, loc)
14854
+ createDOMCompilerError("54", loc)
14855
14855
  );
14856
14856
  node.children.length = 0;
14857
14857
  }
@@ -14871,13 +14871,13 @@ const transformVText = (dir, node, context) => {
14871
14871
 
14872
14872
  const transformModel = (dir, node, context) => {
14873
14873
  const baseResult = transformModel$1(dir, node, context);
14874
- if (!baseResult.props.length || node.tagType === 1) {
14874
+ if (!baseResult.props.length || node.tagType === "1") {
14875
14875
  return baseResult;
14876
14876
  }
14877
14877
  if (dir.arg) {
14878
14878
  context.onError(
14879
14879
  createDOMCompilerError(
14880
- 56,
14880
+ "56",
14881
14881
  dir.arg.loc
14882
14882
  )
14883
14883
  );
@@ -14887,7 +14887,7 @@ const transformModel = (dir, node, context) => {
14887
14887
  if (value) {
14888
14888
  context.onError(
14889
14889
  createDOMCompilerError(
14890
- 58,
14890
+ "58",
14891
14891
  value.loc
14892
14892
  )
14893
14893
  );
@@ -14901,7 +14901,7 @@ const transformModel = (dir, node, context) => {
14901
14901
  if (tag === "input" || isCustomElement) {
14902
14902
  const type = findProp(node, `type`);
14903
14903
  if (type) {
14904
- if (type.type === 7) {
14904
+ if (type.type === "7") {
14905
14905
  directiveToUse = V_MODEL_DYNAMIC;
14906
14906
  } else if (type.value) {
14907
14907
  switch (type.value.content) {
@@ -14915,7 +14915,7 @@ const transformModel = (dir, node, context) => {
14915
14915
  isInvalidType = true;
14916
14916
  context.onError(
14917
14917
  createDOMCompilerError(
14918
- 57,
14918
+ "57",
14919
14919
  dir.loc
14920
14920
  )
14921
14921
  );
@@ -14941,13 +14941,13 @@ const transformModel = (dir, node, context) => {
14941
14941
  } else {
14942
14942
  context.onError(
14943
14943
  createDOMCompilerError(
14944
- 55,
14944
+ "55",
14945
14945
  dir.loc
14946
14946
  )
14947
14947
  );
14948
14948
  }
14949
14949
  baseResult.props = baseResult.props.filter(
14950
- (p) => !(p.key.type === 4 && p.key.content === "modelValue")
14950
+ (p) => !(p.key.type === "4" && p.key.content === "modelValue")
14951
14951
  );
14952
14952
  return baseResult;
14953
14953
  };
@@ -14999,7 +14999,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
14999
14999
  };
15000
15000
  const transformClick = (key, event) => {
15001
15001
  const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick";
15002
- return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([
15002
+ return isStaticClick ? createSimpleExpression(event, true) : key.type !== "4" ? createCompoundExpression([
15003
15003
  `(`,
15004
15004
  key,
15005
15005
  `) === "onClick" ? "${event}" : (`,
@@ -15047,7 +15047,7 @@ const transformShow = (dir, node, context) => {
15047
15047
  const { exp, loc } = dir;
15048
15048
  if (!exp) {
15049
15049
  context.onError(
15050
- createDOMCompilerError(59, loc)
15050
+ createDOMCompilerError("59", loc)
15051
15051
  );
15052
15052
  }
15053
15053
  return {
@@ -15057,7 +15057,7 @@ const transformShow = (dir, node, context) => {
15057
15057
  };
15058
15058
 
15059
15059
  const transformTransition = (node, context) => {
15060
- if (node.type === "element" && node.tagType === 1) {
15060
+ if (node.type === "1" && node.tagType === "1") {
15061
15061
  const component = context.isBuiltInComponent(node.tag);
15062
15062
  if (component === TRANSITION) {
15063
15063
  return () => {
@@ -15067,7 +15067,7 @@ const transformTransition = (node, context) => {
15067
15067
  if (hasMultipleChildren(node)) {
15068
15068
  context.onError(
15069
15069
  createDOMCompilerError(
15070
- 60,
15070
+ "60",
15071
15071
  {
15072
15072
  start: node.children[0].loc.start,
15073
15073
  end: node.children[node.children.length - 1].loc.end,
@@ -15077,11 +15077,11 @@ const transformTransition = (node, context) => {
15077
15077
  );
15078
15078
  }
15079
15079
  const child = node.children[0];
15080
- if (child.type === "element") {
15080
+ if (child.type === "1") {
15081
15081
  for (const p of child.props) {
15082
- if (p.type === 7 && p.name === "show") {
15082
+ if (p.type === "7" && p.name === "show") {
15083
15083
  node.props.push({
15084
- type: 6,
15084
+ type: "6",
15085
15085
  name: "persisted",
15086
15086
  value: void 0,
15087
15087
  loc: node.loc
@@ -15095,16 +15095,16 @@ const transformTransition = (node, context) => {
15095
15095
  };
15096
15096
  function hasMultipleChildren(node) {
15097
15097
  const children = node.children = node.children.filter(
15098
- (c) => c.type !== "comment" && !(c.type === "text" && !c.content.trim())
15098
+ (c) => c.type !== "3" && !(c.type === "2" && !c.content.trim())
15099
15099
  );
15100
15100
  const child = children[0];
15101
- return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren);
15101
+ return children.length !== 1 || child.type === "11" || child.type === "9" && child.branches.some(hasMultipleChildren);
15102
15102
  }
15103
15103
 
15104
15104
  const ignoreSideEffectTags = (node, context) => {
15105
- if (node.type === "element" && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
15105
+ if (node.type === "1" && node.tagType === "0" && (node.tag === "script" || node.tag === "style")) {
15106
15106
  context.onError(
15107
- createDOMCompilerError(61, node.loc)
15107
+ createDOMCompilerError("61", node.loc)
15108
15108
  );
15109
15109
  context.removeNode();
15110
15110
  }