@vue/compat 3.4.0-alpha.3 → 3.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,8 +8,8 @@ const EMPTY_ARR = !!(process.env.NODE_ENV !== "production") ? Object.freeze([])
8
8
  const NOOP = () => {
9
9
  };
10
10
  const NO = () => false;
11
- const onRE = /^on[^a-z]/;
12
- const isOn = (key) => onRE.test(key);
11
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
12
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
13
13
  const isModelListener = (key) => key.startsWith("onUpdate:");
14
14
  const extend = Object.assign;
15
15
  const remove = (arr, el) => {
@@ -117,7 +117,7 @@ const slotFlagsText = {
117
117
  [3]: "FORWARDED"
118
118
  };
119
119
 
120
- const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
120
+ const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
121
121
  const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
122
122
 
123
123
  const range = 2;
@@ -190,6 +190,20 @@ function parseStringStyle(cssText) {
190
190
  });
191
191
  return ret;
192
192
  }
193
+ function stringifyStyle(styles) {
194
+ let ret = "";
195
+ if (!styles || isString(styles)) {
196
+ return ret;
197
+ }
198
+ for (const key in styles) {
199
+ const value = styles[key];
200
+ const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
201
+ if (isString(value) || typeof value === "number") {
202
+ ret += `${normalizedKey}:${value};`;
203
+ }
204
+ }
205
+ return ret;
206
+ }
193
207
  function normalizeClass(value) {
194
208
  let res = "";
195
209
  if (isString(value)) {
@@ -225,16 +239,27 @@ function normalizeProps(props) {
225
239
 
226
240
  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";
227
241
  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";
242
+ 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";
228
243
  const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
229
244
  const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
230
245
  const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
246
+ const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
231
247
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
232
248
 
233
249
  const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
234
250
  const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
251
+ const isBooleanAttr = /* @__PURE__ */ makeMap(
252
+ specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
253
+ );
235
254
  function includeBooleanAttr(value) {
236
255
  return !!value || value === "";
237
256
  }
257
+ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
258
+ `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`
259
+ );
260
+ const isKnownSvgAttr = /* @__PURE__ */ makeMap(
261
+ `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`
262
+ );
238
263
 
239
264
  function looseCompareArrays(a, b) {
240
265
  if (a.length !== b.length)
@@ -296,20 +321,29 @@ const replacer = (_key, val) => {
296
321
  return replacer(_key, val.value);
297
322
  } else if (isMap(val)) {
298
323
  return {
299
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
300
- entries[`${key} =>`] = val2;
301
- return entries;
302
- }, {})
324
+ [`Map(${val.size})`]: [...val.entries()].reduce(
325
+ (entries, [key, val2], i) => {
326
+ entries[stringifySymbol(key, i) + " =>"] = val2;
327
+ return entries;
328
+ },
329
+ {}
330
+ )
303
331
  };
304
332
  } else if (isSet(val)) {
305
333
  return {
306
- [`Set(${val.size})`]: [...val.values()]
334
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
307
335
  };
336
+ } else if (isSymbol(val)) {
337
+ return stringifySymbol(val);
308
338
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
309
339
  return String(val);
310
340
  }
311
341
  return val;
312
342
  };
343
+ const stringifySymbol = (v, i = "") => {
344
+ var _a;
345
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
346
+ };
313
347
 
314
348
  function warn$1(msg, ...args) {
315
349
  console.warn(`[Vue warn] ${msg}`, ...args);
@@ -758,8 +792,13 @@ class BaseReactiveHandler {
758
792
  return isReadonly2;
759
793
  } else if (key === "__v_isShallow") {
760
794
  return shallow;
761
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
762
- return target;
795
+ } else if (key === "__v_raw") {
796
+ if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
797
+ // this means the reciever is a user proxy of the reactive proxy
798
+ Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
799
+ return target;
800
+ }
801
+ return;
763
802
  }
764
803
  const targetIsArray = isArray(target);
765
804
  if (!isReadonly2) {
@@ -795,17 +834,19 @@ class MutableReactiveHandler extends BaseReactiveHandler {
795
834
  }
796
835
  set(target, key, value, receiver) {
797
836
  let oldValue = target[key];
798
- if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
799
- return false;
800
- }
801
837
  if (!this._shallow) {
838
+ const isOldValueReadonly = isReadonly(oldValue);
802
839
  if (!isShallow(value) && !isReadonly(value)) {
803
840
  oldValue = toRaw(oldValue);
804
841
  value = toRaw(value);
805
842
  }
806
843
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
807
- oldValue.value = value;
808
- return true;
844
+ if (isOldValueReadonly) {
845
+ return false;
846
+ } else {
847
+ oldValue.value = value;
848
+ return true;
849
+ }
809
850
  }
810
851
  }
811
852
  const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
@@ -1498,6 +1539,18 @@ function propertyToRef(source, key, defaultValue) {
1498
1539
  return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1499
1540
  }
1500
1541
 
1542
+ const TrackOpTypes = {
1543
+ "GET": "get",
1544
+ "HAS": "has",
1545
+ "ITERATE": "iterate"
1546
+ };
1547
+ const TriggerOpTypes = {
1548
+ "SET": "set",
1549
+ "ADD": "add",
1550
+ "DELETE": "delete",
1551
+ "CLEAR": "clear"
1552
+ };
1553
+
1501
1554
  const stack$1 = [];
1502
1555
  function pushWarningContext(vnode) {
1503
1556
  stack$1.push(vnode);
@@ -1616,6 +1669,38 @@ function assertNumber(val, type) {
1616
1669
  }
1617
1670
  }
1618
1671
 
1672
+ const ErrorCodes = {
1673
+ "SETUP_FUNCTION": 0,
1674
+ "0": "SETUP_FUNCTION",
1675
+ "RENDER_FUNCTION": 1,
1676
+ "1": "RENDER_FUNCTION",
1677
+ "WATCH_GETTER": 2,
1678
+ "2": "WATCH_GETTER",
1679
+ "WATCH_CALLBACK": 3,
1680
+ "3": "WATCH_CALLBACK",
1681
+ "WATCH_CLEANUP": 4,
1682
+ "4": "WATCH_CLEANUP",
1683
+ "NATIVE_EVENT_HANDLER": 5,
1684
+ "5": "NATIVE_EVENT_HANDLER",
1685
+ "COMPONENT_EVENT_HANDLER": 6,
1686
+ "6": "COMPONENT_EVENT_HANDLER",
1687
+ "VNODE_HOOK": 7,
1688
+ "7": "VNODE_HOOK",
1689
+ "DIRECTIVE_HOOK": 8,
1690
+ "8": "DIRECTIVE_HOOK",
1691
+ "TRANSITION_HOOK": 9,
1692
+ "9": "TRANSITION_HOOK",
1693
+ "APP_ERROR_HANDLER": 10,
1694
+ "10": "APP_ERROR_HANDLER",
1695
+ "APP_WARN_HANDLER": 11,
1696
+ "11": "APP_WARN_HANDLER",
1697
+ "FUNCTION_REF": 12,
1698
+ "12": "FUNCTION_REF",
1699
+ "ASYNC_COMPONENT_LOADER": 13,
1700
+ "13": "ASYNC_COMPONENT_LOADER",
1701
+ "SCHEDULER": 14,
1702
+ "14": "SCHEDULER"
1703
+ };
1619
1704
  const ErrorTypeStrings$1 = {
1620
1705
  ["sp"]: "serverPrefetch hook",
1621
1706
  ["bc"]: "beforeCreate hook",
@@ -1789,13 +1874,16 @@ function queuePostFlushCb(cb) {
1789
1874
  }
1790
1875
  queueFlush();
1791
1876
  }
1792
- function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
1877
+ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1793
1878
  if (!!(process.env.NODE_ENV !== "production")) {
1794
1879
  seen = seen || /* @__PURE__ */ new Map();
1795
1880
  }
1796
1881
  for (; i < queue.length; i++) {
1797
1882
  const cb = queue[i];
1798
1883
  if (cb && cb.pre) {
1884
+ if (instance && cb.id !== instance.uid) {
1885
+ continue;
1886
+ }
1799
1887
  if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
1800
1888
  continue;
1801
1889
  }
@@ -2100,6 +2188,50 @@ function devtoolsComponentEmit(component, event, params) {
2100
2188
  );
2101
2189
  }
2102
2190
 
