@vue/runtime-core 3.5.16 → 3.6.0-alpha.1

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-core v3.5.16
2
+ * @vue/runtime-core v3.6.0-alpha.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -11,8 +11,8 @@ var reactivity = require('@vue/reactivity');
11
11
  var shared = require('@vue/shared');
12
12
 
13
13
  const stack = [];
14
- function pushWarningContext(vnode) {
15
- stack.push(vnode);
14
+ function pushWarningContext(ctx) {
15
+ stack.push(ctx);
16
16
  }
17
17
  function popWarningContext() {
18
18
  stack.pop();
@@ -21,8 +21,9 @@ let isWarning = false;
21
21
  function warn$1(msg, ...args) {
22
22
  if (isWarning) return;
23
23
  isWarning = true;
24
- reactivity.pauseTracking();
25
- const instance = stack.length ? stack[stack.length - 1].component : null;
24
+ const prevSub = reactivity.setActiveSub();
25
+ const entry = stack.length ? stack[stack.length - 1] : null;
26
+ const instance = isVNode(entry) ? entry.component : entry;
26
27
  const appWarnHandler = instance && instance.appContext.config.warnHandler;
27
28
  const trace = getComponentTrace();
28
29
  if (appWarnHandler) {
@@ -36,9 +37,9 @@ function warn$1(msg, ...args) {
36
37
  var _a, _b;
37
38
  return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
38
39
  }).join(""),
39
- instance && instance.proxy,
40
+ instance && instance.proxy || instance,
40
41
  trace.map(
41
- ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
42
+ ({ ctx }) => `at <${formatComponentName(instance, ctx.type)}>`
42
43
  ).join("\n"),
43
44
  trace
44
45
  ]
@@ -52,27 +53,31 @@ function warn$1(msg, ...args) {
52
53
  }
53
54
  console.warn(...warnArgs);
54
55
  }
55
- reactivity.resetTracking();
56
+ reactivity.setActiveSub(prevSub);
56
57
  isWarning = false;
57
58
  }
