@vue/compat 3.5.10 → 3.5.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.10
2
+ * @vue/compat v3.5.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -683,8 +683,14 @@ class ReactiveEffect {
683
683
  }
684
684
  let batchDepth = 0;
685
685
  let batchedSub;
686
- function batch(sub) {
686
+ let batchedComputed;
687
+ function batch(sub, isComputed = false) {
687
688
  sub.flags |= 8;
689
+ if (isComputed) {
690
+ sub.next = batchedComputed;
691
+ batchedComputed = sub;
692
+ return;
693
+ }
688
694
  sub.next = batchedSub;
689
695
  batchedSub = sub;
690
696
  }
@@ -695,20 +701,22 @@ function endBatch() {
695
701
  if (--batchDepth > 0) {
696
702
  return;
697
703
  }
704
+ if (batchedComputed) {
705
+ let e = batchedComputed;
706
+ batchedComputed = void 0;
707
+ while (e) {
708
+ const next = e.next;
709
+ e.next = void 0;
710
+ e.flags &= ~8;
711
+ e = next;
712
+ }
713
+ }
698
714
  let error;
699
715
  while (batchedSub) {
700
716
  let e = batchedSub;
701
- let next;
702
- while (e) {
703
- if (!(e.flags & 1)) {
704
- e.flags &= ~8;
705
- }
706
- e = e.next;
707
- }
708
- e = batchedSub;
709
717
  batchedSub = void 0;
710
718
  while (e) {
711
- next = e.next;
719
+ const next = e.next;
712
720
  e.next = void 0;
713
721
  e.flags &= ~8;
714
722
  if (e.flags & 1) {
@@ -808,16 +816,16 @@ function removeSub(link, soft = false) {
808
816
  nextSub.prevSub = prevSub;
809
817
  link.nextSub = void 0;
810
818
  }
811
- if (dep.subs === link) {
812
- dep.subs = prevSub;
813
- }
814
819
  if (dep.subsHead === link) {
815
820
  dep.subsHead = nextSub;
816
821
  }
817
- if (!dep.subs && dep.computed) {
818
- dep.computed.flags &= ~4;
819
- for (let l = dep.computed.deps; l; l = l.nextDep) {
820
- removeSub(l, true);
822
+ if (dep.subs === link) {
823
+ dep.subs = prevSub;
824
+ if (!prevSub && dep.computed) {
825
+ dep.computed.flags &= ~4;
826
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
827
+ removeSub(l, true);
828
+ }
821
829
  }
822
830
  }
823
831
  if (!soft && !--dep.sc && dep.map) {
@@ -904,7 +912,6 @@ class Dep {
904
912
  /**
905
913
  * For object property deps cleanup
906
914
  */
907
- this.target = void 0;
908
915
  this.map = void 0;
909
916
  this.key = void 0;
910
917
  /**
@@ -1032,7 +1039,6 @@ function track(target, type, key) {
1032
1039
  let dep = depsMap.get(key);
1033
1040
  if (!dep) {
1034
1041
  depsMap.set(key, dep = new Dep());
1035
- dep.target = target;
1036
1042
  dep.map = depsMap;
1037
1043
  dep.key = key;
1038
1044
  }
@@ -1079,7 +1085,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
1079
1085
  }
1080
1086
  });
1081
1087
  } else {
1082
- if (key !== void 0) {
1088
+ if (key !== void 0 || depsMap.has(void 0)) {
1083
1089
  run(depsMap.get(key));
1084
1090
  }
1085
1091
  if (isArrayIndex) {
@@ -1454,117 +1460,6 @@ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true
1454
1460
 
1455
1461
  const toShallow = (value) => value;
1456
1462
  const getProto = (v) => Reflect.getPrototypeOf(v);
1457
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
1458
- target = target["__v_raw"];
1459
- const rawTarget = toRaw(target);
1460
- const rawKey = toRaw(key);
1461
- if (!isReadonly2) {
1462
- if (hasChanged(key, rawKey)) {
1463
- track(rawTarget, "get", key);
1464
- }
1465
- track(rawTarget, "get", rawKey);
1466
- }
1467
- const { has: has2 } = getProto(rawTarget);
1468
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1469
- if (has2.call(rawTarget, key)) {
1470
- return wrap(target.get(key));
1471
- } else if (has2.call(rawTarget, rawKey)) {
1472
- return wrap(target.get(rawKey));
1473
- } else if (target !== rawTarget) {
1474
- target.get(key);
1475
- }
1476
- }
1477
- function has(key, isReadonly2 = false) {
1478
- const target = this["__v_raw"];
1479
- const rawTarget = toRaw(target);
1480
- const rawKey = toRaw(key);
1481
- if (!isReadonly2) {
1482
- if (hasChanged(key, rawKey)) {
1483
- track(rawTarget, "has", key);
1484
- }
1485
- track(rawTarget, "has", rawKey);
1486
- }
1487
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1488
- }
1489
- function size(target, isReadonly2 = false) {
1490
- target = target["__v_raw"];
1491
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
1492
- return Reflect.get(target, "size", target);
1493
- }
1494
- function add(value, _isShallow = false) {
1495
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1496
- value = toRaw(value);
1497
- }
1498
- const target = toRaw(this);
1499
- const proto = getProto(target);
1500
- const hadKey = proto.has.call(target, value);
1501
- if (!hadKey) {
1502
- target.add(value);
1503
- trigger(target, "add", value, value);
1504
- }
1505
- return this;
1506
- }
1507
- function set(key, value, _isShallow = false) {
1508
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1509
- value = toRaw(value);
1510
- }
1511
- const target = toRaw(this);
1512
- const { has: has2, get: get2 } = getProto(target);
1513
- let hadKey = has2.call(target, key);
1514
- if (!hadKey) {
1515
- key = toRaw(key);
1516
- hadKey = has2.call(target, key);
1517
- } else {
1518
- checkIdentityKeys(target, has2, key);
1519
- }
1520
- const oldValue = get2.call(target, key);
1521
- target.set(key, value);
1522
- if (!hadKey) {
1523
- trigger(target, "add", key, value);
1524
- } else if (hasChanged(value, oldValue)) {
1525
- trigger(target, "set", key, value, oldValue);
1526
- }
1527
- return this;
1528
- }
1529
- function deleteEntry(key) {
1530
- const target = toRaw(this);
1531
- const { has: has2, get: get2 } = getProto(target);
1532
- let hadKey = has2.call(target, key);
1533
- if (!hadKey) {
1534
- key = toRaw(key);
1535
- hadKey = has2.call(target, key);
1536
- } else {
1537
- checkIdentityKeys(target, has2, key);
1538
- }
1539
- const oldValue = get2 ? get2.call(target, key) : void 0;
1540
- const result = target.delete(key);
1541
- if (hadKey) {
1542
- trigger(target, "delete", key, void 0, oldValue);
1543
- }
1544
- return result;
1545
- }
1546
- function clear() {
1547
- const target = toRaw(this);
1548
- const hadItems = target.size !== 0;
1549
- const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
1550
- const result = target.clear();
1551
- if (hadItems) {
1552
- trigger(target, "clear", void 0, void 0, oldTarget);
1553
- }
1554
- return result;
1555
- }
1556
- function createForEach(isReadonly2, isShallow2) {
1557
- return function forEach(callback, thisArg) {
1558
- const observed = this;
1559
- const target = observed["__v_raw"];
1560
- const rawTarget = toRaw(target);
1561
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1562
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
1563
- return target.forEach((value, key) => {
1564
- return callback.call(thisArg, wrap(value), wrap(key), observed);
1565
- });
1566
- };
1567
- }
1568
1463
  function createIterableMethod(method, isReadonly2, isShallow2) {
1569
1464
  return function(...args) {
1570
1465
  const target = this["__v_raw"];
@@ -1607,71 +1502,134 @@ function createReadonlyMethod(type) {
1607
1502
  return type === "delete" ? false : type === "clear" ? void 0 : this;
1608
1503
  };
1609
1504
  }
1610
- function createInstrumentations() {
1611
- const mutableInstrumentations2 = {
1612
- get(key) {
1613
- return get(this, key);
1614
- },
1615
- get size() {
1616
- return size(this);
1617
- },
1618
- has,
1619
- add,
1620
- set,
1621
- delete: deleteEntry,
1622
- clear,
1623
- forEach: createForEach(false, false)
1624
- };
1625
- const shallowInstrumentations2 = {
1505
+ function createInstrumentations(readonly, shallow) {
1506
+ const instrumentations = {
1626
1507
  get(key) {
1627
- return get(this, key, false, true);
1628
- },
1629
- get size() {
1630
- return size(this);
1631
- },
1632
- has,
1633
- add(value) {
1634
- return add.call(this, value, true);
1635
- },
1636
- set(key, value) {
1637
- return set.call(this, key, value, true);
1638
- },
1639
- delete: deleteEntry,
1640
- clear,
1641
- forEach: createForEach(false, true)
1642
- };
1643
- const readonlyInstrumentations2 = {
1644
- get(key) {
1645
- return get(this, key, true);
1646
- },
1647
- get size() {
1648
- return size(this, true);
1649
- },
1650
- has(key) {
1651
- return has.call(this, key, true);
1652
- },
1653
- add: createReadonlyMethod("add"),
1654
- set: createReadonlyMethod("set"),
1655
- delete: createReadonlyMethod("delete"),
1656
- clear: createReadonlyMethod("clear"),
1657
- forEach: createForEach(true, false)
1658
- };
1659
- const shallowReadonlyInstrumentations2 = {
1660
- get(key) {
1661
- return get(this, key, true, true);
1508
+ const target = this["__v_raw"];
1509
+ const rawTarget = toRaw(target);
1510
+ const rawKey = toRaw(key);
1511
+ if (!readonly) {
1512
+ if (hasChanged(key, rawKey)) {
1513
+ track(rawTarget, "get", key);
1514
+ }
1515
+ track(rawTarget, "get", rawKey);
1516
+ }
1517
+ const { has } = getProto(rawTarget);
1518
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1519
+ if (has.call(rawTarget, key)) {
1520
+ return wrap(target.get(key));
1521
+ } else if (has.call(rawTarget, rawKey)) {
1522
+ return wrap(target.get(rawKey));
1523
+ } else if (target !== rawTarget) {
1524
+ target.get(key);
1525
+ }
1662
1526
  },
1663
1527
  get size() {
1664
- return size(this, true);
1528
+ const target = this["__v_raw"];
1529
+ !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1530
+ return Reflect.get(target, "size", target);
1665
1531
  },
1666
1532
  has(key) {
1667
- return has.call(this, key, true);
1533
+ const target = this["__v_raw"];
1534
+ const rawTarget = toRaw(target);
1535
+ const rawKey = toRaw(key);
1536
+ if (!readonly) {
1537
+ if (hasChanged(key, rawKey)) {
1538
+ track(rawTarget, "has", key);
1539
+ }
1540
+ track(rawTarget, "has", rawKey);
1541
+ }
1542
+ return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1668
1543
  },
1669
- add: createReadonlyMethod("add"),
1670
- set: createReadonlyMethod("set"),
1671
- delete: createReadonlyMethod("delete"),
1672
- clear: createReadonlyMethod("clear"),
1673
- forEach: createForEach(true, true)
1544
+ forEach(callback, thisArg) {
1545
+ const observed = this;
1546
+ const target = observed["__v_raw"];
1547
+ const rawTarget = toRaw(target);
1548
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1549
+ !readonly && track(rawTarget, "iterate", ITERATE_KEY);
1550
+ return target.forEach((value, key) => {
1551
+ return callback.call(thisArg, wrap(value), wrap(key), observed);
1552
+ });
1553
+ }
1674
1554
  };
1555
+ extend(
1556
+ instrumentations,
1557
+ readonly ? {
1558
+ add: createReadonlyMethod("add"),
1559
+ set: createReadonlyMethod("set"),
1560
+ delete: createReadonlyMethod("delete"),
1561
+ clear: createReadonlyMethod("clear")
1562
+ } : {
1563
+ add(value) {
1564
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1565
+ value = toRaw(value);
1566
+ }
1567
+ const target = toRaw(this);
1568
+ const proto = getProto(target);
1569
+ const hadKey = proto.has.call(target, value);
1570
+ if (!hadKey) {
1571
+ target.add(value);
1572
+ trigger(target, "add", value, value);
1573
+ }
1574
+ return this;
1575
+ },
1576
+ set(key, value) {
1577
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1578
+ value = toRaw(value);
1579
+ }
1580
+ const target = toRaw(this);
1581
+ const { has, get } = getProto(target);
1582
+ let hadKey = has.call(target, key);
1583
+ if (!hadKey) {
1584
+ key = toRaw(key);
1585
+ hadKey = has.call(target, key);
1586
+ } else {
1587
+ checkIdentityKeys(target, has, key);
1588
+ }
1589
+ const oldValue = get.call(target, key);
1590
+ target.set(key, value);
1591
+ if (!hadKey) {
1592
+ trigger(target, "add", key, value);
1593
+ } else if (hasChanged(value, oldValue)) {
1594
+ trigger(target, "set", key, value, oldValue);
1595
+ }
1596
+ return this;
1597
+ },
1598
+ delete(key) {
1599
+ const target = toRaw(this);
1600
+ const { has, get } = getProto(target);
1601
+ let hadKey = has.call(target, key);
1602
+ if (!hadKey) {
1603
+ key = toRaw(key);
1604
+ hadKey = has.call(target, key);
1605
+ } else {
1606
+ checkIdentityKeys(target, has, key);
1607
+ }
1608
+ const oldValue = get ? get.call(target, key) : void 0;
1609
+ const result = target.delete(key);
1610
+ if (hadKey) {
1611
+ trigger(target, "delete", key, void 0, oldValue);
1612
+ }
1613
+ return result;
1614
+ },
1615
+ clear() {
1616
+ const target = toRaw(this);
1617
+ const hadItems = target.size !== 0;
1618
+ const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
1619
+ const result = target.clear();
1620
+ if (hadItems) {
1621
+ trigger(
1622
+ target,
1623
+ "clear",
1624
+ void 0,
1625
+ void 0,
1626
+ oldTarget
1627
+ );
1628
+ }
1629
+ return result;
1630
+ }
1631
+ }
1632
+ );
1675
1633
  const iteratorMethods = [
1676
1634
  "keys",
1677
1635
  "values",
@@ -1679,30 +1637,12 @@ function createInstrumentations() {
1679
1637
  Symbol.iterator
1680
1638
  ];
1681
1639
  iteratorMethods.forEach((method) => {
1682
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1683
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1684
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1685
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
1686
- method,
1687
- true,
1688
- true
1689
- );
1640
+ instrumentations[method] = createIterableMethod(method, readonly, shallow);
1690
1641
  });
1691
- return [
1692
- mutableInstrumentations2,
1693
- readonlyInstrumentations2,
1694
- shallowInstrumentations2,
1695
- shallowReadonlyInstrumentations2
1696
- ];
1642
+ return instrumentations;
1697
1643
  }
1698
- const [
1699
- mutableInstrumentations,
1700
- readonlyInstrumentations,
1701
- shallowInstrumentations,
1702
- shallowReadonlyInstrumentations
1703
- ] = /* @__PURE__ */ createInstrumentations();
1704
1644
  function createInstrumentationGetter(isReadonly2, shallow) {
1705
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
1645
+ const instrumentations = createInstrumentations(isReadonly2, shallow);
1706
1646
  return (target, key, receiver) => {
1707
1647
  if (key === "__v_isReactive") {
1708
1648
  return !isReadonly2;
@@ -1730,9 +1670,9 @@ const readonlyCollectionHandlers = {
1730
1670
  const shallowReadonlyCollectionHandlers = {
1731
1671
  get: /* @__PURE__ */ createInstrumentationGetter(true, true)
1732
1672
  };
1733
- function checkIdentityKeys(target, has2, key) {
1673
+ function checkIdentityKeys(target, has, key) {
1734
1674
  const rawKey = toRaw(key);
1735
- if (rawKey !== key && has2.call(target, rawKey)) {
1675
+ if (rawKey !== key && has.call(target, rawKey)) {
1736
1676
  const type = toRawType(target);
1737
1677
  warn$2(
1738
1678
  `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
@@ -2068,7 +2008,7 @@ class ComputedRefImpl {
2068
2008
  this.flags |= 16;
2069
2009
  if (!(this.flags & 8) && // avoid infinite self recursion
2070
2010
  activeSub !== this) {
2071
- batch(this);
2011
+ batch(this, true);
2072
2012
  return true;
2073
2013
  }
2074
2014
  }
@@ -2590,10 +2530,8 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
2590
2530
  }
2591
2531
  }
2592
2532
 
2593
- let isFlushing = false;
2594
- let isFlushPending = false;
2595
2533
  const queue = [];
2596
- let flushIndex = 0;
2534
+ let flushIndex = -1;
2597
2535
  const pendingPostFlushCbs = [];
2598
2536
  let activePostFlushCbs = null;
2599
2537
  let postFlushIndex = 0;
@@ -2605,7 +2543,7 @@ function nextTick(fn) {
2605
2543
  return fn ? p.then(this ? fn.bind(this) : fn) : p;
2606
2544
  }
2607
2545
  function findInsertionIndex(id) {
2608
- let start = isFlushing ? flushIndex + 1 : 0;
2546
+ let start = flushIndex + 1;
2609
2547
  let end = queue.length;
2610
2548
  while (start < end) {
2611
2549
  const middle = start + end >>> 1;
@@ -2634,8 +2572,7 @@ function queueJob(job) {
2634
2572
  }
2635
2573
  }
2636
2574
  function queueFlush() {
2637
- if (!isFlushing && !isFlushPending) {
2638
- isFlushPending = true;
2575
+ if (!currentFlushPromise) {
2639
2576
  currentFlushPromise = resolvedPromise.then(flushJobs);
2640
2577
  }
2641
2578
  }
@@ -2652,7 +2589,7 @@ function queuePostFlushCb(cb) {
2652
2589
  }
2653
2590
  queueFlush();
2654
2591
  }
2655
- function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
2592
+ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2656
2593
  {
2657
2594
  seen = seen || /* @__PURE__ */ new Map();
2658
2595
  }
@@ -2708,8 +2645,6 @@ function flushPostFlushCbs(seen) {
2708
2645
  }
2709
2646
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
2710
2647
  function flushJobs(seen) {
2711
- isFlushPending = false;
2712
- isFlushing = true;
2713
2648
  {
2714
2649
  seen = seen || /* @__PURE__ */ new Map();
2715
2650
  }
@@ -2741,10 +2676,9 @@ function flushJobs(seen) {
2741
2676
  job.flags &= ~1;
2742
2677
  }
2743
2678
  }
2744
- flushIndex = 0;
2679
+ flushIndex = -1;
2745
2680
  queue.length = 0;
2746
2681
  flushPostFlushCbs(seen);
2747
- isFlushing = false;
2748
2682
  currentFlushPromise = null;
2749
2683
  if (queue.length || pendingPostFlushCbs.length) {
2750
2684
  flushJobs(seen);
@@ -3692,7 +3626,7 @@ const TeleportImpl = {
3692
3626
  }
3693
3627
  if (!disabled) {
3694
3628
  mount(target, targetAnchor);
3695
- updateCssVars(n2);
3629
+ updateCssVars(n2, false);
3696
3630
  }
3697
3631
  } else if (!disabled) {
3698
3632
  warn$1(
@@ -3704,7 +3638,7 @@ const TeleportImpl = {
3704
3638
  };
3705
3639
  if (disabled) {
3706
3640
  mount(container, mainAnchor);
3707
- updateCssVars(n2);
3641
+ updateCssVars(n2, true);
3708
3642
  }
3709
3643
  if (isTeleportDeferred(n2.props)) {
3710
3644
  queuePostRenderEffect(mountToTarget, parentSuspense);
@@ -3794,7 +3728,7 @@ const TeleportImpl = {
3794
3728
  );
3795
3729
  }
3796
3730
  }
3797
- updateCssVars(n2);
3731
+ updateCssVars(n2, disabled);
3798
3732
  }
3799
3733
  },
3800
3734
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -3862,9 +3796,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3862
3796
  querySelector
3863
3797
  );
3864
3798
  if (target) {
3799
+ const disabled = isTeleportDisabled(vnode.props);
3865
3800
  const targetNode = target._lpa || target.firstChild;
3866
3801
  if (vnode.shapeFlag & 16) {
3867
- if (isTeleportDisabled(vnode.props)) {
3802
+ if (disabled) {
3868
3803
  vnode.anchor = hydrateChildren(
3869
3804
  nextSibling(node),
3870
3805
  vnode,
@@ -3905,16 +3840,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3905
3840
  );
3906
3841
  }
3907
3842
  }
3908
- updateCssVars(vnode);
3843
+ updateCssVars(vnode, disabled);
3909
3844
  }
3910
3845
  return vnode.anchor && nextSibling(vnode.anchor);
3911
3846
  }
3912
3847
  const Teleport = TeleportImpl;
3913
- function updateCssVars(vnode) {
3848
+ function updateCssVars(vnode, isDisabled) {
3914
3849
  const ctx = vnode.ctx;
3915
3850
  if (ctx && ctx.ut) {
3916
- let node = vnode.targetStart;
3917
- while (node && node !== vnode.targetAnchor) {
3851
+ let node, anchor;
3852
+ if (isDisabled) {
3853
+ node = vnode.el;
3854
+ anchor = vnode.anchor;
3855
+ } else {
3856
+ node = vnode.targetStart;
3857
+ anchor = vnode.targetAnchor;
3858
+ }
3859
+ while (node && node !== anchor) {
3918
3860
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
3919
3861
  node = node.nextSibling;
3920
3862
  }
@@ -4367,8 +4309,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4367
4309
  const setupState = owner.setupState;
4368
4310
  const rawSetupState = toRaw(setupState);
4369
4311
  const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
4370
- if (knownTemplateRefs.has(rawSetupState[key])) {
4371
- return false;
4312
+ {
4313
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4314
+ warn$1(
4315
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
4316
+ );
4317
+ }
4318
+ if (knownTemplateRefs.has(rawSetupState[key])) {
4319
+ return false;
4320
+ }
4372
4321
  }
4373
4322
  return hasOwn(rawSetupState, key);
4374
4323
  };
@@ -4665,7 +4614,11 @@ function createHydrationFunctions(rendererInternals) {
4665
4614
  }
4666
4615
  let needCallTransitionHooks = false;
4667
4616
  if (isTemplateNode(el)) {
4668
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4617
+ needCallTransitionHooks = needTransition(
4618
+ null,
4619
+ // no need check parentSuspense in hydration
4620
+ transition
4621
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4669
4622
  const content = el.content.firstChild;
4670
4623
  if (needCallTransitionHooks) {
4671
4624
  transition.beforeEnter(content);
@@ -5058,6 +5011,8 @@ function isMismatchAllowed(el, allowedType) {
5058
5011
  }
5059
5012
  }
5060
5013
 
5014
+ const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
5015
+ const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
5061
5016
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
5062
5017
  const id = requestIdleCallback(hydrate, { timeout });
5063
5018
  return () => cancelIdleCallback(id);
@@ -6051,12 +6006,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
6051
6006
  }
6052
6007
  openBlock();
6053
6008
  const validSlotContent = slot && ensureValidVNode(slot(props));
6009
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
6010
+ // key attached in the `createSlots` helper, respect that
6011
+ validSlotContent && validSlotContent.key;
6054
6012
  const rendered = createBlock(
6055
6013
  Fragment,
6056
6014
  {
6057
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
6058
- // key attached in the `createSlots` helper, respect that
6059
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
6015
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
6060
6016
  (!validSlotContent && fallback ? "_fb" : "")
6061
6017
  },
6062
6018
  validSlotContent || (fallback ? fallback() : []),
@@ -7225,7 +7181,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7225
7181
  return vm;
7226
7182
  }
7227
7183
  }
7228
- Vue.version = `2.6.14-compat:${"3.5.10"}`;
7184
+ Vue.version = `2.6.14-compat:${"3.5.12"}`;
7229
7185
  Vue.config = singletonApp.config;
7230
7186
  Vue.use = (plugin, ...options) => {
7231
7187
  if (plugin && isFunction(plugin.install)) {
@@ -8213,6 +8169,7 @@ function getType(ctor) {
8213
8169
  function validateProps(rawProps, props, instance) {
8214
8170
  const resolvedValues = toRaw(props);
8215
8171
  const options = instance.propsOptions[0];
8172
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
8216
8173
  for (const key in options) {
8217
8174
  let opt = options[key];
8218
8175
  if (opt == null) continue;
@@ -8221,7 +8178,7 @@ function validateProps(rawProps, props, instance) {
8221
8178
  resolvedValues[key],
8222
8179
  opt,
8223
8180
  shallowReadonly(resolvedValues) ,
8224
- !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
8181
+ !camelizePropsKey.includes(key)
8225
8182
  );
8226
8183
  }
8227
8184
  }
@@ -10035,14 +9992,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
10035
9992
  }
10036
9993
  const baseWatchOptions = extend({}, options);
10037
9994
  baseWatchOptions.onWarn = warn$1;
9995
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
10038
9996
  let ssrCleanup;
10039
9997
  if (isInSSRComponentSetup) {
10040
9998
  if (flush === "sync") {
10041
9999
  const ctx = useSSRContext();
10042
10000
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
10043
- } else if (!cb || immediate) {
10044
- baseWatchOptions.once = true;
10045
- } else {
10001
+ } else if (!runsImmediately) {
10046
10002
  const watchStopHandle = () => {
10047
10003
  };
10048
10004
  watchStopHandle.stop = NOOP;
@@ -10081,7 +10037,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
10081
10037
  }
10082
10038
  };
10083
10039
  const watchHandle = watch$1(source, cb, baseWatchOptions);
10084
- if (ssrCleanup) ssrCleanup.push(watchHandle);
10040
+ if (isInSSRComponentSetup) {
10041
+ if (ssrCleanup) {
10042
+ ssrCleanup.push(watchHandle);
10043
+ } else if (runsImmediately) {
10044
+ watchHandle();
10045
+ }
10046
+ }
10085
10047
  return watchHandle;
10086
10048
  }
10087
10049
  function instanceWatch(source, value, options) {
@@ -10116,19 +10078,19 @@ function useModel(props, name, options = EMPTY_OBJ) {
10116
10078
  warn$1(`useModel() called without active instance.`);
10117
10079
  return ref();
10118
10080
  }
10119
- if (!i.propsOptions[0][name]) {
10081
+ const camelizedName = camelize(name);
10082
+ if (!i.propsOptions[0][camelizedName]) {
10120
10083
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
10121
10084
  return ref();
10122
10085
  }
10123
- const camelizedName = camelize(name);
10124
10086
  const hyphenatedName = hyphenate(name);
10125
- const modifiers = getModelModifiers(props, name);
10087
+ const modifiers = getModelModifiers(props, camelizedName);
10126
10088
  const res = customRef((track, trigger) => {
10127
10089
  let localValue;
10128
10090
  let prevSetValue = EMPTY_OBJ;
10129
10091
  let prevEmittedValue;
10130
10092
  watchSyncEffect(() => {
10131
- const propValue = props[name];
10093
+ const propValue = props[camelizedName];
10132
10094
  if (hasChanged(localValue, propValue)) {
10133
10095
  localValue = propValue;
10134
10096
  trigger();
@@ -11850,9 +11812,9 @@ function setupStatefulComponent(instance, isSSR) {
11850
11812
  }
11851
11813
  const { setup } = Component;
11852
11814
  if (setup) {
11815
+ pauseTracking();
11853
11816
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
11854
11817
  const reset = setCurrentInstance(instance);
11855
- pauseTracking();
11856
11818
  const setupResult = callWithErrorHandling(
11857
11819
  setup,
11858
11820
  instance,
@@ -11862,10 +11824,13 @@ function setupStatefulComponent(instance, isSSR) {
11862
11824
  setupContext
11863
11825
  ]
11864
11826
  );
11827
+ const isAsyncSetup = isPromise(setupResult);
11865
11828
  resetTracking();
11866
11829
  reset();
11867
- if (isPromise(setupResult)) {
11868
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
11830
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
11831
+ markAsyncBoundary(instance);
11832
+ }
11833
+ if (isAsyncSetup) {
11869
11834
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
11870
11835
  if (isSSR) {
11871
11836
  return setupResult.then((resolvedResult) => {
@@ -12340,7 +12305,7 @@ function isMemoSame(cached, memo) {
12340
12305
  return true;
12341
12306
  }
12342
12307
 
12343
- const version = "3.5.10";
12308
+ const version = "3.5.12";
12344
12309
  const warn = warn$1 ;
12345
12310
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12346
12311
  const devtools = devtools$1 ;
@@ -12979,7 +12944,7 @@ function compatCoerceAttr(el, key, value, instance = null) {
12979
12944
  return false;
12980
12945
  }
12981
12946
 
12982
- function patchDOMProp(el, key, value, parentComponent) {
12947
+ function patchDOMProp(el, key, value, parentComponent, attrName) {
12983
12948
  if (key === "innerHTML" || key === "textContent") {
12984
12949
  if (value != null) {
12985
12950
  el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
@@ -13043,7 +13008,7 @@ function patchDOMProp(el, key, value, parentComponent) {
13043
13008
  );
13044
13009
  }
13045
13010
  }
13046
- needRemove && el.removeAttribute(key);
13011
+ needRemove && el.removeAttribute(attrName || key);
13047
13012
  }
13048
13013
 
13049
13014
  function addEventListener(el, event, handler, options) {
@@ -13153,7 +13118,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
13153
13118
  // #11081 force set props for possible async custom element
13154
13119
  el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
13155
13120
  ) {
13156
- patchDOMProp(el, camelize(key), nextValue, parentComponent);
13121
+ patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
13157
13122
  } else {
13158
13123
  if (key === "true-value") {
13159
13124
  el._trueValue = nextValue;
@@ -13880,7 +13845,7 @@ const vModelCheckbox = {
13880
13845
  setChecked(el, binding, vnode);
13881
13846
  }
13882
13847
  };
13883
- function setChecked(el, { value }, vnode) {
13848
+ function setChecked(el, { value, oldValue }, vnode) {
13884
13849
  el._modelValue = value;
13885
13850
  let checked;
13886
13851
  if (isArray(value)) {
@@ -13888,6 +13853,7 @@ function setChecked(el, { value }, vnode) {
13888
13853
  } else if (isSet(value)) {
13889
13854
  checked = value.has(vnode.props.value);
13890
13855
  } else {
13856
+ if (value === oldValue) return;
13891
13857
  checked = looseEqual(value, getCheckboxValue(el, true));
13892
13858
  }
13893
13859
  if (el.checked !== checked) {
@@ -17023,6 +16989,9 @@ function getLoc(start, end) {
17023
16989
  source: end == null ? end : getSlice(start, end)
17024
16990
  };
17025
16991
  }
16992
+ function cloneLoc(loc) {
16993
+ return getLoc(loc.start.offset, loc.end.offset);
16994
+ }
17026
16995
  function setLocEnd(loc, end) {
17027
16996
  loc.end = tokenizer.getPos(end);
17028
16997
  loc.source = getSlice(loc.start.offset, end);
@@ -18785,7 +18754,7 @@ function processIf(node, dir, context, processCodegen) {
18785
18754
  const branch = createIfBranch(node, dir);
18786
18755
  const ifNode = {
18787
18756
  type: 9,
18788
- loc: node.loc,
18757
+ loc: cloneLoc(node.loc),
18789
18758
  branches: [branch]
18790
18759
  };
18791
18760
  context.replaceNode(ifNode);
@@ -21302,7 +21271,7 @@ function analyzeNode(node) {
21302
21271
  if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) {
21303
21272
  return bail();
21304
21273
  }
21305
- if (isOptionTag && isStaticArgOf(p.arg, "value") && p.exp && p.exp.ast && p.exp.ast.type !== "StringLiteral") {
21274
+ if (isOptionTag && isStaticArgOf(p.arg, "value") && p.exp && !p.exp.isStatic) {
21306
21275
  return bail();
21307
21276
  }
21308
21277
  }