2191
+ const DeprecationTypes$1 = {
2192
+ "GLOBAL_MOUNT": "GLOBAL_MOUNT",
2193
+ "GLOBAL_MOUNT_CONTAINER": "GLOBAL_MOUNT_CONTAINER",
2194
+ "GLOBAL_EXTEND": "GLOBAL_EXTEND",
2195
+ "GLOBAL_PROTOTYPE": "GLOBAL_PROTOTYPE",
2196
+ "GLOBAL_SET": "GLOBAL_SET",
2197
+ "GLOBAL_DELETE": "GLOBAL_DELETE",
2198
+ "GLOBAL_OBSERVABLE": "GLOBAL_OBSERVABLE",
2199
+ "GLOBAL_PRIVATE_UTIL": "GLOBAL_PRIVATE_UTIL",
2200
+ "CONFIG_SILENT": "CONFIG_SILENT",
2201
+ "CONFIG_DEVTOOLS": "CONFIG_DEVTOOLS",
2202
+ "CONFIG_KEY_CODES": "CONFIG_KEY_CODES",
2203
+ "CONFIG_PRODUCTION_TIP": "CONFIG_PRODUCTION_TIP",
2204
+ "CONFIG_IGNORED_ELEMENTS": "CONFIG_IGNORED_ELEMENTS",
2205
+ "CONFIG_WHITESPACE": "CONFIG_WHITESPACE",
2206
+ "CONFIG_OPTION_MERGE_STRATS": "CONFIG_OPTION_MERGE_STRATS",
2207
+ "INSTANCE_SET": "INSTANCE_SET",
2208
+ "INSTANCE_DELETE": "INSTANCE_DELETE",
2209
+ "INSTANCE_DESTROY": "INSTANCE_DESTROY",
2210
+ "INSTANCE_EVENT_EMITTER": "INSTANCE_EVENT_EMITTER",
2211
+ "INSTANCE_EVENT_HOOKS": "INSTANCE_EVENT_HOOKS",
2212
+ "INSTANCE_CHILDREN": "INSTANCE_CHILDREN",
2213
+ "INSTANCE_LISTENERS": "INSTANCE_LISTENERS",
2214
+ "INSTANCE_SCOPED_SLOTS": "INSTANCE_SCOPED_SLOTS",
2215
+ "INSTANCE_ATTRS_CLASS_STYLE": "INSTANCE_ATTRS_CLASS_STYLE",
2216
+ "OPTIONS_DATA_FN": "OPTIONS_DATA_FN",
2217
+ "OPTIONS_DATA_MERGE": "OPTIONS_DATA_MERGE",
2218
+ "OPTIONS_BEFORE_DESTROY": "OPTIONS_BEFORE_DESTROY",
2219
+ "OPTIONS_DESTROYED": "OPTIONS_DESTROYED",
2220
+ "WATCH_ARRAY": "WATCH_ARRAY",
2221
+ "PROPS_DEFAULT_THIS": "PROPS_DEFAULT_THIS",
2222
+ "V_ON_KEYCODE_MODIFIER": "V_ON_KEYCODE_MODIFIER",
2223
+ "CUSTOM_DIR": "CUSTOM_DIR",
2224
+ "ATTR_FALSE_VALUE": "ATTR_FALSE_VALUE",
2225
+ "ATTR_ENUMERATED_COERCION": "ATTR_ENUMERATED_COERCION",
2226
+ "TRANSITION_CLASSES": "TRANSITION_CLASSES",
2227
+ "TRANSITION_GROUP_ROOT": "TRANSITION_GROUP_ROOT",
2228
+ "COMPONENT_ASYNC": "COMPONENT_ASYNC",
2229
+ "COMPONENT_FUNCTIONAL": "COMPONENT_FUNCTIONAL",
2230
+ "COMPONENT_V_MODEL": "COMPONENT_V_MODEL",
2231
+ "RENDER_FUNCTION": "RENDER_FUNCTION",
2232
+ "FILTERS": "FILTERS",
2233
+ "PRIVATE_APIS": "PRIVATE_APIS"
2234
+ };
2103
2235
  const deprecationData$1 = {
2104
2236
  ["GLOBAL_MOUNT"]: {
2105
2237
  message: `The global app bootstrapping API has changed: vm.$mount() and the "el" option have been removed. Use createApp(RootComponent).mount() instead.`,
@@ -3031,9 +3163,17 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
3031
3163
  return false;
3032
3164
  }
3033
3165
  function updateHOCHostEl({ vnode, parent }, el) {
3034
- while (parent && parent.subTree === vnode) {
3035
- (vnode = parent.vnode).el = el;
3036
- parent = parent.parent;
3166
+ while (parent) {
3167
+ const root = parent.subTree;
3168
+ if (root.suspense && root.suspense.activeBranch === vnode) {
3169
+ root.el = vnode.el;
3170
+ }
3171
+ if (root === vnode) {
3172
+ (vnode = parent.vnode).el = el;
3173
+ parent = parent.parent;
3174
+ } else {
3175
+ break;
3176
+ }
3037
3177
  }
3038
3178
  }
3039
3179
 
@@ -3097,6 +3237,7 @@ function resolve(registry, name) {
3097
3237
  }
3098
3238
 
3099
3239
  const isSuspense = (type) => type.__isSuspense;
3240
+ let suspenseId = 0;
3100
3241
  const SuspenseImpl = {
3101
3242
  name: "Suspense",
3102
3243
  // In order to make Suspense tree-shakable, we need to avoid importing it
@@ -3104,7 +3245,7 @@ const SuspenseImpl = {
3104
3245
  // on a vnode's type and calls the `process` method, passing in renderer
3105
3246
  // internals.
3106
3247
  __isSuspense: true,
3107
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
3248
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
3108
3249
  if (n1 == null) {
3109
3250
  mountSuspense(
3110
3251
  n2,
@@ -3112,7 +3253,7 @@ const SuspenseImpl = {
3112
3253
  anchor,
3113
3254
  parentComponent,
3114
3255
  parentSuspense,
3115
- isSVG,
3256
+ namespace,
3116
3257
  slotScopeIds,
3117
3258
  optimized,
3118
3259
  rendererInternals
@@ -3124,7 +3265,7 @@ const SuspenseImpl = {
3124
3265
  container,
3125
3266
  anchor,
3126
3267
  parentComponent,
3127
- isSVG,
3268
+ namespace,
3128
3269
  slotScopeIds,
3129
3270
  optimized,
3130
3271
  rendererInternals
@@ -3142,7 +3283,7 @@ function triggerEvent(vnode, name) {
3142
3283
  eventListener();
3143
3284
  }
3144
3285
  }
3145
- function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {
3286
+ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
3146
3287
  const {
3147
3288
  p: patch,
3148
3289
  o: { createElement }
@@ -3155,7 +3296,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3155
3296
  container,
3156
3297
  hiddenContainer,
3157
3298
  anchor,
3158
- isSVG,
3299
+ namespace,
3159
3300
  slotScopeIds,
3160
3301
  optimized,
3161
3302
  rendererInternals
@@ -3167,7 +3308,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3167
3308
  null,
3168
3309
  parentComponent,
3169
3310
  suspense,
3170
- isSVG,
3311
+ namespace,
3171
3312
  slotScopeIds
3172
3313
  );
3173
3314
  if (suspense.deps > 0) {
@@ -3181,7 +3322,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3181
3322
  parentComponent,
3182
3323
  null,
3183
3324
  // fallback tree will not have suspense context
3184
- isSVG,
3325
+ namespace,
3185
3326
  slotScopeIds
3186
3327
  );
3187
3328
  setActiveBranch(suspense, vnode.ssFallback);
@@ -3189,7 +3330,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
3189
3330
  suspense.resolve(false, true);
3190
3331
  }
3191
3332
  }
3192
- function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
3333
+ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
3193
3334
  const suspense = n2.suspense = n1.suspense;
3194
3335
  suspense.vnode = n2;
3195
3336
  n2.el = n1.el;
@@ -3206,29 +3347,31 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3206
3347
  null,
3207
3348
  parentComponent,
3208
3349
  suspense,
3209
- isSVG,
3350
+ namespace,
3210
3351
  slotScopeIds,
3211
3352
  optimized
3212
3353
  );
3213
3354
  if (suspense.deps <= 0) {
3214
3355
  suspense.resolve();
3215
3356
  } else if (isInFallback) {
3216
- patch(
3217
- activeBranch,
3218
- newFallback,
3219
- container,
3220
- anchor,
3221
- parentComponent,
3222
- null,
3223
- // fallback tree will not have suspense context
3224
- isSVG,
3225
- slotScopeIds,
3226
- optimized
3227
- );
3228
- setActiveBranch(suspense, newFallback);
3357
+ if (!isHydrating) {
3358
+ patch(
3359
+ activeBranch,
3360
+ newFallback,
3361
+ container,
3362
+ anchor,
3363
+ parentComponent,
3364
+ null,
3365
+ // fallback tree will not have suspense context
3366
+ namespace,
3367
+ slotScopeIds,
3368
+ optimized
3369
+ );
3370
+ setActiveBranch(suspense, newFallback);
3371
+ }
3229
3372
  }
3230
3373
  } else {
3231
- suspense.pendingId++;
3374
+ suspense.pendingId = suspenseId++;
3232
3375
  if (isHydrating) {
3233
3376
  suspense.isHydrating = false;
3234
3377
  suspense.activeBranch = pendingBranch;
@@ -3246,7 +3389,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3246
3389
  null,
3247
3390
  parentComponent,
3248
3391
  suspense,
3249
- isSVG,
3392
+ namespace,
3250
3393
  slotScopeIds,
3251
3394
  optimized
3252
3395
  );
@@ -3261,7 +3404,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3261
3404
  parentComponent,
3262
3405
  null,
3263
3406
  // fallback tree will not have suspense context
3264
- isSVG,
3407
+ namespace,
3265
3408
  slotScopeIds,
3266
3409
  optimized
3267
3410
  );
@@ -3275,7 +3418,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3275
3418
  anchor,
3276
3419
  parentComponent,
3277
3420
  suspense,
3278
- isSVG,
3421
+ namespace,
3279
3422
  slotScopeIds,
3280
3423
  optimized
3281
3424
  );
@@ -3288,7 +3431,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3288
3431
  null,
3289
3432
  parentComponent,
3290
3433
  suspense,
3291
- isSVG,
3434
+ namespace,
3292
3435
  slotScopeIds,
3293
3436
  optimized
3294
3437
  );
@@ -3306,7 +3449,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3306
3449
  anchor,
3307
3450
  parentComponent,
3308
3451
  suspense,
3309
- isSVG,
3452
+ namespace,
3310
3453
  slotScopeIds,
3311
3454
  optimized
3312
3455
  );
@@ -3314,7 +3457,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3314
3457
  } else {
3315
3458
  triggerEvent(n2, "onPending");
3316
3459
  suspense.pendingBranch = newBranch;
3317
- suspense.pendingId++;
3460
+ if (newBranch.shapeFlag & 512) {
3461
+ suspense.pendingId = newBranch.component.suspenseId;
3462
+ } else {
3463
+ suspense.pendingId = suspenseId++;
3464
+ }
3318
3465
  patch(
3319
3466
  null,
3320
3467
  newBranch,
@@ -3322,7 +3469,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3322
3469
  null,
3323
3470
  parentComponent,
3324
3471
  suspense,
3325
- isSVG,
3472
+ namespace,
3326
3473
  slotScopeIds,
3327
3474
  optimized
3328
3475
  );
@@ -3344,7 +3491,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
3344
3491
  }
3345
3492
  }
3346
3493
  let hasWarned = false;
3347
- function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3494
+ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
3348
3495
  if (!!(process.env.NODE_ENV !== "production") && true && !hasWarned) {
3349
3496
  hasWarned = true;
3350
3497
  console[console.info ? "info" : "log"](
@@ -3374,7 +3521,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3374
3521
  vnode,
3375
3522
  parent: parentSuspense,
3376
3523
  parentComponent,
3377
- isSVG,
3524
+ namespace,
3378
3525
  container,
3379
3526
  hiddenContainer,
3380
3527
  anchor,
@@ -3383,7 +3530,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3383
3530
  timeout: typeof timeout === "number" ? timeout : -1,
3384
3531
  activeBranch: null,
3385
3532
  pendingBranch: null,
3386
- isInFallback: true,
3533
+ isInFallback: !isHydrating,
3387
3534
  isHydrating,
3388
3535
  isUnmounted: false,
3389
3536
  effects: [],
@@ -3417,7 +3564,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3417
3564
  if (delayEnter) {
3418
3565
  activeBranch.transition.afterLeave = () => {
3419
3566
  if (pendingId === suspense.pendingId) {
3420
- move(pendingBranch, container2, anchor2, 0);
3567
+ move(
3568
+ pendingBranch,
3569
+ container2,
3570
+ next(activeBranch),
3571
+ 0
3572
+ );
3421
3573
  queuePostFlushCb(effects);
3422
3574
  }
3423
3575
  };
@@ -3462,7 +3614,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3462
3614
  if (!suspense.pendingBranch) {
3463
3615
  return;
3464
3616
  }
3465
- const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
3617
+ const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
3466
3618
  triggerEvent(vnode2, "onFallback");
3467
3619
  const anchor2 = next(activeBranch);
3468
3620
  const mountFallback = () => {
@@ -3477,7 +3629,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3477
3629
  parentComponent2,
3478
3630
  null,
3479
3631
  // fallback tree will not have suspense context
3480
- isSVG2,
3632
+ namespace2,
3481
3633
  slotScopeIds,
3482
3634
  optimized
3483
3635
  );
@@ -3540,7 +3692,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3540
3692
  // consider the comment placeholder case.
3541
3693
  hydratedEl ? null : next(instance.subTree),
3542
3694
  suspense,
3543
- isSVG,
3695
+ namespace,
3544
3696
  optimized
3545
3697
  );
3546
3698
  if (placeholder) {
@@ -3577,7 +3729,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3577
3729
  };
3578
3730
  return suspense;
3579
3731
  }
3580
- function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3732
+ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3581
3733
  const suspense = vnode.suspense = createSuspenseBoundary(
3582
3734
  vnode,
3583
3735
  parentSuspense,
@@ -3585,7 +3737,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
3585
3737
  node.parentNode,
3586
3738
  document.createElement("div"),
3587
3739
  null,
3588
- isSVG,
3740
+ namespace,
3589
3741
  slotScopeIds,
3590
3742
  optimized,
3591
3743
  rendererInternals,
@@ -4556,7 +4708,7 @@ const KeepAliveImpl = {
4556
4708
  }
4557
4709
  } = sharedContext;
4558
4710
  const storageContainer = createElement("div");
4559
- sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
4711
+ sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4560
4712
  const instance2 = vnode.component;
4561
4713
  move(vnode, container, anchor, 0, parentSuspense);
4562
4714
  patch(
@@ -4566,7 +4718,7 @@ const KeepAliveImpl = {
4566
4718
  anchor,
4567
4719
  instance2,
4568
4720
  parentSuspense,
4569
- isSVG,
4721
+ namespace,
4570
4722
  vnode.slotScopeIds,
4571
4723
  optimized
4572
4724
  );
@@ -5754,7 +5906,7 @@ function useSlots() {
5754
5906
  function useAttrs() {
5755
5907
  return getContext().attrs;
5756
5908
  }
5757
- function useModel(props, name, options) {
5909
+ function useModel(props, name) {
5758
5910
  const i = getCurrentInstance();
5759
5911
  if (!!(process.env.NODE_ENV !== "production") && !i) {
5760
5912
  warn(`useModel() called without active instance.`);
@@ -5764,29 +5916,24 @@ function useModel(props, name, options) {
5764
5916
  warn(`useModel() called with prop "${name}" which is not declared.`);
5765
5917
  return ref();
5766
5918
  }
5767
- if (options && options.local) {
5768
- const proxy = ref(props[name]);
5769
- watch(
5770
- () => props[name],
5771
- (v) => proxy.value = v
5772
- );
5773
- watch(proxy, (value) => {
5774
- if (value !== props[name]) {
5775
- i.emit(`update:${name}`, value);
5776
- }
5777
- });
5778
- return proxy;
5779
- } else {
5780
- return {
5781
- __v_isRef: true,
5782
- get value() {
5783
- return props[name];
5784
- },
5785
- set value(value) {
5786
- i.emit(`update:${name}`, value);
5919
+ let localValue;
5920
+ watchSyncEffect(() => {
5921
+ localValue = props[name];
5922
+ });
5923
+ return customRef((track, trigger) => ({
5924
+ get() {
5925
+ track();
5926
+ return localValue;
5927
+ },
5928
+ set(value) {
5929
+ const rawProps = i.vnode.props;
5930
+ if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
5931
+ localValue = value;
5932
+ trigger();
5787
5933
  }
5788
- };
5789
- }
5934
+ i.emit(`update:${name}`, value);
5935
+ }
5936
+ }));
5790
5937
  }
5791
5938
  function getContext() {
5792
5939
  const i = getCurrentInstance();
@@ -6362,7 +6509,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6362
6509
  return vm;
6363
6510
  }
6364
6511
  }
6365
- Vue.version = `2.6.14-compat:${"3.4.0-alpha.3"}`;
6512
+ Vue.version = `2.6.14-compat:${"3.4.0-beta.1"}`;
6366
6513
  Vue.config = singletonApp.config;
6367
6514
  Vue.use = (p, ...options) => {
6368
6515
  if (p && isFunction(p.install)) {
@@ -6608,12 +6755,16 @@ function installCompatMount(app, context, render) {
6608
6755
  } else {
6609
6756
  container = selectorOrEl || document.createElement("div");
6610
6757
  }
6611
- const isSVG = container instanceof SVGElement;
6758
+ let namespace;
6759
+ if (container instanceof SVGElement)
6760
+ namespace = "svg";
6761
+ else if (typeof MathMLElement === "function" && container instanceof MathMLElement)
6762
+ namespace = "mathml";
6612
6763
  if (!!(process.env.NODE_ENV !== "production")) {
6613
6764
  context.reload = () => {
6614
6765
  const cloned = cloneVNode(vnode);
6615
6766
  cloned.component = null;
6616
- render(cloned, container, isSVG);
6767
+ render(cloned, container, namespace);
6617
6768
  };
6618
6769
  }
6619
6770
  if (hasNoRender && instance.render === emptyRender) {
@@ -6636,7 +6787,7 @@ function installCompatMount(app, context, render) {
6636
6787
  );
6637
6788
  }
6638
6789
  container.innerHTML = "";
6639
- render(vnode, container, isSVG);
6790
+ render(vnode, container, namespace);
6640
6791
  if (container instanceof Element) {
6641
6792
  container.removeAttribute("v-cloak");
6642
6793
  container.setAttribute("data-v-app", "");
@@ -6764,18 +6915,6 @@ function createAppAPI(render, hydrate) {
6764
6915
  rootProps = null;
6765
6916
  }
6766
6917
  const context = createAppContext();
6767
- if (!!(process.env.NODE_ENV !== "production")) {
6768
- Object.defineProperty(context.config, "unwrapInjectedRef", {
6769
- get() {
6770
- return true;
6771
- },
6772
- set() {
6773
- warn(
6774
- `app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
6775
- );
6776
- }
6777
- });
6778
- }
6779
6918
  const installedPlugins = /* @__PURE__ */ new WeakSet();
6780
6919
  let isMounted = false;
6781
6920
  const app = context.app = {
@@ -6852,7 +6991,7 @@ function createAppAPI(render, hydrate) {
6852
6991
  context.directives[name] = directive;
6853
6992
  return app;
6854
6993
  },
6855
- mount(rootContainer, isHydrate, isSVG) {
6994
+ mount(rootContainer, isHydrate, namespace) {
6856
6995
  if (!isMounted) {
6857
6996
  if (!!(process.env.NODE_ENV !== "production") && rootContainer.__vue_app__) {
6858
6997
  warn(
@@ -6862,15 +7001,24 @@ function createAppAPI(render, hydrate) {
6862
7001
  }
6863
7002
  const vnode = createVNode(rootComponent, rootProps);
6864
7003
  vnode.appContext = context;
7004
+ if (namespace === true) {
7005
+ namespace = "svg";
7006
+ } else if (namespace === false) {
7007
+ namespace = void 0;
7008
+ }
6865
7009
  if (!!(process.env.NODE_ENV !== "production")) {
6866
7010
  context.reload = () => {
6867
- render(cloneVNode(vnode), rootContainer, isSVG);
7011
+ render(
7012
+ cloneVNode(vnode),
7013
+ rootContainer,
7014
+ namespace
7015
+ );
6868
7016
  };
6869
7017
  }
6870
7018
  if (isHydrate && hydrate) {
6871
7019
  hydrate(vnode, rootContainer);
6872
7020
  } else {
6873
- render(vnode, rootContainer, isSVG);
7021
+ render(vnode, rootContainer, namespace);
6874
7022
  }
6875
7023
  isMounted = true;
6876
7024
  app._container = rootContainer;
@@ -7335,11 +7483,12 @@ function validateProps(rawProps, props, instance) {
7335
7483
  key,
7336
7484
  resolvedValues[key],
7337
7485
  opt,
7486
+ !!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues,
7338
7487
  !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
7339
7488
  );
7340
7489
  }
7341
7490
  }
7342
- function validateProp(name, value, prop, isAbsent) {
7491
+ function validateProp(name, value, prop, props, isAbsent) {
7343
7492
  const { type, required, validator, skipCheck } = prop;
7344
7493
  if (required && isAbsent) {
7345
7494
  warn('Missing required prop: "' + name + '"');
@@ -7362,7 +7511,7 @@ function validateProp(name, value, prop, isAbsent) {
7362
7511
  return;
7363
7512
  }
7364
7513
  }
7365
- if (validator && !validator(value)) {
7514
+ if (validator && !validator(value, props)) {
7366
7515
  warn('Invalid prop: custom validator check failed for prop "' + name + '".');
7367
7516
  }
7368
7517
  }
@@ -7620,7 +7769,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7620
7769
  }
7621
7770
 
7622
7771
  let hasMismatch = false;
7623
- const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject";
7772
+ const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
7773
+ const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
7774
+ const getContainerType = (container) => {
7775
+ if (isSVGContainer(container))
7776
+ return "svg";
7777
+ if (isMathMLContainer(container))
7778
+ return "mathml";
7779
+ return void 0;
7780
+ };
7624
7781
  const isComment = (node) => node.nodeType === 8 /* COMMENT */;
7625
7782
  function createHydrationFunctions(rendererInternals) {
7626
7783
  const {
@@ -7638,7 +7795,7 @@ function createHydrationFunctions(rendererInternals) {
7638
7795
  } = rendererInternals;
7639
7796
  const hydrate = (vnode, container) => {
7640
7797
  if (!container.hasChildNodes()) {
7641
- !!(process.env.NODE_ENV !== "production") && warn(
7798
+ (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(
7642
7799
  `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
7643
7800
  );
7644
7801
  patch(null, vnode, container);
@@ -7698,12 +7855,14 @@ function createHydrationFunctions(rendererInternals) {
7698
7855
  } else {
7699
7856
  if (node.data !== vnode.children) {
7700
7857
  hasMismatch = true;
7701
- !!(process.env.NODE_ENV !== "production") && warn(
7702
- `Hydration text mismatch:
7703
- - Server rendered: ${JSON.stringify(
7858
+ (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(
7859
+ `Hydration text mismatch in`,
7860
+ node.parentNode,
7861
+ `
7862
+ - rendered on server: ${JSON.stringify(
7704
7863
  node.data
7705
7864
  )}
7706
- - Client rendered: ${JSON.stringify(vnode.children)}`
7865
+ - expected on client: ${JSON.stringify(vnode.children)}`
7707
7866
  );
7708
7867
  node.data = vnode.children;
7709
7868
  }
@@ -7789,7 +7948,7 @@ function createHydrationFunctions(rendererInternals) {
7789
7948
  null,
7790
7949
  parentComponent,
7791
7950
  parentSuspense,
7792
- isSVGContainer(container),
7951
+ getContainerType(container),
7793
7952
  optimized
7794
7953
  );
7795
7954
  if (isAsyncWrapper(vnode)) {
@@ -7824,13 +7983,13 @@ function createHydrationFunctions(rendererInternals) {
7824
7983
  vnode,
7825
7984
  parentComponent,
7826
7985
  parentSuspense,
7827
- isSVGContainer(parentNode(node)),
7986
+ getContainerType(parentNode(node)),
7828
7987
  slotScopeIds,
7829
7988
  optimized,
7830
7989
  rendererInternals,
7831
7990
  hydrateNode
7832
7991
  );
7833
- } else if (!!(process.env.NODE_ENV !== "production")) {
7992
+ } else if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) {
7834
7993
  warn("Invalid HostVNode type:", type, `(${typeof type})`);
7835
7994
  }
7836
7995
  }
@@ -7847,38 +8006,6 @@ function createHydrationFunctions(rendererInternals) {
7847
8006
  if (dirs) {
7848
8007
  invokeDirectiveHook(vnode, null, parentComponent, "created");
7849
8008
  }
7850
- if (props) {
7851
- if (forcePatch || !optimized || patchFlag & (16 | 32)) {
7852
- for (const key in props) {
7853
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
7854
- key[0] === ".") {
7855
- patchProp(
7856
- el,
7857
- key,
7858
- null,
7859
- props[key],
7860
- false,
7861
- void 0,
7862
- parentComponent
7863
- );
7864
- }
7865
- }
7866
- } else if (props.onClick) {
7867
- patchProp(
7868
- el,
7869
- "onClick",
7870
- null,
7871
- props.onClick,
7872
- false,
7873
- void 0,
7874
- parentComponent
7875
- );
7876
- }
7877
- }
7878
- let vnodeHooks;
7879
- if (vnodeHooks = props && props.onVnodeBeforeMount) {
7880
- invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7881
- }
7882
8009
  let needCallTransitionHooks = false;
7883
8010
  if (isTemplateNode(el)) {
7884
8011
  needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
@@ -7889,16 +8016,6 @@ function createHydrationFunctions(rendererInternals) {
7889
8016
  replaceNode(content, el, parentComponent);
7890
8017
  vnode.el = el = content;
7891
8018
  }
7892
- if (dirs) {
7893
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7894
- }
7895
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
7896
- queueEffectWithSuspense(() => {
7897
- vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7898
- needCallTransitionHooks && transition.enter(el);
7899
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7900
- }, parentSuspense);
7901
- }
7902
8019
  if (shapeFlag & 16 && // skip if element has innerHTML / textContent
7903
8020
  !(props && (props.innerHTML || props.textContent))) {
7904
8021
  let next = hydrateChildren(
@@ -7913,9 +8030,12 @@ function createHydrationFunctions(rendererInternals) {
7913
8030
  let hasWarned = false;
7914
8031
  while (next) {
7915
8032
  hasMismatch = true;
7916
- if (!!(process.env.NODE_ENV !== "production") && !hasWarned) {
8033
+ if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
7917
8034
  warn(
7918
- `Hydration children mismatch in <${vnode.type}>: server rendered element contains more child nodes than client vdom.`
8035
+ `Hydration children mismatch on`,
8036
+ el,
8037
+ `
8038
+ Server rendered element contains more child nodes than client vdom.`
7919
8039
  );
7920
8040
  hasWarned = true;
7921
8041
  }
@@ -7926,14 +8046,61 @@ function createHydrationFunctions(rendererInternals) {
7926
8046
  } else if (shapeFlag & 8) {
7927
8047
  if (el.textContent !== vnode.children) {
7928
8048
  hasMismatch = true;
7929
- !!(process.env.NODE_ENV !== "production") && warn(
7930
- `Hydration text content mismatch in <${vnode.type}>:
7931
- - Server rendered: ${el.textContent}
7932
- - Client rendered: ${vnode.children}`
8049
+ (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(
8050
+ `Hydration text content mismatch on`,
8051
+ el,
8052
+ `
8053
+ - rendered on server: ${el.textContent}
8054
+ - expected on client: ${vnode.children}`
7933
8055
  );
7934
8056
  el.textContent = vnode.children;
7935
8057
  }
7936
8058
  }
8059
+ if (props) {
8060
+ if (!!(process.env.NODE_ENV !== "production") || forcePatch || !optimized || patchFlag & (16 | 32)) {
8061
+ for (const key in props) {
8062
+ if (!!(process.env.NODE_ENV !== "production") && propHasMismatch(el, key, props[key])) {
8063
+ hasMismatch = true;
8064
+ }
8065
+ if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
8066
+ key[0] === ".") {
8067
+ patchProp(
8068
+ el,
8069
+ key,
8070
+ null,
8071
+ props[key],
8072
+ void 0,
8073
+ void 0,
8074
+ parentComponent
8075
+ );
8076
+ }
8077
+ }
8078
+ } else if (props.onClick) {
8079
+ patchProp(
8080
+ el,
8081
+ "onClick",
8082
+ null,
8083
+ props.onClick,
8084
+ void 0,
8085
+ void 0,
8086
+ parentComponent
8087
+ );
8088
+ }
8089
+ }
8090
+ let vnodeHooks;
8091
+ if (vnodeHooks = props && props.onVnodeBeforeMount) {
8092
+ invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8093
+ }
8094
+ if (dirs) {
8095
+ invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8096
+ }
8097
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
8098
+ queueEffectWithSuspense(() => {
8099
+ vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
8100
+ needCallTransitionHooks && transition.enter(el);
8101
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
8102
+ }, parentSuspense);
8103
+ }
7937
8104
  }
7938
8105
  return el.nextSibling;
7939
8106
  };
@@ -7957,9 +8124,12 @@ function createHydrationFunctions(rendererInternals) {
7957
8124
  continue;
7958
8125
  } else {
7959
8126
  hasMismatch = true;
7960
- if (!!(process.env.NODE_ENV !== "production") && !hasWarned) {
8127
+ if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
7961
8128
  warn(
7962
- `Hydration children mismatch in <${container.tagName.toLowerCase()}>: server rendered element contains fewer child nodes than client vdom.`
8129
+ `Hydration children mismatch on`,
8130
+ container,
8131
+ `
8132
+ Server rendered element contains fewer child nodes than client vdom.`
7963
8133
  );
7964
8134
  hasWarned = true;
7965
8135
  }
@@ -7970,7 +8140,7 @@ function createHydrationFunctions(rendererInternals) {
7970
8140
  null,
7971
8141
  parentComponent,
7972
8142
  parentSuspense,
7973
- isSVGContainer(container),
8143
+ getContainerType(container),
7974
8144
  slotScopeIds
7975
8145
  );
7976
8146
  }
@@ -8002,14 +8172,14 @@ function createHydrationFunctions(rendererInternals) {
8002
8172
  };
8003
8173
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
8004
8174
  hasMismatch = true;
8005
- !!(process.env.NODE_ENV !== "production") && warn(
8175
+ (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn(
8006
8176
  `Hydration node mismatch:
8007
- - Client vnode:`,
8008
- vnode.type,
8009
- `
8010
- - Server rendered DOM:`,
8177
+ - rendered on server:`,
8011
8178
  node,
8012
- node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``
8179
+ node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
8180
+ `
8181
+ - expected on client:`,
8182
+ vnode.type
8013
8183
  );
8014
8184
  vnode.el = null;
8015
8185
  if (isFragment) {
@@ -8033,7 +8203,7 @@ function createHydrationFunctions(rendererInternals) {
8033
8203
  next,
8034
8204
  parentComponent,
8035
8205
  parentSuspense,
8036
- isSVGContainer(container),
8206
+ getContainerType(container),
8037
8207
  slotScopeIds
8038
8208
  );
8039
8209
  return next;
@@ -8074,6 +8244,46 @@ function createHydrationFunctions(rendererInternals) {
8074
8244
  };
8075
8245
  return [hydrate, hydrateNode];
8076
8246
  }
8247
+ function propHasMismatch(el, key, clientValue) {
8248
+ let mismatchType;
8249
+ let mismatchKey;
8250
+ let actual;
8251
+ let expected;
8252
+ if (key === "class") {
8253
+ actual = el.className;
8254
+ expected = normalizeClass(clientValue);
8255
+ if (actual !== expected) {
8256
+ mismatchType = mismatchKey = `class`;
8257
+ }
8258
+ } else if (key === "style") {
8259
+ actual = el.getAttribute("style");
8260
+ expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
8261
+ if (actual !== expected) {
8262
+ mismatchType = mismatchKey = "style";
8263
+ }
8264
+ } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
8265
+ actual = el.hasAttribute(key) && el.getAttribute(key);
8266
+ expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? false : String(clientValue);
8267
+ if (actual !== expected) {
8268
+ mismatchType = `attribute`;
8269
+ mismatchKey = key;
8270
+ }
8271
+ }
8272
+ if (mismatchType) {
8273
+ const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
8274
+ warn(
8275
+ `Hydration ${mismatchType} mismatch on`,
8276
+ el,
8277
+ `
8278
+ - rendered on server: ${format(actual)}
8279
+ - expected on client: ${format(expected)}
8280
+ Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
8281
+ You should fix the source of the mismatch.`
8282
+ );
8283
+ return true;
8284
+ }
8285
+ return false;
8286
+ }
8077
8287
 
8078
8288
  let supported;
8079
8289
  let perf;
@@ -8125,6 +8335,10 @@ function initFeatureFlags() {
8125
8335
  !!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_PROD_DEVTOOLS__`);
8126
8336
  getGlobalThis().__VUE_PROD_DEVTOOLS__ = false;
8127
8337
  }
8338
+ if (typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ !== "boolean") {
8339
+ !!(process.env.NODE_ENV !== "production") && needWarn.push(`__VUE_PROD_HYDRATION_MISMATCH_DETAILS__`);
8340
+ getGlobalThis().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
8341
+ }
8128
8342
  if (!!(process.env.NODE_ENV !== "production") && needWarn.length) {
8129
8343
  const multi = needWarn.length > 1;
8130
8344
  console.warn(
@@ -8165,7 +8379,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8165
8379
  setScopeId: hostSetScopeId = NOOP,
8166
8380
  insertStaticContent: hostInsertStaticContent
8167
8381
  } = options;
8168
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = !!(process.env.NODE_ENV !== "production") && isHmrUpdating ? false : !!n2.dynamicChildren) => {
8382
+ const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!(process.env.NODE_ENV !== "production") && isHmrUpdating ? false : !!n2.dynamicChildren) => {
8169
8383
  if (n1 === n2) {
8170
8384
  return;
8171
8385
  }
@@ -8188,9 +8402,9 @@ function baseCreateRenderer(options, createHydrationFns) {
8188
8402
  break;
8189
8403
  case Static:
8190
8404
  if (n1 == null) {
8191
- mountStaticNode(n2, container, anchor, isSVG);
8405
+ mountStaticNode(n2, container, anchor, namespace);
8192
8406
  } else if (!!(process.env.NODE_ENV !== "production")) {
8193
- patchStaticNode(n1, n2, container, isSVG);
8407
+ patchStaticNode(n1, n2, container, namespace);
8194
8408
  }
8195
8409
  break;
8196
8410
  case Fragment:
@@ -8201,7 +8415,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8201
8415
  anchor,
8202
8416
  parentComponent,
8203
8417
  parentSuspense,
8204
- isSVG,
8418
+ namespace,
8205
8419
  slotScopeIds,
8206
8420
  optimized
8207
8421
  );
@@ -8215,7 +8429,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8215
8429
  anchor,
8216
8430
  parentComponent,
8217
8431
  parentSuspense,
8218
- isSVG,
8432
+ namespace,
8219
8433
  slotScopeIds,
8220
8434
  optimized
8221
8435
  );
@@ -8227,7 +8441,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8227
8441
  anchor,
8228
8442
  parentComponent,
8229
8443
  parentSuspense,
8230
- isSVG,
8444
+ namespace,
8231
8445
  slotScopeIds,
8232
8446
  optimized
8233
8447
  );
@@ -8239,7 +8453,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8239
8453
  anchor,
8240
8454
  parentComponent,
8241
8455
  parentSuspense,
8242
- isSVG,
8456
+ namespace,
8243
8457
  slotScopeIds,
8244
8458
  optimized,
8245
8459
  internals
@@ -8252,7 +8466,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8252
8466
  anchor,
8253
8467
  parentComponent,
8254
8468
  parentSuspense,
8255
- isSVG,
8469
+ namespace,
8256
8470
  slotScopeIds,
8257
8471
  optimized,
8258
8472
  internals
@@ -8290,17 +8504,17 @@ function baseCreateRenderer(options, createHydrationFns) {
8290
8504
  n2.el = n1.el;
8291
8505
  }
8292
8506
  };
8293
- const mountStaticNode = (n2, container, anchor, isSVG) => {
8507
+ const mountStaticNode = (n2, container, anchor, namespace) => {
8294
8508
  [n2.el, n2.anchor] = hostInsertStaticContent(
8295
8509
  n2.children,
8296
8510
  container,
8297
8511
  anchor,
8298
- isSVG,
8512
+ namespace,
8299
8513
  n2.el,
8300
8514
  n2.anchor
8301
8515
  );
8302
8516
  };
8303
- const patchStaticNode = (n1, n2, container, isSVG) => {
8517
+ const patchStaticNode = (n1, n2, container, namespace) => {
8304
8518
  if (n2.children !== n1.children) {
8305
8519
  const anchor = hostNextSibling(n1.anchor);
8306
8520
  removeStaticNode(n1);
@@ -8308,7 +8522,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8308
8522
  n2.children,
8309
8523
  container,
8310
8524
  anchor,
8311
- isSVG
8525
+ namespace
8312
8526
  );
8313
8527
  } else {
8314
8528
  n2.el = n1.el;
@@ -8333,8 +8547,12 @@ function baseCreateRenderer(options, createHydrationFns) {
8333
8547
  }
8334
8548
  hostRemove(anchor);
8335
8549
  };
8336
- const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8337
- isSVG = isSVG || n2.type === "svg";
8550
+ const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8551
+ if (n2.type === "svg") {
8552
+ namespace = "svg";
8553
+ } else if (n2.type === "math") {
8554
+ namespace = "mathml";
8555
+ }
8338
8556
  if (n1 == null) {
8339
8557
  mountElement(
8340
8558
  n2,
@@ -8342,7 +8560,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8342
8560
  anchor,
8343
8561
  parentComponent,
8344
8562
  parentSuspense,
8345
- isSVG,
8563
+ namespace,
8346
8564
  slotScopeIds,
8347
8565
  optimized
8348
8566
  );
@@ -8352,19 +8570,19 @@ function baseCreateRenderer(options, createHydrationFns) {
8352
8570
  n2,
8353
8571
  parentComponent,
8354
8572
  parentSuspense,
8355
- isSVG,
8573
+ namespace,
8356
8574
  slotScopeIds,
8357
8575
  optimized
8358
8576
  );
8359
8577
  }
8360
8578
  };
8361
- const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8579
+ const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8362
8580
  let el;
8363
8581
  let vnodeHook;
8364
- const { type, props, shapeFlag, transition, dirs } = vnode;
8582
+ const { props, shapeFlag, transition, dirs } = vnode;
8365
8583
  el = vnode.el = hostCreateElement(
8366
8584
  vnode.type,
8367
- isSVG,
8585
+ namespace,
8368
8586
  props && props.is,
8369
8587
  props
8370
8588
  );
@@ -8377,7 +8595,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8377
8595
  null,
8378
8596
  parentComponent,
8379
8597
  parentSuspense,
8380
- isSVG && type !== "foreignObject",
8598
+ resolveChildrenNamespace(vnode, namespace),
8381
8599
  slotScopeIds,
8382
8600
  optimized
8383
8601
  );
@@ -8394,7 +8612,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8394
8612
  key,
8395
8613
  null,
8396
8614
  props[key],
8397
- isSVG,
8615
+ namespace,
8398
8616
  vnode.children,
8399
8617
  parentComponent,
8400
8618
  parentSuspense,
@@ -8403,7 +8621,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8403
8621
  }
8404
8622
  }
8405
8623
  if ("value" in props) {
8406
- hostPatchProp(el, "value", null, props.value);
8624
+ hostPatchProp(el, "value", null, props.value, namespace);
8407
8625
  }
8408
8626
  if (vnodeHook = props.onVnodeBeforeMount) {
8409
8627
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
@@ -8461,7 +8679,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8461
8679
  }
8462
8680
  }
8463
8681
  };
8464
- const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {
8682
+ const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
8465
8683
  for (let i = start; i < children.length; i++) {
8466
8684
  const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
8467
8685
  patch(
@@ -8471,13 +8689,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8471
8689
  anchor,
8472
8690
  parentComponent,
8473
8691
  parentSuspense,
8474
- isSVG,
8692
+ namespace,
8475
8693
  slotScopeIds,
8476
8694
  optimized
8477
8695
  );
8478
8696
  }
8479
8697
  };
8480
- const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8698
+ const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8481
8699
  const el = n2.el = n1.el;
8482
8700
  let { patchFlag, dynamicChildren, dirs } = n2;
8483
8701
  patchFlag |= n1.patchFlag & 16;
@@ -8497,7 +8715,6 @@ function baseCreateRenderer(options, createHydrationFns) {
8497
8715
  optimized = false;
8498
8716
  dynamicChildren = null;
8499
8717
  }
8500
- const areChildrenSVG = isSVG && n2.type !== "foreignObject";
8501
8718
  if (dynamicChildren) {
8502
8719
  patchBlockChildren(
8503
8720
  n1.dynamicChildren,
@@ -8505,7 +8722,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8505
8722
  el,
8506
8723
  parentComponent,
8507
8724
  parentSuspense,
8508
- areChildrenSVG,
8725
+ resolveChildrenNamespace(n2, namespace),
8509
8726
  slotScopeIds
8510
8727
  );
8511
8728
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -8519,7 +8736,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8519
8736
  null,
8520
8737
  parentComponent,
8521
8738
  parentSuspense,
8522
- areChildrenSVG,
8739
+ resolveChildrenNamespace(n2, namespace),
8523
8740
  slotScopeIds,
8524
8741
  false
8525
8742
  );
@@ -8533,16 +8750,16 @@ function baseCreateRenderer(options, createHydrationFns) {
8533
8750
  newProps,
8534
8751
  parentComponent,
8535
8752
  parentSuspense,
8536
- isSVG
8753
+ namespace
8537
8754
  );
8538
8755
  } else {
8539
8756
  if (patchFlag & 2) {
8540
8757
  if (oldProps.class !== newProps.class) {
8541
- hostPatchProp(el, "class", null, newProps.class, isSVG);
8758
+ hostPatchProp(el, "class", null, newProps.class, namespace);
8542
8759
  }
8543
8760
  }
8544
8761
  if (patchFlag & 4) {
8545
- hostPatchProp(el, "style", oldProps.style, newProps.style, isSVG);
8762
+ hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
8546
8763
  }
8547
8764
  if (patchFlag & 8) {
8548
8765
  const propsToUpdate = n2.dynamicProps;
@@ -8556,7 +8773,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8556
8773
  key,
8557
8774
  prev,
8558
8775
  next,
8559
- isSVG,
8776
+ namespace,
8560
8777
  n1.children,
8561
8778
  parentComponent,
8562
8779
  parentSuspense,
@@ -8579,7 +8796,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8579
8796
  newProps,
8580
8797
  parentComponent,
8581
8798
  parentSuspense,
8582
- isSVG
8799
+ namespace
8583
8800
  );
8584
8801
  }
8585
8802
  if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
@@ -8589,7 +8806,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8589
8806
  }, parentSuspense);
8590
8807
  }
8591
8808
  };
8592
- const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {
8809
+ const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
8593
8810
  for (let i = 0; i < newChildren.length; i++) {
8594
8811
  const oldVNode = oldChildren[i];
8595
8812
  const newVNode = newChildren[i];
@@ -8614,13 +8831,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8614
8831
  null,
8615
8832
  parentComponent,
8616
8833
  parentSuspense,
8617
- isSVG,
8834
+ namespace,
8618
8835
  slotScopeIds,
8619
8836
  true
8620
8837
  );
8621
8838
  }
8622
8839
  };
8623
- const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {
8840
+ const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
8624
8841
  if (oldProps !== newProps) {
8625
8842
  if (oldProps !== EMPTY_OBJ) {
8626
8843
  for (const key in oldProps) {
@@ -8630,7 +8847,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8630
8847
  key,
8631
8848
  oldProps[key],
8632
8849
  null,
8633
- isSVG,
8850
+ namespace,
8634
8851
  vnode.children,
8635
8852
  parentComponent,
8636
8853
  parentSuspense,
@@ -8650,7 +8867,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8650
8867
  key,
8651
8868
  prev,
8652
8869
  next,
8653
- isSVG,
8870
+ namespace,
8654
8871
  vnode.children,
8655
8872
  parentComponent,
8656
8873
  parentSuspense,
@@ -8659,11 +8876,11 @@ function baseCreateRenderer(options, createHydrationFns) {
8659
8876
  }
8660
8877
  }
8661
8878
  if ("value" in newProps) {
8662
- hostPatchProp(el, "value", oldProps.value, newProps.value);
8879
+ hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
8663
8880
  }
8664
8881
  }
8665
8882
  };
8666
- const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8883
+ const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8667
8884
  const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
8668
8885
  const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
8669
8886
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
@@ -8685,7 +8902,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8685
8902
  fragmentEndAnchor,
8686
8903
  parentComponent,
8687
8904
  parentSuspense,
8688
- isSVG,
8905
+ namespace,
8689
8906
  slotScopeIds,
8690
8907
  optimized
8691
8908
  );
@@ -8699,7 +8916,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8699
8916
  container,
8700
8917
  parentComponent,
8701
8918
  parentSuspense,
8702
- isSVG,
8919
+ namespace,
8703
8920
  slotScopeIds
8704
8921
  );
8705
8922
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -8726,14 +8943,14 @@ function baseCreateRenderer(options, createHydrationFns) {
8726
8943
  fragmentEndAnchor,
8727
8944
  parentComponent,
8728
8945
  parentSuspense,
8729
- isSVG,
8946
+ namespace,
8730
8947
  slotScopeIds,
8731
8948
  optimized
8732
8949
  );
8733
8950
  }
8734
8951
  }
8735
8952
  };
8736
- const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
8953
+ const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
8737
8954
  n2.slotScopeIds = slotScopeIds;
8738
8955
  if (n1 == null) {
8739
8956
  if (n2.shapeFlag & 512) {
@@ -8741,7 +8958,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8741
8958
  n2,
8742
8959
  container,
8743
8960
  anchor,
8744
- isSVG,
8961
+ namespace,
8745
8962
  optimized
8746
8963
  );
8747
8964
  } else {
@@ -8751,7 +8968,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8751
8968
  anchor,
8752
8969
  parentComponent,
8753
8970
  parentSuspense,
8754
- isSVG,
8971
+ namespace,
8755
8972
  optimized
8756
8973
  );
8757
8974
  }
@@ -8759,7 +8976,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8759
8976
  updateComponent(n1, n2, optimized);
8760
8977
  }
8761
8978
  };
