@vue/compat 3.6.0-rc.11 → 3.6.0-rc.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-rc.11
2
+ * @vue/compat v3.6.0-rc.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -248,9 +248,10 @@ const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
248
248
  * - ismap -> isMap
249
249
  * - nomodule -> noModule
250
250
  * - novalidate -> noValidate
251
+ * - playsinline -> playsInline
251
252
  * - readonly -> readOnly
252
253
  */
253
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
254
+ const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
254
255
  const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
255
256
  /**
256
257
  * The full list is needed during SSR to produce the correct initial markup.
@@ -900,17 +901,33 @@ const arrayInstrumentations = {
900
901
  };
901
902
  function iterator(self, method, wrapValue) {
902
903
  const arr = shallowReadArray(self);
903
- const iter = arr[method]();
904
+ const methodFn = arr[method];
905
+ const iter = methodFn.call(arr);
904
906
  if (arr !== self && !/* @__PURE__ */ isShallow(self)) {
907
+ if (iter[Symbol.toStringTag] === "Array Iterator") {
908
+ const wrapped = Object.create(Object.getPrototypeOf(iter));
909
+ wrapped.next = () => wrapResult(iter.next(), wrapValue);
910
+ if (methodFn !== arrayProto[method]) Object.defineProperties(wrapped, {
911
+ return: { get() {
912
+ const fn = iter.return;
913
+ return typeof fn === "function" ? fn.bind(iter) : fn;
914
+ } },
915
+ throw: { get() {
916
+ const fn = iter.throw;
917
+ return typeof fn === "function" ? fn.bind(iter) : fn;
918
+ } }
919
+ });
920
+ return wrapped;
921
+ }
905
922
  iter._next = iter.next;
906
- iter.next = () => {
907
- const result = iter._next();
908
- if (!result.done) result.value = wrapValue(result.value);
909
- return result;
910
- };
923
+ iter.next = () => wrapResult(iter._next(), wrapValue);
911
924
  }
912
925
  return iter;
913
926
  }
927
+ function wrapResult(result, wrapValue) {
928
+ if (!result.done) result.value = wrapValue(result.value);
929
+ return result;
930
+ }
914
931
  const arrayProto = Array.prototype;
