@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.
package/dist/vue.cjs.js CHANGED
@@ -250,9 +250,11 @@ function normalizeProps(props) {
250
250
 
251
251
  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";
252
252
  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";
253
+ 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";
253
254
  const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
254
255
  const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
255
256
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
257
+ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
256
258
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
257
259
 
258
260
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
@@ -267,7 +269,7 @@ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
267
269
  `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`
268
270
  );
269
271
  const isKnownSvgAttr = /* @__PURE__ */ makeMap(
270
- `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,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
272
+ `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`
271
273
  );
272
274
 
273
275
  const escapeRE = /["'&<>]/;
@@ -370,20 +372,29 @@ const replacer = (_key, val) => {
370
372
  return replacer(_key, val.value);
371
373
  } else if (isMap(val)) {
372
374
  return {
373
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
374
- entries[`${key} =>`] = val2;
375
- return entries;
376
- }, {})
375
+ [`Map(${val.size})`]: [...val.entries()].reduce(
376
+ (entries, [key, val2], i) => {
377
+ entries[stringifySymbol(key, i) + " =>"] = val2;
378
+ return entries;
379
+ },
380
+ {}
381
+ )
377
382
  };
378
383
  } else if (isSet(val)) {
379
384
  return {
380
- [`Set(${val.size})`]: [...val.values()]
385
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
381
386
  };
387
+ } else if (isSymbol(val)) {
388
+ return stringifySymbol(val);
382
389
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
383
390
  return String(val);
384
391
  }
385
392
  return val;
386
393
  };
394
+ const stringifySymbol = (v, i = "") => {
395
+ var _a;
396
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
397
+ };
387
398
 
388
399
  function warn$1(msg, ...args) {
389
400
  console.warn(`[Vue warn] ${msg}`, ...args);
@@ -832,8 +843,13 @@ class BaseReactiveHandler {
832
843
  return isReadonly2;
833
844
  } else if (key === "__v_isShallow") {
834
845
  return shallow;
835
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
836
- return target;
846
+ } else if (key === "__v_raw") {
847
+ if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
848
+ // this means the reciever is a user proxy of the reactive proxy
849
+ Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
850
+ return target;
851
+ }
852
+ return;
837
853
  }
838
854
  const targetIsArray = isArray(target);
839
855
  if (!isReadonly2) {
@@ -869,17 +885,19 @@ class MutableReactiveHandler extends BaseReactiveHandler {
869
885
  }
870
886
  set(target, key, value, receiver) {
871
887
  let oldValue = target[key];
872
- if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
873
- return false;
874
- }
875
888
  if (!this._shallow) {
889
+ const isOldValueReadonly = isReadonly(oldValue);
876
890
  if (!isShallow(value) && !isReadonly(value)) {
877
891
  oldValue = toRaw(oldValue);
878
892
  value = toRaw(value);
879
893
  }
880
894
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
881
- oldValue.value = value;
882
- return true;
895
+ if (isOldValueReadonly) {
896
+ return false;
897
+ } else {
898
+ oldValue.value = value;
899
+ return true;
900
+ }
883
901
  }
884
902
  }
885
903
  const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
@@ -1901,13 +1919,16 @@ function queuePostFlushCb(cb) {
1901
1919
  }
1902
1920
  queueFlush();
1903
1921
  }
1904
- function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
1922
+ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1905
1923
  {
1906
1924
  seen = seen || /* @__PURE__ */ new Map();
1907
1925
  }
1908
1926
  for (; i < queue.length; i++) {
1909
1927
  const cb = queue[i];
1910
1928
  if (cb && cb.pre) {
1929
+ if (instance && cb.id !== instance.uid) {
1930
+ continue;
1931
+ }
1911
1932
  if (checkRecursiveUpdates(seen, cb)) {
1912
1933
  continue;
1913
1934
  }
@@ -3184,9 +3205,17 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
3184
3205
  return false;
3185
3206
  }
3186
3207
  function updateHOCHostEl({ vnode, parent }, el) {
3187
- while (parent && parent.subTree === vnode) {
3188
- (vnode = parent.vnode).el = el;
3189
- parent = parent.parent;
3208
+ while (parent) {
3209
+ const root = parent.subTree;
3210
+ if (root.suspense && root.suspense.activeBranch === vnode) {
3211
+ root.el = vnode.el;
3212
+ }
3213
+ if (root === vnode) {
3214
+ (vnode = parent.vnode).el = el;
3215
+ parent = parent.parent;
3216
+ } else {
3217
+ break;
3218
+ }
3190
3219
  }
3191
3220
  }
3192
3221
 
@@ -3250,6 +3279,7 @@ function resolve(registry, name) {
3250
3279
  }
3251
3280
 
3252
3281
  const isSuspense = (type) => type.__isSuspense;
3282
+ let suspenseId = 0;
3253
3283
  const SuspenseImpl = {
3254
3284
  name: "Suspense",
3255
3285
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -3257,7 +3287,7 @@ const SuspenseImpl = {
3257
3287
  // on a vnode's type and calls the `process` method, passing in renderer
3258
3288
  // internals.
3259
3289
  __isSuspense: true,
3260
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
3290
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
3261
3291
  if (n1 == null) {
3262
3292
  mountSuspense(
3263
3293
  n2,
@@ -3265,7 +3295,7 @@ const SuspenseImpl = {
3265
3295
  anchor,
3266
3296
  parentComponent,
3267
3297
  parentSuspense,
3268
- isSVG,
3298
+ namespace,
3269
3299
  slotScopeIds,
3270
3300
  optimized,
3271
3301
  rendererInternals
@@ -3277,7 +3307,7 @@ const SuspenseImpl = {
3277
3307
  container,
3278
3308
  anchor,
3279
3309
  parentComponent,
3280
- isSVG,
3310
+ namespace,
3281
3311
  slotScopeIds,
3282
3312
  optimized,
3283
3313
  rendererInternals
@@ -3295,7 +3325,7 @@ function triggerEvent(vnode, name) {
3295
3325
  eventListener();
3296
3326
  }
3297
3327
  }
3298
- function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
3328
+ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
3299
3329
  const {
3300
3330
  p: patch,
3301
3331
  o: { createElement }
@@ -3308,7 +3338,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3308
3338
  container,
3309
3339
  hiddenContainer,
3310
3340
  anchor,
3311
- isSVG,
3341
+ namespace,
3312
3342
  slotScopeIds,
3313
3343
  optimized,
3314
3344
  rendererInternals
@@ -3320,7 +3350,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3320
3350
  null,
3321
3351
  parentComponent,
3322
3352
  suspense,
3323
- isSVG,
3353
+ namespace,
3324
3354
  slotScopeIds
3325
3355
  );
3326
3356
  if (suspense.deps > 0) {
@@ -3334,7 +3364,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3334
3364
  parentComponent,
3335
3365
  null,
3336
3366
  // fallback tree will not have suspense context
3337
- isSVG,
3367
+ namespace,
3338
3368
  slotScopeIds
3339
3369
  );
3340
3370
  setActiveBranch(suspense, vnode.ssFallback);
@@ -3342,7 +3372,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3342
3372
  suspense.resolve(false, true);
3343
3373
  }
3344
3374
  }
3345
- function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
3375
+ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
3346
3376
  const suspense = n2.suspense = n1.suspense;
3347
3377
  suspense.vnode = n2;
3348
3378
  n2.el = n1.el;
@@ -3359,29 +3389,31 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3359
3389
  null,
3360
3390
  parentComponent,
3361
3391
  suspense,
3362
- isSVG,
3392
+ namespace,
3363
3393
  slotScopeIds,
3364
3394
  optimized
3365
3395
  );
3366
3396
  if (suspense.deps <= 0) {
3367
3397
  suspense.resolve();
3368
3398
  } else if (isInFallback) {
3369
- patch(
3370
- activeBranch,
3371
- newFallback,
3372
- container,
3373
- anchor,
3374
- parentComponent,
3375
- null,
3376
- // fallback tree will not have suspense context
3377
- isSVG,
3378
- slotScopeIds,
3379
- optimized
3380
- );
3381
- setActiveBranch(suspense, newFallback);
3399
+ if (!isHydrating) {
3400
+ patch(
3401
+ activeBranch,
3402
+ newFallback,
3403
+ container,
3404
+ anchor,
3405
+ parentComponent,
3406
+ null,
3407
+ // fallback tree will not have suspense context
3408
+ namespace,
3409
+ slotScopeIds,
3410
+ optimized
3411
+ );
3412
+ setActiveBranch(suspense, newFallback);
3413
+ }
3382
3414
  }
3383
3415
  } else {
3384
- suspense.pendingId++;
3416
+ suspense.pendingId = suspenseId++;
3385
3417
  if (isHydrating) {
3386
3418
  suspense.isHydrating = false;
3387
3419
  suspense.activeBranch = pendingBranch;
@@ -3399,7 +3431,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3399
3431
  null,
3400
3432
  parentComponent,
3401
3433
  suspense,
3402
- isSVG,
3434
+ namespace,
3403
3435
  slotScopeIds,
3404
3436
  optimized
3405
3437
  );
@@ -3414,7 +3446,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3414
3446
  parentComponent,
3415
3447
  null,
3416
3448
  // fallback tree will not have suspense context
3417
- isSVG,
3449
+ namespace,
3418
3450
  slotScopeIds,
3419
3451
  optimized
3420
3452
  );
@@ -3428,7 +3460,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3428
3460
  anchor,
3429
3461
  parentComponent,
3430
3462
  suspense,
3431
- isSVG,
3463
+ namespace,
3432
3464
  slotScopeIds,
3433
3465
  optimized
3434
3466
  );
@@ -3441,7 +3473,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3441
3473
  null,
3442
3474
  parentComponent,
3443
3475
  suspense,
3444
- isSVG,
3476
+ namespace,
3445
3477
  slotScopeIds,
3446
3478
  optimized
3447
3479
  );
@@ -3459,7 +3491,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3459
3491
  anchor,
3460
3492
  parentComponent,
3461
3493
  suspense,
3462
- isSVG,
3494
+ namespace,
3463
3495
  slotScopeIds,
3464
3496
  optimized
3465
3497
  );
@@ -3467,7 +3499,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3467
3499
  } else {
3468
3500
  triggerEvent(n2, "onPending");
3469
3501
  suspense.pendingBranch = newBranch;
3470
- suspense.pendingId++;
3502
+ if (newBranch.shapeFlag & 512) {
3503
+ suspense.pendingId = newBranch.component.suspenseId;
3504
+ } else {
3505
+ suspense.pendingId = suspenseId++;
3506
+ }
3471
3507
  patch(
3472
3508
  null,
3473
3509
  newBranch,
@@ -3475,7 +3511,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3475
3511
  null,
3476
3512
  parentComponent,
3477
3513
  suspense,
3478
- isSVG,
3514
+ namespace,
3479
3515
  slotScopeIds,
3480
3516
  optimized
3481
3517
  );
@@ -3497,7 +3533,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3497
3533
  }
3498
3534
  }
3499
3535
  let hasWarned = false;
3500
- function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3536
+ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3501
3537
  if (!hasWarned) {
3502
3538
  hasWarned = true;
3503
3539
  console[console.info ? "info" : "log"](
@@ -3527,7 +3563,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3527
3563
  vnode,
3528
3564
  parent: parentSuspense,
3529
3565
  parentComponent,
3530
- isSVG,
3566
+ namespace,
3531
3567
  container,
3532
3568
  hiddenContainer,
3533
3569
  anchor,
@@ -3536,7 +3572,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3536
3572
  timeout: typeof timeout === "number" ? timeout : -1,
3537
3573
  activeBranch: null,
3538
3574
  pendingBranch: null,
3539
- isInFallback: true,
3575
+ isInFallback: !isHydrating,
3540
3576
  isHydrating,
3541
3577
  isUnmounted: false,
3542
3578
  effects: [],
@@ -3620,8 +3656,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3620
3656
  if (!suspense.pendingBranch) {
3621
3657
  return;
3622
3658
  }
3623
- const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
3659
+ const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
3624
3660
  triggerEvent(vnode2, "onFallback");
3661
+ const anchor2 = next(activeBranch);
3625
3662
  const mountFallback = () => {
3626
3663
  if (!suspense.isInFallback) {
3627
3664
  return;
@@ -3630,11 +3667,11 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3630
3667
  null,
3631
3668
  fallbackVNode,
3632
3669
  container2,
3633
- next(activeBranch),
3670
+ anchor2,
3634
3671
  parentComponent2,
3635
3672
  null,
3636
3673
  // fallback tree will not have suspense context
3637
- isSVG2,
3674
+ namespace2,
3638
3675
  slotScopeIds,
3639
3676
  optimized
3640
3677
  );
@@ -3697,7 +3734,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3697
3734
  // consider the comment placeholder case.
3698
3735
  hydratedEl ? null : next(instance.subTree),
3699
3736
  suspense,
3700
- isSVG,
3737
+ namespace,
3701
3738
  optimized
3702
3739
  );
3703
3740
  if (placeholder) {
@@ -3734,7 +3771,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3734
3771
  };
3735
3772
  return suspense;
3736
3773
  }
3737
- function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3774
+ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3738
3775
  const suspense = vnode.suspense = createSuspenseBoundary(
3739
3776
  vnode,
3740
3777
  parentSuspense,
@@ -3742,7 +3779,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
3742
3779
  node.parentNode,
3743
3780
  document.createElement("div"),
3744
3781
  null,
3745
- isSVG,
3782
+ namespace,
3746
3783
  slotScopeIds,
3747
3784
  optimized,
3748
3785
  rendererInternals,
@@ -4711,7 +4748,7 @@ const KeepAliveImpl = {
4711
4748
  }
4712
4749
  } = sharedContext;
4713
4750
  const storageContainer = createElement("div");
4714
- sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
4751
+ sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4715
4752
  const instance2 = vnode.component;
4716
4753
  move(vnode, container, anchor, 0, parentSuspense);
4717
4754
  patch(
@@ -4721,7 +4758,7 @@ const KeepAliveImpl = {
4721
4758
  anchor,
4722
4759
  instance2,
4723
4760
  parentSuspense,
4724
- isSVG,
4761
+ namespace,
4725
4762
  vnode.slotScopeIds,
4726
4763
  optimized
4727
4764
  );
@@ -5909,7 +5946,7 @@ function useSlots() {
5909
5946
  function useAttrs() {
5910
5947
  return getContext().attrs;
5911
5948
  }
5912
- function useModel(props, name, options) {
5949
+ function useModel(props, name) {
5913
5950
  const i = getCurrentInstance();
5914
5951
  if (!i) {
5915
5952
  warn(`useModel() called without active instance.`);
@@ -5919,29 +5956,24 @@ function useModel(props, name, options) {
5919
5956
  warn(`useModel() called with prop "${name}" which is not declared.`);
5920
5957
  return ref();
5921
5958
  }
5922
- if (options && options.local) {
5923
- const proxy = ref(props[name]);
5924
- watch(
5925
- () => props[name],
5926
- (v) => proxy.value = v
5927
- );
5928
- watch(proxy, (value) => {
5929
- if (value !== props[name]) {
5930
- i.emit(`update:${name}`, value);
5931
- }
5932
- });
5933
- return proxy;
5934
- } else {
5935
- return {
5936
- __v_isRef: true,
5937
- get value() {
5938
- return props[name];
5939
- },
5940
- set value(value) {
5941
- i.emit(`update:${name}`, value);
5959
+ let localValue;
5960
+ watchSyncEffect(() => {
5961
+ localValue = props[name];
5962
+ });
5963
+ return customRef((track, trigger) => ({
5964
+ get() {
5965
+ track();
5966
+ return localValue;
5967
+ },
5968
+ set(value) {
5969
+ const rawProps = i.vnode.props;
5970
+ if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
5971
+ localValue = value;
5972
+ trigger();
5942
5973
  }
5943
- };
5944
- }
5974
+ i.emit(`update:${name}`, value);
5975
+ }
5976
+ }));
5945
5977
  }
5946
5978
  function getContext() {
5947
5979
  const i = getCurrentInstance();
@@ -6515,7 +6547,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6515
6547
  return vm;
6516
6548
  }
6517
6549
  }
6518
- Vue.version = `2.6.14-compat:${"3.4.0-alpha.4"}`;
6550
+ Vue.version = `2.6.14-compat:${"3.4.0-beta.1"}`;
6519
6551
  Vue.config = singletonApp.config;
6520
6552
  Vue.use = (p, ...options) => {
6521
6553
  if (p && isFunction(p.install)) {
@@ -6760,12 +6792,16 @@ function installCompatMount(app, context, render) {
6760
6792
  } else {
6761
6793
  container = selectorOrEl || document.createElement("div");
6762
6794
  }
6763
- const isSVG = container instanceof SVGElement;
6795
+ let namespace;
6796
+ if (container instanceof SVGElement)
6797
+ namespace = "svg";
6798
+ else if (typeof MathMLElement === "function" && container instanceof MathMLElement)
6799
+ namespace = "mathml";
6764
6800
  {
6765
6801
  context.reload = () => {
6766
6802
  const cloned = cloneVNode(vnode);
6767
6803
  cloned.component = null;
6768
- render(cloned, container, isSVG);
6804
+ render(cloned, container, namespace);
6769
6805
  };
6770
6806
  }
6771
6807
  if (hasNoRender && instance.render === emptyRender) {
@@ -6788,7 +6824,7 @@ function installCompatMount(app, context, render) {
6788
6824
  );
6789
6825
  }
6790
6826
  container.innerHTML = "";
6791
- render(vnode, container, isSVG);
6827
+ render(vnode, container, namespace);
6792
6828
  if (container instanceof Element) {
6793
6829
  container.removeAttribute("v-cloak");
6794
6830
  container.setAttribute("data-v-app", "");
@@ -6990,7 +7026,7 @@ function createAppAPI(render, hydrate) {
6990
7026
  context.directives[name] = directive;
6991
7027
  return app;
6992
7028
  },
6993
- mount(rootContainer, isHydrate, isSVG) {
7029
+ mount(rootContainer, isHydrate, namespace) {
6994
7030
  if (!isMounted) {
6995
7031
  if (rootContainer.__vue_app__) {
6996
7032
  warn(
@@ -7000,15 +7036,24 @@ function createAppAPI(render, hydrate) {
7000
7036
  }
7001
7037
  const vnode = createVNode(rootComponent, rootProps);
7002
7038
  vnode.appContext = context;
7039
+ if (namespace === true) {
7040
+ namespace = "svg";
7041
+ } else if (namespace === false) {
7042
+ namespace = void 0;
7043
+ }
7003
7044
  {
7004
7045
  context.reload = () => {
7005
- render(cloneVNode(vnode), rootContainer, isSVG);
7046
+ render(
7047
+ cloneVNode(vnode),
7048
+ rootContainer,
7049
+ namespace
7050
+ );
7006
7051
  };
7007
7052
  }
7008
7053
  if (isHydrate && hydrate) {
7009
7054
  hydrate(vnode, rootContainer);
7010
7055
  } else {
7011
- render(vnode, rootContainer, isSVG);
7056
+ render(vnode, rootContainer, namespace);
7012
7057
  }
7013
7058
  isMounted = true;
7014
7059
  app._container = rootContainer;
@@ -7473,11 +7518,12 @@ function validateProps(rawProps, props, instance) {
7473
7518
  key,
7474
7519
  resolvedValues[key],
7475
7520
  opt,
7521
+ shallowReadonly(resolvedValues) ,
7476
7522
  !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
7477
7523
  );
7478
7524
  }
7479
7525
  }
7480
- function validateProp(name, value, prop, isAbsent) {
7526
+ function validateProp(name, value, prop, props, isAbsent) {
7481
7527
  const { type, required, validator, skipCheck } = prop;
7482
7528
  if (required && isAbsent) {
7483
7529
  warn('Missing required prop: "' + name + '"');
@@ -7500,7 +7546,7 @@ function validateProp(name, value, prop, isAbsent) {
7500
7546
  return;
7501
7547
  }
7502
7548
  }
7503
- if (validator && !validator(value)) {
7549
+ if (validator && !validator(value, props)) {
7504
7550
  warn('Invalid prop: custom validator check failed for prop "' + name + '".');
7505
7551
  }
7506
7552
  }
@@ -7758,7 +7804,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7758
7804
  }
7759
7805
 
7760
7806
  let hasMismatch = false;
7761
- const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject";
7807
+ const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
7808
+ const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
7809
+ const getContainerType = (container) => {
7810
+ if (isSVGContainer(container))
7811
+ return "svg";
7812
+ if (isMathMLContainer(container))
7813
+ return "mathml";
7814
+ return void 0;
7815
+ };
7762
7816
  const isComment = (node) => node.nodeType === 8 /* COMMENT */;
7763
7817
  function createHydrationFunctions(rendererInternals) {
7764
7818
  const {
@@ -7837,11 +7891,13 @@ function createHydrationFunctions(rendererInternals) {
7837
7891
  if (node.data !== vnode.children) {
7838
7892
  hasMismatch = true;
7839
7893
  warn(
7840
- `Hydration text mismatch:
7841
- - Server rendered: ${JSON.stringify(
7894
+ `Hydration text mismatch in`,
7895
+ node.parentNode,
7896
+ `
7897
+ - rendered on server: ${JSON.stringify(
7842
7898
  node.data
7843
7899
  )}
7844
- - Client rendered: ${JSON.stringify(vnode.children)}`
7900
+ - expected on client: ${JSON.stringify(vnode.children)}`
7845
7901
  );
7846
7902
  node.data = vnode.children;
7847
7903
  }
@@ -7927,7 +7983,7 @@ function createHydrationFunctions(rendererInternals) {
7927
7983
  null,
7928
7984
  parentComponent,
7929
7985
  parentSuspense,
7930
- isSVGContainer(container),
7986
+ getContainerType(container),
7931
7987
  optimized
7932
7988
  );
7933
7989
  if (isAsyncWrapper(vnode)) {
@@ -7962,7 +8018,7 @@ function createHydrationFunctions(rendererInternals) {
7962
8018
  vnode,
7963
8019
  parentComponent,
7964
8020
  parentSuspense,
7965
- isSVGContainer(parentNode(node)),
8021
+ getContainerType(parentNode(node)),
7966
8022
  slotScopeIds,
7967
8023
  optimized,
7968
8024
  rendererInternals,
@@ -7985,38 +8041,6 @@ function createHydrationFunctions(rendererInternals) {
7985
8041
  if (dirs) {
7986
8042
  invokeDirectiveHook(vnode, null, parentComponent, "created");
7987
8043
  }
7988
- if (props) {
7989
- if (forcePatch || !optimized || patchFlag & (16 | 32)) {
7990
- for (const key in props) {
7991
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7992
- key[0] === ".") {
7993
- patchProp(
7994
- el,
7995
- key,
7996
- null,
7997
- props[key],
7998
- false,
7999
- void 0,
8000
- parentComponent
8001
- );
8002
- }
8003
- }
8004
- } else if (props.onClick) {
8005
- patchProp(
8006
- el,
8007
- "onClick",
8008
- null,
8009
- props.onClick,
8010
- false,
8011
- void 0,
8012
- parentComponent
8013
- );
8014
- }
8015
- }
8016
- let vnodeHooks;
8017
- if (vnodeHooks = props && props.onVnodeBeforeMount) {
8018
- invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8019
- }
8020
8044
  let needCallTransitionHooks = false;
8021
8045
  if (isTemplateNode(el)) {
8022
8046
  needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
@@ -8027,16 +8051,6 @@ function createHydrationFunctions(rendererInternals) {
8027
8051
  replaceNode(content, el, parentComponent);
8028
8052
  vnode.el = el = content;
8029
8053
  }
8030
- if (dirs) {
8031
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8032
- }
8033
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
8034
- queueEffectWithSuspense(() => {
8035
- vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8036
- needCallTransitionHooks && transition.enter(el);
8037
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
8038
- }, parentSuspense);
8039
- }
8040
8054
  if (shapeFlag & 16 && // skip if element has innerHTML / textContent
8041
8055
  !(props && (props.innerHTML || props.textContent))) {
8042
8056
  let next = hydrateChildren(
@@ -8053,7 +8067,10 @@ function createHydrationFunctions(rendererInternals) {
8053
8067
  hasMismatch = true;
8054
8068
  if (!hasWarned) {
8055
8069
  warn(
8056
- `Hydration children mismatch in <${vnode.type}>: server rendered element contains more child nodes than client vdom.`
8070
+ `Hydration children mismatch on`,
8071
+ el,
8072
+ `
8073
+ Server rendered element contains more child nodes than client vdom.`
8057
8074
  );
8058
8075
  hasWarned = true;
8059
8076
  }
@@ -8065,13 +8082,50 @@ function createHydrationFunctions(rendererInternals) {
8065
8082
  if (el.textContent !== vnode.children) {
8066
8083
  hasMismatch = true;
8067
8084
  warn(
8068
- `Hydration text content mismatch in <${vnode.type}>:
8069
- - Server rendered: ${el.textContent}
8070
- - Client rendered: ${vnode.children}`
8085
+ `Hydration text content mismatch on`,
8086
+ el,
8087
+ `
8088
+ - rendered on server: ${el.textContent}
8089
+ - expected on client: ${vnode.children}`
8071
8090
  );
8072
8091
  el.textContent = vnode.children;
8073
8092
  }
8074
8093
  }
8094
+ if (props) {
8095
+ {
8096
+ for (const key in props) {
8097
+ if (propHasMismatch(el, key, props[key])) {
8098
+ hasMismatch = true;
8099
+ }
8100
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
8101
+ key[0] === ".") {
8102
+ patchProp(
8103
+ el,
8104
+ key,
8105
+ null,
8106
+ props[key],
8107
+ void 0,
8108
+ void 0,
8109
+ parentComponent
8110
+ );
8111
+ }
8112
+ }
8113
+ }
8114
+ }
8115
+ let vnodeHooks;
8116
+ if (vnodeHooks = props && props.onVnodeBeforeMount) {
8117
+ invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8118
+ }
8119
+ if (dirs) {
8120
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8121
+ }
8122
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
8123
+ queueEffectWithSuspense(() => {
8124
+ vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8125
+ needCallTransitionHooks && transition.enter(el);
8126
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
8127
+ }, parentSuspense);
8128
+ }
8075
8129
  }
8076
8130
  return el.nextSibling;
8077
8131
  };
@@ -8097,7 +8151,10 @@ function createHydrationFunctions(rendererInternals) {
8097
8151
  hasMismatch = true;
8098
8152
  if (!hasWarned) {
8099
8153
  warn(
8100
- `Hydration children mismatch in <${container.tagName.toLowerCase()}>: server rendered element contains fewer child nodes than client vdom.`
8154
+ `Hydration children mismatch on`,
8155
+ container,
8156
+ `
8157
+ Server rendered element contains fewer child nodes than client vdom.`
8101
8158
  );
8102
8159
  hasWarned = true;
8103
8160
  }
@@ -8108,7 +8165,7 @@ function createHydrationFunctions(rendererInternals) {
8108
8165
  null,
8109
8166
  parentComponent,
8110
8167
  parentSuspense,
8111
- isSVGContainer(container),
8168
+ getContainerType(container),
8112
8169
  slotScopeIds
8113
8170
  );
8114
8171
  }
@@ -8142,12 +8199,12 @@ function createHydrationFunctions(rendererInternals) {
8142
8199
  hasMismatch = true;
8143
8200
  warn(
8144
8201
  `Hydration node mismatch:
8145
- - Client vnode:`,
8146
- vnode.type,
8147
- `
8148
- - Server rendered DOM:`,
8202
+ - rendered on server:`,
8149
8203
  node,
8150
- node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``
8204
+ node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
8205
+ `
8206
+ - expected on client:`,
8207
+ vnode.type
8151
8208
  );
8152
8209
  vnode.el = null;
8153
8210
  if (isFragment) {
@@ -8171,7 +8228,7 @@ function createHydrationFunctions(rendererInternals) {
8171
8228
  next,
8172
8229
  parentComponent,
8173
8230
  parentSuspense,
8174
- isSVGContainer(container),
8231
+ getContainerType(container),
8175
8232
  slotScopeIds
8176
8233
  );
8177
8234
  return next;
@@ -8212,6 +8269,46 @@ function createHydrationFunctions(rendererInternals) {
8212
8269
  };
8213
8270
  return [hydrate, hydrateNode];
8214
8271
  }
8272
+ function propHasMismatch(el, key, clientValue) {
8273
+ let mismatchType;
8274
+ let mismatchKey;
8275
+ let actual;
8276
+ let expected;
8277
+ if (key === "class") {
8278
+ actual = el.className;
8279
+ expected = normalizeClass(clientValue);
8280
+ if (actual !== expected) {
8281
+ mismatchType = mismatchKey = `class`;
8282
+ }
8283
+ } else if (key === "style") {
8284
+ actual = el.getAttribute("style");
8285
+ expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
8286
+ if (actual !== expected) {
8287
+ mismatchType = mismatchKey = "style";
8288
+ }
8289
+ } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
8290
+ actual = el.hasAttribute(key) && el.getAttribute(key);
8291
+ expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? false : String(clientValue);
8292
+ if (actual !== expected) {
8293
+ mismatchType = `attribute`;
8294
+ mismatchKey = key;
8295
+ }
8296
+ }
8297
+ if (mismatchType) {
8298
+ const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
8299
+ warn(
8300
+ `Hydration ${mismatchType} mismatch on`,
8301
+ el,
8302
+ `
8303
+ - rendered on server: ${format(actual)}
8304
+ - expected on client: ${format(expected)}
8305
+ Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
8306
+ You should fix the source of the mismatch.`
8307
+ );
8308
+ return true;
8309
+ }
8310
+ return false;
8311
+ }
8215
8312
 
8216
8313
  let supported;
8217
8314
  let perf;
@@ -8280,7 +8377,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8280
8377
  setScopeId: hostSetScopeId = NOOP,
8281
8378
  insertStaticContent: hostInsertStaticContent
8282
8379
  } = options;
