@vue/compiler-dom 3.5.24 → 3.5.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.5.24
2
+ * @vue/compiler-dom v3.5.26
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -142,81 +142,81 @@ var VueCompilerDOM = (function (exports) {
142
142
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
143
143
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
144
144
 
145
- const FRAGMENT = Symbol(`Fragment` );
146
- const TELEPORT = Symbol(`Teleport` );
147
- const SUSPENSE = Symbol(`Suspense` );
148
- const KEEP_ALIVE = Symbol(`KeepAlive` );
149
- const BASE_TRANSITION = Symbol(
145
+ const FRAGMENT = /* @__PURE__ */ Symbol(`Fragment` );
146
+ const TELEPORT = /* @__PURE__ */ Symbol(`Teleport` );
147
+ const SUSPENSE = /* @__PURE__ */ Symbol(`Suspense` );
148
+ const KEEP_ALIVE = /* @__PURE__ */ Symbol(`KeepAlive` );
149
+ const BASE_TRANSITION = /* @__PURE__ */ Symbol(
150
150
  `BaseTransition`
151
151
  );
152
- const OPEN_BLOCK = Symbol(`openBlock` );
153
- const CREATE_BLOCK = Symbol(`createBlock` );
154
- const CREATE_ELEMENT_BLOCK = Symbol(
152
+ const OPEN_BLOCK = /* @__PURE__ */ Symbol(`openBlock` );
153
+ const CREATE_BLOCK = /* @__PURE__ */ Symbol(`createBlock` );
154
+ const CREATE_ELEMENT_BLOCK = /* @__PURE__ */ Symbol(
155
155
  `createElementBlock`
156
156
  );
157
- const CREATE_VNODE = Symbol(`createVNode` );
158
- const CREATE_ELEMENT_VNODE = Symbol(
157
+ const CREATE_VNODE = /* @__PURE__ */ Symbol(`createVNode` );
158
+ const CREATE_ELEMENT_VNODE = /* @__PURE__ */ Symbol(
159
159
  `createElementVNode`
160
160
  );
161
- const CREATE_COMMENT = Symbol(
161
+ const CREATE_COMMENT = /* @__PURE__ */ Symbol(
162
162
  `createCommentVNode`
163
163
  );
164
- const CREATE_TEXT = Symbol(
164
+ const CREATE_TEXT = /* @__PURE__ */ Symbol(
165
165
  `createTextVNode`
166
166
  );
167
- const CREATE_STATIC = Symbol(
167
+ const CREATE_STATIC = /* @__PURE__ */ Symbol(
168
168
  `createStaticVNode`
169
169
  );
170
- const RESOLVE_COMPONENT = Symbol(
170
+ const RESOLVE_COMPONENT = /* @__PURE__ */ Symbol(
171
171
  `resolveComponent`
172
172
  );
173
- const RESOLVE_DYNAMIC_COMPONENT = Symbol(
173
+ const RESOLVE_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol(
174
174
  `resolveDynamicComponent`
175
175
  );
176
- const RESOLVE_DIRECTIVE = Symbol(
176
+ const RESOLVE_DIRECTIVE = /* @__PURE__ */ Symbol(
177
177
  `resolveDirective`
178
178
  );
179
- const RESOLVE_FILTER = Symbol(
179
+ const RESOLVE_FILTER = /* @__PURE__ */ Symbol(
180
180
  `resolveFilter`
181
181
  );
182
- const WITH_DIRECTIVES = Symbol(
182
+ const WITH_DIRECTIVES = /* @__PURE__ */ Symbol(
183
183
  `withDirectives`
184
184
  );
185
- const RENDER_LIST = Symbol(`renderList` );
186
- const RENDER_SLOT = Symbol(`renderSlot` );
187
- const CREATE_SLOTS = Symbol(`createSlots` );
188
- const TO_DISPLAY_STRING = Symbol(
185
+ const RENDER_LIST = /* @__PURE__ */ Symbol(`renderList` );
186
+ const RENDER_SLOT = /* @__PURE__ */ Symbol(`renderSlot` );
187
+ const CREATE_SLOTS = /* @__PURE__ */ Symbol(`createSlots` );
188
+ const TO_DISPLAY_STRING = /* @__PURE__ */ Symbol(
189
189
  `toDisplayString`
190
190
  );
191
- const MERGE_PROPS = Symbol(`mergeProps` );
192
- const NORMALIZE_CLASS = Symbol(
191
+ const MERGE_PROPS = /* @__PURE__ */ Symbol(`mergeProps` );
192
+ const NORMALIZE_CLASS = /* @__PURE__ */ Symbol(
193
193
  `normalizeClass`
194
194
  );
195
- const NORMALIZE_STYLE = Symbol(
195
+ const NORMALIZE_STYLE = /* @__PURE__ */ Symbol(
196
196
  `normalizeStyle`
197
197
  );
198
- const NORMALIZE_PROPS = Symbol(
198
+ const NORMALIZE_PROPS = /* @__PURE__ */ Symbol(
199
199
  `normalizeProps`
200
200
  );
201
- const GUARD_REACTIVE_PROPS = Symbol(
201
+ const GUARD_REACTIVE_PROPS = /* @__PURE__ */ Symbol(
202
202
  `guardReactiveProps`
203
203
  );
204
- const TO_HANDLERS = Symbol(`toHandlers` );
205
- const CAMELIZE = Symbol(`camelize` );
206
- const CAPITALIZE = Symbol(`capitalize` );
207
- const TO_HANDLER_KEY = Symbol(
204
+ const TO_HANDLERS = /* @__PURE__ */ Symbol(`toHandlers` );
205
+ const CAMELIZE = /* @__PURE__ */ Symbol(`camelize` );
206
+ const CAPITALIZE = /* @__PURE__ */ Symbol(`capitalize` );
207
+ const TO_HANDLER_KEY = /* @__PURE__ */ Symbol(
208
208
  `toHandlerKey`
209
209
  );
210
- const SET_BLOCK_TRACKING = Symbol(
210
+ const SET_BLOCK_TRACKING = /* @__PURE__ */ Symbol(
211
211
  `setBlockTracking`
212
212
  );
213
- const PUSH_SCOPE_ID = Symbol(`pushScopeId` );
214
- const POP_SCOPE_ID = Symbol(`popScopeId` );
215
- const WITH_CTX = Symbol(`withCtx` );
216
- const UNREF = Symbol(`unref` );
217
- const IS_REF = Symbol(`isRef` );
218
- const WITH_MEMO = Symbol(`withMemo` );
219
- const IS_MEMO_SAME = Symbol(`isMemoSame` );
213
+ const PUSH_SCOPE_ID = /* @__PURE__ */ Symbol(`pushScopeId` );
214
+ const POP_SCOPE_ID = /* @__PURE__ */ Symbol(`popScopeId` );
215
+ const WITH_CTX = /* @__PURE__ */ Symbol(`withCtx` );
216
+ const UNREF = /* @__PURE__ */ Symbol(`unref` );
217
+ const IS_REF = /* @__PURE__ */ Symbol(`isRef` );
218
+ const WITH_MEMO = /* @__PURE__ */ Symbol(`withMemo` );
219
+ const IS_MEMO_SAME = /* @__PURE__ */ Symbol(`isMemoSame` );
220
220
  const helperNameMap = {
221
221
  [FRAGMENT]: `Fragment`,
222
222
  [TELEPORT]: `Teleport`,
@@ -640,14 +640,28 @@ var VueCompilerDOM = (function (exports) {
640
640
  getPos(index) {
641
641
  let line = 1;
642
642
  let column = index + 1;
643
- for (let i = this.newlines.length - 1; i >= 0; i--) {
644
- const newlineIndex = this.newlines[i];
645
- if (index > newlineIndex) {
646
- line = i + 2;
647
- column = index - newlineIndex;
648
- break;
643
+ const length = this.newlines.length;
644
+ let j = -1;
645
+ if (length > 100) {
646
+ let l = -1;
647
+ let r = length;
648
+ while (l + 1 < r) {
649
+ const m = l + r >>> 1;
650
+ this.newlines[m] < index ? l = m : r = m;
651
+ }
652
+ j = l;
653
+ } else {
654
+ for (let i = length - 1; i >= 0; i--) {
655
+ if (index > this.newlines[i]) {
656
+ j = i;
657
+ break;
658
+ }
649
659
  }
650
660
  }
661
+ if (j >= 0) {
662
+ line = j + 2;
663
+ column = index - this.newlines[j];
664
+ }
651
665
  return {
652
666
  column,
653
667
  line,
@@ -1524,24 +1538,26 @@ var VueCompilerDOM = (function (exports) {
1524
1538
  "43": "X_V_MODEL_ON_SCOPE_VARIABLE",
1525
1539
  "X_V_MODEL_ON_PROPS": 44,
1526
1540
  "44": "X_V_MODEL_ON_PROPS",
1527
- "X_INVALID_EXPRESSION": 45,
1528
- "45": "X_INVALID_EXPRESSION",
1529
- "X_KEEP_ALIVE_INVALID_CHILDREN": 46,
1530
- "46": "X_KEEP_ALIVE_INVALID_CHILDREN",
1531
- "X_PREFIX_ID_NOT_SUPPORTED": 47,
1532
- "47": "X_PREFIX_ID_NOT_SUPPORTED",
1533
- "X_MODULE_MODE_NOT_SUPPORTED": 48,
1534
- "48": "X_MODULE_MODE_NOT_SUPPORTED",
1535
- "X_CACHE_HANDLER_NOT_SUPPORTED": 49,
1536
- "49": "X_CACHE_HANDLER_NOT_SUPPORTED",
1537
- "X_SCOPE_ID_NOT_SUPPORTED": 50,
1538
- "50": "X_SCOPE_ID_NOT_SUPPORTED",
1539
- "X_VNODE_HOOKS": 51,
1540
- "51": "X_VNODE_HOOKS",
1541
- "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 52,
1542
- "52": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT",
1543
- "__EXTEND_POINT__": 53,
1544
- "53": "__EXTEND_POINT__"
1541
+ "X_V_MODEL_ON_CONST": 45,
1542
+ "45": "X_V_MODEL_ON_CONST",
1543
+ "X_INVALID_EXPRESSION": 46,
1544
+ "46": "X_INVALID_EXPRESSION",
1545
+ "X_KEEP_ALIVE_INVALID_CHILDREN": 47,
1546
+ "47": "X_KEEP_ALIVE_INVALID_CHILDREN",
1547
+ "X_PREFIX_ID_NOT_SUPPORTED": 48,
1548
+ "48": "X_PREFIX_ID_NOT_SUPPORTED",
1549
+ "X_MODULE_MODE_NOT_SUPPORTED": 49,
1550
+ "49": "X_MODULE_MODE_NOT_SUPPORTED",
1551
+ "X_CACHE_HANDLER_NOT_SUPPORTED": 50,
1552
+ "50": "X_CACHE_HANDLER_NOT_SUPPORTED",
1553
+ "X_SCOPE_ID_NOT_SUPPORTED": 51,
1554
+ "51": "X_SCOPE_ID_NOT_SUPPORTED",
1555
+ "X_VNODE_HOOKS": 52,
1556
+ "52": "X_VNODE_HOOKS",
1557
+ "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 53,
1558
+ "53": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT",
1559
+ "__EXTEND_POINT__": 54,
1560
+ "54": "__EXTEND_POINT__"
1545
1561
  };
1546
1562
  const errorMessages = {
1547
1563
  // parse errors
@@ -1582,7 +1598,7 @@ var VueCompilerDOM = (function (exports) {
1582
1598
  [32]: `v-for has invalid expression.`,
1583
1599
  [33]: `<template v-for> key should be placed on the <template> tag.`,
1584
1600
  [34]: `v-bind is missing expression.`,
1585
- [52]: `v-bind with same-name shorthand only allows static argument.`,
1601
+ [53]: `v-bind with same-name shorthand only allows static argument.`,
1586
1602
  [35]: `v-on is missing expression.`,
1587
1603
  [36]: `Unexpected custom directive on <slot> outlet.`,
1588
1604
  [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.`,
@@ -1594,16 +1610,17 @@ var VueCompilerDOM = (function (exports) {
1594
1610
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
1595
1611
  [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
1596
1612
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
1597
- [45]: `Error parsing JavaScript expression: `,
1598
- [46]: `<KeepAlive> expects exactly one child component.`,
1599
- [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
1613
+ [45]: `v-model cannot be used on a const binding because it is not writable.`,
1614
+ [46]: `Error parsing JavaScript expression: `,
1615
+ [47]: `<KeepAlive> expects exactly one child component.`,
1616
+ [52]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
1600
1617
  // generic errors
1601
- [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
1602
- [48]: `ES module mode is not supported in this build of compiler.`,
1603
- [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
1604
- [50]: `"scopeId" option is only supported in module mode.`,
1618
+ [48]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
1619
+ [49]: `ES module mode is not supported in this build of compiler.`,
1620
+ [50]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
1621
+ [51]: `"scopeId" option is only supported in module mode.`,
1605
1622
  // just to fulfill types
1606
- [53]: ``
1623
+ [54]: ``
1607
1624
  };
1608
1625
 
1609
1626
  function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
@@ -2058,6 +2075,20 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
2058
2075
  }
2059
2076
  }
2060
2077
  const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;
2078
+ function isAllWhitespace(str) {
2079
+ for (let i = 0; i < str.length; i++) {
2080
+ if (!isWhitespace(str.charCodeAt(i))) {
2081
+ return false;
2082
+ }
2083
+ }
2084
+ return true;
2085
+ }
2086
+ function isWhitespaceText(node) {
2087
+ return node.type === 2 && isAllWhitespace(node.content) || node.type === 12 && isWhitespaceText(node.content);
2088
+ }
2089
+ function isCommentOrWhitespace(node) {
2090
+ return node.type === 3 || isWhitespaceText(node);
2091
+ }
2061
2092
 
2062
2093
  const defaultParserOptions = {
2063
2094
  parseMode: "base",
@@ -2680,14 +2711,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
2680
2711
  }
2681
2712
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
2682
2713
  }
2683
- function isAllWhitespace(str) {
2684
- for (let i = 0; i < str.length; i++) {
2685
- if (!isWhitespace(str.charCodeAt(i))) {
2686
- return false;
2687
- }
2688
- }
2689
- return true;
2690
- }
2691
2714
  function hasNewlineChar(str) {
2692
2715
  for (let i = 0; i < str.length; i++) {
2693
2716
  const c = str.charCodeAt(i);
@@ -4000,7 +4023,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
4000
4023
  }
4001
4024
  context.onError(
4002
4025
  createCompilerError(
4003
- 45,
4026
+ 46,
4004
4027
  node.loc,
4005
4028
  void 0,
4006
4029
  message
@@ -4116,13 +4139,11 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
4116
4139
  let i = siblings.indexOf(node);
4117
4140
  while (i-- >= -1) {
4118
4141
  const sibling = siblings[i];
4119
- if (sibling && sibling.type === 3) {
4120
- context.removeNode(sibling);
4121
- comments.unshift(sibling);
4122
- continue;
4123
- }
4124
- if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
4142
+ if (sibling && isCommentOrWhitespace(sibling)) {
4125
4143
  context.removeNode(sibling);
4144
+ if (sibling.type === 3) {
4145
+ comments.unshift(sibling);
4146
+ }
4126
4147
  continue;
4127
4148
  }
4128
4149
  if (sibling && sibling.type === 9) {
@@ -4594,7 +4615,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
4594
4615
  let prev;
4595
4616
  while (j--) {
4596
4617
  prev = children[j];
4597
- if (prev.type !== 3 && isNonWhitespaceContent(prev)) {
4618
+ if (!isCommentOrWhitespace(prev)) {
4598
4619
  break;
4599
4620
  }
4600
4621
  }
@@ -4672,7 +4693,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
4672
4693
  } else if (implicitDefaultChildren.length && // #3766
4673
4694
  // with whitespace: 'preserve', whitespaces between slots will end up in
4674
4695
  // implicitDefaultChildren. Ignore if all implicit children are whitespaces.
4675
- implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) {
4696
+ !implicitDefaultChildren.every(isWhitespaceText)) {
4676
4697
  if (hasNamedDefaultSlot) {
4677
4698
  context.onError(
4678
4699
  createCompilerError(
@@ -4745,11 +4766,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
4745
4766
  }
4746
4767
  return false;
4747
4768
  }
4748
- function isNonWhitespaceContent(node) {
4749
- if (node.type !== 2 && node.type !== 12)
4750
- return true;
4751
- return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
4752
- }
4753
4769
 
4754
4770
  const directiveImportMap = /* @__PURE__ */ new WeakMap();
4755
4771
  const transformElement = (node, context) => {
@@ -4801,7 +4817,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
4801
4817
  patchFlag |= 1024;
4802
4818
  if (node.children.length > 1) {
4803
4819
  context.onError(
4804
- createCompilerError(46, {
4820
+ createCompilerError(47, {
4805
4821
  start: node.children[0].loc.start,
4806
4822
  end: node.children[node.children.length - 1].loc.end,
4807
4823
  source: ""
@@ -5388,7 +5404,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
5388
5404
  if (arg.isStatic) {
5389
5405
  let rawName = arg.content;
5390
5406
  if (rawName.startsWith("vnode")) {
5391
- context.onError(createCompilerError(51, arg.loc));
5407
+ context.onError(createCompilerError(52, arg.loc));
5392
5408
  }
5393
5409
  if (rawName.startsWith("vue:")) {
5394
5410
  rawName = `vnode-${rawName.slice(4)}`;
@@ -5621,6 +5637,10 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
5621
5637
  context.onError(createCompilerError(44, exp.loc));
5622
5638
  return createTransformProps();
5623
5639
  }
5640
+ if (bindingType === "literal-const" || bindingType === "setup-const") {
5641
+ context.onError(createCompilerError(45, exp.loc));
5642
+ return createTransformProps();
5643
+ }
5624
5644
  if (!expString.trim() || !isMemberExpression(exp) && true) {
5625
5645
  context.onError(
5626
5646
  createCompilerError(42, exp.loc)
@@ -5849,7 +5869,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
5849
5869
  if (arg.type !== 4 || !arg.isStatic) {
5850
5870
  context.onError(
5851
5871
  createCompilerError(
5852
- 52,
5872
+ 53,
5853
5873
  arg.loc
5854
5874
  )
5855
5875
  );
@@ -5893,17 +5913,17 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
5893
5913
  const isModuleMode = options.mode === "module";
5894
5914
  {
5895
5915
  if (options.prefixIdentifiers === true) {
5896
- onError(createCompilerError(47));
5897
- } else if (isModuleMode) {
5898
5916
  onError(createCompilerError(48));
5917
+ } else if (isModuleMode) {
5918
+ onError(createCompilerError(49));
5899
5919
  }
5900
5920
  }
5901
5921
  const prefixIdentifiers = false;
5902
5922
  if (options.cacheHandlers) {
5903
- onError(createCompilerError(49));
5923
+ onError(createCompilerError(50));
5904
5924
  }
5905
5925
  if (options.scopeId && !isModuleMode) {
5906
- onError(createCompilerError(50));
5926
+ onError(createCompilerError(51));
5907
5927
  }
5908
5928
  const resolvedOptions = extend({}, options, {
5909
5929
  prefixIdentifiers
@@ -5944,26 +5964,26 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
5944
5964
 
5945
5965
  const noopDirectiveTransform = () => ({ props: [] });
5946
5966
 
5947
- const V_MODEL_RADIO = Symbol(`vModelRadio` );
5948
- const V_MODEL_CHECKBOX = Symbol(
5967
+ const V_MODEL_RADIO = /* @__PURE__ */ Symbol(`vModelRadio` );
5968
+ const V_MODEL_CHECKBOX = /* @__PURE__ */ Symbol(
5949
5969
  `vModelCheckbox`
5950
5970
  );
5951
- const V_MODEL_TEXT = Symbol(`vModelText` );
5952
- const V_MODEL_SELECT = Symbol(
5971
+ const V_MODEL_TEXT = /* @__PURE__ */ Symbol(`vModelText` );
5972
+ const V_MODEL_SELECT = /* @__PURE__ */ Symbol(
5953
5973
  `vModelSelect`
5954
5974
  );
5955
- const V_MODEL_DYNAMIC = Symbol(
5975
+ const V_MODEL_DYNAMIC = /* @__PURE__ */ Symbol(
5956
5976
  `vModelDynamic`
5957
5977
  );
5958
- const V_ON_WITH_MODIFIERS = Symbol(
5978
+ const V_ON_WITH_MODIFIERS = /* @__PURE__ */ Symbol(
5959
5979
  `vOnModifiersGuard`
5960
5980
  );
5961
- const V_ON_WITH_KEYS = Symbol(
5981
+ const V_ON_WITH_KEYS = /* @__PURE__ */ Symbol(
5962
5982
  `vOnKeysGuard`
5963
5983
  );
5964
- const V_SHOW = Symbol(`vShow` );
5965
- const TRANSITION = Symbol(`Transition` );
5966
- const TRANSITION_GROUP = Symbol(
5984
+ const V_SHOW = /* @__PURE__ */ Symbol(`vShow` );
5985
+ const TRANSITION = /* @__PURE__ */ Symbol(`Transition` );
5986
+ const TRANSITION_GROUP = /* @__PURE__ */ Symbol(
5967
5987
  `TransitionGroup`
5968
5988
  );
5969
5989
  registerRuntimeHelpers({
@@ -6074,55 +6094,55 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6074
6094
  );
6075
6095
  }
6076
6096
  const DOMErrorCodes = {
6077
- "X_V_HTML_NO_EXPRESSION": 53,
6078
- "53": "X_V_HTML_NO_EXPRESSION",
6079
- "X_V_HTML_WITH_CHILDREN": 54,
6080
- "54": "X_V_HTML_WITH_CHILDREN",
6081
- "X_V_TEXT_NO_EXPRESSION": 55,
6082
- "55": "X_V_TEXT_NO_EXPRESSION",
6083
- "X_V_TEXT_WITH_CHILDREN": 56,
6084
- "56": "X_V_TEXT_WITH_CHILDREN",
6085
- "X_V_MODEL_ON_INVALID_ELEMENT": 57,
6086
- "57": "X_V_MODEL_ON_INVALID_ELEMENT",
6087
- "X_V_MODEL_ARG_ON_ELEMENT": 58,
6088
- "58": "X_V_MODEL_ARG_ON_ELEMENT",
6089
- "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59,
6090
- "59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT",
6091
- "X_V_MODEL_UNNECESSARY_VALUE": 60,
6092
- "60": "X_V_MODEL_UNNECESSARY_VALUE",
6093
- "X_V_SHOW_NO_EXPRESSION": 61,
6094
- "61": "X_V_SHOW_NO_EXPRESSION",
6095
- "X_TRANSITION_INVALID_CHILDREN": 62,
6096
- "62": "X_TRANSITION_INVALID_CHILDREN",
6097
- "X_IGNORED_SIDE_EFFECT_TAG": 63,
6098
- "63": "X_IGNORED_SIDE_EFFECT_TAG",
6099
- "__EXTEND_POINT__": 64,
6100
- "64": "__EXTEND_POINT__"
6097
+ "X_V_HTML_NO_EXPRESSION": 54,
6098
+ "54": "X_V_HTML_NO_EXPRESSION",
6099
+ "X_V_HTML_WITH_CHILDREN": 55,
6100
+ "55": "X_V_HTML_WITH_CHILDREN",
6101
+ "X_V_TEXT_NO_EXPRESSION": 56,
6102
+ "56": "X_V_TEXT_NO_EXPRESSION",
6103
+ "X_V_TEXT_WITH_CHILDREN": 57,
6104
+ "57": "X_V_TEXT_WITH_CHILDREN",
6105
+ "X_V_MODEL_ON_INVALID_ELEMENT": 58,
6106
+ "58": "X_V_MODEL_ON_INVALID_ELEMENT",
6107
+ "X_V_MODEL_ARG_ON_ELEMENT": 59,
6108
+ "59": "X_V_MODEL_ARG_ON_ELEMENT",
6109
+ "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 60,
6110
+ "60": "X_V_MODEL_ON_FILE_INPUT_ELEMENT",
6111
+ "X_V_MODEL_UNNECESSARY_VALUE": 61,
6112
+ "61": "X_V_MODEL_UNNECESSARY_VALUE",
6113
+ "X_V_SHOW_NO_EXPRESSION": 62,
6114
+ "62": "X_V_SHOW_NO_EXPRESSION",
6115
+ "X_TRANSITION_INVALID_CHILDREN": 63,
6116
+ "63": "X_TRANSITION_INVALID_CHILDREN",
6117
+ "X_IGNORED_SIDE_EFFECT_TAG": 64,
6118
+ "64": "X_IGNORED_SIDE_EFFECT_TAG",
6119
+ "__EXTEND_POINT__": 65,
6120
+ "65": "__EXTEND_POINT__"
6101
6121
  };
6102
6122
  const DOMErrorMessages = {
6103
- [53]: `v-html is missing expression.`,
6104
- [54]: `v-html will override element children.`,
6105
- [55]: `v-text is missing expression.`,
6106
- [56]: `v-text will override element children.`,
6107
- [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
6108
- [58]: `v-model argument is not supported on plain elements.`,
6109
- [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
6110
- [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
6111
- [61]: `v-show is missing expression.`,
6112
- [62]: `<Transition> expects exactly one child element or component.`,
6113
- [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
6123
+ [54]: `v-html is missing expression.`,
6124
+ [55]: `v-html will override element children.`,
6125
+ [56]: `v-text is missing expression.`,
6126
+ [57]: `v-text will override element children.`,
6127
+ [58]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
6128
+ [59]: `v-model argument is not supported on plain elements.`,
6129
+ [60]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
6130
+ [61]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
6131
+ [62]: `v-show is missing expression.`,
6132
+ [63]: `<Transition> expects exactly one child element or component.`,
6133
+ [64]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
6114
6134
  };
6115
6135
 
6116
6136
  const transformVHtml = (dir, node, context) => {
6117
6137
  const { exp, loc } = dir;
6118
6138
  if (!exp) {
6119
6139
  context.onError(
6120
- createDOMCompilerError(53, loc)
6140
+ createDOMCompilerError(54, loc)
6121
6141
  );
6122
6142
  }
6123
6143
  if (node.children.length) {
6124
6144
  context.onError(
6125
- createDOMCompilerError(54, loc)
6145
+ createDOMCompilerError(55, loc)
6126
6146
  );
6127
6147
  node.children.length = 0;
6128
6148
  }
@@ -6140,12 +6160,12 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6140
6160
  const { exp, loc } = dir;
6141
6161
  if (!exp) {
6142
6162
  context.onError(
6143
- createDOMCompilerError(55, loc)
6163
+ createDOMCompilerError(56, loc)
6144
6164
  );
6145
6165
  }
6146
6166
  if (node.children.length) {
6147
6167
  context.onError(
6148
- createDOMCompilerError(56, loc)
6168
+ createDOMCompilerError(57, loc)
6149
6169
  );
6150
6170
  node.children.length = 0;
6151
6171
  }
@@ -6171,7 +6191,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6171
6191
  if (dir.arg) {
6172
6192
  context.onError(
6173
6193
  createDOMCompilerError(
6174
- 58,
6194
+ 59,
6175
6195
  dir.arg.loc
6176
6196
  )
6177
6197
  );
@@ -6181,7 +6201,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6181
6201
  if (value && isStaticArgOf(value.arg, "value")) {
6182
6202
  context.onError(
6183
6203
  createDOMCompilerError(
6184
- 60,
6204
+ 61,
6185
6205
  value.loc
6186
6206
  )
6187
6207
  );
@@ -6209,7 +6229,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6209
6229
  isInvalidType = true;
6210
6230
  context.onError(
6211
6231
  createDOMCompilerError(
6212
- 59,
6232
+ 60,
6213
6233
  dir.loc
6214
6234
  )
6215
6235
  );
@@ -6235,7 +6255,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6235
6255
  } else {
6236
6256
  context.onError(
6237
6257
  createDOMCompilerError(
6238
- 57,
6258
+ 58,
6239
6259
  dir.loc
6240
6260
  )
6241
6261
  );
@@ -6343,7 +6363,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6343
6363
  const { exp, loc } = dir;
6344
6364
  if (!exp) {
6345
6365
  context.onError(
6346
- createDOMCompilerError(61, loc)
6366
+ createDOMCompilerError(62, loc)
6347
6367
  );
6348
6368
  }
6349
6369
  return {
@@ -6363,7 +6383,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6363
6383
  if (hasMultipleChildren(node)) {
6364
6384
  context.onError(
6365
6385
  createDOMCompilerError(
6366
- 62,
6386
+ 63,
6367
6387
  {
6368
6388
  start: node.children[0].loc.start,
6369
6389
  end: node.children[node.children.length - 1].loc.end,
@@ -6392,7 +6412,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6392
6412
  };
6393
6413
  function hasMultipleChildren(node) {
6394
6414
  const children = node.children = node.children.filter(
6395
- (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim())
6415
+ (c) => !isCommentOrWhitespace(c)
6396
6416
  );
6397
6417
  const child = children[0];
6398
6418
  return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren);
@@ -6402,7 +6422,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6402
6422
  if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
6403
6423
  context.onError(
6404
6424
  createDOMCompilerError(
6405
- 63,
6425
+ 64,
6406
6426
  node.loc
6407
6427
  )
6408
6428
  );
@@ -6735,6 +6755,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6735
6755
  exports.hasScopeRef = hasScopeRef;
6736
6756
  exports.helperNameMap = helperNameMap;
6737
6757
  exports.injectProp = injectProp;
6758
+ exports.isAllWhitespace = isAllWhitespace;
6759
+ exports.isCommentOrWhitespace = isCommentOrWhitespace;
6738
6760
  exports.isCoreComponent = isCoreComponent;
6739
6761
  exports.isFnExpression = isFnExpression;
6740
6762
  exports.isFnExpressionBrowser = isFnExpressionBrowser;
@@ -6756,6 +6778,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6756
6778
  exports.isText = isText$1;
6757
6779
  exports.isVPre = isVPre;
6758
6780
  exports.isVSlot = isVSlot;
6781
+ exports.isWhitespaceText = isWhitespaceText;
6759
6782
  exports.locStub = locStub;
6760
6783
  exports.noopDirectiveTransform = noopDirectiveTransform;
6761
6784
  exports.parse = parse;