vue 3.5.11 → 3.5.13

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 v3.5.11
2
+ * vue v3.5.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -215,10 +215,9 @@ var Vue = (function (exports) {
215
215
  return ret;
216
216
  }
217
217
  function stringifyStyle(styles) {
218
+ if (!styles) return "";
219
+ if (isString(styles)) return styles;
218
220
  let ret = "";
219
- if (!styles || isString(styles)) {
220
- return ret;
221
- }
222
221
  for (const key in styles) {
223
222
  const value = styles[key];
224
223
  if (isString(value) || typeof value === "number") {
@@ -481,17 +480,21 @@ var Vue = (function (exports) {
481
480
  }
482
481
  stop(fromParent) {
483
482
  if (this._active) {
483
+ this._active = false;
484
484
  let i, l;
485
485
  for (i = 0, l = this.effects.length; i < l; i++) {
486
486
  this.effects[i].stop();
487
487
  }
488
+ this.effects.length = 0;
488
489
  for (i = 0, l = this.cleanups.length; i < l; i++) {
489
490
  this.cleanups[i]();
490
491
  }
492
+ this.cleanups.length = 0;
491
493
  if (this.scopes) {
492
494
  for (i = 0, l = this.scopes.length; i < l; i++) {
493
495
  this.scopes[i].stop(true);
494
496
  }
497
+ this.scopes.length = 0;
495
498
  }
496
499
  if (!this.detached && this.parent && !fromParent) {
497
500
  const last = this.parent.scopes.pop();
@@ -501,7 +504,6 @@ var Vue = (function (exports) {
501
504
  }
502
505
  }
503
506
  this.parent = void 0;
504
- this._active = false;
505
507
  }
506
508
  }
507
509
  }
@@ -766,16 +768,16 @@ var Vue = (function (exports) {
766
768
  nextSub.prevSub = prevSub;
767
769
  link.nextSub = void 0;
768
770
  }
769
- if (dep.subs === link) {
770
- dep.subs = prevSub;
771
- }
772
771
  if (dep.subsHead === link) {
773
772
  dep.subsHead = nextSub;
774
773
  }
775
- if (!dep.subs && dep.computed) {
776
- dep.computed.flags &= ~4;
777
- for (let l = dep.computed.deps; l; l = l.nextDep) {
778
- removeSub(l, true);
774
+ if (dep.subs === link) {
775
+ dep.subs = prevSub;
776
+ if (!prevSub && dep.computed) {
777
+ dep.computed.flags &= ~4;
778
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
779
+ removeSub(l, true);
780
+ }
779
781
  }
780
782
  }
781
783
  if (!soft && !--dep.sc && dep.map) {
@@ -1035,7 +1037,7 @@ var Vue = (function (exports) {
1035
1037
  }
1036
1038
  });
1037
1039
  } else {
1038
- if (key !== void 0) {
1040
+ if (key !== void 0 || depsMap.has(void 0)) {
1039
1041
  run(depsMap.get(key));
1040
1042
  }
1041
1043
  if (isArrayIndex) {
@@ -1267,6 +1269,7 @@ var Vue = (function (exports) {
1267
1269
  this._isShallow = _isShallow;
1268
1270
  }
1269
1271
  get(target, key, receiver) {
1272
+ if (key === "__v_skip") return target["__v_skip"];
1270
1273
  const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
1271
1274
  if (key === "__v_isReactive") {
1272
1275
  return !isReadonly2;
@@ -1410,117 +1413,6 @@ var Vue = (function (exports) {
1410
1413
 
1411
1414
  const toShallow = (value) => value;
1412
1415
  const getProto = (v) => Reflect.getPrototypeOf(v);
1413
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
1414
- target = target["__v_raw"];
1415
- const rawTarget = toRaw(target);
1416
- const rawKey = toRaw(key);
1417
- if (!isReadonly2) {
1418
- if (hasChanged(key, rawKey)) {
1419
- track(rawTarget, "get", key);
1420
- }
1421
- track(rawTarget, "get", rawKey);
1422
- }
1423
- const { has: has2 } = getProto(rawTarget);
1424
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1425
- if (has2.call(rawTarget, key)) {
1426
- return wrap(target.get(key));
1427
- } else if (has2.call(rawTarget, rawKey)) {
1428
- return wrap(target.get(rawKey));
1429
- } else if (target !== rawTarget) {
1430
- target.get(key);
1431
- }
1432
- }
1433
- function has(key, isReadonly2 = false) {
1434
- const target = this["__v_raw"];
1435
- const rawTarget = toRaw(target);
1436
- const rawKey = toRaw(key);
1437
- if (!isReadonly2) {
1438
- if (hasChanged(key, rawKey)) {
1439
- track(rawTarget, "has", key);
1440
- }
1441
- track(rawTarget, "has", rawKey);
1442
- }
1443
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1444
- }
1445
- function size(target, isReadonly2 = false) {
1446
- target = target["__v_raw"];
1447
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
1448
- return Reflect.get(target, "size", target);
1449
- }
1450
- function add(value, _isShallow = false) {
1451
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1452
- value = toRaw(value);
1453
- }
1454
- const target = toRaw(this);
1455
- const proto = getProto(target);
1456
- const hadKey = proto.has.call(target, value);
1457
- if (!hadKey) {
1458
- target.add(value);
1459
- trigger(target, "add", value, value);
1460
- }
1461
- return this;
1462
- }
1463
- function set(key, value, _isShallow = false) {
1464
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1465
- value = toRaw(value);
1466
- }
1467
- const target = toRaw(this);
1468
- const { has: has2, get: get2 } = getProto(target);
1469
- let hadKey = has2.call(target, key);
1470
- if (!hadKey) {
1471
- key = toRaw(key);
1472
- hadKey = has2.call(target, key);
1473
- } else {
1474
- checkIdentityKeys(target, has2, key);
1475
- }
1476
- const oldValue = get2.call(target, key);
1477
- target.set(key, value);
1478
- if (!hadKey) {
1479
- trigger(target, "add", key, value);
1480
- } else if (hasChanged(value, oldValue)) {
1481
- trigger(target, "set", key, value, oldValue);
1482
- }
1483
- return this;
1484
- }
1485
- function deleteEntry(key) {
1486
- const target = toRaw(this);
1487
- const { has: has2, get: get2 } = getProto(target);
1488
- let hadKey = has2.call(target, key);
1489
- if (!hadKey) {
1490
- key = toRaw(key);
1491
- hadKey = has2.call(target, key);
1492
- } else {
1493
- checkIdentityKeys(target, has2, key);
1494
- }
1495
- const oldValue = get2 ? get2.call(target, key) : void 0;
1496
- const result = target.delete(key);
1497
- if (hadKey) {
1498
- trigger(target, "delete", key, void 0, oldValue);
1499
- }
1500
- return result;
1501
- }
1502
- function clear() {
1503
- const target = toRaw(this);
1504
- const hadItems = target.size !== 0;
1505
- const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
1506
- const result = target.clear();
1507
- if (hadItems) {
1508
- trigger(target, "clear", void 0, void 0, oldTarget);
1509
- }
1510
- return result;
1511
- }
1512
- function createForEach(isReadonly2, isShallow2) {
1513
- return function forEach(callback, thisArg) {
1514
- const observed = this;
1515
- const target = observed["__v_raw"];
1516
- const rawTarget = toRaw(target);
1517
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1518
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
1519
- return target.forEach((value, key) => {
1520
- return callback.call(thisArg, wrap(value), wrap(key), observed);
1521
- });
1522
- };
1523
- }
1524
1416
  function createIterableMethod(method, isReadonly2, isShallow2) {
1525
1417
  return function(...args) {
1526
1418
  const target = this["__v_raw"];
@@ -1563,71 +1455,134 @@ var Vue = (function (exports) {
1563
1455
  return type === "delete" ? false : type === "clear" ? void 0 : this;
1564
1456
  };
1565
1457
  }
1566
- function createInstrumentations() {
1567
- const mutableInstrumentations2 = {
1458
+ function createInstrumentations(readonly, shallow) {
1459
+ const instrumentations = {
1568
1460
  get(key) {
1569
- return get(this, key);
1570
- },
1571
- get size() {
1572
- return size(this);
1573
- },
1574
- has,
1575
- add,
1576
- set,
1577
- delete: deleteEntry,
1578
- clear,
1579
- forEach: createForEach(false, false)
1580
- };
1581
- const shallowInstrumentations2 = {
1582
- get(key) {
1583
- return get(this, key, false, true);
1584
- },
1585
- get size() {
1586
- return size(this);
1587
- },
1588
- has,
1589
- add(value) {
1590
- return add.call(this, value, true);
1591
- },
1592
- set(key, value) {
1593
- return set.call(this, key, value, true);
1594
- },
1595
- delete: deleteEntry,
1596
- clear,
1597
- forEach: createForEach(false, true)
1598
- };
1599
- const readonlyInstrumentations2 = {
1600
- get(key) {
1601
- return get(this, key, true);
1602
- },
1603
- get size() {
1604
- return size(this, true);
1605
- },
1606
- has(key) {
1607
- return has.call(this, key, true);
1608
- },
1609
- add: createReadonlyMethod("add"),
1610
- set: createReadonlyMethod("set"),
1611
- delete: createReadonlyMethod("delete"),
1612
- clear: createReadonlyMethod("clear"),
1613
- forEach: createForEach(true, false)
1614
- };
1615
- const shallowReadonlyInstrumentations2 = {
1616
- get(key) {
1617
- return get(this, key, true, true);
1461
+ const target = this["__v_raw"];
1462
+ const rawTarget = toRaw(target);
1463
+ const rawKey = toRaw(key);
1464
+ if (!readonly) {
1465
+ if (hasChanged(key, rawKey)) {
1466
+ track(rawTarget, "get", key);
1467
+ }
1468
+ track(rawTarget, "get", rawKey);
1469
+ }
1470
+ const { has } = getProto(rawTarget);
1471
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1472
+ if (has.call(rawTarget, key)) {
1473
+ return wrap(target.get(key));
1474
+ } else if (has.call(rawTarget, rawKey)) {
1475
+ return wrap(target.get(rawKey));
1476
+ } else if (target !== rawTarget) {
1477
+ target.get(key);
1478
+ }
1618
1479
  },
1619
1480
  get size() {
1620
- return size(this, true);
1481
+ const target = this["__v_raw"];
1482
+ !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1483
+ return Reflect.get(target, "size", target);
1621
1484
  },
1622
1485
  has(key) {
1623
- return has.call(this, key, true);
1486
+ const target = this["__v_raw"];
1487
+ const rawTarget = toRaw(target);
1488
+ const rawKey = toRaw(key);
1489
+ if (!readonly) {
1490
+ if (hasChanged(key, rawKey)) {
1491
+ track(rawTarget, "has", key);
1492
+ }
1493
+ track(rawTarget, "has", rawKey);
1494
+ }
1495
+ return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1624
1496
  },
1625
- add: createReadonlyMethod("add"),
1626
- set: createReadonlyMethod("set"),
1627
- delete: createReadonlyMethod("delete"),
1628
- clear: createReadonlyMethod("clear"),
1629
- forEach: createForEach(true, true)
1497
+ forEach(callback, thisArg) {
1498
+ const observed = this;
1499
+ const target = observed["__v_raw"];
1500
+ const rawTarget = toRaw(target);
1501
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1502
+ !readonly && track(rawTarget, "iterate", ITERATE_KEY);
1503
+ return target.forEach((value, key) => {
1504
+ return callback.call(thisArg, wrap(value), wrap(key), observed);
1505
+ });
1506
+ }
1630
1507
  };
1508
+ extend(
1509
+ instrumentations,
1510
+ readonly ? {
1511
+ add: createReadonlyMethod("add"),
1512
+ set: createReadonlyMethod("set"),
1513
+ delete: createReadonlyMethod("delete"),
1514
+ clear: createReadonlyMethod("clear")
1515
+ } : {
1516
+ add(value) {
1517
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1518
+ value = toRaw(value);
1519
+ }
1520
+ const target = toRaw(this);
1521
+ const proto = getProto(target);
1522
+ const hadKey = proto.has.call(target, value);
1523
+ if (!hadKey) {
1524
+ target.add(value);
1525
+ trigger(target, "add", value, value);
1526
+ }
1527
+ return this;
1528
+ },
1529
+ set(key, value) {
1530
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1531
+ value = toRaw(value);
1532
+ }
1533
+ const target = toRaw(this);
1534
+ const { has, get } = getProto(target);
1535
+ let hadKey = has.call(target, key);
1536
+ if (!hadKey) {
1537
+ key = toRaw(key);
1538
+ hadKey = has.call(target, key);
1539
+ } else {
1540
+ checkIdentityKeys(target, has, key);
1541
+ }
1542
+ const oldValue = get.call(target, key);
1543
+ target.set(key, value);
1544
+ if (!hadKey) {
1545
+ trigger(target, "add", key, value);
1546
+ } else if (hasChanged(value, oldValue)) {
1547
+ trigger(target, "set", key, value, oldValue);
1548
+ }
1549
+ return this;
1550
+ },
1551
+ delete(key) {
1552
+ const target = toRaw(this);
1553
+ const { has, get } = getProto(target);
1554
+ let hadKey = has.call(target, key);
1555
+ if (!hadKey) {
1556
+ key = toRaw(key);
1557
+ hadKey = has.call(target, key);
1558
+ } else {
1559
+ checkIdentityKeys(target, has, key);
1560
+ }
1561
+ const oldValue = get ? get.call(target, key) : void 0;
1562
+ const result = target.delete(key);
1563
+ if (hadKey) {
1564
+ trigger(target, "delete", key, void 0, oldValue);
1565
+ }
1566
+ return result;
1567
+ },
1568
+ clear() {
1569
+ const target = toRaw(this);
1570
+ const hadItems = target.size !== 0;
1571
+ const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
1572
+ const result = target.clear();
1573
+ if (hadItems) {
1574
+ trigger(
1575
+ target,
1576
+ "clear",
1577
+ void 0,
1578
+ void 0,
1579
+ oldTarget
1580
+ );
1581
+ }
1582
+ return result;
1583
+ }
1584
+ }
1585
+ );
1631
1586
  const iteratorMethods = [
1632
1587
  "keys",
1633
1588
  "values",
@@ -1635,30 +1590,12 @@ var Vue = (function (exports) {
1635
1590
  Symbol.iterator
1636
1591
  ];
1637
1592
  iteratorMethods.forEach((method) => {
1638
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1639
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1640
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1641
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
1642
- method,
1643
- true,
1644
- true
1645
- );
1593
+ instrumentations[method] = createIterableMethod(method, readonly, shallow);
1646
1594
  });
1647
- return [
1648
- mutableInstrumentations2,
1649
- readonlyInstrumentations2,
1650
- shallowInstrumentations2,
1651
- shallowReadonlyInstrumentations2
1652
- ];
1595
+ return instrumentations;
1653
1596
  }
1654
- const [
1655
- mutableInstrumentations,
1656
- readonlyInstrumentations,
1657
- shallowInstrumentations,
1658
- shallowReadonlyInstrumentations
1659
- ] = /* @__PURE__ */ createInstrumentations();
1660
1597
  function createInstrumentationGetter(isReadonly2, shallow) {
1661
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
1598
+ const instrumentations = createInstrumentations(isReadonly2, shallow);
1662
1599
  return (target, key, receiver) => {
1663
1600
  if (key === "__v_isReactive") {
1664
1601
  return !isReadonly2;
@@ -1686,9 +1623,9 @@ var Vue = (function (exports) {
1686
1623
  const shallowReadonlyCollectionHandlers = {
1687
1624
  get: /* @__PURE__ */ createInstrumentationGetter(true, true)
1688
1625
  };
1689
- function checkIdentityKeys(target, has2, key) {
1626
+ function checkIdentityKeys(target, has, key) {
1690
1627
  const rawKey = toRaw(key);
1691
- if (rawKey !== key && has2.call(target, rawKey)) {
1628
+ if (rawKey !== key && has.call(target, rawKey)) {
1692
1629
  const type = toRawType(target);
1693
1630
  warn$2(
1694
1631
  `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.`
@@ -2169,7 +2106,7 @@ var Vue = (function (exports) {
2169
2106
  const scope = getCurrentScope();
2170
2107
  const watchHandle = () => {
2171
2108
  effect.stop();
2172
- if (scope) {
2109
+ if (scope && scope.active) {
2173
2110
  remove(scope.effects, effect);
2174
2111
  }
2175
2112
  };
@@ -3114,7 +3051,7 @@ var Vue = (function (exports) {
3114
3051
  }
3115
3052
  if (!disabled) {
3116
3053
  mount(target, targetAnchor);
3117
- updateCssVars(n2);
3054
+ updateCssVars(n2, false);
3118
3055
  }
3119
3056
  } else if (!disabled) {
3120
3057
  warn$1(
@@ -3126,14 +3063,35 @@ var Vue = (function (exports) {
3126
3063
  };
3127
3064
  if (disabled) {
3128
3065
  mount(container, mainAnchor);
3129
- updateCssVars(n2);
3066
+ updateCssVars(n2, true);
3130
3067
  }
3131
3068
  if (isTeleportDeferred(n2.props)) {
3132
- queuePostRenderEffect(mountToTarget, parentSuspense);
3069
+ queuePostRenderEffect(() => {
3070
+ mountToTarget();
3071
+ n2.el.__isMounted = true;
3072
+ }, parentSuspense);
3133
3073
  } else {
3134
3074
  mountToTarget();
3135
3075
  }
3136
3076
  } else {
3077
+ if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
3078
+ queuePostRenderEffect(() => {
3079
+ TeleportImpl.process(
3080
+ n1,
3081
+ n2,
3082
+ container,
3083
+ anchor,
3084
+ parentComponent,
3085
+ parentSuspense,
3086
+ namespace,
3087
+ slotScopeIds,
3088
+ optimized,
3089
+ internals
3090
+ );
3091
+ delete n1.el.__isMounted;
3092
+ }, parentSuspense);
3093
+ return;
3094
+ }
3137
3095
  n2.el = n1.el;
3138
3096
  n2.targetStart = n1.targetStart;
3139
3097
  const mainAnchor = n2.anchor = n1.anchor;
@@ -3216,7 +3174,7 @@ var Vue = (function (exports) {
3216
3174
  );
3217
3175
  }
3218
3176
  }
3219
- updateCssVars(n2);
3177
+ updateCssVars(n2, disabled);
3220
3178
  }
3221
3179
  },
3222
3180
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -3284,9 +3242,10 @@ var Vue = (function (exports) {
3284
3242
  querySelector
3285
3243
  );
3286
3244
  if (target) {
3245
+ const disabled = isTeleportDisabled(vnode.props);
3287
3246
  const targetNode = target._lpa || target.firstChild;
3288
3247
  if (vnode.shapeFlag & 16) {
3289
- if (isTeleportDisabled(vnode.props)) {
3248
+ if (disabled) {
3290
3249
  vnode.anchor = hydrateChildren(
3291
3250
  nextSibling(node),
3292
3251
  vnode,
@@ -3327,16 +3286,23 @@ var Vue = (function (exports) {
3327
3286
  );
3328
3287
  }
3329
3288
  }
3330
- updateCssVars(vnode);
3289
+ updateCssVars(vnode, disabled);
3331
3290
  }
3332
3291
  return vnode.anchor && nextSibling(vnode.anchor);
3333
3292
  }
3334
3293
  const Teleport = TeleportImpl;
3335
- function updateCssVars(vnode) {
3294
+ function updateCssVars(vnode, isDisabled) {
3336
3295
  const ctx = vnode.ctx;
3337
3296
  if (ctx && ctx.ut) {
3338
- let node = vnode.targetStart;
3339
- while (node && node !== vnode.targetAnchor) {
3297
+ let node, anchor;
3298
+ if (isDisabled) {
3299
+ node = vnode.el;
3300
+ anchor = vnode.anchor;
3301
+ } else {
3302
+ node = vnode.targetStart;
3303
+ anchor = vnode.targetAnchor;
3304
+ }
3305
+ while (node && node !== anchor) {
3340
3306
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
3341
3307
  node = node.nextSibling;
3342
3308
  }
@@ -3431,10 +3397,9 @@ var Vue = (function (exports) {
3431
3397
  if (innerChild.type !== Comment) {
3432
3398
  setTransitionHooks(innerChild, enterHooks);
3433
3399
  }
3434
- const oldChild = instance.subTree;
3435
- const oldInnerChild = oldChild && getInnerChild$1(oldChild);
3400
+ let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3436
3401
  if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3437
- const leavingHooks = resolveTransitionHooks(
3402
+ let leavingHooks = resolveTransitionHooks(
3438
3403
  oldInnerChild,
3439
3404
  rawProps,
3440
3405
  state,
@@ -3449,6 +3414,7 @@ var Vue = (function (exports) {
3449
3414
  instance.update();
3450
3415
  }
3451
3416
  delete leavingHooks.afterLeave;
3417
+ oldInnerChild = void 0;
3452
3418
  };
3453
3419
  return emptyPlaceholder(child);
3454
3420
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -3462,10 +3428,19 @@ var Vue = (function (exports) {
3462
3428
  earlyRemove();
3463
3429
  el[leaveCbKey] = void 0;
3464
3430
  delete enterHooks.delayedLeave;
3431
+ oldInnerChild = void 0;
3432
+ };
3433
+ enterHooks.delayedLeave = () => {
3434
+ delayedLeave();
3435
+ delete enterHooks.delayedLeave;
3436
+ oldInnerChild = void 0;
3465
3437
  };
3466
- enterHooks.delayedLeave = delayedLeave;
3467
3438
  };
3439
+ } else {
3440
+ oldInnerChild = void 0;
3468
3441
  }
3442
+ } else if (oldInnerChild) {
3443
+ oldInnerChild = void 0;
3469
3444
  }
3470
3445
  return child;
3471
3446
  };
@@ -3770,6 +3745,9 @@ var Vue = (function (exports) {
3770
3745
  return;
3771
3746
  }
3772
3747
  if (isAsyncWrapper(vnode) && !isUnmount) {
3748
+ if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
3749
+ setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
3750
+ }
3773
3751
  return;
3774
3752
  }
3775
3753
  const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
@@ -3786,8 +3764,15 @@ var Vue = (function (exports) {
3786
3764
  const setupState = owner.setupState;
3787
3765
  const rawSetupState = toRaw(setupState);
3788
3766
  const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3789
- if (knownTemplateRefs.has(rawSetupState[key])) {
3790
- return false;
3767
+ {
3768
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
3769
+ warn$1(
3770
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
3771
+ );
3772
+ }
3773
+ if (knownTemplateRefs.has(rawSetupState[key])) {
3774
+ return false;
3775
+ }
3791
3776
  }
3792
3777
  return hasOwn(rawSetupState, key);
3793
3778
  };
@@ -4027,7 +4012,7 @@ var Vue = (function (exports) {
4027
4012
  getContainerType(container),
4028
4013
  optimized
4029
4014
  );
4030
- if (isAsyncWrapper(vnode)) {
4015
+ if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4031
4016
  let subTree;
4032
4017
  if (isFragmentStart) {
4033
4018
  subTree = createVNode(Fragment);
@@ -4084,7 +4069,11 @@ var Vue = (function (exports) {
4084
4069
  }
4085
4070
  let needCallTransitionHooks = false;
4086
4071
  if (isTemplateNode(el)) {
4087
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4072
+ needCallTransitionHooks = needTransition(
4073
+ null,
4074
+ // no need check parentSuspense in hydration
4075
+ transition
4076
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4088
4077
  const content = el.content.firstChild;
4089
4078
  if (needCallTransitionHooks) {
4090
4079
  transition.beforeEnter(content);
@@ -4292,6 +4281,10 @@ Server rendered element contains fewer child nodes than client vdom.`
4292
4281
  getContainerType(container),
4293
4282
  slotScopeIds
4294
4283
  );
4284
+ if (parentComponent) {
4285
+ parentComponent.vnode.el = vnode.el;
4286
+ updateHOCHostEl(parentComponent, vnode.el);
4287
+ }
4295
4288
  return next;
4296
4289
  };
4297
4290
  const locateClosingAnchor = (node, open = "[", close = "]") => {
@@ -4477,6 +4470,8 @@ Server rendered element contains fewer child nodes than client vdom.`
4477
4470
  }
4478
4471
  }
4479
4472
 
4473
+ const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
4474
+ const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
4480
4475
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
4481
4476
  const id = requestIdleCallback(hydrate, { timeout });
4482
4477
  return () => cancelIdleCallback(id);
@@ -5173,12 +5168,13 @@ If this is a native custom element, make sure to exclude it from component resol
5173
5168
  }
5174
5169
  openBlock();
5175
5170
  const validSlotContent = slot && ensureValidVNode(slot(props));
5171
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5172
+ // key attached in the `createSlots` helper, respect that
5173
+ validSlotContent && validSlotContent.key;
5176
5174
  const rendered = createBlock(
5177
5175
  Fragment,
5178
5176
  {
5179
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
5180
- // key attached in the `createSlots` helper, respect that
5181
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
5177
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
5182
5178
  (!validSlotContent && fallback ? "_fb" : "")
5183
5179
  },
5184
5180
  validSlotContent || (fallback ? fallback() : []),
@@ -6533,6 +6529,7 @@ If you want to remount the same app, move your app creation logic into a factory
6533
6529
  function validateProps(rawProps, props, instance) {
6534
6530
  const resolvedValues = toRaw(props);
6535
6531
  const options = instance.propsOptions[0];
6532
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
6536
6533
  for (const key in options) {
6537
6534
  let opt = options[key];
6538
6535
  if (opt == null) continue;
@@ -6541,7 +6538,7 @@ If you want to remount the same app, move your app creation logic into a factory
6541
6538
  resolvedValues[key],
6542
6539
  opt,
6543
6540
  shallowReadonly(resolvedValues) ,
6544
- !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
6541
+ !camelizePropsKey.includes(key)
6545
6542
  );
6546
6543
  }
6547
6544
  }
@@ -8379,19 +8376,19 @@ If you want to remount the same app, move your app creation logic into a factory
8379
8376
  warn$1(`useModel() called without active instance.`);
8380
8377
  return ref();
8381
8378
  }
8382
- if (!i.propsOptions[0][name]) {
8379
+ const camelizedName = camelize(name);
8380
+ if (!i.propsOptions[0][camelizedName]) {
8383
8381
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
8384
8382
  return ref();
8385
8383
  }
8386
- const camelizedName = camelize(name);
8387
8384
  const hyphenatedName = hyphenate(name);
8388
- const modifiers = getModelModifiers(props, name);
8385
+ const modifiers = getModelModifiers(props, camelizedName);
8389
8386
  const res = customRef((track, trigger) => {
8390
8387
  let localValue;
8391
8388
  let prevSetValue = EMPTY_OBJ;
8392
8389
  let prevEmittedValue;
8393
8390
  watchSyncEffect(() => {
8394
- const propValue = props[name];
8391
+ const propValue = props[camelizedName];
8395
8392
  if (hasChanged(localValue, propValue)) {
8396
8393
  localValue = propValue;
8397
8394
  trigger();
@@ -8690,7 +8687,7 @@ If you want to remount the same app, move your app creation logic into a factory
8690
8687
  }
8691
8688
  if (extraAttrs.length) {
8692
8689
  warn$1(
8693
- `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
8690
+ `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
8694
8691
  );
8695
8692
  }
8696
8693
  if (eventAttrs.length) {
@@ -9473,9 +9470,9 @@ If you want to remount the same app, move your app creation logic into a factory
9473
9470
  currentBlock = blockStack[blockStack.length - 1] || null;
9474
9471
  }
9475
9472
  let isBlockTreeEnabled = 1;
9476
- function setBlockTracking(value) {
9473
+ function setBlockTracking(value, inVOnce = false) {
9477
9474
  isBlockTreeEnabled += value;
9478
- if (value < 0 && currentBlock) {
9475
+ if (value < 0 && currentBlock && inVOnce) {
9479
9476
  currentBlock.hasOnce = true;
9480
9477
  }
9481
9478
  }
@@ -10006,9 +10003,9 @@ Component that was made reactive: `,
10006
10003
  }
10007
10004
  const { setup } = Component;
10008
10005
  if (setup) {
10006
+ pauseTracking();
10009
10007
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
10010
10008
  const reset = setCurrentInstance(instance);
10011
- pauseTracking();
10012
10009
  const setupResult = callWithErrorHandling(
10013
10010
  setup,
10014
10011
  instance,
@@ -10018,10 +10015,13 @@ Component that was made reactive: `,
10018
10015
  setupContext
10019
10016
  ]
10020
10017
  );
10018
+ const isAsyncSetup = isPromise(setupResult);
10021
10019
  resetTracking();
10022
10020
  reset();
10023
- if (isPromise(setupResult)) {
10024
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
10021
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
10022
+ markAsyncBoundary(instance);
10023
+ }
10024
+ if (isAsyncSetup) {
10025
10025
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
10026
10026
  if (isSSR) {
10027
10027
  return setupResult.then((resolvedResult) => {
@@ -10482,7 +10482,7 @@ Component that was made reactive: `,
10482
10482
  return true;
10483
10483
  }
10484
10484
 
10485
- const version = "3.5.11";
10485
+ const version = "3.5.13";
10486
10486
  const warn = warn$1 ;
10487
10487
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10488
10488
  const devtools = devtools$1 ;
@@ -10654,7 +10654,8 @@ Component that was made reactive: `,
10654
10654
  onAppear = onEnter,
10655
10655
  onAppearCancelled = onEnterCancelled
10656
10656
  } = baseProps;
10657
- const finishEnter = (el, isAppear, done) => {
10657
+ const finishEnter = (el, isAppear, done, isCancelled) => {
10658
+ el._enterCancelled = isCancelled;
10658
10659
  removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
10659
10660
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
10660
10661
  done && done();
@@ -10697,8 +10698,13 @@ Component that was made reactive: `,
10697
10698
  el._isLeaving = true;
10698
10699
  const resolve = () => finishLeave(el, done);
10699
10700
  addTransitionClass(el, leaveFromClass);
10700
- addTransitionClass(el, leaveActiveClass);
10701
- forceReflow();
10701
+ if (!el._enterCancelled) {
10702
+ forceReflow();
10703
+ addTransitionClass(el, leaveActiveClass);
10704
+ } else {
10705
+ addTransitionClass(el, leaveActiveClass);
10706
+ forceReflow();
10707
+ }
10702
10708
  nextFrame(() => {
10703
10709
  if (!el._isLeaving) {
10704
10710
  return;
@@ -10712,11 +10718,11 @@ Component that was made reactive: `,
10712
10718
  callHook(onLeave, [el, resolve]);
10713
10719
  },
10714
10720
  onEnterCancelled(el) {
10715
- finishEnter(el, false);
10721
+ finishEnter(el, false, void 0, true);
10716
10722
  callHook(onEnterCancelled, [el]);
10717
10723
  },
10718
10724
  onAppearCancelled(el) {
10719
- finishEnter(el, true);
10725
+ finishEnter(el, true, void 0, true);
10720
10726
  callHook(onAppearCancelled, [el]);
10721
10727
  },
10722
10728
  onLeaveCancelled(el) {
@@ -10929,10 +10935,11 @@ Component that was made reactive: `,
10929
10935
  }
10930
10936
  updateTeleports(vars);
10931
10937
  };
10932
- onBeforeMount(() => {
10933
- watchPostEffect(setVars);
10938
+ onBeforeUpdate(() => {
10939
+ queuePostFlushCb(setVars);
10934
10940
  });
10935
10941
  onMounted(() => {
10942
+ watch(setVars, NOOP, { flush: "post" });
10936
10943
  const ob = new MutationObserver(setVars);
10937
10944
  ob.observe(instance.subTree.el.parentNode, { childList: true });
10938
10945
  onUnmounted(() => ob.disconnect());
@@ -11096,7 +11103,7 @@ Component that was made reactive: `,
11096
11103
  }
11097
11104
  }
11098
11105
 
11099
- function patchDOMProp(el, key, value, parentComponent) {
11106
+ function patchDOMProp(el, key, value, parentComponent, attrName) {
11100
11107
  if (key === "innerHTML" || key === "textContent") {
11101
11108
  if (value != null) {
11102
11109
  el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
@@ -11144,7 +11151,7 @@ Component that was made reactive: `,
11144
11151
  );
11145
11152
  }
11146
11153
  }
11147
- needRemove && el.removeAttribute(key);
11154
+ needRemove && el.removeAttribute(attrName || key);
11148
11155
  }
11149
11156
 
11150
11157
  function addEventListener(el, event, handler, options) {
@@ -11254,7 +11261,7 @@ Expected function or array of functions, received type ${typeof value}.`
11254
11261
  // #11081 force set props for possible async custom element
11255
11262
  el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
11256
11263
  ) {
11257
- patchDOMProp(el, camelize(key), nextValue);
11264
+ patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
11258
11265
  } else {
11259
11266
  if (key === "true-value") {
11260
11267
  el._trueValue = nextValue;
@@ -11539,6 +11546,8 @@ Expected function or array of functions, received type ${typeof value}.`
11539
11546
  this._update();
11540
11547
  }
11541
11548
  if (shouldReflect) {
11549
+ const ob = this._ob;
11550
+ ob && ob.disconnect();
11542
11551
  if (val === true) {
11543
11552
  this.setAttribute(hyphenate(key), "");
11544
11553
  } else if (typeof val === "string" || typeof val === "number") {
@@ -11546,6 +11555,7 @@ Expected function or array of functions, received type ${typeof value}.`
11546
11555
  } else if (!val) {
11547
11556
  this.removeAttribute(hyphenate(key));
11548
11557
  }
11558
+ ob && ob.observe(this, { attributes: true });
11549
11559
  }
11550
11560
  }
11551
11561
  }
@@ -11960,7 +11970,7 @@ Expected function or array of functions, received type ${typeof value}.`
11960
11970
  setChecked(el, binding, vnode);
11961
11971
  }
11962
11972
  };
11963
- function setChecked(el, { value }, vnode) {
11973
+ function setChecked(el, { value, oldValue }, vnode) {
11964
11974
  el._modelValue = value;
11965
11975
  let checked;
11966
11976
  if (isArray(value)) {
@@ -11968,6 +11978,7 @@ Expected function or array of functions, received type ${typeof value}.`
11968
11978
  } else if (isSet(value)) {
11969
11979
  checked = value.has(vnode.props.value);
11970
11980
  } else {
11981
+ if (value === oldValue) return;
11971
11982
  checked = looseEqual(value, getCheckboxValue(el, true));
11972
11983
  }
11973
11984
  if (el.checked !== checked) {
@@ -12518,12 +12529,13 @@ Make sure to use the production build (*.prod.js) when deploying for production.
12518
12529
  loc: locStub
12519
12530
  };
12520
12531
  }
12521
- function createCacheExpression(index, value, needPauseTracking = false) {
12532
+ function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) {
12522
12533
  return {
12523
12534
  type: 20,
12524
12535
  index,
12525
12536
  value,
12526
12537
  needPauseTracking,
12538
+ inVOnce,
12527
12539
  needArraySpread: false,
12528
12540
  loc: locStub
12529
12541
  };
@@ -14246,6 +14258,9 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14246
14258
  source: end == null ? end : getSlice(start, end)
14247
14259
  };
14248
14260
  }
14261
+ function cloneLoc(loc) {
14262
+ return getLoc(loc.start.offset, loc.end.offset);
14263
+ }
14249
14264
  function setLocEnd(loc, end) {
14250
14265
  loc.end = tokenizer.getPos(end);
14251
14266
  loc.source = getSlice(loc.start.offset, end);
@@ -14754,11 +14769,12 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14754
14769
  identifier.hoisted = exp;
14755
14770
  return identifier;
14756
14771
  },
14757
- cache(exp, isVNode = false) {
14772
+ cache(exp, isVNode = false, inVOnce = false) {
14758
14773
  const cacheExp = createCacheExpression(
14759
14774
  context.cached.length,
14760
14775
  exp,
14761
- isVNode
14776
+ isVNode,
14777
+ inVOnce
14762
14778
  );
14763
14779
  context.cached.push(cacheExp);
14764
14780
  return cacheExp;
@@ -15457,7 +15473,9 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15457
15473
  push(`_cache[${node.index}] || (`);
15458
15474
  if (needPauseTracking) {
15459
15475
  indent();
15460
- push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
15476
+ push(`${helper(SET_BLOCK_TRACKING)}(-1`);
15477
+ if (node.inVOnce) push(`, true`);
15478
+ push(`),`);
15461
15479
  newline();
15462
15480
  push(`(`);
15463
15481
  }
@@ -15514,12 +15532,14 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15514
15532
  context
15515
15533
  );
15516
15534
  } else if (node.type === 1) {
15535
+ const memo = findDir(node, "memo");
15517
15536
  for (let i = 0; i < node.props.length; i++) {
15518
15537
  const dir = node.props[i];
15519
15538
  if (dir.type === 7 && dir.name !== "for") {
15520
15539
  const exp = dir.exp;
15521
15540
  const arg = dir.arg;
15522
- if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
15541
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
15542
+ !(memo && arg && arg.type === 4 && arg.content === "key")) {
15523
15543
  dir.exp = processExpression(
15524
15544
  exp,
15525
15545
  context,
@@ -15590,7 +15610,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15590
15610
  const branch = createIfBranch(node, dir);
15591
15611
  const ifNode = {
15592
15612
  type: 9,
15593
- loc: node.loc,
15613
+ loc: cloneLoc(node.loc),
15594
15614
  branches: [branch]
15595
15615
  };
15596
15616
  context.replaceNode(ifNode);
@@ -15847,10 +15867,11 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15847
15867
  const isTemplate = isTemplateNode(node);
15848
15868
  const memo = findDir(node, "memo");
15849
15869
  const keyProp = findProp(node, `key`, false, true);
15850
- if (keyProp && keyProp.type === 7 && !keyProp.exp) {
15870
+ const isDirKey = keyProp && keyProp.type === 7;
15871
+ if (isDirKey && !keyProp.exp) {
15851
15872
  transformBindShorthand(keyProp);
15852
15873
  }
15853
- const keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
15874
+ let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
15854
15875
  const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
15855
15876
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
15856
15877
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
@@ -17047,8 +17068,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17047
17068
  if (cur.codegenNode) {
17048
17069
  cur.codegenNode = context.cache(
17049
17070
  cur.codegenNode,
17071
+ true,
17050
17072
  true
17051
- /* isVNode */
17052
17073
  );
17053
17074
  }
17054
17075
  };