8283
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
8380
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
8284
8381
  if (n1 === n2) {
8285
8382
  return;
8286
8383
  }
@@ -8303,9 +8400,9 @@ function baseCreateRenderer(options, createHydrationFns) {
8303
8400
  break;
8304
8401
  case Static:
8305
8402
  if (n1 == null) {
8306
- mountStaticNode(n2, container, anchor, isSVG);
8403
+ mountStaticNode(n2, container, anchor, namespace);
8307
8404
  } else {
8308
- patchStaticNode(n1, n2, container, isSVG);
8405
+ patchStaticNode(n1, n2, container, namespace);
8309
8406
  }
8310
8407
  break;
8311
8408
  case Fragment:
@@ -8316,7 +8413,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8316
8413
  anchor,
8317
8414
  parentComponent,
8318
8415
  parentSuspense,
8319
- isSVG,
8416
+ namespace,
8320
8417
  slotScopeIds,
8321
8418
  optimized
8322
8419
  );
@@ -8330,7 +8427,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8330
8427
  anchor,
8331
8428
  parentComponent,
8332
8429
  parentSuspense,
8333
- isSVG,
8430
+ namespace,
8334
8431
  slotScopeIds,
8335
8432
  optimized
8336
8433
  );
@@ -8342,7 +8439,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8342
8439
  anchor,
