@vue/compat 3.5.11 → 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.11
2
+ * @vue/compat v3.5.12
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -763,16 +763,16 @@ function removeSub(link, soft = false) {
763
763
  nextSub.prevSub = prevSub;
764
764
  link.nextSub = void 0;
765
765
  }
766
- if (dep.subs === link) {
767
- dep.subs = prevSub;
768
- }
769
766
  if (!!(process.env.NODE_ENV !== "production") && dep.subsHead === link) {
770
767
  dep.subsHead = nextSub;
771
768
  }
772
- if (!dep.subs && dep.computed) {
773
- dep.computed.flags &= ~4;
774
- for (let l = dep.computed.deps; l; l = l.nextDep) {
775
- removeSub(l, true);
769
+ if (dep.subs === link) {
770
+ dep.subs = prevSub;
771
+ if (!prevSub && dep.computed) {
772
+ dep.computed.flags &= ~4;
773
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
774
+ removeSub(l, true);
775
+ }
776
776
  }
777
777
  }
778
778
  if (!soft && !--dep.sc && dep.map) {
@@ -1036,7 +1036,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
1036
1036
  }
1037
1037
  });
1038
1038
  } else {
1039
- if (key !== void 0) {
1039
+ if (key !== void 0 || depsMap.has(void 0)) {
1040
1040
  run(depsMap.get(key));
1041
1041
  }
1042
1042
  if (isArrayIndex) {
@@ -1411,117 +1411,6 @@ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true
1411
1411
 
1412
1412
  const toShallow = (value) => value;
1413
1413
  const getProto = (v) => Reflect.getPrototypeOf(v);
1414
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
1415
- target = target["__v_raw"];
1416
- const rawTarget = toRaw(target);
1417
- const rawKey = toRaw(key);
1418
- if (!isReadonly2) {
1419
- if (hasChanged(key, rawKey)) {
1420
- track(rawTarget, "get", key);
1421
- }
1422
- track(rawTarget, "get", rawKey);
1423
- }
1424
- const { has: has2 } = getProto(rawTarget);
1425
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1426
- if (has2.call(rawTarget, key)) {
1427
- return wrap(target.get(key));
1428
- } else if (has2.call(rawTarget, rawKey)) {
1429
- return wrap(target.get(rawKey));
1430
- } else if (target !== rawTarget) {
1431
- target.get(key);
1432
- }
1433
- }
1434
- function has(key, isReadonly2 = false) {
1435
- const target = this["__v_raw"];
1436
- const rawTarget = toRaw(target);
1437
- const rawKey = toRaw(key);
1438
- if (!isReadonly2) {
1439
- if (hasChanged(key, rawKey)) {
1440
- track(rawTarget, "has", key);
1441
- }
1442
- track(rawTarget, "has", rawKey);
1443
- }
1444
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1445
- }
1446
- function size(target, isReadonly2 = false) {
1447
- target = target["__v_raw"];
1448
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
1449
- return Reflect.get(target, "size", target);
1450
- }
1451
- function add(value, _isShallow = false) {
1452
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1453
- value = toRaw(value);
1454
- }
1455
- const target = toRaw(this);
1456
- const proto = getProto(target);
1457
- const hadKey = proto.has.call(target, value);
1458
- if (!hadKey) {
1459
- target.add(value);
1460
- trigger(target, "add", value, value);
1461
- }
1462
- return this;
1463
- }
1464
- function set(key, value, _isShallow = false) {
1465
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1466
- value = toRaw(value);
1467
- }
1468
- const target = toRaw(this);
1469
- const { has: has2, get: get2 } = getProto(target);
1470
- let hadKey = has2.call(target, key);
1471
- if (!hadKey) {
1472
- key = toRaw(key);
1473
- hadKey = has2.call(target, key);
1474
- } else if (!!(process.env.NODE_ENV !== "production")) {
1475
- checkIdentityKeys(target, has2, key);
1476
- }
1477
- const oldValue = get2.call(target, key);
1478
- target.set(key, value);
1479
- if (!hadKey) {
1480
- trigger(target, "add", key, value);
1481
- } else if (hasChanged(value, oldValue)) {
1482
- trigger(target, "set", key, value, oldValue);
1483
- }
1484
- return this;
1485
- }
1486
- function deleteEntry(key) {
1487
- const target = toRaw(this);
1488
- const { has: has2, get: get2 } = getProto(target);
1489
- let hadKey = has2.call(target, key);
1490
- if (!hadKey) {
1491
- key = toRaw(key);
1492
- hadKey = has2.call(target, key);
1493
- } else if (!!(process.env.NODE_ENV !== "production")) {
1494
- checkIdentityKeys(target, has2, key);
1495
- }
1496
- const oldValue = get2 ? get2.call(target, key) : void 0;
1497
- const result = target.delete(key);
1498
- if (hadKey) {
1499
- trigger(target, "delete", key, void 0, oldValue);
1500
- }
1501
- return result;
1502
- }
1503
- function clear() {
1504
- const target = toRaw(this);
1505
- const hadItems = target.size !== 0;
1506
- const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
1507
- const result = target.clear();
1508
- if (hadItems) {
1509
- trigger(target, "clear", void 0, void 0, oldTarget);
1510
- }
1511
- return result;
1512
- }
1513
- function createForEach(isReadonly2, isShallow2) {
1514
- return function forEach(callback, thisArg) {
1515
- const observed = this;
1516
- const target = observed["__v_raw"];
1517
- const rawTarget = toRaw(target);
1518
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1519
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
1520
- return target.forEach((value, key) => {
1521
- return callback.call(thisArg, wrap(value), wrap(key), observed);
1522
- });
1523
- };
1524
- }
1525
1414
  function createIterableMethod(method, isReadonly2, isShallow2) {
1526
1415
  return function(...args) {
1527
1416
  const target = this["__v_raw"];
@@ -1564,71 +1453,134 @@ function createReadonlyMethod(type) {
1564
1453
  return type === "delete" ? false : type === "clear" ? void 0 : this;
1565
1454
  };
1566
1455
  }
1567
- function createInstrumentations() {
1568
- const mutableInstrumentations2 = {
1569
- get(key) {
1570
- return get(this, key);
1571
- },
1572
- get size() {
1573
- return size(this);
1574
- },
1575
- has,
1576
- add,
1577
- set,
1578
- delete: deleteEntry,
1579
- clear,
1580
- forEach: createForEach(false, false)
1581
- };
1582
- const shallowInstrumentations2 = {
1583
- get(key) {
1584
- return get(this, key, false, true);
1585
- },
1586
- get size() {
1587
- return size(this);
1588
- },
1589
- has,
1590
- add(value) {
1591
- return add.call(this, value, true);
1592
- },
1593
- set(key, value) {
1594
- return set.call(this, key, value, true);
1595
- },
1596
- delete: deleteEntry,
1597
- clear,
1598
- forEach: createForEach(false, true)
1599
- };
1600
- const readonlyInstrumentations2 = {
1601
- get(key) {
1602
- return get(this, key, true);
1603
- },
1604
- get size() {
1605
- return size(this, true);
1606
- },
1607
- has(key) {
1608
- return has.call(this, key, true);
1609
- },
1610
- add: createReadonlyMethod("add"),
1611
- set: createReadonlyMethod("set"),
1612
- delete: createReadonlyMethod("delete"),
1613
- clear: createReadonlyMethod("clear"),
1614
- forEach: createForEach(true, false)
1615
- };
1616
- const shallowReadonlyInstrumentations2 = {
1456
+ function createInstrumentations(readonly, shallow) {
1457
+ const instrumentations = {
1617
1458
  get(key) {
1618
- return get(this, key, true, true);
1459
+ const target = this["__v_raw"];
1460
+ const rawTarget = toRaw(target);
1461
+ const rawKey = toRaw(key);
1462
+ if (!readonly) {
1463
+ if (hasChanged(key, rawKey)) {
1464
+ track(rawTarget, "get", key);
1465
+ }
1466
+ track(rawTarget, "get", rawKey);
1467
+ }
1468
+ const { has } = getProto(rawTarget);
1469
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1470
+ if (has.call(rawTarget, key)) {
1471
+ return wrap(target.get(key));
1472
+ } else if (has.call(rawTarget, rawKey)) {
1473
+ return wrap(target.get(rawKey));
1474
+ } else if (target !== rawTarget) {
1475
+ target.get(key);
1476
+ }
1619
1477
  },
1620
1478
  get size() {
1621
- return size(this, true);
1479
+ const target = this["__v_raw"];
1480
+ !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1481
+ return Reflect.get(target, "size", target);
1622
1482
  },
1623
1483
  has(key) {
1624
- return has.call(this, key, true);
1484
+ const target = this["__v_raw"];
1485
+ const rawTarget = toRaw(target);
1486
+ const rawKey = toRaw(key);
1487
+ if (!readonly) {
1488
+ if (hasChanged(key, rawKey)) {
1489
+ track(rawTarget, "has", key);
1490
+ }
1491
+ track(rawTarget, "has", rawKey);
1492
+ }
1493
+ return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1625
1494
  },
1626
- add: createReadonlyMethod("add"),
1627
- set: createReadonlyMethod("set"),
1628
- delete: createReadonlyMethod("delete"),
1629
- clear: createReadonlyMethod("clear"),
1630
- forEach: createForEach(true, true)
1495
+ forEach(callback, thisArg) {
1496
+ const observed = this;
1497
+ const target = observed["__v_raw"];
1498
+ const rawTarget = toRaw(target);
1499
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1500
+ !readonly && track(rawTarget, "iterate", ITERATE_KEY);
1501
+ return target.forEach((value, key) => {
1502
+ return callback.call(thisArg, wrap(value), wrap(key), observed);
1503
+ });
1504
+ }
1631
1505
  };
1506
+ extend(
1507
+ instrumentations,
1508
+ readonly ? {
1509
+ add: createReadonlyMethod("add"),
1510
+ set: createReadonlyMethod("set"),
1511
+ delete: createReadonlyMethod("delete"),
1512
+ clear: createReadonlyMethod("clear")
1513
+ } : {
1514
+ add(value) {
1515
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1516
+ value = toRaw(value);
1517
+ }
1518
+ const target = toRaw(this);
1519
+ const proto = getProto(target);
1520
+ const hadKey = proto.has.call(target, value);
1521
+ if (!hadKey) {
1522
+ target.add(value);
1523
+ trigger(target, "add", value, value);
1524
+ }
1525
+ return this;
1526
+ },
1527
+ set(key, value) {
1528
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1529
+ value = toRaw(value);
1530
+ }
1531
+ const target = toRaw(this);
1532
+ const { has, get } = getProto(target);
1533
+ let hadKey = has.call(target, key);
1534
+ if (!hadKey) {
1535
+ key = toRaw(key);
1536
+ hadKey = has.call(target, key);
1537
+ } else if (!!(process.env.NODE_ENV !== "production")) {
1538
+ checkIdentityKeys(target, has, key);
1539
+ }
1540
+ const oldValue = get.call(target, key);
1541
+ target.set(key, value);
1542
+ if (!hadKey) {
1543
+ trigger(target, "add", key, value);
1544
+ } else if (hasChanged(value, oldValue)) {
1545
+ trigger(target, "set", key, value, oldValue);
1546
+ }
1547
+ return this;
1548
+ },
1549
+ delete(key) {
1550
+ const target = toRaw(this);
1551
+ const { has, get } = getProto(target);
1552
+ let hadKey = has.call(target, key);
1553
+ if (!hadKey) {
1554
+ key = toRaw(key);
1555
+ hadKey = has.call(target, key);
1556
+ } else if (!!(process.env.NODE_ENV !== "production")) {
1557
+ checkIdentityKeys(target, has, key);
1558
+ }
1559
+ const oldValue = get ? get.call(target, key) : void 0;
1560
+ const result = target.delete(key);
1561
+ if (hadKey) {
1562
+ trigger(target, "delete", key, void 0, oldValue);
1563
+ }
1564
+ return result;
1565
+ },
1566
+ clear() {
1567
+ const target = toRaw(this);
1568
+ const hadItems = target.size !== 0;
1569
+ const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
1570
+ const result = target.clear();
1571
+ if (hadItems) {
1572
+ trigger(
1573
+ target,
1574
+ "clear",
1575
+ void 0,
1576
+ void 0,
1577
+ oldTarget
1578
+ );
1579
+ }
1580
+ return result;
1581
+ }
1582
+ }
1583
+ );
1632
1584
  const iteratorMethods = [
1633
1585
  "keys",
1634
1586
  "values",
@@ -1636,30 +1588,12 @@ function createInstrumentations() {
1636
1588
  Symbol.iterator
1637
1589
  ];
1638
1590
  iteratorMethods.forEach((method) => {
1639
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1640
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1641
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1642
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
1643
- method,
1644
- true,
1645
- true
1646
- );
1591
+ instrumentations[method] = createIterableMethod(method, readonly, shallow);
1647
1592
  });
1648
- return [
1649
- mutableInstrumentations2,
1650
- readonlyInstrumentations2,
1651
- shallowInstrumentations2,
1652
- shallowReadonlyInstrumentations2
1653
- ];
1593
+ return instrumentations;
1654
1594
  }
1655
- const [
1656
- mutableInstrumentations,
1657
- readonlyInstrumentations,
1658
- shallowInstrumentations,
1659
- shallowReadonlyInstrumentations
1660
- ] = /* @__PURE__ */ createInstrumentations();
1661
1595
  function createInstrumentationGetter(isReadonly2, shallow) {
1662
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
1596
+ const instrumentations = createInstrumentations(isReadonly2, shallow);
1663
1597
  return (target, key, receiver) => {
1664
1598
  if (key === "__v_isReactive") {
1665
1599
  return !isReadonly2;
@@ -1687,9 +1621,9 @@ const readonlyCollectionHandlers = {
1687
1621
  const shallowReadonlyCollectionHandlers = {
1688
1622
  get: /* @__PURE__ */ createInstrumentationGetter(true, true)
1689
1623
  };
1690
- function checkIdentityKeys(target, has2, key) {
1624
+ function checkIdentityKeys(target, has, key) {
1691
1625
  const rawKey = toRaw(key);
1692
- if (rawKey !== key && has2.call(target, rawKey)) {
1626
+ if (rawKey !== key && has.call(target, rawKey)) {
1693
1627
  const type = toRawType(target);
1694
1628
  warn$2(
1695
1629
  `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.`
@@ -3657,7 +3591,7 @@ const TeleportImpl = {
3657
3591
  }
3658
3592
  if (!disabled) {
3659
3593
  mount(target, targetAnchor);
3660
- updateCssVars(n2);
3594
+ updateCssVars(n2, false);
3661
3595
  }
3662
3596
  } else if (!!(process.env.NODE_ENV !== "production") && !disabled) {
3663
3597
  warn$1(
@@ -3669,7 +3603,7 @@ const TeleportImpl = {
3669
3603
  };
3670
3604
  if (disabled) {
3671
3605
  mount(container, mainAnchor);
3672
- updateCssVars(n2);
3606
+ updateCssVars(n2, true);
3673
3607
  }
3674
3608
  if (isTeleportDeferred(n2.props)) {
3675
3609
  queuePostRenderEffect(mountToTarget, parentSuspense);
@@ -3759,7 +3693,7 @@ const TeleportImpl = {
3759
3693
  );
3760
3694
  }
3761
3695
  }
3762
- updateCssVars(n2);
3696
+ updateCssVars(n2, disabled);
3763
3697
  }
3764
3698
  },
3765
3699
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -3827,9 +3761,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3827
3761
  querySelector
3828
3762
  );
3829
3763
  if (target) {
3764
+ const disabled = isTeleportDisabled(vnode.props);
3830
3765
  const targetNode = target._lpa || target.firstChild;
3831
3766
  if (vnode.shapeFlag & 16) {
3832
- if (isTeleportDisabled(vnode.props)) {
3767
+ if (disabled) {
3833
3768
  vnode.anchor = hydrateChildren(
3834
3769
  nextSibling(node),
3835
3770
  vnode,
@@ -3870,16 +3805,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3870
3805
  );
3871
3806
  }
3872
3807
  }
3873
- updateCssVars(vnode);
3808
+ updateCssVars(vnode, disabled);
3874
3809
  }
3875
3810
  return vnode.anchor && nextSibling(vnode.anchor);
3876
3811
  }
3877
3812
  const Teleport = TeleportImpl;
3878
- function updateCssVars(vnode) {
3813
+ function updateCssVars(vnode, isDisabled) {
3879
3814
  const ctx = vnode.ctx;
3880
3815
  if (ctx && ctx.ut) {
3881
- let node = vnode.targetStart;
3882
- while (node && node !== vnode.targetAnchor) {
3816
+ let node, anchor;
3817
+ if (isDisabled) {
3818
+ node = vnode.el;
3819
+ anchor = vnode.anchor;
3820
+ } else {
3821
+ node = vnode.targetStart;
3822
+ anchor = vnode.targetAnchor;
3823
+ }
3824
+ while (node && node !== anchor) {
3883
3825
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
3884
3826
  node = node.nextSibling;
3885
3827
  }
@@ -4333,8 +4275,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4333
4275
  const setupState = owner.setupState;
4334
4276
  const rawSetupState = toRaw(setupState);
4335
4277
  const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
4336
- if (!!(process.env.NODE_ENV !== "production") && knownTemplateRefs.has(rawSetupState[key])) {
4337
- return false;
4278
+ if (!!(process.env.NODE_ENV !== "production")) {
4279
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4280
+ warn$1(
4281
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
4282
+ );
4283
+ }
4284
+ if (knownTemplateRefs.has(rawSetupState[key])) {
4285
+ return false;
4286
+ }
4338
4287
  }
4339
4288
  return hasOwn(rawSetupState, key);
4340
4289
  };
@@ -4631,7 +4580,11 @@ function createHydrationFunctions(rendererInternals) {
4631
4580
  }
4632
4581
  let needCallTransitionHooks = false;
4633
4582
  if (isTemplateNode(el)) {
4634
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4583
+ needCallTransitionHooks = needTransition(
4584
+ null,
4585
+ // no need check parentSuspense in hydration
4586
+ transition
4587
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4635
4588
  const content = el.content.firstChild;
4636
4589
  if (needCallTransitionHooks) {
4637
4590
  transition.beforeEnter(content);
@@ -5035,6 +4988,8 @@ function isMismatchAllowed(el, allowedType) {
5035
4988
  }
5036
4989
  }
5037
4990
 
4991
+ const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
4992
+ const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
5038
4993
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
5039
4994
  const id = requestIdleCallback(hydrate, { timeout });
5040
4995
  return () => cancelIdleCallback(id);
@@ -6028,12 +5983,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
6028
5983
  }
6029
5984
  openBlock();
6030
5985
  const validSlotContent = slot && ensureValidVNode(slot(props));
5986
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5987
+ // key attached in the `createSlots` helper, respect that
5988
+ validSlotContent && validSlotContent.key;
6031
5989
  const rendered = createBlock(
6032
5990
  Fragment,
6033
5991
  {
6034
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
6035
- // key attached in the `createSlots` helper, respect that
6036
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
5992
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
6037
5993
  (!validSlotContent && fallback ? "_fb" : "")
6038
5994
  },
6039
5995
  validSlotContent || (fallback ? fallback() : []),
@@ -7204,7 +7160,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7204
7160
  return vm;
7205
7161
  }
7206
7162
  }
7207
- Vue.version = `2.6.14-compat:${"3.5.11"}`;
7163
+ Vue.version = `2.6.14-compat:${"3.5.12"}`;
7208
7164
  Vue.config = singletonApp.config;
7209
7165
  Vue.use = (plugin, ...options) => {
7210
7166
  if (plugin && isFunction(plugin.install)) {
@@ -8194,6 +8150,7 @@ function getType(ctor) {
8194
8150
  function validateProps(rawProps, props, instance) {
8195
8151
  const resolvedValues = toRaw(props);
8196
8152
  const options = instance.propsOptions[0];
8153
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
8197
8154
  for (const key in options) {
8198
8155
  let opt = options[key];
8199
8156
  if (opt == null) continue;
@@ -8202,7 +8159,7 @@ function validateProps(rawProps, props, instance) {
8202
8159
  resolvedValues[key],
8203
8160
  opt,
8204
8161
  !!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues,
8205
- !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
8162
+ !camelizePropsKey.includes(key)
8206
8163
  );
8207
8164
  }
8208
8165
  }
@@ -10054,14 +10011,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
10054
10011
  }
10055
10012
  const baseWatchOptions = extend({}, options);
10056
10013
  if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
10014
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
10057
10015
  let ssrCleanup;
10058
10016
  if (isInSSRComponentSetup) {
10059
10017
  if (flush === "sync") {
10060
10018
  const ctx = useSSRContext();
10061
10019
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
10062
- } else if (!cb || immediate) {
10063
- baseWatchOptions.once = true;
10064
- } else {
10020
+ } else if (!runsImmediately) {
10065
10021
  const watchStopHandle = () => {
10066
10022
  };
10067
10023
  watchStopHandle.stop = NOOP;
@@ -10100,7 +10056,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
10100
10056
  }
10101
10057
  };
10102
10058
  const watchHandle = watch$1(source, cb, baseWatchOptions);
10103
- if (ssrCleanup) ssrCleanup.push(watchHandle);
10059
+ if (isInSSRComponentSetup) {
10060
+ if (ssrCleanup) {
10061
+ ssrCleanup.push(watchHandle);
10062
+ } else if (runsImmediately) {
10063
+ watchHandle();
10064
+ }
10065
+ }
10104
10066
  return watchHandle;
10105
10067
  }
10106
10068
  function instanceWatch(source, value, options) {
@@ -10135,19 +10097,19 @@ function useModel(props, name, options = EMPTY_OBJ) {
10135
10097
  warn$1(`useModel() called without active instance.`);
10136
10098
  return ref();
10137
10099
  }
10138
- if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
10100
+ const camelizedName = camelize(name);
10101
+ if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][camelizedName]) {
10139
10102
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
10140
10103
  return ref();
10141
10104
  }
10142
- const camelizedName = camelize(name);
10143
10105
  const hyphenatedName = hyphenate(name);
10144
- const modifiers = getModelModifiers(props, name);
10106
+ const modifiers = getModelModifiers(props, camelizedName);
10145
10107
  const res = customRef((track, trigger) => {
10146
10108
  let localValue;
10147
10109
  let prevSetValue = EMPTY_OBJ;
10148
10110
  let prevEmittedValue;
10149
10111
  watchSyncEffect(() => {
10150
- const propValue = props[name];
10112
+ const propValue = props[camelizedName];
10151
10113
  if (hasChanged(localValue, propValue)) {
10152
10114
  localValue = propValue;
10153
10115
  trigger();
@@ -11871,9 +11833,9 @@ function setupStatefulComponent(instance, isSSR) {
11871
11833
  }
11872
11834
  const { setup } = Component;
11873
11835
  if (setup) {
11836
+ pauseTracking();
11874
11837
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
11875
11838
  const reset = setCurrentInstance(instance);
11876
- pauseTracking();
11877
11839
  const setupResult = callWithErrorHandling(
11878
11840
  setup,
11879
11841
  instance,
@@ -11883,10 +11845,13 @@ function setupStatefulComponent(instance, isSSR) {
11883
11845
  setupContext
11884
11846
  ]
11885
11847
  );
11848
+ const isAsyncSetup = isPromise(setupResult);
11886
11849
  resetTracking();
11887
11850
  reset();
11888
- if (isPromise(setupResult)) {
11889
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
11851
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
11852
+ markAsyncBoundary(instance);
11853
+ }
11854
+ if (isAsyncSetup) {
11890
11855
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
11891
11856
  if (isSSR) {
11892
11857
  return setupResult.then((resolvedResult) => {
@@ -12373,7 +12338,7 @@ function isMemoSame(cached, memo) {
12373
12338
  return true;
12374
12339
  }
12375
12340
 
12376
- const version = "3.5.11";
12341
+ const version = "3.5.12";
12377
12342
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12378
12343
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12379
12344
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -13078,7 +13043,7 @@ function compatCoerceAttr(el, key, value, instance = null) {
13078
13043
  return false;
13079
13044
  }
13080
13045
 
13081
- function patchDOMProp(el, key, value, parentComponent) {
13046
+ function patchDOMProp(el, key, value, parentComponent, attrName) {
13082
13047
  if (key === "innerHTML" || key === "textContent") {
13083
13048
  if (value != null) {
13084
13049
  el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
@@ -13142,7 +13107,7 @@ function patchDOMProp(el, key, value, parentComponent) {
13142
13107
  );
13143
13108
  }
13144
13109
  }
13145
- needRemove && el.removeAttribute(key);
13110
+ needRemove && el.removeAttribute(attrName || key);
13146
13111
  }
13147
13112
 
13148
13113
  function addEventListener(el, event, handler, options) {
@@ -13252,7 +13217,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
13252
13217
  // #11081 force set props for possible async custom element
13253
13218
  el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
13254
13219
  ) {
13255
- patchDOMProp(el, camelize(key), nextValue, parentComponent);
13220
+ patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
13256
13221
  } else {
13257
13222
  if (key === "true-value") {
13258
13223
  el._trueValue = nextValue;
@@ -13979,7 +13944,7 @@ const vModelCheckbox = {
13979
13944
  setChecked(el, binding, vnode);
13980
13945
  }
13981
13946
  };
13982
- function setChecked(el, { value }, vnode) {
13947
+ function setChecked(el, { value, oldValue }, vnode) {
13983
13948
  el._modelValue = value;
13984
13949
  let checked;
13985
13950
  if (isArray(value)) {
@@ -13987,6 +13952,7 @@ function setChecked(el, { value }, vnode) {
13987
13952
  } else if (isSet(value)) {
13988
13953
  checked = value.has(vnode.props.value);
13989
13954
  } else {
13955
+ if (value === oldValue) return;
13990
13956
  checked = looseEqual(value, getCheckboxValue(el, true));
13991
13957
  }
13992
13958
  if (el.checked !== checked) {
@@ -16690,6 +16656,9 @@ function getLoc(start, end) {
16690
16656
  source: end == null ? end : getSlice(start, end)
16691
16657
  };
16692
16658
  }
16659
+ function cloneLoc(loc) {
16660
+ return getLoc(loc.start.offset, loc.end.offset);
16661
+ }
16693
16662
  function setLocEnd(loc, end) {
16694
16663
  loc.end = tokenizer.getPos(end);
16695
16664
  loc.source = getSlice(loc.start.offset, end);
@@ -18051,7 +18020,7 @@ function processIf(node, dir, context, processCodegen) {
18051
18020
  const branch = createIfBranch(node, dir);
18052
18021
  const ifNode = {
18053
18022
  type: 9,
18054
- loc: node.loc,
18023
+ loc: cloneLoc(node.loc),
18055
18024
  branches: [branch]
18056
18025
  };
18057
18026
  context.replaceNode(ifNode);