8762
- const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
8979
+ const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
8763
8980
  const compatMountInstance = initialVNode.isCompatRoot && initialVNode.component;
8764
8981
  const instance = compatMountInstance || (initialVNode.component = createComponentInstance(
8765
8982
  initialVNode,
@@ -8791,17 +9008,17 @@ function baseCreateRenderer(options, createHydrationFns) {
8791
9008
  const placeholder = instance.subTree = createVNode(Comment);
8792
9009
  processCommentNode(null, placeholder, container, anchor);
8793
9010
  }
8794
- return;
9011
+ } else {
9012
+ setupRenderEffect(
9013
+ instance,
9014
+ initialVNode,
9015
+ container,
9016
+ anchor,
9017
+ parentSuspense,
9018
+ namespace,
9019
+ optimized
9020
+ );
8795
9021
  }
8796
- setupRenderEffect(
8797
- instance,
8798
- initialVNode,
8799
- container,
8800
- anchor,
8801
- parentSuspense,
8802
- isSVG,
8803
- optimized
8804
- );
8805
9022
  if (!!(process.env.NODE_ENV !== "production")) {
8806
9023
  popWarningContext();
8807
9024
  endMeasure(instance, `mount`);
@@ -8830,7 +9047,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8830
9047
  instance.vnode = n2;
8831
9048
  }
8832
9049
  };
