@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 (!!(process.env.NODE_ENV !== "production") && 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
  }
@@ -957,7 +963,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
957
963
  }
958
964
  });
959
965
  } else {
960
- if (key !== void 0) {
966
+ if (key !== void 0 || depsMap.has(void 0)) {
961
967
  run(depsMap.get(key));
962
968
  }
963
969
  if (isArrayIndex) {
@@ -1332,117 +1338,6 @@ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true
1332
1338
 
1333
1339
  const toShallow = (value) => value;
1334
1340
  const getProto = (v) => Reflect.getPrototypeOf(v);
1335
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
1336
- target = target["__v_raw"];
1337
- const rawTarget = toRaw(target);
1338
- const rawKey = toRaw(key);
1339
- if (!isReadonly2) {
1340
- if (hasChanged(key, rawKey)) {
1341
- track(rawTarget, "get", key);
1342
- }
1343
- track(rawTarget, "get", rawKey);
1344
- }
1345
- const { has: has2 } = getProto(rawTarget);
1346
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1347
- if (has2.call(rawTarget, key)) {
1348
- return wrap(target.get(key));
1349
- } else if (has2.call(rawTarget, rawKey)) {
1350
- return wrap(target.get(rawKey));
1351
- } else if (target !== rawTarget) {
1352
- target.get(key);
1353
- }
1354
- }
1355
- function has(key, isReadonly2 = false) {
1356
- const target = this["__v_raw"];
1357
- const rawTarget = toRaw(target);
1358
- const rawKey = toRaw(key);
1359
- if (!isReadonly2) {
1360
- if (hasChanged(key, rawKey)) {
1361
- track(rawTarget, "has", key);
1362
- }
1363
- track(rawTarget, "has", rawKey);
1364
- }
1365
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1366
- }
1367
- function size(target, isReadonly2 = false) {
1368
- target = target["__v_raw"];
1369
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
1370
- return Reflect.get(target, "size", target);
1371
- }
1372
- function add(value, _isShallow = false) {
1373
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1374
- value = toRaw(value);
1375
- }
1376
- const target = toRaw(this);
1377
- const proto = getProto(target);
1378
- const hadKey = proto.has.call(target, value);
1379
- if (!hadKey) {
1380
- target.add(value);
1381
- trigger(target, "add", value, value);
1382
- }
1383
- return this;
1384
- }
1385
- function set(key, value, _isShallow = false) {
1386
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
1387
- value = toRaw(value);
1388
- }
1389
- const target = toRaw(this);
1390
- const { has: has2, get: get2 } = getProto(target);
1391
- let hadKey = has2.call(target, key);
1392
- if (!hadKey) {
1393
- key = toRaw(key);
1394
- hadKey = has2.call(target, key);
1395
- } else if (!!(process.env.NODE_ENV !== "production")) {
1396
- checkIdentityKeys(target, has2, key);
1397
- }
1398
- const oldValue = get2.call(target, key);
1399
- target.set(key, value);
1400
- if (!hadKey) {
1401
- trigger(target, "add", key, value);
1402
- } else if (hasChanged(value, oldValue)) {
1403
- trigger(target, "set", key, value, oldValue);
1404
- }
1405
- return this;
1406
- }
1407
- function deleteEntry(key) {
1408
- const target = toRaw(this);
1409
- const { has: has2, get: get2 } = getProto(target);
1410
- let hadKey = has2.call(target, key);
1411
- if (!hadKey) {
1412
- key = toRaw(key);
1413
- hadKey = has2.call(target, key);
1414
- } else if (!!(process.env.NODE_ENV !== "production")) {
1415
- checkIdentityKeys(target, has2, key);
1416
- }
1417
- const oldValue = get2 ? get2.call(target, key) : void 0;
1418
- const result = target.delete(key);
1419
- if (hadKey) {
1420
- trigger(target, "delete", key, void 0, oldValue);
1421
- }
1422
- return result;
1423
- }
1424
- function clear() {
1425
- const target = toRaw(this);
1426
- const hadItems = target.size !== 0;
1427
- const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
1428
- const result = target.clear();
1429
- if (hadItems) {
1430
- trigger(target, "clear", void 0, void 0, oldTarget);
1431
- }
1432
- return result;
1433
- }
1434
- function createForEach(isReadonly2, isShallow2) {
1435
- return function forEach(callback, thisArg) {
1436
- const observed = this;
1437
- const target = observed["__v_raw"];
1438
- const rawTarget = toRaw(target);
1439
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
1440
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
1441
- return target.forEach((value, key) => {
1442
- return callback.call(thisArg, wrap(value), wrap(key), observed);
1443
- });
1444
- };
1445
- }
1446
1341
  function createIterableMethod(method, isReadonly2, isShallow2) {
1447
1342
  return function(...args) {
1448
1343
  const target = this["__v_raw"];
@@ -1485,71 +1380,134 @@ function createReadonlyMethod(type) {
1485
1380
  return type === "delete" ? false : type === "clear" ? void 0 : this;
1486
1381
  };
1487
1382
  }
1488
- function createInstrumentations() {
1489
- const mutableInstrumentations2 = {
1490
- get(key) {
1491
- return get(this, key);
1492
- },
1493
- get size() {
1494
- return size(this);
1495
- },
1496
- has,
1497
- add,
1498
- set,
1499
- delete: deleteEntry,
1500
- clear,
1501
- forEach: createForEach(false, false)
1502
- };
1503
- const shallowInstrumentations2 = {
1504
- get(key) {
1505
- return get(this, key, false, true);
1506
- },
1507
- get size() {
1508
- return size(this);
1509
- },
1510
- has,
1511
- add(value) {
1512
- return add.call(this, value, true);
1513
- },
1514
- set(key, value) {
1515
- return set.call(this, key, value, true);
1516
- },
1517
- delete: deleteEntry,
1518
- clear,
1519
- forEach: createForEach(false, true)
1520
- };
1521
- const readonlyInstrumentations2 = {
1522
- get(key) {
1523
- return get(this, key, true);
1524
- },
1525
- get size() {
1526
- return size(this, true);
1527
- },
1528
- has(key) {
1529
- return has.call(this, key, true);
1530
- },
1531
- add: createReadonlyMethod("add"),
1532
- set: createReadonlyMethod("set"),
1533
- delete: createReadonlyMethod("delete"),
1534
- clear: createReadonlyMethod("clear"),
1535
- forEach: createForEach(true, false)
1536
- };
1537
- const shallowReadonlyInstrumentations2 = {
1383
+ function createInstrumentations(readonly, shallow) {
1384
+ const instrumentations = {
1538
1385
  get(key) {
1539
- return get(this, key, true, true);
1386
+ const target = this["__v_raw"];
1387
+ const rawTarget = toRaw(target);
1388
+ const rawKey = toRaw(key);
1389
+ if (!readonly) {
1390
+ if (hasChanged(key, rawKey)) {
1391
+ track(rawTarget, "get", key);
1392
+ }
1393
+ track(rawTarget, "get", rawKey);
1394
+ }
1395
+ const { has } = getProto(rawTarget);
1396
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1397
+ if (has.call(rawTarget, key)) {
1398
+ return wrap(target.get(key));
1399
+ } else if (has.call(rawTarget, rawKey)) {
1400
+ return wrap(target.get(rawKey));
1401
+ } else if (target !== rawTarget) {
1402
+ target.get(key);
1403
+ }
1540
1404
  },
1541
1405
  get size() {
1542
- return size(this, true);
1406
+ const target = this["__v_raw"];
1407
+ !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1408
+ return Reflect.get(target, "size", target);
1543
1409
  },
1544
1410
  has(key) {
1545
- return has.call(this, key, true);
1411
+ const target = this["__v_raw"];
1412
+ const rawTarget = toRaw(target);
1413
+ const rawKey = toRaw(key);
1414
+ if (!readonly) {
1415
+ if (hasChanged(key, rawKey)) {
1416
+ track(rawTarget, "has", key);
1417
+ }
1418
+ track(rawTarget, "has", rawKey);
1419
+ }
1420
+ return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
1546
1421
  },
1547
- add: createReadonlyMethod("add"),
1548
- set: createReadonlyMethod("set"),
1549
- delete: createReadonlyMethod("delete"),
1550
- clear: createReadonlyMethod("clear"),
1551
- forEach: createForEach(true, true)
1422
+ forEach(callback, thisArg) {
1423
+ const observed = this;
1424
+ const target = observed["__v_raw"];
1425
+ const rawTarget = toRaw(target);
1426
+ const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
1427
+ !readonly && track(rawTarget, "iterate", ITERATE_KEY);
1428
+ return target.forEach((value, key) => {
1429
+ return callback.call(thisArg, wrap(value), wrap(key), observed);
1430
+ });
1431
+ }
1552
1432
  };
1433
+ extend(
1434
+ instrumentations,
1435
+ readonly ? {
1436
+ add: createReadonlyMethod("add"),
1437
+ set: createReadonlyMethod("set"),
1438
+ delete: createReadonlyMethod("delete"),
1439
+ clear: createReadonlyMethod("clear")
1440
+ } : {
1441
+ add(value) {
1442
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1443
+ value = toRaw(value);
1444
+ }
1445
+ const target = toRaw(this);
1446
+ const proto = getProto(target);
1447
+ const hadKey = proto.has.call(target, value);
1448
+ if (!hadKey) {
1449
+ target.add(value);
1450
+ trigger(target, "add", value, value);
1451
+ }
1452
+ return this;
1453
+ },
1454
+ set(key, value) {
1455
+ if (!shallow && !isShallow(value) && !isReadonly(value)) {
1456
+ value = toRaw(value);
1457
+ }
1458
+ const target = toRaw(this);
1459
+ const { has, get } = getProto(target);
1460
+ let hadKey = has.call(target, key);
1461
+ if (!hadKey) {
1462
+ key = toRaw(key);
1463
+ hadKey = has.call(target, key);
1464
+ } else if (!!(process.env.NODE_ENV !== "production")) {
1465
+ checkIdentityKeys(target, has, key);
1466
+ }
1467
+ const oldValue = get.call(target, key);
1468
+ target.set(key, value);
1469
+ if (!hadKey) {
1470
+ trigger(target, "add", key, value);
1471
+ } else if (hasChanged(value, oldValue)) {
1472
+ trigger(target, "set", key, value, oldValue);
1473
+ }
1474
+ return this;
1475
+ },
1476
+ delete(key) {
1477
+ const target = toRaw(this);
1478
+ const { has, get } = getProto(target);
1479
+ let hadKey = has.call(target, key);
1480
+ if (!hadKey) {
1481
+ key = toRaw(key);
1482
+ hadKey = has.call(target, key);
1483
+ } else if (!!(process.env.NODE_ENV !== "production")) {
1484
+ checkIdentityKeys(target, has, key);
1485
+ }
1486
+ const oldValue = get ? get.call(target, key) : void 0;
1487
+ const result = target.delete(key);
1488
+ if (hadKey) {
1489
+ trigger(target, "delete", key, void 0, oldValue);
1490
+ }
1491
+ return result;
1492
+ },
1493
+ clear() {
1494
+ const target = toRaw(this);
1495
+ const hadItems = target.size !== 0;
1496
+ const oldTarget = !!(process.env.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0;
1497
+ const result = target.clear();
1498
+ if (hadItems) {
1499
+ trigger(
1500
+ target,
1501
+ "clear",
1502
+ void 0,
1503
+ void 0,
1504
+ oldTarget
1505
+ );
1506
+ }
1507
+ return result;
1508
+ }
1509
+ }
1510
+ );
1553
1511
  const iteratorMethods = [
1554
1512
  "keys",
1555
1513
  "values",
@@ -1557,30 +1515,12 @@ function createInstrumentations() {
1557
1515
  Symbol.iterator
1558
1516
  ];
1559
1517
  iteratorMethods.forEach((method) => {
1560
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1561
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1562
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1563
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
1564
- method,
1565
- true,
1566
- true
1567
- );
1518
+ instrumentations[method] = createIterableMethod(method, readonly, shallow);
1568
1519
  });
1569
- return [
1570
- mutableInstrumentations2,
1571
- readonlyInstrumentations2,
1572
- shallowInstrumentations2,
1573
- shallowReadonlyInstrumentations2
1574
- ];
1520
+ return instrumentations;
1575
1521
  }
1576
- const [
1577
- mutableInstrumentations,
1578
- readonlyInstrumentations,
1579
- shallowInstrumentations,
1580
- shallowReadonlyInstrumentations
1581
- ] = /* @__PURE__ */ createInstrumentations();
1582
1522
  function createInstrumentationGetter(isReadonly2, shallow) {
1583
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
1523
+ const instrumentations = createInstrumentations(isReadonly2, shallow);
1584
1524
  return (target, key, receiver) => {
1585
1525
  if (key === "__v_isReactive") {
1586
1526
  return !isReadonly2;
@@ -1608,9 +1548,9 @@ const readonlyCollectionHandlers = {
1608
1548
  const shallowReadonlyCollectionHandlers = {
1609
1549
  get: /* @__PURE__ */ createInstrumentationGetter(true, true)
1610
1550
  };
1611
- function checkIdentityKeys(target, has2, key) {
1551
+ function checkIdentityKeys(target, has, key) {
1612
1552
  const rawKey = toRaw(key);
1613
- if (rawKey !== key && has2.call(target, rawKey)) {
1553
+ if (rawKey !== key && has.call(target, rawKey)) {
1614
1554
  const type = toRawType(target);
1615
1555
  warn$2(
1616
1556
  `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.`
@@ -1952,7 +1892,7 @@ class ComputedRefImpl {
1952
1892
  this.flags |= 16;
1953
1893
  if (!(this.flags & 8) && // avoid infinite self recursion
1954
1894
  activeSub !== this) {
1955
- batch(this);
1895
+ batch(this, true);
1956
1896
  return true;
1957
1897
  } else if (!!(process.env.NODE_ENV !== "production")) ;
1958
1898
  }
@@ -2479,10 +2419,8 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
2479
2419
  }
2480
2420
  }
2481
2421
 
2482
- let isFlushing = false;
2483
- let isFlushPending = false;
2484
2422
  const queue = [];
2485
- let flushIndex = 0;
2423
+ let flushIndex = -1;
2486
2424
  const pendingPostFlushCbs = [];
2487
2425
  let activePostFlushCbs = null;
2488
2426
  let postFlushIndex = 0;
@@ -2494,7 +2432,7 @@ function nextTick(fn) {
2494
2432
  return fn ? p.then(this ? fn.bind(this) : fn) : p;
2495
2433
  }
2496
2434
  function findInsertionIndex(id) {
2497
- let start = isFlushing ? flushIndex + 1 : 0;
2435
+ let start = flushIndex + 1;
2498
2436
  let end = queue.length;
2499
2437
  while (start < end) {
2500
2438
  const middle = start + end >>> 1;
@@ -2523,8 +2461,7 @@ function queueJob(job) {
2523
2461
  }
2524
2462
  }
2525
2463
  function queueFlush() {
2526
- if (!isFlushing && !isFlushPending) {
2527
- isFlushPending = true;
2464
+ if (!currentFlushPromise) {
2528
2465
  currentFlushPromise = resolvedPromise.then(flushJobs);
2529
2466
  }
2530
2467
  }
@@ -2541,7 +2478,7 @@ function queuePostFlushCb(cb) {
2541
2478
  }
2542
2479
  queueFlush();
2543
2480
  }
2544
- function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
2481
+ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2545
2482
  if (!!(process.env.NODE_ENV !== "production")) {
2546
2483
  seen = seen || /* @__PURE__ */ new Map();
2547
2484
  }
@@ -2597,8 +2534,6 @@ function flushPostFlushCbs(seen) {
2597
2534
  }
2598
2535
  const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
2599
2536
  function flushJobs(seen) {
2600
- isFlushPending = false;
2601
- isFlushing = true;
2602
2537
  if (!!(process.env.NODE_ENV !== "production")) {
2603
2538
  seen = seen || /* @__PURE__ */ new Map();
2604
2539
  }
@@ -2630,10 +2565,9 @@ function flushJobs(seen) {
2630
2565
  job.flags &= ~1;
2631
2566
  }
2632
2567
  }
2633
- flushIndex = 0;
2568
+ flushIndex = -1;
2634
2569
  queue.length = 0;
2635
2570
  flushPostFlushCbs(seen);
2636
- isFlushing = false;
2637
2571
  currentFlushPromise = null;
2638
2572
  if (queue.length || pendingPostFlushCbs.length) {
2639
2573
  flushJobs(seen);
@@ -3584,7 +3518,7 @@ const TeleportImpl = {
3584
3518
  }
3585
3519
  if (!disabled) {
3586
3520
  mount(target, targetAnchor);
3587
- updateCssVars(n2);
3521
+ updateCssVars(n2, false);
3588
3522
  }
3589
3523
  } else if (!!(process.env.NODE_ENV !== "production") && !disabled) {
3590
3524
  warn$1(
@@ -3596,7 +3530,7 @@ const TeleportImpl = {
3596
3530
  };
3597
3531
  if (disabled) {
3598
3532
  mount(container, mainAnchor);
3599
- updateCssVars(n2);
3533
+ updateCssVars(n2, true);
3600
3534
  }
3601
3535
  if (isTeleportDeferred(n2.props)) {
3602
3536
  queuePostRenderEffect(mountToTarget, parentSuspense);
@@ -3686,7 +3620,7 @@ const TeleportImpl = {
3686
3620
  );
3687
3621
  }
3688
3622
  }
3689
- updateCssVars(n2);
3623
+ updateCssVars(n2, disabled);
3690
3624
  }
3691
3625
  },
3692
3626
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
@@ -3754,9 +3688,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3754
3688
  querySelector
3755
3689
  );
3756
3690
  if (target) {
3691
+ const disabled = isTeleportDisabled(vnode.props);
3757
3692
  const targetNode = target._lpa || target.firstChild;
3758
3693
  if (vnode.shapeFlag & 16) {
3759
- if (isTeleportDisabled(vnode.props)) {
3694
+ if (disabled) {
3760
3695
  vnode.anchor = hydrateChildren(
3761
3696
  nextSibling(node),
3762
3697
  vnode,
@@ -3797,16 +3732,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3797
3732
  );
3798
3733
  }
3799
3734
  }
3800
- updateCssVars(vnode);
3735
+ updateCssVars(vnode, disabled);
3801
3736
  }
3802
3737
  return vnode.anchor && nextSibling(vnode.anchor);
3803
3738
  }
3804
3739
  const Teleport = TeleportImpl;
3805
- function updateCssVars(vnode) {
3740
+ function updateCssVars(vnode, isDisabled) {
3806
3741
  const ctx = vnode.ctx;
3807
3742
  if (ctx && ctx.ut) {
3808
- let node = vnode.targetStart;
3809
- while (node && node !== vnode.targetAnchor) {
3743
+ let node, anchor;
3744
+ if (isDisabled) {
3745
+ node = vnode.el;
3746
+ anchor = vnode.anchor;
3747
+ } else {
3748
+ node = vnode.targetStart;
3749
+ anchor = vnode.targetAnchor;
3750
+ }
3751
+ while (node && node !== anchor) {
3810
3752
  if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
3811
3753
  node = node.nextSibling;
3812
3754
  }
@@ -4260,8 +4202,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4260
4202
  const setupState = owner.setupState;
4261
4203
  const rawSetupState = toRaw(setupState);
4262
4204
  const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
4263
- if (!!(process.env.NODE_ENV !== "production") && knownTemplateRefs.has(rawSetupState[key])) {
4264
- return false;
4205
+ if (!!(process.env.NODE_ENV !== "production")) {
4206
+ if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4207
+ warn$1(
4208
+ `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
4209
+ );
4210
+ }
4211
+ if (knownTemplateRefs.has(rawSetupState[key])) {
4212
+ return false;
4213
+ }
4265
4214
  }
4266
4215
  return hasOwn(rawSetupState, key);
4267
4216
  };
@@ -4558,7 +4507,11 @@ function createHydrationFunctions(rendererInternals) {
4558
4507
  }
4559
4508
  let needCallTransitionHooks = false;
4560
4509
  if (isTemplateNode(el)) {
4561
- needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4510
+ needCallTransitionHooks = needTransition(
4511
+ null,
4512
+ // no need check parentSuspense in hydration
4513
+ transition
4514
+ ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
4562
4515
  const content = el.content.firstChild;
4563
4516
  if (needCallTransitionHooks) {
4564
4517
  transition.beforeEnter(content);
@@ -4962,6 +4915,8 @@ function isMismatchAllowed(el, allowedType) {
4962
4915
  }
4963
4916
  }
4964
4917
 
4918
+ const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
4919
+ const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
4965
4920
  const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
4966
4921
  const id = requestIdleCallback(hydrate, { timeout });
4967
4922
  return () => cancelIdleCallback(id);
@@ -5955,12 +5910,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5955
5910
  }
5956
5911
  openBlock();
5957
5912
  const validSlotContent = slot && ensureValidVNode(slot(props));
5913
+ const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5914
+ // key attached in the `createSlots` helper, respect that
5915
+ validSlotContent && validSlotContent.key;
5958
5916
  const rendered = createBlock(
5959
5917
  Fragment,
5960
5918
  {
5961
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
5962
- // key attached in the `createSlots` helper, respect that
5963
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
5919
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
5964
5920
  (!validSlotContent && fallback ? "_fb" : "")
5965
5921
  },
5966
5922
  validSlotContent || (fallback ? fallback() : []),
@@ -7131,7 +7087,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7131
7087
  return vm;
7132
7088
  }
7133
7089
  }
7134
- Vue.version = `2.6.14-compat:${"3.5.10"}`;
7090
+ Vue.version = `2.6.14-compat:${"3.5.12"}`;
7135
7091
  Vue.config = singletonApp.config;
7136
7092
  Vue.use = (plugin, ...options) => {
7137
7093
  if (plugin && isFunction(plugin.install)) {
@@ -8121,6 +8077,7 @@ function getType(ctor) {
8121
8077
  function validateProps(rawProps, props, instance) {
8122
8078
  const resolvedValues = toRaw(props);
8123
8079
  const options = instance.propsOptions[0];
8080
+ const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
8124
8081
  for (const key in options) {
8125
8082
  let opt = options[key];
8126
8083
  if (opt == null) continue;
@@ -8129,7 +8086,7 @@ function validateProps(rawProps, props, instance) {
8129
8086
  resolvedValues[key],
8130
8087
  opt,
8131
8088
  !!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues,
8132
- !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
8089
+ !camelizePropsKey.includes(key)
8133
8090
  );
8134
8091
  }
8135
8092
  }
@@ -9981,14 +9938,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
9981
9938
  }
9982
9939
  const baseWatchOptions = extend({}, options);
9983
9940
  if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
9941
+ const runsImmediately = cb && immediate || !cb && flush !== "post";
9984
9942
  let ssrCleanup;
9985
9943
  if (isInSSRComponentSetup) {
9986
9944
  if (flush === "sync") {
9987
9945
  const ctx = useSSRContext();
9988
9946
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
9989
- } else if (!cb || immediate) {
9990
- baseWatchOptions.once = true;
9991
- } else {
9947
+ } else if (!runsImmediately) {
9992
9948
  const watchStopHandle = () => {
9993
9949
  };
9994
9950
  watchStopHandle.stop = NOOP;
@@ -10027,7 +9983,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
10027
9983
  }
10028
9984
  };
10029
9985
  const watchHandle = watch$1(source, cb, baseWatchOptions);
10030
- if (ssrCleanup) ssrCleanup.push(watchHandle);
9986
+ if (isInSSRComponentSetup) {
9987
+ if (ssrCleanup) {
9988
+ ssrCleanup.push(watchHandle);
9989
+ } else if (runsImmediately) {
9990
+ watchHandle();
9991
+ }
9992
+ }
10031
9993
  return watchHandle;
10032
9994
  }
10033
9995
  function instanceWatch(source, value, options) {
@@ -10062,19 +10024,19 @@ function useModel(props, name, options = EMPTY_OBJ) {
10062
10024
  warn$1(`useModel() called without active instance.`);
10063
10025
  return ref();
10064
10026
  }
10065
- if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][name]) {
10027
+ const camelizedName = camelize(name);
10028
+ if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][camelizedName]) {
10066
10029
  warn$1(`useModel() called with prop "${name}" which is not declared.`);
10067
10030
  return ref();
10068
10031
  }
10069
- const camelizedName = camelize(name);
10070
10032
  const hyphenatedName = hyphenate(name);
10071
- const modifiers = getModelModifiers(props, name);
10033
+ const modifiers = getModelModifiers(props, camelizedName);
10072
10034
  const res = customRef((track, trigger) => {
10073
10035
  let localValue;
10074
10036
  let prevSetValue = EMPTY_OBJ;
10075
10037
  let prevEmittedValue;
10076
10038
  watchSyncEffect(() => {
10077
- const propValue = props[name];
10039
+ const propValue = props[camelizedName];
10078
10040
  if (hasChanged(localValue, propValue)) {
10079
10041
  localValue = propValue;
10080
10042
  trigger();
@@ -11798,9 +11760,9 @@ function setupStatefulComponent(instance, isSSR) {
11798
11760
  }
11799
11761
  const { setup } = Component;
11800
11762
  if (setup) {
11763
+ pauseTracking();
11801
11764
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
11802
11765
  const reset = setCurrentInstance(instance);
11803
- pauseTracking();
11804
11766
  const setupResult = callWithErrorHandling(
11805
11767
  setup,
11806
11768
  instance,
@@ -11810,10 +11772,13 @@ function setupStatefulComponent(instance, isSSR) {
11810
11772
  setupContext
11811
11773
  ]
11812
11774
  );
11775
+ const isAsyncSetup = isPromise(setupResult);
11813
11776
  resetTracking();
11814
11777
  reset();
11815
- if (isPromise(setupResult)) {
11816
- if (!isAsyncWrapper(instance)) markAsyncBoundary(instance);
11778
+ if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
11779
+ markAsyncBoundary(instance);
11780
+ }
11781
+ if (isAsyncSetup) {
11817
11782
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
11818
11783
  if (isSSR) {
11819
11784
  return setupResult.then((resolvedResult) => {
@@ -12300,7 +12265,7 @@ function isMemoSame(cached, memo) {
12300
12265
  return true;
12301
12266
  }
12302
12267
 
12303
- const version = "3.5.10";
12268
+ const version = "3.5.12";
12304
12269
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12305
12270
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12306
12271
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -13005,7 +12970,7 @@ function compatCoerceAttr(el, key, value, instance = null) {
13005
12970
  return false;
13006
12971
  }
13007
12972
 
13008
- function patchDOMProp(el, key, value, parentComponent) {
12973
+ function patchDOMProp(el, key, value, parentComponent, attrName) {
13009
12974
  if (key === "innerHTML" || key === "textContent") {
13010
12975
  if (value != null) {
13011
12976
  el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
@@ -13069,7 +13034,7 @@ function patchDOMProp(el, key, value, parentComponent) {
13069
13034
  );
13070
13035
  }
13071
13036
  }
13072
- needRemove && el.removeAttribute(key);
13037
+ needRemove && el.removeAttribute(attrName || key);
13073
13038
  }
13074
13039
 
13075
13040
  function addEventListener(el, event, handler, options) {
@@ -13179,7 +13144,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
13179
13144
  // #11081 force set props for possible async custom element
13180
13145
  el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
13181
13146
  ) {
13182
- patchDOMProp(el, camelize(key), nextValue, parentComponent);
13147
+ patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
13183
13148
  } else {
13184
13149
  if (key === "true-value") {
13185
13150
  el._trueValue = nextValue;
@@ -13906,7 +13871,7 @@ const vModelCheckbox = {
13906
13871
  setChecked(el, binding, vnode);
13907
13872
  }
13908
13873
  };
13909
- function setChecked(el, { value }, vnode) {
13874
+ function setChecked(el, { value, oldValue }, vnode) {
13910
13875
  el._modelValue = value;
13911
13876
  let checked;
13912
13877
  if (isArray(value)) {
@@ -13914,6 +13879,7 @@ function setChecked(el, { value }, vnode) {
13914
13879
  } else if (isSet(value)) {
13915
13880
  checked = value.has(vnode.props.value);
13916
13881
  } else {
13882
+ if (value === oldValue) return;
13917
13883
  checked = looseEqual(value, getCheckboxValue(el, true));
13918
13884
  }
13919
13885
  if (el.checked !== checked) {