915
932
  function apply(self, method, fn, thisArg, wrappedRetFn, args) {
916
933
  const arr = shallowReadArray(self);
@@ -1220,6 +1237,7 @@ function createInstrumentationGetter(isReadonly, shallow) {
1220
1237
  return (target, key, receiver) => {
1221
1238
  if (key === "__v_isReactive") return !isReadonly;
1222
1239
  else if (key === "__v_isReadonly") return isReadonly;
1240
+ else if (key === "__v_isShallow") return shallow;
1223
1241
  else if (key === "__v_raw") return target;
1224
1242
  return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
1225
1243
  };
@@ -2089,8 +2107,9 @@ function getCurrentWatcher() {
2089
2107
  function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
2090
2108
  if (owner) {
2091
2109
  const { call } = owner.options;
2092
- if (call) owner.cleanups[owner.cleanupsLength++] = () => call(cleanupFn, 4);
2093
- else owner.cleanups[owner.cleanupsLength++] = cleanupFn;
2110
+ const cleanup = call ? () => call(cleanupFn, 4) : cleanupFn;
2111
+ if (owner.cb) (owner.cbCleanups || (owner.cbCleanups = [])).push(cleanup);
2112
+ else owner.cleanups[owner.cleanupsLength++] = cleanup;
2094
2113
  }
2095
2114
  }
2096
2115
  var WatcherEffect = class extends ReactiveEffect {
@@ -2147,14 +2166,29 @@ var WatcherEffect = class extends ReactiveEffect {
2147
2166
  if (once && cb) {
2148
2167
  const _cb = cb;
2149
2168
  cb = (...args) => {
2150
- const res = _cb(...args);
2151
- this.stop();
2152
- return res;
2169
+ try {
2170
+ return _cb(...args);
2171
+ } finally {
2172
+ this.stop();
2173
+ }
2153
2174
  };
2154
2175
  }
2155
2176
  this.cb = cb;
2156
2177
  this.oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2157
2178
  }
2179
+ cleanupCallback() {
2180
+ const cleanups = this.cbCleanups;
2181
+ if (cleanups) {
2182
+ this.cbCleanups = void 0;
2183
+ for (let i = 0, l = cleanups.length; i < l; i++) cleanups[i]();
2184
+ }
2185
+ }
2186
+ stop() {
2187
+ if (this.active) {
2188
+ super.stop();
2189
+ this.cleanupCallback();
2190
+ }
2191
+ }
2158
2192
  run(initialRun = false) {
2159
2193
  const oldValue = this.oldValue;
2160
2194
  const newValue = this.oldValue = super.run();
@@ -2162,10 +2196,11 @@ var WatcherEffect = class extends ReactiveEffect {
2162
2196
  const { immediate, deep, call } = this.options;
2163
2197
  if (initialRun && !immediate) return;
2164
2198
  if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2165
- cleanup(this);
2166
2199
  const currentWatcher = activeWatcher;
2167
- activeWatcher = this;
2200
+ const prevSub = setActiveSub();
2168
2201
  try {
2202
+ this.cleanupCallback();
2203
+ activeWatcher = this;
2169
2204
  const args = [
2170
2205
  newValue,
2171
2206
  oldValue === INITIAL_WATCHER_VALUE ? void 0 : this.isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
@@ -2174,6 +2209,7 @@ var WatcherEffect = class extends ReactiveEffect {
2174
2209
  call ? call(this.cb, 3, args) : this.cb(...args);
2175
2210
  } finally {
2176
2211
  activeWatcher = currentWatcher;
2212
+ setActiveSub(prevSub);
2177
2213
  }
2178
2214
  }
2179
2215
  }
@@ -2397,13 +2433,13 @@ function queuePostFlushCb(jobs, id = Infinity) {
2397
2433
  } else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2398
2434
  queueFlush();
2399
2435
  }
2400
- function flushPreFlushCbs(instance, seen) {
2436
+ function flushPreFlushCbs(instance, minUid, seen) {
2401
2437
  for (let i = flushIndex; i < jobsLength; i++) {
2402
2438
  const cb = jobs[i];
2403
2439
  if (cb.order & 1 || cb.order === Infinity) continue;
2404
- if (instance && cb.order !== instance.uid * 2) continue;
2440
+ if (instance && cb.order !== instance.uid * 2 || minUid !== void 0 && !(cb.order >= minUid * 2)) continue;
2405
2441
  jobs.splice(i, 1);
2406
- i--;
2442
+ i = instance ? i - 1 : flushIndex - 1;
2407
2443
  jobsLength--;
2408
2444
  if (cb.flags & 2) cb.flags &= -2;
2409
2445
  try {
@@ -2413,15 +2449,24 @@ function flushPreFlushCbs(instance, seen) {
2413
2449
  }
2414
2450
  }
2415
2451
  }
2416
- function flushPostFlushCbs(seen) {
2452
+ function flushPostFlushCbs(seen, skip, minUid = 0) {
2417
2453
  if (postJobs.length) {
2454
+ let cbs = postJobs;
2455
+ if (skip) {
2456
+ cbs = [];
2457
+ let kept = 0;
2458
+ for (let i = 0; i < postJobs.length; i++) {
2459
+ const cb = postJobs[i];
2460
+ if (cb.i !== void 0 ? !cb.i || cb.i.uid < minUid : skip.has(cb)) postJobs[kept++] = cb;
2461
+ else cbs.push(cb);
2462
+ }
2463
+ postJobs.length = kept;
2464
+ } else postJobs = [];
2418
2465
  if (activePostJobs) {
2419
- for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
2420
- postJobs.length = 0;
2466
+ for (let i = 0; i < cbs.length; i++) activePostJobs.push(cbs[i]);
2421
2467
  return;
2422
2468
  }
2423
- activePostJobs = postJobs;
2424
- postJobs = [];
2469
+ activePostJobs = cbs;
2425
2470
  try {
2426
2471
  while (postFlushIndex < activePostJobs.length) {
2427
2472
  const cb = activePostJobs[postFlushIndex++];
@@ -2441,17 +2486,28 @@ function flushPostFlushCbs(seen) {
2441
2486
  }
2442
2487
  let isFlushing = false;
2443
2488
  /**
2489
+ * Run a root render, then flush the jobs it is responsible for. A mount or
2490
+ * unmount (`minUid` given) only flushes the jobs of the components it created
2491
+ * and the post cbs it queued, so pre watchers triggered in setup run before
2492
+ * mounted (#5721) while the jobs of other components stay in the queue and
2493
+ * keep their order (#6728). A root update keeps flushing all pending pre jobs
2494
+ * and post cbs, as the jobs of the components it re-renders may predate it.
2495
+ *
2444
2496
  * @internal
2445
2497
  */
2446
- function flushOnAppMount(instance) {
2447
- if (!isFlushing) {
2448
- isFlushing = true;
2449
- try {
2450
- flushPreFlushCbs(instance);
2451
- flushPostFlushCbs();
2452
- } finally {
2453
- isFlushing = false;
2454
- }
2498
+ function flushOnAppMount(fn, minUid) {
2499
+ if (isFlushing) {
2500
+ fn();
2501
+ return;
2502
+ }
2503
+ const queued = minUid === void 0 ? void 0 : new Set(postJobs);
2504
+ fn();
2505
+ isFlushing = true;
2506
+ try {
2507
+ flushPreFlushCbs(void 0, minUid);
2508
+ flushPostFlushCbs(void 0, queued, minUid);
2509
+ } finally {
2510
+ isFlushing = false;
2455
2511
  }
2456
2512
  }
2457
2513
  function flushJobs(seen) {
@@ -2829,7 +2885,7 @@ var RenderWatcherEffect = class extends WatcherEffect {
2829
2885
  this.flags |= 128;
2830
2886
  job.flags |= 2;
2831
2887
  }
2832
- if (instance) job.i = instance;
2888
+ job.i = instance;
2833
2889
  this.job = job;
2834
2890
  }
2835
2891
  notify() {
@@ -2898,6 +2954,16 @@ function createPathGetter(ctx, path) {
2898
2954
  };
2899
2955
  }
2900
2956
  //#endregion
2957
+ //#region packages/runtime-core/src/vaporInteropState.ts
2958
+ /**
2959
+ * Set by `vaporInteropPlugin`. Stays false in apps that never import the
2960
+ * plugin, so bundlers drop the vapor-in-vdom branches of the renderer.
2961
+ */
2962
+ let isVaporInteropEnabled = false;
2963
+ function setVaporInteropEnabled() {
2964
+ isVaporInteropEnabled = true;
2965
+ }
2966
+ //#endregion
2901
2967
  //#region packages/runtime-core/src/components/Teleport.ts
2902
2968
  const pendingMounts = /* @__PURE__ */ new WeakMap();
2903
2969
  const TeleportEndKey = Symbol("_vte");
@@ -3021,7 +3087,11 @@ const TeleportImpl = {
3021
3087
  hydrate: hydrateTeleport
3022
3088
  };
3023
3089
  function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
3024
- if (moveType === 0) insert(vnode.targetAnchor, container, parentAnchor);
3090
+ if (moveType === 0) {
3091
+ if (vnode.targetStart) insert(vnode.targetStart, container, parentAnchor);
3092
+ insert(vnode.targetAnchor, container, parentAnchor);
3093
+ parentAnchor = vnode.targetAnchor;
3094
+ }
3025
3095
  const { el, anchor, shapeFlag, children, props } = vnode;
3026
3096
  const isReorder = moveType === 2;
3027
3097
  if (isReorder) insert(el, container, parentAnchor);
@@ -3140,9 +3210,18 @@ const BaseTransitionPropsValidators = {
3140
3210
  onAfterAppear: TransitionHookValidator,
3141
3211
  onAppearCancelled: TransitionHookValidator
3142
3212
  };
3213
+ let isTransitionEnabled = false;
3214
+ function withTransitionEnabled(value) {
3215
+ isTransitionEnabled = true;
3216
+ return value;
3217
+ }
3143
3218
  function isEmptyTransitionChild(vnode, instance) {
3144
3219
  if (vnode.type === Comment) return true;
3145
- if (vnode.type === VaporSlot || isVaporComponent(vnode.type)) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
3220
+ if (vnode.type === Fragment) {
3221
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
3222
+ return !child || isEmptyTransitionChild(child, instance);
3223
+ }
3224
+ if (isVaporInteropEnabled && (vnode.type === VaporSlot || isVaporComponent(vnode.type))) return !getVaporInterface(instance, vnode).hasTransitionChild(vnode);
3146
3225
  return !!vnode.component && isEmptyTransitionChild(vnode.component.subTree, instance);
3147
3226
  }
3148
3227
  const BaseTransitionImpl = {
@@ -3158,7 +3237,7 @@ const BaseTransitionImpl = {
3158
3237
  const rawProps = /* @__PURE__ */ toRaw(props);
3159
3238
  const { mode } = rawProps;
3160
3239
  return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
3161
- if (!(instance.job.flags & 4)) instance.update();
3240
+ if (!(instance.effect.flags & 1024)) instance.update();
3162
3241
  }) : NOOP);
3163
3242
  };
3164
3243
  }
@@ -3174,7 +3253,7 @@ function findNonCommentChild(children) {
3174
3253
  }
3175
3254
  return child;
3176
3255
  }
3177
- const BaseTransition = BaseTransitionImpl;
3256
+ const BaseTransition = /*@__PURE__*/ withTransitionEnabled(BaseTransitionImpl);
3178
3257
  function getLeavingNodesForType(state, vnode) {
3179
3258
  const { leavingNodes } = state;
3180
3259
  let leavingVNodesCache = leavingNodes.get(vnode.type);
@@ -3197,7 +3276,14 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3197
3276
  },
3198
3277
  earlyRemove: () => {
3199
3278
  const leavingVNode = leavingVNodesCache[key];
3200
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) leavingVNode.el[leaveCbKey]();
3279
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode)) {
3280
+ let leavingCb = leavingVNode.el[leaveCbKey];
3281
+ if (!leavingCb) {
3282
+ const leavingRoot = getTransitionRoot(leavingVNode);
3283
+ leavingCb = leavingRoot && leavingRoot.el[leaveCbKey];
3284
+ }
3285
+ if (leavingCb) leavingCb();
3286
+ }
3201
3287
  },
3202
3288
  cloneHooks: (vnode) => {
3203
3289
  const hooks = resolveTransitionHooks(vnode, props, state, instance, postClone);
@@ -3205,7 +3291,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
3205
3291
  return hooks;
3206
3292
  }
3207
3293
  }, props, state, instance);
3208
- if (vnode.type === VaporSlot) extend(hooks, {
3294
+ if (isVaporInteropEnabled && vnode.type === VaporSlot) extend(hooks, {
3209
3295
  __vapor: true,
3210
3296
  props,
3211
3297
  state,
@@ -3382,7 +3468,7 @@ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, pr
3382
3468
  function setTransitionHooks(vnode, hooks) {
3383
3469
  if (vnode.shapeFlag & 6 && vnode.component) {
3384
3470
  vnode.transition = hooks;
3385
- if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
3471
+ if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
3386
3472
  else {
3387
3473
  const subTree = vnode.component.subTree;
3388
3474
  return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
@@ -3391,7 +3477,13 @@ function setTransitionHooks(vnode, hooks) {
3391
3477
  const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3392
3478
  const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3393
3479
  return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
3394
- } else vnode.transition = hooks;
3480
+ } else {
3481
+ vnode.transition = hooks;
3482
+ if (vnode.type === Fragment && isArray(vnode.children)) {
3483
+ const child = filterSingleRoot(vnode.children, false);
3484
+ if (child) setTransitionHooks(child, hooks);
3485
+ }
3486
+ }
3395
3487
  return hooks;
3396
3488
  }
3397
3489
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
@@ -3408,6 +3500,14 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3408
3500
  if (keyedFragmentCount > 1) for (let i = 0; i < ret.length; i++) ret[i].patchFlag = -2;
3409
3501
  return ret;
3410
3502
  }
3503
+ function getTransitionRoot(vnode) {
3504
+ if (vnode.component && (!isVaporInteropEnabled || !isVaporComponent(vnode.type))) return getTransitionRoot(vnode.component.subTree);
3505
+ if (vnode.type === Fragment) {
3506
+ const child = isArray(vnode.children) && filterSingleRoot(vnode.children, false);
3507
+ return child ? getTransitionRoot(child) : void 0;
3508
+ }
3509
+ if (vnode.type !== Comment) return vnode;
3510
+ }
3411
3511
  //#endregion
3412
3512
  //#region packages/runtime-core/src/apiDefineComponent.ts
3413
3513
  /*@__NO_SIDE_EFFECTS__*/
@@ -3645,7 +3745,7 @@ function createHydrationFunctions(rendererInternals) {
3645
3745
  else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
3646
3746
  break;
3647
3747
  case VaporSlot:
3648
- nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
3748
+ if (isVaporInteropEnabled) nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
3649
3749
  break;
3650
3750
  default: if (shapeFlag & 1) {
3651
3751
  if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
@@ -3656,7 +3756,7 @@ function createHydrationFunctions(rendererInternals) {
3656
3756
  if (isFragmentStart) nextNode = locateClosingAnchor(node);
3657
3757
  else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
3658
3758
  else nextNode = nextSibling(node);
3659
- if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
3759
+ if ((isVaporInteropEnabled || false) && vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
3660
3760
  else {
3661
3761
  mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
3662
3762
  const component = vnode.component;
@@ -3768,7 +3868,7 @@ function createHydrationFunctions(rendererInternals) {
3768
3868
  if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
3769
3869
  const container = parentNode(node);
3770
3870
  const first = nextSibling(node);
3771
- const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
3871
+ const next = isVaporInteropEnabled && vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
3772
3872
  if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
3773
3873
  else {
3774
3874
  logMismatchError();
@@ -3896,14 +3996,20 @@ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
3896
3996
  break;
3897
3997
  }
3898
3998
  }, opts);
3899
- forEach((el) => {
3900
- if (!(el instanceof Element)) return;
3999
+ const observe = (el) => {
3901
4000
  if (elementIsVisibleInViewport(el)) {
3902
4001
  hydrate();
3903
4002
  ob.disconnect();
3904
4003
  return false;
3905
4004
  }
4005
+ if (getComputedStyle(el).display === "contents") {
4006
+ for (let i = 0; i < el.children.length; i++) if (observe(el.children[i]) === false) return false;
4007
+ }
3906
4008
  ob.observe(el);
4009
+ };
4010
+ forEach((el) => {
4011
+ if (!(el instanceof Element)) return;
4012
+ return observe(el);
3907
4013
  });
3908
4014
  return () => ob.disconnect();
3909
4015
  };
@@ -4051,7 +4157,7 @@ function createAsyncComponentContext(source) {
4051
4157
  setPendingRequest: (request) => pendingRequest = request
4052
4158
  };
4053
4159
  }
4054
- const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
4160
+ const useAsyncComponentState = (delay = 200, timeout, onError, instance = currentInstance) => {
4055
4161
  const loaded = /* @__PURE__ */ ref(false);
4056
4162
  const error = /* @__PURE__ */ ref();
4057
4163
  const delayed = /* @__PURE__ */ ref(!!delay);
@@ -4102,6 +4208,11 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
4102
4208
  //#endregion
4103
4209
  //#region packages/runtime-core/src/components/KeepAlive.ts
4104
4210
  const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
4211
+ let isKeepAliveEnabled = false;
4212
+ function withKeepAliveEnabled(value) {
4213
+ isKeepAliveEnabled = true;
4214
+ return value;
4215
+ }
4105
4216
  const KeepAliveImpl = {
4106
4217
  name: `KeepAlive`,
4107
4218
  __isKeepAlive: true,
@@ -4156,7 +4267,10 @@ const KeepAliveImpl = {
4156
4267
  function pruneCacheEntry(key) {
4157
4268
  const cached = cache.get(key);
4158
4269
  if (cached && (!current || !isSameVNodeType(cached, current))) unmount(cached);
4159
- else if (current) resetShapeFlag(current);
4270
+ else if (current) {
4271
+ resetShapeFlag(current);
4272
+ if (cached) resetShapeFlag(cached);
4273
+ }
4160
4274
  cache.delete(key);
4161
4275
  keys.delete(key);
4162
4276
  }
@@ -4245,7 +4359,7 @@ const decorate$2 = (t) => {
4245
4359
  t.__isBuiltIn = true;
4246
4360
  return t;
4247
4361
  };
4248
- const KeepAlive = /*@__PURE__*/ decorate$2(KeepAliveImpl);
4362
+ const KeepAlive = /*@__PURE__*/ withKeepAliveEnabled(/*@__PURE__*/ decorate$2(KeepAliveImpl));
4249
4363
  function matches(pattern, name) {
4250
4364
  if (isArray(pattern)) return pattern.some((p) => matches(p, name));
4251
4365
  else if (isString(pattern)) return pattern.split(",").includes(name);
@@ -4630,8 +4744,11 @@ function renderList(source, renderItem, cache, index) {
4630
4744
  ret = new Array(source.length);
4631
4745
  for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i]);
4632
4746
  } else if (typeof source === "number") {
4633
- ret = new Array(source);
4634
- for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
4747
+ if (!Number.isInteger(source) || source < 0) ret = [];
4748
+ else {
4749
+ ret = new Array(source);
4750
+ for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
4751
+ }
4635
4752
  } else if (isObject(source)) {
4636
4753
  if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
4637
4754
  else {
@@ -4697,16 +4814,22 @@ function invokeSlotFallback(fallback, owner) {
4697
4814
  function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
4698
4815
  if (props == null) props = {};
4699
4816
  let slot = slots[name];
4700
- const vaporSlot = slot && slot[rawVaporSlotKey];
4817
+ const vaporSlot = isVaporInteropEnabled && slot && slot[rawVaporSlotKey];
4701
4818
  if (vaporSlot) {
4702
4819
  const ret = (openBlock(), createBlock(VaporSlot, props));
4703
4820
  ret.vs = {
4704
4821
  slot: vaporSlot,
4822
+ name,
4705
4823
  outlets: fallback ? [{
4706
4824
  fallback,
4707
4825
  owner: currentRenderingInstance
4708
4826
  }] : void 0
4709
4827
  };
4828
+ if (branchKey != null && props.key == null) {
4829
+ ret.vs.props = ret.props;
4830
+ ret.props = extend({}, ret.props, { key: branchKey });
4831
+ ret.key = branchKey;
4832
+ }
4710
4833
  if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
4711
4834
  return ret;
4712
4835
  }
@@ -4723,7 +4846,7 @@ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
4723
4846
  try {
4724
4847
  const validSlotContent = slot && ensureValidVNode(slot(props));
4725
4848
  let attached = false;
4726
- if (fallback && validSlotContent && currentRenderingInstance) {
4849
+ if (isVaporInteropEnabled && fallback && validSlotContent && currentRenderingInstance) {
4727
4850
  const interop = currentRenderingInstance.appContext.vapor;
4728
4851
  if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
4729
4852
  }
@@ -4900,6 +5023,7 @@ function installCompatInstanceProperties(map) {
4900
5023
  const privateAPIs = {
4901
5024
  $vnode: (i) => i.vnode,
4902
5025
  _self: (i) => i.proxy,
5026
+ _setupProxy: (i) => i.setupState,
4903
5027
  _uid: (i) => i.uid,
4904
5028
  _data: (i) => i.data,
4905
5029
  _isMounted: (i) => i.isMounted,
@@ -5495,7 +5619,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5495
5619
  if (options.el) return vm.$mount(options.el);
5496
5620
  else return vm;
5497
5621
  }
5498
- Vue.version = `2.6.14-compat:3.6.0-rc.11`;
5622
+ Vue.version = `2.6.14-compat:3.6.0-rc.13`;
5499
5623
  Vue.config = singletonApp.config;
5500
5624
  Vue.use = (plugin, ...options) => {
5501
5625
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -6152,7 +6276,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
6152
6276
  if (nextKeys.length !== Object.keys(prevProps).length) return true;
6153
6277
  for (let i = 0; i < nextKeys.length; i++) {
6154
6278
  const key = nextKeys[i];
6155
- if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
6279
+ if (!hasOwn(prevProps, key) || hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
6156
6280
  }
6157
6281
  return false;
6158
6282
  }
@@ -6531,7 +6655,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6531
6655
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6532
6656
  break;
6533
6657
  case VaporSlot:
6534
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
6658
+ if (isVaporInteropEnabled) getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
6535
6659
  break;
6536
6660
  default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
6537
6661
  else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
@@ -6641,7 +6765,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6641
6765
  let vnodeHook;
6642
6766
  parentComponent && toggleRecurse(parentComponent, false);
6643
6767
  if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
6644
- if (n2.ibu) n2.ibu();
6768
+ if (isVaporInteropEnabled && n2.ibu) n2.ibu();
6645
6769
  if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
6646
6770
  parentComponent && toggleRecurse(parentComponent, true);
6647
6771
  if (dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
@@ -6673,9 +6797,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6673
6797
  if (n1.children !== n2.children) hostSetElementText(el, n2.children);
6674
6798
  }
6675
6799
  } else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
6676
- if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
6800
+ if ((vnodeHook = newProps.onVnodeUpdated) || dirs || isVaporInteropEnabled && n2.iu) queuePostRenderEffect(() => {
6677
6801
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
6678
- n2.iu && n2.iu();
6802
+ isVaporInteropEnabled && n2.iu && n2.iu();
6679
6803
  dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
6680
6804
  }, void 0, parentSuspense);
6681
6805
  };
@@ -6683,7 +6807,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6683
6807
  for (let i = 0; i < newChildren.length; i++) {
6684
6808
  const oldVNode = oldChildren[i];
6685
6809
  const newVNode = newChildren[i];
6686
- const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
6810
+ const oldEl = oldVNode.el || resolveAsyncComponentPlaceholder(oldVNode);
6811
+ const container = oldEl && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldEl) : fallbackContainer;
6687
6812
  patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
6688
6813
  }
6689
6814
  };
@@ -6717,7 +6842,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6717
6842
  };
6718
6843
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6719
6844
  n2.slotScopeIds = slotScopeIds;
6720
- if (n2.type.__vapor) {
6845
+ if ((isVaporInteropEnabled || false) && n2.type.__vapor) {
6721
6846
  if (n1 == null) {
6722
6847
  if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
6723
6848
  else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
@@ -6760,6 +6885,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6760
6885
  if (shouldUpdateComponent(n1, n2, optimized)) {
6761
6886
  if (instance.asyncDep && !instance.asyncResolved) {
6762
6887
  n2.el = n1.el;
6888
+ n2.placeholder = n1.placeholder;
6763
6889
  updateComponentPreRender(instance, n2, optimized);
6764
6890
  return;
6765
6891
  } else {
@@ -6768,6 +6894,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6768
6894
  }
6769
6895
  } else {
6770
6896
  n2.el = n1.el;
6897
+ n2.placeholder = n1.placeholder;
6771
6898
  instance.vnode = n2;
6772
6899
  }
6773
6900
  };
@@ -6857,7 +6984,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6857
6984
  } else next = vnode;
6858
6985
  if (bu) invokeArrayFns(bu);
6859
6986
  if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
6860
- if (next.ibu) next.ibu();
6987
+ if (isVaporInteropEnabled && next.ibu) next.ibu();
6861
6988
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) instance.emit("hook:beforeUpdate");
6862
6989
  toggleRecurse(instance, true);
6863
6990
  const nextTree = renderComponentRoot(instance);
@@ -6867,9 +6994,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6867
6994
  next.el = nextTree.el;
6868
6995
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
6869
6996
  if (u) queuePostRenderEffect(u, void 0, parentSuspense);
6870
- if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
6997
+ if ((vnodeHook = next.props && next.props.onVnodeUpdated) || isVaporInteropEnabled && next.iu) queuePostRenderEffect(() => {
6871
6998
  vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
6872
- next.iu && next.iu();
6999
+ isVaporInteropEnabled && next.iu && next.iu();
6873
7000
  }, void 0, parentSuspense);
6874
7001
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:updated"), void 0, parentSuspense);
6875
7002
  }
@@ -7017,7 +7144,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7017
7144
  };
7018
7145
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
7019
7146
  const { el, type, transition, children, shapeFlag } = vnode;
7020
- if (isVaporComponent(type) || type === VaporSlot) {
7147
+ if (isVaporInteropEnabled && (isVaporComponent(type) || type === VaporSlot)) {
7021
7148
  getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
7022
7149
  return;
7023
7150
  }
@@ -7061,11 +7188,11 @@ function baseCreateRenderer(options, createHydrationFns) {
7061
7188
  }
7062
7189
  if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
7063
7190
  if (shapeFlag & 256) {
7064
- if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
7191
+ if (isVaporInteropEnabled && isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
7065
7192
  else parentComponent.ctx.deactivate(vnode);
7066
7193
  return;
7067
7194
  }
7068
- if (shapeFlag & 6 && isVaporComponent(type)) {
7195
+ if (isVaporInteropEnabled && shapeFlag & 6 && isVaporComponent(type)) {
7069
7196
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
7070
7197
  return;
7071
7198
  }
@@ -7083,7 +7210,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7083
7210
  if (shapeFlag & 64) vnode.type.remove(vnode, parentComponent, parentSuspense, internals, doRemove);
7084
7211
  else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
7085
7212
  else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
7086
- if (type === VaporSlot) {
7213
+ if (isVaporInteropEnabled && type === VaporSlot) {
7087
7214
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
7088
7215
  return;
7089
7216
  }
@@ -7098,7 +7225,8 @@ function baseCreateRenderer(options, createHydrationFns) {
7098
7225
  };
7099
7226
  const remove = (vnode) => {
7100
7227
  const { type, el, anchor, transition } = vnode;
7101
- if (type === Fragment) {
7228
+ const isFragment = type === Fragment;
7229
+ if (isFragment && !transition) {
7102
7230
  removeFragment(el, anchor);
7103
7231
  return;
7104
7232
  }
@@ -7107,8 +7235,21 @@ function baseCreateRenderer(options, createHydrationFns) {
7107
7235
  if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
7108
7236
  return;
7109
7237
  }
7110
- if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
7111
- else hostRemove(el);
7238
+ const leavingNode = isFragment ? getTransitionRoot(vnode) : vnode;
7239
+ const performRemove = () => {
7240
+ if (isFragment) {
7241
+ if (hostParentNode(el)) removeFragment(el, anchor);
7242
+ } else hostRemove(el);
7243
+ };
7244
+ if (transition) {
7245
+ let leavingEl = leavingNode && leavingNode.el;
7246
+ let isElement = !!(leavingNode && leavingNode.shapeFlag & 1);
7247
+ if (isVaporInteropEnabled && isFragment && leavingNode && isVaporComponent(leavingNode.type)) {
7248
+ leavingEl = getVaporInterface(leavingNode.component, leavingNode).getTransitionElement(leavingNode);
7249
+ isElement = !!leavingEl;
7250
+ }
7251
+ performTransitionLeave(leavingEl || el, transition, performRemove, isElement);
7252
+ } else performRemove();
7112
7253
  };
7113
7254
  const removeFragment = (cur, end) => {
7114
7255
  let next;
@@ -7142,7 +7283,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7142
7283
  };
7143
7284
  const getNextHostNode = (vnode) => {
7144
7285
  if (vnode.shapeFlag & 6) {
7145
- if (isVaporComponent(vnode.type)) return hostNextSibling(vnode.anchor);
7286
+ if (isVaporInteropEnabled && isVaporComponent(vnode.type)) return hostNextSibling(vnode.anchor);
7146
7287
  return getNextHostNode(vnode.component.subTree);
7147
7288
  }
7148
7289
  if (vnode.shapeFlag & 128) return vnode.suspense.next();
@@ -7151,15 +7292,12 @@ function baseCreateRenderer(options, createHydrationFns) {
7151
7292
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
7152
7293
  };
7153
7294
  const render = (vnode, container, namespace) => {
7154
- let instance;
7155
- if (vnode == null) {
7156
- if (container._vnode) {
7157
- unmount(container._vnode, null, null, true);
7158
- instance = container._vnode.component;
7159
- }
7160
- } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
7161
- container._vnode = vnode;
7162
- flushOnAppMount(instance);
7295
+ flushOnAppMount(() => {
7296
+ if (vnode == null) {
7297
+ if (container._vnode) unmount(container._vnode, null, null, true);
7298
+ } else patch(container._vnode || null, vnode, container, null, null, null, namespace);
7299
+ container._vnode = vnode;
7300
+ }, vnode && container._vnode ? void 0 : vnode && vnode.component ? vnode.component.uid : getNextUid());
7163
7301
  };
7164
7302
  const internals = {
7165
7303
  p: patch,
@@ -7201,7 +7339,7 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
7201
7339
  return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
7202
7340
  }
7203
7341
  function toggleRecurse({ effect, job, vapor }, allowed) {
7204
- if (!vapor) {
7342
+ if (!isVaporInteropEnabled || !vapor) {
7205
7343
  if (allowed) {
7206
7344
  effect.flags |= 128;
7207
7345
  job.flags |= 2;
@@ -7308,7 +7446,7 @@ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true
7308
7446
  currentParent = currentParent.parent;
7309
7447
  } else break;
7310
7448
  }
7311
- const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
7449
+ const vaporScopeIds = isVaporInteropEnabled && includeVaporRootIds && currentVNode.vaporScopeIds;
7312
7450
  if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
7313
7451
  return inheritedScopeIds;
7314
7452
  }
@@ -7321,8 +7459,13 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
7321
7459
  //#endregion
7322
7460
  //#region packages/runtime-core/src/components/Suspense.ts
7323
7461
  const isSuspense = (type) => type.__isSuspense;
7462
+ let isSuspenseEnabled = false;
7463
+ function withSuspenseEnabled(value) {
7464
+ isSuspenseEnabled = true;
7465
+ return value;
7466
+ }
7324
7467
  let suspenseId = 0;
7325
- const Suspense = {
7468
+ const Suspense = /*@__PURE__*/ withSuspenseEnabled({
7326
7469
  name: "Suspense",
7327
7470
  __isSuspense: true,
7328
7471
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
@@ -7339,7 +7482,7 @@ const Suspense = {
7339
7482
  },
7340
7483
  hydrate: hydrateSuspense,
7341
7484
  normalize: normalizeSuspenseChildren
7342
- };
7485
+ });
7343
7486
  function triggerEvent(vnode, name) {
7344
7487
  const eventListener = vnode.props && vnode.props[name];
7345
7488
  if (isFunction(eventListener)) eventListener();
@@ -7533,13 +7676,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7533
7676
  registerDep(instance, onResolve) {
7534
7677
  const isInPendingSuspense = !!suspense.pendingBranch;
7535
7678
  if (isInPendingSuspense) suspense.deps++;
7536
- const hydratedEl = instance.vnode && instance.vnode.el;
7537
7679
  instance.asyncDep.catch((err) => {
7538
7680
  handleError(err, instance, 0);
7539
7681
  }).then((asyncSetupResult) => {
7540
7682
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
7541
7683
  setCurrentInstance(null, void 0);
7542
- if (hydratedEl && !instance.scope.active) {
7684
+ if (!instance.scope.active) {
7543
7685
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
7544
7686
  return;
7545
7687
  }
@@ -7854,7 +7996,7 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
7854
7996
  ctx: vnode.ctx,
7855
7997
  ce: vnode.ce,
7856
7998
  vi: vnode.vi,
7857
- vs: cloneVaporSlotMeta(vnode),
7999
+ vs: cloneVaporSlotMeta(vnode, extraProps),
7858
8000
  vb: vnode.vb,
7859
8001
  ibu: vnode.ibu,
7860
8002
  iu: vnode.iu,
@@ -7864,13 +8006,29 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
7864
8006
  defineLegacyVNodeProperties(cloned);
7865
8007
  return cloned;
7866
8008
  }
7867
- function cloneVaporSlotMeta(vnode) {
8009
+ function cloneVaporSlotMeta(vnode, extraProps) {
7868
8010
  const vaporSlot = vnode.vs;
7869
8011
  if (!vaporSlot) return vaporSlot;
7870
8012
  const cloned = {
7871
8013
  slot: vaporSlot.slot,
7872
- outlets: vaporSlot.outlets
8014
+ name: vaporSlot.name,
8015
+ outlets: vaporSlot.outlets,
8016
+ props: vaporSlot.props,
8017
+ attrs: vaporSlot.attrs && vaporSlot.attrs === EMPTY_OBJ ? {} : vaporSlot.attrs,
8018
+ group: vaporSlot.group
7873
8019
  };
8020
+ const attrs = cloned.attrs;
8021
+ if (extraProps && vaporSlot.props) {
8022
+ let extraSlotProps;
8023
+ for (const key in extraProps) if (attrs ? !isReservedProp(key) : key !== "key") {
8024
+ if (!extraSlotProps) extraSlotProps = {};
8025
+ extraSlotProps[key] = extraProps[key];
8026
+ }
8027
+ if (extraSlotProps) {
8028
+ if (attrs) cloned.attrs = mergeProps(attrs, extraSlotProps);
8029
+ else cloned.props = mergeProps(vaporSlot.props, extraSlotProps);
8030
+ }
8031
+ }
7874
8032
  if (vnode.el) {
7875
8033
  cloned.state = vaporSlot.state;
7876
8034
  cloned.ref = vaporSlot.ref;
@@ -8047,6 +8205,9 @@ const useInstanceOption = (key, silent = false) => {
8047
8205
  //#region packages/runtime-core/src/component.ts
8048
8206
  const emptyAppContext = /*@__PURE__*/ createAppContext();
8049
8207
  let uid = 0;
8208
+ function getNextUid() {
8209
+ return uid;
8210
+ }
8050
8211
  function createComponentInstance(vnode, parent, suspense) {
8051
8212
  const type = vnode.type;
8052
8213
  const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
@@ -8127,7 +8288,7 @@ function setupComponent(instance, isSSR = false, optimized = false) {
8127
8288
  isSSR && setInSSRSetupState(isSSR);
8128
8289
  const { props, children, vi } = instance.vnode;
8129
8290
  const isStateful = isStatefulComponent(instance);
8130
- if (vi) vi(instance);
8291
+ if (isVaporInteropEnabled && vi) vi(instance);
8131
8292
  else {
8132
8293
  initProps(instance, props, isStateful, isSSR);
8133
8294
  initSlots(instance, children, optimized || isSSR);
@@ -8307,7 +8468,7 @@ function isMemoSame(cached, memo) {
8307
8468
  }
8308
8469
  //#endregion
8309
8470
  //#region packages/runtime-core/src/index.ts
8310
- const version = "3.6.0-rc.11";
8471
+ const version = "3.6.0-rc.13";
8311
8472
  const warn = NOOP;
8312
8473
  /**
8313
8474
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8754,7 +8915,7 @@ function patchStyle(el, prev, next) {
8754
8915
  else el.removeAttribute("style");
8755
8916
  }
8756
8917
  if (vShowOriginalDisplay in el) {
8757
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
8918
+ if (!isCssString || prev !== next) el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
8758
8919
  if (el[vShowHidden]) style.display = "none";
8759
8920
  }
8760
8921
  }
@@ -9073,7 +9234,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
9073
9234
  this._numberProps = numberProps;
9074
9235
  this._resolveProps(def);
9075
9236
  if (this.shadowRoot) this._applyStyles(styles);
9076
- this._mountComponent(def);
9237
+ if (this._connected) this._mountComponent(def);
9077
9238
  };
9078
9239
  const asyncDef = this._def.__asyncLoader;
9079
9240
  if (asyncDef) {
@@ -9346,6 +9507,7 @@ const positionMap = /* @__PURE__ */ new WeakMap();
9346
9507
  const newPositionMap = /* @__PURE__ */ new WeakMap();
9347
9508
  const moveCbKey = Symbol("_moveCb");
9348
9509
  const enterCbKey = Symbol("_enterCb");
9510
+ const pendingGroups = /* @__PURE__ */ new WeakMap();
9349
9511
  /**
9350
9512
  * Wrap logic that modifies TransitionGroup properties in a function
9351
9513
  * so that it can be annotated as pure
@@ -9355,7 +9517,7 @@ const decorate = (t) => {
9355
9517
  t.__isBuiltIn = true;
9356
9518
  return t;
9357
9519
  };
9358
- const TransitionGroup = /* @__PURE__ */ decorate({
9520
+ const TransitionGroup = /*@__PURE__*/ withTransitionEnabled(/* @__PURE__ */ decorate({
9359
9521
  name: "TransitionGroup",
9360
9522
  props: /*@__PURE__*/ extend({}, TransitionPropsValidators, {
9361
9523
  tag: String,
@@ -9364,17 +9526,31 @@ const TransitionGroup = /* @__PURE__ */ decorate({
9364
9526
  setup(props, { slots }) {
9365
9527
  const instance = getCurrentInstance();
9366
9528
  const state = useTransitionState();
9529
+ const group = {
9530
+ props: {},
9531
+ state,
9532
+ instance
9533
+ };
9367
9534
  let prevChildren;
9368
9535
  let children;
9536
+ let origins;
9537
+ let moves;
9538
+ const willMove = () => {
9539
+ if (moves === void 0) moves = prevChildren.length > 0 && hasCSSTransform(prevChildren[0].el, instance.vnode.el, resolveMoveClass(props));
9540
+ return moves;
9541
+ };
9369
9542
  onUpdated(() => {
9370
- if (!prevChildren.length) return;
9371
- const moveClass = props.moveClass || `${props.name || "v"}-move`;
9372
- if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {
9543
+ pendingGroups.delete(instance);
9544
+ if (!willMove()) {
9373
9545
  prevChildren = [];
9546
+ origins = void 0;
9374
9547
  return;
9375
9548
  }
9549
+ const moveClass = resolveMoveClass(props);
9376
9550
  prevChildren.forEach((vnode) => callPendingCbs(vnode.el));
9377
- prevChildren.forEach(recordPosition);
9551
+ const shift = origins && getOriginShift(origins, instance.vnode.el);
9552
+ origins = void 0;
9553
+ prevChildren.forEach((c) => recordPosition(c, shift));
9378
9554
  const movedChildren = prevChildren.filter(applyTranslation);
9379
9555
  forceReflow(instance.vnode.el);
9380
9556
  movedChildren.forEach((c) => {
@@ -9385,33 +9561,50 @@ const TransitionGroup = /* @__PURE__ */ decorate({
9385
9561
  });
9386
9562
  return () => {
9387
9563
  const rawProps = /* @__PURE__ */ toRaw(props);
9388
- const cssTransitionProps = resolveTransitionProps(rawProps);
9564
+ const cssTransitionProps = group.props = resolveTransitionProps(rawProps);
9389
9565
  let tag = rawProps.tag || Fragment;
9390
9566
  if (!rawProps.tag && compatUtils.checkCompatEnabled("TRANSITION_GROUP_ROOT", instance.parent)) tag = "span";
9391
9567
  prevChildren = [];
9568
+ moves = void 0;
9392
9569
  if (children) for (let i = 0; i < children.length; i++) {
9393
9570
  const child = children[i];
9394
9571
  if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
9395
9572
  prevChildren.push(child);
9396
9573
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
9397
9574
  positionMap.set(child, getPosition(child.el));
9398
- }
9575
+ } else if (isVaporInteropEnabled && child.vs && child.vb) instance.appContext.vapor.forEachGroupChild(child, (el) => {
9576
+ const row = { el };
9577
+ prevChildren.push(row);
9578
+ positionMap.set(row, getPosition(el));
9579
+ });
9399
9580
  }
9400
9581
  children = slots.default ? getTransitionRawChildren(slots.default()) : [];
9401
9582
  for (let i = 0; i < children.length; i++) {
9402
9583
  const child = children[i];
9403
- if (child.key != null) setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
9584
+ if (isVaporInteropEnabled && child.vs) child.vs.group = group;
9585
+ else if (child.key != null) setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
9586
+ }
9587
+ if (prevChildren.length) {
9588
+ const root = instance.vnode.el;
9589
+ origins = getOrigins(instance, root);
9590
+ pendingGroups.set(instance, {
9591
+ root,
9592
+ willMove
9593
+ });
9404
9594
  }
9405
9595
  return createVNode(tag, null, children);
9406
9596
  };
9407
9597
  }
9408
- });
9598
+ }));
9409
9599
  function callPendingCbs(el) {
9410
9600
  if (el[moveCbKey]) el[moveCbKey]();
9411
9601
  if (el[enterCbKey]) el[enterCbKey]();
9412
9602
  }
9413
- function recordPosition(c) {
9414
- newPositionMap.set(c, getPosition(c.el));
9603
+ function resolveMoveClass(props) {
9604
+ return props.moveClass || `${props.name || "v"}-move`;
9605
+ }
9606
+ function recordPosition(c, shift) {
9607
+ newPositionMap.set(c, getPosition(c.el, shift));
9415
9608
  }
9416
9609
  function applyTranslation(c) {
9417
9610
  if (baseApplyTranslation(positionMap.get(c), newPositionMap.get(c), c.el)) return c;
@@ -9436,13 +9629,36 @@ function baseApplyTranslation(oldPos, newPos, el) {
9436
9629
  }
9437
9630
  return false;
9438
9631
  }
9439
- function getPosition(el) {
9632
+ function getPosition(el, shift) {
9440
9633
  const rect = el.getBoundingClientRect();
9441
9634
  return {
9442
- left: rect.left,
9443
- top: rect.top
9635
+ left: rect.left - (shift ? shift.left : 0),
9636
+ top: rect.top - (shift ? shift.top : 0)
9444
9637
  };
9445
9638
  }
9639
+ function getOrigins(instance, root) {
9640
+ let origins;
9641
+ for (let group = instance.parent; group; group = group.parent) {
9642
+ const pending = pendingGroups.get(group);
9643
+ if (pending) {
9644
+ const item = findItem(pending.root, root);
9645
+ if (item) (origins || (origins = [])).push(extend(getPosition(item), {
9646
+ item,
9647
+ willMove: pending.willMove
9648
+ }));
9649
+ }
9650
+ }
9651
+ return origins;
9652
+ }
9653
+ function findItem(root, node) {
9654
+ const container = root.nodeType === 1 ? root : root.parentNode;
9655
+ while (node && node.parentNode !== container) node = node.parentNode;
9656
+ if (node && node.nodeType === 1) return node;
9657
+ }
9658
+ function getOriginShift(origins, root) {
9659
+ const origin = origins.find((o) => o.willMove() && o.item.contains(root));
9660
+ return origin && getPosition(origin.item, origin);
9661
+ }
9446
9662
  function hasCSSTransform(el, root, moveClass) {
9447
9663
  const clone = el.cloneNode();
9448
9664
  const _vtc = el[vtcKey];
@@ -9523,7 +9739,7 @@ const vModelTextInit = (el, trim, number, lazy, set) => {
9523
9739
  if (e.target.composing) return;
9524
9740
  (set || el[assignKey])(castValue(el.value, trim, number || el.type === "number"));
9525
9741
  });
9526
- if (trim || number) addEventListener(el, "change", () => {
9742
+ if (trim || number || el.type === "number") addEventListener(el, "change", () => {
9527
9743
  el.value = castValue(el.value, trim, number || el.type === "number");
9528
9744
  });
9529
9745
  if (!lazy) {
@@ -9899,6 +10115,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
9899
10115
  initCustomFormatter: () => initCustomFormatter,
9900
10116
  initDirectivesForSSR: () => initDirectivesForSSR,
9901
10117
  inject: () => inject,
10118
+ isKeepAliveEnabled: () => isKeepAliveEnabled,
9902
10119
  isMemoSame: () => isMemoSame,
9903
10120
  isProxy: () => isProxy,
9904
10121
  isReactive: () => isReactive,
@@ -9906,7 +10123,10 @@ var src_exports = /* @__PURE__ */ __exportAll({
9906
10123
  isRef: () => isRef,
9907
10124
  isRuntimeOnly: () => isRuntimeOnly,
9908
10125
  isShallow: () => isShallow,
10126
+ isSuspenseEnabled: () => isSuspenseEnabled,
10127
+ isTransitionEnabled: () => isTransitionEnabled,
9909
10128
  isVNode: () => isVNode,
10129
+ isVaporInteropEnabled: () => isVaporInteropEnabled,
9910
10130
  markRaw: () => markRaw,
9911
10131
  mergeDefaults: () => mergeDefaults,
9912
10132
  mergeModels: () => mergeModels,
@@ -9953,6 +10173,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
9953
10173
  setDevtoolsHook: () => setDevtoolsHook,
9954
10174
  setIsHydratingEnabled: () => setIsHydratingEnabled,
9955
10175
  setTransitionHooks: () => setTransitionHooks,
10176
+ setVaporInteropEnabled: () => setVaporInteropEnabled,
9956
10177
  shallowReactive: () => shallowReactive,
9957
10178
  shallowReadonly: () => shallowReadonly,
9958
10179
  shallowRef: () => shallowRef,
@@ -9997,10 +10218,13 @@ var src_exports = /* @__PURE__ */ __exportAll({
9997
10218
  withCtx: () => withCtx,
9998
10219
  withDefaults: () => withDefaults,
9999
10220
  withDirectives: () => withDirectives,
10221
+ withKeepAliveEnabled: () => withKeepAliveEnabled,
10000
10222
  withKeys: () => withKeys,
10001
10223
  withMemo: () => withMemo,
10002
10224
  withModifiers: () => withModifiers,
10003
- withScopeId: () => withScopeId
10225
+ withScopeId: () => withScopeId,
10226
+ withSuspenseEnabled: () => withSuspenseEnabled,
10227
+ withTransitionEnabled: () => withTransitionEnabled
10004
10228
  });
10005
10229
  const rendererOptions = /*@__PURE__*/ extend({ patchProp }, nodeOps);
10006
10230
  let renderer;
@@ -11631,7 +11855,7 @@ const errorMessages = {
11631
11855
  [41]: `v-model is missing expression.`,
11632
11856
  [42]: `v-model value must be a valid JavaScript member expression.`,
11633
11857
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
11634
- [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.`,
11858
+ [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.\nUse a v-bind binding combined with a v-on listener that emits update:x event instead.\nFor props declared with defineModel(), assign the returned ref to a variable and use v-model on that variable.`,
11635
11859
  [45]: `v-model cannot be used on a const binding because it is not writable.`,
11636
11860
  [46]: `Error parsing JavaScript expression: `,
11637
11861
  [47]: `<KeepAlive> expects exactly one child component.`,
@@ -13909,7 +14133,11 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
13909
14133
  ]),
13910
14134
  createCompoundExpression([
13911
14135
  `if (_cached && _cached.el`,
13912
- ...keyExp ? [` && _cached.key === `, keyExp] : [],
14136
+ ...keyExp ? [
14137
+ ` && _cached.key === (`,
14138
+ keyExp,
14139
+ `)`
14140
+ ] : [],
13913
14141
  ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
13914
14142
  ]),
13915
14143
  createCompoundExpression([`const _item = `, childBlock]),
@@ -15195,6 +15423,34 @@ const transformShow = (dir, node, context) => {
15195
15423
  };
15196
15424
  };
15197
15425
  //#endregion
15426
+ //#region packages/compiler-dom/src/transforms/Transition.ts
15427
+ const transformTransition = (node, context) => {
15428
+ if (node.type === 1 && node.tagType === 1) {
15429
+ if (context.isBuiltInComponent(node.tag) === TRANSITION) return postTransformTransition(node, context.onError);
15430
+ }
15431
+ };
15432
+ function postTransformTransition(node, onError, hasMultipleChildren = defaultHasMultipleChildren) {
15433
+ return () => {
15434
+ if (!node.children.length) return;
15435
+ hasMultipleChildren(node);
15436
+ const child = node.children[0];
15437
+ if (child.type === 1 && !findDir(child, "if")) {
15438
+ for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
15439
+ type: 6,
15440
+ name: "persisted",
15441
+ nameLoc: node.loc,
15442
+ value: void 0,
15443
+ loc: node.loc
15444
+ });
15445
+ }
15446
+ };
15447
+ }
15448
+ function defaultHasMultipleChildren(node) {
15449
+ const children = node.children = node.children.filter((c) => !isCommentOrWhitespace(c));
15450
+ const child = children[0];
15451
+ return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(defaultHasMultipleChildren);
15452
+ }
15453
+ //#endregion
15198
15454
  //#region packages/compiler-dom/src/transforms/stringifyStatic.ts
15199
15455
  /**
15200
15456
  * This module is Node-only.
@@ -15340,7 +15596,7 @@ function stringifyNode(node, context) {
15340
15596
  }
15341
15597
  function stringifyElement(node, context) {
15342
15598
  let res = `<${node.tag}`;
15343
- let innerHTML = "";
15599
+ let innerHTML = void 0;
15344
15600
  for (let i = 0; i < node.props.length; i++) {
15345
15601
  const p = node.props[i];
15346
15602
  if (p.type === 6) {
@@ -15362,13 +15618,15 @@ function stringifyElement(node, context) {
15362
15618
  else if (arg === "style") evaluated = stringifyStyle(normalizeStyle(evaluated));
15363
15619
  res += ` ${p.arg.content}="${escapeHtml(evaluated)}"`;
15364
15620
  }
15365
- } else if (p.name === "html") innerHTML = evaluateConstant(p.exp);
15366
- else if (p.name === "text") innerHTML = escapeHtml(toDisplayString(evaluateConstant(p.exp)));
15621
+ } else if (p.name === "html") {
15622
+ var _evaluateConstant;
15623
+ innerHTML = (_evaluateConstant = evaluateConstant(p.exp)) !== null && _evaluateConstant !== void 0 ? _evaluateConstant : "";
15624
+ } else if (p.name === "text") innerHTML = escapeHtml(toDisplayString(evaluateConstant(p.exp)));
15367
15625
  }
15368
15626
  }
15369
15627
  if (context.scopeId) res += ` ${context.scopeId}`;
15370
15628
  res += `>`;
15371
- if (innerHTML) res += innerHTML;
15629
+ if (innerHTML !== void 0) res += innerHTML;
15372
15630
  else for (let i = 0; i < node.children.length; i++) res += stringifyNode(node.children[i], context);
15373
15631
  if (!isVoidTag(node.tag)) res += `</${node.tag}>`;
15374
15632
  return res;
@@ -15393,7 +15651,11 @@ const ignoreSideEffectTags = (node, context) => {
15393
15651
  };
15394
15652
  //#endregion
15395
15653
  //#region packages/compiler-dom/src/index.ts
15396
- const DOMNodeTransforms = [transformStyle, ...[]];
15654
+ const DOMNodeTransforms = [
15655
+ transformStyle,
15656
+ transformTransition,
15657
+ ...[]
15658
+ ];
15397
15659
  const DOMDirectiveTransforms = {
15398
15660
  cloak: noopDirectiveTransform,
15399
15661
  html: transformVHtml,