@vue/runtime-dom 3.4.0-alpha.4 → 3.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -130,6 +130,20 @@ var VueRuntimeDOM = (function (exports) {
130
130
  });
131
131
  return ret;
132
132
  }
133
+ function stringifyStyle(styles) {
134
+ let ret = "";
135
+ if (!styles || isString(styles)) {
136
+ return ret;
137
+ }
138
+ for (const key in styles) {
139
+ const value = styles[key];
140
+ const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
141
+ if (isString(value) || typeof value === "number") {
142
+ ret += `${normalizedKey}:${value};`;
143
+ }
144
+ }
145
+ return ret;
146
+ }
133
147
  function normalizeClass(value) {
134
148
  let res = "";
135
149
  if (isString(value)) {
@@ -165,14 +179,25 @@ var VueRuntimeDOM = (function (exports) {
165
179
 
166
180
  const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
167
181
  const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
182
+ const MATH_TAGS = "math,maction,annotation,annotation-xml,menclose,merror,mfenced,mfrac,mi,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,semantics,mspace,msqrt,mstyle,msub,msup,msubsup,mtable,mtd,mtext,mtr,munder,munderover";
168
183
  const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
169
184
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
185
+ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
170
186
 
171
187
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
172
188
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
189
+ const isBooleanAttr = /* @__PURE__ */ makeMap(
190
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
191
+ );
173
192
  function includeBooleanAttr(value) {
174
193
  return !!value || value === "";
175
194
  }
195
+ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
196
+ `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`
197
+ );
198
+ const isKnownSvgAttr = /* @__PURE__ */ makeMap(
199
+ `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`
200
+ );
176
201
 
177
202
  function looseCompareArrays(a, b) {
178
203
  if (a.length !== b.length)
@@ -234,20 +259,29 @@ var VueRuntimeDOM = (function (exports) {
234
259
  return replacer(_key, val.value);
235
260
  } else if (isMap(val)) {
236
261
  return {
237
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
238
- entries[`${key} =>`] = val2;
239
- return entries;
240
- }, {})
262
+ [`Map(${val.size})`]: [...val.entries()].reduce(
263
+ (entries, [key, val2], i) => {
264
+ entries[stringifySymbol(key, i) + " =>"] = val2;
265
+ return entries;
266
+ },
267
+ {}
268
+ )
241
269
  };
242
270
  } else if (isSet(val)) {
243
271
  return {
244
- [`Set(${val.size})`]: [...val.values()]
272
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
245
273
  };
274
+ } else if (isSymbol(val)) {
275
+ return stringifySymbol(val);
246
276
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
247
277
  return String(val);
248
278
  }
249
279
  return val;
250
280
  };
281
+ const stringifySymbol = (v, i = "") => {
282
+ var _a;
283
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
284
+ };
251
285
 
252
286
  function warn$1(msg, ...args) {
253
287
  console.warn(`[Vue warn] ${msg}`, ...args);
@@ -696,8 +730,13 @@ var VueRuntimeDOM = (function (exports) {
696
730
  return isReadonly2;
697
731
  } else if (key === "__v_isShallow") {
698
732
  return shallow;
699
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
700
- return target;
733
+ } else if (key === "__v_raw") {
734
+ if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
735
+ // this means the reciever is a user proxy of the reactive proxy
736
+ Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
737
+ return target;
738
+ }
739
+ return;
701
740
  }
702
741
  const targetIsArray = isArray(target);
703
742
  if (!isReadonly2) {
@@ -733,17 +772,19 @@ var VueRuntimeDOM = (function (exports) {
733
772
  }
734
773
  set(target, key, value, receiver) {
735
774
  let oldValue = target[key];
736
- if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
737
- return false;
738
- }
739
775
  if (!this._shallow) {
776
+ const isOldValueReadonly = isReadonly(oldValue);
740
777
  if (!isShallow(value) && !isReadonly(value)) {
741
778
  oldValue = toRaw(oldValue);
742
779
  value = toRaw(value);
743
780
  }
744
781
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
745
- oldValue.value = value;
746
- return true;
782
+ if (isOldValueReadonly) {
783
+ return false;
784
+ } else {
785
+ oldValue.value = value;
786
+ return true;
787
+ }
747
788
  }
748
789
  }
749
790
  const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
@@ -1765,13 +1806,16 @@ var VueRuntimeDOM = (function (exports) {
1765
1806
  }
1766
1807
  queueFlush();
1767
1808
  }
1768
- function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
1809
+ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1769
1810
  {
1770
1811
  seen = seen || /* @__PURE__ */ new Map();
1771
1812
  }
1772
1813
  for (; i < queue.length; i++) {
1773
1814
  const cb = queue[i];
1774
1815
  if (cb && cb.pre) {
1816
+ if (instance && cb.id !== instance.uid) {
1817
+ continue;
1818
+ }
1775
1819
  if (checkRecursiveUpdates(seen, cb)) {
1776
1820
  continue;
1777
1821
  }
@@ -2531,9 +2575,17 @@ var VueRuntimeDOM = (function (exports) {
2531
2575
  return false;
2532
2576
  }
2533
2577
  function updateHOCHostEl({ vnode, parent }, el) {
2534
- while (parent && parent.subTree === vnode) {
2535
- (vnode = parent.vnode).el = el;
2536
- parent = parent.parent;
2578
+ while (parent) {
2579
+ const root = parent.subTree;
2580
+ if (root.suspense && root.suspense.activeBranch === vnode) {
2581
+ root.el = vnode.el;
2582
+ }
2583
+ if (root === vnode) {
2584
+ (vnode = parent.vnode).el = el;
2585
+ parent = parent.parent;
2586
+ } else {
2587
+ break;
2588
+ }
2537
2589
  }
2538
2590
  }
2539
2591
 
@@ -2593,6 +2645,7 @@ If this is a native custom element, make sure to exclude it from component resol
2593
2645
  }
2594
2646
 
2595
2647
  const isSuspense = (type) => type.__isSuspense;
2648
+ let suspenseId = 0;
2596
2649
  const SuspenseImpl = {
2597
2650
  name: "Suspense",
2598
2651
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -2600,7 +2653,7 @@ If this is a native custom element, make sure to exclude it from component resol
2600
2653
  // on a vnode's type and calls the `process` method, passing in renderer
2601
2654
  // internals.
2602
2655
  __isSuspense: true,
2603
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
2656
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
2604
2657
  if (n1 == null) {
2605
2658
  mountSuspense(
2606
2659
  n2,
@@ -2608,7 +2661,7 @@ If this is a native custom element, make sure to exclude it from component resol
2608
2661
  anchor,
2609
2662
  parentComponent,
2610
2663
  parentSuspense,
2611
- isSVG,
2664
+ namespace,
2612
2665
  slotScopeIds,
2613
2666
  optimized,
2614
2667
  rendererInternals
@@ -2620,7 +2673,7 @@ If this is a native custom element, make sure to exclude it from component resol
2620
2673
  container,
2621
2674
  anchor,
2622
2675
  parentComponent,
2623
- isSVG,
2676
+ namespace,
2624
2677
  slotScopeIds,
2625
2678
  optimized,
2626
2679
  rendererInternals
@@ -2638,7 +2691,7 @@ If this is a native custom element, make sure to exclude it from component resol
2638
2691
  eventListener();
2639
2692
  }
2640
2693
  }
2641
- function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
2694
+ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
2642
2695
  const {
2643
2696
  p: patch,
2644
2697
  o: { createElement }
@@ -2651,7 +2704,7 @@ If this is a native custom element, make sure to exclude it from component resol
2651
2704
  container,
2652
2705
  hiddenContainer,
2653
2706
  anchor,
2654
- isSVG,
2707
+ namespace,
2655
2708
  slotScopeIds,
2656
2709
  optimized,
2657
2710
  rendererInternals
@@ -2663,7 +2716,7 @@ If this is a native custom element, make sure to exclude it from component resol
2663
2716
  null,
2664
2717
  parentComponent,
2665
2718
  suspense,
2666
- isSVG,
2719
+ namespace,
2667
2720
  slotScopeIds
2668
2721
  );
2669
2722
  if (suspense.deps > 0) {
@@ -2677,7 +2730,7 @@ If this is a native custom element, make sure to exclude it from component resol
2677
2730
  parentComponent,
2678
2731
  null,
2679
2732
  // fallback tree will not have suspense context
2680
- isSVG,
2733
+ namespace,
2681
2734
  slotScopeIds
2682
2735
  );
2683
2736
  setActiveBranch(suspense, vnode.ssFallback);
@@ -2685,7 +2738,7 @@ If this is a native custom element, make sure to exclude it from component resol
2685
2738
  suspense.resolve(false, true);
2686
2739
  }
2687
2740
  }
2688
- function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
2741
+ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
2689
2742
  const suspense = n2.suspense = n1.suspense;
2690
2743
  suspense.vnode = n2;
2691
2744
  n2.el = n1.el;
@@ -2702,29 +2755,31 @@ If this is a native custom element, make sure to exclude it from component resol
2702
2755
  null,
2703
2756
  parentComponent,
2704
2757
  suspense,
2705
- isSVG,
2758
+ namespace,
2706
2759
  slotScopeIds,
2707
2760
  optimized
2708
2761
  );
2709
2762
  if (suspense.deps <= 0) {
2710
2763
  suspense.resolve();
2711
2764
  } else if (isInFallback) {
2712
- patch(
2713
- activeBranch,
2714
- newFallback,
2715
- container,
2716
- anchor,
2717
- parentComponent,
2718
- null,
2719
- // fallback tree will not have suspense context
2720
- isSVG,
2721
- slotScopeIds,
2722
- optimized
2723
- );
2724
- setActiveBranch(suspense, newFallback);
2765
+ if (!isHydrating) {
2766
+ patch(
2767
+ activeBranch,
2768
+ newFallback,
2769
+ container,
2770
+ anchor,
2771
+ parentComponent,
2772
+ null,
2773
+ // fallback tree will not have suspense context
2774
+ namespace,
2775
+ slotScopeIds,
2776
+ optimized
2777
+ );
2778
+ setActiveBranch(suspense, newFallback);
2779
+ }
2725
2780
  }
2726
2781
  } else {
2727
- suspense.pendingId++;
2782
+ suspense.pendingId = suspenseId++;
2728
2783
  if (isHydrating) {
2729
2784
  suspense.isHydrating = false;
2730
2785
  suspense.activeBranch = pendingBranch;
@@ -2742,7 +2797,7 @@ If this is a native custom element, make sure to exclude it from component resol
2742
2797
  null,
2743
2798
  parentComponent,
2744
2799
  suspense,
2745
- isSVG,
2800
+ namespace,
2746
2801
  slotScopeIds,
2747
2802
  optimized
2748
2803
  );
@@ -2757,7 +2812,7 @@ If this is a native custom element, make sure to exclude it from component resol
2757
2812
  parentComponent,
2758
2813
  null,
2759
2814
  // fallback tree will not have suspense context
2760
- isSVG,
2815
+ namespace,
2761
2816
  slotScopeIds,
2762
2817
  optimized
2763
2818
  );
@@ -2771,7 +2826,7 @@ If this is a native custom element, make sure to exclude it from component resol
2771
2826
  anchor,
2772
2827
  parentComponent,
2773
2828
  suspense,
2774
- isSVG,
2829
+ namespace,
2775
2830
  slotScopeIds,
2776
2831
  optimized
2777
2832
  );
@@ -2784,7 +2839,7 @@ If this is a native custom element, make sure to exclude it from component resol
2784
2839
  null,
2785
2840
  parentComponent,
2786
2841
  suspense,
2787
- isSVG,
2842
+ namespace,
2788
2843
  slotScopeIds,
2789
2844
  optimized
2790
2845
  );
@@ -2802,7 +2857,7 @@ If this is a native custom element, make sure to exclude it from component resol
2802
2857
  anchor,
2803
2858
  parentComponent,
2804
2859
  suspense,
2805
- isSVG,
2860
+ namespace,
2806
2861
  slotScopeIds,
2807
2862
  optimized
2808
2863
  );
@@ -2810,7 +2865,11 @@ If this is a native custom element, make sure to exclude it from component resol
2810
2865
  } else {
2811
2866
  triggerEvent(n2, "onPending");
2812
2867
  suspense.pendingBranch = newBranch;
2813
- suspense.pendingId++;
2868
+ if (newBranch.shapeFlag & 512) {
2869
+ suspense.pendingId = newBranch.component.suspenseId;
2870
+ } else {
2871
+ suspense.pendingId = suspenseId++;
2872
+ }
2814
2873
  patch(
2815
2874
  null,
2816
2875
  newBranch,
@@ -2818,7 +2877,7 @@ If this is a native custom element, make sure to exclude it from component resol
2818
2877
  null,
2819
2878
  parentComponent,
2820
2879
  suspense,
2821
- isSVG,
2880
+ namespace,
2822
2881
  slotScopeIds,
2823
2882
  optimized
2824
2883
  );
@@ -2840,7 +2899,7 @@ If this is a native custom element, make sure to exclude it from component resol
2840
2899
  }
2841
2900
  }
2842
2901
  let hasWarned = false;
2843
- function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
2902
+ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
2844
2903
  if (!hasWarned) {
2845
2904
  hasWarned = true;
2846
2905
  console[console.info ? "info" : "log"](
@@ -2870,7 +2929,7 @@ If this is a native custom element, make sure to exclude it from component resol
2870
2929
  vnode,
2871
2930
  parent: parentSuspense,
2872
2931
  parentComponent,
2873
- isSVG,
2932
+ namespace,
2874
2933
  container,
2875
2934
  hiddenContainer,
2876
2935
  anchor,
@@ -2879,7 +2938,7 @@ If this is a native custom element, make sure to exclude it from component resol
2879
2938
  timeout: typeof timeout === "number" ? timeout : -1,
2880
2939
  activeBranch: null,
2881
2940
  pendingBranch: null,
2882
- isInFallback: true,
2941
+ isInFallback: !isHydrating,
2883
2942
  isHydrating,
2884
2943
  isUnmounted: false,
2885
2944
  effects: [],
@@ -2963,8 +3022,9 @@ If this is a native custom element, make sure to exclude it from component resol
2963
3022
  if (!suspense.pendingBranch) {
2964
3023
  return;
2965
3024
  }
2966
- const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
3025
+ const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
2967
3026
  triggerEvent(vnode2, "onFallback");
3027
+ const anchor2 = next(activeBranch);
2968
3028
  const mountFallback = () => {
2969
3029
  if (!suspense.isInFallback) {
2970
3030
  return;
@@ -2973,11 +3033,11 @@ If this is a native custom element, make sure to exclude it from component resol
2973
3033
  null,
2974
3034
  fallbackVNode,
2975
3035
  container2,
2976
- next(activeBranch),
3036
+ anchor2,
2977
3037
  parentComponent2,
2978
3038
  null,
2979
3039
  // fallback tree will not have suspense context
2980
- isSVG2,
3040
+ namespace2,
2981
3041
  slotScopeIds,
2982
3042
  optimized
2983
3043
  );
@@ -3040,7 +3100,7 @@ If this is a native custom element, make sure to exclude it from component resol
3040
3100
  // consider the comment placeholder case.
3041
3101
  hydratedEl ? null : next(instance.subTree),
3042
3102
  suspense,
3043
- isSVG,
3103
+ namespace,
3044
3104
  optimized
3045
3105
  );
3046
3106
  if (placeholder) {
@@ -3077,7 +3137,7 @@ If this is a native custom element, make sure to exclude it from component resol
3077
3137
  };
3078
3138
  return suspense;
3079
3139
  }
3080
- function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3140
+ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3081
3141
  const suspense = vnode.suspense = createSuspenseBoundary(
3082
3142
  vnode,
3083
3143
  parentSuspense,
@@ -3085,7 +3145,7 @@ If this is a native custom element, make sure to exclude it from component resol
3085
3145
  node.parentNode,
3086
3146
  document.createElement("div"),
3087
3147
  null,
3088
- isSVG,
3148
+ namespace,
3089
3149
  slotScopeIds,
3090
3150
  optimized,
3091
3151
  rendererInternals,
@@ -3973,7 +4033,7 @@ If this is a native custom element, make sure to exclude it from component resol
3973
4033
  }
3974
4034
  } = sharedContext;
