@vue/runtime-dom 3.4.0-alpha.3 → 3.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,8 +8,8 @@ const EMPTY_ARR = Object.freeze([]) ;
8
8
  const NOOP = () => {
9
9
  };
10
10
  const NO = () => false;
11
- const onRE = /^on[^a-z]/;
12
- const isOn = (key) => onRE.test(key);
11
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
12
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
13
13
  const isModelListener = (key) => key.startsWith("onUpdate:");
14
14
  const extend = Object.assign;
15
15
  const remove = (arr, el) => {
@@ -94,7 +94,7 @@ const getGlobalThis = () => {
94
94
  return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
95
95
  };
96
96
 
97
- const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
97
+ const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
98
98
  const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
99
99
 
100
100
  function normalizeStyle(value) {
@@ -127,6 +127,20 @@ function parseStringStyle(cssText) {
127
127
  });
128
128
  return ret;
129
129
  }
130
+ function stringifyStyle(styles) {
131
+ let ret = "";
132
+ if (!styles || isString(styles)) {
133
+ return ret;
134
+ }
135
+ for (const key in styles) {
136
+ const value = styles[key];
137
+ const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
138
+ if (isString(value) || typeof value === "number") {
139
+ ret += `${normalizedKey}:${value};`;
140
+ }
141
+ }
142
+ return ret;
143
+ }
130
144
  function normalizeClass(value) {
131
145
  let res = "";
132
146
  if (isString(value)) {
@@ -162,14 +176,25 @@ function normalizeProps(props) {
162
176
 
163
177
  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";
164
178
  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";
179
+ 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";
165
180
  const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
166
181
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
182
+ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
167
183
 
168
184
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
169
185
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
186
+ const isBooleanAttr = /* @__PURE__ */ makeMap(
187
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
188
+ );
170
189
  function includeBooleanAttr(value) {
171
190
  return !!value || value === "";
172
191
  }
192
+ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
193
+ `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`
194
+ );
195
+ const isKnownSvgAttr = /* @__PURE__ */ makeMap(
196
+ `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`
197
+ );
173
198
 
174
199
  function looseCompareArrays(a, b) {
175
200
  if (a.length !== b.length)
@@ -231,20 +256,29 @@ const replacer = (_key, val) => {
231
256
  return replacer(_key, val.value);
232
257
  } else if (isMap(val)) {
233
258
  return {
234
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
235
- entries[`${key} =>`] = val2;
236
- return entries;
237
- }, {})
259
+ [`Map(${val.size})`]: [...val.entries()].reduce(
260
+ (entries, [key, val2], i) => {
261
+ entries[stringifySymbol(key, i) + " =>"] = val2;
262
+ return entries;
263
+ },
264
+ {}
265
+ )
238
266
  };
239
267
  } else if (isSet(val)) {
240
268
  return {
241
- [`Set(${val.size})`]: [...val.values()]
269
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
242
270
  };
271
+ } else if (isSymbol(val)) {
272
+ return stringifySymbol(val);
243
273
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
244
274
  return String(val);
245
275
  }
246
276
  return val;
247
277
  };
278
+ const stringifySymbol = (v, i = "") => {
279
+ var _a;
280
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
281
+ };
248
282
 
249
283
  function warn$1(msg, ...args) {
250
284
  console.warn(`[Vue warn] ${msg}`, ...args);
@@ -693,8 +727,13 @@ class BaseReactiveHandler {
693
727
  return isReadonly2;
694
728
  } else if (key === "__v_isShallow") {
695
729
  return shallow;
696
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
697
- return target;
730
+ } else if (key === "__v_raw") {
731
+ if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
732
+ // this means the reciever is a user proxy of the reactive proxy
733
+ Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
734
+ return target;
735
+ }
736
+ return;
698
737
  }
699
738
  const targetIsArray = isArray(target);
700
739
  if (!isReadonly2) {
@@ -730,17 +769,19 @@ class MutableReactiveHandler extends BaseReactiveHandler {
730
769
  }
731
770
  set(target, key, value, receiver) {
732
771
  let oldValue = target[key];
733
- if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
734
- return false;
735
- }
736
772
  if (!this._shallow) {
773
+ const isOldValueReadonly = isReadonly(oldValue);
737
774
  if (!isShallow(value) && !isReadonly(value)) {
738
775
  oldValue = toRaw(oldValue);
739
776
  value = toRaw(value);
740
777
  }
741
778
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
742
- oldValue.value = value;
743
- return true;
779
+ if (isOldValueReadonly) {
780
+ return false;
781
+ } else {
782
+ oldValue.value = value;
783
+ return true;
784
+ }
744
785
  }
745
786
  }
746
787
  const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
@@ -1433,6 +1474,18 @@ function propertyToRef(source, key, defaultValue) {
1433
1474
  return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1434
1475
  }
1435
1476
 
1477
+ const TrackOpTypes = {
1478
+ "GET": "get",
1479
+ "HAS": "has",
1480
+ "ITERATE": "iterate"
1481
+ };
1482
+ const TriggerOpTypes = {
1483
+ "SET": "set",
1484
+ "ADD": "add",
1485
+ "DELETE": "delete",
1486
+ "CLEAR": "clear"
1487
+ };
1488
+
1436
1489
  const stack = [];
1437
1490
  function pushWarningContext(vnode) {
1438
1491
  stack.push(vnode);
@@ -1547,6 +1600,38 @@ function assertNumber(val, type) {
1547
1600
  }
1548
1601
  }
1549
1602
 
1603
+ const ErrorCodes = {
1604
+ "SETUP_FUNCTION": 0,
1605
+ "0": "SETUP_FUNCTION",
1606
+ "RENDER_FUNCTION": 1,
1607
+ "1": "RENDER_FUNCTION",
1608
+ "WATCH_GETTER": 2,
1609
+ "2": "WATCH_GETTER",
1610
+ "WATCH_CALLBACK": 3,
1611
+ "3": "WATCH_CALLBACK",
1612
+ "WATCH_CLEANUP": 4,
1613
+ "4": "WATCH_CLEANUP",
1614
+ "NATIVE_EVENT_HANDLER": 5,
1615
+ "5": "NATIVE_EVENT_HANDLER",
1616
+ "COMPONENT_EVENT_HANDLER": 6,
1617
+ "6": "COMPONENT_EVENT_HANDLER",
1618
+ "VNODE_HOOK": 7,
1619
+ "7": "VNODE_HOOK",
1620
+ "DIRECTIVE_HOOK": 8,
1621
+ "8": "DIRECTIVE_HOOK",
1622
+ "TRANSITION_HOOK": 9,
1623
+ "9": "TRANSITION_HOOK",
1624
+ "APP_ERROR_HANDLER": 10,
1625
+ "10": "APP_ERROR_HANDLER",
1626
+ "APP_WARN_HANDLER": 11,
1627
+ "11": "APP_WARN_HANDLER",
1628
+ "FUNCTION_REF": 12,
1629
+ "12": "FUNCTION_REF",
1630
+ "ASYNC_COMPONENT_LOADER": 13,
1631
+ "13": "ASYNC_COMPONENT_LOADER",
1632
+ "SCHEDULER": 14,
1633
+ "14": "SCHEDULER"
1634
+ };
1550
1635
  const ErrorTypeStrings$1 = {
1551
1636
  ["sp"]: "serverPrefetch hook",
1552
1637
  ["bc"]: "beforeCreate hook",
@@ -1718,13 +1803,16 @@ function queuePostFlushCb(cb) {
1718
1803
  }
1719
1804
  queueFlush();
1720
1805
  }
1721
- function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
1806
+ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1722
1807
  {
1723
1808
  seen = seen || /* @__PURE__ */ new Map();
1724
1809
  }
1725
1810
  for (; i < queue.length; i++) {
1726
1811
  const cb = queue[i];
1727
1812
  if (cb && cb.pre) {
1813
+ if (instance && cb.id !== instance.uid) {
1814
+ continue;
1815
+ }
1728
1816
  if (checkRecursiveUpdates(seen, cb)) {
1729
1817
  continue;
1730
1818
  }
@@ -2484,9 +2572,17 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
2484
2572
  return false;
2485
2573
  }
2486
2574
  function updateHOCHostEl({ vnode, parent }, el) {
2487
- while (parent && parent.subTree === vnode) {
2488
- (vnode = parent.vnode).el = el;
2489
- parent = parent.parent;
2575
+ while (parent) {
2576
+ const root = parent.subTree;
2577
+ if (root.suspense && root.suspense.activeBranch === vnode) {
2578
+ root.el = vnode.el;
2579
+ }
2580
+ if (root === vnode) {
2581
+ (vnode = parent.vnode).el = el;
2582
+ parent = parent.parent;
2583
+ } else {
2584
+ break;
2585
+ }
2490
2586
  }
2491
2587
  }
2492
2588
 
@@ -2546,6 +2642,7 @@ function resolve(registry, name) {
2546
2642
  }
2547
2643
 
2548
2644
  const isSuspense = (type) => type.__isSuspense;
2645
+ let suspenseId = 0;
2549
2646
  const SuspenseImpl = {
2550
2647
  name: "Suspense",
2551
2648
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -2553,7 +2650,7 @@ const SuspenseImpl = {
2553
2650
  // on a vnode's type and calls the `process` method, passing in renderer
2554
2651
  // internals.
2555
2652
  __isSuspense: true,
2556
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
2653
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
2557
2654
  if (n1 == null) {
2558
2655
  mountSuspense(
2559
2656
  n2,
@@ -2561,7 +2658,7 @@ const SuspenseImpl = {
2561
2658
  anchor,
2562
2659
  parentComponent,
2563
2660
  parentSuspense,
2564
- isSVG,
2661
+ namespace,
2565
2662
  slotScopeIds,
2566
2663
  optimized,
2567
2664
  rendererInternals
@@ -2573,7 +2670,7 @@ const SuspenseImpl = {
2573
2670
  container,
2574
2671
  anchor,
2575
2672
  parentComponent,
2576
- isSVG,
2673
+ namespace,
2577
2674
  slotScopeIds,
2578
2675
  optimized,
2579
2676
  rendererInternals
@@ -2591,7 +2688,7 @@ function triggerEvent(vnode, name) {
2591
2688
  eventListener();
2592
2689
  }
2593
2690
  }
2594
- function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
2691
+ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
2595
2692
  const {
2596
2693
  p: patch,
2597
2694
  o: { createElement }
@@ -2604,7 +2701,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
2604
2701
  container,
2605
2702
  hiddenContainer,
2606
2703
  anchor,
2607
- isSVG,
2704
+ namespace,
2608
2705
  slotScopeIds,
2609
2706
  optimized,
2610
2707
  rendererInternals
@@ -2616,7 +2713,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
2616
2713
  null,
2617
2714
  parentComponent,
2618
2715
  suspense,
2619
- isSVG,
2716
+ namespace,
2620
2717
  slotScopeIds
2621
2718
  );
2622
2719
  if (suspense.deps > 0) {
@@ -2630,7 +2727,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
2630
2727
  parentComponent,
2631
2728
  null,
2632
2729
  // fallback tree will not have suspense context
2633
- isSVG,
2730
+ namespace,
2634
2731
  slotScopeIds
2635
2732
  );
2636
2733
  setActiveBranch(suspense, vnode.ssFallback);
@@ -2638,7 +2735,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
2638
2735
  suspense.resolve(false, true);
2639
2736
  }
2640
2737
  }
2641
- function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
2738
+ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
2642
2739
  const suspense = n2.suspense = n1.suspense;
2643
2740
  suspense.vnode = n2;
2644
2741
  n2.el = n1.el;
@@ -2655,29 +2752,31 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
2655
2752
  null,
2656
2753
  parentComponent,
2657
2754
  suspense,
2658
- isSVG,
2755
+ namespace,
2659
2756
  slotScopeIds,
2660
2757
  optimized
2661
2758
  );
2662
2759
  if (suspense.deps <= 0) {
2663
2760
  suspense.resolve();
2664
2761
  } else if (isInFallback) {
2665
- patch(
2666
- activeBranch,
2667
- newFallback,
2668
- container,
2669
- anchor,
2670
- parentComponent,
2671
- null,
2672
- // fallback tree will not have suspense context
2673
- isSVG,
2674
- slotScopeIds,
2675
- optimized
2676
- );
2677
- setActiveBranch(suspense, newFallback);
2762
+ if (!isHydrating) {
2763
+ patch(
2764
+ activeBranch,
2765
+ newFallback,
2766
+ container,
2767
+ anchor,
2768
+ parentComponent,
2769
+ null,
2770
+ // fallback tree will not have suspense context
2771
+ namespace,
2772
+ slotScopeIds,
2773
+ optimized
2774
+ );
2775
+ setActiveBranch(suspense, newFallback);
2776
+ }
2678
2777
  }
2679
2778
  } else {
2680
- suspense.pendingId++;
2779
+ suspense.pendingId = suspenseId++;
2681
2780
  if (isHydrating) {
2682
2781
  suspense.isHydrating = false;
2683
2782
  suspense.activeBranch = pendingBranch;
@@ -2695,7 +2794,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
2695
2794
  null,
2696
2795
  parentComponent,
2697
2796
  suspense,
2698
- isSVG,
2797
+ namespace,
2699
2798
  slotScopeIds,
2700
2799
  optimized
2701
2800
  );
@@ -2710,7 +2809,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
2710
2809
  parentComponent,
2711
2810
  null,
2712
2811
  // fallback tree will not have suspense context
2713
- isSVG,
2812
+ namespace,
2714
2813
  slotScopeIds,
2715
2814
  optimized
2716
2815
  );
@@ -2724,7 +2823,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
2724
2823
  anchor,
2725
2824
  parentComponent,
2726
2825
  suspense,
2727
- isSVG,
2826
+ namespace,
2728
2827
  slotScopeIds,
2729
2828
  optimized
2730
2829
  );
@@ -2737,7 +2836,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
2737
2836
  null,
2738
2837
  parentComponent,
2739
2838
  suspense,
2740
- isSVG,
2839
+ namespace,
2741
2840
  slotScopeIds,
2742
2841
  optimized
2743
2842
  );
@@ -2755,7 +2854,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
2755
2854
  anchor,
2756
2855
  parentComponent,
2757
2856
  suspense,
2758
- isSVG,
2857
+ namespace,
2759
2858
  slotScopeIds,
2760
2859
  optimized
2761
2860
  );
@@ -2763,7 +2862,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
2763
2862
  } else {
2764
2863
  triggerEvent(n2, "onPending");
2765
2864
  suspense.pendingBranch = newBranch;
2766
- suspense.pendingId++;
2865
+ if (newBranch.shapeFlag & 512) {
2866
+ suspense.pendingId = newBranch.component.suspenseId;
2867
+ } else {
2868
+ suspense.pendingId = suspenseId++;
2869
+ }
2767
2870
  patch(
2768
2871
  null,
2769
2872
  newBranch,
@@ -2771,7 +2874,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
2771
2874
  null,
2772
2875
  parentComponent,
2773
2876
  suspense,
2774
- isSVG,
2877
+ namespace,
2775
2878
  slotScopeIds,
2776
2879
  optimized
2777
2880
  );
@@ -2793,7 +2896,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
2793
2896
  }
2794
2897
  }
2795
2898
  let hasWarned = false;
2796
- function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
2899
+ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
2797
2900
  if (!hasWarned) {
2798
2901
  hasWarned = true;
2799
2902
  console[console.info ? "info" : "log"](
@@ -2823,7 +2926,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2823
2926
  vnode,
2824
2927
  parent: parentSuspense,
2825
2928
  parentComponent,
2826
- isSVG,
2929
+ namespace,
2827
2930
  container,
2828
2931
  hiddenContainer,
2829
2932
  anchor,
@@ -2832,7 +2935,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2832
2935
  timeout: typeof timeout === "number" ? timeout : -1,
2833
2936
  activeBranch: null,
2834
2937
  pendingBranch: null,
2835
- isInFallback: true,
2938
+ isInFallback: !isHydrating,
2836
2939
  isHydrating,
2837
2940
  isUnmounted: false,
2838
2941
  effects: [],
@@ -2866,7 +2969,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2866
2969
  if (delayEnter) {
2867
2970
  activeBranch.transition.afterLeave = () => {
2868
2971
  if (pendingId === suspense.pendingId) {
2869
- move(pendingBranch, container2, anchor2, 0);
2972
+ move(
2973
+ pendingBranch,
2974
+ container2,
2975
+ next(activeBranch),
2976
+ 0
2977
+ );
2870
2978
  queuePostFlushCb(effects);
2871
2979
  }
2872
2980
  };
@@ -2911,7 +3019,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2911
3019
  if (!suspense.pendingBranch) {
2912
3020
  return;
2913
3021
  }
2914
- const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
3022
+ const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
2915
3023
  triggerEvent(vnode2, "onFallback");
2916
3024
  const anchor2 = next(activeBranch);
2917
3025
  const mountFallback = () => {
@@ -2926,7 +3034,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2926
3034
  parentComponent2,
2927
3035
  null,
2928
3036
  // fallback tree will not have suspense context
2929
- isSVG2,
3037
+ namespace2,
2930
3038
  slotScopeIds,
2931
3039
  optimized
2932
3040
  );
@@ -2989,7 +3097,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2989
3097
  // consider the comment placeholder case.
2990
3098
  hydratedEl ? null : next(instance.subTree),
2991
3099
  suspense,
2992
- isSVG,
3100
+ namespace,
2993
3101
  optimized
2994
3102
  );
2995
3103
  if (placeholder) {
@@ -3026,7 +3134,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3026
3134
  };
3027
3135
  return suspense;
3028
3136
  }
3029
- function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3137
+ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3030
3138
  const suspense = vnode.suspense = createSuspenseBoundary(
3031
3139
  vnode,
3032
3140
  parentSuspense,
@@ -3034,7 +3142,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
3034
3142
  node.parentNode,
3035
3143
  document.createElement("div"),
3036
3144
  null,
3037
- isSVG,
3145
+ namespace,
3038
3146
  slotScopeIds,
3039
3147
  optimized,
3040
3148
  rendererInternals,
@@ -3922,7 +4030,7 @@ const KeepAliveImpl = {
3922
4030
  }
3923
4031
  } = sharedContext;
3924
4032
  const storageContainer = createElement("div");
3925
- sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
4033
+ sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
3926
4034
  const instance2 = vnode.component;
3927
4035
  move(vnode, container, anchor, 0, parentSuspense);
3928
4036
  patch(
@@ -3932,7 +4040,7 @@ const KeepAliveImpl = {
3932
4040
  anchor,
3933
4041
  instance2,
3934
4042
  parentSuspense,
3935
- isSVG,
4043
+ namespace,
3936
4044
  vnode.slotScopeIds,
3937
4045
  optimized
3938
4046
  );
@@ -4598,7 +4706,7 @@ function useSlots() {
4598
4706
  function useAttrs() {
4599
4707
  return getContext().attrs;
4600
4708
  }
4601
- function useModel(props, name, options) {
4709
+ function useModel(props, name) {
4602
4710
  const i = getCurrentInstance();
4603
4711
  if (!i) {
4604
4712
  warn(`useModel() called without active instance.`);
@@ -4608,29 +4716,24 @@ function useModel(props, name, options) {
4608
4716
  warn(`useModel() called with prop "${name}" which is not declared.`);
4609
4717
  return ref();
4610
4718
  }
4611
- if (options && options.local) {
4612
- const proxy = ref(props[name]);
4613
- watch(
4614
- () => props[name],
4615
- (v) => proxy.value = v
4616
- );
4617
- watch(proxy, (value) => {
4618
- if (value !== props[name]) {
4619
- i.emit(`update:${name}`, value);
4620
- }
4621
- });
4622
- return proxy;
4623
- } else {
4624
- return {
4625
- __v_isRef: true,
4626
- get value() {
4627
- return props[name];
4628
- },
4629
- set value(value) {
4630
- i.emit(`update:${name}`, value);
4719
+ let localValue;
4720
+ watchSyncEffect(() => {
4721
+ localValue = props[name];
4722
+ });
4723
+ return customRef((track, trigger) => ({
4724
+ get() {
4725
+ track();
4726
+ return localValue;
4727
+ },
4728
+ set(value) {
4729
+ const rawProps = i.vnode.props;
4730
+ if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
4731
+ localValue = value;
4732
+ trigger();
4631
4733
  }
4632
- };
4633
- }
4734
+ i.emit(`update:${name}`, value);
4735
+ }
4736
+ }));
4634
4737
  }
4635
4738
  function getContext() {
4636
4739
  const i = getCurrentInstance();
@@ -5150,18 +5253,6 @@ function createAppAPI(render, hydrate) {
5150
5253
  rootProps = null;
5151
5254
  }
5152
5255
  const context = createAppContext();
5153
- {
5154
- Object.defineProperty(context.config, "unwrapInjectedRef", {
5155
- get() {
5156
- return true;
5157
- },
5158
- set() {
5159
- warn(
5160
- `app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
5161
- );
5162
- }
5163
- });
5164
- }
5165
5256
  const installedPlugins = /* @__PURE__ */ new WeakSet();
5166
5257
  let isMounted = false;
5167
5258
  const app = context.app = {
@@ -5236,7 +5327,7 @@ function createAppAPI(render, hydrate) {
5236
5327
  context.directives[name] = directive;
5237
5328
  return app;
5238
5329
  },
5239
- mount(rootContainer, isHydrate, isSVG) {
5330
+ mount(rootContainer, isHydrate, namespace) {
5240
5331
  if (!isMounted) {
5241
5332
  if (rootContainer.__vue_app__) {
5242
5333
  warn(
@@ -5246,15 +5337,24 @@ function createAppAPI(render, hydrate) {
5246
5337
  }
5247
5338
  const vnode = createVNode(rootComponent, rootProps);
5248
5339
  vnode.appContext = context;
5340
+ if (namespace === true) {
5341
+ namespace = "svg";
5342
+ } else if (namespace === false) {
5343
+ namespace = void 0;
5344
+ }
5249
5345
  {
5250
5346
  context.reload = () => {
5251
- render(cloneVNode(vnode), rootContainer, isSVG);
5347
+ render(
5348
+ cloneVNode(vnode),
5349
+ rootContainer,
5350
+ namespace
5351
+ );
5252
5352
  };
5253
5353
  }
5254
5354
  if (isHydrate && hydrate) {
5255
5355
  hydrate(vnode, rootContainer);
5256
5356
  } else {
5257
- render(vnode, rootContainer, isSVG);
5357
+ render(vnode, rootContainer, namespace);
5258
5358
  }
5259
5359
  isMounted = true;
5260
5360
  app._container = rootContainer;
@@ -5644,11 +5744,12 @@ function validateProps(rawProps, props, instance) {
5644
5744
  key,
5645
5745
  resolvedValues[key],
5646
5746
  opt,
5747
+ shallowReadonly(resolvedValues) ,
5647
5748
  !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
5648
5749
  );
5649
5750
  }
5650
5751
  }
5651
- function validateProp(name, value, prop, isAbsent) {
5752
+ function validateProp(name, value, prop, props, isAbsent) {
5652
5753
  const { type, required, validator, skipCheck } = prop;
5653
5754
  if (required && isAbsent) {
5654
5755
  warn('Missing required prop: "' + name + '"');
@@ -5671,7 +5772,7 @@ function validateProp(name, value, prop, isAbsent) {
5671
5772
  return;
5672
5773
  }
5673
5774
  }
5674
- if (validator && !validator(value)) {
5775
+ if (validator && !validator(value, props)) {
5675
5776
  warn('Invalid prop: custom validator check failed for prop "' + name + '".');
5676
5777
  }
5677
5778
  }
@@ -5927,7 +6028,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
5927
6028
  }
5928
6029
 
5929
6030
  let hasMismatch = false;
5930
- const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject";
6031
+ const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
6032
+ const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
6033
+ const getContainerType = (container) => {
6034
+ if (isSVGContainer(container))
6035
+ return "svg";
6036
+ if (isMathMLContainer(container))
6037
+ return "mathml";
6038
+ return void 0;
6039
+ };
5931
6040
  const isComment = (node) => node.nodeType === 8 /* COMMENT */;
5932
6041
  function createHydrationFunctions(rendererInternals) {
5933
6042
  const {
@@ -6006,11 +6115,13 @@ function createHydrationFunctions(rendererInternals) {
6006
6115
  if (node.data !== vnode.children) {
6007
6116
  hasMismatch = true;
6008
6117
  warn(
6009
- `Hydration text mismatch:
6010
- - Server rendered: ${JSON.stringify(
6118
+ `Hydration text mismatch in`,
6119
+ node.parentNode,
6120
+ `
6121
+ - rendered on server: ${JSON.stringify(
6011
6122
  node.data
6012
6123
  )}
6013
- - Client rendered: ${JSON.stringify(vnode.children)}`
6124
+ - expected on client: ${JSON.stringify(vnode.children)}`
6014
6125
  );
6015
6126
  node.data = vnode.children;
6016
6127
  }
@@ -6096,7 +6207,7 @@ function createHydrationFunctions(rendererInternals) {
6096
6207
  null,
6097
6208
  parentComponent,
6098
6209
  parentSuspense,
6099
- isSVGContainer(container),
6210
+ getContainerType(container),
6100
6211
  optimized
6101
6212
  );
6102
6213
  if (isAsyncWrapper(vnode)) {
@@ -6131,7 +6242,7 @@ function createHydrationFunctions(rendererInternals) {
6131
6242
  vnode,
6132
6243
  parentComponent,
6133
6244
  parentSuspense,
6134
- isSVGContainer(parentNode(node)),
6245
+ getContainerType(parentNode(node)),
6135
6246
  slotScopeIds,
6136
6247
  optimized,
6137
6248
  rendererInternals,
@@ -6154,38 +6265,6 @@ function createHydrationFunctions(rendererInternals) {
6154
6265
  if (dirs) {
6155
6266
  invokeDirectiveHook(vnode, null, parentComponent, "created");
6156
6267
  }
6157
- if (props) {
6158
- if (forcePatch || !optimized || patchFlag & (16 | 32)) {
6159
- for (const key in props) {
6160
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
6161
- key[0] === ".") {
6162
- patchProp(
6163
- el,
6164
- key,
6165
- null,
6166
- props[key],
6167
- false,
6168
- void 0,
6169
- parentComponent
6170
- );
6171
- }
6172
- }
6173
- } else if (props.onClick) {
6174
- patchProp(
6175
- el,
6176
- "onClick",
6177
- null,
6178
- props.onClick,
6179
- false,
6180
- void 0,
6181
- parentComponent
6182
- );
6183
- }
6184
- }
6185
- let vnodeHooks;
6186
- if (vnodeHooks = props && props.onVnodeBeforeMount) {
6187
- invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6188
- }
6189
6268
  let needCallTransitionHooks = false;
6190
6269
  if (isTemplateNode(el)) {
6191
6270
  needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
@@ -6196,16 +6275,6 @@ function createHydrationFunctions(rendererInternals) {
6196
6275
  replaceNode(content, el, parentComponent);
6197
6276
  vnode.el = el = content;
6198
6277
  }
6199
- if (dirs) {
6200
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6201
- }
6202
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
6203
- queueEffectWithSuspense(() => {
6204
- vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6205
- needCallTransitionHooks && transition.enter(el);
6206
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6207
- }, parentSuspense);
6208
- }
6209
6278
  if (shapeFlag & 16 && // skip if element has innerHTML / textContent
6210
6279
  !(props && (props.innerHTML || props.textContent))) {
6211
6280
  let next = hydrateChildren(
@@ -6222,7 +6291,10 @@ function createHydrationFunctions(rendererInternals) {
6222
6291
  hasMismatch = true;
6223
6292
  if (!hasWarned) {
6224
6293
  warn(
6225
- `Hydration children mismatch in <${vnode.type}>: server rendered element contains more child nodes than client vdom.`
6294
+ `Hydration children mismatch on`,
6295
+ el,
6296
+ `
6297
+ Server rendered element contains more child nodes than client vdom.`
6226
6298
  );
6227
6299
  hasWarned = true;
6228
6300
  }
@@ -6234,13 +6306,50 @@ function createHydrationFunctions(rendererInternals) {
6234
6306
  if (el.textContent !== vnode.children) {
6235
6307
  hasMismatch = true;
6236
6308
  warn(
6237
- `Hydration text content mismatch in <${vnode.type}>:
6238
- - Server rendered: ${el.textContent}
6239
- - Client rendered: ${vnode.children}`
6309
+ `Hydration text content mismatch on`,
6310
+ el,
6311
+ `
6312
+ - rendered on server: ${el.textContent}
6313
+ - expected on client: ${vnode.children}`
6240
6314
  );
6241
6315
  el.textContent = vnode.children;
6242
6316
  }
6243
6317
  }
6318
+ if (props) {
6319
+ {
6320
+ for (const key in props) {
6321
+ if (propHasMismatch(el, key, props[key])) {
6322
+ hasMismatch = true;
6323
+ }
6324
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
6325
+ key[0] === ".") {
6326
+ patchProp(
6327
+ el,
6328
+ key,
6329
+ null,
6330
+ props[key],
6331
+ void 0,
6332
+ void 0,
6333
+ parentComponent
6334
+ );
6335
+ }
6336
+ }
6337
+ }
6338
+ }
6339
+ let vnodeHooks;
6340
+ if (vnodeHooks = props && props.onVnodeBeforeMount) {
6341
+ invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6342
+ }
6343
+ if (dirs) {
6344
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6345
+ }
6346
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
6347
+ queueEffectWithSuspense(() => {
6348
+ vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6349
+ needCallTransitionHooks && transition.enter(el);
6350
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6351
+ }, parentSuspense);
6352
+ }
6244
6353
  }
6245
6354
  return el.nextSibling;
6246
6355
  };
@@ -6266,7 +6375,10 @@ function createHydrationFunctions(rendererInternals) {
6266
6375
  hasMismatch = true;
6267
6376
  if (!hasWarned) {
6268
6377
  warn(
6269
- `Hydration children mismatch in <${container.tagName.toLowerCase()}>: server rendered element contains fewer child nodes than client vdom.`
6378
+ `Hydration children mismatch on`,
6379
+ container,
6380
+ `
6381
+ Server rendered element contains fewer child nodes than client vdom.`
6270
6382
  );
6271
6383
  hasWarned = true;
6272
6384
  }
@@ -6277,7 +6389,7 @@ function createHydrationFunctions(rendererInternals) {
6277
6389
  null,
6278
6390
  parentComponent,
6279
6391
  parentSuspense,
6280
- isSVGContainer(container),
6392
+ getContainerType(container),
6281
6393
  slotScopeIds
6282
6394
  );
6283
6395
  }
@@ -6311,12 +6423,12 @@ function createHydrationFunctions(rendererInternals) {
6311
6423
  hasMismatch = true;
6312
6424
  warn(
6313
6425
  `Hydration node mismatch:
6314
- - Client vnode:`,
6315
- vnode.type,
6316
- `
6317
- - Server rendered DOM:`,
6426
+ - rendered on server:`,
6318
6427
  node,
6319
- node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``
6428
+ node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
6429
+ `
6430
+ - expected on client:`,
6431
+ vnode.type
6320
6432
  );
6321
6433
  vnode.el = null;
6322
6434
  if (isFragment) {
@@ -6340,7 +6452,7 @@ function createHydrationFunctions(rendererInternals) {
6340
6452
  next,
6341
6453
  parentComponent,
6342
6454
  parentSuspense,
6343
- isSVGContainer(container),
6455
+ getContainerType(container),
6344
6456
  slotScopeIds
6345
6457
  );
6346
6458
  return next;
@@ -6381,6 +6493,46 @@ function createHydrationFunctions(rendererInternals) {
6381
6493
  };
6382
6494
  return [hydrate, hydrateNode];
6383
6495
  }
6496
+ function propHasMismatch(el, key, clientValue) {
6497
+ let mismatchType;
6498
+ let mismatchKey;
6499
+ let actual;
6500
+ let expected;
6501
+ if (key === "class") {
6502
+ actual = el.className;
6503
+ expected = normalizeClass(clientValue);
6504
+ if (actual !== expected) {
6505
+ mismatchType = mismatchKey = `class`;
6506
+ }
6507
+ } else if (key === "style") {
6508
+ actual = el.getAttribute("style");
6509
+ expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
6510
+ if (actual !== expected) {
6511
+ mismatchType = mismatchKey = "style";
6512
+ }
6513
+ } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
6514
+ actual = el.hasAttribute(key) && el.getAttribute(key);
6515
+ expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? false : String(clientValue);
6516
+ if (actual !== expected) {
6517
+ mismatchType = `attribute`;
6518
+ mismatchKey = key;
6519
+ }
6520
+ }
6521
+ if (mismatchType) {
6522
+ const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
6523
+ warn(
6524
+ `Hydration ${mismatchType} mismatch on`,
6525
+ el,
6526
+ `
6527
+ - rendered on server: ${format(actual)}
6528
+ - expected on client: ${format(expected)}
6529
+ Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
6530
+ You should fix the source of the mismatch.`
6531
+ );
6532
+ return true;
6533
+ }
6534
+ return false;
6535
+ }
6384
6536
 
6385
6537
  let supported;
6386
6538
  let perf;
@@ -6449,7 +6601,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6449
6601
  setScopeId: hostSetScopeId = NOOP,
6450
6602
  insertStaticContent: hostInsertStaticContent
6451
6603
  } = options;
6452
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
6604
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
6453
6605
  if (n1 === n2) {
6454
6606
  return;
6455
6607
  }
@@ -6472,9 +6624,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6472
6624
  break;
6473
6625
  case Static:
6474
6626
  if (n1 == null) {
6475
- mountStaticNode(n2, container, anchor, isSVG);
6627
+ mountStaticNode(n2, container, anchor, namespace);
6476
6628
  } else {
6477
- patchStaticNode(n1, n2, container, isSVG);
6629
+ patchStaticNode(n1, n2, container, namespace);
6478
6630
  }
6479
6631
  break;
6480
6632
  case Fragment:
@@ -6485,7 +6637,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6485
6637
  anchor,
6486
6638
  parentComponent,
6487
6639
  parentSuspense,
6488
- isSVG,
6640
+ namespace,
6489
6641
  slotScopeIds,
6490
6642
  optimized
6491
6643
  );
@@ -6499,7 +6651,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6499
6651
  anchor,
6500
6652
  parentComponent,
6501
6653
  parentSuspense,
6502
- isSVG,
6654
+ namespace,
6503
6655
  slotScopeIds,
6504
6656
  optimized
6505
6657
  );
@@ -6511,7 +6663,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6511
6663
  anchor,
6512
6664
  parentComponent,
6513
6665
  parentSuspense,
6514
- isSVG,
6666
+ namespace,
6515
6667
  slotScopeIds,
6516
6668
  optimized
6517
6669
  );
@@ -6523,7 +6675,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6523
6675
  anchor,
6524
6676
  parentComponent,
6525
6677
  parentSuspense,
6526
- isSVG,
6678
+ namespace,
6527
6679
  slotScopeIds,
6528
6680
  optimized,
6529
6681
  internals
@@ -6536,7 +6688,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6536
6688
  anchor,
6537
6689
  parentComponent,
6538
6690
  parentSuspense,
6539
- isSVG,
6691
+ namespace,
6540
6692
  slotScopeIds,
6541
6693
  optimized,
6542
6694
  internals
@@ -6574,17 +6726,17 @@ function baseCreateRenderer(options, createHydrationFns) {
6574
6726
  n2.el = n1.el;
6575
6727
  }
6576
6728
  };
6577
- const mountStaticNode = (n2, container, anchor, isSVG) => {
6729
+ const mountStaticNode = (n2, container, anchor, namespace) => {
6578
6730
  [n2.el, n2.anchor] = hostInsertStaticContent(
6579
6731
  n2.children,
6580
6732
  container,
6581
6733
  anchor,
6582
- isSVG,
6734
+ namespace,
6583
6735
  n2.el,
6584
6736
  n2.anchor
6585
6737
  );
6586
6738
  };
6587
- const patchStaticNode = (n1, n2, container, isSVG) => {
6739
+ const patchStaticNode = (n1, n2, container, namespace) => {
6588
6740
  if (n2.children !== n1.children) {
6589
6741
  const anchor = hostNextSibling(n1.anchor);
6590
6742
  removeStaticNode(n1);
@@ -6592,7 +6744,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6592
6744
  n2.children,
6593
6745
  container,
6594
6746
  anchor,
6595
- isSVG
6747
+ namespace
6596
6748
  );
6597
6749
  } else {
6598
6750
  n2.el = n1.el;
@@ -6617,8 +6769,12 @@ function baseCreateRenderer(options, createHydrationFns) {
6617
6769
  }
6618
6770
  hostRemove(anchor);
6619
6771
  };
6620
- const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
6621
- isSVG = isSVG || n2.type === "svg";
6772
+ const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6773
+ if (n2.type === "svg") {
6774
+ namespace = "svg";
6775
+ } else if (n2.type === "math") {
6776
+ namespace = "mathml";
6777
+ }
6622
6778
  if (n1 == null) {
6623
6779
  mountElement(
6624
6780
  n2,
@@ -6626,7 +6782,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6626
6782
  anchor,
6627
6783
  parentComponent,
6628
6784
  parentSuspense,
6629
- isSVG,
6785
+ namespace,
6630
6786
  slotScopeIds,
6631
6787
  optimized
6632
6788
  );
@@ -6636,19 +6792,19 @@ function baseCreateRenderer(options, createHydrationFns) {
6636
6792
  n2,
6637
6793
  parentComponent,
6638
6794
  parentSuspense,
6639
- isSVG,
6795
+ namespace,
6640
6796
  slotScopeIds,
6641
6797
  optimized
6642
6798
  );
6643
6799
  }
6644
6800
  };
6645
- const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
6801
+ const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6646
6802
  let el;
6647
6803
  let vnodeHook;
6648
- const { type, props, shapeFlag, transition, dirs } = vnode;
6804
+ const { props, shapeFlag, transition, dirs } = vnode;
6649
6805
  el = vnode.el = hostCreateElement(
6650
6806
  vnode.type,
6651
- isSVG,
6807
+ namespace,
6652
6808
  props && props.is,
6653
6809
  props
6654
6810
  );
@@ -6661,7 +6817,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6661
6817
  null,
6662
6818
  parentComponent,
6663
6819
  parentSuspense,
6664
- isSVG && type !== "foreignObject",
6820
+ resolveChildrenNamespace(vnode, namespace),
6665
6821
  slotScopeIds,
6666
6822
  optimized
6667
6823
  );
@@ -6678,7 +6834,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6678
6834
  key,
6679
6835
  null,
6680
6836
  props[key],
6681
- isSVG,
6837
+ namespace,
6682
6838
  vnode.children,
6683
6839
  parentComponent,
6684
6840
  parentSuspense,
@@ -6687,7 +6843,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6687
6843
  }
6688
6844
  }
6689
6845
  if ("value" in props) {
6690
- hostPatchProp(el, "value", null, props.value);
6846
+ hostPatchProp(el, "value", null, props.value, namespace);
6691
6847
  }
6692
6848
  if (vnodeHook = props.onVnodeBeforeMount) {
6693
6849
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -6745,7 +6901,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6745
6901
  }
6746
6902
  }
6747
6903
  };
6748
- const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {
6904
+ const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
6749
6905
  for (let i = start; i < children.length; i++) {
6750
6906
  const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
6751
6907
  patch(
@@ -6755,13 +6911,13 @@ function baseCreateRenderer(options, createHydrationFns) {
6755
6911
  anchor,
6756
6912
  parentComponent,
6757
6913
  parentSuspense,
6758
- isSVG,
6914
+ namespace,
6759
6915
  slotScopeIds,
6760
6916
  optimized
6761
6917
  );
6762
6918
  }
6763
6919
  };
6764
- const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
6920
+ const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6765
6921
  const el = n2.el = n1.el;
6766
6922
  let { patchFlag, dynamicChildren, dirs } = n2;
6767
6923
  patchFlag |= n1.patchFlag & 16;
@@ -6781,7 +6937,6 @@ function baseCreateRenderer(options, createHydrationFns) {
6781
6937
  optimized = false;
6782
6938
  dynamicChildren = null;
6783
6939
  }
6784
- const areChildrenSVG = isSVG && n2.type !== "foreignObject";
6785
6940
  if (dynamicChildren) {
6786
6941
  patchBlockChildren(
6787
6942
  n1.dynamicChildren,
@@ -6789,7 +6944,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6789
6944
  el,
6790
6945
  parentComponent,
6791
6946
  parentSuspense,
6792
- areChildrenSVG,
6947
+ resolveChildrenNamespace(n2, namespace),
6793
6948
  slotScopeIds
6794
6949
  );
6795
6950
  {
@@ -6803,7 +6958,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6803
6958
  null,
6804
6959
  parentComponent,
6805
6960
  parentSuspense,
6806
- areChildrenSVG,
6961
+ resolveChildrenNamespace(n2, namespace),
6807
6962
  slotScopeIds,
6808
6963
  false
6809
6964
  );
@@ -6817,16 +6972,16 @@ function baseCreateRenderer(options, createHydrationFns) {
6817
6972
  newProps,
6818
6973
  parentComponent,
6819
6974
  parentSuspense,
6820
- isSVG
6975
+ namespace
6821
6976
  );
6822
6977
  } else {
6823
6978
  if (patchFlag & 2) {
6824
6979
  if (oldProps.class !== newProps.class) {
6825
- hostPatchProp(el, "class", null, newProps.class, isSVG);
6980
+ hostPatchProp(el, "class", null, newProps.class, namespace);
6826
6981
  }
6827
6982
  }
6828
6983
  if (patchFlag & 4) {
6829
- hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);
6984
+ hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
6830
6985
  }
6831
6986
  if (patchFlag & 8) {
6832
6987
  const propsToUpdate = n2.dynamicProps;
@@ -6840,7 +6995,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6840
6995
  key,
6841
6996
  prev,
6842
6997
  next,
6843
- isSVG,
6998
+ namespace,
6844
6999
  n1.children,
6845
7000
  parentComponent,
6846
7001
  parentSuspense,
@@ -6863,7 +7018,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6863
7018
  newProps,
6864
7019
  parentComponent,
6865
7020
  parentSuspense,
6866
- isSVG
7021
+ namespace
6867
7022
  );
6868
7023
  }
6869
7024
  if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
@@ -6873,7 +7028,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6873
7028
  }, parentSuspense);
6874
7029
  }
6875
7030
  };
6876
- const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {
7031
+ const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
6877
7032
  for (let i = 0; i < newChildren.length; i++) {
6878
7033
  const oldVNode = oldChildren[i];
6879
7034
  const newVNode = newChildren[i];
@@ -6898,13 +7053,13 @@ function baseCreateRenderer(options, createHydrationFns) {
6898
7053
  null,
6899
7054
  parentComponent,
6900
7055
  parentSuspense,
6901
- isSVG,
7056
+ namespace,
6902
7057
  slotScopeIds,
6903
7058
  true
6904
7059
  );
6905
7060
  }
6906
7061
  };
6907
- const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
7062
+ const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
6908
7063
  if (oldProps !== newProps) {
6909
7064
  if (oldProps !== EMPTY_OBJ) {
6910
7065
  for (const key in oldProps) {
@@ -6914,7 +7069,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6914
7069
  key,
6915
7070
  oldProps[key],
6916
7071
  null,
6917
- isSVG,
7072
+ namespace,
6918
7073
  vnode.children,
6919
7074
  parentComponent,
6920
7075
  parentSuspense,
@@ -6934,7 +7089,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6934
7089
  key,
6935
7090
  prev,
6936
7091
  next,
6937
- isSVG,
7092
+ namespace,
6938
7093
  vnode.children,
6939
7094
  parentComponent,
6940
7095
  parentSuspense,
@@ -6943,11 +7098,11 @@ function baseCreateRenderer(options, createHydrationFns) {
6943
7098
  }
6944
7099
  }
6945
7100
  if ("value" in newProps) {
6946
- hostPatchProp(el, "value", oldProps.value, newProps.value);
7101
+ hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
6947
7102
  }
6948
7103
  }
6949
7104
  };
