@vue/compat 3.2.35 → 3.2.38

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.
@@ -638,7 +638,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
638
638
  return;
639
639
  }
640
640
  let deps = [];
641
- if (type === "clear" /* CLEAR */) {
641
+ if (type === "clear" /* TriggerOpTypes.CLEAR */) {
642
642
  // collection being cleared
643
643
  // trigger all effects for target
644
644
  deps = [...depsMap.values()];
@@ -657,7 +657,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
657
657
  }
658
658
  // also run for iteration key on ADD | DELETE | Map.SET
659
659
  switch (type) {
660
- case "add" /* ADD */:
660
+ case "add" /* TriggerOpTypes.ADD */:
661
661
  if (!isArray(target)) {
662
662
  deps.push(depsMap.get(ITERATE_KEY));
663
663
  if (isMap(target)) {
@@ -669,7 +669,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
669
669
  deps.push(depsMap.get('length'));
670
670
  }
671
671
  break;
672
- case "delete" /* DELETE */:
672
+ case "delete" /* TriggerOpTypes.DELETE */:
673
673
  if (!isArray(target)) {
674
674
  deps.push(depsMap.get(ITERATE_KEY));
675
675
  if (isMap(target)) {
@@ -677,7 +677,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
677
677
  }
678
678
  }
679
679
  break;
680
- case "set" /* SET */:
680
+ case "set" /* TriggerOpTypes.SET */:
681
681
  if (isMap(target)) {
682
682
  deps.push(depsMap.get(ITERATE_KEY));
683
683
  }
@@ -754,7 +754,7 @@ function createArrayInstrumentations() {
754
754
  instrumentations[key] = function (...args) {
755
755
  const arr = toRaw(this);
756
756
  for (let i = 0, l = this.length; i < l; i++) {
757
- track(arr, "get" /* GET */, i + '');
757
+ track(arr, "get" /* TrackOpTypes.GET */, i + '');
758
758
  }
759
759
  // we run the method using the original args first (which may be reactive)
760
760
  const res = arr[key](...args);
@@ -779,16 +779,16 @@ function createArrayInstrumentations() {
779
779
  }
780
780
  function createGetter(isReadonly = false, shallow = false) {
781
781
  return function get(target, key, receiver) {
782
- if (key === "__v_isReactive" /* IS_REACTIVE */) {
782
+ if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
783
783
  return !isReadonly;
784
784
  }
785
- else if (key === "__v_isReadonly" /* IS_READONLY */) {
785
+ else if (key === "__v_isReadonly" /* ReactiveFlags.IS_READONLY */) {
786
786
  return isReadonly;
787
787
  }
788
- else if (key === "__v_isShallow" /* IS_SHALLOW */) {
788
+ else if (key === "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */) {
789
789
  return shallow;
790
790
  }
791
- else if (key === "__v_raw" /* RAW */ &&
791
+ else if (key === "__v_raw" /* ReactiveFlags.RAW */ &&
792
792
  receiver ===
793
793
  (isReadonly
794
794
  ? shallow
@@ -808,7 +808,7 @@ function createGetter(isReadonly = false, shallow = false) {
808
808
  return res;
809
809
  }
810
810
  if (!isReadonly) {
811
- track(target, "get" /* GET */, key);
811
+ track(target, "get" /* TrackOpTypes.GET */, key);
812
812
  }
813
813
  if (shallow) {
814
814
  return res;
@@ -834,10 +834,10 @@ function createSetter(shallow = false) {
834
834
  if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
835
835
  return false;
836
836
  }
837
- if (!shallow && !isReadonly(value)) {
838
- if (!isShallow(value)) {
839
- value = toRaw(value);
837
+ if (!shallow) {
838
+ if (!isShallow(value) && !isReadonly(value)) {
840
839
  oldValue = toRaw(oldValue);
840
+ value = toRaw(value);
841
841
  }
842
842
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
843
843
  oldValue.value = value;
@@ -851,10 +851,10 @@ function createSetter(shallow = false) {
851
851
  // don't trigger if target is something up in the prototype chain of original
852
852
  if (target === toRaw(receiver)) {
853
853
  if (!hadKey) {
854
- trigger(target, "add" /* ADD */, key, value);
854
+ trigger(target, "add" /* TriggerOpTypes.ADD */, key, value);
855
855
  }
856
856
  else if (hasChanged(value, oldValue)) {
857
- trigger(target, "set" /* SET */, key, value, oldValue);
857
+ trigger(target, "set" /* TriggerOpTypes.SET */, key, value, oldValue);
858
858
  }
859
859
  }
860
860
  return result;
@@ -865,19 +865,19 @@ function deleteProperty(target, key) {
865
865
  const oldValue = target[key];
866
866
  const result = Reflect.deleteProperty(target, key);
867
867
  if (result && hadKey) {
868
- trigger(target, "delete" /* DELETE */, key, undefined, oldValue);
868
+ trigger(target, "delete" /* TriggerOpTypes.DELETE */, key, undefined, oldValue);
869
869
  }
870
870
  return result;
871
871
  }
872
872
  function has(target, key) {
873
873
  const result = Reflect.has(target, key);
874
874
  if (!isSymbol(key) || !builtInSymbols.has(key)) {
875
- track(target, "has" /* HAS */, key);
875
+ track(target, "has" /* TrackOpTypes.HAS */, key);
876
876
  }
877
877
  return result;
878
878
  }
879
879
  function ownKeys(target) {
880
- track(target, "iterate" /* ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);
880
+ track(target, "iterate" /* TrackOpTypes.ITERATE */, isArray(target) ? 'length' : ITERATE_KEY);
881
881
  return Reflect.ownKeys(target);
882
882
  }
883
883
  const mutableHandlers = {
@@ -918,14 +918,14 @@ const getProto = (v) => Reflect.getPrototypeOf(v);
918
918
  function get$1(target, key, isReadonly = false, isShallow = false) {
919
919
  // #1772: readonly(reactive(Map)) should return readonly + reactive version
920
920
  // of the value
921
- target = target["__v_raw" /* RAW */];
921
+ target = target["__v_raw" /* ReactiveFlags.RAW */];
922
922
  const rawTarget = toRaw(target);
923
923
  const rawKey = toRaw(key);
924
924
  if (!isReadonly) {
925
925
  if (key !== rawKey) {
926
- track(rawTarget, "get" /* GET */, key);
926
+ track(rawTarget, "get" /* TrackOpTypes.GET */, key);
927
927
  }
928
- track(rawTarget, "get" /* GET */, rawKey);
928
+ track(rawTarget, "get" /* TrackOpTypes.GET */, rawKey);
929
929
  }
930
930
  const { has } = getProto(rawTarget);
931
931
  const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
@@ -942,22 +942,22 @@ function get$1(target, key, isReadonly = false, isShallow = false) {
942
942
  }
943
943
  }
944
944
  function has$1(key, isReadonly = false) {
945
- const target = this["__v_raw" /* RAW */];
945
+ const target = this["__v_raw" /* ReactiveFlags.RAW */];
946
946
  const rawTarget = toRaw(target);
947
947
  const rawKey = toRaw(key);
948
948
  if (!isReadonly) {
949
949
  if (key !== rawKey) {
950
- track(rawTarget, "has" /* HAS */, key);
950
+ track(rawTarget, "has" /* TrackOpTypes.HAS */, key);
951
951
  }
952
- track(rawTarget, "has" /* HAS */, rawKey);
952
+ track(rawTarget, "has" /* TrackOpTypes.HAS */, rawKey);
953
953
  }
954
954
  return key === rawKey
955
955
  ? target.has(key)
956
956
  : target.has(key) || target.has(rawKey);
957
957
  }
958
958
  function size(target, isReadonly = false) {
959
- target = target["__v_raw" /* RAW */];
960
- !isReadonly && track(toRaw(target), "iterate" /* ITERATE */, ITERATE_KEY);
959
+ target = target["__v_raw" /* ReactiveFlags.RAW */];
960
+ !isReadonly && track(toRaw(target), "iterate" /* TrackOpTypes.ITERATE */, ITERATE_KEY);
961
961
  return Reflect.get(target, 'size', target);
962
962
  }
963
963
  function add(value) {
@@ -967,7 +967,7 @@ function add(value) {
967
967
  const hadKey = proto.has.call(target, value);
968
968
  if (!hadKey) {
969
969
  target.add(value);
970
- trigger(target, "add" /* ADD */, value, value);
970
+ trigger(target, "add" /* TriggerOpTypes.ADD */, value, value);
971
971
  }
972
972
  return this;
973
973
  }
@@ -986,10 +986,10 @@ function set$1(key, value) {
986
986
  const oldValue = get.call(target, key);
987
987
  target.set(key, value);
988
988
  if (!hadKey) {
989
- trigger(target, "add" /* ADD */, key, value);
989
+ trigger(target, "add" /* TriggerOpTypes.ADD */, key, value);
990
990
  }
991
991
  else if (hasChanged(value, oldValue)) {
992
- trigger(target, "set" /* SET */, key, value, oldValue);
992
+ trigger(target, "set" /* TriggerOpTypes.SET */, key, value, oldValue);
993
993
  }
994
994
  return this;
995
995
  }
@@ -1008,7 +1008,7 @@ function deleteEntry(key) {
1008
1008
  // forward the operation before queueing reactions
1009
1009
  const result = target.delete(key);
1010
1010
  if (hadKey) {
1011
- trigger(target, "delete" /* DELETE */, key, undefined, oldValue);
1011
+ trigger(target, "delete" /* TriggerOpTypes.DELETE */, key, undefined, oldValue);
1012
1012
  }
1013
1013
  return result;
1014
1014
  }
@@ -1022,17 +1022,17 @@ function clear() {
1022
1022
  // forward the operation before queueing reactions
1023
1023
  const result = target.clear();
1024
1024
  if (hadItems) {
1025
- trigger(target, "clear" /* CLEAR */, undefined, undefined, oldTarget);
1025
+ trigger(target, "clear" /* TriggerOpTypes.CLEAR */, undefined, undefined, oldTarget);
1026
1026
  }
1027
1027
  return result;
1028
1028
  }
1029
1029
  function createForEach(isReadonly, isShallow) {
1030
1030
  return function forEach(callback, thisArg) {
1031
1031
  const observed = this;
1032
- const target = observed["__v_raw" /* RAW */];
1032
+ const target = observed["__v_raw" /* ReactiveFlags.RAW */];
1033
1033
  const rawTarget = toRaw(target);
1034
1034
  const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
1035
- !isReadonly && track(rawTarget, "iterate" /* ITERATE */, ITERATE_KEY);
1035
+ !isReadonly && track(rawTarget, "iterate" /* TrackOpTypes.ITERATE */, ITERATE_KEY);
1036
1036
  return target.forEach((value, key) => {
1037
1037
  // important: make sure the callback is
1038
1038
  // 1. invoked with the reactive map as `this` and 3rd arg
@@ -1043,7 +1043,7 @@ function createForEach(isReadonly, isShallow) {
1043
1043
  }
1044
1044
  function createIterableMethod(method, isReadonly, isShallow) {
1045
1045
  return function (...args) {
1046
- const target = this["__v_raw" /* RAW */];
1046
+ const target = this["__v_raw" /* ReactiveFlags.RAW */];
1047
1047
  const rawTarget = toRaw(target);
1048
1048
  const targetIsMap = isMap(rawTarget);
1049
1049
  const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);
@@ -1051,7 +1051,7 @@ function createIterableMethod(method, isReadonly, isShallow) {
1051
1051
  const innerIterator = target[method](...args);
1052
1052
  const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
1053
1053
  !isReadonly &&
1054
- track(rawTarget, "iterate" /* ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
1054
+ track(rawTarget, "iterate" /* TrackOpTypes.ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);
1055
1055
  // return a wrapped iterator which returns observed versions of the
1056
1056
  // values emitted from the real iterator
1057
1057
  return {
@@ -1078,7 +1078,7 @@ function createReadonlyMethod(type) {
1078
1078
  const key = args[0] ? `on key "${args[0]}" ` : ``;
1079
1079
  console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));
1080
1080
  }
1081
- return type === "delete" /* DELETE */ ? false : this;
1081
+ return type === "delete" /* TriggerOpTypes.DELETE */ ? false : this;
1082
1082
  };
1083
1083
  }
1084
1084
  function createInstrumentations() {
@@ -1120,10 +1120,10 @@ function createInstrumentations() {
1120
1120
  has(key) {
1121
1121
  return has$1.call(this, key, true);
1122
1122
  },
1123
- add: createReadonlyMethod("add" /* ADD */),
1124
- set: createReadonlyMethod("set" /* SET */),
1125
- delete: createReadonlyMethod("delete" /* DELETE */),
1126
- clear: createReadonlyMethod("clear" /* CLEAR */),
1123
+ add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
1124
+ set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
1125
+ delete: createReadonlyMethod("delete" /* TriggerOpTypes.DELETE */),
1126
+ clear: createReadonlyMethod("clear" /* TriggerOpTypes.CLEAR */),
1127
1127
  forEach: createForEach(true, false)
1128
1128
  };
1129
1129
  const shallowReadonlyInstrumentations = {
@@ -1136,10 +1136,10 @@ function createInstrumentations() {
1136
1136
  has(key) {
1137
1137
  return has$1.call(this, key, true);
1138
1138
  },
1139
- add: createReadonlyMethod("add" /* ADD */),
1140
- set: createReadonlyMethod("set" /* SET */),
1141
- delete: createReadonlyMethod("delete" /* DELETE */),
1142
- clear: createReadonlyMethod("clear" /* CLEAR */),
1139
+ add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
1140
+ set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
1141
+ delete: createReadonlyMethod("delete" /* TriggerOpTypes.DELETE */),
1142
+ clear: createReadonlyMethod("clear" /* TriggerOpTypes.CLEAR */),
1143
1143
  forEach: createForEach(true, true)
1144
1144
  };
1145
1145
  const iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator];
@@ -1166,13 +1166,13 @@ function createInstrumentationGetter(isReadonly, shallow) {
1166
1166
  ? readonlyInstrumentations
1167
1167
  : mutableInstrumentations;
1168
1168
  return (target, key, receiver) => {
1169
- if (key === "__v_isReactive" /* IS_REACTIVE */) {
1169
+ if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
1170
1170
  return !isReadonly;
1171
1171
  }
1172
- else if (key === "__v_isReadonly" /* IS_READONLY */) {
1172
+ else if (key === "__v_isReadonly" /* ReactiveFlags.IS_READONLY */) {
1173
1173
  return isReadonly;
1174
1174
  }
1175
- else if (key === "__v_raw" /* RAW */) {
1175
+ else if (key === "__v_raw" /* ReactiveFlags.RAW */) {
1176
1176
  return target;
1177
1177
  }
1178
1178
  return Reflect.get(hasOwn(instrumentations, key) && key in target
@@ -1212,19 +1212,19 @@ function targetTypeMap(rawType) {
1212
1212
  switch (rawType) {
1213
1213
  case 'Object':
1214
1214
  case 'Array':
1215
- return 1 /* COMMON */;
1215
+ return 1 /* TargetType.COMMON */;
1216
1216
  case 'Map':
1217
1217
  case 'Set':
1218
1218
  case 'WeakMap':
1219
1219
  case 'WeakSet':
1220
- return 2 /* COLLECTION */;
1220
+ return 2 /* TargetType.COLLECTION */;
1221
1221
  default:
1222
- return 0 /* INVALID */;
1222
+ return 0 /* TargetType.INVALID */;
1223
1223
  }
1224
1224
  }
1225
1225
  function getTargetType(value) {
1226
- return value["__v_skip" /* SKIP */] || !Object.isExtensible(value)
1227
- ? 0 /* INVALID */
1226
+ return value["__v_skip" /* ReactiveFlags.SKIP */] || !Object.isExtensible(value)
1227
+ ? 0 /* TargetType.INVALID */
1228
1228
  : targetTypeMap(toRawType(value));
1229
1229
  }
1230
1230
  function reactive(target) {
@@ -1267,8 +1267,8 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1267
1267
  }
1268
1268
  // target is already a Proxy, return it.
1269
1269
  // exception: calling readonly() on a reactive object
1270
- if (target["__v_raw" /* RAW */] &&
1271
- !(isReadonly && target["__v_isReactive" /* IS_REACTIVE */])) {
1270
+ if (target["__v_raw" /* ReactiveFlags.RAW */] &&
1271
+ !(isReadonly && target["__v_isReactive" /* ReactiveFlags.IS_REACTIVE */])) {
1272
1272
  return target;
1273
1273
  }
1274
1274
  // target already has corresponding Proxy
@@ -1278,34 +1278,34 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1278
1278
  }
1279
1279
  // only specific value types can be observed.
1280
1280
  const targetType = getTargetType(target);
1281
- if (targetType === 0 /* INVALID */) {
1281
+ if (targetType === 0 /* TargetType.INVALID */) {
1282
1282
  return target;
1283
1283
  }
1284
- const proxy = new Proxy(target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers);
1284
+ const proxy = new Proxy(target, targetType === 2 /* TargetType.COLLECTION */ ? collectionHandlers : baseHandlers);
1285
1285
  proxyMap.set(target, proxy);
1286
1286
  return proxy;
1287
1287
  }
1288
1288
  function isReactive(value) {
1289
1289
  if (isReadonly(value)) {
1290
- return isReactive(value["__v_raw" /* RAW */]);
1290
+ return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
1291
1291
  }
1292
- return !!(value && value["__v_isReactive" /* IS_REACTIVE */]);
1292
+ return !!(value && value["__v_isReactive" /* ReactiveFlags.IS_REACTIVE */]);
1293
1293
  }
1294
1294
  function isReadonly(value) {
1295
- return !!(value && value["__v_isReadonly" /* IS_READONLY */]);
1295
+ return !!(value && value["__v_isReadonly" /* ReactiveFlags.IS_READONLY */]);
1296
1296
  }
1297
1297
  function isShallow(value) {
1298
- return !!(value && value["__v_isShallow" /* IS_SHALLOW */]);
1298
+ return !!(value && value["__v_isShallow" /* ReactiveFlags.IS_SHALLOW */]);
1299
1299
  }
1300
1300
  function isProxy(value) {
1301
1301
  return isReactive(value) || isReadonly(value);
1302
1302
  }
1303
1303
  function toRaw(observed) {
1304
- const raw = observed && observed["__v_raw" /* RAW */];
1304
+ const raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
1305
1305
  return raw ? toRaw(raw) : observed;
1306
1306
  }
1307
1307
  function markRaw(value) {
1308
- def(value, "__v_skip" /* SKIP */, true);
1308
+ def(value, "__v_skip" /* ReactiveFlags.SKIP */, true);
1309
1309
  return value;
1310
1310
  }
1311
1311
  const toReactive = (value) => isObject(value) ? reactive(value) : value;
@@ -1317,7 +1317,7 @@ function trackRefValue(ref) {
1317
1317
  {
1318
1318
  trackEffects(ref.dep || (ref.dep = createDep()), {
1319
1319
  target: ref,
1320
- type: "get" /* GET */,
1320
+ type: "get" /* TrackOpTypes.GET */,
1321
1321
  key: 'value'
1322
1322
  });
1323
1323
  }
@@ -1329,7 +1329,7 @@ function triggerRefValue(ref, newVal) {
1329
1329
  {
1330
1330
  triggerEffects(ref.dep, {
1331
1331
  target: ref,
1332
- type: "set" /* SET */,
1332
+ type: "set" /* TriggerOpTypes.SET */,
1333
1333
  key: 'value',
1334
1334
  newValue: newVal
1335
1335
  });
@@ -1364,10 +1364,11 @@ class RefImpl {
1364
1364
  return this._value;
1365
1365
  }
1366
1366
  set value(newVal) {
1367
- newVal = this.__v_isShallow ? newVal : toRaw(newVal);
1367
+ const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
1368
+ newVal = useDirectValue ? newVal : toRaw(newVal);
1368
1369
  if (hasChanged(newVal, this._rawValue)) {
1369
1370
  this._rawValue = newVal;
1370
- this._value = this.__v_isShallow ? newVal : toReactive(newVal);
1371
+ this._value = useDirectValue ? newVal : toReactive(newVal);
1371
1372
  triggerRefValue(this, newVal);
1372
1373
  }
1373
1374
  }
@@ -1446,11 +1447,13 @@ function toRef(object, key, defaultValue) {
1446
1447
  : new ObjectRefImpl(object, key, defaultValue);
1447
1448
  }
1448
1449
 
1450
+ var _a;
1449
1451
  class ComputedRefImpl {
1450
1452
  constructor(getter, _setter, isReadonly, isSSR) {
1451
1453
  this._setter = _setter;
1452
1454
  this.dep = undefined;
1453
1455
  this.__v_isRef = true;
1456
+ this[_a] = false;
1454
1457
  this._dirty = true;
1455
1458
  this.effect = new ReactiveEffect(getter, () => {
1456
1459
  if (!this._dirty) {
@@ -1460,7 +1463,7 @@ class ComputedRefImpl {
1460
1463
  });
1461
1464
  this.effect.computed = this;
1462
1465
  this.effect.active = this._cacheable = !isSSR;
1463
- this["__v_isReadonly" /* IS_READONLY */] = isReadonly;
1466
+ this["__v_isReadonly" /* ReactiveFlags.IS_READONLY */] = isReadonly;
1464
1467
  }
1465
1468
  get value() {
1466
1469
  // the computed ref may get wrapped by other proxies e.g. readonly() #3376
@@ -1476,6 +1479,7 @@ class ComputedRefImpl {
1476
1479
  this._setter(newValue);
1477
1480
  }
1478
1481
  }
1482
+ _a = "__v_isReadonly" /* ReactiveFlags.IS_READONLY */;
1479
1483
  function computed(getterOrOptions, debugOptions, isSSR = false) {
1480
1484
  let getter;
1481
1485
  let setter;
@@ -1514,7 +1518,7 @@ function warn$1(msg, ...args) {
1514
1518
  const appWarnHandler = instance && instance.appContext.config.warnHandler;
1515
1519
  const trace = getComponentTrace();
1516
1520
  if (appWarnHandler) {
1517
- callWithErrorHandling(appWarnHandler, instance, 11 /* APP_WARN_HANDLER */, [
1521
+ callWithErrorHandling(appWarnHandler, instance, 11 /* ErrorCodes.APP_WARN_HANDLER */, [
1518
1522
  msg + args.join(''),
1519
1523
  instance && instance.proxy,
1520
1524
  trace
@@ -1614,35 +1618,35 @@ function formatProp(key, value, raw) {
1614
1618
  }
1615
1619
 
1616
1620
  const ErrorTypeStrings = {
1617
- ["sp" /* SERVER_PREFETCH */]: 'serverPrefetch hook',
1618
- ["bc" /* BEFORE_CREATE */]: 'beforeCreate hook',
1619
- ["c" /* CREATED */]: 'created hook',
1620
- ["bm" /* BEFORE_MOUNT */]: 'beforeMount hook',
1621
- ["m" /* MOUNTED */]: 'mounted hook',
1622
- ["bu" /* BEFORE_UPDATE */]: 'beforeUpdate hook',
1623
- ["u" /* UPDATED */]: 'updated',
1624
- ["bum" /* BEFORE_UNMOUNT */]: 'beforeUnmount hook',
1625
- ["um" /* UNMOUNTED */]: 'unmounted hook',
1626
- ["a" /* ACTIVATED */]: 'activated hook',
1627
- ["da" /* DEACTIVATED */]: 'deactivated hook',
1628
- ["ec" /* ERROR_CAPTURED */]: 'errorCaptured hook',
1629
- ["rtc" /* RENDER_TRACKED */]: 'renderTracked hook',
1630
- ["rtg" /* RENDER_TRIGGERED */]: 'renderTriggered hook',
1631
- [0 /* SETUP_FUNCTION */]: 'setup function',
1632
- [1 /* RENDER_FUNCTION */]: 'render function',
1633
- [2 /* WATCH_GETTER */]: 'watcher getter',
1634
- [3 /* WATCH_CALLBACK */]: 'watcher callback',
1635
- [4 /* WATCH_CLEANUP */]: 'watcher cleanup function',
1636
- [5 /* NATIVE_EVENT_HANDLER */]: 'native event handler',
1637
- [6 /* COMPONENT_EVENT_HANDLER */]: 'component event handler',
1638
- [7 /* VNODE_HOOK */]: 'vnode hook',
1639
- [8 /* DIRECTIVE_HOOK */]: 'directive hook',
1640
- [9 /* TRANSITION_HOOK */]: 'transition hook',
1641
- [10 /* APP_ERROR_HANDLER */]: 'app errorHandler',
1642
- [11 /* APP_WARN_HANDLER */]: 'app warnHandler',
1643
- [12 /* FUNCTION_REF */]: 'ref function',
1644
- [13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',
1645
- [14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
1621
+ ["sp" /* LifecycleHooks.SERVER_PREFETCH */]: 'serverPrefetch hook',
1622
+ ["bc" /* LifecycleHooks.BEFORE_CREATE */]: 'beforeCreate hook',
1623
+ ["c" /* LifecycleHooks.CREATED */]: 'created hook',
1624
+ ["bm" /* LifecycleHooks.BEFORE_MOUNT */]: 'beforeMount hook',
1625
+ ["m" /* LifecycleHooks.MOUNTED */]: 'mounted hook',
1626
+ ["bu" /* LifecycleHooks.BEFORE_UPDATE */]: 'beforeUpdate hook',
1627
+ ["u" /* LifecycleHooks.UPDATED */]: 'updated',
1628
+ ["bum" /* LifecycleHooks.BEFORE_UNMOUNT */]: 'beforeUnmount hook',
1629
+ ["um" /* LifecycleHooks.UNMOUNTED */]: 'unmounted hook',
1630
+ ["a" /* LifecycleHooks.ACTIVATED */]: 'activated hook',
1631
+ ["da" /* LifecycleHooks.DEACTIVATED */]: 'deactivated hook',
1632
+ ["ec" /* LifecycleHooks.ERROR_CAPTURED */]: 'errorCaptured hook',
1633
+ ["rtc" /* LifecycleHooks.RENDER_TRACKED */]: 'renderTracked hook',
1634
+ ["rtg" /* LifecycleHooks.RENDER_TRIGGERED */]: 'renderTriggered hook',
1635
+ [0 /* ErrorCodes.SETUP_FUNCTION */]: 'setup function',
1636
+ [1 /* ErrorCodes.RENDER_FUNCTION */]: 'render function',
1637
+ [2 /* ErrorCodes.WATCH_GETTER */]: 'watcher getter',
1638
+ [3 /* ErrorCodes.WATCH_CALLBACK */]: 'watcher callback',
1639
+ [4 /* ErrorCodes.WATCH_CLEANUP */]: 'watcher cleanup function',
1640
+ [5 /* ErrorCodes.NATIVE_EVENT_HANDLER */]: 'native event handler',
1641
+ [6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */]: 'component event handler',
1642
+ [7 /* ErrorCodes.VNODE_HOOK */]: 'vnode hook',
1643
+ [8 /* ErrorCodes.DIRECTIVE_HOOK */]: 'directive hook',
1644
+ [9 /* ErrorCodes.TRANSITION_HOOK */]: 'transition hook',
1645
+ [10 /* ErrorCodes.APP_ERROR_HANDLER */]: 'app errorHandler',
1646
+ [11 /* ErrorCodes.APP_WARN_HANDLER */]: 'app warnHandler',
1647
+ [12 /* ErrorCodes.FUNCTION_REF */]: 'ref function',
1648
+ [13 /* ErrorCodes.ASYNC_COMPONENT_LOADER */]: 'async component loader',
1649
+ [14 /* ErrorCodes.SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +
1646
1650
  'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core'
1647
1651
  };
1648
1652
  function callWithErrorHandling(fn, instance, type, args) {
@@ -1693,7 +1697,7 @@ function handleError(err, instance, type, throwInDev = true) {
1693
1697
  // app-level handling
1694
1698
  const appErrorHandler = instance.appContext.config.errorHandler;
1695
1699
  if (appErrorHandler) {
1696
- callWithErrorHandling(appErrorHandler, null, 10 /* APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
1700
+ callWithErrorHandling(appErrorHandler, null, 10 /* ErrorCodes.APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
1697
1701
  return;
1698
1702
  }
1699
1703
  }
@@ -1723,15 +1727,11 @@ let isFlushing = false;
1723
1727
  let isFlushPending = false;
1724
1728
  const queue = [];
1725
1729
  let flushIndex = 0;
1726
- const pendingPreFlushCbs = [];
1727
- let activePreFlushCbs = null;
1728
- let preFlushIndex = 0;
1729
1730
  const pendingPostFlushCbs = [];
1730
1731
  let activePostFlushCbs = null;
1731
1732
  let postFlushIndex = 0;
1732
1733
  const resolvedPromise = /*#__PURE__*/ Promise.resolve();
1733
1734
  let currentFlushPromise = null;
1734
- let currentPreFlushParentJob = null;
1735
1735
  const RECURSION_LIMIT = 100;
1736
1736
  function nextTick(fn) {
1737
1737
  const p = currentFlushPromise || resolvedPromise;
@@ -1759,9 +1759,8 @@ function queueJob(job) {
1759
1759
  // if the job is a watch() callback, the search will start with a +1 index to
1760
1760
  // allow it recursively trigger itself - it is the user's responsibility to
1761
1761
  // ensure it doesn't end up in an infinite loop.
1762
- if ((!queue.length ||
1763
- !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) &&
1764
- job !== currentPreFlushParentJob) {
1762
+ if (!queue.length ||
1763
+ !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) {
1765
1764
  if (job.id == null) {
1766
1765
  queue.push(job);
1767
1766
  }
@@ -1783,51 +1782,38 @@ function invalidateJob(job) {
1783
1782
  queue.splice(i, 1);
1784
1783
  }
1785
1784
  }
1786
- function queueCb(cb, activeQueue, pendingQueue, index) {
1785
+ function queuePostFlushCb(cb) {
1787
1786
  if (!isArray(cb)) {
1788
- if (!activeQueue ||
1789
- !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {
1790
- pendingQueue.push(cb);
1787
+ if (!activePostFlushCbs ||
1788
+ !activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) {
1789
+ pendingPostFlushCbs.push(cb);
1791
1790
  }
1792
1791
  }
1793
1792
  else {
1794
1793
  // if cb is an array, it is a component lifecycle hook which can only be
1795
1794
  // triggered by a job, which is already deduped in the main queue, so
1796
1795
  // we can skip duplicate check here to improve perf
1797
- pendingQueue.push(...cb);
1796
+ pendingPostFlushCbs.push(...cb);
1798
1797
  }
1799
1798
  queueFlush();
1800
1799
  }
1801
- function queuePreFlushCb(cb) {
1802
- queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);
1803
- }
1804
- function queuePostFlushCb(cb) {
1805
- queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);
1806
- }
1807
- function flushPreFlushCbs(seen, parentJob = null) {
1808
- if (pendingPreFlushCbs.length) {
1809
- currentPreFlushParentJob = parentJob;
1810
- activePreFlushCbs = [...new Set(pendingPreFlushCbs)];
1811
- pendingPreFlushCbs.length = 0;
1812
- {
1813
- seen = seen || new Map();
1814
- }
1815
- for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
1816
- if (checkRecursiveUpdates(seen, activePreFlushCbs[preFlushIndex])) {
1800
+ function flushPreFlushCbs(seen, i = flushIndex) {
1801
+ {
1802
+ seen = seen || new Map();
1803
+ }
1804
+ for (; i < queue.length; i++) {
1805
+ const cb = queue[i];
1806
+ if (cb && cb.pre) {
1807
+ if (checkRecursiveUpdates(seen, cb)) {
1817
1808
  continue;
1818
1809
  }
1819
- activePreFlushCbs[preFlushIndex]();
1810
+ queue.splice(i, 1);
1811
+ i--;
1812
+ cb();
1820
1813
  }
1821
- activePreFlushCbs = null;
1822
- preFlushIndex = 0;
1823
- currentPreFlushParentJob = null;
1824
- // recursively flush until it drains
1825
- flushPreFlushCbs(seen, parentJob);
1826
1814
  }
1827
1815
  }
1828
1816
  function flushPostFlushCbs(seen) {
1829
- // flush any pre cbs queued during the flush (e.g. pre watchers)
1830
- flushPreFlushCbs();
1831
1817
  if (pendingPostFlushCbs.length) {
1832
1818
  const deduped = [...new Set(pendingPostFlushCbs)];
1833
1819
  pendingPostFlushCbs.length = 0;
@@ -1852,13 +1838,22 @@ function flushPostFlushCbs(seen) {
1852
1838
  }
1853
1839
  }
1854
1840
  const getId = (job) => job.id == null ? Infinity : job.id;
1841
+ const comparator = (a, b) => {
1842
+ const diff = getId(a) - getId(b);
1843
+ if (diff === 0) {
1844
+ if (a.pre && !b.pre)
1845
+ return -1;
1846
+ if (b.pre && !a.pre)
1847
+ return 1;
1848
+ }
1849
+ return diff;
1850
+ };
1855
1851
  function flushJobs(seen) {
1856
1852
  isFlushPending = false;
1857
1853
  isFlushing = true;
1858
1854
  {
1859
1855
  seen = seen || new Map();
1860
1856
  }
1861
- flushPreFlushCbs(seen);
1862
1857
  // Sort queue before flush.
1863
1858
  // This ensures that:
1864
1859
  // 1. Components are updated from parent to child. (because parent is always
@@ -1866,7 +1861,7 @@ function flushJobs(seen) {
1866
1861
  // priority number)
1867
1862
  // 2. If a component is unmounted during a parent component's update,
1868
1863
  // its update can be skipped.
1869
- queue.sort((a, b) => getId(a) - getId(b));
1864
+ queue.sort(comparator);
1870
1865
  // conditional usage of checkRecursiveUpdate must be determined out of
1871
1866
  // try ... catch block since Rollup by default de-optimizes treeshaking
1872
1867
  // inside try-catch. This can leave all warning code unshaked. Although
@@ -1882,7 +1877,7 @@ function flushJobs(seen) {
1882
1877
  continue;
1883
1878
  }
1884
1879
  // console.log(`running:`, job.id)
1885
- callWithErrorHandling(job, null, 14 /* SCHEDULER */);
1880
+ callWithErrorHandling(job, null, 14 /* ErrorCodes.SCHEDULER */);
1886
1881
  }
1887
1882
  }
1888
1883
  }
@@ -1894,9 +1889,7 @@ function flushJobs(seen) {
1894
1889
  currentFlushPromise = null;
1895
1890
  // some postFlushCb queued jobs!
1896
1891
  // keep flushing until it drains.
1897
- if (queue.length ||
1898
- pendingPreFlushCbs.length ||
1899
- pendingPostFlushCbs.length) {
1892
+ if (queue.length || pendingPostFlushCbs.length) {
1900
1893
  flushJobs(seen);
1901
1894
  }
1902
1895
  }
@@ -2114,7 +2107,7 @@ function setDevtoolsHook(hook, target) {
2114
2107
  }
2115
2108
  }
2116
2109
  function devtoolsInitApp(app, version) {
2117
- emit("app:init" /* APP_INIT */, app, version, {
2110
+ emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
2118
2111
  Fragment,
2119
2112
  Text,
2120
2113
  Comment,
@@ -2122,88 +2115,88 @@ function devtoolsInitApp(app, version) {
2122
2115
  });
2123
2116
  }
2124
2117
  function devtoolsUnmountApp(app) {
2125
- emit("app:unmount" /* APP_UNMOUNT */, app);
2118
+ emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
2126
2119
  }
2127
- const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
2120
+ const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
2128
2121
  const devtoolsComponentUpdated =
2129
- /*#__PURE__*/ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
2122
+ /*#__PURE__*/ createDevtoolsComponentHook("component:updated" /* DevtoolsHooks.COMPONENT_UPDATED */);
2130
2123
  const devtoolsComponentRemoved =
2131
- /*#__PURE__*/ createDevtoolsComponentHook("component:removed" /* COMPONENT_REMOVED */);
2124
+ /*#__PURE__*/ createDevtoolsComponentHook("component:removed" /* DevtoolsHooks.COMPONENT_REMOVED */);
2132
2125
  function createDevtoolsComponentHook(hook) {
2133
2126
  return (component) => {
2134
2127
  emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
2135
2128
  };
2136
2129
  }
2137
- const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
2138
- const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
2130
+ const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
2131
+ const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
2139
2132
  function createDevtoolsPerformanceHook(hook) {
2140
2133
  return (component, type, time) => {
2141
2134
  emit(hook, component.appContext.app, component.uid, component, type, time);
2142
2135
  };
2143
2136
  }
2144
2137
  function devtoolsComponentEmit(component, event, params) {
2145
- emit("component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);
2138
+ emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
2146
2139
  }
2147
2140
 
2148
2141
  const deprecationData = {
2149
- ["GLOBAL_MOUNT" /* GLOBAL_MOUNT */]: {
2142
+ ["GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */]: {
2150
2143
  message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
2151
2144
  `option have been removed. Use createApp(RootComponent).mount() instead.`,
2152
2145
  link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#mounting-app-instance`
2153
2146
  },
2154
- ["GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */]: {
2147
+ ["GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */]: {
2155
2148
  message: `Vue detected directives on the mount container. ` +
2156
2149
  `In Vue 3, the container is no longer considered part of the template ` +
2157
2150
  `and will not be processed/replaced.`,
2158
2151
  link: `https://v3-migration.vuejs.org/breaking-changes/mount-changes.html`
2159
2152
  },
2160
- ["GLOBAL_EXTEND" /* GLOBAL_EXTEND */]: {
2153
+ ["GLOBAL_EXTEND" /* DeprecationTypes.GLOBAL_EXTEND */]: {
2161
2154
  message: `Vue.extend() has been removed in Vue 3. ` +
2162
2155
  `Use defineComponent() instead.`,
2163
2156
  link: `https://vuejs.org/api/general.html#definecomponent`
2164
2157
  },
2165
- ["GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */]: {
2158
+ ["GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */]: {
2166
2159
  message: `Vue.prototype is no longer available in Vue 3. ` +
2167
2160
  `Use app.config.globalProperties instead.`,
2168
2161
  link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#vue-prototype-replaced-by-config-globalproperties`
2169
2162
  },
2170
- ["GLOBAL_SET" /* GLOBAL_SET */]: {
2163
+ ["GLOBAL_SET" /* DeprecationTypes.GLOBAL_SET */]: {
2171
2164
  message: `Vue.set() has been removed as it is no longer needed in Vue 3. ` +
2172
2165
  `Simply use native JavaScript mutations.`
2173
2166
  },
2174
- ["GLOBAL_DELETE" /* GLOBAL_DELETE */]: {
2167
+ ["GLOBAL_DELETE" /* DeprecationTypes.GLOBAL_DELETE */]: {
2175
2168
  message: `Vue.delete() has been removed as it is no longer needed in Vue 3. ` +
2176
2169
  `Simply use native JavaScript mutations.`
2177
2170
  },
2178
- ["GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */]: {
2171
+ ["GLOBAL_OBSERVABLE" /* DeprecationTypes.GLOBAL_OBSERVABLE */]: {
2179
2172
  message: `Vue.observable() has been removed. ` +
2180
2173
  `Use \`import { reactive } from "vue"\` from Composition API instead.`,
2181
2174
  link: `https://vuejs.org/api/reactivity-core.html#reactive`
2182
2175
  },
2183
- ["GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */]: {
2176
+ ["GLOBAL_PRIVATE_UTIL" /* DeprecationTypes.GLOBAL_PRIVATE_UTIL */]: {
2184
2177
  message: `Vue.util has been removed. Please refactor to avoid its usage ` +
2185
2178
  `since it was an internal API even in Vue 2.`
2186
2179
  },
2187
- ["CONFIG_SILENT" /* CONFIG_SILENT */]: {
2180
+ ["CONFIG_SILENT" /* DeprecationTypes.CONFIG_SILENT */]: {
2188
2181
  message: `config.silent has been removed because it is not good practice to ` +
2189
2182
  `intentionally suppress warnings. You can use your browser console's ` +
2190
2183
  `filter features to focus on relevant messages.`
2191
2184
  },
2192
- ["CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */]: {
2185
+ ["CONFIG_DEVTOOLS" /* DeprecationTypes.CONFIG_DEVTOOLS */]: {
2193
2186
  message: `config.devtools has been removed. To enable devtools for ` +
2194
2187
  `production, configure the __VUE_PROD_DEVTOOLS__ compile-time flag.`,
2195
2188
  link: `https://github.com/vuejs/core/tree/main/packages/vue#bundler-build-feature-flags`
2196
2189
  },
2197
- ["CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */]: {
2190
+ ["CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */]: {
2198
2191
  message: `config.keyCodes has been removed. ` +
2199
2192
  `In Vue 3, you can directly use the kebab-case key names as v-on modifiers.`,
2200
2193
  link: `https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html`
2201
2194
  },
2202
- ["CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */]: {
2195
+ ["CONFIG_PRODUCTION_TIP" /* DeprecationTypes.CONFIG_PRODUCTION_TIP */]: {
2203
2196
  message: `config.productionTip has been removed.`,
2204
2197
  link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed`
2205
2198
  },
2206
- ["CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */]: {
2199
+ ["CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */]: {
2207
2200
  message: () => {
2208
2201
  let msg = `config.ignoredElements has been removed.`;
2209
2202
  if (isRuntimeOnly()) {
@@ -2216,35 +2209,35 @@ const deprecationData = {
2216
2209
  },
2217
2210
  link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-ignoredelements-is-now-config-iscustomelement`
2218
2211
  },
2219
- ["CONFIG_WHITESPACE" /* CONFIG_WHITESPACE */]: {
2212
+ ["CONFIG_WHITESPACE" /* DeprecationTypes.CONFIG_WHITESPACE */]: {
2220
2213
  // this warning is only relevant in the full build when using runtime
2221
2214
  // compilation, so it's put in the runtime compatConfig list.
2222
2215
  message: `Vue 3 compiler's whitespace option will default to "condense" instead of ` +
2223
2216
  `"preserve". To suppress this warning, provide an explicit value for ` +
2224
2217
  `\`config.compilerOptions.whitespace\`.`
2225
2218
  },
2226
- ["CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */]: {
2219
+ ["CONFIG_OPTION_MERGE_STRATS" /* DeprecationTypes.CONFIG_OPTION_MERGE_STRATS */]: {
2227
2220
  message: `config.optionMergeStrategies no longer exposes internal strategies. ` +
2228
2221
  `Use custom merge functions instead.`
2229
2222
  },
2230
- ["INSTANCE_SET" /* INSTANCE_SET */]: {
2223
+ ["INSTANCE_SET" /* DeprecationTypes.INSTANCE_SET */]: {
2231
2224
  message: `vm.$set() has been removed as it is no longer needed in Vue 3. ` +
2232
2225
  `Simply use native JavaScript mutations.`
2233
2226
  },
2234
- ["INSTANCE_DELETE" /* INSTANCE_DELETE */]: {
2227
+ ["INSTANCE_DELETE" /* DeprecationTypes.INSTANCE_DELETE */]: {
2235
2228
  message: `vm.$delete() has been removed as it is no longer needed in Vue 3. ` +
2236
2229
  `Simply use native JavaScript mutations.`
2237
2230
  },
2238
- ["INSTANCE_DESTROY" /* INSTANCE_DESTROY */]: {
2231
+ ["INSTANCE_DESTROY" /* DeprecationTypes.INSTANCE_DESTROY */]: {
2239
2232
  message: `vm.$destroy() has been removed. Use app.unmount() instead.`,
2240
2233
  link: `https://vuejs.org/api/application.html#app-unmount`
2241
2234
  },
2242
- ["INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */]: {
2235
+ ["INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */]: {
2243
2236
  message: `vm.$on/$once/$off() have been removed. ` +
2244
2237
  `Use an external event emitter library instead.`,
2245
2238
  link: `https://v3-migration.vuejs.org/breaking-changes/events-api.html`
2246
2239
  },
2247
- ["INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */]: {
2240
+ ["INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */]: {
2248
2241
  message: event => `"${event}" lifecycle events are no longer supported. From templates, ` +
2249
2242
  `use the "vnode" prefix instead of "hook:". For example, @${event} ` +
2250
2243
  `should be changed to @vnode-${event.slice(5)}. ` +
@@ -2252,23 +2245,23 @@ const deprecationData = {
2252
2245
  `hooks.`,
2253
2246
  link: `https://v3-migration.vuejs.org/breaking-changes/vnode-lifecycle-events.html`
2254
2247
  },
2255
- ["INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */]: {
2248
+ ["INSTANCE_CHILDREN" /* DeprecationTypes.INSTANCE_CHILDREN */]: {
2256
2249
  message: `vm.$children has been removed. Consider refactoring your logic ` +
2257
2250
  `to avoid relying on direct access to child components.`,
2258
2251
  link: `https://v3-migration.vuejs.org/breaking-changes/children.html`
2259
2252
  },
2260
- ["INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */]: {
2253
+ ["INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */]: {
2261
2254
  message: `vm.$listeners has been removed. In Vue 3, parent v-on listeners are ` +
2262
2255
  `included in vm.$attrs and it is no longer necessary to separately use ` +
2263
2256
  `v-on="$listeners" if you are already using v-bind="$attrs". ` +
2264
2257
  `(Note: the Vue 3 behavior only applies if this compat config is disabled)`,
2265
2258
  link: `https://v3-migration.vuejs.org/breaking-changes/listeners-removed.html`
2266
2259
  },
2267
- ["INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */]: {
2260
+ ["INSTANCE_SCOPED_SLOTS" /* DeprecationTypes.INSTANCE_SCOPED_SLOTS */]: {
2268
2261
  message: `vm.$scopedSlots has been removed. Use vm.$slots instead.`,
2269
2262
  link: `https://v3-migration.vuejs.org/breaking-changes/slots-unification.html`
2270
2263
  },
2271
- ["INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */]: {
2264
+ ["INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */]: {
2272
2265
  message: componentName => `Component <${componentName || 'Anonymous'}> has \`inheritAttrs: false\` but is ` +
2273
2266
  `relying on class/style fallthrough from parent. In Vue 3, class/style ` +
2274
2267
  `are now included in $attrs and will no longer fallthrough when ` +
@@ -2279,75 +2272,75 @@ const deprecationData = {
2279
2272
  `them on root via :class="$attrs.class".`,
2280
2273
  link: `https://v3-migration.vuejs.org/breaking-changes/attrs-includes-class-style.html`
2281
2274
  },
2282
- ["OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */]: {
2275
+ ["OPTIONS_DATA_FN" /* DeprecationTypes.OPTIONS_DATA_FN */]: {
2283
2276
  message: `The "data" option can no longer be a plain object. ` +
2284
2277
  `Always use a function.`,
2285
2278
  link: `https://v3-migration.vuejs.org/breaking-changes/data-option.html`
2286
2279
  },
2287
- ["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */]: {
2280
+ ["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */]: {
2288
2281
  message: (key) => `Detected conflicting key "${key}" when merging data option values. ` +
2289
2282
  `In Vue 3, data keys are merged shallowly and will override one another.`,
2290
2283
  link: `https://v3-migration.vuejs.org/breaking-changes/data-option.html#mixin-merge-behavior-change`
2291
2284
  },
2292
- ["OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */]: {
2285
+ ["OPTIONS_BEFORE_DESTROY" /* DeprecationTypes.OPTIONS_BEFORE_DESTROY */]: {
2293
2286
  message: `\`beforeDestroy\` has been renamed to \`beforeUnmount\`.`
2294
2287
  },
2295
- ["OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */]: {
2288
+ ["OPTIONS_DESTROYED" /* DeprecationTypes.OPTIONS_DESTROYED */]: {
2296
2289
  message: `\`destroyed\` has been renamed to \`unmounted\`.`
2297
2290
  },
2298
- ["WATCH_ARRAY" /* WATCH_ARRAY */]: {
2291
+ ["WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */]: {
2299
2292
  message: `"watch" option or vm.$watch on an array value will no longer ` +
2300
2293
  `trigger on array mutation unless the "deep" option is specified. ` +
2301
2294
  `If current usage is intended, you can disable the compat behavior and ` +
2302
2295
  `suppress this warning with:` +
2303
- `\n\n configureCompat({ ${"WATCH_ARRAY" /* WATCH_ARRAY */}: false })\n`,
2296
+ `\n\n configureCompat({ ${"WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */}: false })\n`,
2304
2297
  link: `https://v3-migration.vuejs.org/breaking-changes/watch.html`
2305
2298
  },
2306
- ["PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */]: {
2299
+ ["PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */]: {
2307
2300
  message: (key) => `props default value function no longer has access to "this". The compat ` +
2308
2301
  `build only offers access to this.$options.` +
2309
2302
  `(found in prop "${key}")`,
2310
2303
  link: `https://v3-migration.vuejs.org/breaking-changes/props-default-this.html`
2311
2304
  },
2312
- ["CUSTOM_DIR" /* CUSTOM_DIR */]: {
2305
+ ["CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */]: {
2313
2306
  message: (legacyHook, newHook) => `Custom directive hook "${legacyHook}" has been removed. ` +
2314
2307
  `Use "${newHook}" instead.`,
2315
2308
  link: `https://v3-migration.vuejs.org/breaking-changes/custom-directives.html`
2316
2309
  },
2317
- ["V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */]: {
2310
+ ["V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */]: {
2318
2311
  message: `Using keyCode as v-on modifier is no longer supported. ` +
2319
2312
  `Use kebab-case key name modifiers instead.`,
2320
2313
  link: `https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html`
2321
2314
  },
2322
- ["ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */]: {
2315
+ ["ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */]: {
2323
2316
  message: (name) => `Attribute "${name}" with v-bind value \`false\` will render ` +
2324
2317
  `${name}="false" instead of removing it in Vue 3. To remove the attribute, ` +
2325
2318
  `use \`null\` or \`undefined\` instead. If the usage is intended, ` +
2326
2319
  `you can disable the compat behavior and suppress this warning with:` +
2327
- `\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */}: false })\n`,
2320
+ `\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */}: false })\n`,
2328
2321
  link: `https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html`
2329
2322
  },
2330
- ["ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */]: {
2323
+ ["ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */]: {
2331
2324
  message: (name, value, coerced) => `Enumerated attribute "${name}" with v-bind value \`${value}\` will ` +
2332
2325
  `${value === null ? `be removed` : `render the value as-is`} instead of coercing the value to "${coerced}" in Vue 3. ` +
2333
2326
  `Always use explicit "true" or "false" values for enumerated attributes. ` +
2334
2327
  `If the usage is intended, ` +
2335
2328
  `you can disable the compat behavior and suppress this warning with:` +
2336
- `\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */}: false })\n`,
2329
+ `\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */}: false })\n`,
2337
2330
  link: `https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html`
2338
2331
  },
2339
- ["TRANSITION_CLASSES" /* TRANSITION_CLASSES */]: {
2332
+ ["TRANSITION_CLASSES" /* DeprecationTypes.TRANSITION_CLASSES */]: {
2340
2333
  message: `` // this feature cannot be runtime-detected
2341
2334
  },
2342
- ["TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */]: {
2335
+ ["TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */]: {
2343
2336
  message: `<TransitionGroup> no longer renders a root <span> element by ` +
2344
2337
  `default if no "tag" prop is specified. If you do not rely on the span ` +
2345
2338
  `for styling, you can disable the compat behavior and suppress this ` +
2346
2339
  `warning with:` +
2347
- `\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */}: false })\n`,
2340
+ `\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */}: false })\n`,
2348
2341
  link: `https://v3-migration.vuejs.org/breaking-changes/transition-group.html`
2349
2342
  },
2350
- ["COMPONENT_ASYNC" /* COMPONENT_ASYNC */]: {
2343
+ ["COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */]: {
2351
2344
  message: (comp) => {
2352
2345
  const name = getComponentName(comp);
2353
2346
  return (`Async component${name ? ` <${name}>` : `s`} should be explicitly created via \`defineAsyncComponent()\` ` +
@@ -2356,11 +2349,11 @@ const deprecationData = {
2356
2349
  `usage and intend to use plain functions for functional components, ` +
2357
2350
  `you can disable the compat behavior and suppress this ` +
2358
2351
  `warning with:` +
2359
- `\n\n configureCompat({ ${"COMPONENT_ASYNC" /* COMPONENT_ASYNC */}: false })\n`);
2352
+ `\n\n configureCompat({ ${"COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */}: false })\n`);
2360
2353
  },
2361
2354
  link: `https://v3-migration.vuejs.org/breaking-changes/async-components.html`
2362
2355
  },
2363
- ["COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */]: {
2356
+ ["COMPONENT_FUNCTIONAL" /* DeprecationTypes.COMPONENT_FUNCTIONAL */]: {
2364
2357
  message: (comp) => {
2365
2358
  const name = getComponentName(comp);
2366
2359
  return (`Functional component${name ? ` <${name}>` : `s`} should be defined as a plain function in Vue 3. The "functional" ` +
@@ -2371,10 +2364,10 @@ const deprecationData = {
2371
2364
  },
2372
2365
  link: `https://v3-migration.vuejs.org/breaking-changes/functional-components.html`
2373
2366
  },
2374
- ["COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */]: {
2367
+ ["COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */]: {
2375
2368
  message: (comp) => {
2376
2369
  const configMsg = `opt-in to ` +
2377
- `Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */}: false }\`.`;
2370
+ `Vue 3 behavior on a per-component basis with \`compatConfig: { ${"COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */}: false }\`.`;
2378
2371
  if (comp.props &&
2379
2372
  (isArray(comp.props)
2380
2373
  ? comp.props.includes('modelValue')
@@ -2388,20 +2381,20 @@ const deprecationData = {
2388
2381
  },
2389
2382
  link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`
2390
2383
  },
2391
- ["RENDER_FUNCTION" /* RENDER_FUNCTION */]: {
2384
+ ["RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */]: {
2392
2385
  message: `Vue 3's render function API has changed. ` +
2393
2386
  `You can opt-in to the new API with:` +
2394
- `\n\n configureCompat({ ${"RENDER_FUNCTION" /* RENDER_FUNCTION */}: false })\n` +
2387
+ `\n\n configureCompat({ ${"RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */}: false })\n` +
2395
2388
  `\n (This can also be done per-component via the "compatConfig" option.)`,
2396
2389
  link: `https://v3-migration.vuejs.org/breaking-changes/render-function-api.html`
2397
2390
  },
2398
- ["FILTERS" /* FILTERS */]: {
2391
+ ["FILTERS" /* DeprecationTypes.FILTERS */]: {
2399
2392
  message: `filters have been removed in Vue 3. ` +
2400
2393
  `The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
2401
2394
  `Use method calls or computed properties instead.`,
2402
2395
  link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`
2403
2396
  },
2404
- ["PRIVATE_APIS" /* PRIVATE_APIS */]: {
2397
+ ["PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */]: {
2405
2398
  message: name => `"${name}" is a Vue 2 private API that no longer exists in Vue 3. ` +
2406
2399
  `If you are seeing this warning only due to a dependency, you can ` +
2407
2400
  `suppress this warning via { PRIVATE_APIS: 'suppress-warning' }.`
@@ -2476,8 +2469,8 @@ function validateCompatConfig(config, instance) {
2476
2469
  warnedInvalidKeys[key] = true;
2477
2470
  }
2478
2471
  }
2479
- if (instance && config["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */] != null) {
2480
- warn$1(`Deprecation config "${"OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */}" can only be configured globally.`);
2472
+ if (instance && config["OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */] != null) {
2473
+ warn$1(`Deprecation config "${"OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */}" can only be configured globally.`);
2481
2474
  }
2482
2475
  }
2483
2476
  function getCompatConfigForKey(key, instance) {
@@ -2552,10 +2545,10 @@ function on(instance, event, fn) {
2552
2545
  }
2553
2546
  else {
2554
2547
  if (event.startsWith('hook:')) {
2555
- assertCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance, event);
2548
+ assertCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance, event);
2556
2549
  }
2557
2550
  else {
2558
- assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */, instance);
2551
+ assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */, instance);
2559
2552
  }
2560
2553
  const events = getRegistry(instance);
2561
2554
  (events[event] || (events[event] = [])).push(fn);
@@ -2572,7 +2565,7 @@ function once(instance, event, fn) {
2572
2565
  return instance.proxy;
2573
2566
  }
2574
2567
  function off(instance, event, fn) {
2575
- assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */, instance);
2568
+ assertCompatEnabled("INSTANCE_EVENT_EMITTER" /* DeprecationTypes.INSTANCE_EVENT_EMITTER */, instance);
2576
2569
  const vm = instance.proxy;
2577
2570
  // all
2578
2571
  if (!event) {
@@ -2600,7 +2593,7 @@ function off(instance, event, fn) {
2600
2593
  function emit$1(instance, event, args) {
2601
2594
  const cbs = getRegistry(instance)[event];
2602
2595
  if (cbs) {
2603
- callWithAsyncErrorHandling(cbs.map(cb => cb.bind(instance.proxy)), instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
2596
+ callWithAsyncErrorHandling(cbs.map(cb => cb.bind(instance.proxy)), instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
2604
2597
  }
2605
2598
  return instance.proxy;
2606
2599
  }
@@ -2610,8 +2603,8 @@ const warnedTypes = new WeakSet();
2610
2603
  function convertLegacyVModelProps(vnode) {
2611
2604
  const { type, shapeFlag, props, dynamicProps } = vnode;
2612
2605
  const comp = type;
2613
- if (shapeFlag & 6 /* COMPONENT */ && props && 'modelValue' in props) {
2614
- if (!isCompatEnabled("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */,
2606
+ if (shapeFlag & 6 /* ShapeFlags.COMPONENT */ && props && 'modelValue' in props) {
2607
+ if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */,
2615
2608
  // this is a special case where we want to use the vnode component's
2616
2609
  // compat config instead of the current rendering instance (which is the
2617
2610
  // parent of the component that exposes v-model)
@@ -2620,7 +2613,7 @@ function convertLegacyVModelProps(vnode) {
2620
2613
  }
2621
2614
  if (!warnedTypes.has(comp)) {
2622
2615
  pushWarningContext(vnode);
2623
- warnDeprecation("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */, { type }, comp);
2616
+ warnDeprecation("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, { type }, comp);
2624
2617
  popWarningContext();
2625
2618
  warnedTypes.add(comp);
2626
2619
  }
@@ -2653,13 +2646,13 @@ function applyModelFromMixins(model, mixins) {
2653
2646
  }
2654
2647
  }
2655
2648
  function compatModelEmit(instance, event, args) {
2656
- if (!isCompatEnabled("COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */, instance)) {
2649
+ if (!isCompatEnabled("COMPONENT_V_MODEL" /* DeprecationTypes.COMPONENT_V_MODEL */, instance)) {
2657
2650
  return;
2658
2651
  }
2659
2652
  const props = instance.vnode.props;
2660
2653
  const modelHandler = props && props[compatModelEventPrefix + event];
2661
2654
  if (modelHandler) {
2662
- callWithErrorHandling(modelHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
2655
+ callWithErrorHandling(modelHandler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
2663
2656
  }
2664
2657
  }
2665
2658
 
@@ -2726,7 +2719,7 @@ function emit$2(instance, event, ...rawArgs) {
2726
2719
  handler = props[(handlerName = toHandlerKey(hyphenate(event)))];
2727
2720
  }
2728
2721
  if (handler) {
2729
- callWithAsyncErrorHandling(handler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
2722
+ callWithAsyncErrorHandling(handler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
2730
2723
  }
2731
2724
  const onceHandler = props[handlerName + `Once`];
2732
2725
  if (onceHandler) {
@@ -2737,7 +2730,7 @@ function emit$2(instance, event, ...rawArgs) {
2737
2730
  return;
2738
2731
  }
2739
2732
  instance.emitted[handlerName] = true;
2740
- callWithAsyncErrorHandling(onceHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);
2733
+ callWithAsyncErrorHandling(onceHandler, instance, 6 /* ErrorCodes.COMPONENT_EVENT_HANDLER */, args);
2741
2734
  }
2742
2735
  {
2743
2736
  compatModelEmit(instance, event, args);
@@ -2773,7 +2766,9 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
2773
2766
  }
2774
2767
  }
2775
2768
  if (!raw && !hasExtends) {
2776
- cache.set(comp, null);
2769
+ if (isObject(comp)) {
2770
+ cache.set(comp, null);
2771
+ }
2777
2772
  return null;
2778
2773
  }
2779
2774
  if (isArray(raw)) {
@@ -2782,7 +2777,9 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
2782
2777
  else {
2783
2778
  extend(normalized, raw);
2784
2779
  }
2785
- cache.set(comp, normalized);
2780
+ if (isObject(comp)) {
2781
+ cache.set(comp, normalized);
2782
+ }
2786
2783
  return normalized;
2787
2784
  }
2788
2785
  // Check if an incoming prop key is a declared emit event listener.
@@ -2912,7 +2909,7 @@ function renderComponentRoot(instance) {
2912
2909
  accessedAttrs = false;
2913
2910
  }
2914
2911
  try {
2915
- if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
2912
+ if (vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) {
2916
2913
  // withProxy is a proxy with a different `has` trap only for
2917
2914
  // runtime-compiled render functions using `with` block.
2918
2915
  const proxyToUse = withProxy || proxy;
@@ -2945,7 +2942,7 @@ function renderComponentRoot(instance) {
2945
2942
  }
2946
2943
  catch (err) {
2947
2944
  blockStack.length = 0;
2948
- handleError(err, instance, 1 /* RENDER_FUNCTION */);
2945
+ handleError(err, instance, 1 /* ErrorCodes.RENDER_FUNCTION */);
2949
2946
  result = createVNode(Comment);
2950
2947
  }
2951
2948
  // attr merging
@@ -2954,14 +2951,14 @@ function renderComponentRoot(instance) {
2954
2951
  let root = result;
2955
2952
  let setRoot = undefined;
2956
2953
  if (result.patchFlag > 0 &&
2957
- result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
2954
+ result.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */) {
2958
2955
  [root, setRoot] = getChildRoot(result);
2959
2956
  }
2960
2957
  if (fallthroughAttrs && inheritAttrs !== false) {
2961
2958
  const keys = Object.keys(fallthroughAttrs);
2962
2959
  const { shapeFlag } = root;
2963
2960
  if (keys.length) {
2964
- if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2961
+ if (shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
2965
2962
  if (propsOptions && keys.some(isModelListener)) {
2966
2963
  // If a v-model listener (onUpdate:xxx) has a corresponding declared
2967
2964
  // prop, it indicates this component expects to handle v-model and
@@ -3006,13 +3003,13 @@ function renderComponentRoot(instance) {
3006
3003
  }
3007
3004
  }
3008
3005
  }
3009
- if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
3010
- vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
3011
- root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
3006
+ if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
3007
+ vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ &&
3008
+ root.shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 6 /* ShapeFlags.COMPONENT */)) {
3012
3009
  const { class: cls, style } = vnode.props || {};
3013
3010
  if (cls || style) {
3014
3011
  if (inheritAttrs === false) {
3015
- warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
3012
+ warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
3016
3013
  }
3017
3014
  root = cloneVNode(root, {
3018
3015
  class: cls,
@@ -3116,7 +3113,7 @@ const filterModelListeners = (attrs, props) => {
3116
3113
  return res;
3117
3114
  };
3118
3115
  const isElementRoot = (vnode) => {
3119
- return (vnode.shapeFlag & (6 /* COMPONENT */ | 1 /* ELEMENT */) ||
3116
+ return (vnode.shapeFlag & (6 /* ShapeFlags.COMPONENT */ | 1 /* ShapeFlags.ELEMENT */) ||
3120
3117
  vnode.type === Comment // potential v-if branch switch
3121
3118
  );
3122
3119
  };
@@ -3135,19 +3132,19 @@ function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
3135
3132
  return true;
3136
3133
  }
3137
3134
  if (optimized && patchFlag >= 0) {
3138
- if (patchFlag & 1024 /* DYNAMIC_SLOTS */) {
3135
+ if (patchFlag & 1024 /* PatchFlags.DYNAMIC_SLOTS */) {
3139
3136
  // slot content that references values that might have changed,
3140
3137
  // e.g. in a v-for
3141
3138
  return true;
3142
3139
  }
3143
- if (patchFlag & 16 /* FULL_PROPS */) {
3140
+ if (patchFlag & 16 /* PatchFlags.FULL_PROPS */) {
3144
3141
  if (!prevProps) {
3145
3142
  return !!nextProps;
3146
3143
  }
3147
3144
  // presence of this flag indicates props are always non-null
3148
3145
  return hasPropsChanged(prevProps, nextProps, emits);
3149
3146
  }
3150
- else if (patchFlag & 8 /* PROPS */) {
3147
+ else if (patchFlag & 8 /* PatchFlags.PROPS */) {
3151
3148
  const dynamicProps = nextVNode.dynamicProps;
3152
3149
  for (let i = 0; i < dynamicProps.length; i++) {
3153
3150
  const key = dynamicProps[i];
@@ -3405,7 +3402,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
3405
3402
  if (delayEnter) {
3406
3403
  activeBranch.transition.afterLeave = () => {
3407
3404
  if (pendingId === suspense.pendingId) {
3408
- move(pendingBranch, container, anchor, 0 /* ENTER */);
3405
+ move(pendingBranch, container, anchor, 0 /* MoveType.ENTER */);
3409
3406
  }
3410
3407
  };
3411
3408
  }
@@ -3420,7 +3417,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
3420
3417
  }
3421
3418
  if (!delayEnter) {
3422
3419
  // move content from off-dom container to actual container
3423
- move(pendingBranch, container, anchor, 0 /* ENTER */);
3420
+ move(pendingBranch, container, anchor, 0 /* MoveType.ENTER */);
3424
3421
  }
3425
3422
  }
3426
3423
  setActiveBranch(suspense, pendingBranch);
@@ -3494,7 +3491,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
3494
3491
  const hydratedEl = instance.vnode.el;
3495
3492
  instance
3496
3493
  .asyncDep.catch(err => {
3497
- handleError(err, instance, 0 /* SETUP_FUNCTION */);
3494
+ handleError(err, instance, 0 /* ErrorCodes.SETUP_FUNCTION */);
3498
3495
  })
3499
3496
  .then(asyncSetupResult => {
3500
3497
  // retry when the setup() promise resolves.
@@ -3568,7 +3565,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
3568
3565
  }
3569
3566
  function normalizeSuspenseChildren(vnode) {
3570
3567
  const { shapeFlag, children } = vnode;
3571
- const isSlotChildren = shapeFlag & 32 /* SLOTS_CHILDREN */;
3568
+ const isSlotChildren = shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */;
3572
3569
  vnode.ssContent = normalizeSuspenseSlot(isSlotChildren ? children.default : children);
3573
3570
  vnode.ssFallback = isSlotChildren
3574
3571
  ? normalizeSuspenseSlot(children.fallback)
@@ -3739,7 +3736,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3739
3736
  return traverse(s);
3740
3737
  }
3741
3738
  else if (isFunction(s)) {
3742
- return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */);
3739
+ return callWithErrorHandling(s, instance, 2 /* ErrorCodes.WATCH_GETTER */);
3743
3740
  }
3744
3741
  else {
3745
3742
  warnInvalidSource(s);
@@ -3749,7 +3746,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3749
3746
  else if (isFunction(source)) {
3750
3747
  if (cb) {
3751
3748
  // getter with cb
3752
- getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */);
3749
+ getter = () => callWithErrorHandling(source, instance, 2 /* ErrorCodes.WATCH_GETTER */);
3753
3750
  }
3754
3751
  else {
3755
3752
  // no cb -> simple effect
@@ -3760,7 +3757,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3760
3757
  if (cleanup) {
3761
3758
  cleanup();
3762
3759
  }
3763
- return callWithAsyncErrorHandling(source, instance, 3 /* WATCH_CALLBACK */, [onCleanup]);
3760
+ return callWithAsyncErrorHandling(source, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [onCleanup]);
3764
3761
  };
3765
3762
  }
3766
3763
  }
@@ -3774,7 +3771,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3774
3771
  getter = () => {
3775
3772
  const val = baseGetter();
3776
3773
  if (isArray(val) &&
3777
- checkCompatEnabled("WATCH_ARRAY" /* WATCH_ARRAY */, instance)) {
3774
+ checkCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance)) {
3778
3775
  traverse(val);
3779
3776
  }
3780
3777
  return val;
@@ -3787,7 +3784,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3787
3784
  let cleanup;
3788
3785
  let onCleanup = (fn) => {
3789
3786
  cleanup = effect.onStop = () => {
3790
- callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);
3787
+ callWithErrorHandling(fn, instance, 4 /* ErrorCodes.WATCH_CLEANUP */);
3791
3788
  };
3792
3789
  };
3793
3790
  let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
@@ -3804,12 +3801,12 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3804
3801
  ? newValue.some((v, i) => hasChanged(v, oldValue[i]))
3805
3802
  : hasChanged(newValue, oldValue)) ||
3806
3803
  (isArray(newValue) &&
3807
- isCompatEnabled("WATCH_ARRAY" /* WATCH_ARRAY */, instance))) {
3804
+ isCompatEnabled("WATCH_ARRAY" /* DeprecationTypes.WATCH_ARRAY */, instance))) {
3808
3805
  // cleanup before running cb again
3809
3806
  if (cleanup) {
3810
3807
  cleanup();
3811
3808
  }
3812
- callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [
3809
+ callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
3813
3810
  newValue,
3814
3811
  // pass undefined as the old value when it's changed for the first time
3815
3812
  oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
@@ -3835,7 +3832,10 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3835
3832
  }
3836
3833
  else {
3837
3834
  // default: 'pre'
3838
- scheduler = () => queuePreFlushCb(job);
3835
+ job.pre = true;
3836
+ if (instance)
3837
+ job.id = instance.uid;
3838
+ scheduler = () => queueJob(job);
3839
3839
  }
3840
3840
  const effect = new ReactiveEffect(getter, scheduler);
3841
3841
  {
@@ -3902,7 +3902,7 @@ function createPathGetter(ctx, path) {
3902
3902
  };
3903
3903
  }
3904
3904
  function traverse(value, seen) {
3905
- if (!isObject(value) || value["__v_skip" /* SKIP */]) {
3905
+ if (!isObject(value) || value["__v_skip" /* ReactiveFlags.SKIP */]) {
3906
3906
  return value;
3907
3907
  }
3908
3908
  seen = seen || new Set();
@@ -4089,7 +4089,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4089
4089
  const leavingVNodesCache = getLeavingNodesForType(state, vnode);
4090
4090
  const callHook = (hook, args) => {
4091
4091
  hook &&
4092
- callWithAsyncErrorHandling(hook, instance, 9 /* TRANSITION_HOOK */, args);
4092
+ callWithAsyncErrorHandling(hook, instance, 9 /* ErrorCodes.TRANSITION_HOOK */, args);
4093
4093
  };
4094
4094
  const callAsyncHook = (hook, args) => {
4095
4095
  const done = args[1];
@@ -4225,10 +4225,10 @@ function getKeepAliveChild(vnode) {
4225
4225
  : vnode;
4226
4226
  }
4227
4227
  function setTransitionHooks(vnode, hooks) {
4228
- if (vnode.shapeFlag & 6 /* COMPONENT */ && vnode.component) {
4228
+ if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && vnode.component) {
4229
4229
  setTransitionHooks(vnode.component.subTree, hooks);
4230
4230
  }
4231
- else if (vnode.shapeFlag & 128 /* SUSPENSE */) {
4231
+ else if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
4232
4232
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4233
4233
  vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4234
4234
  }
@@ -4247,7 +4247,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4247
4247
  : String(parentKey) + String(child.key != null ? child.key : i);
4248
4248
  // handle fragment children case, e.g. v-for
4249
4249
  if (child.type === Fragment) {
4250
- if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
4250
+ if (child.patchFlag & 128 /* PatchFlags.KEYED_FRAGMENT */)
4251
4251
  keyedFragmentCount++;
4252
4252
  ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
4253
4253
  }
@@ -4262,7 +4262,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4262
4262
  // these children to force full diffs to ensure correct behavior.
4263
4263
  if (keyedFragmentCount > 1) {
4264
4264
  for (let i = 0; i < ret.length; i++) {
4265
- ret[i].patchFlag = -2 /* BAIL */;
4265
+ ret[i].patchFlag = -2 /* PatchFlags.BAIL */;
4266
4266
  }
4267
4267
  }
4268
4268
  return ret;
@@ -4340,7 +4340,7 @@ function defineAsyncComponent(source) {
4340
4340
  }
4341
4341
  const onError = (err) => {
4342
4342
  pendingRequest = null;
4343
- handleError(err, instance, 13 /* ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);
4343
+ handleError(err, instance, 13 /* ErrorCodes.ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);
4344
4344
  };
4345
4345
  // suspense-controlled or SSR.
4346
4346
  if ((suspensible && instance.suspense) ||
@@ -4442,7 +4442,7 @@ const KeepAliveImpl = {
4442
4442
  const storageContainer = createElement('div');
4443
4443
  sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
4444
4444
  const instance = vnode.component;
4445
- move(vnode, container, anchor, 0 /* ENTER */, parentSuspense);
4445
+ move(vnode, container, anchor, 0 /* MoveType.ENTER */, parentSuspense);
4446
4446
  // in case props have changed
4447
4447
  patch(instance.vnode, vnode, container, anchor, instance, parentSuspense, isSVG, vnode.slotScopeIds, optimized);
4448
4448
  queuePostRenderEffect(() => {
@@ -4462,7 +4462,7 @@ const KeepAliveImpl = {
4462
4462
  };
4463
4463
  sharedContext.deactivate = (vnode) => {
4464
4464
  const instance = vnode.component;
4465
- move(vnode, storageContainer, null, 1 /* LEAVE */, parentSuspense);
4465
+ move(vnode, storageContainer, null, 1 /* MoveType.LEAVE */, parentSuspense);
4466
4466
  queuePostRenderEffect(() => {
4467
4467
  if (instance.da) {
4468
4468
  invokeArrayFns(instance.da);
@@ -4551,8 +4551,8 @@ const KeepAliveImpl = {
4551
4551
  return children;
4552
4552
  }
4553
4553
  else if (!isVNode(rawVNode) ||
4554
- (!(rawVNode.shapeFlag & 4 /* STATEFUL_COMPONENT */) &&
4555
- !(rawVNode.shapeFlag & 128 /* SUSPENSE */))) {
4554
+ (!(rawVNode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) &&
4555
+ !(rawVNode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */))) {
4556
4556
  current = null;
4557
4557
  return rawVNode;
4558
4558
  }
@@ -4574,7 +4574,7 @@ const KeepAliveImpl = {
4574
4574
  // clone vnode if it's reused because we are going to mutate it
4575
4575
  if (vnode.el) {
4576
4576
  vnode = cloneVNode(vnode);
4577
- if (rawVNode.shapeFlag & 128 /* SUSPENSE */) {
4577
+ if (rawVNode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
4578
4578
  rawVNode.ssContent = vnode;
4579
4579
  }
4580
4580
  }
@@ -4593,7 +4593,7 @@ const KeepAliveImpl = {
4593
4593
  setTransitionHooks(vnode, vnode.transition);
4594
4594
  }
4595
4595
  // avoid vnode being mounted as fresh
4596
- vnode.shapeFlag |= 512 /* COMPONENT_KEPT_ALIVE */;
4596
+ vnode.shapeFlag |= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
4597
4597
  // make this key the freshest
4598
4598
  keys.delete(key);
4599
4599
  keys.add(key);
@@ -4606,7 +4606,7 @@ const KeepAliveImpl = {
4606
4606
  }
4607
4607
  }
4608
4608
  // avoid vnode being unmounted
4609
- vnode.shapeFlag |= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
4609
+ vnode.shapeFlag |= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
4610
4610
  current = vnode;
4611
4611
  return isSuspense(rawVNode.type) ? rawVNode : vnode;
4612
4612
  };
@@ -4632,10 +4632,10 @@ function matches(pattern, name) {
4632
4632
  return false;
4633
4633
  }
4634
4634
  function onActivated(hook, target) {
4635
- registerKeepAliveHook(hook, "a" /* ACTIVATED */, target);
4635
+ registerKeepAliveHook(hook, "a" /* LifecycleHooks.ACTIVATED */, target);
4636
4636
  }
4637
4637
  function onDeactivated(hook, target) {
4638
- registerKeepAliveHook(hook, "da" /* DEACTIVATED */, target);
4638
+ registerKeepAliveHook(hook, "da" /* LifecycleHooks.DEACTIVATED */, target);
4639
4639
  }
4640
4640
  function registerKeepAliveHook(hook, type, target = currentInstance) {
4641
4641
  // cache the deactivate branch check wrapper for injected hooks so the same
@@ -4679,16 +4679,16 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4679
4679
  }
4680
4680
  function resetShapeFlag(vnode) {
4681
4681
  let shapeFlag = vnode.shapeFlag;
4682
- if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {
4683
- shapeFlag -= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
4682
+ if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
4683
+ shapeFlag -= 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
4684
4684
  }
4685
- if (shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {
4686
- shapeFlag -= 512 /* COMPONENT_KEPT_ALIVE */;
4685
+ if (shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
4686
+ shapeFlag -= 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
4687
4687
  }
4688
4688
  vnode.shapeFlag = shapeFlag;
4689
4689
  }
4690
4690
  function getInnerChild(vnode) {
4691
- return vnode.shapeFlag & 128 /* SUSPENSE */ ? vnode.ssContent : vnode;
4691
+ return vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */ ? vnode.ssContent : vnode;
4692
4692
  }
4693
4693
 
4694
4694
  function injectHook(type, hook, target = currentInstance, prepend = false) {
@@ -4734,23 +4734,23 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
4734
4734
  }
4735
4735
  const createHook = (lifecycle) => (hook, target = currentInstance) =>
4736
4736
  // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
4737
- (!isInSSRComponentSetup || lifecycle === "sp" /* SERVER_PREFETCH */) &&
4737
+ (!isInSSRComponentSetup || lifecycle === "sp" /* LifecycleHooks.SERVER_PREFETCH */) &&
4738
4738
  injectHook(lifecycle, hook, target);
4739
- const onBeforeMount = createHook("bm" /* BEFORE_MOUNT */);
4740
- const onMounted = createHook("m" /* MOUNTED */);
4741
- const onBeforeUpdate = createHook("bu" /* BEFORE_UPDATE */);
4742
- const onUpdated = createHook("u" /* UPDATED */);
4743
- const onBeforeUnmount = createHook("bum" /* BEFORE_UNMOUNT */);
4744
- const onUnmounted = createHook("um" /* UNMOUNTED */);
4745
- const onServerPrefetch = createHook("sp" /* SERVER_PREFETCH */);
4746
- const onRenderTriggered = createHook("rtg" /* RENDER_TRIGGERED */);
4747
- const onRenderTracked = createHook("rtc" /* RENDER_TRACKED */);
4739
+ const onBeforeMount = createHook("bm" /* LifecycleHooks.BEFORE_MOUNT */);
4740
+ const onMounted = createHook("m" /* LifecycleHooks.MOUNTED */);
4741
+ const onBeforeUpdate = createHook("bu" /* LifecycleHooks.BEFORE_UPDATE */);
4742
+ const onUpdated = createHook("u" /* LifecycleHooks.UPDATED */);
4743
+ const onBeforeUnmount = createHook("bum" /* LifecycleHooks.BEFORE_UNMOUNT */);
4744
+ const onUnmounted = createHook("um" /* LifecycleHooks.UNMOUNTED */);
4745
+ const onServerPrefetch = createHook("sp" /* LifecycleHooks.SERVER_PREFETCH */);
4746
+ const onRenderTriggered = createHook("rtg" /* LifecycleHooks.RENDER_TRIGGERED */);
4747
+ const onRenderTracked = createHook("rtc" /* LifecycleHooks.RENDER_TRACKED */);
4748
4748
  function onErrorCaptured(hook, target = currentInstance) {
4749
- injectHook("ec" /* ERROR_CAPTURED */, hook, target);
4749
+ injectHook("ec" /* LifecycleHooks.ERROR_CAPTURED */, hook, target);
4750
4750
  }
4751
4751
 
4752
4752
  function getCompatChildren(instance) {
4753
- assertCompatEnabled("INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */, instance);
4753
+ assertCompatEnabled("INSTANCE_CHILDREN" /* DeprecationTypes.INSTANCE_CHILDREN */, instance);
4754
4754
  const root = instance.subTree;
4755
4755
  const children = [];
4756
4756
  if (root) {
@@ -4762,7 +4762,7 @@ function walk(vnode, children) {
4762
4762
  if (vnode.component) {
4763
4763
  children.push(vnode.component.proxy);
4764
4764
  }
4765
- else if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {
4765
+ else if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
4766
4766
  const vnodes = vnode.children;
4767
4767
  for (let i = 0; i < vnodes.length; i++) {
4768
4768
  walk(vnodes[i], children);
@@ -4771,7 +4771,7 @@ function walk(vnode, children) {
4771
4771
  }
4772
4772
 
4773
4773
  function getCompatListeners(instance) {
4774
- assertCompatEnabled("INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */, instance);
4774
+ assertCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance);
4775
4775
  const listeners = {};
4776
4776
  const rawProps = instance.vnode.props;
4777
4777
  if (!rawProps) {
@@ -4799,7 +4799,7 @@ function mapCompatDirectiveHook(name, dir, instance) {
4799
4799
  mappedName.forEach(mapped => {
4800
4800
  const mappedHook = dir[mapped];
4801
4801
  if (mappedHook) {
4802
- softAssertCompatEnabled("CUSTOM_DIR" /* CUSTOM_DIR */, instance, mapped, name);
4802
+ softAssertCompatEnabled("CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */, instance, mapped, name);
4803
4803
  hook.push(mappedHook);
4804
4804
  }
4805
4805
  });
@@ -4807,7 +4807,7 @@ function mapCompatDirectiveHook(name, dir, instance) {
4807
4807
  }
4808
4808
  else {
4809
4809
  if (dir[mappedName]) {
4810
- softAssertCompatEnabled("CUSTOM_DIR" /* CUSTOM_DIR */, instance, mappedName, name);
4810
+ softAssertCompatEnabled("CUSTOM_DIR" /* DeprecationTypes.CUSTOM_DIR */, instance, mappedName, name);
4811
4811
  }
4812
4812
  return dir[mappedName];
4813
4813
  }
@@ -4881,7 +4881,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
4881
4881
  // disable tracking inside all lifecycle hooks
4882
4882
  // since they can potentially be called inside effects.
4883
4883
  pauseTracking();
4884
- callWithAsyncErrorHandling(hook, instance, 8 /* DIRECTIVE_HOOK */, [
4884
+ callWithAsyncErrorHandling(hook, instance, 8 /* ErrorCodes.DIRECTIVE_HOOK */, [
4885
4885
  vnode.el,
4886
4886
  binding,
4887
4887
  vnode,
@@ -4934,7 +4934,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
4934
4934
  const Component = instance.type;
4935
4935
  // explicit self name has highest priority
4936
4936
  if (type === COMPONENTS) {
4937
- const selfName = getComponentName(Component);
4937
+ const selfName = getComponentName(Component, false /* do not include inferred name to avoid breaking existing code */);
4938
4938
  if (selfName &&
4939
4939
  (selfName === name ||
4940
4940
  selfName === camelize(name) ||
@@ -4988,7 +4988,7 @@ function convertLegacyRenderFn(instance) {
4988
4988
  return;
4989
4989
  }
4990
4990
  // v2 render function, try to provide compat
4991
- if (checkCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance)) {
4991
+ if (checkCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance)) {
4992
4992
  const wrapped = (Component.render = function compatRender() {
4993
4993
  // @ts-ignore
4994
4994
  return render.call(this, compatH);
@@ -5110,7 +5110,7 @@ function convertLegacyDirectives(vnode, props) {
5110
5110
  function convertLegacySlots(vnode) {
5111
5111
  const { props, children } = vnode;
5112
5112
  let slots;
5113
- if (vnode.shapeFlag & 6 /* COMPONENT */ && isArray(children)) {
5113
+ if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */ && isArray(children)) {
5114
5114
  slots = {};
5115
5115
  // check "slot" property on vnodes and turn them into v3 function slots
5116
5116
  for (let i = 0; i < children.length; i++) {
@@ -5149,8 +5149,8 @@ function convertLegacySlots(vnode) {
5149
5149
  }
5150
5150
  function defineLegacyVNodeProperties(vnode) {
5151
5151
  /* istanbul ignore if */
5152
- if (isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
5153
- isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
5152
+ if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, currentRenderingInstance, true /* enable for built-ins */) &&
5153
+ isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, currentRenderingInstance, true /* enable for built-ins */)) {
5154
5154
  const context = currentRenderingInstance;
5155
5155
  const getInstance = () => vnode.component && vnode.component.proxy;
5156
5156
  let componentOptions;
@@ -5164,7 +5164,7 @@ function defineLegacyVNodeProperties(vnode) {
5164
5164
  context: { get: () => context && context.proxy },
5165
5165
  componentOptions: {
5166
5166
  get: () => {
5167
- if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
5167
+ if (vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */) {
5168
5168
  if (componentOptions) {
5169
5169
  return componentOptions;
5170
5170
  }
@@ -5284,7 +5284,13 @@ function createSlots(slots, dynamicSlots) {
5284
5284
  }
5285
5285
  else if (slot) {
5286
5286
  // conditional single slot generated by <template v-if="..." #foo>
5287
- slots[slot.name] = slot.fn;
5287
+ slots[slot.name] = slot.key
5288
+ ? (...args) => {
5289
+ const res = slot.fn(...args);
5290
+ res.key = slot.key;
5291
+ return res;
5292
+ }
5293
+ : slot.fn;
5288
5294
  }
5289
5295
  }
5290
5296
  return slots;
@@ -5320,9 +5326,15 @@ fallback, noSlotted) {
5320
5326
  }
5321
5327
  openBlock();
5322
5328
  const validSlotContent = slot && ensureValidVNode(slot(props));
5323
- const rendered = createBlock(Fragment, { key: props.key || `_${name}` }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 /* STABLE */
5324
- ? 64 /* STABLE_FRAGMENT */
5325
- : -2 /* BAIL */);
5329
+ const rendered = createBlock(Fragment, {
5330
+ key: props.key ||
5331
+ // slot content array of a dynamic conditional slot may have a branch
5332
+ // key attached in the `createSlots` helper, respect that
5333
+ (validSlotContent && validSlotContent.key) ||
5334
+ `_${name}`
5335
+ }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 /* SlotFlags.STABLE */
5336
+ ? 64 /* PatchFlags.STABLE_FRAGMENT */
5337
+ : -2 /* PatchFlags.BAIL */);
5326
5338
  if (!noSlotted && rendered.scopeId) {
5327
5339
  rendered.slotScopeIds = [rendered.scopeId + '-s'];
5328
5340
  }
@@ -5350,14 +5362,16 @@ function ensureValidVNode(vnodes) {
5350
5362
  * For prefixing keys in v-on="obj" with "on"
5351
5363
  * @private
5352
5364
  */
5353
- function toHandlers(obj) {
5365
+ function toHandlers(obj, preserveCaseIfNecessary) {
5354
5366
  const ret = {};
5355
5367
  if (!isObject(obj)) {
5356
5368
  warn$1(`v-on with no argument expects an object value.`);
5357
5369
  return ret;
5358
5370
  }
5359
5371
  for (const key in obj) {
5360
- ret[toHandlerKey(key)] = obj[key];
5372
+ ret[preserveCaseIfNecessary && /[A-Z]/.test(key)
5373
+ ? `on:${key}`
5374
+ : toHandlerKey(key)] = obj[key];
5361
5375
  }
5362
5376
  return ret;
5363
5377
  }
@@ -5493,26 +5507,26 @@ function installCompatInstanceProperties(map) {
5493
5507
  };
5494
5508
  extend(map, {
5495
5509
  $set: i => {
5496
- assertCompatEnabled("INSTANCE_SET" /* INSTANCE_SET */, i);
5510
+ assertCompatEnabled("INSTANCE_SET" /* DeprecationTypes.INSTANCE_SET */, i);
5497
5511
  return set;
5498
5512
  },
5499
5513
  $delete: i => {
5500
- assertCompatEnabled("INSTANCE_DELETE" /* INSTANCE_DELETE */, i);
5514
+ assertCompatEnabled("INSTANCE_DELETE" /* DeprecationTypes.INSTANCE_DELETE */, i);
5501
5515
  return del;
5502
5516
  },
5503
5517
  $mount: i => {
5504
- assertCompatEnabled("GLOBAL_MOUNT" /* GLOBAL_MOUNT */, null /* this warning is global */);
5518
+ assertCompatEnabled("GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */, null /* this warning is global */);
5505
5519
  // root mount override from ./global.ts in installCompatMount
5506
5520
  return i.ctx._compat_mount || NOOP;
5507
5521
  },
5508
5522
  $destroy: i => {
5509
- assertCompatEnabled("INSTANCE_DESTROY" /* INSTANCE_DESTROY */, i);
5523
+ assertCompatEnabled("INSTANCE_DESTROY" /* DeprecationTypes.INSTANCE_DESTROY */, i);
5510
5524
  // root destroy override from ./global.ts in installCompatMount
5511
5525
  return i.ctx._compat_destroy || NOOP;
5512
5526
  },
5513
5527
  // overrides existing accessor
5514
5528
  $slots: i => {
5515
- if (isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, i) &&
5529
+ if (isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, i) &&
5516
5530
  i.render &&
5517
5531
  i.render._compatWrapped) {
5518
5532
  return new Proxy(i.slots, legacySlotProxyHandlers);
@@ -5520,7 +5534,7 @@ function installCompatInstanceProperties(map) {
5520
5534
  return shallowReadonly(i.slots) ;
5521
5535
  },
5522
5536
  $scopedSlots: i => {
5523
- assertCompatEnabled("INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */, i);
5537
+ assertCompatEnabled("INSTANCE_SCOPED_SLOTS" /* DeprecationTypes.INSTANCE_SCOPED_SLOTS */, i);
5524
5538
  const res = {};
5525
5539
  for (const key in i.slots) {
5526
5540
  const fn = i.slots[key];
@@ -5537,7 +5551,7 @@ function installCompatInstanceProperties(map) {
5537
5551
  $listeners: getCompatListeners
5538
5552
  });
5539
5553
  /* istanbul ignore if */
5540
- if (isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, null)) {
5554
+ if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, null)) {
5541
5555
  extend(map, {
5542
5556
  // needed by many libs / render fns
5543
5557
  $vnode: i => i.vnode,
@@ -5641,23 +5655,23 @@ const PublicInstanceProxyHandlers = {
5641
5655
  const n = accessCache[key];
5642
5656
  if (n !== undefined) {
5643
5657
  switch (n) {
5644
- case 1 /* SETUP */:
5658
+ case 1 /* AccessTypes.SETUP */:
5645
5659
  return setupState[key];
5646
- case 2 /* DATA */:
5660
+ case 2 /* AccessTypes.DATA */:
5647
5661
  return data[key];
5648
- case 4 /* CONTEXT */:
5662
+ case 4 /* AccessTypes.CONTEXT */:
5649
5663
  return ctx[key];
5650
- case 3 /* PROPS */:
5664
+ case 3 /* AccessTypes.PROPS */:
5651
5665
  return props[key];
5652
5666
  // default: just fallthrough
5653
5667
  }
5654
5668
  }
5655
5669
  else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
5656
- accessCache[key] = 1 /* SETUP */;
5670
+ accessCache[key] = 1 /* AccessTypes.SETUP */;
5657
5671
  return setupState[key];
5658
5672
  }
5659
5673
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
5660
- accessCache[key] = 2 /* DATA */;
5674
+ accessCache[key] = 2 /* AccessTypes.DATA */;
5661
5675
  return data[key];
5662
5676
  }
5663
5677
  else if (
@@ -5665,15 +5679,15 @@ const PublicInstanceProxyHandlers = {
5665
5679
  // props
5666
5680
  (normalizedProps = instance.propsOptions[0]) &&
5667
5681
  hasOwn(normalizedProps, key)) {
5668
- accessCache[key] = 3 /* PROPS */;
5682
+ accessCache[key] = 3 /* AccessTypes.PROPS */;
5669
5683
  return props[key];
5670
5684
  }
5671
5685
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
5672
- accessCache[key] = 4 /* CONTEXT */;
5686
+ accessCache[key] = 4 /* AccessTypes.CONTEXT */;
5673
5687
  return ctx[key];
5674
5688
  }
5675
5689
  else if (shouldCacheAccess) {
5676
- accessCache[key] = 0 /* OTHER */;
5690
+ accessCache[key] = 0 /* AccessTypes.OTHER */;
5677
5691
  }
5678
5692
  }
5679
5693
  const publicGetter = publicPropertiesMap[key];
@@ -5681,7 +5695,7 @@ const PublicInstanceProxyHandlers = {
5681
5695
  // public $xxx properties
5682
5696
  if (publicGetter) {
5683
5697
  if (key === '$attrs') {
5684
- track(instance, "get" /* GET */, key);
5698
+ track(instance, "get" /* TrackOpTypes.GET */, key);
5685
5699
  markAttrsAccessed();
5686
5700
  }
5687
5701
  return publicGetter(instance);
@@ -5694,7 +5708,7 @@ const PublicInstanceProxyHandlers = {
5694
5708
  }
5695
5709
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
5696
5710
  // user may set custom properties to `this` that start with `$`
5697
- accessCache[key] = 4 /* CONTEXT */;
5711
+ accessCache[key] = 4 /* AccessTypes.CONTEXT */;
5698
5712
  return ctx[key];
5699
5713
  }
5700
5714
  else if (
@@ -5870,7 +5884,7 @@ function deepMergeData(to, from) {
5870
5884
  const toVal = to[key];
5871
5885
  const fromVal = from[key];
5872
5886
  if (key in to && isPlainObject(toVal) && isPlainObject(fromVal)) {
5873
- warnDeprecation("OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */, null, key);
5887
+ warnDeprecation("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null, key);
5874
5888
  deepMergeData(toVal, fromVal);
5875
5889
  }
5876
5890
  else {
@@ -5901,7 +5915,7 @@ function applyOptions(instance) {
5901
5915
  // call beforeCreate first before accessing other options since
5902
5916
  // the hook may mutate resolved options (#2791)
5903
5917
  if (options.beforeCreate) {
5904
- callHook(options.beforeCreate, instance, "bc" /* BEFORE_CREATE */);
5918
+ callHook(options.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */);
5905
5919
  }
5906
5920
  const {
5907
5921
  // state
@@ -5917,7 +5931,7 @@ function applyOptions(instance) {
5917
5931
  const [propsOptions] = instance.propsOptions;
5918
5932
  if (propsOptions) {
5919
5933
  for (const key in propsOptions) {
5920
- checkDuplicateProperties("Props" /* PROPS */, key);
5934
+ checkDuplicateProperties("Props" /* OptionTypes.PROPS */, key);
5921
5935
  }
5922
5936
  }
5923
5937
  }
@@ -5947,7 +5961,7 @@ function applyOptions(instance) {
5947
5961
  });
5948
5962
  }
5949
5963
  {
5950
- checkDuplicateProperties("Methods" /* METHODS */, key);
5964
+ checkDuplicateProperties("Methods" /* OptionTypes.METHODS */, key);
5951
5965
  }
5952
5966
  }
5953
5967
  else {
@@ -5974,7 +5988,7 @@ function applyOptions(instance) {
5974
5988
  instance.data = reactive(data);
5975
5989
  {
5976
5990
  for (const key in data) {
5977
- checkDuplicateProperties("Data" /* DATA */, key);
5991
+ checkDuplicateProperties("Data" /* OptionTypes.DATA */, key);
5978
5992
  // expose data on ctx during dev
5979
5993
  if (!isReservedPrefix(key[0])) {
5980
5994
  Object.defineProperty(ctx, key, {
@@ -6018,7 +6032,7 @@ function applyOptions(instance) {
6018
6032
  set: v => (c.value = v)
6019
6033
  });
6020
6034
  {
6021
- checkDuplicateProperties("Computed" /* COMPUTED */, key);
6035
+ checkDuplicateProperties("Computed" /* OptionTypes.COMPUTED */, key);
6022
6036
  }
6023
6037
  }
6024
6038
  }
@@ -6036,7 +6050,7 @@ function applyOptions(instance) {
6036
6050
  });
6037
6051
  }
6038
6052
  if (created) {
6039
- callHook(created, instance, "c" /* CREATED */);
6053
+ callHook(created, instance, "c" /* LifecycleHooks.CREATED */);
6040
6054
  }
6041
6055
  function registerLifecycleHook(register, hook) {
6042
6056
  if (isArray(hook)) {
@@ -6060,11 +6074,11 @@ function applyOptions(instance) {
6060
6074
  registerLifecycleHook(onServerPrefetch, serverPrefetch);
6061
6075
  {
6062
6076
  if (beforeDestroy &&
6063
- softAssertCompatEnabled("OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */, instance)) {
6077
+ softAssertCompatEnabled("OPTIONS_BEFORE_DESTROY" /* DeprecationTypes.OPTIONS_BEFORE_DESTROY */, instance)) {
6064
6078
  registerLifecycleHook(onBeforeUnmount, beforeDestroy);
6065
6079
  }
6066
6080
  if (destroyed &&
6067
- softAssertCompatEnabled("OPTIONS_DESTROYED" /* OPTIONS_DESTROYED */, instance)) {
6081
+ softAssertCompatEnabled("OPTIONS_DESTROYED" /* DeprecationTypes.OPTIONS_DESTROYED */, instance)) {
6068
6082
  registerLifecycleHook(onUnmounted, destroyed);
6069
6083
  }
6070
6084
  }
@@ -6096,7 +6110,7 @@ function applyOptions(instance) {
6096
6110
  if (directives)
6097
6111
  instance.directives = directives;
6098
6112
  if (filters &&
6099
- isCompatEnabled("FILTERS" /* FILTERS */, instance)) {
6113
+ isCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, instance)) {
6100
6114
  instance.filters = filters;
6101
6115
  }
6102
6116
  }
@@ -6143,7 +6157,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
6143
6157
  ctx[key] = injected;
6144
6158
  }
6145
6159
  {
6146
- checkDuplicateProperties("Inject" /* INJECT */, key);
6160
+ checkDuplicateProperties("Inject" /* OptionTypes.INJECT */, key);
6147
6161
  }
6148
6162
  }
6149
6163
  }
@@ -6203,7 +6217,7 @@ function resolveMergedOptions(instance) {
6203
6217
  resolved = cached;
6204
6218
  }
6205
6219
  else if (!globalMixins.length && !mixins && !extendsOptions) {
6206
- if (isCompatEnabled("PRIVATE_APIS" /* PRIVATE_APIS */, instance)) {
6220
+ if (isCompatEnabled("PRIVATE_APIS" /* DeprecationTypes.PRIVATE_APIS */, instance)) {
6207
6221
  resolved = extend({}, base);
6208
6222
  resolved.parent = instance.parent && instance.parent.proxy;
6209
6223
  resolved.propsData = instance.vnode.props;
@@ -6219,7 +6233,9 @@ function resolveMergedOptions(instance) {
6219
6233
  }
6220
6234
  mergeOptions(resolved, base, optionMergeStrategies);
6221
6235
  }
6222
- cache.set(base, resolved);
6236
+ if (isObject(base)) {
6237
+ cache.set(base, resolved);
6238
+ }
6223
6239
  return resolved;
6224
6240
  }
6225
6241
  function mergeOptions(to, from, strats, asMixin = false) {
@@ -6287,7 +6303,7 @@ function mergeDataFn(to, from) {
6287
6303
  return from;
6288
6304
  }
6289
6305
  return function mergedDataFn() {
6290
- return (isCompatEnabled("OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */, null)
6306
+ return (isCompatEnabled("OPTIONS_DATA_MERGE" /* DeprecationTypes.OPTIONS_DATA_MERGE */, null)
6291
6307
  ? deepMergeData
6292
6308
  : extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
6293
6309
  };
@@ -6326,7 +6342,7 @@ function mergeWatchOptions(to, from) {
6326
6342
  function createPropsDefaultThis(instance, rawProps, propKey) {
6327
6343
  return new Proxy({}, {
6328
6344
  get(_, key) {
6329
- warnDeprecation("PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */, null, propKey);
6345
+ warnDeprecation("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, null, propKey);
6330
6346
  // $options
6331
6347
  if (key === '$options') {
6332
6348
  return resolveMergedOptions(instance);
@@ -6356,11 +6372,11 @@ function shouldSkipAttr(key, instance) {
6356
6372
  return true;
6357
6373
  }
6358
6374
  if ((key === 'class' || key === 'style') &&
6359
- isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
6375
+ isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE */, instance)) {
6360
6376
  return true;
6361
6377
  }
6362
6378
  if (isOn(key) &&
6363
- isCompatEnabled("INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */, instance)) {
6379
+ isCompatEnabled("INSTANCE_LISTENERS" /* DeprecationTypes.INSTANCE_LISTENERS */, instance)) {
6364
6380
  return true;
6365
6381
  }
6366
6382
  // vue-router
@@ -6403,6 +6419,13 @@ isSSR = false) {
6403
6419
  }
6404
6420
  instance.attrs = attrs;
6405
6421
  }
6422
+ function isInHmrContext(instance) {
6423
+ while (instance) {
6424
+ if (instance.type.__hmrId)
6425
+ return true;
6426
+ instance = instance.parent;
6427
+ }
6428
+ }
6406
6429
  function updateProps(instance, rawProps, rawPrevProps, optimized) {
6407
6430
  const { props, attrs, vnode: { patchFlag } } = instance;
6408
6431
  const rawCurrentProps = toRaw(props);
@@ -6412,11 +6435,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
6412
6435
  // always force full diff in dev
6413
6436
  // - #1942 if hmr is enabled with sfc component
6414
6437
  // - vite#872 non-sfc component used by sfc component
6415
- !((instance.type.__hmrId ||
6416
- (instance.parent && instance.parent.type.__hmrId))) &&
6438
+ !(isInHmrContext(instance)) &&
6417
6439
  (optimized || patchFlag > 0) &&
6418
- !(patchFlag & 16 /* FULL_PROPS */)) {
6419
- if (patchFlag & 8 /* PROPS */) {
6440
+ !(patchFlag & 16 /* PatchFlags.FULL_PROPS */)) {
6441
+ if (patchFlag & 8 /* PatchFlags.PROPS */) {
6420
6442
  // Compiler-generated props & no keys change, just set the updated
6421
6443
  // the props.
6422
6444
  const propsToUpdate = instance.vnode.dynamicProps;
@@ -6503,7 +6525,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
6503
6525
  }
6504
6526
  // trigger updates for $attrs in case it's used in component slots
6505
6527
  if (hasAttrsChanged) {
6506
- trigger(instance, "set" /* SET */, '$attrs');
6528
+ trigger(instance, "set" /* TriggerOpTypes.SET */, '$attrs');
6507
6529
  }
6508
6530
  {
6509
6531
  validateProps(rawProps || {}, props, instance);
@@ -6521,7 +6543,7 @@ function setFullProps(instance, rawProps, props, attrs) {
6521
6543
  }
6522
6544
  {
6523
6545
  if (key.startsWith('onHook:')) {
6524
- softAssertCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance, key.slice(2).toLowerCase());
6546
+ softAssertCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance, key.slice(2).toLowerCase());
6525
6547
  }
6526
6548
  if (key === 'inline-template') {
6527
6549
  continue;
@@ -6582,7 +6604,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
6582
6604
  }
6583
6605
  else {
6584
6606
  setCurrentInstance(instance);
6585
- value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */, instance)
6607
+ value = propsDefaults[key] = defaultValue.call(isCompatEnabled("PROPS_DEFAULT_THIS" /* DeprecationTypes.PROPS_DEFAULT_THIS */, instance)
6586
6608
  ? createPropsDefaultThis(instance, props, key)
6587
6609
  : null, props);
6588
6610
  unsetCurrentInstance();
@@ -6593,11 +6615,11 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
6593
6615
  }
6594
6616
  }
6595
6617
  // boolean casting
6596
- if (opt[0 /* shouldCast */]) {
6618
+ if (opt[0 /* BooleanFlags.shouldCast */]) {
6597
6619
  if (isAbsent && !hasDefault) {
6598
6620
  value = false;
6599
6621
  }
6600
- else if (opt[1 /* shouldCastTrue */] &&
6622
+ else if (opt[1 /* BooleanFlags.shouldCastTrue */] &&
6601
6623
  (value === '' || value === hyphenate(key))) {
6602
6624
  value = true;
6603
6625
  }
@@ -6638,7 +6660,9 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6638
6660
  }
6639
6661
  }
6640
6662
  if (!raw && !hasExtends) {
6641
- cache.set(comp, EMPTY_ARR);
6663
+ if (isObject(comp)) {
6664
+ cache.set(comp, EMPTY_ARR);
6665
+ }
6642
6666
  return EMPTY_ARR;
6643
6667
  }
6644
6668
  if (isArray(raw)) {
@@ -6665,8 +6689,8 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6665
6689
  if (prop) {
6666
6690
  const booleanIndex = getTypeIndex(Boolean, prop.type);
6667
6691
  const stringIndex = getTypeIndex(String, prop.type);
6668
- prop[0 /* shouldCast */] = booleanIndex > -1;
6669
- prop[1 /* shouldCastTrue */] =
6692
+ prop[0 /* BooleanFlags.shouldCast */] = booleanIndex > -1;
6693
+ prop[1 /* BooleanFlags.shouldCastTrue */] =
6670
6694
  stringIndex < 0 || booleanIndex < stringIndex;
6671
6695
  // if the prop needs boolean casting or default value
6672
6696
  if (booleanIndex > -1 || hasOwn(prop, 'default')) {
@@ -6677,7 +6701,9 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6677
6701
  }
6678
6702
  }
6679
6703
  const res = [normalized, needCastKeys];
6680
- cache.set(comp, res);
6704
+ if (isObject(comp)) {
6705
+ cache.set(comp, res);
6706
+ }
6681
6707
  return res;
6682
6708
  }
6683
6709
  function validatePropName(key) {
@@ -6868,7 +6894,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
6868
6894
  slots[key] = normalizeSlot(key, value, ctx);
6869
6895
  }
6870
6896
  else if (value != null) {
6871
- if (!(isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance))) {
6897
+ if (!(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
6872
6898
  warn$1(`Non-function value encountered for slot "${key}". ` +
6873
6899
  `Prefer function slots for better performance.`);
6874
6900
  }
@@ -6879,7 +6905,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
6879
6905
  };
6880
6906
  const normalizeVNodeSlots = (instance, children) => {
6881
6907
  if (!isKeepAlive(instance.vnode) &&
6882
- !(isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, instance))) {
6908
+ !(isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, instance))) {
6883
6909
  warn$1(`Non-function value encountered for default slot. ` +
6884
6910
  `Prefer function slots for better performance.`);
6885
6911
  }
@@ -6887,7 +6913,7 @@ const normalizeVNodeSlots = (instance, children) => {
6887
6913
  instance.slots.default = () => normalized;
6888
6914
  };
6889
6915
  const initSlots = (instance, children) => {
6890
- if (instance.vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {
6916
+ if (instance.vnode.shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */) {
6891
6917
  const type = children._;
6892
6918
  if (type) {
6893
6919
  // users can get the shallow readonly version of the slots object through `this.$slots`,
@@ -6912,7 +6938,7 @@ const updateSlots = (instance, children, optimized) => {
6912
6938
  const { vnode, slots } = instance;
6913
6939
  let needDeletionCheck = true;
6914
6940
  let deletionComparisonTarget = EMPTY_OBJ;
6915
- if (vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {
6941
+ if (vnode.shapeFlag & 32 /* ShapeFlags.SLOTS_CHILDREN */) {
6916
6942
  const type = children._;
6917
6943
  if (type) {
6918
6944
  // compiled slots.
@@ -6921,7 +6947,7 @@ const updateSlots = (instance, children, optimized) => {
6921
6947
  // force update slots and mark instance for hmr as well
6922
6948
  extend(slots, children);
6923
6949
  }
6924
- else if (optimized && type === 1 /* STABLE */) {
6950
+ else if (optimized && type === 1 /* SlotFlags.STABLE */) {
6925
6951
  // compiled AND stable.
6926
6952
  // no need to update, and skip stale slots removal.
6927
6953
  needDeletionCheck = false;
@@ -6934,7 +6960,7 @@ const updateSlots = (instance, children, optimized) => {
6934
6960
  // when rendering the optimized slots by manually written render function,
6935
6961
  // we need to delete the `slots._` flag if necessary to make subsequent updates reliable,
6936
6962
  // i.e. let the `renderSlot` create the bailed Fragment
6937
- if (!optimized && type === 1 /* STABLE */) {
6963
+ if (!optimized && type === 1 /* SlotFlags.STABLE */) {
6938
6964
  delete slots._;
6939
6965
  }
6940
6966
  }
@@ -6963,11 +6989,11 @@ const updateSlots = (instance, children, optimized) => {
6963
6989
  // dev only
6964
6990
  function installLegacyConfigWarnings(config) {
6965
6991
  const legacyConfigOptions = {
6966
- silent: "CONFIG_SILENT" /* CONFIG_SILENT */,
6967
- devtools: "CONFIG_DEVTOOLS" /* CONFIG_DEVTOOLS */,
6968
- ignoredElements: "CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */,
6969
- keyCodes: "CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */,
6970
- productionTip: "CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */
6992
+ silent: "CONFIG_SILENT" /* DeprecationTypes.CONFIG_SILENT */,
6993
+ devtools: "CONFIG_DEVTOOLS" /* DeprecationTypes.CONFIG_DEVTOOLS */,
6994
+ ignoredElements: "CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */,
6995
+ keyCodes: "CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */,
6996
+ productionTip: "CONFIG_PRODUCTION_TIP" /* DeprecationTypes.CONFIG_PRODUCTION_TIP */
6971
6997
  };
6972
6998
  Object.keys(legacyConfigOptions).forEach(key => {
6973
6999
  let val = config[key];
@@ -6992,7 +7018,7 @@ function installLegacyOptionMergeStrats(config) {
6992
7018
  return target[key];
6993
7019
  }
6994
7020
  if (key in internalOptionMergeStrats &&
6995
- softAssertCompatEnabled("CONFIG_OPTION_MERGE_STRATS" /* CONFIG_OPTION_MERGE_STRATS */, null)) {
7021
+ softAssertCompatEnabled("CONFIG_OPTION_MERGE_STRATS" /* DeprecationTypes.CONFIG_OPTION_MERGE_STRATS */, null)) {
6996
7022
  return internalOptionMergeStrats[key];
6997
7023
  }
6998
7024
  }
@@ -7010,11 +7036,11 @@ function createCompatVue(createApp, createSingletonApp) {
7010
7036
  return createCompatApp(options, Vue);
7011
7037
  });
7012
7038
  function createCompatApp(options = {}, Ctor) {
7013
- assertCompatEnabled("GLOBAL_MOUNT" /* GLOBAL_MOUNT */, null);
7039
+ assertCompatEnabled("GLOBAL_MOUNT" /* DeprecationTypes.GLOBAL_MOUNT */, null);
7014
7040
  const { data } = options;
7015
7041
  if (data &&
7016
7042
  !isFunction(data) &&
7017
- softAssertCompatEnabled("OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */, null)) {
7043
+ softAssertCompatEnabled("OPTIONS_DATA_FN" /* DeprecationTypes.OPTIONS_DATA_FN */, null)) {
7018
7044
  options.data = () => data;
7019
7045
  }
7020
7046
  const app = createApp(options);
@@ -7029,7 +7055,7 @@ function createCompatVue(createApp, createSingletonApp) {
7029
7055
  return vm;
7030
7056
  }
7031
7057
  }
7032
- Vue.version = `2.6.14-compat:${"3.2.35"}`;
7058
+ Vue.version = `2.6.14-compat:${"3.2.38"}`;
7033
7059
  Vue.config = singletonApp.config;
7034
7060
  Vue.use = (p, ...options) => {
7035
7061
  if (p && isFunction(p.install)) {
@@ -7068,7 +7094,7 @@ function createCompatVue(createApp, createSingletonApp) {
7068
7094
  Vue.nextTick = nextTick;
7069
7095
  const extendCache = new WeakMap();
7070
7096
  function extendCtor(extendOptions = {}) {
7071
- assertCompatEnabled("GLOBAL_EXTEND" /* GLOBAL_EXTEND */, null);
7097
+ assertCompatEnabled("GLOBAL_EXTEND" /* DeprecationTypes.GLOBAL_EXTEND */, null);
7072
7098
  if (isFunction(extendOptions)) {
7073
7099
  extendOptions = extendOptions.options;
7074
7100
  }
@@ -7109,15 +7135,15 @@ function createCompatVue(createApp, createSingletonApp) {
7109
7135
  }
7110
7136
  Vue.extend = extendCtor.bind(Vue);
7111
7137
  Vue.set = (target, key, value) => {
7112
- assertCompatEnabled("GLOBAL_SET" /* GLOBAL_SET */, null);
7138
+ assertCompatEnabled("GLOBAL_SET" /* DeprecationTypes.GLOBAL_SET */, null);
7113
7139
  target[key] = value;
7114
7140
  };
7115
7141
  Vue.delete = (target, key) => {
7116
- assertCompatEnabled("GLOBAL_DELETE" /* GLOBAL_DELETE */, null);
7142
+ assertCompatEnabled("GLOBAL_DELETE" /* DeprecationTypes.GLOBAL_DELETE */, null);
7117
7143
  delete target[key];
7118
7144
  };
7119
7145
  Vue.observable = (target) => {
7120
- assertCompatEnabled("GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */, null);
7146
+ assertCompatEnabled("GLOBAL_OBSERVABLE" /* DeprecationTypes.GLOBAL_OBSERVABLE */, null);
7121
7147
  return reactive(target);
7122
7148
  };
7123
7149
  Vue.filter = ((name, filter) => {
@@ -7138,7 +7164,7 @@ function createCompatVue(createApp, createSingletonApp) {
7138
7164
  };
7139
7165
  Object.defineProperty(Vue, 'util', {
7140
7166
  get() {
7141
- assertCompatEnabled("GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */, null);
7167
+ assertCompatEnabled("GLOBAL_PRIVATE_UTIL" /* DeprecationTypes.GLOBAL_PRIVATE_UTIL */, null);
7142
7168
  return util;
7143
7169
  }
7144
7170
  });
@@ -7161,7 +7187,7 @@ function installAppCompatProperties(app, context, render) {
7161
7187
  function installFilterMethod(app, context) {
7162
7188
  context.filters = {};
7163
7189
  app.filter = (name, filter) => {
7164
- assertCompatEnabled("FILTERS" /* FILTERS */, null);
7190
+ assertCompatEnabled("FILTERS" /* DeprecationTypes.FILTERS */, null);
7165
7191
  if (!filter) {
7166
7192
  return context.filters[name];
7167
7193
  }
@@ -7178,7 +7204,7 @@ function installLegacyAPIs(app) {
7178
7204
  // so that app.use() can work with legacy plugins that extend prototypes
7179
7205
  prototype: {
7180
7206
  get() {
7181
- warnDeprecation("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
7207
+ warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
7182
7208
  return app.config.globalProperties;
7183
7209
  }
7184
7210
  },
@@ -7195,9 +7221,11 @@ function installLegacyAPIs(app) {
7195
7221
  });
7196
7222
  }
7197
7223
  function applySingletonAppMutations(app) {
7198
- ['mixins', 'components', 'directives', 'filters', 'deopt'].forEach(key => {
7224
+ // copy over asset registries and deopt flag
7225
+ app._context.mixins = [...singletonApp._context.mixins];
7226
+ ['components', 'directives', 'filters'].forEach(key => {
7199
7227
  // @ts-ignore
7200
- app._context[key] = singletonApp._context[key];
7228
+ app._context[key] = Object.create(singletonApp._context[key]);
7201
7229
  });
7202
7230
  // copy over global config mutations
7203
7231
  isCopyingConfig = true;
@@ -7210,10 +7238,10 @@ function applySingletonAppMutations(app) {
7210
7238
  }
7211
7239
  const val = singletonApp.config[key];
7212
7240
  // @ts-ignore
7213
- app.config[key] = val;
7241
+ app.config[key] = isObject(val) ? Object.create(val) : val;
7214
7242
  // compat for runtime ignoredElements -> isCustomElement
7215
7243
  if (key === 'ignoredElements' &&
7216
- isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
7244
+ isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* DeprecationTypes.CONFIG_IGNORED_ELEMENTS */, null) &&
7217
7245
  !isRuntimeOnly() &&
7218
7246
  isArray(val)) {
7219
7247
  app.config.compilerOptions.isCustomElement = tag => {
@@ -7226,7 +7254,7 @@ function applySingletonAppMutations(app) {
7226
7254
  }
7227
7255
  function applySingletonPrototype(app, Ctor) {
7228
7256
  // copy prototype augmentations as config.globalProperties
7229
- const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
7257
+ const enabled = isCompatEnabled("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
7230
7258
  if (enabled) {
7231
7259
  app.config.globalProperties = Object.create(Ctor.prototype);
7232
7260
  }
@@ -7241,7 +7269,7 @@ function applySingletonPrototype(app, Ctor) {
7241
7269
  }
7242
7270
  }
7243
7271
  if (hasPrototypeAugmentations) {
7244
- warnDeprecation("GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */, null);
7272
+ warnDeprecation("GLOBAL_PROTOTYPE" /* DeprecationTypes.GLOBAL_PROTOTYPE */, null);
7245
7273
  }
7246
7274
  }
7247
7275
  function installCompatMount(app, context, render) {
@@ -7311,7 +7339,7 @@ function installCompatMount(app, context, render) {
7311
7339
  for (let i = 0; i < container.attributes.length; i++) {
7312
7340
  const attr = container.attributes[i];
7313
7341
  if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
7314
- warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */, null);
7342
+ warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
7315
7343
  break;
7316
7344
  }
7317
7345
  }
@@ -7350,7 +7378,7 @@ function installCompatMount(app, context, render) {
7350
7378
  if (bum) {
7351
7379
  invokeArrayFns(bum);
7352
7380
  }
7353
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
7381
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
7354
7382
  instance.emit('hook:beforeDestroy');
7355
7383
  }
7356
7384
  // stop effects
@@ -7361,7 +7389,7 @@ function installCompatMount(app, context, render) {
7361
7389
  if (um) {
7362
7390
  invokeArrayFns(um);
7363
7391
  }
7364
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
7392
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
7365
7393
  instance.emit('hook:destroyed');
7366
7394
  }
7367
7395
  }
@@ -7422,12 +7450,12 @@ function defineReactiveSimple(obj, key, val) {
7422
7450
  enumerable: true,
7423
7451
  configurable: true,
7424
7452
  get() {
7425
- track(obj, "get" /* GET */, key);
7453
+ track(obj, "get" /* TrackOpTypes.GET */, key);
7426
7454
  return val;
7427
7455
  },
7428
7456
  set(newVal) {
7429
7457
  val = isObject(newVal) ? reactive(newVal) : newVal;
7430
- trigger(obj, "set" /* SET */, key, newVal);
7458
+ trigger(obj, "set" /* TriggerOpTypes.SET */, key, newVal);
7431
7459
  }
7432
7460
  });
7433
7461
  }
@@ -7620,7 +7648,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7620
7648
  // because the template ref is forwarded to inner component
7621
7649
  return;
7622
7650
  }
7623
- const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
7651
+ const refValue = vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */
7624
7652
  ? getExposeProxy(vnode.component) || vnode.component.proxy
7625
7653
  : vnode.el;
7626
7654
  const value = isUnmount ? null : refValue;
@@ -7646,7 +7674,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7646
7674
  }
7647
7675
  }
7648
7676
  if (isFunction(ref)) {
7649
- callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
7677
+ callWithErrorHandling(ref, owner, 12 /* ErrorCodes.FUNCTION_REF */, [value, refs]);
7650
7678
  }
7651
7679
  else {
7652
7680
  const _isString = isString(ref);
@@ -7683,7 +7711,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7683
7711
  setupState[ref] = value;
7684
7712
  }
7685
7713
  }
7686
- else if (isRef(ref)) {
7714
+ else if (_isRef) {
7687
7715
  ref.value = value;
7688
7716
  if (rawRef.k)
7689
7717
  refs[rawRef.k] = value;
@@ -7708,7 +7736,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7708
7736
 
7709
7737
  let hasMismatch = false;
7710
7738
  const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';
7711
- const isComment = (node) => node.nodeType === 8 /* COMMENT */;
7739
+ const isComment = (node) => node.nodeType === 8 /* DOMNodeTypes.COMMENT */;
7712
7740
  // Note: hydration is DOM-specific
7713
7741
  // But we have to place it in core due to tight coupling with core - splitting
7714
7742
  // it out creates a ton of unnecessary complexity.
@@ -7722,11 +7750,13 @@ function createHydrationFunctions(rendererInternals) {
7722
7750
  `Performing full mount instead.`);
7723
7751
  patch(null, vnode, container);
7724
7752
  flushPostFlushCbs();
7753
+ container._vnode = vnode;
7725
7754
  return;
7726
7755
  }
7727
7756
  hasMismatch = false;
7728
7757
  hydrateNode(container.firstChild, vnode, null, null, null);
7729
7758
  flushPostFlushCbs();
7759
+ container._vnode = vnode;
7730
7760
  if (hasMismatch && !false) {
7731
7761
  // this error should show up in production
7732
7762
  console.error(`Hydration completed but contains mismatches.`);
@@ -7738,14 +7768,14 @@ function createHydrationFunctions(rendererInternals) {
7738
7768
  const { type, ref, shapeFlag, patchFlag } = vnode;
7739
7769
  const domType = node.nodeType;
7740
7770
  vnode.el = node;
7741
- if (patchFlag === -2 /* BAIL */) {
7771
+ if (patchFlag === -2 /* PatchFlags.BAIL */) {
7742
7772
  optimized = false;
7743
7773
  vnode.dynamicChildren = null;
7744
7774
  }
7745
7775
  let nextNode = null;
7746
7776
  switch (type) {
7747
7777
  case Text:
7748
- if (domType !== 3 /* TEXT */) {
7778
+ if (domType !== 3 /* DOMNodeTypes.TEXT */) {
7749
7779
  // #5728 empty text node inside a slot can cause hydration failure
7750
7780
  // because the server rendered HTML won't contain a text node
7751
7781
  if (vnode.children === '') {
@@ -7768,7 +7798,7 @@ function createHydrationFunctions(rendererInternals) {
7768
7798
  }
7769
7799
  break;
7770
7800
  case Comment:
7771
- if (domType !== 8 /* COMMENT */ || isFragmentStart) {
7801
+ if (domType !== 8 /* DOMNodeTypes.COMMENT */ || isFragmentStart) {
7772
7802
  nextNode = onMismatch();
7773
7803
  }
7774
7804
  else {
@@ -7776,7 +7806,7 @@ function createHydrationFunctions(rendererInternals) {
7776
7806
  }
7777
7807
  break;
7778
7808
  case Static:
7779
- if (domType !== 1 /* ELEMENT */) {
7809
+ if (domType !== 1 /* DOMNodeTypes.ELEMENT */ && domType !== 3 /* DOMNodeTypes.TEXT */) {
7780
7810
  nextNode = onMismatch();
7781
7811
  }
7782
7812
  else {
@@ -7787,7 +7817,10 @@ function createHydrationFunctions(rendererInternals) {
7787
7817
  const needToAdoptContent = !vnode.children.length;
7788
7818
  for (let i = 0; i < vnode.staticCount; i++) {
7789
7819
  if (needToAdoptContent)
7790
- vnode.children += nextNode.outerHTML;
7820
+ vnode.children +=
7821
+ nextNode.nodeType === 1 /* DOMNodeTypes.ELEMENT */
7822
+ ? nextNode.outerHTML
7823
+ : nextNode.data;
7791
7824
  if (i === vnode.staticCount - 1) {
7792
7825
  vnode.anchor = nextNode;
7793
7826
  }
@@ -7805,8 +7838,8 @@ function createHydrationFunctions(rendererInternals) {
7805
7838
  }
7806
7839
  break;
7807
7840
  default:
7808
- if (shapeFlag & 1 /* ELEMENT */) {
7809
- if (domType !== 1 /* ELEMENT */ ||
7841
+ if (shapeFlag & 1 /* ShapeFlags.ELEMENT */) {
7842
+ if (domType !== 1 /* DOMNodeTypes.ELEMENT */ ||
7810
7843
  vnode.type.toLowerCase() !==
7811
7844
  node.tagName.toLowerCase()) {
7812
7845
  nextNode = onMismatch();
@@ -7815,7 +7848,7 @@ function createHydrationFunctions(rendererInternals) {
7815
7848
  nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
7816
7849
  }
7817
7850
  }
7818
- else if (shapeFlag & 6 /* COMPONENT */) {
7851
+ else if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
7819
7852
  // when setting up the render effect, if the initial vnode already
7820
7853
  // has .el set, the component will perform hydration instead of mount
7821
7854
  // on its sub-tree.
@@ -7854,15 +7887,15 @@ function createHydrationFunctions(rendererInternals) {
7854
7887
  vnode.component.subTree = subTree;
7855
7888
  }
7856
7889
  }
7857
- else if (shapeFlag & 64 /* TELEPORT */) {
7858
- if (domType !== 8 /* COMMENT */) {
7890
+ else if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
7891
+ if (domType !== 8 /* DOMNodeTypes.COMMENT */) {
7859
7892
  nextNode = onMismatch();
7860
7893
  }
7861
7894
  else {
7862
7895
  nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
7863
7896
  }
7864
7897
  }
7865
- else if (shapeFlag & 128 /* SUSPENSE */) {
7898
+ else if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
7866
7899
  nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
7867
7900
  }
7868
7901
  else {
@@ -7890,7 +7923,7 @@ function createHydrationFunctions(rendererInternals) {
7890
7923
  if (props) {
7891
7924
  if (forcePatchValue ||
7892
7925
  !optimized ||
7893
- patchFlag & (16 /* FULL_PROPS */ | 32 /* HYDRATE_EVENTS */)) {
7926
+ patchFlag & (16 /* PatchFlags.FULL_PROPS */ | 32 /* PatchFlags.HYDRATE_EVENTS */)) {
7894
7927
  for (const key in props) {
7895
7928
  if ((forcePatchValue && key.endsWith('value')) ||
7896
7929
  (isOn(key) && !isReservedProp(key))) {
@@ -7919,7 +7952,7 @@ function createHydrationFunctions(rendererInternals) {
7919
7952
  }, parentSuspense);
7920
7953
  }
7921
7954
  // children
7922
- if (shapeFlag & 16 /* ARRAY_CHILDREN */ &&
7955
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */ &&
7923
7956
  // skip if element has innerHTML / textContent
7924
7957
  !(props && (props.innerHTML || props.textContent))) {
7925
7958
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
@@ -7937,7 +7970,7 @@ function createHydrationFunctions(rendererInternals) {
7937
7970
  remove(cur);
7938
7971
  }
7939
7972
  }
7940
- else if (shapeFlag & 8 /* TEXT_CHILDREN */) {
7973
+ else if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
7941
7974
  if (el.textContent !== vnode.children) {
7942
7975
  hasMismatch = true;
7943
7976
  warn$1(`Hydration text content mismatch in <${vnode.type}>:\n` +
@@ -8000,7 +8033,7 @@ function createHydrationFunctions(rendererInternals) {
8000
8033
  };
8001
8034
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
8002
8035
  hasMismatch = true;
8003
- warn$1(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* TEXT */
8036
+ warn$1(`Hydration node mismatch:\n- Client vnode:`, vnode.type, `\n- Server rendered DOM:`, node, node.nodeType === 3 /* DOMNodeTypes.TEXT */
8004
8037
  ? `(text)`
8005
8038
  : isComment(node) && node.data === '['
8006
8039
  ? `(start of fragment)`
@@ -8131,7 +8164,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8131
8164
  unmount(n1, parentComponent, parentSuspense, true);
8132
8165
  n1 = null;
8133
8166
  }
8134
- if (n2.patchFlag === -2 /* BAIL */) {
8167
+ if (n2.patchFlag === -2 /* PatchFlags.BAIL */) {
8135
8168
  optimized = false;
8136
8169
  n2.dynamicChildren = null;
8137
8170
  }
@@ -8155,16 +8188,16 @@ function baseCreateRenderer(options, createHydrationFns) {
8155
8188
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
8156
8189
  break;
8157
8190
  default:
8158
- if (shapeFlag & 1 /* ELEMENT */) {
8191
+ if (shapeFlag & 1 /* ShapeFlags.ELEMENT */) {
8159
8192
  processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
8160
8193
  }
8161
- else if (shapeFlag & 6 /* COMPONENT */) {
8194
+ else if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
8162
8195
  processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
8163
8196
  }
8164
- else if (shapeFlag & 64 /* TELEPORT */) {
8197
+ else if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
8165
8198
  type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
8166
8199
  }
8167
- else if (shapeFlag & 128 /* SUSPENSE */) {
8200
+ else if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
8168
8201
  type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
8169
8202
  }
8170
8203
  else {
@@ -8250,10 +8283,10 @@ function baseCreateRenderer(options, createHydrationFns) {
8250
8283
  el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);
8251
8284
  // mount children first, since some props may rely on child content
8252
8285
  // being already rendered, e.g. `<select value>`
8253
- if (shapeFlag & 8 /* TEXT_CHILDREN */) {
8286
+ if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
8254
8287
  hostSetElementText(el, vnode.children);
8255
8288
  }
8256
- else if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
8289
+ else if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
8257
8290
  mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized);
8258
8291
  }
8259
8292
  if (dirs) {
@@ -8329,7 +8362,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8329
8362
  if (parentComponent) {
8330
8363
  let subTree = parentComponent.subTree;
8331
8364
  if (subTree.patchFlag > 0 &&
8332
- subTree.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
8365
+ subTree.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */) {
8333
8366
  subTree =
8334
8367
  filterSingleRoot(subTree.children) || subTree;
8335
8368
  }
@@ -8352,7 +8385,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8352
8385
  let { patchFlag, dynamicChildren, dirs } = n2;
8353
8386
  // #1426 take the old vnode's patch flag into account since user may clone a
8354
8387
  // compiler-generated vnode, which de-opts to FULL_PROPS
8355
- patchFlag |= n1.patchFlag & 16 /* FULL_PROPS */;
8388
+ patchFlag |= n1.patchFlag & 16 /* PatchFlags.FULL_PROPS */;
8356
8389
  const oldProps = n1.props || EMPTY_OBJ;
8357
8390
  const newProps = n2.props || EMPTY_OBJ;
8358
8391
  let vnodeHook;
@@ -8387,21 +8420,21 @@ function baseCreateRenderer(options, createHydrationFns) {
8387
8420
  // generated by the compiler and can take the fast path.
8388
8421
  // in this path old node and new node are guaranteed to have the same shape
8389
8422
  // (i.e. at the exact same position in the source template)
8390
- if (patchFlag & 16 /* FULL_PROPS */) {
8423
+ if (patchFlag & 16 /* PatchFlags.FULL_PROPS */) {
8391
8424
  // element props contain dynamic keys, full diff needed
8392
8425
  patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);
8393
8426
  }
8394
8427
  else {
8395
8428
  // class
8396
8429
  // this flag is matched when the element has dynamic class bindings.
8397
- if (patchFlag & 2 /* CLASS */) {
8430
+ if (patchFlag & 2 /* PatchFlags.CLASS */) {
8398
8431
  if (oldProps.class !== newProps.class) {
8399
8432
  hostPatchProp(el, 'class', null, newProps.class, isSVG);
8400
8433
  }
8401
8434
  }
8402
8435
  // style
8403
8436
  // this flag is matched when the element has dynamic style bindings
8404
- if (patchFlag & 4 /* STYLE */) {
8437
+ if (patchFlag & 4 /* PatchFlags.STYLE */) {
8405
8438
  hostPatchProp(el, 'style', oldProps.style, newProps.style, isSVG);
8406
8439
  }
8407
8440
  // props
@@ -8410,7 +8443,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8410
8443
  // faster iteration.
8411
8444
  // Note dynamic keys like :[foo]="bar" will cause this optimization to
8412
8445
  // bail out and go through a full diff because we need to unset the old key
8413
- if (patchFlag & 8 /* PROPS */) {
8446
+ if (patchFlag & 8 /* PatchFlags.PROPS */) {
8414
8447
  // if the flag is present then dynamicProps must be non-null
8415
8448
  const propsToUpdate = n2.dynamicProps;
8416
8449
  for (let i = 0; i < propsToUpdate.length; i++) {
@@ -8426,7 +8459,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8426
8459
  }
8427
8460
  // text
8428
8461
  // This flag is matched when the element has only dynamic text children.
8429
- if (patchFlag & 1 /* TEXT */) {
8462
+ if (patchFlag & 1 /* PatchFlags.TEXT */) {
8430
8463
  if (n1.children !== n2.children) {
8431
8464
  hostSetElementText(el, n2.children);
8432
8465
  }
@@ -8460,7 +8493,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8460
8493
  // which also requires the correct parent container
8461
8494
  !isSameVNodeType(oldVNode, newVNode) ||
8462
8495
  // - In the case of a component, it could contain anything.
8463
- oldVNode.shapeFlag & (6 /* COMPONENT */ | 64 /* TELEPORT */))
8496
+ oldVNode.shapeFlag & (6 /* ShapeFlags.COMPONENT */ | 64 /* ShapeFlags.TELEPORT */))
8464
8497
  ? hostParentNode(oldVNode.el)
8465
8498
  : // In other cases, the parent container is not actually used so we
8466
8499
  // just pass the block element here to avoid a DOM parentNode call.
@@ -8498,7 +8531,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8498
8531
  const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));
8499
8532
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
8500
8533
  if (// #5523 dev root fragment may inherit directives
8501
- (isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
8534
+ (isHmrUpdating || patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */)) {
8502
8535
  // HMR updated / Dev root fragment (w/ comments), force full diff
8503
8536
  patchFlag = 0;
8504
8537
  optimized = false;
@@ -8520,7 +8553,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8520
8553
  }
8521
8554
  else {
8522
8555
  if (patchFlag > 0 &&
8523
- patchFlag & 64 /* STABLE_FRAGMENT */ &&
8556
+ patchFlag & 64 /* PatchFlags.STABLE_FRAGMENT */ &&
8524
8557
  dynamicChildren &&
8525
8558
  // #2715 the previous fragment could've been a BAILed one as a result
8526
8559
  // of renderSlot() with no valid children
@@ -8553,7 +8586,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8553
8586
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8554
8587
  n2.slotScopeIds = slotScopeIds;
8555
8588
  if (n1 == null) {
8556
- if (n2.shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {
8589
+ if (n2.shapeFlag & 512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */) {
8557
8590
  parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);
8558
8591
  }
8559
8592
  else {
@@ -8658,7 +8691,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8658
8691
  (vnodeHook = props && props.onVnodeBeforeMount)) {
8659
8692
  invokeVNodeHook(vnodeHook, parent, initialVNode);
8660
8693
  }
8661
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
8694
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
8662
8695
  instance.emit('hook:beforeMount');
8663
8696
  }
8664
8697
  toggleRecurse(instance, true);
@@ -8719,18 +8752,18 @@ function baseCreateRenderer(options, createHydrationFns) {
8719
8752
  const scopedInitialVNode = initialVNode;
8720
8753
  queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);
8721
8754
  }
8722
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
8755
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
8723
8756
  queuePostRenderEffect(() => instance.emit('hook:mounted'), parentSuspense);
8724
8757
  }
8725
8758
  // activated hook for keep-alive roots.
8726
8759
  // #1742 activated hook must be accessed after first render
8727
8760
  // since the hook may be injected by a child keep-alive
8728
- if (initialVNode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */ ||
8761
+ if (initialVNode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */ ||
8729
8762
  (parent &&
8730
8763
  isAsyncWrapper(parent.vnode) &&
8731
- parent.vnode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */)) {
8764
+ parent.vnode.shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */)) {
8732
8765
  instance.a && queuePostRenderEffect(instance.a, parentSuspense);
8733
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
8766
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
8734
8767
  queuePostRenderEffect(() => instance.emit('hook:activated'), parentSuspense);
8735
8768
  }
8736
8769
  }
@@ -8768,7 +8801,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8768
8801
  if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
8769
8802
  invokeVNodeHook(vnodeHook, parent, next, vnode);
8770
8803
  }
8771
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
8804
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
8772
8805
  instance.emit('hook:beforeUpdate');
8773
8806
  }
8774
8807
  toggleRecurse(instance, true);
@@ -8808,7 +8841,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8808
8841
  if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {
8809
8842
  queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);
8810
8843
  }
8811
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
8844
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
8812
8845
  queuePostRenderEffect(() => instance.emit('hook:updated'), parentSuspense);
8813
8846
  }
8814
8847
  {
@@ -8848,7 +8881,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8848
8881
  pauseTracking();
8849
8882
  // props update may have triggered pre-flush watchers.
8850
8883
  // flush them before the render update.
8851
- flushPreFlushCbs(undefined, instance.update);
8884
+ flushPreFlushCbs();
8852
8885
  resetTracking();
8853
8886
  };
8854
8887
  const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
@@ -8858,22 +8891,22 @@ function baseCreateRenderer(options, createHydrationFns) {
8858
8891
  const { patchFlag, shapeFlag } = n2;
8859
8892
  // fast path
8860
8893
  if (patchFlag > 0) {
8861
- if (patchFlag & 128 /* KEYED_FRAGMENT */) {
8894
+ if (patchFlag & 128 /* PatchFlags.KEYED_FRAGMENT */) {
8862
8895
  // this could be either fully-keyed or mixed (some keyed some not)
8863
8896
  // presence of patchFlag means children are guaranteed to be arrays
8864
8897
  patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
8865
8898
  return;
8866
8899
  }
8867
- else if (patchFlag & 256 /* UNKEYED_FRAGMENT */) {
8900
+ else if (patchFlag & 256 /* PatchFlags.UNKEYED_FRAGMENT */) {
8868
8901
  // unkeyed
8869
8902
  patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
8870
8903
  return;
8871
8904
  }
8872
8905
  }
8873
8906
  // children has 3 possibilities: text, array or no children.
8874
- if (shapeFlag & 8 /* TEXT_CHILDREN */) {
8907
+ if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
8875
8908
  // text children fast path
8876
- if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {
8909
+ if (prevShapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
8877
8910
  unmountChildren(c1, parentComponent, parentSuspense);
8878
8911
  }
8879
8912
  if (c2 !== c1) {
@@ -8881,9 +8914,9 @@ function baseCreateRenderer(options, createHydrationFns) {
8881
8914
  }
8882
8915
  }
8883
8916
  else {
8884
- if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {
8917
+ if (prevShapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
8885
8918
  // prev children was array
8886
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
8919
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
8887
8920
  // two arrays, cannot assume anything, do full diff
8888
8921
  patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
8889
8922
  }
@@ -8895,11 +8928,11 @@ function baseCreateRenderer(options, createHydrationFns) {
8895
8928
  else {
8896
8929
  // prev children was text OR null
8897
8930
  // new children is array OR null
8898
- if (prevShapeFlag & 8 /* TEXT_CHILDREN */) {
8931
+ if (prevShapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
8899
8932
  hostSetElementText(container, '');
8900
8933
  }
8901
8934
  // mount new if array
8902
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
8935
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
8903
8936
  mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
8904
8937
  }
8905
8938
  }
@@ -9090,7 +9123,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9090
9123
  // There is no stable subsequence (e.g. a reverse)
9091
9124
  // OR current node is not among the stable sequence
9092
9125
  if (j < 0 || i !== increasingNewIndexSequence[j]) {
9093
- move(nextChild, container, anchor, 2 /* REORDER */);
9126
+ move(nextChild, container, anchor, 2 /* MoveType.REORDER */);
9094
9127
  }
9095
9128
  else {
9096
9129
  j--;
@@ -9101,15 +9134,15 @@ function baseCreateRenderer(options, createHydrationFns) {
9101
9134
  };
9102
9135
  const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
9103
9136
  const { el, type, transition, children, shapeFlag } = vnode;
9104
- if (shapeFlag & 6 /* COMPONENT */) {
9137
+ if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
9105
9138
  move(vnode.component.subTree, container, anchor, moveType);
9106
9139
  return;
9107
9140
  }
9108
- if (shapeFlag & 128 /* SUSPENSE */) {
9141
+ if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
9109
9142
  vnode.suspense.move(container, anchor, moveType);
9110
9143
  return;
9111
9144
  }
9112
- if (shapeFlag & 64 /* TELEPORT */) {
9145
+ if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
9113
9146
  type.move(vnode, container, anchor, internals);
9114
9147
  return;
9115
9148
  }
@@ -9126,11 +9159,11 @@ function baseCreateRenderer(options, createHydrationFns) {
9126
9159
  return;
9127
9160
  }
9128
9161
  // single nodes
9129
- const needTransition = moveType !== 2 /* REORDER */ &&
9130
- shapeFlag & 1 /* ELEMENT */ &&
9162
+ const needTransition = moveType !== 2 /* MoveType.REORDER */ &&
9163
+ shapeFlag & 1 /* ShapeFlags.ELEMENT */ &&
9131
9164
  transition;
9132
9165
  if (needTransition) {
9133
- if (moveType === 0 /* ENTER */) {
9166
+ if (moveType === 0 /* MoveType.ENTER */) {
9134
9167
  transition.beforeEnter(el);
9135
9168
  hostInsert(el, container, anchor);
9136
9169
  queuePostRenderEffect(() => transition.enter(el), parentSuspense);
@@ -9162,42 +9195,42 @@ function baseCreateRenderer(options, createHydrationFns) {
9162
9195
  if (ref != null) {
9163
9196
  setRef(ref, null, parentSuspense, vnode, true);
9164
9197
  }
9165
- if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {
9198
+ if (shapeFlag & 256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */) {
9166
9199
  parentComponent.ctx.deactivate(vnode);
9167
9200
  return;
9168
9201
  }
9169
- const shouldInvokeDirs = shapeFlag & 1 /* ELEMENT */ && dirs;
9202
+ const shouldInvokeDirs = shapeFlag & 1 /* ShapeFlags.ELEMENT */ && dirs;
9170
9203
  const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
9171
9204
  let vnodeHook;
9172
9205
  if (shouldInvokeVnodeHook &&
9173
9206
  (vnodeHook = props && props.onVnodeBeforeUnmount)) {
9174
9207
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
9175
9208
  }
9176
- if (shapeFlag & 6 /* COMPONENT */) {
9209
+ if (shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
9177
9210
  unmountComponent(vnode.component, parentSuspense, doRemove);
9178
9211
  }
9179
9212
  else {
9180
- if (shapeFlag & 128 /* SUSPENSE */) {
9213
+ if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
9181
9214
  vnode.suspense.unmount(parentSuspense, doRemove);
9182
9215
  return;
9183
9216
  }
9184
9217
  if (shouldInvokeDirs) {
9185
9218
  invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount');
9186
9219
  }
9187
- if (shapeFlag & 64 /* TELEPORT */) {
9220
+ if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
9188
9221
  vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove);
9189
9222
  }
9190
9223
  else if (dynamicChildren &&
9191
9224
  // #1153: fast path should not be taken for non-stable (v-for) fragments
9192
9225
  (type !== Fragment ||
9193
- (patchFlag > 0 && patchFlag & 64 /* STABLE_FRAGMENT */))) {
9226
+ (patchFlag > 0 && patchFlag & 64 /* PatchFlags.STABLE_FRAGMENT */))) {
9194
9227
  // fast path for block nodes: only need to unmount dynamic children.
9195
9228
  unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
9196
9229
  }
9197
9230
  else if ((type === Fragment &&
9198
9231
  patchFlag &
9199
- (128 /* KEYED_FRAGMENT */ | 256 /* UNKEYED_FRAGMENT */)) ||
9200
- (!optimized && shapeFlag & 16 /* ARRAY_CHILDREN */)) {
9232
+ (128 /* PatchFlags.KEYED_FRAGMENT */ | 256 /* PatchFlags.UNKEYED_FRAGMENT */)) ||
9233
+ (!optimized && shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */)) {
9201
9234
  unmountChildren(children, parentComponent, parentSuspense);
9202
9235
  }
9203
9236
  if (doRemove) {
@@ -9218,7 +9251,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9218
9251
  const { type, el, anchor, transition } = vnode;
9219
9252
  if (type === Fragment) {
9220
9253
  if (vnode.patchFlag > 0 &&
9221
- vnode.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */ &&
9254
+ vnode.patchFlag & 2048 /* PatchFlags.DEV_ROOT_FRAGMENT */ &&
9222
9255
  transition &&
9223
9256
  !transition.persisted) {
9224
9257
  vnode.children.forEach(child => {
@@ -9245,7 +9278,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9245
9278
  transition.afterLeave();
9246
9279
  }
9247
9280
  };
9248
- if (vnode.shapeFlag & 1 /* ELEMENT */ &&
9281
+ if (vnode.shapeFlag & 1 /* ShapeFlags.ELEMENT */ &&
9249
9282
  transition &&
9250
9283
  !transition.persisted) {
9251
9284
  const { leave, delayLeave } = transition;
@@ -9281,7 +9314,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9281
9314
  if (bum) {
9282
9315
  invokeArrayFns(bum);
9283
9316
  }
9284
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
9317
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
9285
9318
  instance.emit('hook:beforeDestroy');
9286
9319
  }
9287
9320
  // stop effects in component scope
@@ -9297,7 +9330,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9297
9330
  if (um) {
9298
9331
  queuePostRenderEffect(um, parentSuspense);
9299
9332
  }
9300
- if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */, instance)) {
9333
+ if (isCompatEnabled("INSTANCE_EVENT_HOOKS" /* DeprecationTypes.INSTANCE_EVENT_HOOKS */, instance)) {
9301
9334
  queuePostRenderEffect(() => instance.emit('hook:destroyed'), parentSuspense);
9302
9335
  }
9303
9336
  queuePostRenderEffect(() => {
@@ -9327,10 +9360,10 @@ function baseCreateRenderer(options, createHydrationFns) {
9327
9360
  }
9328
9361
  };
9329
9362
  const getNextHostNode = vnode => {
9330
- if (vnode.shapeFlag & 6 /* COMPONENT */) {
9363
+ if (vnode.shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
9331
9364
  return getNextHostNode(vnode.component.subTree);
9332
9365
  }
9333
- if (vnode.shapeFlag & 128 /* SUSPENSE */) {
9366
+ if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
9334
9367
  return vnode.suspense.next();
9335
9368
  }
9336
9369
  return hostNextSibling((vnode.anchor || vnode.el));
@@ -9344,6 +9377,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9344
9377
  else {
9345
9378
  patch(container._vnode || null, vnode, container, null, null, null, isSVG);
9346
9379
  }
9380
+ flushPreFlushCbs();
9347
9381
  flushPostFlushCbs();
9348
9382
  container._vnode = vnode;
9349
9383
  };
@@ -9393,8 +9427,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
9393
9427
  // guaranteed to be vnodes
9394
9428
  const c1 = ch1[i];
9395
9429
  let c2 = ch2[i];
9396
- if (c2.shapeFlag & 1 /* ELEMENT */ && !c2.dynamicChildren) {
9397
- if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* HYDRATE_EVENTS */) {
9430
+ if (c2.shapeFlag & 1 /* ShapeFlags.ELEMENT */ && !c2.dynamicChildren) {
9431
+ if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* PatchFlags.HYDRATE_EVENTS */) {
9398
9432
  c2 = ch2[i] = cloneIfMounted(ch2[i]);
9399
9433
  c2.el = c1.el;
9400
9434
  }
@@ -9514,7 +9548,7 @@ const TeleportImpl = {
9514
9548
  const mount = (container, anchor) => {
9515
9549
  // Teleport *always* has Array children. This is enforced in both the
9516
9550
  // compiler and vnode children normalization.
9517
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
9551
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
9518
9552
  mountChildren(children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
9519
9553
  }
9520
9554
  };
@@ -9550,7 +9584,7 @@ const TeleportImpl = {
9550
9584
  if (!wasDisabled) {
9551
9585
  // enabled -> disabled
9552
9586
  // move into main container
9553
- moveTeleport(n2, container, mainAnchor, internals, 1 /* TOGGLE */);
9587
+ moveTeleport(n2, container, mainAnchor, internals, 1 /* TeleportMoveTypes.TOGGLE */);
9554
9588
  }
9555
9589
  }
9556
9590
  else {
@@ -9558,7 +9592,7 @@ const TeleportImpl = {
9558
9592
  if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
9559
9593
  const nextTarget = (n2.target = resolveTarget(n2.props, querySelector));
9560
9594
  if (nextTarget) {
9561
- moveTeleport(n2, nextTarget, null, internals, 0 /* TARGET_CHANGE */);
9595
+ moveTeleport(n2, nextTarget, null, internals, 0 /* TeleportMoveTypes.TARGET_CHANGE */);
9562
9596
  }
9563
9597
  else {
9564
9598
  warn$1('Invalid Teleport target on update:', target, `(${typeof target})`);
@@ -9567,7 +9601,7 @@ const TeleportImpl = {
9567
9601
  else if (wasDisabled) {
9568
9602
  // disabled -> enabled
9569
9603
  // move into teleport target
9570
- moveTeleport(n2, target, targetAnchor, internals, 1 /* TOGGLE */);
9604
+ moveTeleport(n2, target, targetAnchor, internals, 1 /* TeleportMoveTypes.TOGGLE */);
9571
9605
  }
9572
9606
  }
9573
9607
  }
@@ -9580,7 +9614,7 @@ const TeleportImpl = {
9580
9614
  // an unmounted teleport should always remove its children if not disabled
9581
9615
  if (doRemove || !isTeleportDisabled(props)) {
9582
9616
  hostRemove(anchor);
9583
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
9617
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
9584
9618
  for (let i = 0; i < children.length; i++) {
9585
9619
  const child = children[i];
9586
9620
  unmount(child, parentComponent, parentSuspense, true, !!child.dynamicChildren);
@@ -9591,13 +9625,13 @@ const TeleportImpl = {
9591
9625
  move: moveTeleport,
9592
9626
  hydrate: hydrateTeleport
9593
9627
  };
9594
- function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* REORDER */) {
9628
+ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* TeleportMoveTypes.REORDER */) {
9595
9629
  // move target anchor if this is a target change.
9596
- if (moveType === 0 /* TARGET_CHANGE */) {
9630
+ if (moveType === 0 /* TeleportMoveTypes.TARGET_CHANGE */) {
9597
9631
  insert(vnode.targetAnchor, container, parentAnchor);
9598
9632
  }
9599
9633
  const { el, anchor, shapeFlag, children, props } = vnode;
9600
- const isReorder = moveType === 2 /* REORDER */;
9634
+ const isReorder = moveType === 2 /* TeleportMoveTypes.REORDER */;
9601
9635
  // move main view anchor if this is a re-order.
9602
9636
  if (isReorder) {
9603
9637
  insert(el, container, parentAnchor);
@@ -9607,9 +9641,9 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
9607
9641
  // is not a reorder, or the teleport is disabled
9608
9642
  if (!isReorder || isTeleportDisabled(props)) {
9609
9643
  // Teleport has either Array children or no children.
9610
- if (shapeFlag & 16 /* ARRAY_CHILDREN */) {
9644
+ if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
9611
9645
  for (let i = 0; i < children.length; i++) {
9612
- move(children[i], container, parentAnchor, 2 /* REORDER */);
9646
+ move(children[i], container, parentAnchor, 2 /* MoveType.REORDER */);
9613
9647
  }
9614
9648
  }
9615
9649
  }
@@ -9624,7 +9658,7 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
9624
9658
  // if multiple teleports rendered to the same target element, we need to
9625
9659
  // pick up from where the last teleport finished instead of the first node
9626
9660
  const targetNode = target._lpa || target.firstChild;
9627
- if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {
9661
+ if (vnode.shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
9628
9662
  if (isTeleportDisabled(vnode.props)) {
9629
9663
  vnode.anchor = hydrateChildren(nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized);
9630
9664
  vnode.targetAnchor = targetNode;
@@ -9701,7 +9735,7 @@ function convertLegacyComponent(comp, instance) {
9701
9735
  }
9702
9736
  // 2.x async component
9703
9737
  if (isFunction(comp) &&
9704
- checkCompatEnabled("COMPONENT_ASYNC" /* COMPONENT_ASYNC */, instance, comp)) {
9738
+ checkCompatEnabled("COMPONENT_ASYNC" /* DeprecationTypes.COMPONENT_ASYNC */, instance, comp)) {
9705
9739
  // since after disabling this, plain functions are still valid usage, do not
9706
9740
  // use softAssert here.
9707
9741
  return convertLegacyAsyncComponent(comp);
@@ -9709,7 +9743,7 @@ function convertLegacyComponent(comp, instance) {
9709
9743
  // 2.x functional component
9710
9744
  if (isObject(comp) &&
9711
9745
  comp.functional &&
9712
- softAssertCompatEnabled("COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */, instance, comp)) {
9746
+ softAssertCompatEnabled("COMPONENT_FUNCTIONAL" /* DeprecationTypes.COMPONENT_FUNCTIONAL */, instance, comp)) {
9713
9747
  return convertLegacyFunctionalComponent(comp);
9714
9748
  }
9715
9749
  return comp;
@@ -9806,7 +9840,7 @@ function isVNode(value) {
9806
9840
  return value ? value.__v_isVNode === true : false;
9807
9841
  }
9808
9842
  function isSameVNodeType(n1, n2) {
9809
- if (n2.shapeFlag & 6 /* COMPONENT */ &&
9843
+ if (n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
9810
9844
  hmrDirtyComponents.has(n2.type)) {
9811
9845
  // HMR only: if the component has been hot-updated, force a reload.
9812
9846
  return false;
@@ -9837,7 +9871,7 @@ const normalizeRef = ({ ref, ref_key, ref_for }) => {
9837
9871
  : ref
9838
9872
  : null);
9839
9873
  };
9840
- function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {
9874
+ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ShapeFlags.ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {
9841
9875
  const vnode = {
9842
9876
  __v_isVNode: true,
9843
9877
  __v_skip: true,
@@ -9868,7 +9902,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
9868
9902
  if (needFullChildrenNormalization) {
9869
9903
  normalizeChildren(vnode, children);
9870
9904
  // normalize suspense children
9871
- if (shapeFlag & 128 /* SUSPENSE */) {
9905
+ if (shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
9872
9906
  type.normalize(vnode);
9873
9907
  }
9874
9908
  }
@@ -9876,8 +9910,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
9876
9910
  // compiled element vnode - if children is passed, only possible types are
9877
9911
  // string or Array.
9878
9912
  vnode.shapeFlag |= isString(children)
9879
- ? 8 /* TEXT_CHILDREN */
9880
- : 16 /* ARRAY_CHILDREN */;
9913
+ ? 8 /* ShapeFlags.TEXT_CHILDREN */
9914
+ : 16 /* ShapeFlags.ARRAY_CHILDREN */;
9881
9915
  }
9882
9916
  // validate key
9883
9917
  if (vnode.key !== vnode.key) {
@@ -9893,10 +9927,10 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
9893
9927
  // component nodes also should always be patched, because even if the
9894
9928
  // component doesn't need to update, it needs to persist the instance on to
9895
9929
  // the next vnode so that it can be properly unmounted later.
9896
- (vnode.patchFlag > 0 || shapeFlag & 6 /* COMPONENT */) &&
9930
+ (vnode.patchFlag > 0 || shapeFlag & 6 /* ShapeFlags.COMPONENT */) &&
9897
9931
  // the EVENTS flag is only for hydration and if it is the only flag, the
9898
9932
  // vnode should not be considered dynamic due to handler caching.
9899
- vnode.patchFlag !== 32 /* HYDRATE_EVENTS */) {
9933
+ vnode.patchFlag !== 32 /* PatchFlags.HYDRATE_EVENTS */) {
9900
9934
  currentBlock.push(vnode);
9901
9935
  }
9902
9936
  {
@@ -9922,14 +9956,14 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
9922
9956
  normalizeChildren(cloned, children);
9923
9957
  }
9924
9958
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
9925
- if (cloned.shapeFlag & 6 /* COMPONENT */) {
9959
+ if (cloned.shapeFlag & 6 /* ShapeFlags.COMPONENT */) {
9926
9960
  currentBlock[currentBlock.indexOf(type)] = cloned;
9927
9961
  }
9928
9962
  else {
9929
9963
  currentBlock.push(cloned);
9930
9964
  }
9931
9965
  }
9932
- cloned.patchFlag |= -2 /* BAIL */;
9966
+ cloned.patchFlag |= -2 /* PatchFlags.BAIL */;
9933
9967
  return cloned;
9934
9968
  }
9935
9969
  // class component normalization.
@@ -9959,17 +9993,17 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
9959
9993
  }
9960
9994
  // encode the vnode type information into a bitmap
9961
9995
  const shapeFlag = isString(type)
9962
- ? 1 /* ELEMENT */
9996
+ ? 1 /* ShapeFlags.ELEMENT */
9963
9997
  : isSuspense(type)
9964
- ? 128 /* SUSPENSE */
9998
+ ? 128 /* ShapeFlags.SUSPENSE */
9965
9999
  : isTeleport(type)
9966
- ? 64 /* TELEPORT */
10000
+ ? 64 /* ShapeFlags.TELEPORT */
9967
10001
  : isObject(type)
9968
- ? 4 /* STATEFUL_COMPONENT */
10002
+ ? 4 /* ShapeFlags.STATEFUL_COMPONENT */
9969
10003
  : isFunction(type)
9970
- ? 2 /* FUNCTIONAL_COMPONENT */
10004
+ ? 2 /* ShapeFlags.FUNCTIONAL_COMPONENT */
9971
10005
  : 0;
9972
- if (shapeFlag & 4 /* STATEFUL_COMPONENT */ && isProxy(type)) {
10006
+ if (shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && isProxy(type)) {
9973
10007
  type = toRaw(type);
9974
10008
  warn$1(`Vue received a Component which was made a reactive object. This can ` +
9975
10009
  `lead to unnecessary performance overhead, and should be avoided by ` +
@@ -10008,7 +10042,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
10008
10042
  : ref,
10009
10043
  scopeId: vnode.scopeId,
10010
10044
  slotScopeIds: vnode.slotScopeIds,
10011
- children: patchFlag === -1 /* HOISTED */ && isArray(children)
10045
+ children: patchFlag === -1 /* PatchFlags.HOISTED */ && isArray(children)
10012
10046
  ? children.map(deepCloneVNode)
10013
10047
  : children,
10014
10048
  target: vnode.target,
@@ -10021,8 +10055,8 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
10021
10055
  // fast paths only.
10022
10056
  patchFlag: extraProps && vnode.type !== Fragment
10023
10057
  ? patchFlag === -1 // hoisted node
10024
- ? 16 /* FULL_PROPS */
10025
- : patchFlag | 16 /* FULL_PROPS */
10058
+ ? 16 /* PatchFlags.FULL_PROPS */
10059
+ : patchFlag | 16 /* PatchFlags.FULL_PROPS */
10026
10060
  : patchFlag,
10027
10061
  dynamicProps: vnode.dynamicProps,
10028
10062
  dynamicChildren: vnode.dynamicChildren,
@@ -10115,10 +10149,10 @@ function normalizeChildren(vnode, children) {
10115
10149
  children = null;
10116
10150
  }
10117
10151
  else if (isArray(children)) {
10118
- type = 16 /* ARRAY_CHILDREN */;
10152
+ type = 16 /* ShapeFlags.ARRAY_CHILDREN */;
10119
10153
  }
10120
10154
  else if (typeof children === 'object') {
10121
- if (shapeFlag & (1 /* ELEMENT */ | 64 /* TELEPORT */)) {
10155
+ if (shapeFlag & (1 /* ShapeFlags.ELEMENT */ | 64 /* ShapeFlags.TELEPORT */)) {
10122
10156
  // Normalize slot to plain children for plain element and Teleport
10123
10157
  const slot = children.default;
10124
10158
  if (slot) {
@@ -10130,37 +10164,37 @@ function normalizeChildren(vnode, children) {
10130
10164
  return;
10131
10165
  }
10132
10166
  else {
10133
- type = 32 /* SLOTS_CHILDREN */;
10167
+ type = 32 /* ShapeFlags.SLOTS_CHILDREN */;
10134
10168
  const slotFlag = children._;
10135
10169
  if (!slotFlag && !(InternalObjectKey in children)) {
10136
10170
  children._ctx = currentRenderingInstance;
10137
10171
  }
10138
- else if (slotFlag === 3 /* FORWARDED */ && currentRenderingInstance) {
10172
+ else if (slotFlag === 3 /* SlotFlags.FORWARDED */ && currentRenderingInstance) {
10139
10173
  // a child component receives forwarded slots from the parent.
10140
10174
  // its slot type is determined by its parent's slot type.
10141
- if (currentRenderingInstance.slots._ === 1 /* STABLE */) {
10142
- children._ = 1 /* STABLE */;
10175
+ if (currentRenderingInstance.slots._ === 1 /* SlotFlags.STABLE */) {
10176
+ children._ = 1 /* SlotFlags.STABLE */;
10143
10177
  }
10144
10178
  else {
10145
- children._ = 2 /* DYNAMIC */;
10146
- vnode.patchFlag |= 1024 /* DYNAMIC_SLOTS */;
10179
+ children._ = 2 /* SlotFlags.DYNAMIC */;
10180
+ vnode.patchFlag |= 1024 /* PatchFlags.DYNAMIC_SLOTS */;
10147
10181
  }
10148
10182
  }
10149
10183
  }
10150
10184
  }
10151
10185
  else if (isFunction(children)) {
10152
10186
  children = { default: children, _ctx: currentRenderingInstance };
10153
- type = 32 /* SLOTS_CHILDREN */;
10187
+ type = 32 /* ShapeFlags.SLOTS_CHILDREN */;
10154
10188
  }
10155
10189
  else {
10156
10190
  children = String(children);
10157
10191
  // force teleport children to array so it can be moved around
10158
- if (shapeFlag & 64 /* TELEPORT */) {
10159
- type = 16 /* ARRAY_CHILDREN */;
10192
+ if (shapeFlag & 64 /* ShapeFlags.TELEPORT */) {
10193
+ type = 16 /* ShapeFlags.ARRAY_CHILDREN */;
10160
10194
  children = [createTextVNode(children)];
10161
10195
  }
10162
10196
  else {
10163
- type = 8 /* TEXT_CHILDREN */;
10197
+ type = 8 /* ShapeFlags.TEXT_CHILDREN */;
10164
10198
  }
10165
10199
  }
10166
10200
  vnode.children = children;
@@ -10198,7 +10232,7 @@ function mergeProps(...args) {
10198
10232
  return ret;
10199
10233
  }
10200
10234
  function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
10201
- callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
10235
+ callWithAsyncErrorHandling(hook, instance, 7 /* ErrorCodes.VNODE_HOOK */, [
10202
10236
  vnode,
10203
10237
  prevVNode
10204
10238
  ]);
@@ -10306,7 +10340,7 @@ function validateComponentName(name, config) {
10306
10340
  }
10307
10341
  }
10308
10342
  function isStatefulComponent(instance) {
10309
- return instance.vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */;
10343
+ return instance.vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */;
10310
10344
  }
10311
10345
  let isInSSRComponentSetup = false;
10312
10346
  function setupComponent(instance, isSSR = false) {
@@ -10361,7 +10395,7 @@ function setupStatefulComponent(instance, isSSR) {
10361
10395
  setup.length > 1 ? createSetupContext(instance) : null);
10362
10396
  setCurrentInstance(instance);
10363
10397
  pauseTracking();
10364
- const setupResult = callWithErrorHandling(setup, instance, 0 /* SETUP_FUNCTION */, [shallowReadonly(instance.props) , setupContext]);
10398
+ const setupResult = callWithErrorHandling(setup, instance, 0 /* ErrorCodes.SETUP_FUNCTION */, [shallowReadonly(instance.props) , setupContext]);
10365
10399
  resetTracking();
10366
10400
  unsetCurrentInstance();
10367
10401
  if (isPromise(setupResult)) {
@@ -10373,7 +10407,7 @@ function setupStatefulComponent(instance, isSSR) {
10373
10407
  handleSetupResult(instance, resolvedResult, isSSR);
10374
10408
  })
10375
10409
  .catch(e => {
10376
- handleError(e, instance, 0 /* SETUP_FUNCTION */);
10410
+ handleError(e, instance, 0 /* ErrorCodes.SETUP_FUNCTION */);
10377
10411
  });
10378
10412
  }
10379
10413
  else {
@@ -10471,6 +10505,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
10471
10505
  // pass runtime compat config into the compiler
10472
10506
  finalCompilerOptions.compatConfig = Object.create(globalCompatConfig);
10473
10507
  if (Component.compatConfig) {
10508
+ // @ts-expect-error types are not compatible
10474
10509
  extend(finalCompilerOptions.compatConfig, Component.compatConfig);
10475
10510
  }
10476
10511
  }
@@ -10515,7 +10550,7 @@ function createAttrsProxy(instance) {
10515
10550
  return new Proxy(instance.attrs, {
10516
10551
  get(target, key) {
10517
10552
  markAttrsAccessed();
10518
- track(instance, "get" /* GET */, '$attrs');
10553
+ track(instance, "get" /* TrackOpTypes.GET */, '$attrs');
10519
10554
  return target[key];
10520
10555
  },
10521
10556
  set() {
@@ -10571,10 +10606,10 @@ function getExposeProxy(instance) {
10571
10606
  }
10572
10607
  const classifyRE = /(?:^|[-_])(\w)/g;
10573
10608
  const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
10574
- function getComponentName(Component) {
10609
+ function getComponentName(Component, includeInferred = true) {
10575
10610
  return isFunction(Component)
10576
10611
  ? Component.displayName || Component.name
10577
- : Component.name;
10612
+ : Component.name || (includeInferred && Component.__name);
10578
10613
  }
10579
10614
  /* istanbul ignore next */
10580
10615
  function formatComponentName(instance, Component, isRoot = false) {
@@ -11018,9 +11053,9 @@ function isMemoSame(cached, memo) {
11018
11053
  }
11019
11054
 
11020
11055
  // Core API ------------------------------------------------------------------
11021
- const version = "3.2.35";
11056
+ const version = "3.2.38";
11022
11057
  /**
11023
- * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
11058
+ * SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
11024
11059
  * @internal
11025
11060
  */
11026
11061
  const ssrUtils = (null);
@@ -11268,14 +11303,14 @@ function compatCoerceAttr(el, key, value, instance = null) {
11268
11303
  ? 'true'
11269
11304
  : null;
11270
11305
  if (v2CocercedValue &&
11271
- compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */, instance, key, value, v2CocercedValue)) {
11306
+ compatUtils.softAssertCompatEnabled("ATTR_ENUMERATED_COERCION" /* DeprecationTypes.ATTR_ENUMERATED_COERCION */, instance, key, value, v2CocercedValue)) {
11272
11307
  el.setAttribute(key, v2CocercedValue);
11273
11308
  return true;
11274
11309
  }
11275
11310
  }
11276
11311
  else if (value === false &&
11277
11312
  !isSpecialBooleanAttr(key) &&
11278
- compatUtils.softAssertCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, instance, key)) {
11313
+ compatUtils.softAssertCompatEnabled("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, instance, key)) {
11279
11314
  el.removeAttribute(key);
11280
11315
  return true;
11281
11316
  }
@@ -11337,10 +11372,10 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
11337
11372
  }
11338
11373
  else {
11339
11374
  if (value === false &&
11340
- compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent)) {
11375
+ compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, parentComponent)) {
11341
11376
  const type = typeof el[key];
11342
11377
  if (type === 'string' || type === 'number') {
11343
- compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent, key);
11378
+ compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* DeprecationTypes.ATTR_FALSE_VALUE */, parentComponent, key);
11344
11379
  value = type === 'number' ? 0 : '';
11345
11380
  needRemove = true;
11346
11381
  }
@@ -11374,7 +11409,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
11374
11409
  // if the low-res timestamp which is bigger than the event timestamp
11375
11410
  // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
11376
11411
  // and we need to use the hi-res version for event listeners as well.
11377
- _getNow = () => performance.now();
11412
+ _getNow = performance.now.bind(performance);
11378
11413
  }
11379
11414
  // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
11380
11415
  // and does not fire microtasks in between event propagation, so safe to exclude.
@@ -11430,7 +11465,8 @@ function parseName(name) {
11430
11465
  options[m[0].toLowerCase()] = true;
11431
11466
  }
11432
11467
  }
11433
- return [hyphenate(name.slice(2)), options];
11468
+ const event = name[2] === ':' ? name.slice(3) : hyphenate(name.slice(2));
11469
+ return [event, options];
11434
11470
  }
11435
11471
  function createInvoker(initialValue, instance) {
11436
11472
  const invoker = (e) => {
@@ -11442,7 +11478,7 @@ function createInvoker(initialValue, instance) {
11442
11478
  // AFTER it was attached.
11443
11479
  const timeStamp = e.timeStamp || _getNow();
11444
11480
  if (skipTimestampCheck || timeStamp >= invoker.attached - 1) {
11445
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* NATIVE_EVENT_HANDLER */, [e]);
11481
+ callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* ErrorCodes.NATIVE_EVENT_HANDLER */, [e]);
11446
11482
  }
11447
11483
  };
11448
11484
  invoker.value = initialValue;
@@ -11797,7 +11833,7 @@ function useCssVars(getter) {
11797
11833
  });
11798
11834
  }
11799
11835
  function setVarsOnVNode(vnode, vars) {
11800
- if (vnode.shapeFlag & 128 /* SUSPENSE */) {
11836
+ if (vnode.shapeFlag & 128 /* ShapeFlags.SUSPENSE */) {
11801
11837
  const suspense = vnode.suspense;
11802
11838
  vnode = suspense.activeBranch;
11803
11839
  if (suspense.pendingBranch && !suspense.isHydrating) {
@@ -11810,7 +11846,7 @@ function setVarsOnVNode(vnode, vars) {
11810
11846
  while (vnode.component) {
11811
11847
  vnode = vnode.component.subTree;
11812
11848
  }
11813
- if (vnode.shapeFlag & 1 /* ELEMENT */ && vnode.el) {
11849
+ if (vnode.shapeFlag & 1 /* ShapeFlags.ELEMENT */ && vnode.el) {
11814
11850
  setVarsOnNode(vnode.el, vars);
11815
11851
  }
11816
11852
  else if (vnode.type === Fragment) {
@@ -11899,7 +11935,7 @@ function resolveTransitionProps(rawProps) {
11899
11935
  }
11900
11936
  const { name = 'v', type, duration, enterFromClass = `${name}-enter-from`, enterActiveClass = `${name}-enter-active`, enterToClass = `${name}-enter-to`, appearFromClass = enterFromClass, appearActiveClass = enterActiveClass, appearToClass = enterToClass, leaveFromClass = `${name}-leave-from`, leaveActiveClass = `${name}-leave-active`, leaveToClass = `${name}-leave-to` } = rawProps;
11901
11937
  // legacy transition class compat
11902
- const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES" /* TRANSITION_CLASSES */, null);
11938
+ const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES" /* DeprecationTypes.TRANSITION_CLASSES */, null);
11903
11939
  let legacyEnterFromClass;
11904
11940
  let legacyAppearFromClass;
11905
11941
  let legacyLeaveFromClass;
@@ -11924,9 +11960,8 @@ function resolveTransitionProps(rawProps) {
11924
11960
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
11925
11961
  done && done();
11926
11962
  };
11927
- let isLeaving = false;
11928
11963
  const finishLeave = (el, done) => {
11929
- isLeaving = false;
11964
+ el._isLeaving = false;
11930
11965
  removeTransitionClass(el, leaveFromClass);
11931
11966
  removeTransitionClass(el, leaveToClass);
11932
11967
  removeTransitionClass(el, leaveActiveClass);
@@ -11969,7 +12004,7 @@ function resolveTransitionProps(rawProps) {
11969
12004
  onEnter: makeEnterHook(false),
11970
12005
  onAppear: makeEnterHook(true),
11971
12006
  onLeave(el, done) {
11972
- isLeaving = true;
12007
+ el._isLeaving = true;
11973
12008
  const resolve = () => finishLeave(el, done);
11974
12009
  addTransitionClass(el, leaveFromClass);
11975
12010
  if (legacyClassEnabled) {
@@ -11979,7 +12014,7 @@ function resolveTransitionProps(rawProps) {
11979
12014
  forceReflow();
11980
12015
  addTransitionClass(el, leaveActiveClass);
11981
12016
  nextFrame(() => {
11982
- if (!isLeaving) {
12017
+ if (!el._isLeaving) {
11983
12018
  // cancelled
11984
12019
  return;
11985
12020
  }
@@ -12209,7 +12244,7 @@ const TransitionGroupImpl = {
12209
12244
  const cssTransitionProps = resolveTransitionProps(rawProps);
12210
12245
  let tag = rawProps.tag || Fragment;
12211
12246
  if (!rawProps.tag &&
12212
- compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */, instance.parent)) {
12247
+ compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT" /* DeprecationTypes.TRANSITION_GROUP_ROOT */, instance.parent)) {
12213
12248
  tag = 'span';
12214
12249
  }
12215
12250
  prevChildren = children;
@@ -12579,13 +12614,13 @@ const withKeys = (fn, modifiers) => {
12579
12614
  let instance = null;
12580
12615
  {
12581
12616
  instance = getCurrentInstance();
12582
- if (compatUtils.isCompatEnabled("CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */, instance)) {
12617
+ if (compatUtils.isCompatEnabled("CONFIG_KEY_CODES" /* DeprecationTypes.CONFIG_KEY_CODES */, instance)) {
12583
12618
  if (instance) {
12584
12619
  globalKeyCodes = instance.appContext.config.keyCodes;
12585
12620
  }
12586
12621
  }
12587
12622
  if (modifiers.some(m => /^\d+$/.test(m))) {
12588
- compatUtils.warnDeprecation("V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */, instance);
12623
+ compatUtils.warnDeprecation("V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */, instance);
12589
12624
  }
12590
12625
  }
12591
12626
  return (event) => {
@@ -12598,7 +12633,7 @@ const withKeys = (fn, modifiers) => {
12598
12633
  }
12599
12634
  {
12600
12635
  const keyCode = String(event.keyCode);
12601
- if (compatUtils.isCompatEnabled("V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */, instance) &&
12636
+ if (compatUtils.isCompatEnabled("V_ON_KEYCODE_MODIFIER" /* DeprecationTypes.V_ON_KEYCODE_MODIFIER */, instance) &&
12602
12637
  modifiers.some(mod => mod == keyCode)) {
12603
12638
  return fn(event);
12604
12639
  }
@@ -12707,7 +12742,7 @@ const createApp = ((...args) => {
12707
12742
  for (let i = 0; i < container.attributes.length; i++) {
12708
12743
  const attr = container.attributes[i];
12709
12744
  if (attr.name !== 'v-cloak' && /^(v-|:|@)/.test(attr.name)) {
12710
- compatUtils.warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */, null);
12745
+ compatUtils.warnDeprecation("GLOBAL_MOUNT_CONTAINER" /* DeprecationTypes.GLOBAL_MOUNT_CONTAINER */, null);
12711
12746
  break;
12712
12747
  }
12713
12748
  }
@@ -12964,7 +12999,7 @@ function initDev() {
12964
12999
  function wrappedCreateApp(...args) {
12965
13000
  // @ts-ignore
12966
13001
  const app = createApp(...args);
12967
- if (compatUtils.isCompatEnabled("RENDER_FUNCTION" /* RENDER_FUNCTION */, null)) {
13002
+ if (compatUtils.isCompatEnabled("RENDER_FUNCTION" /* DeprecationTypes.RENDER_FUNCTION */, null)) {
12968
13003
  // register built-in components so that they can be resolved via strings
12969
13004
  // in the legacy h() call. The __compat__ prefix is to ensure that v3 h()
12970
13005
  // doesn't get affected.