3975
4035
  const storageContainer = createElement("div");
3976
- sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
4036
+ sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
3977
4037
  const instance2 = vnode.component;
3978
4038
  move(vnode, container, anchor, 0, parentSuspense);
3979
4039
  patch(
@@ -3983,7 +4043,7 @@ If this is a native custom element, make sure to exclude it from component resol
3983
4043
  anchor,
3984
4044
  instance2,
3985
4045
  parentSuspense,
3986
- isSVG,
4046
+ namespace,
3987
4047
  vnode.slotScopeIds,
3988
4048
  optimized
3989
4049
  );
@@ -4649,7 +4709,7 @@ If this is a native custom element, make sure to exclude it from component resol
4649
4709
  function useAttrs() {
4650
4710
  return getContext().attrs;
4651
4711
  }
4652
- function useModel(props, name, options) {
4712
+ function useModel(props, name) {
4653
4713
  const i = getCurrentInstance();
4654
4714
  if (!i) {
4655
4715
  warn(`useModel() called without active instance.`);
@@ -4659,29 +4719,24 @@ If this is a native custom element, make sure to exclude it from component resol
4659
4719
  warn(`useModel() called with prop "${name}" which is not declared.`);
4660
4720
  return ref();
4661
4721
  }
4662
- if (options && options.local) {
4663
- const proxy = ref(props[name]);
4664
- watch(
4665
- () => props[name],
4666
- (v) => proxy.value = v
4667
- );
4668
- watch(proxy, (value) => {
4669
- if (value !== props[name]) {
4670
- i.emit(`update:${name}`, value);
4671
- }
4672
- });
4673
- return proxy;
4674
- } else {
4675
- return {
4676
- __v_isRef: true,
4677
- get value() {
4678
- return props[name];
4679
- },
4680
- set value(value) {
4681
- i.emit(`update:${name}`, value);
4722
+ let localValue;
4723
+ watchSyncEffect(() => {
4724
+ localValue = props[name];
4725
+ });
4726
+ return customRef((track, trigger) => ({
4727
+ get() {
4728
+ track();
4729
+ return localValue;
4730
+ },
4731
+ set(value) {
4732
+ const rawProps = i.vnode.props;
4733
+ if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
4734
+ localValue = value;
4735
+ trigger();
4682
4736
  }
4683
- };
4684
- }
4737
+ i.emit(`update:${name}`, value);
4738
+ }
4739
+ }));
4685
4740
  }
4686
4741
  function getContext() {
4687
4742
  const i = getCurrentInstance();
@@ -5275,7 +5330,7 @@ If this is a native custom element, make sure to exclude it from component resol
5275
5330
  context.directives[name] = directive;
5276
5331
  return app;
5277
5332
  },
5278
- mount(rootContainer, isHydrate, isSVG) {
5333
+ mount(rootContainer, isHydrate, namespace) {
5279
5334
  if (!isMounted) {
5280
5335
  if (rootContainer.__vue_app__) {
5281
5336
  warn(
@@ -5285,15 +5340,24 @@ If this is a native custom element, make sure to exclude it from component resol
5285
5340
  }
5286
5341
  const vnode = createVNode(rootComponent, rootProps);
5287
5342
  vnode.appContext = context;
5343
+ if (namespace === true) {
5344
+ namespace = "svg";
5345
+ } else if (namespace === false) {
5346
+ namespace = void 0;
5347
+ }
5288
5348
  {
5289
5349
  context.reload = () => {
5290
- render(cloneVNode(vnode), rootContainer, isSVG);
5350
+ render(
5351
+ cloneVNode(vnode),
5352
+ rootContainer,
5353
+ namespace
5354
+ );
5291
5355
  };
5292
5356
  }
5293
5357
  if (isHydrate && hydrate) {
5294
5358
  hydrate(vnode, rootContainer);
5295
5359
  } else {
5296
- render(vnode, rootContainer, isSVG);
5360
+ render(vnode, rootContainer, namespace);
5297
5361
  }
5298
5362
  isMounted = true;
5299
5363
  app._container = rootContainer;
@@ -5683,11 +5747,12 @@ If you want to remount the same app, move your app creation logic into a factory
5683
5747
  key,
5684
5748
  resolvedValues[key],
5685
5749
  opt,
5750
+ shallowReadonly(resolvedValues) ,
5686
5751
  !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
5687
5752
  );
5688
5753
  }
5689
5754
  }
5690
- function validateProp(name, value, prop, isAbsent) {
5755
+ function validateProp(name, value, prop, props, isAbsent) {
5691
5756
  const { type, required, validator, skipCheck } = prop;
5692
5757
  if (required && isAbsent) {
5693
5758
  warn('Missing required prop: "' + name + '"');
@@ -5710,7 +5775,7 @@ If you want to remount the same app, move your app creation logic into a factory
5710
5775
  return;
5711
5776
  }
5712
5777
  }
5713
- if (validator && !validator(value)) {
5778
+ if (validator && !validator(value, props)) {
5714
5779
  warn('Invalid prop: custom validator check failed for prop "' + name + '".');
5715
5780
  }
5716
5781
  }
@@ -5966,7 +6031,15 @@ If you want to remount the same app, move your app creation logic into a factory
5966
6031
  }
5967
6032
 
5968
6033
  let hasMismatch = false;
5969
- const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject";
6034
+ const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
6035
+ const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
6036
+ const getContainerType = (container) => {
6037
+ if (isSVGContainer(container))
6038
+ return "svg";
6039
+ if (isMathMLContainer(container))
6040
+ return "mathml";
6041
+ return void 0;
6042
+ };
5970
6043
  const isComment = (node) => node.nodeType === 8 /* COMMENT */;
5971
6044
  function createHydrationFunctions(rendererInternals) {
5972
6045
  const {
@@ -6045,11 +6118,13 @@ If you want to remount the same app, move your app creation logic into a factory
6045
6118
  if (node.data !== vnode.children) {
6046
6119
  hasMismatch = true;
6047
6120
  warn(
6048
- `Hydration text mismatch:
6049
- - Server rendered: ${JSON.stringify(
6121
+ `Hydration text mismatch in`,
6122
+ node.parentNode,
6123
+ `
6124
+ - rendered on server: ${JSON.stringify(
6050
6125
  node.data
6051
6126
  )}
6052
- - Client rendered: ${JSON.stringify(vnode.children)}`
6127
+ - expected on client: ${JSON.stringify(vnode.children)}`
6053
6128
  );
6054
6129
  node.data = vnode.children;
6055
6130
  }
@@ -6135,7 +6210,7 @@ If you want to remount the same app, move your app creation logic into a factory
6135
6210
  null,
6136
6211
  parentComponent,
6137
6212
  parentSuspense,
6138
- isSVGContainer(container),
6213
+ getContainerType(container),
6139
6214
  optimized
6140
6215
  );
6141
6216
  if (isAsyncWrapper(vnode)) {
@@ -6170,7 +6245,7 @@ If you want to remount the same app, move your app creation logic into a factory
6170
6245
  vnode,
6171
6246
  parentComponent,
6172
6247
  parentSuspense,
6173
- isSVGContainer(parentNode(node)),
6248
+ getContainerType(parentNode(node)),
6174
6249
  slotScopeIds,
6175
6250
  optimized,
6176
6251
  rendererInternals,
@@ -6193,38 +6268,6 @@ If you want to remount the same app, move your app creation logic into a factory
6193
6268
  if (dirs) {
6194
6269
  invokeDirectiveHook(vnode, null, parentComponent, "created");
6195
6270
  }
6196
- if (props) {
6197
- if (forcePatch || !optimized || patchFlag & (16 | 32)) {
6198
- for (const key in props) {
6199
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
6200
- key[0] === ".") {
6201
- patchProp(
6202
- el,
6203
- key,
6204
- null,
6205
- props[key],
6206
- false,
6207
- void 0,
6208
- parentComponent
6209
- );
6210
- }
6211
- }
6212
- } else if (props.onClick) {
6213
- patchProp(
6214
- el,
6215
- "onClick",
6216
- null,
6217
- props.onClick,
6218
- false,
6219
- void 0,
6220
- parentComponent
6221
- );
6222
- }
6223
- }
6224
- let vnodeHooks;
6225
- if (vnodeHooks = props && props.onVnodeBeforeMount) {
6226
- invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6227
- }
6228
6271
  let needCallTransitionHooks = false;
6229
6272
  if (isTemplateNode(el)) {
6230
6273
  needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
@@ -6235,16 +6278,6 @@ If you want to remount the same app, move your app creation logic into a factory
6235
6278
  replaceNode(content, el, parentComponent);
6236
6279
  vnode.el = el = content;
6237
6280
  }
6238
- if (dirs) {
6239
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6240
- }
6241
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
6242
- queueEffectWithSuspense(() => {
6243
- vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6244
- needCallTransitionHooks && transition.enter(el);
6245
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6246
- }, parentSuspense);
6247
- }
6248
6281
  if (shapeFlag & 16 && // skip if element has innerHTML / textContent
6249
6282
  !(props && (props.innerHTML || props.textContent))) {
6250
6283
  let next = hydrateChildren(
@@ -6261,7 +6294,10 @@ If you want to remount the same app, move your app creation logic into a factory
6261
6294
  hasMismatch = true;
6262
6295
  if (!hasWarned) {
6263
6296
  warn(
6264
- `Hydration children mismatch in <${vnode.type}>: server rendered element contains more child nodes than client vdom.`
6297
+ `Hydration children mismatch on`,
6298
+ el,
6299
+ `
6300
+ Server rendered element contains more child nodes than client vdom.`
6265
6301
  );
6266
6302
  hasWarned = true;
6267
6303
  }
@@ -6273,13 +6309,50 @@ If you want to remount the same app, move your app creation logic into a factory
6273
6309
  if (el.textContent !== vnode.children) {
6274
6310
  hasMismatch = true;
6275
6311
  warn(
6276
- `Hydration text content mismatch in <${vnode.type}>:
6277
- - Server rendered: ${el.textContent}
6278
- - Client rendered: ${vnode.children}`
6312
+ `Hydration text content mismatch on`,
6313
+ el,
6314
+ `
6315
+ - rendered on server: ${el.textContent}
6316
+ - expected on client: ${vnode.children}`
6279
6317
  );
6280
6318
  el.textContent = vnode.children;
6281
6319
  }
6282
6320
  }
6321
+ if (props) {
6322
+ {
6323
+ for (const key in props) {
6324
+ if (propHasMismatch(el, key, props[key])) {
6325
+ hasMismatch = true;
6326
+ }
6327
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
6328
+ key[0] === ".") {
6329
+ patchProp(
6330
+ el,
6331
+ key,
6332
+ null,
6333
+ props[key],
6334
+ void 0,
6335
+ void 0,
6336
+ parentComponent
6337
+ );
6338
+ }
6339
+ }
6340
+ }
6341
+ }
6342
+ let vnodeHooks;
6343
+ if (vnodeHooks = props && props.onVnodeBeforeMount) {
6344
+ invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6345
+ }
6346
+ if (dirs) {
6347
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6348
+ }
6349
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
6350
+ queueEffectWithSuspense(() => {
6351
+ vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6352
+ needCallTransitionHooks && transition.enter(el);
6353
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6354
+ }, parentSuspense);
6355
+ }
6283
6356
  }
