@vue/compat 3.4.0-alpha.4 → 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.
@@ -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);
@@ -1768,13 +1809,16 @@ function queuePostFlushCb(cb) {
1768
1809
  }
1769
1810
  queueFlush();
1770
1811
  }
1771
- function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
1812
+ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1772
1813
  if (!!(process.env.NODE_ENV !== "production")) {
1773
1814
  seen = seen || /* @__PURE__ */ new Map();
1774
1815
  }
1775
1816
  for (; i < queue.length; i++) {
1776
1817
  const cb = queue[i];
1777
1818
  if (cb && cb.pre) {
1819
+ if (instance && cb.id !== instance.uid) {
1820
+ continue;
1821
+ }
1778
1822
  if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
1779
1823
  continue;
1780
1824
  }
@@ -3054,9 +3098,17 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
3054
3098
  return false;
3055
3099
  }
3056
3100
  function updateHOCHostEl({ vnode, parent }, el) {
3057
- while (parent && parent.subTree === vnode) {
3058
- (vnode = parent.vnode).el = el;
3059
- parent = parent.parent;
3101
+ while (parent) {
3102
+ const root = parent.subTree;
3103
+ if (root.suspense && root.suspense.activeBranch === vnode) {
3104
+ root.el = vnode.el;
3105
+ }
3106
+ if (root === vnode) {
3107
+ (vnode = parent.vnode).el = el;
3108
+ parent = parent.parent;
3109
+ } else {
3110
+ break;
3111
+ }
3060
3112
  }
3061
3113
  }
3062
3114
 
@@ -3120,6 +3172,7 @@ function resolve(registry, name) {
3120
3172
  }
3121
3173
 
3122
3174
  const isSuspense = (type) => type.__isSuspense;
3175
+ let suspenseId = 0;
3123
3176
  const SuspenseImpl = {
3124
3177
  name: "Suspense",
3125
3178
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -3127,7 +3180,7 @@ const SuspenseImpl = {
3127
3180
  // on a vnode's type and calls the `process` method, passing in renderer
3128
3181
  // internals.
3129
3182
  __isSuspense: true,
3130
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
3183
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
3131
3184
  if (n1 == null) {
3132
3185
  mountSuspense(
3133
3186
  n2,
@@ -3135,7 +3188,7 @@ const SuspenseImpl = {
3135
3188
  anchor,
3136
3189
  parentComponent,
3137
3190
  parentSuspense,
3138
- isSVG,
3191
+ namespace,
3139
3192
  slotScopeIds,
3140
3193
  optimized,
3141
3194
  rendererInternals
@@ -3147,7 +3200,7 @@ const SuspenseImpl = {
3147
3200
  container,
3148
3201
  anchor,
3149
3202
  parentComponent,
3150
- isSVG,
3203
+ namespace,
3151
3204
  slotScopeIds,
3152
3205
  optimized,
3153
3206
  rendererInternals
@@ -3165,7 +3218,7 @@ function triggerEvent(vnode, name) {
3165
3218
  eventListener();
3166
3219
  }
3167
3220
  }
3168
- function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
3221
+ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
3169
3222
  const {
3170
3223
  p: patch,
3171
3224
  o: { createElement }
@@ -3178,7 +3231,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3178
3231
  container,
3179
3232
  hiddenContainer,
3180
3233
  anchor,
3181
- isSVG,
3234
+ namespace,
3182
3235
  slotScopeIds,
3183
3236
  optimized,
3184
3237
  rendererInternals
@@ -3190,7 +3243,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3190
3243
  null,
3191
3244
  parentComponent,
3192
3245
  suspense,
3193
- isSVG,
3246
+ namespace,
3194
3247
  slotScopeIds
3195
3248
  );
3196
3249
  if (suspense.deps > 0) {
@@ -3204,7 +3257,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3204
3257
  parentComponent,
3205
3258
  null,
3206
3259
  // fallback tree will not have suspense context
3207
- isSVG,
3260
+ namespace,
3208
3261
  slotScopeIds
3209
3262
  );
3210
3263
  setActiveBranch(suspense, vnode.ssFallback);
@@ -3212,7 +3265,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3212
3265
  suspense.resolve(false, true);
3213
3266
  }
3214
3267
  }
3215
- function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
3268
+ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
3216
3269
  const suspense = n2.suspense = n1.suspense;
3217
3270
  suspense.vnode = n2;
3218
3271
  n2.el = n1.el;
@@ -3229,29 +3282,31 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3229
3282
  null,
3230
3283
  parentComponent,
3231
3284
  suspense,
3232
- isSVG,
3285
+ namespace,
3233
3286
  slotScopeIds,
3234
3287
  optimized
3235
3288
  );
3236
3289
  if (suspense.deps <= 0) {
3237
3290
  suspense.resolve();
3238
3291
  } else if (isInFallback) {
3239
- patch(
3240
- activeBranch,
3241
- newFallback,
3242
- container,
3243
- anchor,
3244
- parentComponent,
3245
- null,
3246
- // fallback tree will not have suspense context
3247
- isSVG,
3248
- slotScopeIds,
3249
- optimized
3250
- );
3251
- setActiveBranch(suspense, newFallback);
3292
+ if (!isHydrating) {
3293
+ patch(
3294
+ activeBranch,
3295
+ newFallback,
3296
+ container,
3297
+ anchor,
3298
+ parentComponent,
3299
+ null,
3300
+ // fallback tree will not have suspense context
3301
+ namespace,
3302
+ slotScopeIds,
3303
+ optimized
3304
+ );
3305
+ setActiveBranch(suspense, newFallback);
3306
+ }
3252
3307
  }
3253
3308
  } else {
3254
- suspense.pendingId++;
3309
+ suspense.pendingId = suspenseId++;
3255
3310
  if (isHydrating) {
3256
3311
  suspense.isHydrating = false;
3257
3312
  suspense.activeBranch = pendingBranch;
@@ -3269,7 +3324,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3269
3324
  null,
3270
3325
  parentComponent,
3271
3326
  suspense,
3272
- isSVG,
3327
+ namespace,
3273
3328
  slotScopeIds,
3274
3329
  optimized
3275
3330
  );
@@ -3284,7 +3339,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3284
3339
  parentComponent,
3285
3340
  null,
3286
3341
  // fallback tree will not have suspense context
3287
- isSVG,
3342
+ namespace,
3288
3343
  slotScopeIds,
3289
3344
  optimized
3290
3345
  );
@@ -3298,7 +3353,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3298
3353
  anchor,
3299
3354
  parentComponent,
3300
3355
  suspense,
3301
- isSVG,
3356
+ namespace,
3302
3357
  slotScopeIds,
3303
3358
  optimized
3304
3359
  );
@@ -3311,7 +3366,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3311
3366
  null,
3312
3367
  parentComponent,
3313
3368
  suspense,
3314
- isSVG,
3369
+ namespace,
3315
3370
  slotScopeIds,
3316
3371
  optimized
3317
3372
  );
@@ -3329,7 +3384,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3329
3384
  anchor,
3330
3385
  parentComponent,
3331
3386
  suspense,
3332
- isSVG,
3387
+ namespace,
3333
3388
  slotScopeIds,
3334
3389
  optimized
3335
3390
  );
@@ -3337,7 +3392,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3337
3392
  } else {
3338
3393
  triggerEvent(n2, "onPending");
3339
3394
  suspense.pendingBranch = newBranch;
3340
- suspense.pendingId++;
3395
+ if (newBranch.shapeFlag & 512) {
3396
+ suspense.pendingId = newBranch.component.suspenseId;
3397
+ } else {
3398
+ suspense.pendingId = suspenseId++;
3399
+ }
3341
3400
  patch(
3342
3401
  null,
3343
3402
  newBranch,
@@ -3345,7 +3404,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3345
3404
  null,
3346
3405
  parentComponent,
3347
3406
  suspense,
3348
- isSVG,
3407
+ namespace,
3349
3408
  slotScopeIds,
3350
3409
  optimized
3351
3410
  );
@@ -3367,7 +3426,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3367
3426
  }
3368
3427
  }
3369
3428
  let hasWarned = false;
3370
- function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3429
+ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3371
3430
  if (!!(process.env.NODE_ENV !== "production") && true && !hasWarned) {
3372
3431
  hasWarned = true;
3373
3432
  console[console.info ? "info" : "log"](
@@ -3397,7 +3456,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3397
3456
  vnode,
3398
3457
  parent: parentSuspense,
3399
3458
  parentComponent,
3400
- isSVG,
3459
+ namespace,
3401
3460
  container,
3402
3461
  hiddenContainer,
3403
3462
  anchor,
@@ -3406,7 +3465,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3406
3465
  timeout: typeof timeout === "number" ? timeout : -1,
3407
3466
  activeBranch: null,
3408
3467
  pendingBranch: null,
3409
- isInFallback: true,
3468
+ isInFallback: !isHydrating,
3410
3469
  isHydrating,
3411
3470
  isUnmounted: false,
3412
3471
  effects: [],
@@ -3490,8 +3549,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3490
3549
  if (!suspense.pendingBranch) {
3491
3550
  return;
3492
3551
  }
3493
- const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
3552
+ const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
3494
3553
  triggerEvent(vnode2, "onFallback");
3554
+ const anchor2 = next(activeBranch);
3495
3555
  const mountFallback = () => {
3496
3556
  if (!suspense.isInFallback) {
3497
3557
  return;
@@ -3500,11 +3560,11 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3500
3560
  null,
3501
3561
  fallbackVNode,
3502
3562
  container2,
3503
- next(activeBranch),
3563
+ anchor2,
3504
3564
  parentComponent2,
3505
3565
  null,
3506
3566
  // fallback tree will not have suspense context
3507
- isSVG2,
3567
+ namespace2,
3508
3568
  slotScopeIds,
3509
3569
  optimized
3510
3570
  );
@@ -3567,7 +3627,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3567
3627
  // consider the comment placeholder case.
3568
3628
  hydratedEl ? null : next(instance.subTree),
3569
3629
  suspense,
3570
- isSVG,
3630
+ namespace,
3571
3631
  optimized
3572
3632
  );
3573
3633
  if (placeholder) {
@@ -3604,7 +3664,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3604
3664
  };
3605
3665
  return suspense;
3606
3666
  }
3607
- function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3667
+ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3608
3668
  const suspense = vnode.suspense = createSuspenseBoundary(
3609
3669
  vnode,
3610
3670
  parentSuspense,
@@ -3612,7 +3672,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
3612
3672
  node.parentNode,
3613
3673
  document.createElement("div"),
3614
3674
  null,
3615
- isSVG,
3675
+ namespace,
3616
3676
  slotScopeIds,
3617
3677
  optimized,
3618
3678
  rendererInternals,
@@ -4583,7 +4643,7 @@ const KeepAliveImpl = {
4583
4643
  }
4584
4644
  } = sharedContext;
4585
4645
  const storageContainer = createElement("div");
4586
- sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
4646
+ sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4587
4647
  const instance2 = vnode.component;
4588
4648
  move(vnode, container, anchor, 0, parentSuspense);
4589
4649
  patch(
@@ -4593,7 +4653,7 @@ const KeepAliveImpl = {
4593
4653
  anchor,
4594
4654
  instance2,
4595
4655
  parentSuspense,
4596
- isSVG,
4656
+ namespace,
4597
4657
  vnode.slotScopeIds,
4598
4658
  optimized
4599
4659
  );
@@ -5781,7 +5841,7 @@ function useSlots() {
5781
5841
  function useAttrs() {
5782
5842
  return getContext().attrs;
5783
5843
  }
5784
- function useModel(props, name, options) {
5844
+ function useModel(props, name) {
5785
5845
  const i = getCurrentInstance();
5786
5846
  if (!!(process.env.NODE_ENV !== "production") && !i) {
5787
5847
  warn(`useModel() called without active instance.`);
@@ -5791,29 +5851,24 @@ function useModel(props, name, options) {
5791
5851
  warn(`useModel() called with prop "${name}" which is not declared.`);
5792
5852
  return ref();
5793
5853
  }
5794
- if (options && options.local) {
5795
- const proxy = ref(props[name]);
5796
- watch(
5797
- () => props[name],
5798
- (v) => proxy.value = v
5799
- );
5800
- watch(proxy, (value) => {
5801
- if (value !== props[name]) {
5802
- i.emit(`update:${name}`, value);
5803
- }
5804
- });
5805
- return proxy;
5806
- } else {
5807
- return {
5808
- __v_isRef: true,
5809
- get value() {
5810
- return props[name];
5811
- },
5812
- set value(value) {
5813
- i.emit(`update:${name}`, value);
5854
+ let localValue;
5855
+ watchSyncEffect(() => {
5856
+ localValue = props[name];
5857
+ });
5858
+ return customRef((track, trigger) => ({
5859
+ get() {
5860
+ track();
5861
+ return localValue;
5862
+ },
5863
+ set(value) {
5864
+ const rawProps = i.vnode.props;
5865
+ if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
5866
+ localValue = value;
5867
+ trigger();
5814
5868
  }
5815
- };
5816
- }
5869
+ i.emit(`update:${name}`, value);
5870
+ }
5871
+ }));
5817
5872
  }
5818
5873
  function getContext() {
5819
5874
  const i = getCurrentInstance();
@@ -6389,7 +6444,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6389
6444
  return vm;
6390
6445
  }
6391
6446
  }
6392
- Vue.version = `2.6.14-compat:${"3.4.0-alpha.4"}`;
6447
+ Vue.version = `2.6.14-compat:${"3.4.0-beta.1"}`;
6393
6448
  Vue.config = singletonApp.config;
6394
6449
  Vue.use = (p, ...options) => {
6395
6450
  if (p && isFunction(p.install)) {
@@ -6635,12 +6690,16 @@ function installCompatMount(app, context, render) {
6635
6690
  } else {
6636
6691
  container = selectorOrEl || document.createElement("div");
6637
6692
  }
6638
- const isSVG = container instanceof SVGElement;
6693
+ let namespace;
6694
+ if (container instanceof SVGElement)
6695
+ namespace = "svg";
6696
+ else if (typeof MathMLElement === "function" && container instanceof MathMLElement)
6697
+ namespace = "mathml";
6639
6698
  if (!!(process.env.NODE_ENV !== "production")) {
6640
6699
  context.reload = () => {
6641
6700
  const cloned = cloneVNode(vnode);
6642
6701
  cloned.component = null;
6643
- render(cloned, container, isSVG);
6702
+ render(cloned, container, namespace);
6644
6703
  };
6645
6704
  }
6646
6705
  if (hasNoRender && instance.render === emptyRender) {
@@ -6663,7 +6722,7 @@ function installCompatMount(app, context, render) {
6663
6722
  );
6664
6723
  }
6665
6724
  container.innerHTML = "";
6666
- render(vnode, container, isSVG);
6725
+ render(vnode, container, namespace);
6667
6726
  if (container instanceof Element) {
6668
6727
  container.removeAttribute("v-cloak");
6669
6728
  container.setAttribute("data-v-app", "");
@@ -6867,7 +6926,7 @@ function createAppAPI(render, hydrate) {
6867
6926
  context.directives[name] = directive;
6868
6927
  return app;
6869
6928
  },
6870
- mount(rootContainer, isHydrate, isSVG) {
6929
+ mount(rootContainer, isHydrate, namespace) {
6871
6930
  if (!isMounted) {
6872
6931
  if (!!(process.env.NODE_ENV !== "production") && rootContainer.__vue_app__) {
6873
6932
  warn(
@@ -6877,15 +6936,24 @@ function createAppAPI(render, hydrate) {
6877
6936
  }
6878
6937
  const vnode = createVNode(rootComponent, rootProps);
6879
6938
  vnode.appContext = context;
6939
+ if (namespace === true) {
6940
+ namespace = "svg";
6941
+ } else if (namespace === false) {
6942
+ namespace = void 0;
6943
+ }
6880
6944
  if (!!(process.env.NODE_ENV !== "production")) {
6881
6945
  context.reload = () => {
6882
- render(cloneVNode(vnode), rootContainer, isSVG);
6946
+ render(
6947
+ cloneVNode(vnode),
6948
+ rootContainer,
6949
+ namespace
6950
+ );
6883
6951
  };
6884
6952
  }
6885
6953
  if (isHydrate && hydrate) {
6886
6954
  hydrate(vnode, rootContainer);
6887
6955
  } else {
6888
- render(vnode, rootContainer, isSVG);
6956
+ render(vnode, rootContainer, namespace);
6889
6957
  }
6890
6958
  isMounted = true;
6891
6959
  app._container = rootContainer;
@@ -7350,11 +7418,12 @@ function validateProps(rawProps, props, instance) {
7350
7418
  key,
7351
7419
  resolvedValues[key],
7352
7420
  opt,
7421
+ !!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues,
7353
7422
  !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
7354
7423
  );
7355
7424
  }
7356
7425
  }
7357
- function validateProp(name, value, prop, isAbsent) {
7426
+ function validateProp(name, value, prop, props, isAbsent) {
7358
7427
  const { type, required, validator, skipCheck } = prop;
7359
7428
  if (required && isAbsent) {
7360
7429
  warn('Missing required prop: "' + name + '"');
@@ -7377,7 +7446,7 @@ function validateProp(name, value, prop, isAbsent) {
7377
7446
  return;
7378
7447
  }
7379
7448
  }
7380
- if (validator && !validator(value)) {
7449
+ if (validator && !validator(value, props)) {
7381
7450
  warn('Invalid prop: custom validator check failed for prop "' + name + '".');
7382
7451
  }
7383
7452
  }
@@ -7635,7 +7704,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7635
7704
  }
7636
7705
 
7637
7706
  let hasMismatch = false;
7638
- const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject";
7707
+ const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
7708
+ const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
7709
+ const getContainerType = (container) => {
7710
+ if (isSVGContainer(container))
7711
+ return "svg";
7712
+ if (isMathMLContainer(container))
7713
+ return "mathml";
7714
+ return void 0;
7715
+ };
7639
7716
  const isComment = (node) => node.nodeType === 8 /* COMMENT */;
7640
7717
  function createHydrationFunctions(rendererInternals) {
7641
7718
  const {
@@ -7653,7 +7730,7 @@ function createHydrationFunctions(rendererInternals) {
7653
7730
  } = rendererInternals;
7654
7731
  const hydrate = (vnode, container) => {
7655
7732
  if (!container.hasChildNodes()) {
7656
- !!(process.env.NODE_ENV !== "production") && warn(
7733
+ (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(
7657
7734
  `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
7658
7735
  );
7659
7736
  patch(null, vnode, container);
@@ -7713,12 +7790,14 @@ function createHydrationFunctions(rendererInternals) {
7713
7790
  } else {
7714
7791
  if (node.data !== vnode.children) {
7715
7792
  hasMismatch = true;
7716
- !!(process.env.NODE_ENV !== "production") && warn(
7717
- `Hydration text mismatch:
7718
- - Server rendered: ${JSON.stringify(
7793
+ (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(
7794
+ `Hydration text mismatch in`,
7795
+ node.parentNode,
7796
+ `
7797
+ - rendered on server: ${JSON.stringify(
7719
7798
  node.data
7720
7799
  )}
7721
- - Client rendered: ${JSON.stringify(vnode.children)}`
7800
+ - expected on client: ${JSON.stringify(vnode.children)}`
7722
7801
  );
7723
7802
  node.data = vnode.children;
7724
7803
  }
@@ -7804,7 +7883,7 @@ function createHydrationFunctions(rendererInternals) {
7804
7883
  null,
7805
7884
  parentComponent,
7806
7885
  parentSuspense,
7807
- isSVGContainer(container),
7886
+ getContainerType(container),
7808
7887
  optimized
7809
7888
  );
7810
7889
  if (isAsyncWrapper(vnode)) {
@@ -7839,13 +7918,13 @@ function createHydrationFunctions(rendererInternals) {
7839
7918
  vnode,
7840
7919
  parentComponent,
7841
7920
  parentSuspense,
7842
- isSVGContainer(parentNode(node)),
7921
+ getContainerType(parentNode(node)),
7843
7922
  slotScopeIds,
7844
7923
  optimized,
7845
7924
  rendererInternals,
7846
7925
  hydrateNode
7847
7926
  );
7848
- } else if (!!(process.env.NODE_ENV !== "production")) {
7927
+ } else if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) {
7849
7928
  warn("Invalid HostVNode type:", type, `(${typeof type})`);
7850
7929
  }
7851
7930
  }
@@ -7862,38 +7941,6 @@ function createHydrationFunctions(rendererInternals) {
7862
7941
  if (dirs) {
7863
7942
  invokeDirectiveHook(vnode, null, parentComponent, "created");
7864
7943
  }
7865
- if (props) {
7866
- if (forcePatch || !optimized || patchFlag & (16 | 32)) {
7867
- for (const key in props) {
7868
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7869
- key[0] === ".") {
7870
- patchProp(
7871
- el,
7872
- key,
7873
- null,
7874
- props[key],
7875
- false,
7876
- void 0,
7877
- parentComponent
7878
- );
7879
- }
7880
- }
7881
- } else if (props.onClick) {
7882
- patchProp(
7883
- el,
7884
- "onClick",
7885
- null,
7886
- props.onClick,
7887
- false,
7888
- void 0,
7889
- parentComponent
7890
- );
7891
- }
7892
- }
7893
- let vnodeHooks;
7894
- if (vnodeHooks = props && props.onVnodeBeforeMount) {
7895
- invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7896
- }
7897
7944
  let needCallTransitionHooks = false;
7898
7945
  if (isTemplateNode(el)) {
7899
7946
  needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
@@ -7904,16 +7951,6 @@ function createHydrationFunctions(rendererInternals) {
7904
7951
  replaceNode(content, el, parentComponent);
7905
7952
  vnode.el = el = content;
7906
7953
  }
7907
- if (dirs) {
7908
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7909
- }
7910
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
7911
- queueEffectWithSuspense(() => {
7912
- vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7913
- needCallTransitionHooks && transition.enter(el);
7914
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7915
- }, parentSuspense);
7916
- }
7917
7954
  if (shapeFlag & 16 && // skip if element has innerHTML / textContent
7918
7955
  !(props && (props.innerHTML || props.textContent))) {
7919
7956
  let next = hydrateChildren(
@@ -7928,9 +7965,12 @@ function createHydrationFunctions(rendererInternals) {
7928
7965
  let hasWarned = false;
7929
7966
  while (next) {
7930
7967
  hasMismatch = true;
7931
- if (!!(process.env.NODE_ENV !== "production") && !hasWarned) {
7968
+ if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
7932
7969
  warn(
7933
- `Hydration children mismatch in <${vnode.type}>: server rendered element contains more child nodes than client vdom.`
7970
+ `Hydration children mismatch on`,
7971
+ el,
7972
+ `
7973
+ Server rendered element contains more child nodes than client vdom.`
7934
7974
  );
7935
7975
  hasWarned = true;
7936
7976
  }
@@ -7941,14 +7981,61 @@ function createHydrationFunctions(rendererInternals) {
7941
7981
  } else if (shapeFlag & 8) {
7942
7982
  if (el.textContent !== vnode.children) {
7943
7983
  hasMismatch = true;
7944
- !!(process.env.NODE_ENV !== "production") && warn(
7945
- `Hydration text content mismatch in <${vnode.type}>:
7946
- - Server rendered: ${el.textContent}
7947
- - Client rendered: ${vnode.children}`
7984
+ (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(
7985
+ `Hydration text content mismatch on`,
7986
+ el,
7987
+ `
7988
+ - rendered on server: ${el.textContent}
7989
+ - expected on client: ${vnode.children}`
7948
7990
  );
7949
7991
  el.textContent = vnode.children;
7950
7992
  }
7951
7993
  }
7994
+ if (props) {
7995
+ if (!!(process.env.NODE_ENV !== "production") || forcePatch || !optimized || patchFlag & (16 | 32)) {
7996
+ for (const key in props) {
7997
+ if (!!(process.env.NODE_ENV !== "production") && propHasMismatch(el, key, props[key])) {
7998
+ hasMismatch = true;
7999
+ }
8000
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
8001
+ key[0] === ".") {
8002
+ patchProp(
8003
+ el,
8004
+ key,
8005
+ null,
8006
+ props[key],
8007
+ void 0,
8008
+ void 0,
8009
+ parentComponent
8010
+ );
8011
+ }
8012
+ }
8013
+ } else if (props.onClick) {
8014
+ patchProp(
8015
+ el,
8016
+ "onClick",
8017
+ null,
8018
+ props.onClick,
8019
+ void 0,
8020
+ void 0,
8021
+ parentComponent
8022
+ );
8023
+ }
8024
+ }
8025
+ let vnodeHooks;
8026
+ if (vnodeHooks = props && props.onVnodeBeforeMount) {
8027
+ invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8028
+ }
8029
+ if (dirs) {
8030
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8031
+ }
8032
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
8033
+ queueEffectWithSuspense(() => {
8034
+ vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8035
+ needCallTransitionHooks && transition.enter(el);
8036
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
8037
+ }, parentSuspense);
8038
+ }
7952
8039
  }
7953
8040
  return el.nextSibling;
7954
8041
  };
@@ -7972,9 +8059,12 @@ function createHydrationFunctions(rendererInternals) {
7972
8059
  continue;
7973
8060
  } else {
7974
8061
  hasMismatch = true;
7975
- if (!!(process.env.NODE_ENV !== "production") && !hasWarned) {
8062
+ if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
7976
8063
  warn(
7977
- `Hydration children mismatch in <${container.tagName.toLowerCase()}>: server rendered element contains fewer child nodes than client vdom.`
8064
+ `Hydration children mismatch on`,
8065
+ container,
8066
+ `
8067
+ Server rendered element contains fewer child nodes than client vdom.`
7978
8068
  );
7979
8069
  hasWarned = true;
7980
8070
  }
@@ -7985,7 +8075,7 @@ function createHydrationFunctions(rendererInternals) {
7985
8075
  null,
7986
8076
  parentComponent,
7987
8077
  parentSuspense,
7988
- isSVGContainer(container),
8078
+ getContainerType(container),
7989
8079
  slotScopeIds
7990
8080
  );
7991
8081
  }
@@ -8017,14 +8107,14 @@ function createHydrationFunctions(rendererInternals) {
8017
8107
  };
8018
8108
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
8019
8109
  hasMismatch = true;
8020
- !!(process.env.NODE_ENV !== "production") && warn(
8110
+ (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(
8021
8111
  `Hydration node mismatch:
8022
- - Client vnode:`,
8023
- vnode.type,
8024
- `
8025
- - Server rendered DOM:`,
8112
+ - rendered on server:`,
8026
8113
  node,
8027
- node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``
8114
+ node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
8115
+ `
8116
+ - expected on client:`,
8117
+ vnode.type
8028
8118
  );
8029
8119
  vnode.el = null;
8030
8120
  if (isFragment) {
@@ -8048,7 +8138,7 @@ function createHydrationFunctions(rendererInternals) {
8048
8138
  next,
8049
8139
  parentComponent,
8050
8140
  parentSuspense,
8051
- isSVGContainer(container),
8141
+ getContainerType(container),
8052
8142
  slotScopeIds
8053
8143
  );
8054
8144
  return next;
@@ -8089,6 +8179,46 @@ function createHydrationFunctions(rendererInternals) {
8089
8179
  };
8090
8180
  return [hydrate, hydrateNode];
8091
8181
  }
8182
+ function propHasMismatch(el, key, clientValue) {
8183
+ let mismatchType;
8184
+ let mismatchKey;
8185
+ let actual;
8186
+ let expected;
8187
+ if (key === "class") {
8188
+ actual = el.className;
8189
+ expected = normalizeClass(clientValue);
8190
+ if (actual !== expected) {
8191
+ mismatchType = mismatchKey = `class`;
8192
+ }
8193
+ } else if (key === "style") {
8194
+ actual = el.getAttribute("style");
8195
+ expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
8196
+ if (actual !== expected) {
8197
+ mismatchType = mismatchKey = "style";
8198
+ }
8199
+ } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
8200
+ actual = el.hasAttribute(key) && el.getAttribute(key);
8201
+ expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? false : String(clientValue);
8202
+ if (actual !== expected) {
8203
+ mismatchType = `attribute`;
8204
+ mismatchKey = key;
8205
+ }
8206
+ }
8207
+ if (mismatchType) {
8208
+ const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
8209
+ warn(
8210
+ `Hydration ${mismatchType} mismatch on`,
8211
+ el,
8212
+ `
8213
+ - rendered on server: ${format(actual)}
8214
+ - expected on client: ${format(expected)}
8215
+ Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
8216
+ You should fix the source of the mismatch.`
8217
+ );
8218
+ return true;
8219
+ }
8220
+ return false;
8221
+ }
8092
8222
 
8093
8223
  let supported;
8094
8224
  let perf;
@@ -8140,6 +8270,10 @@ function initFeatureFlags() {
8140
8270
  !!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_PROD_DEVTOOLS__`);
8141
8271
  getGlobalThis().__VUE_PROD_DEVTOOLS__ = false;
8142
8272
  }
8273
+ if (typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ !== "boolean") {
8274
+ !!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`);
8275
+ getGlobalThis().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
8276
+ }
8143
8277
  if (!!(process.env.NODE_ENV !== "production") && needWarn.length) {
8144
8278
  const multi = needWarn.length > 1;
8145
8279
  console.warn(
@@ -8180,7 +8314,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8180
8314
  setScopeId: hostSetScopeId = NOOP,
8181
8315
  insertStaticContent: hostInsertStaticContent
8182
8316
  } = options;
8183
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = !!(process.env.NODE_ENV !== "production") && isHmrUpdating ? false : !!n2.dynamicChildren) => {
8317
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!(process.env.NODE_ENV !== "production") && isHmrUpdating ? false : !!n2.dynamicChildren) => {
8184
8318
  if (n1 === n2) {
8185
8319
  return;
8186
8320
  }
@@ -8203,9 +8337,9 @@ function baseCreateRenderer(options, createHydrationFns) {
8203
8337
  break;
8204
8338
  case Static:
8205
8339
  if (n1 == null) {
8206
- mountStaticNode(n2, container, anchor, isSVG);
8340
+ mountStaticNode(n2, container, anchor, namespace);
8207
8341
  } else if (!!(process.env.NODE_ENV !== "production")) {
8208
- patchStaticNode(n1, n2, container, isSVG);
8342
+ patchStaticNode(n1, n2, container, namespace);
8209
8343
  }
8210
8344
  break;
8211
8345
  case Fragment:
@@ -8216,7 +8350,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8216
8350
  anchor,
8217
8351
  parentComponent,
8218
8352
  parentSuspense,
8219
- isSVG,
8353
+ namespace,
8220
8354
  slotScopeIds,
8221
8355
  optimized
8222
8356
  );
@@ -8230,7 +8364,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8230
8364
  anchor,
8231
8365
  parentComponent,
8232
8366
  parentSuspense,
8233
- isSVG,
8367
+ namespace,
8234
8368
  slotScopeIds,
8235
8369
  optimized
8236
8370
  );
@@ -8242,7 +8376,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8242
8376
  anchor,
8243
8377
  parentComponent,
8244
8378
  parentSuspense,
8245
- isSVG,
8379
+ namespace,
8246
8380
  slotScopeIds,
8247
8381
  optimized
8248
8382
  );
@@ -8254,7 +8388,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8254
8388
  anchor,
8255
8389
  parentComponent,
8256
8390
  parentSuspense,
8257
- isSVG,
8391
+ namespace,
8258
8392
  slotScopeIds,
8259
8393
  optimized,
8260
8394
  internals
@@ -8267,7 +8401,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8267
8401
  anchor,
8268
8402
  parentComponent,
8269
8403
  parentSuspense,
8270
- isSVG,
8404
+ namespace,
8271
8405
  slotScopeIds,
8272
8406
  optimized,
8273
8407
  internals
@@ -8305,17 +8439,17 @@ function baseCreateRenderer(options, createHydrationFns) {
8305
8439
  n2.el = n1.el;
8306
8440
  }
8307
8441
  };
8308
- const mountStaticNode = (n2, container, anchor, isSVG) => {
8442
+ const mountStaticNode = (n2, container, anchor, namespace) => {
8309
8443
  [n2.el, n2.anchor] = hostInsertStaticContent(
8310
8444
  n2.children,
8311
8445
  container,
8312
8446
  anchor,
8313
- isSVG,
8447
+ namespace,
8314
8448
  n2.el,
8315
8449
  n2.anchor
8316
8450
  );
8317
8451
  };
8318
- const patchStaticNode = (n1, n2, container, isSVG) => {
8452
+ const patchStaticNode = (n1, n2, container, namespace) => {
8319
8453
  if (n2.children !== n1.children) {
8320
8454
  const anchor = hostNextSibling(n1.anchor);
8321
8455
  removeStaticNode(n1);
@@ -8323,7 +8457,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8323
8457
  n2.children,
8324
8458
  container,
8325
8459
  anchor,
8326
- isSVG
8460
+ namespace
8327
8461
  );
8328
8462
  } else {
8329
8463
  n2.el = n1.el;
@@ -8348,8 +8482,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8348
8482
  }
8349
8483
  hostRemove(anchor);
8350
8484
  };
8351
- const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8352
- isSVG = isSVG || n2.type === "svg";
8485
+ const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8486
+ if (n2.type === "svg") {
8487
+ namespace = "svg";
8488
+ } else if (n2.type === "math") {
8489
+ namespace = "mathml";
8490
+ }
8353
8491
  if (n1 == null) {
8354
8492
  mountElement(
8355
8493
  n2,
@@ -8357,7 +8495,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8357
8495
  anchor,
8358
8496
  parentComponent,
8359
8497
  parentSuspense,
8360
- isSVG,
8498
+ namespace,
8361
8499
  slotScopeIds,
8362
8500
  optimized
8363
8501
  );
@@ -8367,19 +8505,19 @@ function baseCreateRenderer(options, createHydrationFns) {
8367
8505
  n2,
8368
8506
  parentComponent,
8369
8507
  parentSuspense,
8370
- isSVG,
8508
+ namespace,
8371
8509
  slotScopeIds,
8372
8510
  optimized
8373
8511
  );
8374
8512
  }
8375
8513
  };
8376
- const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8514
+ const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8377
8515
  let el;
8378
8516
  let vnodeHook;
8379
- const { type, props, shapeFlag, transition, dirs } = vnode;
8517
+ const { props, shapeFlag, transition, dirs } = vnode;
8380
8518
  el = vnode.el = hostCreateElement(
8381
8519
  vnode.type,
8382
- isSVG,
8520
+ namespace,
8383
8521
  props && props.is,
8384
8522
  props
8385
8523
  );
@@ -8392,7 +8530,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8392
8530
  null,
8393
8531
  parentComponent,
8394
8532
  parentSuspense,
8395
- isSVG && type !== "foreignObject",
8533
+ resolveChildrenNamespace(vnode, namespace),
8396
8534
  slotScopeIds,
8397
8535
  optimized
8398
8536
  );
@@ -8409,7 +8547,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8409
8547
  key,
8410
8548
  null,
8411
8549
  props[key],
8412
- isSVG,
8550
+ namespace,
8413
8551
  vnode.children,
8414
8552
  parentComponent,
8415
8553
  parentSuspense,
@@ -8418,7 +8556,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8418
8556
  }
8419
8557
  }
8420
8558
  if ("value" in props) {
8421
- hostPatchProp(el, "value", null, props.value);
8559
+ hostPatchProp(el, "value", null, props.value, namespace);
8422
8560
  }
8423
8561
  if (vnodeHook = props.onVnodeBeforeMount) {
8424
8562
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -8476,7 +8614,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8476
8614
  }
8477
8615
  }
8478
8616
  };
8479
- const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {
8617
+ const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
8480
8618
  for (let i = start; i < children.length; i++) {
8481
8619
  const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
8482
8620
  patch(
@@ -8486,13 +8624,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8486
8624
  anchor,
8487
8625
  parentComponent,
8488
8626
  parentSuspense,
8489
- isSVG,
8627
+ namespace,
8490
8628
  slotScopeIds,
8491
8629
  optimized
8492
8630
  );
8493
8631
  }
8494
8632
  };
8495
- const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8633
+ const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8496
8634
  const el = n2.el = n1.el;
8497
8635
  let { patchFlag, dynamicChildren, dirs } = n2;
8498
8636
  patchFlag |= n1.patchFlag & 16;
@@ -8512,7 +8650,6 @@ function baseCreateRenderer(options, createHydrationFns) {
8512
8650
  optimized = false;
8513
8651
  dynamicChildren = null;
8514
8652
  }
8515
- const areChildrenSVG = isSVG && n2.type !== "foreignObject";
8516
8653
  if (dynamicChildren) {
8517
8654
  patchBlockChildren(
8518
8655
  n1.dynamicChildren,
@@ -8520,7 +8657,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8520
8657
  el,
8521
8658
  parentComponent,
8522
8659
  parentSuspense,
8523
- areChildrenSVG,
8660
+ resolveChildrenNamespace(n2, namespace),
8524
8661
  slotScopeIds
8525
8662
  );
8526
8663
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -8534,7 +8671,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8534
8671
  null,
8535
8672
  parentComponent,
8536
8673
  parentSuspense,
8537
- areChildrenSVG,
8674
+ resolveChildrenNamespace(n2, namespace),
8538
8675
  slotScopeIds,
8539
8676
  false
8540
8677
  );
@@ -8548,16 +8685,16 @@ function baseCreateRenderer(options, createHydrationFns) {
8548
8685
  newProps,
8549
8686
  parentComponent,
8550
8687
  parentSuspense,
8551
- isSVG
8688
+ namespace
8552
8689
  );
8553
8690
  } else {
8554
8691
  if (patchFlag & 2) {
8555
8692
  if (oldProps.class !== newProps.class) {
8556
- hostPatchProp(el, "class", null, newProps.class, isSVG);
8693
+ hostPatchProp(el, "class", null, newProps.class, namespace);
8557
8694
  }
8558
8695
  }
8559
8696
  if (patchFlag & 4) {
8560
- hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);
8697
+ hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
8561
8698
  }
8562
8699
  if (patchFlag & 8) {
8563
8700
  const propsToUpdate = n2.dynamicProps;
@@ -8571,7 +8708,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8571
8708
  key,
8572
8709
  prev,
8573
8710
  next,
8574
- isSVG,
8711
+ namespace,
8575
8712
  n1.children,
8576
8713
  parentComponent,
8577
8714
  parentSuspense,
@@ -8594,7 +8731,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8594
8731
  newProps,
8595
8732
  parentComponent,
8596
8733
  parentSuspense,
8597
- isSVG
8734
+ namespace
8598
8735
  );
8599
8736
  }
8600
8737
  if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
@@ -8604,7 +8741,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8604
8741
  }, parentSuspense);
8605
8742
  }
8606
8743
  };
8607
- const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {
8744
+ const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
8608
8745
  for (let i = 0; i < newChildren.length; i++) {
8609
8746
  const oldVNode = oldChildren[i];
8610
8747
  const newVNode = newChildren[i];
@@ -8629,13 +8766,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8629
8766
  null,
8630
8767
  parentComponent,
8631
8768
  parentSuspense,
8632
- isSVG,
8769
+ namespace,
8633
8770
  slotScopeIds,
8634
8771
  true
8635
8772
  );
8636
8773
  }
8637
8774
  };
8638
- const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
8775
+ const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
8639
8776
  if (oldProps !== newProps) {
8640
8777
  if (oldProps !== EMPTY_OBJ) {
8641
8778
  for (const key in oldProps) {
@@ -8645,7 +8782,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8645
8782
  key,
8646
8783
  oldProps[key],
8647
8784
  null,
8648
- isSVG,
8785
+ namespace,
8649
8786
  vnode.children,
8650
8787
  parentComponent,
8651
8788
  parentSuspense,
@@ -8665,7 +8802,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8665
8802
  key,
8666
8803
  prev,
8667
8804
  next,
8668
- isSVG,
8805
+ namespace,
8669
8806
  vnode.children,
8670
8807
  parentComponent,
8671
8808
  parentSuspense,
@@ -8674,11 +8811,11 @@ function baseCreateRenderer(options, createHydrationFns) {
8674
8811
  }
8675
8812
  }
8676
8813
  if ("value" in newProps) {
8677
- hostPatchProp(el, "value", oldProps.value, newProps.value);
8814
+ hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
8678
8815
  }
8679
8816
  }
8680
8817
  };
8681
- const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8818
+ const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8682
8819
  const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
8683
8820
  const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
8684
8821
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
@@ -8700,7 +8837,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8700
8837
  fragmentEndAnchor,
8701
8838
  parentComponent,
8702
8839
  parentSuspense,
8703
- isSVG,
8840
+ namespace,
8704
8841
  slotScopeIds,
8705
8842
  optimized
8706
8843
  );
@@ -8714,7 +8851,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8714
8851
  container,
8715
8852
  parentComponent,
8716
8853
  parentSuspense,
8717
- isSVG,
8854
+ namespace,
8718
8855
  slotScopeIds
8719
8856
  );
8720
8857
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -8741,14 +8878,14 @@ function baseCreateRenderer(options, createHydrationFns) {
8741
8878
  fragmentEndAnchor,
8742
8879
  parentComponent,
8743
8880
  parentSuspense,
8744
- isSVG,
8881
+ namespace,
8745
8882
  slotScopeIds,
8746
8883
  optimized
8747
8884
  );
8748
8885
  }
8749
8886
  }
8750
8887
  };
8751
- const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8888
+ const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8752
8889
  n2.slotScopeIds = slotScopeIds;
8753
8890
  if (n1 == null) {
8754
8891
  if (n2.shapeFlag & 512) {
@@ -8756,7 +8893,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8756
8893
  n2,
8757
8894
  container,
8758
8895
  anchor,
8759
- isSVG,
8896
+ namespace,
8760
8897
  optimized
8761
8898
  );
8762
8899
  } else {
@@ -8766,7 +8903,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8766
8903
  anchor,
8767
8904
  parentComponent,
8768
8905
  parentSuspense,
8769
- isSVG,
8906
+ namespace,
8770
8907
  optimized
8771
8908
  );
8772
8909
  }
@@ -8774,7 +8911,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8774
8911
  updateComponent(n1, n2, optimized);
8775
8912
  }
8776
8913
  };
8777
- const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
8914
+ const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
8778
8915
  const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
8779
8916
  const instance = compatMountInstance || (initialVNode.component = createComponentInstance(
8780
8917
  initialVNode,
@@ -8806,17 +8943,17 @@ function baseCreateRenderer(options, createHydrationFns) {
8806
8943
  const placeholder = instance.subTree = createVNode(Comment);
8807
8944
  processCommentNode(null, placeholder, container, anchor);
8808
8945
  }
8809
- return;
8946
+ } else {
8947
+ setupRenderEffect(
8948
+ instance,
8949
+ initialVNode,
8950
+ container,
8951
+ anchor,
8952
+ parentSuspense,
8953
+ namespace,
8954
+ optimized
8955
+ );
8810
8956
  }
8811
- setupRenderEffect(
8812
- instance,
8813
- initialVNode,
8814
- container,
8815
- anchor,
8816
- parentSuspense,
8817
- isSVG,
8818
- optimized
8819
- );
8820
8957
  if (!!(process.env.NODE_ENV !== "production")) {
8821
8958
  popWarningContext();
8822
8959
  endMeasure(instance, `mount`);
@@ -8845,7 +8982,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8845
8982
  instance.vnode = n2;
8846
8983
  }
8847
8984
  };
8848
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {
8985
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
8849
8986
  const componentUpdateFn = () => {
8850
8987
  if (!instance.isMounted) {
8851
8988
  let vnodeHook;
@@ -8915,7 +9052,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8915
9052
  anchor,
8916
9053
  instance,
8917
9054
  parentSuspense,
8918
- isSVG
9055
+ namespace
8919
9056
  );
8920
9057
  if (!!(process.env.NODE_ENV !== "production")) {
8921
9058
  endMeasure(instance, `patch`);
@@ -8954,6 +9091,21 @@ function baseCreateRenderer(options, createHydrationFns) {
8954
9091
  initialVNode = container = anchor = null;
8955
9092
  } else {
8956
9093
  let { next, bu, u, parent, vnode } = instance;
9094
+ {
9095
+ const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
9096
+ if (nonHydratedAsyncRoot) {
9097
+ if (next) {
9098
+ next.el = vnode.el;
9099
+ updateComponentPreRender(instance, next, optimized);
9100
+ }
9101
+ nonHydratedAsyncRoot.asyncDep.then(() => {
9102
+ if (!instance.isUnmounted) {
9103
+ componentUpdateFn();
9104
+ }
9105
+ });
9106
+ return;
9107
+ }
9108
+ }
8957
9109
  let originNext = next;
8958
9110
  let vnodeHook;
8959
9111
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -8997,7 +9149,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8997
9149
  getNextHostNode(prevTree),
8998
9150
  instance,
8999
9151
  parentSuspense,
9000
- isSVG
9152
+ namespace
9001
9153
  );
9002
9154
  if (!!(process.env.NODE_ENV !== "production")) {
9003
9155
  endMeasure(instance, `patch`);
@@ -9058,10 +9210,10 @@ function baseCreateRenderer(options, createHydrationFns) {
9058
9210
  updateProps(instance, nextVNode.props, prevProps, optimized);
9059
9211
  updateSlots(instance, nextVNode.children, optimized);
9060
9212
  pauseTracking();
9061
- flushPreFlushCbs();
9213
+ flushPreFlushCbs(instance);
9062
9214
  resetTracking();
9063
9215
  };
9064
- const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
9216
+ const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
9065
9217
  const c1 = n1 && n1.children;
9066
9218
  const prevShapeFlag = n1 ? n1.shapeFlag : 0;
9067
9219
  const c2 = n2.children;
@@ -9075,7 +9227,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9075
9227
  anchor,
9076
9228
  parentComponent,
9077
9229
  parentSuspense,
9078
- isSVG,
9230
+ namespace,
9079
9231
  slotScopeIds,
9080
9232
  optimized
9081
9233
  );
@@ -9088,7 +9240,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9088
9240
  anchor,
9089
9241
  parentComponent,
9090
9242
  parentSuspense,
9091
- isSVG,
9243
+ namespace,
9092
9244
  slotScopeIds,
9093
9245
  optimized
9094
9246
  );
@@ -9112,7 +9264,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9112
9264
  anchor,
9113
9265
  parentComponent,
9114
9266
  parentSuspense,
9115
- isSVG,
9267
+ namespace,
9116
9268
  slotScopeIds,
9117
9269
  optimized
9118
9270
  );
@@ -9130,7 +9282,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9130
9282
  anchor,
9131
9283
  parentComponent,
9132
9284
  parentSuspense,
9133
- isSVG,
9285
+ namespace,
9134
9286
  slotScopeIds,
9135
9287
  optimized
9136
9288
  );
