@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.
@@ -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
  **/
@@ -557,8 +557,14 @@ class ReactiveEffect {
557
557
  }
558
558
  let batchDepth = 0;
559
559
  let batchedSub;
560
- function batch(sub) {
560
+ let batchedComputed;
561
+ function batch(sub, isComputed = false) {
561
562
  sub.flags |= 8;
563
+ if (isComputed) {
564
+ sub.next = batchedComputed;
565
+ batchedComputed = sub;
566
+ return;
567
+ }
562
568
  sub.next = batchedSub;
563
569
  batchedSub = sub;
564
570
  }
@@ -569,20 +575,22 @@ function endBatch() {
569
575
  if (--batchDepth > 0) {
570
576
  return;
571
577
  }
578
+ if (batchedComputed) {
579
+ let e = batchedComputed;
580
+ batchedComputed = void 0;
581
+ while (e) {
582
+ const next = e.next;
583
+ e.next = void 0;
584
+ e.flags &= ~8;
585
+ e = next;
586
+ }
587
+ }
572
588
  let error;
573
589
  while (batchedSub) {
574
590
  let e = batchedSub;
575
- let next;
576
- while (e) {
577
- if (!(e.flags & 1)) {
578
- e.flags &= ~8;
579
- }
580
- e = e.next;
581
- }
582
- e = batchedSub;
583
591
  batchedSub = void 0;
584
592
  while (e) {
585
- next = e.next;
593
+ const next = e.next;
586
594
  e.next = void 0;
587
595
  e.flags &= ~8;
588
596
  if (e.flags & 1) {
@@ -682,16 +690,16 @@ function removeSub(link, soft = false) {
682
690
  nextSub.prevSub = prevSub;
683
691
  link.nextSub = void 0;
684
692
  }
685
- if (dep.subs === link) {
686
- dep.subs = prevSub;
687
- }
688
693
  if (dep.subsHead === link) {
689
694
  dep.subsHead = nextSub;
690
695
  }
691
- if (!dep.subs && dep.computed) {
692
- dep.computed.flags &= ~4;
693
- for (let l = dep.computed.deps; l; l = l.nextDep) {
694
- removeSub(l, true);
696
+ if (dep.subs === link) {
697
+ dep.subs = prevSub;
698
+ if (!prevSub && dep.computed) {
699
+ dep.computed.flags &= ~4;
700
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
701
+ removeSub(l, true);
702
+ }
695
703
  }
696
704
  }
697
705
  if (!soft && !--dep.sc && dep.map) {
@@ -778,7 +786,6 @@ class Dep {
778
786
  /**
779
787
  * For object property deps cleanup
780
788
  */
781
- this.target = void 0;
782
789
  this.map = void 0;
783
790
  this.key = void 0;
784
791
  /**
@@ -906,7 +913,6 @@ function track(target, type, key) {
906
913
  let dep = depsMap.get(key);
907
914
  if (!dep) {
908
915
  depsMap.set(key, dep = new Dep());
909
- dep.target = target;
910
916
  dep.map = depsMap;
911
917
  dep.key = key;
912
918
  }
@@ -953,7 +959,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
953
959
  }
954
960
  });
955
961
  } else {
956
- if (key !== void 0) {
962
+ if (key !== void 0 || depsMap.has(void 0)) {
957
963
  run(depsMap.get(key));
958
964
  }
959
965
  if (isArrayIndex) {
@@ -1328,117 +1334,6 @@ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true
1328
1334
 
1329
1335
  const toShallow = (value) => value;
1330
1336
  const getProto = (v) => Reflect.getPrototypeOf(v);
1331
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
1332
- target = target["__v_raw"];
1333
- const rawTarget = toRaw(target);
1334
- const rawKey = toRaw(key);
1335
- if (!isReadonly2) {
1336
- if (hasChanged(key, rawKey)) {
1337
- track(rawTarget, "get", key);
1338
- }
1339
- track(rawTarget, "get", rawKey);
1340
- }
1341
- const { has: has2 } = getProto(rawTarget);
1342
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1343
- if (has2.call(rawTarget, key)) {
1344
- return wrap(target.get(key));
1345
- } else if (has2.call(rawTarget, rawKey)) {
1346
- return wrap(target.get(rawKey));
1347
- } else if (target !== rawTarget) {
1348
- target.get(key);
1349
- }
1350
- }
1351
- function has(key, isReadonly2 = false) {
1352
- const target = this["__v_raw"];
1353
- const rawTarget = toRaw(target);
1354
- const rawKey = toRaw(key);
1355
- if (!isReadonly2) {
1356
- if (hasChanged(key, rawKey)) {
1357
- track(rawTarget, "has", key);
1358
- }
1359
- track(rawTarget, "has", rawKey);
1360
- }
1361
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1362
- }
1363
- function size(target, isReadonly2 = false) {
1364
- target = target["__v_raw"];
1365
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
1366
- return Reflect.get(target, "size", target);
1367
- }
1368
- function add(value, _isShallow = false) {
1369
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1370
- value = toRaw(value);
1371
- }
1372
- const target = toRaw(this);
1373
- const proto = getProto(target);
1374
- const hadKey = proto.has.call(target, value);
1375
- if (!hadKey) {
1376
- target.add(value);
1377
- trigger(target, "add", value, value);
1378
- }
1379
- return this;
1380
- }
1381
- function set(key, value, _isShallow = false) {
1382
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1383
- value = toRaw(value);
1384
- }
1385
- const target = toRaw(this);
1386
- const { has: has2, get: get2 } = getProto(target);
1387
- let hadKey = has2.call(target, key);
1388
- if (!hadKey) {
1389
- key = toRaw(key);
1390
- hadKey = has2.call(target, key);
1391
- } else {
1392
- checkIdentityKeys(target, has2, key);
1393
- }
1394
- const oldValue = get2.call(target, key);
1395
- target.set(key, value);
1396
- if (!hadKey) {
1397
- trigger(target, "add", key, value);
1398
- } else if (hasChanged(value, oldValue)) {
1399
- trigger(target, "set", key, value, oldValue);
1400
- }
1401
- return this;
1402
- }
1403
- function deleteEntry(key) {
1404
- const target = toRaw(this);
1405
- const { has: has2, get: get2 } = getProto(target);
1406
- let hadKey = has2.call(target, key);
1407
- if (!hadKey) {
1408
- key = toRaw(key);
1409
- hadKey = has2.call(target, key);
1410
- } else {
1411
- checkIdentityKeys(target, has2, key);
1412
- }
1413
- const oldValue = get2 ? get2.call(target, key) : void 0;
1414
- const result = target.delete(key);
1415
- if (hadKey) {
1416
- trigger(target, "delete", key, void 0, oldValue);
1417
- }
1418
- return result;
1419
- }
1420
- function clear() {
1421
- const target = toRaw(this);
1422
- const hadItems = target.size !== 0;
1423
- const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
1424
- const result = target.clear();
1425
- if (hadItems) {
1426
- trigger(target, "clear", void 0, void 0, oldTarget);
1427
- }
1428
- return result;
1429
- }
1430
- function createForEach(isReadonly2, isShallow2) {
1431
- return function forEach(callback, thisArg) {
1432
- const observed = this;
1433
- const target = observed["__v_raw"];
1434
- const rawTarget = toRaw(target);
1435
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1436
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
1437
- return target.forEach((value, key) => {
1438
- return callback.call(thisArg, wrap(value), wrap(key), observed);
1439
- });
1440
- };
1441
- }
1442
1337
  function createIterableMethod(method, isReadonly2, isShallow2) {
1443
1338
  return function(...args) {
1444
1339
  const target = this["__v_raw"];
@@ -1481,71 +1376,134 @@ function createReadonlyMethod(type) {
1481
1376
  return type === "delete" ? false : type === "clear" ? void 0 : this;
1482
1377
  };
1483
1378
  }
1484
- function createInstrumentations() {
1485
- const mutableInstrumentations2 = {
1486
- get(key) {
1487
- return get(this, key);
1488
- },
1489
- get size() {
1490
- return size(this);
1491
- },
1492
- has,
1493
- add,
1494
- set,
1495
- delete: deleteEntry,
1496
- clear,
1497
- forEach: createForEach(false, false)
1498
- };
1499
- const shallowInstrumentations2 = {
1500
- get(key) {
1501
- return get(this, key, false, true);
1502
- },
1503
- get size() {
1504
- return size(this);
1505
- },
1506
- has,
1507
- add(value) {
1508
- return add.call(this, value, true);
1509
- },
1510
- set(key, value) {
1511
- return set.call(this, key, value, true);
1512
- },
1513
- delete: deleteEntry,
1514
- clear,
1515
- forEach: createForEach(false, true)
1516
- };
1517
- const readonlyInstrumentations2 = {
1379
+ function createInstrumentations(readonly, shallow) {
1380
+ const instrumentations = {
1518
1381
  get(key) {
1519
- return get(this, key, true);
1520
- },
1521
- get size() {
1522
- return size(this, true);
1523
- },
1524
- has(key) {
1525
- return has.call(this, key, true);
1526
- },
1527
- add: createReadonlyMethod("add"),
1528
- set: createReadonlyMethod("set"),
1529
- delete: createReadonlyMethod("delete"),
1530
- clear: createReadonlyMethod("clear"),
1531
- forEach: createForEach(true, false)
1532
- };
1533
- const shallowReadonlyInstrumentations2 = {
1534
- get(key) {
1535
- return get(this, key, true, true);
1382
+ const target = this["__v_raw"];
1383
+ const rawTarget = toRaw(target);
1384
+ const rawKey = toRaw(key);
1385
+ if (!readonly) {
1386
+ if (hasChanged(key, rawKey)) {
1387
+ track(rawTarget, "get", key);
1388
+ }
1389
+ track(rawTarget, "get", rawKey);
1390
+ }
1391
+ const { has } = getProto(rawTarget);
1392
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1393
+ if (has.call(rawTarget, key)) {
1394
+ return wrap(target.get(key));
1395
+ } else if (has.call(rawTarget, rawKey)) {
1396
+ return wrap(target.get(rawKey));
1397
+ } else if (target !== rawTarget) {
1398
+ target.get(key);
1399
+ }
1536
1400
  },
1537
1401
  get size() {
1538
- return size(this, true);
1402
+ const target = this["__v_raw"];
1403
+ !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1404
+ return Reflect.get(target, "size", target);
1539
1405
  },
1540
1406
  has(key) {
1541
- return has.call(this, key, true);
1407
+ const target = this["__v_raw"];
1408
+ const rawTarget = toRaw(target);
1409
+ const rawKey = toRaw(key);
1410
+ if (!readonly) {
1411
+ if (hasChanged(key, rawKey)) {
1412
+ track(rawTarget, "has", key);
1413
+ }
1414
+ track(rawTarget, "has", rawKey);
1415
+ }
1416
+ return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1542
1417
  },
1543
- add: createReadonlyMethod("add"),
1544
- set: createReadonlyMethod("set"),
1545
- delete: createReadonlyMethod("delete"),
1546
- clear: createReadonlyMethod("clear"),
1547
- forEach: createForEach(true, true)
1418
+ forEach(callback, thisArg) {
1419
+ const observed = this;
1420
+ const target = observed["__v_raw"];
1421
+ const rawTarget = toRaw(target);
1422
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1423
+ !readonly && track(rawTarget, "iterate", ITERATE_KEY);
1424
+ return target.forEach((value, key) => {
1425
+ return callback.call(thisArg, wrap(value), wrap(key), observed);
1426
+ });
1427
+ }
1548
1428
  };
1429
+ extend(
1430
+ instrumentations,
1431
+ readonly ? {
1432
+ add: createReadonlyMethod("add"),
1433
+ set: createReadonlyMethod("set"),
1434
+ delete: createReadonlyMethod("delete"),
1435
+ clear: createReadonlyMethod("clear")
1436
+ } : {
1437
+ add(value) {
1438
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1439
+ value = toRaw(value);
1440
+ }
1441
+ const target = toRaw(this);
1442
+ const proto = getProto(target);
1443
+ const hadKey = proto.has.call(target, value);
1444
+ if (!hadKey) {
1445
+ target.add(value);
1446
+ trigger(target, "add", value, value);
1447
+ }
1448
+ return this;
1449
+ },
1450
+ set(key, value) {
1451
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1452
+ value = toRaw(value);
1453
+ }
1454
+ const target = toRaw(this);
1455
+ const { has, get } = getProto(target);
1456
+ let hadKey = has.call(target, key);
1457
+ if (!hadKey) {
1458
+ key = toRaw(key);
1459
+ hadKey = has.call(target, key);
1460
+ } else {
1461
+ checkIdentityKeys(target, has, key);
1462
+ }
1463
+ const oldValue = get.call(target, key);
1464
+ target.set(key, value);
1465
+ if (!hadKey) {
1466
+ trigger(target, "add", key, value);
1467
+ } else if (hasChanged(value, oldValue)) {
1468
+ trigger(target, "set", key, value, oldValue);
1469
+ }
1470
+ return this;
1471
+ },
1472
+ delete(key) {
1473
+ const target = toRaw(this);
1474
+ const { has, get } = getProto(target);
1475
+ let hadKey = has.call(target, key);
1476
+ if (!hadKey) {
1477
+ key = toRaw(key);
1478
+ hadKey = has.call(target, key);
1479
+ } else {
1480
+ checkIdentityKeys(target, has, key);
1481
+ }
1482
+ const oldValue = get ? get.call(target, key) : void 0;
1483
+ const result = target.delete(key);
1484
+ if (hadKey) {
1485
+ trigger(target, "delete", key, void 0, oldValue);
1486
+ }
1487
+ return result;
1488
+ },
1489
+ clear() {
1490
+ const target = toRaw(this);
1491
+ const hadItems = target.size !== 0;
1492
+ const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
1493
+ const result = target.clear();
1494
+ if (hadItems) {
1495
+ trigger(
1496
+ target,
1497
+ "clear",
1498
+ void 0,
1499
+ void 0,
1500
+ oldTarget
1501
+ );
1502
+ }
1503
+ return result;
1504
+ }
1505
+ }
1506
+ );
1549
1507
  const iteratorMethods = [
1550
1508
  "keys",
1551
1509
  "values",
@@ -1553,30 +1511,12 @@ function createInstrumentations() {
1553
1511
  Symbol.iterator
1554
1512
  ];
1555
1513
  iteratorMethods.forEach((method) => {
1556
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1557
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1558
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1559
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
1560
- method,
1561
- true,
1562
- true
1563
- );
1514
+ instrumentations[method] = createIterableMethod(method, readonly, shallow);
1564
1515
  });
1565
- return [
1566
- mutableInstrumentations2,
1567
- readonlyInstrumentations2,
1568
- shallowInstrumentations2,
1569
- shallowReadonlyInstrumentations2
1570
- ];
1516
+ return instrumentations;
1571
1517
  }
1572
- const [
1573
- mutableInstrumentations,
1574
- readonlyInstrumentations,
1575
- shallowInstrumentations,
1576
- shallowReadonlyInstrumentations
1577
- ] = /* @__PURE__ */ createInstrumentations();
1578
1518
  function createInstrumentationGetter(isReadonly2, shallow) {
1579
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
1519
+ const instrumentations = createInstrumentations(isReadonly2, shallow);
1580
1520
  return (target, key, receiver) => {
1581
1521
  if (key === "__v_isReactive") {
1582
1522
  return !isReadonly2;
@@ -1604,9 +1544,9 @@ const readonlyCollectionHandlers = {
1604
1544
  const shallowReadonlyCollectionHandlers = {
1605
1545
  get: /* @__PURE__ */ createInstrumentationGetter(true, true)
1606
1546
  };
1607
- function checkIdentityKeys(target, has2, key) {
1547
+ function checkIdentityKeys(target, has, key) {
1608
1548
  const rawKey = toRaw(key);
1609
- if (rawKey !== key && has2.call(target, rawKey)) {
1549
+ if (rawKey !== key && has.call(target, rawKey)) {
1610
1550
  const type = toRawType(target);
1611
1551
  warn$2(
1612
1552
  `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.`
@@ -1942,7 +1882,7 @@ class ComputedRefImpl {
1942
1882
  this.flags |= 16;
1943
1883
  if (!(this.flags & 8) && // avoid infinite self recursion
1944
1884
  activeSub !== this) {
1945
- batch(this);
1885
+ batch(this, true);
1946
1886
  return true;
1947
1887
  }
1948
1888
  }
@@ -2464,10 +2404,8 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
2464
2404
  }
2465
2405
  }
2466
2406
 
2467
- let isFlushing = false;
2468
- let isFlushPending = false;
2469
2407
  const queue = [];
2470
- let flushIndex = 0;
2408
+ let flushIndex = -1;
2471
2409
  const pendingPostFlushCbs = [];
2472
2410
  let activePostFlushCbs = null;
2473
2411
  let postFlushIndex = 0;
@@ -2479,7 +2417,7 @@ function nextTick(fn) {
2479
2417
  return fn ? p.then(this ? fn.bind(this) : fn) : p;
2480
2418
  }
2481
2419
  function findInsertionIndex(id) {
2482
- let start = isFlushing ? flushIndex + 1 : 0;
2420
+ let start = flushIndex + 1;
2483
2421
  let end = queue.length;
2484
2422
  while (start < end) {
2485
2423
  const middle = start + end >>> 1;
@@ -2508,8 +2446,7 @@ function queueJob(job) {
2508
2446
  }
2509
2447
  }
2510
2448
  function queueFlush() {
2511
- if (!isFlushing && !isFlushPending) {
2512
- isFlushPending = true;
2449
+ if (!currentFlushPromise) {
2513
2450
  currentFlushPromise = resolvedPromise.then(flushJobs);
2514
2451
  }
2515
2452
  }
@@ -2526,7 +2463,7 @@ function queuePostFlushCb(cb) {
2526
2463
  }
2527
2464
  queueFlush();
2528
2465
  }
2529
- function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
2466
+ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2530
2467
  {
2531
2468
  seen = seen || /* @__PURE__ */ new Map();
2532
2469
  }
@@ -2582,8 +2519,6 @@ function flushPostFlushCbs(seen) {
2582
2519
  }
2583
2520
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
2584
2521
  function flushJobs(seen) {
2585
- isFlushPending = false;
2586
- isFlushing = true;
2587
2522
  {
2588
2523
  seen = seen || /* @__PURE__ */ new Map();
2589
2524
  }
@@ -2615,10 +2550,9 @@ function flushJobs(seen) {
2615
2550
  job.flags &= ~1;
2616
2551
  }
2617
2552
  }
2618
- flushIndex = 0;
2553
+ flushIndex = -1;
2619
2554
  queue.length = 0;
2620
2555
  flushPostFlushCbs(seen);
2621
- isFlushing = false;
2622
2556
  currentFlushPromise = null;
2623
2557
  if (queue.length || pendingPostFlushCbs.length) {
2624
2558
  flushJobs(seen);
@@ -3566,7 +3500,7 @@ const TeleportImpl = {
3566
3500
  }
3567
3501
  if (!disabled) {
3568
3502
  mount(target, targetAnchor);
3569
- updateCssVars(n2);
3503
+ updateCssVars(n2, false);
3570
3504
  }
3571
3505
  } else if (!disabled) {
3572
3506
  warn$1(
@@ -3578,7 +3512,7 @@ const TeleportImpl = {
3578
3512
  };
3579
3513
  if (disabled) {
3580
3514
  mount(container, mainAnchor);
3581
- updateCssVars(n2);
3515
+ updateCssVars(n2, true);
3582
3516
  }
3583
3517
  if (isTeleportDeferred(n2.props)) {
3584
3518
  queuePostRenderEffect(mountToTarget, parentSuspense);
@@ -3668,7 +3602,7 @@ const TeleportImpl = {
3668
3602
  );
3669
3603
  }
3670
3604
  }
3671
- updateCssVars(n2);
3605
+ updateCssVars(n2, disabled);
3672
3606
  }
3673
3607
  },
3674
3608
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -3736,9 +3670,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3736
3670
  querySelector
3737
3671
  );
3738
3672
  if (target) {
3673
+ const disabled = isTeleportDisabled(vnode.props);
3739
3674
  const targetNode = target._lpa || target.firstChild;
3740
3675
  if (vnode.shapeFlag & 16) {
3741
- if (isTeleportDisabled(vnode.props)) {
3676
+ if (disabled) {
3742
3677
  vnode.anchor = hydrateChildren(
3743
3678
  nextSibling(node),
3744
3679
  vnode,
@@ -3779,16 +3714,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3779
3714
  );
3780
3715
  }
3781
3716
  }
3782
- updateCssVars(vnode);
3717
+ updateCssVars(vnode, disabled);
3783
3718
  }
3784
3719
  return vnode.anchor && nextSibling(vnode.anchor);
3785
3720
  }
3786
3721
  const Teleport = TeleportImpl;
3787
- function updateCssVars(vnode) {
3722
+ function updateCssVars(vnode, isDisabled) {
3788
3723
  const ctx = vnode.ctx;
3789
3724
  if (ctx && ctx.ut) {
3790
- let node = vnode.targetStart;
3791
- while (node && node !== vnode.targetAnchor) {
3725
+ let node, anchor;
3726
+ if (isDisabled) {
3727
+ node = vnode.el;
3728
+ anchor = vnode.anchor;
3729
+ } else {
3730
+ node = vnode.targetStart;
3731
+ anchor = vnode.targetAnchor;
3732
+ }
3733
+ while (node && node !== anchor) {
3792
3734
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
3793
3735
  node = node.nextSibling;
3794
3736
  }
@@ -4241,8 +4183,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4241
4183
  const setupState = owner.setupState;
4242
4184
  const rawSetupState = toRaw(setupState);
4243
4185
  const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
4244
- if (knownTemplateRefs.has(rawSetupState[key])) {
4245
- return false;
4186
+ {
4187
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4188
+ warn$1(
4189
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
4190
+ );
4191
+ }
4192
+ if (knownTemplateRefs.has(rawSetupState[key])) {
4193
+ return false;
4194
+ }
4246
4195
  }
4247
4196
  return hasOwn(rawSetupState, key);
4248
4197
  };
@@ -4539,7 +4488,11 @@ function createHydrationFunctions(rendererInternals) {
4539
4488
  }
4540
4489
  let needCallTransitionHooks = false;
4541
4490
  if (isTemplateNode(el)) {
4542
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4491
+ needCallTransitionHooks = needTransition(
4492
+ null,
4493
+ // no need check parentSuspense in hydration
4494
+ transition
4495
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4543
4496
  const content = el.content.firstChild;
4544
4497
  if (needCallTransitionHooks) {
4545
4498
  transition.beforeEnter(content);
@@ -4932,6 +4885,8 @@ function isMismatchAllowed(el, allowedType) {
4932
4885
  }
4933
4886
  }
4934
4887
 
4888
+ const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
4889
+ const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
4935
4890
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
4936
4891
  const id = requestIdleCallback(hydrate, { timeout });
4937
4892
  return () => cancelIdleCallback(id);
@@ -5925,12 +5880,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5925
5880
  }
5926
5881
  openBlock();
5927
5882
  const validSlotContent = slot && ensureValidVNode(slot(props));
5883
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5884
+ // key attached in the `createSlots` helper, respect that
5885
+ validSlotContent && validSlotContent.key;
5928
5886
  const rendered = createBlock(
5929
5887
  Fragment,
5930
5888
  {
5931
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
5932
- // key attached in the `createSlots` helper, respect that
5933
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
5889
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
5934
5890
  (!validSlotContent && fallback ? "_fb" : "")
5935
5891
  },
5936
5892
  validSlotContent || (fallback ? fallback() : []),
@@ -7099,7 +7055,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7099
7055
  return vm;
7100
7056
  }
7101
7057
  }
7102
- Vue.version = `2.6.14-compat:${"3.5.10"}`;
7058
+ Vue.version = `2.6.14-compat:${"3.5.12"}`;
7103
7059
  Vue.config = singletonApp.config;
7104
7060
  Vue.use = (plugin, ...options) => {
7105
7061
  if (plugin && isFunction(plugin.install)) {
@@ -8087,6 +8043,7 @@ function getType(ctor) {
8087
8043
  function validateProps(rawProps, props, instance) {
8088
8044
  const resolvedValues = toRaw(props);
8089
8045
  const options = instance.propsOptions[0];
8046
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
8090
8047
  for (const key in options) {
8091
8048
  let opt = options[key];
8092
8049
  if (opt == null) continue;
@@ -8095,7 +8052,7 @@ function validateProps(rawProps, props, instance) {
8095
8052
  resolvedValues[key],
8096
8053
  opt,
8097
8054
  shallowReadonly(resolvedValues) ,
8098
- !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
8055
+ !camelizePropsKey.includes(key)
8099
8056
  );
8100
8057
  }
8101
8058
  }
@@ -9909,14 +9866,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
9909
9866
  }
9910
9867
  const baseWatchOptions = extend({}, options);
9911
9868
  baseWatchOptions.onWarn = warn$1;
9869
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
9912
9870
  let ssrCleanup;
9913
9871
  if (isInSSRComponentSetup) {
9914
9872
  if (flush === "sync") {
9915
9873
  const ctx = useSSRContext();
9916
9874
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
9917
- } else if (!cb || immediate) {
9918
- baseWatchOptions.once = true;
9919
- } else {
9875
+ } else if (!runsImmediately) {
9920
9876
  const watchStopHandle = () => {
9921
9877
  };
9922
9878
  watchStopHandle.stop = NOOP;
@@ -9955,7 +9911,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
9955
9911
  }
9956
9912
  };
9957
9913
  const watchHandle = watch$1(source, cb, baseWatchOptions);
9958
- if (ssrCleanup) ssrCleanup.push(watchHandle);
9914
+ if (isInSSRComponentSetup) {
9915
+ if (ssrCleanup) {
9916
+ ssrCleanup.push(watchHandle);
9917
+ } else if (runsImmediately) {
9918
+ watchHandle();
9919
+ }
9920
+ }
9959
9921
  return watchHandle;
9960
9922
  }
9961
9923
  function instanceWatch(source, value, options) {
@@ -9990,19 +9952,19 @@ function useModel(props, name, options = EMPTY_OBJ) {
9990
9952
  warn$1(`useModel() called without active instance.`);
9991
9953
  return ref();
9992
9954
  }
9993
- if (!i.propsOptions[0][name]) {
9955
+ const camelizedName = camelize(name);
9956
+ if (!i.propsOptions[0][camelizedName]) {
9994
9957
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
9995
9958
  return ref();
9996
9959
  }
9997
- const camelizedName = camelize(name);
9998
9960
  const hyphenatedName = hyphenate(name);
9999
- const modifiers = getModelModifiers(props, name);
9961
+ const modifiers = getModelModifiers(props, camelizedName);
10000
9962
  const res = customRef((track, trigger) => {
10001
9963
  let localValue;
10002
9964
  let prevSetValue = EMPTY_OBJ;
10003
9965
  let prevEmittedValue;
10004
9966
  watchSyncEffect(() => {
10005
- const propValue = props[name];
9967
+ const propValue = props[camelizedName];
10006
9968
  if (hasChanged(localValue, propValue)) {
10007
9969
  localValue = propValue;
10008
9970
  trigger();
@@ -11724,9 +11686,9 @@ function setupStatefulComponent(instance, isSSR) {
11724
11686
  }
11725
11687
  const { setup } = Component;
11726
11688
  if (setup) {
11689
+ pauseTracking();
11727
11690
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
11728
11691
  const reset = setCurrentInstance(instance);
11729
- pauseTracking();
11730
11692
  const setupResult = callWithErrorHandling(
11731
11693
  setup,
11732
11694
  instance,
@@ -11736,10 +11698,13 @@ function setupStatefulComponent(instance, isSSR) {
11736
11698
  setupContext
11737
11699
  ]
11738
11700
  );
11701
+ const isAsyncSetup = isPromise(setupResult);
11739
11702
  resetTracking();
11740
11703
  reset();
11741
- if (isPromise(setupResult)) {
11742
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
11704
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
11705
+ markAsyncBoundary(instance);
11706
+ }
11707
+ if (isAsyncSetup) {
11743
11708
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
11744
11709
  if (isSSR) {
11745
11710
  return setupResult.then((resolvedResult) => {
@@ -12214,7 +12179,7 @@ function isMemoSame(cached, memo) {
12214
12179
  return true;
12215
12180
  }
12216
12181
 
12217
- const version = "3.5.10";
12182
+ const version = "3.5.12";
12218
12183
  const warn = warn$1 ;
12219
12184
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12220
12185
  const devtools = devtools$1 ;
@@ -12919,7 +12884,7 @@ function compatCoerceAttr(el, key, value, instance = null) {
12919
12884
  return false;
12920
12885
  }
12921
12886
 
12922
- function patchDOMProp(el, key, value, parentComponent) {
12887
+ function patchDOMProp(el, key, value, parentComponent, attrName) {
12923
12888
  if (key === "innerHTML" || key === "textContent") {
12924
12889
  if (value != null) {
12925
12890
  el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
@@ -12983,7 +12948,7 @@ function patchDOMProp(el, key, value, parentComponent) {
12983
12948
  );
12984
12949
  }
12985
12950
  }
12986
- needRemove && el.removeAttribute(key);
12951
+ needRemove && el.removeAttribute(attrName || key);
12987
12952
  }
12988
12953
 
12989
12954
  function addEventListener(el, event, handler, options) {
@@ -13093,7 +13058,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
13093
13058
  // #11081 force set props for possible async custom element
13094
13059
  el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
13095
13060
  ) {
13096
- patchDOMProp(el, camelize(key), nextValue, parentComponent);
13061
+ patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
13097
13062
  } else {
13098
13063
  if (key === "true-value") {
13099
13064
  el._trueValue = nextValue;
@@ -13820,7 +13785,7 @@ const vModelCheckbox = {
13820
13785
  setChecked(el, binding, vnode);
13821
13786
  }
13822
13787
  };
13823
- function setChecked(el, { value }, vnode) {
13788
+ function setChecked(el, { value, oldValue }, vnode) {
13824
13789
  el._modelValue = value;
13825
13790
  let checked;
13826
13791
  if (isArray(value)) {
@@ -13828,6 +13793,7 @@ function setChecked(el, { value }, vnode) {
13828
13793
  } else if (isSet(value)) {
13829
13794
  checked = value.has(vnode.props.value);
13830
13795
  } else {
13796
+ if (value === oldValue) return;
13831
13797
  checked = looseEqual(value, getCheckboxValue(el, true));
13832
13798
  }
13833
13799
  if (el.checked !== checked) {