UNPKG

329 kBJavaScriptView Raw
1/**
2* vue v3.4.21
3* (c) 2018-present Yuxi (Evan) You and Vue contributors
4* @license MIT
5**/
6function makeMap(str, expectsLowerCase) {
7 const set = new Set(str.split(","));
8 return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
9}
10
11const EMPTY_OBJ = Object.freeze({}) ;
12const EMPTY_ARR = Object.freeze([]) ;
13const NOOP = () => {
14};
15const NO = () => false;
16const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
17(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
18const isModelListener = (key) => key.startsWith("onUpdate:");
19const extend = Object.assign;
20const remove = (arr, el) => {
21 const i = arr.indexOf(el);
22 if (i > -1) {
23 arr.splice(i, 1);
24 }
25};
26const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
27const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
28const isArray = Array.isArray;
29const isMap = (val) => toTypeString(val) === "[object Map]";
30const isSet = (val) => toTypeString(val) === "[object Set]";
31const isDate = (val) => toTypeString(val) === "[object Date]";
32const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
33const isFunction = (val) => typeof val === "function";
34const isString = (val) => typeof val === "string";
35const isSymbol = (val) => typeof val === "symbol";
36const isObject = (val) => val !== null && typeof val === "object";
37const isPromise = (val) => {
38 return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
39};
40const objectToString = Object.prototype.toString;
41const toTypeString = (value) => objectToString.call(value);
42const toRawType = (value) => {
43 return toTypeString(value).slice(8, -1);
44};
45const isPlainObject = (val) => toTypeString(val) === "[object Object]";
46const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
47const isReservedProp = /* @__PURE__ */ makeMap(
48 // the leading comma is intentional so empty string "" is also included
49 ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
50);
51const isBuiltInDirective = /* @__PURE__ */ makeMap(
52 "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
53);
54const cacheStringFunction = (fn) => {
55 const cache = /* @__PURE__ */ Object.create(null);
56 return (str) => {
57 const hit = cache[str];
58 return hit || (cache[str] = fn(str));
59 };
60};
61const camelizeRE = /-(\w)/g;
62const camelize = cacheStringFunction((str) => {
63 return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
64});
65const hyphenateRE = /\B([A-Z])/g;
66const hyphenate = cacheStringFunction(
67 (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
68);
69const capitalize = cacheStringFunction((str) => {
70 return str.charAt(0).toUpperCase() + str.slice(1);
71});
72const toHandlerKey = cacheStringFunction((str) => {
73 const s = str ? `on${capitalize(str)}` : ``;
74 return s;
75});
76const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
77const invokeArrayFns = (fns, arg) => {
78 for (let i = 0; i < fns.length; i++) {
79 fns[i](arg);
80 }
81};
82const def = (obj, key, value) => {
83 Object.defineProperty(obj, key, {
84 configurable: true,
85 enumerable: false,
86 value
87 });
88};
89const looseToNumber = (val) => {
90 const n = parseFloat(val);
91 return isNaN(n) ? val : n;
92};
93const toNumber = (val) => {
94 const n = isString(val) ? Number(val) : NaN;
95 return isNaN(n) ? val : n;
96};
97let _globalThis;
98const getGlobalThis = () => {
99 return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
100};
101
102const 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";
103const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
104
105function normalizeStyle(value) {
106 if (isArray(value)) {
107 const res = {};
108 for (let i = 0; i < value.length; i++) {
109 const item = value[i];
110 const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
111 if (normalized) {
112 for (const key in normalized) {
113 res[key] = normalized[key];
114 }
115 }
116 }
117 return res;
118 } else if (isString(value) || isObject(value)) {
119 return value;
120 }
121}
122const listDelimiterRE = /;(?![^(]*\))/g;
123const propertyDelimiterRE = /:([^]+)/;
124const styleCommentRE = /\/\*[^]*?\*\//g;
125function parseStringStyle(cssText) {
126 const ret = {};
127 cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
128 if (item) {
129 const tmp = item.split(propertyDelimiterRE);
130 tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
131 }
132 });
133 return ret;
134}
135function stringifyStyle(styles) {
136 let ret = "";
137 if (!styles || isString(styles)) {
138 return ret;
139 }
140 for (const key in styles) {
141 const value = styles[key];
142 const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
143 if (isString(value) || typeof value === "number") {
144 ret += `${normalizedKey}:${value};`;
145 }
146 }
147 return ret;
148}
149function normalizeClass(value) {
150 let res = "";
151 if (isString(value)) {
152 res = value;
153 } else if (isArray(value)) {
154 for (let i = 0; i < value.length; i++) {
155 const normalized = normalizeClass(value[i]);
156 if (normalized) {
157 res += normalized + " ";
158 }
159 }
160 } else if (isObject(value)) {
161 for (const name in value) {
162 if (value[name]) {
163 res += name + " ";
164 }
165 }
166 }
167 return res.trim();
168}
169function normalizeProps(props) {
170 if (!props)
171 return null;
172 let { class: klass, style } = props;
173 if (klass && !isString(klass)) {
174 props.class = normalizeClass(klass);
175 }
176 if (style) {
177 props.style = normalizeStyle(style);
178 }
179 return props;
180}
181
182const 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";
183const 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";
184const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
185const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
186const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
187const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
188
189const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
190const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
191const isBooleanAttr = /* @__PURE__ */ makeMap(
192 specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
193);
194function includeBooleanAttr(value) {
195 return !!value || value === "";
196}
197const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
198 `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`
199);
200const isKnownSvgAttr = /* @__PURE__ */ makeMap(
201 `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`
202);
203function isRenderableAttrValue(value) {
204 if (value == null) {
205 return false;
206 }
207 const type = typeof value;
208 return type === "string" || type === "number" || type === "boolean";
209}
210
211function looseCompareArrays(a, b) {
212 if (a.length !== b.length)
213 return false;
214 let equal = true;
215 for (let i = 0; equal && i < a.length; i++) {
216 equal = looseEqual(a[i], b[i]);
217 }
218 return equal;
219}
220function looseEqual(a, b) {
221 if (a === b)
222 return true;
223 let aValidType = isDate(a);
224 let bValidType = isDate(b);
225 if (aValidType || bValidType) {
226 return aValidType && bValidType ? a.getTime() === b.getTime() : false;
227 }
228 aValidType = isSymbol(a);
229 bValidType = isSymbol(b);
230 if (aValidType || bValidType) {
231 return a === b;
232 }
233 aValidType = isArray(a);
234 bValidType = isArray(b);
235 if (aValidType || bValidType) {
236 return aValidType && bValidType ? looseCompareArrays(a, b) : false;
237 }
238 aValidType = isObject(a);
239 bValidType = isObject(b);
240 if (aValidType || bValidType) {
241 if (!aValidType || !bValidType) {
242 return false;
243 }
244 const aKeysCount = Object.keys(a).length;
245 const bKeysCount = Object.keys(b).length;
246 if (aKeysCount !== bKeysCount) {
247 return false;
248 }
249 for (const key in a) {
250 const aHasKey = a.hasOwnProperty(key);
251 const bHasKey = b.hasOwnProperty(key);
252 if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
253 return false;
254 }
255 }
256 }
257 return String(a) === String(b);
258}
259function looseIndexOf(arr, val) {
260 return arr.findIndex((item) => looseEqual(item, val));
261}
262
263const toDisplayString = (val) => {
264 return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
265};
266const replacer = (_key, val) => {
267 if (val && val.__v_isRef) {
268 return replacer(_key, val.value);
269 } else if (isMap(val)) {
270 return {
271 [`Map(${val.size})`]: [...val.entries()].reduce(
272 (entries, [key, val2], i) => {
273 entries[stringifySymbol(key, i) + " =>"] = val2;
274 return entries;
275 },
276 {}
277 )
278 };
279 } else if (isSet(val)) {
280 return {
281 [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
282 };
283 } else if (isSymbol(val)) {
284 return stringifySymbol(val);
285 } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
286 return String(val);
287 }
288 return val;
289};
290const stringifySymbol = (v, i = "") => {
291 var _a;
292 return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
293};
294
295function warn$2(msg, ...args) {
296 console.warn(`[Vue warn] ${msg}`, ...args);
297}
298
299let activeEffectScope;
300class EffectScope {
301 constructor(detached = false) {
302 this.detached = detached;
303 /**
304 * @internal
305 */
306 this._active = true;
307 /**
308 * @internal
309 */
310 this.effects = [];
311 /**
312 * @internal
313 */
314 this.cleanups = [];
315 this.parent = activeEffectScope;
316 if (!detached && activeEffectScope) {
317 this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
318 this
319 ) - 1;
320 }
321 }
322 get active() {
323 return this._active;
324 }
325 run(fn) {
326 if (this._active) {
327 const currentEffectScope = activeEffectScope;
328 try {
329 activeEffectScope = this;
330 return fn();
331 } finally {
332 activeEffectScope = currentEffectScope;
333 }
334 } else {
335 warn$2(`cannot run an inactive effect scope.`);
336 }
337 }
338 /**
339 * This should only be called on non-detached scopes
340 * @internal
341 */
342 on() {
343 activeEffectScope = this;
344 }
345 /**
346 * This should only be called on non-detached scopes
347 * @internal
348 */
349 off() {
350 activeEffectScope = this.parent;
351 }
352 stop(fromParent) {
353 if (this._active) {
354 let i, l;
355 for (i = 0, l = this.effects.length; i < l; i++) {
356 this.effects[i].stop();
357 }
358 for (i = 0, l = this.cleanups.length; i < l; i++) {
359 this.cleanups[i]();
360 }
361 if (this.scopes) {
362 for (i = 0, l = this.scopes.length; i < l; i++) {
363 this.scopes[i].stop(true);
364 }
365 }
366 if (!this.detached && this.parent && !fromParent) {
367 const last = this.parent.scopes.pop();
368 if (last && last !== this) {
369 this.parent.scopes[this.index] = last;
370 last.index = this.index;
371 }
372 }
373 this.parent = void 0;
374 this._active = false;
375 }
376 }
377}
378function effectScope(detached) {
379 return new EffectScope(detached);
380}
381function recordEffectScope(effect, scope = activeEffectScope) {
382 if (scope && scope.active) {
383 scope.effects.push(effect);
384 }
385}
386function getCurrentScope() {
387 return activeEffectScope;
388}
389function onScopeDispose(fn) {
390 if (activeEffectScope) {
391 activeEffectScope.cleanups.push(fn);
392 } else {
393 warn$2(
394 `onScopeDispose() is called when there is no active effect scope to be associated with.`
395 );
396 }
397}
398
399let activeEffect;
400class ReactiveEffect {
401 constructor(fn, trigger, scheduler, scope) {
402 this.fn = fn;
403 this.trigger = trigger;
404 this.scheduler = scheduler;
405 this.active = true;
406 this.deps = [];
407 /**
408 * @internal
409 */
410 this._dirtyLevel = 4;
411 /**
412 * @internal
413 */
414 this._trackId = 0;
415 /**
416 * @internal
417 */
418 this._runnings = 0;
419 /**
420 * @internal
421 */
422 this._shouldSchedule = false;
423 /**
424 * @internal
425 */
426 this._depsLength = 0;
427 recordEffectScope(this, scope);
428 }
429 get dirty() {
430 if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
431 this._dirtyLevel = 1;
432 pauseTracking();
433 for (let i = 0; i < this._depsLength; i++) {
434 const dep = this.deps[i];
435 if (dep.computed) {
436 triggerComputed(dep.computed);
437 if (this._dirtyLevel >= 4) {
438 break;
439 }
440 }
441 }
442 if (this._dirtyLevel === 1) {
443 this._dirtyLevel = 0;
444 }
445 resetTracking();
446 }
447 return this._dirtyLevel >= 4;
448 }
449 set dirty(v) {
450 this._dirtyLevel = v ? 4 : 0;
451 }
452 run() {
453 this._dirtyLevel = 0;
454 if (!this.active) {
455 return this.fn();
456 }
457 let lastShouldTrack = shouldTrack;
458 let lastEffect = activeEffect;
459 try {
460 shouldTrack = true;
461 activeEffect = this;
462 this._runnings++;
463 preCleanupEffect(this);
464 return this.fn();
465 } finally {
466 postCleanupEffect(this);
467 this._runnings--;
468 activeEffect = lastEffect;
469 shouldTrack = lastShouldTrack;
470 }
471 }
472 stop() {
473 var _a;
474 if (this.active) {
475 preCleanupEffect(this);
476 postCleanupEffect(this);
477 (_a = this.onStop) == null ? void 0 : _a.call(this);
478 this.active = false;
479 }
480 }
481}
482function triggerComputed(computed) {
483 return computed.value;
484}
485function preCleanupEffect(effect2) {
486 effect2._trackId++;
487 effect2._depsLength = 0;
488}
489function postCleanupEffect(effect2) {
490 if (effect2.deps.length > effect2._depsLength) {
491 for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
492 cleanupDepEffect(effect2.deps[i], effect2);
493 }
494 effect2.deps.length = effect2._depsLength;
495 }
496}
497function cleanupDepEffect(dep, effect2) {
498 const trackId = dep.get(effect2);
499 if (trackId !== void 0 && effect2._trackId !== trackId) {
500 dep.delete(effect2);
501 if (dep.size === 0) {
502 dep.cleanup();
503 }
504 }
505}
506function effect(fn, options) {
507 if (fn.effect instanceof ReactiveEffect) {
508 fn = fn.effect.fn;
509 }
510 const _effect = new ReactiveEffect(fn, NOOP, () => {
511 if (_effect.dirty) {
512 _effect.run();
513 }
514 });
515 if (options) {
516 extend(_effect, options);
517 if (options.scope)
518 recordEffectScope(_effect, options.scope);
519 }
520 if (!options || !options.lazy) {
521 _effect.run();
522 }
523 const runner = _effect.run.bind(_effect);
524 runner.effect = _effect;
525 return runner;
526}
527function stop(runner) {
528 runner.effect.stop();
529}
530let shouldTrack = true;
531let pauseScheduleStack = 0;
532const trackStack = [];
533function pauseTracking() {
534 trackStack.push(shouldTrack);
535 shouldTrack = false;
536}
537function resetTracking() {
538 const last = trackStack.pop();
539 shouldTrack = last === void 0 ? true : last;
540}
541function pauseScheduling() {
542 pauseScheduleStack++;
543}
544function resetScheduling() {
545 pauseScheduleStack--;
546 while (!pauseScheduleStack && queueEffectSchedulers.length) {
547 queueEffectSchedulers.shift()();
548 }
549}
550function trackEffect(effect2, dep, debuggerEventExtraInfo) {
551 var _a;
552 if (dep.get(effect2) !== effect2._trackId) {
553 dep.set(effect2, effect2._trackId);
554 const oldDep = effect2.deps[effect2._depsLength];
555 if (oldDep !== dep) {
556 if (oldDep) {
557 cleanupDepEffect(oldDep, effect2);
558 }
559 effect2.deps[effect2._depsLength++] = dep;
560 } else {
561 effect2._depsLength++;
562 }
563 {
564 (_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
565 }
566 }
567}
568const queueEffectSchedulers = [];
569function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
570 var _a;
571 pauseScheduling();
572 for (const effect2 of dep.keys()) {
573 let tracking;
574 if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
575 effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
576 effect2._dirtyLevel = dirtyLevel;
577 }
578 if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
579 {
580 (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
581 }
582 effect2.trigger();
583 if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
584 effect2._shouldSchedule = false;
585 if (effect2.scheduler) {
586 queueEffectSchedulers.push(effect2.scheduler);
587 }
588 }
589 }
590 }
591 resetScheduling();
592}
593
594const createDep = (cleanup, computed) => {
595 const dep = /* @__PURE__ */ new Map();
596 dep.cleanup = cleanup;
597 dep.computed = computed;
598 return dep;
599};
600
601const targetMap = /* @__PURE__ */ new WeakMap();
602const ITERATE_KEY = Symbol("iterate" );
603const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" );
604function track(target, type, key) {
605 if (shouldTrack && activeEffect) {
606 let depsMap = targetMap.get(target);
607 if (!depsMap) {
608 targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
609 }
610 let dep = depsMap.get(key);
611 if (!dep) {
612 depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
613 }
614 trackEffect(
615 activeEffect,
616 dep,
617 {
618 target,
619 type,
620 key
621 }
622 );
623 }
624}
625function trigger(target, type, key, newValue, oldValue, oldTarget) {
626 const depsMap = targetMap.get(target);
627 if (!depsMap) {
628 return;
629 }
630 let deps = [];
631 if (type === "clear") {
632 deps = [...depsMap.values()];
633 } else if (key === "length" && isArray(target)) {
634 const newLength = Number(newValue);
635 depsMap.forEach((dep, key2) => {
636 if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
637 deps.push(dep);
638 }
639 });
640 } else {
641 if (key !== void 0) {
642 deps.push(depsMap.get(key));
643 }
644 switch (type) {
645 case "add":
646 if (!isArray(target)) {
647 deps.push(depsMap.get(ITERATE_KEY));
648 if (isMap(target)) {
649 deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
650 }
651 } else if (isIntegerKey(key)) {
652 deps.push(depsMap.get("length"));
653 }
654 break;
655 case "delete":
656 if (!isArray(target)) {
657 deps.push(depsMap.get(ITERATE_KEY));
658 if (isMap(target)) {
659 deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
660 }
661 }
662 break;
663 case "set":
664 if (isMap(target)) {
665 deps.push(depsMap.get(ITERATE_KEY));
666 }
667 break;
668 }
669 }
670 pauseScheduling();
671 for (const dep of deps) {
672 if (dep) {
673 triggerEffects(
674 dep,
675 4,
676 {
677 target,
678 type,
679 key,
680 newValue,
681 oldValue,
682 oldTarget
683 }
684 );
685 }
686 }
687 resetScheduling();
688}
689function getDepFromReactive(object, key) {
690 var _a;
691 return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
692}
693
694const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
695const builtInSymbols = new Set(
696 /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
697);
698const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
699function createArrayInstrumentations() {
700 const instrumentations = {};
701 ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
702 instrumentations[key] = function(...args) {
703 const arr = toRaw(this);
704 for (let i = 0, l = this.length; i < l; i++) {
705 track(arr, "get", i + "");
706 }
707 const res = arr[key](...args);
708 if (res === -1 || res === false) {
709 return arr[key](...args.map(toRaw));
710 } else {
711 return res;
712 }
713 };
714 });
715 ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
716 instrumentations[key] = function(...args) {
717 pauseTracking();
718 pauseScheduling();
719 const res = toRaw(this)[key].apply(this, args);
720 resetScheduling();
721 resetTracking();
722 return res;
723 };
724 });
725 return instrumentations;
726}
727function hasOwnProperty(key) {
728 const obj = toRaw(this);
729 track(obj, "has", key);
730 return obj.hasOwnProperty(key);
731}
732class BaseReactiveHandler {
733 constructor(_isReadonly = false, _isShallow = false) {
734 this._isReadonly = _isReadonly;
735 this._isShallow = _isShallow;
736 }
737 get(target, key, receiver) {
738 const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
739 if (key === "__v_isReactive") {
740 return !isReadonly2;
741 } else if (key === "__v_isReadonly") {
742 return isReadonly2;
743 } else if (key === "__v_isShallow") {
744 return isShallow2;
745 } else if (key === "__v_raw") {
746 if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
747 // this means the reciever is a user proxy of the reactive proxy
748 Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
749 return target;
750 }
751 return;
752 }
753 const targetIsArray = isArray(target);
754 if (!isReadonly2) {
755 if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
756 return Reflect.get(arrayInstrumentations, key, receiver);
757 }
758 if (key === "hasOwnProperty") {
759 return hasOwnProperty;
760 }
761 }
762 const res = Reflect.get(target, key, receiver);
763 if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
764 return res;
765 }
766 if (!isReadonly2) {
767 track(target, "get", key);
768 }
769 if (isShallow2) {
770 return res;
771 }
772 if (isRef(res)) {
773 return targetIsArray && isIntegerKey(key) ? res : res.value;
774 }
775 if (isObject(res)) {
776 return isReadonly2 ? readonly(res) : reactive(res);
777 }
778 return res;
779 }
780}
781class MutableReactiveHandler extends BaseReactiveHandler {
782 constructor(isShallow2 = false) {
783 super(false, isShallow2);
784 }
785 set(target, key, value, receiver) {
786 let oldValue = target[key];
787 if (!this._isShallow) {
788 const isOldValueReadonly = isReadonly(oldValue);
789 if (!isShallow(value) && !isReadonly(value)) {
790 oldValue = toRaw(oldValue);
791 value = toRaw(value);
792 }
793 if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
794 if (isOldValueReadonly) {
795 return false;
796 } else {
797 oldValue.value = value;
798 return true;
799 }
800 }
801 }
802 const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
803 const result = Reflect.set(target, key, value, receiver);
804 if (target === toRaw(receiver)) {
805 if (!hadKey) {
806 trigger(target, "add", key, value);
807 } else if (hasChanged(value, oldValue)) {
808 trigger(target, "set", key, value, oldValue);
809 }
810 }
811 return result;
812 }
813 deleteProperty(target, key) {
814 const hadKey = hasOwn(target, key);
815 const oldValue = target[key];
816 const result = Reflect.deleteProperty(target, key);
817 if (result && hadKey) {
818 trigger(target, "delete", key, void 0, oldValue);
819 }
820 return result;
821 }
822 has(target, key) {
823 const result = Reflect.has(target, key);
824 if (!isSymbol(key) || !builtInSymbols.has(key)) {
825 track(target, "has", key);
826 }
827 return result;
828 }
829 ownKeys(target) {
830 track(
831 target,
832 "iterate",
833 isArray(target) ? "length" : ITERATE_KEY
834 );
835 return Reflect.ownKeys(target);
836 }
837}
838class ReadonlyReactiveHandler extends BaseReactiveHandler {
839 constructor(isShallow2 = false) {
840 super(true, isShallow2);
841 }
842 set(target, key) {
843 {
844 warn$2(
845 `Set operation on key "${String(key)}" failed: target is readonly.`,
846 target
847 );
848 }
849 return true;
850 }
851 deleteProperty(target, key) {
852 {
853 warn$2(
854 `Delete operation on key "${String(key)}" failed: target is readonly.`,
855 target
856 );
857 }
858 return true;
859 }
860}
861const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
862const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
863const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
864 true
865);
866const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
867
868const toShallow = (value) => value;
869const getProto = (v) => Reflect.getPrototypeOf(v);
870function get(target, key, isReadonly = false, isShallow = false) {
871 target = target["__v_raw"];
872 const rawTarget = toRaw(target);
873 const rawKey = toRaw(key);
874 if (!isReadonly) {
875 if (hasChanged(key, rawKey)) {
876 track(rawTarget, "get", key);
877 }
878 track(rawTarget, "get", rawKey);
879 }
880 const { has: has2 } = getProto(rawTarget);
881 const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
882 if (has2.call(rawTarget, key)) {
883 return wrap(target.get(key));
884 } else if (has2.call(rawTarget, rawKey)) {
885 return wrap(target.get(rawKey));
886 } else if (target !== rawTarget) {
887 target.get(key);
888 }
889}
890function has(key, isReadonly = false) {
891 const target = this["__v_raw"];
892 const rawTarget = toRaw(target);
893 const rawKey = toRaw(key);
894 if (!isReadonly) {
895 if (hasChanged(key, rawKey)) {
896 track(rawTarget, "has", key);
897 }
898 track(rawTarget, "has", rawKey);
899 }
900 return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
901}
902function size(target, isReadonly = false) {
903 target = target["__v_raw"];
904 !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY);
905 return Reflect.get(target, "size", target);
906}
907function add(value) {
908 value = toRaw(value);
909 const target = toRaw(this);
910 const proto = getProto(target);
911 const hadKey = proto.has.call(target, value);
912 if (!hadKey) {
913 target.add(value);
914 trigger(target, "add", value, value);
915 }
916 return this;
917}
918function set(key, value) {
919 value = toRaw(value);
920 const target = toRaw(this);
921 const { has: has2, get: get2 } = getProto(target);
922 let hadKey = has2.call(target, key);
923 if (!hadKey) {
924 key = toRaw(key);
925 hadKey = has2.call(target, key);
926 } else {
927 checkIdentityKeys(target, has2, key);
928 }
929 const oldValue = get2.call(target, key);
930 target.set(key, value);
931 if (!hadKey) {
932 trigger(target, "add", key, value);
933 } else if (hasChanged(value, oldValue)) {
934 trigger(target, "set", key, value, oldValue);
935 }
936 return this;
937}
938function deleteEntry(key) {
939 const target = toRaw(this);
940 const { has: has2, get: get2 } = getProto(target);
941 let hadKey = has2.call(target, key);
942 if (!hadKey) {
943 key = toRaw(key);
944 hadKey = has2.call(target, key);
945 } else {
946 checkIdentityKeys(target, has2, key);
947 }
948 const oldValue = get2 ? get2.call(target, key) : void 0;
949 const result = target.delete(key);
950 if (hadKey) {
951 trigger(target, "delete", key, void 0, oldValue);
952 }
953 return result;
954}
955function clear() {
956 const target = toRaw(this);
957 const hadItems = target.size !== 0;
958 const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
959 const result = target.clear();
960 if (hadItems) {
961 trigger(target, "clear", void 0, void 0, oldTarget);
962 }
963 return result;
964}
965function createForEach(isReadonly, isShallow) {
966 return function forEach(callback, thisArg) {
967 const observed = this;
968 const target = observed["__v_raw"];
969 const rawTarget = toRaw(target);
970 const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
971 !isReadonly && track(rawTarget, "iterate", ITERATE_KEY);
972 return target.forEach((value, key) => {
973 return callback.call(thisArg, wrap(value), wrap(key), observed);
974 });
975 };
976}
977function createIterableMethod(method, isReadonly, isShallow) {
978 return function(...args) {
979 const target = this["__v_raw"];
980 const rawTarget = toRaw(target);
981 const targetIsMap = isMap(rawTarget);
982 const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
983 const isKeyOnly = method === "keys" && targetIsMap;
984 const innerIterator = target[method](...args);
985 const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;
986 !isReadonly && track(
987 rawTarget,
988 "iterate",
989 isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
990 );
991 return {
992 // iterator protocol
993 next() {
994 const { value, done } = innerIterator.next();
995 return done ? { value, done } : {
996 value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
997 done
998 };
999 },
1000 // iterable protocol
1001 [Symbol.iterator]() {
1002 return this;
1003 }
1004 };
1005 };
1006}
1007function createReadonlyMethod(type) {
1008 return function(...args) {
1009 {
1010 const key = args[0] ? `on key "${args[0]}" ` : ``;
1011 warn$2(
1012 `${capitalize(type)} operation ${key}failed: target is readonly.`,
1013 toRaw(this)
1014 );
1015 }
1016 return type === "delete" ? false : type === "clear" ? void 0 : this;
1017 };
1018}
1019function createInstrumentations() {
1020 const mutableInstrumentations2 = {
1021 get(key) {
1022 return get(this, key);
1023 },
1024 get size() {
1025 return size(this);
1026 },
1027 has,
1028 add,
1029 set,
1030 delete: deleteEntry,
1031 clear,
1032 forEach: createForEach(false, false)
1033 };
1034 const shallowInstrumentations2 = {
1035 get(key) {
1036 return get(this, key, false, true);
1037 },
1038 get size() {
1039 return size(this);
1040 },
1041 has,
1042 add,
1043 set,
1044 delete: deleteEntry,
1045 clear,
1046 forEach: createForEach(false, true)
1047 };
1048 const readonlyInstrumentations2 = {
1049 get(key) {
1050 return get(this, key, true);
1051 },
1052 get size() {
1053 return size(this, true);
1054 },
1055 has(key) {
1056 return has.call(this, key, true);
1057 },
1058 add: createReadonlyMethod("add"),
1059 set: createReadonlyMethod("set"),
1060 delete: createReadonlyMethod("delete"),
1061 clear: createReadonlyMethod("clear"),
1062 forEach: createForEach(true, false)
1063 };
1064 const shallowReadonlyInstrumentations2 = {
1065 get(key) {
1066 return get(this, key, true, true);
1067 },
1068 get size() {
1069 return size(this, true);
1070 },
1071 has(key) {
1072 return has.call(this, key, true);
1073 },
1074 add: createReadonlyMethod("add"),
1075 set: createReadonlyMethod("set"),
1076 delete: createReadonlyMethod("delete"),
1077 clear: createReadonlyMethod("clear"),
1078 forEach: createForEach(true, true)
1079 };
1080 const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
1081 iteratorMethods.forEach((method) => {
1082 mutableInstrumentations2[method] = createIterableMethod(
1083 method,
1084 false,
1085 false
1086 );
1087 readonlyInstrumentations2[method] = createIterableMethod(
1088 method,
1089 true,
1090 false
1091 );
1092 shallowInstrumentations2[method] = createIterableMethod(
1093 method,
1094 false,
1095 true
1096 );
1097 shallowReadonlyInstrumentations2[method] = createIterableMethod(
1098 method,
1099 true,
1100 true
1101 );
1102 });
1103 return [
1104 mutableInstrumentations2,
1105 readonlyInstrumentations2,
1106 shallowInstrumentations2,
1107 shallowReadonlyInstrumentations2
1108 ];
1109}
1110const [
1111 mutableInstrumentations,
1112 readonlyInstrumentations,
1113 shallowInstrumentations,
1114 shallowReadonlyInstrumentations
1115] = /* @__PURE__ */ createInstrumentations();
1116function createInstrumentationGetter(isReadonly, shallow) {
1117 const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations;
1118 return (target, key, receiver) => {
1119 if (key === "__v_isReactive") {
1120 return !isReadonly;
1121 } else if (key === "__v_isReadonly") {
1122 return isReadonly;
1123 } else if (key === "__v_raw") {
1124 return target;
1125 }
1126 return Reflect.get(
1127 hasOwn(instrumentations, key) && key in target ? instrumentations : target,
1128 key,
1129 receiver
1130 );
1131 };
1132}
1133const mutableCollectionHandlers = {
1134 get: /* @__PURE__ */ createInstrumentationGetter(false, false)
1135};
1136const shallowCollectionHandlers = {
1137 get: /* @__PURE__ */ createInstrumentationGetter(false, true)
1138};
1139const readonlyCollectionHandlers = {
1140 get: /* @__PURE__ */ createInstrumentationGetter(true, false)
1141};
1142const shallowReadonlyCollectionHandlers = {
1143 get: /* @__PURE__ */ createInstrumentationGetter(true, true)
1144};
1145function checkIdentityKeys(target, has2, key) {
1146 const rawKey = toRaw(key);
1147 if (rawKey !== key && has2.call(target, rawKey)) {
1148 const type = toRawType(target);
1149 warn$2(
1150 `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
1151 );
1152 }
1153}
1154
1155const reactiveMap = /* @__PURE__ */ new WeakMap();
1156const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
1157const readonlyMap = /* @__PURE__ */ new WeakMap();
1158const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
1159function targetTypeMap(rawType) {
1160 switch (rawType) {
1161 case "Object":
1162 case "Array":
1163 return 1 /* COMMON */;
1164 case "Map":
1165 case "Set":
1166 case "WeakMap":
1167 case "WeakSet":
1168 return 2 /* COLLECTION */;
1169 default:
1170 return 0 /* INVALID */;
1171 }
1172}
1173function getTargetType(value) {
1174 return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
1175}
1176function reactive(target) {
1177 if (isReadonly(target)) {
1178 return target;
1179 }
1180 return createReactiveObject(
1181 target,
1182 false,
1183 mutableHandlers,
1184 mutableCollectionHandlers,
1185 reactiveMap
1186 );
1187}
1188function shallowReactive(target) {
1189 return createReactiveObject(
1190 target,
1191 false,
1192 shallowReactiveHandlers,
1193 shallowCollectionHandlers,
1194 shallowReactiveMap
1195 );
1196}
1197function readonly(target) {
1198 return createReactiveObject(
1199 target,
1200 true,
1201 readonlyHandlers,
1202 readonlyCollectionHandlers,
1203 readonlyMap
1204 );
1205}
1206function shallowReadonly(target) {
1207 return createReactiveObject(
1208 target,
1209 true,
1210 shallowReadonlyHandlers,
1211 shallowReadonlyCollectionHandlers,
1212 shallowReadonlyMap
1213 );
1214}
1215function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
1216 if (!isObject(target)) {
1217 {
1218 warn$2(`value cannot be made reactive: ${String(target)}`);
1219 }
1220 return target;
1221 }
1222 if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1223 return target;
1224 }
1225 const existingProxy = proxyMap.get(target);
1226 if (existingProxy) {
1227 return existingProxy;
1228 }
1229 const targetType = getTargetType(target);
1230 if (targetType === 0 /* INVALID */) {
1231 return target;
1232 }
1233 const proxy = new Proxy(
1234 target,
1235 targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
1236 );
1237 proxyMap.set(target, proxy);
1238 return proxy;
1239}
1240function isReactive(value) {
1241 if (isReadonly(value)) {
1242 return isReactive(value["__v_raw"]);
1243 }
1244 return !!(value && value["__v_isReactive"]);
1245}
1246function isReadonly(value) {
1247 return !!(value && value["__v_isReadonly"]);
1248}
1249function isShallow(value) {
1250 return !!(value && value["__v_isShallow"]);
1251}
1252function isProxy(value) {
1253 return isReactive(value) || isReadonly(value);
1254}
1255function toRaw(observed) {
1256 const raw = observed && observed["__v_raw"];
1257 return raw ? toRaw(raw) : observed;
1258}
1259function markRaw(value) {
1260 if (Object.isExtensible(value)) {
1261 def(value, "__v_skip", true);
1262 }
1263 return value;
1264}
1265const toReactive = (value) => isObject(value) ? reactive(value) : value;
1266const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1267
1268const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
1269class ComputedRefImpl {
1270 constructor(getter, _setter, isReadonly, isSSR) {
1271 this.getter = getter;
1272 this._setter = _setter;
1273 this.dep = void 0;
1274 this.__v_isRef = true;
1275 this["__v_isReadonly"] = false;
1276 this.effect = new ReactiveEffect(
1277 () => getter(this._value),
1278 () => triggerRefValue(
1279 this,
1280 this.effect._dirtyLevel === 2 ? 2 : 3
1281 )
1282 );
1283 this.effect.computed = this;
1284 this.effect.active = this._cacheable = !isSSR;
1285 this["__v_isReadonly"] = isReadonly;
1286 }
1287 get value() {
1288 const self = toRaw(this);
1289 if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
1290 triggerRefValue(self, 4);
1291 }
1292 trackRefValue(self);
1293 if (self.effect._dirtyLevel >= 2) {
1294 if (this._warnRecursive) {
1295 warn$2(COMPUTED_SIDE_EFFECT_WARN, `
1296
1297getter: `, this.getter);
1298 }
1299 triggerRefValue(self, 2);
1300 }
1301 return self._value;
1302 }
1303 set value(newValue) {
1304 this._setter(newValue);
1305 }
1306 // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
1307 get _dirty() {
1308 return this.effect.dirty;
1309 }
1310 set _dirty(v) {
1311 this.effect.dirty = v;
1312 }
1313 // #endregion
1314}
1315function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1316 let getter;
1317 let setter;
1318 const onlyGetter = isFunction(getterOrOptions);
1319 if (onlyGetter) {
1320 getter = getterOrOptions;
1321 setter = () => {
1322 warn$2("Write operation failed: computed value is readonly");
1323 } ;
1324 } else {
1325 getter = getterOrOptions.get;
1326 setter = getterOrOptions.set;
1327 }
1328 const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
1329 if (debugOptions && !isSSR) {
1330 cRef.effect.onTrack = debugOptions.onTrack;
1331 cRef.effect.onTrigger = debugOptions.onTrigger;
1332 }
1333 return cRef;
1334}
1335
1336function trackRefValue(ref2) {
1337 var _a;
1338 if (shouldTrack && activeEffect) {
1339 ref2 = toRaw(ref2);
1340 trackEffect(
1341 activeEffect,
1342 (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
1343 () => ref2.dep = void 0,
1344 ref2 instanceof ComputedRefImpl ? ref2 : void 0
1345 ),
1346 {
1347 target: ref2,
1348 type: "get",
1349 key: "value"
1350 }
1351 );
1352 }
1353}
1354function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
1355 ref2 = toRaw(ref2);
1356 const dep = ref2.dep;
1357 if (dep) {
1358 triggerEffects(
1359 dep,
1360 dirtyLevel,
1361 {
1362 target: ref2,
1363 type: "set",
1364 key: "value",
1365 newValue: newVal
1366 }
1367 );
1368 }
1369}
1370function isRef(r) {
1371 return !!(r && r.__v_isRef === true);
1372}
1373function ref(value) {
1374 return createRef(value, false);
1375}
1376function shallowRef(value) {
1377 return createRef(value, true);
1378}
1379function createRef(rawValue, shallow) {
1380 if (isRef(rawValue)) {
1381 return rawValue;
1382 }
1383 return new RefImpl(rawValue, shallow);
1384}
1385class RefImpl {
1386 constructor(value, __v_isShallow) {
1387 this.__v_isShallow = __v_isShallow;
1388 this.dep = void 0;
1389 this.__v_isRef = true;
1390 this._rawValue = __v_isShallow ? value : toRaw(value);
1391 this._value = __v_isShallow ? value : toReactive(value);
1392 }
1393 get value() {
1394 trackRefValue(this);
1395 return this._value;
1396 }
1397 set value(newVal) {
1398 const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
1399 newVal = useDirectValue ? newVal : toRaw(newVal);
1400 if (hasChanged(newVal, this._rawValue)) {
1401 this._rawValue = newVal;
1402 this._value = useDirectValue ? newVal : toReactive(newVal);
1403 triggerRefValue(this, 4, newVal);
1404 }
1405 }
1406}
1407function triggerRef(ref2) {
1408 triggerRefValue(ref2, 4, ref2.value );
1409}
1410function unref(ref2) {
1411 return isRef(ref2) ? ref2.value : ref2;
1412}
1413function toValue(source) {
1414 return isFunction(source) ? source() : unref(source);
1415}
1416const shallowUnwrapHandlers = {
1417 get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
1418 set: (target, key, value, receiver) => {
1419 const oldValue = target[key];
1420 if (isRef(oldValue) && !isRef(value)) {
1421 oldValue.value = value;
1422 return true;
1423 } else {
1424 return Reflect.set(target, key, value, receiver);
1425 }
1426 }
1427};
1428function proxyRefs(objectWithRefs) {
1429 return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
1430}
1431class CustomRefImpl {
1432 constructor(factory) {
1433 this.dep = void 0;
1434 this.__v_isRef = true;
1435 const { get, set } = factory(
1436 () => trackRefValue(this),
1437 () => triggerRefValue(this)
1438 );
1439 this._get = get;
1440 this._set = set;
1441 }
1442 get value() {
1443 return this._get();
1444 }
1445 set value(newVal) {
1446 this._set(newVal);
1447 }
1448}
1449function customRef(factory) {
1450 return new CustomRefImpl(factory);
1451}
1452function toRefs(object) {
1453 if (!isProxy(object)) {
1454 warn$2(`toRefs() expects a reactive object but received a plain one.`);
1455 }
1456 const ret = isArray(object) ? new Array(object.length) : {};
1457 for (const key in object) {
1458 ret[key] = propertyToRef(object, key);
1459 }
1460 return ret;
1461}
1462class ObjectRefImpl {
1463 constructor(_object, _key, _defaultValue) {
1464 this._object = _object;
1465 this._key = _key;
1466 this._defaultValue = _defaultValue;
1467 this.__v_isRef = true;
1468 }
1469 get value() {
1470 const val = this._object[this._key];
1471 return val === void 0 ? this._defaultValue : val;
1472 }
1473 set value(newVal) {
1474 this._object[this._key] = newVal;
1475 }
1476 get dep() {
1477 return getDepFromReactive(toRaw(this._object), this._key);
1478 }
1479}
1480class GetterRefImpl {
1481 constructor(_getter) {
1482 this._getter = _getter;
1483 this.__v_isRef = true;
1484 this.__v_isReadonly = true;
1485 }
1486 get value() {
1487 return this._getter();
1488 }
1489}
1490function toRef(source, key, defaultValue) {
1491 if (isRef(source)) {
1492 return source;
1493 } else if (isFunction(source)) {
1494 return new GetterRefImpl(source);
1495 } else if (isObject(source) && arguments.length > 1) {
1496 return propertyToRef(source, key, defaultValue);
1497 } else {
1498 return ref(source);
1499 }
1500}
1501function propertyToRef(source, key, defaultValue) {
1502 const val = source[key];
1503 return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1504}
1505
1506const TrackOpTypes = {
1507 "GET": "get",
1508 "HAS": "has",
1509 "ITERATE": "iterate"
1510};
1511const TriggerOpTypes = {
1512 "SET": "set",
1513 "ADD": "add",
1514 "DELETE": "delete",
1515 "CLEAR": "clear"
1516};
1517
1518const stack = [];
1519function pushWarningContext(vnode) {
1520 stack.push(vnode);
1521}
1522function popWarningContext() {
1523 stack.pop();
1524}
1525function warn$1(msg, ...args) {
1526 pauseTracking();
1527 const instance = stack.length ? stack[stack.length - 1].component : null;
1528 const appWarnHandler = instance && instance.appContext.config.warnHandler;
1529 const trace = getComponentTrace();
1530 if (appWarnHandler) {
1531 callWithErrorHandling(
1532 appWarnHandler,
1533 instance,
1534 11,
1535 [
1536 msg + args.map((a) => {
1537 var _a, _b;
1538 return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
1539 }).join(""),
1540 instance && instance.proxy,
1541 trace.map(
1542 ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
1543 ).join("\n"),
1544 trace
1545 ]
1546 );
1547 } else {
1548 const warnArgs = [`[Vue warn]: ${msg}`, ...args];
1549 if (trace.length && // avoid spamming console during tests
1550 true) {
1551 warnArgs.push(`
1552`, ...formatTrace(trace));
1553 }
1554 console.warn(...warnArgs);
1555 }
1556 resetTracking();
1557}
1558function getComponentTrace() {
1559 let currentVNode = stack[stack.length - 1];
1560 if (!currentVNode) {
1561 return [];
1562 }
1563 const normalizedStack = [];
1564 while (currentVNode) {
1565 const last = normalizedStack[0];
1566 if (last && last.vnode === currentVNode) {
1567 last.recurseCount++;
1568 } else {
1569 normalizedStack.push({
1570 vnode: currentVNode,
1571 recurseCount: 0
1572 });
1573 }
1574 const parentInstance = currentVNode.component && currentVNode.component.parent;
1575 currentVNode = parentInstance && parentInstance.vnode;
1576 }
1577 return normalizedStack;
1578}
1579function formatTrace(trace) {
1580 const logs = [];
1581 trace.forEach((entry, i) => {
1582 logs.push(...i === 0 ? [] : [`
1583`], ...formatTraceEntry(entry));
1584 });
1585 return logs;
1586}
1587function formatTraceEntry({ vnode, recurseCount }) {
1588 const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
1589 const isRoot = vnode.component ? vnode.component.parent == null : false;
1590 const open = ` at <${formatComponentName(
1591 vnode.component,
1592 vnode.type,
1593 isRoot
1594 )}`;
1595 const close = `>` + postfix;
1596 return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
1597}
1598function formatProps(props) {
1599 const res = [];
1600 const keys = Object.keys(props);
1601 keys.slice(0, 3).forEach((key) => {
1602 res.push(...formatProp(key, props[key]));
1603 });
1604 if (keys.length > 3) {
1605 res.push(` ...`);
1606 }
1607 return res;
1608}
1609function formatProp(key, value, raw) {
1610 if (isString(value)) {
1611 value = JSON.stringify(value);
1612 return raw ? value : [`${key}=${value}`];
1613 } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
1614 return raw ? value : [`${key}=${value}`];
1615 } else if (isRef(value)) {
1616 value = formatProp(key, toRaw(value.value), true);
1617 return raw ? value : [`${key}=Ref<`, value, `>`];
1618 } else if (isFunction(value)) {
1619 return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
1620 } else {
1621 value = toRaw(value);
1622 return raw ? value : [`${key}=`, value];
1623 }
1624}
1625function assertNumber(val, type) {
1626 if (val === void 0) {
1627 return;
1628 } else if (typeof val !== "number") {
1629 warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
1630 } else if (isNaN(val)) {
1631 warn$1(`${type} is NaN - the duration expression might be incorrect.`);
1632 }
1633}
1634
1635const ErrorCodes = {
1636 "SETUP_FUNCTION": 0,
1637 "0": "SETUP_FUNCTION",
1638 "RENDER_FUNCTION": 1,
1639 "1": "RENDER_FUNCTION",
1640 "WATCH_GETTER": 2,
1641 "2": "WATCH_GETTER",
1642 "WATCH_CALLBACK": 3,
1643 "3": "WATCH_CALLBACK",
1644 "WATCH_CLEANUP": 4,
1645 "4": "WATCH_CLEANUP",
1646 "NATIVE_EVENT_HANDLER": 5,
1647 "5": "NATIVE_EVENT_HANDLER",
1648 "COMPONENT_EVENT_HANDLER": 6,
1649 "6": "COMPONENT_EVENT_HANDLER",
1650 "VNODE_HOOK": 7,
1651 "7": "VNODE_HOOK",
1652 "DIRECTIVE_HOOK": 8,
1653 "8": "DIRECTIVE_HOOK",
1654 "TRANSITION_HOOK": 9,
1655 "9": "TRANSITION_HOOK",
1656 "APP_ERROR_HANDLER": 10,
1657 "10": "APP_ERROR_HANDLER",
1658 "APP_WARN_HANDLER": 11,
1659 "11": "APP_WARN_HANDLER",
1660 "FUNCTION_REF": 12,
1661 "12": "FUNCTION_REF",
1662 "ASYNC_COMPONENT_LOADER": 13,
1663 "13": "ASYNC_COMPONENT_LOADER",
1664 "SCHEDULER": 14,
1665 "14": "SCHEDULER"
1666};
1667const ErrorTypeStrings$1 = {
1668 ["sp"]: "serverPrefetch hook",
1669 ["bc"]: "beforeCreate hook",
1670 ["c"]: "created hook",
1671 ["bm"]: "beforeMount hook",
1672 ["m"]: "mounted hook",
1673 ["bu"]: "beforeUpdate hook",
1674 ["u"]: "updated",
1675 ["bum"]: "beforeUnmount hook",
1676 ["um"]: "unmounted hook",
1677 ["a"]: "activated hook",
1678 ["da"]: "deactivated hook",
1679 ["ec"]: "errorCaptured hook",
1680 ["rtc"]: "renderTracked hook",
1681 ["rtg"]: "renderTriggered hook",
1682 [0]: "setup function",
1683 [1]: "render function",
1684 [2]: "watcher getter",
1685 [3]: "watcher callback",
1686 [4]: "watcher cleanup function",
1687 [5]: "native event handler",
1688 [6]: "component event handler",
1689 [7]: "vnode hook",
1690 [8]: "directive hook",
1691 [9]: "transition hook",
1692 [10]: "app errorHandler",
1693 [11]: "app warnHandler",
1694 [12]: "ref function",
1695 [13]: "async component loader",
1696 [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
1697};
1698function callWithErrorHandling(fn, instance, type, args) {
1699 try {
1700 return args ? fn(...args) : fn();
1701 } catch (err) {
1702 handleError(err, instance, type);
1703 }
1704}
1705function callWithAsyncErrorHandling(fn, instance, type, args) {
1706 if (isFunction(fn)) {
1707 const res = callWithErrorHandling(fn, instance, type, args);
1708 if (res && isPromise(res)) {
1709 res.catch((err) => {
1710 handleError(err, instance, type);
1711 });
1712 }
1713 return res;
1714 }
1715 const values = [];
1716 for (let i = 0; i < fn.length; i++) {
1717 values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1718 }
1719 return values;
1720}
1721function handleError(err, instance, type, throwInDev = true) {
1722 const contextVNode = instance ? instance.vnode : null;
1723 if (instance) {
1724 let cur = instance.parent;
1725 const exposedInstance = instance.proxy;
1726 const errorInfo = ErrorTypeStrings$1[type] ;
1727 while (cur) {
1728 const errorCapturedHooks = cur.ec;
1729 if (errorCapturedHooks) {
1730 for (let i = 0; i < errorCapturedHooks.length; i++) {
1731 if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
1732 return;
1733 }
1734 }
1735 }
1736 cur = cur.parent;
1737 }
1738 const appErrorHandler = instance.appContext.config.errorHandler;
1739 if (appErrorHandler) {
1740 callWithErrorHandling(
1741 appErrorHandler,
1742 null,
1743 10,
1744 [err, exposedInstance, errorInfo]
1745 );
1746 return;
1747 }
1748 }
1749 logError(err, type, contextVNode, throwInDev);
1750}
1751function logError(err, type, contextVNode, throwInDev = true) {
1752 {
1753 const info = ErrorTypeStrings$1[type];
1754 if (contextVNode) {
1755 pushWarningContext(contextVNode);
1756 }
1757 warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
1758 if (contextVNode) {
1759 popWarningContext();
1760 }
1761 if (throwInDev) {
1762 throw err;
1763 } else {
1764 console.error(err);
1765 }
1766 }
1767}
1768
1769let isFlushing = false;
1770let isFlushPending = false;
1771const queue = [];
1772let flushIndex = 0;
1773const pendingPostFlushCbs = [];
1774let activePostFlushCbs = null;
1775let postFlushIndex = 0;
1776const resolvedPromise = /* @__PURE__ */ Promise.resolve();
1777let currentFlushPromise = null;
1778const RECURSION_LIMIT = 100;
1779function nextTick(fn) {
1780 const p = currentFlushPromise || resolvedPromise;
1781 return fn ? p.then(this ? fn.bind(this) : fn) : p;
1782}
1783function findInsertionIndex(id) {
1784 let start = flushIndex + 1;
1785 let end = queue.length;
1786 while (start < end) {
1787 const middle = start + end >>> 1;
1788 const middleJob = queue[middle];
1789 const middleJobId = getId(middleJob);
1790 if (middleJobId < id || middleJobId === id && middleJob.pre) {
1791 start = middle + 1;
1792 } else {
1793 end = middle;
1794 }
1795 }
1796 return start;
1797}
1798function queueJob(job) {
1799 if (!queue.length || !queue.includes(
1800 job,
1801 isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
1802 )) {
1803 if (job.id == null) {
1804 queue.push(job);
1805 } else {
1806 queue.splice(findInsertionIndex(job.id), 0, job);
1807 }
1808 queueFlush();
1809 }
1810}
1811function queueFlush() {
1812 if (!isFlushing && !isFlushPending) {
1813 isFlushPending = true;
1814 currentFlushPromise = resolvedPromise.then(flushJobs);
1815 }
1816}
1817function invalidateJob(job) {
1818 const i = queue.indexOf(job);
1819 if (i > flushIndex) {
1820 queue.splice(i, 1);
1821 }
1822}
1823function queuePostFlushCb(cb) {
1824 if (!isArray(cb)) {
1825 if (!activePostFlushCbs || !activePostFlushCbs.includes(
1826 cb,
1827 cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
1828 )) {
1829 pendingPostFlushCbs.push(cb);
1830 }
1831 } else {
1832 pendingPostFlushCbs.push(...cb);
1833 }
1834 queueFlush();
1835}
1836function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1837 {
1838 seen = seen || /* @__PURE__ */ new Map();
1839 }
1840 for (; i < queue.length; i++) {
1841 const cb = queue[i];
1842 if (cb && cb.pre) {
1843 if (instance && cb.id !== instance.uid) {
1844 continue;
1845 }
1846 if (checkRecursiveUpdates(seen, cb)) {
1847 continue;
1848 }
1849 queue.splice(i, 1);
1850 i--;
1851 cb();
1852 }
1853 }
1854}
1855function flushPostFlushCbs(seen) {
1856 if (pendingPostFlushCbs.length) {
1857 const deduped = [...new Set(pendingPostFlushCbs)].sort(
1858 (a, b) => getId(a) - getId(b)
1859 );
1860 pendingPostFlushCbs.length = 0;
1861 if (activePostFlushCbs) {
1862 activePostFlushCbs.push(...deduped);
1863 return;
1864 }
1865 activePostFlushCbs = deduped;
1866 {
1867 seen = seen || /* @__PURE__ */ new Map();
1868 }
1869 for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
1870 if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
1871 continue;
1872 }
1873 activePostFlushCbs[postFlushIndex]();
1874 }
1875 activePostFlushCbs = null;
1876 postFlushIndex = 0;
1877 }
1878}
1879const getId = (job) => job.id == null ? Infinity : job.id;
1880const comparator = (a, b) => {
1881 const diff = getId(a) - getId(b);
1882 if (diff === 0) {
1883 if (a.pre && !b.pre)
1884 return -1;
1885 if (b.pre && !a.pre)
1886 return 1;
1887 }
1888 return diff;
1889};
1890function flushJobs(seen) {
1891 isFlushPending = false;
1892 isFlushing = true;
1893 {
1894 seen = seen || /* @__PURE__ */ new Map();
1895 }
1896 queue.sort(comparator);
1897 const check = (job) => checkRecursiveUpdates(seen, job) ;
1898 try {
1899 for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
1900 const job = queue[flushIndex];
1901 if (job && job.active !== false) {
1902 if (check(job)) {
1903 continue;
1904 }
1905 callWithErrorHandling(job, null, 14);
1906 }
1907 }
1908 } finally {
1909 flushIndex = 0;
1910 queue.length = 0;
1911 flushPostFlushCbs(seen);
1912 isFlushing = false;
1913 currentFlushPromise = null;
1914 if (queue.length || pendingPostFlushCbs.length) {
1915 flushJobs(seen);
1916 }
1917 }
1918}
1919function checkRecursiveUpdates(seen, fn) {
1920 if (!seen.has(fn)) {
1921 seen.set(fn, 1);
1922 } else {
1923 const count = seen.get(fn);
1924 if (count > RECURSION_LIMIT) {
1925 const instance = fn.ownerInstance;
1926 const componentName = instance && getComponentName(instance.type);
1927 handleError(
1928 `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
1929 null,
1930 10
1931 );
1932 return true;
1933 } else {
1934 seen.set(fn, count + 1);
1935 }
1936 }
1937}
1938
1939let isHmrUpdating = false;
1940const hmrDirtyComponents = /* @__PURE__ */ new Set();
1941{
1942 getGlobalThis().__VUE_HMR_RUNTIME__ = {
1943 createRecord: tryWrap(createRecord),
1944 rerender: tryWrap(rerender),
1945 reload: tryWrap(reload)
1946 };
1947}
1948const map = /* @__PURE__ */ new Map();
1949function registerHMR(instance) {
1950 const id = instance.type.__hmrId;
1951 let record = map.get(id);
1952 if (!record) {
1953 createRecord(id, instance.type);
1954 record = map.get(id);
1955 }
1956 record.instances.add(instance);
1957}
1958function unregisterHMR(instance) {
1959 map.get(instance.type.__hmrId).instances.delete(instance);
1960}
1961function createRecord(id, initialDef) {
1962 if (map.has(id)) {
1963 return false;
1964 }
1965 map.set(id, {
1966 initialDef: normalizeClassComponent(initialDef),
1967 instances: /* @__PURE__ */ new Set()
1968 });
1969 return true;
1970}
1971function normalizeClassComponent(component) {
1972 return isClassComponent(component) ? component.__vccOpts : component;
1973}
1974function rerender(id, newRender) {
1975 const record = map.get(id);
1976 if (!record) {
1977 return;
1978 }
1979 record.initialDef.render = newRender;
1980 [...record.instances].forEach((instance) => {
1981 if (newRender) {
1982 instance.render = newRender;
1983 normalizeClassComponent(instance.type).render = newRender;
1984 }
1985 instance.renderCache = [];
1986 isHmrUpdating = true;
1987 instance.effect.dirty = true;
1988 instance.update();
1989 isHmrUpdating = false;
1990 });
1991}
1992function reload(id, newComp) {
1993 const record = map.get(id);
1994 if (!record)
1995 return;
1996 newComp = normalizeClassComponent(newComp);
1997 updateComponentDef(record.initialDef, newComp);
1998 const instances = [...record.instances];
1999 for (const instance of instances) {
2000 const oldComp = normalizeClassComponent(instance.type);
2001 if (!hmrDirtyComponents.has(oldComp)) {
2002 if (oldComp !== record.initialDef) {
2003 updateComponentDef(oldComp, newComp);
2004 }
2005 hmrDirtyComponents.add(oldComp);
2006 }
2007 instance.appContext.propsCache.delete(instance.type);
2008 instance.appContext.emitsCache.delete(instance.type);
2009 instance.appContext.optionsCache.delete(instance.type);
2010 if (instance.ceReload) {
2011 hmrDirtyComponents.add(oldComp);
2012 instance.ceReload(newComp.styles);
2013 hmrDirtyComponents.delete(oldComp);
2014 } else if (instance.parent) {
2015 instance.parent.effect.dirty = true;
2016 queueJob(instance.parent.update);
2017 } else if (instance.appContext.reload) {
2018 instance.appContext.reload();
2019 } else if (typeof window !== "undefined") {
2020 window.location.reload();
2021 } else {
2022 console.warn(
2023 "[HMR] Root or manually mounted instance modified. Full reload required."
2024 );
2025 }
2026 }
2027 queuePostFlushCb(() => {
2028 for (const instance of instances) {
2029 hmrDirtyComponents.delete(
2030 normalizeClassComponent(instance.type)
2031 );
2032 }
2033 });
2034}
2035function updateComponentDef(oldComp, newComp) {
2036 extend(oldComp, newComp);
2037 for (const key in oldComp) {
2038 if (key !== "__file" && !(key in newComp)) {
2039 delete oldComp[key];
2040 }
2041 }
2042}
2043function tryWrap(fn) {
2044 return (id, arg) => {
2045 try {
2046 return fn(id, arg);
2047 } catch (e) {
2048 console.error(e);
2049 console.warn(
2050 `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
2051 );
2052 }
2053 };
2054}
2055
2056let devtools$1;
2057let buffer = [];
2058let devtoolsNotInstalled = false;
2059function emit$1(event, ...args) {
2060 if (devtools$1) {
2061 devtools$1.emit(event, ...args);
2062 } else if (!devtoolsNotInstalled) {
2063 buffer.push({ event, args });
2064 }
2065}
2066function setDevtoolsHook$1(hook, target) {
2067 var _a, _b;
2068 devtools$1 = hook;
2069 if (devtools$1) {
2070 devtools$1.enabled = true;
2071 buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
2072 buffer = [];
2073 } else if (
2074 // handle late devtools injection - only do this if we are in an actual
2075 // browser environment to avoid the timer handle stalling test runner exit
2076 // (#4815)
2077 typeof window !== "undefined" && // some envs mock window but not fully
2078 window.HTMLElement && // also exclude jsdom
2079 !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
2080 ) {
2081 const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
2082 replay.push((newHook) => {
2083 setDevtoolsHook$1(newHook, target);
2084 });
2085 setTimeout(() => {
2086 if (!devtools$1) {
2087 target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
2088 devtoolsNotInstalled = true;
2089 buffer = [];
2090 }
2091 }, 3e3);
2092 } else {
2093 devtoolsNotInstalled = true;
2094 buffer = [];
2095 }
2096}
2097function devtoolsInitApp(app, version) {
2098 emit$1("app:init" /* APP_INIT */, app, version, {
2099 Fragment,
2100 Text,
2101 Comment,
2102 Static
2103 });
2104}
2105function devtoolsUnmountApp(app) {
2106 emit$1("app:unmount" /* APP_UNMOUNT */, app);
2107}
2108const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
2109 "component:added" /* COMPONENT_ADDED */
2110);
2111const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
2112const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
2113 "component:removed" /* COMPONENT_REMOVED */
2114);
2115const devtoolsComponentRemoved = (component) => {
2116 if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
2117 !devtools$1.cleanupBuffer(component)) {
2118 _devtoolsComponentRemoved(component);
2119 }
2120};
2121function createDevtoolsComponentHook(hook) {
2122 return (component) => {
2123 emit$1(
2124 hook,
2125 component.appContext.app,
2126 component.uid,
2127 component.parent ? component.parent.uid : void 0,
2128 component
2129 );
2130 };
2131}
2132const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
2133 "perf:start" /* PERFORMANCE_START */
2134);
2135const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
2136 "perf:end" /* PERFORMANCE_END */
2137);
2138function createDevtoolsPerformanceHook(hook) {
2139 return (component, type, time) => {
2140 emit$1(hook, component.appContext.app, component.uid, component, type, time);
2141 };
2142}
2143function devtoolsComponentEmit(component, event, params) {
2144 emit$1(
2145 "component:emit" /* COMPONENT_EMIT */,
2146 component.appContext.app,
2147 component,
2148 event,
2149 params
2150 );
2151}
2152
2153function emit(instance, event, ...rawArgs) {
2154 if (instance.isUnmounted)
2155 return;
2156 const props = instance.vnode.props || EMPTY_OBJ;
2157 {
2158 const {
2159 emitsOptions,
2160 propsOptions: [propsOptions]
2161 } = instance;
2162 if (emitsOptions) {
2163 if (!(event in emitsOptions) && true) {
2164 if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
2165 warn$1(
2166 `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
2167 );
2168 }
2169 } else {
2170 const validator = emitsOptions[event];
2171 if (isFunction(validator)) {
2172 const isValid = validator(...rawArgs);
2173 if (!isValid) {
2174 warn$1(
2175 `Invalid event arguments: event validation failed for event "${event}".`
2176 );
2177 }
2178 }
2179 }
2180 }
2181 }
2182 let args = rawArgs;
2183 const isModelListener = event.startsWith("update:");
2184 const modelArg = isModelListener && event.slice(7);
2185 if (modelArg && modelArg in props) {
2186 const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
2187 const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
2188 if (trim) {
2189 args = rawArgs.map((a) => isString(a) ? a.trim() : a);
2190 }
2191 if (number) {
2192 args = rawArgs.map(looseToNumber);
2193 }
2194 }
2195 {
2196 devtoolsComponentEmit(instance, event, args);
2197 }
2198 {
2199 const lowerCaseEvent = event.toLowerCase();
2200 if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
2201 warn$1(
2202 `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
2203 instance,
2204 instance.type
2205 )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
2206 event
2207 )}" instead of "${event}".`
2208 );
2209 }
2210 }
2211 let handlerName;
2212 let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
2213 props[handlerName = toHandlerKey(camelize(event))];
2214 if (!handler && isModelListener) {
2215 handler = props[handlerName = toHandlerKey(hyphenate(event))];
2216 }
2217 if (handler) {
2218 callWithAsyncErrorHandling(
2219 handler,
2220 instance,
2221 6,
2222 args
2223 );
2224 }
2225 const onceHandler = props[handlerName + `Once`];
2226 if (onceHandler) {
2227 if (!instance.emitted) {
2228 instance.emitted = {};
2229 } else if (instance.emitted[handlerName]) {
2230 return;
2231 }
2232 instance.emitted[handlerName] = true;
2233 callWithAsyncErrorHandling(
2234 onceHandler,
2235 instance,
2236 6,
2237 args
2238 );
2239 }
2240}
2241function normalizeEmitsOptions(comp, appContext, asMixin = false) {
2242 const cache = appContext.emitsCache;
2243 const cached = cache.get(comp);
2244 if (cached !== void 0) {
2245 return cached;
2246 }
2247 const raw = comp.emits;
2248 let normalized = {};
2249 let hasExtends = false;
2250 if (!isFunction(comp)) {
2251 const extendEmits = (raw2) => {
2252 const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
2253 if (normalizedFromExtend) {
2254 hasExtends = true;
2255 extend(normalized, normalizedFromExtend);
2256 }
2257 };
2258 if (!asMixin && appContext.mixins.length) {
2259 appContext.mixins.forEach(extendEmits);
2260 }
2261 if (comp.extends) {
2262 extendEmits(comp.extends);
2263 }
2264 if (comp.mixins) {
2265 comp.mixins.forEach(extendEmits);
2266 }
2267 }
2268 if (!raw && !hasExtends) {
2269 if (isObject(comp)) {
2270 cache.set(comp, null);
2271 }
2272 return null;
2273 }
2274 if (isArray(raw)) {
2275 raw.forEach((key) => normalized[key] = null);
2276 } else {
2277 extend(normalized, raw);
2278 }
2279 if (isObject(comp)) {
2280 cache.set(comp, normalized);
2281 }
2282 return normalized;
2283}
2284function isEmitListener(options, key) {
2285 if (!options || !isOn(key)) {
2286 return false;
2287 }
2288 key = key.slice(2).replace(/Once$/, "");
2289 return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
2290}
2291
2292let currentRenderingInstance = null;
2293let currentScopeId = null;
2294function setCurrentRenderingInstance(instance) {
2295 const prev = currentRenderingInstance;
2296 currentRenderingInstance = instance;
2297 currentScopeId = instance && instance.type.__scopeId || null;
2298 return prev;
2299}
2300function pushScopeId(id) {
2301 currentScopeId = id;
2302}
2303function popScopeId() {
2304 currentScopeId = null;
2305}
2306const withScopeId = (_id) => withCtx;
2307function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
2308 if (!ctx)
2309 return fn;
2310 if (fn._n) {
2311 return fn;
2312 }
2313 const renderFnWithContext = (...args) => {
2314 if (renderFnWithContext._d) {
2315 setBlockTracking(-1);
2316 }
2317 const prevInstance = setCurrentRenderingInstance(ctx);
2318 let res;
2319 try {
2320 res = fn(...args);
2321 } finally {
2322 setCurrentRenderingInstance(prevInstance);
2323 if (renderFnWithContext._d) {
2324 setBlockTracking(1);
2325 }
2326 }
2327 {
2328 devtoolsComponentUpdated(ctx);
2329 }
2330 return res;
2331 };
2332 renderFnWithContext._n = true;
2333 renderFnWithContext._c = true;
2334 renderFnWithContext._d = true;
2335 return renderFnWithContext;
2336}
2337
2338let accessedAttrs = false;
2339function markAttrsAccessed() {
2340 accessedAttrs = true;
2341}
2342function renderComponentRoot(instance) {
2343 const {
2344 type: Component,
2345 vnode,
2346 proxy,
2347 withProxy,
2348 props,
2349 propsOptions: [propsOptions],
2350 slots,
2351 attrs,
2352 emit,
2353 render,
2354 renderCache,
2355 data,
2356 setupState,
2357 ctx,
2358 inheritAttrs
2359 } = instance;
2360 let result;
2361 let fallthroughAttrs;
2362 const prev = setCurrentRenderingInstance(instance);
2363 {
2364 accessedAttrs = false;
2365 }
2366 try {
2367 if (vnode.shapeFlag & 4) {
2368 const proxyToUse = withProxy || proxy;
2369 const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
2370 get(target, key, receiver) {
2371 warn$1(
2372 `Property '${String(
2373 key
2374 )}' was accessed via 'this'. Avoid using 'this' in templates.`
2375 );
2376 return Reflect.get(target, key, receiver);
2377 }
2378 }) : proxyToUse;
2379 result = normalizeVNode(
2380 render.call(
2381 thisProxy,
2382 proxyToUse,
2383 renderCache,
2384 props,
2385 setupState,
2386 data,
2387 ctx
2388 )
2389 );
2390 fallthroughAttrs = attrs;
2391 } else {
2392 const render2 = Component;
2393 if (attrs === props) {
2394 markAttrsAccessed();
2395 }
2396 result = normalizeVNode(
2397 render2.length > 1 ? render2(
2398 props,
2399 true ? {
2400 get attrs() {
2401 markAttrsAccessed();
2402 return attrs;
2403 },
2404 slots,
2405 emit
2406 } : { attrs, slots, emit }
2407 ) : render2(
2408 props,
2409 null
2410 /* we know it doesn't need it */
2411 )
2412 );
2413 fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
2414 }
2415 } catch (err) {
2416 blockStack.length = 0;
2417 handleError(err, instance, 1);
2418 result = createVNode(Comment);
2419 }
2420 let root = result;
2421 let setRoot = void 0;
2422 if (result.patchFlag > 0 && result.patchFlag & 2048) {
2423 [root, setRoot] = getChildRoot(result);
2424 }
2425 if (fallthroughAttrs && inheritAttrs !== false) {
2426 const keys = Object.keys(fallthroughAttrs);
2427 const { shapeFlag } = root;
2428 if (keys.length) {
2429 if (shapeFlag & (1 | 6)) {
2430 if (propsOptions && keys.some(isModelListener)) {
2431 fallthroughAttrs = filterModelListeners(
2432 fallthroughAttrs,
2433 propsOptions
2434 );
2435 }
2436 root = cloneVNode(root, fallthroughAttrs);
2437 } else if (!accessedAttrs && root.type !== Comment) {
2438 const allAttrs = Object.keys(attrs);
2439 const eventAttrs = [];
2440 const extraAttrs = [];
2441 for (let i = 0, l = allAttrs.length; i < l; i++) {
2442 const key = allAttrs[i];
2443 if (isOn(key)) {
2444 if (!isModelListener(key)) {
2445 eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2446 }
2447 } else {
2448 extraAttrs.push(key);
2449 }
2450 }
2451 if (extraAttrs.length) {
2452 warn$1(
2453 `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
2454 );
2455 }
2456 if (eventAttrs.length) {
2457 warn$1(
2458 `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
2459 );
2460 }
2461 }
2462 }
2463 }
2464 if (vnode.dirs) {
2465 if (!isElementRoot(root)) {
2466 warn$1(
2467 `Runtime directive used on component with non-element root node. The directives will not function as intended.`
2468 );
2469 }
2470 root = cloneVNode(root);
2471 root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2472 }
2473 if (vnode.transition) {
2474 if (!isElementRoot(root)) {
2475 warn$1(
2476 `Component inside <Transition> renders non-element root node that cannot be animated.`
2477 );
2478 }
2479 root.transition = vnode.transition;
2480 }
2481 if (setRoot) {
2482 setRoot(root);
2483 } else {
2484 result = root;
2485 }
2486 setCurrentRenderingInstance(prev);
2487 return result;
2488}
2489const getChildRoot = (vnode) => {
2490 const rawChildren = vnode.children;
2491 const dynamicChildren = vnode.dynamicChildren;
2492 const childRoot = filterSingleRoot(rawChildren, false);
2493 if (!childRoot) {
2494 return [vnode, void 0];
2495 } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
2496 return getChildRoot(childRoot);
2497 }
2498 const index = rawChildren.indexOf(childRoot);
2499 const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
2500 const setRoot = (updatedRoot) => {
2501 rawChildren[index] = updatedRoot;
2502 if (dynamicChildren) {
2503 if (dynamicIndex > -1) {
2504 dynamicChildren[dynamicIndex] = updatedRoot;
2505 } else if (updatedRoot.patchFlag > 0) {
2506 vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
2507 }
2508 }
2509 };
2510 return [normalizeVNode(childRoot), setRoot];
2511};
2512function filterSingleRoot(children, recurse = true) {
2513 let singleRoot;
2514 for (let i = 0; i < children.length; i++) {
2515 const child = children[i];
2516 if (isVNode(child)) {
2517 if (child.type !== Comment || child.children === "v-if") {
2518 if (singleRoot) {
2519 return;
2520 } else {
2521 singleRoot = child;
2522 if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
2523 return filterSingleRoot(singleRoot.children);
2524 }
2525 }
2526 }
2527 } else {
2528 return;
2529 }
2530 }
2531 return singleRoot;
2532}
2533const getFunctionalFallthrough = (attrs) => {
2534 let res;
2535 for (const key in attrs) {
2536 if (key === "class" || key === "style" || isOn(key)) {
2537 (res || (res = {}))[key] = attrs[key];
2538 }
2539 }
2540 return res;
2541};
2542const filterModelListeners = (attrs, props) => {
2543 const res = {};
2544 for (const key in attrs) {
2545 if (!isModelListener(key) || !(key.slice(9) in props)) {
2546 res[key] = attrs[key];
2547 }
2548 }
2549 return res;
2550};
2551const isElementRoot = (vnode) => {
2552 return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
2553};
2554function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
2555 const { props: prevProps, children: prevChildren, component } = prevVNode;
2556 const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
2557 const emits = component.emitsOptions;
2558 if ((prevChildren || nextChildren) && isHmrUpdating) {
2559 return true;
2560 }
2561 if (nextVNode.dirs || nextVNode.transition) {
2562 return true;
2563 }
2564 if (optimized && patchFlag >= 0) {
2565 if (patchFlag & 1024) {
2566 return true;
2567 }
2568 if (patchFlag & 16) {
2569 if (!prevProps) {
2570 return !!nextProps;
2571 }
2572 return hasPropsChanged(prevProps, nextProps, emits);
2573 } else if (patchFlag & 8) {
2574 const dynamicProps = nextVNode.dynamicProps;
2575 for (let i = 0; i < dynamicProps.length; i++) {
2576 const key = dynamicProps[i];
2577 if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
2578 return true;
2579 }
2580 }
2581 }
2582 } else {
2583 if (prevChildren || nextChildren) {
2584 if (!nextChildren || !nextChildren.$stable) {
2585 return true;
2586 }
2587 }
2588 if (prevProps === nextProps) {
2589 return false;
2590 }
2591 if (!prevProps) {
2592 return !!nextProps;
2593 }
2594 if (!nextProps) {
2595 return true;
2596 }
2597 return hasPropsChanged(prevProps, nextProps, emits);
2598 }
2599 return false;
2600}
2601function hasPropsChanged(prevProps, nextProps, emitsOptions) {
2602 const nextKeys = Object.keys(nextProps);
2603 if (nextKeys.length !== Object.keys(prevProps).length) {
2604 return true;
2605 }
2606 for (let i = 0; i < nextKeys.length; i++) {
2607 const key = nextKeys[i];
2608 if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
2609 return true;
2610 }
2611 }
2612 return false;
2613}
2614function updateHOCHostEl({ vnode, parent }, el) {
2615 while (parent) {
2616 const root = parent.subTree;
2617 if (root.suspense && root.suspense.activeBranch === vnode) {
2618 root.el = vnode.el;
2619 }
2620 if (root === vnode) {
2621 (vnode = parent.vnode).el = el;
2622 parent = parent.parent;
2623 } else {
2624 break;
2625 }
2626 }
2627}
2628
2629const COMPONENTS = "components";
2630const DIRECTIVES = "directives";
2631function resolveComponent(name, maybeSelfReference) {
2632 return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
2633}
2634const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
2635function resolveDynamicComponent(component) {
2636 if (isString(component)) {
2637 return resolveAsset(COMPONENTS, component, false) || component;
2638 } else {
2639 return component || NULL_DYNAMIC_COMPONENT;
2640 }
2641}
2642function resolveDirective(name) {
2643 return resolveAsset(DIRECTIVES, name);
2644}
2645function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
2646 const instance = currentRenderingInstance || currentInstance;
2647 if (instance) {
2648 const Component = instance.type;
2649 if (type === COMPONENTS) {
2650 const selfName = getComponentName(
2651 Component,
2652 false
2653 );
2654 if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
2655 return Component;
2656 }
2657 }
2658 const res = (
2659 // local registration
2660 // check instance[type] first which is resolved for options API
2661 resolve(instance[type] || Component[type], name) || // global registration
2662 resolve(instance.appContext[type], name)
2663 );
2664 if (!res && maybeSelfReference) {
2665 return Component;
2666 }
2667 if (warnMissing && !res) {
2668 const extra = type === COMPONENTS ? `
2669If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
2670 warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
2671 }
2672 return res;
2673 } else {
2674 warn$1(
2675 `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
2676 );
2677 }
2678}
2679function resolve(registry, name) {
2680 return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
2681}
2682
2683const isSuspense = (type) => type.__isSuspense;
2684let suspenseId = 0;
2685const SuspenseImpl = {
2686 name: "Suspense",
2687 // In order to make Suspense tree-shakable, we need to avoid importing it
2688 // directly in the renderer. The renderer checks for the __isSuspense flag
2689 // on a vnode's type and calls the `process` method, passing in renderer
2690 // internals.
2691 __isSuspense: true,
2692 process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
2693 if (n1 == null) {
2694 mountSuspense(
2695 n2,
2696 container,
2697 anchor,
2698 parentComponent,
2699 parentSuspense,
2700 namespace,
2701 slotScopeIds,
2702 optimized,
2703 rendererInternals
2704 );
2705 } else {
2706 if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
2707 n2.suspense = n1.suspense;
2708 n2.suspense.vnode = n2;
2709 n2.el = n1.el;
2710 return;
2711 }
2712 patchSuspense(
2713 n1,
2714 n2,
2715 container,
2716 anchor,
2717 parentComponent,
2718 namespace,
2719 slotScopeIds,
2720 optimized,
2721 rendererInternals
2722 );
2723 }
2724 },
2725 hydrate: hydrateSuspense,
2726 create: createSuspenseBoundary,
2727 normalize: normalizeSuspenseChildren
2728};
2729const Suspense = SuspenseImpl ;
2730function triggerEvent(vnode, name) {
2731 const eventListener = vnode.props && vnode.props[name];
2732 if (isFunction(eventListener)) {
2733 eventListener();
2734 }
2735}
2736function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
2737 const {
2738 p: patch,
2739 o: { createElement }
2740 } = rendererInternals;
2741 const hiddenContainer = createElement("div");
2742 const suspense = vnode.suspense = createSuspenseBoundary(
2743 vnode,
2744 parentSuspense,
2745 parentComponent,
2746 container,
2747 hiddenContainer,
2748 anchor,
2749 namespace,
2750 slotScopeIds,
2751 optimized,
2752 rendererInternals
2753 );
2754 patch(
2755 null,
2756 suspense.pendingBranch = vnode.ssContent,
2757 hiddenContainer,
2758 null,
2759 parentComponent,
2760 suspense,
2761 namespace,
2762 slotScopeIds
2763 );
2764 if (suspense.deps > 0) {
2765 triggerEvent(vnode, "onPending");
2766 triggerEvent(vnode, "onFallback");
2767 patch(
2768 null,
2769 vnode.ssFallback,
2770 container,
2771 anchor,
2772 parentComponent,
2773 null,
2774 // fallback tree will not have suspense context
2775 namespace,
2776 slotScopeIds
2777 );
2778 setActiveBranch(suspense, vnode.ssFallback);
2779 } else {
2780 suspense.resolve(false, true);
2781 }
2782}
2783function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
2784 const suspense = n2.suspense = n1.suspense;
2785 suspense.vnode = n2;
2786 n2.el = n1.el;
2787 const newBranch = n2.ssContent;
2788 const newFallback = n2.ssFallback;
2789 const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
2790 if (pendingBranch) {
2791 suspense.pendingBranch = newBranch;
2792 if (isSameVNodeType(newBranch, pendingBranch)) {
2793 patch(
2794 pendingBranch,
2795 newBranch,
2796 suspense.hiddenContainer,
2797 null,
2798 parentComponent,
2799 suspense,
2800 namespace,
2801 slotScopeIds,
2802 optimized
2803 );
2804 if (suspense.deps <= 0) {
2805 suspense.resolve();
2806 } else if (isInFallback) {
2807 if (!isHydrating) {
2808 patch(
2809 activeBranch,
2810 newFallback,
2811 container,
2812 anchor,
2813 parentComponent,
2814 null,
2815 // fallback tree will not have suspense context
2816 namespace,
2817 slotScopeIds,
2818 optimized
2819 );
2820 setActiveBranch(suspense, newFallback);
2821 }
2822 }
2823 } else {
2824 suspense.pendingId = suspenseId++;
2825 if (isHydrating) {
2826 suspense.isHydrating = false;
2827 suspense.activeBranch = pendingBranch;
2828 } else {
2829 unmount(pendingBranch, parentComponent, suspense);
2830 }
2831 suspense.deps = 0;
2832 suspense.effects.length = 0;
2833 suspense.hiddenContainer = createElement("div");
2834 if (isInFallback) {
2835 patch(
2836 null,
2837 newBranch,
2838 suspense.hiddenContainer,
2839 null,
2840 parentComponent,
2841 suspense,
2842 namespace,
2843 slotScopeIds,
2844 optimized
2845 );
2846 if (suspense.deps <= 0) {
2847 suspense.resolve();
2848 } else {
2849 patch(
2850 activeBranch,
2851 newFallback,
2852 container,
2853 anchor,
2854 parentComponent,
2855 null,
2856 // fallback tree will not have suspense context
2857 namespace,
2858 slotScopeIds,
2859 optimized
2860 );
2861 setActiveBranch(suspense, newFallback);
2862 }
2863 } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
2864 patch(
2865 activeBranch,
2866 newBranch,
2867 container,
2868 anchor,
2869 parentComponent,
2870 suspense,
2871 namespace,
2872 slotScopeIds,
2873 optimized
2874 );
2875 suspense.resolve(true);
2876 } else {
2877 patch(
2878 null,
2879 newBranch,
2880 suspense.hiddenContainer,
2881 null,
2882 parentComponent,
2883 suspense,
2884 namespace,
2885 slotScopeIds,
2886 optimized
2887 );
2888 if (suspense.deps <= 0) {
2889 suspense.resolve();
2890 }
2891 }
2892 }
2893 } else {
2894 if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
2895 patch(
2896 activeBranch,
2897 newBranch,
2898 container,
2899 anchor,
2900 parentComponent,
2901 suspense,
2902 namespace,
2903 slotScopeIds,
2904 optimized
2905 );
2906 setActiveBranch(suspense, newBranch);
2907 } else {
2908 triggerEvent(n2, "onPending");
2909 suspense.pendingBranch = newBranch;
2910 if (newBranch.shapeFlag & 512) {
2911 suspense.pendingId = newBranch.component.suspenseId;
2912 } else {
2913 suspense.pendingId = suspenseId++;
2914 }
2915 patch(
2916 null,
2917 newBranch,
2918 suspense.hiddenContainer,
2919 null,
2920 parentComponent,
2921 suspense,
2922 namespace,
2923 slotScopeIds,
2924 optimized
2925 );
2926 if (suspense.deps <= 0) {
2927 suspense.resolve();
2928 } else {
2929 const { timeout, pendingId } = suspense;
2930 if (timeout > 0) {
2931 setTimeout(() => {
2932 if (suspense.pendingId === pendingId) {
2933 suspense.fallback(newFallback);
2934 }
2935 }, timeout);
2936 } else if (timeout === 0) {
2937 suspense.fallback(newFallback);
2938 }
2939 }
2940 }
2941 }
2942}
2943let hasWarned = false;
2944function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
2945 if (!hasWarned) {
2946 hasWarned = true;
2947 console[console.info ? "info" : "log"](
2948 `<Suspense> is an experimental feature and its API will likely change.`
2949 );
2950 }
2951 const {
2952 p: patch,
2953 m: move,
2954 um: unmount,
2955 n: next,
2956 o: { parentNode, remove }
2957 } = rendererInternals;
2958 let parentSuspenseId;
2959 const isSuspensible = isVNodeSuspensible(vnode);
2960 if (isSuspensible) {
2961 if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
2962 parentSuspenseId = parentSuspense.pendingId;
2963 parentSuspense.deps++;
2964 }
2965 }
2966 const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
2967 {
2968 assertNumber(timeout, `Suspense timeout`);
2969 }
2970 const initialAnchor = anchor;
2971 const suspense = {
2972 vnode,
2973 parent: parentSuspense,
2974 parentComponent,
2975 namespace,
2976 container,
2977 hiddenContainer,
2978 deps: 0,
2979 pendingId: suspenseId++,
2980 timeout: typeof timeout === "number" ? timeout : -1,
2981 activeBranch: null,
2982 pendingBranch: null,
2983 isInFallback: !isHydrating,
2984 isHydrating,
2985 isUnmounted: false,
2986 effects: [],
2987 resolve(resume = false, sync = false) {
2988 {
2989 if (!resume && !suspense.pendingBranch) {
2990 throw new Error(
2991 `suspense.resolve() is called without a pending branch.`
2992 );
2993 }
2994 if (suspense.isUnmounted) {
2995 throw new Error(
2996 `suspense.resolve() is called on an already unmounted suspense boundary.`
2997 );
2998 }
2999 }
3000 const {
3001 vnode: vnode2,
3002 activeBranch,
3003 pendingBranch,
3004 pendingId,
3005 effects,
3006 parentComponent: parentComponent2,
3007 container: container2
3008 } = suspense;
3009 let delayEnter = false;
3010 if (suspense.isHydrating) {
3011 suspense.isHydrating = false;
3012 } else if (!resume) {
3013 delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
3014 if (delayEnter) {
3015 activeBranch.transition.afterLeave = () => {
3016 if (pendingId === suspense.pendingId) {
3017 move(
3018 pendingBranch,
3019 container2,
3020 anchor === initialAnchor ? next(activeBranch) : anchor,
3021 0
3022 );
3023 queuePostFlushCb(effects);
3024 }
3025 };
3026 }
3027 if (activeBranch) {
3028 if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
3029 anchor = next(activeBranch);
3030 }
3031 unmount(activeBranch, parentComponent2, suspense, true);
3032 }
3033 if (!delayEnter) {
3034 move(pendingBranch, container2, anchor, 0);
3035 }
3036 }
3037 setActiveBranch(suspense, pendingBranch);
3038 suspense.pendingBranch = null;
3039 suspense.isInFallback = false;
3040 let parent = suspense.parent;
3041 let hasUnresolvedAncestor = false;
3042 while (parent) {
3043 if (parent.pendingBranch) {
3044 parent.effects.push(...effects);
3045 hasUnresolvedAncestor = true;
3046 break;
3047 }
3048 parent = parent.parent;
3049 }
3050 if (!hasUnresolvedAncestor && !delayEnter) {
3051 queuePostFlushCb(effects);
3052 }
3053 suspense.effects = [];
3054 if (isSuspensible) {
3055 if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
3056 parentSuspense.deps--;
3057 if (parentSuspense.deps === 0 && !sync) {
3058 parentSuspense.resolve();
3059 }
3060 }
3061 }
3062 triggerEvent(vnode2, "onResolve");
3063 },
3064 fallback(fallbackVNode) {
3065 if (!suspense.pendingBranch) {
3066 return;
3067 }
3068 const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
3069 triggerEvent(vnode2, "onFallback");
3070 const anchor2 = next(activeBranch);
3071 const mountFallback = () => {
3072 if (!suspense.isInFallback) {
3073 return;
3074 }
3075 patch(
3076 null,
3077 fallbackVNode,
3078 container2,
3079 anchor2,
3080 parentComponent2,
3081 null,
3082 // fallback tree will not have suspense context
3083 namespace2,
3084 slotScopeIds,
3085 optimized
3086 );
3087 setActiveBranch(suspense, fallbackVNode);
3088 };
3089 const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
3090 if (delayEnter) {
3091 activeBranch.transition.afterLeave = mountFallback;
3092 }
3093 suspense.isInFallback = true;
3094 unmount(
3095 activeBranch,
3096 parentComponent2,
3097 null,
3098 // no suspense so unmount hooks fire now
3099 true
3100 // shouldRemove
3101 );
3102 if (!delayEnter) {
3103 mountFallback();
3104 }
3105 },
3106 move(container2, anchor2, type) {
3107 suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
3108 suspense.container = container2;
3109 },
3110 next() {
3111 return suspense.activeBranch && next(suspense.activeBranch);
3112 },
3113 registerDep(instance, setupRenderEffect) {
3114 const isInPendingSuspense = !!suspense.pendingBranch;
3115 if (isInPendingSuspense) {
3116 suspense.deps++;
3117 }
3118 const hydratedEl = instance.vnode.el;
3119 instance.asyncDep.catch((err) => {
3120 handleError(err, instance, 0);
3121 }).then((asyncSetupResult) => {
3122 if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
3123 return;
3124 }
3125 instance.asyncResolved = true;
3126 const { vnode: vnode2 } = instance;
3127 {
3128 pushWarningContext(vnode2);
3129 }
3130 handleSetupResult(instance, asyncSetupResult, false);
3131 if (hydratedEl) {
3132 vnode2.el = hydratedEl;
3133 }
3134 const placeholder = !hydratedEl && instance.subTree.el;
3135 setupRenderEffect(
3136 instance,
3137 vnode2,
3138 // component may have been moved before resolve.
3139 // if this is not a hydration, instance.subTree will be the comment
3140 // placeholder.
3141 parentNode(hydratedEl || instance.subTree.el),
3142 // anchor will not be used if this is hydration, so only need to
3143 // consider the comment placeholder case.
3144 hydratedEl ? null : next(instance.subTree),
3145 suspense,
3146 namespace,
3147 optimized
3148 );
3149 if (placeholder) {
3150 remove(placeholder);
3151 }
3152 updateHOCHostEl(instance, vnode2.el);
3153 {
3154 popWarningContext();
3155 }
3156 if (isInPendingSuspense && --suspense.deps === 0) {
3157 suspense.resolve();
3158 }
3159 });
3160 },
3161 unmount(parentSuspense2, doRemove) {
3162 suspense.isUnmounted = true;
3163 if (suspense.activeBranch) {
3164 unmount(
3165 suspense.activeBranch,
3166 parentComponent,
3167 parentSuspense2,
3168 doRemove
3169 );
3170 }
3171 if (suspense.pendingBranch) {
3172 unmount(
3173 suspense.pendingBranch,
3174 parentComponent,
3175 parentSuspense2,
3176 doRemove
3177 );
3178 }
3179 }
3180 };
3181 return suspense;
3182}
3183function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
3184 const suspense = vnode.suspense = createSuspenseBoundary(
3185 vnode,
3186 parentSuspense,
3187 parentComponent,
3188 node.parentNode,
3189 // eslint-disable-next-line no-restricted-globals
3190 document.createElement("div"),
3191 null,
3192 namespace,
3193 slotScopeIds,
3194 optimized,
3195 rendererInternals,
3196 true
3197 );
3198 const result = hydrateNode(
3199 node,
3200 suspense.pendingBranch = vnode.ssContent,
3201 parentComponent,
3202 suspense,
3203 slotScopeIds,
3204 optimized
3205 );
3206 if (suspense.deps === 0) {
3207 suspense.resolve(false, true);
3208 }
3209 return result;
3210}
3211function normalizeSuspenseChildren(vnode) {
3212 const { shapeFlag, children } = vnode;
3213 const isSlotChildren = shapeFlag & 32;
3214 vnode.ssContent = normalizeSuspenseSlot(
3215 isSlotChildren ? children.default : children
3216 );
3217 vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
3218}
3219function normalizeSuspenseSlot(s) {
3220 let block;
3221 if (isFunction(s)) {
3222 const trackBlock = isBlockTreeEnabled && s._c;
3223 if (trackBlock) {
3224 s._d = false;
3225 openBlock();
3226 }
3227 s = s();
3228 if (trackBlock) {
3229 s._d = true;
3230 block = currentBlock;
3231 closeBlock();
3232 }
3233 }
3234 if (isArray(s)) {
3235 const singleChild = filterSingleRoot(s);
3236 if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
3237 warn$1(`<Suspense> slots expect a single root node.`);
3238 }
3239 s = singleChild;
3240 }
3241 s = normalizeVNode(s);
3242 if (block && !s.dynamicChildren) {
3243 s.dynamicChildren = block.filter((c) => c !== s);
3244 }
3245 return s;
3246}
3247function queueEffectWithSuspense(fn, suspense) {
3248 if (suspense && suspense.pendingBranch) {
3249 if (isArray(fn)) {
3250 suspense.effects.push(...fn);
3251 } else {
3252 suspense.effects.push(fn);
3253 }
3254 } else {
3255 queuePostFlushCb(fn);
3256 }
3257}
3258function setActiveBranch(suspense, branch) {
3259 suspense.activeBranch = branch;
3260 const { vnode, parentComponent } = suspense;
3261 let el = branch.el;
3262 while (!el && branch.component) {
3263 branch = branch.component.subTree;
3264 el = branch.el;
3265 }
3266 vnode.el = el;
3267 if (parentComponent && parentComponent.subTree === vnode) {
3268 parentComponent.vnode.el = el;
3269 updateHOCHostEl(parentComponent, el);
3270 }
3271}
3272function isVNodeSuspensible(vnode) {
3273 var _a;
3274 return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
3275}
3276
3277const ssrContextKey = Symbol.for("v-scx");
3278const useSSRContext = () => {
3279 {
3280 const ctx = inject(ssrContextKey);
3281 if (!ctx) {
3282 warn$1(
3283 `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
3284 );
3285 }
3286 return ctx;
3287 }
3288};
3289
3290function watchEffect(effect, options) {
3291 return doWatch(effect, null, options);
3292}
3293function watchPostEffect(effect, options) {
3294 return doWatch(
3295 effect,
3296 null,
3297 extend({}, options, { flush: "post" })
3298 );
3299}
3300function watchSyncEffect(effect, options) {
3301 return doWatch(
3302 effect,
3303 null,
3304 extend({}, options, { flush: "sync" })
3305 );
3306}
3307const INITIAL_WATCHER_VALUE = {};
3308function watch(source, cb, options) {
3309 if (!isFunction(cb)) {
3310 warn$1(
3311 `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
3312 );
3313 }
3314 return doWatch(source, cb, options);
3315}
3316function doWatch(source, cb, {
3317 immediate,
3318 deep,
3319 flush,
3320 once,
3321 onTrack,
3322 onTrigger
3323} = EMPTY_OBJ) {
3324 if (cb && once) {
3325 const _cb = cb;
3326 cb = (...args) => {
3327 _cb(...args);
3328 unwatch();
3329 };
3330 }
3331 if (deep !== void 0 && typeof deep === "number") {
3332 warn$1(
3333 `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
3334 );
3335 }
3336 if (!cb) {
3337 if (immediate !== void 0) {
3338 warn$1(
3339 `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
3340 );
3341 }
3342 if (deep !== void 0) {
3343 warn$1(
3344 `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
3345 );
3346 }
3347 if (once !== void 0) {
3348 warn$1(
3349 `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
3350 );
3351 }
3352 }
3353 const warnInvalidSource = (s) => {
3354 warn$1(
3355 `Invalid watch source: `,
3356 s,
3357 `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
3358 );
3359 };
3360 const instance = currentInstance;
3361 const reactiveGetter = (source2) => deep === true ? source2 : (
3362 // for deep: false, only traverse root-level properties
3363 traverse(source2, deep === false ? 1 : void 0)
3364 );
3365 let getter;
3366 let forceTrigger = false;
3367 let isMultiSource = false;
3368 if (isRef(source)) {
3369 getter = () => source.value;
3370 forceTrigger = isShallow(source);
3371 } else if (isReactive(source)) {
3372 getter = () => reactiveGetter(source);
3373 forceTrigger = true;
3374 } else if (isArray(source)) {
3375 isMultiSource = true;
3376 forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
3377 getter = () => source.map((s) => {
3378 if (isRef(s)) {
3379 return s.value;
3380 } else if (isReactive(s)) {
3381 return reactiveGetter(s);
3382 } else if (isFunction(s)) {
3383 return callWithErrorHandling(s, instance, 2);
3384 } else {
3385 warnInvalidSource(s);
3386 }
3387 });
3388 } else if (isFunction(source)) {
3389 if (cb) {
3390 getter = () => callWithErrorHandling(source, instance, 2);
3391 } else {
3392 getter = () => {
3393 if (cleanup) {
3394 cleanup();
3395 }
3396 return callWithAsyncErrorHandling(
3397 source,
3398 instance,
3399 3,
3400 [onCleanup]
3401 );
3402 };
3403 }
3404 } else {
3405 getter = NOOP;
3406 warnInvalidSource(source);
3407 }
3408 if (cb && deep) {
3409 const baseGetter = getter;
3410 getter = () => traverse(baseGetter());
3411 }
3412 let cleanup;
3413 let onCleanup = (fn) => {
3414 cleanup = effect.onStop = () => {
3415 callWithErrorHandling(fn, instance, 4);
3416 cleanup = effect.onStop = void 0;
3417 };
3418 };
3419 let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
3420 const job = () => {
3421 if (!effect.active || !effect.dirty) {
3422 return;
3423 }
3424 if (cb) {
3425 const newValue = effect.run();
3426 if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
3427 if (cleanup) {
3428 cleanup();
3429 }
3430 callWithAsyncErrorHandling(cb, instance, 3, [
3431 newValue,
3432 // pass undefined as the old value when it's changed for the first time
3433 oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
3434 onCleanup
3435 ]);
3436 oldValue = newValue;
3437 }
3438 } else {
3439 effect.run();
3440 }
3441 };
3442 job.allowRecurse = !!cb;
3443 let scheduler;
3444 if (flush === "sync") {
3445 scheduler = job;
3446 } else if (flush === "post") {
3447 scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
3448 } else {
3449 job.pre = true;
3450 if (instance)
3451 job.id = instance.uid;
3452 scheduler = () => queueJob(job);
3453 }
3454 const effect = new ReactiveEffect(getter, NOOP, scheduler);
3455 const scope = getCurrentScope();
3456 const unwatch = () => {
3457 effect.stop();
3458 if (scope) {
3459 remove(scope.effects, effect);
3460 }
3461 };
3462 {
3463 effect.onTrack = onTrack;
3464 effect.onTrigger = onTrigger;
3465 }
3466 if (cb) {
3467 if (immediate) {
3468 job();
3469 } else {
3470 oldValue = effect.run();
3471 }
3472 } else if (flush === "post") {
3473 queuePostRenderEffect(
3474 effect.run.bind(effect),
3475 instance && instance.suspense
3476 );
3477 } else {
3478 effect.run();
3479 }
3480 return unwatch;
3481}
3482function instanceWatch(source, value, options) {
3483 const publicThis = this.proxy;
3484 const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
3485 let cb;
3486 if (isFunction(value)) {
3487 cb = value;
3488 } else {
3489 cb = value.handler;
3490 options = value;
3491 }
3492 const reset = setCurrentInstance(this);
3493 const res = doWatch(getter, cb.bind(publicThis), options);
3494 reset();
3495 return res;
3496}
3497function createPathGetter(ctx, path) {
3498 const segments = path.split(".");
3499 return () => {
3500 let cur = ctx;
3501 for (let i = 0; i < segments.length && cur; i++) {
3502 cur = cur[segments[i]];
3503 }
3504 return cur;
3505 };
3506}
3507function traverse(value, depth, currentDepth = 0, seen) {
3508 if (!isObject(value) || value["__v_skip"]) {
3509 return value;
3510 }
3511 if (depth && depth > 0) {
3512 if (currentDepth >= depth) {
3513 return value;
3514 }
3515 currentDepth++;
3516 }
3517 seen = seen || /* @__PURE__ */ new Set();
3518 if (seen.has(value)) {
3519 return value;
3520 }
3521 seen.add(value);
3522 if (isRef(value)) {
3523 traverse(value.value, depth, currentDepth, seen);
3524 } else if (isArray(value)) {
3525 for (let i = 0; i < value.length; i++) {
3526 traverse(value[i], depth, currentDepth, seen);
3527 }
3528 } else if (isSet(value) || isMap(value)) {
3529 value.forEach((v) => {
3530 traverse(v, depth, currentDepth, seen);
3531 });
3532 } else if (isPlainObject(value)) {
3533 for (const key in value) {
3534 traverse(value[key], depth, currentDepth, seen);
3535 }
3536 }
3537 return value;
3538}
3539
3540function validateDirectiveName(name) {
3541 if (isBuiltInDirective(name)) {
3542 warn$1("Do not use built-in directive ids as custom directive id: " + name);
3543 }
3544}
3545function withDirectives(vnode, directives) {
3546 if (currentRenderingInstance === null) {
3547 warn$1(`withDirectives can only be used inside render functions.`);
3548 return vnode;
3549 }
3550 const instance = getExposeProxy(currentRenderingInstance) || currentRenderingInstance.proxy;
3551 const bindings = vnode.dirs || (vnode.dirs = []);
3552 for (let i = 0; i < directives.length; i++) {
3553 let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
3554 if (dir) {
3555 if (isFunction(dir)) {
3556 dir = {
3557 mounted: dir,
3558 updated: dir
3559 };
3560 }
3561 if (dir.deep) {
3562 traverse(value);
3563 }
3564 bindings.push({
3565 dir,
3566 instance,
3567 value,
3568 oldValue: void 0,
3569 arg,
3570 modifiers
3571 });
3572 }
3573 }
3574 return vnode;
3575}
3576function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3577 const bindings = vnode.dirs;
3578 const oldBindings = prevVNode && prevVNode.dirs;
3579 for (let i = 0; i < bindings.length; i++) {
3580 const binding = bindings[i];
3581 if (oldBindings) {
3582 binding.oldValue = oldBindings[i].value;
3583 }
3584 let hook = binding.dir[name];
3585 if (hook) {
3586 pauseTracking();
3587 callWithAsyncErrorHandling(hook, instance, 8, [
3588 vnode.el,
3589 binding,
3590 vnode,
3591 prevVNode
3592 ]);
3593 resetTracking();
3594 }
3595 }
3596}
3597
3598const leaveCbKey = Symbol("_leaveCb");
3599const enterCbKey$1 = Symbol("_enterCb");
3600function useTransitionState() {
3601 const state = {
3602 isMounted: false,
3603 isLeaving: false,
3604 isUnmounting: false,
3605 leavingVNodes: /* @__PURE__ */ new Map()
3606 };
3607 onMounted(() => {
3608 state.isMounted = true;
3609 });
3610 onBeforeUnmount(() => {
3611 state.isUnmounting = true;
3612 });
3613 return state;
3614}
3615const TransitionHookValidator = [Function, Array];
3616const BaseTransitionPropsValidators = {
3617 mode: String,
3618 appear: Boolean,
3619 persisted: Boolean,
3620 // enter
3621 onBeforeEnter: TransitionHookValidator,
3622 onEnter: TransitionHookValidator,
3623 onAfterEnter: TransitionHookValidator,
3624 onEnterCancelled: TransitionHookValidator,
3625 // leave
3626 onBeforeLeave: TransitionHookValidator,
3627 onLeave: TransitionHookValidator,
3628 onAfterLeave: TransitionHookValidator,
3629 onLeaveCancelled: TransitionHookValidator,
3630 // appear
3631 onBeforeAppear: TransitionHookValidator,
3632 onAppear: TransitionHookValidator,
3633 onAfterAppear: TransitionHookValidator,
3634 onAppearCancelled: TransitionHookValidator
3635};
3636const BaseTransitionImpl = {
3637 name: `BaseTransition`,
3638 props: BaseTransitionPropsValidators,
3639 setup(props, { slots }) {
3640 const instance = getCurrentInstance();
3641 const state = useTransitionState();
3642 return () => {
3643 const children = slots.default && getTransitionRawChildren(slots.default(), true);
3644 if (!children || !children.length) {
3645 return;
3646 }
3647 let child = children[0];
3648 if (children.length > 1) {
3649 let hasFound = false;
3650 for (const c of children) {
3651 if (c.type !== Comment) {
3652 if (hasFound) {
3653 warn$1(
3654 "<transition> can only be used on a single element or component. Use <transition-group> for lists."
3655 );
3656 break;
3657 }
3658 child = c;
3659 hasFound = true;
3660 }
3661 }
3662 }
3663 const rawProps = toRaw(props);
3664 const { mode } = rawProps;
3665 if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
3666 warn$1(`invalid <transition> mode: ${mode}`);
3667 }
3668 if (state.isLeaving) {
3669 return emptyPlaceholder(child);
3670 }
3671 const innerChild = getKeepAliveChild(child);
3672 if (!innerChild) {
3673 return emptyPlaceholder(child);
3674 }
3675 const enterHooks = resolveTransitionHooks(
3676 innerChild,
3677 rawProps,
3678 state,
3679 instance
3680 );
3681 setTransitionHooks(innerChild, enterHooks);
3682 const oldChild = instance.subTree;
3683 const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
3684 if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild)) {
3685 const leavingHooks = resolveTransitionHooks(
3686 oldInnerChild,
3687 rawProps,
3688 state,
3689 instance
3690 );
3691 setTransitionHooks(oldInnerChild, leavingHooks);
3692 if (mode === "out-in") {
3693 state.isLeaving = true;
3694 leavingHooks.afterLeave = () => {
3695 state.isLeaving = false;
3696 if (instance.update.active !== false) {
3697 instance.effect.dirty = true;
3698 instance.update();
3699 }
3700 };
3701 return emptyPlaceholder(child);
3702 } else if (mode === "in-out" && innerChild.type !== Comment) {
3703 leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
3704 const leavingVNodesCache = getLeavingNodesForType(
3705 state,
3706 oldInnerChild
3707 );
3708 leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3709 el[leaveCbKey] = () => {
3710 earlyRemove();
3711 el[leaveCbKey] = void 0;
3712 delete enterHooks.delayedLeave;
3713 };
3714 enterHooks.delayedLeave = delayedLeave;
3715 };
3716 }
3717 }
3718 return child;
3719 };
3720 }
3721};
3722const BaseTransition = BaseTransitionImpl;
3723function getLeavingNodesForType(state, vnode) {
3724 const { leavingVNodes } = state;
3725 let leavingVNodesCache = leavingVNodes.get(vnode.type);
3726 if (!leavingVNodesCache) {
3727 leavingVNodesCache = /* @__PURE__ */ Object.create(null);
3728 leavingVNodes.set(vnode.type, leavingVNodesCache);
3729 }
3730 return leavingVNodesCache;
3731}
3732function resolveTransitionHooks(vnode, props, state, instance) {
3733 const {
3734 appear,
3735 mode,
3736 persisted = false,
3737 onBeforeEnter,
3738 onEnter,
3739 onAfterEnter,
3740 onEnterCancelled,
3741 onBeforeLeave,
3742 onLeave,
3743 onAfterLeave,
3744 onLeaveCancelled,
3745 onBeforeAppear,
3746 onAppear,
3747 onAfterAppear,
3748 onAppearCancelled
3749 } = props;
3750 const key = String(vnode.key);
3751 const leavingVNodesCache = getLeavingNodesForType(state, vnode);
3752 const callHook = (hook, args) => {
3753 hook && callWithAsyncErrorHandling(
3754 hook,
3755 instance,
3756 9,
3757 args
3758 );
3759 };
3760 const callAsyncHook = (hook, args) => {
3761 const done = args[1];
3762 callHook(hook, args);
3763 if (isArray(hook)) {
3764 if (hook.every((hook2) => hook2.length <= 1))
3765 done();
3766 } else if (hook.length <= 1) {
3767 done();
3768 }
3769 };
3770 const hooks = {
3771 mode,
3772 persisted,
3773 beforeEnter(el) {
3774 let hook = onBeforeEnter;
3775 if (!state.isMounted) {
3776 if (appear) {
3777 hook = onBeforeAppear || onBeforeEnter;
3778 } else {
3779 return;
3780 }
3781 }
3782 if (el[leaveCbKey]) {
3783 el[leaveCbKey](
3784 true
3785 /* cancelled */
3786 );
3787 }
3788 const leavingVNode = leavingVNodesCache[key];
3789 if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
3790 leavingVNode.el[leaveCbKey]();
3791 }
3792 callHook(hook, [el]);
3793 },
3794 enter(el) {
3795 let hook = onEnter;
3796 let afterHook = onAfterEnter;
3797 let cancelHook = onEnterCancelled;
3798 if (!state.isMounted) {
3799 if (appear) {
3800 hook = onAppear || onEnter;
3801 afterHook = onAfterAppear || onAfterEnter;
3802 cancelHook = onAppearCancelled || onEnterCancelled;
3803 } else {
3804 return;
3805 }
3806 }
3807 let called = false;
3808 const done = el[enterCbKey$1] = (cancelled) => {
3809 if (called)
3810 return;
3811 called = true;
3812 if (cancelled) {
3813 callHook(cancelHook, [el]);
3814 } else {
3815 callHook(afterHook, [el]);
3816 }
3817 if (hooks.delayedLeave) {
3818 hooks.delayedLeave();
3819 }
3820 el[enterCbKey$1] = void 0;
3821 };
3822 if (hook) {
3823 callAsyncHook(hook, [el, done]);
3824 } else {
3825 done();
3826 }
3827 },
3828 leave(el, remove) {
3829 const key2 = String(vnode.key);
3830 if (el[enterCbKey$1]) {
3831 el[enterCbKey$1](
3832 true
3833 /* cancelled */
3834 );
3835 }
3836 if (state.isUnmounting) {
3837 return remove();
3838 }
3839 callHook(onBeforeLeave, [el]);
3840 let called = false;
3841 const done = el[leaveCbKey] = (cancelled) => {
3842 if (called)
3843 return;
3844 called = true;
3845 remove();
3846 if (cancelled) {
3847 callHook(onLeaveCancelled, [el]);
3848 } else {
3849 callHook(onAfterLeave, [el]);
3850 }
3851 el[leaveCbKey] = void 0;
3852 if (leavingVNodesCache[key2] === vnode) {
3853 delete leavingVNodesCache[key2];
3854 }
3855 };
3856 leavingVNodesCache[key2] = vnode;
3857 if (onLeave) {
3858 callAsyncHook(onLeave, [el, done]);
3859 } else {
3860 done();
3861 }
3862 },
3863 clone(vnode2) {
3864 return resolveTransitionHooks(vnode2, props, state, instance);
3865 }
3866 };
3867 return hooks;
3868}
3869function emptyPlaceholder(vnode) {
3870 if (isKeepAlive(vnode)) {
3871 vnode = cloneVNode(vnode);
3872 vnode.children = null;
3873 return vnode;
3874 }
3875}
3876function getKeepAliveChild(vnode) {
3877 return isKeepAlive(vnode) ? (
3878 // #7121 ensure get the child component subtree in case
3879 // it's been replaced during HMR
3880 vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0
3881 ) : vnode;
3882}
3883function setTransitionHooks(vnode, hooks) {
3884 if (vnode.shapeFlag & 6 && vnode.component) {
3885 setTransitionHooks(vnode.component.subTree, hooks);
3886 } else if (vnode.shapeFlag & 128) {
3887 vnode.ssContent.transition = hooks.clone(vnode.ssContent);
3888 vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
3889 } else {
3890 vnode.transition = hooks;
3891 }
3892}
3893function getTransitionRawChildren(children, keepComment = false, parentKey) {
3894 let ret = [];
3895 let keyedFragmentCount = 0;
3896 for (let i = 0; i < children.length; i++) {
3897 let child = children[i];
3898 const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
3899 if (child.type === Fragment) {
3900 if (child.patchFlag & 128)
3901 keyedFragmentCount++;
3902 ret = ret.concat(
3903 getTransitionRawChildren(child.children, keepComment, key)
3904 );
3905 } else if (keepComment || child.type !== Comment) {
3906 ret.push(key != null ? cloneVNode(child, { key }) : child);
3907 }
3908 }
3909 if (keyedFragmentCount > 1) {
3910 for (let i = 0; i < ret.length; i++) {
3911 ret[i].patchFlag = -2;
3912 }
3913 }
3914 return ret;
3915}
3916
3917/*! #__NO_SIDE_EFFECTS__ */
3918// @__NO_SIDE_EFFECTS__
3919function defineComponent(options, extraOptions) {
3920 return isFunction(options) ? (
3921 // #8326: extend call and options.name access are considered side-effects
3922 // by Rollup, so we have to wrap it in a pure-annotated IIFE.
3923 /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
3924 ) : options;
3925}
3926
3927const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
3928/*! #__NO_SIDE_EFFECTS__ */
3929// @__NO_SIDE_EFFECTS__
3930function defineAsyncComponent(source) {
3931 if (isFunction(source)) {
3932 source = { loader: source };
3933 }
3934 const {
3935 loader,
3936 loadingComponent,
3937 errorComponent,
3938 delay = 200,
3939 timeout,
3940 // undefined = never times out
3941 suspensible = true,
3942 onError: userOnError
3943 } = source;
3944 let pendingRequest = null;
3945 let resolvedComp;
3946 let retries = 0;
3947 const retry = () => {
3948 retries++;
3949 pendingRequest = null;
3950 return load();
3951 };
3952 const load = () => {
3953 let thisRequest;
3954 return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
3955 err = err instanceof Error ? err : new Error(String(err));
3956 if (userOnError) {
3957 return new Promise((resolve, reject) => {
3958 const userRetry = () => resolve(retry());
3959 const userFail = () => reject(err);
3960 userOnError(err, userRetry, userFail, retries + 1);
3961 });
3962 } else {
3963 throw err;
3964 }
3965 }).then((comp) => {
3966 if (thisRequest !== pendingRequest && pendingRequest) {
3967 return pendingRequest;
3968 }
3969 if (!comp) {
3970 warn$1(
3971 `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
3972 );
3973 }
3974 if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
3975 comp = comp.default;
3976 }
3977 if (comp && !isObject(comp) && !isFunction(comp)) {
3978 throw new Error(`Invalid async component load result: ${comp}`);
3979 }
3980 resolvedComp = comp;
3981 return comp;
3982 }));
3983 };
3984 return defineComponent({
3985 name: "AsyncComponentWrapper",
3986 __asyncLoader: load,
3987 get __asyncResolved() {
3988 return resolvedComp;
3989 },
3990 setup() {
3991 const instance = currentInstance;
3992 if (resolvedComp) {
3993 return () => createInnerComp(resolvedComp, instance);
3994 }
3995 const onError = (err) => {
3996 pendingRequest = null;
3997 handleError(
3998 err,
3999 instance,
4000 13,
4001 !errorComponent
4002 );
4003 };
4004 if (suspensible && instance.suspense || false) {
4005 return load().then((comp) => {
4006 return () => createInnerComp(comp, instance);
4007 }).catch((err) => {
4008 onError(err);
4009 return () => errorComponent ? createVNode(errorComponent, {
4010 error: err
4011 }) : null;
4012 });
4013 }
4014 const loaded = ref(false);
4015 const error = ref();
4016 const delayed = ref(!!delay);
4017 if (delay) {
4018 setTimeout(() => {
4019 delayed.value = false;
4020 }, delay);
4021 }
4022 if (timeout != null) {
4023 setTimeout(() => {
4024 if (!loaded.value && !error.value) {
4025 const err = new Error(
4026 `Async component timed out after ${timeout}ms.`
4027 );
4028 onError(err);
4029 error.value = err;
4030 }
4031 }, timeout);
4032 }
4033 load().then(() => {
4034 loaded.value = true;
4035 if (instance.parent && isKeepAlive(instance.parent.vnode)) {
4036 instance.parent.effect.dirty = true;
4037 queueJob(instance.parent.update);
4038 }
4039 }).catch((err) => {
4040 onError(err);
4041 error.value = err;
4042 });
4043 return () => {
4044 if (loaded.value && resolvedComp) {
4045 return createInnerComp(resolvedComp, instance);
4046 } else if (error.value && errorComponent) {
4047 return createVNode(errorComponent, {
4048 error: error.value
4049 });
4050 } else if (loadingComponent && !delayed.value) {
4051 return createVNode(loadingComponent);
4052 }
4053 };
4054 }
4055 });
4056}
4057function createInnerComp(comp, parent) {
4058 const { ref: ref2, props, children, ce } = parent.vnode;
4059 const vnode = createVNode(comp, props, children);
4060 vnode.ref = ref2;
4061 vnode.ce = ce;
4062 delete parent.vnode.ce;
4063 return vnode;
4064}
4065
4066const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
4067const KeepAliveImpl = {
4068 name: `KeepAlive`,
4069 // Marker for special handling inside the renderer. We are not using a ===
4070 // check directly on KeepAlive in the renderer, because importing it directly
4071 // would prevent it from being tree-shaken.
4072 __isKeepAlive: true,
4073 props: {
4074 include: [String, RegExp, Array],
4075 exclude: [String, RegExp, Array],
4076 max: [String, Number]
4077 },
4078 setup(props, { slots }) {
4079 const instance = getCurrentInstance();
4080 const sharedContext = instance.ctx;
4081 const cache = /* @__PURE__ */ new Map();
4082 const keys = /* @__PURE__ */ new Set();
4083 let current = null;
4084 {
4085 instance.__v_cache = cache;
4086 }
4087 const parentSuspense = instance.suspense;
4088 const {
4089 renderer: {
4090 p: patch,
4091 m: move,
4092 um: _unmount,
4093 o: { createElement }
4094 }
4095 } = sharedContext;
4096 const storageContainer = createElement("div");
4097 sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4098 const instance2 = vnode.component;
4099 move(vnode, container, anchor, 0, parentSuspense);
4100 patch(
4101 instance2.vnode,
4102 vnode,
4103 container,
4104 anchor,
4105 instance2,
4106 parentSuspense,
4107 namespace,
4108 vnode.slotScopeIds,
4109 optimized
4110 );
4111 queuePostRenderEffect(() => {
4112 instance2.isDeactivated = false;
4113 if (instance2.a) {
4114 invokeArrayFns(instance2.a);
4115 }
4116 const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
4117 if (vnodeHook) {
4118 invokeVNodeHook(vnodeHook, instance2.parent, vnode);
4119 }
4120 }, parentSuspense);
4121 {
4122 devtoolsComponentAdded(instance2);
4123 }
4124 };
4125 sharedContext.deactivate = (vnode) => {
4126 const instance2 = vnode.component;
4127 move(vnode, storageContainer, null, 1, parentSuspense);
4128 queuePostRenderEffect(() => {
4129 if (instance2.da) {
4130 invokeArrayFns(instance2.da);
4131 }
4132 const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
4133 if (vnodeHook) {
4134 invokeVNodeHook(vnodeHook, instance2.parent, vnode);
4135 }
4136 instance2.isDeactivated = true;
4137 }, parentSuspense);
4138 {
4139 devtoolsComponentAdded(instance2);
4140 }
4141 };
4142 function unmount(vnode) {
4143 resetShapeFlag(vnode);
4144 _unmount(vnode, instance, parentSuspense, true);
4145 }
4146 function pruneCache(filter) {
4147 cache.forEach((vnode, key) => {
4148 const name = getComponentName(vnode.type);
4149 if (name && (!filter || !filter(name))) {
4150 pruneCacheEntry(key);
4151 }
4152 });
4153 }
4154 function pruneCacheEntry(key) {
4155 const cached = cache.get(key);
4156 if (!current || !isSameVNodeType(cached, current)) {
4157 unmount(cached);
4158 } else if (current) {
4159 resetShapeFlag(current);
4160 }
4161 cache.delete(key);
4162 keys.delete(key);
4163 }
4164 watch(
4165 () => [props.include, props.exclude],
4166 ([include, exclude]) => {
4167 include && pruneCache((name) => matches(include, name));
4168 exclude && pruneCache((name) => !matches(exclude, name));
4169 },
4170 // prune post-render after `current` has been updated
4171 { flush: "post", deep: true }
4172 );
4173 let pendingCacheKey = null;
4174 const cacheSubtree = () => {
4175 if (pendingCacheKey != null) {
4176 cache.set(pendingCacheKey, getInnerChild(instance.subTree));
4177 }
4178 };
4179 onMounted(cacheSubtree);
4180 onUpdated(cacheSubtree);
4181 onBeforeUnmount(() => {
4182 cache.forEach((cached) => {
4183 const { subTree, suspense } = instance;
4184 const vnode = getInnerChild(subTree);
4185 if (cached.type === vnode.type && cached.key === vnode.key) {
4186 resetShapeFlag(vnode);
4187 const da = vnode.component.da;
4188 da && queuePostRenderEffect(da, suspense);
4189 return;
4190 }
4191 unmount(cached);
4192 });
4193 });
4194 return () => {
4195 pendingCacheKey = null;
4196 if (!slots.default) {
4197 return null;
4198 }
4199 const children = slots.default();
4200 const rawVNode = children[0];
4201 if (children.length > 1) {
4202 {
4203 warn$1(`KeepAlive should contain exactly one component child.`);
4204 }
4205 current = null;
4206 return children;
4207 } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
4208 current = null;
4209 return rawVNode;
4210 }
4211 let vnode = getInnerChild(rawVNode);
4212 const comp = vnode.type;
4213 const name = getComponentName(
4214 isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
4215 );
4216 const { include, exclude, max } = props;
4217 if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
4218 current = vnode;
4219 return rawVNode;
4220 }
4221 const key = vnode.key == null ? comp : vnode.key;
4222 const cachedVNode = cache.get(key);
4223 if (vnode.el) {
4224 vnode = cloneVNode(vnode);
4225 if (rawVNode.shapeFlag & 128) {
4226 rawVNode.ssContent = vnode;
4227 }
4228 }
4229 pendingCacheKey = key;
4230 if (cachedVNode) {
4231 vnode.el = cachedVNode.el;
4232 vnode.component = cachedVNode.component;
4233 if (vnode.transition) {
4234 setTransitionHooks(vnode, vnode.transition);
4235 }
4236 vnode.shapeFlag |= 512;
4237 keys.delete(key);
4238 keys.add(key);
4239 } else {
4240 keys.add(key);
4241 if (max && keys.size > parseInt(max, 10)) {
4242 pruneCacheEntry(keys.values().next().value);
4243 }
4244 }
4245 vnode.shapeFlag |= 256;
4246 current = vnode;
4247 return isSuspense(rawVNode.type) ? rawVNode : vnode;
4248 };
4249 }
4250};
4251const KeepAlive = KeepAliveImpl;
4252function matches(pattern, name) {
4253 if (isArray(pattern)) {
4254 return pattern.some((p) => matches(p, name));
4255 } else if (isString(pattern)) {
4256 return pattern.split(",").includes(name);
4257 } else if (isRegExp(pattern)) {
4258 return pattern.test(name);
4259 }
4260 return false;
4261}
4262function onActivated(hook, target) {
4263 registerKeepAliveHook(hook, "a", target);
4264}
4265function onDeactivated(hook, target) {
4266 registerKeepAliveHook(hook, "da", target);
4267}
4268function registerKeepAliveHook(hook, type, target = currentInstance) {
4269 const wrappedHook = hook.__wdc || (hook.__wdc = () => {
4270 let current = target;
4271 while (current) {
4272 if (current.isDeactivated) {
4273 return;
4274 }
4275 current = current.parent;
4276 }
4277 return hook();
4278 });
4279 injectHook(type, wrappedHook, target);
4280 if (target) {
4281 let current = target.parent;
4282 while (current && current.parent) {
4283 if (isKeepAlive(current.parent.vnode)) {
4284 injectToKeepAliveRoot(wrappedHook, type, target, current);
4285 }
4286 current = current.parent;
4287 }
4288 }
4289}
4290function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4291 const injected = injectHook(
4292 type,
4293 hook,
4294 keepAliveRoot,
4295 true
4296 /* prepend */
4297 );
4298 onUnmounted(() => {
4299 remove(keepAliveRoot[type], injected);
4300 }, target);
4301}
4302function resetShapeFlag(vnode) {
4303 vnode.shapeFlag &= ~256;
4304 vnode.shapeFlag &= ~512;
4305}
4306function getInnerChild(vnode) {
4307 return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
4308}
4309
4310function injectHook(type, hook, target = currentInstance, prepend = false) {
4311 if (target) {
4312 const hooks = target[type] || (target[type] = []);
4313 const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
4314 if (target.isUnmounted) {
4315 return;
4316 }
4317 pauseTracking();
4318 const reset = setCurrentInstance(target);
4319 const res = callWithAsyncErrorHandling(hook, target, type, args);
4320 reset();
4321 resetTracking();
4322 return res;
4323 });
4324 if (prepend) {
4325 hooks.unshift(wrappedHook);
4326 } else {
4327 hooks.push(wrappedHook);
4328 }
4329 return wrappedHook;
4330 } else {
4331 const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
4332 warn$1(
4333 `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
4334 );
4335 }
4336}
4337const createHook = (lifecycle) => (hook, target = currentInstance) => (
4338 // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
4339 (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target)
4340);
4341const onBeforeMount = createHook("bm");
4342const onMounted = createHook("m");
4343const onBeforeUpdate = createHook("bu");
4344const onUpdated = createHook("u");
4345const onBeforeUnmount = createHook("bum");
4346const onUnmounted = createHook("um");
4347const onServerPrefetch = createHook("sp");
4348const onRenderTriggered = createHook(
4349 "rtg"
4350);
4351const onRenderTracked = createHook(
4352 "rtc"
4353);
4354function onErrorCaptured(hook, target = currentInstance) {
4355 injectHook("ec", hook, target);
4356}
4357
4358function renderList(source, renderItem, cache, index) {
4359 let ret;
4360 const cached = cache && cache[index];
4361 if (isArray(source) || isString(source)) {
4362 ret = new Array(source.length);
4363 for (let i = 0, l = source.length; i < l; i++) {
4364 ret[i] = renderItem(source[i], i, void 0, cached && cached[i]);
4365 }
4366 } else if (typeof source === "number") {
4367 if (!Number.isInteger(source)) {
4368 warn$1(`The v-for range expect an integer value but got ${source}.`);
4369 }
4370 ret = new Array(source);
4371 for (let i = 0; i < source; i++) {
4372 ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
4373 }
4374 } else if (isObject(source)) {
4375 if (source[Symbol.iterator]) {
4376 ret = Array.from(
4377 source,
4378 (item, i) => renderItem(item, i, void 0, cached && cached[i])
4379 );
4380 } else {
4381 const keys = Object.keys(source);
4382 ret = new Array(keys.length);
4383 for (let i = 0, l = keys.length; i < l; i++) {
4384 const key = keys[i];
4385 ret[i] = renderItem(source[key], key, i, cached && cached[i]);
4386 }
4387 }
4388 } else {
4389 ret = [];
4390 }
4391 if (cache) {
4392 cache[index] = ret;
4393 }
4394 return ret;
4395}
4396
4397function createSlots(slots, dynamicSlots) {
4398 for (let i = 0; i < dynamicSlots.length; i++) {
4399 const slot = dynamicSlots[i];
4400 if (isArray(slot)) {
4401 for (let j = 0; j < slot.length; j++) {
4402 slots[slot[j].name] = slot[j].fn;
4403 }
4404 } else if (slot) {
4405 slots[slot.name] = slot.key ? (...args) => {
4406 const res = slot.fn(...args);
4407 if (res)
4408 res.key = slot.key;
4409 return res;
4410 } : slot.fn;
4411 }
4412 }
4413 return slots;
4414}
4415
4416function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4417 if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
4418 if (name !== "default")
4419 props.name = name;
4420 return createVNode("slot", props, fallback && fallback());
4421 }
4422 let slot = slots[name];
4423 if (slot && slot.length > 1) {
4424 warn$1(
4425 `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`
4426 );
4427 slot = () => [];
4428 }
4429 if (slot && slot._c) {
4430 slot._d = false;
4431 }
4432 openBlock();
4433 const validSlotContent = slot && ensureValidVNode(slot(props));
4434 const rendered = createBlock(
4435 Fragment,
4436 {
4437 key: props.key || // slot content array of a dynamic conditional slot may have a branch
4438 // key attached in the `createSlots` helper, respect that
4439 validSlotContent && validSlotContent.key || `_${name}`
4440 },
4441 validSlotContent || (fallback ? fallback() : []),
4442 validSlotContent && slots._ === 1 ? 64 : -2
4443 );
4444 if (!noSlotted && rendered.scopeId) {
4445 rendered.slotScopeIds = [rendered.scopeId + "-s"];
4446 }
4447 if (slot && slot._c) {
4448 slot._d = true;
4449 }
4450 return rendered;
4451}
4452function ensureValidVNode(vnodes) {
4453 return vnodes.some((child) => {
4454 if (!isVNode(child))
4455 return true;
4456 if (child.type === Comment)
4457 return false;
4458 if (child.type === Fragment && !ensureValidVNode(child.children))
4459 return false;
4460 return true;
4461 }) ? vnodes : null;
4462}
4463
4464function toHandlers(obj, preserveCaseIfNecessary) {
4465 const ret = {};
4466 if (!isObject(obj)) {
4467 warn$1(`v-on with no argument expects an object value.`);
4468 return ret;
4469 }
4470 for (const key in obj) {
4471 ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
4472 }
4473 return ret;
4474}
4475
4476const getPublicInstance = (i) => {
4477 if (!i)
4478 return null;
4479 if (isStatefulComponent(i))
4480 return getExposeProxy(i) || i.proxy;
4481 return getPublicInstance(i.parent);
4482};
4483const publicPropertiesMap = (
4484 // Move PURE marker to new line to workaround compiler discarding it
4485 // due to type annotation
4486 /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
4487 $: (i) => i,
4488 $el: (i) => i.vnode.el,
4489 $data: (i) => i.data,
4490 $props: (i) => shallowReadonly(i.props) ,
4491 $attrs: (i) => shallowReadonly(i.attrs) ,
4492 $slots: (i) => shallowReadonly(i.slots) ,
4493 $refs: (i) => shallowReadonly(i.refs) ,
4494 $parent: (i) => getPublicInstance(i.parent),
4495 $root: (i) => getPublicInstance(i.root),
4496 $emit: (i) => i.emit,
4497 $options: (i) => resolveMergedOptions(i) ,
4498 $forceUpdate: (i) => i.f || (i.f = () => {
4499 i.effect.dirty = true;
4500 queueJob(i.update);
4501 }),
4502 $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
4503 $watch: (i) => instanceWatch.bind(i)
4504 })
4505);
4506const isReservedPrefix = (key) => key === "_" || key === "$";
4507const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
4508const PublicInstanceProxyHandlers = {
4509 get({ _: instance }, key) {
4510 const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
4511 if (key === "__isVue") {
4512 return true;
4513 }
4514 let normalizedProps;
4515 if (key[0] !== "$") {
4516 const n = accessCache[key];
4517 if (n !== void 0) {
4518 switch (n) {
4519 case 1 /* SETUP */:
4520 return setupState[key];
4521 case 2 /* DATA */:
4522 return data[key];
4523 case 4 /* CONTEXT */:
4524 return ctx[key];
4525 case 3 /* PROPS */:
4526 return props[key];
4527 }
4528 } else if (hasSetupBinding(setupState, key)) {
4529 accessCache[key] = 1 /* SETUP */;
4530 return setupState[key];
4531 } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
4532 accessCache[key] = 2 /* DATA */;
4533 return data[key];
4534 } else if (
4535 // only cache other properties when instance has declared (thus stable)
4536 // props
4537 (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
4538 ) {
4539 accessCache[key] = 3 /* PROPS */;
4540 return props[key];
4541 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
4542 accessCache[key] = 4 /* CONTEXT */;
4543 return ctx[key];
4544 } else if (shouldCacheAccess) {
4545 accessCache[key] = 0 /* OTHER */;
4546 }
4547 }
4548 const publicGetter = publicPropertiesMap[key];
4549 let cssModule, globalProperties;
4550 if (publicGetter) {
4551 if (key === "$attrs") {
4552 track(instance, "get", key);
4553 markAttrsAccessed();
4554 } else if (key === "$slots") {
4555 track(instance, "get", key);
4556 }
4557 return publicGetter(instance);
4558 } else if (
4559 // css module (injected by vue-loader)
4560 (cssModule = type.__cssModules) && (cssModule = cssModule[key])
4561 ) {
4562 return cssModule;
4563 } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
4564 accessCache[key] = 4 /* CONTEXT */;
4565 return ctx[key];
4566 } else if (
4567 // global properties
4568 globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
4569 ) {
4570 {
4571 return globalProperties[key];
4572 }
4573 } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
4574 // to infinite warning loop
4575 key.indexOf("__v") !== 0)) {
4576 if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
4577 warn$1(
4578 `Property ${JSON.stringify(
4579 key
4580 )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
4581 );
4582 } else if (instance === currentRenderingInstance) {
4583 warn$1(
4584 `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
4585 );
4586 }
4587 }
4588 },
4589 set({ _: instance }, key, value) {
4590 const { data, setupState, ctx } = instance;
4591 if (hasSetupBinding(setupState, key)) {
4592 setupState[key] = value;
4593 return true;
4594 } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
4595 warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
4596 return false;
4597 } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
4598 data[key] = value;
4599 return true;
4600 } else if (hasOwn(instance.props, key)) {
4601 warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
4602 return false;
4603 }
4604 if (key[0] === "$" && key.slice(1) in instance) {
4605 warn$1(
4606 `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
4607 );
4608 return false;
4609 } else {
4610 if (key in instance.appContext.config.globalProperties) {
4611 Object.defineProperty(ctx, key, {
4612 enumerable: true,
4613 configurable: true,
4614 value
4615 });
4616 } else {
4617 ctx[key] = value;
4618 }
4619 }
4620 return true;
4621 },
4622 has({
4623 _: { data, setupState, accessCache, ctx, appContext, propsOptions }
4624 }, key) {
4625 let normalizedProps;
4626 return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
4627 },
4628 defineProperty(target, key, descriptor) {
4629 if (descriptor.get != null) {
4630 target._.accessCache[key] = 0;
4631 } else if (hasOwn(descriptor, "value")) {
4632 this.set(target, key, descriptor.value, null);
4633 }
4634 return Reflect.defineProperty(target, key, descriptor);
4635 }
4636};
4637{
4638 PublicInstanceProxyHandlers.ownKeys = (target) => {
4639 warn$1(
4640 `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
4641 );
4642 return Reflect.ownKeys(target);
4643 };
4644}
4645const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
4646 {},
4647 PublicInstanceProxyHandlers,
4648 {
4649 get(target, key) {
4650 if (key === Symbol.unscopables) {
4651 return;
4652 }
4653 return PublicInstanceProxyHandlers.get(target, key, target);
4654 },
4655 has(_, key) {
4656 const has = key[0] !== "_" && !isGloballyAllowed(key);
4657 if (!has && PublicInstanceProxyHandlers.has(_, key)) {
4658 warn$1(
4659 `Property ${JSON.stringify(
4660 key
4661 )} should not start with _ which is a reserved prefix for Vue internals.`
4662 );
4663 }
4664 return has;
4665 }
4666 }
4667);
4668function createDevRenderContext(instance) {
4669 const target = {};
4670 Object.defineProperty(target, `_`, {
4671 configurable: true,
4672 enumerable: false,
4673 get: () => instance
4674 });
4675 Object.keys(publicPropertiesMap).forEach((key) => {
4676 Object.defineProperty(target, key, {
4677 configurable: true,
4678 enumerable: false,
4679 get: () => publicPropertiesMap[key](instance),
4680 // intercepted by the proxy so no need for implementation,
4681 // but needed to prevent set errors
4682 set: NOOP
4683 });
4684 });
4685 return target;
4686}
4687function exposePropsOnRenderContext(instance) {
4688 const {
4689 ctx,
4690 propsOptions: [propsOptions]
4691 } = instance;
4692 if (propsOptions) {
4693 Object.keys(propsOptions).forEach((key) => {
4694 Object.defineProperty(ctx, key, {
4695 enumerable: true,
4696 configurable: true,
4697 get: () => instance.props[key],
4698 set: NOOP
4699 });
4700 });
4701 }
4702}
4703function exposeSetupStateOnRenderContext(instance) {
4704 const { ctx, setupState } = instance;
4705 Object.keys(toRaw(setupState)).forEach((key) => {
4706 if (!setupState.__isScriptSetup) {
4707 if (isReservedPrefix(key[0])) {
4708 warn$1(
4709 `setup() return property ${JSON.stringify(
4710 key
4711 )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
4712 );
4713 return;
4714 }
4715 Object.defineProperty(ctx, key, {
4716 enumerable: true,
4717 configurable: true,
4718 get: () => setupState[key],
4719 set: NOOP
4720 });
4721 }
4722 });
4723}
4724
4725const warnRuntimeUsage = (method) => warn$1(
4726 `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
4727);
4728function defineProps() {
4729 {
4730 warnRuntimeUsage(`defineProps`);
4731 }
4732 return null;
4733}
4734function defineEmits() {
4735 {
4736 warnRuntimeUsage(`defineEmits`);
4737 }
4738 return null;
4739}
4740function defineExpose(exposed) {
4741 {
4742 warnRuntimeUsage(`defineExpose`);
4743 }
4744}
4745function defineOptions(options) {
4746 {
4747 warnRuntimeUsage(`defineOptions`);
4748 }
4749}
4750function defineSlots() {
4751 {
4752 warnRuntimeUsage(`defineSlots`);
4753 }
4754 return null;
4755}
4756function defineModel() {
4757 {
4758 warnRuntimeUsage("defineModel");
4759 }
4760}
4761function withDefaults(props, defaults) {
4762 {
4763 warnRuntimeUsage(`withDefaults`);
4764 }
4765 return null;
4766}
4767function useSlots() {
4768 return getContext().slots;
4769}
4770function useAttrs() {
4771 return getContext().attrs;
4772}
4773function getContext() {
4774 const i = getCurrentInstance();
4775 if (!i) {
4776 warn$1(`useContext() called without active instance.`);
4777 }
4778 return i.setupContext || (i.setupContext = createSetupContext(i));
4779}
4780function normalizePropsOrEmits(props) {
4781 return isArray(props) ? props.reduce(
4782 (normalized, p) => (normalized[p] = null, normalized),
4783 {}
4784 ) : props;
4785}
4786function mergeDefaults(raw, defaults) {
4787 const props = normalizePropsOrEmits(raw);
4788 for (const key in defaults) {
4789 if (key.startsWith("__skip"))
4790 continue;
4791 let opt = props[key];
4792 if (opt) {
4793 if (isArray(opt) || isFunction(opt)) {
4794 opt = props[key] = { type: opt, default: defaults[key] };
4795 } else {
4796 opt.default = defaults[key];
4797 }
4798 } else if (opt === null) {
4799 opt = props[key] = { default: defaults[key] };
4800 } else {
4801 warn$1(`props default key "${key}" has no corresponding declaration.`);
4802 }
4803 if (opt && defaults[`__skip_${key}`]) {
4804 opt.skipFactory = true;
4805 }
4806 }
4807 return props;
4808}
4809function mergeModels(a, b) {
4810 if (!a || !b)
4811 return a || b;
4812 if (isArray(a) && isArray(b))
4813 return a.concat(b);
4814 return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
4815}
4816function createPropsRestProxy(props, excludedKeys) {
4817 const ret = {};
4818 for (const key in props) {
4819 if (!excludedKeys.includes(key)) {
4820 Object.defineProperty(ret, key, {
4821 enumerable: true,
4822 get: () => props[key]
4823 });
4824 }
4825 }
4826 return ret;
4827}
4828function withAsyncContext(getAwaitable) {
4829 const ctx = getCurrentInstance();
4830 if (!ctx) {
4831 warn$1(
4832 `withAsyncContext called without active current instance. This is likely a bug.`
4833 );
4834 }
4835 let awaitable = getAwaitable();
4836 unsetCurrentInstance();
4837 if (isPromise(awaitable)) {
4838 awaitable = awaitable.catch((e) => {
4839 setCurrentInstance(ctx);
4840 throw e;
4841 });
4842 }
4843 return [awaitable, () => setCurrentInstance(ctx)];
4844}
4845
4846function createDuplicateChecker() {
4847 const cache = /* @__PURE__ */ Object.create(null);
4848 return (type, key) => {
4849 if (cache[key]) {
4850 warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
4851 } else {
4852 cache[key] = type;
4853 }
4854 };
4855}
4856let shouldCacheAccess = true;
4857function applyOptions(instance) {
4858 const options = resolveMergedOptions(instance);
4859 const publicThis = instance.proxy;
4860 const ctx = instance.ctx;
4861 shouldCacheAccess = false;
4862 if (options.beforeCreate) {
4863 callHook$1(options.beforeCreate, instance, "bc");
4864 }
4865 const {
4866 // state
4867 data: dataOptions,
4868 computed: computedOptions,
4869 methods,
4870 watch: watchOptions,
4871 provide: provideOptions,
4872 inject: injectOptions,
4873 // lifecycle
4874 created,
4875 beforeMount,
4876 mounted,
4877 beforeUpdate,
4878 updated,
4879 activated,
4880 deactivated,
4881 beforeDestroy,
4882 beforeUnmount,
4883 destroyed,
4884 unmounted,
4885 render,
4886 renderTracked,
4887 renderTriggered,
4888 errorCaptured,
4889 serverPrefetch,
4890 // public API
4891 expose,
4892 inheritAttrs,
4893 // assets
4894 components,
4895 directives,
4896 filters
4897 } = options;
4898 const checkDuplicateProperties = createDuplicateChecker() ;
4899 {
4900 const [propsOptions] = instance.propsOptions;
4901 if (propsOptions) {
4902 for (const key in propsOptions) {
4903 checkDuplicateProperties("Props" /* PROPS */, key);
4904 }
4905 }
4906 }
4907 if (injectOptions) {
4908 resolveInjections(injectOptions, ctx, checkDuplicateProperties);
4909 }
4910 if (methods) {
4911 for (const key in methods) {
4912 const methodHandler = methods[key];
4913 if (isFunction(methodHandler)) {
4914 {
4915 Object.defineProperty(ctx, key, {
4916 value: methodHandler.bind(publicThis),
4917 configurable: true,
4918 enumerable: true,
4919 writable: true
4920 });
4921 }
4922 {
4923 checkDuplicateProperties("Methods" /* METHODS */, key);
4924 }
4925 } else {
4926 warn$1(
4927 `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
4928 );
4929 }
4930 }
4931 }
4932 if (dataOptions) {
4933 if (!isFunction(dataOptions)) {
4934 warn$1(
4935 `The data option must be a function. Plain object usage is no longer supported.`
4936 );
4937 }
4938 const data = dataOptions.call(publicThis, publicThis);
4939 if (isPromise(data)) {
4940 warn$1(
4941 `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
4942 );
4943 }
4944 if (!isObject(data)) {
4945 warn$1(`data() should return an object.`);
4946 } else {
4947 instance.data = reactive(data);
4948 {
4949 for (const key in data) {
4950 checkDuplicateProperties("Data" /* DATA */, key);
4951 if (!isReservedPrefix(key[0])) {
4952 Object.defineProperty(ctx, key, {
4953 configurable: true,
4954 enumerable: true,
4955 get: () => data[key],
4956 set: NOOP
4957 });
4958 }
4959 }
4960 }
4961 }
4962 }
4963 shouldCacheAccess = true;
4964 if (computedOptions) {
4965 for (const key in computedOptions) {
4966 const opt = computedOptions[key];
4967 const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
4968 if (get === NOOP) {
4969 warn$1(`Computed property "${key}" has no getter.`);
4970 }
4971 const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
4972 warn$1(
4973 `Write operation failed: computed property "${key}" is readonly.`
4974 );
4975 } ;
4976 const c = computed({
4977 get,
4978 set
4979 });
4980 Object.defineProperty(ctx, key, {
4981 enumerable: true,
4982 configurable: true,
4983 get: () => c.value,
4984 set: (v) => c.value = v
4985 });
4986 {
4987 checkDuplicateProperties("Computed" /* COMPUTED */, key);
4988 }
4989 }
4990 }
4991 if (watchOptions) {
4992 for (const key in watchOptions) {
4993 createWatcher(watchOptions[key], ctx, publicThis, key);
4994 }
4995 }
4996 if (provideOptions) {
4997 const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
4998 Reflect.ownKeys(provides).forEach((key) => {
4999 provide(key, provides[key]);
5000 });
5001 }
5002 if (created) {
5003 callHook$1(created, instance, "c");
5004 }
5005 function registerLifecycleHook(register, hook) {
5006 if (isArray(hook)) {
5007 hook.forEach((_hook) => register(_hook.bind(publicThis)));
5008 } else if (hook) {
5009 register(hook.bind(publicThis));
5010 }
5011 }
5012 registerLifecycleHook(onBeforeMount, beforeMount);
5013 registerLifecycleHook(onMounted, mounted);
5014 registerLifecycleHook(onBeforeUpdate, beforeUpdate);
5015 registerLifecycleHook(onUpdated, updated);
5016 registerLifecycleHook(onActivated, activated);
5017 registerLifecycleHook(onDeactivated, deactivated);
5018 registerLifecycleHook(onErrorCaptured, errorCaptured);
5019 registerLifecycleHook(onRenderTracked, renderTracked);
5020 registerLifecycleHook(onRenderTriggered, renderTriggered);
5021 registerLifecycleHook(onBeforeUnmount, beforeUnmount);
5022 registerLifecycleHook(onUnmounted, unmounted);
5023 registerLifecycleHook(onServerPrefetch, serverPrefetch);
5024 if (isArray(expose)) {
5025 if (expose.length) {
5026 const exposed = instance.exposed || (instance.exposed = {});
5027 expose.forEach((key) => {
5028 Object.defineProperty(exposed, key, {
5029 get: () => publicThis[key],
5030 set: (val) => publicThis[key] = val
5031 });
5032 });
5033 } else if (!instance.exposed) {
5034 instance.exposed = {};
5035 }
5036 }
5037 if (render && instance.render === NOOP) {
5038 instance.render = render;
5039 }
5040 if (inheritAttrs != null) {
5041 instance.inheritAttrs = inheritAttrs;
5042 }
5043 if (components)
5044 instance.components = components;
5045 if (directives)
5046 instance.directives = directives;
5047}
5048function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
5049 if (isArray(injectOptions)) {
5050 injectOptions = normalizeInject(injectOptions);
5051 }
5052 for (const key in injectOptions) {
5053 const opt = injectOptions[key];
5054 let injected;
5055 if (isObject(opt)) {
5056 if ("default" in opt) {
5057 injected = inject(
5058 opt.from || key,
5059 opt.default,
5060 true
5061 );
5062 } else {
5063 injected = inject(opt.from || key);
5064 }
5065 } else {
5066 injected = inject(opt);
5067 }
5068 if (isRef(injected)) {
5069 Object.defineProperty(ctx, key, {
5070 enumerable: true,
5071 configurable: true,
5072 get: () => injected.value,
5073 set: (v) => injected.value = v
5074 });
5075 } else {
5076 ctx[key] = injected;
5077 }
5078 {
5079 checkDuplicateProperties("Inject" /* INJECT */, key);
5080 }
5081 }
5082}
5083function callHook$1(hook, instance, type) {
5084 callWithAsyncErrorHandling(
5085 isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
5086 instance,
5087 type
5088 );
5089}
5090function createWatcher(raw, ctx, publicThis, key) {
5091 const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
5092 if (isString(raw)) {
5093 const handler = ctx[raw];
5094 if (isFunction(handler)) {
5095 watch(getter, handler);
5096 } else {
5097 warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
5098 }
5099 } else if (isFunction(raw)) {
5100 watch(getter, raw.bind(publicThis));
5101 } else if (isObject(raw)) {
5102 if (isArray(raw)) {
5103 raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
5104 } else {
5105 const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
5106 if (isFunction(handler)) {
5107 watch(getter, handler, raw);
5108 } else {
5109 warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
5110 }
5111 }
5112 } else {
5113 warn$1(`Invalid watch option: "${key}"`, raw);
5114 }
5115}
5116function resolveMergedOptions(instance) {
5117 const base = instance.type;
5118 const { mixins, extends: extendsOptions } = base;
5119 const {
5120 mixins: globalMixins,
5121 optionsCache: cache,
5122 config: { optionMergeStrategies }
5123 } = instance.appContext;
5124 const cached = cache.get(base);
5125 let resolved;
5126 if (cached) {
5127 resolved = cached;
5128 } else if (!globalMixins.length && !mixins && !extendsOptions) {
5129 {
5130 resolved = base;
5131 }
5132 } else {
5133 resolved = {};
5134 if (globalMixins.length) {
5135 globalMixins.forEach(
5136 (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
5137 );
5138 }
5139 mergeOptions(resolved, base, optionMergeStrategies);
5140 }
5141 if (isObject(base)) {
5142 cache.set(base, resolved);
5143 }
5144 return resolved;
5145}
5146function mergeOptions(to, from, strats, asMixin = false) {
5147 const { mixins, extends: extendsOptions } = from;
5148 if (extendsOptions) {
5149 mergeOptions(to, extendsOptions, strats, true);
5150 }
5151 if (mixins) {
5152 mixins.forEach(
5153 (m) => mergeOptions(to, m, strats, true)
5154 );
5155 }
5156 for (const key in from) {
5157 if (asMixin && key === "expose") {
5158 warn$1(
5159 `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
5160 );
5161 } else {
5162 const strat = internalOptionMergeStrats[key] || strats && strats[key];
5163 to[key] = strat ? strat(to[key], from[key]) : from[key];
5164 }
5165 }
5166 return to;
5167}
5168const internalOptionMergeStrats = {
5169 data: mergeDataFn,
5170 props: mergeEmitsOrPropsOptions,
5171 emits: mergeEmitsOrPropsOptions,
5172 // objects
5173 methods: mergeObjectOptions,
5174 computed: mergeObjectOptions,
5175 // lifecycle
5176 beforeCreate: mergeAsArray,
5177 created: mergeAsArray,
5178 beforeMount: mergeAsArray,
5179 mounted: mergeAsArray,
5180 beforeUpdate: mergeAsArray,
5181 updated: mergeAsArray,
5182 beforeDestroy: mergeAsArray,
5183 beforeUnmount: mergeAsArray,
5184 destroyed: mergeAsArray,
5185 unmounted: mergeAsArray,
5186 activated: mergeAsArray,
5187 deactivated: mergeAsArray,
5188 errorCaptured: mergeAsArray,
5189 serverPrefetch: mergeAsArray,
5190 // assets
5191 components: mergeObjectOptions,
5192 directives: mergeObjectOptions,
5193 // watch
5194 watch: mergeWatchOptions,
5195 // provide / inject
5196 provide: mergeDataFn,
5197 inject: mergeInject
5198};
5199function mergeDataFn(to, from) {
5200 if (!from) {
5201 return to;
5202 }
5203 if (!to) {
5204 return from;
5205 }
5206 return function mergedDataFn() {
5207 return (extend)(
5208 isFunction(to) ? to.call(this, this) : to,
5209 isFunction(from) ? from.call(this, this) : from
5210 );
5211 };
5212}
5213function mergeInject(to, from) {
5214 return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
5215}
5216function normalizeInject(raw) {
5217 if (isArray(raw)) {
5218 const res = {};
5219 for (let i = 0; i < raw.length; i++) {
5220 res[raw[i]] = raw[i];
5221 }
5222 return res;
5223 }
5224 return raw;
5225}
5226function mergeAsArray(to, from) {
5227 return to ? [...new Set([].concat(to, from))] : from;
5228}
5229function mergeObjectOptions(to, from) {
5230 return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
5231}
5232function mergeEmitsOrPropsOptions(to, from) {
5233 if (to) {
5234 if (isArray(to) && isArray(from)) {
5235 return [.../* @__PURE__ */ new Set([...to, ...from])];
5236 }
5237 return extend(
5238 /* @__PURE__ */ Object.create(null),
5239 normalizePropsOrEmits(to),
5240 normalizePropsOrEmits(from != null ? from : {})
5241 );
5242 } else {
5243 return from;
5244 }
5245}
5246function mergeWatchOptions(to, from) {
5247 if (!to)
5248 return from;
5249 if (!from)
5250 return to;
5251 const merged = extend(/* @__PURE__ */ Object.create(null), to);
5252 for (const key in from) {
5253 merged[key] = mergeAsArray(to[key], from[key]);
5254 }
5255 return merged;
5256}
5257
5258function createAppContext() {
5259 return {
5260 app: null,
5261 config: {
5262 isNativeTag: NO,
5263 performance: false,
5264 globalProperties: {},
5265 optionMergeStrategies: {},
5266 errorHandler: void 0,
5267 warnHandler: void 0,
5268 compilerOptions: {}
5269 },
5270 mixins: [],
5271 components: {},
5272 directives: {},
5273 provides: /* @__PURE__ */ Object.create(null),
5274 optionsCache: /* @__PURE__ */ new WeakMap(),
5275 propsCache: /* @__PURE__ */ new WeakMap(),
5276 emitsCache: /* @__PURE__ */ new WeakMap()
5277 };
5278}
5279let uid$1 = 0;
5280function createAppAPI(render, hydrate) {
5281 return function createApp(rootComponent, rootProps = null) {
5282 if (!isFunction(rootComponent)) {
5283 rootComponent = extend({}, rootComponent);
5284 }
5285 if (rootProps != null && !isObject(rootProps)) {
5286 warn$1(`root props passed to app.mount() must be an object.`);
5287 rootProps = null;
5288 }
5289 const context = createAppContext();
5290 const installedPlugins = /* @__PURE__ */ new WeakSet();
5291 let isMounted = false;
5292 const app = context.app = {
5293 _uid: uid$1++,
5294 _component: rootComponent,
5295 _props: rootProps,
5296 _container: null,
5297 _context: context,
5298 _instance: null,
5299 version,
5300 get config() {
5301 return context.config;
5302 },
5303 set config(v) {
5304 {
5305 warn$1(
5306 `app.config cannot be replaced. Modify individual options instead.`
5307 );
5308 }
5309 },
5310 use(plugin, ...options) {
5311 if (installedPlugins.has(plugin)) {
5312 warn$1(`Plugin has already been applied to target app.`);
5313 } else if (plugin && isFunction(plugin.install)) {
5314 installedPlugins.add(plugin);
5315 plugin.install(app, ...options);
5316 } else if (isFunction(plugin)) {
5317 installedPlugins.add(plugin);
5318 plugin(app, ...options);
5319 } else {
5320 warn$1(
5321 `A plugin must either be a function or an object with an "install" function.`
5322 );
5323 }
5324 return app;
5325 },
5326 mixin(mixin) {
5327 {
5328 if (!context.mixins.includes(mixin)) {
5329 context.mixins.push(mixin);
5330 } else {
5331 warn$1(
5332 "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
5333 );
5334 }
5335 }
5336 return app;
5337 },
5338 component(name, component) {
5339 {
5340 validateComponentName(name, context.config);
5341 }
5342 if (!component) {
5343 return context.components[name];
5344 }
5345 if (context.components[name]) {
5346 warn$1(`Component "${name}" has already been registered in target app.`);
5347 }
5348 context.components[name] = component;
5349 return app;
5350 },
5351 directive(name, directive) {
5352 {
5353 validateDirectiveName(name);
5354 }
5355 if (!directive) {
5356 return context.directives[name];
5357 }
5358 if (context.directives[name]) {
5359 warn$1(`Directive "${name}" has already been registered in target app.`);
5360 }
5361 context.directives[name] = directive;
5362 return app;
5363 },
5364 mount(rootContainer, isHydrate, namespace) {
5365 if (!isMounted) {
5366 if (rootContainer.__vue_app__) {
5367 warn$1(
5368 `There is already an app instance mounted on the host container.
5369 If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
5370 );
5371 }
5372 const vnode = createVNode(rootComponent, rootProps);
5373 vnode.appContext = context;
5374 if (namespace === true) {
5375 namespace = "svg";
5376 } else if (namespace === false) {
5377 namespace = void 0;
5378 }
5379 {
5380 context.reload = () => {
5381 render(
5382 cloneVNode(vnode),
5383 rootContainer,
5384 namespace
5385 );
5386 };
5387 }
5388 if (isHydrate && hydrate) {
5389 hydrate(vnode, rootContainer);
5390 } else {
5391 render(vnode, rootContainer, namespace);
5392 }
5393 isMounted = true;
5394 app._container = rootContainer;
5395 rootContainer.__vue_app__ = app;
5396 {
5397 app._instance = vnode.component;
5398 devtoolsInitApp(app, version);
5399 }
5400 return getExposeProxy(vnode.component) || vnode.component.proxy;
5401 } else {
5402 warn$1(
5403 `App has already been mounted.
5404If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
5405 );
5406 }
5407 },
5408 unmount() {
5409 if (isMounted) {
5410 render(null, app._container);
5411 {
5412 app._instance = null;
5413 devtoolsUnmountApp(app);
5414 }
5415 delete app._container.__vue_app__;
5416 } else {
5417 warn$1(`Cannot unmount an app that is not mounted.`);
5418 }
5419 },
5420 provide(key, value) {
5421 if (key in context.provides) {
5422 warn$1(
5423 `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
5424 );
5425 }
5426 context.provides[key] = value;
5427 return app;
5428 },
5429 runWithContext(fn) {
5430 const lastApp = currentApp;
5431 currentApp = app;
5432 try {
5433 return fn();
5434 } finally {
5435 currentApp = lastApp;
5436 }
5437 }
5438 };
5439 return app;
5440 };
5441}
5442let currentApp = null;
5443
5444function provide(key, value) {
5445 if (!currentInstance) {
5446 {
5447 warn$1(`provide() can only be used inside setup().`);
5448 }
5449 } else {
5450 let provides = currentInstance.provides;
5451 const parentProvides = currentInstance.parent && currentInstance.parent.provides;
5452 if (parentProvides === provides) {
5453 provides = currentInstance.provides = Object.create(parentProvides);
5454 }
5455 provides[key] = value;
5456 }
5457}
5458function inject(key, defaultValue, treatDefaultAsFactory = false) {
5459 const instance = currentInstance || currentRenderingInstance;
5460 if (instance || currentApp) {
5461 const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
5462 if (provides && key in provides) {
5463 return provides[key];
5464 } else if (arguments.length > 1) {
5465 return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
5466 } else {
5467 warn$1(`injection "${String(key)}" not found.`);
5468 }
5469 } else {
5470 warn$1(`inject() can only be used inside setup() or functional components.`);
5471 }
5472}
5473function hasInjectionContext() {
5474 return !!(currentInstance || currentRenderingInstance || currentApp);
5475}
5476
5477function initProps(instance, rawProps, isStateful, isSSR = false) {
5478 const props = {};
5479 const attrs = {};
5480 def(attrs, InternalObjectKey, 1);
5481 instance.propsDefaults = /* @__PURE__ */ Object.create(null);
5482 setFullProps(instance, rawProps, props, attrs);
5483 for (const key in instance.propsOptions[0]) {
5484 if (!(key in props)) {
5485 props[key] = void 0;
5486 }
5487 }
5488 {
5489 validateProps(rawProps || {}, props, instance);
5490 }
5491 if (isStateful) {
5492 instance.props = isSSR ? props : shallowReactive(props);
5493 } else {
5494 if (!instance.type.props) {
5495 instance.props = attrs;
5496 } else {
5497 instance.props = props;
5498 }
5499 }
5500 instance.attrs = attrs;
5501}
5502function isInHmrContext(instance) {
5503 while (instance) {
5504 if (instance.type.__hmrId)
5505 return true;
5506 instance = instance.parent;
5507 }
5508}
5509function updateProps(instance, rawProps, rawPrevProps, optimized) {
5510 const {
5511 props,
5512 attrs,
5513 vnode: { patchFlag }
5514 } = instance;
5515 const rawCurrentProps = toRaw(props);
5516 const [options] = instance.propsOptions;
5517 let hasAttrsChanged = false;
5518 if (
5519 // always force full diff in dev
5520 // - #1942 if hmr is enabled with sfc component
5521 // - vite#872 non-sfc component used by sfc component
5522 !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
5523 ) {
5524 if (patchFlag & 8) {
5525 const propsToUpdate = instance.vnode.dynamicProps;
5526 for (let i = 0; i < propsToUpdate.length; i++) {
5527 let key = propsToUpdate[i];
5528 if (isEmitListener(instance.emitsOptions, key)) {
5529 continue;
5530 }
5531 const value = rawProps[key];
5532 if (options) {
5533 if (hasOwn(attrs, key)) {
5534 if (value !== attrs[key]) {
5535 attrs[key] = value;
5536 hasAttrsChanged = true;
5537 }
5538 } else {
5539 const camelizedKey = camelize(key);
5540 props[camelizedKey] = resolvePropValue(
5541 options,
5542 rawCurrentProps,
5543 camelizedKey,
5544 value,
5545 instance,
5546 false
5547 );
5548 }
5549 } else {
5550 if (value !== attrs[key]) {
5551 attrs[key] = value;
5552 hasAttrsChanged = true;
5553 }
5554 }
5555 }
5556 }
5557 } else {
5558 if (setFullProps(instance, rawProps, props, attrs)) {
5559 hasAttrsChanged = true;
5560 }
5561 let kebabKey;
5562 for (const key in rawCurrentProps) {
5563 if (!rawProps || // for camelCase
5564 !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
5565 // and converted to camelCase (#955)
5566 ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
5567 if (options) {
5568 if (rawPrevProps && // for camelCase
5569 (rawPrevProps[key] !== void 0 || // for kebab-case
5570 rawPrevProps[kebabKey] !== void 0)) {
5571 props[key] = resolvePropValue(
5572 options,
5573 rawCurrentProps,
5574 key,
5575 void 0,
5576 instance,
5577 true
5578 );
5579 }
5580 } else {
5581 delete props[key];
5582 }
5583 }
5584 }
5585 if (attrs !== rawCurrentProps) {
5586 for (const key in attrs) {
5587 if (!rawProps || !hasOwn(rawProps, key) && true) {
5588 delete attrs[key];
5589 hasAttrsChanged = true;
5590 }
5591 }
5592 }
5593 }
5594 if (hasAttrsChanged) {
5595 trigger(instance, "set", "$attrs");
5596 }
5597 {
5598 validateProps(rawProps || {}, props, instance);
5599 }
5600}
5601function setFullProps(instance, rawProps, props, attrs) {
5602 const [options, needCastKeys] = instance.propsOptions;
5603 let hasAttrsChanged = false;
5604 let rawCastValues;
5605 if (rawProps) {
5606 for (let key in rawProps) {
5607 if (isReservedProp(key)) {
5608 continue;
5609 }
5610 const value = rawProps[key];
5611 let camelKey;
5612 if (options && hasOwn(options, camelKey = camelize(key))) {
5613 if (!needCastKeys || !needCastKeys.includes(camelKey)) {
5614 props[camelKey] = value;
5615 } else {
5616 (rawCastValues || (rawCastValues = {}))[camelKey] = value;
5617 }
5618 } else if (!isEmitListener(instance.emitsOptions, key)) {
5619 if (!(key in attrs) || value !== attrs[key]) {
5620 attrs[key] = value;
5621 hasAttrsChanged = true;
5622 }
5623 }
5624 }
5625 }
5626 if (needCastKeys) {
5627 const rawCurrentProps = toRaw(props);
5628 const castValues = rawCastValues || EMPTY_OBJ;
5629 for (let i = 0; i < needCastKeys.length; i++) {
5630 const key = needCastKeys[i];
5631 props[key] = resolvePropValue(
5632 options,
5633 rawCurrentProps,
5634 key,
5635 castValues[key],
5636 instance,
5637 !hasOwn(castValues, key)
5638 );
5639 }
5640 }
5641 return hasAttrsChanged;
5642}
5643function resolvePropValue(options, props, key, value, instance, isAbsent) {
5644 const opt = options[key];
5645 if (opt != null) {
5646 const hasDefault = hasOwn(opt, "default");
5647 if (hasDefault && value === void 0) {
5648 const defaultValue = opt.default;
5649 if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
5650 const { propsDefaults } = instance;
5651 if (key in propsDefaults) {
5652 value = propsDefaults[key];
5653 } else {
5654 const reset = setCurrentInstance(instance);
5655 value = propsDefaults[key] = defaultValue.call(
5656 null,
5657 props
5658 );
5659 reset();
5660 }
5661 } else {
5662 value = defaultValue;
5663 }
5664 }
5665 if (opt[0 /* shouldCast */]) {
5666 if (isAbsent && !hasDefault) {
5667 value = false;
5668 } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
5669 value = true;
5670 }
5671 }
5672 }
5673 return value;
5674}
5675function normalizePropsOptions(comp, appContext, asMixin = false) {
5676 const cache = appContext.propsCache;
5677 const cached = cache.get(comp);
5678 if (cached) {
5679 return cached;
5680 }
5681 const raw = comp.props;
5682 const normalized = {};
5683 const needCastKeys = [];
5684 let hasExtends = false;
5685 if (!isFunction(comp)) {
5686 const extendProps = (raw2) => {
5687 hasExtends = true;
5688 const [props, keys] = normalizePropsOptions(raw2, appContext, true);
5689 extend(normalized, props);
5690 if (keys)
5691 needCastKeys.push(...keys);
5692 };
5693 if (!asMixin && appContext.mixins.length) {
5694 appContext.mixins.forEach(extendProps);
5695 }
5696 if (comp.extends) {
5697 extendProps(comp.extends);
5698 }
5699 if (comp.mixins) {
5700 comp.mixins.forEach(extendProps);
5701 }
5702 }
5703 if (!raw && !hasExtends) {
5704 if (isObject(comp)) {
5705 cache.set(comp, EMPTY_ARR);
5706 }
5707 return EMPTY_ARR;
5708 }
5709 if (isArray(raw)) {
5710 for (let i = 0; i < raw.length; i++) {
5711 if (!isString(raw[i])) {
5712 warn$1(`props must be strings when using array syntax.`, raw[i]);
5713 }
5714 const normalizedKey = camelize(raw[i]);
5715 if (validatePropName(normalizedKey)) {
5716 normalized[normalizedKey] = EMPTY_OBJ;
5717 }
5718 }
5719 } else if (raw) {
5720 if (!isObject(raw)) {
5721 warn$1(`invalid props options`, raw);
5722 }
5723 for (const key in raw) {
5724 const normalizedKey = camelize(key);
5725 if (validatePropName(normalizedKey)) {
5726 const opt = raw[key];
5727 const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
5728 if (prop) {
5729 const booleanIndex = getTypeIndex(Boolean, prop.type);
5730 const stringIndex = getTypeIndex(String, prop.type);
5731 prop[0 /* shouldCast */] = booleanIndex > -1;
5732 prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
5733 if (booleanIndex > -1 || hasOwn(prop, "default")) {
5734 needCastKeys.push(normalizedKey);
5735 }
5736 }
5737 }
5738 }
5739 }
5740 const res = [normalized, needCastKeys];
5741 if (isObject(comp)) {
5742 cache.set(comp, res);
5743 }
5744 return res;
5745}
5746function validatePropName(key) {
5747 if (key[0] !== "$" && !isReservedProp(key)) {
5748 return true;
5749 } else {
5750 warn$1(`Invalid prop name: "${key}" is a reserved property.`);
5751 }
5752 return false;
5753}
5754function getType(ctor) {
5755 if (ctor === null) {
5756 return "null";
5757 }
5758 if (typeof ctor === "function") {
5759 return ctor.name || "";
5760 } else if (typeof ctor === "object") {
5761 const name = ctor.constructor && ctor.constructor.name;
5762 return name || "";
5763 }
5764 return "";
5765}
5766function isSameType(a, b) {
5767 return getType(a) === getType(b);
5768}
5769function getTypeIndex(type, expectedTypes) {
5770 if (isArray(expectedTypes)) {
5771 return expectedTypes.findIndex((t) => isSameType(t, type));
5772 } else if (isFunction(expectedTypes)) {
5773 return isSameType(expectedTypes, type) ? 0 : -1;
5774 }
5775 return -1;
5776}
5777function validateProps(rawProps, props, instance) {
5778 const resolvedValues = toRaw(props);
5779 const options = instance.propsOptions[0];
5780 for (const key in options) {
5781 let opt = options[key];
5782 if (opt == null)
5783 continue;
5784 validateProp(
5785 key,
5786 resolvedValues[key],
5787 opt,
5788 shallowReadonly(resolvedValues) ,
5789 !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
5790 );
5791 }
5792}
5793function validateProp(name, value, prop, props, isAbsent) {
5794 const { type, required, validator, skipCheck } = prop;
5795 if (required && isAbsent) {
5796 warn$1('Missing required prop: "' + name + '"');
5797 return;
5798 }
5799 if (value == null && !required) {
5800 return;
5801 }
5802 if (type != null && type !== true && !skipCheck) {
5803 let isValid = false;
5804 const types = isArray(type) ? type : [type];
5805 const expectedTypes = [];
5806 for (let i = 0; i < types.length && !isValid; i++) {
5807 const { valid, expectedType } = assertType(value, types[i]);
5808 expectedTypes.push(expectedType || "");
5809 isValid = valid;
5810 }
5811 if (!isValid) {
5812 warn$1(getInvalidTypeMessage(name, value, expectedTypes));
5813 return;
5814 }
5815 }
5816 if (validator && !validator(value, props)) {
5817 warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
5818 }
5819}
5820const isSimpleType = /* @__PURE__ */ makeMap(
5821 "String,Number,Boolean,Function,Symbol,BigInt"
5822);
5823function assertType(value, type) {
5824 let valid;
5825 const expectedType = getType(type);
5826 if (isSimpleType(expectedType)) {
5827 const t = typeof value;
5828 valid = t === expectedType.toLowerCase();
5829 if (!valid && t === "object") {
5830 valid = value instanceof type;
5831 }
5832 } else if (expectedType === "Object") {
5833 valid = isObject(value);
5834 } else if (expectedType === "Array") {
5835 valid = isArray(value);
5836 } else if (expectedType === "null") {
5837 valid = value === null;
5838 } else {
5839 valid = value instanceof type;
5840 }
5841 return {
5842 valid,
5843 expectedType
5844 };
5845}
5846function getInvalidTypeMessage(name, value, expectedTypes) {
5847 if (expectedTypes.length === 0) {
5848 return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
5849 }
5850 let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
5851 const expectedType = expectedTypes[0];
5852 const receivedType = toRawType(value);
5853 const expectedValue = styleValue(value, expectedType);
5854 const receivedValue = styleValue(value, receivedType);
5855 if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
5856 message += ` with value ${expectedValue}`;
5857 }
5858 message += `, got ${receivedType} `;
5859 if (isExplicable(receivedType)) {
5860 message += `with value ${receivedValue}.`;
5861 }
5862 return message;
5863}
5864function styleValue(value, type) {
5865 if (type === "String") {
5866 return `"${value}"`;
5867 } else if (type === "Number") {
5868 return `${Number(value)}`;
5869 } else {
5870 return `${value}`;
5871 }
5872}
5873function isExplicable(type) {
5874 const explicitTypes = ["string", "number", "boolean"];
5875 return explicitTypes.some((elem) => type.toLowerCase() === elem);
5876}
5877function isBoolean(...args) {
5878 return args.some((elem) => elem.toLowerCase() === "boolean");
5879}
5880
5881const isInternalKey = (key) => key[0] === "_" || key === "$stable";
5882const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
5883const normalizeSlot = (key, rawSlot, ctx) => {
5884 if (rawSlot._n) {
5885 return rawSlot;
5886 }
5887 const normalized = withCtx((...args) => {
5888 if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
5889 warn$1(
5890 `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
5891 );
5892 }
5893 return normalizeSlotValue(rawSlot(...args));
5894 }, ctx);
5895 normalized._c = false;
5896 return normalized;
5897};
5898const normalizeObjectSlots = (rawSlots, slots, instance) => {
5899 const ctx = rawSlots._ctx;
5900 for (const key in rawSlots) {
5901 if (isInternalKey(key))
5902 continue;
5903 const value = rawSlots[key];
5904 if (isFunction(value)) {
5905 slots[key] = normalizeSlot(key, value, ctx);
5906 } else if (value != null) {
5907 {
5908 warn$1(
5909 `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
5910 );
5911 }
5912 const normalized = normalizeSlotValue(value);
5913 slots[key] = () => normalized;
5914 }
5915 }
5916};
5917const normalizeVNodeSlots = (instance, children) => {
5918 if (!isKeepAlive(instance.vnode) && true) {
5919 warn$1(
5920 `Non-function value encountered for default slot. Prefer function slots for better performance.`
5921 );
5922 }
5923 const normalized = normalizeSlotValue(children);
5924 instance.slots.default = () => normalized;
5925};
5926const initSlots = (instance, children) => {
5927 if (instance.vnode.shapeFlag & 32) {
5928 const type = children._;
5929 if (type) {
5930 instance.slots = toRaw(children);
5931 def(children, "_", type);
5932 } else {
5933 normalizeObjectSlots(
5934 children,
5935 instance.slots = {});
5936 }
5937 } else {
5938 instance.slots = {};
5939 if (children) {
5940 normalizeVNodeSlots(instance, children);
5941 }
5942 }
5943 def(instance.slots, InternalObjectKey, 1);
5944};
5945const updateSlots = (instance, children, optimized) => {
5946 const { vnode, slots } = instance;
5947 let needDeletionCheck = true;
5948 let deletionComparisonTarget = EMPTY_OBJ;
5949 if (vnode.shapeFlag & 32) {
5950 const type = children._;
5951 if (type) {
5952 if (isHmrUpdating) {
5953 extend(slots, children);
5954 trigger(instance, "set", "$slots");
5955 } else if (optimized && type === 1) {
5956 needDeletionCheck = false;
5957 } else {
5958 extend(slots, children);
5959 if (!optimized && type === 1) {
5960 delete slots._;
5961 }
5962 }
5963 } else {
5964 needDeletionCheck = !children.$stable;
5965 normalizeObjectSlots(children, slots);
5966 }
5967 deletionComparisonTarget = children;
5968 } else if (children) {
5969 normalizeVNodeSlots(instance, children);
5970 deletionComparisonTarget = { default: 1 };
5971 }
5972 if (needDeletionCheck) {
5973 for (const key in slots) {
5974 if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
5975 delete slots[key];
5976 }
5977 }
5978 }
5979};
5980
5981function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
5982 if (isArray(rawRef)) {
5983 rawRef.forEach(
5984 (r, i) => setRef(
5985 r,
5986 oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
5987 parentSuspense,
5988 vnode,
5989 isUnmount
5990 )
5991 );
5992 return;
5993 }
5994 if (isAsyncWrapper(vnode) && !isUnmount) {
5995 return;
5996 }
5997 const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el;
5998 const value = isUnmount ? null : refValue;
5999 const { i: owner, r: ref } = rawRef;
6000 if (!owner) {
6001 warn$1(
6002 `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
6003 );
6004 return;
6005 }
6006 const oldRef = oldRawRef && oldRawRef.r;
6007 const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
6008 const setupState = owner.setupState;
6009 if (oldRef != null && oldRef !== ref) {
6010 if (isString(oldRef)) {
6011 refs[oldRef] = null;
6012 if (hasOwn(setupState, oldRef)) {
6013 setupState[oldRef] = null;
6014 }
6015 } else if (isRef(oldRef)) {
6016 oldRef.value = null;
6017 }
6018 }
6019 if (isFunction(ref)) {
6020 callWithErrorHandling(ref, owner, 12, [value, refs]);
6021 } else {
6022 const _isString = isString(ref);
6023 const _isRef = isRef(ref);
6024 if (_isString || _isRef) {
6025 const doSet = () => {
6026 if (rawRef.f) {
6027 const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
6028 if (isUnmount) {
6029 isArray(existing) && remove(existing, refValue);
6030 } else {
6031 if (!isArray(existing)) {
6032 if (_isString) {
6033 refs[ref] = [refValue];
6034 if (hasOwn(setupState, ref)) {
6035 setupState[ref] = refs[ref];
6036 }
6037 } else {
6038 ref.value = [refValue];
6039 if (rawRef.k)
6040 refs[rawRef.k] = ref.value;
6041 }
6042 } else if (!existing.includes(refValue)) {
6043 existing.push(refValue);
6044 }
6045 }
6046 } else if (_isString) {
6047 refs[ref] = value;
6048 if (hasOwn(setupState, ref)) {
6049 setupState[ref] = value;
6050 }
6051 } else if (_isRef) {
6052 ref.value = value;
6053 if (rawRef.k)
6054 refs[rawRef.k] = value;
6055 } else {
6056 warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
6057 }
6058 };
6059 if (value) {
6060 doSet.id = -1;
6061 queuePostRenderEffect(doSet, parentSuspense);
6062 } else {
6063 doSet();
6064 }
6065 } else {
6066 warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
6067 }
6068 }
6069}
6070
6071let hasMismatch = false;
6072const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
6073const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
6074const getContainerType = (container) => {
6075 if (isSVGContainer(container))
6076 return "svg";
6077 if (isMathMLContainer(container))
6078 return "mathml";
6079 return void 0;
6080};
6081const isComment = (node) => node.nodeType === 8 /* COMMENT */;
6082function createHydrationFunctions(rendererInternals) {
6083 const {
6084 mt: mountComponent,
6085 p: patch,
6086 o: {
6087 patchProp,
6088 createText,
6089 nextSibling,
6090 parentNode,
6091 remove,
6092 insert,
6093 createComment
6094 }
6095 } = rendererInternals;
6096 const hydrate = (vnode, container) => {
6097 if (!container.hasChildNodes()) {
6098 warn$1(
6099 `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
6100 );
6101 patch(null, vnode, container);
6102 flushPostFlushCbs();
6103 container._vnode = vnode;
6104 return;
6105 }
6106 hasMismatch = false;
6107 hydrateNode(container.firstChild, vnode, null, null, null);
6108 flushPostFlushCbs();
6109 container._vnode = vnode;
6110 if (hasMismatch && true) {
6111 console.error(`Hydration completed but contains mismatches.`);
6112 }
6113 };
6114 const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
6115 const isFragmentStart = isComment(node) && node.data === "[";
6116 const onMismatch = () => handleMismatch(
6117 node,
6118 vnode,
6119 parentComponent,
6120 parentSuspense,
6121 slotScopeIds,
6122 isFragmentStart
6123 );
6124 const { type, ref, shapeFlag, patchFlag } = vnode;
6125 let domType = node.nodeType;
6126 vnode.el = node;
6127 {
6128 if (!("__vnode" in node)) {
6129 Object.defineProperty(node, "__vnode", {
6130 value: vnode,
6131 enumerable: false
6132 });
6133 }
6134 if (!("__vueParentComponent" in node)) {
6135 Object.defineProperty(node, "__vueParentComponent", {
6136 value: parentComponent,
6137 enumerable: false
6138 });
6139 }
6140 }
6141 if (patchFlag === -2) {
6142 optimized = false;
6143 vnode.dynamicChildren = null;
6144 }
6145 let nextNode = null;
6146 switch (type) {
6147 case Text:
6148 if (domType !== 3 /* TEXT */) {
6149 if (vnode.children === "") {
6150 insert(vnode.el = createText(""), parentNode(node), node);
6151 nextNode = node;
6152 } else {
6153 nextNode = onMismatch();
6154 }
6155 } else {
6156 if (node.data !== vnode.children) {
6157 hasMismatch = true;
6158 warn$1(
6159 `Hydration text mismatch in`,
6160 node.parentNode,
6161 `
6162 - rendered on server: ${JSON.stringify(
6163 node.data
6164 )}
6165 - expected on client: ${JSON.stringify(vnode.children)}`
6166 );
6167 node.data = vnode.children;
6168 }
6169 nextNode = nextSibling(node);
6170 }
6171 break;
6172 case Comment:
6173 if (isTemplateNode(node)) {
6174 nextNode = nextSibling(node);
6175 replaceNode(
6176 vnode.el = node.content.firstChild,
6177 node,
6178 parentComponent
6179 );
6180 } else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
6181 nextNode = onMismatch();
6182 } else {
6183 nextNode = nextSibling(node);
6184 }
6185 break;
6186 case Static:
6187 if (isFragmentStart) {
6188 node = nextSibling(node);
6189 domType = node.nodeType;
6190 }
6191 if (domType === 1 /* ELEMENT */ || domType === 3 /* TEXT */) {
6192 nextNode = node;
6193 const needToAdoptContent = !vnode.children.length;
6194 for (let i = 0; i < vnode.staticCount; i++) {
6195 if (needToAdoptContent)
6196 vnode.children += nextNode.nodeType === 1 /* ELEMENT */ ? nextNode.outerHTML : nextNode.data;
6197 if (i === vnode.staticCount - 1) {
6198 vnode.anchor = nextNode;
6199 }
6200 nextNode = nextSibling(nextNode);
6201 }
6202 return isFragmentStart ? nextSibling(nextNode) : nextNode;
6203 } else {
6204 onMismatch();
6205 }
6206 break;
6207 case Fragment:
6208 if (!isFragmentStart) {
6209 nextNode = onMismatch();
6210 } else {
6211 nextNode = hydrateFragment(
6212 node,
6213 vnode,
6214 parentComponent,
6215 parentSuspense,
6216 slotScopeIds,
6217 optimized
6218 );
6219 }
6220 break;
6221 default:
6222 if (shapeFlag & 1) {
6223 if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
6224 nextNode = onMismatch();
6225 } else {
6226 nextNode = hydrateElement(
6227 node,
6228 vnode,
6229 parentComponent,
6230 parentSuspense,
6231 slotScopeIds,
6232 optimized
6233 );
6234 }
6235 } else if (shapeFlag & 6) {
6236 vnode.slotScopeIds = slotScopeIds;
6237 const container = parentNode(node);
6238 if (isFragmentStart) {
6239 nextNode = locateClosingAnchor(node);
6240 } else if (isComment(node) && node.data === "teleport start") {
6241 nextNode = locateClosingAnchor(node, node.data, "teleport end");
6242 } else {
6243 nextNode = nextSibling(node);
6244 }
6245 mountComponent(
6246 vnode,
6247 container,
6248 null,
6249 parentComponent,
6250 parentSuspense,
6251 getContainerType(container),
6252 optimized
6253 );
6254 if (isAsyncWrapper(vnode)) {
6255 let subTree;
6256 if (isFragmentStart) {
6257 subTree = createVNode(Fragment);
6258 subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
6259 } else {
6260 subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
6261 }
6262 subTree.el = node;
6263 vnode.component.subTree = subTree;
6264 }
6265 } else if (shapeFlag & 64) {
6266 if (domType !== 8 /* COMMENT */) {
6267 nextNode = onMismatch();
6268 } else {
6269 nextNode = vnode.type.hydrate(
6270 node,
6271 vnode,
6272 parentComponent,
6273 parentSuspense,
6274 slotScopeIds,
6275 optimized,
6276 rendererInternals,
6277 hydrateChildren
6278 );
6279 }
6280 } else if (shapeFlag & 128) {
6281 nextNode = vnode.type.hydrate(
6282 node,
6283 vnode,
6284 parentComponent,
6285 parentSuspense,
6286 getContainerType(parentNode(node)),
6287 slotScopeIds,
6288 optimized,
6289 rendererInternals,
6290 hydrateNode
6291 );
6292 } else {
6293 warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
6294 }
6295 }
6296 if (ref != null) {
6297 setRef(ref, null, parentSuspense, vnode);
6298 }
6299 return nextNode;
6300 };
6301 const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
6302 optimized = optimized || !!vnode.dynamicChildren;
6303 const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
6304 const forcePatch = type === "input" || type === "option";
6305 {
6306 if (dirs) {
6307 invokeDirectiveHook(vnode, null, parentComponent, "created");
6308 }
6309 let needCallTransitionHooks = false;
6310 if (isTemplateNode(el)) {
6311 needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
6312 const content = el.content.firstChild;
6313 if (needCallTransitionHooks) {
6314 transition.beforeEnter(content);
6315 }
6316 replaceNode(content, el, parentComponent);
6317 vnode.el = el = content;
6318 }
6319 if (shapeFlag & 16 && // skip if element has innerHTML / textContent
6320 !(props && (props.innerHTML || props.textContent))) {
6321 let next = hydrateChildren(
6322 el.firstChild,
6323 vnode,
6324 el,
6325 parentComponent,
6326 parentSuspense,
6327 slotScopeIds,
6328 optimized
6329 );
6330 let hasWarned = false;
6331 while (next) {
6332 hasMismatch = true;
6333 if (!hasWarned) {
6334 warn$1(
6335 `Hydration children mismatch on`,
6336 el,
6337 `
6338Server rendered element contains more child nodes than client vdom.`
6339 );
6340 hasWarned = true;
6341 }
6342 const cur = next;
6343 next = next.nextSibling;
6344 remove(cur);
6345 }
6346 } else if (shapeFlag & 8) {
6347 if (el.textContent !== vnode.children) {
6348 hasMismatch = true;
6349 warn$1(
6350 `Hydration text content mismatch on`,
6351 el,
6352 `
6353 - rendered on server: ${el.textContent}
6354 - expected on client: ${vnode.children}`
6355 );
6356 el.textContent = vnode.children;
6357 }
6358 }
6359 if (props) {
6360 {
6361 for (const key in props) {
6362 if (propHasMismatch(el, key, props[key], vnode, parentComponent)) {
6363 hasMismatch = true;
6364 }
6365 if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
6366 key[0] === ".") {
6367 patchProp(
6368 el,
6369 key,
6370 null,
6371 props[key],
6372 void 0,
6373 void 0,
6374 parentComponent
6375 );
6376 }
6377 }
6378 }
6379 }
6380 let vnodeHooks;
6381 if (vnodeHooks = props && props.onVnodeBeforeMount) {
6382 invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6383 }
6384 if (dirs) {
6385 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6386 }
6387 if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
6388 queueEffectWithSuspense(() => {
6389 vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6390 needCallTransitionHooks && transition.enter(el);
6391 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6392 }, parentSuspense);
6393 }
6394 }
6395 return el.nextSibling;
6396 };
6397 const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
6398 optimized = optimized || !!parentVNode.dynamicChildren;
6399 const children = parentVNode.children;
6400 const l = children.length;
6401 let hasWarned = false;
6402 for (let i = 0; i < l; i++) {
6403 const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
6404 if (node) {
6405 node = hydrateNode(
6406 node,
6407 vnode,
6408 parentComponent,
6409 parentSuspense,
6410 slotScopeIds,
6411 optimized
6412 );
6413 } else if (vnode.type === Text && !vnode.children) {
6414 continue;
6415 } else {
6416 hasMismatch = true;
6417 if (!hasWarned) {
6418 warn$1(
6419 `Hydration children mismatch on`,
6420 container,
6421 `
6422Server rendered element contains fewer child nodes than client vdom.`
6423 );
6424 hasWarned = true;
6425 }
6426 patch(
6427 null,
6428 vnode,
6429 container,
6430 null,
6431 parentComponent,
6432 parentSuspense,
6433 getContainerType(container),
6434 slotScopeIds
6435 );
6436 }
6437 }
6438 return node;
6439 };
6440 const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
6441 const { slotScopeIds: fragmentSlotScopeIds } = vnode;
6442 if (fragmentSlotScopeIds) {
6443 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
6444 }
6445 const container = parentNode(node);
6446 const next = hydrateChildren(
6447 nextSibling(node),
6448 vnode,
6449 container,
6450 parentComponent,
6451 parentSuspense,
6452 slotScopeIds,
6453 optimized
6454 );
6455 if (next && isComment(next) && next.data === "]") {
6456 return nextSibling(vnode.anchor = next);
6457 } else {
6458 hasMismatch = true;
6459 insert(vnode.anchor = createComment(`]`), container, next);
6460 return next;
6461 }
6462 };
6463 const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
6464 hasMismatch = true;
6465 warn$1(
6466 `Hydration node mismatch:
6467- rendered on server:`,
6468 node,
6469 node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
6470 `
6471- expected on client:`,
6472 vnode.type
6473 );
6474 vnode.el = null;
6475 if (isFragment) {
6476 const end = locateClosingAnchor(node);
6477 while (true) {
6478 const next2 = nextSibling(node);
6479 if (next2 && next2 !== end) {
6480 remove(next2);
6481 } else {
6482 break;
6483 }
6484 }
6485 }
6486 const next = nextSibling(node);
6487 const container = parentNode(node);
6488 remove(node);
6489 patch(
6490 null,
6491 vnode,
6492 container,
6493 next,
6494 parentComponent,
6495 parentSuspense,
6496 getContainerType(container),
6497 slotScopeIds
6498 );
6499 return next;
6500 };
6501 const locateClosingAnchor = (node, open = "[", close = "]") => {
6502 let match = 0;
6503 while (node) {
6504 node = nextSibling(node);
6505 if (node && isComment(node)) {
6506 if (node.data === open)
6507 match++;
6508 if (node.data === close) {
6509 if (match === 0) {
6510 return nextSibling(node);
6511 } else {
6512 match--;
6513 }
6514 }
6515 }
6516 }
6517 return node;
6518 };
6519 const replaceNode = (newNode, oldNode, parentComponent) => {
6520 const parentNode2 = oldNode.parentNode;
6521 if (parentNode2) {
6522 parentNode2.replaceChild(newNode, oldNode);
6523 }
6524 let parent = parentComponent;
6525 while (parent) {
6526 if (parent.vnode.el === oldNode) {
6527 parent.vnode.el = parent.subTree.el = newNode;
6528 }
6529 parent = parent.parent;
6530 }
6531 };
6532 const isTemplateNode = (node) => {
6533 return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
6534 };
6535 return [hydrate, hydrateNode];
6536}
6537function propHasMismatch(el, key, clientValue, vnode, instance) {
6538 var _a;
6539 let mismatchType;
6540 let mismatchKey;
6541 let actual;
6542 let expected;
6543 if (key === "class") {
6544 actual = el.getAttribute("class");
6545 expected = normalizeClass(clientValue);
6546 if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
6547 mismatchType = mismatchKey = `class`;
6548 }
6549 } else if (key === "style") {
6550 actual = el.getAttribute("style");
6551 expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
6552 const actualMap = toStyleMap(actual);
6553 const expectedMap = toStyleMap(expected);
6554 if (vnode.dirs) {
6555 for (const { dir, value } of vnode.dirs) {
6556 if (dir.name === "show" && !value) {
6557 expectedMap.set("display", "none");
6558 }
6559 }
6560 }
6561 const root = instance == null ? void 0 : instance.subTree;
6562 if (vnode === root || (root == null ? void 0 : root.type) === Fragment && root.children.includes(vnode)) {
6563 const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
6564 for (const key2 in cssVars) {
6565 expectedMap.set(`--${key2}`, String(cssVars[key2]));
6566 }
6567 }
6568 if (!isMapEqual(actualMap, expectedMap)) {
6569 mismatchType = mismatchKey = "style";
6570 }
6571 } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
6572 if (isBooleanAttr(key)) {
6573 actual = el.hasAttribute(key);
6574 expected = includeBooleanAttr(clientValue);
6575 } else if (clientValue == null) {
6576 actual = el.hasAttribute(key);
6577 expected = false;
6578 } else {
6579 if (el.hasAttribute(key)) {
6580 actual = el.getAttribute(key);
6581 } else if (key === "value" && el.tagName === "TEXTAREA") {
6582 actual = el.value;
6583 } else {
6584 actual = false;
6585 }
6586 expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
6587 }
6588 if (actual !== expected) {
6589 mismatchType = `attribute`;
6590 mismatchKey = key;
6591 }
6592 }
6593 if (mismatchType) {
6594 const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
6595 const preSegment = `Hydration ${mismatchType} mismatch on`;
6596 const postSegment = `
6597 - rendered on server: ${format(actual)}
6598 - expected on client: ${format(expected)}
6599 Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
6600 You should fix the source of the mismatch.`;
6601 {
6602 warn$1(preSegment, el, postSegment);
6603 }
6604 return true;
6605 }
6606 return false;
6607}
6608function toClassSet(str) {
6609 return new Set(str.trim().split(/\s+/));
6610}
6611function isSetEqual(a, b) {
6612 if (a.size !== b.size) {
6613 return false;
6614 }
6615 for (const s of a) {
6616 if (!b.has(s)) {
6617 return false;
6618 }
6619 }
6620 return true;
6621}
6622function toStyleMap(str) {
6623 const styleMap = /* @__PURE__ */ new Map();
6624 for (const item of str.split(";")) {
6625 let [key, value] = item.split(":");
6626 key = key == null ? void 0 : key.trim();
6627 value = value == null ? void 0 : value.trim();
6628 if (key && value) {
6629 styleMap.set(key, value);
6630 }
6631 }
6632 return styleMap;
6633}
6634function isMapEqual(a, b) {
6635 if (a.size !== b.size) {
6636 return false;
6637 }
6638 for (const [key, value] of a) {
6639 if (value !== b.get(key)) {
6640 return false;
6641 }
6642 }
6643 return true;
6644}
6645
6646let supported;
6647let perf;
6648function startMeasure(instance, type) {
6649 if (instance.appContext.config.performance && isSupported()) {
6650 perf.mark(`vue-${type}-${instance.uid}`);
6651 }
6652 {
6653 devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
6654 }
6655}
6656function endMeasure(instance, type) {
6657 if (instance.appContext.config.performance && isSupported()) {
6658 const startTag = `vue-${type}-${instance.uid}`;
6659 const endTag = startTag + `:end`;
6660 perf.mark(endTag);
6661 perf.measure(
6662 `<${formatComponentName(instance, instance.type)}> ${type}`,
6663 startTag,
6664 endTag
6665 );
6666 perf.clearMarks(startTag);
6667 perf.clearMarks(endTag);
6668 }
6669 {
6670 devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
6671 }
6672}
6673function isSupported() {
6674 if (supported !== void 0) {
6675 return supported;
6676 }
6677 if (typeof window !== "undefined" && window.performance) {
6678 supported = true;
6679 perf = window.performance;
6680 } else {
6681 supported = false;
6682 }
6683 return supported;
6684}
6685
6686const queuePostRenderEffect = queueEffectWithSuspense ;
6687function createRenderer(options) {
6688 return baseCreateRenderer(options);
6689}
6690function createHydrationRenderer(options) {
6691 return baseCreateRenderer(options, createHydrationFunctions);
6692}
6693function baseCreateRenderer(options, createHydrationFns) {
6694 const target = getGlobalThis();
6695 target.__VUE__ = true;
6696 {
6697 setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
6698 }
6699 const {
6700 insert: hostInsert,
6701 remove: hostRemove,
6702 patchProp: hostPatchProp,
6703 createElement: hostCreateElement,
6704 createText: hostCreateText,
6705 createComment: hostCreateComment,
6706 setText: hostSetText,
6707 setElementText: hostSetElementText,
6708 parentNode: hostParentNode,
6709 nextSibling: hostNextSibling,
6710 setScopeId: hostSetScopeId = NOOP,
6711 insertStaticContent: hostInsertStaticContent
6712 } = options;
6713 const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
6714 if (n1 === n2) {
6715 return;
6716 }
6717 if (n1 && !isSameVNodeType(n1, n2)) {
6718 anchor = getNextHostNode(n1);
6719 unmount(n1, parentComponent, parentSuspense, true);
6720 n1 = null;
6721 }
6722 if (n2.patchFlag === -2) {
6723 optimized = false;
6724 n2.dynamicChildren = null;
6725 }
6726 const { type, ref, shapeFlag } = n2;
6727 switch (type) {
6728 case Text:
6729 processText(n1, n2, container, anchor);
6730 break;
6731 case Comment:
6732 processCommentNode(n1, n2, container, anchor);
6733 break;
6734 case Static:
6735 if (n1 == null) {
6736 mountStaticNode(n2, container, anchor, namespace);
6737 } else {
6738 patchStaticNode(n1, n2, container, namespace);
6739 }
6740 break;
6741 case Fragment:
6742 processFragment(
6743 n1,
6744 n2,
6745 container,
6746 anchor,
6747 parentComponent,
6748 parentSuspense,
6749 namespace,
6750 slotScopeIds,
6751 optimized
6752 );
6753 break;
6754 default:
6755 if (shapeFlag & 1) {
6756 processElement(
6757 n1,
6758 n2,
6759 container,
6760 anchor,
6761 parentComponent,
6762 parentSuspense,
6763 namespace,
6764 slotScopeIds,
6765 optimized
6766 );
6767 } else if (shapeFlag & 6) {
6768 processComponent(
6769 n1,
6770 n2,
6771 container,
6772 anchor,
6773 parentComponent,
6774 parentSuspense,
6775 namespace,
6776 slotScopeIds,
6777 optimized
6778 );
6779 } else if (shapeFlag & 64) {
6780 type.process(
6781 n1,
6782 n2,
6783 container,
6784 anchor,
6785 parentComponent,
6786 parentSuspense,
6787 namespace,
6788 slotScopeIds,
6789 optimized,
6790 internals
6791 );
6792 } else if (shapeFlag & 128) {
6793 type.process(
6794 n1,
6795 n2,
6796 container,
6797 anchor,
6798 parentComponent,
6799 parentSuspense,
6800 namespace,
6801 slotScopeIds,
6802 optimized,
6803 internals
6804 );
6805 } else {
6806 warn$1("Invalid VNode type:", type, `(${typeof type})`);
6807 }
6808 }
6809 if (ref != null && parentComponent) {
6810 setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
6811 }
6812 };
6813 const processText = (n1, n2, container, anchor) => {
6814 if (n1 == null) {
6815 hostInsert(
6816 n2.el = hostCreateText(n2.children),
6817 container,
6818 anchor
6819 );
6820 } else {
6821 const el = n2.el = n1.el;
6822 if (n2.children !== n1.children) {
6823 hostSetText(el, n2.children);
6824 }
6825 }
6826 };
6827 const processCommentNode = (n1, n2, container, anchor) => {
6828 if (n1 == null) {
6829 hostInsert(
6830 n2.el = hostCreateComment(n2.children || ""),
6831 container,
6832 anchor
6833 );
6834 } else {
6835 n2.el = n1.el;
6836 }
6837 };
6838 const mountStaticNode = (n2, container, anchor, namespace) => {
6839 [n2.el, n2.anchor] = hostInsertStaticContent(
6840 n2.children,
6841 container,
6842 anchor,
6843 namespace,
6844 n2.el,
6845 n2.anchor
6846 );
6847 };
6848 const patchStaticNode = (n1, n2, container, namespace) => {
6849 if (n2.children !== n1.children) {
6850 const anchor = hostNextSibling(n1.anchor);
6851 removeStaticNode(n1);
6852 [n2.el, n2.anchor] = hostInsertStaticContent(
6853 n2.children,
6854 container,
6855 anchor,
6856 namespace
6857 );
6858 } else {
6859 n2.el = n1.el;
6860 n2.anchor = n1.anchor;
6861 }
6862 };
6863 const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
6864 let next;
6865 while (el && el !== anchor) {
6866 next = hostNextSibling(el);
6867 hostInsert(el, container, nextSibling);
6868 el = next;
6869 }
6870 hostInsert(anchor, container, nextSibling);
6871 };
6872 const removeStaticNode = ({ el, anchor }) => {
6873 let next;
6874 while (el && el !== anchor) {
6875 next = hostNextSibling(el);
6876 hostRemove(el);
6877 el = next;
6878 }
6879 hostRemove(anchor);
6880 };
6881 const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6882 if (n2.type === "svg") {
6883 namespace = "svg";
6884 } else if (n2.type === "math") {
6885 namespace = "mathml";
6886 }
6887 if (n1 == null) {
6888 mountElement(
6889 n2,
6890 container,
6891 anchor,
6892 parentComponent,
6893 parentSuspense,
6894 namespace,
6895 slotScopeIds,
6896 optimized
6897 );
6898 } else {
6899 patchElement(
6900 n1,
6901 n2,
6902 parentComponent,
6903 parentSuspense,
6904 namespace,
6905 slotScopeIds,
6906 optimized
6907 );
6908 }
6909 };
6910 const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6911 let el;
6912 let vnodeHook;
6913 const { props, shapeFlag, transition, dirs } = vnode;
6914 el = vnode.el = hostCreateElement(
6915 vnode.type,
6916 namespace,
6917 props && props.is,
6918 props
6919 );
6920 if (shapeFlag & 8) {
6921 hostSetElementText(el, vnode.children);
6922 } else if (shapeFlag & 16) {
6923 mountChildren(
6924 vnode.children,
6925 el,
6926 null,
6927 parentComponent,
6928 parentSuspense,
6929 resolveChildrenNamespace(vnode, namespace),
6930 slotScopeIds,
6931 optimized
6932 );
6933 }
6934 if (dirs) {
6935 invokeDirectiveHook(vnode, null, parentComponent, "created");
6936 }
6937 setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
6938 if (props) {
6939 for (const key in props) {
6940 if (key !== "value" && !isReservedProp(key)) {
6941 hostPatchProp(
6942 el,
6943 key,
6944 null,
6945 props[key],
6946 namespace,
6947 vnode.children,
6948 parentComponent,
6949 parentSuspense,
6950 unmountChildren
6951 );
6952 }
6953 }
6954 if ("value" in props) {
6955 hostPatchProp(el, "value", null, props.value, namespace);
6956 }
6957 if (vnodeHook = props.onVnodeBeforeMount) {
6958 invokeVNodeHook(vnodeHook, parentComponent, vnode);
6959 }
6960 }
6961 {
6962 Object.defineProperty(el, "__vnode", {
6963 value: vnode,
6964 enumerable: false
6965 });
6966 Object.defineProperty(el, "__vueParentComponent", {
6967 value: parentComponent,
6968 enumerable: false
6969 });
6970 }
6971 if (dirs) {
6972 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6973 }
6974 const needCallTransitionHooks = needTransition(parentSuspense, transition);
6975 if (needCallTransitionHooks) {
6976 transition.beforeEnter(el);
6977 }
6978 hostInsert(el, container, anchor);
6979 if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
6980 queuePostRenderEffect(() => {
6981 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
6982 needCallTransitionHooks && transition.enter(el);
6983 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6984 }, parentSuspense);
6985 }
6986 };
6987 const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
6988 if (scopeId) {
6989 hostSetScopeId(el, scopeId);
6990 }
6991 if (slotScopeIds) {
6992 for (let i = 0; i < slotScopeIds.length; i++) {
6993 hostSetScopeId(el, slotScopeIds[i]);
6994 }
6995 }
6996 if (parentComponent) {
6997 let subTree = parentComponent.subTree;
6998 if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
6999 subTree = filterSingleRoot(subTree.children) || subTree;
7000 }
7001 if (vnode === subTree) {
7002 const parentVNode = parentComponent.vnode;
7003 setScopeId(
7004 el,
7005 parentVNode,
7006 parentVNode.scopeId,
7007 parentVNode.slotScopeIds,
7008 parentComponent.parent
7009 );
7010 }
7011 }
7012 };
7013 const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
7014 for (let i = start; i < children.length; i++) {
7015 const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
7016 patch(
7017 null,
7018 child,
7019 container,
7020 anchor,
7021 parentComponent,
7022 parentSuspense,
7023 namespace,
7024 slotScopeIds,
7025 optimized
7026 );
7027 }
7028 };
7029 const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7030 const el = n2.el = n1.el;
7031 let { patchFlag, dynamicChildren, dirs } = n2;
7032 patchFlag |= n1.patchFlag & 16;
7033 const oldProps = n1.props || EMPTY_OBJ;
7034 const newProps = n2.props || EMPTY_OBJ;
7035 let vnodeHook;
7036 parentComponent && toggleRecurse(parentComponent, false);
7037 if (vnodeHook = newProps.onVnodeBeforeUpdate) {
7038 invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
7039 }
7040 if (dirs) {
7041 invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
7042 }
7043 parentComponent && toggleRecurse(parentComponent, true);
7044 if (isHmrUpdating) {
7045 patchFlag = 0;
7046 optimized = false;
7047 dynamicChildren = null;
7048 }
7049 if (dynamicChildren) {
7050 patchBlockChildren(
7051 n1.dynamicChildren,
7052 dynamicChildren,
7053 el,
7054 parentComponent,
7055 parentSuspense,
7056 resolveChildrenNamespace(n2, namespace),
7057 slotScopeIds
7058 );
7059 {
7060 traverseStaticChildren(n1, n2);
7061 }
7062 } else if (!optimized) {
7063 patchChildren(
7064 n1,
7065 n2,
7066 el,
7067 null,
7068 parentComponent,
7069 parentSuspense,
7070 resolveChildrenNamespace(n2, namespace),
7071 slotScopeIds,
7072 false
7073 );
7074 }
7075 if (patchFlag > 0) {
7076 if (patchFlag & 16) {
7077 patchProps(
7078 el,
7079 n2,
7080 oldProps,
7081 newProps,
7082 parentComponent,
7083 parentSuspense,
7084 namespace
7085 );
7086 } else {
7087 if (patchFlag & 2) {
7088 if (oldProps.class !== newProps.class) {
7089 hostPatchProp(el, "class", null, newProps.class, namespace);
7090 }
7091 }
7092 if (patchFlag & 4) {
7093 hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
7094 }
7095 if (patchFlag & 8) {
7096 const propsToUpdate = n2.dynamicProps;
7097 for (let i = 0; i < propsToUpdate.length; i++) {
7098 const key = propsToUpdate[i];
7099 const prev = oldProps[key];
7100 const next = newProps[key];
7101 if (next !== prev || key === "value") {
7102 hostPatchProp(
7103 el,
7104 key,
7105 prev,
7106 next,
7107 namespace,
7108 n1.children,
7109 parentComponent,
7110 parentSuspense,
7111 unmountChildren
7112 );
7113 }
7114 }
7115 }
7116 }
7117 if (patchFlag & 1) {
7118 if (n1.children !== n2.children) {
7119 hostSetElementText(el, n2.children);
7120 }
7121 }
7122 } else if (!optimized && dynamicChildren == null) {
7123 patchProps(
7124 el,
7125 n2,
7126 oldProps,
7127 newProps,
7128 parentComponent,
7129 parentSuspense,
7130 namespace
7131 );
7132 }
7133 if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
7134 queuePostRenderEffect(() => {
7135 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
7136 dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
7137 }, parentSuspense);
7138 }
7139 };
7140 const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
7141 for (let i = 0; i < newChildren.length; i++) {
7142 const oldVNode = oldChildren[i];
7143 const newVNode = newChildren[i];
7144 const container = (
7145 // oldVNode may be an errored async setup() component inside Suspense
7146 // which will not have a mounted element
7147 oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
7148 // of the Fragment itself so it can move its children.
7149 (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
7150 // which also requires the correct parent container
7151 !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
7152 oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
7153 // In other cases, the parent container is not actually used so we
7154 // just pass the block element here to avoid a DOM parentNode call.
7155 fallbackContainer
7156 )
7157 );
7158 patch(
7159 oldVNode,
7160 newVNode,
7161 container,
7162 null,
7163 parentComponent,
7164 parentSuspense,
7165 namespace,
7166 slotScopeIds,
7167 true
7168 );
7169 }
7170 };
7171 const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
7172 if (oldProps !== newProps) {
7173 if (oldProps !== EMPTY_OBJ) {
7174 for (const key in oldProps) {
7175 if (!isReservedProp(key) && !(key in newProps)) {
7176 hostPatchProp(
7177 el,
7178 key,
7179 oldProps[key],
7180 null,
7181 namespace,
7182 vnode.children,
7183 parentComponent,
7184 parentSuspense,
7185 unmountChildren
7186 );
7187 }
7188 }
7189 }
7190 for (const key in newProps) {
7191 if (isReservedProp(key))
7192 continue;
7193 const next = newProps[key];
7194 const prev = oldProps[key];
7195 if (next !== prev && key !== "value") {
7196 hostPatchProp(
7197 el,
7198 key,
7199 prev,
7200 next,
7201 namespace,
7202 vnode.children,
7203 parentComponent,
7204 parentSuspense,
7205 unmountChildren
7206 );
7207 }
7208 }
7209 if ("value" in newProps) {
7210 hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
7211 }
7212 }
7213 };
7214 const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7215 const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
7216 const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
7217 let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
7218 if (
7219 // #5523 dev root fragment may inherit directives
7220 isHmrUpdating || patchFlag & 2048
7221 ) {
7222 patchFlag = 0;
7223 optimized = false;
7224 dynamicChildren = null;
7225 }
7226 if (fragmentSlotScopeIds) {
7227 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
7228 }
7229 if (n1 == null) {
7230 hostInsert(fragmentStartAnchor, container, anchor);
7231 hostInsert(fragmentEndAnchor, container, anchor);
7232 mountChildren(
7233 // #10007
7234 // such fragment like `<></>` will be compiled into
7235 // a fragment which doesn't have a children.
7236 // In this case fallback to an empty array
7237 n2.children || [],
7238 container,
7239 fragmentEndAnchor,
7240 parentComponent,
7241 parentSuspense,
7242 namespace,
7243 slotScopeIds,
7244 optimized
7245 );
7246 } else {
7247 if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
7248 // of renderSlot() with no valid children
7249 n1.dynamicChildren) {
7250 patchBlockChildren(
7251 n1.dynamicChildren,
7252 dynamicChildren,
7253 container,
7254 parentComponent,
7255 parentSuspense,
7256 namespace,
7257 slotScopeIds
7258 );
7259 {
7260 traverseStaticChildren(n1, n2);
7261 }
7262 } else {
7263 patchChildren(
7264 n1,
7265 n2,
7266 container,
7267 fragmentEndAnchor,
7268 parentComponent,
7269 parentSuspense,
7270 namespace,
7271 slotScopeIds,
7272 optimized
7273 );
7274 }
7275 }
7276 };
7277 const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7278 n2.slotScopeIds = slotScopeIds;
7279 if (n1 == null) {
7280 if (n2.shapeFlag & 512) {
7281 parentComponent.ctx.activate(
7282 n2,
7283 container,
7284 anchor,
7285 namespace,
7286 optimized
7287 );
7288 } else {
7289 mountComponent(
7290 n2,
7291 container,
7292 anchor,
7293 parentComponent,
7294 parentSuspense,
7295 namespace,
7296 optimized
7297 );
7298 }
7299 } else {
7300 updateComponent(n1, n2, optimized);
7301 }
7302 };
7303 const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
7304 const instance = (initialVNode.component = createComponentInstance(
7305 initialVNode,
7306 parentComponent,
7307 parentSuspense
7308 ));
7309 if (instance.type.__hmrId) {
7310 registerHMR(instance);
7311 }
7312 {
7313 pushWarningContext(initialVNode);
7314 startMeasure(instance, `mount`);
7315 }
7316 if (isKeepAlive(initialVNode)) {
7317 instance.ctx.renderer = internals;
7318 }
7319 {
7320 {
7321 startMeasure(instance, `init`);
7322 }
7323 setupComponent(instance);
7324 {
7325 endMeasure(instance, `init`);
7326 }
7327 }
7328 if (instance.asyncDep) {
7329 parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);
7330 if (!initialVNode.el) {
7331 const placeholder = instance.subTree = createVNode(Comment);
7332 processCommentNode(null, placeholder, container, anchor);
7333 }
7334 } else {
7335 setupRenderEffect(
7336 instance,
7337 initialVNode,
7338 container,
7339 anchor,
7340 parentSuspense,
7341 namespace,
7342 optimized
7343 );
7344 }
7345 {
7346 popWarningContext();
7347 endMeasure(instance, `mount`);
7348 }
7349 };
7350 const updateComponent = (n1, n2, optimized) => {
7351 const instance = n2.component = n1.component;
7352 if (shouldUpdateComponent(n1, n2, optimized)) {
7353 if (instance.asyncDep && !instance.asyncResolved) {
7354 {
7355 pushWarningContext(n2);
7356 }
7357 updateComponentPreRender(instance, n2, optimized);
7358 {
7359 popWarningContext();
7360 }
7361 return;
7362 } else {
7363 instance.next = n2;
7364 invalidateJob(instance.update);
7365 instance.effect.dirty = true;
7366 instance.update();
7367 }
7368 } else {
7369 n2.el = n1.el;
7370 instance.vnode = n2;
7371 }
7372 };
7373 const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
7374 const componentUpdateFn = () => {
7375 if (!instance.isMounted) {
7376 let vnodeHook;
7377 const { el, props } = initialVNode;
7378 const { bm, m, parent } = instance;
7379 const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
7380 toggleRecurse(instance, false);
7381 if (bm) {
7382 invokeArrayFns(bm);
7383 }
7384 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
7385 invokeVNodeHook(vnodeHook, parent, initialVNode);
7386 }
7387 toggleRecurse(instance, true);
7388 if (el && hydrateNode) {
7389 const hydrateSubTree = () => {
7390 {
7391 startMeasure(instance, `render`);
7392 }
7393 instance.subTree = renderComponentRoot(instance);
7394 {
7395 endMeasure(instance, `render`);
7396 }
7397 {
7398 startMeasure(instance, `hydrate`);
7399 }
7400 hydrateNode(
7401 el,
7402 instance.subTree,
7403 instance,
7404 parentSuspense,
7405 null
7406 );
7407 {
7408 endMeasure(instance, `hydrate`);
7409 }
7410 };
7411 if (isAsyncWrapperVNode) {
7412 initialVNode.type.__asyncLoader().then(
7413 // note: we are moving the render call into an async callback,
7414 // which means it won't track dependencies - but it's ok because
7415 // a server-rendered async wrapper is already in resolved state
7416 // and it will never need to change.
7417 () => !instance.isUnmounted && hydrateSubTree()
7418 );
7419 } else {
7420 hydrateSubTree();
7421 }
7422 } else {
7423 {
7424 startMeasure(instance, `render`);
7425 }
7426 const subTree = instance.subTree = renderComponentRoot(instance);
7427 {
7428 endMeasure(instance, `render`);
7429 }
7430 {
7431 startMeasure(instance, `patch`);
7432 }
7433 patch(
7434 null,
7435 subTree,
7436 container,
7437 anchor,
7438 instance,
7439 parentSuspense,
7440 namespace
7441 );
7442 {
7443 endMeasure(instance, `patch`);
7444 }
7445 initialVNode.el = subTree.el;
7446 }
7447 if (m) {
7448 queuePostRenderEffect(m, parentSuspense);
7449 }
7450 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
7451 const scopedInitialVNode = initialVNode;
7452 queuePostRenderEffect(
7453 () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
7454 parentSuspense
7455 );
7456 }
7457 if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
7458 instance.a && queuePostRenderEffect(instance.a, parentSuspense);
7459 }
7460 instance.isMounted = true;
7461 {
7462 devtoolsComponentAdded(instance);
7463 }
7464 initialVNode = container = anchor = null;
7465 } else {
7466 let { next, bu, u, parent, vnode } = instance;
7467 {
7468 const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
7469 if (nonHydratedAsyncRoot) {
7470 if (next) {
7471 next.el = vnode.el;
7472 updateComponentPreRender(instance, next, optimized);
7473 }
7474 nonHydratedAsyncRoot.asyncDep.then(() => {
7475 if (!instance.isUnmounted) {
7476 componentUpdateFn();
7477 }
7478 });
7479 return;
7480 }
7481 }
7482 let originNext = next;
7483 let vnodeHook;
7484 {
7485 pushWarningContext(next || instance.vnode);
7486 }
7487 toggleRecurse(instance, false);
7488 if (next) {
7489 next.el = vnode.el;
7490 updateComponentPreRender(instance, next, optimized);
7491 } else {
7492 next = vnode;
7493 }
7494 if (bu) {
7495 invokeArrayFns(bu);
7496 }
7497 if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
7498 invokeVNodeHook(vnodeHook, parent, next, vnode);
7499 }
7500 toggleRecurse(instance, true);
7501 {
7502 startMeasure(instance, `render`);
7503 }
7504 const nextTree = renderComponentRoot(instance);
7505 {
7506 endMeasure(instance, `render`);
7507 }
7508 const prevTree = instance.subTree;
7509 instance.subTree = nextTree;
7510 {
7511 startMeasure(instance, `patch`);
7512 }
7513 patch(
7514 prevTree,
7515 nextTree,
7516 // parent may have changed if it's in a teleport
7517 hostParentNode(prevTree.el),
7518 // anchor may have changed if it's in a fragment
7519 getNextHostNode(prevTree),
7520 instance,
7521 parentSuspense,
7522 namespace
7523 );
7524 {
7525 endMeasure(instance, `patch`);
7526 }
7527 next.el = nextTree.el;
7528 if (originNext === null) {
7529 updateHOCHostEl(instance, nextTree.el);
7530 }
7531 if (u) {
7532 queuePostRenderEffect(u, parentSuspense);
7533 }
7534 if (vnodeHook = next.props && next.props.onVnodeUpdated) {
7535 queuePostRenderEffect(
7536 () => invokeVNodeHook(vnodeHook, parent, next, vnode),
7537 parentSuspense
7538 );
7539 }
7540 {
7541 devtoolsComponentUpdated(instance);
7542 }
7543 {
7544 popWarningContext();
7545 }
7546 }
7547 };
7548 const effect = instance.effect = new ReactiveEffect(
7549 componentUpdateFn,
7550 NOOP,
7551 () => queueJob(update),
7552 instance.scope
7553 // track it in component's effect scope
7554 );
7555 const update = instance.update = () => {
7556 if (effect.dirty) {
7557 effect.run();
7558 }
7559 };
7560 update.id = instance.uid;
7561 toggleRecurse(instance, true);
7562 {
7563 effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
7564 effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
7565 update.ownerInstance = instance;
7566 }
7567 update();
7568 };
7569 const updateComponentPreRender = (instance, nextVNode, optimized) => {
7570 nextVNode.component = instance;
7571 const prevProps = instance.vnode.props;
7572 instance.vnode = nextVNode;
7573 instance.next = null;
7574 updateProps(instance, nextVNode.props, prevProps, optimized);
7575 updateSlots(instance, nextVNode.children, optimized);
7576 pauseTracking();
7577 flushPreFlushCbs(instance);
7578 resetTracking();
7579 };
7580 const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
7581 const c1 = n1 && n1.children;
7582 const prevShapeFlag = n1 ? n1.shapeFlag : 0;
7583 const c2 = n2.children;
7584 const { patchFlag, shapeFlag } = n2;
7585 if (patchFlag > 0) {
7586 if (patchFlag & 128) {
7587 patchKeyedChildren(
7588 c1,
7589 c2,
7590 container,
7591 anchor,
7592 parentComponent,
7593 parentSuspense,
7594 namespace,
7595 slotScopeIds,
7596 optimized
7597 );
7598 return;
7599 } else if (patchFlag & 256) {
7600 patchUnkeyedChildren(
7601 c1,
7602 c2,
7603 container,
7604 anchor,
7605 parentComponent,
7606 parentSuspense,
7607 namespace,
7608 slotScopeIds,
7609 optimized
7610 );
7611 return;
7612 }
7613 }
7614 if (shapeFlag & 8) {
7615 if (prevShapeFlag & 16) {
7616 unmountChildren(c1, parentComponent, parentSuspense);
7617 }
7618 if (c2 !== c1) {
7619 hostSetElementText(container, c2);
7620 }
7621 } else {
7622 if (prevShapeFlag & 16) {
7623 if (shapeFlag & 16) {
7624 patchKeyedChildren(
7625 c1,
7626 c2,
7627 container,
7628 anchor,
7629 parentComponent,
7630 parentSuspense,
7631 namespace,
7632 slotScopeIds,
7633 optimized
7634 );
7635 } else {
7636 unmountChildren(c1, parentComponent, parentSuspense, true);
7637 }
7638 } else {
7639 if (prevShapeFlag & 8) {
7640 hostSetElementText(container, "");
7641 }
7642 if (shapeFlag & 16) {
7643 mountChildren(
7644 c2,
7645 container,
7646 anchor,
7647 parentComponent,
7648 parentSuspense,
7649 namespace,
7650 slotScopeIds,
7651 optimized
7652 );
7653 }
7654 }
7655 }
7656 };
7657 const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7658 c1 = c1 || EMPTY_ARR;
7659 c2 = c2 || EMPTY_ARR;
7660 const oldLength = c1.length;
7661 const newLength = c2.length;
7662 const commonLength = Math.min(oldLength, newLength);
7663 let i;
7664 for (i = 0; i < commonLength; i++) {
7665 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
7666 patch(
7667 c1[i],
7668 nextChild,
7669 container,
7670 null,
7671 parentComponent,
7672 parentSuspense,
7673 namespace,
7674 slotScopeIds,
7675 optimized
7676 );
7677 }
7678 if (oldLength > newLength) {
7679 unmountChildren(
7680 c1,
7681 parentComponent,
7682 parentSuspense,
7683 true,
7684 false,
7685 commonLength
7686 );
7687 } else {
7688 mountChildren(
7689 c2,
7690 container,
7691 anchor,
7692 parentComponent,
7693 parentSuspense,
7694 namespace,
7695 slotScopeIds,
7696 optimized,
7697 commonLength
7698 );
7699 }
7700 };
7701 const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7702 let i = 0;
7703 const l2 = c2.length;
7704 let e1 = c1.length - 1;
7705 let e2 = l2 - 1;
7706 while (i <= e1 && i <= e2) {
7707 const n1 = c1[i];
7708 const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
7709 if (isSameVNodeType(n1, n2)) {
7710 patch(
7711 n1,
7712 n2,
7713 container,
7714 null,
7715 parentComponent,
7716 parentSuspense,
7717 namespace,
7718 slotScopeIds,
7719 optimized
7720 );
7721 } else {
7722 break;
7723 }
7724 i++;
7725 }
7726 while (i <= e1 && i <= e2) {
7727 const n1 = c1[e1];
7728 const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
7729 if (isSameVNodeType(n1, n2)) {
7730 patch(
7731 n1,
7732 n2,
7733 container,
7734 null,
7735 parentComponent,
7736 parentSuspense,
7737 namespace,
7738 slotScopeIds,
7739 optimized
7740 );
7741 } else {
7742 break;
7743 }
7744 e1--;
7745 e2--;
7746 }
7747 if (i > e1) {
7748 if (i <= e2) {
7749 const nextPos = e2 + 1;
7750 const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
7751 while (i <= e2) {
7752 patch(
7753 null,
7754 c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
7755 container,
7756 anchor,
7757 parentComponent,
7758 parentSuspense,
7759 namespace,
7760 slotScopeIds,
7761 optimized
7762 );
7763 i++;
7764 }
7765 }
7766 } else if (i > e2) {
7767 while (i <= e1) {
7768 unmount(c1[i], parentComponent, parentSuspense, true);
7769 i++;
7770 }
7771 } else {
7772 const s1 = i;
7773 const s2 = i;
7774 const keyToNewIndexMap = /* @__PURE__ */ new Map();
7775 for (i = s2; i <= e2; i++) {
7776 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
7777 if (nextChild.key != null) {
7778 if (keyToNewIndexMap.has(nextChild.key)) {
7779 warn$1(
7780 `Duplicate keys found during update:`,
7781 JSON.stringify(nextChild.key),
7782 `Make sure keys are unique.`
7783 );
7784 }
7785 keyToNewIndexMap.set(nextChild.key, i);
7786 }
7787 }
7788 let j;
7789 let patched = 0;
7790 const toBePatched = e2 - s2 + 1;
7791 let moved = false;
7792 let maxNewIndexSoFar = 0;
7793 const newIndexToOldIndexMap = new Array(toBePatched);
7794 for (i = 0; i < toBePatched; i++)
7795 newIndexToOldIndexMap[i] = 0;
7796 for (i = s1; i <= e1; i++) {
7797 const prevChild = c1[i];
7798 if (patched >= toBePatched) {
7799 unmount(prevChild, parentComponent, parentSuspense, true);
7800 continue;
7801 }
7802 let newIndex;
7803 if (prevChild.key != null) {
7804 newIndex = keyToNewIndexMap.get(prevChild.key);
7805 } else {
7806 for (j = s2; j <= e2; j++) {
7807 if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
7808 newIndex = j;
7809 break;
7810 }
7811 }
7812 }
7813 if (newIndex === void 0) {
7814 unmount(prevChild, parentComponent, parentSuspense, true);
7815 } else {
7816 newIndexToOldIndexMap[newIndex - s2] = i + 1;
7817 if (newIndex >= maxNewIndexSoFar) {
7818 maxNewIndexSoFar = newIndex;
7819 } else {
7820 moved = true;
7821 }
7822 patch(
7823 prevChild,
7824 c2[newIndex],
7825 container,
7826 null,
7827 parentComponent,
7828 parentSuspense,
7829 namespace,
7830 slotScopeIds,
7831 optimized
7832 );
7833 patched++;
7834 }
7835 }
7836 const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
7837 j = increasingNewIndexSequence.length - 1;
7838 for (i = toBePatched - 1; i >= 0; i--) {
7839 const nextIndex = s2 + i;
7840 const nextChild = c2[nextIndex];
7841 const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
7842 if (newIndexToOldIndexMap[i] === 0) {
7843 patch(
7844 null,
7845 nextChild,
7846 container,
7847 anchor,
7848 parentComponent,
7849 parentSuspense,
7850 namespace,
7851 slotScopeIds,
7852 optimized
7853 );
7854 } else if (moved) {
7855 if (j < 0 || i !== increasingNewIndexSequence[j]) {
7856 move(nextChild, container, anchor, 2);
7857 } else {
7858 j--;
7859 }
7860 }
7861 }
7862 }
7863 };
7864 const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
7865 const { el, type, transition, children, shapeFlag } = vnode;
7866 if (shapeFlag & 6) {
7867 move(vnode.component.subTree, container, anchor, moveType);
7868 return;
7869 }
7870 if (shapeFlag & 128) {
7871 vnode.suspense.move(container, anchor, moveType);
7872 return;
7873 }
7874 if (shapeFlag & 64) {
7875 type.move(vnode, container, anchor, internals);
7876 return;
7877 }
7878 if (type === Fragment) {
7879 hostInsert(el, container, anchor);
7880 for (let i = 0; i < children.length; i++) {
7881 move(children[i], container, anchor, moveType);
7882 }
7883 hostInsert(vnode.anchor, container, anchor);
7884 return;
7885 }
7886 if (type === Static) {
7887 moveStaticNode(vnode, container, anchor);
7888 return;
7889 }
7890 const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
7891 if (needTransition2) {
7892 if (moveType === 0) {
7893 transition.beforeEnter(el);
7894 hostInsert(el, container, anchor);
7895 queuePostRenderEffect(() => transition.enter(el), parentSuspense);
7896 } else {
7897 const { leave, delayLeave, afterLeave } = transition;
7898 const remove2 = () => hostInsert(el, container, anchor);
7899 const performLeave = () => {
7900 leave(el, () => {
7901 remove2();
7902 afterLeave && afterLeave();
7903 });
7904 };
7905 if (delayLeave) {
7906 delayLeave(el, remove2, performLeave);
7907 } else {
7908 performLeave();
7909 }
7910 }
7911 } else {
7912 hostInsert(el, container, anchor);
7913 }
7914 };
7915 const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
7916 const {
7917 type,
7918 props,
7919 ref,
7920 children,
7921 dynamicChildren,
7922 shapeFlag,
7923 patchFlag,
7924 dirs
7925 } = vnode;
7926 if (ref != null) {
7927 setRef(ref, null, parentSuspense, vnode, true);
7928 }
7929 if (shapeFlag & 256) {
7930 parentComponent.ctx.deactivate(vnode);
7931 return;
7932 }
7933 const shouldInvokeDirs = shapeFlag & 1 && dirs;
7934 const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
7935 let vnodeHook;
7936 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
7937 invokeVNodeHook(vnodeHook, parentComponent, vnode);
7938 }
7939 if (shapeFlag & 6) {
7940 unmountComponent(vnode.component, parentSuspense, doRemove);
7941 } else {
7942 if (shapeFlag & 128) {
7943 vnode.suspense.unmount(parentSuspense, doRemove);
7944 return;
7945 }
7946 if (shouldInvokeDirs) {
7947 invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
7948 }
7949 if (shapeFlag & 64) {
7950 vnode.type.remove(
7951 vnode,
7952 parentComponent,
7953 parentSuspense,
7954 optimized,
7955 internals,
7956 doRemove
7957 );
7958 } else if (dynamicChildren && // #1153: fast path should not be taken for non-stable (v-for) fragments
7959 (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
7960 unmountChildren(
7961 dynamicChildren,
7962 parentComponent,
7963 parentSuspense,
7964 false,
7965 true
7966 );
7967 } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
7968 unmountChildren(children, parentComponent, parentSuspense);
7969 }
7970 if (doRemove) {
7971 remove(vnode);
7972 }
7973 }
7974 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
7975 queuePostRenderEffect(() => {
7976 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7977 shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
7978 }, parentSuspense);
7979 }
7980 };
7981 const remove = (vnode) => {
7982 const { type, el, anchor, transition } = vnode;
7983 if (type === Fragment) {
7984 if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
7985 vnode.children.forEach((child) => {
7986 if (child.type === Comment) {
7987 hostRemove(child.el);
7988 } else {
7989 remove(child);
7990 }
7991 });
7992 } else {
7993 removeFragment(el, anchor);
7994 }
7995 return;
7996 }
7997 if (type === Static) {
7998 removeStaticNode(vnode);
7999 return;
8000 }
8001 const performRemove = () => {
8002 hostRemove(el);
8003 if (transition && !transition.persisted && transition.afterLeave) {
8004 transition.afterLeave();
8005 }
8006 };
8007 if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
8008 const { leave, delayLeave } = transition;
8009 const performLeave = () => leave(el, performRemove);
8010 if (delayLeave) {
8011 delayLeave(vnode.el, performRemove, performLeave);
8012 } else {
8013 performLeave();
8014 }
8015 } else {
8016 performRemove();
8017 }
8018 };
8019 const removeFragment = (cur, end) => {
8020 let next;
8021 while (cur !== end) {
8022 next = hostNextSibling(cur);
8023 hostRemove(cur);
8024 cur = next;
8025 }
8026 hostRemove(end);
8027 };
8028 const unmountComponent = (instance, parentSuspense, doRemove) => {
8029 if (instance.type.__hmrId) {
8030 unregisterHMR(instance);
8031 }
8032 const { bum, scope, update, subTree, um } = instance;
8033 if (bum) {
8034 invokeArrayFns(bum);
8035 }
8036 scope.stop();
8037 if (update) {
8038 update.active = false;
8039 unmount(subTree, instance, parentSuspense, doRemove);
8040 }
8041 if (um) {
8042 queuePostRenderEffect(um, parentSuspense);
8043 }
8044 queuePostRenderEffect(() => {
8045 instance.isUnmounted = true;
8046 }, parentSuspense);
8047 if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
8048 parentSuspense.deps--;
8049 if (parentSuspense.deps === 0) {
8050 parentSuspense.resolve();
8051 }
8052 }
8053 {
8054 devtoolsComponentRemoved(instance);
8055 }
8056 };
8057 const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
8058 for (let i = start; i < children.length; i++) {
8059 unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
8060 }
8061 };
8062 const getNextHostNode = (vnode) => {
8063 if (vnode.shapeFlag & 6) {
8064 return getNextHostNode(vnode.component.subTree);
8065 }
8066 if (vnode.shapeFlag & 128) {
8067 return vnode.suspense.next();
8068 }
8069 return hostNextSibling(vnode.anchor || vnode.el);
8070 };
8071 let isFlushing = false;
8072 const render = (vnode, container, namespace) => {
8073 if (vnode == null) {
8074 if (container._vnode) {
8075 unmount(container._vnode, null, null, true);
8076 }
8077 } else {
8078 patch(
8079 container._vnode || null,
8080 vnode,
8081 container,
8082 null,
8083 null,
8084 null,
8085 namespace
8086 );
8087 }
8088 if (!isFlushing) {
8089 isFlushing = true;
8090 flushPreFlushCbs();
8091 flushPostFlushCbs();
8092 isFlushing = false;
8093 }
8094 container._vnode = vnode;
8095 };
8096 const internals = {
8097 p: patch,
8098 um: unmount,
8099 m: move,
8100 r: remove,
8101 mt: mountComponent,
8102 mc: mountChildren,
8103 pc: patchChildren,
8104 pbc: patchBlockChildren,
8105 n: getNextHostNode,
8106 o: options
8107 };
8108 let hydrate;
8109 let hydrateNode;
8110 if (createHydrationFns) {
8111 [hydrate, hydrateNode] = createHydrationFns(
8112 internals
8113 );
8114 }
8115 return {
8116 render,
8117 hydrate,
8118 createApp: createAppAPI(render, hydrate)
8119 };
8120}
8121function resolveChildrenNamespace({ type, props }, currentNamespace) {
8122 return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
8123}
8124function toggleRecurse({ effect, update }, allowed) {
8125 effect.allowRecurse = update.allowRecurse = allowed;
8126}
8127function needTransition(parentSuspense, transition) {
8128 return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
8129}
8130function traverseStaticChildren(n1, n2, shallow = false) {
8131 const ch1 = n1.children;
8132 const ch2 = n2.children;
8133 if (isArray(ch1) && isArray(ch2)) {
8134 for (let i = 0; i < ch1.length; i++) {
8135 const c1 = ch1[i];
8136 let c2 = ch2[i];
8137 if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
8138 if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
8139 c2 = ch2[i] = cloneIfMounted(ch2[i]);
8140 c2.el = c1.el;
8141 }
8142 if (!shallow)
8143 traverseStaticChildren(c1, c2);
8144 }
8145 if (c2.type === Text) {
8146 c2.el = c1.el;
8147 }
8148 if (c2.type === Comment && !c2.el) {
8149 c2.el = c1.el;
8150 }
8151 }
8152 }
8153}
8154function getSequence(arr) {
8155 const p = arr.slice();
8156 const result = [0];
8157 let i, j, u, v, c;
8158 const len = arr.length;
8159 for (i = 0; i < len; i++) {
8160 const arrI = arr[i];
8161 if (arrI !== 0) {
8162 j = result[result.length - 1];
8163 if (arr[j] < arrI) {
8164 p[i] = j;
8165 result.push(i);
8166 continue;
8167 }
8168 u = 0;
8169 v = result.length - 1;
8170 while (u < v) {
8171 c = u + v >> 1;
8172 if (arr[result[c]] < arrI) {
8173 u = c + 1;
8174 } else {
8175 v = c;
8176 }
8177 }
8178 if (arrI < arr[result[u]]) {
8179 if (u > 0) {
8180 p[i] = result[u - 1];
8181 }
8182 result[u] = i;
8183 }
8184 }
8185 }
8186 u = result.length;
8187 v = result[u - 1];
8188 while (u-- > 0) {
8189 result[u] = v;
8190 v = p[v];
8191 }
8192 return result;
8193}
8194function locateNonHydratedAsyncRoot(instance) {
8195 const subComponent = instance.subTree.component;
8196 if (subComponent) {
8197 if (subComponent.asyncDep && !subComponent.asyncResolved) {
8198 return subComponent;
8199 } else {
8200 return locateNonHydratedAsyncRoot(subComponent);
8201 }
8202 }
8203}
8204
8205const isTeleport = (type) => type.__isTeleport;
8206const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
8207const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
8208const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
8209const resolveTarget = (props, select) => {
8210 const targetSelector = props && props.to;
8211 if (isString(targetSelector)) {
8212 if (!select) {
8213 warn$1(
8214 `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
8215 );
8216 return null;
8217 } else {
8218 const target = select(targetSelector);
8219 if (!target) {
8220 warn$1(
8221 `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`
8222 );
8223 }
8224 return target;
8225 }
8226 } else {
8227 if (!targetSelector && !isTeleportDisabled(props)) {
8228 warn$1(`Invalid Teleport target: ${targetSelector}`);
8229 }
8230 return targetSelector;
8231 }
8232};
8233const TeleportImpl = {
8234 name: "Teleport",
8235 __isTeleport: true,
8236 process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
8237 const {
8238 mc: mountChildren,
8239 pc: patchChildren,
8240 pbc: patchBlockChildren,
8241 o: { insert, querySelector, createText, createComment }
8242 } = internals;
8243 const disabled = isTeleportDisabled(n2.props);
8244 let { shapeFlag, children, dynamicChildren } = n2;
8245 if (isHmrUpdating) {
8246 optimized = false;
8247 dynamicChildren = null;
8248 }
8249 if (n1 == null) {
8250 const placeholder = n2.el = createComment("teleport start") ;
8251 const mainAnchor = n2.anchor = createComment("teleport end") ;
8252 insert(placeholder, container, anchor);
8253 insert(mainAnchor, container, anchor);
8254 const target = n2.target = resolveTarget(n2.props, querySelector);
8255 const targetAnchor = n2.targetAnchor = createText("");
8256 if (target) {
8257 insert(targetAnchor, target);
8258 if (namespace === "svg" || isTargetSVG(target)) {
8259 namespace = "svg";
8260 } else if (namespace === "mathml" || isTargetMathML(target)) {
8261 namespace = "mathml";
8262 }
8263 } else if (!disabled) {
8264 warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
8265 }
8266 const mount = (container2, anchor2) => {
8267 if (shapeFlag & 16) {
8268 mountChildren(
8269 children,
8270 container2,
8271 anchor2,
8272 parentComponent,
8273 parentSuspense,
8274 namespace,
8275 slotScopeIds,
8276 optimized
8277 );
8278 }
8279 };
8280 if (disabled) {
8281 mount(container, mainAnchor);
8282 } else if (target) {
8283 mount(target, targetAnchor);
8284 }
8285 } else {
8286 n2.el = n1.el;
8287 const mainAnchor = n2.anchor = n1.anchor;
8288 const target = n2.target = n1.target;
8289 const targetAnchor = n2.targetAnchor = n1.targetAnchor;
8290 const wasDisabled = isTeleportDisabled(n1.props);
8291 const currentContainer = wasDisabled ? container : target;
8292 const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
8293 if (namespace === "svg" || isTargetSVG(target)) {
8294 namespace = "svg";
8295 } else if (namespace === "mathml" || isTargetMathML(target)) {
8296 namespace = "mathml";
8297 }
8298 if (dynamicChildren) {
8299 patchBlockChildren(
8300 n1.dynamicChildren,
8301 dynamicChildren,
8302 currentContainer,
8303 parentComponent,
8304 parentSuspense,
8305 namespace,
8306 slotScopeIds
8307 );
8308 traverseStaticChildren(n1, n2, true);
8309 } else if (!optimized) {
8310 patchChildren(
8311 n1,
8312 n2,
8313 currentContainer,
8314 currentAnchor,
8315 parentComponent,
8316 parentSuspense,
8317 namespace,
8318 slotScopeIds,
8319 false
8320 );
8321 }
8322 if (disabled) {
8323 if (!wasDisabled) {
8324 moveTeleport(
8325 n2,
8326 container,
8327 mainAnchor,
8328 internals,
8329 1
8330 );
8331 } else {
8332 if (n2.props && n1.props && n2.props.to !== n1.props.to) {
8333 n2.props.to = n1.props.to;
8334 }
8335 }
8336 } else {
8337 if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
8338 const nextTarget = n2.target = resolveTarget(
8339 n2.props,
8340 querySelector
8341 );
8342 if (nextTarget) {
8343 moveTeleport(
8344 n2,
8345 nextTarget,
8346 null,
8347 internals,
8348 0
8349 );
8350 } else {
8351 warn$1(
8352 "Invalid Teleport target on update:",
8353 target,
8354 `(${typeof target})`
8355 );
8356 }
8357 } else if (wasDisabled) {
8358 moveTeleport(
8359 n2,
8360 target,
8361 targetAnchor,
8362 internals,
8363 1
8364 );
8365 }
8366 }
8367 }
8368 updateCssVars(n2);
8369 },
8370 remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
8371 const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
8372 if (target) {
8373 hostRemove(targetAnchor);
8374 }
8375 doRemove && hostRemove(anchor);
8376 if (shapeFlag & 16) {
8377 const shouldRemove = doRemove || !isTeleportDisabled(props);
8378 for (let i = 0; i < children.length; i++) {
8379 const child = children[i];
8380 unmount(
8381 child,
8382 parentComponent,
8383 parentSuspense,
8384 shouldRemove,
8385 !!child.dynamicChildren
8386 );
8387 }
8388 }
8389 },
8390 move: moveTeleport,
8391 hydrate: hydrateTeleport
8392};
8393function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
8394 if (moveType === 0) {
8395 insert(vnode.targetAnchor, container, parentAnchor);
8396 }
8397 const { el, anchor, shapeFlag, children, props } = vnode;
8398 const isReorder = moveType === 2;
8399 if (isReorder) {
8400 insert(el, container, parentAnchor);
8401 }
8402 if (!isReorder || isTeleportDisabled(props)) {
8403 if (shapeFlag & 16) {
8404 for (let i = 0; i < children.length; i++) {
8405 move(
8406 children[i],
8407 container,
8408 parentAnchor,
8409 2
8410 );
8411 }
8412 }
8413 }
8414 if (isReorder) {
8415 insert(anchor, container, parentAnchor);
8416 }
8417}
8418function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
8419 o: { nextSibling, parentNode, querySelector }
8420}, hydrateChildren) {
8421 const target = vnode.target = resolveTarget(
8422 vnode.props,
8423 querySelector
8424 );
8425 if (target) {
8426 const targetNode = target._lpa || target.firstChild;
8427 if (vnode.shapeFlag & 16) {
8428 if (isTeleportDisabled(vnode.props)) {
8429 vnode.anchor = hydrateChildren(
8430 nextSibling(node),
8431 vnode,
8432 parentNode(node),
8433 parentComponent,
8434 parentSuspense,
8435 slotScopeIds,
8436 optimized
8437 );
8438 vnode.targetAnchor = targetNode;
8439 } else {
8440 vnode.anchor = nextSibling(node);
8441 let targetAnchor = targetNode;
8442 while (targetAnchor) {
8443 targetAnchor = nextSibling(targetAnchor);
8444 if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
8445 vnode.targetAnchor = targetAnchor;
8446 target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
8447 break;
8448 }
8449 }
8450 hydrateChildren(
8451 targetNode,
8452 vnode,
8453 target,
8454 parentComponent,
8455 parentSuspense,
8456 slotScopeIds,
8457 optimized
8458 );
8459 }
8460 }
8461 updateCssVars(vnode);
8462 }
8463 return vnode.anchor && nextSibling(vnode.anchor);
8464}
8465const Teleport = TeleportImpl;
8466function updateCssVars(vnode) {
8467 const ctx = vnode.ctx;
8468 if (ctx && ctx.ut) {
8469 let node = vnode.children[0].el;
8470 while (node && node !== vnode.targetAnchor) {
8471 if (node.nodeType === 1)
8472 node.setAttribute("data-v-owner", ctx.uid);
8473 node = node.nextSibling;
8474 }
8475 ctx.ut();
8476 }
8477}
8478
8479const Fragment = Symbol.for("v-fgt");
8480const Text = Symbol.for("v-txt");
8481const Comment = Symbol.for("v-cmt");
8482const Static = Symbol.for("v-stc");
8483const blockStack = [];
8484let currentBlock = null;
8485function openBlock(disableTracking = false) {
8486 blockStack.push(currentBlock = disableTracking ? null : []);
8487}
8488function closeBlock() {
8489 blockStack.pop();
8490 currentBlock = blockStack[blockStack.length - 1] || null;
8491}
8492let isBlockTreeEnabled = 1;
8493function setBlockTracking(value) {
8494 isBlockTreeEnabled += value;
8495}
8496function setupBlock(vnode) {
8497 vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
8498 closeBlock();
8499 if (isBlockTreeEnabled > 0 && currentBlock) {
8500 currentBlock.push(vnode);
8501 }
8502 return vnode;
8503}
8504function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
8505 return setupBlock(
8506 createBaseVNode(
8507 type,
8508 props,
8509 children,
8510 patchFlag,
8511 dynamicProps,
8512 shapeFlag,
8513 true
8514 )
8515 );
8516}
8517function createBlock(type, props, children, patchFlag, dynamicProps) {
8518 return setupBlock(
8519 createVNode(
8520 type,
8521 props,
8522 children,
8523 patchFlag,
8524 dynamicProps,
8525 true
8526 )
8527 );
8528}
8529function isVNode(value) {
8530 return value ? value.__v_isVNode === true : false;
8531}
8532function isSameVNodeType(n1, n2) {
8533 if (n2.shapeFlag & 6 && hmrDirtyComponents.has(n2.type)) {
8534 n1.shapeFlag &= ~256;
8535 n2.shapeFlag &= ~512;
8536 return false;
8537 }
8538 return n1.type === n2.type && n1.key === n2.key;
8539}
8540let vnodeArgsTransformer;
8541function transformVNodeArgs(transformer) {
8542 vnodeArgsTransformer = transformer;
8543}
8544const createVNodeWithArgsTransform = (...args) => {
8545 return _createVNode(
8546 ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
8547 );
8548};
8549const InternalObjectKey = `__vInternal`;
8550const normalizeKey = ({ key }) => key != null ? key : null;
8551const normalizeRef = ({
8552 ref,
8553 ref_key,
8554 ref_for
8555}) => {
8556 if (typeof ref === "number") {
8557 ref = "" + ref;
8558 }
8559 return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
8560};
8561function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
8562 const vnode = {
8563 __v_isVNode: true,
8564 __v_skip: true,
8565 type,
8566 props,
8567 key: props && normalizeKey(props),
8568 ref: props && normalizeRef(props),
8569 scopeId: currentScopeId,
8570 slotScopeIds: null,
8571 children,
8572 component: null,
8573 suspense: null,
8574 ssContent: null,
8575 ssFallback: null,
8576 dirs: null,
8577 transition: null,
8578 el: null,
8579 anchor: null,
8580 target: null,
8581 targetAnchor: null,
8582 staticCount: 0,
8583 shapeFlag,
8584 patchFlag,
8585 dynamicProps,
8586 dynamicChildren: null,
8587 appContext: null,
8588 ctx: currentRenderingInstance
8589 };
8590 if (needFullChildrenNormalization) {
8591 normalizeChildren(vnode, children);
8592 if (shapeFlag & 128) {
8593 type.normalize(vnode);
8594 }
8595 } else if (children) {
8596 vnode.shapeFlag |= isString(children) ? 8 : 16;
8597 }
8598 if (vnode.key !== vnode.key) {
8599 warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
8600 }
8601 if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
8602 !isBlockNode && // has current parent block
8603 currentBlock && // presence of a patch flag indicates this node needs patching on updates.
8604 // component nodes also should always be patched, because even if the
8605 // component doesn't need to update, it needs to persist the instance on to
8606 // the next vnode so that it can be properly unmounted later.
8607 (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
8608 // vnode should not be considered dynamic due to handler caching.
8609 vnode.patchFlag !== 32) {
8610 currentBlock.push(vnode);
8611 }
8612 return vnode;
8613}
8614const createVNode = createVNodeWithArgsTransform ;
8615function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
8616 if (!type || type === NULL_DYNAMIC_COMPONENT) {
8617 if (!type) {
8618 warn$1(`Invalid vnode type when creating vnode: ${type}.`);
8619 }
8620 type = Comment;
8621 }
8622 if (isVNode(type)) {
8623 const cloned = cloneVNode(
8624 type,
8625 props,
8626 true
8627 /* mergeRef: true */
8628 );
8629 if (children) {
8630 normalizeChildren(cloned, children);
8631 }
8632 if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
8633 if (cloned.shapeFlag & 6) {
8634 currentBlock[currentBlock.indexOf(type)] = cloned;
8635 } else {
8636 currentBlock.push(cloned);
8637 }
8638 }
8639 cloned.patchFlag |= -2;
8640 return cloned;
8641 }
8642 if (isClassComponent(type)) {
8643 type = type.__vccOpts;
8644 }
8645 if (props) {
8646 props = guardReactiveProps(props);
8647 let { class: klass, style } = props;
8648 if (klass && !isString(klass)) {
8649 props.class = normalizeClass(klass);
8650 }
8651 if (isObject(style)) {
8652 if (isProxy(style) && !isArray(style)) {
8653 style = extend({}, style);
8654 }
8655 props.style = normalizeStyle(style);
8656 }
8657 }
8658 const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
8659 if (shapeFlag & 4 && isProxy(type)) {
8660 type = toRaw(type);
8661 warn$1(
8662 `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
8663 `
8664Component that was made reactive: `,
8665 type
8666 );
8667 }
8668 return createBaseVNode(
8669 type,
8670 props,
8671 children,
8672 patchFlag,
8673 dynamicProps,
8674 shapeFlag,
8675 isBlockNode,
8676 true
8677 );
8678}
8679function guardReactiveProps(props) {
8680 if (!props)
8681 return null;
8682 return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
8683}
8684function cloneVNode(vnode, extraProps, mergeRef = false) {
8685 const { props, ref, patchFlag, children } = vnode;
8686 const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
8687 const cloned = {
8688 __v_isVNode: true,
8689 __v_skip: true,
8690 type: vnode.type,
8691 props: mergedProps,
8692 key: mergedProps && normalizeKey(mergedProps),
8693 ref: extraProps && extraProps.ref ? (
8694 // #2078 in the case of <component :is="vnode" ref="extra"/>
8695 // if the vnode itself already has a ref, cloneVNode will need to merge
8696 // the refs so the single vnode can be set on multiple refs
8697 mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
8698 ) : ref,
8699 scopeId: vnode.scopeId,
8700 slotScopeIds: vnode.slotScopeIds,
8701 children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
8702 target: vnode.target,
8703 targetAnchor: vnode.targetAnchor,
8704 staticCount: vnode.staticCount,
8705 shapeFlag: vnode.shapeFlag,
8706 // if the vnode is cloned with extra props, we can no longer assume its
8707 // existing patch flag to be reliable and need to add the FULL_PROPS flag.
8708 // note: preserve flag for fragments since they use the flag for children
8709 // fast paths only.
8710 patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
8711 dynamicProps: vnode.dynamicProps,
8712 dynamicChildren: vnode.dynamicChildren,
8713 appContext: vnode.appContext,
8714 dirs: vnode.dirs,
8715 transition: vnode.transition,
8716 // These should technically only be non-null on mounted VNodes. However,
8717 // they *should* be copied for kept-alive vnodes. So we just always copy
8718 // them since them being non-null during a mount doesn't affect the logic as
8719 // they will simply be overwritten.
8720 component: vnode.component,
8721 suspense: vnode.suspense,
8722 ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
8723 ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
8724 el: vnode.el,
8725 anchor: vnode.anchor,
8726 ctx: vnode.ctx,
8727 ce: vnode.ce
8728 };
8729 return cloned;
8730}
8731function deepCloneVNode(vnode) {
8732 const cloned = cloneVNode(vnode);
8733 if (isArray(vnode.children)) {
8734 cloned.children = vnode.children.map(deepCloneVNode);
8735 }
8736 return cloned;
8737}
8738function createTextVNode(text = " ", flag = 0) {
8739 return createVNode(Text, null, text, flag);
8740}
8741function createStaticVNode(content, numberOfNodes) {
8742 const vnode = createVNode(Static, null, content);
8743 vnode.staticCount = numberOfNodes;
8744 return vnode;
8745}
8746function createCommentVNode(text = "", asBlock = false) {
8747 return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
8748}
8749function normalizeVNode(child) {
8750 if (child == null || typeof child === "boolean") {
8751 return createVNode(Comment);
8752 } else if (isArray(child)) {
8753 return createVNode(
8754 Fragment,
8755 null,
8756 // #3666, avoid reference pollution when reusing vnode
8757 child.slice()
8758 );
8759 } else if (typeof child === "object") {
8760 return cloneIfMounted(child);
8761 } else {
8762 return createVNode(Text, null, String(child));
8763 }
8764}
8765function cloneIfMounted(child) {
8766 return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
8767}
8768function normalizeChildren(vnode, children) {
8769 let type = 0;
8770 const { shapeFlag } = vnode;
8771 if (children == null) {
8772 children = null;
8773 } else if (isArray(children)) {
8774 type = 16;
8775 } else if (typeof children === "object") {
8776 if (shapeFlag & (1 | 64)) {
8777 const slot = children.default;
8778 if (slot) {
8779 slot._c && (slot._d = false);
8780 normalizeChildren(vnode, slot());
8781 slot._c && (slot._d = true);
8782 }
8783 return;
8784 } else {
8785 type = 32;
8786 const slotFlag = children._;
8787 if (!slotFlag && !(InternalObjectKey in children)) {
8788 children._ctx = currentRenderingInstance;
8789 } else if (slotFlag === 3 && currentRenderingInstance) {
8790 if (currentRenderingInstance.slots._ === 1) {
8791 children._ = 1;
8792 } else {
8793 children._ = 2;
8794 vnode.patchFlag |= 1024;
8795 }
8796 }
8797 }
8798 } else if (isFunction(children)) {
8799 children = { default: children, _ctx: currentRenderingInstance };
8800 type = 32;
8801 } else {
8802 children = String(children);
8803 if (shapeFlag & 64) {
8804 type = 16;
8805 children = [createTextVNode(children)];
8806 } else {
8807 type = 8;
8808 }
8809 }
8810 vnode.children = children;
8811 vnode.shapeFlag |= type;
8812}
8813function mergeProps(...args) {
8814 const ret = {};
8815 for (let i = 0; i < args.length; i++) {
8816 const toMerge = args[i];
8817 for (const key in toMerge) {
8818 if (key === "class") {
8819 if (ret.class !== toMerge.class) {
8820 ret.class = normalizeClass([ret.class, toMerge.class]);
8821 }
8822 } else if (key === "style") {
8823 ret.style = normalizeStyle([ret.style, toMerge.style]);
8824 } else if (isOn(key)) {
8825 const existing = ret[key];
8826 const incoming = toMerge[key];
8827 if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
8828 ret[key] = existing ? [].concat(existing, incoming) : incoming;
8829 }
8830 } else if (key !== "") {
8831 ret[key] = toMerge[key];
8832 }
8833 }
8834 }
8835 return ret;
8836}
8837function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
8838 callWithAsyncErrorHandling(hook, instance, 7, [
8839 vnode,
8840 prevVNode
8841 ]);
8842}
8843
8844const emptyAppContext = createAppContext();
8845let uid = 0;
8846function createComponentInstance(vnode, parent, suspense) {
8847 const type = vnode.type;
8848 const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
8849 const instance = {
8850 uid: uid++,
8851 vnode,
8852 type,
8853 parent,
8854 appContext,
8855 root: null,
8856 // to be immediately set
8857 next: null,
8858 subTree: null,
8859 // will be set synchronously right after creation
8860 effect: null,
8861 update: null,
8862 // will be set synchronously right after creation
8863 scope: new EffectScope(
8864 true
8865 /* detached */
8866 ),
8867 render: null,
8868 proxy: null,
8869 exposed: null,
8870 exposeProxy: null,
8871 withProxy: null,
8872 provides: parent ? parent.provides : Object.create(appContext.provides),
8873 accessCache: null,
8874 renderCache: [],
8875 // local resolved assets
8876 components: null,
8877 directives: null,
8878 // resolved props and emits options
8879 propsOptions: normalizePropsOptions(type, appContext),
8880 emitsOptions: normalizeEmitsOptions(type, appContext),
8881 // emit
8882 emit: null,
8883 // to be set immediately
8884 emitted: null,
8885 // props default value
8886 propsDefaults: EMPTY_OBJ,
8887 // inheritAttrs
8888 inheritAttrs: type.inheritAttrs,
8889 // state
8890 ctx: EMPTY_OBJ,
8891 data: EMPTY_OBJ,
8892 props: EMPTY_OBJ,
8893 attrs: EMPTY_OBJ,
8894 slots: EMPTY_OBJ,
8895 refs: EMPTY_OBJ,
8896 setupState: EMPTY_OBJ,
8897 setupContext: null,
8898 attrsProxy: null,
8899 slotsProxy: null,
8900 // suspense related
8901 suspense,
8902 suspenseId: suspense ? suspense.pendingId : 0,
8903 asyncDep: null,
8904 asyncResolved: false,
8905 // lifecycle hooks
8906 // not using enums here because it results in computed properties
8907 isMounted: false,
8908 isUnmounted: false,
8909 isDeactivated: false,
8910 bc: null,
8911 c: null,
8912 bm: null,
8913 m: null,
8914 bu: null,
8915 u: null,
8916 um: null,
8917 bum: null,
8918 da: null,
8919 a: null,
8920 rtg: null,
8921 rtc: null,
8922 ec: null,
8923 sp: null
8924 };
8925 {
8926 instance.ctx = createDevRenderContext(instance);
8927 }
8928 instance.root = parent ? parent.root : instance;
8929 instance.emit = emit.bind(null, instance);
8930 if (vnode.ce) {
8931 vnode.ce(instance);
8932 }
8933 return instance;
8934}
8935let currentInstance = null;
8936const getCurrentInstance = () => currentInstance || currentRenderingInstance;
8937let internalSetCurrentInstance;
8938let setInSSRSetupState;
8939{
8940 internalSetCurrentInstance = (i) => {
8941 currentInstance = i;
8942 };
8943 setInSSRSetupState = (v) => {
8944 isInSSRComponentSetup = v;
8945 };
8946}
8947const setCurrentInstance = (instance) => {
8948 const prev = currentInstance;
8949 internalSetCurrentInstance(instance);
8950 instance.scope.on();
8951 return () => {
8952 instance.scope.off();
8953 internalSetCurrentInstance(prev);
8954 };
8955};
8956const unsetCurrentInstance = () => {
8957 currentInstance && currentInstance.scope.off();
8958 internalSetCurrentInstance(null);
8959};
8960const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
8961function validateComponentName(name, { isNativeTag }) {
8962 if (isBuiltInTag(name) || isNativeTag(name)) {
8963 warn$1(
8964 "Do not use built-in or reserved HTML elements as component id: " + name
8965 );
8966 }
8967}
8968function isStatefulComponent(instance) {
8969 return instance.vnode.shapeFlag & 4;
8970}
8971let isInSSRComponentSetup = false;
8972function setupComponent(instance, isSSR = false) {
8973 isSSR && setInSSRSetupState(isSSR);
8974 const { props, children } = instance.vnode;
8975 const isStateful = isStatefulComponent(instance);
8976 initProps(instance, props, isStateful, isSSR);
8977 initSlots(instance, children);
8978 const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
8979 isSSR && setInSSRSetupState(false);
8980 return setupResult;
8981}
8982function setupStatefulComponent(instance, isSSR) {
8983 var _a;
8984 const Component = instance.type;
8985 {
8986 if (Component.name) {
8987 validateComponentName(Component.name, instance.appContext.config);
8988 }
8989 if (Component.components) {
8990 const names = Object.keys(Component.components);
8991 for (let i = 0; i < names.length; i++) {
8992 validateComponentName(names[i], instance.appContext.config);
8993 }
8994 }
8995 if (Component.directives) {
8996 const names = Object.keys(Component.directives);
8997 for (let i = 0; i < names.length; i++) {
8998 validateDirectiveName(names[i]);
8999 }
9000 }
9001 if (Component.compilerOptions && isRuntimeOnly()) {
9002 warn$1(
9003 `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
9004 );
9005 }
9006 }
9007 instance.accessCache = /* @__PURE__ */ Object.create(null);
9008 instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
9009 {
9010 exposePropsOnRenderContext(instance);
9011 }
9012 const { setup } = Component;
9013 if (setup) {
9014 const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
9015 const reset = setCurrentInstance(instance);
9016 pauseTracking();
9017 const setupResult = callWithErrorHandling(
9018 setup,
9019 instance,
9020 0,
9021 [
9022 shallowReadonly(instance.props) ,
9023 setupContext
9024 ]
9025 );
9026 resetTracking();
9027 reset();
9028 if (isPromise(setupResult)) {
9029 setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
9030 if (isSSR) {
9031 return setupResult.then((resolvedResult) => {
9032 handleSetupResult(instance, resolvedResult, isSSR);
9033 }).catch((e) => {
9034 handleError(e, instance, 0);
9035 });
9036 } else {
9037 instance.asyncDep = setupResult;
9038 if (!instance.suspense) {
9039 const name = (_a = Component.name) != null ? _a : "Anonymous";
9040 warn$1(
9041 `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
9042 );
9043 }
9044 }
9045 } else {
9046 handleSetupResult(instance, setupResult, isSSR);
9047 }
9048 } else {
9049 finishComponentSetup(instance, isSSR);
9050 }
9051}
9052function handleSetupResult(instance, setupResult, isSSR) {
9053 if (isFunction(setupResult)) {
9054 {
9055 instance.render = setupResult;
9056 }
9057 } else if (isObject(setupResult)) {
9058 if (isVNode(setupResult)) {
9059 warn$1(
9060 `setup() should not return VNodes directly - return a render function instead.`
9061 );
9062 }
9063 {
9064 instance.devtoolsRawSetupState = setupResult;
9065 }
9066 instance.setupState = proxyRefs(setupResult);
9067 {
9068 exposeSetupStateOnRenderContext(instance);
9069 }
9070 } else if (setupResult !== void 0) {
9071 warn$1(
9072 `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
9073 );
9074 }
9075 finishComponentSetup(instance, isSSR);
9076}
9077let compile$1;
9078let installWithProxy;
9079function registerRuntimeCompiler(_compile) {
9080 compile$1 = _compile;
9081 installWithProxy = (i) => {
9082 if (i.render._rc) {
9083 i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
9084 }
9085 };
9086}
9087const isRuntimeOnly = () => !compile$1;
9088function finishComponentSetup(instance, isSSR, skipOptions) {
9089 const Component = instance.type;
9090 if (!instance.render) {
9091 if (!isSSR && compile$1 && !Component.render) {
9092 const template = Component.template || resolveMergedOptions(instance).template;
9093 if (template) {
9094 {
9095 startMeasure(instance, `compile`);
9096 }
9097 const { isCustomElement, compilerOptions } = instance.appContext.config;
9098 const { delimiters, compilerOptions: componentCompilerOptions } = Component;
9099 const finalCompilerOptions = extend(
9100 extend(
9101 {
9102 isCustomElement,
9103 delimiters
9104 },
9105 compilerOptions
9106 ),
9107 componentCompilerOptions
9108 );
9109 Component.render = compile$1(template, finalCompilerOptions);
9110 {
9111 endMeasure(instance, `compile`);
9112 }
9113 }
9114 }
9115 instance.render = Component.render || NOOP;
9116 if (installWithProxy) {
9117 installWithProxy(instance);
9118 }
9119 }
9120 {
9121 const reset = setCurrentInstance(instance);
9122 pauseTracking();
9123 try {
9124 applyOptions(instance);
9125 } finally {
9126 resetTracking();
9127 reset();
9128 }
9129 }
9130 if (!Component.render && instance.render === NOOP && !isSSR) {
9131 if (!compile$1 && Component.template) {
9132 warn$1(
9133 `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.esm-browser.js" instead.` )
9134 );
9135 } else {
9136 warn$1(`Component is missing template or render function.`);
9137 }
9138 }
9139}
9140function getAttrsProxy(instance) {
9141 return instance.attrsProxy || (instance.attrsProxy = new Proxy(
9142 instance.attrs,
9143 {
9144 get(target, key) {
9145 markAttrsAccessed();
9146 track(instance, "get", "$attrs");
9147 return target[key];
9148 },
9149 set() {
9150 warn$1(`setupContext.attrs is readonly.`);
9151 return false;
9152 },
9153 deleteProperty() {
9154 warn$1(`setupContext.attrs is readonly.`);
9155 return false;
9156 }
9157 }
9158 ));
9159}
9160function getSlotsProxy(instance) {
9161 return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
9162 get(target, key) {
9163 track(instance, "get", "$slots");
9164 return target[key];
9165 }
9166 }));
9167}
9168function createSetupContext(instance) {
9169 const expose = (exposed) => {
9170 {
9171 if (instance.exposed) {
9172 warn$1(`expose() should be called only once per setup().`);
9173 }
9174 if (exposed != null) {
9175 let exposedType = typeof exposed;
9176 if (exposedType === "object") {
9177 if (isArray(exposed)) {
9178 exposedType = "array";
9179 } else if (isRef(exposed)) {
9180 exposedType = "ref";
9181 }
9182 }
9183 if (exposedType !== "object") {
9184 warn$1(
9185 `expose() should be passed a plain object, received ${exposedType}.`
9186 );
9187 }
9188 }
9189 }
9190 instance.exposed = exposed || {};
9191 };
9192 {
9193 return Object.freeze({
9194 get attrs() {
9195 return getAttrsProxy(instance);
9196 },
9197 get slots() {
9198 return getSlotsProxy(instance);
9199 },
9200 get emit() {
9201 return (event, ...args) => instance.emit(event, ...args);
9202 },
9203 expose
9204 });
9205 }
9206}
9207function getExposeProxy(instance) {
9208 if (instance.exposed) {
9209 return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
9210 get(target, key) {
9211 if (key in target) {
9212 return target[key];
9213 } else if (key in publicPropertiesMap) {
9214 return publicPropertiesMap[key](instance);
9215 }
9216 },
9217 has(target, key) {
9218 return key in target || key in publicPropertiesMap;
9219 }
9220 }));
9221 }
9222}
9223const classifyRE = /(?:^|[-_])(\w)/g;
9224const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
9225function getComponentName(Component, includeInferred = true) {
9226 return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
9227}
9228function formatComponentName(instance, Component, isRoot = false) {
9229 let name = getComponentName(Component);
9230 if (!name && Component.__file) {
9231 const match = Component.__file.match(/([^/\\]+)\.\w+$/);
9232 if (match) {
9233 name = match[1];
9234 }
9235 }
9236 if (!name && instance && instance.parent) {
9237 const inferFromRegistry = (registry) => {
9238 for (const key in registry) {
9239 if (registry[key] === Component) {
9240 return key;
9241 }
9242 }
9243 };
9244 name = inferFromRegistry(
9245 instance.components || instance.parent.type.components
9246 ) || inferFromRegistry(instance.appContext.components);
9247 }
9248 return name ? classify(name) : isRoot ? `App` : `Anonymous`;
9249}
9250function isClassComponent(value) {
9251 return isFunction(value) && "__vccOpts" in value;
9252}
9253
9254const computed = (getterOrOptions, debugOptions) => {
9255 const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
9256 {
9257 const i = getCurrentInstance();
9258 if (i && i.appContext.config.warnRecursiveComputed) {
9259 c._warnRecursive = true;
9260 }
9261 }
9262 return c;
9263};
9264
9265function useModel(props, name, options = EMPTY_OBJ) {
9266 const i = getCurrentInstance();
9267 if (!i) {
9268 warn$1(`useModel() called without active instance.`);
9269 return ref();
9270 }
9271 if (!i.propsOptions[0][name]) {
9272 warn$1(`useModel() called with prop "${name}" which is not declared.`);
9273 return ref();
9274 }
9275 const camelizedName = camelize(name);
9276 const hyphenatedName = hyphenate(name);
9277 const res = customRef((track, trigger) => {
9278 let localValue;
9279 watchSyncEffect(() => {
9280 const propValue = props[name];
9281 if (hasChanged(localValue, propValue)) {
9282 localValue = propValue;
9283 trigger();
9284 }
9285 });
9286 return {
9287 get() {
9288 track();
9289 return options.get ? options.get(localValue) : localValue;
9290 },
9291 set(value) {
9292 const rawProps = i.vnode.props;
9293 if (!(rawProps && // check if parent has passed v-model
9294 (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
9295 localValue = value;
9296 trigger();
9297 }
9298 i.emit(`update:${name}`, options.set ? options.set(value) : value);
9299 }
9300 };
9301 });
9302 const modifierKey = name === "modelValue" ? "modelModifiers" : `${name}Modifiers`;
9303 res[Symbol.iterator] = () => {
9304 let i2 = 0;
9305 return {
9306 next() {
9307 if (i2 < 2) {
9308 return { value: i2++ ? props[modifierKey] || {} : res, done: false };
9309 } else {
9310 return { done: true };
9311 }
9312 }
9313 };
9314 };
9315 return res;
9316}
9317
9318function h(type, propsOrChildren, children) {
9319 const l = arguments.length;
9320 if (l === 2) {
9321 if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
9322 if (isVNode(propsOrChildren)) {
9323 return createVNode(type, null, [propsOrChildren]);
9324 }
9325 return createVNode(type, propsOrChildren);
9326 } else {
9327 return createVNode(type, null, propsOrChildren);
9328 }
9329 } else {
9330 if (l > 3) {
9331 children = Array.prototype.slice.call(arguments, 2);
9332 } else if (l === 3 && isVNode(children)) {
9333 children = [children];
9334 }
9335 return createVNode(type, propsOrChildren, children);
9336 }
9337}
9338
9339function initCustomFormatter() {
9340 if (typeof window === "undefined") {
9341 return;
9342 }
9343 const vueStyle = { style: "color:#3ba776" };
9344 const numberStyle = { style: "color:#1677ff" };
9345 const stringStyle = { style: "color:#f5222d" };
9346 const keywordStyle = { style: "color:#eb2f96" };
9347 const formatter = {
9348 header(obj) {
9349 if (!isObject(obj)) {
9350 return null;
9351 }
9352 if (obj.__isVue) {
9353 return ["div", vueStyle, `VueInstance`];
9354 } else if (isRef(obj)) {
9355 return [
9356 "div",
9357 {},
9358 ["span", vueStyle, genRefFlag(obj)],
9359 "<",
9360 formatValue(obj.value),
9361 `>`
9362 ];
9363 } else if (isReactive(obj)) {
9364 return [
9365 "div",
9366 {},
9367 ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
9368 "<",
9369 formatValue(obj),
9370 `>${isReadonly(obj) ? ` (readonly)` : ``}`
9371 ];
9372 } else if (isReadonly(obj)) {
9373 return [
9374 "div",
9375 {},
9376 ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
9377 "<",
9378 formatValue(obj),
9379 ">"
9380 ];
9381 }
9382 return null;
9383 },
9384 hasBody(obj) {
9385 return obj && obj.__isVue;
9386 },
9387 body(obj) {
9388 if (obj && obj.__isVue) {
9389 return [
9390 "div",
9391 {},
9392 ...formatInstance(obj.$)
9393 ];
9394 }
9395 }
9396 };
9397 function formatInstance(instance) {
9398 const blocks = [];
9399 if (instance.type.props && instance.props) {
9400 blocks.push(createInstanceBlock("props", toRaw(instance.props)));
9401 }
9402 if (instance.setupState !== EMPTY_OBJ) {
9403 blocks.push(createInstanceBlock("setup", instance.setupState));
9404 }
9405 if (instance.data !== EMPTY_OBJ) {
9406 blocks.push(createInstanceBlock("data", toRaw(instance.data)));
9407 }
9408 const computed = extractKeys(instance, "computed");
9409 if (computed) {
9410 blocks.push(createInstanceBlock("computed", computed));
9411 }
9412 const injected = extractKeys(instance, "inject");
9413 if (injected) {
9414 blocks.push(createInstanceBlock("injected", injected));
9415 }
9416 blocks.push([
9417 "div",
9418 {},
9419 [
9420 "span",
9421 {
9422 style: keywordStyle.style + ";opacity:0.66"
9423 },
9424 "$ (internal): "
9425 ],
9426 ["object", { object: instance }]
9427 ]);
9428 return blocks;
9429 }
9430 function createInstanceBlock(type, target) {
9431 target = extend({}, target);
9432 if (!Object.keys(target).length) {
9433 return ["span", {}];
9434 }
9435 return [
9436 "div",
9437 { style: "line-height:1.25em;margin-bottom:0.6em" },
9438 [
9439 "div",
9440 {
9441 style: "color:#476582"
9442 },
9443 type
9444 ],
9445 [
9446 "div",
9447 {
9448 style: "padding-left:1.25em"
9449 },
9450 ...Object.keys(target).map((key) => {
9451 return [
9452 "div",
9453 {},
9454 ["span", keywordStyle, key + ": "],
9455 formatValue(target[key], false)
9456 ];
9457 })
9458 ]
9459 ];
9460 }
9461 function formatValue(v, asRaw = true) {
9462 if (typeof v === "number") {
9463 return ["span", numberStyle, v];
9464 } else if (typeof v === "string") {
9465 return ["span", stringStyle, JSON.stringify(v)];
9466 } else if (typeof v === "boolean") {
9467 return ["span", keywordStyle, v];
9468 } else if (isObject(v)) {
9469 return ["object", { object: asRaw ? toRaw(v) : v }];
9470 } else {
9471 return ["span", stringStyle, String(v)];
9472 }
9473 }
9474 function extractKeys(instance, type) {
9475 const Comp = instance.type;
9476 if (isFunction(Comp)) {
9477 return;
9478 }
9479 const extracted = {};
9480 for (const key in instance.ctx) {
9481 if (isKeyOfType(Comp, key, type)) {
9482 extracted[key] = instance.ctx[key];
9483 }
9484 }
9485 return extracted;
9486 }
9487 function isKeyOfType(Comp, key, type) {
9488 const opts = Comp[type];
9489 if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
9490 return true;
9491 }
9492 if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
9493 return true;
9494 }
9495 if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
9496 return true;
9497 }
9498 }
9499 function genRefFlag(v) {
9500 if (isShallow(v)) {
9501 return `ShallowRef`;
9502 }
9503 if (v.effect) {
9504 return `ComputedRef`;
9505 }
9506 return `Ref`;
9507 }
9508 if (window.devtoolsFormatters) {
9509 window.devtoolsFormatters.push(formatter);
9510 } else {
9511 window.devtoolsFormatters = [formatter];
9512 }
9513}
9514
9515function withMemo(memo, render, cache, index) {
9516 const cached = cache[index];
9517 if (cached && isMemoSame(cached, memo)) {
9518 return cached;
9519 }
9520 const ret = render();
9521 ret.memo = memo.slice();
9522 return cache[index] = ret;
9523}
9524function isMemoSame(cached, memo) {
9525 const prev = cached.memo;
9526 if (prev.length != memo.length) {
9527 return false;
9528 }
9529 for (let i = 0; i < prev.length; i++) {
9530 if (hasChanged(prev[i], memo[i])) {
9531 return false;
9532 }
9533 }
9534 if (isBlockTreeEnabled > 0 && currentBlock) {
9535 currentBlock.push(cached);
9536 }
9537 return true;
9538}
9539
9540const version = "3.4.21";
9541const warn = warn$1 ;
9542const ErrorTypeStrings = ErrorTypeStrings$1 ;
9543const devtools = devtools$1 ;
9544const setDevtoolsHook = setDevtoolsHook$1 ;
9545const ssrUtils = null;
9546const resolveFilter = null;
9547const compatUtils = null;
9548const DeprecationTypes = null;
9549
9550const svgNS = "http://www.w3.org/2000/svg";
9551const mathmlNS = "http://www.w3.org/1998/Math/MathML";
9552const doc = typeof document !== "undefined" ? document : null;
9553const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
9554const nodeOps = {
9555 insert: (child, parent, anchor) => {
9556 parent.insertBefore(child, anchor || null);
9557 },
9558 remove: (child) => {
9559 const parent = child.parentNode;
9560 if (parent) {
9561 parent.removeChild(child);
9562 }
9563 },
9564 createElement: (tag, namespace, is, props) => {
9565 const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
9566 if (tag === "select" && props && props.multiple != null) {
9567 el.setAttribute("multiple", props.multiple);
9568 }
9569 return el;
9570 },
9571 createText: (text) => doc.createTextNode(text),
9572 createComment: (text) => doc.createComment(text),
9573 setText: (node, text) => {
9574 node.nodeValue = text;
9575 },
9576 setElementText: (el, text) => {
9577 el.textContent = text;
9578 },
9579 parentNode: (node) => node.parentNode,
9580 nextSibling: (node) => node.nextSibling,
9581 querySelector: (selector) => doc.querySelector(selector),
9582 setScopeId(el, id) {
9583 el.setAttribute(id, "");
9584 },
9585 // __UNSAFE__
9586 // Reason: innerHTML.
9587 // Static content here can only come from compiled templates.
9588 // As long as the user only uses trusted templates, this is safe.
9589 insertStaticContent(content, parent, anchor, namespace, start, end) {
9590 const before = anchor ? anchor.previousSibling : parent.lastChild;
9591 if (start && (start === end || start.nextSibling)) {
9592 while (true) {
9593 parent.insertBefore(start.cloneNode(true), anchor);
9594 if (start === end || !(start = start.nextSibling))
9595 break;
9596 }
9597 } else {
9598 templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
9599 const template = templateContainer.content;
9600 if (namespace === "svg" || namespace === "mathml") {
9601 const wrapper = template.firstChild;
9602 while (wrapper.firstChild) {
9603 template.appendChild(wrapper.firstChild);
9604 }
9605 template.removeChild(wrapper);
9606 }
9607 parent.insertBefore(template, anchor);
9608 }
9609 return [
9610 // first
9611 before ? before.nextSibling : parent.firstChild,
9612 // last
9613 anchor ? anchor.previousSibling : parent.lastChild
9614 ];
9615 }
9616};
9617
9618const TRANSITION = "transition";
9619const ANIMATION = "animation";
9620const vtcKey = Symbol("_vtc");
9621const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
9622Transition.displayName = "Transition";
9623const DOMTransitionPropsValidators = {
9624 name: String,
9625 type: String,
9626 css: {
9627 type: Boolean,
9628 default: true
9629 },
9630 duration: [String, Number, Object],
9631 enterFromClass: String,
9632 enterActiveClass: String,
9633 enterToClass: String,
9634 appearFromClass: String,
9635 appearActiveClass: String,
9636 appearToClass: String,
9637 leaveFromClass: String,
9638 leaveActiveClass: String,
9639 leaveToClass: String
9640};
9641const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
9642 {},
9643 BaseTransitionPropsValidators,
9644 DOMTransitionPropsValidators
9645);
9646const callHook = (hook, args = []) => {
9647 if (isArray(hook)) {
9648 hook.forEach((h2) => h2(...args));
9649 } else if (hook) {
9650 hook(...args);
9651 }
9652};
9653const hasExplicitCallback = (hook) => {
9654 return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
9655};
9656function resolveTransitionProps(rawProps) {
9657 const baseProps = {};
9658 for (const key in rawProps) {
9659 if (!(key in DOMTransitionPropsValidators)) {
9660 baseProps[key] = rawProps[key];
9661 }
9662 }
9663 if (rawProps.css === false) {
9664 return baseProps;
9665 }
9666 const {
9667 name = "v",
9668 type,
9669 duration,
9670 enterFromClass = `${name}-enter-from`,
9671 enterActiveClass = `${name}-enter-active`,
9672 enterToClass = `${name}-enter-to`,
9673 appearFromClass = enterFromClass,
9674 appearActiveClass = enterActiveClass,
9675 appearToClass = enterToClass,
9676 leaveFromClass = `${name}-leave-from`,
9677 leaveActiveClass = `${name}-leave-active`,
9678 leaveToClass = `${name}-leave-to`
9679 } = rawProps;
9680 const durations = normalizeDuration(duration);
9681 const enterDuration = durations && durations[0];
9682 const leaveDuration = durations && durations[1];
9683 const {
9684 onBeforeEnter,
9685 onEnter,
9686 onEnterCancelled,
9687 onLeave,
9688 onLeaveCancelled,
9689 onBeforeAppear = onBeforeEnter,
9690 onAppear = onEnter,
9691 onAppearCancelled = onEnterCancelled
9692 } = baseProps;
9693 const finishEnter = (el, isAppear, done) => {
9694 removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
9695 removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
9696 done && done();
9697 };
9698 const finishLeave = (el, done) => {
9699 el._isLeaving = false;
9700 removeTransitionClass(el, leaveFromClass);
9701 removeTransitionClass(el, leaveToClass);
9702 removeTransitionClass(el, leaveActiveClass);
9703 done && done();
9704 };
9705 const makeEnterHook = (isAppear) => {
9706 return (el, done) => {
9707 const hook = isAppear ? onAppear : onEnter;
9708 const resolve = () => finishEnter(el, isAppear, done);
9709 callHook(hook, [el, resolve]);
9710 nextFrame(() => {
9711 removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
9712 addTransitionClass(el, isAppear ? appearToClass : enterToClass);
9713 if (!hasExplicitCallback(hook)) {
9714 whenTransitionEnds(el, type, enterDuration, resolve);
9715 }
9716 });
9717 };
9718 };
9719 return extend(baseProps, {
9720 onBeforeEnter(el) {
9721 callHook(onBeforeEnter, [el]);
9722 addTransitionClass(el, enterFromClass);
9723 addTransitionClass(el, enterActiveClass);
9724 },
9725 onBeforeAppear(el) {
9726 callHook(onBeforeAppear, [el]);
9727 addTransitionClass(el, appearFromClass);
9728 addTransitionClass(el, appearActiveClass);
9729 },
9730 onEnter: makeEnterHook(false),
9731 onAppear: makeEnterHook(true),
9732 onLeave(el, done) {
9733 el._isLeaving = true;
9734 const resolve = () => finishLeave(el, done);
9735 addTransitionClass(el, leaveFromClass);
9736 forceReflow();
9737 addTransitionClass(el, leaveActiveClass);
9738 nextFrame(() => {
9739 if (!el._isLeaving) {
9740 return;
9741 }
9742 removeTransitionClass(el, leaveFromClass);
9743 addTransitionClass(el, leaveToClass);
9744 if (!hasExplicitCallback(onLeave)) {
9745 whenTransitionEnds(el, type, leaveDuration, resolve);
9746 }
9747 });
9748 callHook(onLeave, [el, resolve]);
9749 },
9750 onEnterCancelled(el) {
9751 finishEnter(el, false);
9752 callHook(onEnterCancelled, [el]);
9753 },
9754 onAppearCancelled(el) {
9755 finishEnter(el, true);
9756 callHook(onAppearCancelled, [el]);
9757 },
9758 onLeaveCancelled(el) {
9759 finishLeave(el);
9760 callHook(onLeaveCancelled, [el]);
9761 }
9762 });
9763}
9764function normalizeDuration(duration) {
9765 if (duration == null) {
9766 return null;
9767 } else if (isObject(duration)) {
9768 return [NumberOf(duration.enter), NumberOf(duration.leave)];
9769 } else {
9770 const n = NumberOf(duration);
9771 return [n, n];
9772 }
9773}
9774function NumberOf(val) {
9775 const res = toNumber(val);
9776 {
9777 assertNumber(res, "<transition> explicit duration");
9778 }
9779 return res;
9780}
9781function addTransitionClass(el, cls) {
9782 cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
9783 (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
9784}
9785function removeTransitionClass(el, cls) {
9786 cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
9787 const _vtc = el[vtcKey];
9788 if (_vtc) {
9789 _vtc.delete(cls);
9790 if (!_vtc.size) {
9791 el[vtcKey] = void 0;
9792 }
9793 }
9794}
9795function nextFrame(cb) {
9796 requestAnimationFrame(() => {
9797 requestAnimationFrame(cb);
9798 });
9799}
9800let endId = 0;
9801function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
9802 const id = el._endId = ++endId;
9803 const resolveIfNotStale = () => {
9804 if (id === el._endId) {
9805 resolve();
9806 }
9807 };
9808 if (explicitTimeout) {
9809 return setTimeout(resolveIfNotStale, explicitTimeout);
9810 }
9811 const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
9812 if (!type) {
9813 return resolve();
9814 }
9815 const endEvent = type + "end";
9816 let ended = 0;
9817 const end = () => {
9818 el.removeEventListener(endEvent, onEnd);
9819 resolveIfNotStale();
9820 };
9821 const onEnd = (e) => {
9822 if (e.target === el && ++ended >= propCount) {
9823 end();
9824 }
9825 };
9826 setTimeout(() => {
9827 if (ended < propCount) {
9828 end();
9829 }
9830 }, timeout + 1);
9831 el.addEventListener(endEvent, onEnd);
9832}
9833function getTransitionInfo(el, expectedType) {
9834 const styles = window.getComputedStyle(el);
9835 const getStyleProperties = (key) => (styles[key] || "").split(", ");
9836 const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
9837 const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
9838 const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
9839 const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
9840 const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
9841 const animationTimeout = getTimeout(animationDelays, animationDurations);
9842 let type = null;
9843 let timeout = 0;
9844 let propCount = 0;
9845 if (expectedType === TRANSITION) {
9846 if (transitionTimeout > 0) {
9847 type = TRANSITION;
9848 timeout = transitionTimeout;
9849 propCount = transitionDurations.length;
9850 }
9851 } else if (expectedType === ANIMATION) {
9852 if (animationTimeout > 0) {
9853 type = ANIMATION;
9854 timeout = animationTimeout;
9855 propCount = animationDurations.length;
9856 }
9857 } else {
9858 timeout = Math.max(transitionTimeout, animationTimeout);
9859 type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
9860 propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
9861 }
9862 const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
9863 getStyleProperties(`${TRANSITION}Property`).toString()
9864 );
9865 return {
9866 type,
9867 timeout,
9868 propCount,
9869 hasTransform
9870 };
9871}
9872function getTimeout(delays, durations) {
9873 while (delays.length < durations.length) {
9874 delays = delays.concat(delays);
9875 }
9876 return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
9877}
9878function toMs(s) {
9879 if (s === "auto")
9880 return 0;
9881 return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
9882}
9883function forceReflow() {
9884 return document.body.offsetHeight;
9885}
9886
9887function patchClass(el, value, isSVG) {
9888 const transitionClasses = el[vtcKey];
9889 if (transitionClasses) {
9890 value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
9891 }
9892 if (value == null) {
9893 el.removeAttribute("class");
9894 } else if (isSVG) {
9895 el.setAttribute("class", value);
9896 } else {
9897 el.className = value;
9898 }
9899}
9900
9901const vShowOriginalDisplay = Symbol("_vod");
9902const vShowHidden = Symbol("_vsh");
9903const vShow = {
9904 beforeMount(el, { value }, { transition }) {
9905 el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
9906 if (transition && value) {
9907 transition.beforeEnter(el);
9908 } else {
9909 setDisplay(el, value);
9910 }
9911 },
9912 mounted(el, { value }, { transition }) {
9913 if (transition && value) {
9914 transition.enter(el);
9915 }
9916 },
9917 updated(el, { value, oldValue }, { transition }) {
9918 if (!value === !oldValue)
9919 return;
9920 if (transition) {
9921 if (value) {
9922 transition.beforeEnter(el);
9923 setDisplay(el, true);
9924 transition.enter(el);
9925 } else {
9926 transition.leave(el, () => {
9927 setDisplay(el, false);
9928 });
9929 }
9930 } else {
9931 setDisplay(el, value);
9932 }
9933 },
9934 beforeUnmount(el, { value }) {
9935 setDisplay(el, value);
9936 }
9937};
9938{
9939 vShow.name = "show";
9940}
9941function setDisplay(el, value) {
9942 el.style.display = value ? el[vShowOriginalDisplay] : "none";
9943 el[vShowHidden] = !value;
9944}
9945
9946const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
9947function useCssVars(getter) {
9948 const instance = getCurrentInstance();
9949 if (!instance) {
9950 warn(`useCssVars is called without current active component instance.`);
9951 return;
9952 }
9953 const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
9954 Array.from(
9955 document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
9956 ).forEach((node) => setVarsOnNode(node, vars));
9957 };
9958 {
9959 instance.getCssVars = () => getter(instance.proxy);
9960 }
9961 const setVars = () => {
9962 const vars = getter(instance.proxy);
9963 setVarsOnVNode(instance.subTree, vars);
9964 updateTeleports(vars);
9965 };
9966 watchPostEffect(setVars);
9967 onMounted(() => {
9968 const ob = new MutationObserver(setVars);
9969 ob.observe(instance.subTree.el.parentNode, { childList: true });
9970 onUnmounted(() => ob.disconnect());
9971 });
9972}
9973function setVarsOnVNode(vnode, vars) {
9974 if (vnode.shapeFlag & 128) {
9975 const suspense = vnode.suspense;
9976 vnode = suspense.activeBranch;
9977 if (suspense.pendingBranch && !suspense.isHydrating) {
9978 suspense.effects.push(() => {
9979 setVarsOnVNode(suspense.activeBranch, vars);
9980 });
9981 }
9982 }
9983 while (vnode.component) {
9984 vnode = vnode.component.subTree;
9985 }
9986 if (vnode.shapeFlag & 1 && vnode.el) {
9987 setVarsOnNode(vnode.el, vars);
9988 } else if (vnode.type === Fragment) {
9989 vnode.children.forEach((c) => setVarsOnVNode(c, vars));
9990 } else if (vnode.type === Static) {
9991 let { el, anchor } = vnode;
9992 while (el) {
9993 setVarsOnNode(el, vars);
9994 if (el === anchor)
9995 break;
9996 el = el.nextSibling;
9997 }
9998 }
9999}
10000function setVarsOnNode(el, vars) {
10001 if (el.nodeType === 1) {
10002 const style = el.style;
10003 let cssText = "";
10004 for (const key in vars) {
10005 style.setProperty(`--${key}`, vars[key]);
10006 cssText += `--${key}: ${vars[key]};`;
10007 }
10008 style[CSS_VAR_TEXT] = cssText;
10009 }
10010}
10011
10012const displayRE = /(^|;)\s*display\s*:/;
10013function patchStyle(el, prev, next) {
10014 const style = el.style;
10015 const isCssString = isString(next);
10016 let hasControlledDisplay = false;
10017 if (next && !isCssString) {
10018 if (prev) {
10019 if (!isString(prev)) {
10020 for (const key in prev) {
10021 if (next[key] == null) {
10022 setStyle(style, key, "");
10023 }
10024 }
10025 } else {
10026 for (const prevStyle of prev.split(";")) {
10027 const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
10028 if (next[key] == null) {
10029 setStyle(style, key, "");
10030 }
10031 }
10032 }
10033 }
10034 for (const key in next) {
10035 if (key === "display") {
10036 hasControlledDisplay = true;
10037 }
10038 setStyle(style, key, next[key]);
10039 }
10040 } else {
10041 if (isCssString) {
10042 if (prev !== next) {
10043 const cssVarText = style[CSS_VAR_TEXT];
10044 if (cssVarText) {
10045 next += ";" + cssVarText;
10046 }
10047 style.cssText = next;
10048 hasControlledDisplay = displayRE.test(next);
10049 }
10050 } else if (prev) {
10051 el.removeAttribute("style");
10052 }
10053 }
10054 if (vShowOriginalDisplay in el) {
10055 el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
10056 if (el[vShowHidden]) {
10057 style.display = "none";
10058 }
10059 }
10060}
10061const semicolonRE = /[^\\];\s*$/;
10062const importantRE = /\s*!important$/;
10063function setStyle(style, name, val) {
10064 if (isArray(val)) {
10065 val.forEach((v) => setStyle(style, name, v));
10066 } else {
10067 if (val == null)
10068 val = "";
10069 {
10070 if (semicolonRE.test(val)) {
10071 warn(
10072 `Unexpected semicolon at the end of '${name}' style value: '${val}'`
10073 );
10074 }
10075 }
10076 if (name.startsWith("--")) {
10077 style.setProperty(name, val);
10078 } else {
10079 const prefixed = autoPrefix(style, name);
10080 if (importantRE.test(val)) {
10081 style.setProperty(
10082 hyphenate(prefixed),
10083 val.replace(importantRE, ""),
10084 "important"
10085 );
10086 } else {
10087 style[prefixed] = val;
10088 }
10089 }
10090 }
10091}
10092const prefixes = ["Webkit", "Moz", "ms"];
10093const prefixCache = {};
10094function autoPrefix(style, rawName) {
10095 const cached = prefixCache[rawName];
10096 if (cached) {
10097 return cached;
10098 }
10099 let name = camelize(rawName);
10100 if (name !== "filter" && name in style) {
10101 return prefixCache[rawName] = name;
10102 }
10103 name = capitalize(name);
10104 for (let i = 0; i < prefixes.length; i++) {
10105 const prefixed = prefixes[i] + name;
10106 if (prefixed in style) {
10107 return prefixCache[rawName] = prefixed;
10108 }
10109 }
10110 return rawName;
10111}
10112
10113const xlinkNS = "http://www.w3.org/1999/xlink";
10114function patchAttr(el, key, value, isSVG, instance) {
10115 if (isSVG && key.startsWith("xlink:")) {
10116 if (value == null) {
10117 el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
10118 } else {
10119 el.setAttributeNS(xlinkNS, key, value);
10120 }
10121 } else {
10122 const isBoolean = isSpecialBooleanAttr(key);
10123 if (value == null || isBoolean && !includeBooleanAttr(value)) {
10124 el.removeAttribute(key);
10125 } else {
10126 el.setAttribute(key, isBoolean ? "" : value);
10127 }
10128 }
10129}
10130
10131function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
10132 if (key === "innerHTML" || key === "textContent") {
10133 if (prevChildren) {
10134 unmountChildren(prevChildren, parentComponent, parentSuspense);
10135 }
10136 el[key] = value == null ? "" : value;
10137 return;
10138 }
10139 const tag = el.tagName;
10140 if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
10141 !tag.includes("-")) {
10142 const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
10143 const newValue = value == null ? "" : value;
10144 if (oldValue !== newValue || !("_value" in el)) {
10145 el.value = newValue;
10146 }
10147 if (value == null) {
10148 el.removeAttribute(key);
10149 }
10150 el._value = value;
10151 return;
10152 }
10153 let needRemove = false;
10154 if (value === "" || value == null) {
10155 const type = typeof el[key];
10156 if (type === "boolean") {
10157 value = includeBooleanAttr(value);
10158 } else if (value == null && type === "string") {
10159 value = "";
10160 needRemove = true;
10161 } else if (type === "number") {
10162 value = 0;
10163 needRemove = true;
10164 }
10165 }
10166 try {
10167 el[key] = value;
10168 } catch (e) {
10169 if (!needRemove) {
10170 warn(
10171 `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
10172 e
10173 );
10174 }
10175 }
10176 needRemove && el.removeAttribute(key);
10177}
10178
10179function addEventListener(el, event, handler, options) {
10180 el.addEventListener(event, handler, options);
10181}
10182function removeEventListener(el, event, handler, options) {
10183 el.removeEventListener(event, handler, options);
10184}
10185const veiKey = Symbol("_vei");
10186function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
10187 const invokers = el[veiKey] || (el[veiKey] = {});
10188 const existingInvoker = invokers[rawName];
10189 if (nextValue && existingInvoker) {
10190 existingInvoker.value = nextValue;
10191 } else {
10192 const [name, options] = parseName(rawName);
10193 if (nextValue) {
10194 const invoker = invokers[rawName] = createInvoker(nextValue, instance);
10195 addEventListener(el, name, invoker, options);
10196 } else if (existingInvoker) {
10197 removeEventListener(el, name, existingInvoker, options);
10198 invokers[rawName] = void 0;
10199 }
10200 }
10201}
10202const optionsModifierRE = /(?:Once|Passive|Capture)$/;
10203function parseName(name) {
10204 let options;
10205 if (optionsModifierRE.test(name)) {
10206 options = {};
10207 let m;
10208 while (m = name.match(optionsModifierRE)) {
10209 name = name.slice(0, name.length - m[0].length);
10210 options[m[0].toLowerCase()] = true;
10211 }
10212 }
10213 const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
10214 return [event, options];
10215}
10216let cachedNow = 0;
10217const p = /* @__PURE__ */ Promise.resolve();
10218const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
10219function createInvoker(initialValue, instance) {
10220 const invoker = (e) => {
10221 if (!e._vts) {
10222 e._vts = Date.now();
10223 } else if (e._vts <= invoker.attached) {
10224 return;
10225 }
10226 callWithAsyncErrorHandling(
10227 patchStopImmediatePropagation(e, invoker.value),
10228 instance,
10229 5,
10230 [e]
10231 );
10232 };
10233 invoker.value = initialValue;
10234 invoker.attached = getNow();
10235 return invoker;
10236}
10237function patchStopImmediatePropagation(e, value) {
10238 if (isArray(value)) {
10239 const originalStop = e.stopImmediatePropagation;
10240 e.stopImmediatePropagation = () => {
10241 originalStop.call(e);
10242 e._stopped = true;
10243 };
10244 return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
10245 } else {
10246 return value;
10247 }
10248}
10249
10250const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
10251key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
10252const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
10253 const isSVG = namespace === "svg";
10254 if (key === "class") {
10255 patchClass(el, nextValue, isSVG);
10256 } else if (key === "style") {
10257 patchStyle(el, prevValue, nextValue);
10258 } else if (isOn(key)) {
10259 if (!isModelListener(key)) {
10260 patchEvent(el, key, prevValue, nextValue, parentComponent);
10261 }
10262 } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
10263 patchDOMProp(
10264 el,
10265 key,
10266 nextValue,
10267 prevChildren,
10268 parentComponent,
10269 parentSuspense,
10270 unmountChildren
10271 );
10272 } else {
10273 if (key === "true-value") {
10274 el._trueValue = nextValue;
10275 } else if (key === "false-value") {
10276 el._falseValue = nextValue;
10277 }
10278 patchAttr(el, key, nextValue, isSVG);
10279 }
10280};
10281function shouldSetAsProp(el, key, value, isSVG) {
10282 if (isSVG) {
10283 if (key === "innerHTML" || key === "textContent") {
10284 return true;
10285 }
10286 if (key in el && isNativeOn(key) && isFunction(value)) {
10287 return true;
10288 }
10289 return false;
10290 }
10291 if (key === "spellcheck" || key === "draggable" || key === "translate") {
10292 return false;
10293 }
10294 if (key === "form") {
10295 return false;
10296 }
10297 if (key === "list" && el.tagName === "INPUT") {
10298 return false;
10299 }
10300 if (key === "type" && el.tagName === "TEXTAREA") {
10301 return false;
10302 }
10303 if (key === "width" || key === "height") {
10304 const tag = el.tagName;
10305 if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
10306 return false;
10307 }
10308 }
10309 if (isNativeOn(key) && isString(value)) {
10310 return false;
10311 }
10312 return key in el;
10313}
10314
10315/*! #__NO_SIDE_EFFECTS__ */
10316// @__NO_SIDE_EFFECTS__
10317function defineCustomElement(options, hydrate2) {
10318 const Comp = defineComponent(options);
10319 class VueCustomElement extends VueElement {
10320 constructor(initialProps) {
10321 super(Comp, initialProps, hydrate2);
10322 }
10323 }
10324 VueCustomElement.def = Comp;
10325 return VueCustomElement;
10326}
10327/*! #__NO_SIDE_EFFECTS__ */
10328const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => {
10329 return /* @__PURE__ */ defineCustomElement(options, hydrate);
10330};
10331const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
10332};
10333class VueElement extends BaseClass {
10334 constructor(_def, _props = {}, hydrate2) {
10335 super();
10336 this._def = _def;
10337 this._props = _props;
10338 /**
10339 * @internal
10340 */
10341 this._instance = null;
10342 this._connected = false;
10343 this._resolved = false;
10344 this._numberProps = null;
10345 this._ob = null;
10346 if (this.shadowRoot && hydrate2) {
10347 hydrate2(this._createVNode(), this.shadowRoot);
10348 } else {
10349 if (this.shadowRoot) {
10350 warn(
10351 `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
10352 );
10353 }
10354 this.attachShadow({ mode: "open" });
10355 if (!this._def.__asyncLoader) {
10356 this._resolveProps(this._def);
10357 }
10358 }
10359 }
10360 connectedCallback() {
10361 this._connected = true;
10362 if (!this._instance) {
10363 if (this._resolved) {
10364 this._update();
10365 } else {
10366 this._resolveDef();
10367 }
10368 }
10369 }
10370 disconnectedCallback() {
10371 this._connected = false;
10372 if (this._ob) {
10373 this._ob.disconnect();
10374 this._ob = null;
10375 }
10376 nextTick(() => {
10377 if (!this._connected) {
10378 render(null, this.shadowRoot);
10379 this._instance = null;
10380 }
10381 });
10382 }
10383 /**
10384 * resolve inner component definition (handle possible async component)
10385 */
10386 _resolveDef() {
10387 this._resolved = true;
10388 for (let i = 0; i < this.attributes.length; i++) {
10389 this._setAttr(this.attributes[i].name);
10390 }
10391 this._ob = new MutationObserver((mutations) => {
10392 for (const m of mutations) {
10393 this._setAttr(m.attributeName);
10394 }
10395 });
10396 this._ob.observe(this, { attributes: true });
10397 const resolve = (def, isAsync = false) => {
10398 const { props, styles } = def;
10399 let numberProps;
10400 if (props && !isArray(props)) {
10401 for (const key in props) {
10402 const opt = props[key];
10403 if (opt === Number || opt && opt.type === Number) {
10404 if (key in this._props) {
10405 this._props[key] = toNumber(this._props[key]);
10406 }
10407 (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
10408 }
10409 }
10410 }
10411 this._numberProps = numberProps;
10412 if (isAsync) {
10413 this._resolveProps(def);
10414 }
10415 this._applyStyles(styles);
10416 this._update();
10417 };
10418 const asyncDef = this._def.__asyncLoader;
10419 if (asyncDef) {
10420 asyncDef().then((def) => resolve(def, true));
10421 } else {
10422 resolve(this._def);
10423 }
10424 }
10425 _resolveProps(def) {
10426 const { props } = def;
10427 const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
10428 for (const key of Object.keys(this)) {
10429 if (key[0] !== "_" && declaredPropKeys.includes(key)) {
10430 this._setProp(key, this[key], true, false);
10431 }
10432 }
10433 for (const key of declaredPropKeys.map(camelize)) {
10434 Object.defineProperty(this, key, {
10435 get() {
10436 return this._getProp(key);
10437 },
10438 set(val) {
10439 this._setProp(key, val);
10440 }
10441 });
10442 }
10443 }
10444 _setAttr(key) {
10445 let value = this.getAttribute(key);
10446 const camelKey = camelize(key);
10447 if (this._numberProps && this._numberProps[camelKey]) {
10448 value = toNumber(value);
10449 }
10450 this._setProp(camelKey, value, false);
10451 }
10452 /**
10453 * @internal
10454 */
10455 _getProp(key) {
10456 return this._props[key];
10457 }
10458 /**
10459 * @internal
10460 */
10461 _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
10462 if (val !== this._props[key]) {
10463 this._props[key] = val;
10464 if (shouldUpdate && this._instance) {
10465 this._update();
10466 }
10467 if (shouldReflect) {
10468 if (val === true) {
10469 this.setAttribute(hyphenate(key), "");
10470 } else if (typeof val === "string" || typeof val === "number") {
10471 this.setAttribute(hyphenate(key), val + "");
10472 } else if (!val) {
10473 this.removeAttribute(hyphenate(key));
10474 }
10475 }
10476 }
10477 }
10478 _update() {
10479 render(this._createVNode(), this.shadowRoot);
10480 }
10481 _createVNode() {
10482 const vnode = createVNode(this._def, extend({}, this._props));
10483 if (!this._instance) {
10484 vnode.ce = (instance) => {
10485 this._instance = instance;
10486 instance.isCE = true;
10487 {
10488 instance.ceReload = (newStyles) => {
10489 if (this._styles) {
10490 this._styles.forEach((s) => this.shadowRoot.removeChild(s));
10491 this._styles.length = 0;
10492 }
10493 this._applyStyles(newStyles);
10494 this._instance = null;
10495 this._update();
10496 };
10497 }
10498 const dispatch = (event, args) => {
10499 this.dispatchEvent(
10500 new CustomEvent(event, {
10501 detail: args
10502 })
10503 );
10504 };
10505 instance.emit = (event, ...args) => {
10506 dispatch(event, args);
10507 if (hyphenate(event) !== event) {
10508 dispatch(hyphenate(event), args);
10509 }
10510 };
10511 let parent = this;
10512 while (parent = parent && (parent.parentNode || parent.host)) {
10513 if (parent instanceof VueElement) {
10514 instance.parent = parent._instance;
10515 instance.provides = parent._instance.provides;
10516 break;
10517 }
10518 }
10519 };
10520 }
10521 return vnode;
10522 }
10523 _applyStyles(styles) {
10524 if (styles) {
10525 styles.forEach((css) => {
10526 const s = document.createElement("style");
10527 s.textContent = css;
10528 this.shadowRoot.appendChild(s);
10529 {
10530 (this._styles || (this._styles = [])).push(s);
10531 }
10532 });
10533 }
10534 }
10535}
10536
10537function useCssModule(name = "$style") {
10538 {
10539 const instance = getCurrentInstance();
10540 if (!instance) {
10541 warn(`useCssModule must be called inside setup()`);
10542 return EMPTY_OBJ;
10543 }
10544 const modules = instance.type.__cssModules;
10545 if (!modules) {
10546 warn(`Current instance does not have CSS modules injected.`);
10547 return EMPTY_OBJ;
10548 }
10549 const mod = modules[name];
10550 if (!mod) {
10551 warn(`Current instance does not have CSS module named "${name}".`);
10552 return EMPTY_OBJ;
10553 }
10554 return mod;
10555 }
10556}
10557
10558const positionMap = /* @__PURE__ */ new WeakMap();
10559const newPositionMap = /* @__PURE__ */ new WeakMap();
10560const moveCbKey = Symbol("_moveCb");
10561const enterCbKey = Symbol("_enterCb");
10562const TransitionGroupImpl = {
10563 name: "TransitionGroup",
10564 props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
10565 tag: String,
10566 moveClass: String
10567 }),
10568 setup(props, { slots }) {
10569 const instance = getCurrentInstance();
10570 const state = useTransitionState();
10571 let prevChildren;
10572 let children;
10573 onUpdated(() => {
10574 if (!prevChildren.length) {
10575 return;
10576 }
10577 const moveClass = props.moveClass || `${props.name || "v"}-move`;
10578 if (!hasCSSTransform(
10579 prevChildren[0].el,
10580 instance.vnode.el,
10581 moveClass
10582 )) {
10583 return;
10584 }
10585 prevChildren.forEach(callPendingCbs);
10586 prevChildren.forEach(recordPosition);
10587 const movedChildren = prevChildren.filter(applyTranslation);
10588 forceReflow();
10589 movedChildren.forEach((c) => {
10590 const el = c.el;
10591 const style = el.style;
10592 addTransitionClass(el, moveClass);
10593 style.transform = style.webkitTransform = style.transitionDuration = "";
10594 const cb = el[moveCbKey] = (e) => {
10595 if (e && e.target !== el) {
10596 return;
10597 }
10598 if (!e || /transform$/.test(e.propertyName)) {
10599 el.removeEventListener("transitionend", cb);
10600 el[moveCbKey] = null;
10601 removeTransitionClass(el, moveClass);
10602 }
10603 };
10604 el.addEventListener("transitionend", cb);
10605 });
10606 });
10607 return () => {
10608 const rawProps = toRaw(props);
10609 const cssTransitionProps = resolveTransitionProps(rawProps);
10610 let tag = rawProps.tag || Fragment;
10611 prevChildren = children;
10612 children = slots.default ? getTransitionRawChildren(slots.default()) : [];
10613 for (let i = 0; i < children.length; i++) {
10614 const child = children[i];
10615 if (child.key != null) {
10616 setTransitionHooks(
10617 child,
10618 resolveTransitionHooks(child, cssTransitionProps, state, instance)
10619 );
10620 } else {
10621 warn(`<TransitionGroup> children must be keyed.`);
10622 }
10623 }
10624 if (prevChildren) {
10625 for (let i = 0; i < prevChildren.length; i++) {
10626 const child = prevChildren[i];
10627 setTransitionHooks(
10628 child,
10629 resolveTransitionHooks(child, cssTransitionProps, state, instance)
10630 );
10631 positionMap.set(child, child.el.getBoundingClientRect());
10632 }
10633 }
10634 return createVNode(tag, null, children);
10635 };
10636 }
10637};
10638const removeMode = (props) => delete props.mode;
10639/* @__PURE__ */ removeMode(TransitionGroupImpl.props);
10640const TransitionGroup = TransitionGroupImpl;
10641function callPendingCbs(c) {
10642 const el = c.el;
10643 if (el[moveCbKey]) {
10644 el[moveCbKey]();
10645 }
10646 if (el[enterCbKey]) {
10647 el[enterCbKey]();
10648 }
10649}
10650function recordPosition(c) {
10651 newPositionMap.set(c, c.el.getBoundingClientRect());
10652}
10653function applyTranslation(c) {
10654 const oldPos = positionMap.get(c);
10655 const newPos = newPositionMap.get(c);
10656 const dx = oldPos.left - newPos.left;
10657 const dy = oldPos.top - newPos.top;
10658 if (dx || dy) {
10659 const s = c.el.style;
10660 s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
10661 s.transitionDuration = "0s";
10662 return c;
10663 }
10664}
10665function hasCSSTransform(el, root, moveClass) {
10666 const clone = el.cloneNode();
10667 const _vtc = el[vtcKey];
10668 if (_vtc) {
10669 _vtc.forEach((cls) => {
10670 cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
10671 });
10672 }
10673 moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
10674 clone.style.display = "none";
10675 const container = root.nodeType === 1 ? root : root.parentNode;
10676 container.appendChild(clone);
10677 const { hasTransform } = getTransitionInfo(clone);
10678 container.removeChild(clone);
10679 return hasTransform;
10680}
10681
10682const getModelAssigner = (vnode) => {
10683 const fn = vnode.props["onUpdate:modelValue"] || false;
10684 return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
10685};
10686function onCompositionStart(e) {
10687 e.target.composing = true;
10688}
10689function onCompositionEnd(e) {
10690 const target = e.target;
10691 if (target.composing) {
10692 target.composing = false;
10693 target.dispatchEvent(new Event("input"));
10694 }
10695}
10696const assignKey = Symbol("_assign");
10697const vModelText = {
10698 created(el, { modifiers: { lazy, trim, number } }, vnode) {
10699 el[assignKey] = getModelAssigner(vnode);
10700 const castToNumber = number || vnode.props && vnode.props.type === "number";
10701 addEventListener(el, lazy ? "change" : "input", (e) => {
10702 if (e.target.composing)
10703 return;
10704 let domValue = el.value;
10705 if (trim) {
10706 domValue = domValue.trim();
10707 }
10708 if (castToNumber) {
10709 domValue = looseToNumber(domValue);
10710 }
10711 el[assignKey](domValue);
10712 });
10713 if (trim) {
10714 addEventListener(el, "change", () => {
10715 el.value = el.value.trim();
10716 });
10717 }
10718 if (!lazy) {
10719 addEventListener(el, "compositionstart", onCompositionStart);
10720 addEventListener(el, "compositionend", onCompositionEnd);
10721 addEventListener(el, "change", onCompositionEnd);
10722 }
10723 },
10724 // set value on mounted so it's after min/max for type="range"
10725 mounted(el, { value }) {
10726 el.value = value == null ? "" : value;
10727 },
10728 beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
10729 el[assignKey] = getModelAssigner(vnode);
10730 if (el.composing)
10731 return;
10732 const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
10733 const newValue = value == null ? "" : value;
10734 if (elValue === newValue) {
10735 return;
10736 }
10737 if (document.activeElement === el && el.type !== "range") {
10738 if (lazy) {
10739 return;
10740 }
10741 if (trim && el.value.trim() === newValue) {
10742 return;
10743 }
10744 }
10745 el.value = newValue;
10746 }
10747};
10748const vModelCheckbox = {
10749 // #4096 array checkboxes need to be deep traversed
10750 deep: true,
10751 created(el, _, vnode) {
10752 el[assignKey] = getModelAssigner(vnode);
10753 addEventListener(el, "change", () => {
10754 const modelValue = el._modelValue;
10755 const elementValue = getValue(el);
10756 const checked = el.checked;
10757 const assign = el[assignKey];
10758 if (isArray(modelValue)) {
10759 const index = looseIndexOf(modelValue, elementValue);
10760 const found = index !== -1;
10761 if (checked && !found) {
10762 assign(modelValue.concat(elementValue));
10763 } else if (!checked && found) {
10764 const filtered = [...modelValue];
10765 filtered.splice(index, 1);
10766 assign(filtered);
10767 }
10768 } else if (isSet(modelValue)) {
10769 const cloned = new Set(modelValue);
10770 if (checked) {
10771 cloned.add(elementValue);
10772 } else {
10773 cloned.delete(elementValue);
10774 }
10775 assign(cloned);
10776 } else {
10777 assign(getCheckboxValue(el, checked));
10778 }
10779 });
10780 },
10781 // set initial checked on mount to wait for true-value/false-value
10782 mounted: setChecked,
10783 beforeUpdate(el, binding, vnode) {
10784 el[assignKey] = getModelAssigner(vnode);
10785 setChecked(el, binding, vnode);
10786 }
10787};
10788function setChecked(el, { value, oldValue }, vnode) {
10789 el._modelValue = value;
10790 if (isArray(value)) {
10791 el.checked = looseIndexOf(value, vnode.props.value) > -1;
10792 } else if (isSet(value)) {
10793 el.checked = value.has(vnode.props.value);
10794 } else if (value !== oldValue) {
10795 el.checked = looseEqual(value, getCheckboxValue(el, true));
10796 }
10797}
10798const vModelRadio = {
10799 created(el, { value }, vnode) {
10800 el.checked = looseEqual(value, vnode.props.value);
10801 el[assignKey] = getModelAssigner(vnode);
10802 addEventListener(el, "change", () => {
10803 el[assignKey](getValue(el));
10804 });
10805 },
10806 beforeUpdate(el, { value, oldValue }, vnode) {
10807 el[assignKey] = getModelAssigner(vnode);
10808 if (value !== oldValue) {
10809 el.checked = looseEqual(value, vnode.props.value);
10810 }
10811 }
10812};
10813const vModelSelect = {
10814 // <select multiple> value need to be deep traversed
10815 deep: true,
10816 created(el, { value, modifiers: { number } }, vnode) {
10817 const isSetModel = isSet(value);
10818 addEventListener(el, "change", () => {
10819 const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
10820 (o) => number ? looseToNumber(getValue(o)) : getValue(o)
10821 );
10822 el[assignKey](
10823 el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
10824 );
10825 el._assigning = true;
10826 nextTick(() => {
10827 el._assigning = false;
10828 });
10829 });
10830 el[assignKey] = getModelAssigner(vnode);
10831 },
10832 // set value in mounted & updated because <select> relies on its children
10833 // <option>s.
10834 mounted(el, { value, modifiers: { number } }) {
10835 setSelected(el, value, number);
10836 },
10837 beforeUpdate(el, _binding, vnode) {
10838 el[assignKey] = getModelAssigner(vnode);
10839 },
10840 updated(el, { value, modifiers: { number } }) {
10841 if (!el._assigning) {
10842 setSelected(el, value, number);
10843 }
10844 }
10845};
10846function setSelected(el, value, number) {
10847 const isMultiple = el.multiple;
10848 const isArrayValue = isArray(value);
10849 if (isMultiple && !isArrayValue && !isSet(value)) {
10850 warn(
10851 `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
10852 );
10853 return;
10854 }
10855 for (let i = 0, l = el.options.length; i < l; i++) {
10856 const option = el.options[i];
10857 const optionValue = getValue(option);
10858 if (isMultiple) {
10859 if (isArrayValue) {
10860 const optionType = typeof optionValue;
10861 if (optionType === "string" || optionType === "number") {
10862 option.selected = value.includes(
10863 number ? looseToNumber(optionValue) : optionValue
10864 );
10865 } else {
10866 option.selected = looseIndexOf(value, optionValue) > -1;
10867 }
10868 } else {
10869 option.selected = value.has(optionValue);
10870 }
10871 } else if (looseEqual(getValue(option), value)) {
10872 if (el.selectedIndex !== i)
10873 el.selectedIndex = i;
10874 return;
10875 }
10876 }
10877 if (!isMultiple && el.selectedIndex !== -1) {
10878 el.selectedIndex = -1;
10879 }
10880}
10881function getValue(el) {
10882 return "_value" in el ? el._value : el.value;
10883}
10884function getCheckboxValue(el, checked) {
10885 const key = checked ? "_trueValue" : "_falseValue";
10886 return key in el ? el[key] : checked;
10887}
10888const vModelDynamic = {
10889 created(el, binding, vnode) {
10890 callModelHook(el, binding, vnode, null, "created");
10891 },
10892 mounted(el, binding, vnode) {
10893 callModelHook(el, binding, vnode, null, "mounted");
10894 },
10895 beforeUpdate(el, binding, vnode, prevVNode) {
10896 callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
10897 },
10898 updated(el, binding, vnode, prevVNode) {
10899 callModelHook(el, binding, vnode, prevVNode, "updated");
10900 }
10901};
10902function resolveDynamicModel(tagName, type) {
10903 switch (tagName) {
10904 case "SELECT":
10905 return vModelSelect;
10906 case "TEXTAREA":
10907 return vModelText;
10908 default:
10909 switch (type) {
10910 case "checkbox":
10911 return vModelCheckbox;
10912 case "radio":
10913 return vModelRadio;
10914 default:
10915 return vModelText;
10916 }
10917 }
10918}
10919function callModelHook(el, binding, vnode, prevVNode, hook) {
10920 const modelToUse = resolveDynamicModel(
10921 el.tagName,
10922 vnode.props && vnode.props.type
10923 );
10924 const fn = modelToUse[hook];
10925 fn && fn(el, binding, vnode, prevVNode);
10926}
10927
10928const systemModifiers = ["ctrl", "shift", "alt", "meta"];
10929const modifierGuards = {
10930 stop: (e) => e.stopPropagation(),
10931 prevent: (e) => e.preventDefault(),
10932 self: (e) => e.target !== e.currentTarget,
10933 ctrl: (e) => !e.ctrlKey,
10934 shift: (e) => !e.shiftKey,
10935 alt: (e) => !e.altKey,
10936 meta: (e) => !e.metaKey,
10937 left: (e) => "button" in e && e.button !== 0,
10938 middle: (e) => "button" in e && e.button !== 1,
10939 right: (e) => "button" in e && e.button !== 2,
10940 exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
10941};
10942const withModifiers = (fn, modifiers) => {
10943 const cache = fn._withMods || (fn._withMods = {});
10944 const cacheKey = modifiers.join(".");
10945 return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
10946 for (let i = 0; i < modifiers.length; i++) {
10947 const guard = modifierGuards[modifiers[i]];
10948 if (guard && guard(event, modifiers))
10949 return;
10950 }
10951 return fn(event, ...args);
10952 });
10953};
10954const keyNames = {
10955 esc: "escape",
10956 space: " ",
10957 up: "arrow-up",
10958 left: "arrow-left",
10959 right: "arrow-right",
10960 down: "arrow-down",
10961 delete: "backspace"
10962};
10963const withKeys = (fn, modifiers) => {
10964 const cache = fn._withKeys || (fn._withKeys = {});
10965 const cacheKey = modifiers.join(".");
10966 return cache[cacheKey] || (cache[cacheKey] = (event) => {
10967 if (!("key" in event)) {
10968 return;
10969 }
10970 const eventKey = hyphenate(event.key);
10971 if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
10972 return fn(event);
10973 }
10974 });
10975};
10976
10977const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
10978let renderer;
10979let enabledHydration = false;
10980function ensureRenderer() {
10981 return renderer || (renderer = createRenderer(rendererOptions));
10982}
10983function ensureHydrationRenderer() {
10984 renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
10985 enabledHydration = true;
10986 return renderer;
10987}
10988const render = (...args) => {
10989 ensureRenderer().render(...args);
10990};
10991const hydrate = (...args) => {
10992 ensureHydrationRenderer().hydrate(...args);
10993};
10994const createApp = (...args) => {
10995 const app = ensureRenderer().createApp(...args);
10996 {
10997 injectNativeTagCheck(app);
10998 injectCompilerOptionsCheck(app);
10999 }
11000 const { mount } = app;
11001 app.mount = (containerOrSelector) => {
11002 const container = normalizeContainer(containerOrSelector);
11003 if (!container)
11004 return;
11005 const component = app._component;
11006 if (!isFunction(component) && !component.render && !component.template) {
11007 component.template = container.innerHTML;
11008 }
11009 container.innerHTML = "";
11010 const proxy = mount(container, false, resolveRootNamespace(container));
11011 if (container instanceof Element) {
11012 container.removeAttribute("v-cloak");
11013 container.setAttribute("data-v-app", "");
11014 }
11015 return proxy;
11016 };
11017 return app;
11018};
11019const createSSRApp = (...args) => {
11020 const app = ensureHydrationRenderer().createApp(...args);
11021 {
11022 injectNativeTagCheck(app);
11023 injectCompilerOptionsCheck(app);
11024 }
11025 const { mount } = app;
11026 app.mount = (containerOrSelector) => {
11027 const container = normalizeContainer(containerOrSelector);
11028 if (container) {
11029 return mount(container, true, resolveRootNamespace(container));
11030 }
11031 };
11032 return app;
11033};
11034function resolveRootNamespace(container) {
11035 if (container instanceof SVGElement) {
11036 return "svg";
11037 }
11038 if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
11039 return "mathml";
11040 }
11041}
11042function injectNativeTagCheck(app) {
11043 Object.defineProperty(app.config, "isNativeTag", {
11044 value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
11045 writable: false
11046 });
11047}
11048function injectCompilerOptionsCheck(app) {
11049 if (isRuntimeOnly()) {
11050 const isCustomElement = app.config.isCustomElement;
11051 Object.defineProperty(app.config, "isCustomElement", {
11052 get() {
11053 return isCustomElement;
11054 },
11055 set() {
11056 warn(
11057 `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
11058 );
11059 }
11060 });
11061 const compilerOptions = app.config.compilerOptions;
11062 const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
11063- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
11064- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
11065- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
11066 Object.defineProperty(app.config, "compilerOptions", {
11067 get() {
11068 warn(msg);
11069 return compilerOptions;
11070 },
11071 set() {
11072 warn(msg);
11073 }
11074 });
11075 }
11076}
11077function normalizeContainer(container) {
11078 if (isString(container)) {
11079 const res = document.querySelector(container);
11080 if (!res) {
11081 warn(
11082 `Failed to mount app: mount target selector "${container}" returned null.`
11083 );
11084 }
11085 return res;
11086 }
11087 if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
11088 warn(
11089 `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
11090 );
11091 }
11092 return container;
11093}
11094const initDirectivesForSSR = NOOP;
11095
11096function initDev() {
11097 {
11098 {
11099 console.info(
11100 `You are running a development build of Vue.
11101Make sure to use the production build (*.prod.js) when deploying for production.`
11102 );
11103 }
11104 initCustomFormatter();
11105 }
11106}
11107
11108{
11109 initDev();
11110}
11111const compile = () => {
11112 {
11113 warn(
11114 `Runtime compilation is not supported in this build of Vue.` + (` Use "vue.esm-browser.js" instead.` )
11115 );
11116 }
11117};
11118
11119export { 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, compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };