@vue/compat 3.6.0-beta.9 → 3.6.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-beta.9
2
+ * @vue/compat v3.6.0-rc.10
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -23,7 +23,7 @@ var __exportAll = (all, no_symbols) => {
23
23
  * \/\*#\_\_PURE\_\_\*\/
24
24
  * So that they can be tree-shaken if necessary.
25
25
  */
26
- /* @__NO_SIDE_EFFECTS__ */
26
+ /*@__NO_SIDE_EFFECTS__*/
27
27
  function makeMap(str) {
28
28
  const map = Object.create(null);
29
29
  for (const key of str.split(",")) map[key] = 1;
@@ -67,9 +67,9 @@ const toRawType = (value) => {
67
67
  };
68
68
  const isPlainObject = (val) => toTypeString(val) === "[object Object]";
69
69
  const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
70
- const isReservedProp = /* @__PURE__ */ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
71
- const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
72
- const isBuiltInDirective = /* @__PURE__ */ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
70
+ const isReservedProp = /*@__PURE__*/ makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");
71
+ const isBuiltInTag = /*#__PURE__*/ makeMap("slot,component");
72
+ const isBuiltInDirective = /*@__PURE__*/ makeMap("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo");
73
73
  const cacheStringFunction = (fn) => {
74
74
  const cache = Object.create(null);
75
75
  return ((str) => {
@@ -177,7 +177,7 @@ const slotFlagsText = {
177
177
  [2]: "DYNAMIC",
178
178
  [3]: "FORWARDED"
179
179
  };
180
- const isGloballyAllowed = /* @__PURE__ */ makeMap("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");
180
+ const isGloballyAllowed = /*@__PURE__*/ makeMap("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");
181
181
  //#endregion
182
182
  //#region packages/shared/src/codeframe.ts
183
183
  const range = 2;
@@ -231,10 +231,10 @@ function normalizeStyle(value) {
231
231
  }
232
232
  const listDelimiterRE = /;(?![^(]*\))/g;
233
233
  const propertyDelimiterRE = /:([^]+)/;
234
- const styleCommentRE = /\/\*[^]*?\*\//g;
234
+ const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
235
235
  function parseStringStyle(cssText) {
236
236
  const ret = {};
237
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
237
+ cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
238
238
  if (item) {
239
239
  const tmp = item.split(propertyDelimiterRE);
240
240
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -284,22 +284,22 @@ const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,tr
284
284
  * Compiler only.
285
285
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
286
286
  */
287
- const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
287
+ const isHTMLTag = /*@__PURE__*/ makeMap(HTML_TAGS);
288
288
  /**
289
289
  * Compiler only.
290
290
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
291
291
  */
292
- const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
292
+ const isSVGTag = /*@__PURE__*/ makeMap(SVG_TAGS);
293
293
  /**
294
294
  * Compiler only.
295
295
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
296
296
  */
297
- const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
297
+ const isMathMLTag = /*@__PURE__*/ makeMap(MATH_TAGS);
298
298
  /**
299
299
  * Compiler only.
300
300
  * Do NOT use in runtime code paths unless behind `__DEV__` flag.
301
301
  */
302
- const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
302
+ const isVoidTag = /*@__PURE__*/ makeMap(VOID_TAGS);
303
303
  //#endregion
304
304
  //#region packages/shared/src/domAttrConfig.ts
305
305
  /**
@@ -314,11 +314,11 @@ const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
314
314
  * - readonly -> readOnly
315
315
  */
316
316
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
317
- const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
317
+ const isSpecialBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs);
318
318
  /**
319
319
  * The full list is needed during SSR to produce the correct initial markup.
320
320
  */
321
- const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
321
+ const isBooleanAttr = /*@__PURE__*/ makeMap(specialBooleanAttrs + ",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");
322
322
  /**
323
323
  * Boolean attributes should be included if the value is truthy or ''.
324
324
  * e.g. `<select multiple>` compiles to `{ multiple: '' }`
@@ -332,11 +332,11 @@ function includeBooleanAttr(value) {
332
332
  * Don't also forget to allow `data-*` and `aria-*`!
333
333
  * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
334
334
  */
335
- const isKnownHtmlAttr = /* @__PURE__ */ makeMap("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap");
335
+ const isKnownHtmlAttr = /*@__PURE__*/ makeMap("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap");
336
336
  /**
337
337
  * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
338
338
  */
339
- const isKnownSvgAttr = /* @__PURE__ */ makeMap("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");
339
+ const isKnownSvgAttr = /*@__PURE__*/ makeMap("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");
340
340
  /**
341
341
  * Shared between server-renderer and runtime-core hydration logic
342
342
  */
@@ -362,13 +362,54 @@ function getEscapedCssVarName(key, doubleEscape) {
362
362
  }
363
363
  //#endregion
364
364
  //#region packages/shared/src/looseEqual.ts
365
- function looseCompareArrays(a, b) {
365
+ function looseCompareArrays(a, b, seen) {
366
366
  if (a.length !== b.length) return false;
367
367
  let equal = true;
368
- for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i]);
368
+ for (let i = 0; equal && i < a.length; i++) equal = looseEqual(a[i], b[i], seen);
369
369
  return equal;
370
370
  }
371
- function looseEqual(a, b) {
371
+ function looseCompareCollections(a, b, seen) {
372
+ if (a.size !== b.size) return false;
373
+ const candidates = Array.from(b);
374
+ const matched = new Uint8Array(candidates.length);
375
+ for (const item of a) {
376
+ let index = -1;
377
+ for (let i = 0; i < candidates.length; i++) if (!matched[i] && looseEqual(item, candidates[i], seen)) {
378
+ index = i;
379
+ break;
380
+ }
381
+ if (index < 0) return false;
382
+ matched[index] = 1;
383
+ }
384
+ return true;
385
+ }
386
+ function looseCompareObjects(a, b, seen) {
387
+ let aValidType = isMap(a);
388
+ let bValidType = isMap(b);
389
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
390
+ aValidType = isSet(a);
391
+ bValidType = isSet(b);
392
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false;
393
+ if (Object.keys(a).length !== Object.keys(b).length) return false;
394
+ for (const key in a) {
395
+ const aHasKey = a.hasOwnProperty(key);
396
+ const bHasKey = b.hasOwnProperty(key);
397
+ if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) return false;
398
+ }
399
+ return String(a) === String(b);
400
+ }
401
+ function looseCompareNested(a, b, seen, compare) {
402
+ if (!seen) seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
403
+ const [seenA, seenB] = seen;
404
+ if (seenA.has(a) || seenB.has(b)) return seenA.get(a) === b && seenB.get(b) === a;
405
+ seenA.set(a, b);
406
+ seenB.set(b, a);
407
+ const equal = compare(a, b, seen);
408
+ seenA.delete(a);
409
+ seenB.delete(b);
410
+ return equal;
411
+ }
412
+ function looseEqual(a, b, seen) {
372
413
  if (a === b) return true;
373
414
  let aValidType = isDate(a);
374
415
  let bValidType = isDate(b);
@@ -378,17 +419,12 @@ function looseEqual(a, b) {
378
419
  if (aValidType || bValidType) return a === b;
379
420
  aValidType = isArray(a);
380
421
  bValidType = isArray(b);
381
- if (aValidType || bValidType) return aValidType && bValidType ? looseCompareArrays(a, b) : false;
422
+ if (aValidType || bValidType) return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false;
382
423
  aValidType = isObject(a);
383
424
  bValidType = isObject(b);
384
425
  if (aValidType || bValidType) {
385
426
  if (!aValidType || !bValidType) return false;
386
- if (Object.keys(a).length !== Object.keys(b).length) return false;
387
- for (const key in a) {
388
- const aHasKey = a.hasOwnProperty(key);
389
- const bHasKey = b.hasOwnProperty(key);
390
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) return false;
391
- }
427
+ return looseCompareNested(a, b, seen, looseCompareObjects);
392
428
  }
393
429
  return String(a) === String(b);
394
430
  }
@@ -518,9 +554,18 @@ function setupFlagsHandler(target) {
518
554
  function warn$2(msg, ...args) {
519
555
  console.warn(`[Vue warn] ${msg}`, ...args);
520
556
  }
557
+ //#endregion
558
+ //#region packages/reactivity/src/system.ts
521
559
  const notifyBuffer = [];
522
560
  let batchDepth = 0;
523
561
  let activeSub = void 0;
562
+ let runDepth = 0;
563
+ function incRunDepth() {
564
+ ++runDepth;
565
+ }
566
+ function decRunDepth() {
567
+ --runDepth;
568
+ }
524
569
  let globalVersion = 0;
525
570
  let notifyIndex = 0;
526
571
  let notifyBufferLength = 0;
@@ -594,8 +639,10 @@ function propagate(link) {
594
639
  const sub = link.sub;
595
640
  let flags = sub.flags;
596
641
  if (flags & 3) {
597
- if (!(flags & 60)) sub.flags = flags | 32;
598
- else if (!(flags & 12)) flags = 0;
642
+ if (!(flags & 60)) {
643
+ sub.flags = flags | 32;
644
+ if (runDepth) sub.flags |= 8;
645
+ } else if (!(flags & 12)) flags = 0;
599
646
  else if (!(flags & 4)) sub.flags = flags & -9 | 32;
600
647
  else if (!(flags & 48) && isValidLink(link, sub)) {
601
648
  sub.flags = flags | 40;
@@ -647,13 +694,23 @@ function endTracking(sub, prevSub) {
647
694
  sub.flags &= -5;
648
695
  }
649
696
  function flush() {
697
+ let hasError = false;
698
+ let error;
650
699
  while (notifyIndex < notifyBufferLength) {
651
700
  const effect = notifyBuffer[notifyIndex];
652
701
  notifyBuffer[notifyIndex++] = void 0;
653
- effect.notify();
702
+ try {
703
+ effect.notify();
704
+ } catch (err) {
705
+ if (!hasError) {
706
+ hasError = true;
707
+ error = err;
708
+ }
709
+ }
654
710
  }
655
711
  notifyIndex = 0;
656
712
  notifyBufferLength = 0;
713
+ if (hasError) throw error;
657
714
  }
658
715
  function checkDirty(link, sub) {
659
716
  let stack;
@@ -664,13 +721,13 @@ function checkDirty(link, sub) {
664
721
  let dirty = false;
665
722
  if (sub.flags & 16) dirty = true;
666
723
  else if ((depFlags & 17) === 17) {
724
+ const subs = dep.subs;
667
725
  if (dep.update()) {
668
- const subs = dep.subs;
669
726
  if (subs.nextSub !== void 0) shallowPropagate(subs);
670
727
  dirty = true;
671
728
  }
672
729
  } else if ((depFlags & 33) === 33) {
673
- if (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {
730
+ stack = {
674
731
  value: link,
675
732
  prev: stack
676
733
  };
@@ -685,15 +742,12 @@ function checkDirty(link, sub) {
685
742
  }
686
743
  while (checkDepth) {
687
744
  --checkDepth;
688
- const firstSub = sub.subs;
689
- const hasMultipleSubs = firstSub.nextSub !== void 0;
690
- if (hasMultipleSubs) {
691
- link = stack.value;
692
- stack = stack.prev;
693
- } else link = firstSub;
745
+ link = stack.value;
746
+ stack = stack.prev;
694
747
  if (dirty) {
748
+ const subs = sub.subs;
695
749
  if (sub.update()) {
696
- if (hasMultipleSubs) shallowPropagate(firstSub);
750
+ if (subs.nextSub !== void 0) shallowPropagate(subs);
697
751
  sub = link.sub;
698
752
  continue;
699
753
  }
@@ -705,7 +759,7 @@ function checkDirty(link, sub) {
705
759
  }
706
760
  dirty = false;
707
761
  }
708
- return dirty;
762
+ return dirty && !!sub.flags;
709
763
  } while (true);
710
764
  }
711
765
  function shallowPropagate(link) {
@@ -740,7 +794,7 @@ var Dep = class {
740
794
  }
741
795
  set subs(value) {
742
796
  this._subs = value;
743
- if (value === void 0) this.map.delete(this.key);
797
+ if (value === void 0 && this.map) this.map.delete(this.key);
744
798
  }
745
799
  };
746
800
  const targetMap = /* @__PURE__ */ new WeakMap();
@@ -823,9 +877,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
823
877
  if (isMap(target)) run(depsMap.get(MAP_KEY_ITERATE_KEY));
824
878
  }
825
879
  break;
826
- case "set":
827
- if (isMap(target)) run(depsMap.get(ITERATE_KEY));
828
- break;
880
+ case "set": if (isMap(target)) run(depsMap.get(ITERATE_KEY));
829
881
  }
830
882
  }
831
883
  }
@@ -840,13 +892,17 @@ function getDepFromReactive(object, key) {
840
892
  /**
841
893
  * Track array iteration and return:
842
894
  * - if input is reactive: a cloned raw array with reactive values
843
- * - if input is non-reactive or shallowReactive: the original raw array
895
+ * - if input is readonly: a cloned raw array with readonly values, preserving
896
+ * reactivity
897
+ * - if input is raw or shallow: the original raw array
844
898
  */
845
899
  function reactiveReadArray(array) {
846
900
  const raw = /* @__PURE__ */ toRaw(array);
847
901
  if (raw === array) return raw;
848
902
  track(raw, "iterate", ARRAY_ITERATE_KEY);
849
- return /* @__PURE__ */ isShallow(array) ? raw : raw.map(toReactive);
903
+ if (/* @__PURE__ */ isShallow(array)) return raw;
904
+ if (!/* @__PURE__ */ isReadonly(array)) return raw.map(toReactive);
905
+ return /* @__PURE__ */ isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
850
906
  }
851
907
  /**
852
908
  * Track array iteration and return raw array
@@ -1022,8 +1078,8 @@ function noTracking(self, method, args = []) {
1022
1078
  }
1023
1079
  //#endregion
1024
1080
  //#region packages/reactivity/src/baseHandlers.ts
1025
- const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
1026
- const builtInSymbols = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
1081
+ const isNonTrackableKeys = /*@__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
1082
+ const builtInSymbols = new Set(/*@__PURE__*/ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
1027
1083
  function hasOwnProperty(key) {
1028
1084
  if (!isSymbol(key)) key = String(key);
1029
1085
  const obj = /* @__PURE__ */ toRaw(this);
@@ -1078,17 +1134,19 @@ var MutableReactiveHandler = class extends BaseReactiveHandler {
1078
1134
  oldValue = /* @__PURE__ */ toRaw(oldValue);
1079
1135
  value = /* @__PURE__ */ toRaw(value);
1080
1136
  }
1081
- if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) if (isOldValueReadonly) {
1082
- warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
1083
- return true;
1084
- } else {
1085
- oldValue.value = value;
1086
- return true;
1137
+ if (!isArrayWithIntegerKey && /* @__PURE__ */ isRef(oldValue) && !/* @__PURE__ */ isRef(value)) {
1138
+ if (isOldValueReadonly) {
1139
+ warn$2(`Set operation on key "${String(key)}" failed: target is readonly.`, target[key]);
1140
+ return true;
1141
+ } else {
1142
+ oldValue.value = value;
1143
+ return true;
1144
+ }
1087
1145
  }
1088
1146
  }
1089
1147
  const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
1090
1148
  const result = Reflect.set(target, key, value, /* @__PURE__ */ isRef(target) ? target : receiver);
1091
- if (target === /* @__PURE__ */ toRaw(receiver)) {
1149
+ if (target === /* @__PURE__ */ toRaw(receiver) && result) {
1092
1150
  if (!hadKey) trigger(target, "add", key, value);
1093
1151
  else if (hasChanged(value, oldValue)) trigger(target, "set", key, value, oldValue);
1094
1152
  }
@@ -1124,10 +1182,10 @@ var ReadonlyReactiveHandler = class extends BaseReactiveHandler {
1124
1182
  return true;
1125
1183
  }
1126
1184
  };
1127
- const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
1128
- const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
1129
- const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
1130
- const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
1185
+ const mutableHandlers = /*@__PURE__*/ new MutableReactiveHandler();
1186
+ const readonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler();
1187
+ const shallowReactiveHandlers = /*@__PURE__*/ new MutableReactiveHandler(true);
1188
+ const shallowReadonlyHandlers = /*@__PURE__*/ new ReadonlyReactiveHandler(true);
1131
1189
  //#endregion
1132
1190
  //#region packages/reactivity/src/collectionHandlers.ts
1133
1191
  const toShallow = (value) => value;
@@ -1278,10 +1336,10 @@ function createInstrumentationGetter(isReadonly, shallow) {
1278
1336
  return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);
1279
1337
  };
1280
1338
  }
1281
- const mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) };
1282
- const shallowCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, true) };
1283
- const readonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, false) };
1284
- const shallowReadonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, true) };
1339
+ const mutableCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, false) };
1340
+ const shallowCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(false, true) };
1341
+ const readonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, false) };
1342
+ const shallowReadonlyCollectionHandlers = { get: /*@__PURE__*/ createInstrumentationGetter(true, true) };
1285
1343
  function checkIdentityKeys(target, has, key) {
1286
1344
  const rawKey = /* @__PURE__ */ toRaw(key);
1287
1345
  if (rawKey !== key && has.call(target, rawKey)) {
@@ -1306,10 +1364,7 @@ function targetTypeMap(rawType) {
1306
1364
  default: return 0;
1307
1365
  }
1308
1366
  }
1309
- function getTargetType(value) {
1310
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
1311
- }
1312
- /* @__NO_SIDE_EFFECTS__ */
1367
+ /*@__NO_SIDE_EFFECTS__*/
1313
1368
  function reactive(target) {
1314
1369
  if (/* @__PURE__ */ isReadonly(target)) return target;
1315
1370
  return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);
@@ -1344,7 +1399,7 @@ function reactive(target) {
1344
1399
  * @param target - The source object.
1345
1400
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreactive}
1346
1401
  */
1347
- /* @__NO_SIDE_EFFECTS__ */
1402
+ /*@__NO_SIDE_EFFECTS__*/
1348
1403
  function shallowReactive(target) {
1349
1404
  return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);
1350
1405
  }
@@ -1377,7 +1432,7 @@ function shallowReactive(target) {
1377
1432
  * @param target - The source object.
1378
1433
  * @see {@link https://vuejs.org/api/reactivity-core.html#readonly}
1379
1434
  */
1380
- /* @__NO_SIDE_EFFECTS__ */
1435
+ /*@__NO_SIDE_EFFECTS__*/
1381
1436
  function readonly(target) {
1382
1437
  return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);
1383
1438
  }
@@ -1411,7 +1466,7 @@ function readonly(target) {
1411
1466
  * @param target - The source object.
1412
1467
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#shallowreadonly}
1413
1468
  */
1414
- /* @__NO_SIDE_EFFECTS__ */
1469
+ /*@__NO_SIDE_EFFECTS__*/
1415
1470
  function shallowReadonly(target) {
1416
1471
  return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);
1417
1472
  }
@@ -1421,10 +1476,11 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1421
1476
  return target;
1422
1477
  }
1423
1478
  if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target;
1424
- const targetType = getTargetType(target);
1425
- if (targetType === 0) return target;
1479
+ if (target["__v_skip"] || !Object.isExtensible(target)) return target;
1426
1480
  const existingProxy = proxyMap.get(target);
1427
1481
  if (existingProxy) return existingProxy;
1482
+ const targetType = targetTypeMap(toRawType(target));
1483
+ if (targetType === 0) return target;
1428
1484
  const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);
1429
1485
  proxyMap.set(target, proxy);
1430
1486
  return proxy;
@@ -1447,7 +1503,7 @@ function createReactiveObject(target, isReadonly, baseHandlers, collectionHandle
1447
1503
  * @param value - The value to check.
1448
1504
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isreactive}
1449
1505
  */
1450
- /* @__NO_SIDE_EFFECTS__ */
1506
+ /*@__NO_SIDE_EFFECTS__*/
1451
1507
  function isReactive(value) {
1452
1508
  if (/* @__PURE__ */ isReadonly(value)) return /* @__PURE__ */ isReactive(value["__v_raw"]);
1453
1509
  return !!(value && value["__v_isReactive"]);
@@ -1463,11 +1519,11 @@ function isReactive(value) {
1463
1519
  * @param value - The value to check.
1464
1520
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isreadonly}
1465
1521
  */
1466
- /* @__NO_SIDE_EFFECTS__ */
1522
+ /*@__NO_SIDE_EFFECTS__*/
1467
1523
  function isReadonly(value) {
1468
1524
  return !!(value && value["__v_isReadonly"]);
1469
1525
  }
1470
- /* @__NO_SIDE_EFFECTS__ */
1526
+ /*@__NO_SIDE_EFFECTS__*/
1471
1527
  function isShallow(value) {
1472
1528
  return !!(value && value["__v_isShallow"]);
1473
1529
  }
@@ -1478,7 +1534,7 @@ function isShallow(value) {
1478
1534
  * @param value - The value to check.
1479
1535
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#isproxy}
1480
1536
  */
1481
- /* @__NO_SIDE_EFFECTS__ */
1537
+ /*@__NO_SIDE_EFFECTS__*/
1482
1538
  function isProxy(value) {
1483
1539
  return value ? !!value["__v_raw"] : false;
1484
1540
  }
@@ -1505,7 +1561,7 @@ function isProxy(value) {
1505
1561
  * @param observed - The object for which the "raw" value is requested.
1506
1562
  * @see {@link https://vuejs.org/api/reactivity-advanced.html#toraw}
1507
1563
  */
1508
- /* @__NO_SIDE_EFFECTS__ */
1564
+ /*@__NO_SIDE_EFFECTS__*/
1509
1565
  function toRaw(observed) {
1510
1566
  const raw = observed && observed["__v_raw"];
1511
1567
  return raw ? /* @__PURE__ */ toRaw(raw) : observed;
@@ -1554,15 +1610,15 @@ const toReactive = (value) => isObject(value) ? /* @__PURE__ */ reactive(value)
1554
1610
  const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value) : value;
1555
1611
  //#endregion
1556
1612
  //#region packages/reactivity/src/ref.ts
1557
- /* @__NO_SIDE_EFFECTS__ */
1613
+ /*@__NO_SIDE_EFFECTS__*/
1558
1614
  function isRef(r) {
1559
1615
  return r ? r["__v_isRef"] === true : false;
1560
1616
  }
1561
- /* @__NO_SIDE_EFFECTS__ */
1617
+ /*@__NO_SIDE_EFFECTS__*/
1562
1618
  function ref(value) {
1563
1619
  return createRef(value, toReactive);
1564
1620
  }
1565
- /* @__NO_SIDE_EFFECTS__ */
1621
+ /*@__NO_SIDE_EFFECTS__*/
1566
1622
  function shallowRef(value) {
1567
1623
  return createRef(value);
1568
1624
  }
@@ -1765,7 +1821,7 @@ function customRef(factory) {
1765
1821
  * @param object - Reactive object to be made into an object of linked refs.
1766
1822
  * @see {@link https://vuejs.org/api/reactivity-utilities.html#torefs}
1767
1823
  */
1768
- /* @__NO_SIDE_EFFECTS__ */
1824
+ /*@__NO_SIDE_EFFECTS__*/
1769
1825
  function toRefs(object) {
1770
1826
  const ret = isArray(object) ? new Array(object.length) : {};
1771
1827
  for (const key in object) ret[key] = propertyToRef(object, key);
@@ -1816,7 +1872,7 @@ var GetterRefImpl = class {
1816
1872
  return this._value = this._getter();
1817
1873
  }
1818
1874
  };
1819
- /* @__NO_SIDE_EFFECTS__ */
1875
+ /*@__NO_SIDE_EFFECTS__*/
1820
1876
  function toRef(source, key, defaultValue) {
1821
1877
  if (/* @__PURE__ */ isRef(source)) return source;
1822
1878
  else if (isFunction(source)) return new GetterRefImpl(source);
@@ -1857,9 +1913,11 @@ var ReactiveEffect = class {
1857
1913
  if (!this.active) return this.fn();
1858
1914
  cleanup(this);
1859
1915
  const prevSub = startTracking(this);
1916
+ incRunDepth();
1860
1917
  try {
1861
1918
  return this.fn();
1862
1919
  } finally {
1920
+ decRunDepth();
1863
1921
  endTracking(this, prevSub);
1864
1922
  const flags = this.flags;
1865
1923
  if ((flags & 136) === 136) {
@@ -1880,10 +1938,12 @@ var ReactiveEffect = class {
1880
1938
  get dirty() {
1881
1939
  const flags = this.flags;
1882
1940
  if (flags & 16) return true;
1883
- if (flags & 32) if (checkDirty(this.deps, this)) {
1884
- this.flags = flags | 16;
1885
- return true;
1886
- } else this.flags = flags & -33;
1941
+ if (flags & 32) {
1942
+ if (checkDirty(this.deps, this)) {
1943
+ this.flags = flags | 16;
1944
+ return true;
1945
+ } else this.flags = flags & -33;
1946
+ }
1887
1947
  return false;
1888
1948
  }
1889
1949
  };
@@ -2062,10 +2122,12 @@ var ComputedRefImpl = class {
2062
2122
  get _dirty() {
2063
2123
  const flags = this.flags;
2064
2124
  if (flags & 16) return true;
2065
- if (flags & 32) if (checkDirty(this.deps, this)) {
2066
- this.flags = flags | 16;
2067
- return true;
2068
- } else this.flags = flags & -33;
2125
+ if (flags & 32) {
2126
+ if (checkDirty(this.deps, this)) {
2127
+ this.flags = flags | 16;
2128
+ return true;
2129
+ } else this.flags = flags & -33;
2130
+ }
2069
2131
  return false;
2070
2132
  }
2071
2133
  /**
@@ -2126,7 +2188,7 @@ var ComputedRefImpl = class {
2126
2188
  }
2127
2189
  };
2128
2190
  setupOnTrigger(ComputedRefImpl);
2129
- /* @__NO_SIDE_EFFECTS__ */
2191
+ /*@__NO_SIDE_EFFECTS__*/
2130
2192
  function computed$1(getterOrOptions, debugOptions, isSSR = false) {
2131
2193
  let getter;
2132
2194
  let setter;
@@ -2204,25 +2266,26 @@ var WatcherEffect = class extends ReactiveEffect {
2204
2266
  else if (isFunction(s)) return call ? call(s, 2) : s();
2205
2267
  else warnInvalidSource(s, onWarn);
2206
2268
  });
2207
- } else if (isFunction(source)) if (cb) getter = call ? () => call(source, 2) : source;
2208
- else getter = () => {
2209
- if (this.cleanupsLength) {
2210
- const prevSub = setActiveSub();
2269
+ } else if (isFunction(source)) {
2270
+ if (cb) getter = call ? () => call(source, 2) : source;
2271
+ else getter = () => {
2272
+ if (this.cleanupsLength) {
2273
+ const prevSub = setActiveSub();
2274
+ try {
2275
+ cleanup(this);
2276
+ } finally {
2277
+ setActiveSub(prevSub);
2278
+ }
2279
+ }
2280
+ const currentEffect = activeWatcher;
2281
+ activeWatcher = this;
2211
2282
  try {
2212
- cleanup(this);
2283
+ return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
2213
2284
  } finally {
2214
- setActiveSub(prevSub);
2285
+ activeWatcher = currentEffect;
2215
2286
  }
2216
- }
2217
- const currentEffect = activeWatcher;
2218
- activeWatcher = this;
2219
- try {
2220
- return call ? call(source, 3, [this.boundCleanup]) : source(this.boundCleanup);
2221
- } finally {
2222
- activeWatcher = currentEffect;
2223
- }
2224
- };
2225
- else {
2287
+ };
2288
+ } else {
2226
2289
  getter = NOOP;
2227
2290
  warnInvalidSource(source, onWarn);
2228
2291
  }
@@ -2240,8 +2303,9 @@ var WatcherEffect = class extends ReactiveEffect {
2240
2303
  if (once && cb) {
2241
2304
  const _cb = cb;
2242
2305
  cb = (...args) => {
2243
- _cb(...args);
2306
+ const res = _cb(...args);
2244
2307
  this.stop();
2308
+ return res;
2245
2309
  };
2246
2310
  }
2247
2311
  this.cb = cb;
@@ -2255,7 +2319,7 @@ var WatcherEffect = class extends ReactiveEffect {
2255
2319
  if (!this.cb) return;
2256
2320
  const { immediate, deep, call } = this.options;
2257
2321
  if (initialRun && !immediate) return;
2258
- if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2322
+ if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2259
2323
  cleanup(this);
2260
2324
  const currentWatcher = activeWatcher;
2261
2325
  activeWatcher = this;
@@ -2545,7 +2609,7 @@ let currentFlushPromise = null;
2545
2609
  let jobsLength = 0;
2546
2610
  let flushIndex = 0;
2547
2611
  let postFlushIndex = 0;
2548
- const resolvedPromise = /* @__PURE__ */ Promise.resolve();
2612
+ const resolvedPromise = /*@__PURE__*/ Promise.resolve();
2549
2613
  const RECURSION_LIMIT = 100;
2550
2614
  function nextTick(fn) {
2551
2615
  const p = currentFlushPromise || resolvedPromise;
@@ -2562,8 +2626,8 @@ function findInsertionIndex(order, queue, start, end) {
2562
2626
  /**
2563
2627
  * @internal for runtime-vapor only
2564
2628
  */
2565
- function queueJob(job, id, isPre = false) {
2566
- if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1, jobs, jobsLength, flushIndex)) {
2629
+ function queueJob(job, id, isPre = false, order = 0) {
2630
+ if (queueJobWorker(job, id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : order ? id * 2 + 1 + order / (order + 1) : id * 2 + 1, jobs, jobsLength, flushIndex)) {
2567
2631
  jobsLength++;
2568
2632
  queueFlush();
2569
2633
  }
@@ -2584,6 +2648,7 @@ const doFlushJobs = () => {
2584
2648
  flushJobs();
2585
2649
  } catch (e) {
2586
2650
  currentFlushPromise = null;
2651
+ if (jobsLength || postJobs.length) queueFlush();
2587
2652
  throw e;
2588
2653
  }
2589
2654
  };
@@ -2591,9 +2656,10 @@ function queueFlush() {
2591
2656
  if (!currentFlushPromise) currentFlushPromise = resolvedPromise.then(doFlushJobs);
2592
2657
  }
2593
2658
  function queuePostFlushCb(jobs, id = Infinity) {
2594
- if (!isArray(jobs)) if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
2595
- else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
2596
- else for (const job of jobs) queueJobWorker(job, id, postJobs, postJobs.length, 0);
2659
+ if (!isArray(jobs)) {
2660
+ if (activePostJobs && id === -1) activePostJobs.splice(postFlushIndex, 0, jobs);
2661
+ else queueJobWorker(jobs, id, postJobs, postJobs.length, 0);
2662
+ } else for (let i = 0; i < jobs.length; i++) queueJobWorker(jobs[i], id, postJobs, postJobs.length, 0);
2597
2663
  queueFlush();
2598
2664
  }
2599
2665
  function flushPreFlushCbs(instance, seen) {
@@ -2607,32 +2673,39 @@ function flushPreFlushCbs(instance, seen) {
2607
2673
  i--;
2608
2674
  jobsLength--;
2609
2675
  if (cb.flags & 2) cb.flags &= -2;
2610
- cb();
2611
- if (!(cb.flags & 2)) cb.flags &= -2;
2676
+ try {
2677
+ cb();
2678
+ } finally {
2679
+ if (!(cb.flags & 2)) cb.flags &= -2;
2680
+ }
2612
2681
  }
2613
2682
  }
2614
2683
  function flushPostFlushCbs(seen) {
2615
2684
  if (postJobs.length) {
2616
2685
  if (activePostJobs) {
2617
- activePostJobs.push(...postJobs);
2686
+ for (let i = 0; i < postJobs.length; i++) activePostJobs.push(postJobs[i]);
2618
2687
  postJobs.length = 0;
2619
2688
  return;
2620
2689
  }
2621
2690
  activePostJobs = postJobs;
2622
2691
  postJobs = [];
2623
2692
  seen = seen || /* @__PURE__ */ new Map();
2624
- while (postFlushIndex < activePostJobs.length) {
2625
- const cb = activePostJobs[postFlushIndex++];
2626
- if (checkRecursiveUpdates(seen, cb)) continue;
2627
- if (cb.flags & 2) cb.flags &= -2;
2628
- if (!(cb.flags & 4)) try {
2629
- cb();
2630
- } finally {
2631
- cb.flags &= -2;
2693
+ try {
2694
+ while (postFlushIndex < activePostJobs.length) {
2695
+ const cb = activePostJobs[postFlushIndex++];
2696
+ if (checkRecursiveUpdates(seen, cb)) continue;
2697
+ if (cb.flags & 2) cb.flags &= -2;
2698
+ if (!(cb.flags & 4)) try {
2699
+ cb();
2700
+ } finally {
2701
+ if (!(cb.flags & 2)) cb.flags &= -2;
2702
+ }
2632
2703
  }
2704
+ } finally {
2705
+ while (postFlushIndex < activePostJobs.length) activePostJobs[postFlushIndex++].flags &= -2;
2706
+ activePostJobs = null;
2707
+ postFlushIndex = 0;
2633
2708
  }
2634
- activePostJobs = null;
2635
- postFlushIndex = 0;
2636
2709
  }
2637
2710
  }
2638
2711
  let isFlushing = false;
@@ -2642,9 +2715,12 @@ let isFlushing = false;
2642
2715
  function flushOnAppMount(instance) {
2643
2716
  if (!isFlushing) {
2644
2717
  isFlushing = true;
2645
- flushPreFlushCbs(instance);
2646
- flushPostFlushCbs();
2647
- isFlushing = false;
2718
+ try {
2719
+ flushPreFlushCbs(instance);
2720
+ flushPostFlushCbs();
2721
+ } finally {
2722
+ isFlushing = false;
2723
+ }
2648
2724
  }
2649
2725
  }
2650
2726
  function flushJobs(seen) {
@@ -2672,9 +2748,10 @@ function flushJobs(seen) {
2672
2748
  }
2673
2749
  flushIndex = 0;
2674
2750
  jobsLength = 0;
2751
+ jobs.length = 0;
2675
2752
  flushPostFlushCbs(seen);
2676
- currentFlushPromise = null;
2677
2753
  if (jobsLength || postJobs.length) flushJobs(seen);
2754
+ else currentFlushPromise = null;
2678
2755
  }
2679
2756
  }
2680
2757
  function checkRecursiveUpdates(seen, fn) {
@@ -2705,6 +2782,19 @@ getGlobalThis().__VUE_HMR_RUNTIME__ = {
2705
2782
  rerender: tryWrap(rerender),
2706
2783
  reload: tryWrap(reload)
2707
2784
  };
2785
+ function runWithHmrUpdating(fn) {
2786
+ isHmrUpdating = true;
2787
+ let done = false;
2788
+ try {
2789
+ fn();
2790
+ done = true;
2791
+ } finally {
2792
+ if (done) nextTick(() => {
2793
+ isHmrUpdating = false;
2794
+ });
2795
+ else isHmrUpdating = false;
2796
+ }
2797
+ }
2708
2798
  const map = /* @__PURE__ */ new Map();
2709
2799
  function registerHMR(instance) {
2710
2800
  const id = instance.type.__hmrId;
@@ -2729,6 +2819,14 @@ function createRecord(id, initialDef) {
2729
2819
  function normalizeClassComponent(component) {
2730
2820
  return isClassComponent(component) ? component.__vccOpts : component;
2731
2821
  }
2822
+ function hasDirtyAncestor(instance, dirtyInstances) {
2823
+ let parent = instance.parent;
2824
+ while (parent) {
2825
+ if (dirtyInstances.has(parent)) return true;
2826
+ parent = parent.parent;
2827
+ }
2828
+ return false;
2829
+ }
2732
2830
  function rerender(id, newRender) {
2733
2831
  const record = map.get(id);
2734
2832
  if (!record) return;
@@ -2738,18 +2836,16 @@ function rerender(id, newRender) {
2738
2836
  instance.render = newRender;
2739
2837
  normalizeClassComponent(instance.type).render = newRender;
2740
2838
  }
2741
- isHmrUpdating = true;
2742
- if (instance.vapor) {
2743
- if (!instance.isUnmounted) instance.hmrRerender();
2744
- } else {
2745
- const i = instance;
2746
- if (!(i.effect.flags & 1024)) {
2747
- i.renderCache = [];
2748
- i.effect.run();
2839
+ runWithHmrUpdating(() => {
2840
+ if (instance.vapor) {
2841
+ if (!instance.isUnmounted) instance.hmrRerender();
2842
+ } else {
2843
+ const i = instance;
2844
+ if (!(i.effect.flags & 1024)) {
2845
+ i.renderCache = [];
2846
+ i.effect.run();
2847
+ }
2749
2848
  }
2750
- }
2751
- nextTick(() => {
2752
- isHmrUpdating = false;
2753
2849
  });
2754
2850
  });
2755
2851
  }
@@ -2760,42 +2856,61 @@ function reload(id, newComp) {
2760
2856
  const isVapor = record.initialDef.__vapor;
2761
2857
  updateComponentDef(record.initialDef, newComp);
2762
2858
  const instances = [...record.instances];
2763
- if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
2859
+ if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2764
2860
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2765
- for (const instance of instances) instance.hmrReload(newComp);
2766
- } else for (const instance of instances) {
2767
- const oldComp = normalizeClassComponent(instance.type);
2768
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
2769
- if (!dirtyInstances) {
2770
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2771
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2772
- }
2773
- dirtyInstances.add(instance);
2774
- hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2775
- instance.appContext.propsCache.delete(instance.type);
2776
- instance.appContext.emitsCache.delete(instance.type);
2777
- instance.appContext.optionsCache.delete(instance.type);
2778
- if (instance.ceReload) {
2779
- dirtyInstances.add(instance);
2780
- instance.ceReload(newComp.styles);
2781
- dirtyInstances.delete(instance);
2782
- } else if (instance.parent) queueJob(() => {
2783
- isHmrUpdating = true;
2784
- const parent = instance.parent;
2785
- if (parent.vapor) parent.hmrRerender();
2786
- else if (!(parent.effect.flags & 1024)) {
2787
- parent.renderCache = [];
2788
- parent.effect.run();
2861
+ const dirtyInstances = new Set(instances);
2862
+ const rerenderedParents = /* @__PURE__ */ new Set();
2863
+ runWithHmrUpdating(() => {
2864
+ for (const instance of instances) {
2865
+ const parent = instance.parent;
2866
+ if (parent) {
2867
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2868
+ rerenderedParents.add(parent);
2869
+ parent.hmrRerender();
2870
+ }
2871
+ } else instance.hmrReload(newComp);
2789
2872
  }
2790
- nextTick(() => {
2791
- isHmrUpdating = false;
2873
+ });
2874
+ } else {
2875
+ const parents = /* @__PURE__ */ new Set();
2876
+ const dirtyInstanceSet = new Set(instances);
2877
+ for (const instance of instances) {
2878
+ const oldComp = normalizeClassComponent(instance.type);
2879
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
2880
+ if (!dirtyInstances) {
2881
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2882
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2883
+ }
2884
+ dirtyInstances.add(instance);
2885
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2886
+ instance.appContext.propsCache.delete(instance.type);
2887
+ instance.appContext.emitsCache.delete(instance.type);
2888
+ instance.appContext.optionsCache.delete(instance.type);
2889
+ if (instance.ceReload) {
2890
+ dirtyInstances.add(instance);
2891
+ instance.ceReload(newComp.styles);
2892
+ dirtyInstances.delete(instance);
2893
+ } else if (instance.parent) {
2894
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) parents.add(instance.parent);
2895
+ } else if (instance.appContext.reload) instance.appContext.reload();
2896
+ else if (typeof window !== "undefined") window.location.reload();
2897
+ else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2898
+ if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2899
+ }
2900
+ parents.forEach((parent) => {
2901
+ queueJob(() => {
2902
+ runWithHmrUpdating(() => {
2903
+ if (parent.vapor) parent.hmrRerender();
2904
+ else {
2905
+ const i = parent;
2906
+ if (!(i.effect.flags & 1024)) {
2907
+ i.renderCache = [];
2908
+ i.effect.run();
2909
+ }
2910
+ }
2911
+ });
2792
2912
  });
2793
- dirtyInstances.delete(instance);
2794
2913
  });
2795
- else if (instance.appContext.reload) instance.appContext.reload();
2796
- else if (typeof window !== "undefined") window.location.reload();
2797
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2798
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2799
2914
  }
2800
2915
  queuePostFlushCb(() => {
2801
2916
  hmrDirtyComponents.clear();
@@ -2862,20 +2977,20 @@ function devtoolsInitApp(app, version) {
2862
2977
  function devtoolsUnmountApp(app) {
2863
2978
  emit$2("app:unmount", app);
2864
2979
  }
2865
- const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added");
2866
- const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated");
2867
- const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook("component:removed");
2980
+ const devtoolsComponentAdded = /*@__PURE__*/ createDevtoolsComponentHook("component:added");
2981
+ const devtoolsComponentUpdated = /*@__PURE__*/ createDevtoolsComponentHook("component:updated");
2982
+ const _devtoolsComponentRemoved = /*@__PURE__*/ createDevtoolsComponentHook("component:removed");
2868
2983
  const devtoolsComponentRemoved = (component) => {
2869
2984
  if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && !devtools$1.cleanupBuffer(component)) _devtoolsComponentRemoved(component);
2870
2985
  };
2871
- /* @__NO_SIDE_EFFECTS__ */
2986
+ /*@__NO_SIDE_EFFECTS__*/
2872
2987
  function createDevtoolsComponentHook(hook) {
2873
2988
  return (component) => {
2874
2989
  emit$2(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component);
2875
2990
  };
2876
2991
  }
2877
- const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start");
2878
- const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end");
2992
+ const devtoolsPerfStart = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:start");
2993
+ const devtoolsPerfEnd = /*@__PURE__*/ createDevtoolsPerformanceHook("perf:end");
2879
2994
  function createDevtoolsPerformanceHook(hook) {
2880
2995
  return (component, type, time) => {
2881
2996
  emit$2(hook, component.appContext.app, component.uid, component, type, time);
@@ -3104,7 +3219,7 @@ function configureCompat$1(config) {
3104
3219
  validateCompatConfig(config);
3105
3220
  extend(globalCompatConfig, config);
3106
3221
  }
3107
- const seenConfigObjects = /* @__PURE__ */ new WeakSet();
3222
+ const seenConfigObjects = /*@__PURE__*/ new WeakSet();
3108
3223
  const warnedInvalidKeys = {};
3109
3224
  function validateCompatConfig(config, instance) {
3110
3225
  if (seenConfigObjects.has(config)) return;
@@ -3156,7 +3271,7 @@ function checkCompatEnabled$1(key, instance, ...args) {
3156
3271
  }
3157
3272
  //#endregion
3158
3273
  //#region packages/runtime-core/src/compat/instanceEventEmitter.ts
3159
- const eventRegistryMap = /* @__PURE__ */ new WeakMap();
3274
+ const eventRegistryMap = /*@__PURE__*/ new WeakMap();
3160
3275
  function getRegistry(instance) {
3161
3276
  let events = eventRegistryMap.get(instance);
3162
3277
  if (!events) eventRegistryMap.set(instance, events = Object.create(null));
@@ -3262,10 +3377,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
3262
3377
  const renderFnWithContext = (...args) => {
3263
3378
  if (renderFnWithContext._d) setBlockTracking(-1);
3264
3379
  const prevInstance = setCurrentRenderingInstance(ctx);
3380
+ const prevStackSize = blockStack.length;
3265
3381
  let res;
3266
3382
  try {
3267
3383
  res = fn(...args);
3268
3384
  } finally {
3385
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
3269
3386
  setCurrentRenderingInstance(prevInstance);
3270
3387
  if (renderFnWithContext._d) setBlockTracking(1);
3271
3388
  }
@@ -3288,19 +3405,21 @@ const legacyDirectiveHookMap = {
3288
3405
  };
3289
3406
  function mapCompatDirectiveHook(name, dir, instance) {
3290
3407
  const mappedName = legacyDirectiveHookMap[name];
3291
- if (mappedName) if (isArray(mappedName)) {
3292
- const hook = [];
3293
- mappedName.forEach((mapped) => {
3294
- const mappedHook = dir[mapped];
3295
- if (mappedHook) {
3296
- softAssertCompatEnabled("CUSTOM_DIR", instance, mapped, name);
3297
- hook.push(mappedHook);
3298
- }
3299
- });
3300
- return hook.length ? hook : void 0;
3301
- } else {
3302
- if (dir[mappedName]) softAssertCompatEnabled("CUSTOM_DIR", instance, mappedName, name);
3303
- return dir[mappedName];
3408
+ if (mappedName) {
3409
+ if (isArray(mappedName)) {
3410
+ const hook = [];
3411
+ mappedName.forEach((mapped) => {
3412
+ const mappedHook = dir[mapped];
3413
+ if (mappedHook) {
3414
+ softAssertCompatEnabled("CUSTOM_DIR", instance, mapped, name);
3415
+ hook.push(mappedHook);
3416
+ }
3417
+ });
3418
+ return hook.length ? hook : void 0;
3419
+ } else {
3420
+ if (dir[mappedName]) softAssertCompatEnabled("CUSTOM_DIR", instance, mappedName, name);
3421
+ return dir[mappedName];
3422
+ }
3304
3423
  }
3305
3424
  }
3306
3425
  //#endregion
@@ -3467,7 +3586,7 @@ function instanceWatch(source, value, options) {
3467
3586
  }
3468
3587
  const prev = setCurrentInstance(this);
3469
3588
  const res = doWatch(getter, cb.bind(publicThis), options);
3470
- setCurrentInstance(...prev);
3589
+ restoreCurrentInstance(prev);
3471
3590
  return res;
3472
3591
  }
3473
3592
  function createPathGetter(ctx, path) {
@@ -3480,6 +3599,7 @@ function createPathGetter(ctx, path) {
3480
3599
  }
3481
3600
  //#endregion
3482
3601
  //#region packages/runtime-core/src/components/Teleport.ts
3602
+ const pendingMounts = /* @__PURE__ */ new WeakMap();
3483
3603
  const TeleportEndKey = Symbol("_vte");
3484
3604
  const isTeleport = (type) => type.__isTeleport;
3485
3605
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
@@ -3488,15 +3608,16 @@ const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target inst
3488
3608
  const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
3489
3609
  const resolveTarget = (props, select) => {
3490
3610
  const targetSelector = props && props.to;
3491
- if (isString(targetSelector)) if (!select) {
3492
- warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
3493
- return null;
3611
+ if (isString(targetSelector)) {
3612
+ if (!select) {
3613
+ warn$1("Current renderer does not support string target for Teleports. (missing querySelector renderer option)");
3614
+ return null;
3615
+ } else {
3616
+ const target = select(targetSelector);
3617
+ if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
3618
+ return target;
3619
+ }
3494
3620
  } else {
3495
- const target = select(targetSelector);
3496
- if (!target && !isTeleportDisabled(props)) warn$1(`Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`);
3497
- return target;
3498
- }
3499
- else {
3500
3621
  if (!targetSelector && !isTeleportDisabled(props)) warn$1(`Invalid Teleport target: ${targetSelector}`);
3501
3622
  return targetSelector;
3502
3623
  }
@@ -3505,58 +3626,71 @@ const TeleportImpl = {
3505
3626
  name: "Teleport",
3506
3627
  __isTeleport: true,
3507
3628
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
3508
- const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;
3629
+ const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment, parentNode } } = internals;
3509
3630
  const disabled = isTeleportDisabled(n2.props);
3510
- let { shapeFlag, children, dynamicChildren } = n2;
3631
+ let { dynamicChildren } = n2;
3511
3632
  if (isHmrUpdating) {
3512
3633
  optimized = false;
3513
3634
  dynamicChildren = null;
3514
3635
  }
3636
+ const mount = (vnode, container, anchor) => {
3637
+ if (vnode.shapeFlag & 16) mountChildren(vnode.children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3638
+ };
3639
+ const mountToTarget = (vnode = n2) => {
3640
+ const disabled = isTeleportDisabled(vnode.props);
3641
+ const target = vnode.target = resolveTarget(vnode.props, querySelector);
3642
+ const targetAnchor = prepareAnchor(target, vnode, createText, insert);
3643
+ if (target) {
3644
+ if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
3645
+ else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
3646
+ if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3647
+ if (!disabled) {
3648
+ mount(vnode, target, targetAnchor);
3649
+ updateCssVars(vnode, false);
3650
+ }
3651
+ } else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3652
+ };
3653
+ const queuePendingMount = (vnode) => {
3654
+ const mountJob = () => {
3655
+ if (pendingMounts.get(vnode) !== mountJob) return;
3656
+ pendingMounts.delete(vnode);
3657
+ if (isTeleportDisabled(vnode.props)) {
3658
+ const mountContainer = parentNode(vnode.el) || container;
3659
+ mount(vnode, mountContainer, vnode.anchor);
3660
+ updateCssVars(vnode, true);
3661
+ }
3662
+ mountToTarget(vnode);
3663
+ };
3664
+ pendingMounts.set(vnode, mountJob);
3665
+ queuePostRenderEffect(mountJob, void 0, parentSuspense);
3666
+ };
3515
3667
  if (n1 == null) {
3516
3668
  const placeholder = n2.el = createComment("teleport start");
3517
3669
  const mainAnchor = n2.anchor = createComment("teleport end");
3518
3670
  insert(placeholder, container, anchor);
3519
3671
  insert(mainAnchor, container, anchor);
3520
- const mount = (container, anchor) => {
3521
- if (shapeFlag & 16) mountChildren(children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
3522
- };
3523
- const mountToTarget = () => {
3524
- const target = n2.target = resolveTarget(n2.props, querySelector);
3525
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
3526
- if (target) {
3527
- if (namespace !== "svg" && isTargetSVG(target)) namespace = "svg";
3528
- else if (namespace !== "mathml" && isTargetMathML(target)) namespace = "mathml";
3529
- if (parentComponent && parentComponent.isCE) (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
3530
- if (!disabled) {
3531
- mount(target, targetAnchor);
3532
- updateCssVars(n2, false);
3533
- }
3534
- } else if (!disabled) warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
3535
- };
3672
+ if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3673
+ queuePendingMount(n2);
3674
+ return;
3675
+ }
3536
3676
  if (disabled) {
3537
- mount(container, mainAnchor);
3677
+ mount(n2, container, mainAnchor);
3538
3678
  updateCssVars(n2, true);
3539
3679
  }
3540
- if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
3541
- n2.el.__isMounted = false;
3542
- queuePostRenderEffect(() => {
3543
- if (n2.el.__isMounted !== false) return;
3544
- mountToTarget();
3545
- delete n2.el.__isMounted;
3546
- }, void 0, parentSuspense);
3547
- } else mountToTarget();
3680
+ mountToTarget();
3548
3681
  } else {
3549
3682
  n2.el = n1.el;
3550
- n2.targetStart = n1.targetStart;
3551
3683
  const mainAnchor = n2.anchor = n1.anchor;
3552
- const target = n2.target = n1.target;
3553
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3554
- if (n1.el.__isMounted === false) {
3555
- queuePostRenderEffect(() => {
3556
- TeleportImpl.process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals);
3557
- }, void 0, parentSuspense);
3684
+ const pendingMount = pendingMounts.get(n1);
3685
+ if (pendingMount) {
3686
+ pendingMount.flags |= 4;
3687
+ pendingMounts.delete(n1);
3688
+ queuePendingMount(n2);
3558
3689
  return;
3559
3690
  }
3691
+ n2.targetStart = n1.targetStart;
3692
+ const target = n2.target = n1.target;
3693
+ const targetAnchor = n2.targetAnchor = n1.targetAnchor;
3560
3694
  const wasDisabled = isTeleportDisabled(n1.props);
3561
3695
  const currentContainer = wasDisabled ? container : target;
3562
3696
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
@@ -3570,24 +3704,30 @@ const TeleportImpl = {
3570
3704
  if (!wasDisabled) moveTeleport(n2, container, mainAnchor, internals, parentComponent, 1);
3571
3705
  else if (n2.props && n1.props && n2.props.to !== n1.props.to) n2.props.to = n1.props.to;
3572
3706
  } else if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
3573
- const nextTarget = n2.target = resolveTarget(n2.props, querySelector);
3574
- if (nextTarget) moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
3575
- else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
3707
+ const nextTarget = resolveTarget(n2.props, querySelector);
3708
+ if (nextTarget) {
3709
+ n2.target = nextTarget;
3710
+ moveTeleport(n2, nextTarget, null, internals, parentComponent, 0);
3711
+ } else warn$1("Invalid Teleport target on update:", target, `(${typeof target})`);
3576
3712
  } else if (wasDisabled) moveTeleport(n2, target, targetAnchor, internals, parentComponent, 1);
3577
3713
  updateCssVars(n2, disabled);
3578
3714
  }
3579
3715
  },
3580
3716
  remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
3581
- const { shapeFlag, children, anchor, targetStart, targetAnchor, props } = vnode;
3717
+ const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode;
3718
+ const disabled = isTeleportDisabled(props);
3719
+ const shouldRemove = doRemove || !disabled;
3720
+ const pendingMount = pendingMounts.get(vnode);
3721
+ if (pendingMount) {
3722
+ pendingMount.flags |= 4;
3723
+ pendingMounts.delete(vnode);
3724
+ }
3582
3725
  if (targetStart) hostRemove(targetStart);
3583
3726
  if (targetAnchor) hostRemove(targetAnchor);
3584
3727
  doRemove && hostRemove(anchor);
3585
- if (shapeFlag & 16) {
3586
- const shouldRemove = doRemove || !isTeleportDisabled(props);
3587
- for (let i = 0; i < children.length; i++) {
3588
- const child = children[i];
3589
- unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3590
- }
3728
+ if (!pendingMount && (disabled || target) && shapeFlag & 16) for (let i = 0; i < children.length; i++) {
3729
+ const child = children[i];
3730
+ unmount(child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren);
3591
3731
  }
3592
3732
  },
3593
3733
  move: moveTeleport,
@@ -3598,7 +3738,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3598
3738
  const { el, anchor, shapeFlag, children, props } = vnode;
3599
3739
  const isReorder = moveType === 2;
3600
3740
  if (isReorder) insert(el, container, parentAnchor);
3601
- if (!isReorder || isTeleportDisabled(props)) {
3741
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3602
3742
  if (shapeFlag & 16) for (let i = 0; i < children.length; i++) move(children[i], container, parentAnchor, 2, parentComponent);
3603
3743
  }
3604
3744
  if (isReorder) insert(anchor, container, parentAnchor);
@@ -3625,15 +3765,17 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
3625
3765
  const disabled = isTeleportDisabled(vnode.props);
3626
3766
  if (target) {
3627
3767
  const targetNode = target._lpa || target.firstChild;
3628
- if (vnode.shapeFlag & 16) if (disabled) {
3629
- hydrateDisabledTeleport(node, vnode);
3630
- hydrateAnchor(target, targetNode);
3631
- if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
3632
- } else {
3633
- vnode.anchor = nextSibling(node);
3634
- hydrateAnchor(target, targetNode);
3635
- if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
3636
- hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
3768
+ if (vnode.shapeFlag & 16) {
3769
+ if (disabled) {
3770
+ hydrateDisabledTeleport(node, vnode);
3771
+ hydrateAnchor(target, targetNode);
3772
+ if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
3773
+ } else {
3774
+ vnode.anchor = nextSibling(node);
3775
+ hydrateAnchor(target, targetNode);
3776
+ if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
3777
+ hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
3778
+ }
3637
3779
  }
3638
3780
  updateCssVars(vnode, disabled);
3639
3781
  } else if (disabled) {
@@ -3721,49 +3863,16 @@ const BaseTransitionImpl = {
3721
3863
  setup(props, { slots }) {
3722
3864
  const instance = getCurrentInstance();
3723
3865
  const state = useTransitionState();
3866
+ let resumeAfterLeave;
3724
3867
  return () => {
3725
- const children = slots.default && getTransitionRawChildren(slots.default(), true);
3726
- if (!children || !children.length) return;
3727
- const child = findNonCommentChild(children);
3868
+ const child = resolveTransitionChild(slots.default && slots.default(), !!instance.subTree);
3869
+ if (!child) return;
3728
3870
  const rawProps = /* @__PURE__ */ toRaw(props);
3729
3871
  const { mode } = rawProps;
3730
3872
  checkTransitionMode(mode);
3731
- if (state.isLeaving) return emptyPlaceholder(child);
3732
- const innerChild = getInnerChild$1(child);
3733
- if (!innerChild) return emptyPlaceholder(child);
3734
- let enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance, (hooks) => enterHooks = hooks);
3735
- if (innerChild.type !== Comment) setTransitionHooks(innerChild, enterHooks);
3736
- let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3737
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
3738
- let leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);
3739
- setTransitionHooks(oldInnerChild, leavingHooks);
3740
- if (mode === "out-in" && innerChild.type !== Comment) {
3741
- state.isLeaving = true;
3742
- leavingHooks.afterLeave = () => {
3743
- state.isLeaving = false;
3744
- if (!(instance.job.flags & 4)) instance.update();
3745
- delete leavingHooks.afterLeave;
3746
- oldInnerChild = void 0;
3747
- };
3748
- return emptyPlaceholder(child);
3749
- } else if (mode === "in-out" && innerChild.type !== Comment) leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3750
- const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);
3751
- leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3752
- el[leaveCbKey] = () => {
3753
- earlyRemove();
3754
- el[leaveCbKey] = void 0;
3755
- delete enterHooks.delayedLeave;
3756
- oldInnerChild = void 0;
3757
- };
3758
- enterHooks.delayedLeave = () => {
3759
- delayedLeave();
3760
- delete enterHooks.delayedLeave;
3761
- oldInnerChild = void 0;
3762
- };
3763
- };
3764
- else oldInnerChild = void 0;
3765
- } else if (oldInnerChild) oldInnerChild = void 0;
3766
- return child;
3873
+ return prepareTransitionSwitch(instance.subTree, child, rawProps, state, instance, mode === "out-in" ? resumeAfterLeave || (resumeAfterLeave = () => {
3874
+ if (!(instance.job.flags & 4)) instance.update();
3875
+ }) : NOOP);
3767
3876
  };
3768
3877
  }
3769
3878
  };
@@ -3833,8 +3942,10 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3833
3942
  persisted,
3834
3943
  beforeEnter(el) {
3835
3944
  let hook = onBeforeEnter;
3836
- if (!state.isMounted) if (appear) hook = onBeforeAppear || onBeforeEnter;
3837
- else return;
3945
+ if (!state.isMounted) {
3946
+ if (appear) hook = onBeforeAppear || onBeforeEnter;
3947
+ else return;
3948
+ }
3838
3949
  if (el[leaveCbKey]) el[leaveCbKey](true);
3839
3950
  earlyRemove();
3840
3951
  callHook(hook, [el]);
@@ -3844,11 +3955,13 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3844
3955
  let hook = onEnter;
3845
3956
  let afterHook = onAfterEnter;
3846
3957
  let cancelHook = onEnterCancelled;
3847
- if (!state.isMounted) if (appear) {
3848
- hook = onAppear || onEnter;
3849
- afterHook = onAfterAppear || onAfterEnter;
3850
- cancelHook = onAppearCancelled || onEnterCancelled;
3851
- } else return;
3958
+ if (!state.isMounted) {
3959
+ if (appear) {
3960
+ hook = onAppear || onEnter;
3961
+ afterHook = onAfterAppear || onAfterEnter;
3962
+ cancelHook = onAppearCancelled || onEnterCancelled;
3963
+ } else return;
3964
+ }
3852
3965
  let called = false;
3853
3966
  el[enterCbKey$1] = (cancelled) => {
3854
3967
  if (called) return;
@@ -3882,7 +3995,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
3882
3995
  else done();
3883
3996
  },
3884
3997
  clone(node) {
3885
- return cloneHooks(node);
3998
+ return cloneHooks ? cloneHooks(node) : hooks;
3886
3999
  }
3887
4000
  };
3888
4001
  return hooks;
@@ -3906,16 +4019,91 @@ function getInnerChild$1(vnode) {
3906
4019
  if (shapeFlag & 32 && isFunction(children.default)) return children.default();
3907
4020
  }
3908
4021
  }
4022
+ function resolveTransitionChild(children, renderEmpty = false) {
4023
+ const branches = children && getTransitionRawChildren(children, true);
4024
+ return branches && branches.length ? findNonCommentChild(branches) : renderEmpty ? createCommentVNode() : void 0;
4025
+ }
4026
+ /**
4027
+ * @internal
4028
+ */
4029
+ function prepareTransitionSwitch(previous, next, props, state, instance, resumeAfterLeave, delayedLeaveSource) {
4030
+ if (state.isLeaving) return emptyPlaceholder(next);
4031
+ const nextInner = getInnerChild$1(next);
4032
+ if (!nextInner) return emptyPlaceholder(next);
4033
+ let enterHooks = resolveTransitionHooks(nextInner, props, state, instance, (hooks) => {
4034
+ if (delayedLeaveSource) forwardDelayedLeave(hooks, delayedLeaveSource);
4035
+ enterHooks = hooks;
4036
+ });
4037
+ if (delayedLeaveSource) forwardDelayedLeave(enterHooks, delayedLeaveSource);
4038
+ if (nextInner.type !== Comment) setTransitionHooks(nextInner, enterHooks);
4039
+ const mode = props.mode;
4040
+ const previousInner = previous && getInnerChild$1(previous);
4041
+ if (previous && previousInner && previousInner.type !== Comment && !isSameVNodeType(previousInner, nextInner) && (!previous.component || recursiveGetSubtree(previous.component).type !== Comment)) {
4042
+ const leavingHooks = prepareLeavingTransitionHooks(previousInner, props, state, instance);
4043
+ if (nextInner.type !== Comment && (mode === "out-in" || mode === "in-out") && applyTransitionModeSwitch(previousInner, leavingHooks, mode === "in-out" ? () => enterHooks : void 0, props, state, resumeAfterLeave)) return emptyPlaceholder(next);
4044
+ }
4045
+ return next;
4046
+ }
4047
+ function forwardDelayedLeave(hooks, source) {
4048
+ const delayedLeave = source && source.delayedLeave;
4049
+ if (!delayedLeave) return;
4050
+ hooks.delayedLeave = () => {
4051
+ if (source.delayedLeave === delayedLeave) delayedLeave();
4052
+ delete hooks.delayedLeave;
4053
+ };
4054
+ }
4055
+ function prepareLeavingTransitionHooks(previousInner, props, state, instance) {
4056
+ return setTransitionHooks(previousInner, resolveTransitionHooks(previousInner, props, state, instance));
4057
+ }
4058
+ function applyTransitionModeSwitch(leavingVNode, leavingHooks, getEnterHooks, props, state, resumeAfterLeave) {
4059
+ if (props.mode === "out-in") {
4060
+ state.isLeaving = true;
4061
+ leavingHooks.afterLeave = () => {
4062
+ state.isLeaving = false;
4063
+ resumeAfterLeave();
4064
+ delete leavingHooks.afterLeave;
4065
+ };
4066
+ return true;
4067
+ } else if (props.mode === "in-out" && getEnterHooks) {
4068
+ let delayedLeavingVNode = leavingVNode;
4069
+ leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
4070
+ const enterHooks = getEnterHooks();
4071
+ if (!enterHooks) {
4072
+ delayedLeave();
4073
+ return;
4074
+ }
4075
+ const vnode = delayedLeavingVNode;
4076
+ const leavingVNodesCache = getLeavingNodesForType(state, vnode);
4077
+ leavingVNodesCache[String(vnode.key)] = vnode;
4078
+ el[leaveCbKey] = () => {
4079
+ earlyRemove();
4080
+ el[leaveCbKey] = void 0;
4081
+ delete enterHooks.delayedLeave;
4082
+ delayedLeavingVNode = void 0;
4083
+ };
4084
+ enterHooks.delayedLeave = () => {
4085
+ delayedLeave();
4086
+ delete enterHooks.delayedLeave;
4087
+ delayedLeavingVNode = void 0;
4088
+ };
4089
+ };
4090
+ }
4091
+ return false;
4092
+ }
3909
4093
  function setTransitionHooks(vnode, hooks) {
3910
- if (vnode.shapeFlag & 6 && vnode.component) if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
3911
- else {
4094
+ if (vnode.shapeFlag & 6 && vnode.component) {
3912
4095
  vnode.transition = hooks;
3913
- setTransitionHooks(vnode.component.subTree, hooks);
3914
- }
3915
- else if (vnode.shapeFlag & 128) {
3916
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3917
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4096
+ if (isVaporComponent(vnode.type)) getVaporInterface(vnode.component, vnode).setTransitionHooks(vnode.component, hooks);
4097
+ else {
4098
+ const subTree = vnode.component.subTree;
4099
+ return setTransitionHooks(isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, hooks);
4100
+ }
4101
+ } else if (vnode.shapeFlag & 128) {
4102
+ const contentHooks = vnode.ssContent.transition = hooks.clone(vnode.ssContent);
4103
+ const fallbackHooks = vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
4104
+ return vnode.suspense && vnode.suspense.activeBranch === vnode.ssFallback ? fallbackHooks : contentHooks;
3918
4105
  } else vnode.transition = hooks;
4106
+ return hooks;
3919
4107
  }
3920
4108
  function getTransitionRawChildren(children, keepComment = false, parentKey) {
3921
4109
  let ret = [];
@@ -3939,9 +4127,9 @@ function checkTransitionMode(mode) {
3939
4127
  }
3940
4128
  //#endregion
3941
4129
  //#region packages/runtime-core/src/apiDefineComponent.ts
3942
- /* @__NO_SIDE_EFFECTS__ */
4130
+ /*@__NO_SIDE_EFFECTS__*/
3943
4131
  function defineComponent(options, extraOptions) {
3944
- return isFunction(options) ? extend({ name: options.name }, extraOptions, { setup: options }) : options;
4132
+ return isFunction(options) ? /*@__PURE__*/ (() => extend({ name: options.name }, extraOptions, { setup: options }))() : options;
3945
4133
  }
3946
4134
  //#endregion
3947
4135
  //#region packages/runtime-core/src/helpers/useId.ts
@@ -4038,15 +4226,16 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4038
4226
  if (rawRef.f) {
4039
4227
  const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
4040
4228
  if (isUnmount) isArray(existing) && remove(existing, refValue);
4041
- else if (!isArray(existing)) if (_isString) {
4042
- refs[ref] = [refValue];
4043
- if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
4044
- } else {
4045
- const newVal = [refValue];
4046
- if (canSetRef(ref, rawRef.k)) ref.value = newVal;
4047
- if (rawRef.k) refs[rawRef.k] = newVal;
4048
- }
4049
- else if (!existing.includes(refValue)) existing.push(refValue);
4229
+ else if (!isArray(existing)) {
4230
+ if (_isString) {
4231
+ refs[ref] = [refValue];
4232
+ if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
4233
+ } else {
4234
+ const newVal = [refValue];
4235
+ if (canSetRef(ref, rawRef.k)) ref.value = newVal;
4236
+ if (rawRef.k) refs[rawRef.k] = newVal;
4237
+ }
4238
+ } else if (!existing.includes(refValue)) existing.push(refValue);
4050
4239
  } else if (_isString) {
4051
4240
  refs[ref] = value;
4052
4241
  if (canSetSetupRef(ref)) setupState[ref] = value;
@@ -4098,7 +4287,18 @@ const logMismatchError = () => {
4098
4287
  hasLoggedMismatchError = true;
4099
4288
  };
4100
4289
  const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
4101
- const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
4290
+ const isMathMLContainer = (container) => {
4291
+ if (!container.namespaceURI.includes("MathML")) return false;
4292
+ if (container.tagName !== "annotation-xml") return true;
4293
+ const encoding = container.getAttribute("encoding");
4294
+ return !encoding || !encoding.includes("html");
4295
+ };
4296
+ /**
4297
+ * Resolve the element namespace a container's children should be created in.
4298
+ * The live DOM is the source of truth, so this also covers containers that are
4299
+ * only known at runtime (interop boundaries, teleport targets).
4300
+ * @internal
4301
+ */
4102
4302
  const getContainerType = (container) => {
4103
4303
  if (container.nodeType !== 1) return void 0;
4104
4304
  if (isSVGContainer(container)) return "svg";
@@ -4122,7 +4322,7 @@ function createHydrationFunctions(rendererInternals) {
4122
4322
  };
4123
4323
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
4124
4324
  optimized = optimized || !!vnode.dynamicChildren;
4125
- const isFragmentStart = isComment(node) && node.data === "[";
4325
+ const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
4126
4326
  const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
4127
4327
  const { type, ref, shapeFlag, patchFlag } = vnode;
4128
4328
  let domType = node.nodeType;
@@ -4136,11 +4336,12 @@ function createHydrationFunctions(rendererInternals) {
4136
4336
  let nextNode = null;
4137
4337
  switch (type) {
4138
4338
  case Text:
4139
- if (domType !== 3) if (vnode.children === "") {
4140
- insert(vnode.el = createText(""), parentNode(node), node);
4141
- nextNode = node;
4142
- } else nextNode = onMismatch();
4143
- else {
4339
+ if (domType !== 3) {
4340
+ if (vnode.children === "") {
4341
+ insert(vnode.el = createText(""), parentNode(node), node);
4342
+ nextNode = node;
4343
+ } else nextNode = onMismatch();
4344
+ } else {
4144
4345
  if (node.data !== vnode.children) {
4145
4346
  warn$1(`Hydration text mismatch in`, node.parentNode, `\n - rendered on server: ${JSON.stringify(node.data)}\n - expected on client: ${JSON.stringify(vnode.children)}`);
4146
4347
  logMismatchError();
@@ -4177,30 +4378,35 @@ function createHydrationFunctions(rendererInternals) {
4177
4378
  else nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
4178
4379
  break;
4179
4380
  case VaporSlot:
4180
- nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node);
4381
+ nextNode = getVaporInterface(parentComponent, vnode).hydrateSlot(vnode, node, parentComponent, parentSuspense, slotScopeIds);
4181
4382
  break;
4182
- default: if (shapeFlag & 1) if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
4183
- else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
4184
- else if (shapeFlag & 6) {
4383
+ default: if (shapeFlag & 1) {
4384
+ if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode$1(node)) nextNode = onMismatch();
4385
+ else nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
4386
+ } else if (shapeFlag & 6) {
4185
4387
  vnode.slotScopeIds = slotScopeIds;
4186
4388
  const container = parentNode(node);
4187
4389
  if (isFragmentStart) nextNode = locateClosingAnchor(node);
4188
4390
  else if (isComment(node) && node.data === "teleport start") nextNode = locateClosingAnchor(node, node.data, "teleport end");
4189
4391
  else nextNode = nextSibling(node);
4190
- if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, null, parentComponent, parentSuspense);
4191
- else mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
4192
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4193
- let subTree;
4194
- if (isFragmentStart) {
4195
- subTree = createVNode(Fragment);
4196
- subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4197
- } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
4198
- subTree.el = node;
4199
- vnode.component.subTree = subTree;
4392
+ if (vnode.type.__vapor) getVaporInterface(parentComponent, vnode).hydrate(vnode, node, container, nextNode, parentComponent, parentSuspense);
4393
+ else {
4394
+ mountComponent(vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized);
4395
+ const component = vnode.component;
4396
+ if (!component.subTree && (isAsyncWrapper(vnode) || component.asyncDep)) {
4397
+ let subTree;
4398
+ if (isFragmentStart) {
4399
+ subTree = createVNode(Static);
4400
+ subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
4401
+ } else subTree = node.nodeType === 3 ? createTextVNode("") : createVNode(node.nodeType === 8 ? Comment : "div");
4402
+ subTree.el = node;
4403
+ component.subTree = subTree;
4404
+ }
4200
4405
  }
4201
- } else if (shapeFlag & 64) if (domType !== 8) nextNode = onMismatch();
4202
- else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
4203
- else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
4406
+ } else if (shapeFlag & 64) {
4407
+ if (domType !== 8) nextNode = onMismatch();
4408
+ else nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);
4409
+ } else if (shapeFlag & 128) nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);
4204
4410
  else warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
4205
4411
  }
4206
4412
  if (ref != null) setRef(ref, null, parentSuspense, vnode);
@@ -4208,7 +4414,7 @@ function createHydrationFunctions(rendererInternals) {
4208
4414
  };
4209
4415
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
4210
4416
  optimized = optimized || !!vnode.dynamicChildren;
4211
- const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
4417
+ const { type, dynamicProps, props, patchFlag, shapeFlag, dirs, transition } = vnode;
4212
4418
  const forcePatch = type === "input" || type === "option";
4213
4419
  {
4214
4420
  if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "created");
@@ -4226,15 +4432,11 @@ function createHydrationFunctions(rendererInternals) {
4226
4432
  }
4227
4433
  if (shapeFlag & 16 && !(props && (props.innerHTML || props.textContent))) {
4228
4434
  let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);
4229
- let hasWarned = false;
4435
+ if (next && !isMismatchAllowed(el, 1)) {
4436
+ warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
4437
+ logMismatchError();
4438
+ }
4230
4439
  while (next) {
4231
- if (!isMismatchAllowed(el, 1)) {
4232
- if (!hasWarned) {
4233
- warn$1(`Hydration children mismatch on`, el, `\nServer rendered element contains more child nodes than client vdom.`);
4234
- hasWarned = true;
4235
- }
4236
- logMismatchError();
4237
- }
4238
4440
  const cur = next;
4239
4441
  next = next.nextSibling;
4240
4442
  remove(cur);
@@ -4253,9 +4455,13 @@ function createHydrationFunctions(rendererInternals) {
4253
4455
  }
4254
4456
  if (props) {
4255
4457
  const isCustomElement = el.tagName.includes("-");
4458
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
4256
4459
  for (const key in props) {
4257
4460
  if (!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) logMismatchError();
4258
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key)) patchProp(el, key, null, props[key], void 0, parentComponent);
4461
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4462
+ if (isUnchangedResourceProp(el, key, props[key])) continue;
4463
+ patchProp(el, key, null, props[key], namespace, parentComponent);
4464
+ }
4259
4465
  }
4260
4466
  }
4261
4467
  let vnodeHooks;
@@ -4273,7 +4479,7 @@ function createHydrationFunctions(rendererInternals) {
4273
4479
  optimized = optimized || !!parentVNode.dynamicChildren;
4274
4480
  const children = parentVNode.children;
4275
4481
  const l = children.length;
4276
- let hasWarned = false;
4482
+ let hasCheckedMismatch = false;
4277
4483
  for (let i = 0; i < l; i++) {
4278
4484
  const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
4279
4485
  const isText = vnode.type === Text;
@@ -4287,12 +4493,12 @@ function createHydrationFunctions(rendererInternals) {
4287
4493
  node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);
4288
4494
  } else if (isText && !vnode.children) insert(vnode.el = createText(""), container);
4289
4495
  else {
4290
- if (!isMismatchAllowed(container, 1)) {
4291
- if (!hasWarned) {
4496
+ if (!hasCheckedMismatch) {
4497
+ hasCheckedMismatch = true;
4498
+ if (!isMismatchAllowed(container, 1)) {
4292
4499
  warn$1(`Hydration children mismatch on`, container, `\nServer rendered element contains fewer child nodes than client vdom.`);
4293
- hasWarned = true;
4500
+ logMismatchError();
4294
4501
  }
4295
- logMismatchError();
4296
4502
  }
4297
4503
  patch(null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
4298
4504
  }
@@ -4303,8 +4509,9 @@ function createHydrationFunctions(rendererInternals) {
4303
4509
  const { slotScopeIds: fragmentSlotScopeIds } = vnode;
4304
4510
  if (fragmentSlotScopeIds) slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
4305
4511
  const container = parentNode(node);
4306
- const next = hydrateChildren(nextSibling(node), vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
4307
- if (next && isComment(next) && next.data === "]") return nextSibling(vnode.anchor = next);
4512
+ const first = nextSibling(node);
4513
+ const next = vnode.vo && node.data === "(" ? getVaporInterface(parentComponent, vnode).hydrateSlotOutlet(vnode, node, parentComponent, parentSuspense, slotScopeIds) : hydrateChildren(first, vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);
4514
+ if (next && isComment(next) && next.data === (node.data === "(" ? ")" : "]")) return nextSibling(vnode.anchor = next);
4308
4515
  else {
4309
4516
  logMismatchError();
4310
4517
  insert(vnode.anchor = createComment(`]`), container, next);
@@ -4312,8 +4519,8 @@ function createHydrationFunctions(rendererInternals) {
4312
4519
  }
4313
4520
  };
4314
4521
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
4315
- if (!isMismatchAllowed(node.parentElement, 1)) {
4316
- warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
4522
+ if (!isNodeMismatchAllowed(node, vnode)) {
4523
+ warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && (node.data === "[" || node.data === "(") ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
4317
4524
  logMismatchError();
4318
4525
  }
4319
4526
  vnode.el = null;
@@ -4329,20 +4536,22 @@ function createHydrationFunctions(rendererInternals) {
4329
4536
  const container = parentNode(node);
4330
4537
  remove(node);
4331
4538
  patch(null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds);
4332
- if (parentComponent) {
4539
+ if (parentComponent && parentComponent.vnode) {
4333
4540
  parentComponent.vnode.el = vnode.el;
4334
4541
  updateHOCHostEl(parentComponent, vnode.el);
4335
4542
  }
4336
4543
  return next;
4337
4544
  };
4338
- const locateClosingAnchor = (node, open = "[", close = "]") => {
4545
+ const locateClosingAnchor = (node, open = node && isComment(node) && node.data === "(" ? "(" : "[", close = open === "(" ? ")" : "]") => {
4339
4546
  let match = 0;
4340
4547
  while (node) {
4341
4548
  node = nextSibling(node);
4342
4549
  if (node && isComment(node)) {
4343
4550
  if (node.data === open) match++;
4344
- if (node.data === close) if (match === 0) return nextSibling(node);
4345
- else match--;
4551
+ if (node.data === close) {
4552
+ if (match === 0) return nextSibling(node);
4553
+ else match--;
4554
+ }
4346
4555
  }
4347
4556
  }
4348
4557
  return node;
@@ -4352,7 +4561,7 @@ function createHydrationFunctions(rendererInternals) {
4352
4561
  if (parentNode) parentNode.replaceChild(newNode, oldNode);
4353
4562
  let parent = parentComponent;
4354
4563
  while (parent) {
4355
- if (parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
4564
+ if (parent.vnode && parent.vnode.el === oldNode) parent.vnode.el = parent.subTree.el = newNode;
4356
4565
  parent = parent.parent;
4357
4566
  }
4358
4567
  };
@@ -4361,6 +4570,16 @@ function createHydrationFunctions(rendererInternals) {
4361
4570
  const isTemplateNode$1 = (node) => {
4362
4571
  return node.nodeType === 1 && node.tagName === "TEMPLATE";
4363
4572
  };
4573
+ const resourceProps = /*@__PURE__*/ new Set([
4574
+ "src",
4575
+ "srcset",
4576
+ "href",
4577
+ "poster"
4578
+ ]);
4579
+ function isUnchangedResourceProp(el, key, clientValue) {
4580
+ if (!resourceProps.has(key)) return false;
4581
+ return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`);
4582
+ }
4364
4583
  /**
4365
4584
  * Dev only
4366
4585
  */
@@ -4404,7 +4623,10 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
4404
4623
  function getAttributeMismatch(el, key, clientValue) {
4405
4624
  let actual;
4406
4625
  let expected;
4407
- if (isBooleanAttr(key)) {
4626
+ if (key === "hidden") {
4627
+ actual = normalizeHiddenValue(el.getAttribute(key));
4628
+ expected = normalizeHiddenValue(clientValue);
4629
+ } else if (isBooleanAttr(key)) {
4408
4630
  actual = el.hasAttribute(key);
4409
4631
  expected = includeBooleanAttr(clientValue);
4410
4632
  } else if (clientValue == null) {
@@ -4432,6 +4654,11 @@ function warnPropMismatch(el, mismatchKey, mismatchType, actual, expected) {
4432
4654
  }
4433
4655
  return false;
4434
4656
  }
4657
+ function normalizeHiddenValue(value) {
4658
+ if (!isRenderableAttrValue(value)) return false;
4659
+ if (isString(value)) return value.toLowerCase() === "until-found" ? "until-found" : "";
4660
+ return includeBooleanAttr(value) ? "" : false;
4661
+ }
4435
4662
  function toClassSet(str) {
4436
4663
  return new Set(str.trim().split(/\s+/));
4437
4664
  }
@@ -4476,7 +4703,9 @@ const MismatchTypeString = {
4476
4703
  };
4477
4704
  function isMismatchAllowed(el, allowedType) {
4478
4705
  if (allowedType === 0 || allowedType === 1) while (el && !el.hasAttribute(allowMismatchAttr)) el = el.parentElement;
4479
- const allowedAttr = el && el.getAttribute(allowMismatchAttr);
4706
+ return isMismatchAllowedByAttr(el && el.getAttribute(allowMismatchAttr), allowedType);
4707
+ }
4708
+ function isMismatchAllowedByAttr(allowedAttr, allowedType) {
4480
4709
  if (allowedAttr == null) return false;
4481
4710
  else if (allowedAttr === "") return true;
4482
4711
  else {
@@ -4485,6 +4714,16 @@ function isMismatchAllowed(el, allowedType) {
4485
4714
  return list.includes(MismatchTypeString[allowedType]);
4486
4715
  }
4487
4716
  }
4717
+ function isNodeMismatchAllowed(node, vnode) {
4718
+ return isMismatchAllowed(node.parentElement, 1) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode);
4719
+ }
4720
+ function isMismatchAllowedByNode(node) {
4721
+ return node.nodeType === 1 && isMismatchAllowedByAttr(node.getAttribute(allowMismatchAttr), 1);
4722
+ }
4723
+ function isMismatchAllowedByVNode({ props }) {
4724
+ const allowedAttr = props && props[allowMismatchAttr];
4725
+ return typeof allowedAttr === "string" && isMismatchAllowedByAttr(allowedAttr, 1);
4726
+ }
4488
4727
  //#endregion
4489
4728
  //#region packages/runtime-core/src/hydrationStrategies.ts
4490
4729
  let requestIdleCallback;
@@ -4558,16 +4797,18 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
4558
4797
  return teardown;
4559
4798
  };
4560
4799
  function forEachElement(node, cb) {
4561
- if (isComment(node) && node.data === "[") {
4800
+ if (isComment(node) && (node.data === "[" || node.data === "(")) {
4801
+ const open = node.data;
4802
+ const close = open === "[" ? "]" : ")";
4562
4803
  let depth = 1;
4563
4804
  let next = node.nextSibling;
4564
4805
  while (next) {
4565
4806
  if (next.nodeType === 1) {
4566
4807
  if (cb(next) === false) break;
4567
4808
  } else if (isComment(next)) {
4568
- if (next.data === "]") {
4809
+ if (next.data === close) {
4569
4810
  if (--depth === 0) break;
4570
- } else if (next.data === "[") depth++;
4811
+ } else if (next.data === open) depth++;
4571
4812
  }
4572
4813
  next = next.nextSibling;
4573
4814
  }
@@ -4576,14 +4817,14 @@ function forEachElement(node, cb) {
4576
4817
  //#endregion
4577
4818
  //#region packages/runtime-core/src/apiAsyncComponent.ts
4578
4819
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4579
- /* @__NO_SIDE_EFFECTS__ */
4820
+ /*@__NO_SIDE_EFFECTS__*/
4580
4821
  function defineAsyncComponent(source) {
4581
4822
  const { load, getResolvedComp, setPendingRequest, source: { loadingComponent, errorComponent, delay, hydrate: hydrateStrategy, timeout, suspensible = true } } = createAsyncComponentContext(source);
4582
4823
  return /* @__PURE__ */ defineComponent({
4583
4824
  name: "AsyncComponentWrapper",
4584
4825
  __asyncLoader: load,
4585
4826
  __asyncHydrate(el, instance, hydrate) {
4586
- performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy);
4827
+ performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, true);
4587
4828
  },
4588
4829
  get __asyncResolved() {
4589
4830
  return getResolvedComp();
@@ -4603,11 +4844,16 @@ function defineAsyncComponent(source) {
4603
4844
  onError(err);
4604
4845
  return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
4605
4846
  });
4606
- const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
4847
+ const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
4607
4848
  load().then(() => {
4849
+ if (instance.isUnmounted) return;
4608
4850
  loaded.value = true;
4609
4851
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
4610
4852
  }).catch((err) => {
4853
+ if (instance.isUnmounted) {
4854
+ setPendingRequest(null);
4855
+ return;
4856
+ }
4611
4857
  onError(err);
4612
4858
  error.value = err;
4613
4859
  });
@@ -4665,14 +4911,22 @@ function createAsyncComponentContext(source) {
4665
4911
  setPendingRequest: (request) => pendingRequest = request
4666
4912
  };
4667
4913
  }
4668
- const useAsyncComponentState = (delay, timeout, onError) => {
4914
+ const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
4669
4915
  const loaded = /* @__PURE__ */ ref(false);
4670
4916
  const error = /* @__PURE__ */ ref();
4671
4917
  const delayed = /* @__PURE__ */ ref(!!delay);
4672
- if (delay) setTimeout(() => {
4918
+ let timeoutTimer;
4919
+ let delayTimer;
4920
+ if (instance) onUnmounted(() => {
4921
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
4922
+ if (delayTimer != null) clearTimeout(delayTimer);
4923
+ }, instance);
4924
+ if (delay) delayTimer = setTimeout(() => {
4925
+ if (instance && instance.isUnmounted) return;
4673
4926
  delayed.value = false;
4674
4927
  }, delay);
4675
- if (timeout != null) setTimeout(() => {
4928
+ if (timeout != null) timeoutTimer = setTimeout(() => {
4929
+ if (instance && instance.isUnmounted) return;
4676
4930
  if (!loaded.value && !error.value) {
4677
4931
  const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
4678
4932
  onError(err);
@@ -4689,9 +4943,10 @@ const useAsyncComponentState = (delay, timeout, onError) => {
4689
4943
  * shared between core and vapor
4690
4944
  * @internal
4691
4945
  */
4692
- function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy) {
4946
+ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydrateStrategy, skipIfUpdated) {
4947
+ const wasConnected = el.isConnected;
4693
4948
  let patched = false;
4694
- (instance.bu || (instance.bu = [])).push(() => patched = true);
4949
+ if (skipIfUpdated) (instance.bu || (instance.bu = [])).push(() => patched = true);
4695
4950
  const performHydrate = () => {
4696
4951
  if (patched) {
4697
4952
  {
@@ -4700,6 +4955,7 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
4700
4955
  }
4701
4956
  return;
4702
4957
  }
4958
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
4703
4959
  hydrate();
4704
4960
  };
4705
4961
  const doHydrate = hydrateStrategy ? () => {
@@ -4776,10 +5032,13 @@ const KeepAliveImpl = {
4776
5032
  });
4777
5033
  let pendingCacheKey = null;
4778
5034
  const cacheSubtree = () => {
4779
- if (pendingCacheKey != null) if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
4780
- cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
4781
- }, void 0, keepAliveInstance.subTree.suspense);
4782
- else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
5035
+ if (pendingCacheKey != null) {
5036
+ if (isSuspense(keepAliveInstance.subTree.type)) queuePostRenderEffect(() => {
5037
+ const vnode = getInnerChild(keepAliveInstance.subTree);
5038
+ if (vnode.component) cache.set(pendingCacheKey, vnode);
5039
+ }, void 0, keepAliveInstance.subTree.suspense);
5040
+ else cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
5041
+ }
4783
5042
  };
4784
5043
  onMounted(cacheSubtree);
4785
5044
  onUpdated(cacheSubtree);
@@ -4850,7 +5109,7 @@ const decorate$2 = (t) => {
4850
5109
  t.__isBuiltIn = true;
4851
5110
  return t;
4852
5111
  };
4853
- const KeepAlive = /* @__PURE__ */ decorate$2(KeepAliveImpl);
5112
+ const KeepAlive = /*@__PURE__*/ decorate$2(KeepAliveImpl);
4854
5113
  function matches(pattern, name) {
4855
5114
  if (isArray(pattern)) return pattern.some((p) => matches(p, name));
4856
5115
  else if (isString(pattern)) return pattern.split(",").includes(name);
@@ -4941,7 +5200,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
4941
5200
  try {
4942
5201
  return callWithAsyncErrorHandling(hook, target, type, args);
4943
5202
  } finally {
4944
- setCurrentInstance(...prev);
5203
+ restoreCurrentInstance(prev);
4945
5204
  setActiveSub(prevSub);
4946
5205
  }
4947
5206
  });
@@ -5066,16 +5325,17 @@ function compatH(type, propsOrChildren, children) {
5066
5325
  }
5067
5326
  const l = arguments.length;
5068
5327
  const is2ndArgArrayChildren = isArray(propsOrChildren);
5069
- if (l === 2 || is2ndArgArrayChildren) if (isObject(propsOrChildren) && !is2ndArgArrayChildren) {
5070
- if (isVNode(propsOrChildren)) return convertLegacySlots(createVNode(type, null, [propsOrChildren]));
5071
- return convertLegacySlots(convertLegacyDirectives(createVNode(type, convertLegacyProps(propsOrChildren, type)), propsOrChildren));
5072
- } else return convertLegacySlots(createVNode(type, null, propsOrChildren));
5073
- else {
5328
+ if (l === 2 || is2ndArgArrayChildren) {
5329
+ if (isObject(propsOrChildren) && !is2ndArgArrayChildren) {
5330
+ if (isVNode(propsOrChildren)) return convertLegacySlots(createVNode(type, null, [propsOrChildren]));
5331
+ return convertLegacySlots(convertLegacyDirectives(createVNode(type, convertLegacyProps(propsOrChildren, type)), propsOrChildren));
5332
+ } else return convertLegacySlots(createVNode(type, null, propsOrChildren));
5333
+ } else {
5074
5334
  if (isVNode(children)) children = [children];
5075
5335
  return convertLegacySlots(convertLegacyDirectives(createVNode(type, convertLegacyProps(propsOrChildren, type), children), propsOrChildren));
5076
5336
  }
5077
5337
  }
5078
- const skipLegacyRootLevelProps = /* @__PURE__ */ makeMap("staticStyle,staticClass,directives,model,hook");
5338
+ const skipLegacyRootLevelProps = /*@__PURE__*/ makeMap("staticStyle,staticClass,directives,model,hook");
5079
5339
  function convertLegacyProps(legacyProps, type) {
5080
5340
  if (!legacyProps) return null;
5081
5341
  const converted = {};
@@ -5087,8 +5347,10 @@ function convertLegacyProps(legacyProps, type) {
5087
5347
  if (key === "nativeOn") handlerKey += `Native`;
5088
5348
  const existing = converted[handlerKey];
5089
5349
  const incoming = listeners[event];
5090
- if (existing !== incoming) if (existing) converted[handlerKey] = [].concat(existing, incoming);
5091
- else converted[handlerKey] = incoming;
5350
+ if (existing !== incoming) {
5351
+ if (existing) converted[handlerKey] = [].concat(existing, incoming);
5352
+ else converted[handlerKey] = incoming;
5353
+ }
5092
5354
  }
5093
5355
  } else if (!skipLegacyRootLevelProps(key)) converted[key] = legacyProps[key];
5094
5356
  if (legacyProps.staticClass) converted.class = normalizeClass([legacyProps.staticClass, converted.class]);
@@ -5187,7 +5449,7 @@ function convertLegacyFunctionalComponent(comp) {
5187
5449
  const legacyFn = comp.render;
5188
5450
  const Func = (props, ctx) => {
5189
5451
  const instance = getCurrentInstance();
5190
- return legacyFn(compatH, {
5452
+ const legacyCtx = {
5191
5453
  props,
5192
5454
  children: instance.vnode.children || [],
5193
5455
  data: instance.vnode.props || {},
@@ -5207,7 +5469,8 @@ function convertLegacyFunctionalComponent(comp) {
5207
5469
  }
5208
5470
  return {};
5209
5471
  }
5210
- });
5472
+ };
5473
+ return legacyFn(compatH, legacyCtx);
5211
5474
  };
5212
5475
  Func.props = comp.props;
5213
5476
  Func.displayName = comp.name;
@@ -5236,23 +5499,25 @@ function renderList(source, renderItem, cache, index) {
5236
5499
  }
5237
5500
  ret = new Array(source.length);
5238
5501
  for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], i, void 0, cached && cached[i]);
5239
- } else if (typeof source === "number") if (!Number.isInteger(source) || source < 0) {
5240
- warn$1(`The v-for range expects a positive integer value but got ${source}.`);
5241
- ret = [];
5242
- } else {
5243
- ret = new Array(source);
5244
- for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
5245
- }
5246
- else if (isObject(source)) if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
5247
- else {
5248
- const keys = Object.keys(source);
5249
- ret = new Array(keys.length);
5250
- for (let i = 0, l = keys.length; i < l; i++) {
5251
- const key = keys[i];
5252
- ret[i] = renderItem(source[key], key, i, cached && cached[i]);
5502
+ } else if (typeof source === "number") {
5503
+ if (!Number.isInteger(source) || source < 0) {
5504
+ warn$1(`The v-for range expects a positive integer value but got ${source}.`);
5505
+ ret = [];
5506
+ } else {
5507
+ ret = new Array(source);
5508
+ for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
5253
5509
  }
5254
- }
5255
- else ret = [];
5510
+ } else if (isObject(source)) {
5511
+ if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
5512
+ else {
5513
+ const keys = Object.keys(source);
5514
+ ret = new Array(keys.length);
5515
+ for (let i = 0, l = keys.length; i < l; i++) {
5516
+ const key = keys[i];
5517
+ ret[i] = renderItem(source[key], key, i, cached && cached[i]);
5518
+ }
5519
+ }
5520
+ } else ret = [];
5256
5521
  if (cache) cache[index] = ret;
5257
5522
  return ret;
5258
5523
  }
@@ -5277,37 +5542,64 @@ function createSlots(slots, dynamicSlots) {
5277
5542
  //#endregion
5278
5543
  //#region packages/runtime-core/src/helpers/renderSlot.ts
5279
5544
  /**
5545
+ * Links a slot function to its raw vapor slot: a raw vapor slot carries
5546
+ * itself, and the wrapper the interop slots proxy hands out carries the raw
5547
+ * slot it wraps — one lookup answers both "is this a vapor slot" and
5548
+ * "which one". Internal to vapor interop.
5549
+ */
5550
+ const rawVaporSlotKey = Symbol(`rawVaporSlot`);
5551
+ /**
5280
5552
  * Compiler runtime helper for rendering `<slot/>`
5281
5553
  * @private
5282
5554
  */
5283
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5555
+ function renderSlot(slots, name, props, fallback, noSlotted, branchKey) {
5556
+ if (props == null) props = {};
5284
5557
  let slot = slots[name];
5285
- const vaporSlot = slot && (slot.__vs || (slot.__vapor ? slot : null));
5558
+ const vaporSlot = slot && slot[rawVaporSlotKey];
5286
5559
  if (vaporSlot) {
5287
5560
  const ret = (openBlock(), createBlock(VaporSlot, props));
5288
5561
  ret.vs = {
5289
5562
  slot: vaporSlot,
5290
- fallback
5563
+ outlets: fallback ? [{
5564
+ fallback,
5565
+ owner: currentRenderingInstance
5566
+ }] : void 0
5291
5567
  };
5568
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
5292
5569
  return ret;
5293
5570
  }
5294
5571
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
5295
- const hasProps = Object.keys(props).length > 0;
5296
- if (name !== "default") props.name = name;
5297
- return openBlock(), createBlock(Fragment, null, [createVNode("slot", props, fallback && fallback())], hasProps ? -2 : 64);
5572
+ const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
5573
+ const hasProps = Object.keys(slotProps).length > 0;
5574
+ if (name !== "default") slotProps.name = name;
5575
+ return openBlock(), createBlock(Fragment, null, [createVNode("slot", slotProps, fallback && fallback())], hasProps ? -2 : 64);
5298
5576
  }
5299
5577
  if (slot && slot.length > 1) {
5300
5578
  warn$1("SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.");
5301
5579
  slot = () => [];
5302
5580
  }
5303
5581
  if (slot && slot._c) slot._d = false;
5582
+ const prevStackSize = blockStack.length;
5304
5583
  openBlock();
5305
- const validSlotContent = slot && ensureValidVNode(slot(props));
5306
- ensureVaporSlotFallback(validSlotContent, fallback);
5307
- const slotKey = props.key || validSlotContent && validSlotContent.key;
5308
- const rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
5584
+ let rendered;
5585
+ try {
5586
+ const validSlotContent = slot && ensureValidVNode(slot(props));
5587
+ let attached = false;
5588
+ if (fallback && validSlotContent && currentRenderingInstance) {
5589
+ const interop = currentRenderingInstance.appContext.vapor;
5590
+ if (interop) attached = interop.attachSlotOutlet(validSlotContent, fallback, currentRenderingInstance);
5591
+ }
5592
+ const slotKey = props.key || branchKey || validSlotContent && validSlotContent.key;
5593
+ rendered = createBlock(Fragment, { key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
5594
+ if (!validSlotContent && fallback) rendered.shapeFlag |= 1024;
5595
+ if (attached) rendered.vo = true;
5596
+ } catch (err) {
5597
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
5598
+ throw err;
5599
+ } finally {
5600
+ if (slot && slot._c) slot._d = true;
5601
+ }
5309
5602
  if (!noSlotted && rendered.scopeId) rendered.slotScopeIds = [rendered.scopeId + "-s"];
5310
- if (slot && slot._c) slot._d = true;
5311
5603
  return rendered;
5312
5604
  }
5313
5605
  function ensureValidVNode(vnodes) {
@@ -5318,12 +5610,6 @@ function ensureValidVNode(vnodes) {
5318
5610
  return true;
5319
5611
  }) ? vnodes : null;
5320
5612
  }
5321
- function ensureVaporSlotFallback(vnodes, fallback) {
5322
- let vaporSlot;
5323
- if (vnodes && vnodes.length === 1 && isVNode(vnodes[0]) && (vaporSlot = vnodes[0].vs)) {
5324
- if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
5325
- }
5326
- }
5327
5613
  //#endregion
5328
5614
  //#region packages/runtime-core/src/helpers/toHandlers.ts
5329
5615
  /**
@@ -5382,12 +5668,14 @@ function legacyResolveScopedSlots(fns, raw, hasDynamicKeys) {
5382
5668
  function mapKeyToName(slots) {
5383
5669
  for (let i = 0; i < slots.length; i++) {
5384
5670
  const fn = slots[i];
5385
- if (fn) if (isArray(fn)) mapKeyToName(fn);
5386
- else fn.name = fn.key || "default";
5671
+ if (fn) {
5672
+ if (isArray(fn)) mapKeyToName(fn);
5673
+ else fn.name = fn.key || "default";
5674
+ }
5387
5675
  }
5388
5676
  return slots;
5389
5677
  }
5390
- const staticCacheMap = /* @__PURE__ */ new WeakMap();
5678
+ const staticCacheMap = /*@__PURE__*/ new WeakMap();
5391
5679
  function legacyRenderStatic(instance, index) {
5392
5680
  let cache = staticCacheMap.get(instance);
5393
5681
  if (!cache) staticCacheMap.set(instance, cache = []);
@@ -5520,11 +5808,38 @@ const getPublicInstance = (i) => {
5520
5808
  if (isStatefulComponent(i)) return getComponentPublicInstance(i);
5521
5809
  return getPublicInstance(i.parent);
5522
5810
  };
5811
+ const resolveDevRootEl = (vnode) => {
5812
+ let found = false;
5813
+ while (true) {
5814
+ if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) {
5815
+ const root = filterSingleRoot(vnode.children);
5816
+ if (!root) return;
5817
+ vnode = root;
5818
+ found = true;
5819
+ continue;
5820
+ }
5821
+ const component = vnode.component;
5822
+ if (component && component.subTree) {
5823
+ vnode = component.subTree;
5824
+ continue;
5825
+ }
5826
+ const suspense = vnode.suspense;
5827
+ if (suspense && suspense.activeBranch) {
5828
+ vnode = suspense.activeBranch;
5829
+ continue;
5830
+ }
5831
+ return found ? vnode.el : void 0;
5832
+ }
5833
+ };
5834
+ const getDevRootFragmentEl = (i) => {
5835
+ const el = i.subTree && resolveDevRootEl(i.subTree);
5836
+ return el === void 0 ? i.vnode.el : el;
5837
+ };
5523
5838
  let publicPropertiesMap;
5524
5839
  const getPublicPropertiesMap = () => {
5525
5840
  if (!publicPropertiesMap) publicPropertiesMap = extend(Object.create(null), {
5526
5841
  $: (i) => i,
5527
- $el: (i) => i.vnode.el,
5842
+ $el: (i) => getDevRootFragmentEl(i),
5528
5843
  $data: (i) => i.data,
5529
5844
  $props: (i) => /* @__PURE__ */ shallowReadonly(i.props),
5530
5845
  $attrs: (i) => /* @__PURE__ */ shallowReadonly(i.attrs),
@@ -5637,7 +5952,7 @@ PublicInstanceProxyHandlers.ownKeys = (target) => {
5637
5952
  warn$1("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.");
5638
5953
  return Reflect.ownKeys(target);
5639
5954
  };
5640
- const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, {
5955
+ const RuntimeCompiledPublicInstanceProxyHandlers = /*@__PURE__*/ extend({}, PublicInstanceProxyHandlers, {
5641
5956
  get(target, key) {
5642
5957
  if (key === Symbol.unscopables) return;
5643
5958
  return PublicInstanceProxyHandlers.get(target, key, target);
@@ -5822,12 +6137,13 @@ function mergeDefaults(raw, defaults) {
5822
6137
  for (const key in defaults) {
5823
6138
  if (key.startsWith("__skip")) continue;
5824
6139
  let opt = props[key];
5825
- if (opt) if (isArray(opt) || isFunction(opt)) opt = props[key] = {
5826
- type: opt,
5827
- default: defaults[key]
5828
- };
5829
- else opt.default = defaults[key];
5830
- else if (opt === null) opt = props[key] = { default: defaults[key] };
6140
+ if (opt) {
6141
+ if (isArray(opt) || isFunction(opt)) opt = props[key] = {
6142
+ type: opt,
6143
+ default: defaults[key]
6144
+ };
6145
+ else opt.default = defaults[key];
6146
+ } else if (opt === null) opt = props[key] = { default: defaults[key] };
5831
6147
  else warn$1(`props default key "${key}" has no corresponding declaration.`);
5832
6148
  if (opt && defaults[`__skip_${key}`]) opt.skipFactory = true;
5833
6149
  }
@@ -5882,21 +6198,29 @@ function withAsyncContext(getAwaitable) {
5882
6198
  setCurrentInstance(null, void 0);
5883
6199
  if (inSSRSetup) setInSSRSetupState(false);
5884
6200
  const restore = () => {
6201
+ const stoppedScope = ctx && !ctx.scope.active ? ctx.scope : void 0;
5885
6202
  setCurrentInstance(ctx);
5886
6203
  if (inSSRSetup) setInSSRSetupState(true);
6204
+ return stoppedScope;
5887
6205
  };
5888
6206
  const cleanup = () => {
5889
6207
  setCurrentInstance(null, void 0);
5890
6208
  if (inSSRSetup) setInSSRSetupState(false);
5891
6209
  };
5892
6210
  if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
5893
- restore();
5894
- Promise.resolve().then(() => Promise.resolve().then(cleanup));
6211
+ const stoppedScope = restore();
6212
+ Promise.resolve().then(() => Promise.resolve().then(() => {
6213
+ if (stoppedScope) stoppedScope.reset();
6214
+ cleanup();
6215
+ }));
5895
6216
  throw e;
5896
6217
  });
5897
6218
  return [awaitable, () => {
5898
- restore();
5899
- Promise.resolve().then(cleanup);
6219
+ const stoppedScope = restore();
6220
+ Promise.resolve().then(() => {
6221
+ if (stoppedScope) stoppedScope.reset();
6222
+ cleanup();
6223
+ });
5900
6224
  }];
5901
6225
  }
5902
6226
  //#endregion
@@ -5957,11 +6281,12 @@ function applyOptions(instance) {
5957
6281
  const opt = computedOptions[key];
5958
6282
  const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
5959
6283
  if (get === NOOP) warn$1(`Computed property "${key}" has no getter.`);
6284
+ const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
6285
+ warn$1(`Write operation failed: computed property "${key}" is readonly.`);
6286
+ };
5960
6287
  const c = computed({
5961
6288
  get,
5962
- set: !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
5963
- warn$1(`Write operation failed: computed property "${key}" is readonly.`);
5964
- }
6289
+ set
5965
6290
  });
5966
6291
  Object.defineProperty(ctx, key, {
5967
6292
  enumerable: true,
@@ -6020,9 +6345,10 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP)
6020
6345
  for (const key in injectOptions) {
6021
6346
  const opt = injectOptions[key];
6022
6347
  let injected;
6023
- if (isObject(opt)) if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
6024
- else injected = inject(opt.from || key);
6025
- else injected = inject(opt);
6348
+ if (isObject(opt)) {
6349
+ if ("default" in opt) injected = inject(opt.from || key, opt.default, true);
6350
+ else injected = inject(opt.from || key);
6351
+ } else injected = inject(opt);
6026
6352
  if (/* @__PURE__ */ isRef(injected)) Object.defineProperty(ctx, key, {
6027
6353
  enumerable: true,
6028
6354
  configurable: true,
@@ -6042,7 +6368,8 @@ function createWatcher(raw, ctx, publicThis, key) {
6042
6368
  {
6043
6369
  const cur = getCurrentInstance();
6044
6370
  const instance = cur && getCurrentScope() === cur.scope ? cur : null;
6045
- if (isArray(getter()) && isCompatEnabled$1("WATCH_ARRAY", instance)) options.deep = true;
6371
+ const newValue = getter();
6372
+ if (isArray(newValue) && isCompatEnabled$1("WATCH_ARRAY", instance)) options.deep = true;
6046
6373
  const baseGetter = getter;
6047
6374
  getter = () => {
6048
6375
  const val = baseGetter();
@@ -6055,13 +6382,14 @@ function createWatcher(raw, ctx, publicThis, key) {
6055
6382
  if (isFunction(handler)) watch(getter, handler, options);
6056
6383
  else warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
6057
6384
  } else if (isFunction(raw)) watch(getter, raw.bind(publicThis), options);
6058
- else if (isObject(raw)) if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
6059
- else {
6060
- const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
6061
- if (isFunction(handler)) watch(getter, handler, extend(raw, options));
6062
- else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
6063
- }
6064
- else warn$1(`Invalid watch option: "${key}"`, raw);
6385
+ else if (isObject(raw)) {
6386
+ if (isArray(raw)) raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
6387
+ else {
6388
+ const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
6389
+ if (isFunction(handler)) watch(getter, handler, extend(raw, options));
6390
+ else warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
6391
+ }
6392
+ } else warn$1(`Invalid watch option: "${key}"`, raw);
6065
6393
  }
6066
6394
  /**
6067
6395
  * Resolve merged options and cache it on the component.
@@ -6075,12 +6403,13 @@ function resolveMergedOptions(instance) {
6075
6403
  const cached = cache.get(base);
6076
6404
  let resolved;
6077
6405
  if (cached) resolved = cached;
6078
- else if (!globalMixins.length && !mixins && !extendsOptions) if (isCompatEnabled$1("PRIVATE_APIS", instance)) {
6079
- resolved = extend({}, base);
6080
- resolved.parent = instance.parent && instance.parent.proxy;
6081
- resolved.propsData = instance.vnode.props;
6082
- } else resolved = base;
6083
- else {
6406
+ else if (!globalMixins.length && !mixins && !extendsOptions) {
6407
+ if (isCompatEnabled$1("PRIVATE_APIS", instance)) {
6408
+ resolved = extend({}, base);
6409
+ resolved.parent = instance.parent && instance.parent.proxy;
6410
+ resolved.propsData = instance.vnode.props;
6411
+ } else resolved = base;
6412
+ } else {
6084
6413
  resolved = {};
6085
6414
  if (globalMixins.length) globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
6086
6415
  mergeOptions(resolved, base, optionMergeStrategies);
@@ -6153,7 +6482,7 @@ function mergeObjectOptions(to, from) {
6153
6482
  }
6154
6483
  function mergeEmitsOrPropsOptions(to, from) {
6155
6484
  if (to) {
6156
- if (isArray(to) && isArray(from)) return [...new Set([...to, ...from])];
6485
+ if (isArray(to) && isArray(from)) return [.../* @__PURE__ */ new Set([...to, ...from])];
6157
6486
  return extend(Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from !== null && from !== void 0 ? from : {}));
6158
6487
  } else return from;
6159
6488
  }
@@ -6214,7 +6543,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6214
6543
  if (options.el) return vm.$mount(options.el);
6215
6544
  else return vm;
6216
6545
  }
6217
- Vue.version = `2.6.14-compat:3.6.0-beta.9`;
6546
+ Vue.version = `2.6.14-compat:3.6.0-rc.10`;
6218
6547
  Vue.config = singletonApp.config;
6219
6548
  Vue.use = (plugin, ...options) => {
6220
6549
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -6469,7 +6798,9 @@ function defineReactive(obj, key, val) {
6469
6798
  else Object.keys(val).forEach((key) => {
6470
6799
  try {
6471
6800
  defineReactiveSimple(val, key, val[key]);
6472
- } catch (e) {}
6801
+ } catch (e) {
6802
+ warn$1(`Failed making property "${key}" reactive:`, e);
6803
+ }
6473
6804
  });
6474
6805
  }
6475
6806
  const i = obj.$;
@@ -6602,8 +6933,10 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
6602
6933
  } else warn$1(`Cannot unmount an app that is not mounted.`);
6603
6934
  },
6604
6935
  provide(key, value) {
6605
- if (key in context.provides) if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
6606
- else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
6936
+ if (key in context.provides) {
6937
+ if (hasOwn(context.provides, key)) warn$1(`App already provides property with key "${String(key)}". It will be overwritten with the new value.`);
6938
+ else warn$1(`App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.`);
6939
+ }
6607
6940
  context.provides[key] = value;
6608
6941
  return app;
6609
6942
  },
@@ -6685,13 +7018,17 @@ function useModel(props, name, options = EMPTY_OBJ) {
6685
7018
  const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
6686
7019
  const res = customRef((track, trigger) => {
6687
7020
  let localValue;
7021
+ let prevPropValue = EMPTY_OBJ;
6688
7022
  let prevSetValue = EMPTY_OBJ;
6689
7023
  let prevEmittedValue;
6690
7024
  watchSyncEffect(() => {
6691
7025
  const propValue = props[camelizedName];
6692
- if (hasChanged(localValue, propValue)) {
6693
- localValue = propValue;
6694
- trigger();
7026
+ if (hasChanged(prevPropValue, propValue)) {
7027
+ prevPropValue = propValue;
7028
+ if (hasChanged(localValue, propValue)) {
7029
+ localValue = propValue;
7030
+ trigger();
7031
+ }
6695
7032
  }
6696
7033
  });
6697
7034
  return {
@@ -6714,12 +7051,13 @@ function useModel(props, name, options = EMPTY_OBJ) {
6714
7051
  for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
6715
7052
  else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
6716
7053
  }
6717
- if (!parentPassedModelValue || !parentPassedModelUpdater) {
7054
+ const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
7055
+ if (!hasVModel) {
6718
7056
  localValue = value;
6719
7057
  trigger();
6720
7058
  }
6721
7059
  i.emit(`update:${name}`, emittedValue);
6722
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) trigger();
7060
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
6723
7061
  prevSetValue = value;
6724
7062
  prevEmittedValue = emittedValue;
6725
7063
  }
@@ -6752,12 +7090,14 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
6752
7090
  if (instance.isUnmounted) return;
6753
7091
  {
6754
7092
  const { emitsOptions, propsOptions } = instance;
6755
- if (emitsOptions) if (!(event in emitsOptions) && !(event.startsWith("hook:") || event.startsWith(compatModelEventPrefix))) {
6756
- if (!propsOptions || !propsOptions[0] || !(toHandlerKey(camelize(event)) in propsOptions[0])) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`);
6757
- } else {
6758
- const validator = emitsOptions[event];
6759
- if (isFunction(validator)) {
6760
- if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
7093
+ if (emitsOptions) {
7094
+ if (!(event in emitsOptions) && !(event.startsWith("hook:") || event.startsWith(compatModelEventPrefix))) {
7095
+ if (!propsOptions || !propsOptions[0] || !(toHandlerKey(camelize(event)) in propsOptions[0])) warn$1(`Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`);
7096
+ } else {
7097
+ const validator = emitsOptions[event];
7098
+ if (isFunction(validator)) {
7099
+ if (!validator(...rawArgs)) warn$1(`Invalid event arguments: event validation failed for event "${event}".`);
7100
+ }
6761
7101
  }
6762
7102
  }
6763
7103
  }
@@ -6767,7 +7107,7 @@ function baseEmit(instance, props, getter, event, ...rawArgs) {
6767
7107
  const modifiers = isCompatModelListener ? props.modelModifiers : isModelListener && getModelModifiers(props, event.slice(7), getter);
6768
7108
  if (modifiers) {
6769
7109
  if (modifiers.trim) args = rawArgs.map((a) => isString(a) ? a.trim() : a);
6770
- if (modifiers.number) args = rawArgs.map(looseToNumber);
7110
+ if (modifiers.number) args = args.map(looseToNumber);
6771
7111
  }
6772
7112
  devtoolsComponentEmit(instance, event, args);
6773
7113
  {
@@ -6832,7 +7172,8 @@ function normalizeEmitsOptions(comp, appContext, asMixin = false) {
6832
7172
  function isEmitListener(options, key) {
6833
7173
  if (!options || !isOn(key)) return false;
6834
7174
  if (key.startsWith(compatModelEventPrefix)) return true;
6835
- key = key.slice(2).replace(/Once$/, "");
7175
+ key = key.slice(2);
7176
+ key = key === "Once" ? key : key.replace(/Once$/, "");
6836
7177
  return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
6837
7178
  }
6838
7179
  //#endregion
@@ -6908,8 +7249,9 @@ function renderComponentRoot(instance) {
6908
7249
  root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
6909
7250
  }
6910
7251
  if (vnode.transition) {
6911
- if (!isElementRoot(root)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
6912
- setTransitionHooks(root, vnode.transition);
7252
+ const child = isTeleport(root.type) ? getInnerChild$1(root) || root : root;
7253
+ if (!isElementRoot(child)) warn$1("Component inside <Transition> renders non-element root node that cannot be animated.");
7254
+ setTransitionHooks(child, vnode.transition);
6913
7255
  }
6914
7256
  if (setRoot) setRoot(root);
6915
7257
  else result = root;
@@ -6960,18 +7302,21 @@ function filterSingleRoot(children, recurse = true) {
6960
7302
  for (let i = 0; i < children.length; i++) {
6961
7303
  const child = children[i];
6962
7304
  if (isVNode(child)) {
6963
- if (child.type !== Comment || child.children === "v-if") if (singleRoot) return;
6964
- else {
6965
- singleRoot = child;
6966
- if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
7305
+ if (child.type !== Comment || child.children === "v-if") {
7306
+ if (singleRoot) return;
7307
+ else {
7308
+ singleRoot = child;
7309
+ if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) return filterSingleRoot(singleRoot.children);
7310
+ }
6967
7311
  }
6968
7312
  } else return;
6969
7313
  }
6970
7314
  return singleRoot;
6971
7315
  }
7316
+ const isFunctionalFallthroughKey = (key) => key === "class" || key === "style" || isOn(key);
6972
7317
  const getFunctionalFallthrough = (attrs) => {
6973
7318
  let res;
6974
- for (const key in attrs) if (key === "class" || key === "style" || isOn(key)) (res || (res = {}))[key] = attrs[key];
7319
+ for (const key in attrs) if (isFunctionalFallthroughKey(key)) (res || (res = {}))[key] = attrs[key];
6975
7320
  return res;
6976
7321
  };
6977
7322
  const filterModelListeners = (attrs, props) => {
@@ -7107,16 +7452,17 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
7107
7452
  let key = propsToUpdate[i];
7108
7453
  if (isEmitListener(instance.emitsOptions, key)) continue;
7109
7454
  const value = rawProps[key];
7110
- if (options) if (hasOwn(attrs, key)) {
7111
- if (value !== attrs[key]) {
7112
- attrs[key] = value;
7113
- hasAttrsChanged = true;
7455
+ if (options) {
7456
+ if (hasOwn(attrs, key)) {
7457
+ if (value !== attrs[key]) {
7458
+ attrs[key] = value;
7459
+ hasAttrsChanged = true;
7460
+ }
7461
+ } else {
7462
+ const camelizedKey = camelize(key);
7463
+ props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
7114
7464
  }
7115
7465
  } else {
7116
- const camelizedKey = camelize(key);
7117
- props[camelizedKey] = resolvePropValue(options, camelizedKey, value, instance, baseResolveDefault);
7118
- }
7119
- else {
7120
7466
  if (isOn(key) && key.endsWith("Native")) key = key.slice(0, -6);
7121
7467
  else if (shouldSkipAttr(key, instance)) continue;
7122
7468
  if (value !== attrs[key]) {
@@ -7129,9 +7475,11 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
7129
7475
  } else {
7130
7476
  if (setFullProps(instance, rawProps, props, attrs)) hasAttrsChanged = true;
7131
7477
  let kebabKey;
7132
- for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) if (options) {
7133
- if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
7134
- } else delete props[key];
7478
+ for (const key in rawCurrentProps) if (!rawProps || !hasOwn(rawProps, key) && ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
7479
+ if (options) {
7480
+ if (rawPrevProps && (rawPrevProps[key] !== void 0 || rawPrevProps[kebabKey] !== void 0)) props[key] = resolvePropValue(options, key, void 0, instance, baseResolveDefault, true);
7481
+ } else delete props[key];
7482
+ }
7135
7483
  if (attrs !== rawCurrentProps) {
7136
7484
  for (const key in attrs) if (!rawProps || !hasOwn(rawProps, key) && !hasOwn(rawProps, key + "Native")) {
7137
7485
  delete attrs[key];
@@ -7152,9 +7500,10 @@ function setFullProps(instance, rawProps, props, attrs) {
7152
7500
  if (key === "inline-template") continue;
7153
7501
  const value = rawProps[key];
7154
7502
  let camelKey;
7155
- if (options && hasOwn(options, camelKey = camelize(key))) if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
7156
- else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
7157
- else if (!isEmitListener(instance.emitsOptions, key)) {
7503
+ if (options && hasOwn(options, camelKey = camelize(key))) {
7504
+ if (!needCastKeys || !needCastKeys.includes(camelKey)) props[camelKey] = value;
7505
+ else (rawCastValues || (rawCastValues = {}))[camelKey] = value;
7506
+ } else if (!isEmitListener(instance.emitsOptions, key)) {
7158
7507
  if (isOn(key) && key.endsWith("Native")) key = key.slice(0, -6);
7159
7508
  else if (shouldSkipAttr(key, instance)) continue;
7160
7509
  if (!(key in attrs) || value !== attrs[key]) {
@@ -7203,7 +7552,7 @@ function baseResolveDefault(factory, instance, key) {
7203
7552
  const prev = setCurrentInstance(instance);
7204
7553
  const props = /* @__PURE__ */ toRaw(instance.props);
7205
7554
  value = factory.call(isCompatEnabled$1("PROPS_DEFAULT_THIS", instance) ? createPropsDefaultThis(instance, props, key) : null, props);
7206
- setCurrentInstance(...prev);
7555
+ restoreCurrentInstance(prev);
7207
7556
  return value;
7208
7557
  }
7209
7558
  const mixinPropsCache = /* @__PURE__ */ new WeakMap();
@@ -7320,7 +7669,7 @@ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
7320
7669
  }
7321
7670
  if (validator && !validator(value, /* @__PURE__ */ shallowReadonly(resolvedProps))) warn$1("Invalid prop: custom validator check failed for prop \"" + key + "\".");
7322
7671
  }
7323
- const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
7672
+ const isSimpleType = /*@__PURE__*/ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
7324
7673
  /**
7325
7674
  * dev only
7326
7675
  */
@@ -7350,7 +7699,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
7350
7699
  const receivedType = toRawType(value);
7351
7700
  const expectedValue = styleValue(value, expectedType);
7352
7701
  const receivedValue = styleValue(value, receivedType);
7353
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) message += ` with value ${expectedValue}`;
7702
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) message += ` with value ${expectedValue}`;
7354
7703
  message += `, got ${receivedType} `;
7355
7704
  if (isExplicable(receivedType)) message += `with value ${receivedValue}.`;
7356
7705
  return message;
@@ -7359,7 +7708,8 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
7359
7708
  * dev only
7360
7709
  */
7361
7710
  function styleValue(value, type) {
7362
- if (type === "String") return `"${value}"`;
7711
+ if (isSymbol(value)) return value.toString();
7712
+ else if (type === "String") return `"${value}"`;
7363
7713
  else if (type === "Number") return `${Number(value)}`;
7364
7714
  else return `${value}`;
7365
7715
  }
@@ -7376,8 +7726,11 @@ function isExplicable(type) {
7376
7726
  /**
7377
7727
  * dev only
7378
7728
  */
7379
- function isBoolean(...args) {
7380
- return args.some((elem) => elem.toLowerCase() === "boolean");
7729
+ function isCoercible(...args) {
7730
+ return args.every((elem) => {
7731
+ const value = elem.toLowerCase();
7732
+ return value !== "boolean" && value !== "symbol";
7733
+ });
7381
7734
  }
7382
7735
  //#endregion
7383
7736
  //#region packages/runtime-core/src/componentSlots.ts
@@ -7429,12 +7782,13 @@ const updateSlots = (instance, children, optimized) => {
7429
7782
  let deletionComparisonTarget = EMPTY_OBJ;
7430
7783
  if (vnode.shapeFlag & 32) {
7431
7784
  const type = children._;
7432
- if (type) if (isHmrUpdating) {
7433
- assignSlots(slots, children, optimized);
7434
- trigger(instance, "set", "$slots");
7435
- } else if (optimized && type === 1) needDeletionCheck = false;
7436
- else assignSlots(slots, children, optimized);
7437
- else {
7785
+ if (type) {
7786
+ if (isHmrUpdating) {
7787
+ assignSlots(slots, children, optimized);
7788
+ trigger(instance, "set", "$slots");
7789
+ } else if (optimized && type === 1) needDeletionCheck = false;
7790
+ else assignSlots(slots, children, optimized);
7791
+ } else {
7438
7792
  needDeletionCheck = !children.$stable;
7439
7793
  normalizeObjectSlots(children, slots, instance);
7440
7794
  }
@@ -7452,7 +7806,7 @@ const updateSlots = (instance, children, optimized) => {
7452
7806
  let supported;
7453
7807
  let perf;
7454
7808
  let cachedNow$1 = 0;
7455
- const p$1 = /* @__PURE__ */ Promise.resolve();
7809
+ const p$1 = /*@__PURE__*/ Promise.resolve();
7456
7810
  const getNow$1 = () => cachedNow$1 || (p$1.then(() => cachedNow$1 = 0), cachedNow$1 = isSupported() ? perf.now() : Date.now());
7457
7811
  /**
7458
7812
  * @internal
@@ -7533,6 +7887,10 @@ function baseCreateRenderer(options, createHydrationFns) {
7533
7887
  optimized = false;
7534
7888
  n2.dynamicChildren = null;
7535
7889
  }
7890
+ if (n2.dynamicChildren && n1 && n1.dynamicChildren && n1.dynamicChildren.hasOnce) {
7891
+ if (n2.dynamicChildren === EMPTY_ARR) n2.dynamicChildren = [];
7892
+ n2.dynamicChildren.hasOnce = true;
7893
+ }
7536
7894
  const { type, ref, shapeFlag } = n2;
7537
7895
  switch (type) {
7538
7896
  case Text:
@@ -7549,7 +7907,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7549
7907
  processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
7550
7908
  break;
7551
7909
  case VaporSlot:
7552
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
7910
+ getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense, slotScopeIds);
7553
7911
  break;
7554
7912
  default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
7555
7913
  else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
@@ -7668,7 +8026,10 @@ function baseCreateRenderer(options, createHydrationFns) {
7668
8026
  for (let i = 0; i < inheritedScopeIds.length; i++) hostSetScopeId(el, inheritedScopeIds[i]);
7669
8027
  };
7670
8028
  const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
7671
- for (let i = start; i < children.length; i++) patch(null, children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]), container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
8029
+ for (let i = start; i < children.length; i++) {
8030
+ const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
8031
+ patch(null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
8032
+ }
7672
8033
  };
7673
8034
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7674
8035
  const el = n2.el = n1.el;
@@ -7680,9 +8041,10 @@ function baseCreateRenderer(options, createHydrationFns) {
7680
8041
  let vnodeHook;
7681
8042
  parentComponent && toggleRecurse(parentComponent, false);
7682
8043
  if (vnodeHook = newProps.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
8044
+ if (n2.ibu) n2.ibu();
7683
8045
  if (dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
7684
8046
  parentComponent && toggleRecurse(parentComponent, true);
7685
- if (isHmrUpdating) {
8047
+ if (isHmrUpdating || dynamicChildren && (!n1.dynamicChildren || n1.dynamicChildren.length !== dynamicChildren.length)) {
7686
8048
  patchFlag = 0;
7687
8049
  optimized = false;
7688
8050
  dynamicChildren = null;
@@ -7713,8 +8075,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7713
8075
  if (n1.children !== n2.children) hostSetElementText(el, n2.children);
7714
8076
  }
7715
8077
  } else if (!optimized && dynamicChildren == null) patchProps(el, oldProps, newProps, parentComponent, namespace);
7716
- if ((vnodeHook = newProps.onVnodeUpdated) || dirs) queuePostRenderEffect(() => {
8078
+ if ((vnodeHook = newProps.onVnodeUpdated) || dirs || n2.iu) queuePostRenderEffect(() => {
7717
8079
  vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
8080
+ n2.iu && n2.iu();
7718
8081
  dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
7719
8082
  }, void 0, parentSuspense);
7720
8083
  };
@@ -7722,7 +8085,8 @@ function baseCreateRenderer(options, createHydrationFns) {
7722
8085
  for (let i = 0; i < newChildren.length; i++) {
7723
8086
  const oldVNode = oldChildren[i];
7724
8087
  const newVNode = newChildren[i];
7725
- patch(oldVNode, newVNode, oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
8088
+ const container = oldVNode.el && (oldVNode.type === Fragment || !isSameVNodeType(oldVNode, newVNode) || oldVNode.shapeFlag & 198) ? hostParentNode(oldVNode.el) : fallbackContainer;
8089
+ patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true);
7726
8090
  }
7727
8091
  };
7728
8092
  const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
@@ -7760,25 +8124,15 @@ function baseCreateRenderer(options, createHydrationFns) {
7760
8124
  };
7761
8125
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7762
8126
  n2.slotScopeIds = slotScopeIds;
7763
- if (n2.type.__vapor) if (n1 == null) if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent);
7764
- else {
7765
- getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense, () => {
7766
- if (n2.dirs) {
7767
- invokeDirectiveHook(n2, null, parentComponent, "created");
7768
- invokeDirectiveHook(n2, null, parentComponent, "beforeMount");
7769
- }
7770
- });
7771
- if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, null, parentComponent, "mounted"), void 0, parentSuspense);
7772
- }
7773
- else {
7774
- getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized), () => {
7775
- if (n2.dirs) invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
7776
- });
7777
- if (n2.dirs) queuePostRenderEffect(() => invokeDirectiveHook(n2, n1, parentComponent, "updated"), void 0, parentSuspense);
7778
- }
7779
- else if (n1 == null) if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
7780
- else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
7781
- else updateComponent(n1, n2, optimized);
8127
+ if (n2.type.__vapor) {
8128
+ if (n1 == null) {
8129
+ if (n2.shapeFlag & 512) getVaporInterface(parentComponent, n2).activate(n2, container, anchor, parentComponent, parentSuspense);
8130
+ else getVaporInterface(parentComponent, n2).mount(n2, container, anchor, parentComponent, parentSuspense);
8131
+ } else getVaporInterface(parentComponent, n2).update(n1, n2, shouldUpdateComponent(n1, n2, optimized));
8132
+ } else if (n1 == null) {
8133
+ if (n2.shapeFlag & 512) parentComponent.ctx.activate(n2, container, anchor, namespace, optimized);
8134
+ else mountComponent(n2, container, anchor, parentComponent, parentSuspense, namespace, optimized);
8135
+ } else updateComponent(n1, n2, optimized);
7782
8136
  };
7783
8137
  const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
7784
8138
  const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
@@ -7822,16 +8176,18 @@ function baseCreateRenderer(options, createHydrationFns) {
7822
8176
  };
7823
8177
  const updateComponent = (n1, n2, optimized) => {
7824
8178
  const instance = n2.component = n1.component;
7825
- if (shouldUpdateComponent(n1, n2, optimized)) if (instance.asyncDep && !instance.asyncResolved) {
7826
- pushWarningContext(n2);
7827
- updateComponentPreRender(instance, n2, optimized);
7828
- popWarningContext();
7829
- return;
8179
+ if (shouldUpdateComponent(n1, n2, optimized)) {
8180
+ if (instance.asyncDep && !instance.asyncResolved) {
8181
+ pushWarningContext(n2);
8182
+ n2.el = n1.el;
8183
+ updateComponentPreRender(instance, n2, optimized);
8184
+ popWarningContext();
8185
+ return;
8186
+ } else {
8187
+ instance.next = n2;
8188
+ instance.effect.run();
8189
+ }
7830
8190
  } else {
7831
- instance.next = n2;
7832
- instance.effect.run();
7833
- }
7834
- else {
7835
8191
  n2.el = n1.el;
7836
8192
  instance.vnode = n2;
7837
8193
  }
@@ -7934,6 +8290,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7934
8290
  } else next = vnode;
7935
8291
  if (bu) invokeArrayFns(bu);
7936
8292
  if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) invokeVNodeHook(vnodeHook, parent, next, vnode);
8293
+ if (next.ibu) next.ibu();
7937
8294
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) instance.emit("hook:beforeUpdate");
7938
8295
  toggleRecurse(instance, true);
7939
8296
  startMeasure(instance, `render`);
@@ -7947,7 +8304,10 @@ function baseCreateRenderer(options, createHydrationFns) {
7947
8304
  next.el = nextTree.el;
7948
8305
  if (originNext === null) updateHOCHostEl(instance, nextTree.el);
7949
8306
  if (u) queuePostRenderEffect(u, void 0, parentSuspense);
7950
- if (vnodeHook = next.props && next.props.onVnodeUpdated) queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), void 0, parentSuspense);
8307
+ if ((vnodeHook = next.props && next.props.onVnodeUpdated) || next.iu) queuePostRenderEffect(() => {
8308
+ vnodeHook && invokeVNodeHook(vnodeHook, parent, next, vnode);
8309
+ next.iu && next.iu();
8310
+ }, void 0, parentSuspense);
7951
8311
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:updated"), void 0, parentSuspense);
7952
8312
  devtoolsComponentUpdated(instance);
7953
8313
  popWarningContext();
@@ -7988,9 +8348,10 @@ function baseCreateRenderer(options, createHydrationFns) {
7988
8348
  if (shapeFlag & 8) {
7989
8349
  if (prevShapeFlag & 16) unmountChildren(c1, parentComponent, parentSuspense);
7990
8350
  if (c2 !== c1) hostSetElementText(container, c2);
7991
- } else if (prevShapeFlag & 16) if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
7992
- else unmountChildren(c1, parentComponent, parentSuspense, true);
7993
- else {
8351
+ } else if (prevShapeFlag & 16) {
8352
+ if (shapeFlag & 16) patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
8353
+ else unmountChildren(c1, parentComponent, parentSuspense, true);
8354
+ } else {
7994
8355
  if (prevShapeFlag & 8) hostSetElementText(container, "");
7995
8356
  if (shapeFlag & 16) mountChildren(c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
7996
8357
  }
@@ -8089,15 +8450,17 @@ function baseCreateRenderer(options, createHydrationFns) {
8089
8450
  const anchorVNode = c2[nextIndex + 1];
8090
8451
  const anchor = nextIndex + 1 < l2 ? anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode) : parentAnchor;
8091
8452
  if (newIndexToOldIndexMap[i] === 0) patch(null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
8092
- else if (moved) if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
8093
- else j--;
8453
+ else if (moved) {
8454
+ if (j < 0 || i !== increasingNewIndexSequence[j]) move(nextChild, container, anchor, 2, parentComponent);
8455
+ else j--;
8456
+ }
8094
8457
  }
8095
8458
  }
8096
8459
  };
8097
8460
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
8098
8461
  const { el, type, transition, children, shapeFlag } = vnode;
8099
8462
  if (isVaporComponent(type) || type === VaporSlot) {
8100
- getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType);
8463
+ getVaporInterface(parentComponent, vnode).move(vnode, container, anchor, moveType, parentSuspense);
8101
8464
  return;
8102
8465
  }
8103
8466
  if (shapeFlag & 6) {
@@ -8122,49 +8485,37 @@ function baseCreateRenderer(options, createHydrationFns) {
8122
8485
  moveStaticNode(vnode, container, anchor);
8123
8486
  return;
8124
8487
  }
8125
- if (moveType !== 2 && shapeFlag & 1 && transition) if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
8126
- else {
8127
- const { leave, delayLeave, afterLeave } = transition;
8128
- const remove = () => {
8488
+ if (moveType !== 2 && shapeFlag & 1 && transition) {
8489
+ if (moveType === 0) performTransitionEnter(el, transition, () => hostInsert(el, container, anchor), parentSuspense, true);
8490
+ else performTransitionLeave(el, transition, () => {
8129
8491
  if (vnode.ctx.isUnmounted) hostRemove(el);
8130
8492
  else hostInsert(el, container, anchor);
8131
- };
8132
- const performLeave = () => {
8133
- if (el._isLeaving) el[leaveCbKey](true);
8134
- leave(el, () => {
8135
- remove();
8136
- afterLeave && afterLeave();
8137
- });
8138
- };
8139
- if (delayLeave) delayLeave(el, remove, performLeave);
8140
- else performLeave();
8141
- }
8142
- else hostInsert(el, container, anchor);
8493
+ }, true, true);
8494
+ } else hostInsert(el, container, anchor);
8143
8495
  };
8144
8496
  const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
8145
8497
  const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex, memo } = vnode;
8146
- if (patchFlag === -2) optimized = false;
8498
+ if (patchFlag === -2 || dynamicChildren && dynamicChildren.hasOnce) optimized = false;
8147
8499
  if (ref != null) {
8148
8500
  const prevSub = setActiveSub();
8149
8501
  setRef(ref, null, parentSuspense, vnode, true);
8150
8502
  setActiveSub(prevSub);
8151
8503
  }
8152
- if (cacheIndex != null) parentComponent.renderCache[cacheIndex] = void 0;
8504
+ if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) parentComponent.renderCache[cacheIndex] = void 0;
8153
8505
  if (shapeFlag & 256) {
8154
- if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer());
8506
+ if (isVaporComponent(vnode.type)) getVaporInterface(parentComponent, vnode).deactivate(vnode, parentComponent.ctx.getStorageContainer(), parentSuspense);
8155
8507
  else parentComponent.ctx.deactivate(vnode);
8156
8508
  return;
8157
8509
  }
8510
+ if (shapeFlag & 6 && isVaporComponent(type)) {
8511
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
8512
+ return;
8513
+ }
8158
8514
  const shouldInvokeDirs = shapeFlag & 1 && dirs;
8159
8515
  const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
8160
8516
  let vnodeHook;
8161
8517
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) invokeVNodeHook(vnodeHook, parentComponent, vnode);
8162
- if (shapeFlag & 6) if (isVaporComponent(type)) {
8163
- if (dirs) invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
8164
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
8165
- if (dirs) queuePostRenderEffect(() => invokeDirectiveHook(vnode, null, parentComponent, "unmounted"), void 0, parentSuspense);
8166
- return;
8167
- } else unmountComponent(vnode.component, parentSuspense, doRemove);
8518
+ if (shapeFlag & 6) unmountComponent(vnode.component, parentSuspense, doRemove);
8168
8519
  else {
8169
8520
  if (shapeFlag & 128) {
8170
8521
  vnode.suspense.unmount(parentSuspense, doRemove);
@@ -8175,7 +8526,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8175
8526
  else if (dynamicChildren && !dynamicChildren.hasOnce && (type !== Fragment || patchFlag > 0 && patchFlag & 64)) unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);
8176
8527
  else if (type === Fragment && patchFlag & 384 || !optimized && shapeFlag & 16) unmountChildren(children, parentComponent, parentSuspense);
8177
8528
  if (type === VaporSlot) {
8178
- getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
8529
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove, parentSuspense);
8179
8530
  return;
8180
8531
  }
8181
8532
  if (doRemove) remove(vnode);
@@ -8199,6 +8550,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8199
8550
  }
8200
8551
  if (type === Static) {
8201
8552
  removeStaticNode(vnode);
8553
+ if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
8202
8554
  return;
8203
8555
  }
8204
8556
  if (transition) performTransitionLeave(el, transition, () => hostRemove(el), !!(vnode.shapeFlag & 1));
@@ -8224,6 +8576,9 @@ function baseCreateRenderer(options, createHydrationFns) {
8224
8576
  if (effect) {
8225
8577
  effect.stop();
8226
8578
  unmount(subTree, instance, parentSuspense, doRemove);
8579
+ } else if (instance.vnode.el && subTree) {
8580
+ subTree.transition = instance.vnode.transition;
8581
+ unmount(subTree, instance, parentSuspense, doRemove);
8227
8582
  }
8228
8583
  if (um) queuePostRenderEffect(um, void 0, parentSuspense);
8229
8584
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) queuePostRenderEffect(() => instance.emit("hook:destroyed"), void 0, parentSuspense);
@@ -8299,12 +8654,14 @@ function resolveChildrenNamespace({ type, props }, currentNamespace) {
8299
8654
  return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
8300
8655
  }
8301
8656
  function toggleRecurse({ effect, job, vapor }, allowed) {
8302
- if (!vapor) if (allowed) {
8303
- effect.flags |= 128;
8304
- job.flags |= 2;
8305
- } else {
8306
- effect.flags &= -129;
8307
- job.flags &= -3;
8657
+ if (!vapor) {
8658
+ if (allowed) {
8659
+ effect.flags |= 128;
8660
+ job.flags |= 2;
8661
+ } else {
8662
+ effect.flags &= -129;
8663
+ job.flags &= -3;
8664
+ }
8308
8665
  }
8309
8666
  }
8310
8667
  function needTransition(parentSuspense, transition) {
@@ -8344,13 +8701,19 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8344
8701
  }
8345
8702
  function locateNonHydratedAsyncRoot(instance) {
8346
8703
  const subComponent = instance.subTree && instance.subTree.component;
8347
- if (subComponent) if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
8348
- else return locateNonHydratedAsyncRoot(subComponent);
8704
+ if (subComponent) {
8705
+ if (subComponent.asyncDep && !subComponent.asyncResolved) return subComponent;
8706
+ else return locateNonHydratedAsyncRoot(subComponent);
8707
+ }
8349
8708
  }
8350
8709
  function invalidateMount(hooks) {
8351
8710
  if (hooks) for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 4;
8352
8711
  }
8353
8712
  function performTransitionEnter(el, transition, insert, parentSuspense, force = false) {
8713
+ if (force && transition.persisted && !el[leaveCbKey]) {
8714
+ insert();
8715
+ return;
8716
+ }
8354
8717
  if (force || needTransition(parentSuspense, transition)) {
8355
8718
  transition.beforeEnter(el);
8356
8719
  insert();
@@ -8360,13 +8723,15 @@ function performTransitionEnter(el, transition, insert, parentSuspense, force =
8360
8723
  function performTransitionLeave(el, transition, remove, isElement = true, force = false) {
8361
8724
  const performRemove = () => {
8362
8725
  remove();
8363
- if (transition && !transition.persisted && transition.afterLeave) transition.afterLeave();
8726
+ if (transition && (force || !transition.persisted) && transition.afterLeave) transition.afterLeave();
8364
8727
  };
8365
8728
  if (force || isElement && transition && !transition.persisted) {
8366
8729
  const { leave, delayLeave } = transition;
8367
8730
  const performLeave = () => {
8731
+ const wasLeaving = el._isLeaving || !!el[leaveCbKey];
8368
8732
  if (el._isLeaving && force) el[leaveCbKey](true);
8369
- leave(el, performRemove);
8733
+ if (force && transition.persisted && !wasLeaving) remove();
8734
+ else leave(el, performRemove);
8370
8735
  };
8371
8736
  if (delayLeave) delayLeave(el, performRemove, performLeave);
8372
8737
  else performLeave();
@@ -8385,7 +8750,7 @@ function isVaporComponent(type) {
8385
8750
  /**
8386
8751
  * shared between vdom and vapor
8387
8752
  */
8388
- function getInheritedScopeIds(vnode, parentComponent) {
8753
+ function getInheritedScopeIds(vnode, parentComponent, includeVaporRootIds = true) {
8389
8754
  const inheritedScopeIds = [];
8390
8755
  let currentParent = parentComponent;
8391
8756
  let currentVNode = vnode;
@@ -8401,6 +8766,8 @@ function getInheritedScopeIds(vnode, parentComponent) {
8401
8766
  currentParent = currentParent.parent;
8402
8767
  } else break;
8403
8768
  }
8769
+ const vaporScopeIds = includeVaporRootIds && currentVNode.vaporScopeIds;
8770
+ if (vaporScopeIds) inheritedScopeIds.push(...vaporScopeIds);
8404
8771
  return inheritedScopeIds;
8405
8772
  }
8406
8773
  function resolveAsyncComponentPlaceholder(anchorVnode) {
@@ -8419,7 +8786,7 @@ const Suspense = {
8419
8786
  process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
8420
8787
  if (n1 == null) mountSuspense(n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals);
8421
8788
  else {
8422
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
8789
+ if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback && !parentSuspense.isHydrating) {
8423
8790
  n2.suspense = n1.suspense;
8424
8791
  n2.suspense.vnode = n2;
8425
8792
  n2.el = n1.el;
@@ -8457,10 +8824,12 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
8457
8824
  if (pendingBranch) {
8458
8825
  suspense.pendingBranch = newBranch;
8459
8826
  if (isSameVNodeType(pendingBranch, newBranch)) {
8460
- patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
8827
+ suspense.deps++;
8828
+ patch(pendingBranch, newBranch, isHydrating ? container : suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
8829
+ suspense.deps--;
8461
8830
  if (suspense.deps <= 0) suspense.resolve();
8462
8831
  else if (isInFallback) {
8463
- if (!isHydrating) {
8832
+ if (!isHydrating && !suspense.isFallbackMountPending) {
8464
8833
  patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
8465
8834
  setActiveBranch(suspense, newFallback);
8466
8835
  }
@@ -8472,12 +8841,16 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
8472
8841
  suspense.activeBranch = pendingBranch;
8473
8842
  } else unmount(pendingBranch, parentComponent, suspense);
8474
8843
  suspense.deps = 0;
8844
+ for (let i = 0; i < suspense.effects.length; i++) {
8845
+ const effect = suspense.effects[i];
8846
+ if (effect.flags & 8) queuePostFlushCb(effect);
8847
+ }
8475
8848
  suspense.effects.length = 0;
8476
8849
  suspense.hiddenContainer = createElement("div");
8477
8850
  if (isInFallback) {
8478
8851
  patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized);
8479
8852
  if (suspense.deps <= 0) suspense.resolve();
8480
- else {
8853
+ else if (!suspense.isFallbackMountPending) {
8481
8854
  patch(activeBranch, newFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
8482
8855
  setActiveBranch(suspense, newFallback);
8483
8856
  }
@@ -8553,15 +8926,19 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
8553
8926
  if (suspense.isHydrating) suspense.isHydrating = false;
8554
8927
  else if (!resume) {
8555
8928
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
8929
+ let hasUpdatedAnchor = false;
8556
8930
  if (delayEnter) activeBranch.transition.afterLeave = () => {
8557
8931
  if (pendingId === suspense.pendingId) {
8558
- move(pendingBranch, container, anchor === initialAnchor ? next(activeBranch) : anchor, 0, parentComponent);
8932
+ move(pendingBranch, container, anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor, 0, parentComponent);
8559
8933
  queuePostFlushCb(effects);
8560
8934
  if (isInFallback && vnode.ssFallback) vnode.ssFallback.el = null;
8561
8935
  }
8562
8936
  };
8563
8937
  if (activeBranch && !suspense.isFallbackMountPending) {
8564
- if (parentNode(activeBranch.el) === container) anchor = next(activeBranch);
8938
+ if (parentNode(activeBranch.el) === container) {
8939
+ anchor = next(activeBranch);
8940
+ hasUpdatedAnchor = true;
8941
+ }
8565
8942
  unmount(activeBranch, parentComponent, suspense, true);
8566
8943
  if (!delayEnter && isInFallback && vnode.ssFallback) queuePostRenderEffect(() => vnode.ssFallback.el = null, void 0, suspense);
8567
8944
  }
@@ -8575,7 +8952,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
8575
8952
  let hasUnresolvedAncestor = false;
8576
8953
  while (parent) {
8577
8954
  if (parent.pendingBranch) {
8578
- parent.effects.push(...effects);
8955
+ for (let i = 0; i < effects.length; i++) parent.effects.push(effects[i]);
8579
8956
  hasUnresolvedAncestor = true;
8580
8957
  break;
8581
8958
  }
@@ -8585,6 +8962,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
8585
8962
  suspense.effects = [];
8586
8963
  if (isSuspensible) {
8587
8964
  if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
8965
+ parentSuspenseId = void 0;
8588
8966
  parentSuspense.deps--;
8589
8967
  if (parentSuspense.deps === 0 && !sync) parentSuspense.resolve();
8590
8968
  }
@@ -8599,8 +8977,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
8599
8977
  const mountFallback = () => {
8600
8978
  suspense.isFallbackMountPending = false;
8601
8979
  if (!suspense.isInFallback) return;
8602
- patch(null, fallbackVNode, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
8603
- setActiveBranch(suspense, fallbackVNode);
8980
+ const latestFallback = suspense.vnode.ssFallback;
8981
+ patch(null, latestFallback, container, anchor, parentComponent, null, namespace, slotScopeIds, optimized);
8982
+ setActiveBranch(suspense, latestFallback);
8604
8983
  };
8605
8984
  const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
8606
8985
  if (delayEnter) {
@@ -8621,10 +9000,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
8621
9000
  registerDep(instance, onResolve) {
8622
9001
  const isInPendingSuspense = !!suspense.pendingBranch;
8623
9002
  if (isInPendingSuspense) suspense.deps++;
9003
+ const hydratedEl = instance.vnode && instance.vnode.el;
8624
9004
  instance.asyncDep.catch((err) => {
8625
9005
  handleError(err, instance, 0);
8626
9006
  }).then((asyncSetupResult) => {
8627
9007
  if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) return;
9008
+ setCurrentInstance(null, void 0);
9009
+ if (hydratedEl && !instance.scope.active) {
9010
+ if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
9011
+ return;
9012
+ }
8628
9013
  instance.asyncResolved = true;
8629
9014
  onResolve(asyncSetupResult);
8630
9015
  if (isInPendingSuspense && --suspense.deps === 0) suspense.resolve();
@@ -8675,9 +9060,10 @@ function normalizeSuspenseSlot(s) {
8675
9060
  return s;
8676
9061
  }
8677
9062
  function queueEffectWithSuspense(fn, id, suspense) {
8678
- if (suspense && suspense.pendingBranch) if (isArray(fn)) suspense.effects.push(...fn);
8679
- else suspense.effects.push(fn);
8680
- else queuePostFlushCb(fn, id);
9063
+ if (suspense && suspense.pendingBranch) {
9064
+ if (isArray(fn)) suspense.effects.push(...fn);
9065
+ else suspense.effects.push(fn);
9066
+ } else queuePostFlushCb(fn, id);
8681
9067
  }
8682
9068
  function setActiveBranch(suspense, branch) {
8683
9069
  suspense.activeBranch = branch;
@@ -8884,11 +9270,26 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
8884
9270
  if (shapeFlag & 128) type.normalize(vnode);
8885
9271
  } else if (children) vnode.shapeFlag |= isString(children) ? 8 : 16;
8886
9272
  if (vnode.key !== vnode.key) warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
9273
+ if (props && vnode.shapeFlag & 1) {
9274
+ const overwritingProp = props.innerHTML != null ? "innerHTML" : props.textContent != null ? "textContent" : null;
9275
+ if (overwritingProp && hasContentChildren(vnode.children)) warn$1(`The \`${overwritingProp}\` prop on <${vnode.type}> will override its children. Remove either the \`${overwritingProp}\` prop or the children.`);
9276
+ }
8887
9277
  if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) currentBlock.push(vnode);
8888
9278
  convertLegacyVModelProps(vnode);
8889
9279
  defineLegacyVNodeProperties(vnode);
8890
9280
  return vnode;
8891
9281
  }
9282
+ /**
9283
+ * dev only
9284
+ * Whether children would actually render something. Empty text and empty
9285
+ * arrays are ignored, mirroring the compiler's `node.children.length` check
9286
+ * for `v-html` / `v-text`.
9287
+ */
9288
+ function hasContentChildren(children) {
9289
+ if (isString(children)) return children !== "";
9290
+ if (isArray(children)) return children.length > 0;
9291
+ return false;
9292
+ }
8892
9293
  const createVNode = createVNodeWithArgsTransform;
8893
9294
  function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
8894
9295
  if (!type || type === NULL_DYNAMIC_COMPONENT) {
@@ -8898,8 +9299,10 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
8898
9299
  if (isVNode(type)) {
8899
9300
  const cloned = cloneVNode(type, props, true);
8900
9301
  if (children) normalizeChildren(cloned, children);
8901
- if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
8902
- else currentBlock.push(cloned);
9302
+ if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
9303
+ if (cloned.shapeFlag & 6) currentBlock[currentBlock.indexOf(type)] = cloned;
9304
+ else currentBlock.push(cloned);
9305
+ }
8903
9306
  cloned.patchFlag = -2;
8904
9307
  return cloned;
8905
9308
  }
@@ -8957,12 +9360,32 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
8957
9360
  el: vnode.el,
8958
9361
  anchor: vnode.anchor,
8959
9362
  ctx: vnode.ctx,
8960
- ce: vnode.ce
9363
+ ce: vnode.ce,
9364
+ vi: vnode.vi,
9365
+ vs: cloneVaporSlotMeta(vnode),
9366
+ vb: vnode.vb,
9367
+ ibu: vnode.ibu,
9368
+ iu: vnode.iu,
9369
+ cacheIndex: vnode.cacheIndex
8961
9370
  };
8962
9371
  if (transition && cloneTransition) setTransitionHooks(cloned, transition.clone(cloned));
8963
9372
  defineLegacyVNodeProperties(cloned);
8964
9373
  return cloned;
8965
9374
  }
9375
+ function cloneVaporSlotMeta(vnode) {
9376
+ const vaporSlot = vnode.vs;
9377
+ if (!vaporSlot) return vaporSlot;
9378
+ const cloned = {
9379
+ slot: vaporSlot.slot,
9380
+ outlets: vaporSlot.outlets
9381
+ };
9382
+ if (vnode.el) {
9383
+ cloned.state = vaporSlot.state;
9384
+ cloned.ref = vaporSlot.ref;
9385
+ cloned.scope = vaporSlot.scope;
9386
+ }
9387
+ return cloned;
9388
+ }
8966
9389
  /**
8967
9390
  * Dev only, for HMR of hoisted vnodes reused in v-for
8968
9391
  * https://github.com/vitejs/vite/issues/2022
@@ -9006,25 +9429,32 @@ function normalizeChildren(vnode, children) {
9006
9429
  const { shapeFlag } = vnode;
9007
9430
  if (children == null) children = null;
9008
9431
  else if (isArray(children)) type = 16;
9009
- else if (typeof children === "object") if (shapeFlag & 65) {
9010
- const slot = children.default;
9011
- if (slot) {
9012
- slot._c && (slot._d = false);
9013
- normalizeChildren(vnode, slot());
9014
- slot._c && (slot._d = true);
9432
+ else if (typeof children === "object") {
9433
+ if (shapeFlag & 65) {
9434
+ const slot = children.default;
9435
+ if (slot) {
9436
+ slot._c && (slot._d = false);
9437
+ normalizeChildren(vnode, slot());
9438
+ slot._c && (slot._d = true);
9439
+ }
9440
+ return;
9441
+ } else {
9442
+ type = 32;
9443
+ const slotFlag = children._;
9444
+ if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
9445
+ else if (slotFlag === 3 && currentRenderingInstance) {
9446
+ if (currentRenderingInstance.slots._ === 1) children._ = 1;
9447
+ else {
9448
+ children._ = 2;
9449
+ vnode.patchFlag |= 1024;
9450
+ }
9451
+ }
9015
9452
  }
9016
- return;
9017
- } else {
9018
- type = 32;
9019
- const slotFlag = children._;
9020
- if (!slotFlag && !isInternalObject(children)) children._ctx = currentRenderingInstance;
9021
- else if (slotFlag === 3 && currentRenderingInstance) if (currentRenderingInstance.slots._ === 1) children._ = 1;
9022
- else {
9023
- children._ = 2;
9024
- vnode.patchFlag |= 1024;
9453
+ } else if (isFunction(children)) {
9454
+ if (shapeFlag & 65) {
9455
+ normalizeChildren(vnode, { default: children });
9456
+ return;
9025
9457
  }
9026
- }
9027
- else if (isFunction(children)) {
9028
9458
  children = {
9029
9459
  default: children,
9030
9460
  _ctx: currentRenderingInstance
@@ -9088,6 +9518,16 @@ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope
9088
9518
  simpleSetCurrentInstance(instance);
9089
9519
  }
9090
9520
  };
9521
+ /**
9522
+ * Restores a snapshot returned by {@link setCurrentInstance}. Unlike calling
9523
+ * `setCurrentInstance(...prev)`, an `undefined` saved scope is restored
9524
+ * verbatim instead of re-triggering the `instance.scope` default.
9525
+ * @internal
9526
+ */
9527
+ const restoreCurrentInstance = (prev) => {
9528
+ setCurrentScope(prev[1]);
9529
+ simpleSetCurrentInstance(prev[0]);
9530
+ };
9091
9531
  const internalOptions = [
9092
9532
  "ce",
9093
9533
  "type",
@@ -9119,7 +9559,7 @@ const useInstanceOption = (key, silent = false) => {
9119
9559
  };
9120
9560
  //#endregion
9121
9561
  //#region packages/runtime-core/src/component.ts
9122
- const emptyAppContext = /* @__PURE__ */ createAppContext();
9562
+ const emptyAppContext = /*@__PURE__*/ createAppContext();
9123
9563
  let uid = 0;
9124
9564
  function createComponentInstance(vnode, parent, suspense) {
9125
9565
  const type = vnode.type;
@@ -9239,7 +9679,7 @@ function setupStatefulComponent(instance, isSSR) {
9239
9679
  const setupResult = callWithErrorHandling(setup, instance, 0, [/* @__PURE__ */ shallowReadonly(instance.props), setupContext]);
9240
9680
  const isAsyncSetup = isPromise(setupResult);
9241
9681
  setActiveSub(prevSub);
9242
- setCurrentInstance(...prev);
9682
+ restoreCurrentInstance(prev);
9243
9683
  if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) markAsyncBoundary(instance);
9244
9684
  if (isAsyncSetup) {
9245
9685
  const unsetCurrentInstance = () => {
@@ -9247,7 +9687,12 @@ function setupStatefulComponent(instance, isSSR) {
9247
9687
  };
9248
9688
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
9249
9689
  if (isSSR) return setupResult.then((resolvedResult) => {
9250
- handleSetupResult(instance, resolvedResult, isSSR);
9690
+ setInSSRSetupState(true);
9691
+ try {
9692
+ handleSetupResult(instance, resolvedResult, isSSR);
9693
+ } finally {
9694
+ setInSSRSetupState(false);
9695
+ }
9251
9696
  }).catch((e) => {
9252
9697
  handleError(e, instance, 0);
9253
9698
  });
@@ -9312,13 +9757,15 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
9312
9757
  applyOptions(instance);
9313
9758
  } finally {
9314
9759
  setActiveSub(prevSub);
9315
- setCurrentInstance(...prevInstance);
9760
+ restoreCurrentInstance(prevInstance);
9316
9761
  }
9317
9762
  }
9318
- if (!Component.render && instance.render === NOOP && !isSSR) if (!compile$1 && Component.template)
9763
+ if (!Component.render && instance.render === NOOP && !isSSR) {
9764
+ if (!compile$1 && Component.template)
9319
9765
  /* v8 ignore start */
9320
- warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.esm-browser.js\" instead.");
9321
- else warn$1(`Component is missing template or render function: `, Component);
9766
+ warn$1("Component provided template option but runtime compilation is not supported in this build of Vue. Use \"vue.esm-browser.js\" instead.");
9767
+ else warn$1(`Component is missing template or render function: `, Component);
9768
+ }
9322
9769
  }
9323
9770
  const attrsProxyHandlers = {
9324
9771
  get(target, key) {
@@ -9381,14 +9828,13 @@ function getComponentPublicInstance(instance) {
9381
9828
  if (instance.exposed) return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
9382
9829
  get(target, key) {
9383
9830
  if (key in target) return target[key];
9384
- else {
9831
+ else if (!instance.vapor) {
9385
9832
  const publicPropertiesMap = getPublicPropertiesMap();
9386
9833
  if (key in publicPropertiesMap) return publicPropertiesMap[key](instance);
9387
9834
  }
9388
9835
  },
9389
9836
  has(target, key) {
9390
- const publicPropertiesMap = getPublicPropertiesMap();
9391
- return key in target || key in publicPropertiesMap;
9837
+ return key in target || !instance.vapor && key in getPublicPropertiesMap();
9392
9838
  }
9393
9839
  }));
9394
9840
  else return instance.proxy;
@@ -9426,11 +9872,12 @@ function h(type, propsOrChildren, children) {
9426
9872
  try {
9427
9873
  setBlockTracking(-1);
9428
9874
  const l = arguments.length;
9429
- if (l === 2) if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
9430
- if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
9431
- return createVNode(type, propsOrChildren);
9432
- } else return createVNode(type, null, propsOrChildren);
9433
- else {
9875
+ if (l === 2) {
9876
+ if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
9877
+ if (isVNode(propsOrChildren)) return createVNode(type, null, [propsOrChildren]);
9878
+ return createVNode(type, propsOrChildren);
9879
+ } else return createVNode(type, null, propsOrChildren);
9880
+ } else {
9434
9881
  if (l > 3) children = Array.prototype.slice.call(arguments, 2);
9435
9882
  else if (l === 3 && isVNode(children)) children = [children];
9436
9883
  return createVNode(type, propsOrChildren, children);
@@ -9622,7 +10069,7 @@ function isMemoSame(cached, memo) {
9622
10069
  }
9623
10070
  //#endregion
9624
10071
  //#region packages/runtime-core/src/index.ts
9625
- const version = "3.6.0-beta.9";
10072
+ const version = "3.6.0-rc.10";
9626
10073
  const warn = warn$1;
9627
10074
  /**
9628
10075
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -9656,7 +10103,7 @@ const DeprecationTypes = DeprecationTypes$1;
9656
10103
  let policy = void 0;
9657
10104
  const tt = typeof window !== "undefined" && window.trustedTypes;
9658
10105
  if (tt) try {
9659
- policy = /* @__PURE__ */ tt.createPolicy("vue", { createHTML: (val) => val });
10106
+ policy = /*@__PURE__*/ tt.createPolicy("vue", { createHTML: (val) => val });
9660
10107
  } catch (e) {
9661
10108
  warn(`Error creating trusted types policy: ${e}`);
9662
10109
  }
@@ -9664,7 +10111,7 @@ const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) =>
9664
10111
  const svgNS = "http://www.w3.org/2000/svg";
9665
10112
  const mathmlNS = "http://www.w3.org/1998/Math/MathML";
9666
10113
  const doc = typeof document !== "undefined" ? document : null;
9667
- const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
10114
+ const templateContainer = doc && /*@__PURE__*/ doc.createElement("template");
9668
10115
  const nodeOps = {
9669
10116
  insert: (child, parent, anchor) => {
9670
10117
  parent.insertBefore(child, anchor || null);
@@ -9738,7 +10185,7 @@ const DOMTransitionPropsValidators = {
9738
10185
  leaveActiveClass: String,
9739
10186
  leaveToClass: String
9740
10187
  };
9741
- const TransitionPropsValidators = /* @__PURE__ */ extend({}, BaseTransitionPropsValidators, DOMTransitionPropsValidators);
10188
+ const TransitionPropsValidators = /*@__PURE__*/ extend({}, BaseTransitionPropsValidators, DOMTransitionPropsValidators);
9742
10189
  /**
9743
10190
  * Wrap logic that attaches extra properties to Transition in a function
9744
10191
  * so that it can be annotated as pure
@@ -9753,7 +10200,7 @@ const decorate$1 = (t) => {
9753
10200
  * DOM Transition is a higher-order-component based on the platform-agnostic
9754
10201
  * base Transition component, with DOM-specific logic.
9755
10202
  */
9756
- const Transition = /* @__PURE__ */ decorate$1((props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots));
10203
+ const Transition = /*@__PURE__*/ decorate$1((props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots));
9757
10204
  /**
9758
10205
  * #3227 Incoming hooks may be merged into arrays when wrapping Transition
9759
10206
  * with custom HOCs.
@@ -9993,14 +10440,15 @@ const vShow = {
9993
10440
  },
9994
10441
  updated(el, { value, oldValue }, { transition }) {
9995
10442
  if (!value === !oldValue) return;
9996
- if (transition) if (value) {
9997
- transition.beforeEnter(el);
9998
- setDisplay(el, true);
9999
- transition.enter(el);
10000
- } else transition.leave(el, () => {
10001
- setDisplay(el, false);
10002
- });
10003
- else setDisplay(el, value);
10443
+ if (transition) {
10444
+ if (value) {
10445
+ transition.beforeEnter(el);
10446
+ setDisplay(el, true);
10447
+ transition.enter(el);
10448
+ } else transition.leave(el, () => {
10449
+ setDisplay(el, false);
10450
+ });
10451
+ } else setDisplay(el, value);
10004
10452
  },
10005
10453
  beforeUnmount(el, { value }) {
10006
10454
  setDisplay(el, value);
@@ -10019,49 +10467,20 @@ const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT");
10019
10467
  */
10020
10468
  function useCssVars(getter) {
10021
10469
  const instance = getCurrentInstance();
10022
- const getVars = () => getter(instance.proxy);
10023
- const setVars = (vars) => {
10024
- if (instance.ce) setVarsOnNode(instance.ce, vars);
10025
- else setVarsOnVNode(instance.subTree, vars);
10026
- };
10027
- baseUseCssVars(instance, () => instance.subTree.el.parentNode, getVars, setVars);
10028
- }
10029
- function setVarsOnVNode(vnode, vars) {
10030
- if (vnode.shapeFlag & 128) {
10031
- const suspense = vnode.suspense;
10032
- vnode = suspense.activeBranch;
10033
- if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
10034
- setVarsOnVNode(suspense.activeBranch, vars);
10035
- });
10036
- }
10037
- while (vnode.component) vnode = vnode.component.subTree;
10038
- if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
10039
- else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
10040
- else if (vnode.type === Static) {
10041
- let { el, anchor } = vnode;
10042
- while (el) {
10043
- setVarsOnNode(el, vars);
10044
- if (el === anchor) break;
10045
- el = el.nextSibling;
10046
- }
10047
- }
10048
- }
10049
- /**
10050
- * @internal
10051
- * shared between vdom and vapor
10052
- */
10053
- function baseUseCssVars(instance, getParentNode, getVars, setVars) {
10054
10470
  /* v8 ignore start */
10055
10471
  if (!instance) {
10056
10472
  warn(`useCssVars is called without current active component instance.`);
10057
10473
  return;
10058
10474
  }
10475
+ /* v8 ignore stop */
10476
+ const getVars = () => getter(instance.proxy);
10059
10477
  instance.getCssVars = getVars;
10060
10478
  const updateTeleports = instance.ut = (vars = getVars()) => {
10061
10479
  Array.from(document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)).forEach((node) => setVarsOnNode(node, vars));
10062
10480
  };
10063
10481
  const applyCssVars = (vars = getVars()) => {
10064
- setVars(vars);
10482
+ if (instance.ce) setVarsOnNode(instance.ce, vars);
10483
+ else setVarsOnVNode(instance.subTree, vars);
10065
10484
  updateTeleports(vars);
10066
10485
  };
10067
10486
  onBeforeUpdate(() => {
@@ -10074,10 +10493,38 @@ function baseUseCssVars(instance, getParentNode, getVars, setVars) {
10074
10493
  applyCssVars(vars);
10075
10494
  }, NOOP, { flush: "post" });
10076
10495
  const ob = new MutationObserver(() => applyCssVars());
10077
- ob.observe(getParentNode(), { childList: true });
10496
+ ob.observe(instance.subTree.el.parentNode, { childList: true });
10078
10497
  onUnmounted(() => ob.disconnect());
10079
10498
  });
10080
10499
  }
10500
+ function setVarsOnVNode(vnode, vars) {
10501
+ if (vnode.shapeFlag & 128) {
10502
+ const suspense = vnode.suspense;
10503
+ vnode = suspense.activeBranch;
10504
+ if (suspense.pendingBranch && !suspense.isHydrating) suspense.effects.push(() => {
10505
+ setVarsOnVNode(suspense.activeBranch, vars);
10506
+ });
10507
+ }
10508
+ while (vnode.component) {
10509
+ const component = vnode.component;
10510
+ if (component.vapor) {
10511
+ component.appContext.vapor.applyCssVars(vnode, vars);
10512
+ return;
10513
+ }
10514
+ vnode = vnode.component.subTree;
10515
+ }
10516
+ if (vnode.shapeFlag & 1 && vnode.el) setVarsOnNode(vnode.el, vars);
10517
+ else if (vnode.vb) vnode.ctx.appContext.vapor.applyCssVars(vnode, vars);
10518
+ else if (vnode.type === Fragment) vnode.children.forEach((c) => setVarsOnVNode(c, vars));
10519
+ else if (vnode.type === Static) {
10520
+ let { el, anchor } = vnode;
10521
+ while (el) {
10522
+ setVarsOnNode(el, vars);
10523
+ if (el === anchor) break;
10524
+ el = el.nextSibling;
10525
+ }
10526
+ }
10527
+ }
10081
10528
  /**
10082
10529
  * @internal
10083
10530
  * shared between vdom and vapor
@@ -10102,15 +10549,20 @@ function patchStyle(el, prev, next) {
10102
10549
  const isCssString = isString(next);
10103
10550
  let hasControlledDisplay = false;
10104
10551
  if (next && !isCssString) {
10105
- if (prev) if (!isString(prev)) {
10106
- for (const key in prev) if (next[key] == null) setStyle(style, key, "");
10107
- } else for (const prevStyle of prev.split(";")) {
10108
- const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
10109
- if (next[key] == null) setStyle(style, key, "");
10552
+ if (prev) {
10553
+ if (!isString(prev)) {
10554
+ for (const key in prev) if (next[key] == null) setStyle(style, key, "");
10555
+ } else for (const prevStyle of prev.split(";")) {
10556
+ const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
10557
+ if (next[key] == null) setStyle(style, key, "");
10558
+ }
10110
10559
  }
10111
10560
  for (const key in next) {
10112
10561
  if (key === "display") hasControlledDisplay = true;
10113
- setStyle(style, key, next[key]);
10562
+ const value = next[key];
10563
+ if (value != null) {
10564
+ if (!shouldPreserveTextareaResizeStyle(el, key, !isString(prev) && prev ? prev[key] : void 0, value)) setStyle(style, key, value);
10565
+ } else setStyle(style, key, "");
10114
10566
  }
10115
10567
  } else if (isCssString) {
10116
10568
  if (prev !== next) {
@@ -10119,7 +10571,11 @@ function patchStyle(el, prev, next) {
10119
10571
  style.cssText = next;
10120
10572
  hasControlledDisplay = displayRE.test(next);
10121
10573
  }
10122
- } else if (prev) el.removeAttribute("style");
10574
+ } else if (prev) {
10575
+ const cssVarText = style[CSS_VAR_TEXT];
10576
+ if (cssVarText) style.cssText = cssVarText;
10577
+ else el.removeAttribute("style");
10578
+ }
10123
10579
  if (vShowOriginalDisplay in el) {
10124
10580
  el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
10125
10581
  if (el[vShowHidden]) style.display = "none";
@@ -10132,8 +10588,10 @@ function setStyle(style, name, rawVal) {
10132
10588
  else {
10133
10589
  const val = rawVal == null ? "" : String(rawVal);
10134
10590
  if (semicolonRE.test(val)) warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
10135
- if (name.startsWith("--")) style.setProperty(name, val);
10136
- else {
10591
+ if (name.startsWith("--")) {
10592
+ if (importantRE.test(val)) style.setProperty(name, val.replace(importantRE, ""), "important");
10593
+ else style.setProperty(name, val);
10594
+ } else {
10137
10595
  const prefixed = autoPrefix(style, name);
10138
10596
  if (importantRE.test(val)) style.setProperty(hyphenate(prefixed), val.replace(importantRE, ""), "important");
10139
10597
  else style[prefixed] = val;
@@ -10158,19 +10616,28 @@ function autoPrefix(style, rawName) {
10158
10616
  }
10159
10617
  return rawName;
10160
10618
  }
10619
+ /**
10620
+ * Browsers update textarea width/height directly during native resize.
10621
+ * Only special-case this common textarea path for now; other resize scenarios
10622
+ * still follow normal vnode style patching.
10623
+ */
10624
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
10625
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
10626
+ }
10161
10627
  //#endregion
10162
10628
  //#region packages/runtime-dom/src/modules/attrs.ts
10163
10629
  const xlinkNS = "http://www.w3.org/1999/xlink";
10164
10630
  function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
10165
- if (isSVG && key.startsWith("xlink:")) if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
10166
- else el.setAttributeNS(xlinkNS, key, value);
10167
- else {
10631
+ if (isSVG && key.startsWith("xlink:")) {
10632
+ if (value == null) el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
10633
+ else el.setAttributeNS(xlinkNS, key, value);
10634
+ } else {
10168
10635
  if (compatCoerceAttr(el, key, value, instance)) return;
10169
10636
  if (value == null || isBoolean && !includeBooleanAttr(value)) el.removeAttribute(key);
10170
10637
  else el.setAttribute(key, isBoolean ? "" : isSymbol(value) ? String(value) : value);
10171
10638
  }
10172
10639
  }
10173
- const isEnumeratedAttr = /* @__PURE__ */ makeMap("contenteditable,draggable,spellcheck");
10640
+ const isEnumeratedAttr = /*@__PURE__*/ makeMap("contenteditable,draggable,spellcheck");
10174
10641
  function compatCoerceAttr(el, key, value, instance = null) {
10175
10642
  if (isEnumeratedAttr(key)) {
10176
10643
  const v2CoercedValue = value === void 0 ? null : value === null || value === false || value === "false" ? "false" : "true";
@@ -10241,7 +10708,7 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
10241
10708
  const existingInvoker = invokers[rawName];
10242
10709
  if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
10243
10710
  else {
10244
- const [name, options] = parseName(rawName);
10711
+ const [name, options] = parseEventName(rawName);
10245
10712
  if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
10246
10713
  else if (existingInvoker) {
10247
10714
  removeEventListener(el, name, existingInvoker, options);
@@ -10249,27 +10716,40 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
10249
10716
  }
10250
10717
  }
10251
10718
  }
10252
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
10253
- function parseName(name) {
10719
+ const optionsModifierRE = /(Once|Passive|Capture)$/;
10720
+ const optionsModifierEventRE = /^on:?(?:Once|Passive|Capture)$/;
10721
+ function parseEventName(name) {
10254
10722
  let options;
10255
- if (optionsModifierRE.test(name)) {
10256
- options = {};
10257
- let m;
10258
- while (m = name.match(optionsModifierRE)) {
10259
- name = name.slice(0, name.length - m[0].length);
10260
- options[m[0].toLowerCase()] = true;
10261
- }
10723
+ let m;
10724
+ while ((m = name.match(optionsModifierRE)) && !optionsModifierEventRE.test(name)) {
10725
+ if (!options) options = {};
10726
+ name = name.slice(0, name.length - m[1].length);
10727
+ options[m[1].toLowerCase()] = true;
10262
10728
  }
10263
10729
  return [name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)), options];
10264
10730
  }
10265
10731
  let cachedNow = 0;
10266
- const p = /* @__PURE__ */ Promise.resolve();
10732
+ const p = /*@__PURE__*/ Promise.resolve();
10267
10733
  const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
10268
10734
  function createInvoker(initialValue, instance) {
10269
10735
  const invoker = (e) => {
10270
10736
  if (!e._vts) e._vts = Date.now();
10271
10737
  else if (e._vts <= invoker.attached) return;
10272
- callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5, [e]);
10738
+ const value = invoker.value;
10739
+ if (isArray(value)) {
10740
+ const originalStop = e.stopImmediatePropagation;
10741
+ e.stopImmediatePropagation = () => {
10742
+ originalStop.call(e);
10743
+ e._stopped = true;
10744
+ };
10745
+ const handlers = value.slice();
10746
+ const args = [e];
10747
+ for (let i = 0; i < handlers.length; i++) {
10748
+ if (e._stopped) break;
10749
+ const handler = handlers[i];
10750
+ if (handler) callWithAsyncErrorHandling(handler, instance, 5, args);
10751
+ }
10752
+ } else callWithAsyncErrorHandling(value, instance, 5, [e]);
10273
10753
  };
10274
10754
  invoker.value = initialValue;
10275
10755
  invoker.attached = getNow();
@@ -10280,16 +10760,6 @@ function sanitizeEventValue(value, propName) {
10280
10760
  warn(`Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?\nExpected function or array of functions, received type ${typeof value}.`);
10281
10761
  return NOOP;
10282
10762
  }
10283
- function patchStopImmediatePropagation(e, value) {
10284
- if (isArray(value)) {
10285
- const originalStop = e.stopImmediatePropagation;
10286
- e.stopImmediatePropagation = () => {
10287
- originalStop.call(e);
10288
- e._stopped = true;
10289
- };
10290
- return value.map((fn) => (e) => !e._stopped && fn && fn(e));
10291
- } else return value;
10292
- }
10293
10763
  //#endregion
10294
10764
  //#region packages/runtime-dom/src/patchProp.ts
10295
10765
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
@@ -10327,7 +10797,7 @@ function shouldSetAsPropForVueCE(el, key) {
10327
10797
  //#endregion
10328
10798
  //#region packages/runtime-dom/src/apiCustomElement.ts
10329
10799
  const REMOVAL = {};
10330
- /* @__NO_SIDE_EFFECTS__ */
10800
+ /*@__NO_SIDE_EFFECTS__*/
10331
10801
  function defineCustomElement(options, extraOptions, _createApp) {
10332
10802
  let Comp = /* @__PURE__ */ defineComponent(options, extraOptions);
10333
10803
  if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
@@ -10376,12 +10846,14 @@ var VueElementBase = class VueElementBase extends BaseClass {
10376
10846
  this._parent = parent;
10377
10847
  break;
10378
10848
  }
10379
- if (!this._instance) if (this._resolved) this._mountComponent(this._def);
10380
- else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
10381
- this._pendingResolve = void 0;
10382
- this._resolveDef();
10383
- });
10384
- else this._resolveDef();
10849
+ if (!this._instance) {
10850
+ if (this._resolved) this._mountComponent(this._def);
10851
+ else if (parent && parent._pendingResolve) this._pendingResolve = parent._pendingResolve.then(() => {
10852
+ this._pendingResolve = void 0;
10853
+ if (this.isConnected) return this._resolveDef();
10854
+ });
10855
+ else this._resolveDef();
10856
+ }
10385
10857
  }
10386
10858
  disconnectedCallback() {
10387
10859
  this._connected = false;
@@ -10415,7 +10887,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
10415
10887
  * resolve inner component definition (handle possible async component)
10416
10888
  */
10417
10889
  _resolveDef() {
10418
- if (this._pendingResolve) return;
10890
+ if (this._pendingResolve) return this._pendingResolve;
10419
10891
  for (let i = 0; i < this.attributes.length; i++) this._setAttr(this.attributes[i].name);
10420
10892
  this._ob = new MutationObserver(this._processMutations.bind(this));
10421
10893
  this._ob.observe(this, { attributes: true });
@@ -10445,6 +10917,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
10445
10917
  this._def = def;
10446
10918
  resolve(def);
10447
10919
  });
10920
+ return this._pendingResolve;
10448
10921
  } else resolve(this._def);
10449
10922
  }
10450
10923
  _mountComponent(def) {
@@ -10483,14 +10956,17 @@ var VueElementBase = class VueElementBase extends BaseClass {
10483
10956
  const { props } = def;
10484
10957
  const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
10485
10958
  for (const key of Object.keys(this)) if (key[0] !== "_" && declaredPropKeys.includes(key)) this._setProp(key, this[key]);
10486
- for (const key of declaredPropKeys.map(camelize)) Object.defineProperty(this, key, {
10487
- get() {
10488
- return this._getProp(key);
10489
- },
10490
- set(val) {
10491
- this._setProp(key, val, true, !this._patching);
10492
- }
10493
- });
10959
+ for (const key of declaredPropKeys.map(camelize)) {
10960
+ if (key in Object.getPrototypeOf(this)) warn(`Custom element prop "${key}" conflicts with an existing property on the element and will overwrite it.`);
10961
+ Object.defineProperty(this, key, {
10962
+ get() {
10963
+ return this._getProp(key);
10964
+ },
10965
+ set(val) {
10966
+ this._setProp(key, val, true, !this._patching);
10967
+ }
10968
+ });
10969
+ }
10494
10970
  }
10495
10971
  _setAttr(key) {
10496
10972
  if (key.startsWith("data-v-")) return;
@@ -10593,13 +11069,11 @@ var VueElementBase = class VueElementBase extends BaseClass {
10593
11069
  _renderSlots() {
10594
11070
  const outlets = this._getSlots();
10595
11071
  const scopeId = this._instance.type.__scopeId;
10596
- const slotReplacements = /* @__PURE__ */ new Map();
10597
11072
  for (let i = 0; i < outlets.length; i++) {
10598
11073
  const o = outlets[i];
10599
11074
  const slotName = o.getAttribute("name") || "default";
10600
11075
  const content = this._slots[slotName];
10601
11076
  const parent = o.parentNode;
10602
- const replacementNodes = [];
10603
11077
  if (content) for (const n of content) {
10604
11078
  if (scopeId && n.nodeType === 1) {
10605
11079
  const id = scopeId + "-s";
@@ -10609,17 +11083,10 @@ var VueElementBase = class VueElementBase extends BaseClass {
10609
11083
  while (child = walker.nextNode()) child.setAttribute(id, "");
10610
11084
  }
10611
11085
  parent.insertBefore(n, o);
10612
- replacementNodes.push(n);
10613
- }
10614
- else while (o.firstChild) {
10615
- const child = o.firstChild;
10616
- parent.insertBefore(child, o);
10617
- replacementNodes.push(child);
10618
11086
  }
11087
+ else while (o.firstChild) parent.insertBefore(o.firstChild, o);
10619
11088
  parent.removeChild(o);
10620
- slotReplacements.set(o, replacementNodes);
10621
11089
  }
10622
- this._updateSlotNodes(slotReplacements);
10623
11090
  }
10624
11091
  /**
10625
11092
  * @internal
@@ -10658,7 +11125,7 @@ var VueElementBase = class VueElementBase extends BaseClass {
10658
11125
  * @internal
10659
11126
  */
10660
11127
  _hasShadowRoot() {
10661
- return this._def.shadowRoot !== false;
11128
+ return this._root !== this;
10662
11129
  }
10663
11130
  /**
10664
11131
  * @internal
@@ -10703,10 +11170,6 @@ var VueElement = class extends VueElementBase {
10703
11170
  if (this._instance && this._instance.ce) this._instance.ce = void 0;
10704
11171
  this._app = this._instance = null;
10705
11172
  }
10706
- /**
10707
- * Only called when shadowRoot is false
10708
- */
10709
- _updateSlotNodes(replacements) {}
10710
11173
  _createVNode() {
10711
11174
  const baseProps = {};
10712
11175
  if (!this.shadowRoot) baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
@@ -10773,7 +11236,7 @@ const decorate = (t) => {
10773
11236
  };
10774
11237
  const TransitionGroup = /* @__PURE__ */ decorate({
10775
11238
  name: "TransitionGroup",
10776
- props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
11239
+ props: /*@__PURE__*/ extend({}, TransitionPropsValidators, {
10777
11240
  tag: String,
10778
11241
  moveClass: String
10779
11242
  }),
@@ -10807,7 +11270,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
10807
11270
  prevChildren = [];
10808
11271
  if (children) for (let i = 0; i < children.length; i++) {
10809
11272
  const child = children[i];
10810
- if (child.el && child.el instanceof Element) {
11273
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
10811
11274
  prevChildren.push(child);
10812
11275
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
10813
11276
  positionMap.set(child, getPosition(child.el));
@@ -10905,13 +11368,22 @@ function onCompositionEnd(e) {
10905
11368
  }
10906
11369
  }
10907
11370
  const assignKey = Symbol("_assign");
11371
+ const initialValueKey = Symbol("_initialValue");
10908
11372
  const vModelText = {
10909
11373
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
11374
+ if (el.parentNode) {
11375
+ if (el.type === "text") el[initialValueKey] = el.defaultValue.replace(/[\r\n]/g, "");
11376
+ else if (el.type === "textarea") el[initialValueKey] = el.defaultValue.replace(/\r\n?/g, "\n");
11377
+ }
10910
11378
  el[assignKey] = getModelAssigner(vnode);
10911
11379
  vModelTextInit(el, trim, number || !!(vnode.props && vnode.props.type === "number"), lazy);
10912
11380
  },
10913
- mounted(el, { value }) {
10914
- el.value = value == null ? "" : value;
11381
+ mounted(el, { value, modifiers: { trim, number } }) {
11382
+ const newValue = value == null ? "" : value;
11383
+ const initialValue = el[initialValueKey];
11384
+ delete el[initialValueKey];
11385
+ if (initialValue !== void 0 && (el.type === "text" || el.type === "textarea") && el.value !== initialValue) el[assignKey](castValue(el.value, trim, number));
11386
+ else el.value = newValue;
10915
11387
  },
10916
11388
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
10917
11389
  el[assignKey] = getModelAssigner(vnode);
@@ -11031,7 +11503,8 @@ const vModelSelect = {
11031
11503
  mounted(el, { value }) {
11032
11504
  vModelSetSelected(el, value);
11033
11505
  },
11034
- beforeUpdate(el, _binding, vnode) {
11506
+ beforeUpdate(el, { value }, vnode) {
11507
+ el._modelValue = value;
11035
11508
  el[assignKey] = getModelAssigner(vnode);
11036
11509
  },
11037
11510
  updated(el, { value }) {
@@ -11042,21 +11515,42 @@ const vModelSelect = {
11042
11515
  * @internal
11043
11516
  */
11044
11517
  const vModelSelectInit = (el, value, number, set) => {
11045
- const isSetModel = isSet(value);
11518
+ el._modelValue = value;
11046
11519
  addEventListener(el, "change", () => {
11047
11520
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map((o) => number ? looseToNumber(getValue(o)) : getValue(o));
11048
- (set || el[assignKey])(el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]);
11049
- el._assigning = true;
11050
- nextTick(() => {
11051
- el._assigning = false;
11052
- });
11521
+ const multiple = el.multiple;
11522
+ const assignedValue = multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0];
11523
+ const pending = el._pendingValue = [multiple, multiple ? isArray(assignedValue) ? selectedVal.slice() : selectedVal : assignedValue];
11524
+ try {
11525
+ (set || el[assignKey])(assignedValue);
11526
+ } finally {
11527
+ nextTick(() => {
11528
+ if (el._pendingValue === pending) el._pendingValue = void 0;
11529
+ });
11530
+ }
11053
11531
  });
11054
11532
  };
11533
+ function isSameSelectValue(value, assignedValue, multiple) {
11534
+ if (!multiple) return looseEqual(value, assignedValue);
11535
+ if (isArray(value)) return looseEqual(value, assignedValue);
11536
+ if (isSet(value)) {
11537
+ if (value.size !== assignedValue.length) return false;
11538
+ for (const item of assignedValue) if (!value.has(item)) return false;
11539
+ return true;
11540
+ }
11541
+ return false;
11542
+ }
11055
11543
  /**
11056
11544
  * @internal
11057
11545
  */
11058
11546
  const vModelSetSelected = (el, value) => {
11059
- if (el._assigning) return;
11547
+ el._modelValue = value;
11548
+ const pending = el._pendingValue;
11549
+ el._pendingValue = void 0;
11550
+ if (pending && pending[0] === el.multiple && isSameSelectValue(value, pending[1], pending[0])) return;
11551
+ setSelected(el, value);
11552
+ };
11553
+ function setSelected(el, value) {
11060
11554
  const isMultiple = el.multiple;
11061
11555
  const isArrayValue = isArray(value);
11062
11556
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -11066,18 +11560,19 @@ const vModelSetSelected = (el, value) => {
11066
11560
  for (let i = 0, l = el.options.length; i < l; i++) {
11067
11561
  const option = el.options[i];
11068
11562
  const optionValue = getValue(option);
11069
- if (isMultiple) if (isArrayValue) {
11070
- const optionType = typeof optionValue;
11071
- if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
11072
- else option.selected = looseIndexOf(value, optionValue) > -1;
11073
- } else option.selected = value.has(optionValue);
11074
- else if (looseEqual(getValue(option), value)) {
11563
+ if (isMultiple) {
11564
+ if (isArrayValue) {
11565
+ const optionType = typeof optionValue;
11566
+ if (optionType === "string" || optionType === "number") option.selected = value.some((v) => String(v) === String(optionValue));
11567
+ else option.selected = looseIndexOf(value, optionValue) > -1;
11568
+ } else option.selected = value.has(optionValue);
11569
+ } else if (looseEqual(getValue(option), value)) {
11075
11570
  if (el.selectedIndex !== i) el.selectedIndex = i;
11076
11571
  return;
11077
11572
  }
11078
11573
  }
11079
11574
  if (!isMultiple && el.selectedIndex !== -1) el.selectedIndex = -1;
11080
- };
11575
+ }
11081
11576
  /**
11082
11577
  * @internal retrieve raw value set via :value bindings
11083
11578
  */
@@ -11373,7 +11868,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
11373
11868
  withModifiers: () => withModifiers,
11374
11869
  withScopeId: () => withScopeId
11375
11870
  });
11376
- const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
11871
+ const rendererOptions = /*@__PURE__*/ extend({ patchProp }, nodeOps);
11377
11872
  let renderer;
11378
11873
  let enabledHydration = false;
11379
11874
  function ensureRenderer() {
@@ -11924,13 +12419,14 @@ var Tokenizer = class {
11924
12419
  }
11925
12420
  }
11926
12421
  stateInterpolationOpen(c) {
11927
- if (c === this.delimiterOpen[this.delimiterIndex]) if (this.delimiterIndex === this.delimiterOpen.length - 1) {
11928
- const start = this.index + 1 - this.delimiterOpen.length;
11929
- if (start > this.sectionStart) this.cbs.ontext(this.sectionStart, start);
11930
- this.state = 3;
11931
- this.sectionStart = start;
11932
- } else this.delimiterIndex++;
11933
- else if (this.inRCDATA) {
12422
+ if (c === this.delimiterOpen[this.delimiterIndex]) {
12423
+ if (this.delimiterIndex === this.delimiterOpen.length - 1) {
12424
+ const start = this.index + 1 - this.delimiterOpen.length;
12425
+ if (start > this.sectionStart) this.cbs.ontext(this.sectionStart, start);
12426
+ this.state = 3;
12427
+ this.sectionStart = start;
12428
+ } else this.delimiterIndex++;
12429
+ } else if (this.inRCDATA) {
11934
12430
  this.state = 32;
11935
12431
  this.stateInRCDATA(c);
11936
12432
  } else {
@@ -11946,13 +12442,14 @@ var Tokenizer = class {
11946
12442
  }
11947
12443
  }
11948
12444
  stateInterpolationClose(c) {
11949
- if (c === this.delimiterClose[this.delimiterIndex]) if (this.delimiterIndex === this.delimiterClose.length - 1) {
11950
- this.cbs.oninterpolation(this.sectionStart, this.index + 1);
11951
- if (this.inRCDATA) this.state = 32;
11952
- else this.state = 1;
11953
- this.sectionStart = this.index + 1;
11954
- } else this.delimiterIndex++;
11955
- else {
12445
+ if (c === this.delimiterClose[this.delimiterIndex]) {
12446
+ if (this.delimiterIndex === this.delimiterClose.length - 1) {
12447
+ this.cbs.oninterpolation(this.sectionStart, this.index + 1);
12448
+ if (this.inRCDATA) this.state = 32;
12449
+ else this.state = 1;
12450
+ this.sectionStart = this.index + 1;
12451
+ } else this.delimiterIndex++;
12452
+ } else {
11956
12453
  this.state = 3;
11957
12454
  this.stateInterpolation(c);
11958
12455
  }
@@ -12067,9 +12564,10 @@ var Tokenizer = class {
12067
12564
  this.sectionStart = this.index;
12068
12565
  if (this.mode === 0) this.state = 6;
12069
12566
  else if (this.inSFCRoot) this.state = 34;
12070
- else if (!this.inXML) if (c === 116) this.state = 30;
12071
- else this.state = c === 115 ? 29 : 6;
12072
- else this.state = 6;
12567
+ else if (!this.inXML) {
12568
+ if (c === 116) this.state = 30;
12569
+ else this.state = c === 115 ? 29 : 6;
12570
+ } else this.state = 6;
12073
12571
  } else if (c === 47) this.state = 8;
12074
12572
  else {
12075
12573
  this.state = 1;
@@ -12422,9 +12920,7 @@ var Tokenizer = class {
12422
12920
  case 24:
12423
12921
  this.stateInProcessingInstruction(c);
12424
12922
  break;
12425
- case 33:
12426
- this.stateInEntity();
12427
- break;
12923
+ case 33: this.stateInEntity();
12428
12924
  }
12429
12925
  this.index++;
12430
12926
  }
@@ -12453,9 +12949,10 @@ var Tokenizer = class {
12453
12949
  handleTrailingData() {
12454
12950
  const endIndex = this.buffer.length;
12455
12951
  if (this.sectionStart >= endIndex) return;
12456
- if (this.state === 28) if (this.currentSequence === Sequences.CdataEnd) this.cbs.oncdata(this.sectionStart, endIndex);
12457
- else this.cbs.oncomment(this.sectionStart, endIndex);
12458
- else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) {} else this.cbs.ontext(this.sectionStart, endIndex);
12952
+ if (this.state === 28) {
12953
+ if (this.currentSequence === Sequences.CdataEnd) this.cbs.oncdata(this.sectionStart, endIndex);
12954
+ else this.cbs.oncomment(this.sectionStart, endIndex);
12955
+ } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) {} else this.cbs.ontext(this.sectionStart, endIndex);
12459
12956
  }
12460
12957
  emitCodePoint(cp, consumed) {}
12461
12958
  };
@@ -12657,12 +13154,10 @@ const isMemberExpressionBrowser = (exp) => {
12657
13154
  if (!--currentOpenParensCount) state = stateStack.pop();
12658
13155
  }
12659
13156
  break;
12660
- case 3:
12661
- if (char === currentStringType) {
12662
- state = stateStack.pop();
12663
- currentStringType = null;
12664
- }
12665
- break;
13157
+ case 3: if (char === currentStringType) {
13158
+ state = stateStack.pop();
13159
+ currentStringType = null;
13160
+ }
12666
13161
  }
12667
13162
  }
12668
13163
  return !currentOpenBracketCount && !currentOpenParensCount;
@@ -12712,7 +13207,7 @@ function isTemplateNode(node) {
12712
13207
  function isSlotOutlet(node) {
12713
13208
  return node.type === 1 && node.tagType === 2;
12714
13209
  }
12715
- const propsHelperSet = new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
13210
+ const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
12716
13211
  function getUnnormalizedProps(props, callPath = []) {
12717
13212
  if (props && !isString(props) && props.type === 14) {
12718
13213
  const callee = props.callee;
@@ -12721,6 +13216,7 @@ function getUnnormalizedProps(props, callPath = []) {
12721
13216
  return [props, callPath];
12722
13217
  }
12723
13218
  function injectProp(node, prop, context) {
13219
+ if (node.type !== 13 && injectSlotKey(node, prop)) return;
12724
13220
  let propsWithInjection;
12725
13221
  /**
12726
13222
  * 1. mergeProps(...)
@@ -12754,11 +13250,26 @@ function injectProp(node, prop, context) {
12754
13250
  propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [createObjectExpression([prop]), props]);
12755
13251
  if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) parentCall = callPath[callPath.length - 2];
12756
13252
  }
12757
- if (node.type === 13) if (parentCall) parentCall.arguments[0] = propsWithInjection;
12758
- else node.props = propsWithInjection;
12759
- else if (parentCall) parentCall.arguments[0] = propsWithInjection;
13253
+ if (node.type === 13) {
13254
+ if (parentCall) parentCall.arguments[0] = propsWithInjection;
13255
+ else node.props = propsWithInjection;
13256
+ } else if (parentCall) parentCall.arguments[0] = propsWithInjection;
12760
13257
  else node.arguments[2] = propsWithInjection;
12761
13258
  }
13259
+ function injectSlotKey(node, prop) {
13260
+ var _node$arguments, _node$arguments2, _node$arguments3;
13261
+ if (prop.key.type !== 4 || prop.key.content !== "key") return false;
13262
+ const props = node.arguments[2];
13263
+ if (props && !isString(props)) {
13264
+ const [unnormalizedProps] = getUnnormalizedProps(props);
13265
+ if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) return true;
13266
+ }
13267
+ (_node$arguments = node.arguments)[2] || (_node$arguments[2] = "{}");
13268
+ (_node$arguments2 = node.arguments)[3] || (_node$arguments2[3] = "undefined");
13269
+ (_node$arguments3 = node.arguments)[4] || (_node$arguments3[4] = "undefined");
13270
+ node.arguments[5] = prop.value;
13271
+ return true;
13272
+ }
12762
13273
  function hasProp(prop, props) {
12763
13274
  let result = false;
12764
13275
  if (prop.key.type === 4) {
@@ -13017,10 +13528,7 @@ const tokenizer = new Tokenizer(stack, {
13017
13528
  case 18:
13018
13529
  case 19:
13019
13530
  case 20:
13020
- case 21:
13021
- emitError(9, end);
13022
- break;
13023
- default: break;
13531
+ case 21: emitError(9, end);
13024
13532
  }
13025
13533
  for (let index = 0; index < stack.length; index++) {
13026
13534
  onCloseTag(stack[index], end - 1);
@@ -13028,7 +13536,7 @@ const tokenizer = new Tokenizer(stack, {
13028
13536
  }
13029
13537
  },
13030
13538
  oncdata(start, end) {
13031
- if (stack[0].ns !== 0) onText(getSlice(start, end), start, end);
13539
+ if ((stack[0] ? stack[0].ns : currentOptions.ns) !== 0) onText(getSlice(start, end), start, end);
13032
13540
  else emitError(1, start - 9);
13033
13541
  },
13034
13542
  onprocessinginstruction(start) {
@@ -13170,7 +13678,7 @@ function backTrack(index, c) {
13170
13678
  while (currentInput.charCodeAt(i) !== c && i >= 0) i--;
13171
13679
  return i;
13172
13680
  }
13173
- const specialTemplateDir = new Set([
13681
+ const specialTemplateDir = /* @__PURE__ */ new Set([
13174
13682
  "if",
13175
13683
  "else",
13176
13684
  "else-if",
@@ -13206,16 +13714,18 @@ function condenseWhitespace(nodes) {
13206
13714
  let removedWhitespace = false;
13207
13715
  for (let i = 0; i < nodes.length; i++) {
13208
13716
  const node = nodes[i];
13209
- if (node.type === 2) if (!inPre) {
13210
- if (isAllWhitespace(node.content)) {
13211
- const prev = nodes[i - 1] && nodes[i - 1].type;
13212
- const next = nodes[i + 1] && nodes[i + 1].type;
13213
- if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
13214
- removedWhitespace = true;
13215
- nodes[i] = null;
13216
- } else node.content = " ";
13217
- } else if (shouldCondense) node.content = condense(node.content);
13218
- } else node.content = node.content.replace(windowsNewlineRE, "\n");
13717
+ if (node.type === 2) {
13718
+ if (!inPre) {
13719
+ if (isAllWhitespace(node.content)) {
13720
+ const prev = nodes[i - 1] && nodes[i - 1].type;
13721
+ const next = nodes[i + 1] && nodes[i + 1].type;
13722
+ if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
13723
+ removedWhitespace = true;
13724
+ nodes[i] = null;
13725
+ } else node.content = " ";
13726
+ } else if (shouldCondense) node.content = condense(node.content);
13727
+ } else node.content = node.content.replace(windowsNewlineRE, "\n");
13728
+ }
13219
13729
  }
13220
13730
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
13221
13731
  }
@@ -13476,7 +13986,7 @@ function getConstantType(node, context) {
13476
13986
  default: return 0;
13477
13987
  }
13478
13988
  }
13479
- const allowHoistedHelperSet = new Set([
13989
+ const allowHoistedHelperSet = /* @__PURE__ */ new Set([
13480
13990
  NORMALIZE_CLASS,
13481
13991
  NORMALIZE_STYLE,
13482
13992
  NORMALIZE_PROPS,
@@ -13553,8 +14063,10 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
13553
14063
  imports: [],
13554
14064
  cached: [],
13555
14065
  constantCache: /* @__PURE__ */ new WeakMap(),
14066
+ vForMemoKeyedNodes: /* @__PURE__ */ new WeakSet(),
13556
14067
  temps: 0,
13557
14068
  identifiers: Object.create(null),
14069
+ identifierScopes: Object.create(null),
13558
14070
  scopes: {
13559
14071
  vFor: 0,
13560
14072
  vSlot: 0,
@@ -13605,8 +14117,12 @@ function createTransformContext(root, { filename = "", prefixIdentifiers = false
13605
14117
  context.parent.children.splice(removalIndex, 1);
13606
14118
  },
13607
14119
  onNodeRemoved: NOOP,
13608
- addIdentifiers(exp) {},
14120
+ addIdentifiers(exp, type = "local") {},
13609
14121
  removeIdentifiers(exp) {},
14122
+ isSlotScopeIdentifier(name) {
14123
+ const scopes = context.identifierScopes[name];
14124
+ return scopes ? scopes[scopes.length - 1] === "slot" : false;
14125
+ },
13610
14126
  hoist(exp) {
13611
14127
  if (isString(exp)) exp = createSimpleExpression(exp);
13612
14128
  context.hoists.push(exp);
@@ -13628,7 +14144,7 @@ function transform(root, options) {
13628
14144
  traverseNode(root, context);
13629
14145
  if (options.hoistStatic) cacheStatic(root, context);
13630
14146
  if (!options.ssr) createRootCodegen(root, context);
13631
- root.helpers = new Set([...context.helpers.keys()]);
14147
+ root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]);
13632
14148
  root.components = [...context.components];
13633
14149
  root.directives = [...context.directives];
13634
14150
  root.imports = context.imports;
@@ -13675,8 +14191,10 @@ function traverseNode(node, context) {
13675
14191
  const exitFns = [];
13676
14192
  for (let i = 0; i < nodeTransforms.length; i++) {
13677
14193
  const onExit = nodeTransforms[i](node, context);
13678
- if (onExit) if (isArray(onExit)) exitFns.push(...onExit);
13679
- else exitFns.push(onExit);
14194
+ if (onExit) {
14195
+ if (isArray(onExit)) exitFns.push(...onExit);
14196
+ else exitFns.push(onExit);
14197
+ }
13680
14198
  if (!context.currentNode) return;
13681
14199
  else node = context.currentNode;
13682
14200
  }
@@ -13693,9 +14211,7 @@ function traverseNode(node, context) {
13693
14211
  case 10:
13694
14212
  case 11:
13695
14213
  case 1:
13696
- case 0:
13697
- traverseChildren(node, context);
13698
- break;
14214
+ case 0: traverseChildren(node, context);
13699
14215
  }
13700
14216
  context.currentNode = node;
13701
14217
  let i = exitFns.length;
@@ -13891,10 +14407,12 @@ function genNodeList(nodes, context, multilines = false, comma = true) {
13891
14407
  if (isString(node)) push(node, -3);
13892
14408
  else if (isArray(node)) genNodeListAsArray(node, context);
13893
14409
  else genNode(node, context);
13894
- if (i < nodes.length - 1) if (multilines) {
13895
- comma && push(",");
13896
- newline();
13897
- } else comma && push(", ");
14410
+ if (i < nodes.length - 1) {
14411
+ if (multilines) {
14412
+ comma && push(",");
14413
+ newline();
14414
+ } else comma && push(", ");
14415
+ }
13898
14416
  }
13899
14417
  }
13900
14418
  function genNode(node, context) {
@@ -13960,6 +14478,7 @@ function genNode(node, context) {
13960
14478
  case 24: break;
13961
14479
  case 25: break;
13962
14480
  case 26: break;
14481
+ /* v8 ignore start */
13963
14482
  case 10: break;
13964
14483
  default:
13965
14484
  assert(false, `unhandled codegen node type: ${node.type}`);
@@ -14005,8 +14524,10 @@ function genVNodeCall(node, context) {
14005
14524
  const { push, helper, pure } = context;
14006
14525
  const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking, isComponent } = node;
14007
14526
  let patchFlagString;
14008
- if (patchFlag) if (patchFlag < 0) patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
14009
- else patchFlagString = patchFlag + ` /* ${Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `)} */`;
14527
+ if (patchFlag) {
14528
+ if (patchFlag < 0) patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
14529
+ else patchFlagString = patchFlag + ` /* ${Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `)} */`;
14530
+ }
14010
14531
  if (directives) push(helper(WITH_DIRECTIVES) + `(`);
14011
14532
  if (isBlock) push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);
14012
14533
  if (pure) push(PURE_ANNOTATION);
@@ -14177,7 +14698,7 @@ const transformExpression = (node, context) => {
14177
14698
  if (dir.type === 7 && dir.name !== "for") {
14178
14699
  const exp = dir.exp;
14179
14700
  const arg = dir.arg;
14180
- if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
14701
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg) && !(memo && context.vForMemoKeyedNodes.has(node) && arg && arg.type === 4 && arg.content === "key")) dir.exp = processExpression(exp, context, dir.name === "slot");
14181
14702
  if (arg && arg.type === 4 && !arg.isStatic) dir.arg = processExpression(arg, context);
14182
14703
  }
14183
14704
  }
@@ -14275,16 +14796,17 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
14275
14796
  const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2));
14276
14797
  const { children } = branch;
14277
14798
  const firstChild = children[0];
14278
- if (children.length !== 1 || firstChild.type !== 1) if (children.length === 1 && firstChild.type === 11) {
14279
- const vnodeCall = firstChild.codegenNode;
14280
- injectProp(vnodeCall, keyProperty, context);
14281
- return vnodeCall;
14799
+ if (children.length !== 1 || firstChild.type !== 1) {
14800
+ if (children.length === 1 && firstChild.type === 11) {
14801
+ const vnodeCall = firstChild.codegenNode;
14802
+ injectProp(vnodeCall, keyProperty, context);
14803
+ return vnodeCall;
14804
+ } else {
14805
+ let patchFlag = 64;
14806
+ if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) patchFlag |= 2048;
14807
+ return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag, void 0, void 0, true, false, false, branch.loc);
14808
+ }
14282
14809
  } else {
14283
- let patchFlag = 64;
14284
- if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) patchFlag |= 2048;
14285
- return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag, void 0, void 0, true, false, false, branch.loc);
14286
- }
14287
- else {
14288
14810
  const ret = firstChild.codegenNode;
14289
14811
  const vnodeCall = getMemoedVNodeCall(ret);
14290
14812
  if (vnodeCall.type === 13) convertToBlock(vnodeCall, context);
@@ -14305,9 +14827,10 @@ function isSameKey(a, b) {
14305
14827
  return true;
14306
14828
  }
14307
14829
  function getParentCondition(node) {
14308
- while (true) if (node.type === 19) if (node.alternate.type === 19) node = node.alternate;
14309
- else return node;
14310
- else if (node.type === 20) node = node.value;
14830
+ while (true) if (node.type === 19) {
14831
+ if (node.alternate.type === 19) node = node.alternate;
14832
+ else return node;
14833
+ } else if (node.type === 20) node = node.value;
14311
14834
  }
14312
14835
  //#endregion
14313
14836
  //#region packages/compiler-core/src/transforms/vFor.ts
@@ -14318,10 +14841,9 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
14318
14841
  const isTemplate = isTemplateNode(node);
14319
14842
  const memo = findDir(node, "memo");
14320
14843
  const keyProp = findProp(node, `key`, false, true);
14321
- const isDirKey = keyProp && keyProp.type === 7;
14844
+ keyProp && keyProp.type;
14322
14845
  let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
14323
- if (memo && keyExp && isDirKey) {}
14324
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
14846
+ const keyProperty = keyExp ? createObjectProperty(`key`, keyExp) : null;
14325
14847
  const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
14326
14848
  const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
14327
14849
  forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc);
@@ -14346,15 +14868,24 @@ const transformFor = createStructuralDirectiveTransform("for", (node, dir, conte
14346
14868
  else {
14347
14869
  childBlock = children[0].codegenNode;
14348
14870
  if (isTemplate && keyProperty) injectProp(childBlock, keyProperty, context);
14349
- if (childBlock.isBlock !== !isStableFragment) if (childBlock.isBlock) {
14350
- removeHelper(OPEN_BLOCK);
14351
- removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
14352
- } else removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
14353
- childBlock.isBlock = !isStableFragment;
14871
+ const shouldUseBlock = !isStableFragment || childBlock.isBlockRequired === true;
14872
+ if (childBlock.isBlock !== shouldUseBlock) {
14873
+ if (childBlock.isBlock) {
14874
+ removeHelper(OPEN_BLOCK);
14875
+ removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
14876
+ } else removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
14877
+ }
14878
+ childBlock.isBlock = shouldUseBlock;
14354
14879
  if (childBlock.isBlock) {
14355
14880
  helper(OPEN_BLOCK);
14356
14881
  helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
14357
- } else helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
14882
+ } else {
14883
+ helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
14884
+ if (childBlock.needsPatch) {
14885
+ var _childBlock$patchFlag;
14886
+ childBlock.patchFlag = ((_childBlock$patchFlag = childBlock.patchFlag) !== null && _childBlock$patchFlag !== void 0 ? _childBlock$patchFlag : 0) | 512;
14887
+ }
14888
+ }
14358
14889
  }
14359
14890
  if (memo) {
14360
14891
  const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [createSimpleExpression(`_cached`)]));
@@ -14526,8 +15057,10 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
14526
15057
  return createObjectProperty(`default`, fn);
14527
15058
  };
14528
15059
  if (!hasTemplateSlots) slotsProperties.push(buildDefaultSlotProperty(void 0, children));
14529
- else if (implicitDefaultChildren.length && !implicitDefaultChildren.every(isWhitespaceText)) if (hasNamedDefaultSlot) context.onError(createCompilerError(39, implicitDefaultChildren[0].loc));
14530
- else slotsProperties.push(buildDefaultSlotProperty(void 0, implicitDefaultChildren));
15060
+ else if (implicitDefaultChildren.length && !implicitDefaultChildren.every(isWhitespaceText)) {
15061
+ if (hasNamedDefaultSlot) context.onError(createCompilerError(39, implicitDefaultChildren[0].loc));
15062
+ else slotsProperties.push(buildDefaultSlotProperty(void 0, implicitDefaultChildren));
15063
+ }
14531
15064
  }
14532
15065
  const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1;
14533
15066
  let slots = createObjectExpression(slotsProperties.concat(createObjectProperty(`_`, createSimpleExpression(slotFlag + ` /* ${slotFlagsText[slotFlag]} */`, false))), loc);
@@ -14553,10 +15086,7 @@ function hasForwardedSlots(children) {
14553
15086
  if (hasForwardedSlots(child.branches)) return true;
14554
15087
  break;
14555
15088
  case 10:
14556
- case 11:
14557
- if (hasForwardedSlots(child.children)) return true;
14558
- break;
14559
- default: break;
15089
+ case 11: if (hasForwardedSlots(child.children)) return true;
14560
15090
  }
14561
15091
  }
14562
15092
  return false;
@@ -14578,12 +15108,16 @@ const transformElement = (node, context) => {
14578
15108
  let vnodeDynamicProps;
14579
15109
  let dynamicPropNames;
14580
15110
  let vnodeDirectives;
15111
+ let needsPatch = false;
15112
+ let isBlockRequired = false;
14581
15113
  let shouldUseBlock = isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && (tag === "svg" || tag === "foreignObject" || tag === "math");
14582
15114
  if (props.length > 0) {
14583
15115
  const propsBuildResult = buildProps(node, context, void 0, isComponent, isDynamicComponent);
14584
15116
  vnodeProps = propsBuildResult.props;
14585
15117
  patchFlag = propsBuildResult.patchFlag;
14586
15118
  dynamicPropNames = propsBuildResult.dynamicPropNames;
15119
+ needsPatch = propsBuildResult.needsPatch;
15120
+ isBlockRequired = propsBuildResult.isBlockRequired;
14587
15121
  const directives = propsBuildResult.directives;
14588
15122
  vnodeDirectives = directives && directives.length ? createArrayExpression(directives.map((dir) => buildDirectiveArgs(dir, context))) : void 0;
14589
15123
  if (propsBuildResult.shouldUseBlock) shouldUseBlock = true;
@@ -14612,7 +15146,10 @@ const transformElement = (node, context) => {
14612
15146
  } else vnodeChildren = node.children;
14613
15147
  }
14614
15148
  if (dynamicPropNames && dynamicPropNames.length) vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
14615
- node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
15149
+ const vnodeCall = node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc);
15150
+ needsPatch = needsPatch && (patchFlag === 0 || patchFlag === 32);
15151
+ if (needsPatch) vnodeCall.needsPatch = true;
15152
+ if (isBlockRequired) vnodeCall.isBlockRequired = true;
14616
15153
  };
14617
15154
  };
14618
15155
  function resolveComponentType(node, context, ssr = false) {
@@ -14646,6 +15183,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14646
15183
  const runtimeDirectives = [];
14647
15184
  const hasChildren = children.length > 0;
14648
15185
  let shouldUseBlock = false;
15186
+ let isBlockRequired = false;
14649
15187
  let patchFlag = 0;
14650
15188
  let hasRef = false;
14651
15189
  let hasClassBinding = false;
@@ -14670,12 +15208,12 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14670
15208
  const isEventHandler = isOn(name);
14671
15209
  if (isEventHandler && (!isComponent || isDynamicComponent) && name.toLowerCase() !== "onclick" && name !== "onUpdate:modelValue" && !isReservedProp(name)) hasHydrationEventBinding = true;
14672
15210
  if (isEventHandler && isReservedProp(name)) hasVnodeHook = true;
15211
+ if (name === "ref") hasRef = true;
14673
15212
  if (isEventHandler && value.type === 14) value = value.arguments[0];
14674
15213
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) return;
14675
- if (name === "ref") hasRef = true;
14676
- else if (name === "class") hasClassBinding = true;
15214
+ if (name === "class") hasClassBinding = true;
14677
15215
  else if (name === "style") hasStyleBinding = true;
14678
- else if (name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
15216
+ else if (name !== "ref" && name !== "key" && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
14679
15217
  if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) dynamicPropNames.push(name);
14680
15218
  } else hasDynamicKeys = true;
14681
15219
  };
@@ -14701,33 +15239,38 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14701
15239
  if (name === "once" || name === "memo") continue;
14702
15240
  if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled("COMPILER_IS_ON_ELEMENT", context))) continue;
14703
15241
  if (isVOn && ssr) continue;
14704
- if (isVBind && isStaticArgOf(arg, "key") || isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")) shouldUseBlock = true;
15242
+ if (isVBind && isStaticArgOf(arg, "key")) shouldUseBlock = true;
15243
+ if (isVOn && hasChildren && arg && isStaticExp(arg) && camelize(arg.content) === "vue:beforeUpdate") {
15244
+ shouldUseBlock = true;
15245
+ isBlockRequired = true;
15246
+ }
14705
15247
  if (isVBind && isStaticArgOf(arg, "ref")) pushRefVForMarker();
14706
15248
  if (!arg && (isVBind || isVOn)) {
14707
15249
  hasDynamicKeys = true;
14708
- if (exp) if (isVBind) {
14709
- pushMergeArg();
14710
- if (mergeArgs.some((arg) => {
14711
- if (arg.type === 15) return arg.properties.some(({ key }) => {
14712
- if (key.type !== 4 || !key.isStatic) return true;
14713
- return key.content !== "class" && key.content !== "style" && !isOn(key.content);
14714
- });
14715
- else return true;
14716
- })) checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER", context, loc);
14717
- if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER", context)) {
14718
- mergeArgs.unshift(exp);
14719
- continue;
14720
- }
14721
- pushRefVForMarker();
14722
- pushMergeArg();
14723
- mergeArgs.push(exp);
14724
- } else pushMergeArg({
14725
- type: 14,
14726
- loc,
14727
- callee: context.helper(TO_HANDLERS),
14728
- arguments: isComponent ? [exp] : [exp, `true`]
14729
- });
14730
- else context.onError(createCompilerError(isVBind ? 34 : 35, loc));
15250
+ if (exp) {
15251
+ if (isVBind) {
15252
+ pushMergeArg();
15253
+ if (mergeArgs.some((arg) => {
15254
+ if (arg.type === 15) return arg.properties.some(({ key }) => {
15255
+ if (key.type !== 4 || !key.isStatic) return true;
15256
+ return key.content !== "class" && key.content !== "style" && !isOn(key.content);
15257
+ });
15258
+ else return true;
15259
+ })) checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER", context, loc);
15260
+ if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER", context)) {
15261
+ mergeArgs.unshift(exp);
15262
+ continue;
15263
+ }
15264
+ pushRefVForMarker();
15265
+ pushMergeArg();
15266
+ mergeArgs.push(exp);
15267
+ } else pushMergeArg({
15268
+ type: 14,
15269
+ loc,
15270
+ callee: context.helper(TO_HANDLERS),
15271
+ arguments: isComponent ? [exp] : [exp, `true`]
15272
+ });
15273
+ } else context.onError(createCompilerError(isVBind ? 34 : 35, loc));
14731
15274
  continue;
14732
15275
  }
14733
15276
  if (isVBind && modifiers.some((mod) => mod.content === "prop")) patchFlag |= 32;
@@ -14743,7 +15286,10 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14743
15286
  }
14744
15287
  } else if (!isBuiltInDirective(name)) {
14745
15288
  runtimeDirectives.push(prop);
14746
- if (hasChildren) shouldUseBlock = true;
15289
+ if (hasChildren) {
15290
+ shouldUseBlock = true;
15291
+ isBlockRequired = true;
15292
+ }
14747
15293
  }
14748
15294
  }
14749
15295
  }
@@ -14760,7 +15306,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14760
15306
  if (dynamicPropNames.length) patchFlag |= 8;
14761
15307
  if (hasHydrationEventBinding) patchFlag |= 32;
14762
15308
  }
14763
- if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) patchFlag |= 512;
15309
+ const needsPatch = (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0);
15310
+ if (!shouldUseBlock && needsPatch) patchFlag |= 512;
14764
15311
  if (!context.inSSR && propsExpression) switch (propsExpression.type) {
14765
15312
  case 15:
14766
15313
  let classKeyIndex = -1;
@@ -14781,16 +15328,16 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
14781
15328
  } else propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [propsExpression]);
14782
15329
  break;
14783
15330
  case 14: break;
14784
- default:
14785
- propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [propsExpression])]);
14786
- break;
15331
+ default: propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [propsExpression])]);
14787
15332
  }
14788
15333
  return {
14789
15334
  props: propsExpression,
14790
15335
  directives: runtimeDirectives,
14791
15336
  patchFlag,
14792
15337
  dynamicPropNames,
14793
- shouldUseBlock
15338
+ shouldUseBlock,
15339
+ needsPatch,
15340
+ isBlockRequired
14794
15341
  };
14795
15342
  }
14796
15343
  function dedupeProperties(properties) {
@@ -14887,10 +15434,12 @@ function processSlotOutlet(node, context) {
14887
15434
  for (let i = 0; i < node.props.length; i++) {
14888
15435
  const p = node.props[i];
14889
15436
  if (p.type === 6) {
14890
- if (p.value) if (p.name === "name") slotName = JSON.stringify(p.value.content);
14891
- else {
14892
- p.name = camelize(p.name);
14893
- nonNameProps.push(p);
15437
+ if (p.value) {
15438
+ if (p.name === "name") slotName = JSON.stringify(p.value.content);
15439
+ else {
15440
+ p.name = camelize(p.name);
15441
+ nonNameProps.push(p);
15442
+ }
14894
15443
  }
14895
15444
  } else if (p.name === "bind" && isStaticArgOf(p.arg, "name")) {
14896
15445
  if (p.exp) slotName = p.exp;
@@ -14916,17 +15465,18 @@ const transformOn$1 = (dir, node, context, augmentor) => {
14916
15465
  const { loc, modifiers, arg } = dir;
14917
15466
  if (!dir.exp && !modifiers.length) context.onError(createCompilerError(35, loc));
14918
15467
  let eventName;
14919
- if (arg.type === 4) if (arg.isStatic) {
14920
- let rawName = arg.content;
14921
- if (rawName.startsWith("vnode")) context.onError(createCompilerError(52, arg.loc));
14922
- if (rawName.startsWith("vue:")) rawName = `vnode-${rawName.slice(4)}`;
14923
- eventName = createSimpleExpression(node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? toHandlerKey(camelize(rawName)) : `on:${rawName}`, true, arg.loc);
14924
- } else eventName = createCompoundExpression([
14925
- `${context.helperString(TO_HANDLER_KEY)}(`,
14926
- arg,
14927
- `)`
14928
- ]);
14929
- else {
15468
+ if (arg.type === 4) {
15469
+ if (arg.isStatic) {
15470
+ let rawName = arg.content;
15471
+ if (rawName.startsWith("vnode")) context.onError(createCompilerError(52, arg.loc));
15472
+ if (rawName.startsWith("vue:")) rawName = `vnode-${rawName.slice(4)}`;
15473
+ eventName = createSimpleExpression(node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? toHandlerKey(camelize(rawName)) : `on:${rawName}`, true, arg.loc);
15474
+ } else eventName = createCompoundExpression([
15475
+ `${context.helperString(TO_HANDLER_KEY)}(`,
15476
+ arg,
15477
+ `)`
15478
+ ]);
15479
+ } else {
14930
15480
  eventName = arg;
14931
15481
  eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);
14932
15482
  eventName.children.push(`)`);
@@ -14962,11 +15512,14 @@ const transformBind = (dir, _node, context) => {
14962
15512
  arg.children.unshift(`(`);
14963
15513
  arg.children.push(`) || ""`);
14964
15514
  } else if (!arg.isStatic) arg.content = arg.content ? `${arg.content} || ""` : `""`;
14965
- if (modifiers.some((mod) => mod.content === "camel")) if (arg.type === 4) if (arg.isStatic) arg.content = camelize(arg.content);
14966
- else arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
14967
- else {
14968
- arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
14969
- arg.children.push(`)`);
15515
+ if (modifiers.some((mod) => mod.content === "camel")) {
15516
+ if (arg.type === 4) {
15517
+ if (arg.isStatic) arg.content = camelize(arg.content);
15518
+ else arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
15519
+ } else {
15520
+ arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
15521
+ arg.children.push(`)`);
15522
+ }
14970
15523
  }
14971
15524
  if (!context.inSSR) {
14972
15525
  if (modifiers.some((mod) => mod.content === "prop")) injectPrefix(arg, ".");
@@ -14975,9 +15528,10 @@ const transformBind = (dir, _node, context) => {
14975
15528
  return { props: [createObjectProperty(arg, exp)] };
14976
15529
  };
14977
15530
  const injectPrefix = (arg, prefix) => {
14978
- if (arg.type === 4) if (arg.isStatic) arg.content = prefix + arg.content;
14979
- else arg.content = `\`${prefix}\${${arg.content}}\``;
14980
- else {
15531
+ if (arg.type === 4) {
15532
+ if (arg.isStatic) arg.content = prefix + arg.content;
15533
+ else arg.content = `\`${prefix}\${${arg.content}}\``;
15534
+ } else {
14981
15535
  arg.children.unshift(`'${prefix}' + (`);
14982
15536
  arg.children.push(`)`);
14983
15537
  }
@@ -15098,7 +15652,7 @@ function rewriteFilter(node, context) {
15098
15652
  const child = node.children[i];
15099
15653
  if (typeof child !== "object") continue;
15100
15654
  if (child.type === 4) parseFilter(child, context);
15101
- else if (child.type === 8) rewriteFilter(node, context);
15655
+ else if (child.type === 8) rewriteFilter(child, context);
15102
15656
  else if (child.type === 5) rewriteFilter(child.content, context);
15103
15657
  }
15104
15658
  }
@@ -15124,11 +15678,12 @@ function parseFilter(node, context) {
15124
15678
  if (c === 96 && prev !== 92) inTemplateString = false;
15125
15679
  } else if (inRegex) {
15126
15680
  if (c === 47 && prev !== 92) inRegex = false;
15127
- } else if (c === 124 && exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) if (expression === void 0) {
15128
- lastFilterIndex = i + 1;
15129
- expression = exp.slice(0, i).trim();
15130
- } else pushFilter();
15131
- else {
15681
+ } else if (c === 124 && exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) {
15682
+ if (expression === void 0) {
15683
+ lastFilterIndex = i + 1;
15684
+ expression = exp.slice(0, i).trim();
15685
+ } else pushFilter();
15686
+ } else {
15132
15687
  switch (c) {
15133
15688
  case 34:
15134
15689
  inDouble = true;
@@ -15154,9 +15709,7 @@ function parseFilter(node, context) {
15154
15709
  case 123:
15155
15710
  curly++;
15156
15711
  break;
15157
- case 125:
15158
- curly--;
15159
- break;
15712
+ case 125: curly--;
15160
15713
  }
15161
15714
  if (c === 47) {
15162
15715
  let j = i - 1;
@@ -15432,9 +15985,7 @@ const transformModel = (dir, node, context) => {
15432
15985
  isInvalidType = true;
15433
15986
  context.onError(createDOMCompilerError(60, dir.loc));
15434
15987
  break;
15435
- default:
15436
- checkDuplicatedValue();
15437
- break;
15988
+ default: checkDuplicatedValue();
15438
15989
  }
15439
15990
  } else if (hasDynamicKeyVBind(node)) directiveToUse = V_MODEL_DYNAMIC;
15440
15991
  else checkDuplicatedValue();
@@ -15447,27 +15998,37 @@ const transformModel = (dir, node, context) => {
15447
15998
  };
15448
15999
  //#endregion
15449
16000
  //#region packages/compiler-dom/src/transforms/vOn.ts
15450
- const isEventOptionModifier = /* @__PURE__ */ makeMap(`passive,once,capture`);
15451
- const isNonKeyModifier = /* @__PURE__ */ makeMap("stop,prevent,self,ctrl,shift,alt,meta,exact,middle");
15452
- const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right");
15453
- const isKeyboardEvent = /* @__PURE__ */ makeMap(`onkeyup,onkeydown,onkeypress`);
16001
+ const isEventOptionModifier = /*@__PURE__*/ makeMap(`passive,once,capture`);
16002
+ const isNonKeyModifier = /*@__PURE__*/ makeMap("stop,prevent,self,ctrl,shift,alt,meta,exact,middle");
16003
+ const maybeKeyModifier = /*@__PURE__*/ makeMap("left,right");
16004
+ const isKeyboardEvent = /*@__PURE__*/ makeMap(`onkeyup,onkeydown,onkeypress`);
15454
16005
  const resolveModifiers = (key, modifiers, context, loc) => {
15455
16006
  const keyModifiers = [];
15456
16007
  const nonKeyModifiers = [];
15457
16008
  const eventOptionModifiers = [];
15458
16009
  for (let i = 0; i < modifiers.length; i++) {
15459
16010
  const modifier = modifiers[i].content;
16011
+ if (modifier === "delegate") {
16012
+ if (context) {
16013
+ const error = /* @__PURE__ */ new SyntaxError(`.delegate modifier is only supported in Vapor components.`);
16014
+ error.loc = modifiers[i].loc;
16015
+ context.onWarn(error);
16016
+ }
16017
+ continue;
16018
+ }
15460
16019
  if (modifier === "native" && context && checkCompatEnabled("COMPILER_V_ON_NATIVE", context, loc)) eventOptionModifiers.push(modifier);
15461
16020
  else if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
15462
16021
  else {
15463
16022
  const keyString = isString(key) ? key : isStaticExp(key) ? key.content : null;
15464
- if (maybeKeyModifier(modifier)) if (keyString) if (isKeyboardEvent(keyString.toLowerCase())) keyModifiers.push(modifier);
15465
- else nonKeyModifiers.push(modifier);
15466
- else {
15467
- keyModifiers.push(modifier);
15468
- nonKeyModifiers.push(modifier);
15469
- }
15470
- else if (isNonKeyModifier(modifier)) nonKeyModifiers.push(modifier);
16023
+ if (maybeKeyModifier(modifier)) {
16024
+ if (keyString) {
16025
+ if (isKeyboardEvent(keyString.toLowerCase())) keyModifiers.push(modifier);
16026
+ else nonKeyModifiers.push(modifier);
16027
+ } else {
16028
+ keyModifiers.push(modifier);
16029
+ nonKeyModifiers.push(modifier);
16030
+ }
16031
+ } else if (isNonKeyModifier(modifier)) nonKeyModifiers.push(modifier);
15471
16032
  else keyModifiers.push(modifier);
15472
16033
  }
15473
16034
  }
@@ -15533,7 +16094,7 @@ function postTransformTransition(node, onError, hasMultipleChildren = defaultHas
15533
16094
  source: ""
15534
16095
  }));
15535
16096
  const child = node.children[0];
15536
- if (child.type === 1) {
16097
+ if (child.type === 1 && !findDir(child, "if")) {
15537
16098
  for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
15538
16099
  type: 6,
15539
16100
  name: "persisted",
@@ -15582,7 +16143,7 @@ function isValidHTMLNesting(parent, child) {
15582
16143
  }
15583
16144
  return true;
15584
16145
  }
15585
- const headings = new Set([
16146
+ const headings = /* @__PURE__ */ new Set([
15586
16147
  "h1",
15587
16148
  "h2",
15588
16149
  "h3",
@@ -15594,7 +16155,7 @@ const emptySet = /* @__PURE__ */ new Set([]);
15594
16155
  /**
15595
16156
  * maps element to set of elements that can be it's children, no other */
15596
16157
  const onlyValidChildren = {
15597
- head: new Set([
16158
+ head: /* @__PURE__ */ new Set([
15598
16159
  "base",
15599
16160
  "basefront",
15600
16161
  "bgsound",
@@ -15607,24 +16168,24 @@ const onlyValidChildren = {
15607
16168
  "script",
15608
16169
  "template"
15609
16170
  ]),
15610
- optgroup: new Set(["option"]),
15611
- select: new Set([
16171
+ optgroup: /* @__PURE__ */ new Set(["option"]),
16172
+ select: /* @__PURE__ */ new Set([
15612
16173
  "optgroup",
15613
16174
  "option",
15614
16175
  "hr"
15615
16176
  ]),
15616
- table: new Set([
16177
+ table: /* @__PURE__ */ new Set([
15617
16178
  "caption",
15618
16179
  "colgroup",
15619
16180
  "tbody",
15620
16181
  "tfoot",
15621
16182
  "thead"
15622
16183
  ]),
15623
- tr: new Set(["td", "th"]),
15624
- colgroup: new Set(["col"]),
15625
- tbody: new Set(["tr"]),
15626
- thead: new Set(["tr"]),
15627
- tfoot: new Set(["tr"]),
16184
+ tr: /* @__PURE__ */ new Set(["td", "th"]),
16185
+ colgroup: /* @__PURE__ */ new Set(["col"]),
16186
+ tbody: /* @__PURE__ */ new Set(["tr"]),
16187
+ thead: /* @__PURE__ */ new Set(["tr"]),
16188
+ tfoot: /* @__PURE__ */ new Set(["tr"]),
15628
16189
  script: emptySet,
15629
16190
  iframe: emptySet,
15630
16191
  option: emptySet,
@@ -15635,30 +16196,30 @@ const onlyValidChildren = {
15635
16196
  /** maps elements to set of elements which can be it's parent, no other */
15636
16197
  const onlyValidParents = {
15637
16198
  html: emptySet,
15638
- body: new Set(["html"]),
15639
- head: new Set(["html"]),
15640
- td: new Set(["tr"]),
15641
- colgroup: new Set(["table"]),
15642
- caption: new Set(["table"]),
15643
- tbody: new Set(["table"]),
15644
- tfoot: new Set(["table"]),
15645
- col: new Set(["colgroup"]),
15646
- th: new Set(["tr"]),
15647
- thead: new Set(["table"]),
15648
- tr: new Set([
16199
+ body: /* @__PURE__ */ new Set(["html"]),
16200
+ head: /* @__PURE__ */ new Set(["html"]),
16201
+ td: /* @__PURE__ */ new Set(["tr"]),
16202
+ colgroup: /* @__PURE__ */ new Set(["table"]),
16203
+ caption: /* @__PURE__ */ new Set(["table"]),
16204
+ tbody: /* @__PURE__ */ new Set(["table"]),
16205
+ tfoot: /* @__PURE__ */ new Set(["table"]),
16206
+ col: /* @__PURE__ */ new Set(["colgroup"]),
16207
+ th: /* @__PURE__ */ new Set(["tr"]),
16208
+ thead: /* @__PURE__ */ new Set(["table"]),
16209
+ tr: /* @__PURE__ */ new Set([
15649
16210
  "tbody",
15650
16211
  "thead",
15651
16212
  "tfoot"
15652
16213
  ]),
15653
- dd: new Set(["dl", "div"]),
15654
- dt: new Set(["dl", "div"]),
15655
- figcaption: new Set(["figure"]),
15656
- summary: new Set(["details"]),
15657
- area: new Set(["map"])
16214
+ dd: /* @__PURE__ */ new Set(["dl", "div"]),
16215
+ dt: /* @__PURE__ */ new Set(["dl", "div"]),
16216
+ figcaption: /* @__PURE__ */ new Set(["figure"]),
16217
+ summary: /* @__PURE__ */ new Set(["details"]),
16218
+ area: /* @__PURE__ */ new Set(["map"])
15658
16219
  };
15659
16220
  /** maps element to set of elements that can not be it's children, others can */
15660
16221
  const knownInvalidChildren = {
15661
- p: new Set([
16222
+ p: /* @__PURE__ */ new Set([
15662
16223
  "address",
15663
16224
  "article",
15664
16225
  "aside",
@@ -15693,7 +16254,7 @@ const knownInvalidChildren = {
15693
16254
  "table",
15694
16255
  "ul"
15695
16256
  ]),
15696
- svg: new Set([
16257
+ svg: /* @__PURE__ */ new Set([
15697
16258
  "b",
15698
16259
  "blockquote",
15699
16260
  "br",
@@ -15734,12 +16295,12 @@ const knownInvalidChildren = {
15734
16295
  };
15735
16296
  /** maps element to set of elements that can not be it's parent, others can */
15736
16297
  const knownInvalidParents = {
15737
- a: new Set(["a"]),
15738
- button: new Set(["button"]),
15739
- dd: new Set(["dd", "dt"]),
15740
- dt: new Set(["dd", "dt"]),
15741
- form: new Set(["form"]),
15742
- li: new Set(["li"]),
16298
+ a: /* @__PURE__ */ new Set(["a"]),
16299
+ button: /* @__PURE__ */ new Set(["button"]),
16300
+ dd: /* @__PURE__ */ new Set(["dd", "dt"]),
16301
+ dt: /* @__PURE__ */ new Set(["dd", "dt"]),
16302
+ form: /* @__PURE__ */ new Set(["form"]),
16303
+ li: /* @__PURE__ */ new Set(["li"]),
15743
16304
  h1: headings,
15744
16305
  h2: headings,
15745
16306
  h3: headings,
@@ -15782,10 +16343,12 @@ function compile(src, options = {}) {
15782
16343
  //#region packages/vue-compat/src/index.ts
15783
16344
  const compileCache = Object.create(null);
15784
16345
  function compileToFunction(template, options) {
15785
- if (!isString(template)) if (template.nodeType) template = template.innerHTML;
15786
- else {
15787
- warn(`invalid template option: `, template);
15788
- return NOOP;
16346
+ if (!isString(template)) {
16347
+ if (template.nodeType) template = template.innerHTML;
16348
+ else {
16349
+ warn(`invalid template option: `, template);
16350
+ return NOOP;
16351
+ }
15789
16352
  }
15790
16353
  const key = genCacheKey(template, options);
15791
16354
  const cached = compileCache[key];