8343
8440
  parentComponent,
8344
8441
  parentSuspense,
8345
- isSVG,
8442
+ namespace,
8346
8443
  slotScopeIds,
8347
8444
  optimized
8348
8445
  );
@@ -8354,7 +8451,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8354
8451
  anchor,
8355
8452
  parentComponent,
8356
8453
  parentSuspense,
8357
- isSVG,
8454
+ namespace,
8358
8455
  slotScopeIds,
8359
8456
  optimized,
8360
8457
  internals
@@ -8367,7 +8464,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8367
8464
  anchor,
8368
8465
  parentComponent,
8369
8466
  parentSuspense,
8370
- isSVG,
8467
+ namespace,
8371
8468
  slotScopeIds,
8372
8469
  optimized,
8373
8470
  internals
@@ -8405,17 +8502,17 @@ function baseCreateRenderer(options, createHydrationFns) {
8405
8502
  n2.el = n1.el;
8406
8503
  }
8407
8504
  };
8408
- const mountStaticNode = (n2, container, anchor, isSVG) => {
8505
+ const mountStaticNode = (n2, container, anchor, namespace) => {
8409
8506
  [n2.el, n2.anchor] = hostInsertStaticContent(
8410
8507
  n2.children,
8411
8508
  container,
8412
8509
  anchor,
8413
- isSVG,
8510
+ namespace,
8414
8511
  n2.el,
8415
8512
  n2.anchor
8416
8513
  );
8417
8514
  };
8418
- const patchStaticNode = (n1, n2, container, isSVG) => {
8515
+ const patchStaticNode = (n1, n2, container, namespace) => {
8419
8516
  if (n2.children !== n1.children) {
8420
8517
  const anchor = hostNextSibling(n1.anchor);
8421
8518
  removeStaticNode(n1);
@@ -8423,7 +8520,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8423
8520
  n2.children,
8424
8521
  container,
8425
8522
  anchor,
8426
- isSVG
8523
+ namespace
8427
8524
  );
8428
8525
  } else {
8429
8526
  n2.el = n1.el;
@@ -8448,8 +8545,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8448
8545
  }
8449
8546
  hostRemove(anchor);
8450
8547
  };
8451
- const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8452
- isSVG = isSVG || n2.type === "svg";
8548
+ const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8549
+ if (n2.type === "svg") {
8550
+ namespace = "svg";
8551
+ } else if (n2.type === "math") {
8552
+ namespace = "mathml";
8553
+ }
8453
8554
  if (n1 == null) {
8454
8555
  mountElement(
8455
8556
  n2,
@@ -8457,7 +8558,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8457
8558
  anchor,
8458
8559
  parentComponent,
8459
8560
  parentSuspense,
8460
- isSVG,
8561
+ namespace,
8461
8562
  slotScopeIds,
8462
8563
  optimized
8463
8564
  );
@@ -8467,19 +8568,19 @@ function baseCreateRenderer(options, createHydrationFns) {
8467
8568
  n2,
8468
8569
  parentComponent,
8469
8570
  parentSuspense,
8470
- isSVG,
8571
+ namespace,
8471
8572
  slotScopeIds,
8472
8573
  optimized
8473
8574
  );
8474
8575
  }
8475
8576
  };
8476
- const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8577
+ const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8477
8578
  let el;
8478
8579
  let vnodeHook;
8479
- const { type, props, shapeFlag, transition, dirs } = vnode;
8580
+ const { props, shapeFlag, transition, dirs } = vnode;
8480
8581
  el = vnode.el = hostCreateElement(
8481
8582
  vnode.type,
8482
- isSVG,
8583
+ namespace,
8483
8584
  props && props.is,
8484
8585
  props
8485
8586
  );
@@ -8492,7 +8593,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8492
8593
  null,
8493
8594
  parentComponent,
8494
8595
  parentSuspense,
8495
- isSVG && type !== "foreignObject",
8596
+ resolveChildrenNamespace(vnode, namespace),
8496
8597
  slotScopeIds,
8497
8598
  optimized
8498
8599
  );
@@ -8509,7 +8610,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8509
8610
  key,
8510
8611
  null,
8511
8612
  props[key],
8512
- isSVG,
8613
+ namespace,
8513
8614
  vnode.children,
8514
8615
  parentComponent,
8515
8616
  parentSuspense,
@@ -8518,7 +8619,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8518
8619
  }
8519
8620
  }
8520
8621
  if ("value" in props) {
8521
- hostPatchProp(el, "value", null, props.value);
8622
+ hostPatchProp(el, "value", null, props.value, namespace);
8522
8623
  }
8523
8624
  if (vnodeHook = props.onVnodeBeforeMount) {
8524
8625
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -8576,7 +8677,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8576
8677
  }
8577
8678
  }
8578
8679
  };
8579
- const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {
8680
+ const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
8580
8681
  for (let i = start; i < children.length; i++) {
8581
8682
  const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
8582
8683
  patch(
@@ -8586,13 +8687,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8586
8687
  anchor,
8587
8688
  parentComponent,
8588
8689
  parentSuspense,
8589
- isSVG,
8690
+ namespace,
8590
8691
  slotScopeIds,
8591
8692
  optimized
8592
8693
  );
8593
8694
  }
8594
8695
  };
8595
- const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8696
+ const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8596
8697
  const el = n2.el = n1.el;
8597
8698
  let { patchFlag, dynamicChildren, dirs } = n2;
8598
8699
  patchFlag |= n1.patchFlag & 16;
@@ -8612,7 +8713,6 @@ function baseCreateRenderer(options, createHydrationFns) {
8612
8713
  optimized = false;
8613
8714
  dynamicChildren = null;
8614
8715
  }
8615
- const areChildrenSVG = isSVG && n2.type !== "foreignObject";
8616
8716
  if (dynamicChildren) {
8617
8717
  patchBlockChildren(
8618
8718
  n1.dynamicChildren,
@@ -8620,7 +8720,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8620
8720
  el,
8621
8721
  parentComponent,
8622
8722
  parentSuspense,
8623
- areChildrenSVG,
8723
+ resolveChildrenNamespace(n2, namespace),
8624
8724
  slotScopeIds
8625
8725
  );
8626
8726
  {
@@ -8634,7 +8734,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8634
8734
  null,
8635
8735
  parentComponent,
8636
8736
  parentSuspense,
8637
- areChildrenSVG,
8737
+ resolveChildrenNamespace(n2, namespace),
8638
8738
  slotScopeIds,
8639
8739
  false
8640
8740
  );
@@ -8648,16 +8748,16 @@ function baseCreateRenderer(options, createHydrationFns) {
8648
8748
  newProps,
8649
8749
  parentComponent,
8650
8750
  parentSuspense,
8651
- isSVG
8751
+ namespace
8652
8752
  );
8653
8753
  } else {
8654
8754
  if (patchFlag & 2) {
8655
8755
  if (oldProps.class !== newProps.class) {
8656
- hostPatchProp(el, "class", null, newProps.class, isSVG);
8756
+ hostPatchProp(el, "class", null, newProps.class, namespace);
8657
8757
  }
8658
8758
  }
8659
8759
  if (patchFlag & 4) {
8660
- hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);
8760
+ hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
8661
8761
  }
8662
8762
  if (patchFlag & 8) {
8663
8763
  const propsToUpdate = n2.dynamicProps;
@@ -8671,7 +8771,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8671
8771
  key,
8672
8772
  prev,
8673
8773
  next,
8674
- isSVG,
8774
+ namespace,
8675
8775
  n1.children,
8676
8776
  parentComponent,
8677
8777
  parentSuspense,
@@ -8694,7 +8794,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8694
8794
  newProps,
8695
8795
  parentComponent,
8696
8796
  parentSuspense,
8697
- isSVG
8797
+ namespace
8698
8798
  );
8699
8799
  }
8700
8800
  if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
@@ -8704,7 +8804,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8704
8804
  }, parentSuspense);
8705
8805
  }
8706
8806
  };
8707
- const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {
8807
+ const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
8708
8808
  for (let i = 0; i < newChildren.length; i++) {
8709
8809
  const oldVNode = oldChildren[i];
8710
8810
  const newVNode = newChildren[i];
@@ -8729,13 +8829,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8729
8829
  null,
8730
8830
  parentComponent,
8731
8831
  parentSuspense,
8732
- isSVG,
8832
+ namespace,
8733
8833
  slotScopeIds,
8734
8834
  true
8735
8835
  );
8736
8836
  }
8737
8837
  };
8738
- const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
8838
+ const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
8739
8839
  if (oldProps !== newProps) {
8740
8840
  if (oldProps !== EMPTY_OBJ) {
8741
8841
  for (const key in oldProps) {
@@ -8745,7 +8845,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8745
8845
  key,
8746
8846
  oldProps[key],
8747
8847
  null,
8748
- isSVG,
8848
+ namespace,
8749
8849
  vnode.children,
8750
8850
  parentComponent,
8751
8851
  parentSuspense,
@@ -8765,7 +8865,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8765
8865
  key,
8766
8866
  prev,
8767
8867
  next,
8768
- isSVG,
8868
+ namespace,
8769
8869
  vnode.children,
8770
8870
  parentComponent,
8771
8871
  parentSuspense,
@@ -8774,11 +8874,11 @@ function baseCreateRenderer(options, createHydrationFns) {
8774
8874
  }
8775
8875
  }
8776
8876
  if ("value" in newProps) {
8777
- hostPatchProp(el, "value", oldProps.value, newProps.value);
8877
+ hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
8778
8878
  }
8779
8879
  }
8780
8880
  };
8781
- const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8881
+ const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8782
8882
  const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
8783
8883
  const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
8784
8884
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
@@ -8802,7 +8902,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8802
8902
  fragmentEndAnchor,
8803
8903
  parentComponent,
8804
8904
  parentSuspense,
8805
- isSVG,
8905
+ namespace,
8806
8906
  slotScopeIds,
8807
8907
  optimized
8808
8908
  );
@@ -8816,7 +8916,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8816
8916
  container,
8817
8917
  parentComponent,
8818
8918
  parentSuspense,
8819
- isSVG,
8919
+ namespace,
8820
8920
  slotScopeIds
8821
8921
  );
8822
8922
  {
@@ -8830,14 +8930,14 @@ function baseCreateRenderer(options, createHydrationFns) {
8830
8930
  fragmentEndAnchor,
8831
8931
  parentComponent,
8832
8932
  parentSuspense,
8833
- isSVG,
8933
+ namespace,
8834
8934
  slotScopeIds,
8835
8935
  optimized
8836
8936
  );
8837
8937
  }
8838
8938
  }
8839
8939
  };
8840
- const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8940
+ const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8841
8941
  n2.slotScopeIds = slotScopeIds;
8842
8942
  if (n1 == null) {
8843
8943
  if (n2.shapeFlag & 512) {
@@ -8845,7 +8945,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8845
8945
  n2,
8846
8946
  container,
8847
8947
  anchor,
8848
- isSVG,
8948
+ namespace,
8849
8949
  optimized
8850
8950
  );
8851
8951
  } else {
@@ -8855,7 +8955,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8855
8955
  anchor,
8856
8956
  parentComponent,
8857
8957
  parentSuspense,
8858
- isSVG,
8958
+ namespace,
8859
8959
  optimized
8860
8960
  );
8861
8961
  }
@@ -8863,7 +8963,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8863
8963
  updateComponent(n1, n2, optimized);
8864
8964
  }
8865
8965
  };
8866
- const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
8966
+ const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
8867
8967
  const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
