@vue/compat 3.5.40 → 3.5.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.40
2
+ * @vue/compat v3.5.42
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -270,7 +270,7 @@ var Vue = (function () {
270
270
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
271
271
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
272
272
  const isBooleanAttr = /* @__PURE__ */ makeMap(
273
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
273
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
274
274
  );
275
275
  function includeBooleanAttr(value) {
276
276
  return !!value || value === "";
@@ -305,6 +305,23 @@ var Vue = (function () {
305
305
  }
306
306
  return equal;
307
307
  }
308
+ function looseCompareCollections(a, b) {
309
+ if (a.size !== b.size) return false;
310
+ const candidates = Array.from(b);
311
+ const matched = new Uint8Array(candidates.length);
312
+ for (const item of a) {
313
+ let index = -1;
314
+ for (let i = 0; i < candidates.length; i++) {
315
+ if (!matched[i] && looseEqual(item, candidates[i])) {
316
+ index = i;
317
+ break;
318
+ }
319
+ }
320
+ if (index < 0) return false;
321
+ matched[index] = 1;
322
+ }
323
+ return true;
324
+ }
308
325
  function looseEqual(a, b) {
309
326
  if (a === b) return true;
310
327
  let aValidType = isDate(a);
@@ -328,6 +345,16 @@ var Vue = (function () {
328
345
  if (!aValidType || !bValidType) {
329
346
  return false;
330
347
  }
348
+ aValidType = isMap(a);
349
+ bValidType = isMap(b);
350
+ if (aValidType || bValidType) {
351
+ return aValidType && bValidType ? looseCompareCollections(a, b) : false;
352
+ }
353
+ aValidType = isSet(a);
354
+ bValidType = isSet(b);
355
+ if (aValidType || bValidType) {
356
+ return aValidType && bValidType ? looseCompareCollections(a, b) : false;
357
+ }
331
358
  const aKeysCount = Object.keys(a).length;
332
359
  const bKeysCount = Object.keys(b).length;
333
360
  if (aKeysCount !== bKeysCount) {
@@ -2673,7 +2700,9 @@ var Vue = (function () {
2673
2700
  cb.flags |= 1;
2674
2701
  }
2675
2702
  } else {
2676
- pendingPostFlushCbs.push(...cb);
2703
+ for (let i = 0; i < cb.length; i++) {
2704
+ pendingPostFlushCbs.push(cb[i]);
2705
+ }
2677
2706
  }
2678
2707
  queueFlush();
2679
2708
  }
@@ -2709,7 +2738,9 @@ var Vue = (function () {
2709
2738
  );
2710
2739
  pendingPostFlushCbs.length = 0;
2711
2740
  if (activePostFlushCbs) {
2712
- activePostFlushCbs.push(...deduped);
2741
+ for (let i = 0; i < deduped.length; i++) {
2742
+ activePostFlushCbs.push(deduped[i]);
2743
+ }
2713
2744
  return;
2714
2745
  }
2715
2746
  activePostFlushCbs = deduped;
@@ -4442,7 +4473,11 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4442
4473
  function setTransitionHooks(vnode, hooks) {
4443
4474
  if (vnode.shapeFlag & 6 && vnode.component) {
4444
4475
  vnode.transition = hooks;
4445
- setTransitionHooks(vnode.component.subTree, hooks);
4476
+ const subTree = vnode.component.subTree;
4477
+ setTransitionHooks(
4478
+ isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree,
4479
+ hooks
4480
+ );
4446
4481
  } else if (vnode.shapeFlag & 128) {
4447
4482
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4448
4483
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
@@ -4845,10 +4880,10 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4845
4880
  getContainerType(container),
4846
4881
  optimized
4847
4882
  );
4848
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4883
+ if (isAsyncWrapper(vnode) && !vnode.component.subTree) {
4849
4884
  let subTree;
4850
4885
  if (isFragmentStart) {
4851
- subTree = createVNode(Fragment);
4886
+ subTree = createVNode(Static);
4852
4887
  subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4853
4888
  } else {
4854
4889
  subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
@@ -4982,6 +5017,9 @@ Server rendered element contains more child nodes than client vdom.`
4982
5017
  }
4983
5018
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4984
5019
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
5020
+ if (isUnchangedResourceProp(el, key, props[key])) {
5021
+ continue;
5022
+ }
4985
5023
  patchProp(el, key, null, props[key], namespace, parentComponent);
4986
5024
  }
4987
5025
  }
@@ -5164,6 +5202,13 @@ Server rendered element contains fewer child nodes than client vdom.`
5164
5202
  };
5165
5203
  return [hydrate, hydrateNode];
5166
5204
  }
5205
+ const resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]);
5206
+ function isUnchangedResourceProp(el, key, clientValue) {
5207
+ if (!resourceProps.has(key)) {
5208
+ return false;
5209
+ }
5210
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
5211
+ }
5167
5212
  function propHasMismatch(el, key, clientValue, vnode, instance) {
5168
5213
  let mismatchType;
5169
5214
  let mismatchKey;
@@ -5201,7 +5246,10 @@ Server rendered element contains fewer child nodes than client vdom.`
5201
5246
  mismatchKey = "style";
5202
5247
  }
5203
5248
  } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
5204
- if (isBooleanAttr(key)) {
5249
+ if (key === "hidden") {
5250
+ actual = normalizeHiddenValue(el.getAttribute(key));
5251
+ expected = normalizeHiddenValue(clientValue);
5252
+ } else if (isBooleanAttr(key)) {
5205
5253
  actual = el.hasAttribute(key);
5206
5254
  expected = includeBooleanAttr(clientValue);
5207
5255
  } else if (clientValue == null) {
@@ -5237,6 +5285,15 @@ Server rendered element contains fewer child nodes than client vdom.`
5237
5285
  }
5238
5286
  return false;
5239
5287
  }
5288
+ function normalizeHiddenValue(value) {
5289
+ if (!isRenderableAttrValue(value)) {
5290
+ return false;
5291
+ }
5292
+ if (isString(value)) {
5293
+ return value.toLowerCase() === "until-found" ? "until-found" : "";
5294
+ }
5295
+ return includeBooleanAttr(value) ? "" : false;
5296
+ }
5240
5297
  function toClassSet(str) {
5241
5298
  return new Set(str.trim().split(/\s+/));
5242
5299
  }
@@ -5729,7 +5786,10 @@ Server rendered element contains fewer child nodes than client vdom.`
5729
5786
  if (pendingCacheKey != null) {
5730
5787
  if (isSuspense(instance.subTree.type)) {
5731
5788
  queuePostRenderEffect(() => {
5732
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
5789
+ const vnode = getInnerChild(instance.subTree);
5790
+ if (vnode.component) {
5791
+ cache.set(pendingCacheKey, vnode);
5792
+ }
5733
5793
  }, instance.subTree.suspense);
5734
5794
  } else {
5735
5795
  cache.set(pendingCacheKey, getInnerChild(instance.subTree));
@@ -6341,7 +6401,8 @@ If this is a native custom element, make sure to exclude it from component resol
6341
6401
  return slots;
6342
6402
  }
6343
6403
 
6344
- function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
6404
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
6405
+ if (props == null) props = {};
6345
6406
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
6346
6407
  const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
6347
6408
  const hasProps = Object.keys(slotProps).length > 0;
@@ -6649,12 +6710,41 @@ If this is a native custom element, make sure to exclude it from component resol
6649
6710
  if (isStatefulComponent(i)) return getComponentPublicInstance(i);
6650
6711
  return getPublicInstance(i.parent);
6651
6712
  };
6713
+ const resolveDevRootEl = (vnode) => {
6714
+ let found = false;
6715
+ while (true) {
6716
+ if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
6717
+ const root = filterSingleRoot(vnode.children);
6718
+ if (!root) {
6719
+ return;
6720
+ }
6721
+ vnode = root;
6722
+ found = true;
6723
+ continue;
6724
+ }
6725
+ const component = vnode.component;
6726
+ if (component && component.subTree) {
6727
+ vnode = component.subTree;
6728
+ continue;
6729
+ }
6730
+ const suspense = vnode.suspense;
6731
+ if (suspense && suspense.activeBranch) {
6732
+ vnode = suspense.activeBranch;
6733
+ continue;
6734
+ }
6735
+ return found ? vnode.el : void 0;
6736
+ }
6737
+ };
6738
+ const getDevRootFragmentEl = (i) => {
6739
+ const el = i.subTree && resolveDevRootEl(i.subTree);
6740
+ return el === void 0 ? i.vnode.el : el;
6741
+ };
6652
6742
  const publicPropertiesMap = (
6653
6743
  // Move PURE marker to new line to workaround compiler discarding it
6654
6744
  // due to type annotation
6655
6745
  /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
6656
6746
  $: (i) => i,
6657
- $el: (i) => i.vnode.el,
6747
+ $el: (i) => getDevRootFragmentEl(i) ,
6658
6748
  $data: (i) => i.data,
6659
6749
  $props: (i) => shallowReadonly(i.props) ,
6660
6750
  $attrs: (i) => shallowReadonly(i.attrs) ,
@@ -7565,7 +7655,7 @@ If this is a native custom element, make sure to exclude it from component resol
7565
7655
  return vm;
7566
7656
  }
7567
7657
  }
7568
- Vue.version = `2.6.14-compat:${"3.5.40"}`;
7658
+ Vue.version = `2.6.14-compat:${"3.5.42"}`;
7569
7659
  Vue.config = singletonApp.config;
7570
7660
  Vue.use = (plugin, ...options) => {
7571
7661
  if (plugin && isFunction(plugin.install)) {
@@ -8322,7 +8412,7 @@ If you want to remount the same app, move your app creation logic into a factory
8322
8412
  args = rawArgs.map((a) => isString(a) ? a.trim() : a);
8323
8413
  }
8324
8414
  if (modifiers.number) {
8325
- args = rawArgs.map(looseToNumber);
8415
+ args = args.map(looseToNumber);
8326
8416
  }
8327
8417
  }
8328
8418
  {
@@ -8587,12 +8677,13 @@ If you want to remount the same app, move your app creation logic into a factory
8587
8677
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
8588
8678
  }
8589
8679
  if (vnode.transition) {
8590
- if (!isElementRoot(root)) {
8680
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
8681
+ if (!isElementRoot(child)) {
8591
8682
  warn$1(
8592
8683
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8593
8684
  );
8594
8685
  }
8595
- setTransitionHooks(root, vnode.transition);
8686
+ setTransitionHooks(child, vnode.transition);
8596
8687
  }
8597
8688
  if (setRoot) {
8598
8689
  setRoot(root);
@@ -11098,7 +11189,7 @@ If you want to remount the same app, move your app creation logic into a factory
11098
11189
  if (suspense.deps <= 0) {
11099
11190
  suspense.resolve();
11100
11191
  } else if (isInFallback) {
11101
- if (!isHydrating) {
11192
+ if (!isHydrating && !suspense.isFallbackMountPending) {
11102
11193
  patch(
11103
11194
  activeBranch,
11104
11195
  newFallback,
@@ -11139,7 +11230,7 @@ If you want to remount the same app, move your app creation logic into a factory
11139
11230
  );
11140
11231
  if (suspense.deps <= 0) {
11141
11232
  suspense.resolve();
11142
- } else {
11233
+ } else if (!suspense.isFallbackMountPending) {
11143
11234
  patch(
11144
11235
  activeBranch,
11145
11236
  newFallback,
@@ -11346,7 +11437,9 @@ If you want to remount the same app, move your app creation logic into a factory
11346
11437
  let hasUnresolvedAncestor = false;
11347
11438
  while (parent) {
11348
11439
  if (parent.pendingBranch) {
11349
- parent.effects.push(...effects);
11440
+ for (let i = 0; i < effects.length; i++) {
11441
+ parent.effects.push(effects[i]);
11442
+ }
11350
11443
  hasUnresolvedAncestor = true;
11351
11444
  break;
11352
11445
  }
@@ -11378,9 +11471,10 @@ If you want to remount the same app, move your app creation logic into a factory
11378
11471
  if (!suspense.isInFallback) {
11379
11472
  return;
11380
11473
  }
11474
+ const latestFallback = suspense.vnode.ssFallback;
11381
11475
  patch(
11382
11476
  null,
11383
- fallbackVNode,
11477
+ latestFallback,
11384
11478
  container2,
11385
11479
  anchor2,
11386
11480
  parentComponent2,
@@ -11390,7 +11484,7 @@ If you want to remount the same app, move your app creation logic into a factory
11390
11484
  slotScopeIds,
11391
11485
  optimized
11392
11486
  );
11393
- setActiveBranch(suspense, fallbackVNode);
11487
+ setActiveBranch(suspense, latestFallback);
11394
11488
  };
11395
11489
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
11396
11490
  if (delayEnter) {
@@ -11768,6 +11862,14 @@ If you want to remount the same app, move your app creation logic into a factory
11768
11862
  if (vnode.key !== vnode.key) {
11769
11863
  warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
11770
11864
  }
11865
+ if (props && vnode.shapeFlag & 1) {
11866
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
11867
+ if (overwritingProp && hasContentChildren(vnode.children)) {
11868
+ warn$1(
11869
+ `The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`
11870
+ );
11871
+ }
11872
+ }
11771
11873
  if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
11772
11874
  !isBlockNode && // has current parent block
11773
11875
  currentBlock && // presence of a patch flag indicates this node needs patching on updates.
@@ -11785,6 +11887,11 @@ If you want to remount the same app, move your app creation logic into a factory
11785
11887
  }
11786
11888
  return vnode;
11787
11889
  }
11890
+ function hasContentChildren(children) {
11891
+ if (isString(children)) return children !== "";
11892
+ if (isArray(children)) return children.length > 0;
11893
+ return false;
11894
+ }
11788
11895
  const createVNode = createVNodeWithArgsTransform ;
11789
11896
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
11790
11897
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -12227,7 +12334,12 @@ Component that was made reactive: `,
12227
12334
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
12228
12335
  if (isSSR) {
12229
12336
  return setupResult.then((resolvedResult) => {
12230
- handleSetupResult(instance, resolvedResult, isSSR);
12337
+ setInSSRSetupState(true);
12338
+ try {
12339
+ handleSetupResult(instance, resolvedResult, isSSR);
12340
+ } finally {
12341
+ setInSSRSetupState(false);
12342
+ }
12231
12343
  }).catch((e) => {
12232
12344
  handleError(e, instance, 0);
12233
12345
  });
@@ -12703,7 +12815,7 @@ Component that was made reactive: `,
12703
12815
  return true;
12704
12816
  }
12705
12817
 
12706
- const version = "3.5.40";
12818
+ const version = "3.5.42";
12707
12819
  const warn = warn$1 ;
12708
12820
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12709
12821
  const devtools = devtools$1 ;
@@ -13325,7 +13437,11 @@ Component that was made reactive: `,
13325
13437
  }
13326
13438
  }
13327
13439
  if (name.startsWith("--")) {
13328
- style.setProperty(name, val);
13440
+ if (importantRE.test(val)) {
13441
+ style.setProperty(name, val.replace(importantRE, ""), "important");
13442
+ } else {
13443
+ style.setProperty(name, val);
13444
+ }
13329
13445
  } else {
13330
13446
  const prefixed = autoPrefix(style, name);
13331
13447
  if (importantRE.test(val)) {
@@ -13742,7 +13858,9 @@ Expected function or array of functions, received type ${typeof value}.`
13742
13858
  if (parent && parent._pendingResolve) {
13743
13859
  this._pendingResolve = parent._pendingResolve.then(() => {
13744
13860
  this._pendingResolve = void 0;
13745
- this._resolveDef();
13861
+ if (this.isConnected) {
13862
+ return this._resolveDef();
13863
+ }
13746
13864
  });
13747
13865
  } else {
13748
13866
  this._resolveDef();
@@ -13792,7 +13910,7 @@ Expected function or array of functions, received type ${typeof value}.`
13792
13910
  */
13793
13911
  _resolveDef() {
13794
13912
  if (this._pendingResolve) {
13795
- return;
13913
+ return this._pendingResolve;
13796
13914
  }
13797
13915
  for (let i = 0; i < this.attributes.length; i++) {
13798
13916
  this._setAttr(this.attributes[i].name);
@@ -13832,6 +13950,7 @@ Expected function or array of functions, received type ${typeof value}.`
13832
13950
  def.configureApp = this._def.configureApp;
13833
13951
  resolve(this._def = def, true);
13834
13952
  });
13953
+ return this._pendingResolve;
13835
13954
  } else {
13836
13955
  resolve(this._def);
13837
13956
  }
@@ -13869,6 +13988,11 @@ Expected function or array of functions, received type ${typeof value}.`
13869
13988
  }
13870
13989
  }
13871
13990
  for (const key of declaredPropKeys.map(camelize)) {
13991
+ if (key in Object.getPrototypeOf(this)) {
13992
+ warn(
13993
+ `Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`
13994
+ );
13995
+ }
13872
13996
  Object.defineProperty(this, key, {
13873
13997
  get() {
13874
13998
  return this._getProp(key);
@@ -14350,6 +14474,7 @@ Expected function or array of functions, received type ${typeof value}.`
14350
14474
  }
14351
14475
  }
14352
14476
  const assignKey = /* @__PURE__ */ Symbol("_assign");
14477
+ const initialValueKey = /* @__PURE__ */ Symbol("_initialValue");
14353
14478
  function castValue(value, trim, number) {
14354
14479
  if (trim) value = value.trim();
14355
14480
  if (number) value = looseToNumber(value);
@@ -14357,6 +14482,13 @@ Expected function or array of functions, received type ${typeof value}.`
14357
14482
  }
14358
14483
  const vModelText = {
14359
14484
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
14485
+ if (el.parentNode) {
14486
+ if (el.type === "text") {
14487
+ el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
14488
+ } else if (el.type === "textarea") {
14489
+ el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
14490
+ }
14491
+ }
14360
14492
  el[assignKey] = getModelAssigner(vnode);
14361
14493
  const castToNumber = number || vnode.props && vnode.props.type === "number";
14362
14494
  addEventListener(el, lazy ? "change" : "input", (e) => {
@@ -14375,8 +14507,15 @@ Expected function or array of functions, received type ${typeof value}.`
14375
14507
  }
14376
14508
  },
14377
14509
  // set value on mounted so it's after min/max for type="range"
14378
- mounted(el, { value }) {
14379
- el.value = value == null ? "" : value;
14510
+ mounted(el, { value, modifiers: { trim, number } }) {
14511
+ const newValue = value == null ? "" : value;
14512
+ const initialValue = el[initialValueKey];
14513
+ delete el[initialValueKey];
14514
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) {
14515
+ el[assignKey](castValue(el.value, trim, number));
14516
+ } else {
14517
+ el.value = newValue;
14518
+ }
14380
14519
  },
14381
14520
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
14382
14521
  el[assignKey] = getModelAssigner(vnode);
@@ -14477,13 +14616,21 @@ Expected function or array of functions, received type ${typeof value}.`
14477
14616
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
14478
14617
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
14479
14618
  );
14480
- el[assignKey](
14481
- el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]
14482
- );
14483
- el._assigning = true;
14484
- nextTick(() => {
14485
- el._assigning = false;
14486
- });
14619
+ const multiple = el.multiple;
14620
+ const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
14621
+ const pending = el._pendingValue = [
14622
+ multiple,
14623
+ multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue
14624
+ ];
14625
+ try {
14626
+ el[assignKey](assignedValue);
14627
+ } finally {
14628
+ nextTick(() => {
14629
+ if (el._pendingValue === pending) {
14630
+ el._pendingValue = void 0;
14631
+ }
14632
+ });
14633
+ }
14487
14634
  });
14488
14635
  el[assignKey] = getModelAssigner(vnode);
14489
14636
  },
@@ -14497,11 +14644,25 @@ Expected function or array of functions, received type ${typeof value}.`
14497
14644
  el[assignKey] = getModelAssigner(vnode);
14498
14645
  },
14499
14646
  updated(el, { value }) {
14500
- if (!el._assigning) {
14647
+ const pending = el._pendingValue;
14648
+ el._pendingValue = void 0;
14649
+ if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
14501
14650
  setSelected(el, value);
14502
14651
  }
14503
14652
  }
14504
14653
  };
14654
+ function isSameSelectValue(value, assignedValue, multiple) {
14655
+ if (!multiple) return looseEqual(value, assignedValue);
14656
+ if (isArray(value)) return looseEqual(value, assignedValue);
14657
+ if (isSet(value)) {
14658
+ if (value.size !== assignedValue.length) return false;
14659
+ for (const item of assignedValue) {
14660
+ if (!value.has(item)) return false;
14661
+ }
14662
+ return true;
14663
+ }
14664
+ return false;
14665
+ }
14505
14666
  function setSelected(el, value) {
14506
14667
  const isMultiple = el.multiple;
14507
14668
  const isArrayValue = isArray(value);
@@ -18735,6 +18896,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
18735
18896
  node.loc
18736
18897
  );
18737
18898
  return () => {
18899
+ var _a;
18738
18900
  let childBlock;
18739
18901
  const { children } = forNode;
18740
18902
  if (isTemplate) {
@@ -18778,7 +18940,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
18778
18940
  if (isTemplate && keyProperty) {
18779
18941
  injectProp(childBlock, keyProperty, context);
18780
18942
  }
18781
- if (childBlock.isBlock !== !isStableFragment) {
18943
+ const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
18944
+ if (childBlock.isBlock !== shouldUseBlock) {
18782
18945
  if (childBlock.isBlock) {
18783
18946
  removeHelper(OPEN_BLOCK);
18784
18947
  removeHelper(
@@ -18790,12 +18953,15 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
18790
18953
  );
18791
18954
  }
18792
18955
  }
18793
- childBlock.isBlock = !isStableFragment;
18956
+ childBlock.isBlock = shouldUseBlock;
18794
18957
  if (childBlock.isBlock) {
18795
18958
  helper(OPEN_BLOCK);
18796
18959
  helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
18797
18960
  } else {
18798
18961
  helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
18962
+ if (childBlock.needsPatch) {
18963
+ childBlock.patchFlag = ((_a = childBlock.patchFlag) != null ? _a : 0) | 512;
18964
+ }
18799
18965
  }
18800
18966
  }
18801
18967
  if (memo) {
@@ -19174,6 +19340,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19174
19340
  let vnodeDynamicProps;
19175
19341
  let dynamicPropNames;
19176
19342
  let vnodeDirectives;
19343
+ let needsPatch = false;
19344
+ let isBlockRequired = false;
19177
19345
  let shouldUseBlock = (
19178
19346
  // dynamic component may resolve to plain elements
19179
19347
  isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
@@ -19193,6 +19361,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19193
19361
  vnodeProps = propsBuildResult.props;
19194
19362
  patchFlag = propsBuildResult.patchFlag;
19195
19363
  dynamicPropNames = propsBuildResult.dynamicPropNames;
19364
+ needsPatch = propsBuildResult.needsPatch;
19365
+ isBlockRequired = propsBuildResult.isBlockRequired;
19196
19366
  const directives = propsBuildResult.directives;
19197
19367
  vnodeDirectives = directives && directives.length ? createArrayExpression(
19198
19368
  directives.map((dir) => buildDirectiveArgs(dir, context))
@@ -19243,7 +19413,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19243
19413
  if (dynamicPropNames && dynamicPropNames.length) {
19244
19414
  vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
19245
19415
  }
19246
- node.codegenNode = createVNodeCall(
19416
+ const vnodeCall = node.codegenNode = createVNodeCall(
19247
19417
  context,
19248
19418
  vnodeTag,
19249
19419
  vnodeProps,
@@ -19256,6 +19426,13 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19256
19426
  isComponent,
19257
19427
  node.loc
19258
19428
  );
19429
+ needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
19430
+ if (needsPatch) {
19431
+ vnodeCall.needsPatch = true;
19432
+ }
19433
+ if (isBlockRequired) {
19434
+ vnodeCall.isBlockRequired = true;
19435
+ }
19259
19436
  };
19260
19437
  };
19261
19438
  function resolveComponentType(node, context, ssr = false) {
@@ -19307,6 +19484,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19307
19484
  const runtimeDirectives = [];
19308
19485
  const hasChildren = children.length > 0;
19309
19486
  let shouldUseBlock = false;
19487
+ let isBlockRequired = false;
19310
19488
  let patchFlag = 0;
19311
19489
  let hasRef = false;
19312
19490
  let hasClassBinding = false;
@@ -19348,19 +19526,20 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19348
19526
  if (isEventHandler && isReservedProp(name)) {
19349
19527
  hasVnodeHook = true;
19350
19528
  }
19529
+ if (name === "ref") {
19530
+ hasRef = true;
19531
+ }
19351
19532
  if (isEventHandler && value.type === 14) {
19352
19533
  value = value.arguments[0];
19353
19534
  }
19354
19535
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
19355
19536
  return;
19356
19537
  }
19357
- if (name === "ref") {
19358
- hasRef = true;
19359
- } else if (name === "class") {
19538
+ if (name === "class") {
19360
19539
  hasClassBinding = true;
19361
19540
  } else if (name === "style") {
19362
19541
  hasStyleBinding = true;
19363
- } else if (name !== "key" && !dynamicPropNames.includes(name)) {
19542
+ } else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) {
19364
19543
  dynamicPropNames.push(name);
19365
19544
  }
19366
19545
  if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
@@ -19419,13 +19598,12 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19419
19598
  if (isVOn && ssr) {
19420
19599
  continue;
19421
19600
  }
19422
- if (
19423
- // #938: elements with dynamic keys should be forced into blocks
19424
- isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked
19425
- // before children
19426
- isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
19427
- ) {
19601
+ if (isVBind && isStaticArgOf(arg, "key")) {
19602
+ shouldUseBlock = true;
19603
+ }
19604
+ if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
19428
19605
  shouldUseBlock = true;
19606
+ isBlockRequired = true;
19429
19607
  }
19430
19608
  if (isVBind && isStaticArgOf(arg, "ref")) {
19431
19609
  pushRefVForMarker();
@@ -19508,6 +19686,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19508
19686
  runtimeDirectives.push(prop);
19509
19687
  if (hasChildren) {
19510
19688
  shouldUseBlock = true;
19689
+ isBlockRequired = true;
19511
19690
  }
19512
19691
  }
19513
19692
  }
@@ -19546,7 +19725,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19546
19725
  patchFlag |= 32;
19547
19726
  }
19548
19727
  }
19549
- if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
19728
+ const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
19729
+ if (!shouldUseBlock && needsPatch) {
19550
19730
  patchFlag |= 512;
19551
19731
  }
19552
19732
  if (!context.inSSR && propsExpression) {
@@ -19612,7 +19792,9 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19612
19792
  directives: runtimeDirectives,
19613
19793
  patchFlag,
19614
19794
  dynamicPropNames,
19615
- shouldUseBlock
19795
+ shouldUseBlock,
19796
+ needsPatch,
19797
+ isBlockRequired
19616
19798
  };
19617
19799
  }
19618
19800
  function dedupeProperties(properties) {