58
59
  function getComponentTrace() {
59
- let currentVNode = stack[stack.length - 1];
60
- if (!currentVNode) {
60
+ let currentCtx = stack[stack.length - 1];
61
+ if (!currentCtx) {
61
62
  return [];
62
63
  }
63
64
  const normalizedStack = [];
64
- while (currentVNode) {
65
+ while (currentCtx) {
65
66
  const last = normalizedStack[0];
66
- if (last && last.vnode === currentVNode) {
67
+ if (last && last.ctx === currentCtx) {
67
68
  last.recurseCount++;
68
69
  } else {
69
70
  normalizedStack.push({
70
- vnode: currentVNode,
71
+ ctx: currentCtx,
71
72
  recurseCount: 0
72
73
  });
73
74
  }
74
- const parentInstance = currentVNode.component && currentVNode.component.parent;
75
- currentVNode = parentInstance && parentInstance.vnode;
75
+ if (isVNode(currentCtx)) {
76
+ const parent = currentCtx.component && currentCtx.component.parent;
77
+ currentCtx = parent && parent.vnode || parent;
78
+ } else {
79
+ currentCtx = currentCtx.parent;
80
+ }
76
81
  }
77
82
  return normalizedStack;
78
83
  }
@@ -84,16 +89,13 @@ function formatTrace(trace) {
84
89
  });
85
90
  return logs;
86
91
  }
87
- function formatTraceEntry({ vnode, recurseCount }) {
92
+ function formatTraceEntry({ ctx, recurseCount }) {
88
93
  const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
89
- const isRoot = vnode.component ? vnode.component.parent == null : false;
90
- const open = ` at <${formatComponentName(
91
- vnode.component,
92
- vnode.type,
93
- isRoot
94
- )}`;
94
+ const instance = isVNode(ctx) ? ctx.component : ctx;
95
+ const isRoot = instance ? instance.parent == null : false;
96
+ const open = ` at <${formatComponentName(instance, ctx.type, isRoot)}`;
95
97
  const close = `>` + postfix;
96
- return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
98
+ return ctx.props ? [open, ...formatProps(ctx.props), close] : [open + close];
97
99
  }
98
100
  function formatProps(props) {
99
101
  const res = [];
@@ -225,11 +227,10 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
225
227
  }
226
228
  }
227
229
  function handleError(err, instance, type, throwInDev = true) {
228
- const contextVNode = instance ? instance.vnode : null;
229
230
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ;
230
231
  if (instance) {
231
232
  let cur = instance.parent;
232
- const exposedInstance = instance.proxy;
233
+ const exposedInstance = instance.proxy || instance;
233
234
  const errorInfo = ErrorTypeStrings$1[type] ;
234
235
  while (cur) {
235
236
  const errorCapturedHooks = cur.ec;
@@ -243,26 +244,26 @@ function handleError(err, instance, type, throwInDev = true) {
243
244
  cur = cur.parent;
244
245
  }
245
246
  if (errorHandler) {
246
- reactivity.pauseTracking();
247
+ const prevSub = reactivity.setActiveSub();
247
248
  callWithErrorHandling(errorHandler, null, 10, [
248
249
  err,
249
250
  exposedInstance,
250
251
  errorInfo
251
252
  ]);
252
- reactivity.resetTracking();
253
+ reactivity.setActiveSub(prevSub);
253
254
  return;
254
255
  }
255
256
  }
256
- logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
257
+ logError(err, type, instance, throwInDev, throwUnhandledErrorInProduction);
257
258
  }
258
- function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
259
+ function logError(err, type, instance, throwInDev = true, throwInProd = false) {
259
260
  {
260
261
  const info = ErrorTypeStrings$1[type];
261
- if (contextVNode) {
262
- pushWarningContext(contextVNode);
262
+ if (instance) {
263
+ pushWarningContext(instance);
263
264
  }
264
265
  warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
265
- if (contextVNode) {
266
+ if (instance) {
266
267
  popWarningContext();
267
268
  }
268
269
  if (throwInDev) {
@@ -273,26 +274,23 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
273
274
  }
274
275
  }
275
276
 
276
- const queue = [];
277
- let flushIndex = -1;
278
- const pendingPostFlushCbs = [];
279
- let activePostFlushCbs = null;
277
+ const jobs = [];
278
+ let postJobs = [];
279
+ let activePostJobs = null;
280
+ let currentFlushPromise = null;
281
+ let jobsLength = 0;
282
+ let flushIndex = 0;
280
283
  let postFlushIndex = 0;
281
284
  const resolvedPromise = /* @__PURE__ */ Promise.resolve();
282
- let currentFlushPromise = null;
283
285
  const RECURSION_LIMIT = 100;
284
286
  function nextTick(fn) {
285
287
  const p = currentFlushPromise || resolvedPromise;
286
288
  return fn ? p.then(this ? fn.bind(this) : fn) : p;
287
289
  }
288
- function findInsertionIndex(id) {
289
- let start = flushIndex + 1;
290
- let end = queue.length;
290
+ function findInsertionIndex(order, queue, start, end) {
291
291
  while (start < end) {
292
292
  const middle = start + end >>> 1;
293
- const middleJob = queue[middle];
294
- const middleJobId = getId(middleJob);
295
- if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
293
+ if (queue[middle].order <= order) {
296
294
  start = middle + 1;
297
295
  } else {
298
296
  end = middle;
@@ -300,130 +298,168 @@ function findInsertionIndex(id) {
300
298
  }
301
299
  return start;
302
300
  }
303
- function queueJob(job) {
304
- if (!(job.flags & 1)) {
305
- const jobId = getId(job);
306
- const lastJob = queue[queue.length - 1];
307
- if (!lastJob || // fast path when the job id is larger than the tail
308
- !(job.flags & 2) && jobId >= getId(lastJob)) {
309
- queue.push(job);
301
+ function queueJob(job, id, isPre = false) {
302
+ if (queueJobWorker(
303
+ job,
304
+ id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1,
305
+ jobs,
306
+ jobsLength,
307
+ flushIndex
308
+ )) {
309
+ jobsLength++;
310
+ queueFlush();
311
+ }
312
+ }
313
+ function queueJobWorker(job, order, queue, length, flushIndex2) {
314
+ const flags = job.flags;
315
+ if (!(flags & 1)) {
316
+ job.flags = flags | 1;
317
+ job.order = order;
318
+ if (flushIndex2 === length || // fast path when the job id is larger than the tail
319
+ order >= queue[length - 1].order) {
320
+ queue[length] = job;
310
321
  } else {
311
- queue.splice(findInsertionIndex(jobId), 0, job);
322
+ queue.splice(findInsertionIndex(order, queue, flushIndex2, length), 0, job);
312
323
  }
313
- job.flags |= 1;
314
- queueFlush();
324
+ return true;
315
325
  }
326
+ return false;
316
327
  }
328
+ const doFlushJobs = () => {
329
+ try {
330
+ flushJobs();
331
+ } catch (e) {
332
+ currentFlushPromise = null;
333
+ throw e;
334
+ }
335
+ };
317
336
  function queueFlush() {
318
337
  if (!currentFlushPromise) {
319
- currentFlushPromise = resolvedPromise.then(flushJobs);
338
+ currentFlushPromise = resolvedPromise.then(doFlushJobs);
320
339
  }
321
340
  }
322
- function queuePostFlushCb(cb) {
323
- if (!shared.isArray(cb)) {
324
- if (activePostFlushCbs && cb.id === -1) {
325
- activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
326
- } else if (!(cb.flags & 1)) {
327
- pendingPostFlushCbs.push(cb);
328
- cb.flags |= 1;
341
+ function queuePostFlushCb(jobs2, id = Infinity) {
342
+ if (!shared.isArray(jobs2)) {
343
+ if (activePostJobs && id === -1) {
344
+ activePostJobs.splice(postFlushIndex, 0, jobs2);
345
+ } else {
346
+ queueJobWorker(jobs2, id, postJobs, postJobs.length, 0);
329
347
  }
330
348
  } else {
331
- pendingPostFlushCbs.push(...cb);
349
+ for (const job of jobs2) {
350
+ queueJobWorker(job, id, postJobs, postJobs.length, 0);
351
+ }
332
352
  }
333
353
  queueFlush();
334
354
  }
335
- function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
355
+ function flushPreFlushCbs(instance, seen) {
336
356
  {
337
357
  seen = seen || /* @__PURE__ */ new Map();
338
358
  }
339
- for (; i < queue.length; i++) {
340
- const cb = queue[i];
341
- if (cb && cb.flags & 2) {
342
- if (instance && cb.id !== instance.uid) {
343
- continue;
344
- }
345
- if (checkRecursiveUpdates(seen, cb)) {
346
- continue;
347
- }
348
- queue.splice(i, 1);
349
- i--;
350
- if (cb.flags & 4) {
351
- cb.flags &= -2;
352
- }
353
- cb();
354
- if (!(cb.flags & 4)) {
355
- cb.flags &= -2;
356
- }
359
+ for (let i = flushIndex; i < jobsLength; i++) {
360
+ const cb = jobs[i];
361
+ if (cb.order & 1 || cb.order === Infinity) {
362
+ continue;
363
+ }
364
+ if (instance && cb.order !== instance.uid * 2) {
365
+ continue;
366
+ }
367
+ if (checkRecursiveUpdates(seen, cb)) {
368
+ continue;
369
+ }
370
+ jobs.splice(i, 1);
371
+ i--;
372
+ jobsLength--;
373
+ if (cb.flags & 2) {
374
+ cb.flags &= -2;
375
+ }
376
+ cb();
377
+ if (!(cb.flags & 2)) {
378
+ cb.flags &= -2;
357
379
  }
358
380
  }
359
381
  }
360
382
  function flushPostFlushCbs(seen) {
361
- if (pendingPostFlushCbs.length) {
362
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
363
- (a, b) => getId(a) - getId(b)
364
- );
365
- pendingPostFlushCbs.length = 0;
366
- if (activePostFlushCbs) {
367
- activePostFlushCbs.push(...deduped);
383
+ if (postJobs.length) {
384
+ if (activePostJobs) {
385
+ activePostJobs.push(...postJobs);
386
+ postJobs.length = 0;
368
387
  return;
369
388
  }
370
- activePostFlushCbs = deduped;
389
+ activePostJobs = postJobs;
390
+ postJobs = [];
371
391
  {
372
392
  seen = seen || /* @__PURE__ */ new Map();
373
393
  }
374
- for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
375
- const cb = activePostFlushCbs[postFlushIndex];
394
+ while (postFlushIndex < activePostJobs.length) {
395
+ const cb = activePostJobs[postFlushIndex++];
376
396
  if (checkRecursiveUpdates(seen, cb)) {
377
397
  continue;
378
398
  }
379
- if (cb.flags & 4) {
399
+ if (cb.flags & 2) {
380
400
  cb.flags &= -2;
381
401
  }
382
- if (!(cb.flags & 8)) cb();
383
- cb.flags &= -2;
402
+ if (!(cb.flags & 4)) {
403
+ try {
404
+ cb();
405
+ } finally {
406
+ cb.flags &= -2;
407
+ }
408
+ }
384
409
  }
385
- activePostFlushCbs = null;
410
+ activePostJobs = null;
386
411
  postFlushIndex = 0;
387
412
  }
388
413
  }
389
- const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
414
+ let isFlushing = false;
415
+ function flushOnAppMount() {
416
+ if (!isFlushing) {
417
+ isFlushing = true;
418
+ flushPreFlushCbs();
419
+ flushPostFlushCbs();
420
+ isFlushing = false;
421
+ }
422
+ }
390
423
  function flushJobs(seen) {
391
424
  {
392
- seen = seen || /* @__PURE__ */ new Map();
425
+ seen || (seen = /* @__PURE__ */ new Map());
393
426
  }
394
- const check = (job) => checkRecursiveUpdates(seen, job) ;
395
427
  try {
396
- for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
397
- const job = queue[flushIndex];
398
- if (job && !(job.flags & 8)) {
399
- if (check(job)) {
428
+ while (flushIndex < jobsLength) {
429
+ const job = jobs[flushIndex];
430
+ jobs[flushIndex++] = void 0;
431
+ if (!(job.flags & 4)) {
432
+ if (checkRecursiveUpdates(seen, job)) {
400
433
  continue;
401
434
  }
402
- if (job.flags & 4) {
435
+ if (job.flags & 2) {
403
436
  job.flags &= ~1;
404
437
  }
405
- callWithErrorHandling(
406
- job,
407
- job.i,
408
- job.i ? 15 : 14
409
- );
410
- if (!(job.flags & 4)) {
411
- job.flags &= ~1;
438
+ try {
439
+ job();
440
+ } catch (err) {
441
+ handleError(
442
+ err,
443
+ job.i,
444
+ job.i ? 15 : 14
445
+ );
446
+ } finally {
447
+ if (!(job.flags & 2)) {
448
+ job.flags &= ~1;
449
+ }
412
450
  }
413
451
  }
414
452
  }
415
453
  } finally {
416
- for (; flushIndex < queue.length; flushIndex++) {
417
- const job = queue[flushIndex];
418
- if (job) {
419
- job.flags &= -2;
420
- }
454
+ while (flushIndex < jobsLength) {
455
+ jobs[flushIndex].flags &= -2;
456
+ jobs[flushIndex++] = void 0;
421
457
  }
422
- flushIndex = -1;
423
- queue.length = 0;
458
+ flushIndex = 0;
459
+ jobsLength = 0;
424
460
  flushPostFlushCbs(seen);
425
461
  currentFlushPromise = null;
426
- if (queue.length || pendingPostFlushCbs.length) {
462
+ if (jobsLength || postJobs.length) {
427
463
  flushJobs(seen);
428
464
  }
429
465
  }
@@ -490,10 +526,17 @@ function rerender(id, newRender) {
490
526
  instance.render = newRender;
491
527
  normalizeClassComponent(instance.type).render = newRender;
492
528
  }
493
- instance.renderCache = [];
494
529
  isHmrUpdating = true;
495
- instance.update();
496
- isHmrUpdating = false;
530
+ if (instance.vapor) {
531
+ instance.hmrRerender();
532
+ } else {
533
+ const i = instance;
534
+ i.renderCache = [];
535
+ i.effect.run();
536
+ }
537
+ nextTick(() => {
538
+ isHmrUpdating = false;
539
+ });
497
540
  });
498
541
  }
499
542
  function reload(id, newComp) {
@@ -502,42 +545,54 @@ function reload(id, newComp) {
502
545
  newComp = normalizeClassComponent(newComp);
503
546
  updateComponentDef(record.initialDef, newComp);
504
547
  const instances = [...record.instances];
505
- for (let i = 0; i < instances.length; i++) {
506
- const instance = instances[i];
507
- const oldComp = normalizeClassComponent(instance.type);
508
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
509
- if (!dirtyInstances) {
510
- if (oldComp !== record.initialDef) {
511
- updateComponentDef(oldComp, newComp);
512
- }
513
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
514
- }
515
- dirtyInstances.add(instance);
516
- instance.appContext.propsCache.delete(instance.type);
517
- instance.appContext.emitsCache.delete(instance.type);
518
- instance.appContext.optionsCache.delete(instance.type);
519
- if (instance.ceReload) {
548
+ if (newComp.vapor) {
549
+ for (const instance of instances) {
550
+ instance.hmrReload(newComp);
551
+ }
552
+ } else {
553
+ for (const instance of instances) {
554
+ const oldComp = normalizeClassComponent(instance.type);
555
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
556
+ if (!dirtyInstances) {
557
+ if (oldComp !== record.initialDef) {
558
+ updateComponentDef(oldComp, newComp);
559
+ }
560
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
561
+ }
520
562
  dirtyInstances.add(instance);
521
- instance.ceReload(newComp.styles);
522
- dirtyInstances.delete(instance);
523
- } else if (instance.parent) {
524
- queueJob(() => {
525
- isHmrUpdating = true;
526
- instance.parent.update();
527
- isHmrUpdating = false;
563
+ instance.appContext.propsCache.delete(instance.type);
564
+ instance.appContext.emitsCache.delete(instance.type);
565
+ instance.appContext.optionsCache.delete(instance.type);
566
+ if (instance.ceReload) {
567
+ dirtyInstances.add(instance);
568
+ instance.ceReload(newComp.styles);
528
569
  dirtyInstances.delete(instance);
529
- });
530
- } else if (instance.appContext.reload) {
531
- instance.appContext.reload();
532
- } else if (typeof window !== "undefined") {
533
- window.location.reload();
534
- } else {
535
- console.warn(
536
- "[HMR] Root or manually mounted instance modified. Full reload required."
537
- );
538
- }
539
- if (instance.root.ce && instance !== instance.root) {
540
- instance.root.ce._removeChildStyle(oldComp);
570
+ } else if (instance.parent) {
571
+ queueJob(() => {
572
+ isHmrUpdating = true;
573
+ const parent = instance.parent;
574
+ if (parent.vapor) {
575
+ parent.hmrRerender();
576
+ } else {
577
+ parent.effect.run();
578
+ }
579
+ nextTick(() => {
580
+ isHmrUpdating = false;
581
+ });
582
+ dirtyInstances.delete(instance);
583
+ });
584
+ } else if (instance.appContext.reload) {
585
+ instance.appContext.reload();
586
+ } else if (typeof window !== "undefined") {
587
+ window.location.reload();
588
+ } else {
589
+ console.warn(
590
+ "[HMR] Root or manually mounted instance modified. Full reload required."
591
+ );
592
+ }
593
+ if (instance.root.ce && instance !== instance.root) {
594
+ instance.root.ce._removeChildStyle(oldComp);
595
+ }
541
596
  }
542
597
  }
543
598
  queuePostFlushCb(() => {
@@ -750,14 +805,14 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
750
805
  }
751
806
  let hook = binding.dir[name];
752
807
  if (hook) {
753
- reactivity.pauseTracking();
808
+ const prevSub = reactivity.setActiveSub();
754
809
  callWithAsyncErrorHandling(hook, instance, 8, [
755
810
  vnode.el,
756
811
  binding,
757
812
  vnode,
758
813
  prevVNode
759
814
  ]);
760
- reactivity.resetTracking();
815
+ reactivity.setActiveSub(prevSub);
761
816
  }
762
817
  }
763
818
  }
@@ -857,29 +912,37 @@ const TeleportImpl = {
857
912
  }
858
913
  if (isTeleportDeferred(n2.props)) {
859
914
  n2.el.__isMounted = false;
860
- queuePostRenderEffect(() => {
861
- mountToTarget();
862
- delete n2.el.__isMounted;
863
- }, parentSuspense);
915
+ queuePostRenderEffect(
916
+ () => {
917
+ mountToTarget();
918
+ delete n2.el.__isMounted;
919
+ },
920
+ void 0,
921
+ parentSuspense
922
+ );
864
923
  } else {
865
924
  mountToTarget();
866
925
  }
867
926
  } else {
868
927
  if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
869
- queuePostRenderEffect(() => {
870
- TeleportImpl.process(
871
- n1,
872
- n2,
873
- container,
874
- anchor,
875
- parentComponent,
876
- parentSuspense,
877
- namespace,
878
- slotScopeIds,
879
- optimized,
880
- internals
881
- );
882
- }, parentSuspense);
928
+ queuePostRenderEffect(
929
+ () => {
930
+ TeleportImpl.process(
931
+ n1,
932
+ n2,
933
+ container,
934
+ anchor,
935
+ parentComponent,
936
+ parentSuspense,
937
+ namespace,
938
+ slotScopeIds,
939
+ optimized,
940
+ internals
941
+ );
942
+ },
943
+ void 0,
944
+ parentSuspense
945
+ );
883
946
  return;
884
947
  }
885
948
  n2.el = n1.el;
@@ -926,6 +989,7 @@ const TeleportImpl = {
926
989
  container,
927
990
  mainAnchor,
928
991
  internals,
992
+ parentComponent,
929
993
  1
930
994
  );
931
995
  } else {
@@ -945,6 +1009,7 @@ const TeleportImpl = {
945
1009
  nextTarget,
946
1010
  null,
947
1011
  internals,
1012
+ parentComponent,
948
1013
  0
949
1014
  );
950
1015
  } else {
@@ -960,6 +1025,7 @@ const TeleportImpl = {
960
1025
  target,
961
1026
  targetAnchor,
962
1027
  internals,
1028
+ parentComponent,
963
1029
  1
964
1030
  );
965
1031
  }
@@ -999,7 +1065,7 @@ const TeleportImpl = {
999
1065
  move: moveTeleport,
1000
1066
  hydrate: hydrateTeleport
1001
1067
  };
1002
- function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
1068
+ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
1003
1069
  if (moveType === 0) {
1004
1070
  insert(vnode.targetAnchor, container, parentAnchor);
1005
1071
  }
@@ -1015,7 +1081,8 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
1015
1081
  children[i],
1016
1082
  container,
1017
1083
  parentAnchor,
1018
- 2
1084
+ 2,
1085
+ parentComponent
1019
1086
  );
1020
1087
  }
1021
1088
  }
@@ -1200,7 +1267,7 @@ const BaseTransitionImpl = {
1200
1267
  state.isLeaving = true;
1201
1268
  leavingHooks.afterLeave = () => {
1202
1269
  state.isLeaving = false;
1203
- if (!(instance.job.flags & 8)) {
1270
+ if (!(instance.job.flags & 4)) {
1204
1271
  instance.update();
1205
1272
  }
1206
1273
  delete leavingHooks.afterLeave;
@@ -1479,7 +1546,7 @@ function defineComponent(options, extraOptions) {
1479
1546
  }
1480
1547
 
1481
1548
  function useId() {
1482
- const i = getCurrentInstance();
1549
+ const i = getCurrentGenericInstance();
1483
1550
  if (i) {
1484
1551
  return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
1485
1552
  } else {
@@ -1495,7 +1562,7 @@ function markAsyncBoundary(instance) {
1495
1562
 
1496
1563
  const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
1497
1564
  function useTemplateRef(key) {
1498
- const i = getCurrentInstance();
1565
+ const i = getCurrentGenericInstance();
1499
1566
  const r = reactivity.shallowRef(null);
1500
1567
  if (i) {
1501
1568
  const refs = i.refs === shared.EMPTY_OBJ ? i.refs = {} : i.refs;
@@ -1615,8 +1682,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
1615
1682
  }
1616
1683
  };
1617
1684
  if (value) {
1618
- doSet.id = -1;
1619
- queuePostRenderEffect(doSet, parentSuspense);
1685
+ queuePostRenderEffect(doSet, -1, parentSuspense);
1620
1686
  } else {
1621
1687
  doSet();
1622
1688
  }
@@ -1784,6 +1850,9 @@ function createHydrationFunctions(rendererInternals) {
1784
1850
  );
1785
1851
  }
1786
1852
  } else if (shapeFlag & 6) {
1853
+ if (vnode.type.__vapor) {
1854
+ throw new Error("Vapor component hydration is not supported yet.");
1855
+ }
1787
1856
  vnode.slotScopeIds = slotScopeIds;
1788
1857
  const container = parentNode(node);
1789
1858
  if (isFragmentStart) {
@@ -1945,11 +2014,15 @@ Server rendered element contains more child nodes than client vdom.`
1945
2014
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
1946
2015
  }
1947
2016
  if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
1948
- queueEffectWithSuspense(() => {
1949
- vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
1950
- needCallTransitionHooks && transition.enter(el);
1951
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
1952
- }, parentSuspense);
2017
+ queueEffectWithSuspense(
2018
+ () => {
2019
+ vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
2020
+ needCallTransitionHooks && transition.enter(el);
2021
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
2022
+ },
2023
+ void 0,
2024
+ parentSuspense
2025
+ );
1953
2026
  }
1954
2027
  }
1955
2028
  return el.nextSibling;
@@ -2229,14 +2302,16 @@ function resolveCssVars(instance, vnode, expectedMap) {
2229
2302
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
2230
2303
  const cssVars = instance.getCssVars();
2231
2304
  for (const key in cssVars) {
2232
- expectedMap.set(
2233
- `--${shared.getEscapedCssVarName(key, false)}`,
2234
- String(cssVars[key])
2235
- );
2305
+ const value = shared.normalizeCssVarValue(cssVars[key]);
2306
+ expectedMap.set(`--${shared.getEscapedCssVarName(key, false)}`, value);
2236
2307
  }
2237
2308
  }
2238
2309
  if (vnode === root && instance.parent) {
2239
- resolveCssVars(instance.parent, instance.vnode, expectedMap);
2310
+ resolveCssVars(
2311
+ instance.parent,
2312
+ instance.vnode,
2313
+ expectedMap
2314
+ );
2240
2315
  }
2241
2316
  }
2242
2317
  const allowMismatchAttr = "data-allow-mismatch";
@@ -2263,7 +2338,7 @@ function isMismatchAllowed(el, allowedType) {
2263
2338
  if (allowedType === 0 /* TEXT */ && list.includes("children")) {
2264
2339
  return true;
2265
2340
  }
2266
- return allowedAttr.split(",").includes(MismatchTypeString[allowedType]);
2341
+ return list.includes(MismatchTypeString[allowedType]);
2267
2342
  }
2268
2343
  }
2269
2344
 
@@ -2495,7 +2570,7 @@ function defineAsyncComponent(source) {
2495
2570
  }
2496
2571
  load().then(() => {
2497
2572
  loaded.value = true;
2498
- if (instance.parent && isKeepAlive(instance.parent.vnode)) {
2573
+ if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
2499
2574
  instance.parent.update();
2500
2575
  }
2501
2576
  }).catch((err) => {
@@ -2538,8 +2613,8 @@ const KeepAliveImpl = {
2538
2613
  max: [String, Number]
2539
2614
  },
2540
2615
  setup(props, { slots }) {
2541
- const instance = getCurrentInstance();
2542
- const sharedContext = instance.ctx;
2616
+ const keepAliveInstance = getCurrentInstance();
2617
+ const sharedContext = keepAliveInstance.ctx;
2543
2618
  if (!sharedContext.renderer) {
2544
2619
  return () => {
2545
2620
  const children = slots.default && slots.default();
@@ -2550,9 +2625,9 @@ const KeepAliveImpl = {
2550
2625
  const keys = /* @__PURE__ */ new Set();
2551
2626
  let current = null;
2552
2627
  {
2553
- instance.__v_cache = cache;
2628
+ keepAliveInstance.__v_cache = cache;
2554
2629
  }
2555
- const parentSuspense = instance.suspense;
2630
+ const parentSuspense = keepAliveInstance.suspense;
2556
2631
  const {
2557
2632
  renderer: {
2558
2633
  p: patch,
@@ -2563,55 +2638,77 @@ const KeepAliveImpl = {
2563
2638
  } = sharedContext;
2564
2639
  const storageContainer = createElement("div");
2565
2640
  sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
2566
- const instance2 = vnode.component;
2567
- move(vnode, container, anchor, 0, parentSuspense);
2641
+ const instance = vnode.component;
2642
+ move(
2643
+ vnode,
2644
+ container,
2645
+ anchor,
2646
+ 0,
2647
+ keepAliveInstance,
2648
+ parentSuspense
2649
+ );
2568
2650
  patch(
2569
- instance2.vnode,
2651
+ instance.vnode,
2570
2652
  vnode,
2571
2653
  container,
2572
2654
  anchor,
2573
- instance2,
2655
+ instance,
2574
2656
  parentSuspense,
2575
2657
  namespace,
2576
2658
  vnode.slotScopeIds,
2577
2659
  optimized
2578
2660
  );
2579
- queuePostRenderEffect(() => {
2580
- instance2.isDeactivated = false;
2581
- if (instance2.a) {
2582
- shared.invokeArrayFns(instance2.a);
2583
- }
2584
- const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
2585
- if (vnodeHook) {
2586
- invokeVNodeHook(vnodeHook, instance2.parent, vnode);
2587
- }
2588
- }, parentSuspense);
2661
+ queuePostRenderEffect(
2662
+ () => {
2663
+ instance.isDeactivated = false;
2664
+ if (instance.a) {
2665
+ shared.invokeArrayFns(instance.a);
2666
+ }
2667
+ const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
2668
+ if (vnodeHook) {
2669
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
2670
+ }
2671
+ },
2672
+ void 0,
2673
+ parentSuspense
2674
+ );
2589
2675
  {
2590
- devtoolsComponentAdded(instance2);
2676
+ devtoolsComponentAdded(instance);
2591
2677
  }
2592
2678
  };
2593
2679
  sharedContext.deactivate = (vnode) => {
2594
- const instance2 = vnode.component;
2595
- invalidateMount(instance2.m);
2596
- invalidateMount(instance2.a);
2597
- move(vnode, storageContainer, null, 1, parentSuspense);
2598
- queuePostRenderEffect(() => {
2599
- if (instance2.da) {
2600
- shared.invokeArrayFns(instance2.da);
2601
- }
2602
- const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
2603
- if (vnodeHook) {
2604
- invokeVNodeHook(vnodeHook, instance2.parent, vnode);
2605
- }
2606
- instance2.isDeactivated = true;
2607
- }, parentSuspense);
2680
+ const instance = vnode.component;
2681
+ invalidateMount(instance.m);
2682
+ invalidateMount(instance.a);
2683
+ move(
2684
+ vnode,
2685
+ storageContainer,
2686
+ null,
2687
+ 1,
2688
+ keepAliveInstance,
2689
+ parentSuspense
2690
+ );
2691
+ queuePostRenderEffect(
2692
+ () => {
2693
+ if (instance.da) {
2694
+ shared.invokeArrayFns(instance.da);
2695
+ }
2696
+ const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
2697
+ if (vnodeHook) {
2698
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
2699
+ }
2700
+ instance.isDeactivated = true;
2701
+ },
2702
+ void 0,
2703
+ parentSuspense
2704
+ );
2608
2705
  {
2609
- devtoolsComponentAdded(instance2);
2706
+ devtoolsComponentAdded(instance);
2610
2707
  }
2611
2708
  };
2612
2709
  function unmount(vnode) {
2613
2710
  resetShapeFlag(vnode);
2614
- _unmount(vnode, instance, parentSuspense, true);
2711
+ _unmount(vnode, keepAliveInstance, parentSuspense, true);
2615
2712
  }
2616
2713
  function pruneCache(filter) {
2617
2714
  cache.forEach((vnode, key) => {
@@ -2643,12 +2740,19 @@ const KeepAliveImpl = {
2643
2740
  let pendingCacheKey = null;
2644
2741
  const cacheSubtree = () => {
2645
2742
  if (pendingCacheKey != null) {
2646
- if (isSuspense(instance.subTree.type)) {
2647
- queuePostRenderEffect(() => {
2648
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
2649
- }, instance.subTree.suspense);
2743
+ if (isSuspense(keepAliveInstance.subTree.type)) {
2744
+ queuePostRenderEffect(
2745
+ () => {
2746
+ cache.set(
2747
+ pendingCacheKey,
2748
+ getInnerChild(keepAliveInstance.subTree)
2749
+ );
2750
+ },
2751
+ void 0,
2752
+ keepAliveInstance.subTree.suspense
2753
+ );
2650
2754
  } else {
2651
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
2755
+ cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
2652
2756
  }
2653
2757
  }
2654
2758
  };
@@ -2656,12 +2760,12 @@ const KeepAliveImpl = {
2656
2760
  onUpdated(cacheSubtree);
2657
2761
  onBeforeUnmount(() => {
2658
2762
  cache.forEach((cached) => {
2659
- const { subTree, suspense } = instance;
2763
+ const { subTree, suspense } = keepAliveInstance;
2660
2764
  const vnode = getInnerChild(subTree);
2661
2765
  if (cached.type === vnode.type && cached.key === vnode.key) {
2662
2766
  resetShapeFlag(vnode);
2663
2767
  const da = vnode.component.da;
2664
- da && queuePostRenderEffect(da, suspense);
2768
+ da && queuePostRenderEffect(da, void 0, suspense);
2665
2769
  return;
2666
2770
  }
2667
2771
  unmount(cached);
@@ -2747,7 +2851,7 @@ function onActivated(hook, target) {
2747
2851
  function onDeactivated(hook, target) {
2748
2852
  registerKeepAliveHook(hook, "da", target);
2749
2853
  }
2750
- function registerKeepAliveHook(hook, type, target = currentInstance) {
2854
+ function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
2751
2855
  const wrappedHook = hook.__wdc || (hook.__wdc = () => {
2752
2856
  let current = target;
2753
2857
  while (current) {
@@ -2761,7 +2865,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
2761
2865
  injectHook(type, wrappedHook, target);
2762
2866
  if (target) {
2763
2867
  let current = target.parent;
2764
- while (current && current.parent) {
2868
+ while (current && current.parent && current.parent.vnode) {
2765
2869
  if (isKeepAlive(current.parent.vnode)) {
2766
2870
  injectToKeepAliveRoot(wrappedHook, type, target, current);
2767
2871
  }
@@ -2793,12 +2897,14 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
2793
2897
  if (target) {
2794
2898
  const hooks = target[type] || (target[type] = []);
2795
2899
  const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
2796
- reactivity.pauseTracking();
2797
- const reset = setCurrentInstance(target);
2798
- const res = callWithAsyncErrorHandling(hook, target, type, args);
2799
- reset();
2800
- reactivity.resetTracking();
2801
- return res;
2900
+ const prevSub = reactivity.setActiveSub();
2901
+ const prev = setCurrentInstance(target);
2902
+ try {
2903
+ return callWithAsyncErrorHandling(hook, target, type, args);
2904
+ } finally {
2905
+ setCurrentInstance(...prev);
2906
+ reactivity.setActiveSub(prevSub);
2907
+ }
2802
2908
  });
2803
2909
  if (prepend) {
2804
2910
  hooks.unshift(wrappedHook);
@@ -2869,7 +2975,11 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
2869
2975
  const res = (
2870
2976
  // local registration
2871
2977
  // check instance[type] first which is resolved for options API
2872
- resolve(instance[type] || Component[type], name) || // global registration
2978
+ resolve(
2979
+ instance[type] || Component[type],
2980
+ name
2981
+ ) || // global registration
2982
+ // @ts-expect-error filters only exist in compat mode
2873
2983
  resolve(instance.appContext[type], name)
2874
2984
  );
2875
2985
  if (!res && maybeSelfReference) {
@@ -2963,7 +3073,13 @@ function createSlots(slots, dynamicSlots) {
2963
3073
  }
2964
3074
 
2965
3075
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
2966
- if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
3076
+ let slot = slots[name];
3077
+ if (slot && slot.__vapor) {
3078
+ const ret = (openBlock(), createBlock(VaporSlot, props));
3079
+ ret.vs = { slot, fallback };
3080
+ return ret;
3081
+ }
3082
+ if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
2967
3083
  if (name !== "default") props.name = name;
2968
3084
  return openBlock(), createBlock(
2969
3085
  Fragment,
@@ -2972,7 +3088,6 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
2972
3088
  64
2973
3089
  );
2974
3090
  }
2975
- let slot = slots[name];
2976
3091
  if (slot && slot.length > 1) {
2977
3092
  warn$1(
2978
3093
  `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`
@@ -3027,8 +3142,9 @@ function toHandlers(obj, preserveCaseIfNecessary) {
3027
3142
  }
3028
3143
 
3029
3144
  const getPublicInstance = (i) => {
3030
- if (!i) return null;
3031
- if (isStatefulComponent(i)) return getComponentPublicInstance(i);
3145
+ if (!i || i.vapor) return null;
3146
+ if (isStatefulComponent(i))
3147
+ return getComponentPublicInstance(i);
3032
3148
  return getPublicInstance(i.parent);
3033
3149
  };
3034
3150
  const publicPropertiesMap = (
@@ -3321,11 +3437,16 @@ function useAttrs() {
3321
3437
  return getContext().attrs;
3322
3438
  }
3323
3439
  function getContext() {
3324
- const i = getCurrentInstance();
3440
+ const i = getCurrentGenericInstance();
3325
3441
  if (!i) {
3326
3442
  warn$1(`useContext() called without active instance.`);
3327
3443
  }
3328
- return i.setupContext || (i.setupContext = createSetupContext(i));
3444
+ if (i.vapor) {
3445
+ return i;
3446
+ } else {
3447
+ const ii = i;
3448
+ return ii.setupContext || (ii.setupContext = createSetupContext(ii));
3449
+ }
3329
3450
  }
3330
3451
  function normalizePropsOrEmits(props) {
3331
3452
  return shared.isArray(props) ? props.reduce(
@@ -3373,14 +3494,14 @@ function createPropsRestProxy(props, excludedKeys) {
3373
3494
  return ret;
3374
3495
  }
3375
3496
  function withAsyncContext(getAwaitable) {
3376
- const ctx = getCurrentInstance();
3497
+ const ctx = getCurrentGenericInstance();
3377
3498
  if (!ctx) {
3378
3499
  warn$1(
3379
3500
  `withAsyncContext called without active current instance. This is likely a bug.`
3380
3501
  );
3381
3502
  }
3382
3503
  let awaitable = getAwaitable();
3383
- unsetCurrentInstance();
3504
+ setCurrentInstance(null, void 0);
3384
3505
  if (shared.isPromise(awaitable)) {
3385
3506
  awaitable = awaitable.catch((e) => {
3386
3507
  setCurrentInstance(ctx);
@@ -3827,7 +3948,7 @@ function createAppContext() {
3827
3948
  };
3828
3949
  }
3829
3950
  let uid$1 = 0;
3830
- function createAppAPI(render, hydrate) {
3951
+ function createAppAPI(mount, unmount, getPublicInstance, render) {
3831
3952
  return function createApp(rootComponent, rootProps = null) {
3832
3953
  if (!shared.isFunction(rootComponent)) {
3833
3954
  rootComponent = shared.extend({}, rootComponent);
@@ -3920,33 +4041,15 @@ function createAppAPI(render, hydrate) {
3920
4041
  If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
3921
4042
  );
3922
4043
  }
3923
- const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
3924
- vnode.appContext = context;
3925
- if (namespace === true) {
3926
- namespace = "svg";
3927
- } else if (namespace === false) {
3928
- namespace = void 0;
3929
- }
4044
+ const instance = mount(app, rootContainer, isHydrate, namespace);
3930
4045
  {
3931
- context.reload = () => {
3932
- const cloned = cloneVNode(vnode);
3933
- cloned.el = null;
3934
- render(cloned, rootContainer, namespace);
3935
- };
3936
- }
3937
- if (isHydrate && hydrate) {
3938
- hydrate(vnode, rootContainer);
3939
- } else {
3940
- render(vnode, rootContainer, namespace);
4046
+ app._instance = instance;
4047
+ devtoolsInitApp(app, version);
3941
4048
  }
3942
4049
  isMounted = true;
3943
4050
  app._container = rootContainer;
3944
4051
  rootContainer.__vue_app__ = app;
3945
- {
3946
- app._instance = vnode.component;
3947
- devtoolsInitApp(app, version);
3948
- }
3949
- return getComponentPublicInstance(vnode.component);
4052
+ return getPublicInstance(instance);
3950
4053
  } else {
3951
4054
  warn$1(
3952
4055
  `App has already been mounted.
@@ -3969,7 +4072,7 @@ If you want to remount the same app, move your app creation logic into a factory
3969
4072
  app._instance,
3970
4073
  16
3971
4074
  );
3972
- render(null, app._container);
4075
+ unmount(app);
3973
4076
  {
3974
4077
  app._instance = null;
3975
4078
  devtoolsUnmountApp(app);
@@ -4010,6 +4113,7 @@ If you want to remount the same app, move your app creation logic into a factory
4010
4113
  let currentApp = null;
4011
4114
 
4012
4115
  function provide(key, value) {
4116
+ const currentInstance = getCurrentGenericInstance();
4013
4117
  if (!currentInstance) {
4014
4118
  {
4015
4119
  warn$1(`provide() can only be used inside setup().`);
@@ -4024,9 +4128,9 @@ function provide(key, value) {
4024
4128
  }
4025
4129
  }
4026
4130
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
4027
- const instance = currentInstance || currentRenderingInstance;
4131
+ const instance = getCurrentGenericInstance();
4028
4132
  if (instance || currentApp) {
4029
- let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
4133
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
4030
4134
  if (provides && key in provides) {
4031
4135
  return provides[key];
4032
4136
  } else if (arguments.length > 1) {
@@ -4039,7 +4143,7 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
4039
4143
  }
4040
4144
  }
4041
4145
  function hasInjectionContext() {
4042
- return !!(currentInstance || currentRenderingInstance || currentApp);
4146
+ return !!(getCurrentGenericInstance() || currentApp);
4043
4147
  }
4044
4148
 
4045
4149
  const internalObjectProto = {};
@@ -4047,7 +4151,7 @@ const createInternalObject = () => Object.create(internalObjectProto);
4047
4151
  const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
4048
4152
 
4049
4153
  function initProps(instance, rawProps, isStateful, isSSR = false) {
4050
- const props = {};
4154
+ const props = instance.props = {};
4051
4155
  const attrs = createInternalObject();
4052
4156
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
4053
4157
  setFullProps(instance, rawProps, props, attrs);
@@ -4057,7 +4161,7 @@ function initProps(instance, rawProps, isStateful, isSSR = false) {
4057
4161
  }
4058
4162
  }
4059
4163
  {
4060
- validateProps(rawProps || {}, props, instance);
4164
+ validateProps(rawProps || {}, props, instance.propsOptions[0]);
4061
4165
  }
4062
4166
  if (isStateful) {
4063
4167
  instance.props = isSSR ? props : reactivity.shallowReactive(props);
@@ -4109,11 +4213,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
4109
4213
  const camelizedKey = shared.camelize(key);
4110
4214
  props[camelizedKey] = resolvePropValue(
4111
4215
  options,
4112
- rawCurrentProps,
4113
4216
  camelizedKey,
4114
4217
  value,
4115
4218
  instance,
4116
- false
4219
+ baseResolveDefault
4117
4220
  );
4118
4221
  }
4119
4222
  } else {
@@ -4140,10 +4243,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
4140
4243
  rawPrevProps[kebabKey] !== void 0)) {
4141
4244
  props[key] = resolvePropValue(
4142
4245
  options,
4143
- rawCurrentProps,
4144
4246
  key,
4145
4247
  void 0,
4146
4248
  instance,
4249
+ baseResolveDefault,
4147
4250
  true
4148
4251
  );
4149
4252
  }
@@ -4165,7 +4268,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
4165
4268
  reactivity.trigger(instance.attrs, "set", "");
4166
4269
  }
4167
4270
  {
4168
- validateProps(rawProps || {}, props, instance);
4271
+ validateProps(rawProps || {}, props, instance.propsOptions[0]);
4169
4272
  }
4170
4273
  }
4171
4274
  function setFullProps(instance, rawProps, props, attrs) {
@@ -4194,39 +4297,37 @@ function setFullProps(instance, rawProps, props, attrs) {
4194
4297
  }
4195
4298
  }
4196
4299
  if (needCastKeys) {
4197
- const rawCurrentProps = reactivity.toRaw(props);
4198
4300
  const castValues = rawCastValues || shared.EMPTY_OBJ;
4199
4301
  for (let i = 0; i < needCastKeys.length; i++) {
4200
4302
  const key = needCastKeys[i];
4201
4303
  props[key] = resolvePropValue(
4202
4304
  options,
4203
- rawCurrentProps,
4204
4305
  key,
4205
4306
  castValues[key],
4206
4307
  instance,
4308
+ baseResolveDefault,
4207
4309
  !shared.hasOwn(castValues, key)
4208
4310
  );
4209
4311
  }
4210
4312
  }
4211
4313
  return hasAttrsChanged;
4212
4314
  }
4213
- function resolvePropValue(options, props, key, value, instance, isAbsent) {
4315
+ function resolvePropValue(options, key, value, instance, resolveDefault, isAbsent = false) {
4214
4316
  const opt = options[key];
4215
4317
  if (opt != null) {
4216
4318
  const hasDefault = shared.hasOwn(opt, "default");
4217
4319
  if (hasDefault && value === void 0) {
4218
4320
  const defaultValue = opt.default;
4219
4321
  if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
4220
- const { propsDefaults } = instance;
4221
- if (key in propsDefaults) {
4222
- value = propsDefaults[key];
4322
+ const cachedDefaults = instance.propsDefaults || (instance.propsDefaults = {});
4323
+ if (shared.hasOwn(cachedDefaults, key)) {
4324
+ value = cachedDefaults[key];
4223
4325
  } else {
4224
- const reset = setCurrentInstance(instance);
4225
- value = propsDefaults[key] = defaultValue.call(
4226
- null,
4227
- props
4326
+ value = cachedDefaults[key] = resolveDefault(
4327
+ defaultValue,
4328
+ instance,
4329
+ key
4228
4330
  );
4229
- reset();
4230
4331
  }
4231
4332
  } else {
4232
4333
  value = defaultValue;
@@ -4245,6 +4346,17 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
4245
4346
  }
4246
4347
  return value;
4247
4348
  }
4349
+ function baseResolveDefault(factory, instance, key) {
4350
+ let value;
4351
+ const prev = setCurrentInstance(instance);
4352
+ const props = reactivity.toRaw(instance.props);
4353
+ value = factory.call(
4354
+ null,
4355
+ props
4356
+ );
4357
+ setCurrentInstance(...prev);
4358
+ return value;
4359
+ }
4248
4360
  const mixinPropsCache = /* @__PURE__ */ new WeakMap();
4249
4361
  function normalizePropsOptions(comp, appContext, asMixin = false) {
4250
4362
  const cache = asMixin ? mixinPropsCache : appContext.propsCache;
@@ -4279,6 +4391,14 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
4279
4391
  }
4280
4392
  return shared.EMPTY_ARR;
4281
4393
  }
4394
+ baseNormalizePropsOptions(raw, normalized, needCastKeys);
4395
+ const res = [normalized, needCastKeys];
4396
+ if (shared.isObject(comp)) {
4397
+ cache.set(comp, res);
4398
+ }
4399
+ return res;
4400
+ }
4401
+ function baseNormalizePropsOptions(raw, normalized, needCastKeys) {
4282
4402
  if (shared.isArray(raw)) {
4283
4403
  for (let i = 0; i < raw.length; i++) {
4284
4404
  if (!shared.isString(raw[i])) {
@@ -4323,11 +4443,6 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
4323
4443
  }
4324
4444
  }
4325
4445
  }
4326
- const res = [normalized, needCastKeys];
4327
- if (shared.isObject(comp)) {
4328
- cache.set(comp, res);
4329
- }
4330
- return res;
4331
4446
  }
4332
4447
  function validatePropName(key) {
4333
4448
  if (key[0] !== "$" && !shared.isReservedProp(key)) {
@@ -4349,26 +4464,26 @@ function getType(ctor) {
4349
4464
  }
4350
4465
  return "";
4351
4466
  }
4352
- function validateProps(rawProps, props, instance) {
4353
- const resolvedValues = reactivity.toRaw(props);
4354
- const options = instance.propsOptions[0];
4467
+ function validateProps(rawProps, resolvedProps, options) {
4468
+ resolvedProps = reactivity.toRaw(resolvedProps);
4355
4469
  const camelizePropsKey = Object.keys(rawProps).map((key) => shared.camelize(key));
4356
4470
  for (const key in options) {
4357
- let opt = options[key];
4358
- if (opt == null) continue;
4359
- validateProp(
4360
- key,
4361
- resolvedValues[key],
4362
- opt,
4363
- reactivity.shallowReadonly(resolvedValues) ,
4364
- !camelizePropsKey.includes(key)
4365
- );
4471
+ const opt = options[key];
4472
+ if (opt != null) {
4473
+ validateProp(
4474
+ key,
4475
+ resolvedProps[key],
4476
+ opt,
4477
+ resolvedProps,
4478
+ !camelizePropsKey.includes(key)
4479
+ );
4480
+ }
4366
4481
  }
4367
4482
  }
4368
- function validateProp(name, value, prop, props, isAbsent) {
4369
- const { type, required, validator, skipCheck } = prop;
4483
+ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
4484
+ const { type, required, validator, skipCheck } = propOptions;
4370
4485
  if (required && isAbsent) {
4371
- warn$1('Missing required prop: "' + name + '"');
4486
+ warn$1('Missing required prop: "' + key + '"');
4372
4487
  return;
4373
4488
  }
4374
4489
  if (value == null && !required) {
@@ -4384,12 +4499,12 @@ function validateProp(name, value, prop, props, isAbsent) {
4384
4499
  isValid = valid;
4385
4500
  }
4386
4501
  if (!isValid) {
4387
- warn$1(getInvalidTypeMessage(name, value, expectedTypes));
4502
+ warn$1(getInvalidTypeMessage(key, value, expectedTypes));
4388
4503
  return;
4389
4504
  }
4390
4505
  }
4391
- if (validator && !validator(value, props)) {
4392
- warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
4506
+ if (validator && !validator(value, reactivity.shallowReadonly(resolvedProps) )) {
4507
+ warn$1('Invalid prop: custom validator check failed for prop "' + key + '".');
4393
4508
  }
4394
4509
  }
4395
4510
  const isSimpleType = /* @__PURE__ */ shared.makeMap(
@@ -4460,7 +4575,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
4460
4575
  return rawSlot;
4461
4576
  }
4462
4577
  const normalized = withCtx((...args) => {
4463
- if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
4578
+ if (currentInstance && !currentInstance.vapor && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
4464
4579
  warn$1(
4465
4580
  `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
4466
4581
  );
@@ -4507,6 +4622,8 @@ const assignSlots = (slots, children, optimized) => {
4507
4622
  const initSlots = (instance, children, optimized) => {
4508
4623
  const slots = instance.slots = createInternalObject();
4509
4624
  if (instance.vnode.shapeFlag & 32) {
4625
+ const cacheIndexes = children.__;
4626
+ if (cacheIndexes) shared.def(slots, "__", cacheIndexes, true);
4510
4627
  const type = children._;
4511
4628
  if (type) {
4512
4629
  assignSlots(slots, children, optimized);
@@ -4555,12 +4672,15 @@ const updateSlots = (instance, children, optimized) => {
4555
4672
 
4556
4673
  let supported;
4557
4674
  let perf;
4675
+ let cachedNow = 0;
4676
+ const p = /* @__PURE__ */ Promise.resolve();
4677
+ const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = isSupported() ? perf.now() : Date.now());
4558
4678
  function startMeasure(instance, type) {
4559
4679
  if (instance.appContext.config.performance && isSupported()) {
4560
4680
  perf.mark(`vue-${type}-${instance.uid}`);
4561
4681
  }
4562
4682
  {
4563
- devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
4683
+ devtoolsPerfStart(instance, type, getNow());
4564
4684
  }
4565
4685
  }
4566
4686
  function endMeasure(instance, type) {
@@ -4577,7 +4697,7 @@ function endMeasure(instance, type) {
4577
4697
  perf.clearMarks(endTag);
4578
4698
  }
4579
4699
  {
4580
- devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
4700
+ devtoolsPerfEnd(instance, type, getNow());
4581
4701
  }
4582
4702
  }
4583
4703
  function isSupported() {
@@ -4661,6 +4781,9 @@ function baseCreateRenderer(options, createHydrationFns) {
4661
4781
  optimized
4662
4782
  );
4663
4783
  break;
4784
+ case VaporSlot:
4785
+ getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
4786
+ break;
4664
4787
  default:
4665
4788
  if (shapeFlag & 1) {
4666
4789
  processElement(
@@ -4718,6 +4841,8 @@ function baseCreateRenderer(options, createHydrationFns) {
4718
4841
  }
4719
4842
  if (ref != null && parentComponent) {
4720
4843
  setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
4844
+ } else if (ref == null && n1 && n1.ref != null) {
4845
+ setRef(n1.ref, null, parentSuspense, n1, true);
4721
4846
  }
4722
4847
  };
4723
4848
  const processText = (n1, n2, container, anchor) => {
@@ -4871,11 +4996,15 @@ function baseCreateRenderer(options, createHydrationFns) {
4871
4996
  }
4872
4997
  hostInsert(el, container, anchor);
4873
4998
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
4874
- queuePostRenderEffect(() => {
4875
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
4876
- needCallTransitionHooks && transition.enter(el);
4877
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
4878
- }, parentSuspense);
4999
+ queuePostRenderEffect(
5000
+ () => {
5001
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
5002
+ needCallTransitionHooks && transition.enter(el);
5003
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
5004
+ },
5005
+ void 0,
5006
+ parentSuspense
5007
+ );
4879
5008
  }
4880
5009
  };
4881
5010
  const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
@@ -4887,8 +5016,8 @@ function baseCreateRenderer(options, createHydrationFns) {
4887
5016
  hostSetScopeId(el, slotScopeIds[i]);
4888
5017
  }
4889
5018
  }
4890
- if (parentComponent) {
4891
- let subTree = parentComponent.subTree;
5019
+ let subTree = parentComponent && parentComponent.subTree;
5020
+ if (subTree) {
4892
5021
  if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
4893
5022
  subTree = filterSingleRoot(subTree.children) || subTree;
4894
5023
  }
@@ -5005,10 +5134,14 @@ function baseCreateRenderer(options, createHydrationFns) {
5005
5134
  patchProps(el, oldProps, newProps, parentComponent, namespace);
5006
5135
  }
5007
5136
  if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
5008
- queuePostRenderEffect(() => {
5009
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
5010
- dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
5011
- }, parentSuspense);
5137
+ queuePostRenderEffect(
5138
+ () => {
5139
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
5140
+ dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
5141
+ },
5142
+ void 0,
5143
+ parentSuspense
5144
+ );
5012
5145
  }
5013
5146
  };
5014
5147
  const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
@@ -5136,7 +5269,22 @@ function baseCreateRenderer(options, createHydrationFns) {
5136
5269
  };
5137
5270
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
5138
5271
  n2.slotScopeIds = slotScopeIds;
5139
- if (n1 == null) {
5272
+ if (n2.type.__vapor) {
5273
+ if (n1 == null) {
5274
+ getVaporInterface(parentComponent, n2).mount(
5275
+ n2,
5276
+ container,
5277
+ anchor,
5278
+ parentComponent
5279
+ );
5280
+ } else {
5281
+ getVaporInterface(parentComponent, n2).update(
5282
+ n1,
5283
+ n2,
5284
+ shouldUpdateComponent(n1, n2, optimized)
5285
+ );
5286
+ }
5287
+ } else if (n1 == null) {
5140
5288
  if (n2.shapeFlag & 512) {
5141
5289
  parentComponent.ctx.activate(
5142
5290
  n2,
@@ -5222,15 +5370,52 @@ function baseCreateRenderer(options, createHydrationFns) {
5222
5370
  return;
5223
5371
  } else {
5224
5372
  instance.next = n2;
5225
- instance.update();
5373
+ instance.effect.run();
5226
5374
  }
5227
5375
  } else {
5228
5376
  n2.el = n1.el;
5229
5377
  instance.vnode = n2;
5230
5378
  }
5231
5379
  };
5232
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
5233
- const componentUpdateFn = () => {
5380
+ class SetupRenderEffect extends reactivity.ReactiveEffect {
5381
+ constructor(instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) {
5382
+ const prevScope = reactivity.setCurrentScope(instance.scope);
5383
+ super();
5384
+ this.instance = instance;
5385
+ this.initialVNode = initialVNode;
5386
+ this.container = container;
5387
+ this.anchor = anchor;
5388
+ this.parentSuspense = parentSuspense;
5389
+ this.namespace = namespace;
5390
+ this.optimized = optimized;
5391
+ reactivity.setCurrentScope(prevScope);
5392
+ this.job = instance.job = () => {
5393
+ if (this.dirty) {
5394
+ this.run();
5395
+ }
5396
+ };
5397
+ this.job.i = instance;
5398
+ {
5399
+ this.onTrack = instance.rtc ? (e) => shared.invokeArrayFns(instance.rtc, e) : void 0;
5400
+ this.onTrigger = instance.rtg ? (e) => shared.invokeArrayFns(instance.rtg, e) : void 0;
5401
+ }
5402
+ }
5403
+ notify() {
5404
+ if (!(this.flags & 256)) {
5405
+ const job = this.job;
5406
+ queueJob(job, job.i.uid);
5407
+ }
5408
+ }
5409
+ fn() {
5410
+ const {
5411
+ instance,
5412
+ initialVNode,
5413
+ container,
5414
+ anchor,
5415
+ parentSuspense,
5416
+ namespace,
5417
+ optimized
5418
+ } = this;
5234
5419
  if (!instance.isMounted) {
5235
5420
  let vnodeHook;
5236
5421
  const { el, props } = initialVNode;
@@ -5277,7 +5462,8 @@ function baseCreateRenderer(options, createHydrationFns) {
5277
5462
  hydrateSubTree();
5278
5463
  }
5279
5464
  } else {
5280
- if (root.ce) {
5465
+ if (root.ce && // @ts-expect-error _def is private
5466
+ root.ce._def.shadowRoot !== false) {
5281
5467
  root.ce._injectChildStyle(type);
5282
5468
  }
5283
5469
  {
@@ -5305,23 +5491,24 @@ function baseCreateRenderer(options, createHydrationFns) {
5305
5491
  initialVNode.el = subTree.el;
5306
5492
  }
5307
5493
  if (m) {
5308
- queuePostRenderEffect(m, parentSuspense);
5494
+ queuePostRenderEffect(m, void 0, parentSuspense);
5309
5495
  }
5310
5496
  if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
5311
5497
  const scopedInitialVNode = initialVNode;
5312
5498
  queuePostRenderEffect(
5313
5499
  () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
5500
+ void 0,
5314
5501
  parentSuspense
5315
5502
  );
5316
5503
  }
5317
- if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
5318
- instance.a && queuePostRenderEffect(instance.a, parentSuspense);
5504
+ if (initialVNode.shapeFlag & 256 || parent && parent.vnode && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
5505
+ instance.a && queuePostRenderEffect(instance.a, void 0, parentSuspense);
5319
5506
  }
5320
5507
  instance.isMounted = true;
5321
5508
  {
5322
5509
  devtoolsComponentAdded(instance);
5323
5510
  }
5324
- initialVNode = container = anchor = null;
5511
+ this.initialVNode = this.container = this.anchor = null;
5325
5512
  } else {
5326
5513
  let { next, bu, u, parent, vnode } = instance;
5327
5514
  {
@@ -5333,7 +5520,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5333
5520
  }
5334
5521
  nonHydratedAsyncRoot.asyncDep.then(() => {
5335
5522
  if (!instance.isUnmounted) {
5336
- componentUpdateFn();
5523
+ this.fn();
5337
5524
  }
5338
5525
  });
5339
5526
  return;
@@ -5389,11 +5576,12 @@ function baseCreateRenderer(options, createHydrationFns) {
5389
5576
  updateHOCHostEl(instance, nextTree.el);
5390
5577
  }
5391
5578
  if (u) {
5392
- queuePostRenderEffect(u, parentSuspense);
5579
+ queuePostRenderEffect(u, void 0, parentSuspense);
5393
5580
  }
5394
5581
  if (vnodeHook = next.props && next.props.onVnodeUpdated) {
5395
5582
  queuePostRenderEffect(
5396
5583
  () => invokeVNodeHook(vnodeHook, parent, next, vnode),
5584
+ void 0,
5397
5585
  parentSuspense
5398
5586
  );
5399
5587
  }
@@ -5404,21 +5592,21 @@ function baseCreateRenderer(options, createHydrationFns) {
5404
5592
  popWarningContext();
5405
5593
  }
5406
5594
  }
5407
- };
5408
- instance.scope.on();
5409
- const effect = instance.effect = new reactivity.ReactiveEffect(componentUpdateFn);
5410
- instance.scope.off();
5411
- const update = instance.update = effect.run.bind(effect);
5412
- const job = instance.job = effect.runIfDirty.bind(effect);
5413
- job.i = instance;
5414
- job.id = instance.uid;
5415
- effect.scheduler = () => queueJob(job);
5416
- toggleRecurse(instance, true);
5417
- {
5418
- effect.onTrack = instance.rtc ? (e) => shared.invokeArrayFns(instance.rtc, e) : void 0;
5419
- effect.onTrigger = instance.rtg ? (e) => shared.invokeArrayFns(instance.rtg, e) : void 0;
5420
5595
  }
5421
- update();
5596
+ }
5597
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
5598
+ const effect = instance.effect = new SetupRenderEffect(
5599
+ instance,
5600
+ initialVNode,
5601
+ container,
5602
+ anchor,
5603
+ parentSuspense,
5604
+ namespace,
5605
+ optimized
5606
+ );
5607
+ instance.update = effect.run.bind(effect);
5608
+ toggleRecurse(instance, true);
5609
+ effect.run();
5422
5610
  };
5423
5611
  const updateComponentPreRender = (instance, nextVNode, optimized) => {
5424
5612
  nextVNode.component = instance;
@@ -5427,9 +5615,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5427
5615
  instance.next = null;
5428
5616
  updateProps(instance, nextVNode.props, prevProps, optimized);
5429
5617
  updateSlots(instance, nextVNode.children, optimized);
5430
- reactivity.pauseTracking();
5618
+ const prevSub = reactivity.setActiveSub();
5431
5619
  flushPreFlushCbs(instance);
5432
- reactivity.resetTracking();
5620
+ reactivity.setActiveSub(prevSub);
5433
5621
  };
5434
5622
  const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
5435
5623
  const c1 = n1 && n1.children;
@@ -5686,7 +5874,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5686
5874
  patched++;
5687
5875
  }
5688
5876
  }
5689
- const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR;
5877
+ const increasingNewIndexSequence = moved ? shared.getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR;
5690
5878
  j = increasingNewIndexSequence.length - 1;
5691
5879
  for (i = toBePatched - 1; i >= 0; i--) {
5692
5880
  const nextIndex = s2 + i;
@@ -5706,7 +5894,13 @@ function baseCreateRenderer(options, createHydrationFns) {
5706
5894
  );
5707
5895
  } else if (moved) {
5708
5896
  if (j < 0 || i !== increasingNewIndexSequence[j]) {
5709
- move(nextChild, container, anchor, 2);
5897
+ move(
5898
+ nextChild,
5899
+ container,
5900
+ anchor,
5901
+ 2,
5902
+ parentComponent
5903
+ );
5710
5904
  } else {
5711
5905
  j--;
5712
5906
  }
@@ -5714,10 +5908,20 @@ function baseCreateRenderer(options, createHydrationFns) {
5714
5908
  }
5715
5909
  }
5716
5910
  };
5717
- const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
5911
+ const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
5718
5912
  const { el, type, transition, children, shapeFlag } = vnode;
5719
5913
  if (shapeFlag & 6) {
5720
- move(vnode.component.subTree, container, anchor, moveType);
5914
+ if (type.__vapor) {
5915
+ getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
5916
+ } else {
5917
+ move(
5918
+ vnode.component.subTree,
5919
+ container,
5920
+ anchor,
5921
+ moveType,
5922
+ parentComponent
5923
+ );
5924
+ }
5721
5925
  return;
5722
5926
  }
5723
5927
  if (shapeFlag & 128) {
@@ -5725,13 +5929,25 @@ function baseCreateRenderer(options, createHydrationFns) {
5725
5929
  return;
5726
5930
  }
5727
5931
  if (shapeFlag & 64) {
5728
- type.move(vnode, container, anchor, internals);
5932
+ type.move(
5933
+ vnode,
5934
+ container,
5935
+ anchor,
5936
+ internals,
5937
+ parentComponent
5938
+ );
5729
5939
  return;
5730
5940
  }
5731
5941
  if (type === Fragment) {
5732
5942
  hostInsert(el, container, anchor);
5733
5943
  for (let i = 0; i < children.length; i++) {
5734
- move(children[i], container, anchor, moveType);
5944
+ move(
5945
+ children[i],
5946
+ container,
5947
+ anchor,
5948
+ moveType,
5949
+ parentComponent
5950
+ );
5735
5951
  }
5736
5952
  hostInsert(vnode.anchor, container, anchor);
5737
5953
  return;
@@ -5745,7 +5961,11 @@ function baseCreateRenderer(options, createHydrationFns) {
5745
5961
  if (moveType === 0) {
5746
5962
  transition.beforeEnter(el);
5747
5963
  hostInsert(el, container, anchor);
5748
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
5964
+ queuePostRenderEffect(
5965
+ () => transition.enter(el),
5966
+ void 0,
5967
+ parentSuspense
5968
+ );
5749
5969
  } else {
5750
5970
  const { leave, delayLeave, afterLeave } = transition;
5751
5971
  const remove2 = () => {
@@ -5787,9 +6007,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5787
6007
  optimized = false;
5788
6008
  }
5789
6009
  if (ref != null) {
5790
- reactivity.pauseTracking();
6010
+ const prevSub = reactivity.setActiveSub();
5791
6011
  setRef(ref, null, parentSuspense, vnode, true);
5792
- reactivity.resetTracking();
6012
+ reactivity.setActiveSub(prevSub);
5793
6013
  }
5794
6014
  if (cacheIndex != null) {
5795
6015
  parentComponent.renderCache[cacheIndex] = void 0;
@@ -5805,7 +6025,12 @@ function baseCreateRenderer(options, createHydrationFns) {
5805
6025
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
5806
6026
  }
5807
6027
  if (shapeFlag & 6) {
5808
- unmountComponent(vnode.component, parentSuspense, doRemove);
6028
+ if (type.__vapor) {
6029
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
6030
+ return;
6031
+ } else {
6032
+ unmountComponent(vnode.component, parentSuspense, doRemove);
6033
+ }
5809
6034
  } else {
5810
6035
  if (shapeFlag & 128) {
5811
6036
  vnode.suspense.unmount(parentSuspense, doRemove);
@@ -5839,15 +6064,23 @@ function baseCreateRenderer(options, createHydrationFns) {
5839
6064
  } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
5840
6065
  unmountChildren(children, parentComponent, parentSuspense);
5841
6066
  }
6067
+ if (type === VaporSlot) {
6068
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
6069
+ return;
6070
+ }
5842
6071
  if (doRemove) {
5843
6072
  remove(vnode);
5844
6073
  }
5845
6074
  }
5846
6075
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
5847
- queuePostRenderEffect(() => {
5848
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
5849
- shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
5850
- }, parentSuspense);
6076
+ queuePostRenderEffect(
6077
+ () => {
6078
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
6079
+ shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
6080
+ },
6081
+ void 0,
6082
+ parentSuspense
6083
+ );
5851
6084
  }
5852
6085
  };
5853
6086
  const remove = (vnode) => {
@@ -5904,7 +6137,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5904
6137
  const {
5905
6138
  bum,
5906
6139
  scope,
5907
- job,
6140
+ effect,
5908
6141
  subTree,
5909
6142
  um,
5910
6143
  m,
@@ -5923,16 +6156,18 @@ function baseCreateRenderer(options, createHydrationFns) {
5923
6156
  });
5924
6157
  }
5925
6158
  scope.stop();
5926
- if (job) {
5927
- job.flags |= 8;
6159
+ if (effect) {
6160
+ effect.stop();
5928
6161
  unmount(subTree, instance, parentSuspense, doRemove);
5929
6162
  }
5930
6163
  if (um) {
5931
- queuePostRenderEffect(um, parentSuspense);
6164
+ queuePostRenderEffect(um, void 0, parentSuspense);
5932
6165
  }
5933
- queuePostRenderEffect(() => {
5934
- instance.isUnmounted = true;
5935
- }, parentSuspense);
6166
+ queuePostRenderEffect(
6167
+ () => instance.isUnmounted = true,
6168
+ void 0,
6169
+ parentSuspense
6170
+ );
5936
6171
  if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
5937
6172
  parentSuspense.deps--;
5938
6173
  if (parentSuspense.deps === 0) {
@@ -5950,6 +6185,9 @@ function baseCreateRenderer(options, createHydrationFns) {
5950
6185
  };
5951
6186
  const getNextHostNode = (vnode) => {
5952
6187
  if (vnode.shapeFlag & 6) {
6188
+ if (vnode.type.__vapor) {
6189
+ return hostNextSibling(vnode.component.block);
6190
+ }
5953
6191
  return getNextHostNode(vnode.component.subTree);
5954
6192
  }
5955
6193
  if (vnode.shapeFlag & 128) {
@@ -5959,7 +6197,6 @@ function baseCreateRenderer(options, createHydrationFns) {
5959
6197
  const teleportEnd = el && el[TeleportEndKey];
5960
6198
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
5961
6199
  };
5962
- let isFlushing = false;
5963
6200
  const render = (vnode, container, namespace) => {
5964
6201
  if (vnode == null) {
5965
6202
  if (container._vnode) {
@@ -5977,12 +6214,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5977
6214
  );
5978
6215
  }
5979
6216
  container._vnode = vnode;
5980
- if (!isFlushing) {
5981
- isFlushing = true;
5982
- flushPreFlushCbs();
5983
- flushPostFlushCbs();
5984
- isFlushing = false;
5985
- }
6217
+ flushOnAppMount();
5986
6218
  };
5987
6219
  const internals = {
5988
6220
  p: patch,
@@ -5990,6 +6222,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5990
6222
  m: move,
5991
6223
  r: remove,
5992
6224
  mt: mountComponent,
6225
+ umt: unmountComponent,
5993
6226
  mc: mountChildren,
5994
6227
  pc: patchChildren,
5995
6228
  pbc: patchBlockChildren,
@@ -6003,22 +6236,53 @@ function baseCreateRenderer(options, createHydrationFns) {
6003
6236
  internals
6004
6237
  );
6005
6238
  }
6239
+ const mountApp = (app, container, isHydrate, namespace) => {
6240
+ const vnode = app._ceVNode || createVNode(app._component, app._props);
6241
+ vnode.appContext = app._context;
6242
+ if (namespace === true) {
6243
+ namespace = "svg";
6244
+ } else if (namespace === false) {
6245
+ namespace = void 0;
6246
+ }
6247
+ {
6248
+ app._context.reload = () => {
6249
+ const cloned = cloneVNode(vnode);
6250
+ cloned.el = null;
6251
+ render(cloned, container, namespace);
6252
+ };
6253
+ }
6254
+ if (isHydrate && hydrate) {
6255
+ hydrate(vnode, container);
6256
+ } else {
6257
+ render(vnode, container, namespace);
6258
+ }
6259
+ return vnode.component;
6260
+ };
6261
+ const unmountApp = (app) => {
6262
+ render(null, app._container);
6263
+ };
6006
6264
  return {
6007
6265
  render,
6008
6266
  hydrate,
6009
- createApp: createAppAPI(render, hydrate)
6267
+ internals,
6268
+ createApp: createAppAPI(
6269
+ mountApp,
6270
+ unmountApp,
6271
+ getComponentPublicInstance)
6010
6272
  };
6011
6273
  }
6012
6274
  function resolveChildrenNamespace({ type, props }, currentNamespace) {
6013
6275
  return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
6014
6276
  }
6015
- function toggleRecurse({ effect, job }, allowed) {
6016
- if (allowed) {
6017
- effect.flags |= 32;
6018
- job.flags |= 4;
6019
- } else {
6020
- effect.flags &= -33;
6021
- job.flags &= -5;
6277
+ function toggleRecurse({ effect, job, vapor }, allowed) {
6278
+ if (!vapor) {
6279
+ if (allowed) {
6280
+ effect.flags |= 128;
6281
+ job.flags |= 2;
6282
+ } else {
6283
+ effect.flags &= -129;
6284
+ job.flags &= -3;
6285
+ }
6022
6286
  }
6023
6287
  }
6024
6288
  function needTransition(parentSuspense, transition) {
@@ -6051,46 +6315,6 @@ function traverseStaticChildren(n1, n2, shallow = false) {
6051
6315
  }
6052
6316
  }
6053
6317
  }
6054
- function getSequence(arr) {
6055
- const p = arr.slice();
6056
- const result = [0];
6057
- let i, j, u, v, c;
6058
- const len = arr.length;
6059
- for (i = 0; i < len; i++) {
6060
- const arrI = arr[i];
6061
- if (arrI !== 0) {
6062
- j = result[result.length - 1];
6063
- if (arr[j] < arrI) {
6064
- p[i] = j;
6065
- result.push(i);
6066
- continue;
6067
- }
6068
- u = 0;
6069
- v = result.length - 1;
6070
- while (u < v) {
6071
- c = u + v >> 1;
6072
- if (arr[result[c]] < arrI) {
6073
- u = c + 1;
6074
- } else {
6075
- v = c;
6076
- }
6077
- }
6078
- if (arrI < arr[result[u]]) {
6079
- if (u > 0) {
6080
- p[i] = result[u - 1];
6081
- }
6082
- result[u] = i;
6083
- }
6084
- }
6085
- }
6086
- u = result.length;
6087
- v = result[u - 1];
6088
- while (u-- > 0) {
6089
- result[u] = v;
6090
- v = p[v];
6091
- }
6092
- return result;
6093
- }
6094
6318
  function locateNonHydratedAsyncRoot(instance) {
6095
6319
  const subComponent = instance.subTree.component;
6096
6320
  if (subComponent) {
@@ -6104,9 +6328,23 @@ function locateNonHydratedAsyncRoot(instance) {
6104
6328
  function invalidateMount(hooks) {
6105
6329
  if (hooks) {
6106
6330
  for (let i = 0; i < hooks.length; i++)
6107
- hooks[i].flags |= 8;
6331
+ hooks[i].flags |= 4;
6108
6332
  }
6109
6333
  }
6334
+ function getVaporInterface(instance, vnode) {
6335
+ const ctx = instance ? instance.appContext : vnode.appContext;
6336
+ const res = ctx && ctx.vapor;
6337
+ if (!res) {
6338
+ warn$1(
6339
+ `Vapor component found in vdom tree but vapor-in-vdom interop was not installed. Make sure to install it:
6340
+ \`\`\`
6341
+ import { vaporInteropPlugin } from 'vue'
6342
+ app.use(vaporInteropPlugin)
6343
+ \`\`\``
6344
+ );
6345
+ }
6346
+ return res;
6347
+ }
6110
6348
 
6111
6349
  const ssrContextKey = Symbol.for("v-scx");
6112
6350
  const useSSRContext = () => {
@@ -6146,8 +6384,41 @@ function watch(source, cb, options) {
6146
6384
  }
6147
6385
  return doWatch(source, cb, options);
6148
6386
  }
6387
+ class RenderWatcherEffect extends reactivity.WatcherEffect {
6388
+ constructor(instance, source, cb, options, flush) {
6389
+ super(source, cb, options);
6390
+ this.flush = flush;
6391
+ const job = () => {
6392
+ if (this.dirty) {
6393
+ this.run();
6394
+ }
6395
+ };
6396
+ if (cb) {
6397
+ this.flags |= 128;
6398
+ job.flags |= 2;
6399
+ }
6400
+ if (instance) {
6401
+ job.i = instance;
6402
+ }
6403
+ this.job = job;
6404
+ }
6405
+ notify() {
6406
+ const flags = this.flags;
6407
+ if (!(flags & 256)) {
6408
+ const flush = this.flush;
6409
+ const job = this.job;
6410
+ if (flush === "post") {
6411
+ queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
6412
+ } else if (flush === "pre") {
6413
+ queueJob(job, job.i ? job.i.uid : void 0, true);
6414
+ } else {
6415
+ job();
6416
+ }
6417
+ }
6418
+ }
6419
+ }
6149
6420
  function doWatch(source, cb, options = shared.EMPTY_OBJ) {
6150
- const { immediate, deep, flush, once } = options;
6421
+ const { immediate, deep, flush = "pre", once } = options;
6151
6422
  if (!cb) {
6152
6423
  if (immediate !== void 0) {
6153
6424
  warn$1(
@@ -6184,42 +6455,32 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
6184
6455
  }
6185
6456
  const instance = currentInstance;
6186
6457
  baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
6187
- let isPre = false;
6188
- if (flush === "post") {
6189
- baseWatchOptions.scheduler = (job) => {
6190
- queuePostRenderEffect(job, instance && instance.suspense);
6191
- };
6192
- } else if (flush !== "sync") {
6193
- isPre = true;
6194
- baseWatchOptions.scheduler = (job, isFirstRun) => {
6195
- if (isFirstRun) {
6196
- job();
6197
- } else {
6198
- queueJob(job);
6199
- }
6200
- };
6458
+ const effect = new RenderWatcherEffect(
6459
+ instance,
6460
+ source,
6461
+ cb,
6462
+ baseWatchOptions,
6463
+ flush
6464
+ );
6465
+ if (cb) {
6466
+ effect.run(true);
6467
+ } else if (flush === "post") {
6468
+ queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
6469
+ } else {
6470
+ effect.run(true);
6201
6471
  }
6202
- baseWatchOptions.augmentJob = (job) => {
6203
- if (cb) {
6204
- job.flags |= 4;
6205
- }
6206
- if (isPre) {
6207
- job.flags |= 2;
6208
- if (instance) {
6209
- job.id = instance.uid;
6210
- job.i = instance;
6211
- }
6212
- }
6213
- };
6214
- const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
6472
+ const stop = effect.stop.bind(effect);
6473
+ stop.pause = effect.pause.bind(effect);
6474
+ stop.resume = effect.resume.bind(effect);
6475
+ stop.stop = stop;
6215
6476
  if (isInSSRComponentSetup) {
6216
6477
  if (ssrCleanup) {
6217
- ssrCleanup.push(watchHandle);
6478
+ ssrCleanup.push(stop);
6218
6479
  } else if (runsImmediately) {
6219
- watchHandle();
6480
+ stop();
6220
6481
  }
6221
6482
  }
6222
- return watchHandle;
6483
+ return stop;
6223
6484
  }
6224
6485
  function instanceWatch(source, value, options) {
6225
6486
  const publicThis = this.proxy;
@@ -6231,9 +6492,9 @@ function instanceWatch(source, value, options) {
6231
6492
  cb = value.handler;
6232
6493
  options = value;
6233
6494
  }
6234
- const reset = setCurrentInstance(this);
6495
+ const prev = setCurrentInstance(this);
6235
6496
  const res = doWatch(getter, cb.bind(publicThis), options);
6236
- reset();
6497
+ setCurrentInstance(...prev);
6237
6498
  return res;
6238
6499
  }
6239
6500
  function createPathGetter(ctx, path) {
@@ -6248,7 +6509,7 @@ function createPathGetter(ctx, path) {
6248
6509
  }
6249
6510
 
6250
6511
  function useModel(props, name, options = shared.EMPTY_OBJ) {
6251
- const i = getCurrentInstance();
6512
+ const i = getCurrentGenericInstance();
6252
6513
  if (!i) {
6253
6514
  warn$1(`useModel() called without active instance.`);
6254
6515
  return reactivity.ref();
@@ -6259,7 +6520,7 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
6259
6520
  return reactivity.ref();
6260
6521
  }
6261
6522
  const hyphenatedName = shared.hyphenate(name);
6262
- const modifiers = getModelModifiers(props, camelizedName);
6523
+ const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
6263
6524
  const res = reactivity.customRef((track, trigger) => {
6264
6525
  let localValue;
6265
6526
  let prevSetValue = shared.EMPTY_OBJ;
@@ -6281,9 +6542,25 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
6281
6542
  if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
6282
6543
  return;
6283
6544
  }
6284
- const rawProps = i.vnode.props;
6285
- if (!(rawProps && // check if parent has passed v-model
6286
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
6545
+ let rawPropKeys;
6546
+ let parentPassedModelValue = false;
6547
+ let parentPassedModelUpdater = false;
6548
+ if (i.rawKeys) {
6549
+ rawPropKeys = i.rawKeys();
6550
+ } else {
6551
+ const rawProps = i.vnode.props;
6552
+ rawPropKeys = rawProps && Object.keys(rawProps);
6553
+ }
6554
+ if (rawPropKeys) {
6555
+ for (const key of rawPropKeys) {
6556
+ if (key === name || key === camelizedName || key === hyphenatedName) {
6557
+ parentPassedModelValue = true;
6558
+ } else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) {
6559
+ parentPassedModelUpdater = true;
6560
+ }
6561
+ }
6562
+ }
6563
+ if (!parentPassedModelValue || !parentPassedModelUpdater) {
6287
6564
  localValue = value;
6288
6565
  trigger();
6289
6566
  }
@@ -6310,21 +6587,26 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
6310
6587
  };
6311
6588
  return res;
6312
6589
  }
6313
- const getModelModifiers = (props, modelName) => {
6314
- return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${shared.camelize(modelName)}Modifiers`] || props[`${shared.hyphenate(modelName)}Modifiers`];
6590
+ const getModelModifiers = (props, modelName, getter) => {
6591
+ return modelName === "modelValue" || modelName === "model-value" ? getter(props, "modelModifiers") : getter(props, `${modelName}Modifiers`) || getter(props, `${shared.camelize(modelName)}Modifiers`) || getter(props, `${shared.hyphenate(modelName)}Modifiers`);
6315
6592
  };
6316
6593
 
6317
6594
  function emit(instance, event, ...rawArgs) {
6595
+ return baseEmit(
6596
+ instance,
6597
+ instance.vnode.props || shared.EMPTY_OBJ,
6598
+ defaultPropGetter,
6599
+ event,
6600
+ ...rawArgs
6601
+ );
6602
+ }
6603
+ function baseEmit(instance, props, getter, event, ...rawArgs) {
6318
6604
  if (instance.isUnmounted) return;
6319
- const props = instance.vnode.props || shared.EMPTY_OBJ;
6320
6605
  {
6321
- const {
6322
- emitsOptions,
6323
- propsOptions: [propsOptions]
6324
- } = instance;
6606
+ const { emitsOptions, propsOptions } = instance;
6325
6607
  if (emitsOptions) {
6326
6608
  if (!(event in emitsOptions) && true) {
6327
- if (!propsOptions || !(shared.toHandlerKey(shared.camelize(event)) in propsOptions)) {
6609
+ if (!propsOptions || !propsOptions[0] || !(shared.toHandlerKey(shared.camelize(event)) in propsOptions[0])) {
6328
6610
  warn$1(
6329
6611
  `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${shared.toHandlerKey(shared.camelize(event))}" prop.`
6330
6612
  );
@@ -6344,7 +6626,7 @@ function emit(instance, event, ...rawArgs) {
6344
6626
  }
6345
6627
  let args = rawArgs;
6346
6628
  const isModelListener = event.startsWith("update:");
6347
- const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
6629
+ const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
6348
6630
  if (modifiers) {
6349
6631
  if (modifiers.trim) {
6350
6632
  args = rawArgs.map((a) => shared.isString(a) ? a.trim() : a);
@@ -6358,7 +6640,7 @@ function emit(instance, event, ...rawArgs) {
6358
6640
  }
6359
6641
  {
6360
6642
  const lowerCaseEvent = event.toLowerCase();
6361
- if (lowerCaseEvent !== event && props[shared.toHandlerKey(lowerCaseEvent)]) {
6643
+ if (lowerCaseEvent !== event && getter(props, shared.toHandlerKey(lowerCaseEvent))) {
6362
6644
  warn$1(
6363
6645
  `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
6364
6646
  instance,
@@ -6370,10 +6652,10 @@ function emit(instance, event, ...rawArgs) {
6370
6652
  }
6371
6653
  }
6372
6654
  let handlerName;
6373
- let handler = props[handlerName = shared.toHandlerKey(event)] || // also try camelCase event handler (#2249)
6374
- props[handlerName = shared.toHandlerKey(shared.camelize(event))];
6655
+ let handler = getter(props, handlerName = shared.toHandlerKey(event)) || // also try camelCase event handler (#2249)
6656
+ getter(props, handlerName = shared.toHandlerKey(shared.camelize(event)));
6375
6657
  if (!handler && isModelListener) {
6376
- handler = props[handlerName = shared.toHandlerKey(shared.hyphenate(event))];
6658
+ handler = getter(props, handlerName = shared.toHandlerKey(shared.hyphenate(event)));
6377
6659
  }
6378
6660
  if (handler) {
6379
6661
  callWithAsyncErrorHandling(
@@ -6383,7 +6665,7 @@ function emit(instance, event, ...rawArgs) {
6383
6665
  args
6384
6666
  );
6385
6667
  }
6386
- const onceHandler = props[handlerName + `Once`];
6668
+ const onceHandler = getter(props, handlerName + `Once`);
6387
6669
  if (onceHandler) {
6388
6670
  if (!instance.emitted) {
6389
6671
  instance.emitted = {};
@@ -6399,6 +6681,9 @@ function emit(instance, event, ...rawArgs) {
6399
6681
  );
6400
6682
  }
6401
6683
  }
6684
+ function defaultPropGetter(props, key) {
6685
+ return props[key];
6686
+ }
6402
6687
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
6403
6688
  const cache = appContext.emitsCache;
6404
6689
  const cached = cache.get(comp);
@@ -6726,7 +7011,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
6726
7011
  return false;
6727
7012
  }
6728
7013
  function updateHOCHostEl({ vnode, parent }, el) {
6729
- while (parent) {
7014
+ while (parent && !parent.vapor) {
6730
7015
  const root = parent.subTree;
6731
7016
  if (root.suspense && root.suspense.activeBranch === vnode) {
6732
7017
  root.el = vnode.el;
@@ -7077,7 +7362,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7077
7362
  pendingBranch,
7078
7363
  container2,
7079
7364
  anchor === initialAnchor ? next(activeBranch) : anchor,
7080
- 0
7365
+ 0,
7366
+ parentComponent2
7081
7367
  );
7082
7368
  queuePostFlushCb(effects);
7083
7369
  }
@@ -7090,7 +7376,13 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7090
7376
  unmount(activeBranch, parentComponent2, suspense, true);
7091
7377
  }
7092
7378
  if (!delayEnter) {
7093
- move(pendingBranch, container2, anchor, 0);
7379
+ move(
7380
+ pendingBranch,
7381
+ container2,
7382
+ anchor,
7383
+ 0,
7384
+ parentComponent2
7385
+ );
7094
7386
  }
7095
7387
  }
7096
7388
  setActiveBranch(suspense, pendingBranch);
@@ -7163,7 +7455,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
7163
7455
  }
7164
7456
  },
7165
7457
  move(container2, anchor2, type) {
7166
- suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
7458
+ suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type, parentComponent);
7167
7459
  suspense.container = container2;
7168
7460
  },
7169
7461
  next() {
@@ -7303,7 +7595,7 @@ function normalizeSuspenseSlot(s) {
7303
7595
  }
7304
7596
  return s;
7305
7597
  }
7306
- function queueEffectWithSuspense(fn, suspense) {
7598
+ function queueEffectWithSuspense(fn, id, suspense) {
7307
7599
  if (suspense && suspense.pendingBranch) {
7308
7600
  if (shared.isArray(fn)) {
7309
7601
  suspense.effects.push(...fn);
@@ -7311,7 +7603,7 @@ function queueEffectWithSuspense(fn, suspense) {
7311
7603
  suspense.effects.push(fn);
7312
7604
  }
7313
7605
  } else {
7314
- queuePostFlushCb(fn);
7606
+ queuePostFlushCb(fn, id);
7315
7607
  }
7316
7608
  }
7317
7609
  function setActiveBranch(suspense, branch) {
@@ -7337,6 +7629,7 @@ const Fragment = Symbol.for("v-fgt");
7337
7629
  const Text = Symbol.for("v-txt");
7338
7630
  const Comment = Symbol.for("v-cmt");
7339
7631
  const Static = Symbol.for("v-stc");
7632
+ const VaporSlot = Symbol.for("v-vps");
7340
7633
  const blockStack = [];
7341
7634
  let currentBlock = null;
7342
7635
  function openBlock(disableTracking = false) {
@@ -7710,6 +8003,40 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
7710
8003
  ]);
7711
8004
  }
7712
8005
 
8006
+ let currentInstance = null;
8007
+ const getCurrentGenericInstance = () => currentInstance || currentRenderingInstance;
8008
+ const getCurrentInstance = () => currentInstance && !currentInstance.vapor ? currentInstance : currentRenderingInstance;
8009
+ let isInSSRComponentSetup = false;
8010
+ let setInSSRSetupState;
8011
+ let simpleSetCurrentInstance;
8012
+ {
8013
+ const g = shared.getGlobalThis();
8014
+ const registerGlobalSetter = (key, setter) => {
8015
+ let setters;
8016
+ if (!(setters = g[key])) setters = g[key] = [];
8017
+ setters.push(setter);
8018
+ return (v) => {
8019
+ if (setters.length > 1) setters.forEach((set) => set(v));
8020
+ else setters[0](v);
8021
+ };
8022
+ };
8023
+ simpleSetCurrentInstance = registerGlobalSetter(
8024
+ `__VUE_INSTANCE_SETTERS__`,
8025
+ (v) => currentInstance = v
8026
+ );
8027
+ setInSSRSetupState = registerGlobalSetter(
8028
+ `__VUE_SSR_SETTERS__`,
8029
+ (v) => isInSSRComponentSetup = v
8030
+ );
8031
+ }
8032
+ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope : void 0) => {
8033
+ try {
8034
+ return [currentInstance, reactivity.setCurrentScope(scope)];
8035
+ } finally {
8036
+ simpleSetCurrentInstance(instance);
8037
+ }
8038
+ };
8039
+
7713
8040
  const emptyAppContext = createAppContext();
7714
8041
  let uid = 0;
7715
8042
  function createComponentInstance(vnode, parent, suspense) {
@@ -7754,7 +8081,7 @@ function createComponentInstance(vnode, parent, suspense) {
7754
8081
  // to be set immediately
7755
8082
  emitted: null,
7756
8083
  // props default value
7757
- propsDefaults: shared.EMPTY_OBJ,
8084
+ propsDefaults: null,
7758
8085
  // inheritAttrs
7759
8086
  inheritAttrs: type.inheritAttrs,
7760
8087
  // state
@@ -7801,46 +8128,8 @@ function createComponentInstance(vnode, parent, suspense) {
7801
8128
  }
7802
8129
  return instance;
7803
8130
  }
7804
- let currentInstance = null;
7805
- const getCurrentInstance = () => currentInstance || currentRenderingInstance;
7806
- let internalSetCurrentInstance;
7807
- let setInSSRSetupState;
7808
- {
7809
- const g = shared.getGlobalThis();
7810
- const registerGlobalSetter = (key, setter) => {
7811
- let setters;
7812
- if (!(setters = g[key])) setters = g[key] = [];
7813
- setters.push(setter);
7814
- return (v) => {
7815
- if (setters.length > 1) setters.forEach((set) => set(v));
7816
- else setters[0](v);
7817
- };
7818
- };
7819
- internalSetCurrentInstance = registerGlobalSetter(
7820
- `__VUE_INSTANCE_SETTERS__`,
7821
- (v) => currentInstance = v
7822
- );
7823
- setInSSRSetupState = registerGlobalSetter(
7824
- `__VUE_SSR_SETTERS__`,
7825
- (v) => isInSSRComponentSetup = v
7826
- );
7827
- }
7828
- const setCurrentInstance = (instance) => {
7829
- const prev = currentInstance;
7830
- internalSetCurrentInstance(instance);
7831
- instance.scope.on();
7832
- return () => {
7833
- instance.scope.off();
7834
- internalSetCurrentInstance(prev);
7835
- };
7836
- };
7837
- const unsetCurrentInstance = () => {
7838
- currentInstance && currentInstance.scope.off();
7839
- internalSetCurrentInstance(null);
7840
- };
7841
- const isBuiltInTag = /* @__PURE__ */ shared.makeMap("slot,component");
7842
8131
  function validateComponentName(name, { isNativeTag }) {
7843
- if (isBuiltInTag(name) || isNativeTag(name)) {
8132
+ if (shared.isBuiltInTag(name) || isNativeTag(name)) {
7844
8133
  warn$1(
7845
8134
  "Do not use built-in or reserved HTML elements as component id: " + name
7846
8135
  );
@@ -7849,13 +8138,16 @@ function validateComponentName(name, { isNativeTag }) {
7849
8138
  function isStatefulComponent(instance) {
7850
8139
  return instance.vnode.shapeFlag & 4;
7851
8140
  }
7852
- let isInSSRComponentSetup = false;
7853
8141
  function setupComponent(instance, isSSR = false, optimized = false) {
7854
8142
  isSSR && setInSSRSetupState(isSSR);
7855
- const { props, children } = instance.vnode;
8143
+ const { props, children, vi } = instance.vnode;
7856
8144
  const isStateful = isStatefulComponent(instance);
7857
- initProps(instance, props, isStateful, isSSR);
7858
- initSlots(instance, children, optimized || isSSR);
8145
+ if (vi) {
8146
+ vi(instance);
8147
+ } else {
8148
+ initProps(instance, props, isStateful, isSSR);
8149
+ initSlots(instance, children, optimized || isSSR);
8150
+ }
7859
8151
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
7860
8152
  isSSR && setInSSRSetupState(false);
7861
8153
  return setupResult;
@@ -7892,9 +8184,9 @@ function setupStatefulComponent(instance, isSSR) {
7892
8184
  }
7893
8185
  const { setup } = Component;
7894
8186
  if (setup) {
7895
- reactivity.pauseTracking();
8187
+ const prevSub = reactivity.setActiveSub();
7896
8188
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
7897
- const reset = setCurrentInstance(instance);
8189
+ const prev = setCurrentInstance(instance);
7898
8190
  const setupResult = callWithErrorHandling(
7899
8191
  setup,
7900
8192
  instance,
@@ -7905,12 +8197,15 @@ function setupStatefulComponent(instance, isSSR) {
7905
8197
  ]
7906
8198
  );
7907
8199
  const isAsyncSetup = shared.isPromise(setupResult);
7908
- reactivity.resetTracking();
7909
- reset();
8200
+ reactivity.setActiveSub(prevSub);
8201
+ setCurrentInstance(...prev);
7910
8202
  if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
7911
8203
  markAsyncBoundary(instance);
7912
8204
  }
7913
8205
  if (isAsyncSetup) {
8206
+ const unsetCurrentInstance = () => {
8207
+ setCurrentInstance(null, void 0);
8208
+ };
7914
8209
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
7915
8210
  if (isSSR) {
7916
8211
  return setupResult.then((resolvedResult) => {
@@ -8005,13 +8300,13 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
8005
8300
  }
8006
8301
  }
8007
8302
  {
8008
- const reset = setCurrentInstance(instance);
8009
- reactivity.pauseTracking();
8303
+ const prevInstance = setCurrentInstance(instance);
8304
+ const prevSub = reactivity.setActiveSub();
8010
8305
  try {
8011
8306
  applyOptions(instance);
8012
8307
  } finally {
8013
- reactivity.resetTracking();
8014
- reset();
8308
+ reactivity.setActiveSub(prevSub);
8309
+ setCurrentInstance(...prevInstance);
8015
8310
  }
8016
8311
  }
8017
8312
  if (!Component.render && instance.render === shared.NOOP && !isSSR) {
@@ -8048,29 +8343,6 @@ function getSlotsProxy(instance) {
8048
8343
  });
8049
8344
  }
8050
8345
  function createSetupContext(instance) {
8051
- const expose = (exposed) => {
8052
- {
8053
- if (instance.exposed) {
8054
- warn$1(`expose() should be called only once per setup().`);
8055
- }
8056
- if (exposed != null) {
8057
- let exposedType = typeof exposed;
8058
- if (exposedType === "object") {
8059
- if (shared.isArray(exposed)) {
8060
- exposedType = "array";
8061
- } else if (reactivity.isRef(exposed)) {
8062
- exposedType = "ref";
8063
- }
8064
- }
8065
- if (exposedType !== "object") {
8066
- warn$1(
8067
- `expose() should be passed a plain object, received ${exposedType}.`
8068
- );
8069
- }
8070
- }
8071
- }
8072
- instance.exposed = exposed || {};
8073
- };
8074
8346
  {
8075
8347
  let attrsProxy;
8076
8348
  let slotsProxy;
@@ -8084,10 +8356,33 @@ function createSetupContext(instance) {
8084
8356
  get emit() {
8085
8357
  return (event, ...args) => instance.emit(event, ...args);
8086
8358
  },
8087
- expose
8359
+ expose: (exposed) => expose(instance, exposed)
8088
8360
  });
8089
8361
  }
8090
8362
  }
8363
+ function expose(instance, exposed) {
8364
+ {
8365
+ if (instance.exposed) {
8366
+ warn$1(`expose() should be called only once per setup().`);
8367
+ }
8368
+ if (exposed != null) {
8369
+ let exposedType = typeof exposed;
8370
+ if (exposedType === "object") {
8371
+ if (shared.isArray(exposed)) {
8372
+ exposedType = "array";
8373
+ } else if (reactivity.isRef(exposed)) {
8374
+ exposedType = "ref";
8375
+ }
8376
+ }
8377
+ if (exposedType !== "object") {
8378
+ warn$1(
8379
+ `expose() should be passed a plain object, received ${exposedType}.`
8380
+ );
8381
+ }
8382
+ }
8383
+ }
8384
+ instance.exposed = exposed || {};
8385
+ }
8091
8386
  function getComponentPublicInstance(instance) {
8092
8387
  if (instance.exposed) {
8093
8388
  return instance.exposeProxy || (instance.exposeProxy = new Proxy(reactivity.proxyRefs(reactivity.markRaw(instance.exposed)), {
@@ -8095,7 +8390,9 @@ function getComponentPublicInstance(instance) {
8095
8390
  if (key in target) {
8096
8391
  return target[key];
8097
8392
  } else if (key in publicPropertiesMap) {
8098
- return publicPropertiesMap[key](instance);
8393
+ return publicPropertiesMap[key](
8394
+ instance
8395
+ );
8099
8396
  }
8100
8397
  },
8101
8398
  has(target, key) {
@@ -8138,14 +8435,7 @@ function isClassComponent(value) {
8138
8435
  }
8139
8436
 
8140
8437
  const computed = (getterOrOptions, debugOptions) => {
8141
- const c = reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
8142
- {
8143
- const i = getCurrentInstance();
8144
- if (i && i.appContext.config.warnRecursiveComputed) {
8145
- c._warnRecursive = true;
8146
- }
8147
- }
8148
- return c;
8438
+ return reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
8149
8439
  };
8150
8440
 
8151
8441
  function h(type, propsOrChildren, children) {
@@ -8186,9 +8476,9 @@ function initCustomFormatter() {
8186
8476
  if (obj.__isVue) {
8187
8477
  return ["div", vueStyle, `VueInstance`];
8188
8478
  } else if (reactivity.isRef(obj)) {
8189
- reactivity.pauseTracking();
8479
+ const prevSub = reactivity.setActiveSub();
8190
8480
  const value = obj.value;
8191
- reactivity.resetTracking();
8481
+ reactivity.setActiveSub(prevSub);
8192
8482
  return [
8193
8483
  "div",
8194
8484
  {},
@@ -8375,7 +8665,7 @@ function isMemoSame(cached, memo) {
8375
8665
  return true;
8376
8666
  }
8377
8667
 
8378
- const version = "3.5.16";
8668
+ const version = "3.6.0-alpha.1";
8379
8669
  const warn = warn$1 ;
8380
8670
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8381
8671
  const devtools = devtools$1 ;