8868
8968
  const instance = compatMountInstance || (initialVNode.component = createComponentInstance(
8869
8969
  initialVNode,
@@ -8895,17 +8995,17 @@ function baseCreateRenderer(options, createHydrationFns) {
8895
8995
  const placeholder = instance.subTree = createVNode(Comment);
8896
8996
  processCommentNode(null, placeholder, container, anchor);
8897
8997
  }
8898
- return;
8998
+ } else {
8999
+ setupRenderEffect(
9000
+ instance,
9001
+ initialVNode,
9002
+ container,
9003
+ anchor,
9004
+ parentSuspense,
9005
+ namespace,
9006
+ optimized
9007
+ );
8899
9008
  }
8900
- setupRenderEffect(
8901
- instance,
8902
- initialVNode,
8903
- container,
8904
- anchor,
8905
- parentSuspense,
8906
- isSVG,
8907
- optimized
8908
- );
8909
9009
  {
8910
9010
  popWarningContext();
8911
9011
  endMeasure(instance, `mount`);
@@ -8934,7 +9034,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8934
9034
  instance.vnode = n2;
8935
9035
  }
8936
9036
  };
8937
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {
9037
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
8938
9038
  const componentUpdateFn = () => {
8939
9039
  if (!instance.isMounted) {
8940
9040
  let vnodeHook;
@@ -9004,7 +9104,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9004
9104
  anchor,
9005
9105
  instance,
9006
9106
  parentSuspense,
9007
- isSVG
9107
+ namespace
9008
9108
  );
9009
9109
  {
9010
9110
  endMeasure(instance, `patch`);
@@ -9043,6 +9143,21 @@ function baseCreateRenderer(options, createHydrationFns) {
9043
9143
  initialVNode = container = anchor = null;
9044
9144
  } else {
9045
9145
  let { next, bu, u, parent, vnode } = instance;
9146
+ {
9147
+ const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
9148
+ if (nonHydratedAsyncRoot) {
9149
+ if (next) {
9150
+ next.el = vnode.el;
9151
+ updateComponentPreRender(instance, next, optimized);
9152
+ }
9153
+ nonHydratedAsyncRoot.asyncDep.then(() => {
9154
+ if (!instance.isUnmounted) {
9155
+ componentUpdateFn();
9156
+ }
9157
+ });
9158
+ return;
9159
+ }
9160
+ }
9046
9161
  let originNext = next;
9047
9162
  let vnodeHook;
9048
9163
  {
@@ -9086,7 +9201,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9086
9201
  getNextHostNode(prevTree),
9087
9202
  instance,
9088
9203
  parentSuspense,
9089
- isSVG
9204
+ namespace
9090
9205
  );
9091
9206
  {
9092
9207
  endMeasure(instance, `patch`);
@@ -9147,10 +9262,10 @@ function baseCreateRenderer(options, createHydrationFns) {
9147
9262
  updateProps(instance, nextVNode.props, prevProps, optimized);
9148
9263
  updateSlots(instance, nextVNode.children, optimized);
9149
9264
  pauseTracking();
9150
- flushPreFlushCbs();
9265
+ flushPreFlushCbs(instance);
9151
9266
  resetTracking();
9152
9267
  };
9153
- const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
9268
+ const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
9154
9269
  const c1 = n1 && n1.children;
9155
9270
  const prevShapeFlag = n1 ? n1.shapeFlag : 0;
9156
9271
  const c2 = n2.children;
@@ -9164,7 +9279,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9164
9279
  anchor,
9165
9280
  parentComponent,
9166
9281
  parentSuspense,
9167
- isSVG,
9282
+ namespace,
9168
9283
  slotScopeIds,
9169
9284
  optimized
9170
9285
  );
@@ -9177,7 +9292,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9177
9292
  anchor,
9178
9293
  parentComponent,
9179
9294
  parentSuspense,
9180
- isSVG,
9295
+ namespace,
9181
9296
  slotScopeIds,
9182
9297
  optimized
9183
9298
  );
@@ -9201,7 +9316,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9201
9316
  anchor,
9202
9317
  parentComponent,
9203
9318
  parentSuspense,
9204
- isSVG,
9319
+ namespace,
9205
9320
  slotScopeIds,
9206
9321
  optimized
9207
9322
  );
@@ -9219,7 +9334,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9219
9334
  anchor,
9220
9335
  parentComponent,
9221
9336
  parentSuspense,
9222
- isSVG,
9337
+ namespace,
9223
9338
  slotScopeIds,
9224
9339
  optimized
9225
9340
  );
@@ -9227,7 +9342,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9227
9342
  }
9228
9343
  }
9229
9344
  };
9230
- const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
9345
+ const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9231
9346
  c1 = c1 || EMPTY_ARR;
9232
9347
  c2 = c2 || EMPTY_ARR;
9233
9348
  const oldLength = c1.length;
@@ -9243,7 +9358,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9243
9358
  null,
9244
9359
  parentComponent,
9245
9360
  parentSuspense,
9246
- isSVG,
9361
+ namespace,
9247
9362
  slotScopeIds,
9248
9363
  optimized
9249
9364
  );
@@ -9264,14 +9379,14 @@ function baseCreateRenderer(options, createHydrationFns) {
9264
9379
  anchor,
9265
9380
  parentComponent,
9266
9381
  parentSuspense,
9267
- isSVG,
9382
+ namespace,
9268
9383
  slotScopeIds,
9269
9384
  optimized,
9270
9385
  commonLength
9271
9386
  );
9272
9387
  }
9273
9388
  };
9274
- const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
9389
+ const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9275
9390
  let i = 0;
9276
9391
  const l2 = c2.length;
9277
9392
  let e1 = c1.length - 1;
@@ -9287,7 +9402,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9287
9402
  null,
9288
9403
  parentComponent,
9289
9404
  parentSuspense,
9290
- isSVG,
9405
+ namespace,
9291
9406
  slotScopeIds,
9292
9407
  optimized
9293
9408
  );
@@ -9307,7 +9422,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9307
9422
  null,
9308
9423
  parentComponent,
9309
9424
  parentSuspense,
9310
- isSVG,
9425
+ namespace,
9311
9426
  slotScopeIds,
9312
9427
  optimized
9313
9428
  );
@@ -9329,7 +9444,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9329
9444
  anchor,
9330
9445
  parentComponent,
9331
9446
  parentSuspense,
9332
- isSVG,
9447
+ namespace,
9333
9448
  slotScopeIds,
9334
9449
  optimized
9335
9450
  );
@@ -9399,7 +9514,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9399
9514
  null,
9400
9515
  parentComponent,
9401
9516
  parentSuspense,
9402
- isSVG,
9517
+ namespace,
9403
9518
  slotScopeIds,
9404
9519
  optimized
9405
9520
  );
@@ -9420,7 +9535,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9420
9535
  anchor,
9421
9536
  parentComponent,
9422
9537
  parentSuspense,
9423
- isSVG,
9538
+ namespace,
9424
9539
  slotScopeIds,
9425
9540
  optimized
9426
9541
  );
@@ -9650,13 +9765,21 @@ function baseCreateRenderer(options, createHydrationFns) {
9650
9765
  }
9651
9766
  return hostNextSibling(vnode.anchor || vnode.el);
9652
9767
  };
9653
- const render = (vnode, container, isSVG) => {
9768
+ const render = (vnode, container, namespace) => {
9654
9769
  if (vnode == null) {
9655
9770
  if (container._vnode) {
9656
9771
  unmount(container._vnode, null, null, true);
9657
9772
  }
9658
9773
  } else {
9659
- patch(container._vnode || null, vnode, container, null, null, null, isSVG);
9774
+ patch(
9775
+ container._vnode || null,
9776
+ vnode,
9777
+ container,
9778
+ null,
9779
+ null,
9780
+ null,
9781
+ namespace
9782
+ );
9660
9783
  }
9661
9784
  flushPreFlushCbs();
9662
9785
  flushPostFlushCbs();
@@ -9687,6 +9810,9 @@ function baseCreateRenderer(options, createHydrationFns) {
9687
9810
  createApp: createAppAPI(render, hydrate)
9688
9811
  };
9689
9812
  }
9813
+ function resolveChildrenNamespace({ type, props }, currentNamespace) {
9814
+ return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
9815
+ }
9690
9816
  function toggleRecurse({ effect, update }, allowed) {
9691
9817
  effect.allowRecurse = update.allowRecurse = allowed;
9692
9818
  }
@@ -9757,10 +9883,21 @@ function getSequence(arr) {
9757
9883
  }
9758
9884
  return result;
9759
9885
  }
9886
+ function locateNonHydratedAsyncRoot(instance) {
9887
+ const subComponent = instance.subTree.component;
9888
+ if (subComponent) {
9889
+ if (subComponent.asyncDep && !subComponent.asyncResolved) {
9890
+ return subComponent;
9891
+ } else {
9892
+ return locateNonHydratedAsyncRoot(subComponent);
9893
+ }
9894
+ }
9895
+ }
9760
9896
 
9761
9897
  const isTeleport = (type) => type.__isTeleport;
9762
9898
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
9763
9899
  const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
9900
+ const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
9764
9901
  const resolveTarget = (props, select) => {
9765
9902
  const targetSelector = props && props.to;
9766
9903
  if (isString(targetSelector)) {
@@ -9788,7 +9925,7 @@ const resolveTarget = (props, select) => {
9788
9925
  const TeleportImpl = {
9789
9926
  name: "Teleport",
9790
9927
  __isTeleport: true,
9791
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
9928
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
9792
9929
  const {
9793
9930
  mc: mountChildren,
9794
9931
  pc: patchChildren,
@@ -9810,7 +9947,11 @@ const TeleportImpl = {
9810
9947
  const targetAnchor = n2.targetAnchor = createText("");
9811
9948
  if (target) {
9812
9949
  insert(targetAnchor, target);
9813
- isSVG = isSVG || isTargetSVG(target);
9950
+ if (namespace === "svg" || isTargetSVG(target)) {
9951
+ namespace = "svg";
9952
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
9953
+ namespace = "mathml";
9954
+ }
9814
9955
  } else if (!disabled) {
9815
9956
  warn("Invalid Teleport target on mount:", target, `(${typeof target})`);
9816
9957
  }
@@ -9822,7 +9963,7 @@ const TeleportImpl = {
9822
9963
  anchor2,
9823
9964
  parentComponent,
9824
9965
  parentSuspense,
9825
- isSVG,
9966
+ namespace,
9826
9967
  slotScopeIds,
9827
9968
  optimized
9828
9969
  );
@@ -9841,7 +9982,11 @@ const TeleportImpl = {
9841
9982
  const wasDisabled = isTeleportDisabled(n1.props);
9842
9983
  const currentContainer = wasDisabled ? container : target;
9843
9984
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
9844
- isSVG = isSVG || isTargetSVG(target);
9985
+ if (namespace === "svg" || isTargetSVG(target)) {
9986
+ namespace = "svg";
9987
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
9988
+ namespace = "mathml";
9989
+ }
9845
9990
  if (dynamicChildren) {
9846
9991
  patchBlockChildren(
9847
9992
  n1.dynamicChildren,
@@ -9849,7 +9994,7 @@ const TeleportImpl = {
9849
9994
  currentContainer,
9850
9995
  parentComponent,
9851
9996
  parentSuspense,
9852
- isSVG,
9997
+ namespace,
9853
9998
  slotScopeIds
9854
9999
  );
9855
10000
  traverseStaticChildren(n1, n2, true);
@@ -9861,7 +10006,7 @@ const TeleportImpl = {
9861
10006
  currentAnchor,
9862
10007
  parentComponent,
9863
10008
  parentSuspense,
9864
- isSVG,
10009
+ namespace,
9865
10010
  slotScopeIds,
9866
10011
  false
9867
10012
  );
@@ -10545,20 +10690,29 @@ function createComponentInstance(vnode, parent, suspense) {
10545
10690
  let currentInstance = null;
10546
10691
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
10547
10692
  let internalSetCurrentInstance;
10548
- let globalCurrentInstanceSetters;
10549
- let settersKey = "__VUE_INSTANCE_SETTERS__";
10693
+ let setInSSRSetupState;
10550
10694
  {
10551
- if (!(globalCurrentInstanceSetters = getGlobalThis()[settersKey])) {
10552
- globalCurrentInstanceSetters = getGlobalThis()[settersKey] = [];
10553
- }
10554
- globalCurrentInstanceSetters.push((i) => currentInstance = i);
10555
- internalSetCurrentInstance = (instance) => {
10556
- if (globalCurrentInstanceSetters.length > 1) {
10557
- globalCurrentInstanceSetters.forEach((s) => s(instance));
10558
- } else {
10559
- globalCurrentInstanceSetters[0](instance);
10560
- }
10695
+ const g = getGlobalThis();
10696
+ const registerGlobalSetter = (key, setter) => {
10697
+ let setters;
10698
+ if (!(setters = g[key]))
10699
+ setters = g[key] = [];
10700
+ setters.push(setter);
10701
+ return (v) => {
10702
+ if (setters.length > 1)
10703
+ setters.forEach((set) => set(v));
10704
+ else
10705
+ setters[0](v);
10706
+ };
10561
10707
  };
10708
+ internalSetCurrentInstance = registerGlobalSetter(
10709
+ `__VUE_INSTANCE_SETTERS__`,
10710
+ (v) => currentInstance = v
10711
+ );
10712
+ setInSSRSetupState = registerGlobalSetter(
10713
+ `__VUE_SSR_SETTERS__`,
10714
+ (v) => isInSSRComponentSetup = v
10715
+ );
10562
10716
  }
10563
10717
  const setCurrentInstance = (instance) => {
10564
10718
  internalSetCurrentInstance(instance);
@@ -10582,13 +10736,13 @@ function isStatefulComponent(instance) {
10582
10736
  }
10583
10737
  let isInSSRComponentSetup = false;
10584
10738
  function setupComponent(instance, isSSR = false) {
10585
- isInSSRComponentSetup = isSSR;
10739
+ isSSR && setInSSRSetupState(isSSR);
10586
10740
  const { props, children } = instance.vnode;
10587
10741
  const isStateful = isStatefulComponent(instance);
10588
10742
  initProps(instance, props, isStateful, isSSR);
10589
10743
  initSlots(instance, children);
10590
10744
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
10591
- isInSSRComponentSetup = false;
10745
+ isSSR && setInSSRSetupState(false);
10592
10746
  return setupResult;
10593
10747
  }
10594
10748
  function setupStatefulComponent(instance, isSSR) {
@@ -11114,7 +11268,7 @@ function isMemoSame(cached, memo) {
11114
11268
  return true;
11115
11269
  }
11116
11270
 
11117
- const version = "3.4.0-alpha.4";
11271
+ const version = "3.4.0-beta.1";
11118
11272
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11119
11273
  const _ssrUtils = {
11120
11274
  createComponentInstance,
@@ -11137,6 +11291,7 @@ const compatUtils = _compatUtils ;
11137
11291
  const DeprecationTypes = DeprecationTypes$1 ;
11138
11292
 
11139
11293
  const svgNS = "http://www.w3.org/2000/svg";
11294
+ const mathmlNS = "http://www.w3.org/1998/Math/MathML";
11140
11295
  const doc = typeof document !== "undefined" ? document : null;
11141
11296
  const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
11142
11297
  const nodeOps = {
@@ -11149,8 +11304,8 @@ const nodeOps = {
11149
11304
  parent.removeChild(child);
11150
11305
  }
11151
11306
  },
11152
- createElement: (tag, isSVG, is, props) => {
11153
- const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0);
11307
+ createElement: (tag, namespace, is, props) => {
11308
+ const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
11154
11309
  if (tag === "select" && props && props.multiple != null) {
11155
11310
  el.setAttribute("multiple", props.multiple);
11156
11311
  }
@@ -11174,7 +11329,7 @@ const nodeOps = {
11174
11329
  // Reason: innerHTML.
11175
11330
  // Static content here can only come from compiled templates.
11176
11331
  // As long as the user only uses trusted templates, this is safe.
11177
- insertStaticContent(content, parent, anchor, isSVG, start, end) {
11332
+ insertStaticContent(content, parent, anchor, namespace, start, end) {
11178
11333
  const before = anchor ? anchor.previousSibling : parent.lastChild;
11179
11334
  if (start && (start === end || start.nextSibling)) {
11180
11335
  while (true) {
@@ -11183,9 +11338,9 @@ const nodeOps = {
11183
11338
  break;
11184
11339
  }
11185
11340
  } else {
11186
- templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content;
11341
+ templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
11187
11342
  const template = templateContainer.content;
11188
- if (isSVG) {
11343
+ if (namespace === "svg" || namespace === "mathml") {
11189
11344
  const wrapper = template.firstChild;
11190
11345
  while (wrapper.firstChild) {
11191
11346
  template.appendChild(wrapper.firstChild);
@@ -11832,7 +11987,8 @@ function patchStopImmediatePropagation(e, value) {
11832
11987
 
11833
11988
  const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11834
11989
  key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
11835
- const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11990
+ const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11991
+ const isSVG = namespace === "svg";
11836
11992
  if (key === "class") {
11837
11993
  patchClass(el, nextValue, isSVG);
11838
11994
  } else if (key === "style") {
@@ -11884,7 +12040,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
11884
12040
  }
11885
12041
  if (key === "width" || key === "height") {
11886
12042
  const tag = el.tagName;
11887
- return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
12043
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
12044
+ return false;
12045
+ }
11888
12046
  }
11889
12047
  if (isNativeOn(key) && isString(value)) {
11890
12048
  return false;
@@ -12666,7 +12824,7 @@ const createApp = (...args) => {
12666
12824
  }
12667
12825
  }
12668
12826
  container.innerHTML = "";
12669
- const proxy = mount(container, false, container instanceof SVGElement);
12827
+ const proxy = mount(container, false, resolveRootNamespace(container));
12670
12828
  if (container instanceof Element) {
12671
12829
  container.removeAttribute("v-cloak");
12672
12830
  container.setAttribute("data-v-app", "");
@@ -12685,14 +12843,22 @@ const createSSRApp = (...args) => {
12685
12843
  app.mount = (containerOrSelector) => {
12686
12844
  const container = normalizeContainer(containerOrSelector);
12687
12845
  if (container) {
12688
- return mount(container, true, container instanceof SVGElement);
12846
+ return mount(container, true, resolveRootNamespace(container));
12689
12847
  }
12690
12848
  };
12691
12849
  return app;
12692
12850
  };
12851
+ function resolveRootNamespace(container) {
12852
+ if (container instanceof SVGElement) {
12853
+ return "svg";
12854
+ }
12855
+ if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
12856
+ return "mathml";
12857
+ }
12858
+ }
12693
12859
  function injectNativeTagCheck(app) {
12694
12860
  Object.defineProperty(app.config, "isNativeTag", {
12695
- value: (tag) => isHTMLTag(tag) || isSVGTag(tag),
12861
+ value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
12696
12862
  writable: false
12697
12863
  });
12698
12864
  }
@@ -14164,32 +14330,297 @@ const errorMessages = {
14164
14330
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
14165
14331
  [45]: `Error parsing JavaScript expression: `,
14166
14332
  [46]: `<KeepAlive> expects exactly one child component.`,
14167
- [47]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
14333
+ [51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
14168
14334
  // generic errors
14169
- [48]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
14170
- [49]: `ES module mode is not supported in this build of compiler.`,
14171
- [50]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
14172
- [51]: `"scopeId" option is only supported in module mode.`,
14335
+ [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
14336
+ [48]: `ES module mode is not supported in this build of compiler.`,
14337
+ [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
14338
+ [50]: `"scopeId" option is only supported in module mode.`,
14173
14339
  // just to fulfill types
14174
14340
  [52]: ``
14175
14341
  };
14176
14342
 
14177
- const isStaticExp = (p) => p.type === 4 && p.isStatic;
14178
- function isCoreComponent(tag) {
14179
- switch (tag) {
14180
- case "Teleport":
14181
- case "teleport":
14182
- return TELEPORT;
14183
- case "Suspense":
14184
- case "suspense":
14185
- return SUSPENSE;
14186
- case "KeepAlive":
14187
- case "keep-alive":
14188
- return KEEP_ALIVE;
14189
- case "BaseTransition":
14190
- case "base-transition":
14191
- return BASE_TRANSITION;
14192
- }
14343
+ function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
14344
+ const rootExp = root.type === "Program" ? root.body[0].type === "ExpressionStatement" && root.body[0].expression : root;
14345
+ estreeWalker.walk(root, {
14346
+ enter(node, parent) {
14347
+ parent && parentStack.push(parent);
14348
+ if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) {
14349
+ return this.skip();
14350
+ }
14351
+ if (node.type === "Identifier") {
14352
+ const isLocal = !!knownIds[node.name];
14353
+ const isRefed = isReferencedIdentifier(node, parent, parentStack);
14354
+ if (includeAll || isRefed && !isLocal) {
14355
+ onIdentifier(node, parent, parentStack, isRefed, isLocal);
14356
+ }
14357
+ } else if (node.type === "ObjectProperty" && parent.type === "ObjectPattern") {
14358
+ node.inPattern = true;
14359
+ } else if (isFunctionType(node)) {
14360
+ walkFunctionParams(node, (id) => markScopeIdentifier(node, id, knownIds));
14361
+ } else if (node.type === "BlockStatement") {
14362
+ walkBlockDeclarations(
14363
+ node,
14364
+ (id) => markScopeIdentifier(node, id, knownIds)
14365
+ );
14366
+ }
14367
+ },
14368
+ leave(node, parent) {
14369
+ parent && parentStack.pop();
14370
+ if (node !== rootExp && node.scopeIds) {
14371
+ for (const id of node.scopeIds) {
14372
+ knownIds[id]--;
14373
+ if (knownIds[id] === 0) {
14374
+ delete knownIds[id];
14375
+ }
14376
+ }
14377
+ }
14378
+ }
14379
+ });
14380
+ }
14381
+ function isReferencedIdentifier(id, parent, parentStack) {
14382
+ if (!parent) {
14383
+ return true;
14384
+ }
14385
+ if (id.name === "arguments") {
14386
+ return false;
14387
+ }
14388
+ if (isReferenced(id, parent)) {
14389
+ return true;
14390
+ }
14391
+ switch (parent.type) {
14392
+ case "AssignmentExpression":
14393
+ case "AssignmentPattern":
14394
+ return true;
14395
+ case "ObjectPattern":
14396
+ case "ArrayPattern":
14397
+ return isInDestructureAssignment(parent, parentStack);
14398
+ }
14399
+ return false;
14400
+ }
14401
+ function isInDestructureAssignment(parent, parentStack) {
14402
+ if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) {
14403
+ let i = parentStack.length;
14404
+ while (i--) {
14405
+ const p = parentStack[i];
14406
+ if (p.type === "AssignmentExpression") {
14407
+ return true;
14408
+ } else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) {
14409
+ break;
14410
+ }
14411
+ }
14412
+ }
14413
+ return false;
14414
+ }
14415
+ function walkFunctionParams(node, onIdent) {
14416
+ for (const p of node.params) {
14417
+ for (const id of extractIdentifiers(p)) {
14418
+ onIdent(id);
14419
+ }
14420
+ }
14421
+ }
14422
+ function walkBlockDeclarations(block, onIdent) {
14423
+ for (const stmt of block.body) {
14424
+ if (stmt.type === "VariableDeclaration") {
14425
+ if (stmt.declare)
14426
+ continue;
14427
+ for (const decl of stmt.declarations) {
14428
+ for (const id of extractIdentifiers(decl.id)) {
14429
+ onIdent(id);
14430
+ }
14431
+ }
14432
+ } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
14433
+ if (stmt.declare || !stmt.id)
14434
+ continue;
14435
+ onIdent(stmt.id);
14436
+ } else if (stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement") {
14437
+ const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
14438
+ if (variable && variable.type === "VariableDeclaration") {
14439
+ for (const decl of variable.declarations) {
14440
+ for (const id of extractIdentifiers(decl.id)) {
14441
+ onIdent(id);
14442
+ }
14443
+ }
14444
+ }
14445
+ }
14446
+ }
14447
+ }
14448
+ function extractIdentifiers(param, nodes = []) {
14449
+ switch (param.type) {
14450
+ case "Identifier":
14451
+ nodes.push(param);
14452
+ break;
14453
+ case "MemberExpression":
14454
+ let object = param;
14455
+ while (object.type === "MemberExpression") {
14456
+ object = object.object;
14457
+ }
14458
+ nodes.push(object);
14459
+ break;
14460
+ case "ObjectPattern":
14461
+ for (const prop of param.properties) {
14462
+ if (prop.type === "RestElement") {
14463
+ extractIdentifiers(prop.argument, nodes);
14464
+ } else {
14465
+ extractIdentifiers(prop.value, nodes);
14466
+ }
14467
+ }
14468
+ break;
14469
+ case "ArrayPattern":
14470
+ param.elements.forEach((element) => {
14471
+ if (element)
14472
+ extractIdentifiers(element, nodes);
14473
+ });
14474
+ break;
14475
+ case "RestElement":
14476
+ extractIdentifiers(param.argument, nodes);
14477
+ break;
14478
+ case "AssignmentPattern":
14479
+ extractIdentifiers(param.left, nodes);
14480
+ break;
14481
+ }
14482
+ return nodes;
14483
+ }
14484
+ function markScopeIdentifier(node, child, knownIds) {
14485
+ const { name } = child;
14486
+ if (node.scopeIds && node.scopeIds.has(name)) {
14487
+ return;
14488
+ }
14489
+ if (name in knownIds) {
14490
+ knownIds[name]++;
14491
+ } else {
14492
+ knownIds[name] = 1;
14493
+ }
14494
+ (node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name);
14495
+ }
14496
+ const isFunctionType = (node) => {
14497
+ return /Function(?:Expression|Declaration)$|Method$/.test(node.type);
14498
+ };
14499
+ const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
14500
+ const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
14501
+ function isReferenced(node, parent, grandparent) {
14502
+ switch (parent.type) {
14503
+ case "MemberExpression":
14504
+ case "OptionalMemberExpression":
14505
+ if (parent.property === node) {
14506
+ return !!parent.computed;
14507
+ }
14508
+ return parent.object === node;
14509
+ case "JSXMemberExpression":
14510
+ return parent.object === node;
14511
+ case "VariableDeclarator":
14512
+ return parent.init === node;
14513
+ case "ArrowFunctionExpression":
14514
+ return parent.body === node;
14515
+ case "PrivateName":
14516
+ return false;
14517
+ case "ClassMethod":
14518
+ case "ClassPrivateMethod":
14519
+ case "ObjectMethod":
14520
+ if (parent.key === node) {
14521
+ return !!parent.computed;
14522
+ }
14523
+ return false;
14524
+ case "ObjectProperty":
14525
+ if (parent.key === node) {
14526
+ return !!parent.computed;
14527
+ }
14528
+ return !grandparent || grandparent.type !== "ObjectPattern";
14529
+ case "ClassProperty":
14530
+ if (parent.key === node) {
14531
+ return !!parent.computed;
14532
+ }
14533
+ return true;
14534
+ case "ClassPrivateProperty":
14535
+ return parent.key !== node;
14536
+ case "ClassDeclaration":
14537
+ case "ClassExpression":
14538
+ return parent.superClass === node;
14539
+ case "AssignmentExpression":
14540
+ return parent.right === node;
14541
+ case "AssignmentPattern":
14542
+ return parent.right === node;
14543
+ case "LabeledStatement":
14544
+ return false;
14545
+ case "CatchClause":
14546
+ return false;
14547
+ case "RestElement":
14548
+ return false;
14549
+ case "BreakStatement":
14550
+ case "ContinueStatement":
14551
+ return false;
14552
+ case "FunctionDeclaration":
14553
+ case "FunctionExpression":
14554
+ return false;
14555
+ case "ExportNamespaceSpecifier":
14556
+ case "ExportDefaultSpecifier":
14557
+ return false;
14558
+ case "ExportSpecifier":
14559
+ if (grandparent == null ? void 0 : grandparent.source) {
14560
+ return false;
14561
+ }
14562
+ return parent.local === node;
14563
+ case "ImportDefaultSpecifier":
14564
+ case "ImportNamespaceSpecifier":
14565
+ case "ImportSpecifier":
14566
+ return false;
14567
+ case "ImportAttribute":
14568
+ return false;
14569
+ case "JSXAttribute":
14570
+ return false;
14571
+ case "ObjectPattern":
14572
+ case "ArrayPattern":
14573
+ return false;
14574
+ case "MetaProperty":
14575
+ return false;
14576
+ case "ObjectTypeProperty":
14577
+ return parent.key !== node;
14578
+ case "TSEnumMember":
14579
+ return parent.id !== node;
14580
+ case "TSPropertySignature":
14581
+ if (parent.key === node) {
14582
+ return !!parent.computed;
14583
+ }
14584
+ return true;
14585
+ }
14586
+ return true;
14587
+ }
14588
+ const TS_NODE_TYPES = [
14589
+ "TSAsExpression",
14590
+ // foo as number
14591
+ "TSTypeAssertion",
14592
+ // (<number>foo)
14593
+ "TSNonNullExpression",
14594
+ // foo!
14595
+ "TSInstantiationExpression",
14596
+ // foo<string>
14597
+ "TSSatisfiesExpression"
14598
+ // foo satisfies T
14599
+ ];
14600
+ function unwrapTSNode(node) {
14601
+ if (TS_NODE_TYPES.includes(node.type)) {
14602
+ return unwrapTSNode(node.expression);
14603
+ } else {
14604
+ return node;
14605
+ }
14606
+ }
14607
+
14608
+ const isStaticExp = (p) => p.type === 4 && p.isStatic;
14609
+ function isCoreComponent(tag) {
14610
+ switch (tag) {
14611
+ case "Teleport":
14612
+ case "teleport":
14613
+ return TELEPORT;
14614
+ case "Suspense":
14615
+ case "suspense":
14616
+ return SUSPENSE;
14617
+ case "KeepAlive":
14618
+ case "keep-alive":
14619
+ return KEEP_ALIVE;
14620
+ case "BaseTransition":
14621
+ case "base-transition":
14622
+ return BASE_TRANSITION;
14623
+ }
14193
14624
  }
14194
14625
  const nonIdentifierRE = /^\d|[^\$\w]/;
14195
14626
  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
@@ -14198,9 +14629,7 @@ const isMemberExpressionNode = (path, context) => {
14198
14629
  let ret = parser.parseExpression(path, {
14199
14630
  plugins: context.expressionPlugins
14200
14631
  });
14201
- if (ret.type === "TSAsExpression" || ret.type === "TSTypeAssertion") {
14202
- ret = ret.expression;
14203
- }
14632
+ ret = unwrapTSNode(ret);
14204
14633
  return ret.type === "MemberExpression" || ret.type === "OptionalMemberExpression" || ret.type === "Identifier";
14205
14634
  } catch (e) {
14206
14635
  return false;
@@ -15462,6 +15891,7 @@ function createTransformContext(root, {
15462
15891
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
15463
15892
  const context = {
15464
15893
  // options
15894
+ filename,
15465
15895
  selfName: nameMatch && capitalize(camelize(nameMatch[1])),
15466
15896
  prefixIdentifiers,
15467
15897
  hoistStatic: hoistStatic2,
@@ -16535,264 +16965,6 @@ function genReturnStatement({ returns }, context) {
16535
16965
  }
16536
16966
  }
16537
16967
 
16538
- function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
16539
- const rootExp = root.type === "Program" ? root.body[0].type === "ExpressionStatement" && root.body[0].expression : root;
16540
- estreeWalker.walk(root, {
16541
- enter(node, parent) {
16542
- parent && parentStack.push(parent);
16543
- if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) {
16544
- return this.skip();
16545
- }
16546
- if (node.type === "Identifier") {
16547
- const isLocal = !!knownIds[node.name];
16548
- const isRefed = isReferencedIdentifier(node, parent, parentStack);
16549
- if (includeAll || isRefed && !isLocal) {
16550
- onIdentifier(node, parent, parentStack, isRefed, isLocal);
16551
- }
16552
- } else if (node.type === "ObjectProperty" && parent.type === "ObjectPattern") {
16553
- node.inPattern = true;
16554
- } else if (isFunctionType(node)) {
16555
- walkFunctionParams(node, (id) => markScopeIdentifier(node, id, knownIds));
16556
- } else if (node.type === "BlockStatement") {
16557
- walkBlockDeclarations(
16558
- node,
16559
- (id) => markScopeIdentifier(node, id, knownIds)
16560
- );
16561
- }
16562
- },
16563
- leave(node, parent) {
16564
- parent && parentStack.pop();
16565
- if (node !== rootExp && node.scopeIds) {
16566
- for (const id of node.scopeIds) {
16567
- knownIds[id]--;
16568
- if (knownIds[id] === 0) {
16569
- delete knownIds[id];
16570
- }
16571
- }
16572
- }
16573
- }
16574
- });
16575
- }
16576
- function isReferencedIdentifier(id, parent, parentStack) {
16577
- if (!parent) {
16578
- return true;
16579
- }
16580
- if (id.name === "arguments") {
16581
- return false;
16582
- }
16583
- if (isReferenced(id, parent)) {
16584
- return true;
16585
- }
16586
- switch (parent.type) {
16587
- case "AssignmentExpression":
16588
- case "AssignmentPattern":
16589
- return true;
16590
- case "ObjectPattern":
16591
- case "ArrayPattern":
16592
- return isInDestructureAssignment(parent, parentStack);
16593
- }
16594
- return false;
16595
- }
16596
- function isInDestructureAssignment(parent, parentStack) {
16597
- if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) {
16598
- let i = parentStack.length;
16599
- while (i--) {
16600
- const p = parentStack[i];
16601
- if (p.type === "AssignmentExpression") {
16602
- return true;
16603
- } else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) {
16604
- break;
16605
- }
16606
- }
16607
- }
16608
- return false;
16609
- }
16610
- function walkFunctionParams(node, onIdent) {
16611
- for (const p of node.params) {
16612
- for (const id of extractIdentifiers(p)) {
16613
- onIdent(id);
16614
- }
16615
- }
16616
- }
16617
- function walkBlockDeclarations(block, onIdent) {
16618
- for (const stmt of block.body) {
16619
- if (stmt.type === "VariableDeclaration") {
16620
- if (stmt.declare)
16621
- continue;
16622
- for (const decl of stmt.declarations) {
16623
- for (const id of extractIdentifiers(decl.id)) {
16624
- onIdent(id);
16625
- }
16626
- }
16627
- } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
16628
- if (stmt.declare || !stmt.id)
16629
- continue;
16630
- onIdent(stmt.id);
16631
- } else if (stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement") {
16632
- const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
16633
- if (variable && variable.type === "VariableDeclaration") {
16634
- for (const decl of variable.declarations) {
16635
- for (const id of extractIdentifiers(decl.id)) {
16636
- onIdent(id);
16637
- }
16638
- }
16639
- }
16640
- }
16641
- }
16642
- }
16643
- function extractIdentifiers(param, nodes = []) {
16644
- switch (param.type) {
16645
- case "Identifier":
16646
- nodes.push(param);
16647
- break;
16648
- case "MemberExpression":
16649
- let object = param;
16650
- while (object.type === "MemberExpression") {
16651
- object = object.object;
16652
- }
16653
- nodes.push(object);
16654
- break;
16655
- case "ObjectPattern":
16656
- for (const prop of param.properties) {
16657
- if (prop.type === "RestElement") {
16658
- extractIdentifiers(prop.argument, nodes);
16659
- } else {
16660
- extractIdentifiers(prop.value, nodes);
16661
- }
16662
- }
16663
- break;
16664
- case "ArrayPattern":
16665
- param.elements.forEach((element) => {
16666
- if (element)
16667
- extractIdentifiers(element, nodes);
16668
- });
16669
- break;
16670
- case "RestElement":
16671
- extractIdentifiers(param.argument, nodes);
16672
- break;
16673
- case "AssignmentPattern":
16674
- extractIdentifiers(param.left, nodes);
16675
- break;
16676
- }
16677
- return nodes;
16678
- }
16679
- function markScopeIdentifier(node, child, knownIds) {
16680
- const { name } = child;
16681
- if (node.scopeIds && node.scopeIds.has(name)) {
16682
- return;
16683
- }
16684
- if (name in knownIds) {
16685
- knownIds[name]++;
16686
- } else {
16687
- knownIds[name] = 1;
16688
- }
16689
- (node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name);
16690
- }
16691
- const isFunctionType = (node) => {
16692
- return /Function(?:Expression|Declaration)$|Method$/.test(node.type);
16693
- };
16694
- const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
16695
- const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
16696
- function isReferenced(node, parent, grandparent) {
16697
- switch (parent.type) {
16698
- case "MemberExpression":
16699
- case "OptionalMemberExpression":
16700
- if (parent.property === node) {
16701
- return !!parent.computed;
16702
- }
16703
- return parent.object === node;
16704
- case "JSXMemberExpression":
16705
- return parent.object === node;
16706
- case "VariableDeclarator":
16707
- return parent.init === node;
16708
- case "ArrowFunctionExpression":
16709
- return parent.body === node;
16710
- case "PrivateName":
16711
- return false;
16712
- case "ClassMethod":
16713
- case "ClassPrivateMethod":
16714
- case "ObjectMethod":
16715
- if (parent.key === node) {
16716
- return !!parent.computed;
16717
- }
16718
- return false;
16719
- case "ObjectProperty":
16720
- if (parent.key === node) {
16721
- return !!parent.computed;
16722
- }
16723
- return !grandparent || grandparent.type !== "ObjectPattern";
16724
- case "ClassProperty":
16725
- if (parent.key === node) {
16726
- return !!parent.computed;
16727
- }
16728
- return true;
16729
- case "ClassPrivateProperty":
16730
- return parent.key !== node;
16731
- case "ClassDeclaration":
16732
- case "ClassExpression":
16733
- return parent.superClass === node;
16734
- case "AssignmentExpression":
16735
- return parent.right === node;
16736
- case "AssignmentPattern":
16737
- return parent.right === node;
16738
- case "LabeledStatement":
16739
- return false;
16740
- case "CatchClause":
16741
- return false;
16742
- case "RestElement":
16743
- return false;
16744
- case "BreakStatement":
16745
- case "ContinueStatement":
16746
- return false;
16747
- case "FunctionDeclaration":
16748
- case "FunctionExpression":
16749
- return false;
16750
- case "ExportNamespaceSpecifier":
16751
- case "ExportDefaultSpecifier":
16752
- return false;
16753
- case "ExportSpecifier":
16754
- if (grandparent == null ? void 0 : grandparent.source) {
16755
- return false;
16756
- }
16757
- return parent.local === node;
16758
- case "ImportDefaultSpecifier":
16759
- case "ImportNamespaceSpecifier":
16760
- case "ImportSpecifier":
16761
- return false;
16762
- case "ImportAttribute":
16763
- return false;
16764
- case "JSXAttribute":
16765
- return false;
16766
- case "ObjectPattern":
16767
- case "ArrayPattern":
16768
- return false;
16769
- case "MetaProperty":
16770
- return false;
16771
- case "ObjectTypeProperty":
16772
- return parent.key !== node;
16773
- case "TSEnumMember":
16774
- return parent.id !== node;
16775
- case "TSPropertySignature":
16776
- if (parent.key === node) {
16777
- return !!parent.computed;
16778
- }
16779
- return true;
16780
- }
16781
- return true;
16782
- }
16783
- const TS_NODE_TYPES = [
16784
- "TSAsExpression",
16785
- // foo as number
16786
- "TSTypeAssertion",
16787
- // (<number>foo)
16788
- "TSNonNullExpression",
16789
- // foo!
16790
- "TSInstantiationExpression",
16791
- // foo<string>
16792
- "TSSatisfiesExpression"
16793
- // foo satisfies T
16794
- ];
16795
-
16796
16968
  const isLiteralWhitelisted = /* @__PURE__ */ makeMap("true,false,null,this");
16797
16969
  const constantBailRE = /\w\s*\(|\.[^\d]/;
16798
16970
  const transformExpression = (node, context) => {
@@ -18460,7 +18632,7 @@ const transformOn$1 = (dir, node, context, augmentor) => {
18460
18632
  if (arg.isStatic) {
18461
18633
  let rawName = arg.content;
18462
18634
  if (rawName.startsWith("vnode")) {
18463
- context.onError(createCompilerError(47, arg.loc));
18635
+ context.onError(createCompilerError(51, arg.loc));
18464
18636
  }
18465
18637
  if (rawName.startsWith("vue:")) {
18466
18638
  rawName = `vnode-${rawName.slice(4)}`;
@@ -18994,12 +19166,15 @@ function baseCompile(source, options = {}) {
18994
19166
  const isModuleMode = options.mode === "module";
18995
19167
  const prefixIdentifiers = options.prefixIdentifiers === true || isModuleMode;
18996
19168
  if (!prefixIdentifiers && options.cacheHandlers) {
18997
- onError(createCompilerError(50));
19169
+ onError(createCompilerError(49));
18998
19170
  }
18999
19171
  if (options.scopeId && !isModuleMode) {
19000
- onError(createCompilerError(51));
19172
+ onError(createCompilerError(50));
19001
19173
  }
19002
- const ast = isString(source) ? baseParse(source, options) : source;
19174
+ const resolvedOptions = extend({}, options, {
19175
+ prefixIdentifiers
19176
+ });
19177
+ const ast = isString(source) ? baseParse(source, resolvedOptions) : source;
19003
19178
  const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers);
19004
19179
  if (options.isTS) {
19005
19180
  const { expressionPlugins } = options;
@@ -19009,8 +19184,7 @@ function baseCompile(source, options = {}) {
19009
19184
  }
19010
19185
  transform(
19011
19186
  ast,
19012
- extend({}, options, {
19013
- prefixIdentifiers,
19187
+ extend({}, resolvedOptions, {
19014
19188
  nodeTransforms: [
19015
19189
  ...nodeTransforms,
19016
19190
  ...options.nodeTransforms || []
@@ -19024,12 +19198,7 @@ function baseCompile(source, options = {}) {
19024
19198
  )
19025
19199
  })
19026
19200
  );
19027
- return generate(
19028
- ast,
19029
- extend({}, options, {
19030
- prefixIdentifiers
19031
- })
19032
- );
19201
+ return generate(ast, resolvedOptions);
19033
19202
  }
19034
19203
 
19035
19204
  const noopDirectiveTransform = () => ({ props: [] });
@@ -19060,7 +19229,7 @@ registerRuntimeHelpers({
19060
19229
  const parserOptions = {
19061
19230
  parseMode: "html",
19062
19231
  isVoidTag,
19063
- isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag),
19232
+ isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
19064
19233
  isPreTag: (tag) => tag === "pre",
19065
19234
  decodeEntities: void 0,
19066
19235
  isBuiltInComponent: (tag) => {