6950
- const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
7105
+ const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6951
7106
  const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
6952
7107
  const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
6953
7108
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
@@ -6971,7 +7126,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6971
7126
  fragmentEndAnchor,
6972
7127
  parentComponent,
6973
7128
  parentSuspense,
6974
- isSVG,
7129
+ namespace,
6975
7130
  slotScopeIds,
6976
7131
  optimized
6977
7132
  );
@@ -6985,7 +7140,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6985
7140
  container,
6986
7141
  parentComponent,
6987
7142
  parentSuspense,
6988
- isSVG,
7143
+ namespace,
6989
7144
  slotScopeIds
6990
7145
  );
6991
7146
  {
@@ -6999,14 +7154,14 @@ function baseCreateRenderer(options, createHydrationFns) {
6999
7154
  fragmentEndAnchor,
7000
7155
  parentComponent,
7001
7156
  parentSuspense,
7002
- isSVG,
7157
+ namespace,
7003
7158
  slotScopeIds,
7004
7159
  optimized
7005
7160
  );
7006
7161
  }
7007
7162
  }
7008
7163
  };
7009
- const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
7164
+ const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7010
7165
  n2.slotScopeIds = slotScopeIds;
7011
7166
  if (n1 == null) {
7012
7167
  if (n2.shapeFlag & 512) {
@@ -7014,7 +7169,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7014
7169
  n2,
7015
7170
  container,
7016
7171
  anchor,
7017
- isSVG,
7172
+ namespace,
7018
7173
  optimized
7019
7174
  );
7020
7175
  } else {
@@ -7024,7 +7179,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7024
7179
  anchor,
7025
7180
  parentComponent,
7026
7181
  parentSuspense,
7027
- isSVG,
7182
+ namespace,
7028
7183
  optimized
7029
7184
  );
7030
7185
  }
@@ -7032,7 +7187,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7032
7187
  updateComponent(n1, n2, optimized);
7033
7188
  }
7034
7189
  };
7035
- const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
7190
+ const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
7036
7191
  const instance = (initialVNode.component = createComponentInstance(
7037
7192
  initialVNode,
7038
7193
  parentComponent,
@@ -7063,17 +7218,17 @@ function baseCreateRenderer(options, createHydrationFns) {
7063
7218
  const placeholder = instance.subTree = createVNode(Comment);
7064
7219
  processCommentNode(null, placeholder, container, anchor);
7065
7220
  }
7066
- return;
7221
+ } else {
7222
+ setupRenderEffect(
7223
+ instance,
7224
+ initialVNode,
7225
+ container,
7226
+ anchor,
7227
+ parentSuspense,
7228
+ namespace,
7229
+ optimized
7230
+ );
7067
7231
  }
7068
- setupRenderEffect(
7069
- instance,
7070
- initialVNode,
7071
- container,
7072
- anchor,
7073
- parentSuspense,
7074
- isSVG,
7075
- optimized
7076
- );
7077
7232
  {
7078
7233
  popWarningContext();
7079
7234
  endMeasure(instance, `mount`);
@@ -7102,7 +7257,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7102
7257
  instance.vnode = n2;
7103
7258
  }
7104
7259
  };
7105
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {
7260
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
7106
7261
  const componentUpdateFn = () => {
7107
7262
  if (!instance.isMounted) {
7108
7263
  let vnodeHook;
@@ -7169,7 +7324,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7169
7324
  anchor,
7170
7325
  instance,
7171
7326
  parentSuspense,
7172
- isSVG
7327
+ namespace
7173
7328
  );
7174
7329
  {
7175
7330
  endMeasure(instance, `patch`);
@@ -7196,6 +7351,21 @@ function baseCreateRenderer(options, createHydrationFns) {
7196
7351
  initialVNode = container = anchor = null;
7197
7352
  } else {
7198
7353
  let { next, bu, u, parent, vnode } = instance;
7354
+ {
7355
+ const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
7356
+ if (nonHydratedAsyncRoot) {
7357
+ if (next) {
7358
+ next.el = vnode.el;
7359
+ updateComponentPreRender(instance, next, optimized);
7360
+ }
7361
+ nonHydratedAsyncRoot.asyncDep.then(() => {
7362
+ if (!instance.isUnmounted) {
7363
+ componentUpdateFn();
7364
+ }
7365
+ });
7366
+ return;
7367
+ }
7368
+ }
7199
7369
  let originNext = next;
7200
7370
  let vnodeHook;
7201
7371
  {
@@ -7236,7 +7406,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7236
7406
  getNextHostNode(prevTree),
7237
7407
  instance,
7238
7408
  parentSuspense,
7239
- isSVG
7409
+ namespace
7240
7410
  );
7241
7411
  {
7242
7412
  endMeasure(instance, `patch`);
@@ -7291,10 +7461,10 @@ function baseCreateRenderer(options, createHydrationFns) {
7291
7461
  updateProps(instance, nextVNode.props, prevProps, optimized);
7292
7462
  updateSlots(instance, nextVNode.children, optimized);
7293
7463
  pauseTracking();
7294
- flushPreFlushCbs();
7464
+ flushPreFlushCbs(instance);
7295
7465
  resetTracking();
7296
7466
  };
7297
- const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
7467
+ const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
7298
7468
  const c1 = n1 && n1.children;
7299
7469
  const prevShapeFlag = n1 ? n1.shapeFlag : 0;
7300
7470
  const c2 = n2.children;
@@ -7308,7 +7478,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7308
7478
  anchor,
7309
7479
  parentComponent,
7310
7480
  parentSuspense,
7311
- isSVG,
7481
+ namespace,
7312
7482
  slotScopeIds,
7313
7483
  optimized
7314
7484
  );
@@ -7321,7 +7491,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7321
7491
  anchor,
7322
7492
  parentComponent,
7323
7493
  parentSuspense,
7324
- isSVG,
7494
+ namespace,
7325
7495
  slotScopeIds,
7326
7496
  optimized
7327
7497
  );
@@ -7345,7 +7515,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7345
7515
  anchor,
7346
7516
  parentComponent,
7347
7517
  parentSuspense,
7348
- isSVG,
7518
+ namespace,
7349
7519
  slotScopeIds,
7350
7520
  optimized
7351
7521
  );
@@ -7363,7 +7533,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7363
7533
  anchor,
7364
7534
  parentComponent,
7365
7535
  parentSuspense,
7366
- isSVG,
7536
+ namespace,
7367
7537
  slotScopeIds,
7368
7538
  optimized
7369
7539
  );
@@ -7371,7 +7541,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7371
7541
  }
7372
7542
  }
7373
7543
  };
7374
- const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
7544
+ const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7375
7545
  c1 = c1 || EMPTY_ARR;
7376
7546
  c2 = c2 || EMPTY_ARR;
7377
7547
  const oldLength = c1.length;
@@ -7387,7 +7557,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7387
7557
  null,
7388
7558
  parentComponent,
7389
7559
  parentSuspense,
7390
- isSVG,
7560
+ namespace,
7391
7561
  slotScopeIds,
7392
7562
  optimized
7393
7563
  );
@@ -7408,14 +7578,14 @@ function baseCreateRenderer(options, createHydrationFns) {
7408
7578
  anchor,
7409
7579
  parentComponent,
7410
7580
  parentSuspense,
7411
- isSVG,
7581
+ namespace,
7412
7582
  slotScopeIds,
7413
7583
  optimized,
7414
7584
  commonLength
7415
7585
  );
7416
7586
  }
7417
7587
  };
7418
- const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
7588
+ const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7419
7589
  let i = 0;
7420
7590
  const l2 = c2.length;
7421
7591
  let e1 = c1.length - 1;
@@ -7431,7 +7601,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7431
7601
  null,
7432
7602
  parentComponent,
7433
7603
  parentSuspense,
7434
- isSVG,
7604
+ namespace,
7435
7605
  slotScopeIds,
7436
7606
  optimized
7437
7607
  );
@@ -7451,7 +7621,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7451
7621
  null,
7452
7622
  parentComponent,
7453
7623
  parentSuspense,
7454
- isSVG,
7624
+ namespace,
7455
7625
  slotScopeIds,
7456
7626
  optimized
7457
7627
  );
@@ -7473,7 +7643,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7473
7643
  anchor,
7474
7644
  parentComponent,
7475
7645
  parentSuspense,
7476
- isSVG,
7646
+ namespace,
7477
7647
  slotScopeIds,
7478
7648
  optimized
7479
7649
  );
@@ -7543,7 +7713,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7543
7713
  null,
7544
7714
  parentComponent,
7545
7715
  parentSuspense,
7546
- isSVG,
7716
+ namespace,
7547
7717
  slotScopeIds,
7548
7718
  optimized
7549
7719
  );
@@ -7564,7 +7734,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7564
7734
  anchor,
7565
7735
  parentComponent,
7566
7736
  parentSuspense,
7567
- isSVG,
7737
+ namespace,
7568
7738
  slotScopeIds,
7569
7739
  optimized
7570
7740
  );
@@ -7785,13 +7955,21 @@ function baseCreateRenderer(options, createHydrationFns) {
7785
7955
  }
7786
7956
  return hostNextSibling(vnode.anchor || vnode.el);
7787
7957
  };
7788
- const render = (vnode, container, isSVG) => {
7958
+ const render = (vnode, container, namespace) => {
7789
7959
  if (vnode == null) {
7790
7960
  if (container._vnode) {
7791
7961
  unmount(container._vnode, null, null, true);
7792
7962
  }
7793
7963
  } else {
7794
- patch(container._vnode || null, vnode, container, null, null, null, isSVG);
7964
+ patch(
7965
+ container._vnode || null,
7966
+ vnode,
7967
+ container,
7968
+ null,
7969
+ null,
7970
+ null,
7971
+ namespace
7972
+ );
7795
7973
  }
7796
7974
  flushPreFlushCbs();
7797
7975
  flushPostFlushCbs();
@@ -7822,6 +8000,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7822
8000
  createApp: createAppAPI(render, hydrate)
7823
8001
  };
7824
8002
  }
8003
+ function resolveChildrenNamespace({ type, props }, currentNamespace) {
8004
+ return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
8005
+ }
7825
8006
  function toggleRecurse({ effect, update }, allowed) {
7826
8007
  effect.allowRecurse = update.allowRecurse = allowed;
7827
8008
  }
@@ -7892,10 +8073,21 @@ function getSequence(arr) {
7892
8073
  }
7893
8074
  return result;
7894
8075
  }
8076
+ function locateNonHydratedAsyncRoot(instance) {
8077
+ const subComponent = instance.subTree.component;
8078
+ if (subComponent) {
8079
+ if (subComponent.asyncDep && !subComponent.asyncResolved) {
8080
+ return subComponent;
8081
+ } else {
8082
+ return locateNonHydratedAsyncRoot(subComponent);
8083
+ }
8084
+ }
8085
+ }
7895
8086
 
7896
8087
  const isTeleport = (type) => type.__isTeleport;
7897
8088
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
7898
8089
  const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
8090
+ const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
7899
8091
  const resolveTarget = (props, select) => {
7900
8092
  const targetSelector = props && props.to;
7901
8093
  if (isString(targetSelector)) {
@@ -7923,7 +8115,7 @@ const resolveTarget = (props, select) => {
7923
8115
  const TeleportImpl = {
7924
8116
  name: "Teleport",
7925
8117
  __isTeleport: true,
7926
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
8118
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
7927
8119
  const {
7928
8120
  mc: mountChildren,
7929
8121
  pc: patchChildren,
@@ -7945,7 +8137,11 @@ const TeleportImpl = {
7945
8137
  const targetAnchor = n2.targetAnchor = createText("");
7946
8138
  if (target) {
7947
8139
  insert(targetAnchor, target);
7948
- isSVG = isSVG || isTargetSVG(target);
8140
+ if (namespace === "svg" || isTargetSVG(target)) {
8141
+ namespace = "svg";
8142
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
8143
+ namespace = "mathml";
8144
+ }
7949
8145
  } else if (!disabled) {
7950
8146
  warn("Invalid Teleport target on mount:", target, `(${typeof target})`);
7951
8147
  }
@@ -7957,7 +8153,7 @@ const TeleportImpl = {
7957
8153
  anchor2,
7958
8154
  parentComponent,
7959
8155
  parentSuspense,
7960
- isSVG,
8156
+ namespace,
7961
8157
  slotScopeIds,
7962
8158
  optimized
7963
8159
  );
@@ -7976,7 +8172,11 @@ const TeleportImpl = {
7976
8172
  const wasDisabled = isTeleportDisabled(n1.props);
7977
8173
  const currentContainer = wasDisabled ? container : target;
7978
8174
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
7979
- isSVG = isSVG || isTargetSVG(target);
8175
+ if (namespace === "svg" || isTargetSVG(target)) {
8176
+ namespace = "svg";
8177
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
8178
+ namespace = "mathml";
8179
+ }
7980
8180
  if (dynamicChildren) {
7981
8181
  patchBlockChildren(
7982
8182
  n1.dynamicChildren,
@@ -7984,7 +8184,7 @@ const TeleportImpl = {
7984
8184
  currentContainer,
7985
8185
  parentComponent,
7986
8186
  parentSuspense,
7987
- isSVG,
8187
+ namespace,
7988
8188
  slotScopeIds
7989
8189
  );
7990
8190
  traverseStaticChildren(n1, n2, true);
@@ -7996,7 +8196,7 @@ const TeleportImpl = {
7996
8196
  currentAnchor,
7997
8197
  parentComponent,
7998
8198
  parentSuspense,
7999
- isSVG,
8199
+ namespace,
8000
8200
  slotScopeIds,
8001
8201
  false
8002
8202
  );
@@ -8619,10 +8819,14 @@ function createComponentInstance(vnode, parent, suspense) {
8619
8819
  let currentInstance = null;
8620
8820
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
8621
8821
  let internalSetCurrentInstance;
8822
+ let setInSSRSetupState;
8622
8823
  {
8623
8824
  internalSetCurrentInstance = (i) => {
8624
8825
  currentInstance = i;
8625
8826
  };
8827
+ setInSSRSetupState = (v) => {
8828
+ isInSSRComponentSetup = v;
8829
+ };
8626
8830
  }
8627
8831
  const setCurrentInstance = (instance) => {
8628
8832
  internalSetCurrentInstance(instance);
@@ -8646,13 +8850,13 @@ function isStatefulComponent(instance) {
8646
8850
  }
8647
8851
  let isInSSRComponentSetup = false;
8648
8852
  function setupComponent(instance, isSSR = false) {
8649
- isInSSRComponentSetup = isSSR;
8853
+ isSSR && setInSSRSetupState(isSSR);
8650
8854
  const { props, children } = instance.vnode;
8651
8855
  const isStateful = isStatefulComponent(instance);
8652
8856
  initProps(instance, props, isStateful, isSSR);
8653
8857
  initSlots(instance, children);
8654
8858
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
8655
- isInSSRComponentSetup = false;
8859
+ isSSR && setInSSRSetupState(false);
8656
8860
  return setupResult;
8657
8861
  }
8658
8862
  function setupStatefulComponent(instance, isSSR) {
@@ -8968,9 +9172,9 @@ function initCustomFormatter() {
8968
9172
  return;
8969
9173
  }
8970
9174
  const vueStyle = { style: "color:#3ba776" };
8971
- const numberStyle = { style: "color:#0b1bc9" };
8972
- const stringStyle = { style: "color:#b62e24" };
8973
- const keywordStyle = { style: "color:#9d288c" };
9175
+ const numberStyle = { style: "color:#1677ff" };
9176
+ const stringStyle = { style: "color:#f5222d" };
9177
+ const keywordStyle = { style: "color:#eb2f96" };
8974
9178
  const formatter = {
8975
9179
  header(obj) {
8976
9180
  if (!isObject(obj)) {
@@ -9164,13 +9368,15 @@ function isMemoSame(cached, memo) {
9164
9368
  return true;
9165
9369
  }
9166
9370
 
9167
- const version = "3.4.0-alpha.3";
9371
+ const version = "3.4.0-beta.1";
9168
9372
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9169
9373
  const ssrUtils = null;
9170
9374
  const resolveFilter = null;
9171
9375
  const compatUtils = null;
9376
+ const DeprecationTypes = null;
9172
9377
 
9173
9378
  const svgNS = "http://www.w3.org/2000/svg";
9379
+ const mathmlNS = "http://www.w3.org/1998/Math/MathML";
9174
9380
  const doc = typeof document !== "undefined" ? document : null;
9175
9381
  const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
9176
9382
  const nodeOps = {
@@ -9183,8 +9389,8 @@ const nodeOps = {
9183
9389
  parent.removeChild(child);
9184
9390
  }
9185
9391
  },
9186
- createElement: (tag, isSVG, is, props) => {
9187
- const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0);
9392
+ createElement: (tag, namespace, is, props) => {
9393
+ const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
9188
9394
  if (tag === "select" && props && props.multiple != null) {
9189
9395
  el.setAttribute("multiple", props.multiple);
9190
9396
  }
@@ -9208,7 +9414,7 @@ const nodeOps = {
9208
9414
  // Reason: innerHTML.
9209
9415
  // Static content here can only come from compiled templates.
9210
9416
  // As long as the user only uses trusted templates, this is safe.
9211
- insertStaticContent(content, parent, anchor, isSVG, start, end) {
9417
+ insertStaticContent(content, parent, anchor, namespace, start, end) {
9212
9418
  const before = anchor ? anchor.previousSibling : parent.lastChild;
9213
9419
  if (start && (start === end || start.nextSibling)) {
9214
9420
  while (true) {
@@ -9217,9 +9423,9 @@ const nodeOps = {
9217
9423
  break;
9218
9424
  }
9219
9425
  } else {
9220
- templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content;
9426
+ templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
9221
9427
  const template = templateContainer.content;
9222
- if (isSVG) {
9428
+ if (namespace === "svg" || namespace === "mathml") {
9223
9429
  const wrapper = template.firstChild;
9224
9430
  while (wrapper.firstChild) {
9225
9431
  template.appendChild(wrapper.firstChild);
@@ -9777,8 +9983,10 @@ function patchStopImmediatePropagation(e, value) {
9777
9983
  }
9778
9984
  }
9779
9985
 
9780
- const nativeOnRE = /^on[a-z]/;
9781
- const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
9986
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
9987
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
9988
+ const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
9989
+ const isSVG = namespace === "svg";
9782
9990
  if (key === "class") {
9783
9991
  patchClass(el, nextValue, isSVG);
9784
9992
  } else if (key === "style") {
@@ -9811,7 +10019,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
9811
10019
  if (key === "innerHTML" || key === "textContent") {
9812
10020
  return true;
9813
10021
  }
9814
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
10022
+ if (key in el && isNativeOn(key) && isFunction(value)) {
9815
10023
  return true;
9816
10024
  }
9817
10025
  return false;
@@ -9828,7 +10036,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
9828
10036
  if (key === "type" && el.tagName === "TEXTAREA") {
9829
10037
  return false;
9830
10038
  }
9831
- if (nativeOnRE.test(key) && isString(value)) {
10039
+ if (key === "width" || key === "height") {
10040
+ const tag = el.tagName;
10041
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
10042
+ return false;
10043
+ }
10044
+ }
10045
+ if (isNativeOn(key) && isString(value)) {
9832
10046
  return false;
9833
10047
  }
9834
10048
  return key in el;
@@ -10509,14 +10723,14 @@ const modifierGuards = {
10509
10723
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
10510
10724
  };
10511
10725
  const withModifiers = (fn, modifiers) => {
10512
- return (event, ...args) => {
10726
+ return fn._withMods || (fn._withMods = (event, ...args) => {
10513
10727
  for (let i = 0; i < modifiers.length; i++) {
10514
10728
  const guard = modifierGuards[modifiers[i]];
10515
10729
  if (guard && guard(event, modifiers))
10516
10730
  return;
10517
10731
  }
10518
10732
  return fn(event, ...args);
10519
- };
10733
+ });
10520
10734
  };
10521
10735
  const keyNames = {
10522
10736
  esc: "escape",
@@ -10528,7 +10742,7 @@ const keyNames = {
10528
10742
  delete: "backspace"
10529
10743
  };
10530
10744
  const withKeys = (fn, modifiers) => {
10531
- return (event) => {
10745
+ return fn._withKeys || (fn._withKeys = (event) => {
10532
10746
  if (!("key" in event)) {
10533
10747
  return;
10534
10748
  }
@@ -10536,7 +10750,7 @@ const withKeys = (fn, modifiers) => {
10536
10750
  if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
10537
10751
  return fn(event);
10538
10752
  }
10539
- };
10753
+ });
10540
10754
  };
10541
10755
 
10542
10756
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -10572,7 +10786,7 @@ const createApp = (...args) => {
10572
10786
  component.template = container.innerHTML;
10573
10787
  }
10574
10788
  container.innerHTML = "";
10575
- const proxy = mount(container, false, container instanceof SVGElement);
10789
+ const proxy = mount(container, false, resolveRootNamespace(container));
10576
10790
  if (container instanceof Element) {
10577
10791
  container.removeAttribute("v-cloak");
10578
10792
  container.setAttribute("data-v-app", "");
@@ -10591,14 +10805,22 @@ const createSSRApp = (...args) => {
10591
10805
  app.mount = (containerOrSelector) => {
10592
10806
  const container = normalizeContainer(containerOrSelector);
10593
10807
  if (container) {
10594
- return mount(container, true, container instanceof SVGElement);
10808
+ return mount(container, true, resolveRootNamespace(container));
10595
10809
  }
10596
10810
  };
10597
10811
  return app;
10598
10812
  };
10813
+ function resolveRootNamespace(container) {
10814
+ if (container instanceof SVGElement) {
10815
+ return "svg";
10816
+ }
10817
+ if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
10818
+ return "mathml";
10819
+ }
10820
+ }
10599
10821
  function injectNativeTagCheck(app) {
10600
10822
  Object.defineProperty(app.config, "isNativeTag", {
10601
- value: (tag) => isHTMLTag(tag) || isSVGTag(tag),
10823
+ value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
10602
10824
  writable: false
10603
10825
  });
10604
10826
  }
@@ -10650,4 +10872,4 @@ function normalizeContainer(container) {
10650
10872
  }
10651
10873
  const initDirectivesForSSR = NOOP;
10652
10874
 
10653
- export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
10875
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };