@vuact/runtime-dom 3.5.45-vuact.0 → 3.5.47-vuact.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.45
2
+ * @vue/runtime-dom v3.5.47
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -56,11 +56,18 @@ var VueRuntimeDOM = (function (exports) {
56
56
  const isBuiltInDirective = /* @__PURE__ */ makeMap(
57
57
  "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
58
58
  );
59
+ const STRING_CACHE_MAX_SIZE = 1e4;
59
60
  const cacheStringFunction = (fn) => {
60
- const cache = /* @__PURE__ */ Object.create(null);
61
+ let cache = /* @__PURE__ */ Object.create(null);
62
+ let size = 0;
61
63
  return ((str) => {
62
64
  const hit = cache[str];
63
- return hit || (cache[str] = fn(str));
65
+ if (hit !== void 0) return hit;
66
+ if (++size > STRING_CACHE_MAX_SIZE) {
67
+ cache = /* @__PURE__ */ Object.create(null);
68
+ size = 1;
69
+ }
70
+ return cache[str] = fn(str);
64
71
  });
65
72
  };
66
73
  const camelizeRE = /-\w/g;
@@ -138,6 +145,7 @@ var VueRuntimeDOM = (function (exports) {
138
145
  });
139
146
  return ret;
140
147
  }
148
+ const vendorPrefixRE = /^(?:webkit|moz|ms)-/;
141
149
  function stringifyStyle(styles) {
142
150
  if (!styles) return "";
143
151
  if (isString(styles)) return styles;
@@ -145,7 +153,10 @@ var VueRuntimeDOM = (function (exports) {
145
153
  for (const key in styles) {
146
154
  const value = styles[key];
147
155
  if (isString(value) || typeof value === "number") {
148
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
156
+ let normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
157
+ if (vendorPrefixRE.test(normalizedKey)) {
158
+ normalizedKey = `-${normalizedKey}`;
159
+ }
149
160
  ret += `${normalizedKey}:${value};`;
150
161
  }
151
162
  }
@@ -193,7 +204,7 @@ var VueRuntimeDOM = (function (exports) {
193
204
  const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
194
205
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
195
206
  const isBooleanAttr = /* @__PURE__ */ makeMap(
196
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
207
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected,webkitdirectory`
197
208
  );
198
209
  function includeBooleanAttr(value) {
199
210
  return !!value || value === "";
@@ -209,7 +220,9 @@ var VueRuntimeDOM = (function (exports) {
209
220
  return false;
210
221
  }
211
222
  const type = typeof value;
212
- return type === "string" || type === "number" || type === "boolean";
223
+ return type === "string" || type === "number" || type === "boolean" || // bigint stringifies the same way on both sides (`setAttribute`/property
224
+ // assignment on the client, `escapeHtml` during SSR)
225
+ type === "bigint";
213
226
  }
214
227
 
215
228
  const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
@@ -262,13 +275,13 @@ var VueRuntimeDOM = (function (exports) {
262
275
  return false;
263
276
  }
264
277
  for (const key in a) {
265
- const aHasKey = a.hasOwnProperty(key);
266
- const bHasKey = b.hasOwnProperty(key);
278
+ const aHasKey = hasOwn(a, key);
279
+ const bHasKey = hasOwn(b, key);
267
280
  if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) {
268
281
  return false;
269
282
  }
270
283
  }
271
- return String(a) === String(b);
284
+ return toComparableString(a) === toComparableString(b);
272
285
  }
273
286
  function looseCompareNested(a, b, seen, compare) {
274
287
  if (!seen) {
@@ -315,6 +328,9 @@ var VueRuntimeDOM = (function (exports) {
315
328
  function looseIndexOf(arr, val) {
316
329
  return arr.findIndex((item) => looseEqual(item, val));
317
330
  }
331
+ function toComparableString(value) {
332
+ return Object.getPrototypeOf(value) === null && value[Symbol.toPrimitive] == null && typeof value.toString !== "function" && typeof value.valueOf !== "function" ? toTypeString(value) : String(value);
333
+ }
318
334
 
319
335
  const isRef$1 = (val) => {
320
336
  return !!(val && val["__v_isRef"] === true);
@@ -1121,16 +1137,17 @@ var VueRuntimeDOM = (function (exports) {
1121
1137
  track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
1122
1138
  return arr;
1123
1139
  }
1124
- function toWrapped(target, item) {
1140
+ const toReadonlyReactive = (item) => toReadonly(toReactive(item));
1141
+ function getWrapper(target) {
1125
1142
  if (isReadonly(target)) {
1126
- return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
1143
+ return isReactive(target) ? toReadonlyReactive : toReadonly;
1127
1144
  }
1128
- return toReactive(item);
1145
+ return toReactive;
1129
1146
  }
1130
1147
  const arrayInstrumentations = {
1131
1148
  __proto__: null,
1132
1149
  [Symbol.iterator]() {
1133
- return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
1150
+ return iterator(this, Symbol.iterator, getWrapper(this));
1134
1151
  },
1135
1152
  concat(...args) {
1136
1153
  return reactiveReadArray(this).concat(
@@ -1138,8 +1155,9 @@ var VueRuntimeDOM = (function (exports) {
1138
1155
  );
1139
1156
  },
1140
1157
  entries() {
1158
+ const wrap = getWrapper(this);
1141
1159
  return iterator(this, "entries", (value) => {
1142
- value[1] = toWrapped(this, value[1]);
1160
+ value[1] = wrap(value[1]);
1143
1161
  return value;
1144
1162
  });
1145
1163
  },
@@ -1152,7 +1170,7 @@ var VueRuntimeDOM = (function (exports) {
1152
1170
  "filter",
1153
1171
  fn,
1154
1172
  thisArg,
1155
- (v) => v.map((item) => toWrapped(this, item)),
1173
+ (v) => v.map(getWrapper(this)),
1156
1174
  arguments
1157
1175
  );
1158
1176
  },
@@ -1162,7 +1180,8 @@ var VueRuntimeDOM = (function (exports) {
1162
1180
  "find",
1163
1181
  fn,
1164
1182
  thisArg,
1165
- (item) => toWrapped(this, item),
1183
+ // only the found item is wrapped, so read the flags only then
1184
+ (item) => getWrapper(this)(item),
1166
1185
  arguments
1167
1186
  );
1168
1187
  },
@@ -1175,7 +1194,8 @@ var VueRuntimeDOM = (function (exports) {
1175
1194
  "findLast",
1176
1195
  fn,
1177
1196
  thisArg,
1178
- (item) => toWrapped(this, item),
1197
+ // only the found item is wrapped, so read the flags only then
1198
+ (item) => getWrapper(this)(item),
1179
1199
  arguments
1180
1200
  );
1181
1201
  },
@@ -1237,7 +1257,7 @@ var VueRuntimeDOM = (function (exports) {
1237
1257
  return noTracking(this, "unshift", args);
1238
1258
  },
1239
1259
  values() {
1240
- return iterator(this, "values", (item) => toWrapped(this, item));
1260
+ return iterator(this, "values", getWrapper(this));
1241
1261
  }
1242
1262
  };
1243
1263
  function iterator(self, method, wrapValue) {
@@ -1289,8 +1309,9 @@ var VueRuntimeDOM = (function (exports) {
1289
1309
  let wrappedFn = fn;
1290
1310
  if (arr !== self) {
1291
1311
  if (needsWrap) {
1312
+ const wrap = getWrapper(self);
1292
1313
  wrappedFn = function(item, index) {
1293
- return fn.call(this, toWrapped(self, item), index, self);
1314
+ return fn.call(this, wrap(item), index, self);
1294
1315
  };
1295
1316
  } else if (fn.length > 2) {
1296
1317
  wrappedFn = function(item, index) {
@@ -1308,13 +1329,14 @@ var VueRuntimeDOM = (function (exports) {
1308
1329
  let wrapInitialAccumulator = false;
1309
1330
  if (arr !== self) {
1310
1331
  if (needsWrap) {
1332
+ const wrap = getWrapper(self);
1311
1333
  wrapInitialAccumulator = args.length === 0;
1312
1334
  wrappedFn = function(acc, item, index) {
1313
1335
  if (wrapInitialAccumulator) {
1314
1336
  wrapInitialAccumulator = false;
1315
- acc = toWrapped(self, acc);
1337
+ acc = wrap(acc);
1316
1338
  }
1317
- return fn.call(this, acc, toWrapped(self, item), index, self);
1339
+ return fn.call(this, acc, wrap(item), index, self);
1318
1340
  };
1319
1341
  } else if (fn.length > 3) {
1320
1342
  wrappedFn = function(acc, item, index) {
@@ -1323,7 +1345,7 @@ var VueRuntimeDOM = (function (exports) {
1323
1345
  }
1324
1346
  }
1325
1347
  const result = arr[method](wrappedFn, ...args);
1326
- return wrapInitialAccumulator ? toWrapped(self, result) : result;
1348
+ return wrapInitialAccumulator ? getWrapper(self)(result) : result;
1327
1349
  }
1328
1350
  function searchProxy(self, method, args) {
1329
1351
  const arr = toRaw(self);
@@ -2165,7 +2187,7 @@ var VueRuntimeDOM = (function (exports) {
2165
2187
  }
2166
2188
  }
2167
2189
  function watch$1(source, cb, options = EMPTY_OBJ) {
2168
- const { immediate, deep, once, scheduler, augmentJob, call } = options;
2190
+ const { immediate, deep, once, scheduler, augmentJob, call, onStop } = options;
2169
2191
  const warnInvalidSource = (s) => {
2170
2192
  (options.onWarn || warn$2)(
2171
2193
  `Invalid watch source: `,
@@ -2234,7 +2256,7 @@ var VueRuntimeDOM = (function (exports) {
2234
2256
  if (cb && deep) {
2235
2257
  const baseGetter = getter;
2236
2258
  const depth = deep === true ? Infinity : deep;
2237
- getter = () => traverse(baseGetter(), depth);
2259
+ getter = () => traverse(baseGetter(), isMultiSource ? depth + 1 : depth);
2238
2260
  }
2239
2261
  const scope = getCurrentScope();
2240
2262
  const watchHandle = () => {
@@ -2243,9 +2265,11 @@ var VueRuntimeDOM = (function (exports) {
2243
2265
  remove(scope.effects, effect);
2244
2266
  }
2245
2267
  };
2268
+ let onceCallbackInvoked = false;
2246
2269
  if (once && cb) {
2247
2270
  const _cb = cb;
2248
2271
  cb = (...args) => {
2272
+ onceCallbackInvoked = true;
2249
2273
  try {
2250
2274
  return _cb(...args);
2251
2275
  } finally {
@@ -2255,7 +2279,7 @@ var VueRuntimeDOM = (function (exports) {
2255
2279
  }
2256
2280
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2257
2281
  const job = (immediateFirstRun) => {
2258
- if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
2282
+ if (onceCallbackInvoked || !(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
2259
2283
  return;
2260
2284
  }
2261
2285
  if (cb) {
@@ -2305,6 +2329,12 @@ var VueRuntimeDOM = (function (exports) {
2305
2329
  cleanupMap.delete(effect);
2306
2330
  }
2307
2331
  };
2332
+ if (onStop) {
2333
+ effect.onStop = () => {
2334
+ cleanup();
2335
+ onStop();
2336
+ };
2337
+ }
2308
2338
  {
2309
2339
  effect.onTrack = options.onTrack;
2310
2340
  effect.onTrigger = options.onTrigger;
@@ -2338,8 +2368,17 @@ var VueRuntimeDOM = (function (exports) {
2338
2368
  if (isRef(value)) {
2339
2369
  traverse(value.value, depth, seen);
2340
2370
  } else if (isArray(value)) {
2341
- for (let i = 0; i < value.length; i++) {
2342
- traverse(value[i], depth, seen);
2371
+ if (isReactive(value) && !isReadonly(value) && !isShallow(value)) {
2372
+ const raw = toRaw(value);
2373
+ track(raw, "iterate", ARRAY_ITERATE_KEY);
2374
+ for (let i = 0; i < raw.length; i++) {
2375
+ const item = raw[i];
2376
+ traverse(isRef(item) ? item : toReactive(item), depth, seen);
2377
+ }
2378
+ } else {
2379
+ for (let i = 0; i < value.length; i++) {
2380
+ traverse(value[i], depth, seen);
2381
+ }
2343
2382
  }
2344
2383
  } else if (isSet(value) || isMap(value)) {
2345
2384
  value.forEach((v) => {
@@ -2349,8 +2388,9 @@ var VueRuntimeDOM = (function (exports) {
2349
2388
  for (const key in value) {
2350
2389
  traverse(value[key], depth, seen);
2351
2390
  }
2352
- for (const key of Object.getOwnPropertySymbols(value)) {
2353
- if (Object.prototype.propertyIsEnumerable.call(value, key)) {
2391
+ const raw = toRaw(value);
2392
+ for (const key of Object.getOwnPropertySymbols(raw)) {
2393
+ if (Object.prototype.propertyIsEnumerable.call(raw, key)) {
2354
2394
  traverse(value[key], depth, seen);
2355
2395
  }
2356
2396
  }
@@ -3279,7 +3319,27 @@ var VueRuntimeDOM = (function (exports) {
3279
3319
  }
3280
3320
  const baseWatchOptions = extend({}, options);
3281
3321
  baseWatchOptions.onWarn = warn$1;
3282
- const instance = currentInstance;
3322
+ let instance = currentInstance;
3323
+ let watcherJob;
3324
+ if (instance && getCurrentScope() !== instance.scope) {
3325
+ if (instance.scope.active) {
3326
+ const ownerScope = instance.scope.run(() => new EffectScope());
3327
+ ownerScope.run(
3328
+ () => onScopeDispose(
3329
+ () => (
3330
+ // deferred: the watchers this unmount stops still report to the owner
3331
+ Promise.resolve().then(() => {
3332
+ instance = null;
3333
+ if (watcherJob) watcherJob.i = null;
3334
+ })
3335
+ )
3336
+ )
3337
+ );
3338
+ baseWatchOptions.onStop = () => ownerScope.stop();
3339
+ } else {
3340
+ instance = null;
3341
+ }
3342
+ }
3283
3343
  baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
3284
3344
  let isPre = false;
3285
3345
  if (flush === "post") {
@@ -3298,6 +3358,7 @@ var VueRuntimeDOM = (function (exports) {
3298
3358
  };
3299
3359
  }
3300
3360
  baseWatchOptions.augmentJob = (job) => {
3361
+ watcherJob = job;
3301
3362
  if (cb) {
3302
3363
  job.flags |= 4;
3303
3364
  }
@@ -3644,8 +3705,8 @@ var VueRuntimeDOM = (function (exports) {
3644
3705
  const targetNode = target._lpa || target.firstChild;
3645
3706
  if (vnode.shapeFlag & 16) {
3646
3707
  if (disabled) {
3647
- hydrateDisabledTeleport(node, vnode);
3648
3708
  hydrateAnchor(target, targetNode);
3709
+ hydrateDisabledTeleport(node, vnode);
3649
3710
  if (!vnode.targetAnchor) {
3650
3711
  prepareAnchor(
3651
3712
  target,
@@ -3660,17 +3721,20 @@ var VueRuntimeDOM = (function (exports) {
3660
3721
  } else {
3661
3722
  vnode.anchor = nextSibling(node);
3662
3723
  hydrateAnchor(target, targetNode);
3663
- if (!vnode.targetAnchor) {
3724
+ const hasSSRAnchor = !!vnode.targetAnchor;
3725
+ if (!hasSSRAnchor) {
3664
3726
  prepareAnchor(target, vnode, createText, insert);
3665
3727
  }
3666
3728
  hydrateChildren(
3667
- targetNode && nextSibling(targetNode),
3729
+ // #15937 without SSR anchors, mount instead of hydrating unrelated nodes.
3730
+ hasSSRAnchor ? targetNode && nextSibling(targetNode) : null,
3668
3731
  vnode,
3669
3732
  target,
3670
3733
  parentComponent,
3671
3734
  parentSuspense,
3672
3735
  slotScopeIds,
3673
- optimized
3736
+ optimized,
3737
+ vnode.targetAnchor
3674
3738
  );
3675
3739
  }
3676
3740
  }
@@ -3688,19 +3752,11 @@ var VueRuntimeDOM = (function (exports) {
3688
3752
  function updateCssVars(vnode, isDisabled) {
3689
3753
  const ctx = vnode.ctx;
3690
3754
  if (ctx && ctx.ut) {
3691
- let node, anchor;
3692
3755
  if (isDisabled) {
3693
- node = vnode.el;
3694
- anchor = vnode.anchor;
3756
+ ctx.ut(vnode.el, vnode.anchor);
3695
3757
  } else {
3696
- node = vnode.targetStart;
3697
- anchor = vnode.targetAnchor;
3758
+ ctx.ut(vnode.targetStart, vnode.targetAnchor);
3698
3759
  }
3699
- while (node && node !== anchor) {
3700
- if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
3701
- node = node.nextSibling;
3702
- }
3703
- ctx.ut();
3704
3760
  }
3705
3761
  }
3706
3762
  function prepareAnchor(target, vnode, createText, insert, anchor = null) {
@@ -3830,11 +3886,13 @@ var VueRuntimeDOM = (function (exports) {
3830
3886
  earlyRemove();
3831
3887
  el[leaveCbKey] = void 0;
3832
3888
  delete enterHooks.delayedLeave;
3889
+ delete leavingHooks.delayLeave;
3833
3890
  oldInnerChild = void 0;
3834
3891
  };
3835
3892
  enterHooks.delayedLeave = () => {
3836
3893
  delayedLeave();
3837
3894
  delete enterHooks.delayedLeave;
3895
+ delete leavingHooks.delayLeave;
3838
3896
  oldInnerChild = void 0;
3839
3897
  };
3840
3898
  };
@@ -3946,7 +4004,10 @@ var VueRuntimeDOM = (function (exports) {
3946
4004
  callHook(hook, [el]);
3947
4005
  },
3948
4006
  enter(el) {
3949
- if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
4007
+ if (!isHmrUpdating && el[leaveCbKey]) {
4008
+ if (hooks.delayedLeave) hooks.delayedLeave();
4009
+ return;
4010
+ }
3950
4011
  let hook = onEnter;
3951
4012
  let afterHook = onAfterEnter;
3952
4013
  let cancelHook = onEnterCancelled;
@@ -4448,7 +4509,7 @@ var VueRuntimeDOM = (function (exports) {
4448
4509
  }
4449
4510
  return isFragmentStart ? nextSibling(nextNode) : nextNode;
4450
4511
  } else {
4451
- onMismatch();
4512
+ nextNode = onMismatch();
4452
4513
  }
4453
4514
  break;
4454
4515
  case Fragment:
@@ -4662,15 +4723,19 @@ Server rendered element contains more child nodes than client vdom.`
4662
4723
  }
4663
4724
  return el.nextSibling;
4664
4725
  };
4665
- const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
4726
+ const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized, anchor) => {
4666
4727
  optimized = optimized || !!parentVNode.dynamicChildren;
4667
4728
  const children = parentVNode.children;
4668
4729
  const l = children.length;
4730
+ const isFragment = parentVNode.type === Fragment;
4669
4731
  let hasCheckedMismatch = false;
4670
4732
  for (let i = 0; i < l; i++) {
4671
4733
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4672
4734
  const isText = vnode.type === Text;
4673
- if (node) {
4735
+ if (isFragment && node && isComment(node) && node.data === "]") {
4736
+ anchor = node;
4737
+ }
4738
+ if (node && node !== anchor) {
4674
4739
  if (isText && !optimized) {
4675
4740
  if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
4676
4741
  insert(
@@ -4692,7 +4757,7 @@ Server rendered element contains more child nodes than client vdom.`
4692
4757
  optimized
4693
4758
  );
4694
4759
  } else if (isText && !vnode.children) {
4695
- insert(vnode.el = createText(""), container);
4760
+ insert(vnode.el = createText(""), container, anchor);
4696
4761
  } else {
4697
4762
  if (!hasCheckedMismatch) {
4698
4763
  hasCheckedMismatch = true;
@@ -4710,7 +4775,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4710
4775
  null,
4711
4776
  vnode,
4712
4777
  container,
4713
- null,
4778
+ anchor,
4714
4779
  parentComponent,
4715
4780
  parentSuspense,
4716
4781
  getContainerType(container),
@@ -4953,7 +5018,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4953
5018
  }
4954
5019
  function resolveCssVars(instance, vnode, expectedMap) {
4955
5020
  const root = instance.subTree;
4956
- if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
5021
+ if (instance.getCssVars && isCssVarsRoot(root, vnode)) {
4957
5022
  const cssVars = instance.getCssVars();
4958
5023
  for (const key in cssVars) {
4959
5024
  const value = normalizeCssVarValue(cssVars[key]);
@@ -4964,6 +5029,9 @@ Server rendered element contains fewer child nodes than client vdom.`
4964
5029
  resolveCssVars(instance.parent, instance.vnode, expectedMap);
4965
5030
  }
4966
5031
  }
5032
+ function isCssVarsRoot(root, vnode) {
5033
+ return root === vnode || !!(root && (root.type === Fragment || root.shapeFlag & 64) && root.children.some((child) => isCssVarsRoot(child, vnode)));
5034
+ }
4967
5035
  const allowMismatchAttr = "data-allow-mismatch";
4968
5036
  const MismatchTypeString = {
4969
5037
  [0 /* TEXT */]: "text",
@@ -5402,7 +5470,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5402
5470
  const cached = cache.get(key);
5403
5471
  if (cached && (!current || !isSameVNodeType(cached, current))) {
5404
5472
  unmount(cached);
5405
- } else if (current) {
5473
+ } else if (current && (current.key == null ? current.type : current.key) === key) {
5406
5474
  resetShapeFlag(current);
5407
5475
  if (cached) resetShapeFlag(cached);
5408
5476
  }
@@ -9761,6 +9829,8 @@ If you want to remount the same app, move your app creation logic into a factory
9761
9829
  optimized
9762
9830
  );
9763
9831
  suspense.resolve(true);
9832
+ suspense.pendingId = suspenseId++;
9833
+ suspense.deps = 0;
9764
9834
  } else {
9765
9835
  patch(
9766
9836
  null,
@@ -9892,6 +9962,10 @@ If you want to remount the same app, move your app creation logic into a factory
9892
9962
  container: container2,
9893
9963
  isInFallback
9894
9964
  } = suspense;
9965
+ let pendingAncestor = suspense.parent;
9966
+ while (pendingAncestor && !pendingAncestor.pendingBranch) {
9967
+ pendingAncestor = pendingAncestor.parent;
9968
+ }
9895
9969
  let delayEnter = false;
9896
9970
  if (suspense.isHydrating) {
9897
9971
  suspense.isHydrating = false;
@@ -9908,7 +9982,16 @@ If you want to remount the same app, move your app creation logic into a factory
9908
9982
  anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor,
9909
9983
  0
9910
9984
  );
9911
- queuePostFlushCb(effects);
9985
+ let hidden = false;
9986
+ if (pendingAncestor) {
9987
+ let top = container2;
9988
+ let parent;
9989
+ while (parent = parentNode(top)) top = parent;
9990
+ hidden = top === pendingAncestor.hiddenContainer;
9991
+ }
9992
+ if (!hidden) {
9993
+ queuePostFlushCb(effects);
9994
+ }
9912
9995
  if (isInFallback && vnode2.ssFallback) {
9913
9996
  vnode2.ssFallback.el = null;
9914
9997
  }
@@ -9948,19 +10031,11 @@ If you want to remount the same app, move your app creation logic into a factory
9948
10031
  }
9949
10032
  }
9950
10033
  effects.length = kept;
9951
- let parent = suspense.parent;
9952
- let hasUnresolvedAncestor = false;
9953
- while (parent) {
9954
- if (parent.pendingBranch) {
9955
- for (let i = 0; i < effects.length; i++) {
9956
- parent.effects.push(effects[i]);
9957
- }
9958
- hasUnresolvedAncestor = true;
9959
- break;
10034
+ if (pendingAncestor) {
10035
+ for (let i = 0; i < effects.length; i++) {
10036
+ pendingAncestor.effects.push(effects[i]);
9960
10037
  }
9961
- parent = parent.parent;
9962
- }
9963
- if (!hasUnresolvedAncestor && !delayEnter) {
10038
+ } else if (!delayEnter) {
9964
10039
  queuePostFlushCb(effects);
9965
10040
  }
9966
10041
  suspense.effects = [];
@@ -10071,7 +10146,9 @@ If you want to remount the same app, move your app creation logic into a factory
10071
10146
  }
10072
10147
  };
10073
10148
  instance.asyncDep.catch((err) => {
10074
- handleError(err, instance, 0, false, true);
10149
+ if (instance.scope.active) {
10150
+ handleError(err, instance, 0, false, true);
10151
+ }
10075
10152
  return () => null;
10076
10153
  }).then((asyncSetupResult) => {
10077
10154
  if (instance.isUnmounted || suspense.isUnmounted) {
@@ -11306,7 +11383,7 @@ Component that was made reactive: `,
11306
11383
  return true;
11307
11384
  }
11308
11385
 
11309
- const version = "3.5.45";
11386
+ const version = "3.5.47";
11310
11387
  const warn = warn$1 ;
11311
11388
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11312
11389
  const devtools = devtools$1 ;
@@ -11479,12 +11556,14 @@ Component that was made reactive: `,
11479
11556
  onAppearCancelled = onEnterCancelled
11480
11557
  } = baseProps;
11481
11558
  const finishEnter = (el, isAppear, done, isCancelled) => {
11559
+ el._enterResolve = void 0;
11482
11560
  el._enterCancelled = isCancelled;
11483
11561
  removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
11484
11562
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
11485
11563
  done && done();
11486
11564
  };
11487
11565
  const finishLeave = (el, done) => {
11566
+ el._leaveResolve = void 0;
11488
11567
  el._isLeaving = false;
11489
11568
  removeTransitionClass(el, leaveFromClass);
11490
11569
  removeTransitionClass(el, leaveToClass);
@@ -11494,10 +11573,18 @@ Component that was made reactive: `,
11494
11573
  const makeEnterHook = (isAppear) => {
11495
11574
  return (el, done) => {
11496
11575
  const hook = isAppear ? onAppear : onEnter;
11497
- const resolve = () => finishEnter(el, isAppear, done);
11576
+ const resolve = () => {
11577
+ if (el._enterResolve === resolve) {
11578
+ finishEnter(el, isAppear, done);
11579
+ }
11580
+ };
11581
+ el._enterResolve = resolve;
11498
11582
  callHook(hook, [el, resolve]);
11499
11583
  nextFrame(() => {
11500
11584
  removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
11585
+ if (el._enterResolve !== resolve) {
11586
+ return;
11587
+ }
11501
11588
  addTransitionClass(el, isAppear ? appearToClass : enterToClass);
11502
11589
  if (!hasExplicitCallback(hook)) {
11503
11590
  whenTransitionEnds(el, type, enterDuration, resolve);
@@ -11520,7 +11607,12 @@ Component that was made reactive: `,
11520
11607
  onAppear: makeEnterHook(true),
11521
11608
  onLeave(el, done) {
11522
11609
  el._isLeaving = true;
11523
- const resolve = () => finishLeave(el, done);
11610
+ const resolve = () => {
11611
+ if (el._leaveResolve === resolve) {
11612
+ finishLeave(el, done);
11613
+ }
11614
+ };
11615
+ el._leaveResolve = resolve;
11524
11616
  addTransitionClass(el, leaveFromClass);
11525
11617
  if (!el._enterCancelled) {
11526
11618
  forceReflow(el);
@@ -11530,7 +11622,7 @@ Component that was made reactive: `,
11530
11622
  forceReflow(el);
11531
11623
  }
11532
11624
  nextFrame(() => {
11533
- if (!el._isLeaving) {
11625
+ if (el._leaveResolve !== resolve) {
11534
11626
  return;
11535
11627
  }
11536
11628
  removeTransitionClass(el, leaveFromClass);
@@ -11742,11 +11834,24 @@ Component that was made reactive: `,
11742
11834
  warn(`useCssVars is called without current active component instance.`);
11743
11835
  return;
11744
11836
  }
11745
- const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
11837
+ const updateTeleports = (vars = getter(instance.proxy)) => {
11746
11838
  Array.from(
11747
11839
  document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11748
11840
  ).forEach((node) => setVarsOnNode(node, vars));
11749
11841
  };
11842
+ const owner = {
11843
+ uid: String(instance.uid),
11844
+ update: updateTeleports
11845
+ };
11846
+ onScopeDispose(() => owner.update = void 0);
11847
+ instance.ut = (start, end) => {
11848
+ if (start) {
11849
+ start[TELEPORT_KEY] = [end, owner];
11850
+ observeTeleport(start);
11851
+ markTeleport(start);
11852
+ }
11853
+ updateTeleports();
11854
+ };
11750
11855
  {
11751
11856
  instance.getCssVars = () => getter(instance.proxy);
11752
11857
  }
@@ -11769,6 +11874,56 @@ Component that was made reactive: `,
11769
11874
  onUnmounted(() => ob.disconnect());
11770
11875
  });
11771
11876
  }
11877
+ const TELEPORT_KEY = /* @__PURE__ */ Symbol("TELEPORT_KEY" );
11878
+ function markTeleport(start, added) {
11879
+ const [end, owner] = start[TELEPORT_KEY];
11880
+ let update;
11881
+ if (owner.update) {
11882
+ for (let node = start; node && node !== end; node = node.nextSibling) {
11883
+ if (node.nodeType === 1 && (!added || (added === true || added.has(node)) && (node.getAttribute("data-v-owner") || owner.uid) === owner.uid)) {
11884
+ node.setAttribute("data-v-owner", owner.uid);
11885
+ update = owner.update;
11886
+ }
11887
+ }
11888
+ }
11889
+ return update;
11890
+ }
11891
+ function observeTeleport(start) {
11892
+ const container = start.parentNode;
11893
+ if (container) {
11894
+ let starts = container[TELEPORT_KEY];
11895
+ if (!starts) {
11896
+ starts = container[TELEPORT_KEY] = /* @__PURE__ */ new Set();
11897
+ new MutationObserver(onTeleportMutations).observe(container, {
11898
+ childList: true
11899
+ });
11900
+ }
11901
+ starts.add(start);
11902
+ }
11903
+ }
11904
+ function onTeleportMutations(records, ob) {
11905
+ const container = records[0].target;
11906
+ const starts = container[TELEPORT_KEY];
11907
+ const added = /* @__PURE__ */ new Set();
11908
+ for (const { addedNodes } of records) {
11909
+ addedNodes.forEach((node) => added.add(node));
11910
+ }
11911
+ const updates = /* @__PURE__ */ new Set();
11912
+ starts.forEach((start) => {
11913
+ if (start.parentNode !== container) {
11914
+ starts.delete(start);
11915
+ observeTeleport(start);
11916
+ updates.add(markTeleport(start, true));
11917
+ } else if (added.size) {
11918
+ updates.add(markTeleport(start, added));
11919
+ }
11920
+ });
11921
+ updates.forEach((update) => update && update());
11922
+ if (!starts.size) {
11923
+ ob.disconnect();
11924
+ container[TELEPORT_KEY] = void 0;
11925
+ }
11926
+ }
11772
11927
  function setVarsOnVNode(vnode, vars) {
11773
11928
  if (vnode.shapeFlag & 128) {
11774
11929
  const suspense = vnode.suspense;
@@ -13224,8 +13379,14 @@ Expected function or array of functions, received type ${typeof value}.`
13224
13379
  const withKeys = (fn, modifiers) => {
13225
13380
  const cache = fn._withKeys || (fn._withKeys = {});
13226
13381
  const cacheKey = modifiers.join(".");
13227
- return cache[cacheKey] || (cache[cacheKey] = ((event) => {
13382
+ const cached = cache[cacheKey];
13383
+ if (cached) return cached;
13384
+ const hasButtonModifier = modifiers.some((m) => m === "left" || m === "right");
13385
+ return cache[cacheKey] = ((event) => {
13228
13386
  if (!("key" in event)) {
13387
+ if (hasButtonModifier) {
13388
+ return fn(event);
13389
+ }
13229
13390
  return;
13230
13391
  }
13231
13392
  const eventKey = hyphenate(event.key);
@@ -13234,7 +13395,7 @@ Expected function or array of functions, received type ${typeof value}.`
13234
13395
  )) {
13235
13396
  return fn(event);
13236
13397
  }
13237
- }));
13398
+ });
13238
13399
  };
13239
13400
 
13240
13401
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);