@vue/compat 3.5.17 → 3.6.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.17
2
+ * @vue/compat v3.6.0-alpha.2
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -25,8 +25,10 @@ const NOOP = () => {
25
25
  const NO = () => false;
26
26
  const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
27
27
  (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
28
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
29
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
28
30
  const isModelListener = (key) => key.startsWith("onUpdate:");
29
- const extend$1 = Object.assign;
31
+ const extend = Object.assign;
30
32
  const remove = (arr, el) => {
31
33
  const i = arr.indexOf(el);
32
34
  if (i > -1) {
@@ -69,10 +71,9 @@ const cacheStringFunction = (fn) => {
69
71
  };
70
72
  };
71
73
  const camelizeRE = /-(\w)/g;
74
+ const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
72
75
  const camelize = cacheStringFunction(
73
- (str) => {
74
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
75
- }
76
+ (str) => str.replace(camelizeRE, camelizeReplacer)
76
77
  );
77
78
  const hyphenateRE = /\B([A-Z])/g;
78
79
  const hyphenate = cacheStringFunction(
@@ -123,6 +124,10 @@ function genCacheKey(source, options) {
123
124
  (_, val) => typeof val === "function" ? val.toString() : val
124
125
  );
125
126
  }
127
+ function canSetValueDirectly(tagName) {
128
+ return tagName !== "PROGRESS" && // custom elements may use _value internally
129
+ !tagName.includes("-");
130
+ }
126
131
 
127
132
  const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol";
128
133
  const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
@@ -228,6 +233,24 @@ const isKnownSvgAttr = /* @__PURE__ */ makeMap(
228
233
  const isKnownMathMLAttr = /* @__PURE__ */ makeMap(
229
234
  `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns`
230
235
  );
236
+ function shouldSetAsAttr(tagName, key) {
237
+ if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
238
+ return true;
239
+ }
240
+ if (key === "form") {
241
+ return true;
242
+ }
243
+ if (key === "list" && tagName === "INPUT") {
244
+ return true;
245
+ }
246
+ if (key === "type" && tagName === "TEXTAREA") {
247
+ return true;
248
+ }
249
+ if ((key === "width" || key === "height") && (tagName === "IMG" || tagName === "VIDEO" || tagName === "CANVAS" || tagName === "SOURCE")) {
250
+ return true;
251
+ }
252
+ return false;
253
+ }
231
254
 
232
255
  const escapeRE = /["'&<>]/;
233
256
  function escapeHtml(string) {
@@ -323,7 +346,20 @@ const isRef$1 = (val) => {
323
346
  return !!(val && val["__v_isRef"] === true);
324
347
  };
325
348
  const toDisplayString = (val) => {
326
- return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
349
+ switch (typeof val) {
350
+ case "string":
351
+ return val;
352
+ case "object":
353
+ if (val) {
354
+ if (isRef$1(val)) {
355
+ return toDisplayString(val.value);
356
+ } else if (isArray(val) || val.toString === objectToString || !isFunction(val.toString)) {
357
+ return JSON.stringify(val, replacer, 2);
358
+ }
359
+ }
360
+ default:
361
+ return val == null ? "" : String(val);
362
+ }
327
363
  };
328
364
  const replacer = (_key, val) => {
329
365
  if (isRef$1(val)) {
@@ -358,557 +394,325 @@ const stringifySymbol = (v, i = "") => {
358
394
  );
359
395
  };
360
396
 
361
- let activeEffectScope;
362
- class EffectScope {
363
- constructor(detached = false) {
364
- this.detached = detached;
365
- /**
366
- * @internal
367
- */
368
- this._active = true;
369
- /**
370
- * @internal track `on` calls, allow `on` call multiple times
371
- */
372
- this._on = 0;
373
- /**
374
- * @internal
375
- */
376
- this.effects = [];
377
- /**
378
- * @internal
379
- */
380
- this.cleanups = [];
381
- this._isPaused = false;
382
- this.parent = activeEffectScope;
383
- if (!detached && activeEffectScope) {
384
- this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
385
- this
386
- ) - 1;
387
- }
388
- }
389
- get active() {
390
- return this._active;
391
- }
392
- pause() {
393
- if (this._active) {
394
- this._isPaused = true;
395
- let i, l;
396
- if (this.scopes) {
397
- for (i = 0, l = this.scopes.length; i < l; i++) {
398
- this.scopes[i].pause();
399
- }
400
- }
401
- for (i = 0, l = this.effects.length; i < l; i++) {
402
- this.effects[i].pause();
403
- }
404
- }
405
- }
406
- /**
407
- * Resumes the effect scope, including all child scopes and effects.
408
- */
409
- resume() {
410
- if (this._active) {
411
- if (this._isPaused) {
412
- this._isPaused = false;
413
- let i, l;
414
- if (this.scopes) {
415
- for (i = 0, l = this.scopes.length; i < l; i++) {
416
- this.scopes[i].resume();
417
- }
418
- }
419
- for (i = 0, l = this.effects.length; i < l; i++) {
420
- this.effects[i].resume();
421
- }
422
- }
423
- }
424
- }
425
- run(fn) {
426
- if (this._active) {
427
- const currentEffectScope = activeEffectScope;
428
- try {
429
- activeEffectScope = this;
430
- return fn();
431
- } finally {
432
- activeEffectScope = currentEffectScope;
433
- }
434
- }
435
- }
436
- /**
437
- * This should only be called on non-detached scopes
438
- * @internal
439
- */
440
- on() {
441
- if (++this._on === 1) {
442
- this.prevScope = activeEffectScope;
443
- activeEffectScope = this;
444
- }
445
- }
446
- /**
447
- * This should only be called on non-detached scopes
448
- * @internal
449
- */
450
- off() {
451
- if (this._on > 0 && --this._on === 0) {
452
- activeEffectScope = this.prevScope;
453
- this.prevScope = void 0;
454
- }
455
- }
456
- stop(fromParent) {
457
- if (this._active) {
458
- this._active = false;
459
- let i, l;
460
- for (i = 0, l = this.effects.length; i < l; i++) {
461
- this.effects[i].stop();
462
- }
463
- this.effects.length = 0;
464
- for (i = 0, l = this.cleanups.length; i < l; i++) {
465
- this.cleanups[i]();
397
+ function getSequence(arr) {
398
+ const p = arr.slice();
399
+ const result = [0];
400
+ let i, j, u, v, c;
401
+ const len = arr.length;
402
+ for (i = 0; i < len; i++) {
403
+ const arrI = arr[i];
404
+ if (arrI !== 0) {
405
+ j = result[result.length - 1];
406
+ if (arr[j] < arrI) {
407
+ p[i] = j;
408
+ result.push(i);
409
+ continue;
466
410
  }
467
- this.cleanups.length = 0;
468
- if (this.scopes) {
469
- for (i = 0, l = this.scopes.length; i < l; i++) {
470
- this.scopes[i].stop(true);
411
+ u = 0;
412
+ v = result.length - 1;
413
+ while (u < v) {
414
+ c = u + v >> 1;
415
+ if (arr[result[c]] < arrI) {
416
+ u = c + 1;
417
+ } else {
418
+ v = c;
471
419
  }
472
- this.scopes.length = 0;
473
420
  }
474
- if (!this.detached && this.parent && !fromParent) {
475
- const last = this.parent.scopes.pop();
476
- if (last && last !== this) {
477
- this.parent.scopes[this.index] = last;
478
- last.index = this.index;
421
+ if (arrI < arr[result[u]]) {
422
+ if (u > 0) {
423
+ p[i] = result[u - 1];
479
424
  }
425
+ result[u] = i;
480
426
  }
481
- this.parent = void 0;
482
427
  }
483
428
  }
484
- }
485
- function effectScope(detached) {
486
- return new EffectScope(detached);
487
- }
488
- function getCurrentScope() {
489
- return activeEffectScope;
490
- }
491
- function onScopeDispose(fn, failSilently = false) {
492
- if (activeEffectScope) {
493
- activeEffectScope.cleanups.push(fn);
429
+ u = result.length;
430
+ v = result[u - 1];
431
+ while (u-- > 0) {
432
+ result[u] = v;
433
+ v = p[v];
494
434
  }
435
+ return result;
495
436
  }
496
437
 
497
- let activeSub;
498
- const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
499
- class ReactiveEffect {
500
- constructor(fn) {
501
- this.fn = fn;
502
- /**
503
- * @internal
504
- */
505
- this.deps = void 0;
506
- /**
507
- * @internal
508
- */
509
- this.depsTail = void 0;
510
- /**
511
- * @internal
512
- */
513
- this.flags = 1 | 4;
514
- /**
515
- * @internal
516
- */
517
- this.next = void 0;
518
- /**
519
- * @internal
520
- */
521
- this.cleanup = void 0;
522
- this.scheduler = void 0;
523
- if (activeEffectScope && activeEffectScope.active) {
524
- activeEffectScope.effects.push(this);
525
- }
526
- }
527
- pause() {
528
- this.flags |= 64;
529
- }
530
- resume() {
531
- if (this.flags & 64) {
532
- this.flags &= -65;
533
- if (pausedQueueEffects.has(this)) {
534
- pausedQueueEffects.delete(this);
535
- this.trigger();
536
- }
537
- }
538
- }
539
- /**
540
- * @internal
541
- */
542
- notify() {
543
- if (this.flags & 2 && !(this.flags & 32)) {
544
- return;
545
- }
546
- if (!(this.flags & 8)) {
547
- batch(this);
548
- }
549
- }
550
- run() {
551
- if (!(this.flags & 1)) {
552
- return this.fn();
553
- }
554
- this.flags |= 2;
555
- cleanupEffect(this);
556
- prepareDeps(this);
557
- const prevEffect = activeSub;
558
- const prevShouldTrack = shouldTrack;
559
- activeSub = this;
560
- shouldTrack = true;
561
- try {
562
- return this.fn();
563
- } finally {
564
- cleanupDeps(this);
565
- activeSub = prevEffect;
566
- shouldTrack = prevShouldTrack;
567
- this.flags &= -3;
568
- }
569
- }
570
- stop() {
571
- if (this.flags & 1) {
572
- for (let link = this.deps; link; link = link.nextDep) {
573
- removeSub(link);
574
- }
575
- this.deps = this.depsTail = void 0;
576
- cleanupEffect(this);
577
- this.onStop && this.onStop();
578
- this.flags &= -2;
579
- }
580
- }
581
- trigger() {
582
- if (this.flags & 64) {
583
- pausedQueueEffects.add(this);
584
- } else if (this.scheduler) {
585
- this.scheduler();
586
- } else {
587
- this.runIfDirty();
588
- }
589
- }
590
- /**
591
- * @internal
592
- */
593
- runIfDirty() {
594
- if (isDirty(this)) {
595
- this.run();
596
- }
597
- }
598
- get dirty() {
599
- return isDirty(this);
600
- }
601
- }
438
+ var ReactiveFlags = /* @__PURE__ */ ((ReactiveFlags2) => {
439
+ ReactiveFlags2[ReactiveFlags2["None"] = 0] = "None";
440
+ ReactiveFlags2[ReactiveFlags2["Mutable"] = 1] = "Mutable";
441
+ ReactiveFlags2[ReactiveFlags2["Watching"] = 2] = "Watching";
442
+ ReactiveFlags2[ReactiveFlags2["RecursedCheck"] = 4] = "RecursedCheck";
443
+ ReactiveFlags2[ReactiveFlags2["Recursed"] = 8] = "Recursed";
444
+ ReactiveFlags2[ReactiveFlags2["Dirty"] = 16] = "Dirty";
445
+ ReactiveFlags2[ReactiveFlags2["Pending"] = 32] = "Pending";
446
+ return ReactiveFlags2;
447
+ })(ReactiveFlags || {});
448
+ const notifyBuffer = [];
602
449
  let batchDepth = 0;
603
- let batchedSub;
604
- let batchedComputed;
605
- function batch(sub, isComputed = false) {
606
- sub.flags |= 8;
607
- if (isComputed) {
608
- sub.next = batchedComputed;
609
- batchedComputed = sub;
610
- return;
450
+ let activeSub = void 0;
451
+ let notifyIndex = 0;
452
+ let notifyBufferLength = 0;
453
+ function setActiveSub(sub) {
454
+ try {
455
+ return activeSub;
456
+ } finally {
457
+ activeSub = sub;
611
458
  }
612
- sub.next = batchedSub;
613
- batchedSub = sub;
614
459
  }
615
460
  function startBatch() {
616
- batchDepth++;
461
+ ++batchDepth;
617
462
  }
618
463
  function endBatch() {
619
- if (--batchDepth > 0) {
620
- return;
621
- }
622
- if (batchedComputed) {
623
- let e = batchedComputed;
624
- batchedComputed = void 0;
625
- while (e) {
626
- const next = e.next;
627
- e.next = void 0;
628
- e.flags &= -9;
629
- e = next;
630
- }
631
- }
632
- let error;
633
- while (batchedSub) {
634
- let e = batchedSub;
635
- batchedSub = void 0;
636
- while (e) {
637
- const next = e.next;
638
- e.next = void 0;
639
- e.flags &= -9;
640
- if (e.flags & 1) {
641
- try {
642
- ;
643
- e.trigger();
644
- } catch (err) {
645
- if (!error) error = err;
646
- }
647
- }
648
- e = next;
649
- }
650
- }
651
- if (error) throw error;
652
- }
653
- function prepareDeps(sub) {
654
- for (let link = sub.deps; link; link = link.nextDep) {
655
- link.version = -1;
656
- link.prevActiveLink = link.dep.activeLink;
657
- link.dep.activeLink = link;
658
- }
659
- }
660
- function cleanupDeps(sub) {
661
- let head;
662
- let tail = sub.depsTail;
663
- let link = tail;
664
- while (link) {
665
- const prev = link.prevDep;
666
- if (link.version === -1) {
667
- if (link === tail) tail = prev;
668
- removeSub(link);
669
- removeDep(link);
670
- } else {
671
- head = link;
672
- }
673
- link.dep.activeLink = link.prevActiveLink;
674
- link.prevActiveLink = void 0;
675
- link = prev;
676
- }
677
- sub.deps = head;
678
- sub.depsTail = tail;
679
- }
680
- function isDirty(sub) {
681
- for (let link = sub.deps; link; link = link.nextDep) {
682
- if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
683
- return true;
684
- }
685
- }
686
- if (sub._dirty) {
687
- return true;
464
+ if (!--batchDepth && notifyBufferLength) {
465
+ flush();
688
466
  }
689
- return false;
690
467
  }
691
- function refreshComputed(computed) {
692
- if (computed.flags & 4 && !(computed.flags & 16)) {
468
+ function link(dep, sub) {
469
+ const prevDep = sub.depsTail;
470
+ if (prevDep !== void 0 && prevDep.dep === dep) {
693
471
  return;
694
472
  }
695
- computed.flags &= -17;
696
- if (computed.globalVersion === globalVersion) {
697
- return;
698
- }
699
- computed.globalVersion = globalVersion;
700
- if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) {
701
- return;
702
- }
703
- computed.flags |= 2;
704
- const dep = computed.dep;
705
- const prevSub = activeSub;
706
- const prevShouldTrack = shouldTrack;
707
- activeSub = computed;
708
- shouldTrack = true;
709
- try {
710
- prepareDeps(computed);
711
- const value = computed.fn(computed._value);
712
- if (dep.version === 0 || hasChanged(value, computed._value)) {
713
- computed.flags |= 128;
714
- computed._value = value;
715
- dep.version++;
473
+ let nextDep = void 0;
474
+ const recursedCheck = sub.flags & 4 /* RecursedCheck */;
475
+ if (recursedCheck) {
476
+ nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;
477
+ if (nextDep !== void 0 && nextDep.dep === dep) {
478
+ sub.depsTail = nextDep;
479
+ return;
716
480
  }
717
- } catch (err) {
718
- dep.version++;
719
- throw err;
720
- } finally {
721
- activeSub = prevSub;
722
- shouldTrack = prevShouldTrack;
723
- cleanupDeps(computed);
724
- computed.flags &= -3;
725
- }
726
- }
727
- function removeSub(link, soft = false) {
728
- const { dep, prevSub, nextSub } = link;
729
- if (prevSub) {
730
- prevSub.nextSub = nextSub;
731
- link.prevSub = void 0;
732
481
  }
733
- if (nextSub) {
734
- nextSub.prevSub = prevSub;
735
- link.nextSub = void 0;
482
+ const prevSub = dep.subsTail;
483
+ const newLink = sub.depsTail = dep.subsTail = {
484
+ dep,
485
+ sub,
486
+ prevDep,
487
+ nextDep,
488
+ prevSub,
489
+ nextSub: void 0
490
+ };
491
+ if (nextDep !== void 0) {
492
+ nextDep.prevDep = newLink;
736
493
  }
737
- if (dep.subs === link) {
738
- dep.subs = prevSub;
739
- if (!prevSub && dep.computed) {
740
- dep.computed.flags &= -5;
741
- for (let l = dep.computed.deps; l; l = l.nextDep) {
742
- removeSub(l, true);
743
- }
744
- }
494
+ if (prevDep !== void 0) {
495
+ prevDep.nextDep = newLink;
496
+ } else {
497
+ sub.deps = newLink;
745
498
  }
746
- if (!soft && !--dep.sc && dep.map) {
747
- dep.map.delete(dep.key);
499
+ if (prevSub !== void 0) {
500
+ prevSub.nextSub = newLink;
501
+ } else {
502
+ dep.subs = newLink;
748
503
  }
749
504
  }
750
- function removeDep(link) {
751
- const { prevDep, nextDep } = link;
752
- if (prevDep) {
753
- prevDep.nextDep = nextDep;
754
- link.prevDep = void 0;
755
- }
756
- if (nextDep) {
505
+ function unlink(link2, sub = link2.sub) {
506
+ const dep = link2.dep;
507
+ const prevDep = link2.prevDep;
508
+ const nextDep = link2.nextDep;
509
+ const nextSub = link2.nextSub;
510
+ const prevSub = link2.prevSub;
511
+ if (nextDep !== void 0) {
757
512
  nextDep.prevDep = prevDep;
758
- link.nextDep = void 0;
759
- }
760
- }
761
- function effect(fn, options) {
762
- if (fn.effect instanceof ReactiveEffect) {
763
- fn = fn.effect.fn;
764
- }
765
- const e = new ReactiveEffect(fn);
766
- if (options) {
767
- extend$1(e, options);
768
- }
769
- try {
770
- e.run();
771
- } catch (err) {
772
- e.stop();
773
- throw err;
774
- }
775
- const runner = e.run.bind(e);
776
- runner.effect = e;
777
- return runner;
778
- }
779
- function stop(runner) {
780
- runner.effect.stop();
781
- }
782
- let shouldTrack = true;
783
- const trackStack = [];
784
- function pauseTracking() {
785
- trackStack.push(shouldTrack);
786
- shouldTrack = false;
787
- }
788
- function resetTracking() {
789
- const last = trackStack.pop();
790
- shouldTrack = last === void 0 ? true : last;
791
- }
792
- function cleanupEffect(e) {
793
- const { cleanup } = e;
794
- e.cleanup = void 0;
795
- if (cleanup) {
796
- const prevSub = activeSub;
797
- activeSub = void 0;
798
- try {
799
- cleanup();
800
- } finally {
801
- activeSub = prevSub;
802
- }
803
- }
804
- }
805
-
806
- let globalVersion = 0;
807
- class Link {
808
- constructor(sub, dep) {
809
- this.sub = sub;
810
- this.dep = dep;
811
- this.version = dep.version;
812
- this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
813
- }
814
- }
815
- class Dep {
816
- // TODO isolatedDeclarations "__v_skip"
817
- constructor(computed) {
818
- this.computed = computed;
819
- this.version = 0;
820
- /**
821
- * Link between this dep and the current active effect
822
- */
823
- this.activeLink = void 0;
824
- /**
825
- * Doubly linked list representing the subscribing effects (tail)
826
- */
827
- this.subs = void 0;
828
- /**
829
- * For object property deps cleanup
830
- */
831
- this.map = void 0;
832
- this.key = void 0;
833
- /**
834
- * Subscriber counter
835
- */
836
- this.sc = 0;
837
- /**
838
- * @internal
839
- */
840
- this.__v_skip = true;
513
+ } else {
514
+ sub.depsTail = prevDep;
841
515
  }
842
- track(debugInfo) {
843
- if (!activeSub || !shouldTrack || activeSub === this.computed) {
844
- return;
845
- }
846
- let link = this.activeLink;
847
- if (link === void 0 || link.sub !== activeSub) {
848
- link = this.activeLink = new Link(activeSub, this);
849
- if (!activeSub.deps) {
850
- activeSub.deps = activeSub.depsTail = link;
516
+ if (prevDep !== void 0) {
517
+ prevDep.nextDep = nextDep;
518
+ } else {
519
+ sub.deps = nextDep;
520
+ }
521
+ if (nextSub !== void 0) {
522
+ nextSub.prevSub = prevSub;
523
+ } else {
524
+ dep.subsTail = prevSub;
525
+ }
526
+ if (prevSub !== void 0) {
527
+ prevSub.nextSub = nextSub;
528
+ } else if ((dep.subs = nextSub) === void 0) {
529
+ let toRemove = dep.deps;
530
+ if (toRemove !== void 0) {
531
+ do {
532
+ toRemove = unlink(toRemove, dep);
533
+ } while (toRemove !== void 0);
534
+ dep.flags |= 16 /* Dirty */;
535
+ }
536
+ }
537
+ return nextDep;
538
+ }
539
+ function propagate(link2) {
540
+ let next = link2.nextSub;
541
+ let stack;
542
+ top: do {
543
+ const sub = link2.sub;
544
+ let flags = sub.flags;
545
+ if (flags & (1 /* Mutable */ | 2 /* Watching */)) {
546
+ if (!(flags & (4 /* RecursedCheck */ | 8 /* Recursed */ | 16 /* Dirty */ | 32 /* Pending */))) {
547
+ sub.flags = flags | 32 /* Pending */;
548
+ } else if (!(flags & (4 /* RecursedCheck */ | 8 /* Recursed */))) {
549
+ flags = 0 /* None */;
550
+ } else if (!(flags & 4 /* RecursedCheck */)) {
551
+ sub.flags = flags & -9 /* Recursed */ | 32 /* Pending */;
552
+ } else if (!(flags & (16 /* Dirty */ | 32 /* Pending */)) && isValidLink(link2, sub)) {
553
+ sub.flags = flags | 8 /* Recursed */ | 32 /* Pending */;
554
+ flags &= 1 /* Mutable */;
851
555
  } else {
852
- link.prevDep = activeSub.depsTail;
853
- activeSub.depsTail.nextDep = link;
854
- activeSub.depsTail = link;
855
- }
856
- addSub(link);
857
- } else if (link.version === -1) {
858
- link.version = this.version;
859
- if (link.nextDep) {
860
- const next = link.nextDep;
861
- next.prevDep = link.prevDep;
862
- if (link.prevDep) {
863
- link.prevDep.nextDep = next;
864
- }
865
- link.prevDep = activeSub.depsTail;
866
- link.nextDep = void 0;
867
- activeSub.depsTail.nextDep = link;
868
- activeSub.depsTail = link;
869
- if (activeSub.deps === link) {
870
- activeSub.deps = next;
556
+ flags = 0 /* None */;
557
+ }
558
+ if (flags & 2 /* Watching */) {
559
+ notifyBuffer[notifyBufferLength++] = sub;
560
+ }
561
+ if (flags & 1 /* Mutable */) {
562
+ const subSubs = sub.subs;
563
+ if (subSubs !== void 0) {
564
+ link2 = subSubs;
565
+ if (subSubs.nextSub !== void 0) {
566
+ stack = { value: next, prev: stack };
567
+ next = link2.nextSub;
568
+ }
569
+ continue;
871
570
  }
872
571
  }
873
572
  }
874
- return link;
875
- }
876
- trigger(debugInfo) {
877
- this.version++;
878
- globalVersion++;
879
- this.notify(debugInfo);
880
- }
881
- notify(debugInfo) {
882
- startBatch();
883
- try {
884
- if (false) ;
885
- for (let link = this.subs; link; link = link.prevSub) {
886
- if (link.sub.notify()) {
887
- ;
888
- link.sub.dep.notify();
573
+ if ((link2 = next) !== void 0) {
574
+ next = link2.nextSub;
575
+ continue;
576
+ }
577
+ while (stack !== void 0) {
578
+ link2 = stack.value;
579
+ stack = stack.prev;
580
+ if (link2 !== void 0) {
581
+ next = link2.nextSub;
582
+ continue top;
583
+ }
584
+ }
585
+ break;
586
+ } while (true);
587
+ }
588
+ function startTracking(sub) {
589
+ sub.depsTail = void 0;
590
+ sub.flags = sub.flags & -57 | 4 /* RecursedCheck */;
591
+ return setActiveSub(sub);
592
+ }
593
+ function endTracking(sub, prevSub) {
594
+ activeSub = prevSub;
595
+ const depsTail = sub.depsTail;
596
+ let toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
597
+ while (toRemove !== void 0) {
598
+ toRemove = unlink(toRemove, sub);
599
+ }
600
+ sub.flags &= -5 /* RecursedCheck */;
601
+ }
602
+ function flush() {
603
+ while (notifyIndex < notifyBufferLength) {
604
+ const effect = notifyBuffer[notifyIndex];
605
+ notifyBuffer[notifyIndex++] = void 0;
606
+ effect.notify();
607
+ }
608
+ notifyIndex = 0;
609
+ notifyBufferLength = 0;
610
+ }
611
+ function checkDirty(link2, sub) {
612
+ let stack;
613
+ let checkDepth = 0;
614
+ top: do {
615
+ const dep = link2.dep;
616
+ const depFlags = dep.flags;
617
+ let dirty = false;
618
+ if (sub.flags & 16 /* Dirty */) {
619
+ dirty = true;
620
+ } else if ((depFlags & (1 /* Mutable */ | 16 /* Dirty */)) === (1 /* Mutable */ | 16 /* Dirty */)) {
621
+ if (dep.update()) {
622
+ const subs = dep.subs;
623
+ if (subs.nextSub !== void 0) {
624
+ shallowPropagate(subs);
625
+ }
626
+ dirty = true;
627
+ }
628
+ } else if ((depFlags & (1 /* Mutable */ | 32 /* Pending */)) === (1 /* Mutable */ | 32 /* Pending */)) {
629
+ if (link2.nextSub !== void 0 || link2.prevSub !== void 0) {
630
+ stack = { value: link2, prev: stack };
631
+ }
632
+ link2 = dep.deps;
633
+ sub = dep;
634
+ ++checkDepth;
635
+ continue;
636
+ }
637
+ if (!dirty && link2.nextDep !== void 0) {
638
+ link2 = link2.nextDep;
639
+ continue;
640
+ }
641
+ while (checkDepth) {
642
+ --checkDepth;
643
+ const firstSub = sub.subs;
644
+ const hasMultipleSubs = firstSub.nextSub !== void 0;
645
+ if (hasMultipleSubs) {
646
+ link2 = stack.value;
647
+ stack = stack.prev;
648
+ } else {
649
+ link2 = firstSub;
650
+ }
651
+ if (dirty) {
652
+ if (sub.update()) {
653
+ if (hasMultipleSubs) {
654
+ shallowPropagate(firstSub);
655
+ }
656
+ sub = link2.sub;
657
+ continue;
889
658
  }
659
+ } else {
660
+ sub.flags &= -33 /* Pending */;
661
+ }
662
+ sub = link2.sub;
663
+ if (link2.nextDep !== void 0) {
664
+ link2 = link2.nextDep;
665
+ continue top;
666
+ }
667
+ dirty = false;
668
+ }
669
+ return dirty;
670
+ } while (true);
671
+ }
672
+ function shallowPropagate(link2) {
673
+ do {
674
+ const sub = link2.sub;
675
+ const nextSub = link2.nextSub;
676
+ const subFlags = sub.flags;
677
+ if ((subFlags & (32 /* Pending */ | 16 /* Dirty */)) === 32 /* Pending */) {
678
+ sub.flags = subFlags | 16 /* Dirty */;
679
+ }
680
+ link2 = nextSub;
681
+ } while (link2 !== void 0);
682
+ }
683
+ function isValidLink(checkLink, sub) {
684
+ const depsTail = sub.depsTail;
685
+ if (depsTail !== void 0) {
686
+ let link2 = sub.deps;
687
+ do {
688
+ if (link2 === checkLink) {
689
+ return true;
890
690
  }
891
- } finally {
892
- endBatch();
893
- }
691
+ if (link2 === depsTail) {
692
+ break;
693
+ }
694
+ link2 = link2.nextDep;
695
+ } while (link2 !== void 0);
894
696
  }
697
+ return false;
895
698
  }
896
- function addSub(link) {
897
- link.dep.sc++;
898
- if (link.sub.flags & 4) {
899
- const computed = link.dep.computed;
900
- if (computed && !link.dep.subs) {
901
- computed.flags |= 4 | 16;
902
- for (let l = computed.deps; l; l = l.nextDep) {
903
- addSub(l);
904
- }
905
- }
906
- const currentTail = link.dep.subs;
907
- if (currentTail !== link) {
908
- link.prevSub = currentTail;
909
- if (currentTail) currentTail.nextSub = link;
699
+
700
+ class Dep {
701
+ constructor(map, key) {
702
+ this.map = map;
703
+ this.key = key;
704
+ this._subs = void 0;
705
+ this.subsTail = void 0;
706
+ this.flags = ReactiveFlags.None;
707
+ }
708
+ get subs() {
709
+ return this._subs;
710
+ }
711
+ set subs(value) {
712
+ this._subs = value;
713
+ if (value === void 0) {
714
+ this.map.delete(this.key);
910
715
  }
911
- link.dep.subs = link;
912
716
  }
913
717
  }
914
718
  const targetMap = /* @__PURE__ */ new WeakMap();
@@ -922,33 +726,27 @@ const ARRAY_ITERATE_KEY = Symbol(
922
726
  ""
923
727
  );
924
728
  function track(target, type, key) {
925
- if (shouldTrack && activeSub) {
729
+ if (activeSub !== void 0) {
926
730
  let depsMap = targetMap.get(target);
927
731
  if (!depsMap) {
928
732
  targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
929
733
  }
930
734
  let dep = depsMap.get(key);
931
735
  if (!dep) {
932
- depsMap.set(key, dep = new Dep());
933
- dep.map = depsMap;
934
- dep.key = key;
935
- }
936
- {
937
- dep.track();
736
+ depsMap.set(key, dep = new Dep(depsMap, key));
938
737
  }
738
+ link(dep, activeSub);
939
739
  }
940
740
  }
941
741
  function trigger(target, type, key, newValue, oldValue, oldTarget) {
942
742
  const depsMap = targetMap.get(target);
943
743
  if (!depsMap) {
944
- globalVersion++;
945
744
  return;
946
745
  }
947
746
  const run = (dep) => {
948
- if (dep) {
949
- {
950
- dep.trigger();
951
- }
747
+ if (dep !== void 0 && dep.subs !== void 0) {
748
+ propagate(dep.subs);
749
+ shallowPropagate(dep.subs);
952
750
  }
953
751
  };
954
752
  startBatch();
@@ -1173,11 +971,11 @@ function searchProxy(self, method, args) {
1173
971
  return res;
1174
972
  }
1175
973
  function noTracking(self, method, args = []) {
1176
- pauseTracking();
1177
974
  startBatch();
975
+ const prevSub = setActiveSub();
1178
976
  const res = toRaw(self)[method].apply(self, args);
977
+ setActiveSub(prevSub);
1179
978
  endBatch();
1180
- resetTracking();
1181
979
  return res;
1182
980
  }
1183
981
 
@@ -1223,14 +1021,18 @@ class BaseReactiveHandler {
1223
1021
  return hasOwnProperty;
1224
1022
  }
1225
1023
  }
1024
+ const wasRef = isRef(target);
1226
1025
  const res = Reflect.get(
1227
1026
  target,
1228
1027
  key,
1229
1028
  // if this is a proxy wrapping a ref, return methods using the raw ref
1230
1029
  // as receiver so that we don't have to call `toRaw` on the ref in all
1231
1030
  // its class methods
1232
- isRef(target) ? target : receiver
1031
+ wasRef ? target : receiver
1233
1032
  );
1033
+ if (wasRef && key !== "value") {
1034
+ return res;
1035
+ }
1234
1036
  if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
1235
1037
  return res;
1236
1038
  }
@@ -1414,7 +1216,7 @@ function createInstrumentations(readonly, shallow) {
1414
1216
  });
1415
1217
  }
1416
1218
  };
1417
- extend$1(
1219
+ extend(
1418
1220
  instrumentations,
1419
1221
  readonly ? {
1420
1222
  add: createReadonlyMethod("add"),
@@ -1640,29 +1442,47 @@ function isRef(r) {
1640
1442
  return r ? r["__v_isRef"] === true : false;
1641
1443
  }
1642
1444
  function ref(value) {
1643
- return createRef(value, false);
1445
+ return createRef(value, toReactive);
1644
1446
  }
1645
1447
  function shallowRef(value) {
1646
- return createRef(value, true);
1448
+ return createRef(value);
1647
1449
  }
1648
- function createRef(rawValue, shallow) {
1450
+ function createRef(rawValue, wrap) {
1649
1451
  if (isRef(rawValue)) {
1650
1452
  return rawValue;
1651
1453
  }
1652
- return new RefImpl(rawValue, shallow);
1454
+ return new RefImpl(rawValue, wrap);
1653
1455
  }
1654
1456
  class RefImpl {
1655
- constructor(value, isShallow2) {
1656
- this.dep = new Dep();
1657
- this["__v_isRef"] = true;
1658
- this["__v_isShallow"] = false;
1659
- this._rawValue = isShallow2 ? value : toRaw(value);
1660
- this._value = isShallow2 ? value : toReactive(value);
1661
- this["__v_isShallow"] = isShallow2;
1457
+ // TODO isolatedDeclarations "__v_isShallow"
1458
+ constructor(value, wrap) {
1459
+ this.subs = void 0;
1460
+ this.subsTail = void 0;
1461
+ this.flags = ReactiveFlags.Mutable;
1462
+ /**
1463
+ * @internal
1464
+ */
1465
+ this.__v_isRef = true;
1466
+ // TODO isolatedDeclarations "__v_isRef"
1467
+ /**
1468
+ * @internal
1469
+ */
1470
+ this.__v_isShallow = false;
1471
+ this._oldValue = this._rawValue = wrap ? toRaw(value) : value;
1472
+ this._value = wrap ? wrap(value) : value;
1473
+ this._wrap = wrap;
1474
+ this["__v_isShallow"] = !wrap;
1475
+ }
1476
+ get dep() {
1477
+ return this;
1662
1478
  }
1663
1479
  get value() {
1664
- {
1665
- this.dep.track();
1480
+ trackRef(this);
1481
+ if (this.flags & ReactiveFlags.Dirty && this.update()) {
1482
+ const subs = this.subs;
1483
+ if (subs !== void 0) {
1484
+ shallowPropagate(subs);
1485
+ }
1666
1486
  }
1667
1487
  return this._value;
1668
1488
  }
@@ -1671,21 +1491,38 @@ class RefImpl {
1671
1491
  const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
1672
1492
  newValue = useDirectValue ? newValue : toRaw(newValue);
1673
1493
  if (hasChanged(newValue, oldValue)) {
1494
+ this.flags |= ReactiveFlags.Dirty;
1674
1495
  this._rawValue = newValue;
1675
- this._value = useDirectValue ? newValue : toReactive(newValue);
1676
- {
1677
- this.dep.trigger();
1496
+ this._value = !useDirectValue && this._wrap ? this._wrap(newValue) : newValue;
1497
+ const subs = this.subs;
1498
+ if (subs !== void 0) {
1499
+ propagate(subs);
1500
+ if (!batchDepth) {
1501
+ flush();
1502
+ }
1678
1503
  }
1679
1504
  }
1680
1505
  }
1506
+ update() {
1507
+ this.flags &= ~ReactiveFlags.Dirty;
1508
+ return hasChanged(this._oldValue, this._oldValue = this._rawValue);
1509
+ }
1681
1510
  }
1682
1511
  function triggerRef(ref2) {
1683
- if (ref2.dep) {
1684
- {
1685
- ref2.dep.trigger();
1512
+ const dep = ref2.dep;
1513
+ if (dep !== void 0 && dep.subs !== void 0) {
1514
+ propagate(dep.subs);
1515
+ shallowPropagate(dep.subs);
1516
+ if (!batchDepth) {
1517
+ flush();
1686
1518
  }
1687
1519
  }
1688
1520
  }
1521
+ function trackRef(dep) {
1522
+ if (activeSub !== void 0) {
1523
+ link(dep, activeSub);
1524
+ }
1525
+ }
1689
1526
  function unref(ref2) {
1690
1527
  return isRef(ref2) ? ref2.value : ref2;
1691
1528
  }
@@ -1709,13 +1546,21 @@ function proxyRefs(objectWithRefs) {
1709
1546
  }
1710
1547
  class CustomRefImpl {
1711
1548
  constructor(factory) {
1549
+ this.subs = void 0;
1550
+ this.subsTail = void 0;
1551
+ this.flags = ReactiveFlags.None;
1712
1552
  this["__v_isRef"] = true;
1713
1553
  this._value = void 0;
1714
- const dep = this.dep = new Dep();
1715
- const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
1554
+ const { get, set } = factory(
1555
+ () => trackRef(this),
1556
+ () => triggerRef(this)
1557
+ );
1716
1558
  this._get = get;
1717
1559
  this._set = set;
1718
1560
  }
1561
+ get dep() {
1562
+ return this;
1563
+ }
1719
1564
  get value() {
1720
1565
  return this._value = this._get();
1721
1566
  }
@@ -1779,65 +1624,317 @@ function propertyToRef(source, key, defaultValue) {
1779
1624
  return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1780
1625
  }
1781
1626
 
1782
- class ComputedRefImpl {
1783
- constructor(fn, setter, isSSR) {
1784
- this.fn = fn;
1785
- this.setter = setter;
1786
- /**
1787
- * @internal
1788
- */
1789
- this._value = void 0;
1790
- /**
1791
- * @internal
1792
- */
1793
- this.dep = new Dep(this);
1627
+ class ReactiveEffect {
1628
+ constructor(fn) {
1629
+ this.deps = void 0;
1630
+ this.depsTail = void 0;
1631
+ this.subs = void 0;
1632
+ this.subsTail = void 0;
1633
+ this.flags = ReactiveFlags.Watching | ReactiveFlags.Dirty;
1794
1634
  /**
1795
1635
  * @internal
1796
1636
  */
1797
- this.__v_isRef = true;
1798
- // TODO isolatedDeclarations "__v_isReadonly"
1799
- // A computed is also a subscriber that tracks other deps
1637
+ this.cleanups = [];
1800
1638
  /**
1801
1639
  * @internal
1802
1640
  */
1641
+ this.cleanupsLength = 0;
1642
+ if (fn !== void 0) {
1643
+ this.fn = fn;
1644
+ }
1645
+ if (activeEffectScope) {
1646
+ link(this, activeEffectScope);
1647
+ }
1648
+ }
1649
+ // @ts-expect-error
1650
+ fn() {
1651
+ }
1652
+ get active() {
1653
+ return !(this.flags & 1024);
1654
+ }
1655
+ pause() {
1656
+ this.flags |= 256;
1657
+ }
1658
+ resume() {
1659
+ const flags = this.flags &= -257;
1660
+ if (flags & (ReactiveFlags.Dirty | ReactiveFlags.Pending)) {
1661
+ this.notify();
1662
+ }
1663
+ }
1664
+ notify() {
1665
+ if (!(this.flags & 256) && this.dirty) {
1666
+ this.run();
1667
+ }
1668
+ }
1669
+ run() {
1670
+ if (!this.active) {
1671
+ return this.fn();
1672
+ }
1673
+ cleanup(this);
1674
+ const prevSub = startTracking(this);
1675
+ try {
1676
+ return this.fn();
1677
+ } finally {
1678
+ endTracking(this, prevSub);
1679
+ const flags = this.flags;
1680
+ if ((flags & (ReactiveFlags.Recursed | 128)) === (ReactiveFlags.Recursed | 128)) {
1681
+ this.flags = flags & ~ReactiveFlags.Recursed;
1682
+ this.notify();
1683
+ }
1684
+ }
1685
+ }
1686
+ stop() {
1687
+ if (!this.active) {
1688
+ return;
1689
+ }
1690
+ this.flags = 1024;
1691
+ let dep = this.deps;
1692
+ while (dep !== void 0) {
1693
+ dep = unlink(dep, this);
1694
+ }
1695
+ const sub = this.subs;
1696
+ if (sub !== void 0) {
1697
+ unlink(sub);
1698
+ }
1699
+ cleanup(this);
1700
+ }
1701
+ get dirty() {
1702
+ const flags = this.flags;
1703
+ if (flags & ReactiveFlags.Dirty) {
1704
+ return true;
1705
+ }
1706
+ if (flags & ReactiveFlags.Pending) {
1707
+ if (checkDirty(this.deps, this)) {
1708
+ this.flags = flags | ReactiveFlags.Dirty;
1709
+ return true;
1710
+ } else {
1711
+ this.flags = flags & ~ReactiveFlags.Pending;
1712
+ }
1713
+ }
1714
+ return false;
1715
+ }
1716
+ }
1717
+ function effect(fn, options) {
1718
+ if (fn.effect instanceof ReactiveEffect) {
1719
+ fn = fn.effect.fn;
1720
+ }
1721
+ const e = new ReactiveEffect(fn);
1722
+ if (options) {
1723
+ const { onStop, scheduler } = options;
1724
+ if (onStop) {
1725
+ options.onStop = void 0;
1726
+ const stop2 = e.stop.bind(e);
1727
+ e.stop = () => {
1728
+ stop2();
1729
+ onStop();
1730
+ };
1731
+ }
1732
+ if (scheduler) {
1733
+ options.scheduler = void 0;
1734
+ e.notify = () => {
1735
+ if (!(e.flags & 256)) {
1736
+ scheduler();
1737
+ }
1738
+ };
1739
+ }
1740
+ extend(e, options);
1741
+ }
1742
+ try {
1743
+ e.run();
1744
+ } catch (err) {
1745
+ e.stop();
1746
+ throw err;
1747
+ }
1748
+ const runner = e.run.bind(e);
1749
+ runner.effect = e;
1750
+ return runner;
1751
+ }
1752
+ function stop(runner) {
1753
+ runner.effect.stop();
1754
+ }
1755
+ function cleanup(sub) {
1756
+ const l = sub.cleanupsLength;
1757
+ if (l) {
1758
+ for (let i = 0; i < l; i++) {
1759
+ sub.cleanups[i]();
1760
+ }
1761
+ sub.cleanupsLength = 0;
1762
+ }
1763
+ }
1764
+
1765
+ let activeEffectScope;
1766
+ class EffectScope {
1767
+ constructor(detached = false) {
1803
1768
  this.deps = void 0;
1769
+ this.depsTail = void 0;
1770
+ this.subs = void 0;
1771
+ this.subsTail = void 0;
1772
+ this.flags = 0;
1804
1773
  /**
1805
1774
  * @internal
1806
1775
  */
1807
- this.depsTail = void 0;
1776
+ this.cleanups = [];
1808
1777
  /**
1809
1778
  * @internal
1810
1779
  */
1811
- this.flags = 16;
1780
+ this.cleanupsLength = 0;
1781
+ if (!detached && activeEffectScope) {
1782
+ link(this, activeEffectScope);
1783
+ }
1784
+ }
1785
+ get active() {
1786
+ return !(this.flags & 1024);
1787
+ }
1788
+ pause() {
1789
+ if (!(this.flags & 256)) {
1790
+ this.flags |= 256;
1791
+ for (let link2 = this.deps; link2 !== void 0; link2 = link2.nextDep) {
1792
+ const dep = link2.dep;
1793
+ if ("pause" in dep) {
1794
+ dep.pause();
1795
+ }
1796
+ }
1797
+ }
1798
+ }
1799
+ /**
1800
+ * Resumes the effect scope, including all child scopes and effects.
1801
+ */
1802
+ resume() {
1803
+ const flags = this.flags;
1804
+ if (flags & 256) {
1805
+ this.flags = flags & -257;
1806
+ for (let link2 = this.deps; link2 !== void 0; link2 = link2.nextDep) {
1807
+ const dep = link2.dep;
1808
+ if ("resume" in dep) {
1809
+ dep.resume();
1810
+ }
1811
+ }
1812
+ }
1813
+ }
1814
+ run(fn) {
1815
+ const prevScope = activeEffectScope;
1816
+ try {
1817
+ activeEffectScope = this;
1818
+ return fn();
1819
+ } finally {
1820
+ activeEffectScope = prevScope;
1821
+ }
1822
+ }
1823
+ stop() {
1824
+ if (!this.active) {
1825
+ return;
1826
+ }
1827
+ this.flags = 1024;
1828
+ let dep = this.deps;
1829
+ while (dep !== void 0) {
1830
+ const node = dep.dep;
1831
+ if ("stop" in node) {
1832
+ dep = dep.nextDep;
1833
+ node.stop();
1834
+ } else {
1835
+ dep = unlink(dep, this);
1836
+ }
1837
+ }
1838
+ const sub = this.subs;
1839
+ if (sub !== void 0) {
1840
+ unlink(sub);
1841
+ }
1842
+ cleanup(this);
1843
+ }
1844
+ }
1845
+ function effectScope(detached) {
1846
+ return new EffectScope(detached);
1847
+ }
1848
+ function getCurrentScope() {
1849
+ return activeEffectScope;
1850
+ }
1851
+ function setCurrentScope(scope) {
1852
+ try {
1853
+ return activeEffectScope;
1854
+ } finally {
1855
+ activeEffectScope = scope;
1856
+ }
1857
+ }
1858
+ function onScopeDispose(fn, failSilently = false) {
1859
+ if (activeEffectScope !== void 0) {
1860
+ activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
1861
+ }
1862
+ }
1863
+
1864
+ class ComputedRefImpl {
1865
+ constructor(fn, setter) {
1866
+ this.fn = fn;
1867
+ this.setter = setter;
1812
1868
  /**
1813
1869
  * @internal
1814
1870
  */
1815
- this.globalVersion = globalVersion - 1;
1871
+ this._value = void 0;
1872
+ this.subs = void 0;
1873
+ this.subsTail = void 0;
1874
+ this.deps = void 0;
1875
+ this.depsTail = void 0;
1876
+ this.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty;
1816
1877
  /**
1817
1878
  * @internal
1818
1879
  */
1819
- this.next = void 0;
1820
- // for backwards compat
1821
- this.effect = this;
1880
+ this.__v_isRef = true;
1822
1881
  this["__v_isReadonly"] = !setter;
1823
- this.isSSR = isSSR;
1882
+ }
1883
+ // TODO isolatedDeclarations "__v_isReadonly"
1884
+ // for backwards compat
1885
+ get effect() {
1886
+ return this;
1887
+ }
1888
+ // for backwards compat
1889
+ get dep() {
1890
+ return this;
1824
1891
  }
1825
1892
  /**
1826
1893
  * @internal
1894
+ * for backwards compat
1827
1895
  */
1828
- notify() {
1829
- this.flags |= 16;
1830
- if (!(this.flags & 8) && // avoid infinite self recursion
1831
- activeSub !== this) {
1832
- batch(this, true);
1896
+ get _dirty() {
1897
+ const flags = this.flags;
1898
+ if (flags & ReactiveFlags.Dirty) {
1833
1899
  return true;
1834
1900
  }
1901
+ if (flags & ReactiveFlags.Pending) {
1902
+ if (checkDirty(this.deps, this)) {
1903
+ this.flags = flags | ReactiveFlags.Dirty;
1904
+ return true;
1905
+ } else {
1906
+ this.flags = flags & ~ReactiveFlags.Pending;
1907
+ }
1908
+ }
1909
+ return false;
1910
+ }
1911
+ /**
1912
+ * @internal
1913
+ * for backwards compat
1914
+ */
1915
+ set _dirty(v) {
1916
+ if (v) {
1917
+ this.flags |= ReactiveFlags.Dirty;
1918
+ } else {
1919
+ this.flags &= ~(ReactiveFlags.Dirty | ReactiveFlags.Pending);
1920
+ }
1835
1921
  }
1836
1922
  get value() {
1837
- const link = this.dep.track();
1838
- refreshComputed(this);
1839
- if (link) {
1840
- link.version = this.dep.version;
1923
+ const flags = this.flags;
1924
+ if (flags & ReactiveFlags.Dirty || flags & ReactiveFlags.Pending && checkDirty(this.deps, this)) {
1925
+ if (this.update()) {
1926
+ const subs = this.subs;
1927
+ if (subs !== void 0) {
1928
+ shallowPropagate(subs);
1929
+ }
1930
+ }
1931
+ } else if (flags & ReactiveFlags.Pending) {
1932
+ this.flags = flags & ~ReactiveFlags.Pending;
1933
+ }
1934
+ if (activeSub !== void 0) {
1935
+ link(this, activeSub);
1936
+ } else if (activeEffectScope !== void 0) {
1937
+ link(this, activeEffectScope);
1841
1938
  }
1842
1939
  return this._value;
1843
1940
  }
@@ -1846,6 +1943,20 @@ class ComputedRefImpl {
1846
1943
  this.setter(newValue);
1847
1944
  }
1848
1945
  }
1946
+ update() {
1947
+ const prevSub = startTracking(this);
1948
+ try {
1949
+ const oldValue = this._value;
1950
+ const newValue = this.fn(oldValue);
1951
+ if (hasChanged(oldValue, newValue)) {
1952
+ this._value = newValue;
1953
+ return true;
1954
+ }
1955
+ return false;
1956
+ } finally {
1957
+ endTracking(this, prevSub);
1958
+ }
1959
+ }
1849
1960
  }
1850
1961
  function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1851
1962
  let getter;
@@ -1856,7 +1967,7 @@ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1856
1967
  getter = getterOrOptions.get;
1857
1968
  setter = getterOrOptions.set;
1858
1969
  }
1859
- const cRef = new ComputedRefImpl(getter, setter, isSSR);
1970
+ const cRef = new ComputedRefImpl(getter, setter);
1860
1971
  return cRef;
1861
1972
  }
1862
1973
 
@@ -1873,159 +1984,128 @@ const TriggerOpTypes = {
1873
1984
  };
1874
1985
 
1875
1986
  const INITIAL_WATCHER_VALUE = {};
1876
- const cleanupMap = /* @__PURE__ */ new WeakMap();
1877
1987
  let activeWatcher = void 0;
1878
1988
  function getCurrentWatcher() {
1879
1989
  return activeWatcher;
1880
1990
  }
1881
1991
  function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
1882
1992
  if (owner) {
1883
- let cleanups = cleanupMap.get(owner);
1884
- if (!cleanups) cleanupMap.set(owner, cleanups = []);
1885
- cleanups.push(cleanupFn);
1886
- }
1887
- }
1888
- function watch$1(source, cb, options = EMPTY_OBJ) {
1889
- const { immediate, deep, once, scheduler, augmentJob, call } = options;
1890
- const reactiveGetter = (source2) => {
1891
- if (deep) return source2;
1892
- if (isShallow(source2) || deep === false || deep === 0)
1893
- return traverse(source2, 1);
1894
- return traverse(source2);
1895
- };
1896
- let effect;
1897
- let getter;
1898
- let cleanup;
1899
- let boundCleanup;
1900
- let forceTrigger = false;
1901
- let isMultiSource = false;
1902
- if (isRef(source)) {
1903
- getter = () => source.value;
1904
- forceTrigger = isShallow(source);
1905
- } else if (isReactive(source)) {
1906
- getter = () => reactiveGetter(source);
1907
- forceTrigger = true;
1908
- } else if (isArray(source)) {
1909
- isMultiSource = true;
1910
- forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
1911
- getter = () => source.map((s) => {
1912
- if (isRef(s)) {
1913
- return s.value;
1914
- } else if (isReactive(s)) {
1915
- return reactiveGetter(s);
1916
- } else if (isFunction(s)) {
1917
- return call ? call(s, 2) : s();
1918
- } else ;
1919
- });
1920
- } else if (isFunction(source)) {
1921
- if (cb) {
1922
- getter = call ? () => call(source, 2) : source;
1993
+ const { call } = owner.options;
1994
+ if (call) {
1995
+ owner.cleanups[owner.cleanupsLength++] = () => call(cleanupFn, 4);
1923
1996
  } else {
1924
- getter = () => {
1925
- if (cleanup) {
1926
- pauseTracking();
1997
+ owner.cleanups[owner.cleanupsLength++] = cleanupFn;
1998
+ }
1999
+ }
2000
+ }
2001
+ class WatcherEffect extends ReactiveEffect {
2002
+ constructor(source, cb, options = EMPTY_OBJ) {
2003
+ const { deep, once, call, onWarn } = options;
2004
+ let getter;
2005
+ let forceTrigger = false;
2006
+ let isMultiSource = false;
2007
+ if (isRef(source)) {
2008
+ getter = () => source.value;
2009
+ forceTrigger = isShallow(source);
2010
+ } else if (isReactive(source)) {
2011
+ getter = () => reactiveGetter(source, deep);
2012
+ forceTrigger = true;
2013
+ } else if (isArray(source)) {
2014
+ isMultiSource = true;
2015
+ forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
2016
+ getter = () => source.map((s) => {
2017
+ if (isRef(s)) {
2018
+ return s.value;
2019
+ } else if (isReactive(s)) {
2020
+ return reactiveGetter(s, deep);
2021
+ } else if (isFunction(s)) {
2022
+ return call ? call(s, 2) : s();
2023
+ } else ;
2024
+ });
2025
+ } else if (isFunction(source)) {
2026
+ if (cb) {
2027
+ getter = call ? () => call(source, 2) : source;
2028
+ } else {
2029
+ getter = () => {
2030
+ if (this.cleanupsLength) {
2031
+ const prevSub = setActiveSub();
2032
+ try {
2033
+ cleanup(this);
2034
+ } finally {
2035
+ setActiveSub(prevSub);
2036
+ }
2037
+ }
2038
+ const currentEffect = activeWatcher;
2039
+ activeWatcher = this;
1927
2040
  try {
1928
- cleanup();
2041
+ return call ? call(source, 3, [
2042
+ this.boundCleanup
2043
+ ]) : source(this.boundCleanup);
1929
2044
  } finally {
1930
- resetTracking();
2045
+ activeWatcher = currentEffect;
1931
2046
  }
1932
- }
1933
- const currentEffect = activeWatcher;
1934
- activeWatcher = effect;
1935
- try {
1936
- return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
1937
- } finally {
1938
- activeWatcher = currentEffect;
1939
- }
2047
+ };
2048
+ }
2049
+ } else {
2050
+ getter = NOOP;
2051
+ }
2052
+ if (cb && deep) {
2053
+ const baseGetter = getter;
2054
+ const depth = deep === true ? Infinity : deep;
2055
+ getter = () => traverse(baseGetter(), depth);
2056
+ }
2057
+ super(getter);
2058
+ this.cb = cb;
2059
+ this.options = options;
2060
+ this.boundCleanup = (fn) => onWatcherCleanup(fn, false, this);
2061
+ this.forceTrigger = forceTrigger;
2062
+ this.isMultiSource = isMultiSource;
2063
+ if (once && cb) {
2064
+ const _cb = cb;
2065
+ cb = (...args) => {
2066
+ _cb(...args);
2067
+ this.stop();
1940
2068
  };
1941
2069
  }
1942
- } else {
1943
- getter = NOOP;
1944
- }
1945
- if (cb && deep) {
1946
- const baseGetter = getter;
1947
- const depth = deep === true ? Infinity : deep;
1948
- getter = () => traverse(baseGetter(), depth);
1949
- }
1950
- const scope = getCurrentScope();
1951
- const watchHandle = () => {
1952
- effect.stop();
1953
- if (scope && scope.active) {
1954
- remove(scope.effects, effect);
1955
- }
1956
- };
1957
- if (once && cb) {
1958
- const _cb = cb;
1959
- cb = (...args) => {
1960
- _cb(...args);
1961
- watchHandle();
1962
- };
2070
+ this.cb = cb;
2071
+ this.oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
1963
2072
  }
1964
- let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
1965
- const job = (immediateFirstRun) => {
1966
- if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
2073
+ run(initialRun = false) {
2074
+ const oldValue = this.oldValue;
2075
+ const newValue = this.oldValue = super.run();
2076
+ if (!this.cb) {
1967
2077
  return;
1968
2078
  }
1969
- if (cb) {
1970
- const newValue = effect.run();
1971
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
1972
- if (cleanup) {
1973
- cleanup();
1974
- }
1975
- const currentWatcher = activeWatcher;
1976
- activeWatcher = effect;
1977
- try {
1978
- const args = [
1979
- newValue,
1980
- // pass undefined as the old value when it's changed for the first time
1981
- oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
1982
- boundCleanup
1983
- ];
1984
- oldValue = newValue;
1985
- call ? call(cb, 3, args) : (
1986
- // @ts-expect-error
1987
- cb(...args)
1988
- );
1989
- } finally {
1990
- activeWatcher = currentWatcher;
1991
- }
1992
- }
1993
- } else {
1994
- effect.run();
2079
+ const { immediate, deep, call } = this.options;
2080
+ if (initialRun && !immediate) {
2081
+ return;
1995
2082
  }
1996
- };
1997
- if (augmentJob) {
1998
- augmentJob(job);
1999
- }
2000
- effect = new ReactiveEffect(getter);
2001
- effect.scheduler = scheduler ? () => scheduler(job, false) : job;
2002
- boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
2003
- cleanup = effect.onStop = () => {
2004
- const cleanups = cleanupMap.get(effect);
2005
- if (cleanups) {
2006
- if (call) {
2007
- call(cleanups, 4);
2008
- } else {
2009
- for (const cleanup2 of cleanups) cleanup2();
2083
+ if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2084
+ cleanup(this);
2085
+ const currentWatcher = activeWatcher;
2086
+ activeWatcher = this;
2087
+ try {
2088
+ const args = [
2089
+ newValue,
2090
+ // pass undefined as the old value when it's changed for the first time
2091
+ oldValue === INITIAL_WATCHER_VALUE ? void 0 : this.isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
2092
+ this.boundCleanup
2093
+ ];
2094
+ call ? call(this.cb, 3, args) : (
2095
+ // @ts-expect-error
2096
+ this.cb(...args)
2097
+ );
2098
+ } finally {
2099
+ activeWatcher = currentWatcher;
2010
2100
  }
2011
- cleanupMap.delete(effect);
2012
- }
2013
- };
2014
- if (cb) {
2015
- if (immediate) {
2016
- job(true);
2017
- } else {
2018
- oldValue = effect.run();
2019
2101
  }
2020
- } else if (scheduler) {
2021
- scheduler(job.bind(null, true), true);
2022
- } else {
2023
- effect.run();
2024
2102
  }
2025
- watchHandle.pause = effect.pause.bind(effect);
2026
- watchHandle.resume = effect.resume.bind(effect);
2027
- watchHandle.stop = watchHandle;
2028
- return watchHandle;
2103
+ }
2104
+ function reactiveGetter(source, deep) {
2105
+ if (deep) return source;
2106
+ if (isShallow(source) || deep === false || deep === 0)
2107
+ return traverse(source, 1);
2108
+ return traverse(source);
2029
2109
  }
2030
2110
  function traverse(value, depth = Infinity, seen) {
2031
2111
  if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
@@ -2060,7 +2140,7 @@ function traverse(value, depth = Infinity, seen) {
2060
2140
  return value;
2061
2141
  }
2062
2142
 
2063
- function pushWarningContext(vnode) {
2143
+ function pushWarningContext(ctx) {
2064
2144
  }
2065
2145
  function popWarningContext() {
2066
2146
  }
@@ -2157,11 +2237,10 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
2157
2237
  }
2158
2238
  }
2159
2239
  function handleError(err, instance, type, throwInDev = true) {
2160
- const contextVNode = instance ? instance.vnode : null;
2161
2240
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2162
2241
  if (instance) {
2163
2242
  let cur = instance.parent;
2164
- const exposedInstance = instance.proxy;
2243
+ const exposedInstance = instance.proxy || instance;
2165
2244
  const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
2166
2245
  while (cur) {
2167
2246
  const errorCapturedHooks = cur.ec;
@@ -2175,19 +2254,19 @@ function handleError(err, instance, type, throwInDev = true) {
2175
2254
  cur = cur.parent;
2176
2255
  }
2177
2256
  if (errorHandler) {
2178
- pauseTracking();
2257
+ const prevSub = setActiveSub();
2179
2258
  callWithErrorHandling(errorHandler, null, 10, [
2180
2259
  err,
2181
2260
  exposedInstance,
2182
2261
  errorInfo
2183
2262
  ]);
2184
- resetTracking();
2263
+ setActiveSub(prevSub);
2185
2264
  return;
2186
2265
  }
2187
2266
  }
2188
- logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
2267
+ logError(err, type, instance, throwInDev, throwUnhandledErrorInProduction);
2189
2268
  }
2190
- function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
2269
+ function logError(err, type, instance, throwInDev = true, throwInProd = false) {
2191
2270
  if (throwInProd) {
2192
2271
  throw err;
2193
2272
  } else {
@@ -2195,25 +2274,22 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
2195
2274
  }
2196
2275
  }
2197
2276
 
2198
- const queue = [];
2199
- let flushIndex = -1;
2200
- const pendingPostFlushCbs = [];
2201
- let activePostFlushCbs = null;
2277
+ const jobs = [];
2278
+ let postJobs = [];
2279
+ let activePostJobs = null;
2280
+ let currentFlushPromise = null;
2281
+ let jobsLength = 0;
2282
+ let flushIndex = 0;
2202
2283
  let postFlushIndex = 0;
2203
2284
  const resolvedPromise = /* @__PURE__ */ Promise.resolve();
2204
- let currentFlushPromise = null;
2205
2285
  function nextTick(fn) {
2206
2286
  const p = currentFlushPromise || resolvedPromise;
2207
2287
  return fn ? p.then(this ? fn.bind(this) : fn) : p;
2208
2288
  }
2209
- function findInsertionIndex(id) {
2210
- let start = flushIndex + 1;
2211
- let end = queue.length;
2289
+ function findInsertionIndex(order, queue, start, end) {
2212
2290
  while (start < end) {
2213
2291
  const middle = start + end >>> 1;
2214
- const middleJob = queue[middle];
2215
- const middleJobId = getId(middleJob);
2216
- if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
2292
+ if (queue[middle].order <= order) {
2217
2293
  start = middle + 1;
2218
2294
  } else {
2219
2295
  end = middle;
@@ -2221,112 +2297,151 @@ function findInsertionIndex(id) {
2221
2297
  }
2222
2298
  return start;
2223
2299
  }
2224
- function queueJob(job) {
2225
- if (!(job.flags & 1)) {
2226
- const jobId = getId(job);
2227
- const lastJob = queue[queue.length - 1];
2228
- if (!lastJob || // fast path when the job id is larger than the tail
2229
- !(job.flags & 2) && jobId >= getId(lastJob)) {
2230
- queue.push(job);
2300
+ function queueJob(job, id, isPre = false) {
2301
+ if (queueJobWorker(
2302
+ job,
2303
+ id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1,
2304
+ jobs,
2305
+ jobsLength,
2306
+ flushIndex
2307
+ )) {
2308
+ jobsLength++;
2309
+ queueFlush();
2310
+ }
2311
+ }
2312
+ function queueJobWorker(job, order, queue, length, flushIndex2) {
2313
+ const flags = job.flags;
2314
+ if (!(flags & 1)) {
2315
+ job.flags = flags | 1;
2316
+ job.order = order;
2317
+ if (flushIndex2 === length || // fast path when the job id is larger than the tail
2318
+ order >= queue[length - 1].order) {
2319
+ queue[length] = job;
2231
2320
  } else {
2232
- queue.splice(findInsertionIndex(jobId), 0, job);
2321
+ queue.splice(findInsertionIndex(order, queue, flushIndex2, length), 0, job);
2233
2322
  }
2234
- job.flags |= 1;
2235
- queueFlush();
2323
+ return true;
2236
2324
  }
2325
+ return false;
2237
2326
  }
2327
+ const doFlushJobs = () => {
2328
+ try {
2329
+ flushJobs();
2330
+ } catch (e) {
2331
+ currentFlushPromise = null;
2332
+ throw e;
2333
+ }
2334
+ };
2238
2335
  function queueFlush() {
2239
2336
  if (!currentFlushPromise) {
2240
- currentFlushPromise = resolvedPromise.then(flushJobs);
2337
+ currentFlushPromise = resolvedPromise.then(doFlushJobs);
2241
2338
  }
2242
2339
  }
2243
- function queuePostFlushCb(cb) {
2244
- if (!isArray(cb)) {
2245
- if (activePostFlushCbs && cb.id === -1) {
2246
- activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
2247
- } else if (!(cb.flags & 1)) {
2248
- pendingPostFlushCbs.push(cb);
2249
- cb.flags |= 1;
2340
+ function queuePostFlushCb(jobs2, id = Infinity) {
2341
+ if (!isArray(jobs2)) {
2342
+ if (activePostJobs && id === -1) {
2343
+ activePostJobs.splice(postFlushIndex, 0, jobs2);
2344
+ } else {
2345
+ queueJobWorker(jobs2, id, postJobs, postJobs.length, 0);
2250
2346
  }
2251
2347
  } else {
2252
- pendingPostFlushCbs.push(...cb);
2348
+ for (const job of jobs2) {
2349
+ queueJobWorker(job, id, postJobs, postJobs.length, 0);
2350
+ }
2253
2351
  }
2254
2352
  queueFlush();
2255
2353
  }
2256
- function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2257
- for (; i < queue.length; i++) {
2258
- const cb = queue[i];
2259
- if (cb && cb.flags & 2) {
2260
- if (instance && cb.id !== instance.uid) {
2261
- continue;
2262
- }
2263
- queue.splice(i, 1);
2264
- i--;
2265
- if (cb.flags & 4) {
2266
- cb.flags &= -2;
2267
- }
2268
- cb();
2269
- if (!(cb.flags & 4)) {
2270
- cb.flags &= -2;
2271
- }
2354
+ function flushPreFlushCbs(instance, seen) {
2355
+ for (let i = flushIndex; i < jobsLength; i++) {
2356
+ const cb = jobs[i];
2357
+ if (cb.order & 1 || cb.order === Infinity) {
2358
+ continue;
2359
+ }
2360
+ if (instance && cb.order !== instance.uid * 2) {
2361
+ continue;
2362
+ }
2363
+ jobs.splice(i, 1);
2364
+ i--;
2365
+ jobsLength--;
2366
+ if (cb.flags & 2) {
2367
+ cb.flags &= -2;
2368
+ }
2369
+ cb();
2370
+ if (!(cb.flags & 2)) {
2371
+ cb.flags &= -2;
2272
2372
  }
2273
2373
  }
2274
2374
  }
2275
2375
  function flushPostFlushCbs(seen) {
2276
- if (pendingPostFlushCbs.length) {
2277
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
2278
- (a, b) => getId(a) - getId(b)
2279
- );
2280
- pendingPostFlushCbs.length = 0;
2281
- if (activePostFlushCbs) {
2282
- activePostFlushCbs.push(...deduped);
2376
+ if (postJobs.length) {
2377
+ if (activePostJobs) {
2378
+ activePostJobs.push(...postJobs);
2379
+ postJobs.length = 0;
2283
2380
  return;
2284
2381
  }
2285
- activePostFlushCbs = deduped;
2286
- for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
2287
- const cb = activePostFlushCbs[postFlushIndex];
2288
- if (cb.flags & 4) {
2382
+ activePostJobs = postJobs;
2383
+ postJobs = [];
2384
+ while (postFlushIndex < activePostJobs.length) {
2385
+ const cb = activePostJobs[postFlushIndex++];
2386
+ if (cb.flags & 2) {
2289
2387
  cb.flags &= -2;
2290
2388
  }
2291
- if (!(cb.flags & 8)) cb();
2292
- cb.flags &= -2;
2389
+ if (!(cb.flags & 4)) {
2390
+ try {
2391
+ cb();
2392
+ } finally {
2393
+ cb.flags &= -2;
2394
+ }
2395
+ }
2293
2396
  }
2294
- activePostFlushCbs = null;
2397
+ activePostJobs = null;
2295
2398
  postFlushIndex = 0;
2296
2399
  }
2297
2400
  }
2298
- const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
2401
+ let isFlushing = false;
2402
+ function flushOnAppMount() {
2403
+ if (!isFlushing) {
2404
+ isFlushing = true;
2405
+ flushPreFlushCbs();
2406
+ flushPostFlushCbs();
2407
+ isFlushing = false;
2408
+ }
2409
+ }
2299
2410
  function flushJobs(seen) {
2300
2411
  try {
2301
- for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
2302
- const job = queue[flushIndex];
2303
- if (job && !(job.flags & 8)) {
2412
+ while (flushIndex < jobsLength) {
2413
+ const job = jobs[flushIndex];
2414
+ jobs[flushIndex++] = void 0;
2415
+ if (!(job.flags & 4)) {
2304
2416
  if (false) ;
2305
- if (job.flags & 4) {
2417
+ if (job.flags & 2) {
2306
2418
  job.flags &= ~1;
2307
2419
  }
2308
- callWithErrorHandling(
2309
- job,
2310
- job.i,
2311
- job.i ? 15 : 14
2312
- );
2313
- if (!(job.flags & 4)) {
2314
- job.flags &= ~1;
2420
+ try {
2421
+ job();
2422
+ } catch (err) {
2423
+ handleError(
2424
+ err,
2425
+ job.i,
2426
+ job.i ? 15 : 14
2427
+ );
2428
+ } finally {
2429
+ if (!(job.flags & 2)) {
2430
+ job.flags &= ~1;
2431
+ }
2315
2432
  }
2316
2433
  }
2317
2434
  }
2318
2435
  } finally {
2319
- for (; flushIndex < queue.length; flushIndex++) {
2320
- const job = queue[flushIndex];
2321
- if (job) {
2322
- job.flags &= -2;
2323
- }
2436
+ while (flushIndex < jobsLength) {
2437
+ jobs[flushIndex].flags &= -2;
2438
+ jobs[flushIndex++] = void 0;
2324
2439
  }
2325
- flushIndex = -1;
2326
- queue.length = 0;
2440
+ flushIndex = 0;
2441
+ jobsLength = 0;
2327
2442
  flushPostFlushCbs();
2328
2443
  currentFlushPromise = null;
2329
- if (queue.length || pendingPostFlushCbs.length) {
2444
+ if (jobsLength || postJobs.length) {
2330
2445
  flushJobs();
2331
2446
  }
2332
2447
  }
@@ -2385,7 +2500,7 @@ const globalCompatConfig = {
2385
2500
  MODE: 2
2386
2501
  };
2387
2502
  function configureCompat(config) {
2388
- extend$1(globalCompatConfig, config);
2503
+ extend(globalCompatConfig, config);
2389
2504
  }
2390
2505
  function getCompatConfigForKey(key, instance) {
2391
2506
  const instanceConfig = instance && instance.type.compatConfig;
@@ -2522,7 +2637,7 @@ function convertLegacyVModelProps(vnode) {
2522
2637
  function applyModelFromMixins(model, mixins) {
2523
2638
  if (mixins) {
2524
2639
  mixins.forEach((m) => {
2525
- if (m.model) extend$1(model, m.model);
2640
+ if (m.model) extend(model, m.model);
2526
2641
  if (m.mixins) applyModelFromMixins(model, m.mixins);
2527
2642
  });
2528
2643
  }
@@ -2672,14 +2787,14 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
2672
2787
  hook = mapCompatDirectiveHook(name, binding.dir, instance);
2673
2788
  }
2674
2789
  if (hook) {
2675
- pauseTracking();
2790
+ const prevSub = setActiveSub();
2676
2791
  callWithAsyncErrorHandling(hook, instance, 8, [
2677
2792
  vnode.el,
2678
2793
  binding,
2679
2794
  vnode,
2680
2795
  prevVNode
2681
2796
  ]);
2682
- resetTracking();
2797
+ setActiveSub(prevSub);
2683
2798
  }
2684
2799
  }
2685
2800
  }
@@ -2758,29 +2873,37 @@ const TeleportImpl = {
2758
2873
  }
2759
2874
  if (isTeleportDeferred(n2.props)) {
2760
2875
  n2.el.__isMounted = false;
2761
- queuePostRenderEffect(() => {
2762
- mountToTarget();
2763
- delete n2.el.__isMounted;
2764
- }, parentSuspense);
2876
+ queuePostRenderEffect(
2877
+ () => {
2878
+ mountToTarget();
2879
+ delete n2.el.__isMounted;
2880
+ },
2881
+ void 0,
2882
+ parentSuspense
2883
+ );
2765
2884
  } else {
2766
2885
  mountToTarget();
2767
2886
  }
2768
2887
  } else {
2769
2888
  if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
2770
- queuePostRenderEffect(() => {
2771
- TeleportImpl.process(
2772
- n1,
2773
- n2,
2774
- container,
2775
- anchor,
2776
- parentComponent,
2777
- parentSuspense,
2778
- namespace,
2779
- slotScopeIds,
2780
- optimized,
2781
- internals
2782
- );
2783
- }, parentSuspense);
2889
+ queuePostRenderEffect(
2890
+ () => {
2891
+ TeleportImpl.process(
2892
+ n1,
2893
+ n2,
2894
+ container,
2895
+ anchor,
2896
+ parentComponent,
2897
+ parentSuspense,
2898
+ namespace,
2899
+ slotScopeIds,
2900
+ optimized,
2901
+ internals
2902
+ );
2903
+ },
2904
+ void 0,
2905
+ parentSuspense
2906
+ );
2784
2907
  return;
2785
2908
  }
2786
2909
  n2.el = n1.el;
@@ -2827,6 +2950,7 @@ const TeleportImpl = {
2827
2950
  container,
2828
2951
  mainAnchor,
2829
2952
  internals,
2953
+ parentComponent,
2830
2954
  1
2831
2955
  );
2832
2956
  } else {
@@ -2846,6 +2970,7 @@ const TeleportImpl = {
2846
2970
  nextTarget,
2847
2971
  null,
2848
2972
  internals,
2973
+ parentComponent,
2849
2974
  0
2850
2975
  );
2851
2976
  }
@@ -2855,6 +2980,7 @@ const TeleportImpl = {
2855
2980
  target,
2856
2981
  targetAnchor,
2857
2982
  internals,
2983
+ parentComponent,
2858
2984
  1
2859
2985
  );
2860
2986
  }
@@ -2894,7 +3020,7 @@ const TeleportImpl = {
2894
3020
  move: moveTeleport,
2895
3021
  hydrate: hydrateTeleport
2896
3022
  };
2897
- function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
3023
+ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
2898
3024
  if (moveType === 0) {
2899
3025
  insert(vnode.targetAnchor, container, parentAnchor);
2900
3026
  }
@@ -2910,7 +3036,8 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
2910
3036
  children[i],
2911
3037
  container,
2912
3038
  parentAnchor,
2913
- 2
3039
+ 2,
3040
+ parentComponent
2914
3041
  );
2915
3042
  }
2916
3043
  }
@@ -3092,7 +3219,7 @@ const BaseTransitionImpl = {
3092
3219
  state.isLeaving = true;
3093
3220
  leavingHooks.afterLeave = () => {
3094
3221
  state.isLeaving = false;
3095
- if (!(instance.job.flags & 8)) {
3222
+ if (!(instance.job.flags & 4)) {
3096
3223
  instance.update();
3097
3224
  }
3098
3225
  delete leavingHooks.afterLeave;
@@ -3362,12 +3489,12 @@ function defineComponent(options, extraOptions) {
3362
3489
  return isFunction(options) ? (
3363
3490
  // #8236: extend call and options.name access are considered side-effects
3364
3491
  // by Rollup, so we have to wrap it in a pure-annotated IIFE.
3365
- /* @__PURE__ */ (() => extend$1({ name: options.name }, extraOptions, { setup: options }))()
3492
+ /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
3366
3493
  ) : options;
3367
3494
  }
3368
3495
 
3369
3496
  function useId() {
3370
- const i = getCurrentInstance();
3497
+ const i = getCurrentGenericInstance();
3371
3498
  if (i) {
3372
3499
  return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
3373
3500
  }
@@ -3378,7 +3505,7 @@ function markAsyncBoundary(instance) {
3378
3505
  }
3379
3506
 
3380
3507
  function useTemplateRef(key) {
3381
- const i = getCurrentInstance();
3508
+ const i = getCurrentGenericInstance();
3382
3509
  const r = shallowRef(null);
3383
3510
  if (i) {
3384
3511
  const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
@@ -3470,8 +3597,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3470
3597
  } else ;
3471
3598
  };
3472
3599
  if (value) {
3473
- doSet.id = -1;
3474
- queuePostRenderEffect(doSet, parentSuspense);
3600
+ queuePostRenderEffect(doSet, -1, parentSuspense);
3475
3601
  } else {
3476
3602
  doSet();
3477
3603
  }
@@ -3621,6 +3747,9 @@ function createHydrationFunctions(rendererInternals) {
3621
3747
  );
3622
3748
  }
3623
3749
  } else if (shapeFlag & 6) {
3750
+ if (vnode.type.__vapor) {
3751
+ throw new Error("Vapor component hydration is not supported yet.");
3752
+ }
3624
3753
  vnode.slotScopeIds = slotScopeIds;
3625
3754
  const container = parentNode(node);
3626
3755
  if (isFragmentStart) {
@@ -3769,11 +3898,15 @@ function createHydrationFunctions(rendererInternals) {
3769
3898
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
3770
3899
  }
3771
3900
  if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
3772
- queueEffectWithSuspense(() => {
3773
- vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
3774
- needCallTransitionHooks && transition.enter(el);
3775
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
3776
- }, parentSuspense);
3901
+ queueEffectWithSuspense(
3902
+ () => {
3903
+ vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
3904
+ needCallTransitionHooks && transition.enter(el);
3905
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
3906
+ },
3907
+ void 0,
3908
+ parentSuspense
3909
+ );
3777
3910
  }
3778
3911
  }
3779
3912
  return el.nextSibling;
@@ -4160,7 +4293,7 @@ function defineAsyncComponent(source) {
4160
4293
  }
4161
4294
  load().then(() => {
4162
4295
  loaded.value = true;
4163
- if (instance.parent && isKeepAlive(instance.parent.vnode)) {
4296
+ if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
4164
4297
  instance.parent.update();
4165
4298
  }
4166
4299
  }).catch((err) => {
@@ -4203,8 +4336,8 @@ const KeepAliveImpl = {
4203
4336
  max: [String, Number]
4204
4337
  },
4205
4338
  setup(props, { slots }) {
4206
- const instance = getCurrentInstance();
4207
- const sharedContext = instance.ctx;
4339
+ const keepAliveInstance = getCurrentInstance();
4340
+ const sharedContext = keepAliveInstance.ctx;
4208
4341
  if (!sharedContext.renderer) {
4209
4342
  return () => {
4210
4343
  const children = slots.default && slots.default();
@@ -4214,7 +4347,7 @@ const KeepAliveImpl = {
4214
4347
  const cache = /* @__PURE__ */ new Map();
4215
4348
  const keys = /* @__PURE__ */ new Set();
4216
4349
  let current = null;
4217
- const parentSuspense = instance.suspense;
4350
+ const parentSuspense = keepAliveInstance.suspense;
4218
4351
  const {
4219
4352
  renderer: {
4220
4353
  p: patch,
@@ -4225,49 +4358,71 @@ const KeepAliveImpl = {
4225
4358
  } = sharedContext;
4226
4359
  const storageContainer = createElement("div");
4227
4360
  sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4228
- const instance2 = vnode.component;
4229
- move(vnode, container, anchor, 0, parentSuspense);
4361
+ const instance = vnode.component;
4362
+ move(
4363
+ vnode,
4364
+ container,
4365
+ anchor,
4366
+ 0,
4367
+ keepAliveInstance,
4368
+ parentSuspense
4369
+ );
4230
4370
  patch(
4231
- instance2.vnode,
4371
+ instance.vnode,
4232
4372
  vnode,
4233
4373
  container,
4234
4374
  anchor,
4235
- instance2,
4375
+ instance,
4236
4376
  parentSuspense,
4237
4377
  namespace,
4238
4378
  vnode.slotScopeIds,
4239
4379
  optimized
4240
4380
  );
4241
- queuePostRenderEffect(() => {
4242
- instance2.isDeactivated = false;
4243
- if (instance2.a) {
4244
- invokeArrayFns(instance2.a);
4245
- }
4246
- const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
4247
- if (vnodeHook) {
4248
- invokeVNodeHook(vnodeHook, instance2.parent, vnode);
4249
- }
4250
- }, parentSuspense);
4381
+ queuePostRenderEffect(
4382
+ () => {
4383
+ instance.isDeactivated = false;
4384
+ if (instance.a) {
4385
+ invokeArrayFns(instance.a);
4386
+ }
4387
+ const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
4388
+ if (vnodeHook) {
4389
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
4390
+ }
4391
+ },
4392
+ void 0,
4393
+ parentSuspense
4394
+ );
4251
4395
  };
4252
4396
  sharedContext.deactivate = (vnode) => {
4253
- const instance2 = vnode.component;
4254
- invalidateMount(instance2.m);
4255
- invalidateMount(instance2.a);
4256
- move(vnode, storageContainer, null, 1, parentSuspense);
4257
- queuePostRenderEffect(() => {
4258
- if (instance2.da) {
4259
- invokeArrayFns(instance2.da);
4260
- }
4261
- const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
4262
- if (vnodeHook) {
4263
- invokeVNodeHook(vnodeHook, instance2.parent, vnode);
4264
- }
4265
- instance2.isDeactivated = true;
4266
- }, parentSuspense);
4397
+ const instance = vnode.component;
4398
+ invalidateMount(instance.m);
4399
+ invalidateMount(instance.a);
4400
+ move(
4401
+ vnode,
4402
+ storageContainer,
4403
+ null,
4404
+ 1,
4405
+ keepAliveInstance,
4406
+ parentSuspense
4407
+ );
4408
+ queuePostRenderEffect(
4409
+ () => {
4410
+ if (instance.da) {
4411
+ invokeArrayFns(instance.da);
4412
+ }
4413
+ const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
4414
+ if (vnodeHook) {
4415
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
4416
+ }
4417
+ instance.isDeactivated = true;
4418
+ },
4419
+ void 0,
4420
+ parentSuspense
4421
+ );
4267
4422
  };
4268
4423
  function unmount(vnode) {
4269
4424
  resetShapeFlag(vnode);
4270
- _unmount(vnode, instance, parentSuspense, true);
4425
+ _unmount(vnode, keepAliveInstance, parentSuspense, true);
4271
4426
  }
4272
4427
  function pruneCache(filter) {
4273
4428
  cache.forEach((vnode, key) => {
@@ -4299,12 +4454,19 @@ const KeepAliveImpl = {
4299
4454
  let pendingCacheKey = null;
4300
4455
  const cacheSubtree = () => {
4301
4456
  if (pendingCacheKey != null) {
4302
- if (isSuspense(instance.subTree.type)) {
4303
- queuePostRenderEffect(() => {
4304
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
4305
- }, instance.subTree.suspense);
4457
+ if (isSuspense(keepAliveInstance.subTree.type)) {
4458
+ queuePostRenderEffect(
4459
+ () => {
4460
+ cache.set(
4461
+ pendingCacheKey,
4462
+ getInnerChild(keepAliveInstance.subTree)
4463
+ );
4464
+ },
4465
+ void 0,
4466
+ keepAliveInstance.subTree.suspense
4467
+ );
4306
4468
  } else {
4307
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
4469
+ cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
4308
4470
  }
4309
4471
  }
4310
4472
  };
@@ -4312,12 +4474,12 @@ const KeepAliveImpl = {
4312
4474
  onUpdated(cacheSubtree);
4313
4475
  onBeforeUnmount(() => {
4314
4476
  cache.forEach((cached) => {
4315
- const { subTree, suspense } = instance;
4477
+ const { subTree, suspense } = keepAliveInstance;
4316
4478
  const vnode = getInnerChild(subTree);
4317
4479
  if (cached.type === vnode.type && cached.key === vnode.key) {
4318
4480
  resetShapeFlag(vnode);
4319
4481
  const da = vnode.component.da;
4320
- da && queuePostRenderEffect(da, suspense);
4482
+ da && queuePostRenderEffect(da, void 0, suspense);
4321
4483
  return;
4322
4484
  }
4323
4485
  unmount(cached);
@@ -4404,7 +4566,7 @@ function onActivated(hook, target) {
4404
4566
  function onDeactivated(hook, target) {
4405
4567
  registerKeepAliveHook(hook, "da", target);
4406
4568
  }
4407
- function registerKeepAliveHook(hook, type, target = currentInstance) {
4569
+ function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
4408
4570
  const wrappedHook = hook.__wdc || (hook.__wdc = () => {
4409
4571
  let current = target;
4410
4572
  while (current) {
@@ -4418,7 +4580,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
4418
4580
  injectHook(type, wrappedHook, target);
4419
4581
  if (target) {
4420
4582
  let current = target.parent;
4421
- while (current && current.parent) {
4583
+ while (current && current.parent && current.parent.vnode) {
4422
4584
  if (isKeepAlive(current.parent.vnode)) {
4423
4585
  injectToKeepAliveRoot(wrappedHook, type, target, current);
4424
4586
  }
@@ -4450,12 +4612,14 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
4450
4612
  if (target) {
4451
4613
  const hooks = target[type] || (target[type] = []);
4452
4614
  const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
4453
- pauseTracking();
4454
- const reset = setCurrentInstance(target);
4455
- const res = callWithAsyncErrorHandling(hook, target, type, args);
4456
- reset();
4457
- resetTracking();
4458
- return res;
4615
+ const prevSub = setActiveSub();
4616
+ const prev = setCurrentInstance(target);
4617
+ try {
4618
+ return callWithAsyncErrorHandling(hook, target, type, args);
4619
+ } finally {
4620
+ setCurrentInstance(...prev);
4621
+ setActiveSub(prevSub);
4622
+ }
4459
4623
  });
4460
4624
  if (prepend) {
4461
4625
  hooks.unshift(wrappedHook);
@@ -4560,7 +4724,11 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
4560
4724
  const res = (
4561
4725
  // local registration
4562
4726
  // check instance[type] first which is resolved for options API
4563
- resolve(instance[type] || Component[type], name) || // global registration
4727
+ resolve(
4728
+ instance[type] || Component[type],
4729
+ name
4730
+ ) || // global registration
4731
+ // @ts-expect-error filters only exist in compat mode
4564
4732
  resolve(instance.appContext[type], name)
4565
4733
  );
4566
4734
  if (!res && maybeSelfReference) {
@@ -4639,7 +4807,7 @@ function convertLegacyProps(legacyProps, type) {
4639
4807
  const converted = {};
4640
4808
  for (const key in legacyProps) {
4641
4809
  if (key === "attrs" || key === "domProps" || key === "props") {
4642
- extend$1(converted, legacyProps[key]);
4810
+ extend(converted, legacyProps[key]);
4643
4811
  } else if (key === "on" || key === "nativeOn") {
4644
4812
  const listeners = legacyProps[key];
4645
4813
  for (const event in listeners) {
@@ -4727,7 +4895,7 @@ function convertLegacySlots(vnode) {
4727
4895
  if (scopedSlots) {
4728
4896
  delete props.scopedSlots;
4729
4897
  if (slots) {
4730
- extend$1(slots, scopedSlots);
4898
+ extend(slots, scopedSlots);
4731
4899
  } else {
4732
4900
  slots = scopedSlots;
4733
4901
  }
@@ -4890,7 +5058,13 @@ function createSlots(slots, dynamicSlots) {
4890
5058
  }
4891
5059
 
4892
5060
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4893
- if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
5061
+ let slot = slots[name];
5062
+ if (slot && slot.__vapor) {
5063
+ const ret = (openBlock(), createBlock(VaporSlot, props));
5064
+ ret.vs = { slot, fallback };
5065
+ return ret;
5066
+ }
5067
+ if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
4894
5068
  if (name !== "default") props.name = name;
4895
5069
  return openBlock(), createBlock(
4896
5070
  Fragment,
@@ -4899,7 +5073,6 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4899
5073
  64
4900
5074
  );
4901
5075
  }
4902
- let slot = slots[name];
4903
5076
  if (slot && slot._c) {
4904
5077
  slot._d = false;
4905
5078
  }
@@ -4947,7 +5120,7 @@ function toObject(arr) {
4947
5120
  const res = {};
4948
5121
  for (let i = 0; i < arr.length; i++) {
4949
5122
  if (arr[i]) {
4950
- extend$1(res, arr[i]);
5123
+ extend(res, arr[i]);
4951
5124
  }
4952
5125
  }
4953
5126
  return res;
@@ -5066,7 +5239,7 @@ function installCompatInstanceProperties(map) {
5066
5239
  const del = (target, key) => {
5067
5240
  delete target[key];
5068
5241
  };
5069
- extend$1(map, {
5242
+ extend(map, {
5070
5243
  $set: (i) => {
5071
5244
  assertCompatEnabled("INSTANCE_SET", i);
5072
5245
  return set;
@@ -5111,7 +5284,7 @@ function installCompatInstanceProperties(map) {
5111
5284
  if (i.resolvedOptions) {
5112
5285
  return i.resolvedOptions;
5113
5286
  }
5114
- const res = i.resolvedOptions = extend$1({}, resolveMergedOptions(i));
5287
+ const res = i.resolvedOptions = extend({}, resolveMergedOptions(i));
5115
5288
  Object.defineProperties(res, {
5116
5289
  parent: {
5117
5290
  get() {
@@ -5167,14 +5340,15 @@ function installCompatInstanceProperties(map) {
5167
5340
  }
5168
5341
 
5169
5342
  const getPublicInstance = (i) => {
5170
- if (!i) return null;
5171
- if (isStatefulComponent(i)) return getComponentPublicInstance(i);
5343
+ if (!i || i.vapor) return null;
5344
+ if (isStatefulComponent(i))
5345
+ return getComponentPublicInstance(i);
5172
5346
  return getPublicInstance(i.parent);
5173
5347
  };
5174
5348
  const publicPropertiesMap = (
5175
5349
  // Move PURE marker to new line to workaround compiler discarding it
5176
5350
  // due to type annotation
5177
- /* @__PURE__ */ extend$1(/* @__PURE__ */ Object.create(null), {
5351
+ /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
5178
5352
  $: (i) => i,
5179
5353
  $el: (i) => i.vnode.el,
5180
5354
  $data: (i) => i.data,
@@ -5263,7 +5437,7 @@ const PublicInstanceProxyHandlers = {
5263
5437
  return desc.get.call(instance.proxy);
5264
5438
  } else {
5265
5439
  const val = globalProperties[key];
5266
- return isFunction(val) ? extend$1(val.bind(instance.proxy), val) : val;
5440
+ return isFunction(val) ? extend(val.bind(instance.proxy), val) : val;
5267
5441
  }
5268
5442
  }
5269
5443
  } else ;
@@ -5303,7 +5477,7 @@ const PublicInstanceProxyHandlers = {
5303
5477
  return Reflect.defineProperty(target, key, descriptor);
5304
5478
  }
5305
5479
  };
5306
- const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend$1({}, PublicInstanceProxyHandlers, {
5480
+ const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, {
5307
5481
  get(target, key) {
5308
5482
  if (key === Symbol.unscopables) {
5309
5483
  return;
@@ -5354,8 +5528,13 @@ function useAttrs() {
5354
5528
  return getContext().attrs;
5355
5529
  }
5356
5530
  function getContext() {
5357
- const i = getCurrentInstance();
5358
- return i.setupContext || (i.setupContext = createSetupContext(i));
5531
+ const i = getCurrentGenericInstance();
5532
+ if (i.vapor) {
5533
+ return i;
5534
+ } else {
5535
+ const ii = i;
5536
+ return ii.setupContext || (ii.setupContext = createSetupContext(ii));
5537
+ }
5359
5538
  }
5360
5539
  function normalizePropsOrEmits(props) {
5361
5540
  return isArray(props) ? props.reduce(
@@ -5386,7 +5565,7 @@ function mergeDefaults(raw, defaults) {
5386
5565
  function mergeModels(a, b) {
5387
5566
  if (!a || !b) return a || b;
5388
5567
  if (isArray(a) && isArray(b)) return a.concat(b);
5389
- return extend$1({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
5568
+ return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
5390
5569
  }
5391
5570
  function createPropsRestProxy(props, excludedKeys) {
5392
5571
  const ret = {};
@@ -5401,9 +5580,9 @@ function createPropsRestProxy(props, excludedKeys) {
5401
5580
  return ret;
5402
5581
  }
5403
5582
  function withAsyncContext(getAwaitable) {
5404
- const ctx = getCurrentInstance();
5583
+ const ctx = getCurrentGenericInstance();
5405
5584
  let awaitable = getAwaitable();
5406
- unsetCurrentInstance();
5585
+ setCurrentInstance(null, void 0);
5407
5586
  if (isPromise(awaitable)) {
5408
5587
  awaitable = awaitable.catch((e) => {
5409
5588
  setCurrentInstance(ctx);
@@ -5605,7 +5784,8 @@ function createWatcher(raw, ctx, publicThis, key) {
5605
5784
  let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
5606
5785
  const options = {};
5607
5786
  {
5608
- const instance = currentInstance && getCurrentScope() === currentInstance.scope ? currentInstance : null;
5787
+ const cur = getCurrentInstance();
5788
+ const instance = cur && getCurrentScope() === cur.scope ? cur : null;
5609
5789
  const newValue = getter();
5610
5790
  if (isArray(newValue) && isCompatEnabled$1("WATCH_ARRAY", instance)) {
5611
5791
  options.deep = true;
@@ -5636,7 +5816,7 @@ function createWatcher(raw, ctx, publicThis, key) {
5636
5816
  } else {
5637
5817
  const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
5638
5818
  if (isFunction(handler)) {
5639
- watch(getter, handler, extend$1(raw, options) );
5819
+ watch(getter, handler, extend(raw, options) );
5640
5820
  }
5641
5821
  }
5642
5822
  } else ;
@@ -5655,7 +5835,7 @@ function resolveMergedOptions(instance) {
5655
5835
  resolved = cached;
5656
5836
  } else if (!globalMixins.length && !mixins && !extendsOptions) {
5657
5837
  if (isCompatEnabled$1("PRIVATE_APIS", instance)) {
5658
- resolved = extend$1({}, base);
5838
+ resolved = extend({}, base);
5659
5839
  resolved.parent = instance.parent && instance.parent.proxy;
5660
5840
  resolved.propsData = instance.vnode.props;
5661
5841
  } else {
@@ -5738,7 +5918,7 @@ function mergeDataFn(to, from) {
5738
5918
  return from;
5739
5919
  }
5740
5920
  return function mergedDataFn() {
5741
- return (isCompatEnabled$1("OPTIONS_DATA_MERGE", null) ? deepMergeData : extend$1)(
5921
+ return (isCompatEnabled$1("OPTIONS_DATA_MERGE", null) ? deepMergeData : extend)(
5742
5922
  isFunction(to) ? to.call(this, this) : to,
5743
5923
  isFunction(from) ? from.call(this, this) : from
5744
5924
  );
@@ -5761,14 +5941,14 @@ function mergeAsArray$1(to, from) {
5761
5941
  return to ? [...new Set([].concat(to, from))] : from;
5762
5942
  }
5763
5943
  function mergeObjectOptions(to, from) {
5764
- return to ? extend$1(/* @__PURE__ */ Object.create(null), to, from) : from;
5944
+ return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
5765
5945
  }
5766
5946
  function mergeEmitsOrPropsOptions(to, from) {
5767
5947
  if (to) {
5768
5948
  if (isArray(to) && isArray(from)) {
5769
5949
  return [.../* @__PURE__ */ new Set([...to, ...from])];
5770
5950
  }
5771
- return extend$1(
5951
+ return extend(
5772
5952
  /* @__PURE__ */ Object.create(null),
5773
5953
  normalizePropsOrEmits(to),
5774
5954
  normalizePropsOrEmits(from != null ? from : {})
@@ -5780,7 +5960,7 @@ function mergeEmitsOrPropsOptions(to, from) {
5780
5960
  function mergeWatchOptions(to, from) {
5781
5961
  if (!to) return from;
5782
5962
  if (!from) return to;
5783
- const merged = extend$1(/* @__PURE__ */ Object.create(null), to);
5963
+ const merged = extend(/* @__PURE__ */ Object.create(null), to);
5784
5964
  for (const key in from) {
5785
5965
  merged[key] = mergeAsArray$1(to[key], from[key]);
5786
5966
  }
@@ -5827,7 +6007,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5827
6007
  return vm;
5828
6008
  }
5829
6009
  }
5830
- Vue.version = `2.6.14-compat:${"3.5.17"}`;
6010
+ Vue.version = `2.6.14-compat:${"3.6.0-alpha.2"}`;
5831
6011
  Vue.config = singletonApp.config;
5832
6012
  Vue.use = (plugin, ...options) => {
5833
6013
  if (plugin && isFunction(plugin.install)) {
@@ -5877,7 +6057,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5877
6057
  } else {
5878
6058
  return createCompatApp(
5879
6059
  mergeOptions(
5880
- extend$1({}, SubVue.options),
6060
+ extend({}, SubVue.options),
5881
6061
  inlineOptions,
5882
6062
  internalOptionMergeStrats
5883
6063
  ),
@@ -5891,7 +6071,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5891
6071
  const mergeBase = {};
5892
6072
  for (const key in Super.options) {
5893
6073
  const superValue = Super.options[key];
5894
- mergeBase[key] = isArray(superValue) ? superValue.slice() : isObject(superValue) ? extend$1(/* @__PURE__ */ Object.create(null), superValue) : superValue;
6074
+ mergeBase[key] = isArray(superValue) ? superValue.slice() : isObject(superValue) ? extend(/* @__PURE__ */ Object.create(null), superValue) : superValue;
5895
6075
  }
5896
6076
  SubVue.options = mergeOptions(
5897
6077
  mergeBase,
@@ -5929,7 +6109,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5929
6109
  };
5930
6110
  const util = {
5931
6111
  warn: NOOP,
5932
- extend: extend$1,
6112
+ extend,
5933
6113
  mergeOptions: (parent, child, vm) => mergeOptions(
5934
6114
  parent,
5935
6115
  child,
@@ -6181,10 +6361,10 @@ function createAppContext() {
6181
6361
  };
6182
6362
  }
6183
6363
  let uid$1 = 0;
6184
- function createAppAPI(render, hydrate) {
6364
+ function createAppAPI(mount, unmount, getPublicInstance, render) {
6185
6365
  return function createApp(rootComponent, rootProps = null) {
6186
6366
  if (!isFunction(rootComponent)) {
6187
- rootComponent = extend$1({}, rootComponent);
6367
+ rootComponent = extend({}, rootComponent);
6188
6368
  }
6189
6369
  if (rootProps != null && !isObject(rootProps)) {
6190
6370
  rootProps = null;
@@ -6240,22 +6420,11 @@ function createAppAPI(render, hydrate) {
6240
6420
  },
6241
6421
  mount(rootContainer, isHydrate, namespace) {
6242
6422
  if (!isMounted) {
6243
- const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
6244
- vnode.appContext = context;
6245
- if (namespace === true) {
6246
- namespace = "svg";
6247
- } else if (namespace === false) {
6248
- namespace = void 0;
6249
- }
6250
- if (isHydrate && hydrate) {
6251
- hydrate(vnode, rootContainer);
6252
- } else {
6253
- render(vnode, rootContainer, namespace);
6254
- }
6423
+ const instance = mount(app, rootContainer, isHydrate, namespace);
6255
6424
  isMounted = true;
6256
6425
  app._container = rootContainer;
6257
6426
  rootContainer.__vue_app__ = app;
6258
- return getComponentPublicInstance(vnode.component);
6427
+ return getPublicInstance(instance);
6259
6428
  }
6260
6429
  },
6261
6430
  onUnmount(cleanupFn) {
@@ -6268,7 +6437,7 @@ function createAppAPI(render, hydrate) {
6268
6437
  app._instance,
6269
6438
  16
6270
6439
  );
6271
- render(null, app._container);
6440
+ unmount(app);
6272
6441
  delete app._container.__vue_app__;
6273
6442
  }
6274
6443
  },
@@ -6287,7 +6456,12 @@ function createAppAPI(render, hydrate) {
6287
6456
  }
6288
6457
  };
6289
6458
  {
6290
- installAppCompatProperties(app, context, render);
6459
+ installAppCompatProperties(
6460
+ app,
6461
+ context,
6462
+ // vapor doesn't have compat mode so this is always passed
6463
+ render
6464
+ );
6291
6465
  }
6292
6466
  return app;
6293
6467
  };
@@ -6295,6 +6469,7 @@ function createAppAPI(render, hydrate) {
6295
6469
  let currentApp = null;
6296
6470
 
6297
6471
  function provide(key, value) {
6472
+ const currentInstance = getCurrentGenericInstance();
6298
6473
  if (!currentInstance) ; else {
6299
6474
  let provides = currentInstance.provides;
6300
6475
  const parentProvides = currentInstance.parent && currentInstance.parent.provides;
@@ -6305,9 +6480,9 @@ function provide(key, value) {
6305
6480
  }
6306
6481
  }
6307
6482
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
6308
- const instance = currentInstance || currentRenderingInstance;
6483
+ const instance = getCurrentGenericInstance();
6309
6484
  if (instance || currentApp) {
6310
- let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
6485
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
6311
6486
  if (provides && key in provides) {
6312
6487
  return provides[key];
6313
6488
  } else if (arguments.length > 1) {
@@ -6316,7 +6491,7 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
6316
6491
  }
6317
6492
  }
6318
6493
  function hasInjectionContext() {
6319
- return !!(currentInstance || currentRenderingInstance || currentApp);
6494
+ return !!(getCurrentGenericInstance() || currentApp);
6320
6495
  }
6321
6496
 
6322
6497
  function createPropsDefaultThis(instance, rawProps, propKey) {
@@ -6366,7 +6541,7 @@ const createInternalObject = () => Object.create(internalObjectProto);
6366
6541
  const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
6367
6542
 
6368
6543
  function initProps(instance, rawProps, isStateful, isSSR = false) {
6369
- const props = {};
6544
+ const props = instance.props = {};
6370
6545
  const attrs = createInternalObject();
6371
6546
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
6372
6547
  setFullProps(instance, rawProps, props, attrs);
@@ -6419,11 +6594,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
6419
6594
  const camelizedKey = camelize(key);
6420
6595
  props[camelizedKey] = resolvePropValue(
6421
6596
  options,
6422
- rawCurrentProps,
6423
6597
  camelizedKey,
6424
6598
  value,
6425
6599
  instance,
6426
- false
6600
+ baseResolveDefault
6427
6601
  );
6428
6602
  }
6429
6603
  } else {
@@ -6457,10 +6631,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
6457
6631
  rawPrevProps[kebabKey] !== void 0)) {
6458
6632
  props[key] = resolvePropValue(
6459
6633
  options,
6460
- rawCurrentProps,
6461
6634
  key,
6462
6635
  void 0,
6463
6636
  instance,
6637
+ baseResolveDefault,
6464
6638
  true
6465
6639
  );
6466
6640
  }
@@ -6527,39 +6701,37 @@ function setFullProps(instance, rawProps, props, attrs) {
6527
6701
  }
6528
6702
  }
6529
6703
  if (needCastKeys) {
6530
- const rawCurrentProps = toRaw(props);
6531
6704
  const castValues = rawCastValues || EMPTY_OBJ;
6532
6705
  for (let i = 0; i < needCastKeys.length; i++) {
6533
6706
  const key = needCastKeys[i];
6534
6707
  props[key] = resolvePropValue(
6535
6708
  options,
6536
- rawCurrentProps,
6537
6709
  key,
6538
6710
  castValues[key],
6539
6711
  instance,
6712
+ baseResolveDefault,
6540
6713
  !hasOwn(castValues, key)
6541
6714
  );
6542
6715
  }
6543
6716
  }
6544
6717
  return hasAttrsChanged;
6545
6718
  }
6546
- function resolvePropValue(options, props, key, value, instance, isAbsent) {
6719
+ function resolvePropValue(options, key, value, instance, resolveDefault, isAbsent = false) {
6547
6720
  const opt = options[key];
6548
6721
  if (opt != null) {
6549
6722
  const hasDefault = hasOwn(opt, "default");
6550
6723
  if (hasDefault && value === void 0) {
6551
6724
  const defaultValue = opt.default;
6552
6725
  if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
6553
- const { propsDefaults } = instance;
6554
- if (key in propsDefaults) {
6555
- value = propsDefaults[key];
6726
+ const cachedDefaults = instance.propsDefaults || (instance.propsDefaults = {});
6727
+ if (hasOwn(cachedDefaults, key)) {
6728
+ value = cachedDefaults[key];
6556
6729
  } else {
6557
- const reset = setCurrentInstance(instance);
6558
- value = propsDefaults[key] = defaultValue.call(
6559
- isCompatEnabled$1("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props) : null,
6560
- props
6730
+ value = cachedDefaults[key] = resolveDefault(
6731
+ defaultValue,
6732
+ instance,
6733
+ key
6561
6734
  );
6562
- reset();
6563
6735
  }
6564
6736
  } else {
6565
6737
  value = defaultValue;
@@ -6578,6 +6750,17 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
6578
6750
  }
6579
6751
  return value;
6580
6752
  }
6753
+ function baseResolveDefault(factory, instance, key) {
6754
+ let value;
6755
+ const prev = setCurrentInstance(instance);
6756
+ const props = toRaw(instance.props);
6757
+ value = factory.call(
6758
+ isCompatEnabled$1("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props) : null,
6759
+ props
6760
+ );
6761
+ setCurrentInstance(...prev);
6762
+ return value;
6763
+ }
6581
6764
  const mixinPropsCache = /* @__PURE__ */ new WeakMap();
6582
6765
  function normalizePropsOptions(comp, appContext, asMixin = false) {
6583
6766
  const cache = asMixin ? mixinPropsCache : appContext.propsCache;
@@ -6596,7 +6779,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6596
6779
  }
6597
6780
  hasExtends = true;
6598
6781
  const [props, keys] = normalizePropsOptions(raw2, appContext, true);
6599
- extend$1(normalized, props);
6782
+ extend(normalized, props);
6600
6783
  if (keys) needCastKeys.push(...keys);
6601
6784
  };
6602
6785
  if (!asMixin && appContext.mixins.length) {
@@ -6615,6 +6798,14 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6615
6798
  }
6616
6799
  return EMPTY_ARR;
6617
6800
  }
6801
+ baseNormalizePropsOptions(raw, normalized, needCastKeys);
6802
+ const res = [normalized, needCastKeys];
6803
+ if (isObject(comp)) {
6804
+ cache.set(comp, res);
6805
+ }
6806
+ return res;
6807
+ }
6808
+ function baseNormalizePropsOptions(raw, normalized, needCastKeys) {
6618
6809
  if (isArray(raw)) {
6619
6810
  for (let i = 0; i < raw.length; i++) {
6620
6811
  const normalizedKey = camelize(raw[i]);
@@ -6627,7 +6818,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6627
6818
  const normalizedKey = camelize(key);
6628
6819
  if (validatePropName(normalizedKey)) {
6629
6820
  const opt = raw[key];
6630
- const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend$1({}, opt);
6821
+ const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
6631
6822
  const propType = prop.type;
6632
6823
  let shouldCast = false;
6633
6824
  let shouldCastTrue = true;
@@ -6653,11 +6844,6 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6653
6844
  }
6654
6845
  }
6655
6846
  }
6656
- const res = [normalized, needCastKeys];
6657
- if (isObject(comp)) {
6658
- cache.set(comp, res);
6659
- }
6660
- return res;
6661
6847
  }
6662
6848
  function validatePropName(key) {
6663
6849
  if (key[0] !== "$" && !isReservedProp(key)) {
@@ -6814,6 +7000,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6814
7000
  optimized
6815
7001
  );
6816
7002
  break;
7003
+ case VaporSlot:
7004
+ getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
7005
+ break;
6817
7006
  default:
6818
7007
  if (shapeFlag & 1) {
6819
7008
  processElement(
@@ -7005,11 +7194,15 @@ function baseCreateRenderer(options, createHydrationFns) {
7005
7194
  }
7006
7195
  hostInsert(el, container, anchor);
7007
7196
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
7008
- queuePostRenderEffect(() => {
7009
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7010
- needCallTransitionHooks && transition.enter(el);
7011
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7012
- }, parentSuspense);
7197
+ queuePostRenderEffect(
7198
+ () => {
7199
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7200
+ needCallTransitionHooks && transition.enter(el);
7201
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7202
+ },
7203
+ void 0,
7204
+ parentSuspense
7205
+ );
7013
7206
  }
7014
7207
  };
7015
7208
  const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
@@ -7021,8 +7214,8 @@ function baseCreateRenderer(options, createHydrationFns) {
7021
7214
  hostSetScopeId(el, slotScopeIds[i]);
7022
7215
  }
7023
7216
  }
7024
- if (parentComponent) {
7025
- let subTree = parentComponent.subTree;
7217
+ let subTree = parentComponent && parentComponent.subTree;
7218
+ if (subTree) {
7026
7219
  if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
7027
7220
  const parentVNode = parentComponent.vnode;
7028
7221
  setScopeId(
@@ -7125,10 +7318,14 @@ function baseCreateRenderer(options, createHydrationFns) {
7125
7318
  patchProps(el, oldProps, newProps, parentComponent, namespace);
7126
7319
  }
7127
7320
  if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
7128
- queuePostRenderEffect(() => {
7129
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
7130
- dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
7131
- }, parentSuspense);
7321
+ queuePostRenderEffect(
7322
+ () => {
7323
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
7324
+ dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
7325
+ },
7326
+ void 0,
7327
+ parentSuspense
7328
+ );
7132
7329
  }
7133
7330
  };
7134
7331
  const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
@@ -7259,7 +7456,22 @@ function baseCreateRenderer(options, createHydrationFns) {
7259
7456
  };
7260
7457
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7261
7458
  n2.slotScopeIds = slotScopeIds;
7262
- if (n1 == null) {
7459
+ if (n2.type.__vapor) {
7460
+ if (n1 == null) {
7461
+ getVaporInterface(parentComponent, n2).mount(
7462
+ n2,
7463
+ container,
7464
+ anchor,
7465
+ parentComponent
7466
+ );
7467
+ } else {
7468
+ getVaporInterface(parentComponent, n2).update(
7469
+ n1,
7470
+ n2,
7471
+ shouldUpdateComponent(n1, n2, optimized)
7472
+ );
7473
+ }
7474
+ } else if (n1 == null) {
7263
7475
  if (n2.shapeFlag & 512) {
7264
7476
  parentComponent.ctx.activate(
7265
7477
  n2,
@@ -7322,15 +7534,48 @@ function baseCreateRenderer(options, createHydrationFns) {
7322
7534
  return;
7323
7535
  } else {
7324
7536
  instance.next = n2;
7325
- instance.update();
7537
+ instance.effect.run();
7326
7538
  }
7327
7539
  } else {
7328
7540
  n2.el = n1.el;
7329
7541
  instance.vnode = n2;
7330
7542
  }
7331
7543
  };
7332
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
7333
- const componentUpdateFn = () => {
7544
+ class SetupRenderEffect extends ReactiveEffect {
7545
+ constructor(instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) {
7546
+ const prevScope = setCurrentScope(instance.scope);
7547
+ super();
7548
+ this.instance = instance;
7549
+ this.initialVNode = initialVNode;
7550
+ this.container = container;
7551
+ this.anchor = anchor;
7552
+ this.parentSuspense = parentSuspense;
7553
+ this.namespace = namespace;
7554
+ this.optimized = optimized;
7555
+ setCurrentScope(prevScope);
7556
+ this.job = instance.job = () => {
7557
+ if (this.dirty) {
7558
+ this.run();
7559
+ }
7560
+ };
7561
+ this.job.i = instance;
7562
+ }
7563
+ notify() {
7564
+ if (!(this.flags & 256)) {
7565
+ const job = this.job;
7566
+ queueJob(job, job.i.uid);
7567
+ }
7568
+ }
7569
+ fn() {
7570
+ const {
7571
+ instance,
7572
+ initialVNode,
7573
+ container,
7574
+ anchor,
7575
+ parentSuspense,
7576
+ namespace,
7577
+ optimized
7578
+ } = this;
7334
7579
  if (!instance.isMounted) {
7335
7580
  let vnodeHook;
7336
7581
  const { el, props } = initialVNode;
@@ -7385,32 +7630,35 @@ function baseCreateRenderer(options, createHydrationFns) {
7385
7630
  initialVNode.el = subTree.el;
7386
7631
  }
7387
7632
  if (m) {
7388
- queuePostRenderEffect(m, parentSuspense);
7633
+ queuePostRenderEffect(m, void 0, parentSuspense);
7389
7634
  }
7390
7635
  if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
7391
7636
  const scopedInitialVNode = initialVNode;
7392
7637
  queuePostRenderEffect(
7393
7638
  () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
7639
+ void 0,
7394
7640
  parentSuspense
7395
7641
  );
7396
7642
  }
7397
7643
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) {
7398
7644
  queuePostRenderEffect(
7399
7645
  () => instance.emit("hook:mounted"),
7646
+ void 0,
7400
7647
  parentSuspense
7401
7648
  );
7402
7649
  }
7403
- if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
7404
- instance.a && queuePostRenderEffect(instance.a, parentSuspense);
7650
+ if (initialVNode.shapeFlag & 256 || parent && parent.vnode && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
7651
+ instance.a && queuePostRenderEffect(instance.a, void 0, parentSuspense);
7405
7652
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) {
7406
7653
  queuePostRenderEffect(
7407
7654
  () => instance.emit("hook:activated"),
7655
+ void 0,
7408
7656
  parentSuspense
7409
7657
  );
7410
7658
  }
7411
7659
  }
7412
7660
  instance.isMounted = true;
7413
- initialVNode = container = anchor = null;
7661
+ this.initialVNode = this.container = this.anchor = null;
7414
7662
  } else {
7415
7663
  let { next, bu, u, parent, vnode } = instance;
7416
7664
  {
@@ -7422,7 +7670,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7422
7670
  }
7423
7671
  nonHydratedAsyncRoot.asyncDep.then(() => {
7424
7672
  if (!instance.isUnmounted) {
7425
- componentUpdateFn();
7673
+ this.fn();
7426
7674
  }
7427
7675
  });
7428
7676
  return;
@@ -7466,32 +7714,38 @@ function baseCreateRenderer(options, createHydrationFns) {
7466
7714
  updateHOCHostEl(instance, nextTree.el);
7467
7715
  }
7468
7716
  if (u) {
7469
- queuePostRenderEffect(u, parentSuspense);
7717
+ queuePostRenderEffect(u, void 0, parentSuspense);
7470
7718
  }
7471
7719
  if (vnodeHook = next.props && next.props.onVnodeUpdated) {
7472
7720
  queuePostRenderEffect(
7473
7721
  () => invokeVNodeHook(vnodeHook, parent, next, vnode),
7722
+ void 0,
7474
7723
  parentSuspense
7475
7724
  );
7476
7725
  }
7477
7726
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) {
7478
7727
  queuePostRenderEffect(
7479
7728
  () => instance.emit("hook:updated"),
7729
+ void 0,
7480
7730
  parentSuspense
7481
7731
  );
7482
7732
  }
7483
7733
  }
7484
- };
7485
- instance.scope.on();
7486
- const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
7487
- instance.scope.off();
7488
- const update = instance.update = effect.run.bind(effect);
7489
- const job = instance.job = effect.runIfDirty.bind(effect);
7490
- job.i = instance;
7491
- job.id = instance.uid;
7492
- effect.scheduler = () => queueJob(job);
7734
+ }
7735
+ }
7736
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
7737
+ const effect = instance.effect = new SetupRenderEffect(
7738
+ instance,
7739
+ initialVNode,
7740
+ container,
7741
+ anchor,
7742
+ parentSuspense,
7743
+ namespace,
7744
+ optimized
7745
+ );
7746
+ instance.update = effect.run.bind(effect);
7493
7747
  toggleRecurse(instance, true);
7494
- update();
7748
+ effect.run();
7495
7749
  };
7496
7750
  const updateComponentPreRender = (instance, nextVNode, optimized) => {
7497
7751
  nextVNode.component = instance;
@@ -7500,9 +7754,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7500
7754
  instance.next = null;
7501
7755
  updateProps(instance, nextVNode.props, prevProps, optimized);
7502
7756
  updateSlots(instance, nextVNode.children, optimized);
7503
- pauseTracking();
7757
+ const prevSub = setActiveSub();
7504
7758
  flushPreFlushCbs(instance);
7505
- resetTracking();
7759
+ setActiveSub(prevSub);
7506
7760
  };
7507
7761
  const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
7508
7762
  const c1 = n1 && n1.children;
@@ -7772,7 +8026,13 @@ function baseCreateRenderer(options, createHydrationFns) {
7772
8026
  );
7773
8027
  } else if (moved) {
7774
8028
  if (j < 0 || i !== increasingNewIndexSequence[j]) {
7775
- move(nextChild, container, anchor, 2);
8029
+ move(
8030
+ nextChild,
8031
+ container,
8032
+ anchor,
8033
+ 2,
8034
+ parentComponent
8035
+ );
7776
8036
  } else {
7777
8037
  j--;
7778
8038
  }
@@ -7780,10 +8040,20 @@ function baseCreateRenderer(options, createHydrationFns) {
7780
8040
  }
7781
8041
  }
7782
8042
  };
7783
- const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
8043
+ const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
7784
8044
  const { el, type, transition, children, shapeFlag } = vnode;
7785
8045
  if (shapeFlag & 6) {
7786
- move(vnode.component.subTree, container, anchor, moveType);
8046
+ if (type.__vapor) {
8047
+ getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
8048
+ } else {
8049
+ move(
8050
+ vnode.component.subTree,
8051
+ container,
8052
+ anchor,
8053
+ moveType,
8054
+ parentComponent
8055
+ );
8056
+ }
7787
8057
  return;
7788
8058
  }
7789
8059
  if (shapeFlag & 128) {
@@ -7791,13 +8061,25 @@ function baseCreateRenderer(options, createHydrationFns) {
7791
8061
  return;
7792
8062
  }
7793
8063
  if (shapeFlag & 64) {
7794
- type.move(vnode, container, anchor, internals);
8064
+ type.move(
8065
+ vnode,
8066
+ container,
8067
+ anchor,
8068
+ internals,
8069
+ parentComponent
8070
+ );
7795
8071
  return;
7796
8072
  }
7797
8073
  if (type === Fragment) {
7798
8074
  hostInsert(el, container, anchor);
7799
8075
  for (let i = 0; i < children.length; i++) {
7800
- move(children[i], container, anchor, moveType);
8076
+ move(
8077
+ children[i],
8078
+ container,
8079
+ anchor,
8080
+ moveType,
8081
+ parentComponent
8082
+ );
7801
8083
  }
7802
8084
  hostInsert(vnode.anchor, container, anchor);
7803
8085
  return;
@@ -7811,7 +8093,11 @@ function baseCreateRenderer(options, createHydrationFns) {
7811
8093
  if (moveType === 0) {
7812
8094
  transition.beforeEnter(el);
7813
8095
  hostInsert(el, container, anchor);
7814
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
8096
+ queuePostRenderEffect(
8097
+ () => transition.enter(el),
8098
+ void 0,
8099
+ parentSuspense
8100
+ );
7815
8101
  } else {
7816
8102
  const { leave, delayLeave, afterLeave } = transition;
7817
8103
  const remove2 = () => {
@@ -7853,9 +8139,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7853
8139
  optimized = false;
7854
8140
  }
7855
8141
  if (ref != null) {
7856
- pauseTracking();
8142
+ const prevSub = setActiveSub();
7857
8143
  setRef(ref, null, parentSuspense, vnode, true);
7858
- resetTracking();
8144
+ setActiveSub(prevSub);
7859
8145
  }
7860
8146
  if (cacheIndex != null) {
7861
8147
  parentComponent.renderCache[cacheIndex] = void 0;
@@ -7871,7 +8157,12 @@ function baseCreateRenderer(options, createHydrationFns) {
7871
8157
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
7872
8158
  }
7873
8159
  if (shapeFlag & 6) {
7874
- unmountComponent(vnode.component, parentSuspense, doRemove);
8160
+ if (type.__vapor) {
8161
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
8162
+ return;
8163
+ } else {
8164
+ unmountComponent(vnode.component, parentSuspense, doRemove);
8165
+ }
7875
8166
  } else {
7876
8167
  if (shapeFlag & 128) {
7877
8168
  vnode.suspense.unmount(parentSuspense, doRemove);
@@ -7905,15 +8196,23 @@ function baseCreateRenderer(options, createHydrationFns) {
7905
8196
  } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
7906
8197
  unmountChildren(children, parentComponent, parentSuspense);
7907
8198
  }
8199
+ if (type === VaporSlot) {
8200
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
8201
+ return;
8202
+ }
7908
8203
  if (doRemove) {
7909
8204
  remove(vnode);
7910
8205
  }
7911
8206
  }
7912
8207
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
7913
- queuePostRenderEffect(() => {
7914
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7915
- shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
7916
- }, parentSuspense);
8208
+ queuePostRenderEffect(
8209
+ () => {
8210
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
8211
+ shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
8212
+ },
8213
+ void 0,
8214
+ parentSuspense
8215
+ );
7917
8216
  }
7918
8217
  };
7919
8218
  const remove = (vnode) => {
@@ -7959,7 +8258,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7959
8258
  const {
7960
8259
  bum,
7961
8260
  scope,
7962
- job,
8261
+ effect,
7963
8262
  subTree,
7964
8263
  um,
7965
8264
  m,
@@ -7981,22 +8280,25 @@ function baseCreateRenderer(options, createHydrationFns) {
7981
8280
  instance.emit("hook:beforeDestroy");
7982
8281
  }
7983
8282
  scope.stop();
7984
- if (job) {
7985
- job.flags |= 8;
8283
+ if (effect) {
8284
+ effect.stop();
7986
8285
  unmount(subTree, instance, parentSuspense, doRemove);
7987
8286
  }
7988
8287
  if (um) {
7989
- queuePostRenderEffect(um, parentSuspense);
8288
+ queuePostRenderEffect(um, void 0, parentSuspense);
7990
8289
  }
7991
8290
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) {
7992
8291
  queuePostRenderEffect(
7993
8292
  () => instance.emit("hook:destroyed"),
8293
+ void 0,
7994
8294
  parentSuspense
7995
8295
  );
7996
8296
  }
7997
- queuePostRenderEffect(() => {
7998
- instance.isUnmounted = true;
7999
- }, parentSuspense);
8297
+ queuePostRenderEffect(
8298
+ () => instance.isUnmounted = true,
8299
+ void 0,
8300
+ parentSuspense
8301
+ );
8000
8302
  if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
8001
8303
  parentSuspense.deps--;
8002
8304
  if (parentSuspense.deps === 0) {
@@ -8011,6 +8313,9 @@ function baseCreateRenderer(options, createHydrationFns) {
8011
8313
  };
8012
8314
  const getNextHostNode = (vnode) => {
8013
8315
  if (vnode.shapeFlag & 6) {
8316
+ if (vnode.type.__vapor) {
8317
+ return hostNextSibling(vnode.component.block);
8318
+ }
8014
8319
  return getNextHostNode(vnode.component.subTree);
8015
8320
  }
8016
8321
  if (vnode.shapeFlag & 128) {
@@ -8020,7 +8325,6 @@ function baseCreateRenderer(options, createHydrationFns) {
8020
8325
  const teleportEnd = el && el[TeleportEndKey];
8021
8326
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
8022
8327
  };
8023
- let isFlushing = false;
8024
8328
  const render = (vnode, container, namespace) => {
8025
8329
  if (vnode == null) {
8026
8330
  if (container._vnode) {
@@ -8038,12 +8342,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8038
8342
  );
8039
8343
  }
8040
8344
  container._vnode = vnode;
8041
- if (!isFlushing) {
8042
- isFlushing = true;
8043
- flushPreFlushCbs();
8044
- flushPostFlushCbs();
8045
- isFlushing = false;
8046
- }
8345
+ flushOnAppMount();
8047
8346
  };
8048
8347
  const internals = {
8049
8348
  p: patch,
@@ -8051,6 +8350,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8051
8350
  m: move,
8052
8351
  r: remove,
8053
8352
  mt: mountComponent,
8353
+ umt: unmountComponent,
8054
8354
  mc: mountChildren,
8055
8355
  pc: patchChildren,
8056
8356
  pbc: patchBlockChildren,
@@ -8064,22 +8364,48 @@ function baseCreateRenderer(options, createHydrationFns) {
8064
8364
  internals
8065
8365
  );
8066
8366
  }
8367
+ const mountApp = (app, container, isHydrate, namespace) => {
8368
+ const vnode = app._ceVNode || createVNode(app._component, app._props);
8369
+ vnode.appContext = app._context;
8370
+ if (namespace === true) {
8371
+ namespace = "svg";
8372
+ } else if (namespace === false) {
8373
+ namespace = void 0;
8374
+ }
8375
+ if (isHydrate && hydrate) {
8376
+ hydrate(vnode, container);
8377
+ } else {
8378
+ render(vnode, container, namespace);
8379
+ }
8380
+ return vnode.component;
8381
+ };
8382
+ const unmountApp = (app) => {
8383
+ render(null, app._container);
8384
+ };
8067
8385
  return {
8068
8386
  render,
8069
8387
  hydrate,
8070
- createApp: createAppAPI(render, hydrate)
8388
+ internals,
8389
+ createApp: createAppAPI(
8390
+ mountApp,
8391
+ unmountApp,
8392
+ getComponentPublicInstance,
8393
+ render
8394
+ )
8071
8395
  };
8072
8396
  }
8073
8397
  function resolveChildrenNamespace({ type, props }, currentNamespace) {
8074
8398
  return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
8075
8399
  }
8076
- function toggleRecurse({ effect, job }, allowed) {
8077
- if (allowed) {
8078
- effect.flags |= 32;
8079
- job.flags |= 4;
8080
- } else {
8081
- effect.flags &= -33;
8082
- job.flags &= -5;
8400
+ function toggleRecurse({ effect, job, vapor }, allowed) {
8401
+ if (!vapor) {
8402
+ if (allowed) {
8403
+ effect.flags |= 128;
8404
+ job.flags |= 2;
8405
+ } else {
8406
+ effect.flags &= -129;
8407
+ job.flags &= -3;
8408
+ }
8083
8409
  }
8084
8410
  }
8085
8411
  function needTransition(parentSuspense, transition) {
@@ -8109,48 +8435,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8109
8435
  }
8110
8436
  }
8111
8437
  }
8112
- function getSequence(arr) {
8113
- const p = arr.slice();
8114
- const result = [0];
8115
- let i, j, u, v, c;
8116
- const len = arr.length;
8117
- for (i = 0; i < len; i++) {
8118
- const arrI = arr[i];
8119
- if (arrI !== 0) {
8120
- j = result[result.length - 1];
8121
- if (arr[j] < arrI) {
8122
- p[i] = j;
8123
- result.push(i);
8124
- continue;
8125
- }
8126
- u = 0;
8127
- v = result.length - 1;
8128
- while (u < v) {
8129
- c = u + v >> 1;
8130
- if (arr[result[c]] < arrI) {
8131
- u = c + 1;
8132
- } else {
8133
- v = c;
8134
- }
8135
- }
8136
- if (arrI < arr[result[u]]) {
8137
- if (u > 0) {
8138
- p[i] = result[u - 1];
8139
- }
8140
- result[u] = i;
8141
- }
8142
- }
8143
- }
8144
- u = result.length;
8145
- v = result[u - 1];
8146
- while (u-- > 0) {
8147
- result[u] = v;
8148
- v = p[v];
8149
- }
8150
- return result;
8151
- }
8152
8438
  function locateNonHydratedAsyncRoot(instance) {
8153
- const subComponent = instance.subTree.component;
8439
+ const subComponent = instance.vapor ? null : instance.subTree.component;
8154
8440
  if (subComponent) {
8155
8441
  if (subComponent.asyncDep && !subComponent.asyncResolved) {
8156
8442
  return subComponent;
@@ -8162,9 +8448,14 @@ function locateNonHydratedAsyncRoot(instance) {
8162
8448
  function invalidateMount(hooks) {
8163
8449
  if (hooks) {
8164
8450
  for (let i = 0; i < hooks.length; i++)
8165
- hooks[i].flags |= 8;
8451
+ hooks[i].flags |= 4;
8166
8452
  }
8167
8453
  }
8454
+ function getVaporInterface(instance, vnode) {
8455
+ const ctx = instance ? instance.appContext : vnode.appContext;
8456
+ const res = ctx && ctx.vapor;
8457
+ return res;
8458
+ }
8168
8459
 
8169
8460
  const ssrContextKey = Symbol.for("v-scx");
8170
8461
  const useSSRContext = () => {
@@ -8194,9 +8485,42 @@ function watchSyncEffect(effect, options) {
8194
8485
  function watch(source, cb, options) {
8195
8486
  return doWatch(source, cb, options);
8196
8487
  }
8488
+ class RenderWatcherEffect extends WatcherEffect {
8489
+ constructor(instance, source, cb, options, flush) {
8490
+ super(source, cb, options);
8491
+ this.flush = flush;
8492
+ const job = () => {
8493
+ if (this.dirty) {
8494
+ this.run();
8495
+ }
8496
+ };
8497
+ if (cb) {
8498
+ this.flags |= 128;
8499
+ job.flags |= 2;
8500
+ }
8501
+ if (instance) {
8502
+ job.i = instance;
8503
+ }
8504
+ this.job = job;
8505
+ }
8506
+ notify() {
8507
+ const flags = this.flags;
8508
+ if (!(flags & 256)) {
8509
+ const flush = this.flush;
8510
+ const job = this.job;
8511
+ if (flush === "post") {
8512
+ queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
8513
+ } else if (flush === "pre") {
8514
+ queueJob(job, job.i ? job.i.uid : void 0, true);
8515
+ } else {
8516
+ job();
8517
+ }
8518
+ }
8519
+ }
8520
+ }
8197
8521
  function doWatch(source, cb, options = EMPTY_OBJ) {
8198
- const { immediate, deep, flush, once } = options;
8199
- const baseWatchOptions = extend$1({}, options);
8522
+ const { immediate, deep, flush = "pre", once } = options;
8523
+ const baseWatchOptions = extend({}, options);
8200
8524
  const runsImmediately = cb && immediate || !cb && flush !== "post";
8201
8525
  let ssrCleanup;
8202
8526
  if (isInSSRComponentSetup) {
@@ -8214,42 +8538,32 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
8214
8538
  }
8215
8539
  const instance = currentInstance;
8216
8540
  baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
8217
- let isPre = false;
8218
- if (flush === "post") {
8219
- baseWatchOptions.scheduler = (job) => {
8220
- queuePostRenderEffect(job, instance && instance.suspense);
8221
- };
8222
- } else if (flush !== "sync") {
8223
- isPre = true;
8224
- baseWatchOptions.scheduler = (job, isFirstRun) => {
8225
- if (isFirstRun) {
8226
- job();
8227
- } else {
8228
- queueJob(job);
8229
- }
8230
- };
8541
+ const effect = new RenderWatcherEffect(
8542
+ instance,
8543
+ source,
8544
+ cb,
8545
+ baseWatchOptions,
8546
+ flush
8547
+ );
8548
+ if (cb) {
8549
+ effect.run(true);
8550
+ } else if (flush === "post") {
8551
+ queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
8552
+ } else {
8553
+ effect.run(true);
8231
8554
  }
8232
- baseWatchOptions.augmentJob = (job) => {
8233
- if (cb) {
8234
- job.flags |= 4;
8235
- }
8236
- if (isPre) {
8237
- job.flags |= 2;
8238
- if (instance) {
8239
- job.id = instance.uid;
8240
- job.i = instance;
8241
- }
8242
- }
8243
- };
8244
- const watchHandle = watch$1(source, cb, baseWatchOptions);
8555
+ const stop = effect.stop.bind(effect);
8556
+ stop.pause = effect.pause.bind(effect);
8557
+ stop.resume = effect.resume.bind(effect);
8558
+ stop.stop = stop;
8245
8559
  if (isInSSRComponentSetup) {
8246
8560
  if (ssrCleanup) {
8247
- ssrCleanup.push(watchHandle);
8561
+ ssrCleanup.push(stop);
8248
8562
  } else if (runsImmediately) {
8249
- watchHandle();
8563
+ stop();
8250
8564
  }
8251
8565
  }
8252
- return watchHandle;
8566
+ return stop;
8253
8567
  }
8254
8568
  function instanceWatch(source, value, options) {
8255
8569
  const publicThis = this.proxy;
@@ -8261,9 +8575,9 @@ function instanceWatch(source, value, options) {
8261
8575
  cb = value.handler;
8262
8576
  options = value;
8263
8577
  }
8264
- const reset = setCurrentInstance(this);
8578
+ const prev = setCurrentInstance(this);
8265
8579
  const res = doWatch(getter, cb.bind(publicThis), options);
8266
- reset();
8580
+ setCurrentInstance(...prev);
8267
8581
  return res;
8268
8582
  }
8269
8583
  function createPathGetter(ctx, path) {
@@ -8278,10 +8592,10 @@ function createPathGetter(ctx, path) {
8278
8592
  }
8279
8593
 
8280
8594
  function useModel(props, name, options = EMPTY_OBJ) {
8281
- const i = getCurrentInstance();
8595
+ const i = getCurrentGenericInstance();
8282
8596
  const camelizedName = camelize(name);
8283
8597
  const hyphenatedName = hyphenate(name);
8284
- const modifiers = getModelModifiers(props, camelizedName);
8598
+ const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
8285
8599
  const res = customRef((track, trigger) => {
8286
8600
  let localValue;
8287
8601
  let prevSetValue = EMPTY_OBJ;
@@ -8303,9 +8617,25 @@ function useModel(props, name, options = EMPTY_OBJ) {
8303
8617
  if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
8304
8618
  return;
8305
8619
  }
8306
- const rawProps = i.vnode.props;
8307
- if (!(rawProps && // check if parent has passed v-model
8308
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
8620
+ let rawPropKeys;
8621
+ let parentPassedModelValue = false;
8622
+ let parentPassedModelUpdater = false;
8623
+ if (i.rawKeys) {
8624
+ rawPropKeys = i.rawKeys();
8625
+ } else {
8626
+ const rawProps = i.vnode.props;
8627
+ rawPropKeys = rawProps && Object.keys(rawProps);
8628
+ }
8629
+ if (rawPropKeys) {
8630
+ for (const key of rawPropKeys) {
8631
+ if (key === name || key === camelizedName || key === hyphenatedName) {
8632
+ parentPassedModelValue = true;
8633
+ } else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) {
8634
+ parentPassedModelUpdater = true;
8635
+ }
8636
+ }
8637
+ }
8638
+ if (!parentPassedModelValue || !parentPassedModelUpdater) {
8309
8639
  localValue = value;
8310
8640
  trigger();
8311
8641
  }
@@ -8332,17 +8662,25 @@ function useModel(props, name, options = EMPTY_OBJ) {
8332
8662
  };
8333
8663
  return res;
8334
8664
  }
8335
- const getModelModifiers = (props, modelName) => {
8336
- return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
8665
+ const getModelModifiers = (props, modelName, getter) => {
8666
+ return modelName === "modelValue" || modelName === "model-value" ? getter(props, "modelModifiers") : getter(props, `${modelName}Modifiers`) || getter(props, `${camelize(modelName)}Modifiers`) || getter(props, `${hyphenate(modelName)}Modifiers`);
8337
8667
  };
8338
8668
 
8339
8669
  function emit(instance, event, ...rawArgs) {
8670
+ return baseEmit(
8671
+ instance,
8672
+ instance.vnode.props || EMPTY_OBJ,
8673
+ defaultPropGetter,
8674
+ event,
8675
+ ...rawArgs
8676
+ );
8677
+ }
8678
+ function baseEmit(instance, props, getter, event, ...rawArgs) {
8340
8679
  if (instance.isUnmounted) return;
8341
- const props = instance.vnode.props || EMPTY_OBJ;
8342
8680
  let args = rawArgs;
8343
8681
  const isCompatModelListener = compatModelEventPrefix + event in props;
8344
8682
  const isModelListener = isCompatModelListener || event.startsWith("update:");
8345
- const modifiers = isCompatModelListener ? props.modelModifiers : isModelListener && getModelModifiers(props, event.slice(7));
8683
+ const modifiers = isCompatModelListener ? props.modelModifiers : isModelListener && getModelModifiers(props, event.slice(7), getter);
8346
8684
  if (modifiers) {
8347
8685
  if (modifiers.trim) {
8348
8686
  args = rawArgs.map((a) => isString(a) ? a.trim() : a);
@@ -8352,10 +8690,10 @@ function emit(instance, event, ...rawArgs) {
8352
8690
  }
8353
8691
  }
8354
8692
  let handlerName;
8355
- let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
8356
- props[handlerName = toHandlerKey(camelize(event))];
8693
+ let handler = getter(props, handlerName = toHandlerKey(event)) || // also try camelCase event handler (#2249)
8694
+ getter(props, handlerName = toHandlerKey(camelize(event)));
8357
8695
  if (!handler && isModelListener) {
8358
- handler = props[handlerName = toHandlerKey(hyphenate(event))];
8696
+ handler = getter(props, handlerName = toHandlerKey(hyphenate(event)));
8359
8697
  }
8360
8698
  if (handler) {
8361
8699
  callWithAsyncErrorHandling(
@@ -8365,7 +8703,7 @@ function emit(instance, event, ...rawArgs) {
8365
8703
  args
8366
8704
  );
8367
8705
  }
8368
- const onceHandler = props[handlerName + `Once`];
8706
+ const onceHandler = getter(props, handlerName + `Once`);
8369
8707
  if (onceHandler) {
8370
8708
  if (!instance.emitted) {
8371
8709
  instance.emitted = {};
@@ -8380,11 +8718,18 @@ function emit(instance, event, ...rawArgs) {
8380
8718
  args
8381
8719
  );
8382
8720
  }
8383
- {
8721
+ if (args) {
8384
8722
  compatModelEmit(instance, event, args);
8385
- return emit$1(instance, event, args);
8723
+ return emit$1(
8724
+ instance,
8725
+ event,
8726
+ args
8727
+ );
8386
8728
  }
8387
8729
  }
8730
+ function defaultPropGetter(props, key) {
8731
+ return props[key];
8732
+ }
8388
8733
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
8389
8734
  const cache = appContext.emitsCache;
8390
8735
  const cached = cache.get(comp);
@@ -8399,7 +8744,7 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
8399
8744
  const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
8400
8745
  if (normalizedFromExtend) {
8401
8746
  hasExtends = true;
8402
- extend$1(normalized, normalizedFromExtend);
8747
+ extend(normalized, normalizedFromExtend);
8403
8748
  }
8404
8749
  };
8405
8750
  if (!asMixin && appContext.mixins.length) {
@@ -8421,7 +8766,7 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
8421
8766
  if (isArray(raw)) {
8422
8767
  raw.forEach((key) => normalized[key] = null);
8423
8768
  } else {
8424
- extend$1(normalized, raw);
8769
+ extend(normalized, raw);
8425
8770
  }
8426
8771
  if (isObject(comp)) {
8427
8772
  cache.set(comp, normalized);
@@ -8650,7 +8995,7 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
8650
8995
  return false;
8651
8996
  }
8652
8997
  function updateHOCHostEl({ vnode, parent }, el) {
8653
- while (parent) {
8998
+ while (parent && !parent.vapor) {
8654
8999
  const root = parent.subTree;
8655
9000
  if (root.suspense && root.suspense.activeBranch === vnode) {
8656
9001
  root.el = vnode.el;
@@ -8979,7 +9324,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
8979
9324
  pendingBranch,
8980
9325
  container2,
8981
9326
  anchor === initialAnchor ? next(activeBranch) : anchor,
8982
- 0
9327
+ 0,
9328
+ parentComponent2
8983
9329
  );
8984
9330
  queuePostFlushCb(effects);
8985
9331
  }
@@ -8992,7 +9338,13 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
8992
9338
  unmount(activeBranch, parentComponent2, suspense, true);
8993
9339
  }
8994
9340
  if (!delayEnter) {
8995
- move(pendingBranch, container2, anchor, 0);
9341
+ move(
9342
+ pendingBranch,
9343
+ container2,
9344
+ anchor,
9345
+ 0,
9346
+ parentComponent2
9347
+ );
8996
9348
  }
8997
9349
  }
8998
9350
  setActiveBranch(suspense, pendingBranch);
@@ -9065,7 +9417,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9065
9417
  }
9066
9418
  },
9067
9419
  move(container2, anchor2, type) {
9068
- suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
9420
+ suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type, parentComponent);
9069
9421
  suspense.container = container2;
9070
9422
  },
9071
9423
  next() {
@@ -9196,7 +9548,7 @@ function normalizeSuspenseSlot(s) {
9196
9548
  }
9197
9549
  return s;
9198
9550
  }
9199
- function queueEffectWithSuspense(fn, suspense) {
9551
+ function queueEffectWithSuspense(fn, id, suspense) {
9200
9552
  if (suspense && suspense.pendingBranch) {
9201
9553
  if (isArray(fn)) {
9202
9554
  suspense.effects.push(...fn);
@@ -9204,7 +9556,7 @@ function queueEffectWithSuspense(fn, suspense) {
9204
9556
  suspense.effects.push(fn);
9205
9557
  }
9206
9558
  } else {
9207
- queuePostFlushCb(fn);
9559
+ queuePostFlushCb(fn, id);
9208
9560
  }
9209
9561
  }
9210
9562
  function setActiveBranch(suspense, branch) {
@@ -9287,6 +9639,7 @@ const Fragment = Symbol.for("v-fgt");
9287
9639
  const Text = Symbol.for("v-txt");
9288
9640
  const Comment = Symbol.for("v-cmt");
9289
9641
  const Static = Symbol.for("v-stc");
9642
+ const VaporSlot = Symbol.for("v-vps");
9290
9643
  const blockStack = [];
9291
9644
  let currentBlock = null;
9292
9645
  function openBlock(disableTracking = false) {
@@ -9449,7 +9802,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
9449
9802
  }
9450
9803
  if (isObject(style)) {
9451
9804
  if (isProxy(style) && !isArray(style)) {
9452
- style = extend$1({}, style);
9805
+ style = extend({}, style);
9453
9806
  }
9454
9807
  props.style = normalizeStyle(style);
9455
9808
  }
@@ -9468,7 +9821,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
9468
9821
  }
9469
9822
  function guardReactiveProps(props) {
9470
9823
  if (!props) return null;
9471
- return isProxy(props) || isInternalObject(props) ? extend$1({}, props) : props;
9824
+ return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
9472
9825
  }
9473
9826
  function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
9474
9827
  const { props, ref, patchFlag, children, transition } = vnode;
@@ -9633,6 +9986,40 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
9633
9986
  ]);
9634
9987
  }
9635
9988
 
9989
+ let currentInstance = null;
9990
+ const getCurrentGenericInstance = () => currentInstance || currentRenderingInstance;
9991
+ const getCurrentInstance = () => currentInstance && !currentInstance.vapor ? currentInstance : currentRenderingInstance;
9992
+ let isInSSRComponentSetup = false;
9993
+ let setInSSRSetupState;
9994
+ let simpleSetCurrentInstance;
9995
+ {
9996
+ const g = getGlobalThis();
9997
+ const registerGlobalSetter = (key, setter) => {
9998
+ let setters;
9999
+ if (!(setters = g[key])) setters = g[key] = [];
10000
+ setters.push(setter);
10001
+ return (v) => {
10002
+ if (setters.length > 1) setters.forEach((set) => set(v));
10003
+ else setters[0](v);
10004
+ };
10005
+ };
10006
+ simpleSetCurrentInstance = registerGlobalSetter(
10007
+ `__VUE_INSTANCE_SETTERS__`,
10008
+ (v) => currentInstance = v
10009
+ );
10010
+ setInSSRSetupState = registerGlobalSetter(
10011
+ `__VUE_SSR_SETTERS__`,
10012
+ (v) => isInSSRComponentSetup = v
10013
+ );
10014
+ }
10015
+ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope : void 0) => {
10016
+ try {
10017
+ return [currentInstance, setCurrentScope(scope)];
10018
+ } finally {
10019
+ simpleSetCurrentInstance(instance);
10020
+ }
10021
+ };
10022
+
9636
10023
  const emptyAppContext = createAppContext();
9637
10024
  let uid = 0;
9638
10025
  function createComponentInstance(vnode, parent, suspense) {
@@ -9677,7 +10064,7 @@ function createComponentInstance(vnode, parent, suspense) {
9677
10064
  // to be set immediately
9678
10065
  emitted: null,
9679
10066
  // props default value
9680
- propsDefaults: EMPTY_OBJ,
10067
+ propsDefaults: null,
9681
10068
  // inheritAttrs
9682
10069
  inheritAttrs: type.inheritAttrs,
9683
10070
  // state
@@ -9724,53 +10111,19 @@ function createComponentInstance(vnode, parent, suspense) {
9724
10111
  }
9725
10112
  return instance;
9726
10113
  }
9727
- let currentInstance = null;
9728
- const getCurrentInstance = () => currentInstance || currentRenderingInstance;
9729
- let internalSetCurrentInstance;
9730
- let setInSSRSetupState;
9731
- {
9732
- const g = getGlobalThis();
9733
- const registerGlobalSetter = (key, setter) => {
9734
- let setters;
9735
- if (!(setters = g[key])) setters = g[key] = [];
9736
- setters.push(setter);
9737
- return (v) => {
9738
- if (setters.length > 1) setters.forEach((set) => set(v));
9739
- else setters[0](v);
9740
- };
9741
- };
9742
- internalSetCurrentInstance = registerGlobalSetter(
9743
- `__VUE_INSTANCE_SETTERS__`,
9744
- (v) => currentInstance = v
9745
- );
9746
- setInSSRSetupState = registerGlobalSetter(
9747
- `__VUE_SSR_SETTERS__`,
9748
- (v) => isInSSRComponentSetup = v
9749
- );
9750
- }
9751
- const setCurrentInstance = (instance) => {
9752
- const prev = currentInstance;
9753
- internalSetCurrentInstance(instance);
9754
- instance.scope.on();
9755
- return () => {
9756
- instance.scope.off();
9757
- internalSetCurrentInstance(prev);
9758
- };
9759
- };
9760
- const unsetCurrentInstance = () => {
9761
- currentInstance && currentInstance.scope.off();
9762
- internalSetCurrentInstance(null);
9763
- };
9764
10114
  function isStatefulComponent(instance) {
9765
10115
  return instance.vnode.shapeFlag & 4;
9766
10116
  }
9767
- let isInSSRComponentSetup = false;
9768
10117
  function setupComponent(instance, isSSR = false, optimized = false) {
9769
10118
  isSSR && setInSSRSetupState(isSSR);
9770
- const { props, children } = instance.vnode;
10119
+ const { props, children, vi } = instance.vnode;
9771
10120
  const isStateful = isStatefulComponent(instance);
9772
- initProps(instance, props, isStateful, isSSR);
9773
- initSlots(instance, children, optimized || isSSR);
10121
+ if (vi) {
10122
+ vi(instance);
10123
+ } else {
10124
+ initProps(instance, props, isStateful, isSSR);
10125
+ initSlots(instance, children, optimized || isSSR);
10126
+ }
9774
10127
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
9775
10128
  isSSR && setInSSRSetupState(false);
9776
10129
  return setupResult;
@@ -9781,9 +10134,9 @@ function setupStatefulComponent(instance, isSSR) {
9781
10134
  instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
9782
10135
  const { setup } = Component;
9783
10136
  if (setup) {
9784
- pauseTracking();
10137
+ const prevSub = setActiveSub();
9785
10138
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
9786
- const reset = setCurrentInstance(instance);
10139
+ const prev = setCurrentInstance(instance);
9787
10140
  const setupResult = callWithErrorHandling(
9788
10141
  setup,
9789
10142
  instance,
@@ -9794,12 +10147,15 @@ function setupStatefulComponent(instance, isSSR) {
9794
10147
  ]
9795
10148
  );
9796
10149
  const isAsyncSetup = isPromise(setupResult);
9797
- resetTracking();
9798
- reset();
10150
+ setActiveSub(prevSub);
10151
+ setCurrentInstance(...prev);
9799
10152
  if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
9800
10153
  markAsyncBoundary(instance);
9801
10154
  }
9802
10155
  if (isAsyncSetup) {
10156
+ const unsetCurrentInstance = () => {
10157
+ setCurrentInstance(null, void 0);
10158
+ };
9803
10159
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
9804
10160
  if (isSSR) {
9805
10161
  return setupResult.then((resolvedResult) => {
@@ -9851,8 +10207,8 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
9851
10207
  if (template) {
9852
10208
  const { isCustomElement, compilerOptions } = instance.appContext.config;
9853
10209
  const { delimiters, compilerOptions: componentCompilerOptions } = Component;
9854
- const finalCompilerOptions = extend$1(
9855
- extend$1(
10210
+ const finalCompilerOptions = extend(
10211
+ extend(
9856
10212
  {
9857
10213
  isCustomElement,
9858
10214
  delimiters
@@ -9864,7 +10220,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
9864
10220
  {
9865
10221
  finalCompilerOptions.compatConfig = Object.create(globalCompatConfig);
9866
10222
  if (Component.compatConfig) {
9867
- extend$1(finalCompilerOptions.compatConfig, Component.compatConfig);
10223
+ extend(finalCompilerOptions.compatConfig, Component.compatConfig);
9868
10224
  }
9869
10225
  }
9870
10226
  Component.render = compile$1(template, finalCompilerOptions);
@@ -9876,13 +10232,13 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
9876
10232
  }
9877
10233
  }
9878
10234
  if (!skipOptions) {
9879
- const reset = setCurrentInstance(instance);
9880
- pauseTracking();
10235
+ const prevInstance = setCurrentInstance(instance);
10236
+ const prevSub = setActiveSub();
9881
10237
  try {
9882
10238
  applyOptions(instance);
9883
10239
  } finally {
9884
- resetTracking();
9885
- reset();
10240
+ setActiveSub(prevSub);
10241
+ setCurrentInstance(...prevInstance);
9886
10242
  }
9887
10243
  }
9888
10244
  }
@@ -9893,18 +10249,18 @@ const attrsProxyHandlers = {
9893
10249
  }
9894
10250
  };
9895
10251
  function createSetupContext(instance) {
9896
- const expose = (exposed) => {
9897
- instance.exposed = exposed || {};
9898
- };
9899
10252
  {
9900
10253
  return {
9901
10254
  attrs: new Proxy(instance.attrs, attrsProxyHandlers),
9902
10255
  slots: instance.slots,
9903
10256
  emit: instance.emit,
9904
- expose
10257
+ expose: (exposed) => expose(instance, exposed)
9905
10258
  };
9906
10259
  }
9907
10260
  }
10261
+ function expose(instance, exposed) {
10262
+ instance.exposed = exposed || {};
10263
+ }
9908
10264
  function getComponentPublicInstance(instance) {
9909
10265
  if (instance.exposed) {
9910
10266
  return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
@@ -9912,7 +10268,9 @@ function getComponentPublicInstance(instance) {
9912
10268
  if (key in target) {
9913
10269
  return target[key];
9914
10270
  } else if (key in publicPropertiesMap) {
9915
- return publicPropertiesMap[key](instance);
10271
+ return publicPropertiesMap[key](
10272
+ instance
10273
+ );
9916
10274
  }
9917
10275
  },
9918
10276
  has(target, key) {
@@ -9931,8 +10289,7 @@ function isClassComponent(value) {
9931
10289
  }
9932
10290
 
9933
10291
  const computed = (getterOrOptions, debugOptions) => {
9934
- const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
9935
- return c;
10292
+ return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
9936
10293
  };
9937
10294
 
9938
10295
  function h(type, propsOrChildren, children) {
@@ -9988,7 +10345,7 @@ function isMemoSame(cached, memo) {
9988
10345
  return true;
9989
10346
  }
9990
10347
 
9991
- const version = "3.5.17";
10348
+ const version = "3.6.0-alpha.2";
9992
10349
  const warn$1 = NOOP;
9993
10350
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9994
10351
  const devtools = void 0;
@@ -10118,7 +10475,7 @@ const DOMTransitionPropsValidators = {
10118
10475
  leaveActiveClass: String,
10119
10476
  leaveToClass: String
10120
10477
  };
10121
- const TransitionPropsValidators = /* @__PURE__ */ extend$1(
10478
+ const TransitionPropsValidators = /* @__PURE__ */ extend(
10122
10479
  {},
10123
10480
  BaseTransitionPropsValidators,
10124
10481
  DOMTransitionPropsValidators
@@ -10230,7 +10587,7 @@ function resolveTransitionProps(rawProps) {
10230
10587
  });
10231
10588
  };
10232
10589
  };
10233
- return extend$1(baseProps, {
10590
+ return extend(baseProps, {
10234
10591
  onBeforeEnter(el) {
10235
10592
  callHook(onBeforeEnter, [el]);
10236
10593
  addTransitionClass(el, enterFromClass);
@@ -10528,11 +10885,11 @@ function patchStyle(el, prev, next) {
10528
10885
  }
10529
10886
  }
10530
10887
  const importantRE = /\s*!important$/;
10531
- function setStyle(style, name, val) {
10532
- if (isArray(val)) {
10533
- val.forEach((v) => setStyle(style, name, v));
10888
+ function setStyle(style, name, rawVal) {
10889
+ if (isArray(rawVal)) {
10890
+ rawVal.forEach((v) => setStyle(style, name, v));
10534
10891
  } else {
10535
- if (val == null) val = "";
10892
+ const val = rawVal == null ? "" : String(rawVal);
10536
10893
  if (name.startsWith("--")) {
10537
10894
  style.setProperty(name, val);
10538
10895
  } else {
@@ -10626,8 +10983,7 @@ function patchDOMProp(el, key, value, parentComponent, attrName) {
10626
10983
  return;
10627
10984
  }
10628
10985
  const tag = el.tagName;
10629
- if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
10630
- !tag.includes("-")) {
10986
+ if (key === "value" && canSetValueDirectly(tag)) {
10631
10987
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
10632
10988
  const newValue = value == null ? (
10633
10989
  // #11647: value should be set as empty string for null and undefined,
@@ -10750,8 +11106,6 @@ function patchStopImmediatePropagation(e, value) {
10750
11106
  }
10751
11107
  }
10752
11108
 
10753
- const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
10754
- key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
10755
11109
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
10756
11110
  const isSVG = namespace === "svg";
10757
11111
  if (key === "class") {
@@ -10791,24 +11145,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
10791
11145
  }
10792
11146
  return false;
10793
11147
  }
10794
- if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
10795
- return false;
10796
- }
10797
- if (key === "form") {
10798
- return false;
10799
- }
10800
- if (key === "list" && el.tagName === "INPUT") {
10801
- return false;
10802
- }
10803
- if (key === "type" && el.tagName === "TEXTAREA") {
11148
+ if (shouldSetAsAttr(el.tagName, key)) {
10804
11149
  return false;
10805
11150
  }
10806
- if (key === "width" || key === "height") {
10807
- const tag = el.tagName;
10808
- if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
10809
- return false;
10810
- }
10811
- }
10812
11151
  if (isNativeOn(key) && isString(value)) {
10813
11152
  return false;
10814
11153
  }
@@ -10820,7 +11159,7 @@ const REMOVAL = {};
10820
11159
  // @__NO_SIDE_EFFECTS__
10821
11160
  function defineCustomElement(options, extraOptions, _createApp) {
10822
11161
  const Comp = defineComponent(options, extraOptions);
10823
- if (isPlainObject(Comp)) extend$1(Comp, extraOptions);
11162
+ if (isPlainObject(Comp)) extend(Comp, extraOptions);
10824
11163
  class VueCustomElement extends VueElement {
10825
11164
  constructor(initialProps) {
10826
11165
  super(Comp, initialProps, _createApp);
@@ -11069,7 +11408,7 @@ class VueElement extends BaseClass {
11069
11408
  if (!this.shadowRoot) {
11070
11409
  baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
11071
11410
  }
11072
- const vnode = createVNode(this._def, extend$1(baseProps, this._props));
11411
+ const vnode = createVNode(this._def, extend(baseProps, this._props));
11073
11412
  if (!this._instance) {
11074
11413
  vnode.ce = (instance) => {
11075
11414
  this._instance = instance;
@@ -11079,7 +11418,7 @@ class VueElement extends BaseClass {
11079
11418
  this.dispatchEvent(
11080
11419
  new CustomEvent(
11081
11420
  event,
11082
- isPlainObject(args[0]) ? extend$1({ detail: args }, args[0]) : { detail: args }
11421
+ isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
11083
11422
  )
11084
11423
  );
11085
11424
  };
@@ -11208,7 +11547,7 @@ const decorate = (t) => {
11208
11547
  };
11209
11548
  const TransitionGroupImpl = /* @__PURE__ */ decorate({
11210
11549
  name: "TransitionGroup",
11211
- props: /* @__PURE__ */ extend$1({}, TransitionPropsValidators, {
11550
+ props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
11212
11551
  tag: String,
11213
11552
  moveClass: String
11214
11553
  }),
@@ -11359,28 +11698,12 @@ const assignKey = Symbol("_assign");
11359
11698
  const vModelText = {
11360
11699
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
11361
11700
  el[assignKey] = getModelAssigner(vnode);
11362
- const castToNumber = number || vnode.props && vnode.props.type === "number";
11363
- addEventListener(el, lazy ? "change" : "input", (e) => {
11364
- if (e.target.composing) return;
11365
- let domValue = el.value;
11366
- if (trim) {
11367
- domValue = domValue.trim();
11368
- }
11369
- if (castToNumber) {
11370
- domValue = looseToNumber(domValue);
11371
- }
11372
- el[assignKey](domValue);
11373
- });
11374
- if (trim) {
11375
- addEventListener(el, "change", () => {
11376
- el.value = el.value.trim();
11377
- });
11378
- }
11379
- if (!lazy) {
11380
- addEventListener(el, "compositionstart", onCompositionStart);
11381
- addEventListener(el, "compositionend", onCompositionEnd);
11382
- addEventListener(el, "change", onCompositionEnd);
11383
- }
11701
+ vModelTextInit(
11702
+ el,
11703
+ trim,
11704
+ number || !!(vnode.props && vnode.props.type === "number"),
11705
+ lazy
11706
+ );
11384
11707
  },
11385
11708
  // set value on mounted so it's after min/max for type="range"
11386
11709
  mounted(el, { value }) {
@@ -11388,70 +11711,111 @@ const vModelText = {
11388
11711
  },
11389
11712
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
11390
11713
  el[assignKey] = getModelAssigner(vnode);
11391
- if (el.composing) return;
11392
- const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
11393
- const newValue = value == null ? "" : value;
11394
- if (elValue === newValue) {
11714
+ vModelTextUpdate(el, oldValue, value, trim, number, lazy);
11715
+ }
11716
+ };
11717
+ const vModelTextInit = (el, trim, number, lazy, set) => {
11718
+ addEventListener(el, lazy ? "change" : "input", (e) => {
11719
+ if (e.target.composing) return;
11720
+ let domValue = el.value;
11721
+ if (trim) {
11722
+ domValue = domValue.trim();
11723
+ }
11724
+ if (number || el.type === "number") {
11725
+ domValue = looseToNumber(domValue);
11726
+ }
11727
+ (0, el[assignKey])(domValue);
11728
+ });
11729
+ if (trim) {
11730
+ addEventListener(el, "change", () => {
11731
+ el.value = el.value.trim();
11732
+ });
11733
+ }
11734
+ if (!lazy) {
11735
+ addEventListener(el, "compositionstart", onCompositionStart);
11736
+ addEventListener(el, "compositionend", onCompositionEnd);
11737
+ addEventListener(el, "change", onCompositionEnd);
11738
+ }
11739
+ };
11740
+ const vModelTextUpdate = (el, oldValue, value, trim, number, lazy) => {
11741
+ if (el.composing) return;
11742
+ const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
11743
+ const newValue = value == null ? "" : value;
11744
+ if (elValue === newValue) {
11745
+ return;
11746
+ }
11747
+ if (document.activeElement === el && el.type !== "range") {
11748
+ if (lazy && value === oldValue) {
11395
11749
  return;
11396
11750
  }
11397
- if (document.activeElement === el && el.type !== "range") {
11398
- if (lazy && value === oldValue) {
11399
- return;
11400
- }
11401
- if (trim && el.value.trim() === newValue) {
11402
- return;
11403
- }
11751
+ if (trim && el.value.trim() === newValue) {
11752
+ return;
11404
11753
  }
11405
- el.value = newValue;
11406
11754
  }
11755
+ el.value = newValue;
11407
11756
  };
11408
11757
  const vModelCheckbox = {
11409
11758
  // #4096 array checkboxes need to be deep traversed
11410
11759
  deep: true,
11411
11760
  created(el, _, vnode) {
11412
11761
  el[assignKey] = getModelAssigner(vnode);
11413
- addEventListener(el, "change", () => {
11414
- const modelValue = el._modelValue;
11415
- const elementValue = getValue(el);
11416
- const checked = el.checked;
11417
- const assign = el[assignKey];
11418
- if (isArray(modelValue)) {
11419
- const index = looseIndexOf(modelValue, elementValue);
11420
- const found = index !== -1;
11421
- if (checked && !found) {
11422
- assign(modelValue.concat(elementValue));
11423
- } else if (!checked && found) {
11424
- const filtered = [...modelValue];
11425
- filtered.splice(index, 1);
11426
- assign(filtered);
11427
- }
11428
- } else if (isSet(modelValue)) {
11429
- const cloned = new Set(modelValue);
11430
- if (checked) {
11431
- cloned.add(elementValue);
11432
- } else {
11433
- cloned.delete(elementValue);
11434
- }
11435
- assign(cloned);
11436
- } else {
11437
- assign(getCheckboxValue(el, checked));
11438
- }
11439
- });
11762
+ vModelCheckboxInit(el);
11440
11763
  },
11441
11764
  // set initial checked on mount to wait for true-value/false-value
11442
- mounted: setChecked,
11765
+ mounted(el, binding, vnode) {
11766
+ vModelCheckboxUpdate(
11767
+ el,
11768
+ binding.oldValue,
11769
+ binding.value,
11770
+ vnode.props.value
11771
+ );
11772
+ },
11443
11773
  beforeUpdate(el, binding, vnode) {
11444
11774
  el[assignKey] = getModelAssigner(vnode);
11445
- setChecked(el, binding, vnode);
11775
+ vModelCheckboxUpdate(
11776
+ el,
11777
+ binding.oldValue,
11778
+ binding.value,
11779
+ vnode.props.value
11780
+ );
11446
11781
  }
11447
11782
  };
11448
- function setChecked(el, { value, oldValue }, vnode) {
11783
+ const vModelCheckboxInit = (el, set) => {
11784
+ addEventListener(el, "change", () => {
11785
+ const assign = el[assignKey];
11786
+ const modelValue = el._modelValue;
11787
+ const elementValue = getValue(el);
11788
+ const checked = el.checked;
11789
+ if (isArray(modelValue)) {
11790
+ const index = looseIndexOf(modelValue, elementValue);
11791
+ const found = index !== -1;
11792
+ if (checked && !found) {
11793
+ assign(modelValue.concat(elementValue));
11794
+ } else if (!checked && found) {
11795
+ const filtered = [...modelValue];
11796
+ filtered.splice(index, 1);
11797
+ assign(filtered);
11798
+ }
11799
+ } else if (isSet(modelValue)) {
11800
+ const cloned = new Set(modelValue);
11801
+ if (checked) {
11802
+ cloned.add(elementValue);
11803
+ } else {
11804
+ cloned.delete(elementValue);
11805
+ }
11806
+ assign(cloned);
11807
+ } else {
11808
+ assign(getCheckboxValue(el, checked));
11809
+ }
11810
+ });
11811
+ };
11812
+ const vModelCheckboxUpdate = (el, oldValue, value, rawValue = getValue(el)) => {
11449
11813
  el._modelValue = value;
11450
11814
  let checked;
11451
11815
  if (isArray(value)) {
11452
- checked = looseIndexOf(value, vnode.props.value) > -1;
11816
+ checked = looseIndexOf(value, rawValue) > -1;
11453
11817
  } else if (isSet(value)) {
11454
- checked = value.has(vnode.props.value);
11818
+ checked = value.has(rawValue);
11455
11819
  } else {
11456
11820
  if (value === oldValue) return;
11457
11821
  checked = looseEqual(value, getCheckboxValue(el, true));
@@ -11459,7 +11823,7 @@ function setChecked(el, { value, oldValue }, vnode) {
11459
11823
  if (el.checked !== checked) {
11460
11824
  el.checked = checked;
11461
11825
  }
11462
- }
11826
+ };
11463
11827
  const vModelRadio = {
11464
11828
  created(el, { value }, vnode) {
11465
11829
  el.checked = looseEqual(value, vnode.props.value);
@@ -11479,36 +11843,38 @@ const vModelSelect = {
11479
11843
  // <select multiple> value need to be deep traversed
11480
11844
  deep: true,
11481
11845
  created(el, { value, modifiers: { number } }, vnode) {
11482
- const isSetModel = isSet(value);
11483
- addEventListener(el, "change", () => {
11484
- const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
11485
- (o) => number ? looseToNumber(getValue(o)) : getValue(o)
11486
- );
11487
- el[assignKey](
11488
- el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
11489
- );
11490
- el._assigning = true;
11491
- nextTick(() => {
11492
- el._assigning = false;
11493
- });
11494
- });
11846
+ vModelSelectInit(el, value, number);
11495
11847
  el[assignKey] = getModelAssigner(vnode);
11496
11848
  },
11497
11849
  // set value in mounted & updated because <select> relies on its children
11498
11850
  // <option>s.
11499
11851
  mounted(el, { value }) {
11500
- setSelected(el, value);
11852
+ vModelSetSelected(el, value);
11501
11853
  },
11502
11854
  beforeUpdate(el, _binding, vnode) {
11503
11855
  el[assignKey] = getModelAssigner(vnode);
11504
11856
  },
11505
11857
  updated(el, { value }) {
11506
- if (!el._assigning) {
11507
- setSelected(el, value);
11508
- }
11858
+ vModelSetSelected(el, value);
11509
11859
  }
11510
11860
  };
11511
- function setSelected(el, value) {
11861
+ const vModelSelectInit = (el, value, number, set) => {
11862
+ const isSetModel = isSet(value);
11863
+ addEventListener(el, "change", () => {
11864
+ const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
11865
+ (o) => number ? looseToNumber(getValue(o)) : getValue(o)
11866
+ );
11867
+ (0, el[assignKey])(
11868
+ el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
11869
+ );
11870
+ el._assigning = true;
11871
+ nextTick(() => {
11872
+ el._assigning = false;
11873
+ });
11874
+ });
11875
+ };
11876
+ const vModelSetSelected = (el, value) => {
11877
+ if (el._assigning) return;
11512
11878
  const isMultiple = el.multiple;
11513
11879
  const isArrayValue = isArray(value);
11514
11880
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -11536,13 +11902,20 @@ function setSelected(el, value) {
11536
11902
  if (!isMultiple && el.selectedIndex !== -1) {
11537
11903
  el.selectedIndex = -1;
11538
11904
  }
11539
- }
11905
+ };
11540
11906
  function getValue(el) {
11541
11907
  return "_value" in el ? el._value : el.value;
11542
11908
  }
11543
11909
  function getCheckboxValue(el, checked) {
11544
11910
  const key = checked ? "_trueValue" : "_falseValue";
11545
- return key in el ? el[key] : checked;
11911
+ if (key in el) {
11912
+ return el[key];
11913
+ }
11914
+ const attr = checked ? "true-value" : "false-value";
11915
+ if (el.hasAttribute(attr)) {
11916
+ return el.getAttribute(attr);
11917
+ }
11918
+ return checked;
11546
11919
  }
11547
11920
  const vModelDynamic = {
11548
11921
  created(el, binding, vnode) {
@@ -11698,7 +12071,7 @@ const withKeys = (fn, modifiers) => {
11698
12071
  });
11699
12072
  };
11700
12073
 
11701
- const rendererOptions = /* @__PURE__ */ extend$1({ patchProp }, nodeOps);
12074
+ const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
11702
12075
  let renderer;
11703
12076
  let enabledHydration = false;
11704
12077
  function ensureRenderer() {
@@ -11957,7 +12330,7 @@ function wrappedCreateApp(...args) {
11957
12330
  }
11958
12331
  function createCompatVue() {
11959
12332
  const Vue = compatUtils.createCompatVue(createApp, wrappedCreateApp);
11960
- extend$1(Vue, runtimeDom);
12333
+ extend(Vue, runtimeDom);
11961
12334
  return Vue;
11962
12335
  }
11963
12336
 
@@ -13384,7 +13757,7 @@ function markScopeIdentifier(node, child, knownIds) {
13384
13757
  const isFunctionType = (node) => {
13385
13758
  return /Function(?:Expression|Declaration)$|Method$/.test(node.type);
13386
13759
  };
13387
- const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
13760
+ const isStaticProperty = (node) => !!node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
13388
13761
  const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
13389
13762
  function isReferenced(node, parent, grandparent) {
13390
13763
  switch (parent.type) {
@@ -14236,9 +14609,9 @@ function onCloseTag(el, end, isImplied = false) {
14236
14609
  }
14237
14610
  if (tokenizer.inSFCRoot) {
14238
14611
  if (el.children.length) {
14239
- el.innerLoc.end = extend$1({}, el.children[el.children.length - 1].loc.end);
14612
+ el.innerLoc.end = extend({}, el.children[el.children.length - 1].loc.end);
14240
14613
  } else {
14241
- el.innerLoc.end = extend$1({}, el.innerLoc.start);
14614
+ el.innerLoc.end = extend({}, el.innerLoc.start);
14242
14615
  }
14243
14616
  el.innerLoc.source = getSlice(
14244
14617
  el.innerLoc.start.offset,
@@ -14508,7 +14881,7 @@ function reset() {
14508
14881
  function baseParse(input, options) {
14509
14882
  reset();
14510
14883
  currentInput = input;
14511
- currentOptions = extend$1({}, defaultParserOptions);
14884
+ currentOptions = extend({}, defaultParserOptions);
14512
14885
  if (options) {
14513
14886
  let key;
14514
14887
  for (key in options) {
@@ -14829,6 +15202,10 @@ function getNodeProps(node) {
14829
15202
  }
14830
15203
  }
14831
15204
 
15205
+ function getSelfName(filename) {
15206
+ const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
15207
+ return nameMatch ? capitalize(camelize(nameMatch[1])) : null;
15208
+ }
14832
15209
  function createTransformContext(root, {
14833
15210
  filename = "",
14834
15211
  prefixIdentifiers = false,
@@ -14853,11 +15230,10 @@ function createTransformContext(root, {
14853
15230
  onWarn = defaultOnWarn,
14854
15231
  compatConfig
14855
15232
  }) {
14856
- const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
14857
15233
  const context = {
14858
15234
  // options
14859
15235
  filename,
14860
- selfName: nameMatch && capitalize(camelize(nameMatch[1])),
15236
+ selfName: getSelfName(filename),
14861
15237
  prefixIdentifiers,
14862
15238
  hoistStatic,
14863
15239
  hmr,
@@ -15177,7 +15553,7 @@ function createCodegenContext(ast, {
15177
15553
  helper(key) {
15178
15554
  return `_${helperNameMap[key]}`;
15179
15555
  },
15180
- push(code, newlineIndex = -2 /* None */, node) {
15556
+ push(code, newlineIndex = -2, node) {
15181
15557
  context.code += code;
15182
15558
  if (context.map) {
15183
15559
  if (node) {
@@ -15192,14 +15568,14 @@ function createCodegenContext(ast, {
15192
15568
  addMapping(node.loc.start, name);
15193
15569
  }
15194
15570
  }
15195
- if (newlineIndex === -3 /* Unknown */) {
15571
+ if (newlineIndex === -3) {
15196
15572
  advancePositionWithMutation(context, code);
15197
15573
  } else {
15198
15574
  context.offset += code.length;
15199
- if (newlineIndex === -2 /* None */) {
15575
+ if (newlineIndex === -2) {
15200
15576
  context.column += code.length;
15201
15577
  } else {
15202
- if (newlineIndex === -1 /* End */) {
15578
+ if (newlineIndex === -1) {
15203
15579
  newlineIndex = code.length - 1;
15204
15580
  }
15205
15581
  context.line++;
@@ -15226,7 +15602,7 @@ function createCodegenContext(ast, {
15226
15602
  }
15227
15603
  };
15228
15604
  function newline(n) {
15229
- context.push("\n" + ` `.repeat(n), 0 /* Start */);
15605
+ context.push("\n" + ` `.repeat(n), 0);
15230
15606
  }
15231
15607
  function addMapping(loc, name = null) {
15232
15608
  const { _names, _mappings } = context.map;
@@ -15291,7 +15667,7 @@ function generate(ast, options = {}) {
15291
15667
  push(
15292
15668
  `const { ${helpers.map(aliasHelper).join(", ")} } = _Vue
15293
15669
  `,
15294
- -1 /* End */
15670
+ -1
15295
15671
  );
15296
15672
  newline();
15297
15673
  }
@@ -15321,7 +15697,7 @@ function generate(ast, options = {}) {
15321
15697
  }
15322
15698
  if (ast.components.length || ast.directives.length || ast.temps) {
15323
15699
  push(`
15324
- `, 0 /* Start */);
15700
+ `, 0);
15325
15701
  newline();
15326
15702
  }
15327
15703
  if (!ssr) {
@@ -15342,7 +15718,8 @@ function generate(ast, options = {}) {
15342
15718
  ast,
15343
15719
  code: context.code,
15344
15720
  preamble: isSetupInlined ? preambleContext.code : ``,
15345
- map: context.map ? context.map.toJSON() : void 0
15721
+ map: context.map ? context.map.toJSON() : void 0,
15722
+ helpers: ast.helpers
15346
15723
  };
15347
15724
  }
15348
15725
  function genFunctionPreamble(ast, context) {
@@ -15362,11 +15739,11 @@ function genFunctionPreamble(ast, context) {
15362
15739
  push(
15363
15740
  `const { ${helpers.map(aliasHelper).join(", ")} } = ${VueBinding}
15364
15741
  `,
15365
- -1 /* End */
15742
+ -1
15366
15743
  );
15367
15744
  } else {
15368
15745
  push(`const _Vue = ${VueBinding}
15369
- `, -1 /* End */);
15746
+ `, -1);
15370
15747
  if (ast.hoists.length) {
15371
15748
  const staticHelpers = [
15372
15749
  CREATE_VNODE,
@@ -15376,7 +15753,7 @@ function genFunctionPreamble(ast, context) {
15376
15753
  CREATE_STATIC
15377
15754
  ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", ");
15378
15755
  push(`const { ${staticHelpers} } = _Vue
15379
- `, -1 /* End */);
15756
+ `, -1);
15380
15757
  }
15381
15758
  }
15382
15759
  }
@@ -15384,7 +15761,7 @@ function genFunctionPreamble(ast, context) {
15384
15761
  push(
15385
15762
  `const { ${ast.ssrHelpers.map(aliasHelper).join(", ")} } = require("${ssrRuntimeModuleName}")
15386
15763
  `,
15387
- -1 /* End */
15764
+ -1
15388
15765
  );
15389
15766
  }
15390
15767
  genHoists(ast.hoists, context);
@@ -15405,20 +15782,20 @@ function genModulePreamble(ast, context, genScopeId, inline) {
15405
15782
  push(
15406
15783
  `import { ${helpers.map((s) => helperNameMap[s]).join(", ")} } from ${JSON.stringify(runtimeModuleName)}
15407
15784
  `,
15408
- -1 /* End */
15785
+ -1
15409
15786
  );
15410
15787
  push(
15411
15788
  `
15412
15789
  // Binding optimization for webpack code-split
15413
15790
  const ${helpers.map((s) => `_${helperNameMap[s]} = ${helperNameMap[s]}`).join(", ")}
15414
15791
  `,
15415
- -1 /* End */
15792
+ -1
15416
15793
  );
15417
15794
  } else {
15418
15795
  push(
15419
15796
  `import { ${helpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(", ")} } from ${JSON.stringify(runtimeModuleName)}
15420
15797
  `,
15421
- -1 /* End */
15798
+ -1
15422
15799
  );
15423
15800
  }
15424
15801
  }
@@ -15426,7 +15803,7 @@ const ${helpers.map((s) => `_${helperNameMap[s]} = ${helperNameMap[s]}`).join(",
15426
15803
  push(
15427
15804
  `import { ${ast.ssrHelpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(", ")} } from "${ssrRuntimeModuleName}"
15428
15805
  `,
15429
- -1 /* End */
15806
+ -1
15430
15807
  );
15431
15808
  }
15432
15809
  if (ast.imports.length) {
@@ -15501,7 +15878,7 @@ function genNodeList(nodes, context, multilines = false, comma = true) {
15501
15878
  for (let i = 0; i < nodes.length; i++) {
15502
15879
  const node = nodes[i];
15503
15880
  if (isString(node)) {
15504
- push(node, -3 /* Unknown */);
15881
+ push(node, -3);
15505
15882
  } else if (isArray(node)) {
15506
15883
  genNodeListAsArray(node, context);
15507
15884
  } else {
@@ -15519,7 +15896,7 @@ function genNodeList(nodes, context, multilines = false, comma = true) {
15519
15896
  }
15520
15897
  function genNode(node, context) {
15521
15898
  if (isString(node)) {
15522
- context.push(node, -3 /* Unknown */);
15899
+ context.push(node, -3);
15523
15900
  return;
15524
15901
  }
15525
15902
  if (isSymbol(node)) {
@@ -15593,13 +15970,13 @@ function genNode(node, context) {
15593
15970
  }
15594
15971
  }
15595
15972
  function genText(node, context) {
15596
- context.push(JSON.stringify(node.content), -3 /* Unknown */, node);
15973
+ context.push(JSON.stringify(node.content), -3, node);
15597
15974
  }
15598
15975
  function genExpression(node, context) {
15599
15976
  const { content, isStatic } = node;
15600
15977
  context.push(
15601
15978
  isStatic ? JSON.stringify(content) : content,
15602
- -3 /* Unknown */,
15979
+ -3,
15603
15980
  node
15604
15981
  );
15605
15982
  }
@@ -15614,7 +15991,7 @@ function genCompoundExpression(node, context) {
15614
15991
  for (let i = 0; i < node.children.length; i++) {
15615
15992
  const child = node.children[i];
15616
15993
  if (isString(child)) {
15617
- context.push(child, -3 /* Unknown */);
15994
+ context.push(child, -3);
15618
15995
  } else {
15619
15996
  genNode(child, context);
15620
15997
  }
@@ -15628,9 +16005,9 @@ function genExpressionAsPropertyKey(node, context) {
15628
16005
  push(`]`);
15629
16006
  } else if (node.isStatic) {
15630
16007
  const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content);
15631
- push(text, -2 /* None */, node);
16008
+ push(text, -2, node);
15632
16009
  } else {
15633
- push(`[${node.content}]`, -3 /* Unknown */, node);
16010
+ push(`[${node.content}]`, -3, node);
15634
16011
  }
15635
16012
  }
15636
16013
  function genComment(node, context) {
@@ -15640,7 +16017,7 @@ function genComment(node, context) {
15640
16017
  }
15641
16018
  push(
15642
16019
  `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`,
15643
- -3 /* Unknown */,
16020
+ -3,
15644
16021
  node
15645
16022
  );
15646
16023
  }
@@ -15673,7 +16050,7 @@ function genVNodeCall(node, context) {
15673
16050
  push(PURE_ANNOTATION);
15674
16051
  }
15675
16052
  const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent);
15676
- push(helper(callHelper) + `(`, -2 /* None */, node);
16053
+ push(helper(callHelper) + `(`, -2, node);
15677
16054
  genNodeList(
15678
16055
  genNullableArgs([tag, props, children, patchFlagString, dynamicProps]),
15679
16056
  context
@@ -15701,7 +16078,7 @@ function genCallExpression(node, context) {
15701
16078
  if (pure) {
15702
16079
  push(PURE_ANNOTATION);
15703
16080
  }
15704
- push(callee + `(`, -2 /* None */, node);
16081
+ push(callee + `(`, -2, node);
15705
16082
  genNodeList(node.arguments, context);
15706
16083
  push(`)`);
15707
16084
  }
@@ -15709,7 +16086,7 @@ function genObjectExpression(node, context) {
15709
16086
  const { push, indent, deindent, newline } = context;
15710
16087
  const { properties } = node;
15711
16088
  if (!properties.length) {
15712
- push(`{}`, -2 /* None */, node);
16089
+ push(`{}`, -2, node);
15713
16090
  return;
15714
16091
  }
15715
16092
  const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4);
@@ -15737,7 +16114,7 @@ function genFunctionExpression(node, context) {
15737
16114
  if (isSlot) {
15738
16115
  push(`_${helperNameMap[WITH_CTX]}(`);
15739
16116
  }
15740
- push(`(`, -2 /* None */, node);
16117
+ push(`(`, -2, node);
15741
16118
  if (isArray(params)) {
15742
16119
  genNodeList(params, context);
15743
16120
  } else if (params) {
@@ -15844,7 +16221,7 @@ function genTemplateLiteral(node, context) {
15844
16221
  for (let i = 0; i < l; i++) {
15845
16222
  const e = node.elements[i];
15846
16223
  if (isString(e)) {
15847
- push(e.replace(/(`|\$|\\)/g, "\\$1"), -3 /* Unknown */);
16224
+ push(e.replace(/(`|\$|\\)/g, "\\$1"), -3);
15848
16225
  } else {
15849
16226
  push("${");
15850
16227
  if (multilines) indent();
@@ -18100,7 +18477,7 @@ function baseCompile(source, options = {}) {
18100
18477
  if (options.scopeId && !isModuleMode) {
18101
18478
  onError(createCompilerError(50));
18102
18479
  }
18103
- const resolvedOptions = extend$1({}, options, {
18480
+ const resolvedOptions = extend({}, options, {
18104
18481
  prefixIdentifiers
18105
18482
  });
18106
18483
  const ast = isString(source) ? baseParse(source, resolvedOptions) : source;
@@ -18113,13 +18490,13 @@ function baseCompile(source, options = {}) {
18113
18490
  }
18114
18491
  transform(
18115
18492
  ast,
18116
- extend$1({}, resolvedOptions, {
18493
+ extend({}, resolvedOptions, {
18117
18494
  nodeTransforms: [
18118
18495
  ...nodeTransforms,
18119
18496
  ...options.nodeTransforms || []
18120
18497
  // user transforms
18121
18498
  ],
18122
- directiveTransforms: extend$1(
18499
+ directiveTransforms: extend(
18123
18500
  {},
18124
18501
  directiveTransforms,
18125
18502
  options.directiveTransforms || {}
@@ -18258,7 +18635,9 @@ const DOMErrorMessages = {
18258
18635
  [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
18259
18636
  [61]: `v-show is missing expression.`,
18260
18637
  [62]: `<Transition> expects exactly one child element or component.`,
18261
- [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
18638
+ [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`,
18639
+ // just to fulfill types
18640
+ [64]: ``
18262
18641
  };
18263
18642
 
18264
18643
  const transformVHtml = (dir, node, context) => {
@@ -18389,16 +18768,17 @@ const resolveModifiers = (key, modifiers, context, loc) => {
18389
18768
  const eventOptionModifiers = [];
18390
18769
  for (let i = 0; i < modifiers.length; i++) {
18391
18770
  const modifier = modifiers[i].content;
18392
- if (modifier === "native" && checkCompatEnabled(
18771
+ if (modifier === "native" && context && checkCompatEnabled(
18393
18772
  "COMPILER_V_ON_NATIVE",
18394
18773
  context)) {
18395
18774
  eventOptionModifiers.push(modifier);
18396
18775
  } else if (isEventOptionModifier(modifier)) {
18397
18776
  eventOptionModifiers.push(modifier);
18398
18777
  } else {
18778
+ const keyString = isString(key) ? key : isStaticExp(key) ? key.content : null;
18399
18779
  if (maybeKeyModifier(modifier)) {
18400
- if (isStaticExp(key)) {
18401
- if (isKeyboardEvent(key.content.toLowerCase())) {
18780
+ if (keyString) {
18781
+ if (isKeyboardEvent(keyString.toLowerCase())) {
18402
18782
  keyModifiers.push(modifier);
18403
18783
  } else {
18404
18784
  nonKeyModifiers.push(modifier);
@@ -18734,7 +19114,7 @@ const DOMDirectiveTransforms = {
18734
19114
  function compile(src, options = {}) {
18735
19115
  return baseCompile(
18736
19116
  src,
18737
- extend$1({}, parserOptions, options, {
19117
+ extend({}, parserOptions, options, {
18738
19118
  nodeTransforms: [
18739
19119
  // ignore <script> and <tag>
18740
19120
  // this is not put inside DOMNodeTransforms because that list is used
@@ -18743,7 +19123,7 @@ function compile(src, options = {}) {
18743
19123
  ...DOMNodeTransforms,
18744
19124
  ...options.nodeTransforms || []
18745
19125
  ],
18746
- directiveTransforms: extend$1(
19126
+ directiveTransforms: extend(
18747
19127
  {},
18748
19128
  DOMDirectiveTransforms,
18749
19129
  options.directiveTransforms || {}
@@ -18773,7 +19153,7 @@ function compileToFunction(template, options) {
18773
19153
  }
18774
19154
  const { code } = compile(
18775
19155
  template,
18776
- extend$1(
19156
+ extend(
18777
19157
  {
18778
19158
  hoistStatic: true,
18779
19159
  whitespace: "preserve",