@@ -9138,7 +9290,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9138
9290
  }
9139
9291
  }
9140
9292
  };
9141
- const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
9293
+ const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9142
9294
  c1 = c1 || EMPTY_ARR;
9143
9295
  c2 = c2 || EMPTY_ARR;
9144
9296
  const oldLength = c1.length;
@@ -9154,7 +9306,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9154
9306
  null,
9155
9307
  parentComponent,
9156
9308
  parentSuspense,
9157
- isSVG,
9309
+ namespace,
9158
9310
  slotScopeIds,
9159
9311
  optimized
9160
9312
  );
@@ -9175,14 +9327,14 @@ function baseCreateRenderer(options, createHydrationFns) {
9175
9327
  anchor,
9176
9328
  parentComponent,
9177
9329
  parentSuspense,
9178
- isSVG,
9330
+ namespace,
9179
9331
  slotScopeIds,
9180
9332
  optimized,
9181
9333
  commonLength
9182
9334
  );
9183
9335
  }
9184
9336
  };
9185
- const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
9337
+ const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9186
9338
  let i = 0;
9187
9339
  const l2 = c2.length;
9188
9340
  let e1 = c1.length - 1;
@@ -9198,7 +9350,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9198
9350
  null,
9199
9351
  parentComponent,
9200
9352
  parentSuspense,
9201
- isSVG,
9353
+ namespace,
9202
9354
  slotScopeIds,
9203
9355
  optimized
9204
9356
  );
@@ -9218,7 +9370,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9218
9370
  null,
9219
9371
  parentComponent,
9220
9372
  parentSuspense,
9221
- isSVG,
9373
+ namespace,
9222
9374
  slotScopeIds,
9223
9375
  optimized
9224
9376
  );
@@ -9240,7 +9392,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9240
9392
  anchor,
9241
9393
  parentComponent,
9242
9394
  parentSuspense,
9243
- isSVG,
9395
+ namespace,
9244
9396
  slotScopeIds,
9245
9397
  optimized
9246
9398
  );
@@ -9310,7 +9462,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9310
9462
  null,
9311
9463
  parentComponent,
9312
9464
  parentSuspense,
9313
- isSVG,
9465
+ namespace,
9314
9466
  slotScopeIds,
9315
9467
  optimized
9316
9468
  );
@@ -9331,7 +9483,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9331
9483
  anchor,
9332
9484
  parentComponent,
9333
9485
  parentSuspense,
9334
- isSVG,
9486
+ namespace,
9335
9487
  slotScopeIds,
9336
9488
  optimized
9337
9489
  );
@@ -9561,13 +9713,21 @@ function baseCreateRenderer(options, createHydrationFns) {
9561
9713
  }
