@vue/compat 3.6.0-rc.14 → 3.6.0-rc.15

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.6.0-rc.14
2
+ * @vue/compat v3.6.0-rc.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -71,10 +71,18 @@ var Vue = (function() {
71
71
  const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
72
72
  const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
73
73
  const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
74
+ const STRING_CACHE_MAX_SIZE = 1e4;
74
75
  const cacheStringFunction = (fn) => {
75
- const cache = Object.create(null);
76
+ let cache = Object.create(null);
77
+ let size = 0;
76
78
  return ((str) => {
77
- return cache[str] || (cache[str] = fn(str));
79
+ const hit = cache[str];
80
+ if (hit !== void 0) return hit;
81
+ if (++size > STRING_CACHE_MAX_SIZE) {
82
+ cache = Object.create(null);
83
+ size = 1;
84
+ }
85
+ return cache[str] = fn(str);
78
86
  });
79
87
  };
80
88
  const camelizeRE = /-(\w)/g;
@@ -82,22 +90,22 @@ var Vue = (function() {
82
90
  /**
83
91
  * @private
84
92
  */
85
- const camelize = cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
93
+ const camelize = /*@__PURE__*/ cacheStringFunction((str) => str.replace(camelizeRE, camelizeReplacer));
86
94
  const hyphenateRE = /\B([A-Z])/g;
87
95
  /**
88
96
  * @private
89
97
  */
90
- const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
98
+ const hyphenate = /*@__PURE__*/ cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
91
99
  /**
92
100
  * @private
93
101
  */
94
- const capitalize = cacheStringFunction((str) => {
102
+ const capitalize = /*@__PURE__*/ cacheStringFunction((str) => {
95
103
  return str.charAt(0).toUpperCase() + str.slice(1);
96
104
  });
97
105
  /**
98
106
  * @private
99
107
  */
100
- const toHandlerKey = cacheStringFunction((str) => {
108
+ const toHandlerKey = /*@__PURE__*/ cacheStringFunction((str) => {
101
109
  return str ? `on${capitalize(str)}` : ``;
102
110
  });
103
111
  /**
@@ -301,26 +309,11 @@ var Vue = (function() {
301
309
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
302
310
  */
303
311
  const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
304
- //#endregion
305
- //#region packages/shared/src/domAttrConfig.ts
306
- /**
307
- * On the client we only need to offer special cases for boolean attributes that
308
- * have different names from their corresponding dom properties:
309
- * - itemscope -> N/A
310
- * - allowfullscreen -> allowFullscreen
311
- * - formnovalidate -> formNoValidate
312
- * - ismap -> isMap
313
- * - nomodule -> noModule
314
- * - novalidate -> noValidate
315
- * - playsinline -> playsInline
316
- * - readonly -> readOnly
317
- */
318
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
319
- const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
312
+ const isSpecialBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly");
320
313
  /**
321
314
  * The full list is needed during SSR to produce the correct initial markup.
322
315
  */
323
- const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
316
+ const isBooleanAttr = /*@__PURE__*/ makeMap("itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
324
317
  /**
325
318
  * Boolean attributes should be included if the value is truthy or ''.
326
319
  * e.g. `<select multiple>` compiles to `{ multiple: '' }`
@@ -531,40 +524,16 @@ var Vue = (function() {
531
524
  }
532
525
  return true;
533
526
  }
534
- //#endregion
535
- //#region packages/reactivity/src/debug.ts
536
- const triggerEventInfos = [];
537
- function onTrack(sub, debugInfo) {
538
- if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
539
- }
540
- function onTrigger(sub) {
541
- if (sub.onTrigger) {
542
- const debugInfo = triggerEventInfos[triggerEventInfos.length - 1];
543
- sub.onTrigger(extend({ effect: sub }, debugInfo));
544
- }
545
- }
546
- function setupOnTrigger(target) {
547
- Object.defineProperty(target.prototype, "onTrigger", {
548
- get() {
549
- return this._onTrigger;
550
- },
551
- set(val) {
552
- if (val && !this._onTrigger) setupFlagsHandler(this);
553
- this._onTrigger = val;
554
- }
555
- });
527
+ /**
528
+ * The data of a comment opening a range only a vapor server render emits:
529
+ * `<!--{-->` around the render of a component, or a v-if branch's.
530
+ */
531
+ function isVaporRangeStart(data) {
532
+ return data === "{" || isVaporBranchStart(data);
556
533
  }
557
- function setupFlagsHandler(target) {
558
- target._flags = target.flags;
559
- Object.defineProperty(target, "flags", {
560
- get() {
561
- return target._flags;
562
- },
563
- set(value) {
564
- if (!(target._flags & 48) && !!(value & 48)) onTrigger(this);
565
- target._flags = value;
566
- }
567
- });
534
+ /** The data of the comment closing the range `open` opens. */
535
+ function rangeCloseOf(open) {
536
+ return open === "(" ? ")" : open === "{" ? "}" : "]";
568
537
  }
569
538
  //#endregion
570
539
  //#region packages/reactivity/src/warning.ts
@@ -576,13 +545,7 @@ var Vue = (function() {
576
545
  const notifyBuffer = [];
577
546
  let batchDepth = 0;
578
547
  let activeSub = void 0;
579
- let runDepth = 0;
580
- function incRunDepth() {
581
- ++runDepth;
582
- }
583
- function decRunDepth() {
584
- --runDepth;
585
- }
548
+ const CHECKING = 512;
586
549
  let globalVersion = 0;
587
550
  let notifyIndex = 0;
588
551
  let notifyBufferLength = 0;
@@ -631,6 +594,7 @@ var Vue = (function() {
631
594
  const nextDep = link.nextDep;
632
595
  const nextSub = link.nextSub;
633
596
  const prevSub = link.prevSub;
597
+ link.prevDep = link.nextDep = link.prevSub = link.nextSub = void 0;
634
598
  if (nextDep !== void 0) nextDep.prevDep = prevDep;
635
599
  else sub.depsTail = prevDep;
636
600
  if (prevDep !== void 0) prevDep.nextDep = nextDep;
@@ -638,7 +602,7 @@ var Vue = (function() {
638
602
  if (nextSub !== void 0) nextSub.prevSub = prevSub;
639
603
  else dep.subsTail = prevSub;
640
604
  if (prevSub !== void 0) prevSub.nextSub = nextSub;
641
- else if ((dep.subs = nextSub) === void 0) {
605
+ else if ((dep.subs = nextSub) === void 0 && dep.flags & 1) {
642
606
  let toRemove = dep.deps;
643
607
  if (toRemove !== void 0) {
644
608
  do
@@ -656,14 +620,12 @@ var Vue = (function() {
656
620
  const sub = link.sub;
657
621
  let flags = sub.flags;
658
622
  if (flags & 3) {
659
- if (!(flags & 60)) {
660
- sub.flags = flags | 32;
661
- if (runDepth) sub.flags |= 8;
662
- } else if (!(flags & 12)) flags = 0;
623
+ if (!(flags & 44)) sub.flags = flags | 32;
624
+ else if (!(flags & 12)) flags = 0;
663
625
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
664
626
  else if (!(flags & 48) && isValidLink(link, sub)) {
665
627
  sub.flags = flags | 40;
666
- flags &= 1;
628
+ flags = sub === activeSub || activeSub === void 0 ? 0 : flags & 1;
667
629
  } else flags = 0;
668
630
  if (flags & 2) notifyBuffer[notifyBufferLength++] = sub;
669
631
  if (flags & 1) {
@@ -699,7 +661,7 @@ var Vue = (function() {
699
661
  function startTracking(sub) {
700
662
  ++globalVersion;
701
663
  sub.depsTail = void 0;
702
- sub.flags = sub.flags & -57 | 4;
664
+ sub.flags = sub.flags & -569 | 4;
703
665
  return setActiveSub(sub);
704
666
  }
705
667
  function endTracking(sub, prevSub) {
@@ -707,8 +669,11 @@ var Vue = (function() {
707
669
  activeSub = prevSub;
708
670
  const depsTail = sub.depsTail;
709
671
  let toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
710
- while (toRemove !== void 0) toRemove = unlink(toRemove, sub);
711
- sub.flags &= -5;
672
+ while (toRemove !== void 0) {
673
+ unlink(toRemove, sub);
674
+ toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
675
+ }
676
+ if ((sub.flags &= -5) & 8) markRecursed(sub);
712
677
  }
713
678
  function flush() {
714
679
  let hasError = false;
@@ -730,45 +695,67 @@ var Vue = (function() {
730
695
  if (hasError) throw error;
731
696
  }
732
697
  function checkDirty(link, sub) {
698
+ try {
699
+ return walkDirty(link, sub);
700
+ } catch (err) {
701
+ markStale(sub);
702
+ throw err;
703
+ }
704
+ }
705
+ function walkDirty(link, sub) {
706
+ const root = sub;
733
707
  let stack;
734
708
  let checkDepth = 0;
709
+ let staleDepth = 0;
710
+ let staleFloor = 0;
735
711
  top: do {
736
712
  const dep = link.dep;
737
713
  const depFlags = dep.flags;
738
714
  let dirty = false;
739
715
  if (sub.flags & 16) dirty = true;
740
716
  else if ((depFlags & 17) === 17) {
741
- const subs = dep.subs;
742
717
  if (dep.update()) {
743
- if (subs.nextSub !== void 0) shallowPropagate(subs);
718
+ const subs = dep.subs;
719
+ if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
744
720
  dirty = true;
745
721
  }
746
722
  } else if ((depFlags & 33) === 33) {
747
- stack = {
748
- value: link,
749
- prev: stack
750
- };
751
- link = dep.deps;
752
- sub = dep;
753
- ++checkDepth;
754
- continue;
723
+ const depth = dep === root ? 0 : depFlags & CHECKING ? checkingDepth(dep, stack, checkDepth) : -1;
724
+ if (depth < 0) {
725
+ if (link.nextSub !== void 0 || link.prevSub !== void 0) dep.flags = depFlags | CHECKING;
726
+ stack = {
727
+ value: link,
728
+ prev: stack
729
+ };
730
+ link = dep.deps;
731
+ sub = dep;
732
+ ++checkDepth;
733
+ continue;
734
+ }
735
+ if (depth < checkDepth) {
736
+ staleFloor = staleDepth && staleFloor < depth ? staleFloor : depth;
737
+ staleDepth = checkDepth;
738
+ }
755
739
  }
756
740
  if (!dirty && link.nextDep !== void 0) {
757
741
  link = link.nextDep;
758
742
  continue;
759
743
  }
760
744
  while (checkDepth) {
745
+ const stale = checkDepth === staleDepth;
746
+ if (stale && --staleDepth === staleFloor) staleDepth = 0;
761
747
  --checkDepth;
762
748
  link = stack.value;
763
749
  stack = stack.prev;
764
750
  if (dirty) {
765
- const subs = sub.subs;
766
751
  if (sub.update()) {
767
- if (subs.nextSub !== void 0) shallowPropagate(subs);
752
+ const subs = sub.subs;
753
+ if (subs !== void 0 && (subs !== link || subs.nextSub !== void 0)) shallowPropagate(subs);
768
754
  sub = link.sub;
769
755
  continue;
770
756
  }
771
- } else sub.flags &= -33;
757
+ } else if (stale) sub.flags = sub.flags & -545 | 16;
758
+ else sub.flags &= -545;
772
759
  sub = link.sub;
773
760
  if (link.nextDep !== void 0) {
774
761
  link = link.nextDep;
@@ -776,9 +763,21 @@ var Vue = (function() {
776
763
  }
777
764
  dirty = false;
778
765
  }
779
- return dirty && !!sub.flags;
766
+ return (dirty || !!(sub.flags & 16)) && !!sub.flags;
780
767
  } while (true);
781
768
  }
769
+ function checkingDepth(dep, stack, depth) {
770
+ for (; stack !== void 0; stack = stack.prev, --depth) if (stack.value.dep === dep) return depth;
771
+ return -1;
772
+ }
773
+ function markStale(sub) {
774
+ const nodes = [sub];
775
+ do {
776
+ sub = nodes.pop();
777
+ sub.flags = sub.flags & -33 | 16;
778
+ for (let link = sub.deps; link !== void 0; link = link.nextDep) if (link.dep.flags & 32) nodes.push(link.dep);
779
+ } while (nodes.length);
780
+ }
782
781
  function shallowPropagate(link) {
783
782
  do {
784
783
  const sub = link.sub;
@@ -796,6 +795,71 @@ var Vue = (function() {
796
795
  }
797
796
  return false;
798
797
  }
798
+ function markRecursed(sub) {
799
+ const nodes = [sub];
800
+ do {
801
+ sub = nodes.pop();
802
+ for (let link = sub.deps; link !== void 0; link = link.nextDep) {
803
+ const dep = link.dep;
804
+ if ((dep.flags & 40) === 32) {
805
+ dep.flags |= 8;
806
+ nodes.push(dep);
807
+ }
808
+ }
809
+ } while (nodes.length);
810
+ }
811
+ //#endregion
812
+ //#region packages/reactivity/src/debug.ts
813
+ const triggered = [];
814
+ function onTrack(sub, debugInfo) {
815
+ if (sub.onTrack) sub.onTrack(extend({ effect: sub }, debugInfo));
816
+ }
817
+ function onTrigger(sub, debugInfo) {
818
+ if (sub.onTrigger) sub.onTrigger(extend({ effect: sub }, debugInfo));
819
+ }
820
+ function startTrigger() {
821
+ triggered.push([]);
822
+ }
823
+ function endTrigger(debugInfo) {
824
+ const subs = triggered.pop();
825
+ if (subs.length) {
826
+ startBatch();
827
+ try {
828
+ for (let i = 0; i < subs.length; i++) {
829
+ const sub = subs[i];
830
+ if (sub.flags & 3) onTrigger(sub, debugInfo);
831
+ }
832
+ } finally {
833
+ endBatch();
834
+ }
835
+ }
836
+ }
837
+ function setupOnTrigger(target) {
838
+ Object.defineProperty(target.prototype, "onTrigger", {
839
+ get() {
840
+ return this._onTrigger;
841
+ },
842
+ set(val) {
843
+ if (val && !this._onTrigger) setupFlagsHandler(this);
844
+ this._onTrigger = val;
845
+ }
846
+ });
847
+ }
848
+ function setupFlagsHandler(target) {
849
+ target._flags = target.flags;
850
+ Object.defineProperty(target, "flags", {
851
+ get() {
852
+ return target._flags;
853
+ },
854
+ set(value) {
855
+ if (!(target._flags & 48) && !!(value & 48)) {
856
+ if (triggered.length) triggered[triggered.length - 1].push(this);
857
+ else onTrigger(this);
858
+ }
859
+ target._flags = value;
860
+ }
861
+ });
862
+ }
799
863
  //#endregion
800
864
  //#region packages/reactivity/src/dep.ts
801
865
  var Dep = class {
@@ -855,20 +919,12 @@ var Vue = (function() {
855
919
  if (!depsMap) return;
856
920
  const run = (dep) => {
857
921
  if (dep !== void 0 && dep.subs !== void 0) {
858
- triggerEventInfos.push({
859
- target,
860
- type,
861
- key,
862
- newValue,
863
- oldValue,
864
- oldTarget
865
- });
866
922
  propagate(dep.subs);
867
923
  shallowPropagate(dep.subs);
868
- triggerEventInfos.pop();
869
924
  }
870
925
  };
871
926
  startBatch();
927
+ startTrigger();
872
928
  if (type === "clear") depsMap.forEach(run);
873
929
  else {
874
930
  const targetIsArray = isArray(target);
@@ -898,6 +954,14 @@ var Vue = (function() {
898
954
  }
899
955
  }
900
956
  }
957
+ endTrigger({
958
+ target,
959
+ type,
960
+ key,
961
+ newValue,
962
+ oldValue,
963
+ oldTarget
964
+ });
901
965
  endBatch();
902
966
  }
903
967
  function getDepFromReactive(object, key) {
@@ -1112,7 +1176,7 @@ var Vue = (function() {
1112
1176
  //#endregion
1113
1177
  //#region packages/reactivity/src/baseHandlers.ts
1114
1178
  const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
1115
- const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
1179
+ const builtInSymbols = /*@__PURE__*/ new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
1116
1180
  function hasOwnProperty(key) {
1117
1181
  if (!isSymbol(key)) key = String(key);
1118
1182
  const obj = /* @__PURE__ */ toRaw(this);
@@ -1696,16 +1760,16 @@ var Vue = (function() {
1696
1760
  this._value = !useDirectValue && this._wrap ? this._wrap(newValue) : newValue;
1697
1761
  const subs = this.subs;
1698
1762
  if (subs !== void 0) {
1699
- triggerEventInfos.push({
1763
+ startTrigger();
1764
+ propagate(subs);
1765
+ endTrigger({
1700
1766
  target: this,
1701
1767
  type: "set",
1702
1768
  key: "value",
1703
1769
  newValue,
1704
1770
  oldValue
1705
1771
  });
1706
- propagate(subs);
1707
1772
  if (!batchDepth) flush();
1708
- triggerEventInfos.pop();
1709
1773
  }
1710
1774
  }
1711
1775
  }
@@ -1742,8 +1806,10 @@ var Vue = (function() {
1742
1806
  function triggerRef(ref) {
1743
1807
  const dep = ref.dep;
1744
1808
  if (dep !== void 0 && dep.subs !== void 0) {
1809
+ startTrigger();
1745
1810
  propagate(dep.subs);
1746
1811
  shallowPropagate(dep.subs);
1812
+ endTrigger();
1747
1813
  if (!batchDepth) flush();
1748
1814
  }
1749
1815
  }
@@ -1934,6 +2000,10 @@ var Vue = (function() {
1934
2000
  get active() {
1935
2001
  return !(this.flags & 1024);
1936
2002
  }
2003
+ /** @internal */
2004
+ get running() {
2005
+ return !!(this.flags & 4);
2006
+ }
1937
2007
  pause() {
1938
2008
  this.flags |= 256;
1939
2009
  }
@@ -1947,11 +2017,9 @@ var Vue = (function() {
1947
2017
  if (!this.active) return this.fn();
1948
2018
  cleanup(this);
1949
2019
  const prevSub = startTracking(this);
1950
- incRunDepth();
1951
2020
  try {
1952
2021
  return this.fn();
1953
2022
  } finally {
1954
- decRunDepth();
1955
2023
  endTracking(this, prevSub);
1956
2024
  const flags = this.flags;
1957
2025
  if ((flags & 136) === 136) {
@@ -1974,9 +2042,9 @@ var Vue = (function() {
1974
2042
  if (flags & 16) return true;
1975
2043
  if (flags & 32) {
1976
2044
  if (checkDirty(this.deps, this)) {
1977
- this.flags = flags | 16;
2045
+ if (this.active) this.flags |= 16;
1978
2046
  return true;
1979
- } else this.flags = flags & -33;
2047
+ } else this.flags &= -33;
1980
2048
  }
1981
2049
  return false;
1982
2050
  }
@@ -1988,20 +2056,17 @@ var Vue = (function() {
1988
2056
  if (options) {
1989
2057
  const { onStop, scheduler } = options;
1990
2058
  if (onStop) {
1991
- options.onStop = void 0;
1992
2059
  const stop = e.stop.bind(e);
1993
2060
  e.stop = () => {
1994
2061
  stop();
1995
2062
  onStop();
1996
2063
  };
1997
2064
  }
1998
- if (scheduler) {
1999
- options.scheduler = void 0;
2000
- e.notify = () => {
2001
- if (!(e.flags & 256)) scheduler();
2002
- };
2003
- }
2004
- extend(e, options);
2065
+ if (scheduler) e.notify = () => {
2066
+ if (!(e.flags & 1280)) scheduler();
2067
+ };
2068
+ e.onTrack = options.onTrack;
2069
+ e.onTrigger = options.onTrigger;
2005
2070
  }
2006
2071
  try {
2007
2072
  e.run();
@@ -2061,8 +2126,10 @@ var Vue = (function() {
2061
2126
  const flags = this.flags;
2062
2127
  if (flags & 256) {
2063
2128
  this.flags = flags & -257;
2064
- for (let link = this.deps; link !== void 0; link = link.nextDep) {
2065
- const dep = link.dep;
2129
+ const deps = [];
2130
+ for (let link = this.deps; link !== void 0; link = link.nextDep) deps.push(link.dep);
2131
+ for (let i = 0; i < deps.length; i++) {
2132
+ const dep = deps[i];
2066
2133
  if ("resume" in dep) dep.resume();
2067
2134
  }
2068
2135
  }
@@ -2091,8 +2158,10 @@ var Vue = (function() {
2091
2158
  while (dep !== void 0) {
2092
2159
  const node = dep.dep;
2093
2160
  if ("stop" in node) {
2094
- dep = dep.nextDep;
2161
+ const prev = dep.prevDep;
2095
2162
  node.stop();
2163
+ const next = prev !== void 0 ? prev.nextDep : this.deps;
2164
+ dep = next === dep ? dep.nextDep : next;
2096
2165
  } else dep = unlink(dep, this);
2097
2166
  }
2098
2167
  cleanup(this);
@@ -2133,11 +2202,14 @@ var Vue = (function() {
2133
2202
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#onscopedispose}
2134
2203
  */
2135
2204
  function onScopeDispose(fn, failSilently = false) {
2136
- if (activeEffectScope !== void 0) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
2137
- else if (!failSilently) warn$2("onScopeDispose() is called when there is no active effect scope to be associated with.");
2205
+ if (activeEffectScope !== void 0) {
2206
+ if (activeEffectScope.active) activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
2207
+ else fn();
2208
+ } else if (!failSilently) warn$2("onScopeDispose() is called when there is no active effect scope to be associated with.");
2138
2209
  }
2139
2210
  //#endregion
2140
2211
  //#region packages/reactivity/src/computed.ts
2212
+ const FAILED = 64;
2141
2213
  /**
2142
2214
  * @private exported by @vue/reactivity for Vue core use, but not exported from
2143
2215
  * the main vue package
@@ -2186,12 +2258,24 @@ var Vue = (function() {
2186
2258
  }
2187
2259
  get value() {
2188
2260
  const flags = this.flags;
2189
- if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
2190
- if (this.update()) {
2191
- const subs = this.subs;
2192
- if (subs !== void 0) shallowPropagate(subs);
2193
- }
2194
- } else if (flags & 32) this.flags = flags & -33;
2261
+ try {
2262
+ if (flags & 16 || flags & 32 && checkDirty(this.deps, this)) {
2263
+ if (this.update()) {
2264
+ const subs = this.subs;
2265
+ if (subs !== void 0) shallowPropagate(subs);
2266
+ }
2267
+ } else if (flags & 32) this.flags = flags & -33;
2268
+ } catch (err) {
2269
+ if (activeSub !== void 0) {
2270
+ onTrack(activeSub, {
2271
+ target: this,
2272
+ type: "get",
2273
+ key: "value"
2274
+ });
2275
+ link(this, activeSub);
2276
+ } else if (activeEffectScope !== void 0) link(this, activeEffectScope);
2277
+ throw err;
2278
+ }
2195
2279
  if (activeSub !== void 0) {
2196
2280
  onTrack(activeSub, {
2197
2281
  target: this,
@@ -2199,7 +2283,18 @@ var Vue = (function() {
2199
2283
  key: "value"
2200
2284
  });
2201
2285
  link(this, activeSub);
2202
- } else if (activeEffectScope !== void 0) link(this, activeEffectScope);
2286
+ } else if (activeEffectScope !== void 0) {
2287
+ if (activeEffectScope.active) link(this, activeEffectScope);
2288
+ else if (this.subs === void 0) {
2289
+ let dep = this.deps;
2290
+ if (dep !== void 0) {
2291
+ do
2292
+ dep = unlink(dep, this);
2293
+ while (dep !== void 0);
2294
+ this.flags |= 16;
2295
+ }
2296
+ }
2297
+ }
2203
2298
  return this._value;
2204
2299
  }
2205
2300
  set value(newValue) {
@@ -2211,11 +2306,15 @@ var Vue = (function() {
2211
2306
  try {
2212
2307
  const oldValue = this._value;
2213
2308
  const newValue = this.fn(oldValue);
2214
- if (hasChanged(oldValue, newValue)) {
2309
+ if (hasChanged(oldValue, newValue) || this.flags & FAILED) {
2215
2310
  this._value = newValue;
2311
+ this.flags &= -65;
2216
2312
  return true;
2217
2313
  }
2218
2314
  return false;
2315
+ } catch (err) {
2316
+ this.flags |= FAILED;
2317
+ throw err;
2219
2318
  } finally {
2220
2319
  endTracking(this, prevSub);
2221
2320
  }
@@ -2236,6 +2335,7 @@ var Vue = (function() {
2236
2335
  cRef.onTrack = debugOptions.onTrack;
2237
2336
  cRef.onTrigger = debugOptions.onTrigger;
2238
2337
  }
2338
+ if (isSSR && activeEffectScope !== void 0) link(cRef, activeEffectScope);
2239
2339
  return cRef;
2240
2340
  }
2241
2341
  //#endregion
@@ -2606,7 +2706,7 @@ var Vue = (function() {
2606
2706
  if (isFunction(fn)) {
2607
2707
  const res = callWithErrorHandling(fn, instance, type, args);
2608
2708
  if (res && isPromise(res)) res.catch((err) => {
2609
- handleError(err, instance, type);
2709
+ handleError(err, instance, type, void 0, true);
2610
2710
  });
2611
2711
  return res;
2612
2712
  }
@@ -2616,7 +2716,7 @@ var Vue = (function() {
2616
2716
  return values;
2617
2717
  } else warn$1(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`);
2618
2718
  }
2619
- function handleError(err, instance, type, throwInDev = true) {
2719
+ function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
2620
2720
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2621
2721
  if (instance) {
2622
2722
  let cur = instance.parent;
@@ -2624,7 +2724,7 @@ var Vue = (function() {
2624
2724
  const errorInfo = ErrorTypeStrings$1[type];
2625
2725
  while (cur) {
2626
2726
  const errorCapturedHooks = cur.ec;
2627
- if (errorCapturedHooks) {
2727
+ if (errorCapturedHooks && !cur.isUnmounted && (!isAsyncError || cur.scope.active)) {
2628
2728
  for (let i = 0; i < errorCapturedHooks.length; i++) if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) return;
2629
2729
  }
2630
2730
  cur = cur.parent;
@@ -2929,7 +3029,11 @@ var Vue = (function() {
2929
3029
  updateComponentDef(record.initialDef, newComp);
2930
3030
  const instances = [...record.instances];
2931
3031
  if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2932
- for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
3032
+ for (const instance of instances) {
3033
+ if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
3034
+ const oldComp = normalizeClassComponent(instance.type);
3035
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
3036
+ }
2933
3037
  const dirtyInstances = new Set(instances);
2934
3038
  const rerenderedParents = /* @__PURE__ */ new Set();
2935
3039
  runWithHmrUpdating(() => {
@@ -2970,7 +3074,25 @@ var Vue = (function() {
2970
3074
  if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2971
3075
  }
2972
3076
  parents.forEach((parent) => {
2973
- queueJob(() => {
3077
+ const children = instances.filter((instance) => instance.parent === parent);
3078
+ const update = () => {
3079
+ if (!parent.scope.active) return;
3080
+ const activeChildren = children.filter((instance) => instance.scope.active);
3081
+ if (!activeChildren.length) return;
3082
+ const pending = activeChildren.find((instance) => instance.asyncDep && !instance.asyncResolved) || locateUnresolvedAsyncRoot(parent);
3083
+ if (pending) {
3084
+ pending.asyncDep.catch(NOOP).then(() => {
3085
+ if (parent.scope.active && (pending.asyncResolved || !pending.scope.active)) queueJob(update);
3086
+ });
3087
+ return;
3088
+ }
3089
+ for (const instance of activeChildren) {
3090
+ const oldComp = normalizeClassComponent(instance.type);
3091
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
3092
+ if (!dirtyInstances) hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
3093
+ dirtyInstances.add(instance);
3094
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
3095
+ }
2974
3096
  runWithHmrUpdating(() => {
2975
3097
  if (parent.vapor) parent.hmrRerender();
2976
3098
  else {
@@ -2981,7 +3103,12 @@ var Vue = (function() {
2981
3103
  }
2982
3104
  }
2983
3105
  });
2984
- });
3106
+ queuePostFlushCb(() => {
3107
+ hmrDirtyComponents.clear();
3108
+ hmrDirtyComponentsMode.clear();
3109
+ });
3110
+ };
3111
+ queueJob(update);
2985
3112
  });
2986
3113
  }
2987
3114
  queuePostFlushCb(() => {
@@ -3530,11 +3657,28 @@ var Vue = (function() {
3530
3657
  return vnode;
3531
3658
  }
3532
3659
  function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3533
- const bindings = vnode.dirs;
3660
+ let hookVNode = vnode;
3661
+ if (name === "beforeMount") vnode._mount = vnode;
3662
+ else if (name === "beforeUpdate") {
3663
+ const mount = prevVNode && prevVNode._mount;
3664
+ if (mount) {
3665
+ mount._latest = vnode;
3666
+ vnode._mount = mount;
3667
+ }
3668
+ } else if (name === "mounted") {
3669
+ const latest = vnode._latest;
3670
+ vnode._mount = vnode._latest = void 0;
3671
+ if (latest) {
3672
+ hookVNode = latest;
3673
+ latest._mount = void 0;
3674
+ }
3675
+ }
3676
+ const bindings = hookVNode.dirs;
3534
3677
  const oldBindings = prevVNode && prevVNode.dirs;
3535
3678
  for (let i = 0; i < bindings.length; i++) {
3536
- const binding = bindings[i];
3679
+ let binding = bindings[i];
3537
3680
  if (oldBindings) binding.oldValue = oldBindings[i].value;
3681
+ else if (name === "mounted" && binding.oldValue !== void 0) binding = extend({}, binding, { oldValue: void 0 });
3538
3682
  let hook = binding.dir[name];
3539
3683
  if (!hook) hook = mapCompatDirectiveHook(name, binding.dir, instance);
3540
3684
  if (hook) {
@@ -3542,7 +3686,7 @@ var Vue = (function() {
3542
3686
  callWithAsyncErrorHandling(hook, instance, 8, [
3543
3687
  vnode.el,
3544
3688
  binding,
3545
- vnode,
3689
+ hookVNode,
3546
3690
  prevVNode
3547
3691
  ]);
3548
3692
  setActiveSub(prevSub);
@@ -3963,7 +4107,15 @@ var Vue = (function() {
3963
4107
  const { mode } = rawProps;
3964
4108
  checkTransitionMode(mode);
3965
4109
  return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
3966
- if (!(instance.effect.flags & 1024)) instance.update();
4110
+ if (!(instance.effect.flags & 1024)) {
4111
+ if (instance.effect.running) {
4112
+ const job = () => {
4113
+ if (!(instance.effect.flags & 1024)) instance.update();
4114
+ };
4115
+ job.i = instance;
4116
+ queueJob(job);
4117
+ } else instance.update();
4118
+ }
3967
4119
  }) : NOOP);
3968
4120
  };
3969
4121
  }
@@ -3994,7 +4146,7 @@ var Vue = (function() {
3994
4146
  }
3995
4147
  return leavingVNodesCache;
3996
4148
  }
3997
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
4149
+ function resolveTransitionHooks(vnode, props, state, instance) {
3998
4150
  const key = String(vnode.key);
3999
4151
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
4000
4152
  const hooks = baseResolveTransitionHooks({
@@ -4017,9 +4169,7 @@ var Vue = (function() {
4017
4169
  }
4018
4170
  },
4019
4171
  cloneHooks: (vnode) => {
4020
- const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
4021
- if (postClone) postClone(hooks);
4022
- return hooks;
4172
+ return resolveTransitionHooks(vnode, props, state, instance);
4023
4173
  }
4024
4174
  }, props, state, instance);
4025
4175
  if (isVaporInteropEnabled && vnode.type === VaporSlot) extend(hooks, {
@@ -4057,7 +4207,7 @@ var Vue = (function() {
4057
4207
  callHook(hook, [el]);
4058
4208
  },
4059
4209
  enter(el) {
4060
- if (!isHmrUpdating && isLeaving()) return;
4210
+ if (!isHmrUpdating && isLeaving(el)) return;
4061
4211
  let hook = onEnter;
4062
4212
  let afterHook = onAfterEnter;
4063
4213
  let cancelHook = onEnterCancelled;
@@ -4101,7 +4251,19 @@ var Vue = (function() {
4101
4251
  else done();
4102
4252
  },
4103
4253
  clone(node) {
4104
- return cloneHooks ? cloneHooks(node) : hooks;
4254
+ if (!cloneHooks) return hooks;
4255
+ const cloned = cloneHooks(node);
4256
+ cloned.afterLeave = () => {
4257
+ if (hooks.afterLeave) hooks.afterLeave();
4258
+ };
4259
+ cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
4260
+ if (hooks.delayLeave) hooks.delayLeave(el, earlyRemove, delayedLeave);
4261
+ else delayedLeave();
4262
+ };
4263
+ cloned.delayedLeave = () => {
4264
+ if (hooks.delayedLeave) hooks.delayedLeave();
4265
+ };
4266
+ return cloned;
4105
4267
  }
4106
4268
  };
4107
4269
  return hooks;
@@ -4136,10 +4298,7 @@ var Vue = (function() {
4136
4298
  if (state.isLeaving) return emptyPlaceholder(next);
4137
4299
  const nextInner = getInnerChild$1(next);
4138
4300
  if (!nextInner) return emptyPlaceholder(next);
4139
- let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
4140
- if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
4141
- enterHooks = hooks;
4142
- });
4301
+ const enterHooks = resolveTransitionHooks(nextInner, props, state, instance);
4143
4302
  if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
4144
4303
  if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
4145
4304
  const mode = props.mode;
@@ -4205,9 +4364,14 @@ var Vue = (function() {
4205
4364
  return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
4206
4365
  }
4207
4366
  } else if (vnode.shapeFlag & 128) {
4208
- const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4209
- const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4210
- return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
4367
+ const suspense = vnode.suspense;
4368
+ if (suspense) {
4369
+ const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
4370
+ if (branch) return setTransitionHooks(branch, hooks.clone(branch));
4371
+ } else {
4372
+ vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4373
+ vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4374
+ }
4211
4375
  } else {
4212
4376
  vnode.transition = hooks;
4213
4377
  if (vnode.type === Fragment && isArray(vnode.children)) {
@@ -4426,7 +4590,7 @@ var Vue = (function() {
4426
4590
  };
4427
4591
  const isComment = (node) => node.nodeType === 8;
4428
4592
  /** The data of a comment opening a range a hydration steps over as one. */
4429
- const isRangeStart = (data) => data === "[" || data === "(" || isVaporBranchStart(data);
4593
+ const isRangeStart = (data) => data === "[" || data === "(" || isVaporRangeStart(data);
4430
4594
  function createHydrationFunctions(rendererInternals) {
4431
4595
  const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
4432
4596
  const hydrate = (vnode, container) => {
@@ -4444,7 +4608,7 @@ var Vue = (function() {
4444
4608
  };
4445
4609
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
4446
4610
  optimized = optimized || !!vnode.dynamicChildren;
4447
- const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporBranchStart(node.data));
4611
+ const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporRangeStart(node.data));
4448
4612
  const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
4449
4613
  const { type, ref, shapeFlag, patchFlag } = vnode;
4450
4614
  let domType = node.nodeType;
@@ -4633,10 +4797,11 @@ var Vue = (function() {
4633
4797
  const container = parentNode(node);
4634
4798
  const first = nextSibling(node);
4635
4799
  const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
4636
- if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
4800
+ const close = isVaporInteropEnabled ? rangeCloseOf(node.data) : node.data === "(" ? ")" : "]";
4801
+ if (next && isComment(next) && next.data === close) return nextSibling(vnode.anchor = next);
4637
4802
  else {
4638
4803
  logMismatchError();
4639
- insert(vnode.anchor = createComment(`]`), container, next);
4804
+ insert(vnode.anchor = createComment(close), container, next);
4640
4805
  return next;
4641
4806
  }
4642
4807
  };
@@ -4658,13 +4823,13 @@ var Vue = (function() {
4658
4823
  const container = parentNode(node);
4659
4824
  remove(node);
4660
4825
  patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
4661
- if (parentComponent && parentComponent.vnode) {
4826
+ if (parentComponent && parentComponent.vnode && parentComponent.vnode.el === node) {
4662
4827
  parentComponent.vnode.el = vnode.el;
4663
4828
  updateHOCHostEl(parentComponent, vnode.el);
4664
4829
  }
4665
4830
  return next;
4666
4831
  };
4667
- const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
4832
+ const locateClosingAnchor = (node, open = node && isComment(node) && (node.data === "(" || isVaporInteropEnabled && node.data === "{") ? node.data : "[", close = isVaporInteropEnabled ? rangeCloseOf(open) : open === "(" ? ")" : "]") => {
4668
4833
  let match = 0;
4669
4834
  while (node) {
4670
4835
  node = nextSibling(node);
@@ -4927,7 +5092,7 @@ var Vue = (function() {
4927
5092
  function forEachElement(node, cb) {
4928
5093
  if (isComment(node) && isRangeStart(node.data)) {
4929
5094
  const open = node.data;
4930
- const close = open === "(" ? ")" : "]";
5095
+ const close = rangeCloseOf(open);
4931
5096
  let depth = 1;
4932
5097
  let next = node.nextSibling;
4933
5098
  while (next) {
@@ -4964,7 +5129,7 @@ var Vue = (function() {
4964
5129
  if (resolvedComp) return () => createInnerComp(resolvedComp, instance);
4965
5130
  const onError = (err) => {
4966
5131
  setPendingRequest(null);
4967
- handleError(err, instance, 13, !errorComponent);
5132
+ handleError(err, instance, 13, !errorComponent, true);
4968
5133
  };
4969
5134
  if (suspensible && instance.suspense || false) return load().then((comp) => {
4970
5135
  return () => createInnerComp(comp, instance);
@@ -5045,10 +5210,12 @@ var Vue = (function() {
5045
5210
  const delayed = /* @__PURE__ */ ref(!!delay);
5046
5211
  let timeoutTimer;
5047
5212
  let delayTimer;
5048
- if (instance) onUnmounted(() => {
5049
- if (timeoutTimer != null) clearTimeout(timeoutTimer);
5050
- if (delayTimer != null) clearTimeout(delayTimer);
5051
- }, instance);
5213
+ if (instance) instance.scope.run(() => {
5214
+ onScopeDispose(() => {
5215
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
5216
+ if (delayTimer != null) clearTimeout(delayTimer);
5217
+ });
5218
+ });
5052
5219
  if (delay) delayTimer = setTimeout(() => {
5053
5220
  if (instance && instance.isUnmounted) return;
5054
5221
  delayed.value = false;
@@ -5083,7 +5250,12 @@ var Vue = (function() {
5083
5250
  }
5084
5251
  return;
5085
5252
  }
5086
- if (!el.parentNode || wasConnected && !el.isConnected) return;
5253
+ if (!el.parentNode) return;
5254
+ if (wasConnected && !el.isConnected) {
5255
+ let current = instance;
5256
+ while (current && !current.isDeactivated) current = current.parent;
5257
+ if (!current) return;
5258
+ }
5087
5259
  hydrate();
5088
5260
  };
5089
5261
  const doHydrate = hydrateStrategy ? () => {
@@ -5137,7 +5309,11 @@ var Vue = (function() {
5137
5309
  activate(vnode, container, anchor, renderer, keepAliveInstance, parentSuspense, namespace, optimized);
5138
5310
  };
5139
5311
  sharedContext.deactivate = (vnode) => {
5140
- deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
5312
+ const cached = sharedContext.getCachedComponent(vnode);
5313
+ if (!cached || cached.component !== vnode.component) return false;
5314
+ if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(keepAliveInstance, vnode).deactivate(vnode, storageContainer, parentSuspense);
5315
+ else deactivate(vnode, storageContainer, renderer, keepAliveInstance, parentSuspense);
5316
+ return true;
5141
5317
  };
5142
5318
  function unmount(vnode) {
5143
5319
  resetShapeFlag(vnode);
@@ -5169,11 +5345,15 @@ var Vue = (function() {
5169
5345
  let pendingCacheKey = null;
5170
5346
  const cacheSubtree = () => {
5171
5347
  if (pendingCacheKey != null) {
5172
- if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
5173
- const vnode = getInnerChild(keepAliveInstance.subTree);
5174
- if (vnode.component) cache.set(pendingCacheKey, vnode);
5175
- }, void 0, keepAliveInstance.subTree.suspense);
5176
- else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
5348
+ if (isSuspense(keepAliveInstance.subTree.type)) {
5349
+ const cacheInnerChild = () => {
5350
+ const vnode = getInnerChild(keepAliveInstance.subTree);
5351
+ if (vnode.component) cache.set(pendingCacheKey, vnode);
5352
+ };
5353
+ const suspense = keepAliveInstance.subTree.suspense;
5354
+ if (suspense.pendingBranch) queuePostRenderEffect(cacheInnerChild, void 0, suspense);
5355
+ else cacheInnerChild();
5356
+ } else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
5177
5357
  }
5178
5358
  };
5179
5359
  onMounted(cacheSubtree);
@@ -5283,9 +5463,8 @@ var Vue = (function() {
5283
5463
  }
5284
5464
  function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
5285
5465
  const injected = injectHook(type, hook, keepAliveRoot, true);
5286
- onUnmounted(() => {
5287
- remove(keepAliveRoot[type], injected);
5288
- }, target);
5466
+ const removal = injectHook("um", () => remove(keepAliveRoot[type], injected), target);
5467
+ removal.flags = 8;
5289
5468
  }
5290
5469
  function resetShapeFlag(vnode) {
5291
5470
  vnode.shapeFlag &= -257;
@@ -5707,6 +5886,11 @@ var Vue = (function() {
5707
5886
  ret.props = extend({}, ret.props, { key: branchKey });
5708
5887
  ret.key = branchKey;
5709
5888
  }
5889
+ if (isBlockTreeEnabled <= 0) {
5890
+ if (!ret.vs.props) ret.vs.props = ret.props;
5891
+ ret.props = ret.key != null ? { key: ret.key } : null;
5892
+ ret.vs.attrs = EMPTY_OBJ;
5893
+ }
5710
5894
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
5711
5895
  return ret;
5712
5896
  }
@@ -6686,7 +6870,7 @@ var Vue = (function() {
6686
6870
  if (options.el) return vm.$mount(options.el);
6687
6871
  else return vm;
6688
6872
  }
6689
- Vue.version = `2.6.14-compat:3.6.0-rc.14`;
6873
+ Vue.version = `2.6.14-compat:3.6.0-rc.15`;
6690
6874
  Vue.config = singletonApp.config;
6691
6875
  Vue.use = (plugin, ...options) => {
6692
6876
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -8146,8 +8330,10 @@ var Vue = (function() {
8146
8330
  def(el, "__vnode", vnode, true);
8147
8331
  def(el, "__vueParentComponent", parentComponent, true);
8148
8332
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8149
- if (transition) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
8150
- else hostInsert(el, container, anchor);
8333
+ if (transition) {
8334
+ if (!needTransition(parentSuspense, transition) && !transition.persisted) el[deferredEnterKey] = true;
8335
+ performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense);
8336
+ } else hostInsert(el, container, anchor);
8151
8337
  if ((vnodeHook = props && props.onVnodeMounted) || dirs) {
8152
8338
  const isHmr = isHmrUpdating;
8153
8339
  queuePostRenderEffect(() => {
@@ -8412,16 +8598,20 @@ var Vue = (function() {
8412
8598
  } else {
8413
8599
  let { next, bu, u, parent, vnode } = instance;
8414
8600
  {
8415
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
8416
- if (nonHydratedAsyncRoot) {
8601
+ const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
8602
+ if (unresolvedAsyncRoot) {
8417
8603
  if (next) {
8418
8604
  next.el = vnode.el;
8419
8605
  updateComponentPreRender(instance, next, optimized);
8420
8606
  }
8421
- nonHydratedAsyncRoot.asyncDep.then(() => {
8422
- queuePostRenderEffect(() => {
8423
- if (!instance.isUnmounted) instance.update();
8424
- }, void 0, parentSuspense);
8607
+ unresolvedAsyncRoot.asyncDep.then(() => {
8608
+ const retry = () => {
8609
+ if (instance.effect.flags & 1024) return;
8610
+ if (parentSuspense && parentSuspense.pendingBranch) queuePostRenderEffect(retry, void 0, parentSuspense);
8611
+ else instance.update();
8612
+ };
8613
+ retry.flags = 24;
8614
+ queuePostRenderEffect(retry, void 0, parentSuspense);
8425
8615
  });
8426
8616
  return;
8427
8617
  }
@@ -8445,7 +8635,7 @@ var Vue = (function() {
8445
8635
  const prevTree = instance.subTree;
8446
8636
  instance.subTree = nextTree;
8447
8637
  startMeasure(instance, `patch`);
8448
- patch(prevTree, nextTree, hostParentNode(prevTree.el), getNextHostNode(prevTree), instance, parentSuspense, namespace);
8638
+ patch(prevTree, nextTree, hostParentNode(prevTree.el || resolveAsyncComponentPlaceholder(prevTree)), getNextHostNode(prevTree), instance, parentSuspense, namespace);
8449
8639
  endMeasure(instance, `patch`);
8450
8640
  next.el = nextTree.el;
8451
8641
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
@@ -8649,9 +8839,7 @@ var Vue = (function() {
8649
8839
  }
8650
8840
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
8651
8841
  if (shapeFlag & 256) {
8652
- if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
8653
- else parentComponent.ctx.deactivate(vnode);
8654
- return;
8842
+ if (parentComponent.ctx.deactivate(vnode)) return;
8655
8843
  }
8656
8844
  if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
8657
8845
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
@@ -8732,13 +8920,15 @@ var Vue = (function() {
8732
8920
  if (effect) {
8733
8921
  effect.stop();
8734
8922
  unmount(subTree, instance, parentSuspense, doRemove);
8735
- } else if (instance.vnode.el && subTree) {
8923
+ } else if (subTree) {
8736
8924
  subTree.transition = instance.vnode.transition;
8737
8925
  unmount(subTree, instance, parentSuspense, doRemove);
8738
8926
  }
8739
8927
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
8740
8928
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
8741
- queuePostRenderEffect(() => instance.isUnmounted = true, void 0, parentSuspense);
8929
+ const markUnmounted = () => instance.isUnmounted = true;
8930
+ markUnmounted.flags = 8;
8931
+ queuePostRenderEffect(markUnmounted, void 0, parentSuspense);
8742
8932
  devtoolsComponentRemoved(instance);
8743
8933
  };
8744
8934
  const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
@@ -8852,11 +9042,11 @@ var Vue = (function() {
8852
9042
  c2.el && (c2.el.__vnode = c2);
8853
9043
  }
8854
9044
  }
8855
- function locateNonHydratedAsyncRoot(instance) {
9045
+ function locateUnresolvedAsyncRoot(instance) {
8856
9046
  const subComponent = instance.subTree && instance.subTree.component;
8857
9047
  if (subComponent) {
8858
9048
  if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
8859
- else return locateNonHydratedAsyncRoot(subComponent);
9049
+ else return locateUnresolvedAsyncRoot(subComponent);
8860
9050
  }
8861
9051
  }
8862
9052
  function invalidateMount(hooks) {
@@ -8926,7 +9116,9 @@ var Vue = (function() {
8926
9116
  function resolveAsyncComponentPlaceholder(anchorVnode) {
8927
9117
  if (anchorVnode.placeholder) return anchorVnode.placeholder;
8928
9118
  const instance = anchorVnode.component;
8929
- if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
9119
+ if (instance && instance.subTree) return resolveAsyncComponentPlaceholder(instance.subTree);
9120
+ const suspense = anchorVnode.suspense;
9121
+ if (suspense && suspense.activeBranch) return resolveAsyncComponentPlaceholder(suspense.activeBranch);
8930
9122
  return null;
8931
9123
  }
8932
9124
  //#endregion
@@ -8938,17 +9130,22 @@ var Vue = (function() {
8938
9130
  return value;
8939
9131
  }
8940
9132
  let suspenseId = 0;
9133
+ const deferredEnterKey = Symbol("_deferredEnter");
8941
9134
  const Suspense = /*@__PURE__*/ withSuspenseEnabled({
8942
9135
  name: "Suspense",
8943
9136
  __isSuspense: true,
8944
9137
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
8945
9138
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
8946
9139
  else {
8947
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
8948
- n2.suspense = n1.suspense;
8949
- n2.suspense.vnode = n2;
8950
- n2.el = n1.el;
8951
- return;
9140
+ const suspense = n1.suspense;
9141
+ if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
9142
+ const owner = suspense.parentComponent;
9143
+ if (!!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId ? parentSuspense.pendingBranch && !isSameVNodeType(n2.ssContent, suspense.pendingBranch || suspense.activeBranch) : !suspense.isInFallback) {
9144
+ n2.suspense = suspense;
9145
+ suspense.vnode = n2;
9146
+ n2.el = n1.el;
9147
+ return;
9148
+ }
8952
9149
  }
8953
9150
  patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, rendererInternals);
8954
9151
  }
@@ -8960,6 +9157,36 @@ var Vue = (function() {
8960
9157
  const eventListener = vnode.props && vnode.props[name];
8961
9158
  if (isFunction(eventListener)) eventListener();
8962
9159
  }
9160
+ function enterDeferred(suspense, branch) {
9161
+ const enters = [];
9162
+ collectDeferredEnters(branch, enters, true);
9163
+ if (isVaporInteropEnabled) {
9164
+ const { parentComponent } = suspense;
9165
+ const vapor = parentComponent && parentComponent.appContext.vapor;
9166
+ if (vapor) vapor.enterDeferred(suspense, enters);
9167
+ }
9168
+ if (enters.length) queuePostFlushCb(enters);
9169
+ }
9170
+ function collectDeferredEnters(vnode, enters, isRoot) {
9171
+ const { el, transition, children, shapeFlag } = vnode;
9172
+ if (shapeFlag & 6) {
9173
+ const subTree = vnode.component.subTree;
9174
+ if (subTree) collectDeferredEnters(subTree, enters, isRoot);
9175
+ return;
9176
+ }
9177
+ if (shapeFlag & 192) return;
9178
+ if (shapeFlag & 1) {
9179
+ if (!isRoot && el && el[deferredEnterKey]) {
9180
+ el[deferredEnterKey] = void 0;
9181
+ if (transition && !transition.persisted) {
9182
+ transition.beforeEnter(el);
9183
+ enters.push(() => transition.enter(el));
9184
+ }
9185
+ }
9186
+ isRoot = false;
9187
+ }
9188
+ if (shapeFlag & 16) for (let i = 0; i < children.length; i++) collectDeferredEnters(children[i], enters, isRoot);
9189
+ }
8963
9190
  function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
8964
9191
  const { p: patch, o: { createElement } } = rendererInternals;
8965
9192
  const hiddenContainer = createElement("div");
@@ -8999,11 +9226,7 @@ var Vue = (function() {
8999
9226
  suspense.activeBranch = pendingBranch;
9000
9227
  } else unmount(pendingBranch, parentComponent, suspense);
9001
9228
  suspense.deps = 0;
9002
- for (let i = 0; i < suspense.effects.length; i++) {
9003
- const effect = suspense.effects[i];
9004
- if (effect.flags & 8) queuePostFlushCb(effect);
9005
- }
9006
- suspense.effects.length = 0;
9229
+ discardEffects(suspense);
9007
9230
  suspense.hiddenContainer = createElement("div");
9008
9231
  if (isInFallback) {
9009
9232
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
@@ -9026,14 +9249,14 @@ var Vue = (function() {
9026
9249
  } else {
9027
9250
  triggerEvent(n2, "onPending");
9028
9251
  suspense.pendingBranch = newBranch;
9029
- if (newBranch.shapeFlag & 512) suspense.pendingId = newBranch.component.suspenseId;
9030
- else suspense.pendingId = suspenseId++;
9252
+ suspense.pendingId = suspenseId++;
9031
9253
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
9032
9254
  if (suspense.deps <= 0) suspense.resolve();
9033
9255
  else {
9034
- const { timeout, pendingId } = suspense;
9035
- if (timeout > 0) setTimeout(() => {
9036
- if (suspense.pendingId === pendingId) suspense.fallback(newFallback);
9256
+ const { timeout } = suspense;
9257
+ if (timeout > 0) suspense.timeoutTimer = setTimeout(() => {
9258
+ suspense.timeoutTimer = void 0;
9259
+ suspense.fallback(suspense.vnode.ssFallback);
9037
9260
  }, timeout);
9038
9261
  else if (timeout === 0) suspense.fallback(newFallback);
9039
9262
  }
@@ -9069,6 +9292,7 @@ var Vue = (function() {
9069
9292
  deps: 0,
9070
9293
  pendingId: suspenseId++,
9071
9294
  timeout: typeof timeout === "number" ? timeout : -1,
9295
+ timeoutTimer: void 0,
9072
9296
  activeBranch: null,
9073
9297
  isFallbackMountPending: false,
9074
9298
  pendingBranch: null,
@@ -9086,26 +9310,39 @@ var Vue = (function() {
9086
9310
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
9087
9311
  let hasUpdatedAnchor = false;
9088
9312
  if (delayEnter) activeBranch.transition.afterLeave = () => {
9089
- if (pendingId === suspense.pendingId) {
9313
+ if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
9314
+ enterDeferred(suspense, pendingBranch);
9090
9315
  move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
9091
9316
  queuePostFlushCb(effects);
9092
9317
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
9093
9318
  }
9094
9319
  };
9095
9320
  if (activeBranch && !suspense.isFallbackMountPending) {
9096
- if (parentNode(activeBranch.el) === container) {
9321
+ if (parentNode(activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)) === container) {
9097
9322
  anchor = next(activeBranch);
9098
9323
  hasUpdatedAnchor = true;
9099
9324
  }
9100
9325
  unmount(activeBranch, parentComponent, suspense, true);
9101
9326
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
9102
9327
  }
9103
- if (!delayEnter) move(pendingBranch, container, anchor, 0, parentComponent);
9328
+ if (!delayEnter) {
9329
+ enterDeferred(suspense, pendingBranch);
9330
+ move(pendingBranch, container, anchor, 0, parentComponent);
9331
+ }
9104
9332
  }
9333
+ clearTimeout(suspense.timeoutTimer);
9334
+ suspense.timeoutTimer = void 0;
9105
9335
  suspense.isFallbackMountPending = false;
9106
9336
  setActiveBranch(suspense, pendingBranch);
9107
9337
  suspense.pendingBranch = null;
9108
9338
  suspense.isInFallback = false;
9339
+ let kept = 0;
9340
+ for (let i = 0; i < effects.length; i++) {
9341
+ const effect = effects[i];
9342
+ if (effect.flags & 16) queuePostFlushCb(effect);
9343
+ else effects[kept++] = effect;
9344
+ }
9345
+ effects.length = kept;
9109
9346
  let parent = suspense.parent;
9110
9347
  let hasUnresolvedAncestor = false;
9111
9348
  while (parent) {
@@ -9128,13 +9365,13 @@ var Vue = (function() {
9128
9365
  triggerEvent(vnode, "onResolve");
9129
9366
  },
9130
9367
  fallback(fallbackVNode) {
9131
- if (!suspense.pendingBranch) return;
9368
+ if (suspense.isUnmounted || !suspense.pendingBranch) return;
9132
9369
  const { vnode, activeBranch, parentComponent, container, namespace } = suspense;
9133
9370
  triggerEvent(vnode, "onFallback");
9134
9371
  const anchor = next(activeBranch);
9135
9372
  const mountFallback = () => {
9136
9373
  suspense.isFallbackMountPending = false;
9137
- if (!suspense.isInFallback) return;
9374
+ if (suspense.isUnmounted || !suspense.isInFallback) return;
9138
9375
  const latestFallback = suspense.vnode.ssFallback;
9139
9376
  patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
9140
9377
  setActiveBranch(suspense, latestFallback);
@@ -9158,24 +9395,52 @@ var Vue = (function() {
9158
9395
  registerDep(instance, onResolve) {
9159
9396
  const isInPendingSuspense = !!suspense.pendingBranch;
9160
9397
  if (isInPendingSuspense) suspense.deps++;
9398
+ const render = (setupResult) => {
9399
+ instance.asyncResolved = true;
9400
+ onResolve(setupResult);
9401
+ };
9161
9402
  instance.asyncDep.catch((err) => {
9162
- handleError(err, instance, 0);
9403
+ handleError(err, instance, 0, false, true);
9404
+ return () => null;
9163
9405
  }).then((asyncSetupResult) => {
9164
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
9406
+ if (instance.isUnmounted || suspense.isUnmounted) return;
9407
+ const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
9165
9408
  setCurrentInstance(null, void 0);
9166
9409
  if (!instance.scope.active) {
9167
- if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
9410
+ if (isPendingDep && --suspense.deps === 0) suspense.resolve();
9168
9411
  return;
9169
9412
  }
9170
- instance.asyncResolved = true;
9171
- onResolve(asyncSetupResult);
9172
- if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
9413
+ if (!isPendingDep && suspense.pendingBranch) {
9414
+ const job = () => {
9415
+ if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) return;
9416
+ if (suspense.pendingBranch) queueEffectWithSuspense(job, void 0, suspense);
9417
+ else render(asyncSetupResult);
9418
+ };
9419
+ job.flags = 24;
9420
+ queueEffectWithSuspense(job, void 0, suspense);
9421
+ return;
9422
+ }
9423
+ render(asyncSetupResult);
9424
+ if (isPendingDep && --suspense.deps === 0) suspense.resolve();
9173
9425
  });
9174
9426
  },
9175
9427
  unmount(parentSuspense, doRemove) {
9176
9428
  suspense.isUnmounted = true;
9429
+ clearTimeout(suspense.timeoutTimer);
9430
+ suspense.timeoutTimer = void 0;
9431
+ if (parentSuspenseId !== void 0) {
9432
+ const parent = suspense.parent;
9433
+ const pendingId = parentSuspenseId;
9434
+ parentSuspenseId = void 0;
9435
+ queuePostFlushCb(() => {
9436
+ if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) parent.resolve();
9437
+ });
9438
+ }
9177
9439
  if (suspense.activeBranch) unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);
9178
- if (suspense.pendingBranch) unmount(suspense.pendingBranch, parentComponent, parentSuspense, doRemove);
9440
+ if (suspense.pendingBranch) {
9441
+ unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
9442
+ discardEffects(suspense);
9443
+ }
9179
9444
  }
9180
9445
  };
9181
9446
  return suspense;
@@ -9216,6 +9481,14 @@ var Vue = (function() {
9216
9481
  if (block && !s.dynamicChildren) s.dynamicChildren = block.filter((c) => c !== s);
9217
9482
  return s;
9218
9483
  }
9484
+ function discardEffects(suspense) {
9485
+ const { effects } = suspense;
9486
+ for (let i = 0; i < effects.length; i++) {
9487
+ const effect = effects[i];
9488
+ if (effect.flags & 8) queuePostFlushCb(effect);
9489
+ }
9490
+ effects.length = 0;
9491
+ }
9219
9492
  function queueEffectWithSuspense(fn, id, suspense) {
9220
9493
  if (suspense && suspense.pendingBranch) {
9221
9494
  if (isArray(fn)) suspense.effects.push(...fn);
@@ -9483,7 +9756,8 @@ var Vue = (function() {
9483
9756
  }
9484
9757
  function guardReactiveProps(props) {
9485
9758
  if (!props) return null;
9486
- return /* @__PURE__ */ isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
9759
+ if (/* @__PURE__ */ isProxy(props)) return extend({}, props);
9760
+ return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
9487
9761
  }
9488
9762
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
9489
9763
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -9870,7 +10144,8 @@ var Vue = (function() {
9870
10144
  setInSSRSetupState(false);
9871
10145
  }
9872
10146
  }).catch((e) => {
9873
- handleError(e, instance, 0);
10147
+ handleError(e, instance, 0, void 0, true);
10148
+ instance.ssrRender = (_, push) => push("<!---->");
9874
10149
  });
9875
10150
  else {
9876
10151
  instance.asyncDep = setupResult;
@@ -9943,11 +10218,16 @@ var Vue = (function() {
9943
10218
  else warn$1(`Component is missing template or render function: `, Component);
9944
10219
  }
9945
10220
  }
10221
+ /**
10222
+ * Read through the setup context `attrs` proxy to get the raw attrs object.
10223
+ * @internal
10224
+ */
10225
+ const rawAttrsKey = Symbol();
9946
10226
  const attrsProxyHandlers = {
9947
10227
  get(target, key) {
9948
10228
  markAttrsAccessed();
9949
10229
  track(target, "get", "");
9950
- return target[key];
10230
+ return key === rawAttrsKey ? target : target[key];
9951
10231
  },
9952
10232
  set() {
9953
10233
  warn$1(`setupContext.attrs is readonly.`);
@@ -10245,7 +10525,7 @@ var Vue = (function() {
10245
10525
  }
10246
10526
  //#endregion
10247
10527
  //#region packages/runtime-core/src/index.ts
10248
- const version = "3.6.0-rc.14";
10528
+ const version = "3.6.0-rc.15";
10249
10529
  const warn = warn$1;
10250
10530
  /**
10251
10531
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -11111,7 +11391,7 @@ var Vue = (function() {
11111
11391
  }
11112
11392
  this._styleAnchors.delete(this._def);
11113
11393
  this._applyStyles(newStyles);
11114
- if (!this._instance.vapor) this._instance = null;
11394
+ this._instance = null;
11115
11395
  this._update();
11116
11396
  };
11117
11397
  const dispatch = (event, args) => {
@@ -11710,15 +11990,15 @@ var Vue = (function() {
11710
11990
  vModelSelectInit(el, value, number);
11711
11991
  el[assignKey] = getModelAssigner(vnode);
11712
11992
  },
11713
- mounted(el, { value }) {
11714
- vModelSetSelected(el, value);
11993
+ mounted(el, { value, modifiers: { number } }) {
11994
+ vModelSetSelected(el, value, number);
11715
11995
  },
11716
11996
  beforeUpdate(el, { value }, vnode) {
11717
11997
  el._modelValue = value;
11718
11998
  el[assignKey] = getModelAssigner(vnode);
11719
11999
  },
11720
- updated(el, { value }) {
11721
- vModelSetSelected(el, value);
12000
+ updated(el, { value, modifiers: { number } }) {
12001
+ vModelSetSelected(el, value, number);
11722
12002
  }
11723
12003
  };
11724
12004
  /**
@@ -11753,14 +12033,14 @@ var Vue = (function() {
11753
12033
  /**
11754
12034
  * @internal
11755
12035
  */
11756
- const vModelSetSelected = (el, value) => {
12036
+ const vModelSetSelected = (el, value, number = false) => {
11757
12037
  el._modelValue = value;
11758
12038
  const pending = el._pendingValue;
11759
12039
  el._pendingValue = void 0;
11760
12040
  if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
11761
- setSelected(el, value);
12041
+ setSelected(el, value, number);
11762
12042
  };
11763
- function setSelected(el, value) {
12043
+ function setSelected(el, value, number) {
11764
12044
  const isMultiple = el.multiple;
11765
12045
  const isArrayValue = isArray(value);
11766
12046
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -11775,7 +12055,7 @@ var Vue = (function() {
11775
12055
  const optionType = typeof optionValue;
11776
12056
  if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
11777
12057
  else option.selected = looseIndexOf(value, optionValue) > -1;
11778
- } else option.selected = value.has(optionValue);
12058
+ } else option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
11779
12059
  } else if (looseEqual(getValue(option), value)) {
11780
12060
  if (el.selectedIndex !== i) el.selectedIndex = i;
11781
12061
  return;
@@ -13979,7 +14259,11 @@ var Vue = (function() {
13979
14259
  };
13980
14260
  }
13981
14261
  function cloneLoc(loc) {
13982
- return getLoc(loc.start.offset, loc.end.offset);
14262
+ return {
14263
+ start: extend({}, loc.start),
14264
+ end: extend({}, loc.end),
14265
+ source: loc.source
14266
+ };
13983
14267
  }
13984
14268
  function setLocEnd(loc, end) {
13985
14269
  loc.end = tokenizer.getPos(end);