8833
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {
9050
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
8834
9051
  const componentUpdateFn = () => {
8835
9052
  if (!instance.isMounted) {
8836
9053
  let vnodeHook;
@@ -8900,7 +9117,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8900
9117
  anchor,
8901
9118
  instance,
8902
9119
  parentSuspense,
8903
- isSVG
9120
+ namespace
8904
9121
  );
8905
9122
  if (!!(process.env.NODE_ENV !== "production")) {
8906
9123
  endMeasure(instance, `patch`);
@@ -8939,6 +9156,21 @@ function baseCreateRenderer(options, createHydrationFns) {
8939
9156
  initialVNode = container = anchor = null;
8940
9157
  } else {
8941
9158
  let { next, bu, u, parent, vnode } = instance;
9159
+ {
9160
+ const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
9161
+ if (nonHydratedAsyncRoot) {
9162
+ if (next) {
9163
+ next.el = vnode.el;
9164
+ updateComponentPreRender(instance, next, optimized);
9165
+ }
9166
+ nonHydratedAsyncRoot.asyncDep.then(() => {
9167
+ if (!instance.isUnmounted) {
9168
+ componentUpdateFn();
9169
+ }
9170
+ });
9171
+ return;
9172
+ }
9173
+ }
8942
9174
  let originNext = next;
8943
9175
  let vnodeHook;
8944
9176
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -8982,7 +9214,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8982
9214
  getNextHostNode(prevTree),
8983
9215
  instance,
8984
9216
  parentSuspense,
8985
- isSVG
9217
+ namespace
8986
9218
  );
8987
9219
  if (!!(process.env.NODE_ENV !== "production")) {
8988
9220
  endMeasure(instance, `patch`);
@@ -9043,10 +9275,10 @@ function baseCreateRenderer(options, createHydrationFns) {
9043
9275
  updateProps(instance, nextVNode.props, prevProps, optimized);
9044
9276
  updateSlots(instance, nextVNode.children, optimized);
9045
9277
  pauseTracking();
9046
- flushPreFlushCbs();
9278
+ flushPreFlushCbs(instance);
9047
9279
  resetTracking();
9048
9280
  };
9049
- const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
9281
+ const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
9050
9282
  const c1 = n1 && n1.children;
9051
9283
  const prevShapeFlag = n1 ? n1.shapeFlag : 0;
9052
9284
  const c2 = n2.children;
@@ -9060,7 +9292,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9060
9292
  anchor,
9061
9293
  parentComponent,
9062
9294
  parentSuspense,
9063
- isSVG,
9295
+ namespace,
9064
9296
  slotScopeIds,
9065
9297
  optimized
9066
9298
  );
@@ -9073,7 +9305,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9073
9305
  anchor,
9074
9306
  parentComponent,
9075
9307
  parentSuspense,
9076
- isSVG,
9308
+ namespace,
9077
9309
  slotScopeIds,
9078
9310
  optimized
9079
9311
  );
@@ -9097,7 +9329,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9097
9329
  anchor,
9098
9330
  parentComponent,
9099
9331
  parentSuspense,
9100
- isSVG,
9332
+ namespace,
9101
9333
  slotScopeIds,
9102
9334
  optimized
9103
9335
  );
@@ -9115,7 +9347,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9115
9347
  anchor,
9116
9348
  parentComponent,
9117
9349
  parentSuspense,
9118
- isSVG,
9350
+ namespace,
9119
9351
  slotScopeIds,
9120
9352
  optimized
9121
9353
  );
@@ -9123,7 +9355,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9123
9355
  }
9124
9356
  }
9125
9357
  };
9126
- const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
9358
+ const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9127
9359
  c1 = c1 || EMPTY_ARR;
9128
9360
  c2 = c2 || EMPTY_ARR;
9129
9361
  const oldLength = c1.length;
@@ -9139,7 +9371,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9139
9371
  null,
9140
9372
  parentComponent,
9141
9373
  parentSuspense,
9142
- isSVG,
9374
+ namespace,
9143
9375
  slotScopeIds,
9144
9376
  optimized
9145
9377
  );
@@ -9160,14 +9392,14 @@ function baseCreateRenderer(options, createHydrationFns) {
9160
9392
  anchor,
9161
9393
  parentComponent,
9162
9394
  parentSuspense,
9163
- isSVG,
9395
+ namespace,
9164
9396
  slotScopeIds,
9165
9397
  optimized,
9166
9398
  commonLength
9167
9399
  );
9168
9400
  }
9169
9401
  };
9170
- const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {
9402
+ const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
9171
9403
  let i = 0;
9172
9404
  const l2 = c2.length;
9173
9405
  let e1 = c1.length - 1;
@@ -9183,7 +9415,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9183
9415
  null,
9184
9416
  parentComponent,
9185
9417
  parentSuspense,
9186
- isSVG,
9418
+ namespace,
9187
9419
  slotScopeIds,
9188
9420
  optimized
9189
9421
  );
@@ -9203,7 +9435,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9203
9435
  null,
9204
9436
  parentComponent,
9205
9437
  parentSuspense,
9206
- isSVG,
9438
+ namespace,
9207
9439
  slotScopeIds,
9208
9440
  optimized
9209
9441
  );
@@ -9225,7 +9457,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9225
9457
  anchor,
9226
9458
  parentComponent,
9227
9459
  parentSuspense,
9228
- isSVG,
9460
+ namespace,
9229
9461
  slotScopeIds,
9230
9462
  optimized
9231
9463
  );
@@ -9295,7 +9527,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9295
9527
  null,
9296
9528
  parentComponent,
9297
9529
  parentSuspense,
9298
- isSVG,
9530
+ namespace,
9299
9531
  slotScopeIds,
9300
9532
  optimized
9301
9533
  );
@@ -9316,7 +9548,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9316
9548
  anchor,
9317
9549
  parentComponent,
9318
9550
  parentSuspense,
9319
- isSVG,
9551
+ namespace,
9320
9552
  slotScopeIds,
9321
9553
  optimized
9322
9554
  );
@@ -9546,13 +9778,21 @@ function baseCreateRenderer(options, createHydrationFns) {
9546
9778
  }
9547
9779
  return hostNextSibling(vnode.anchor || vnode.el);
9548
9780
  };
9549
- const render = (vnode, container, isSVG) => {
9781
+ const render = (vnode, container, namespace) => {
9550
9782
  if (vnode == null) {
9551
9783
  if (container._vnode) {
9552
9784
  unmount(container._vnode, null, null, true);
9553
9785
  }
9554
9786
  } else {
9555
- patch(container._vnode || null, vnode, container, null, null, null, isSVG);
9787
+ patch(
9788
+ container._vnode || null,
9789
+ vnode,
9790
+ container,
9791
+ null,
9792
+ null,
9793
+ null,
9794
+ namespace
9795
+ );
9556
9796
  }
9557
9797
  flushPreFlushCbs();
9558
9798
  flushPostFlushCbs();
@@ -9583,6 +9823,9 @@ function baseCreateRenderer(options, createHydrationFns) {
9583
9823
  createApp: createAppAPI(render, hydrate)
9584
9824
  };
9585
9825
  }
9826
+ function resolveChildrenNamespace({ type, props }, currentNamespace) {
9827
+ return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
9828
+ }
9586
9829
  function toggleRecurse({ effect, update }, allowed) {
9587
9830
  effect.allowRecurse = update.allowRecurse = allowed;
9588
9831
  }
@@ -9653,10 +9896,21 @@ function getSequence(arr) {
9653
9896
  }
9654
9897
  return result;
9655
9898
  }
9899
+ function locateNonHydratedAsyncRoot(instance) {
9900
+ const subComponent = instance.subTree.component;
9901
+ if (subComponent) {
9902
+ if (subComponent.asyncDep && !subComponent.asyncResolved) {
9903
+ return subComponent;
9904
+ } else {
9905
+ return locateNonHydratedAsyncRoot(subComponent);
9906
+ }
9907
+ }
9908
+ }
9656
9909
 
9657
9910
  const isTeleport = (type) => type.__isTeleport;
9658
9911
  const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
9659
9912
  const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
9913
+ const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
9660
9914
  const resolveTarget = (props, select) => {
9661
9915
  const targetSelector = props && props.to;
9662
9916
  if (isString(targetSelector)) {
@@ -9684,7 +9938,7 @@ const resolveTarget = (props, select) => {
9684
9938
  const TeleportImpl = {
9685
9939
  name: "Teleport",
9686
9940
  __isTeleport: true,
9687
- process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
9941
+ process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
9688
9942
  const {
9689
9943
  mc: mountChildren,
9690
9944
  pc: patchChildren,
@@ -9706,7 +9960,11 @@ const TeleportImpl = {
9706
9960
  const targetAnchor = n2.targetAnchor = createText("");
9707
9961
  if (target) {
9708
9962
  insert(targetAnchor, target);
9709
- isSVG = isSVG || isTargetSVG(target);
9963
+ if (namespace === "svg" || isTargetSVG(target)) {
9964
+ namespace = "svg";
9965
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
9966
+ namespace = "mathml";
9967
+ }
9710
9968
  } else if (!!(process.env.NODE_ENV !== "production") && !disabled) {
9711
9969
  warn("Invalid Teleport target on mount:", target, `(${typeof target})`);
9712
9970
  }
@@ -9718,7 +9976,7 @@ const TeleportImpl = {
9718
9976
  anchor2,
9719
9977
  parentComponent,
9720
9978
  parentSuspense,
9721
- isSVG,
9979
+ namespace,
9722
9980
  slotScopeIds,
9723
9981
  optimized
9724
9982
  );
@@ -9737,7 +9995,11 @@ const TeleportImpl = {
9737
9995
  const wasDisabled = isTeleportDisabled(n1.props);
9738
9996
  const currentContainer = wasDisabled ? container : target;
9739
9997
  const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
9740
- isSVG = isSVG || isTargetSVG(target);
9998
+ if (namespace === "svg" || isTargetSVG(target)) {
9999
+ namespace = "svg";
10000
+ } else if (namespace === "mathml" || isTargetMathML(target)) {
10001
+ namespace = "mathml";
10002
+ }
9741
10003
  if (dynamicChildren) {
9742
10004
  patchBlockChildren(
9743
10005
  n1.dynamicChildren,
@@ -9745,7 +10007,7 @@ const TeleportImpl = {
9745
10007
  currentContainer,
9746
10008
  parentComponent,
9747
10009
  parentSuspense,
9748
- isSVG,
10010
+ namespace,
9749
10011
  slotScopeIds
9750
10012
  );
9751
10013
  traverseStaticChildren(n1, n2, true);
@@ -9757,7 +10019,7 @@ const TeleportImpl = {
9757
10019
  currentAnchor,
9758
10020
  parentComponent,
9759
10021
  parentSuspense,
9760
- isSVG,
10022
+ namespace,
9761
10023
  slotScopeIds,
9762
10024
  false
9763
10025
  );
@@ -10443,20 +10705,29 @@ function createComponentInstance(vnode, parent, suspense) {
10443
10705
  let currentInstance = null;
10444
10706
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
10445
10707
  let internalSetCurrentInstance;
10446
- let globalCurrentInstanceSetters;
10447
- let settersKey = "__VUE_INSTANCE_SETTERS__";
10708
+ let setInSSRSetupState;
10448
10709
  {
10449
- if (!(globalCurrentInstanceSetters = getGlobalThis()[settersKey])) {
10450
- globalCurrentInstanceSetters = getGlobalThis()[settersKey] = [];
10451
- }
10452
- globalCurrentInstanceSetters.push((i) => currentInstance = i);
10453
- internalSetCurrentInstance = (instance) => {
10454
- if (globalCurrentInstanceSetters.length > 1) {
10455
- globalCurrentInstanceSetters.forEach((s) => s(instance));
10456
- } else {
10457
- globalCurrentInstanceSetters[0](instance);
10458
- }
10710
+ const g = getGlobalThis();
10711
+ const registerGlobalSetter = (key, setter) => {
10712
+ let setters;
10713
+ if (!(setters = g[key]))
10714
+ setters = g[key] = [];
10715
+ setters.push(setter);
10716
+ return (v) => {
10717
+ if (setters.length > 1)
10718
+ setters.forEach((set) => set(v));
10719
+ else
10720
+ setters[0](v);
10721
+ };
10459
10722
  };
10723
+ internalSetCurrentInstance = registerGlobalSetter(
10724
+ `__VUE_INSTANCE_SETTERS__`,
10725
+ (v) => currentInstance = v
10726
+ );
10727
+ setInSSRSetupState = registerGlobalSetter(
10728
+ `__VUE_SSR_SETTERS__`,
10729
+ (v) => isInSSRComponentSetup = v
10730
+ );
10460
10731
  }
10461
10732
  const setCurrentInstance = (instance) => {
10462
10733
  internalSetCurrentInstance(instance);
@@ -10480,13 +10751,13 @@ function isStatefulComponent(instance) {
10480
10751
  }
10481
10752
  let isInSSRComponentSetup = false;
10482
10753
  function setupComponent(instance, isSSR = false) {
10483
- isInSSRComponentSetup = isSSR;
10754
+ isSSR && setInSSRSetupState(isSSR);
10484
10755
  const { props, children } = instance.vnode;
10485
10756
  const isStateful = isStatefulComponent(instance);
10486
10757
  initProps(instance, props, isStateful, isSSR);
10487
10758
  initSlots(instance, children);
10488
10759
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
10489
- isInSSRComponentSetup = false;
10760
+ isSSR && setInSSRSetupState(false);
10490
10761
  return setupResult;
10491
10762
  }
10492
10763
  function setupStatefulComponent(instance, isSSR) {
@@ -10830,9 +11101,9 @@ function initCustomFormatter() {
10830
11101
  return;
10831
11102
  }
10832
11103
  const vueStyle = { style: "color:#3ba776" };
10833
- const numberStyle = { style: "color:#0b1bc9" };
10834
- const stringStyle = { style: "color:#b62e24" };
10835
- const keywordStyle = { style: "color:#9d288c" };
11104
+ const numberStyle = { style: "color:#1677ff" };
11105
+ const stringStyle = { style: "color:#f5222d" };
11106
+ const keywordStyle = { style: "color:#eb2f96" };
10836
11107
  const formatter = {
10837
11108
  header(obj) {
10838
11109
  if (!isObject(obj)) {
@@ -11026,7 +11297,7 @@ function isMemoSame(cached, memo) {
11026
11297
  return true;
11027
11298
  }
11028
11299
 
11029
- const version = "3.4.0-alpha.3";
11300
+ const version = "3.4.0-beta.1";
11030
11301
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11031
11302
  const _ssrUtils = {
11032
11303
  createComponentInstance,
@@ -11046,8 +11317,10 @@ const _compatUtils = {
11046
11317
  softAssertCompatEnabled
11047
11318
  };
11048
11319
  const compatUtils = _compatUtils ;
11320
+ const DeprecationTypes = DeprecationTypes$1 ;
11049
11321
 
11050
11322
  const svgNS = "http://www.w3.org/2000/svg";
11323
+ const mathmlNS = "http://www.w3.org/1998/Math/MathML";
11051
11324
  const doc = typeof document !== "undefined" ? document : null;
11052
11325
  const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
11053
11326
  const nodeOps = {
@@ -11060,8 +11333,8 @@ const nodeOps = {
11060
11333
  parent.removeChild(child);
11061
11334
  }
11062
11335
  },
11063
- createElement: (tag, isSVG, is, props) => {
11064
- const el = isSVG ? doc.createElementNS(svgNS, tag) : doc.createElement(tag, is ? { is } : void 0);
11336
+ createElement: (tag, namespace, is, props) => {
11337
+ const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
11065
11338
  if (tag === "select" && props && props.multiple != null) {
11066
11339
  el.setAttribute("multiple", props.multiple);
11067
11340
  }
@@ -11085,7 +11358,7 @@ const nodeOps = {
11085
11358
  // Reason: innerHTML.
11086
11359
  // Static content here can only come from compiled templates.
11087
11360
  // As long as the user only uses trusted templates, this is safe.
11088
- insertStaticContent(content, parent, anchor, isSVG, start, end) {
11361
+ insertStaticContent(content, parent, anchor, namespace, start, end) {
11089
11362
  const before = anchor ? anchor.previousSibling : parent.lastChild;
11090
11363
  if (start && (start === end || start.nextSibling)) {
11091
11364
  while (true) {
@@ -11094,9 +11367,9 @@ const nodeOps = {
11094
11367
  break;
11095
11368
  }
11096
11369
  } else {
11097
- templateContainer.innerHTML = isSVG ? `<svg>${content}</svg>` : content;
11370
+ templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
11098
11371
  const template = templateContainer.content;
11099
- if (isSVG) {
11372
+ if (namespace === "svg" || namespace === "mathml") {
11100
11373
  const wrapper = template.firstChild;
11101
11374
  while (wrapper.firstChild) {
11102
11375
  template.appendChild(wrapper.firstChild);
@@ -11741,8 +12014,10 @@ function patchStopImmediatePropagation(e, value) {
11741
12014
  }
11742
12015
  }
11743
12016
 
11744
- const nativeOnRE = /^on[a-z]/;
11745
- const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
12017
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
12018
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
12019
+ const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
12020
+ const isSVG = namespace === "svg";
11746
12021
  if (key === "class") {
11747
12022
  patchClass(el, nextValue, isSVG);
11748
12023
  } else if (key === "style") {
@@ -11775,7 +12050,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
11775
12050
  if (key === "innerHTML" || key === "textContent") {
11776
12051
  return true;
11777
12052
  }
11778
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
12053
+ if (key in el && isNativeOn(key) && isFunction(value)) {
11779
12054
  return true;
11780
12055
  }
11781
12056
  return false;
@@ -11792,7 +12067,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
11792
12067
  if (key === "type" && el.tagName === "TEXTAREA") {
11793
12068
  return false;
11794
12069
  }
11795
- if (nativeOnRE.test(key) && isString(value)) {
12070
+ if (key === "width" || key === "height") {
12071
+ const tag = el.tagName;
12072
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
12073
+ return false;
12074
+ }
12075
+ }
12076
+ if (isNativeOn(key) && isString(value)) {
11796
12077
  return false;
11797
12078
  }
11798
12079
  return key in el;
@@ -12516,14 +12797,14 @@ const modifierGuards = {
12516
12797
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
12517
12798
  };
12518
12799
  const withModifiers = (fn, modifiers) => {
12519
- return (event, ...args) => {
12800
+ return fn._withMods || (fn._withMods = (event, ...args) => {
12520
12801
  for (let i = 0; i < modifiers.length; i++) {
12521
12802
  const guard = modifierGuards[modifiers[i]];
12522
12803
  if (guard && guard(event, modifiers))
12523
12804
  return;
12524
12805
  }
12525
12806
  return fn(event, ...args);
12526
- };
12807
+ });
12527
12808
  };
12528
12809
  const keyNames = {
12529
12810
  esc: "escape",
@@ -12551,7 +12832,7 @@ const withKeys = (fn, modifiers) => {
12551
12832
  );
12552
12833
  }
12553
12834
  }
12554
- return (event) => {
12835
+ return fn._withKeys || (fn._withKeys = (event) => {
12555
12836
  if (!("key" in event)) {
12556
12837
  return;
12557
12838
  }
@@ -12579,7 +12860,7 @@ const withKeys = (fn, modifiers) => {
12579
12860
  }
12580
12861
  }
12581
12862
  }
12582
- };
12863
+ });
12583
12864
  };
12584
12865
 
12585
12866
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -12627,7 +12908,7 @@ const createApp = (...args) => {
12627
12908
  }
12628
12909
  }
12629
12910
  container.innerHTML = "";
12630
- const proxy = mount(container, false, container instanceof SVGElement);
12911
+ const proxy = mount(container, false, resolveRootNamespace(container));
12631
12912
  if (container instanceof Element) {
12632
12913
  container.removeAttribute("v-cloak");
12633
12914
  container.setAttribute("data-v-app", "");
@@ -12646,14 +12927,22 @@ const createSSRApp = (...args) => {
12646
12927
  app.mount = (containerOrSelector) => {
12647
12928
  const container = normalizeContainer(containerOrSelector);
12648
12929
  if (container) {
12649
- return mount(container, true, container instanceof SVGElement);
12930
+ return mount(container, true, resolveRootNamespace(container));
12650
12931
  }
12651
12932
  };
12652
12933
  return app;
12653
12934
  };
12935
+ function resolveRootNamespace(container) {
12936
+ if (container instanceof SVGElement) {
12937
+ return "svg";
12938
+ }
12939
+ if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
12940
+ return "mathml";
12941
+ }
12942
+ }
12654
12943
  function injectNativeTagCheck(app) {
12655
12944
  Object.defineProperty(app.config, "isNativeTag", {
12656
- value: (tag) => isHTMLTag(tag) || isSVGTag(tag),
12945
+ value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
12657
12946
  writable: false
12658
12947
  });
12659
12948
  }
@@ -12717,7 +13006,9 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12717
13006
  BaseTransition: BaseTransition,
12718
13007
  BaseTransitionPropsValidators: BaseTransitionPropsValidators,
12719
13008
  Comment: Comment,
13009
+ DeprecationTypes: DeprecationTypes,
12720
13010
  EffectScope: EffectScope,
13011
+ ErrorCodes: ErrorCodes,
12721
13012
  ErrorTypeStrings: ErrorTypeStrings,
12722
13013
  Fragment: Fragment,
12723
13014
  KeepAlive: KeepAlive,
@@ -12726,8 +13017,10 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12726
13017
  Suspense: Suspense,
12727
13018
  Teleport: Teleport,
12728
13019
  Text: Text,
13020
+ TrackOpTypes: TrackOpTypes,
12729
13021
  Transition: Transition,
12730
13022
  TransitionGroup: TransitionGroup,
13023
+ TriggerOpTypes: TriggerOpTypes,
12731
13024
  VueElement: VueElement,
12732
13025
  assertNumber: assertNumber,
12733
13026
  callWithAsyncErrorHandling: callWithAsyncErrorHandling,
@@ -13193,7 +13486,9 @@ class Tokenizer {
13193
13486
  this.inRCDATA = false;
13194
13487
  /** For disabling RCDATA tags handling */
13195
13488
  this.inXML = false;
13196
- /** Reocrd newline positions for fast line / column calculation */
13489
+ /** For disabling interpolation parsing in v-pre */
13490
+ this.inVPre = false;
13491
+ /** Record newline positions for fast line / column calculation */
13197
13492
  this.newlines = [];
13198
13493
  this.mode = 0;
13199
13494
  this.delimiterOpen = defaultDelimitersOpen;
@@ -13212,6 +13507,7 @@ class Tokenizer {
13212
13507
  this.sectionStart = 0;
13213
13508
  this.index = 0;
13214
13509
  this.baseState = 1;
13510
+ this.inRCDATA = false;
13215
13511
  this.currentSequence = void 0;
13216
13512
  this.newlines.length = 0;
13217
13513
  this.delimiterOpen = defaultDelimitersOpen;
@@ -13250,7 +13546,7 @@ class Tokenizer {
13250
13546
  }
13251
13547
  this.state = 5;
13252
13548
  this.sectionStart = this.index;
13253
- } else if (c === this.delimiterOpen[0]) {
13549
+ } else if (!this.inVPre && c === this.delimiterOpen[0]) {
13254
13550
  this.state = 2;
13255
13551
  this.delimiterIndex = 0;
13256
13552
  this.stateInterpolationOpen(c);
@@ -14065,16 +14361,14 @@ const errorMessages = {
14065
14361
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
14066
14362
  [45]: `Error parsing JavaScript expression: `,
14067
14363
  [46]: `<KeepAlive> expects exactly one child component.`,
14364
+ [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.`,
14068
14365
  // generic errors
14069
14366
  [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
14070
14367
  [48]: `ES module mode is not supported in this build of compiler.`,
14071
14368
  [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
14072
14369
  [50]: `"scopeId" option is only supported in module mode.`,
14073
- // deprecations
14074
- [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.`,
14075
- [52]: `v-is="component-name" has been deprecated. Use is="vue:component-name" instead. v-is support will be removed in 3.4.`,
14076
14370
  // just to fulfill types
14077
- [53]: ``
14371
+ [52]: ``
14078
14372
  };
14079
14373
 
14080
14374
  const isStaticExp = (p) => p.type === 4 && p.isStatic;
@@ -14317,7 +14611,8 @@ const defaultParserOptions = {
14317
14611
  isCustomElement: NO,
14318
14612
  onError: defaultOnError,
14319
14613
  onWarn: defaultOnWarn,
14320
- comments: !!(process.env.NODE_ENV !== "production")
14614
+ comments: !!(process.env.NODE_ENV !== "production"),
14615
+ prefixIdentifiers: false
14321
14616
  };
14322
14617
  let currentOptions = defaultParserOptions;
14323
14618
  let currentRoot = null;
@@ -14359,7 +14654,7 @@ const tokenizer = new Tokenizer(stack, {
14359
14654
  }
14360
14655
  addNode({
14361
14656
  type: 5,
14362
- content: createSimpleExpression(exp, false, getLoc(innerStart, innerEnd)),
14657
+ content: createExp(exp, false, getLoc(innerStart, innerEnd)),
14363
14658
  loc: getLoc(start, end)
14364
14659
  });
14365
14660
  },
@@ -14452,7 +14747,7 @@ const tokenizer = new Tokenizer(stack, {
14452
14747
  loc: getLoc(start)
14453
14748
  };
14454
14749
  if (name === "pre") {
14455
- inVPre = true;
14750
+ inVPre = tokenizer.inVPre = true;
14456
14751
  currentVPreBoundary = currentOpenTag;
14457
14752
  const props = currentOpenTag.props;
14458
14753
  for (let i = 0; i < props.length; i++) {
@@ -14472,7 +14767,7 @@ const tokenizer = new Tokenizer(stack, {
14472
14767
  setLocEnd(currentProp.nameLoc, end);
14473
14768
  } else {
14474
14769
  const isStatic = arg[0] !== `[`;
14475
- currentProp.arg = createSimpleExpression(
14770
+ currentProp.arg = createExp(
14476
14771
  isStatic ? arg : arg.slice(1, -1),
14477
14772
  isStatic,
14478
14773
  getLoc(start, end),
@@ -14545,10 +14840,13 @@ const tokenizer = new Tokenizer(stack, {
14545
14840
  tokenizer.enterRCDATA(toCharCodes(`</template`), 0);
14546
14841
  }
14547
14842
  } else {
14548
- currentProp.exp = createSimpleExpression(
14843
+ let expParseMode = 0 /* Normal */;
14844
+ currentProp.exp = createExp(
14549
14845
  currentAttrValue,
14550
14846
  false,
14551
- getLoc(currentAttrStartIndex, currentAttrEndIndex)
14847
+ getLoc(currentAttrStartIndex, currentAttrEndIndex),
14848
+ 0,
14849
+ expParseMode
14552
14850
  );
14553
14851
  if (currentProp.name === "for") {
14554
14852
  currentProp.forParseResult = parseForExpression(currentProp.exp);
@@ -14651,10 +14949,16 @@ function parseForExpression(input) {
14651
14949
  if (!inMatch)
14652
14950
  return;
14653
14951
  const [, LHS, RHS] = inMatch;
14654
- const createAliasExpression = (content, offset) => {
14952
+ const createAliasExpression = (content, offset, asParam = false) => {
14655
14953
  const start = loc.start.offset + offset;
14656
14954
  const end = start + content.length;
14657
- return createSimpleExpression(content, false, getLoc(start, end));
14955
+ return createExp(
14956
+ content,
14957
+ false,
14958
+ getLoc(start, end),
14959
+ 0,
14960
+ asParam ? 1 /* Params */ : 0 /* Normal */
14961
+ );
14658
14962
  };
14659
14963
  const result = {
14660
14964
  source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)),
@@ -14672,7 +14976,7 @@ function parseForExpression(input) {
14672
14976
  let keyOffset;
14673
14977
  if (keyContent) {
14674
14978
  keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
14675
- result.key = createAliasExpression(keyContent, keyOffset);
14979
+ result.key = createAliasExpression(keyContent, keyOffset, true);
14676
14980
  }
14677
14981
  if (iteratorMatch[2]) {
14678
14982
  const indexContent = iteratorMatch[2].trim();
@@ -14682,13 +14986,14 @@ function parseForExpression(input) {
14682
14986
  exp.indexOf(
14683
14987
  indexContent,
14684
14988
  result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length
14685
- )
14989
+ ),
14990
+ true
14686
14991
  );
14687
14992
  }
14688
14993
  }
14689
14994
  }
14690
14995
  if (valueContent) {
14691
- result.value = createAliasExpression(valueContent, trimmedOffset);
14996
+ result.value = createAliasExpression(valueContent, trimmedOffset, true);
14692
14997
  }
14693
14998
  return result;
14694
14999
  }
@@ -14766,7 +15071,7 @@ function onCloseTag(el, end, isImplied = false) {
14766
15071
  inPre--;
14767
15072
  }
14768
15073
  if (currentVPreBoundary === el) {
14769
- inVPre = false;
15074
+ inVPre = tokenizer.inVPre = false;
14770
15075
  currentVPreBoundary = null;
14771
15076
  }
14772
15077
  if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) {
@@ -15001,8 +15306,14 @@ function dirToAttr(dir) {
15001
15306
  }
15002
15307
  return attr;
15003
15308
  }
15004
- function emitError(code, index) {
15005
- currentOptions.onError(createCompilerError(code, getLoc(index, index)));
15309
+ function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) {
15310
+ const exp = createSimpleExpression(content, isStatic, loc, constType);
15311
+ return exp;
15312
+ }
15313
+ function emitError(code, index, message) {
15314
+ currentOptions.onError(
15315
+ createCompilerError(code, getLoc(index, index), void 0, message)
15316
+ );
15006
15317
  }
15007
15318
  function reset() {
15008
15319
  tokenizer.reset();
@@ -15033,6 +15344,7 @@ function baseParse(input, options) {
15033
15344
  }
15034
15345
  }
15035
15346
  tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
15347
+ tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
15036
15348
  const delimiters = options == null ? void 0 : options.delimiters;
15037
15349
  if (delimiters) {
15038
15350
  tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
@@ -15318,6 +15630,7 @@ function createTransformContext(root, {
15318
15630
  const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
15319
15631
  const context = {
15320
15632
  // options
15633
+ filename,
15321
15634
  selfName: nameMatch && capitalize(camelize(nameMatch[1])),
15322
15635
  prefixIdentifiers,
15323
15636
  hoistStatic: hoistStatic2,
@@ -17082,6 +17395,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17082
17395
  if (isEventHandler && isReservedProp(name)) {
17083
17396
  hasVnodeHook = true;
17084
17397
  }
17398
+ if (isEventHandler && value.type === 14) {
17399
+ value = value.arguments[0];
17400
+ }
17085
17401
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
17086
17402
  return;
17087
17403
  }
@@ -17534,9 +17850,7 @@ const transformOn$1 = (dir, node, context, augmentor) => {
17534
17850
  if (arg.isStatic) {
17535
17851
  let rawName = arg.content;
17536
17852
  if (!!(process.env.NODE_ENV !== "production") && rawName.startsWith("vnode")) {
17537
- context.onWarn(
17538
- createCompilerError(51, arg.loc)
17539
- );
17853
+ context.onError(createCompilerError(51, arg.loc));
17540
17854
  }
17541
17855
  if (rawName.startsWith("vue:")) {
17542
17856
  rawName = `vnode-${rawName.slice(4)}`;
@@ -18029,12 +18343,14 @@ function baseCompile(source, options = {}) {
18029
18343
  if (options.scopeId && !isModuleMode) {
18030
18344
  onError(createCompilerError(50));
18031
18345
  }
18032
- const ast = isString(source) ? baseParse(source, options) : source;
18346
+ const resolvedOptions = extend({}, options, {
18347
+ prefixIdentifiers
18348
+ });
18349
+ const ast = isString(source) ? baseParse(source, resolvedOptions) : source;
18033
18350
  const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
18034
18351
  transform(
18035
18352
  ast,
18036
- extend({}, options, {
18037
- prefixIdentifiers,
18353
+ extend({}, resolvedOptions, {
18038
18354
  nodeTransforms: [
18039
18355
  ...nodeTransforms,
18040
18356
  ...options.nodeTransforms || []
@@ -18048,12 +18364,7 @@ function baseCompile(source, options = {}) {
18048
18364
  )
18049
18365
  })
18050
18366
  );
18051
- return generate(
18052
- ast,
18053
- extend({}, options, {
18054
- prefixIdentifiers
18055
- })
18056
- );
18367
+ return generate(ast, resolvedOptions);
18057
18368
  }
18058
18369
 
18059
18370
  const noopDirectiveTransform = () => ({ props: [] });
@@ -18098,7 +18409,7 @@ function decodeHtmlBrowser(raw, asAttr = false) {
18098
18409
  const parserOptions = {
18099
18410
  parseMode: "html",
18100
18411
  isVoidTag,
18101
- isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag),
18412
+ isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
18102
18413
  isPreTag: (tag) => tag === "pre",
18103
18414
  decodeEntities: decodeHtmlBrowser ,
18104
18415
  isBuiltInComponent: (tag) => {
@@ -18583,4 +18894,4 @@ var Vue$1 = Vue;
18583
18894
 
18584
18895
  const { configureCompat } = Vue$1;
18585
18896
 
18586
- export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
18897
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };