UNPKG

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