6284
6357
  return el.nextSibling;
6285
6358
  };
@@ -6305,7 +6378,10 @@ If you want to remount the same app, move your app creation logic into a factory
6305
6378
  hasMismatch = true;
6306
6379
  if (!hasWarned) {
6307
6380
  warn(
6308
- `Hydration children mismatch in <${container.tagName.toLowerCase()}>: server rendered element contains fewer child nodes than client vdom.`
6381
+ `Hydration children mismatch on`,
6382
+ container,
6383
+ `
6384
+ Server rendered element contains fewer child nodes than client vdom.`
6309
6385
  );
6310
6386
  hasWarned = true;
6311
6387
  }
@@ -6316,7 +6392,7 @@ If you want to remount the same app, move your app creation logic into a factory
6316
6392
  null,
6317
6393
  parentComponent,
6318
6394
  parentSuspense,
6319
- isSVGContainer(container),
6395
+ getContainerType(container),
6320
6396
  slotScopeIds
6321
6397
  );
6322
6398
  }
@@ -6350,12 +6426,12 @@ If you want to remount the same app, move your app creation logic into a factory
6350
6426
  hasMismatch = true;
6351
6427
  warn(
6352
6428
  `Hydration node mismatch:
6353
- - Client vnode:`,
6354
- vnode.type,
6355
- `
6356
- - Server rendered DOM:`,
6429
+ - rendered on server:`,
6357
6430
  node,
6358
- node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``
6431
+ node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
6432
+ `
6433
+ - expected on client:`,
6434
+ vnode.type
6359
6435
  );
6360
6436
  vnode.el = null;
6361
6437
  if (isFragment) {
@@ -6379,7 +6455,7 @@ If you want to remount the same app, move your app creation logic into a factory
6379
6455
  next,
6380
6456
  parentComponent,
6381
6457
  parentSuspense,
6382
- isSVGContainer(container),
6458
+ getContainerType(container),
6383
6459
  slotScopeIds
6384
6460
  );
6385
6461
  return next;
@@ -6420,6 +6496,46 @@ If you want to remount the same app, move your app creation logic into a factory
6420
6496
  };
6421
6497
  return [hydrate, hydrateNode];
6422
6498
  }
6499
+ function propHasMismatch(el, key, clientValue) {
6500
+ let mismatchType;
6501
+ let mismatchKey;
6502
+ let actual;
6503
+ let expected;
6504
+ if (key === "class") {
6505
+ actual = el.className;
6506
+ expected = normalizeClass(clientValue);
6507
+ if (actual !== expected) {
6508
+ mismatchType = mismatchKey = `class`;
6509
+ }
6510
+ } else if (key === "style") {
6511
+ actual = el.getAttribute("style");
6512
+ expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
6513
+ if (actual !== expected) {
6514
+ mismatchType = mismatchKey = "style";
6515
+ }
6516
+ } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
6517
+ actual = el.hasAttribute(key) && el.getAttribute(key);
6518
+ expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? false : String(clientValue);
6519
+ if (actual !== expected) {
6520
+ mismatchType = `attribute`;
6521
+ mismatchKey = key;
6522
+ }
6523
+ }
6524
+ if (mismatchType) {
6525
+ const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
6526
+ warn(
6527
+ `Hydration ${mismatchType} mismatch on`,
6528
+ el,
6529
+ `
6530
+ - rendered on server: ${format(actual)}
6531
+ - expected on client: ${format(expected)}
6532
+ Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
6533
+ You should fix the source of the mismatch.`
6534
+ );
6535
+ return true;
6536
+ }
6537
+ return false;
6538
+ }
6423
6539
 
6424
6540
  let supported;
6425
6541
  let perf;
@@ -6488,7 +6604,7 @@ If you want to remount the same app, move your app creation logic into a factory
6488
6604
  setScopeId: hostSetScopeId = NOOP,
6489
6605
  insertStaticContent: hostInsertStaticContent
6490
6606
  } = options;
6491
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
6607
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
6492
6608
  if (n1 === n2) {
6493
6609
  return;
6494
6610
  }
@@ -6511,9 +6627,9 @@ If you want to remount the same app, move your app creation logic into a factory
6511
6627
  break;
6512
6628
  case Static:
6513
6629
  if (n1 == null) {
6514
- mountStaticNode(n2, container, anchor, isSVG);
6630
+ mountStaticNode(n2, container, anchor, namespace);
6515
6631
  } else {
6516
- patchStaticNode(n1, n2, container, isSVG);
6632
+ patchStaticNode(n1, n2, container, namespace);
6517
6633
  }
6518
6634
  break;
6519
6635
  case Fragment:
@@ -6524,7 +6640,7 @@ If you want to remount the same app, move your app creation logic into a factory
6524
6640
  anchor,
6525
6641
  parentComponent,
6526
6642
  parentSuspense,
6527
- isSVG,
6643
+ namespace,
6528
6644
  slotScopeIds,
6529
6645
  optimized
6530
6646
  );
@@ -6538,7 +6654,7 @@ If you want to remount the same app, move your app creation logic into a factory
6538
6654
  anchor,
6539
6655
  parentComponent,
6540
6656
  parentSuspense,
6541
- isSVG,
6657
+ namespace,
6542
6658
  slotScopeIds,
6543
6659
  optimized
6544
6660
  );
@@ -6550,7 +6666,7 @@ If you want to remount the same app, move your app creation logic into a factory
6550
6666
  anchor,
6551
6667
  parentComponent,
6552
6668
  parentSuspense,
6553
- isSVG,
6669
+ namespace,
6554
6670
  slotScopeIds,
6555
6671
  optimized
6556
6672
  );
@@ -6562,7 +6678,7 @@ If you want to remount the same app, move your app creation logic into a factory
6562
6678
  anchor,
6563
6679
  parentComponent,
6564
6680
  parentSuspense,
6565
- isSVG,
6681
+ namespace,
6566
6682
  slotScopeIds,
6567
6683
  optimized,
6568
6684
  internals
@@ -6575,7 +6691,7 @@ If you want to remount the same app, move your app creation logic into a factory
6575
6691
  anchor,
6576
6692
  parentComponent,
6577
6693
  parentSuspense,
6578
- isSVG,
6694
+ namespace,
6579
6695
  slotScopeIds,
6580
6696
  optimized,
6581
6697
  internals
@@ -6613,17 +6729,17 @@ If you want to remount the same app, move your app creation logic into a factory
6613
6729
  n2.el = n1.el;
6614
6730
  }
6615
6731
  };
6616
- const mountStaticNode = (n2, container, anchor, isSVG) => {
6732
+ const mountStaticNode = (n2, container, anchor, namespace) => {
6617
6733
  [n2.el, n2.anchor] = hostInsertStaticContent(
6618
6734
  n2.children,
6619
6735
  container,
6620
6736
  anchor,
6621
- isSVG,
6737
+ namespace,
6622
6738
  n2.el,
6623
6739
  n2.anchor
6624
6740
  );
6625
6741
  };
6626
- const patchStaticNode = (n1, n2, container, isSVG) => {
6742
+ const patchStaticNode = (n1, n2, container, namespace) => {
6627
6743
  if (n2.children !== n1.children) {
6628
6744
  const anchor = hostNextSibling(n1.anchor);
6629
6745
  removeStaticNode(n1);
@@ -6631,7 +6747,7 @@ If you want to remount the same app, move your app creation logic into a factory
6631
6747
  n2.children,
6632
6748
  container,
6633
6749
  anchor,
6634
- isSVG
6750
+ namespace
6635
6751
  );
6636
6752
  } else {
6637
6753
  n2.el = n1.el;
@@ -6656,8 +6772,12 @@ If you want to remount the same app, move your app creation logic into a factory
6656
6772
  }
6657
6773
  hostRemove(anchor);
6658
6774
  };
6659
- const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
6660
- isSVG = isSVG || n2.type === "svg";
6775
+ const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6776
+ if (n2.type === "svg") {
6777
+ namespace = "svg";
6778
+ } else if (n2.type === "math") {
6779
+ namespace = "mathml";
6780
+ }
6661
6781
  if (n1 == null) {
6662
6782
  mountElement(
6663
6783
  n2,
@@ -6665,7 +6785,7 @@ If you want to remount the same app, move your app creation logic into a factory
6665
6785
  anchor,
6666
6786
  parentComponent,
6667
6787
  parentSuspense,
6668
- isSVG,
6788
+ namespace,
6669
6789
  slotScopeIds,
6670
6790
  optimized
6671
6791
  );
@@ -6675,19 +6795,19 @@ If you want to remount the same app, move your app creation logic into a factory
6675
6795
  n2,
6676
6796
  parentComponent,
6677
6797
  parentSuspense,
6678
- isSVG,
6798
+ namespace,
6679
6799
  slotScopeIds,
6680
6800
  optimized
6681
6801
  );
6682
6802
  }
6683
6803
  };
6684
- const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
6804
+ const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6685
6805
  let el;
6686
6806
  let vnodeHook;
6687
- const { type, props, shapeFlag, transition, dirs } = vnode;
6807
+ const { props, shapeFlag, transition, dirs } = vnode;
6688
6808
  el = vnode.el = hostCreateElement(
6689
6809
  vnode.type,
6690
- isSVG,
6810
+ namespace,
6691
6811
  props && props.is,
6692
6812
  props
6693
6813
  );
@@ -6700,7 +6820,7 @@ If you want to remount the same app, move your app creation logic into a factory
6700
6820
  null,
6701
6821
  parentComponent,
6702
6822
  parentSuspense,
6703
- isSVG && type !== "foreignObject",
6823
+ resolveChildrenNamespace(vnode, namespace),
6704
6824
  slotScopeIds,
6705
6825
  optimized
6706
6826
  );
@@ -6717,7 +6837,7 @@ If you want to remount the same app, move your app creation logic into a factory
6717
6837
  key,
6718
6838
  null,
6719
6839
  props[key],
6720
- isSVG,
6840
+ namespace,
6721
6841
  vnode.children,
6722
6842
  parentComponent,
6723
6843
  parentSuspense,
@@ -6726,7 +6846,7 @@ If you want to remount the same app, move your app creation logic into a factory
6726
6846
  }
6727
6847
  }
6728
6848
  if ("value" in props) {
6729
- hostPatchProp(el, "value", null, props.value);
6849
+ hostPatchProp(el, "value", null, props.value, namespace);
6730
6850
  }
6731
6851
  if (vnodeHook = props.onVnodeBeforeMount) {
6732
6852
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -6784,7 +6904,7 @@ If you want to remount the same app, move your app creation logic into a factory
6784
6904
  }
6785
6905
  }
6786
6906
  };
6787
- const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {
6907
+ const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
6788
6908
  for (let i = start; i < children.length; i++) {
6789
6909
  const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
6790
6910
  patch(
@@ -6794,13 +6914,13 @@ If you want to remount the same app, move your app creation logic into a factory
6794
6914
  anchor,
6795
6915
  parentComponent,
6796
6916
  parentSuspense,
6797
- isSVG,
6917
+ namespace,
6798
6918
  slotScopeIds,
6799
6919
  optimized
6800
6920
  );
6801
6921
  }
6802
6922
  };
6803
- const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
6923
+ const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6804
6924
  const el = n2.el = n1.el;
6805
6925
  let { patchFlag, dynamicChildren, dirs } = n2;
6806
6926
  patchFlag |= n1.patchFlag & 16;
@@ -6820,7 +6940,6 @@ If you want to remount the same app, move your app creation logic into a factory
6820
6940
  optimized = false;
6821
6941
  dynamicChildren = null;
6822
6942
  }
6823
- const areChildrenSVG = isSVG && n2.type !== "foreignObject";
6824
6943
  if (dynamicChildren) {
6825
6944
  patchBlockChildren(
6826
6945
  n1.dynamicChildren,
@@ -6828,7 +6947,7 @@ If you want to remount the same app, move your app creation logic into a factory
6828
6947
  el,
6829
6948
  parentComponent,
6830
6949
  parentSuspense,
6831
- areChildrenSVG,
6950
+ resolveChildrenNamespace(n2, namespace),
6832
6951
  slotScopeIds
6833
6952
  );
6834
6953
  {
@@ -6842,7 +6961,7 @@ If you want to remount the same app, move your app creation logic into a factory
6842
6961
  null,
6843
6962
  parentComponent,
6844
6963
  parentSuspense,
6845
- areChildrenSVG,
6964
+ resolveChildrenNamespace(n2, namespace),
6846
6965
  slotScopeIds,
6847
6966
  false
6848
6967
  );
@@ -6856,16 +6975,16 @@ If you want to remount the same app, move your app creation logic into a factory
6856
6975
  newProps,
6857
6976
  parentComponent,
6858
6977
  parentSuspense,
6859
- isSVG
6978
+ namespace
6860
6979
  );
6861
6980
  } else {
6862
6981
  if (patchFlag & 2) {
6863
6982
  if (oldProps.class !== newProps.class) {
6864
- hostPatchProp(el, "class", null, newProps.class, isSVG);
6983
+ hostPatchProp(el, "class", null, newProps.class, namespace);
6865
6984
  }
6866
6985
  }
6867
6986
  if (patchFlag & 4) {
6868
- hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);
6987
+ hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
6869
6988
  }
6870
6989
  if (patchFlag & 8) {
6871
6990
  const propsToUpdate = n2.dynamicProps;
@@ -6879,7 +6998,7 @@ If you want to remount the same app, move your app creation logic into a factory
6879
6998
  key,
6880
6999
  prev,
6881
7000
  next,
6882
- isSVG,
7001
+ namespace,
6883
7002
  n1.children,
6884
7003
  parentComponent,
6885
7004
  parentSuspense,
@@ -6902,7 +7021,7 @@ If you want to remount the same app, move your app creation logic into a factory
6902
7021
  newProps,
6903
7022
  parentComponent,
6904
7023
  parentSuspense,
6905
- isSVG
7024
+ namespace
6906
7025
  );
6907
7026
  }
6908
7027
  if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
@@ -6912,7 +7031,7 @@ If you want to remount the same app, move your app creation logic into a factory
6912
7031
  }, parentSuspense);
6913
7032
  }
6914
7033
  };
6915
- const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {
7034
+ const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
6916
7035
  for (let i = 0; i < newChildren.length; i++) {
6917
7036
  const oldVNode = oldChildren[i];
6918
7037
  const newVNode = newChildren[i];
@@ -6937,13 +7056,13 @@ If you want to remount the same app, move your app creation logic into a factory
6937
7056
  null,
6938
7057
  parentComponent,
6939
7058
  parentSuspense,
6940
- isSVG,
7059
+ namespace,
6941
7060
  slotScopeIds,
6942
7061
  true
6943
7062
  );
6944
7063
  }
6945
7064
  };
6946
- const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
7065
+ const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
6947
7066
  if (oldProps !== newProps) {
6948
7067
  if (oldProps !== EMPTY_OBJ) {
6949
7068
  for (const key in oldProps) {
@@ -6953,7 +7072,7 @@ If you want to remount the same app, move your app creation logic into a factory
6953
7072
  key,
6954
7073
  oldProps[key],
6955
7074
  null,
6956
- isSVG,
7075
+ namespace,
6957
7076
  vnode.children,
6958
7077
  parentComponent,
6959
7078
  parentSuspense,
@@ -6973,7 +7092,7 @@ If you want to remount the same app, move your app creation logic into a factory
6973
7092
  key,
6974
7093
  prev,
6975
7094
  next,
6976
- isSVG,
7095
+ namespace,
6977
7096
  vnode.children,
6978
7097
  parentComponent,
6979
7098
  parentSuspense,
@@ -6982,11 +7101,11 @@ If you want to remount the same app, move your app creation logic into a factory
6982
7101
  }
6983
7102
  }
6984
7103
  if ("value" in newProps) {
6985
- hostPatchProp(el, "value", oldProps.value, newProps.value);
7104
+ hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
6986
7105
  }
6987
7106
  }
6988
7107
  };
6989
- const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
7108
+ const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6990
7109
  const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
6991
7110
  const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
6992
7111
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
@@ -7010,7 +7129,7 @@ If you want to remount the same app, move your app creation logic into a factory
7010
7129
  fragmentEndAnchor,
7011
7130
  parentComponent,
7012
7131
  parentSuspense,
7013
- isSVG,
7132
+ namespace,
7014
7133
  slotScopeIds,
7015
7134
  optimized
7016
7135
  );
@@ -7024,7 +7143,7 @@ If you want to remount the same app, move your app creation logic into a factory
7024
7143
  container,
7025
7144
  parentComponent,
7026
7145
  parentSuspense,
7027
- isSVG,
7146
+ namespace,
7028
7147
  slotScopeIds
7029
7148
  );
7030
7149
  {
@@ -7038,14 +7157,14 @@ If you want to remount the same app, move your app creation logic into a factory
7038
7157
  fragmentEndAnchor,
7039
7158
  parentComponent,
7040
7159
  parentSuspense,
7041
- isSVG,
7160
+ namespace,
7042
7161
  slotScopeIds,
7043
7162
  optimized
7044
7163
  );
7045
7164
  }
7046
7165
  }
7047
7166
  };
7048
- const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
7167
+ const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7049
7168
  n2.slotScopeIds = slotScopeIds;
7050
7169
  if (n1 == null) {
7051
7170
  if (n2.shapeFlag & 512) {
@@ -7053,7 +7172,7 @@ If you want to remount the same app, move your app creation logic into a factory
7053
7172
  n2,
7054
7173
  container,
7055
7174
  anchor,
7056
- isSVG,
7175
+ namespace,
7057
7176
  optimized
7058
7177
  );
7059
7178
  } else {
@@ -7063,7 +7182,7 @@ If you want to remount the same app, move your app creation logic into a factory
7063
7182
  anchor,
7064
7183
  parentComponent,
7065
7184
  parentSuspense,
7066
- isSVG,
7185
+ namespace,
7067
7186
  optimized
7068
7187
  );
7069
7188
  }
@@ -7071,7 +7190,7 @@ If you want to remount the same app, move your app creation logic into a factory
7071
7190
  updateComponent(n1, n2, optimized);
7072
7191
  }
7073
7192
  };
7074
- const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
7193
+ const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
7075
7194
  const instance = (initialVNode.component = createComponentInstance(
7076
7195
  initialVNode,
7077
7196
  parentComponent,
@@ -7102,17 +7221,17 @@ If you want to remount the same app, move your app creation logic into a factory
7102
7221
  const placeholder = instance.subTree = createVNode(Comment);
7103
7222
  processCommentNode(null, placeholder, container, anchor);
7104
7223
  }
7105
- return;
7224
+ } else {
7225
+ setupRenderEffect(
7226
+ instance,
7227
+ initialVNode,
7228
+ container,
7229
+ anchor,
7230
+ parentSuspense,
7231
+ namespace,
7232
+ optimized
7233
+ );
7106
7234
  }
7107
- setupRenderEffect(
7108
- instance,
7109
- initialVNode,
7110
- container,
7111
- anchor,
7112
- parentSuspense,
7113
- isSVG,
7114
- optimized
7115
- );
7116
7235
  {
7117
7236
  popWarningContext();
7118
7237
  endMeasure(instance, `mount`);
@@ -7141,7 +7260,7 @@ If you want to remount the same app, move your app creation logic into a factory
7141
7260
  instance.vnode = n2;
7142
7261
  }
7143
7262
  };
7144
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {
7263
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
7145
7264
  const componentUpdateFn = () => {
7146
7265
  if (!instance.isMounted) {
7147
7266
  let vnodeHook;
@@ -7208,7 +7327,7 @@ If you want to remount the same app, move your app creation logic into a factory
7208
7327
  anchor,
7209
7328
  instance,
7210
7329
  parentSuspense,
7211
- isSVG
7330
+ namespace
7212
7331
  );
7213
7332
  {
7214
7333
  endMeasure(instance, `patch`);
@@ -7235,6 +7354,21 @@ If you want to remount the same app, move your app creation logic into a factory
7235
7354
  initialVNode = container = anchor = null;
7236
7355
  } else {
7237
7356
  let { next, bu, u, parent, vnode } = instance;
7357
+ {
7358
+ const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
7359
+ if (nonHydratedAsyncRoot) {
7360
+ if (next) {
7361
+ next.el = vnode.el;
7362
+ updateComponentPreRender(instance, next, optimized);
7363
+ }
7364
+ nonHydratedAsyncRoot.asyncDep.then(() => {
7365
+ if (!instance.isUnmounted) {
7366
+ componentUpdateFn();
7367
+ }
7368
+ });
7369
+ return;
7370
+ }
7371
+ }
7238
7372
  let originNext = next;
7239
7373
  let vnodeHook;
7240
7374
  {
@@ -7275,7 +7409,7 @@ If you want to remount the same app, move your app creation logic into a factory
7275
7409
  getNextHostNode(prevTree),
7276
7410
  instance,
7277
7411
  parentSuspense,
7278
- isSVG
7412
+ namespace
7279
7413
  );
7280
7414
  {
7281
7415
  endMeasure(instance, `patch`);
@@ -7330,10 +7464,10 @@ If you want to remount the same app, move your app creation logic into a factory
7330
7464
  updateProps(instance, nextVNode.props, prevProps, optimized);
7331
7465
  updateSlots(instance, nextVNode.children, optimized);
7332
7466
  pauseTracking();
7333
- flushPreFlushCbs();
7467
+ flushPreFlushCbs(instance);
7334
7468
  resetTracking();
7335
7469
  };
7336
- const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
7470
+ const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
7337
7471
  const c1 = n1 && n1.children;
7338
7472
  const prevShapeFlag = n1 ? n1.shapeFlag : 0;
7339
7473
  const c2 = n2.children;
@@ -7347,7 +7481,7 @@ If you want to remount the same app, move your app creation logic into a factory
7347
7481
  anchor,
7348
7482
  parentComponent,
7349
7483
  parentSuspense,
7350
- isSVG,
7484
+ namespace,
7351
7485
  slotScopeIds,
7352
7486
  optimized
7353
7487
  );
@@ -7360,7 +7494,7 @@ If you want to remount the same app, move your app creation logic into a factory
7360
7494
  anchor,
7361
7495
  parentComponent,
7362
7496
  parentSuspense,
7363
- isSVG,
7497
+ namespace,
7364
7498
  slotScopeIds,
7365
7499
  optimized
7366
7500
  );
@@ -7384,7 +7518,7 @@ If you want to remount the same app, move your app creation logic into a factory
7384
7518
  anchor,
7385
7519
  parentComponent,
7386
7520
  parentSuspense,
7387
- isSVG,
7521
+ namespace,
7388
7522
  slotScopeIds,
7389
7523
  optimized
7390
7524
  );
@@ -7402,7 +7536,7 @@ If you want to remount the same app, move your app creation logic into a factory
7402
7536
  anchor,
7403
7537
  parentComponent,
7404
7538
  parentSuspense,
7405
- isSVG,
7539
+ namespace,
7406
7540
  slotScopeIds,
7407
7541
  optimized
7408
7542
  );
@@ -7410,7 +7544,7 @@ If you want to remount the same app, move your app creation logic into a factory
7410
7544
  }
7411
7545
  }
7412
7546
  };
7413
- const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
7547
+ const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7414
7548
  c1 = c1 || EMPTY_ARR;
7415
7549
  c2 = c2 || EMPTY_ARR;
7416
7550
  const oldLength = c1.length;
@@ -7426,7 +7560,7 @@ If you want to remount the same app, move your app creation logic into a factory
7426
7560
  null,
7427
7561
  parentComponent,
7428
7562
  parentSuspense,
7429
- isSVG,
7563
+ namespace,
7430
7564
  slotScopeIds,
7431
7565
  optimized
7432
7566
  );
@@ -7447,14 +7581,14 @@ If you want to remount the same app, move your app creation logic into a factory
7447
7581
  anchor,
7448
7582
  parentComponent,
7449
7583
  parentSuspense,
7450
- isSVG,
7584
+ namespace,
7451
7585
  slotScopeIds,
7452
7586
  optimized,
7453
7587
  commonLength
7454
7588
  );
7455
7589
  }
7456
7590
  };
7457
- const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
7591
+ const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7458
7592
  let i = 0;
7459
7593
  const l2 = c2.length;
7460
7594
  let e1 = c1.length - 1;
@@ -7470,7 +7604,7 @@ If you want to remount the same app, move your app creation logic into a factory
7470
7604
  null,
7471
7605
  parentComponent,
7472
7606
  parentSuspense,
7473
- isSVG,
7607
+ namespace,
7474
7608
  slotScopeIds,
7475
7609
  optimized
7476
7610
  );
@@ -7490,7 +7624,7 @@ If you want to remount the same app, move your app creation logic into a factory
7490
7624
  null,
7491
7625
  parentComponent,
7492
7626
  parentSuspense,
7493
- isSVG,
7627
+ namespace,
7494
7628
  slotScopeIds,
7495
7629
  optimized
7496
7630
  );
@@ -7512,7 +7646,7 @@ If you want to remount the same app, move your app creation logic into a factory
7512
7646
  anchor,
7513
7647
  parentComponent,
7514
7648
  parentSuspense,
7515
- isSVG,
7649
+ namespace,
7516
7650
  slotScopeIds,
7517
7651
  optimized
7518
7652
  );
@@ -7582,7 +7716,7 @@ If you want to remount the same app, move your app creation logic into a factory
7582
7716
  null,
7583
7717
  parentComponent,
7584
7718
  parentSuspense,
7585
- isSVG,
7719
+ namespace,
7586
7720
  slotScopeIds,
7587
7721
  optimized
7588
7722
  );
@@ -7603,7 +7737,7 @@ If you want to remount the same app, move your app creation logic into a factory
7603
7737
  anchor,
7604
7738
  parentComponent,
7605
7739
  parentSuspense,
7606
- isSVG,
7740
+ namespace,
7607
7741
  slotScopeIds,
7608
7742
  optimized
7609
7743
  );
@@ -7824,13 +7958,21 @@ If you want to remount the same app, move your app creation logic into a factory
7824
7958
  }
7825
7959
  return hostNextSibling(vnode.anchor || vnode.el);
7826
7960
  };
7827
- const render = (vnode, container, isSVG) => {
7961
+ const render = (vnode, container, namespace) => {
7828
7962
  if (vnode == null) {
7829
7963
  if (container._vnode) {
7830
7964
  unmount(container._vnode, null, null, true);
7831
7965
  }
7832
7966
  } else {
7833
- patch(container._vnode || null, vnode, container, null, null, null, isSVG);
7967
+ patch(
7968
+ container._vnode || null,
7969
+ vnode,
7970
+ container,
7971
+ null,
7972
+ null,
7973
+ null,
7974
+ namespace
7975
+ );
7834
7976
  }
7835
7977
  flushPreFlushCbs();
7836
7978
  flushPostFlushCbs();
@@ -7861,6 +8003,9 @@ If you want to remount the same app, move your app creation logic into a factory
7861
8003
  createApp: createAppAPI(render, hydrate)
7862
8004
  };
7863
8005
  }
8006
+ function resolveChildrenNamespace({ type, props }, currentNamespace) {
8007
+ return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
8008
+ }
7864
8009
  function toggleRecurse({ effect, update }, allowed) {
7865
8010
  effect.allowRecurse = update.allowRecurse = allowed;
7866
8011
  }
@@ -7931,10 +8076,21 @@ If you want to remount the same app, move your app creation logic into a factory
7931
8076
  }
7932
8077
  return result;
7933
8078
  }
8079
+ function locateNonHydratedAsyncRoot(instance) {
8080
+ const subComponent = instance.subTree.component;
8081
+ if (subComponent) {
8082
+ if (subComponent.asyncDep && !subComponent.asyncResolved) {
8083
+ return subComponent;
8084
+ } else {
8085
+ return locateNonHydratedAsyncRoot(subComponent);
8086
+ }
8087
+ }
8088
+ }
7934
8089
 
7935
8090
  const isTeleport = (type) => type.__isTeleport;
7936
8091
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
7937
8092
  const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
8093
+ const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
7938
8094
  const resolveTarget = (props, select) => {
7939
8095
  const targetSelector = props && props.to;
7940
8096
  if (isString(targetSelector)) {
@@ -7962,7 +8118,7 @@ If you want to remount the same app, move your app creation logic into a factory
7962
8118
  const TeleportImpl = {
7963
8119
  name: "Teleport",
7964
8120
  __isTeleport: true,
7965
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
8121
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
7966
8122
  const {
7967
8123
  mc: mountChildren,
7968
8124
  pc: patchChildren,
@@ -7984,7 +8140,11 @@ If you want to remount the same app, move your app creation logic into a factory
7984
8140
  const targetAnchor = n2.targetAnchor = createText("");
7985
8141
  if (target) {
7986
8142
  insert(targetAnchor, target);
7987
- isSVG = isSVG || isTargetSVG(target);
8143
+ if (namespace === "svg" || isTargetSVG(target)) {
8144
+ namespace = "svg";
8145
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
8146
+ namespace = "mathml";
8147
+ }
7988
8148
  } else if (!disabled) {
7989
8149
  warn("Invalid Teleport target on mount:", target, `(${typeof target})`);
7990
8150
  }
@@ -7996,7 +8156,7 @@ If you want to remount the same app, move your app creation logic into a factory
7996
8156
  anchor2,
7997
8157
  parentComponent,
7998
8158
  parentSuspense,
7999
- isSVG,
8159
+ namespace,
8000
8160
  slotScopeIds,
8001
8161
  optimized
8002
8162
  );
@@ -8015,7 +8175,11 @@ If you want to remount the same app, move your app creation logic into a factory
8015
8175
  const wasDisabled = isTeleportDisabled(n1.props);
8016
8176
  const currentContainer = wasDisabled ? container : target;
8017
8177
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
8018
- isSVG = isSVG || isTargetSVG(target);
8178
+ if (namespace === "svg" || isTargetSVG(target)) {
8179
+ namespace = "svg";
8180
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
8181
+ namespace = "mathml";
8182
+ }
8019
8183
  if (dynamicChildren) {
8020
8184
  patchBlockChildren(
8021
8185
  n1.dynamicChildren,
@@ -8023,7 +8187,7 @@ If you want to remount the same app, move your app creation logic into a factory
8023
8187
  currentContainer,
8024
8188
  parentComponent,
8025
8189
  parentSuspense,
8026
- isSVG,
8190
+ namespace,
8027
8191
  slotScopeIds
8028
8192
  );
8029
8193
  traverseStaticChildren(n1, n2, true);
@@ -8035,7 +8199,7 @@ If you want to remount the same app, move your app creation logic into a factory
8035
8199
  currentAnchor,
8036
8200
  parentComponent,
8037
8201
  parentSuspense,
8038
- isSVG,
8202
+ namespace,
8039
8203
  slotScopeIds,
8040
8204
  false
8041
8205
  );
@@ -8658,10 +8822,14 @@ Component that was made reactive: `,
8658
8822
  let currentInstance = null;
8659
8823
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
8660
8824
  let internalSetCurrentInstance;
8825
+ let setInSSRSetupState;
8661
8826
  {
8662
8827
  internalSetCurrentInstance = (i) => {
8663
8828
  currentInstance = i;
8664
8829
  };
8830
+ setInSSRSetupState = (v) => {
8831
+ isInSSRComponentSetup = v;
8832
+ };
8665
8833
  }
8666
8834
  const setCurrentInstance = (instance) => {
8667
8835
  internalSetCurrentInstance(instance);
@@ -8685,13 +8853,13 @@ Component that was made reactive: `,
8685
8853
  }
8686
8854
  let isInSSRComponentSetup = false;
8687
8855
  function setupComponent(instance, isSSR = false) {
8688
- isInSSRComponentSetup = isSSR;
8856
+ isSSR && setInSSRSetupState(isSSR);
8689
8857
  const { props, children } = instance.vnode;
8690
8858
  const isStateful = isStatefulComponent(instance);
8691
8859
  initProps(instance, props, isStateful, isSSR);
8692
8860
  initSlots(instance, children);
8693
8861
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
8694
- isInSSRComponentSetup = false;
8862
+ isSSR && setInSSRSetupState(false);
8695
8863
  return setupResult;
8696
8864
  }
8697
8865
  function setupStatefulComponent(instance, isSSR) {
@@ -9197,7 +9365,7 @@ Component that was made reactive: `,
9197
9365
  return true;
9198
9366
  }
9199
9367
 
9200
- const version = "3.4.0-alpha.4";
9368
+ const version = "3.4.0-beta.2";
9201
9369
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9202
9370
  const ssrUtils = null;
9203
9371
  const resolveFilter = null;
@@ -9205,6 +9373,7 @@ Component that was made reactive: `,
9205
9373
  const DeprecationTypes = null;
9206
9374
 
9207
9375
  const svgNS = "http://www.w3.org/2000/svg";
9376
+ const mathmlNS = "http://www.w3.org/1998/Math/MathML";
9208
9377
  const doc = typeof document !== "undefined" ? document : null;
9209
9378
  const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
9210
9379
  const nodeOps = {
@@ -9217,8 +9386,8 @@ Component that was made reactive: `,
9217
9386
  parent.removeChild(child);
9218
9387
  }
9219
9388
  },
9220
- createElement: (tag, isSVG, is, props) => {
9221
- const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0);
9389
+ createElement: (tag, namespace, is, props) => {
9390
+ const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
9222
9391
  if (tag === "select" && props && props.multiple != null) {
9223
9392
  el.setAttribute("multiple", props.multiple);
9224
9393
  }
@@ -9242,7 +9411,7 @@ Component that was made reactive: `,
9242
9411
  // Reason: innerHTML.
9243
9412
  // Static content here can only come from compiled templates.
9244
9413
  // As long as the user only uses trusted templates, this is safe.
9245
- insertStaticContent(content, parent, anchor, isSVG, start, end) {
9414
+ insertStaticContent(content, parent, anchor, namespace, start, end) {
9246
9415
  const before = anchor ? anchor.previousSibling : parent.lastChild;
9247
9416
  if (start && (start === end || start.nextSibling)) {
9248
9417
  while (true) {
@@ -9251,9 +9420,9 @@ Component that was made reactive: `,
9251
9420
  break;
9252
9421
  }
9253
9422
  } else {
9254
- templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content;
9423
+ templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
9255
9424
  const template = templateContainer.content;
9256
- if (isSVG) {
9425
+ if (namespace === "svg" || namespace === "mathml") {
9257
9426
  const wrapper = template.firstChild;
9258
9427
  while (wrapper.firstChild) {
9259
9428
  template.appendChild(wrapper.firstChild);
@@ -9813,7 +9982,8 @@ Component that was made reactive: `,
9813
9982
 
9814
9983
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
9815
9984
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
9816
- const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
9985
+ const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
9986
+ const isSVG = namespace === "svg";
9817
9987
  if (key === "class") {
9818
9988
  patchClass(el, nextValue, isSVG);
9819
9989
  } else if (key === "style") {
@@ -9865,7 +10035,9 @@ Component that was made reactive: `,
9865
10035
  }
9866
10036
  if (key === "width" || key === "height") {
9867
10037
  const tag = el.tagName;
9868
- return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
10038
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
10039
+ return false;
10040
+ }
9869
10041
  }
9870
10042
  if (isNativeOn(key) && isString(value)) {
9871
10043
  return false;
@@ -10599,7 +10771,7 @@ Component that was made reactive: `,
10599
10771
  component.template = container.innerHTML;
10600
10772
  }
10601
10773
  container.innerHTML = "";
10602
- const proxy = mount(container, false, container instanceof SVGElement);
10774
+ const proxy = mount(container, false, resolveRootNamespace(container));
10603
10775
  if (container instanceof Element) {
10604
10776
  container.removeAttribute("v-cloak");
10605
10777
  container.setAttribute("data-v-app", "");
@@ -10618,14 +10790,22 @@ Component that was made reactive: `,
10618
10790
  app.mount = (containerOrSelector) => {
10619
10791
  const container = normalizeContainer(containerOrSelector);
10620
10792
  if (container) {
10621
- return mount(container, true, container instanceof SVGElement);
10793
+ return mount(container, true, resolveRootNamespace(container));
10622
10794
  }
10623
10795
  };
10624
10796
  return app;
10625
10797
  };
10798
+ function resolveRootNamespace(container) {
10799
+ if (container instanceof SVGElement) {
10800
+ return "svg";
10801
+ }
10802
+ if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
10803
+ return "mathml";
10804
+ }
10805
+ }
10626
10806
  function injectNativeTagCheck(app) {
10627
10807
  Object.defineProperty(app.config, "isNativeTag", {
10628
- value: (tag) => isHTMLTag(tag) || isSVGTag(tag),
10808
+ value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
10629
10809
  writable: false
10630
10810
  });
10631
10811
  }