9562
9714
  return hostNextSibling(vnode.anchor || vnode.el);
9563
9715
  };
9564
- const render = (vnode, container, isSVG) => {
9716
+ const render = (vnode, container, namespace) => {
9565
9717
  if (vnode == null) {
9566
9718
  if (container._vnode) {
9567
9719
  unmount(container._vnode, null, null, true);
9568
9720
  }
9569
9721
  } else {
9570
- patch(container._vnode || null, vnode, container, null, null, null, isSVG);
9722
+ patch(
9723
+ container._vnode || null,
9724
+ vnode,
9725
+ container,
9726
+ null,
9727
+ null,
9728
+ null,
9729
+ namespace
9730
+ );
9571
9731
  }
9572
9732
  flushPreFlushCbs();
9573
9733
  flushPostFlushCbs();
@@ -9598,6 +9758,9 @@ function baseCreateRenderer(options, createHydrationFns) {
9598
9758
  createApp: createAppAPI(render, hydrate)
9599
9759
  };
9600
9760
  }
9761
+ function resolveChildrenNamespace({ type, props }, currentNamespace) {
9762
+ return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
9763
+ }
9601
9764
  function toggleRecurse({ effect, update }, allowed) {
9602
9765
  effect.allowRecurse = update.allowRecurse = allowed;
9603
9766
  }
@@ -9668,10 +9831,21 @@ function getSequence(arr) {
9668
9831
  }
9669
9832
  return result;
9670
9833
  }
9834
+ function locateNonHydratedAsyncRoot(instance) {
9835
+ const subComponent = instance.subTree.component;
9836
+ if (subComponent) {
9837
+ if (subComponent.asyncDep && !subComponent.asyncResolved) {
9838
+ return subComponent;
9839
+ } else {
9840
+ return locateNonHydratedAsyncRoot(subComponent);
9841
+ }
9842
+ }
9843
+ }
9671
9844
 
9672
9845
  const isTeleport = (type) => type.__isTeleport;
9673
9846
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
9674
9847
  const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
9848
+ const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
9675
9849
  const resolveTarget = (props, select) => {
9676
9850
  const targetSelector = props && props.to;
9677
9851
  if (isString(targetSelector)) {
@@ -9699,7 +9873,7 @@ const resolveTarget = (props, select) => {
9699
9873
  const TeleportImpl = {
9700
9874
  name: "Teleport",
9701
9875
  __isTeleport: true,
9702
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
9876
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
9703
9877
  const {
9704
9878
  mc: mountChildren,
9705
9879
  pc: patchChildren,
@@ -9721,7 +9895,11 @@ const TeleportImpl = {
9721
9895
  const targetAnchor = n2.targetAnchor = createText("");
9722
9896
  if (target) {
9723
9897
  insert(targetAnchor, target);
9724
- isSVG = isSVG || isTargetSVG(target);
9898
+ if (namespace === "svg" || isTargetSVG(target)) {
9899
+ namespace = "svg";
9900
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
9901
+ namespace = "mathml";
9902
+ }
9725
9903
  } else if (!!(process.env.NODE_ENV !== "production") && !disabled) {
9726
9904
  warn("Invalid Teleport target on mount:", target, `(${typeof target})`);
9727
9905
  }
@@ -9733,7 +9911,7 @@ const TeleportImpl = {
9733
9911
  anchor2,
9734
9912
  parentComponent,
9735
9913
  parentSuspense,
9736
- isSVG,
9914
+ namespace,
9737
9915
  slotScopeIds,
9738
9916
  optimized
9739
9917
  );
@@ -9752,7 +9930,11 @@ const TeleportImpl = {
9752
9930
  const wasDisabled = isTeleportDisabled(n1.props);
9753
9931
  const currentContainer = wasDisabled ? container : target;
9754
9932
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
9755
- isSVG = isSVG || isTargetSVG(target);
9933
+ if (namespace === "svg" || isTargetSVG(target)) {
9934
+ namespace = "svg";
9935
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
9936
+ namespace = "mathml";
9937
+ }
9756
9938
  if (dynamicChildren) {
9757
9939
  patchBlockChildren(
9758
9940
  n1.dynamicChildren,
@@ -9760,7 +9942,7 @@ const TeleportImpl = {
9760
9942
  currentContainer,
9761
9943
  parentComponent,
9762
9944
  parentSuspense,
9763
- isSVG,
9945
+ namespace,
9764
9946
  slotScopeIds
9765
9947
  );
9766
9948
  traverseStaticChildren(n1, n2, true);
@@ -9772,7 +9954,7 @@ const TeleportImpl = {
9772
9954
  currentAnchor,
9773
9955
  parentComponent,
9774
9956
  parentSuspense,
9775
- isSVG,
9957
+ namespace,
9776
9958
  slotScopeIds,
9777
9959
  false
9778
9960
  );
@@ -10458,20 +10640,29 @@ function createComponentInstance(vnode, parent, suspense) {
10458
10640
  let currentInstance = null;
10459
10641
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
10460
10642
  let internalSetCurrentInstance;
10461
- let globalCurrentInstanceSetters;
10462
- let settersKey = "__VUE_INSTANCE_SETTERS__";
10643
+ let setInSSRSetupState;
10463
10644
  {
10464
- if (!(globalCurrentInstanceSetters = getGlobalThis()[settersKey])) {
10465
- globalCurrentInstanceSetters = getGlobalThis()[settersKey] = [];
10466
- }
10467
- globalCurrentInstanceSetters.push((i) => currentInstance = i);
10468
- internalSetCurrentInstance = (instance) => {
10469
- if (globalCurrentInstanceSetters.length > 1) {
10470
- globalCurrentInstanceSetters.forEach((s) => s(instance));
10471
- } else {
10472
- globalCurrentInstanceSetters[0](instance);
10473
- }
10645
+ const g = getGlobalThis();
10646
+ const registerGlobalSetter = (key, setter) => {
10647
+ let setters;
10648
+ if (!(setters = g[key]))
10649
+ setters = g[key] = [];
10650
+ setters.push(setter);
10651
+ return (v) => {
10652
+ if (setters.length > 1)
10653
+ setters.forEach((set) => set(v));
10654
+ else
10655
+ setters[0](v);
10656
+ };
10474
10657
  };
10658
+ internalSetCurrentInstance = registerGlobalSetter(
10659
+ `__VUE_INSTANCE_SETTERS__`,
10660
+ (v) => currentInstance = v
10661
+ );
10662
+ setInSSRSetupState = registerGlobalSetter(
10663
+ `__VUE_SSR_SETTERS__`,
10664
+ (v) => isInSSRComponentSetup = v
10665
+ );
10475
10666
  }
10476
10667
  const setCurrentInstance = (instance) => {
10477
10668
  internalSetCurrentInstance(instance);
@@ -10495,13 +10686,13 @@ function isStatefulComponent(instance) {
10495
10686
  }
10496
10687
  let isInSSRComponentSetup = false;
10497
10688
  function setupComponent(instance, isSSR = false) {
10498
- isInSSRComponentSetup = isSSR;
10689
+ isSSR && setInSSRSetupState(isSSR);
10499
10690
  const { props, children } = instance.vnode;
10500
10691
  const isStateful = isStatefulComponent(instance);
10501
10692
  initProps(instance, props, isStateful, isSSR);
10502
10693
  initSlots(instance, children);
10503
10694
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
10504
- isInSSRComponentSetup = false;
10695
+ isSSR && setInSSRSetupState(false);
10505
10696
  return setupResult;
10506
10697
  }
10507
10698
  function setupStatefulComponent(instance, isSSR) {
@@ -11041,7 +11232,7 @@ function isMemoSame(cached, memo) {
11041
11232
  return true;
11042
11233
  }
11043
11234
 
11044
- const version = "3.4.0-alpha.4";
11235
+ const version = "3.4.0-beta.1";
11045
11236
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11046
11237
  const _ssrUtils = {
11047
11238
  createComponentInstance,
@@ -11064,6 +11255,7 @@ const compatUtils = _compatUtils ;
11064
11255
  const DeprecationTypes = DeprecationTypes$1 ;
11065
11256
 
11066
11257
  const svgNS = "http://www.w3.org/2000/svg";
11258
+ const mathmlNS = "http://www.w3.org/1998/Math/MathML";
11067
11259
  const doc = typeof document !== "undefined" ? document : null;
11068
11260
  const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
11069
11261
  const nodeOps = {
@@ -11076,8 +11268,8 @@ const nodeOps = {
11076
11268
  parent.removeChild(child);
11077
11269
  }
11078
11270
  },
11079
- createElement: (tag, isSVG, is, props) => {
11080
- const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0);
11271
+ createElement: (tag, namespace, is, props) => {
11272
+ const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
11081
11273
  if (tag === "select" && props && props.multiple != null) {
11082
11274
  el.setAttribute("multiple", props.multiple);
11083
11275
  }
@@ -11101,7 +11293,7 @@ const nodeOps = {
11101
11293
  // Reason: innerHTML.
11102
11294
  // Static content here can only come from compiled templates.
11103
11295
  // As long as the user only uses trusted templates, this is safe.
11104
- insertStaticContent(content, parent, anchor, isSVG, start, end) {
11296
+ insertStaticContent(content, parent, anchor, namespace, start, end) {
11105
11297
  const before = anchor ? anchor.previousSibling : parent.lastChild;
11106
11298
  if (start && (start === end || start.nextSibling)) {
11107
11299
  while (true) {
@@ -11110,9 +11302,9 @@ const nodeOps = {
11110
11302
  break;
11111
11303
  }
11112
11304
  } else {
11113
- templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content;
11305
+ templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
11114
11306
  const template = templateContainer.content;
11115
- if (isSVG) {
11307
+ if (namespace === "svg" || namespace === "mathml") {
11116
11308
  const wrapper = template.firstChild;
11117
11309
  while (wrapper.firstChild) {
11118
11310
  template.appendChild(wrapper.firstChild);
@@ -11759,7 +11951,8 @@ function patchStopImmediatePropagation(e, value) {
11759
11951
 
11760
11952
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11761
11953
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
11762
- const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11954
+ const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11955
+ const isSVG = namespace === "svg";
11763
11956
  if (key === "class") {
11764
11957
  patchClass(el, nextValue, isSVG);
11765
11958
  } else if (key === "style") {
@@ -11811,7 +12004,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
11811
12004
  }
11812
12005
  if (key === "width" || key === "height") {
11813
12006
  const tag = el.tagName;
11814
- return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
12007
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
12008
+ return false;
12009
+ }
11815
12010
  }
11816
12011
  if (isNativeOn(key) && isString(value)) {
11817
12012
  return false;
@@ -12648,7 +12843,7 @@ const createApp = (...args) => {
12648
12843
  }
12649
12844
  }
12650
12845
  container.innerHTML = "";
12651
- const proxy = mount(container, false, container instanceof SVGElement);
12846
+ const proxy = mount(container, false, resolveRootNamespace(container));
12652
12847
  if (container instanceof Element) {
12653
12848
  container.removeAttribute("v-cloak");
12654
12849
  container.setAttribute("data-v-app", "");
@@ -12667,14 +12862,22 @@ const createSSRApp = (...args) => {
12667
12862
  app.mount = (containerOrSelector) => {
12668
12863
  const container = normalizeContainer(containerOrSelector);
12669
12864
  if (container) {
12670
- return mount(container, true, container instanceof SVGElement);
12865
+ return mount(container, true, resolveRootNamespace(container));
12671
12866
  }
12672
12867
  };
12673
12868
  return app;
12674
12869
  };
12870
+ function resolveRootNamespace(container) {
12871
+ if (container instanceof SVGElement) {
12872
+ return "svg";
12873
+ }
12874
+ if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
12875
+ return "mathml";
12876
+ }
12877
+ }
12675
12878
  function injectNativeTagCheck(app) {
12676
12879
  Object.defineProperty(app.config, "isNativeTag", {
12677
- value: (tag) => isHTMLTag(tag) || isSVGTag(tag),
12880
+ value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
12678
12881
  writable: false
12679
12882
  });
12680
12883
  }