(function polyfill() { const relList = document.createElement("link").relList; if (relList && relList.supports && relList.supports("modulepreload")) { return; } for (const link4 of document.querySelectorAll('link[rel="modulepreload"]')) { processPreload(link4); } new MutationObserver((mutations) => { for (const mutation of mutations) { if (mutation.type !== "childList") { continue; } for (const node of mutation.addedNodes) { if (node.tagName === "LINK" && node.rel === "modulepreload") processPreload(node); } } }).observe(document, { childList: true, subtree: true }); function getFetchOpts(link4) { const fetchOpts = {}; if (link4.integrity) fetchOpts.integrity = link4.integrity; if (link4.referrerPolicy) fetchOpts.referrerPolicy = link4.referrerPolicy; if (link4.crossOrigin === "use-credentials") fetchOpts.credentials = "include"; else if (link4.crossOrigin === "anonymous") fetchOpts.credentials = "omit"; else fetchOpts.credentials = "same-origin"; return fetchOpts; } function processPreload(link4) { if (link4.ep) return; link4.ep = true; const fetchOpts = getFetchOpts(link4); fetch(link4.href, fetchOpts); } })(); function makeMap(str, expectsLowerCase) { const map2 = /* @__PURE__ */ Object.create(null); const list3 = str.split(","); for (let i2 = 0; i2 < list3.length; i2++) { map2[list3[i2]] = true; } return expectsLowerCase ? (val) => !!map2[val.toLowerCase()] : (val) => !!map2[val]; } const GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt"; const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED); function normalizeStyle(value) { if (isArray$1(value)) { const res = {}; for (let i2 = 0; i2 < value.length; i2++) { const item = value[i2]; const normalized = isString$4(item) ? parseStringStyle(item) : normalizeStyle(item); if (normalized) { for (const key in normalized) { res[key] = normalized[key]; } } } return res; } else if (isString$4(value)) { return value; } else if (isObject$4(value)) { return value; } } const listDelimiterRE = /;(?![^(]*\))/g; const propertyDelimiterRE = /:([^]+)/; const styleCommentRE = /\/\*.*?\*\//gs; function parseStringStyle(cssText) { const ret = {}; cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { if (item) { const tmp = item.split(propertyDelimiterRE); tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); } }); return ret; } function normalizeClass(value) { let res = ""; if (isString$4(value)) { res = value; } else if (isArray$1(value)) { for (let i2 = 0; i2 < value.length; i2++) { const normalized = normalizeClass(value[i2]); if (normalized) { res += normalized + " "; } } } else if (isObject$4(value)) { for (const name2 in value) { if (value[name2]) { res += name2 + " "; } } } return res.trim(); } function normalizeProps(props) { if (!props) return null; let { class: klass, style } = props; if (klass && !isString$4(klass)) { props.class = normalizeClass(klass); } if (style) { props.style = normalizeStyle(style); } return props; } const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); function includeBooleanAttr(value) { return !!value || value === ""; } function looseCompareArrays(a2, b2) { if (a2.length !== b2.length) return false; let equal = true; for (let i2 = 0; equal && i2 < a2.length; i2++) { equal = looseEqual(a2[i2], b2[i2]); } return equal; } function looseEqual(a2, b2) { if (a2 === b2) return true; let aValidType = isDate$1(a2); let bValidType = isDate$1(b2); if (aValidType || bValidType) { return aValidType && bValidType ? a2.getTime() === b2.getTime() : false; } aValidType = isSymbol$1(a2); bValidType = isSymbol$1(b2); if (aValidType || bValidType) { return a2 === b2; } aValidType = isArray$1(a2); bValidType = isArray$1(b2); if (aValidType || bValidType) { return aValidType && bValidType ? looseCompareArrays(a2, b2) : false; } aValidType = isObject$4(a2); bValidType = isObject$4(b2); if (aValidType || bValidType) { if (!aValidType || !bValidType) { return false; } const aKeysCount = Object.keys(a2).length; const bKeysCount = Object.keys(b2).length; if (aKeysCount !== bKeysCount) { return false; } for (const key in a2) { const aHasKey = a2.hasOwnProperty(key); const bHasKey = b2.hasOwnProperty(key); if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a2[key], b2[key])) { return false; } } } return String(a2) === String(b2); } function looseIndexOf(arr, val) { return arr.findIndex((item) => looseEqual(item, val)); } const toDisplayString$1 = (val) => { return isString$4(val) ? val : val == null ? "" : isArray$1(val) || isObject$4(val) && (val.toString === objectToString$2 || !isFunction$3(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val); }; const replacer = (_key, val) => { if (val && val.__v_isRef) { return replacer(_key, val.value); } else if (isMap(val)) { return { [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => { entries[`${key} =>`] = val2; return entries; }, {}) }; } else if (isSet(val)) { return { [`Set(${val.size})`]: [...val.values()] }; } else if (isObject$4(val) && !isArray$1(val) && !isPlainObject$2(val)) { return String(val); } return val; }; const EMPTY_OBJ = {}; const EMPTY_ARR = []; const NOOP = () => { }; const NO = () => false; const onRE = /^on[^a-z]/; const isOn = (key) => onRE.test(key); const isModelListener = (key) => key.startsWith("onUpdate:"); const extend = Object.assign; const remove = (arr, el2) => { const i2 = arr.indexOf(el2); if (i2 > -1) { arr.splice(i2, 1); } }; const hasOwnProperty$4 = Object.prototype.hasOwnProperty; const hasOwn$1 = (val, key) => hasOwnProperty$4.call(val, key); const isArray$1 = Array.isArray; const isMap = (val) => toTypeString$1(val) === "[object Map]"; const isSet = (val) => toTypeString$1(val) === "[object Set]"; const isDate$1 = (val) => toTypeString$1(val) === "[object Date]"; const isRegExp$2 = (val) => toTypeString$1(val) === "[object RegExp]"; const isFunction$3 = (val) => typeof val === "function"; const isString$4 = (val) => typeof val === "string"; const isSymbol$1 = (val) => typeof val === "symbol"; const isObject$4 = (val) => val !== null && typeof val === "object"; const isPromise = (val) => { return isObject$4(val) && isFunction$3(val.then) && isFunction$3(val.catch); }; const objectToString$2 = Object.prototype.toString; const toTypeString$1 = (value) => objectToString$2.call(value); const toRawType = (value) => { return toTypeString$1(value).slice(8, -1); }; const isPlainObject$2 = (val) => toTypeString$1(val) === "[object Object]"; const isIntegerKey = (key) => isString$4(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; const isReservedProp = /* @__PURE__ */ makeMap( // the leading comma is intentional so empty string "" is also included ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" ); const cacheStringFunction = (fn) => { const cache2 = /* @__PURE__ */ Object.create(null); return (str) => { const hit = cache2[str]; return hit || (cache2[str] = fn(str)); }; }; const camelizeRE = /-(\w)/g; const camelize = cacheStringFunction((str) => { return str.replace(camelizeRE, (_2, c2) => c2 ? c2.toUpperCase() : ""); }); const hyphenateRE = /\B([A-Z])/g; const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase()); const capitalize$1 = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1)); const toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize$1(str)}` : ``); const hasChanged = (value, oldValue) => !Object.is(value, oldValue); const invokeArrayFns = (fns, arg) => { for (let i2 = 0; i2 < fns.length; i2++) { fns[i2](arg); } }; const def = (obj, key, value) => { Object.defineProperty(obj, key, { configurable: true, enumerable: false, value }); }; const looseToNumber = (val) => { const n = parseFloat(val); return isNaN(n) ? val : n; }; const toNumber = (val) => { const n = isString$4(val) ? Number(val) : NaN; return isNaN(n) ? val : n; }; let _globalThis$1; const getGlobalThis$1 = () => { return _globalThis$1 || (_globalThis$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); }; let activeEffectScope; class EffectScope { constructor(detached = false) { this.detached = detached; this._active = true; this.effects = []; this.cleanups = []; this.parent = activeEffectScope; if (!detached && activeEffectScope) { this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1; } } get active() { return this._active; } run(fn) { if (this._active) { const currentEffectScope = activeEffectScope; try { activeEffectScope = this; return fn(); } finally { activeEffectScope = currentEffectScope; } } } /** * This should only be called on non-detached scopes * @internal */ on() { activeEffectScope = this; } /** * This should only be called on non-detached scopes * @internal */ off() { activeEffectScope = this.parent; } stop(fromParent) { if (this._active) { let i2, l2; for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) { this.effects[i2].stop(); } for (i2 = 0, l2 = this.cleanups.length; i2 < l2; i2++) { this.cleanups[i2](); } if (this.scopes) { for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) { this.scopes[i2].stop(true); } } if (!this.detached && this.parent && !fromParent) { const last = this.parent.scopes.pop(); if (last && last !== this) { this.parent.scopes[this.index] = last; last.index = this.index; } } this.parent = void 0; this._active = false; } } } function effectScope(detached) { return new EffectScope(detached); } function recordEffectScope(effect2, scope = activeEffectScope) { if (scope && scope.active) { scope.effects.push(effect2); } } function getCurrentScope() { return activeEffectScope; } function onScopeDispose(fn) { if (activeEffectScope) { activeEffectScope.cleanups.push(fn); } } const createDep = (effects) => { const dep = new Set(effects); dep.w = 0; dep.n = 0; return dep; }; const wasTracked = (dep) => (dep.w & trackOpBit) > 0; const newTracked = (dep) => (dep.n & trackOpBit) > 0; const initDepMarkers = ({ deps }) => { if (deps.length) { for (let i2 = 0; i2 < deps.length; i2++) { deps[i2].w |= trackOpBit; } } }; const finalizeDepMarkers = (effect2) => { const { deps } = effect2; if (deps.length) { let ptr = 0; for (let i2 = 0; i2 < deps.length; i2++) { const dep = deps[i2]; if (wasTracked(dep) && !newTracked(dep)) { dep.delete(effect2); } else { deps[ptr++] = dep; } dep.w &= ~trackOpBit; dep.n &= ~trackOpBit; } deps.length = ptr; } }; const targetMap = /* @__PURE__ */ new WeakMap(); let effectTrackDepth = 0; let trackOpBit = 1; const maxMarkerBits = 30; let activeEffect; const ITERATE_KEY = Symbol(""); const MAP_KEY_ITERATE_KEY = Symbol(""); class ReactiveEffect { constructor(fn, scheduler = null, scope) { this.fn = fn; this.scheduler = scheduler; this.active = true; this.deps = []; this.parent = void 0; recordEffectScope(this, scope); } run() { if (!this.active) { return this.fn(); } let parent = activeEffect; let lastShouldTrack = shouldTrack; while (parent) { if (parent === this) { return; } parent = parent.parent; } try { this.parent = activeEffect; activeEffect = this; shouldTrack = true; trackOpBit = 1 << ++effectTrackDepth; if (effectTrackDepth <= maxMarkerBits) { initDepMarkers(this); } else { cleanupEffect(this); } return this.fn(); } finally { if (effectTrackDepth <= maxMarkerBits) { finalizeDepMarkers(this); } trackOpBit = 1 << --effectTrackDepth; activeEffect = this.parent; shouldTrack = lastShouldTrack; this.parent = void 0; if (this.deferStop) { this.stop(); } } } stop() { if (activeEffect === this) { this.deferStop = true; } else if (this.active) { cleanupEffect(this); if (this.onStop) { this.onStop(); } this.active = false; } } } function cleanupEffect(effect2) { const { deps } = effect2; if (deps.length) { for (let i2 = 0; i2 < deps.length; i2++) { deps[i2].delete(effect2); } deps.length = 0; } } function effect(fn, options2) { if (fn.effect) { fn = fn.effect.fn; } const _effect = new ReactiveEffect(fn); if (options2) { extend(_effect, options2); if (options2.scope) recordEffectScope(_effect, options2.scope); } if (!options2 || !options2.lazy) { _effect.run(); } const runner = _effect.run.bind(_effect); runner.effect = _effect; return runner; } function stop(runner) { runner.effect.stop(); } let shouldTrack = true; const trackStack = []; function pauseTracking() { trackStack.push(shouldTrack); shouldTrack = false; } function resetTracking() { const last = trackStack.pop(); shouldTrack = last === void 0 ? true : last; } function track(target2, type2, key) { if (shouldTrack && activeEffect) { let depsMap = targetMap.get(target2); if (!depsMap) { targetMap.set(target2, depsMap = /* @__PURE__ */ new Map()); } let dep = depsMap.get(key); if (!dep) { depsMap.set(key, dep = createDep()); } trackEffects(dep); } } function trackEffects(dep, debuggerEventExtraInfo) { let shouldTrack2 = false; if (effectTrackDepth <= maxMarkerBits) { if (!newTracked(dep)) { dep.n |= trackOpBit; shouldTrack2 = !wasTracked(dep); } } else { shouldTrack2 = !dep.has(activeEffect); } if (shouldTrack2) { dep.add(activeEffect); activeEffect.deps.push(dep); } } function trigger(target2, type2, key, newValue, oldValue, oldTarget) { const depsMap = targetMap.get(target2); if (!depsMap) { return; } let deps = []; if (type2 === "clear") { deps = [...depsMap.values()]; } else if (key === "length" && isArray$1(target2)) { const newLength = Number(newValue); depsMap.forEach((dep, key2) => { if (key2 === "length" || key2 >= newLength) { deps.push(dep); } }); } else { if (key !== void 0) { deps.push(depsMap.get(key)); } switch (type2) { case "add": if (!isArray$1(target2)) { deps.push(depsMap.get(ITERATE_KEY)); if (isMap(target2)) { deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); } } else if (isIntegerKey(key)) { deps.push(depsMap.get("length")); } break; case "delete": if (!isArray$1(target2)) { deps.push(depsMap.get(ITERATE_KEY)); if (isMap(target2)) { deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); } } break; case "set": if (isMap(target2)) { deps.push(depsMap.get(ITERATE_KEY)); } break; } } if (deps.length === 1) { if (deps[0]) { { triggerEffects(deps[0]); } } } else { const effects = []; for (const dep of deps) { if (dep) { effects.push(...dep); } } { triggerEffects(createDep(effects)); } } } function triggerEffects(dep, debuggerEventExtraInfo) { const effects = isArray$1(dep) ? dep : [...dep]; for (const effect2 of effects) { if (effect2.computed) { triggerEffect(effect2); } } for (const effect2 of effects) { if (!effect2.computed) { triggerEffect(effect2); } } } function triggerEffect(effect2, debuggerEventExtraInfo) { if (effect2 !== activeEffect || effect2.allowRecurse) { if (effect2.scheduler) { effect2.scheduler(); } else { effect2.run(); } } } function getDepFromReactive(object, key) { var _a2; return (_a2 = targetMap.get(object)) === null || _a2 === void 0 ? void 0 : _a2.get(key); } const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); const builtInSymbols = new Set( /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol$1) ); const get$1 = /* @__PURE__ */ createGetter(); const shallowGet = /* @__PURE__ */ createGetter(false, true); const readonlyGet = /* @__PURE__ */ createGetter(true); const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true); const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations(); function createArrayInstrumentations() { const instrumentations = {}; ["includes", "indexOf", "lastIndexOf"].forEach((key) => { instrumentations[key] = function(...args) { const arr = toRaw(this); for (let i2 = 0, l2 = this.length; i2 < l2; i2++) { track(arr, "get", i2 + ""); } const res = arr[key](...args); if (res === -1 || res === false) { return arr[key](...args.map(toRaw)); } else { return res; } }; }); ["push", "pop", "shift", "unshift", "splice"].forEach((key) => { instrumentations[key] = function(...args) { pauseTracking(); const res = toRaw(this)[key].apply(this, args); resetTracking(); return res; }; }); return instrumentations; } function hasOwnProperty$3(key) { const obj = toRaw(this); track(obj, "has", key); return obj.hasOwnProperty(key); } function createGetter(isReadonly2 = false, shallow = false) { return function get2(target2, key, receiver) { if (key === "__v_isReactive") { return !isReadonly2; } else if (key === "__v_isReadonly") { return isReadonly2; } else if (key === "__v_isShallow") { return shallow; } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target2)) { return target2; } const targetIsArray = isArray$1(target2); if (!isReadonly2) { if (targetIsArray && hasOwn$1(arrayInstrumentations, key)) { return Reflect.get(arrayInstrumentations, key, receiver); } if (key === "hasOwnProperty") { return hasOwnProperty$3; } } const res = Reflect.get(target2, key, receiver); if (isSymbol$1(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { return res; } if (!isReadonly2) { track(target2, "get", key); } if (shallow) { return res; } if (isRef(res)) { return targetIsArray && isIntegerKey(key) ? res : res.value; } if (isObject$4(res)) { return isReadonly2 ? readonly(res) : reactive(res); } return res; }; } const set$1 = /* @__PURE__ */ createSetter(); const shallowSet = /* @__PURE__ */ createSetter(true); function createSetter(shallow = false) { return function set3(target2, key, value, receiver) { let oldValue = target2[key]; if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) { return false; } if (!shallow) { if (!isShallow(value) && !isReadonly(value)) { oldValue = toRaw(oldValue); value = toRaw(value); } if (!isArray$1(target2) && isRef(oldValue) && !isRef(value)) { oldValue.value = value; return true; } } const hadKey = isArray$1(target2) && isIntegerKey(key) ? Number(key) < target2.length : hasOwn$1(target2, key); const result = Reflect.set(target2, key, value, receiver); if (target2 === toRaw(receiver)) { if (!hadKey) { trigger(target2, "add", key, value); } else if (hasChanged(value, oldValue)) { trigger(target2, "set", key, value); } } return result; }; } function deleteProperty(target2, key) { const hadKey = hasOwn$1(target2, key); target2[key]; const result = Reflect.deleteProperty(target2, key); if (result && hadKey) { trigger(target2, "delete", key, void 0); } return result; } function has$1(target2, key) { const result = Reflect.has(target2, key); if (!isSymbol$1(key) || !builtInSymbols.has(key)) { track(target2, "has", key); } return result; } function ownKeys(target2) { track(target2, "iterate", isArray$1(target2) ? "length" : ITERATE_KEY); return Reflect.ownKeys(target2); } const mutableHandlers = { get: get$1, set: set$1, deleteProperty, has: has$1, ownKeys }; const readonlyHandlers = { get: readonlyGet, set(target2, key) { return true; }, deleteProperty(target2, key) { return true; } }; const shallowReactiveHandlers = /* @__PURE__ */ extend({}, mutableHandlers, { get: shallowGet, set: shallowSet }); const shallowReadonlyHandlers = /* @__PURE__ */ extend({}, readonlyHandlers, { get: shallowReadonlyGet }); const toShallow = (value) => value; const getProto = (v) => Reflect.getPrototypeOf(v); function get$2(target2, key, isReadonly2 = false, isShallow2 = false) { target2 = target2[ "__v_raw" /* ReactiveFlags.RAW */ ]; const rawTarget = toRaw(target2); const rawKey = toRaw(key); if (!isReadonly2) { if (key !== rawKey) { track(rawTarget, "get", key); } track(rawTarget, "get", rawKey); } const { has: has2 } = getProto(rawTarget); const wrap2 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; if (has2.call(rawTarget, key)) { return wrap2(target2.get(key)); } else if (has2.call(rawTarget, rawKey)) { return wrap2(target2.get(rawKey)); } else if (target2 !== rawTarget) { target2.get(key); } } function has$2(key, isReadonly2 = false) { const target2 = this[ "__v_raw" /* ReactiveFlags.RAW */ ]; const rawTarget = toRaw(target2); const rawKey = toRaw(key); if (!isReadonly2) { if (key !== rawKey) { track(rawTarget, "has", key); } track(rawTarget, "has", rawKey); } return key === rawKey ? target2.has(key) : target2.has(key) || target2.has(rawKey); } function size$1(target2, isReadonly2 = false) { target2 = target2[ "__v_raw" /* ReactiveFlags.RAW */ ]; !isReadonly2 && track(toRaw(target2), "iterate", ITERATE_KEY); return Reflect.get(target2, "size", target2); } function add(value) { value = toRaw(value); const target2 = toRaw(this); const proto2 = getProto(target2); const hadKey = proto2.has.call(target2, value); if (!hadKey) { target2.add(value); trigger(target2, "add", value, value); } return this; } function set(key, value) { value = toRaw(value); const target2 = toRaw(this); const { has: has2, get: get2 } = getProto(target2); let hadKey = has2.call(target2, key); if (!hadKey) { key = toRaw(key); hadKey = has2.call(target2, key); } const oldValue = get2.call(target2, key); target2.set(key, value); if (!hadKey) { trigger(target2, "add", key, value); } else if (hasChanged(value, oldValue)) { trigger(target2, "set", key, value); } return this; } function deleteEntry(key) { const target2 = toRaw(this); const { has: has2, get: get2 } = getProto(target2); let hadKey = has2.call(target2, key); if (!hadKey) { key = toRaw(key); hadKey = has2.call(target2, key); } get2 ? get2.call(target2, key) : void 0; const result = target2.delete(key); if (hadKey) { trigger(target2, "delete", key, void 0); } return result; } function clear() { const target2 = toRaw(this); const hadItems = target2.size !== 0; const result = target2.clear(); if (hadItems) { trigger(target2, "clear", void 0, void 0); } return result; } function createForEach(isReadonly2, isShallow2) { return function forEach(callback, thisArg) { const observed = this; const target2 = observed[ "__v_raw" /* ReactiveFlags.RAW */ ]; const rawTarget = toRaw(target2); const wrap2 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY); return target2.forEach((value, key) => { return callback.call(thisArg, wrap2(value), wrap2(key), observed); }); }; } function createIterableMethod(method, isReadonly2, isShallow2) { return function(...args) { const target2 = this[ "__v_raw" /* ReactiveFlags.RAW */ ]; const rawTarget = toRaw(target2); const targetIsMap = isMap(rawTarget); const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; const isKeyOnly = method === "keys" && targetIsMap; const innerIterator = target2[method](...args); const wrap2 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY); return { // iterator protocol next() { const { value, done } = innerIterator.next(); return done ? { value, done } : { value: isPair ? [wrap2(value[0]), wrap2(value[1])] : wrap2(value), done }; }, // iterable protocol [Symbol.iterator]() { return this; } }; }; } function createReadonlyMethod(type2) { return function(...args) { return type2 === "delete" ? false : this; }; } function createInstrumentations() { const mutableInstrumentations2 = { get(key) { return get$2(this, key); }, get size() { return size$1(this); }, has: has$2, add, set, delete: deleteEntry, clear, forEach: createForEach(false, false) }; const shallowInstrumentations2 = { get(key) { return get$2(this, key, false, true); }, get size() { return size$1(this); }, has: has$2, add, set, delete: deleteEntry, clear, forEach: createForEach(false, true) }; const readonlyInstrumentations2 = { get(key) { return get$2(this, key, true); }, get size() { return size$1(this, true); }, has(key) { return has$2.call(this, key, true); }, add: createReadonlyMethod( "add" /* TriggerOpTypes.ADD */ ), set: createReadonlyMethod( "set" /* TriggerOpTypes.SET */ ), delete: createReadonlyMethod( "delete" /* TriggerOpTypes.DELETE */ ), clear: createReadonlyMethod( "clear" /* TriggerOpTypes.CLEAR */ ), forEach: createForEach(true, false) }; const shallowReadonlyInstrumentations2 = { get(key) { return get$2(this, key, true, true); }, get size() { return size$1(this, true); }, has(key) { return has$2.call(this, key, true); }, add: createReadonlyMethod( "add" /* TriggerOpTypes.ADD */ ), set: createReadonlyMethod( "set" /* TriggerOpTypes.SET */ ), delete: createReadonlyMethod( "delete" /* TriggerOpTypes.DELETE */ ), clear: createReadonlyMethod( "clear" /* TriggerOpTypes.CLEAR */ ), forEach: createForEach(true, true) }; const iteratorMethods = ["keys", "values", "entries", Symbol.iterator]; iteratorMethods.forEach((method) => { mutableInstrumentations2[method] = createIterableMethod(method, false, false); readonlyInstrumentations2[method] = createIterableMethod(method, true, false); shallowInstrumentations2[method] = createIterableMethod(method, false, true); shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true); }); return [ mutableInstrumentations2, readonlyInstrumentations2, shallowInstrumentations2, shallowReadonlyInstrumentations2 ]; } const [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations(); function createInstrumentationGetter(isReadonly2, shallow) { const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations; return (target2, key, receiver) => { if (key === "__v_isReactive") { return !isReadonly2; } else if (key === "__v_isReadonly") { return isReadonly2; } else if (key === "__v_raw") { return target2; } return Reflect.get(hasOwn$1(instrumentations, key) && key in target2 ? instrumentations : target2, key, receiver); }; } const mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) }; const shallowCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, true) }; const readonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, false) }; const shallowReadonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, true) }; const reactiveMap = /* @__PURE__ */ new WeakMap(); const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); const readonlyMap = /* @__PURE__ */ new WeakMap(); const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); function targetTypeMap(rawType) { switch (rawType) { case "Object": case "Array": return 1; case "Map": case "Set": case "WeakMap": case "WeakSet": return 2; default: return 0; } } function getTargetType(value) { return value[ "__v_skip" /* ReactiveFlags.SKIP */ ] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value)); } function reactive(target2) { if (isReadonly(target2)) { return target2; } return createReactiveObject(target2, false, mutableHandlers, mutableCollectionHandlers, reactiveMap); } function shallowReactive(target2) { return createReactiveObject(target2, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap); } function readonly(target2) { return createReactiveObject(target2, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap); } function shallowReadonly(target2) { return createReactiveObject(target2, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap); } function createReactiveObject(target2, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { if (!isObject$4(target2)) { return target2; } if (target2[ "__v_raw" /* ReactiveFlags.RAW */ ] && !(isReadonly2 && target2[ "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */ ])) { return target2; } const existingProxy = proxyMap.get(target2); if (existingProxy) { return existingProxy; } const targetType = getTargetType(target2); if (targetType === 0) { return target2; } const proxy = new Proxy(target2, targetType === 2 ? collectionHandlers : baseHandlers); proxyMap.set(target2, proxy); return proxy; } function isReactive(value) { if (isReadonly(value)) { return isReactive(value[ "__v_raw" /* ReactiveFlags.RAW */ ]); } return !!(value && value[ "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */ ]); } function isReadonly(value) { return !!(value && value[ "__v_isReadonly" /* ReactiveFlags.IS_READONLY */ ]); } function isShallow(value) { return !!(value && value[ "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */ ]); } function isProxy(value) { return isReactive(value) || isReadonly(value); } function toRaw(observed) { const raw = observed && observed[ "__v_raw" /* ReactiveFlags.RAW */ ]; return raw ? toRaw(raw) : observed; } function markRaw(value) { def(value, "__v_skip", true); return value; } const toReactive = (value) => isObject$4(value) ? reactive(value) : value; const toReadonly = (value) => isObject$4(value) ? readonly(value) : value; function trackRefValue(ref2) { if (shouldTrack && activeEffect) { ref2 = toRaw(ref2); { trackEffects(ref2.dep || (ref2.dep = createDep())); } } } function triggerRefValue(ref2, newVal) { ref2 = toRaw(ref2); const dep = ref2.dep; if (dep) { { triggerEffects(dep); } } } function isRef(r2) { return !!(r2 && r2.__v_isRef === true); } function ref(value) { return createRef(value, false); } function shallowRef(value) { return createRef(value, true); } function createRef(rawValue, shallow) { if (isRef(rawValue)) { return rawValue; } return new RefImpl(rawValue, shallow); } class RefImpl { constructor(value, __v_isShallow) { this.__v_isShallow = __v_isShallow; this.dep = void 0; this.__v_isRef = true; this._rawValue = __v_isShallow ? value : toRaw(value); this._value = __v_isShallow ? value : toReactive(value); } get value() { trackRefValue(this); return this._value; } set value(newVal) { const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal); newVal = useDirectValue ? newVal : toRaw(newVal); if (hasChanged(newVal, this._rawValue)) { this._rawValue = newVal; this._value = useDirectValue ? newVal : toReactive(newVal); triggerRefValue(this); } } } function triggerRef(ref2) { triggerRefValue(ref2); } function unref(ref2) { return isRef(ref2) ? ref2.value : ref2; } const shallowUnwrapHandlers = { get: (target2, key, receiver) => unref(Reflect.get(target2, key, receiver)), set: (target2, key, value, receiver) => { const oldValue = target2[key]; if (isRef(oldValue) && !isRef(value)) { oldValue.value = value; return true; } else { return Reflect.set(target2, key, value, receiver); } } }; function proxyRefs(objectWithRefs) { return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); } class CustomRefImpl { constructor(factory) { this.dep = void 0; this.__v_isRef = true; const { get: get2, set: set3 } = factory(() => trackRefValue(this), () => triggerRefValue(this)); this._get = get2; this._set = set3; } get value() { return this._get(); } set value(newVal) { this._set(newVal); } } function customRef(factory) { return new CustomRefImpl(factory); } function toRefs(object) { const ret = isArray$1(object) ? new Array(object.length) : {}; for (const key in object) { ret[key] = toRef(object, key); } return ret; } class ObjectRefImpl { constructor(_object, _key, _defaultValue) { this._object = _object; this._key = _key; this._defaultValue = _defaultValue; this.__v_isRef = true; } get value() { const val = this._object[this._key]; return val === void 0 ? this._defaultValue : val; } set value(newVal) { this._object[this._key] = newVal; } get dep() { return getDepFromReactive(toRaw(this._object), this._key); } } function toRef(object, key, defaultValue) { const val = object[key]; return isRef(val) ? val : new ObjectRefImpl(object, key, defaultValue); } var _a$1; class ComputedRefImpl { constructor(getter, _setter, isReadonly2, isSSR) { this._setter = _setter; this.dep = void 0; this.__v_isRef = true; this[_a$1] = false; this._dirty = true; this.effect = new ReactiveEffect(getter, () => { if (!this._dirty) { this._dirty = true; triggerRefValue(this); } }); this.effect.computed = this; this.effect.active = this._cacheable = !isSSR; this[ "__v_isReadonly" /* ReactiveFlags.IS_READONLY */ ] = isReadonly2; } get value() { const self2 = toRaw(this); trackRefValue(self2); if (self2._dirty || !self2._cacheable) { self2._dirty = false; self2._value = self2.effect.run(); } return self2._value; } set value(newValue) { this._setter(newValue); } } _a$1 = "__v_isReadonly"; function computed$1(getterOrOptions, debugOptions, isSSR = false) { let getter; let setter; const onlyGetter = isFunction$3(getterOrOptions); if (onlyGetter) { getter = getterOrOptions; setter = NOOP; } else { getter = getterOrOptions.get; setter = getterOrOptions.set; } const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR); return cRef; } function warn$1(msg, ...args) { return; } function assertNumber(val, type2) { return; } function callWithErrorHandling(fn, instance, type2, args) { let res; try { res = args ? fn(...args) : fn(); } catch (err) { handleError(err, instance, type2); } return res; } function callWithAsyncErrorHandling(fn, instance, type2, args) { if (isFunction$3(fn)) { const res = callWithErrorHandling(fn, instance, type2, args); if (res && isPromise(res)) { res.catch((err) => { handleError(err, instance, type2); }); } return res; } const values = []; for (let i2 = 0; i2 < fn.length; i2++) { values.push(callWithAsyncErrorHandling(fn[i2], instance, type2, args)); } return values; } function handleError(err, instance, type2, throwInDev = true) { const contextVNode = instance ? instance.vnode : null; if (instance) { let cur = instance.parent; const exposedInstance = instance.proxy; const errorInfo = type2; while (cur) { const errorCapturedHooks = cur.ec; if (errorCapturedHooks) { for (let i2 = 0; i2 < errorCapturedHooks.length; i2++) { if (errorCapturedHooks[i2](err, exposedInstance, errorInfo) === false) { return; } } } cur = cur.parent; } const appErrorHandler = instance.appContext.config.errorHandler; if (appErrorHandler) { callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]); return; } } logError(err, type2, contextVNode, throwInDev); } function logError(err, type2, contextVNode, throwInDev = true) { { console.error(err); } } let isFlushing = false; let isFlushPending = false; const queue = []; let flushIndex = 0; const pendingPostFlushCbs = []; let activePostFlushCbs = null; let postFlushIndex = 0; const resolvedPromise = /* @__PURE__ */ Promise.resolve(); let currentFlushPromise = null; function nextTick(fn) { const p2 = currentFlushPromise || resolvedPromise; return fn ? p2.then(this ? fn.bind(this) : fn) : p2; } function findInsertionIndex(id2) { let start = flushIndex + 1; let end = queue.length; while (start < end) { const middle = start + end >>> 1; const middleJobId = getId$1(queue[middle]); middleJobId < id2 ? start = middle + 1 : end = middle; } return start; } function queueJob(job) { if (!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) { if (job.id == null) { queue.push(job); } else { queue.splice(findInsertionIndex(job.id), 0, job); } queueFlush(); } } function queueFlush() { if (!isFlushing && !isFlushPending) { isFlushPending = true; currentFlushPromise = resolvedPromise.then(flushJobs); } } function invalidateJob(job) { const i2 = queue.indexOf(job); if (i2 > flushIndex) { queue.splice(i2, 1); } } function queuePostFlushCb(cb) { if (!isArray$1(cb)) { if (!activePostFlushCbs || !activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) { pendingPostFlushCbs.push(cb); } } else { pendingPostFlushCbs.push(...cb); } queueFlush(); } function flushPreFlushCbs(seen, i2 = isFlushing ? flushIndex + 1 : 0) { for (; i2 < queue.length; i2++) { const cb = queue[i2]; if (cb && cb.pre) { queue.splice(i2, 1); i2--; cb(); } } } function flushPostFlushCbs(seen) { if (pendingPostFlushCbs.length) { const deduped = [...new Set(pendingPostFlushCbs)]; pendingPostFlushCbs.length = 0; if (activePostFlushCbs) { activePostFlushCbs.push(...deduped); return; } activePostFlushCbs = deduped; activePostFlushCbs.sort((a2, b2) => getId$1(a2) - getId$1(b2)); for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { activePostFlushCbs[postFlushIndex](); } activePostFlushCbs = null; postFlushIndex = 0; } } const getId$1 = (job) => job.id == null ? Infinity : job.id; const comparator = (a2, b2) => { const diff = getId$1(a2) - getId$1(b2); if (diff === 0) { if (a2.pre && !b2.pre) return -1; if (b2.pre && !a2.pre) return 1; } return diff; }; function flushJobs(seen) { isFlushPending = false; isFlushing = true; queue.sort(comparator); const check2 = NOOP; try { for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { const job = queue[flushIndex]; if (job && job.active !== false) { if (false) ; callWithErrorHandling( job, null, 14 /* ErrorCodes.SCHEDULER */ ); } } } finally { flushIndex = 0; queue.length = 0; flushPostFlushCbs(); isFlushing = false; currentFlushPromise = null; if (queue.length || pendingPostFlushCbs.length) { flushJobs(); } } } let devtools$1; let buffer = []; function setDevtoolsHook(hook, target2) { var _a2, _b2; devtools$1 = hook; if (devtools$1) { devtools$1.enabled = true; buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); buffer = []; } else if ( // handle late devtools injection - only do this if we are in an actual // browser environment to avoid the timer handle stalling test runner exit // (#4815) typeof window !== "undefined" && // some envs mock window but not fully window.HTMLElement && // also exclude jsdom !((_b2 = (_a2 = window.navigator) === null || _a2 === void 0 ? void 0 : _a2.userAgent) === null || _b2 === void 0 ? void 0 : _b2.includes("jsdom")) ) { const replay = target2.__VUE_DEVTOOLS_HOOK_REPLAY__ = target2.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; replay.push((newHook) => { setDevtoolsHook(newHook, target2); }); setTimeout(() => { if (!devtools$1) { target2.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; buffer = []; } }, 3e3); } else { buffer = []; } } function emit(instance, event, ...rawArgs) { if (instance.isUnmounted) return; const props = instance.vnode.props || EMPTY_OBJ; let args = rawArgs; const isModelListener2 = event.startsWith("update:"); const modelArg = isModelListener2 && event.slice(7); if (modelArg && modelArg in props) { const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`; const { number: number2, trim: trim2 } = props[modifiersKey] || EMPTY_OBJ; if (trim2) { args = rawArgs.map((a2) => isString$4(a2) ? a2.trim() : a2); } if (number2) { args = rawArgs.map(looseToNumber); } } let handlerName; let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) props[handlerName = toHandlerKey(camelize(event))]; if (!handler && isModelListener2) { handler = props[handlerName = toHandlerKey(hyphenate(event))]; } if (handler) { callWithAsyncErrorHandling(handler, instance, 6, args); } const onceHandler = props[handlerName + `Once`]; if (onceHandler) { if (!instance.emitted) { instance.emitted = {}; } else if (instance.emitted[handlerName]) { return; } instance.emitted[handlerName] = true; callWithAsyncErrorHandling(onceHandler, instance, 6, args); } } function normalizeEmitsOptions(comp2, appContext, asMixin = false) { const cache2 = appContext.emitsCache; const cached = cache2.get(comp2); if (cached !== void 0) { return cached; } const raw = comp2.emits; let normalized = {}; let hasExtends = false; if (!isFunction$3(comp2)) { const extendEmits = (raw2) => { const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); if (normalizedFromExtend) { hasExtends = true; extend(normalized, normalizedFromExtend); } }; if (!asMixin && appContext.mixins.length) { appContext.mixins.forEach(extendEmits); } if (comp2.extends) { extendEmits(comp2.extends); } if (comp2.mixins) { comp2.mixins.forEach(extendEmits); } } if (!raw && !hasExtends) { if (isObject$4(comp2)) { cache2.set(comp2, null); } return null; } if (isArray$1(raw)) { raw.forEach((key) => normalized[key] = null); } else { extend(normalized, raw); } if (isObject$4(comp2)) { cache2.set(comp2, normalized); } return normalized; } function isEmitListener(options2, key) { if (!options2 || !isOn(key)) { return false; } key = key.slice(2).replace(/Once$/, ""); return hasOwn$1(options2, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options2, hyphenate(key)) || hasOwn$1(options2, key); } let currentRenderingInstance = null; let currentScopeId = null; function setCurrentRenderingInstance(instance) { const prev2 = currentRenderingInstance; currentRenderingInstance = instance; currentScopeId = instance && instance.type.__scopeId || null; return prev2; } function pushScopeId(id2) { currentScopeId = id2; } function popScopeId() { currentScopeId = null; } const withScopeId = (_id) => withCtx; function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { if (!ctx) return fn; if (fn._n) { return fn; } const renderFnWithContext = (...args) => { if (renderFnWithContext._d) { setBlockTracking(-1); } const prevInstance = setCurrentRenderingInstance(ctx); let res; try { res = fn(...args); } finally { setCurrentRenderingInstance(prevInstance); if (renderFnWithContext._d) { setBlockTracking(1); } } return res; }; renderFnWithContext._n = true; renderFnWithContext._c = true; renderFnWithContext._d = true; return renderFnWithContext; } function markAttrsAccessed() { } function renderComponentRoot(instance) { const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit: emit2, render: render2, renderCache, data, setupState, ctx, inheritAttrs } = instance; let result; let fallthroughAttrs; const prev2 = setCurrentRenderingInstance(instance); try { if (vnode.shapeFlag & 4) { const proxyToUse = withProxy || proxy; result = normalizeVNode(render2.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx)); fallthroughAttrs = attrs; } else { const render3 = Component; if (false) ; result = normalizeVNode(render3.length > 1 ? render3(props, false ? { get attrs() { markAttrsAccessed(); return attrs; }, slots, emit: emit2 } : { attrs, slots, emit: emit2 }) : render3( props, null /* we know it doesn't need it */ )); fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); } } catch (err) { blockStack.length = 0; handleError( err, instance, 1 /* ErrorCodes.RENDER_FUNCTION */ ); result = createVNode(Comment); } let root2 = result; if (fallthroughAttrs && inheritAttrs !== false) { const keys = Object.keys(fallthroughAttrs); const { shapeFlag } = root2; if (keys.length) { if (shapeFlag & (1 | 6)) { if (propsOptions && keys.some(isModelListener)) { fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions); } root2 = cloneVNode(root2, fallthroughAttrs); } } } if (vnode.dirs) { root2 = cloneVNode(root2); root2.dirs = root2.dirs ? root2.dirs.concat(vnode.dirs) : vnode.dirs; } if (vnode.transition) { root2.transition = vnode.transition; } { result = root2; } setCurrentRenderingInstance(prev2); return result; } function filterSingleRoot(children) { let singleRoot; for (let i2 = 0; i2 < children.length; i2++) { const child = children[i2]; if (isVNode(child)) { if (child.type !== Comment || child.children === "v-if") { if (singleRoot) { return; } else { singleRoot = child; } } } else { return; } } return singleRoot; } const getFunctionalFallthrough = (attrs) => { let res; for (const key in attrs) { if (key === "class" || key === "style" || isOn(key)) { (res || (res = {}))[key] = attrs[key]; } } return res; }; const filterModelListeners = (attrs, props) => { const res = {}; for (const key in attrs) { if (!isModelListener(key) || !(key.slice(9) in props)) { res[key] = attrs[key]; } } return res; }; function shouldUpdateComponent(prevVNode, nextVNode, optimized) { const { props: prevProps, children: prevChildren, component } = prevVNode; const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; const emits = component.emitsOptions; if (nextVNode.dirs || nextVNode.transition) { return true; } if (optimized && patchFlag >= 0) { if (patchFlag & 1024) { return true; } if (patchFlag & 16) { if (!prevProps) { return !!nextProps; } return hasPropsChanged(prevProps, nextProps, emits); } else if (patchFlag & 8) { const dynamicProps = nextVNode.dynamicProps; for (let i2 = 0; i2 < dynamicProps.length; i2++) { const key = dynamicProps[i2]; if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { return true; } } } } else { if (prevChildren || nextChildren) { if (!nextChildren || !nextChildren.$stable) { return true; } } if (prevProps === nextProps) { return false; } if (!prevProps) { return !!nextProps; } if (!nextProps) { return true; } return hasPropsChanged(prevProps, nextProps, emits); } return false; } function hasPropsChanged(prevProps, nextProps, emitsOptions) { const nextKeys = Object.keys(nextProps); if (nextKeys.length !== Object.keys(prevProps).length) { return true; } for (let i2 = 0; i2 < nextKeys.length; i2++) { const key = nextKeys[i2]; if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { return true; } } return false; } function updateHOCHostEl({ vnode, parent }, el2) { while (parent && parent.subTree === vnode) { (vnode = parent.vnode).el = el2; parent = parent.parent; } } const isSuspense = (type2) => type2.__isSuspense; const SuspenseImpl = { name: "Suspense", // In order to make Suspense tree-shakable, we need to avoid importing it // directly in the renderer. The renderer checks for the __isSuspense flag // on a vnode's type and calls the `process` method, passing in renderer // internals. __isSuspense: true, process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) { if (n1 == null) { mountSuspense(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals); } else { patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, rendererInternals); } }, hydrate: hydrateSuspense, create: createSuspenseBoundary, normalize: normalizeSuspenseChildren }; const Suspense = SuspenseImpl; function triggerEvent(vnode, name2) { const eventListener = vnode.props && vnode.props[name2]; if (isFunction$3(eventListener)) { eventListener(); } } function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) { const { p: patch, o: { createElement } } = rendererInternals; const hiddenContainer = createElement("div"); const suspense = vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals); patch(null, suspense.pendingBranch = vnode.ssContent, hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds); if (suspense.deps > 0) { triggerEvent(vnode, "onPending"); triggerEvent(vnode, "onFallback"); patch( null, vnode.ssFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context isSVG, slotScopeIds ); setActiveBranch(suspense, vnode.ssFallback); } else { suspense.resolve(); } } function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) { const suspense = n2.suspense = n1.suspense; suspense.vnode = n2; n2.el = n1.el; const newBranch = n2.ssContent; const newFallback = n2.ssFallback; const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; if (pendingBranch) { suspense.pendingBranch = newBranch; if (isSameVNodeType(newBranch, pendingBranch)) { patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized); if (suspense.deps <= 0) { suspense.resolve(); } else if (isInFallback) { patch( activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context isSVG, slotScopeIds, optimized ); setActiveBranch(suspense, newFallback); } } else { suspense.pendingId++; if (isHydrating) { suspense.isHydrating = false; suspense.activeBranch = pendingBranch; } else { unmount(pendingBranch, parentComponent, suspense); } suspense.deps = 0; suspense.effects.length = 0; suspense.hiddenContainer = createElement("div"); if (isInFallback) { patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized); if (suspense.deps <= 0) { suspense.resolve(); } else { patch( activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context isSVG, slotScopeIds, optimized ); setActiveBranch(suspense, newFallback); } } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, isSVG, slotScopeIds, optimized); suspense.resolve(true); } else { patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized); if (suspense.deps <= 0) { suspense.resolve(); } } } } else { if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, isSVG, slotScopeIds, optimized); setActiveBranch(suspense, newBranch); } else { triggerEvent(n2, "onPending"); suspense.pendingBranch = newBranch; suspense.pendingId++; patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized); if (suspense.deps <= 0) { suspense.resolve(); } else { const { timeout, pendingId } = suspense; if (timeout > 0) { setTimeout(() => { if (suspense.pendingId === pendingId) { suspense.fallback(newFallback); } }, timeout); } else if (timeout === 0) { suspense.fallback(newFallback); } } } } } function createSuspenseBoundary(vnode, parent, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) { const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove: remove2 } } = rendererInternals; const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0; const suspense = { vnode, parent, parentComponent, isSVG, container, hiddenContainer, anchor, deps: 0, pendingId: 0, timeout: typeof timeout === "number" ? timeout : -1, activeBranch: null, pendingBranch: null, isInFallback: true, isHydrating, isUnmounted: false, effects: [], resolve(resume = false) { const { vnode: vnode2, activeBranch, pendingBranch, pendingId, effects, parentComponent: parentComponent2, container: container2 } = suspense; if (suspense.isHydrating) { suspense.isHydrating = false; } else if (!resume) { const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; if (delayEnter) { activeBranch.transition.afterLeave = () => { if (pendingId === suspense.pendingId) { move( pendingBranch, container2, anchor2, 0 /* MoveType.ENTER */ ); } }; } let { anchor: anchor2 } = suspense; if (activeBranch) { anchor2 = next(activeBranch); unmount(activeBranch, parentComponent2, suspense, true); } if (!delayEnter) { move( pendingBranch, container2, anchor2, 0 /* MoveType.ENTER */ ); } } setActiveBranch(suspense, pendingBranch); suspense.pendingBranch = null; suspense.isInFallback = false; let parent2 = suspense.parent; let hasUnresolvedAncestor = false; while (parent2) { if (parent2.pendingBranch) { parent2.effects.push(...effects); hasUnresolvedAncestor = true; break; } parent2 = parent2.parent; } if (!hasUnresolvedAncestor) { queuePostFlushCb(effects); } suspense.effects = []; triggerEvent(vnode2, "onResolve"); }, fallback(fallbackVNode) { if (!suspense.pendingBranch) { return; } const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense; triggerEvent(vnode2, "onFallback"); const anchor2 = next(activeBranch); const mountFallback = () => { if (!suspense.isInFallback) { return; } patch( null, fallbackVNode, container2, anchor2, parentComponent2, null, // fallback tree will not have suspense context isSVG2, slotScopeIds, optimized ); setActiveBranch(suspense, fallbackVNode); }; const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; if (delayEnter) { activeBranch.transition.afterLeave = mountFallback; } suspense.isInFallback = true; unmount( activeBranch, parentComponent2, null, // no suspense so unmount hooks fire now true // shouldRemove ); if (!delayEnter) { mountFallback(); } }, move(container2, anchor2, type2) { suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type2); suspense.container = container2; }, next() { return suspense.activeBranch && next(suspense.activeBranch); }, registerDep(instance, setupRenderEffect) { const isInPendingSuspense = !!suspense.pendingBranch; if (isInPendingSuspense) { suspense.deps++; } const hydratedEl = instance.vnode.el; instance.asyncDep.catch((err) => { handleError( err, instance, 0 /* ErrorCodes.SETUP_FUNCTION */ ); }).then((asyncSetupResult) => { if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { return; } instance.asyncResolved = true; const { vnode: vnode2 } = instance; handleSetupResult(instance, asyncSetupResult, false); if (hydratedEl) { vnode2.el = hydratedEl; } const placeholder = !hydratedEl && instance.subTree.el; setupRenderEffect( instance, vnode2, // component may have been moved before resolve. // if this is not a hydration, instance.subTree will be the comment // placeholder. parentNode(hydratedEl || instance.subTree.el), // anchor will not be used if this is hydration, so only need to // consider the comment placeholder case. hydratedEl ? null : next(instance.subTree), suspense, isSVG, optimized ); if (placeholder) { remove2(placeholder); } updateHOCHostEl(instance, vnode2.el); if (isInPendingSuspense && --suspense.deps === 0) { suspense.resolve(); } }); }, unmount(parentSuspense, doRemove) { suspense.isUnmounted = true; if (suspense.activeBranch) { unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove); } if (suspense.pendingBranch) { unmount(suspense.pendingBranch, parentComponent, parentSuspense, doRemove); } } }; return suspense; } function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) { const suspense = vnode.suspense = createSuspenseBoundary( vnode, parentSuspense, parentComponent, node.parentNode, document.createElement("div"), null, isSVG, slotScopeIds, optimized, rendererInternals, true /* hydrating */ ); const result = hydrateNode(node, suspense.pendingBranch = vnode.ssContent, parentComponent, suspense, slotScopeIds, optimized); if (suspense.deps === 0) { suspense.resolve(); } return result; } function normalizeSuspenseChildren(vnode) { const { shapeFlag, children } = vnode; const isSlotChildren = shapeFlag & 32; vnode.ssContent = normalizeSuspenseSlot(isSlotChildren ? children.default : children); vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); } function normalizeSuspenseSlot(s2) { let block3; if (isFunction$3(s2)) { const trackBlock = isBlockTreeEnabled && s2._c; if (trackBlock) { s2._d = false; openBlock(); } s2 = s2(); if (trackBlock) { s2._d = true; block3 = currentBlock; closeBlock(); } } if (isArray$1(s2)) { const singleChild = filterSingleRoot(s2); s2 = singleChild; } s2 = normalizeVNode(s2); if (block3 && !s2.dynamicChildren) { s2.dynamicChildren = block3.filter((c2) => c2 !== s2); } return s2; } function queueEffectWithSuspense(fn, suspense) { if (suspense && suspense.pendingBranch) { if (isArray$1(fn)) { suspense.effects.push(...fn); } else { suspense.effects.push(fn); } } else { queuePostFlushCb(fn); } } function setActiveBranch(suspense, branch) { suspense.activeBranch = branch; const { vnode, parentComponent } = suspense; const el2 = vnode.el = branch.el; if (parentComponent && parentComponent.subTree === vnode) { parentComponent.vnode.el = el2; updateHOCHostEl(parentComponent, el2); } } function provide(key, value) { if (!currentInstance) ; else { let provides = currentInstance.provides; const parentProvides = currentInstance.parent && currentInstance.parent.provides; if (parentProvides === provides) { provides = currentInstance.provides = Object.create(parentProvides); } provides[key] = value; } } function inject(key, defaultValue, treatDefaultAsFactory = false) { const instance = currentInstance || currentRenderingInstance; if (instance) { const provides = instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides; if (provides && key in provides) { return provides[key]; } else if (arguments.length > 1) { return treatDefaultAsFactory && isFunction$3(defaultValue) ? defaultValue.call(instance.proxy) : defaultValue; } else ; } } function watchEffect(effect2, options2) { return doWatch(effect2, null, options2); } function watchPostEffect(effect2, options2) { return doWatch(effect2, null, { flush: "post" }); } function watchSyncEffect(effect2, options2) { return doWatch(effect2, null, { flush: "sync" }); } const INITIAL_WATCHER_VALUE = {}; function watch(source, cb, options2) { return doWatch(source, cb, options2); } function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) { const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null; let getter; let forceTrigger = false; let isMultiSource = false; if (isRef(source)) { getter = () => source.value; forceTrigger = isShallow(source); } else if (isReactive(source)) { getter = () => source; deep = true; } else if (isArray$1(source)) { isMultiSource = true; forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2)); getter = () => source.map((s2) => { if (isRef(s2)) { return s2.value; } else if (isReactive(s2)) { return traverse(s2); } else if (isFunction$3(s2)) { return callWithErrorHandling( s2, instance, 2 /* ErrorCodes.WATCH_GETTER */ ); } else ; }); } else if (isFunction$3(source)) { if (cb) { getter = () => callWithErrorHandling( source, instance, 2 /* ErrorCodes.WATCH_GETTER */ ); } else { getter = () => { if (instance && instance.isUnmounted) { return; } if (cleanup) { cleanup(); } return callWithAsyncErrorHandling(source, instance, 3, [onCleanup]); }; } } else { getter = NOOP; } if (cb && deep) { const baseGetter = getter; getter = () => traverse(baseGetter()); } let cleanup; let onCleanup = (fn) => { cleanup = effect2.onStop = () => { callWithErrorHandling( fn, instance, 4 /* ErrorCodes.WATCH_CLEANUP */ ); }; }; let ssrCleanup; if (isInSSRComponentSetup) { onCleanup = NOOP; if (!cb) { getter(); } else if (immediate) { callWithAsyncErrorHandling(cb, instance, 3, [ getter(), isMultiSource ? [] : void 0, onCleanup ]); } if (flush === "sync") { const ctx = useSSRContext(); ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); } else { return NOOP; } } let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; const job = () => { if (!effect2.active) { return; } if (cb) { const newValue = effect2.run(); if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i2) => hasChanged(v, oldValue[i2])) : hasChanged(newValue, oldValue)) || false) { if (cleanup) { cleanup(); } callWithAsyncErrorHandling(cb, instance, 3, [ newValue, // pass undefined as the old value when it's changed for the first time oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, onCleanup ]); oldValue = newValue; } } else { effect2.run(); } }; job.allowRecurse = !!cb; let scheduler; if (flush === "sync") { scheduler = job; } else if (flush === "post") { scheduler = () => queuePostRenderEffect(job, instance && instance.suspense); } else { job.pre = true; if (instance) job.id = instance.uid; scheduler = () => queueJob(job); } const effect2 = new ReactiveEffect(getter, scheduler); if (cb) { if (immediate) { job(); } else { oldValue = effect2.run(); } } else if (flush === "post") { queuePostRenderEffect(effect2.run.bind(effect2), instance && instance.suspense); } else { effect2.run(); } const unwatch = () => { effect2.stop(); if (instance && instance.scope) { remove(instance.scope.effects, effect2); } }; if (ssrCleanup) ssrCleanup.push(unwatch); return unwatch; } function instanceWatch(source, value, options2) { const publicThis = this.proxy; const getter = isString$4(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); let cb; if (isFunction$3(value)) { cb = value; } else { cb = value.handler; options2 = value; } const cur = currentInstance; setCurrentInstance(this); const res = doWatch(getter, cb.bind(publicThis), options2); if (cur) { setCurrentInstance(cur); } else { unsetCurrentInstance(); } return res; } function createPathGetter(ctx, path) { const segments = path.split("."); return () => { let cur = ctx; for (let i2 = 0; i2 < segments.length && cur; i2++) { cur = cur[segments[i2]]; } return cur; }; } function traverse(value, seen) { if (!isObject$4(value) || value[ "__v_skip" /* ReactiveFlags.SKIP */ ]) { return value; } seen = seen || /* @__PURE__ */ new Set(); if (seen.has(value)) { return value; } seen.add(value); if (isRef(value)) { traverse(value.value, seen); } else if (isArray$1(value)) { for (let i2 = 0; i2 < value.length; i2++) { traverse(value[i2], seen); } } else if (isSet(value) || isMap(value)) { value.forEach((v) => { traverse(v, seen); }); } else if (isPlainObject$2(value)) { for (const key in value) { traverse(value[key], seen); } } return value; } function useTransitionState() { const state = { isMounted: false, isLeaving: false, isUnmounting: false, leavingVNodes: /* @__PURE__ */ new Map() }; onMounted(() => { state.isMounted = true; }); onBeforeUnmount(() => { state.isUnmounting = true; }); return state; } const TransitionHookValidator = [Function, Array]; const BaseTransitionImpl = { name: `BaseTransition`, props: { mode: String, appear: Boolean, persisted: Boolean, // enter onBeforeEnter: TransitionHookValidator, onEnter: TransitionHookValidator, onAfterEnter: TransitionHookValidator, onEnterCancelled: TransitionHookValidator, // leave onBeforeLeave: TransitionHookValidator, onLeave: TransitionHookValidator, onAfterLeave: TransitionHookValidator, onLeaveCancelled: TransitionHookValidator, // appear onBeforeAppear: TransitionHookValidator, onAppear: TransitionHookValidator, onAfterAppear: TransitionHookValidator, onAppearCancelled: TransitionHookValidator }, setup(props, { slots }) { const instance = getCurrentInstance(); const state = useTransitionState(); let prevTransitionKey; return () => { const children = slots.default && getTransitionRawChildren(slots.default(), true); if (!children || !children.length) { return; } let child = children[0]; if (children.length > 1) { for (const c2 of children) { if (c2.type !== Comment) { child = c2; break; } } } const rawProps = toRaw(props); const { mode } = rawProps; if (state.isLeaving) { return emptyPlaceholder(child); } const innerChild = getKeepAliveChild(child); if (!innerChild) { return emptyPlaceholder(child); } const enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance); setTransitionHooks(innerChild, enterHooks); const oldChild = instance.subTree; const oldInnerChild = oldChild && getKeepAliveChild(oldChild); let transitionKeyChanged = false; const { getTransitionKey } = innerChild.type; if (getTransitionKey) { const key = getTransitionKey(); if (prevTransitionKey === void 0) { prevTransitionKey = key; } else if (key !== prevTransitionKey) { prevTransitionKey = key; transitionKeyChanged = true; } } if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) { const leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance); setTransitionHooks(oldInnerChild, leavingHooks); if (mode === "out-in") { state.isLeaving = true; leavingHooks.afterLeave = () => { state.isLeaving = false; if (instance.update.active !== false) { instance.update(); } }; return emptyPlaceholder(child); } else if (mode === "in-out" && innerChild.type !== Comment) { leavingHooks.delayLeave = (el2, earlyRemove, delayedLeave) => { const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild); leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; el2._leaveCb = () => { earlyRemove(); el2._leaveCb = void 0; delete enterHooks.delayedLeave; }; enterHooks.delayedLeave = delayedLeave; }; } } return child; }; } }; const BaseTransition = BaseTransitionImpl; function getLeavingNodesForType(state, vnode) { const { leavingVNodes } = state; let leavingVNodesCache = leavingVNodes.get(vnode.type); if (!leavingVNodesCache) { leavingVNodesCache = /* @__PURE__ */ Object.create(null); leavingVNodes.set(vnode.type, leavingVNodesCache); } return leavingVNodesCache; } function resolveTransitionHooks(vnode, props, state, instance) { const { appear, mode, persisted = false, onBeforeEnter, onEnter, onAfterEnter, onEnterCancelled, onBeforeLeave, onLeave, onAfterLeave, onLeaveCancelled, onBeforeAppear, onAppear, onAfterAppear, onAppearCancelled } = props; const key = String(vnode.key); const leavingVNodesCache = getLeavingNodesForType(state, vnode); const callHook2 = (hook, args) => { hook && callWithAsyncErrorHandling(hook, instance, 9, args); }; const callAsyncHook = (hook, args) => { const done = args[1]; callHook2(hook, args); if (isArray$1(hook)) { if (hook.every((hook2) => hook2.length <= 1)) done(); } else if (hook.length <= 1) { done(); } }; const hooks = { mode, persisted, beforeEnter(el2) { let hook = onBeforeEnter; if (!state.isMounted) { if (appear) { hook = onBeforeAppear || onBeforeEnter; } else { return; } } if (el2._leaveCb) { el2._leaveCb( true /* cancelled */ ); } const leavingVNode = leavingVNodesCache[key]; if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el._leaveCb) { leavingVNode.el._leaveCb(); } callHook2(hook, [el2]); }, enter(el2) { let hook = onEnter; let afterHook = onAfterEnter; let cancelHook = onEnterCancelled; if (!state.isMounted) { if (appear) { hook = onAppear || onEnter; afterHook = onAfterAppear || onAfterEnter; cancelHook = onAppearCancelled || onEnterCancelled; } else { return; } } let called = false; const done = el2._enterCb = (cancelled) => { if (called) return; called = true; if (cancelled) { callHook2(cancelHook, [el2]); } else { callHook2(afterHook, [el2]); } if (hooks.delayedLeave) { hooks.delayedLeave(); } el2._enterCb = void 0; }; if (hook) { callAsyncHook(hook, [el2, done]); } else { done(); } }, leave(el2, remove2) { const key2 = String(vnode.key); if (el2._enterCb) { el2._enterCb( true /* cancelled */ ); } if (state.isUnmounting) { return remove2(); } callHook2(onBeforeLeave, [el2]); let called = false; const done = el2._leaveCb = (cancelled) => { if (called) return; called = true; remove2(); if (cancelled) { callHook2(onLeaveCancelled, [el2]); } else { callHook2(onAfterLeave, [el2]); } el2._leaveCb = void 0; if (leavingVNodesCache[key2] === vnode) { delete leavingVNodesCache[key2]; } }; leavingVNodesCache[key2] = vnode; if (onLeave) { callAsyncHook(onLeave, [el2, done]); } else { done(); } }, clone(vnode2) { return resolveTransitionHooks(vnode2, props, state, instance); } }; return hooks; } function emptyPlaceholder(vnode) { if (isKeepAlive(vnode)) { vnode = cloneVNode(vnode); vnode.children = null; return vnode; } } function getKeepAliveChild(vnode) { return isKeepAlive(vnode) ? vnode.children ? vnode.children[0] : void 0 : vnode; } function setTransitionHooks(vnode, hooks) { if (vnode.shapeFlag & 6 && vnode.component) { setTransitionHooks(vnode.component.subTree, hooks); } else if (vnode.shapeFlag & 128) { vnode.ssContent.transition = hooks.clone(vnode.ssContent); vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); } else { vnode.transition = hooks; } } function getTransitionRawChildren(children, keepComment = false, parentKey) { let ret = []; let keyedFragmentCount = 0; for (let i2 = 0; i2 < children.length; i2++) { let child = children[i2]; const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i2); if (child.type === Fragment) { if (child.patchFlag & 128) keyedFragmentCount++; ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key)); } else if (keepComment || child.type !== Comment) { ret.push(key != null ? cloneVNode(child, { key }) : child); } } if (keyedFragmentCount > 1) { for (let i2 = 0; i2 < ret.length; i2++) { ret[i2].patchFlag = -2; } } return ret; } function defineComponent(options2) { return isFunction$3(options2) ? { setup: options2, name: options2.name } : options2; } const isAsyncWrapper = (i2) => !!i2.type.__asyncLoader; function defineAsyncComponent(source) { if (isFunction$3(source)) { source = { loader: source }; } const { loader, loadingComponent, errorComponent, delay = 200, timeout, // undefined = never times out suspensible = true, onError: userOnError } = source; let pendingRequest = null; let resolvedComp; let retries = 0; const retry = () => { retries++; pendingRequest = null; return load(); }; const load = () => { let thisRequest; return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { err = err instanceof Error ? err : new Error(String(err)); if (userOnError) { return new Promise((resolve3, reject) => { const userRetry = () => resolve3(retry()); const userFail = () => reject(err); userOnError(err, userRetry, userFail, retries + 1); }); } else { throw err; } }).then((comp2) => { if (thisRequest !== pendingRequest && pendingRequest) { return pendingRequest; } if (comp2 && (comp2.__esModule || comp2[Symbol.toStringTag] === "Module")) { comp2 = comp2.default; } resolvedComp = comp2; return comp2; })); }; return defineComponent({ name: "AsyncComponentWrapper", __asyncLoader: load, get __asyncResolved() { return resolvedComp; }, setup() { const instance = currentInstance; if (resolvedComp) { return () => createInnerComp(resolvedComp, instance); } const onError = (err) => { pendingRequest = null; handleError( err, instance, 13, !errorComponent /* do not throw in dev if user provided error component */ ); }; if (suspensible && instance.suspense || isInSSRComponentSetup) { return load().then((comp2) => { return () => createInnerComp(comp2, instance); }).catch((err) => { onError(err); return () => errorComponent ? createVNode(errorComponent, { error: err }) : null; }); } const loaded = ref(false); const error2 = ref(); const delayed = ref(!!delay); if (delay) { setTimeout(() => { delayed.value = false; }, delay); } if (timeout != null) { setTimeout(() => { if (!loaded.value && !error2.value) { const err = new Error(`Async component timed out after ${timeout}ms.`); onError(err); error2.value = err; } }, timeout); } load().then(() => { loaded.value = true; if (instance.parent && isKeepAlive(instance.parent.vnode)) { queueJob(instance.parent.update); } }).catch((err) => { onError(err); error2.value = err; }); return () => { if (loaded.value && resolvedComp) { return createInnerComp(resolvedComp, instance); } else if (error2.value && errorComponent) { return createVNode(errorComponent, { error: error2.value }); } else if (loadingComponent && !delayed.value) { return createVNode(loadingComponent); } }; } }); } function createInnerComp(comp2, parent) { const { ref: ref2, props, children, ce } = parent.vnode; const vnode = createVNode(comp2, props, children); vnode.ref = ref2; vnode.ce = ce; delete parent.vnode.ce; return vnode; } const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; const KeepAliveImpl = { name: `KeepAlive`, // Marker for special handling inside the renderer. We are not using a === // check directly on KeepAlive in the renderer, because importing it directly // would prevent it from being tree-shaken. __isKeepAlive: true, props: { include: [String, RegExp, Array], exclude: [String, RegExp, Array], max: [String, Number] }, setup(props, { slots }) { const instance = getCurrentInstance(); const sharedContext = instance.ctx; if (!sharedContext.renderer) { return () => { const children = slots.default && slots.default(); return children && children.length === 1 ? children[0] : children; }; } const cache2 = /* @__PURE__ */ new Map(); const keys = /* @__PURE__ */ new Set(); let current = null; const parentSuspense = instance.suspense; const { renderer: { p: patch, m: move, um: _unmount, o: { createElement } } } = sharedContext; const storageContainer = createElement("div"); sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => { const instance2 = vnode.component; move(vnode, container, anchor, 0, parentSuspense); patch(instance2.vnode, vnode, container, anchor, instance2, parentSuspense, isSVG, vnode.slotScopeIds, optimized); queuePostRenderEffect(() => { instance2.isDeactivated = false; if (instance2.a) { invokeArrayFns(instance2.a); } const vnodeHook = vnode.props && vnode.props.onVnodeMounted; if (vnodeHook) { invokeVNodeHook(vnodeHook, instance2.parent, vnode); } }, parentSuspense); }; sharedContext.deactivate = (vnode) => { const instance2 = vnode.component; move(vnode, storageContainer, null, 1, parentSuspense); queuePostRenderEffect(() => { if (instance2.da) { invokeArrayFns(instance2.da); } const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; if (vnodeHook) { invokeVNodeHook(vnodeHook, instance2.parent, vnode); } instance2.isDeactivated = true; }, parentSuspense); }; function unmount(vnode) { resetShapeFlag(vnode); _unmount(vnode, instance, parentSuspense, true); } function pruneCache(filter) { cache2.forEach((vnode, key) => { const name2 = getComponentName(vnode.type); if (name2 && (!filter || !filter(name2))) { pruneCacheEntry(key); } }); } function pruneCacheEntry(key) { const cached = cache2.get(key); if (!current || !isSameVNodeType(cached, current)) { unmount(cached); } else if (current) { resetShapeFlag(current); } cache2.delete(key); keys.delete(key); } watch( () => [props.include, props.exclude], ([include, exclude]) => { include && pruneCache((name2) => matches$1(include, name2)); exclude && pruneCache((name2) => !matches$1(exclude, name2)); }, // prune post-render after `current` has been updated { flush: "post", deep: true } ); let pendingCacheKey = null; const cacheSubtree = () => { if (pendingCacheKey != null) { cache2.set(pendingCacheKey, getInnerChild(instance.subTree)); } }; onMounted(cacheSubtree); onUpdated(cacheSubtree); onBeforeUnmount(() => { cache2.forEach((cached) => { const { subTree, suspense } = instance; const vnode = getInnerChild(subTree); if (cached.type === vnode.type && cached.key === vnode.key) { resetShapeFlag(vnode); const da = vnode.component.da; da && queuePostRenderEffect(da, suspense); return; } unmount(cached); }); }); return () => { pendingCacheKey = null; if (!slots.default) { return null; } const children = slots.default(); const rawVNode = children[0]; if (children.length > 1) { current = null; return children; } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { current = null; return rawVNode; } let vnode = getInnerChild(rawVNode); const comp2 = vnode.type; const name2 = getComponentName(isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp2); const { include, exclude, max: max2 } = props; if (include && (!name2 || !matches$1(include, name2)) || exclude && name2 && matches$1(exclude, name2)) { current = vnode; return rawVNode; } const key = vnode.key == null ? comp2 : vnode.key; const cachedVNode = cache2.get(key); if (vnode.el) { vnode = cloneVNode(vnode); if (rawVNode.shapeFlag & 128) { rawVNode.ssContent = vnode; } } pendingCacheKey = key; if (cachedVNode) { vnode.el = cachedVNode.el; vnode.component = cachedVNode.component; if (vnode.transition) { setTransitionHooks(vnode, vnode.transition); } vnode.shapeFlag |= 512; keys.delete(key); keys.add(key); } else { keys.add(key); if (max2 && keys.size > parseInt(max2, 10)) { pruneCacheEntry(keys.values().next().value); } } vnode.shapeFlag |= 256; current = vnode; return isSuspense(rawVNode.type) ? rawVNode : vnode; }; } }; const KeepAlive = KeepAliveImpl; function matches$1(pattern, name2) { if (isArray$1(pattern)) { return pattern.some((p2) => matches$1(p2, name2)); } else if (isString$4(pattern)) { return pattern.split(",").includes(name2); } else if (isRegExp$2(pattern)) { return pattern.test(name2); } return false; } function onActivated(hook, target2) { registerKeepAliveHook(hook, "a", target2); } function onDeactivated(hook, target2) { registerKeepAliveHook(hook, "da", target2); } function registerKeepAliveHook(hook, type2, target2 = currentInstance) { const wrappedHook = hook.__wdc || (hook.__wdc = () => { let current = target2; while (current) { if (current.isDeactivated) { return; } current = current.parent; } return hook(); }); injectHook(type2, wrappedHook, target2); if (target2) { let current = target2.parent; while (current && current.parent) { if (isKeepAlive(current.parent.vnode)) { injectToKeepAliveRoot(wrappedHook, type2, target2, current); } current = current.parent; } } } function injectToKeepAliveRoot(hook, type2, target2, keepAliveRoot) { const injected = injectHook( type2, hook, keepAliveRoot, true /* prepend */ ); onUnmounted(() => { remove(keepAliveRoot[type2], injected); }, target2); } function resetShapeFlag(vnode) { vnode.shapeFlag &= ~256; vnode.shapeFlag &= ~512; } function getInnerChild(vnode) { return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; } function injectHook(type2, hook, target2 = currentInstance, prepend = false) { if (target2) { const hooks = target2[type2] || (target2[type2] = []); const wrappedHook = hook.__weh || (hook.__weh = (...args) => { if (target2.isUnmounted) { return; } pauseTracking(); setCurrentInstance(target2); const res = callWithAsyncErrorHandling(hook, target2, type2, args); unsetCurrentInstance(); resetTracking(); return res; }); if (prepend) { hooks.unshift(wrappedHook); } else { hooks.push(wrappedHook); } return wrappedHook; } } const createHook = (lifecycle) => (hook, target2 = currentInstance) => ( // post-create lifecycle registrations are noops during SSR (except for serverPrefetch) (!isInSSRComponentSetup || lifecycle === "sp") && injectHook(lifecycle, (...args) => hook(...args), target2) ); const onBeforeMount = createHook( "bm" /* LifecycleHooks.BEFORE_MOUNT */ ); const onMounted = createHook( "m" /* LifecycleHooks.MOUNTED */ ); const onBeforeUpdate = createHook( "bu" /* LifecycleHooks.BEFORE_UPDATE */ ); const onUpdated = createHook( "u" /* LifecycleHooks.UPDATED */ ); const onBeforeUnmount = createHook( "bum" /* LifecycleHooks.BEFORE_UNMOUNT */ ); const onUnmounted = createHook( "um" /* LifecycleHooks.UNMOUNTED */ ); const onServerPrefetch = createHook( "sp" /* LifecycleHooks.SERVER_PREFETCH */ ); const onRenderTriggered = createHook( "rtg" /* LifecycleHooks.RENDER_TRIGGERED */ ); const onRenderTracked = createHook( "rtc" /* LifecycleHooks.RENDER_TRACKED */ ); function onErrorCaptured(hook, target2 = currentInstance) { injectHook("ec", hook, target2); } function withDirectives(vnode, directives) { const internalInstance = currentRenderingInstance; if (internalInstance === null) { return vnode; } const instance = getExposeProxy(internalInstance) || internalInstance.proxy; const bindings = vnode.dirs || (vnode.dirs = []); for (let i2 = 0; i2 < directives.length; i2++) { let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i2]; if (dir) { if (isFunction$3(dir)) { dir = { mounted: dir, updated: dir }; } if (dir.deep) { traverse(value); } bindings.push({ dir, instance, value, oldValue: void 0, arg, modifiers }); } } return vnode; } function invokeDirectiveHook(vnode, prevVNode, instance, name2) { const bindings = vnode.dirs; const oldBindings = prevVNode && prevVNode.dirs; for (let i2 = 0; i2 < bindings.length; i2++) { const binding = bindings[i2]; if (oldBindings) { binding.oldValue = oldBindings[i2].value; } let hook = binding.dir[name2]; if (hook) { pauseTracking(); callWithAsyncErrorHandling(hook, instance, 8, [ vnode.el, binding, vnode, prevVNode ]); resetTracking(); } } } const COMPONENTS = "components"; const DIRECTIVES = "directives"; function resolveComponent(name2, maybeSelfReference) { return resolveAsset(COMPONENTS, name2, true, maybeSelfReference) || name2; } const NULL_DYNAMIC_COMPONENT = Symbol(); function resolveDynamicComponent(component) { if (isString$4(component)) { return resolveAsset(COMPONENTS, component, false) || component; } else { return component || NULL_DYNAMIC_COMPONENT; } } function resolveDirective(name2) { return resolveAsset(DIRECTIVES, name2); } function resolveAsset(type2, name2, warnMissing = true, maybeSelfReference = false) { const instance = currentRenderingInstance || currentInstance; if (instance) { const Component = instance.type; if (type2 === COMPONENTS) { const selfName = getComponentName( Component, false /* do not include inferred name to avoid breaking existing code */ ); if (selfName && (selfName === name2 || selfName === camelize(name2) || selfName === capitalize$1(camelize(name2)))) { return Component; } } const res = ( // local registration // check instance[type] first which is resolved for options API resolve(instance[type2] || Component[type2], name2) || // global registration resolve(instance.appContext[type2], name2) ); if (!res && maybeSelfReference) { return Component; } return res; } } function resolve(registry, name2) { return registry && (registry[name2] || registry[camelize(name2)] || registry[capitalize$1(camelize(name2))]); } function renderList(source, renderItem, cache2, index2) { let ret; const cached = cache2 && cache2[index2]; if (isArray$1(source) || isString$4(source)) { ret = new Array(source.length); for (let i2 = 0, l2 = source.length; i2 < l2; i2++) { ret[i2] = renderItem(source[i2], i2, void 0, cached && cached[i2]); } } else if (typeof source === "number") { ret = new Array(source); for (let i2 = 0; i2 < source; i2++) { ret[i2] = renderItem(i2 + 1, i2, void 0, cached && cached[i2]); } } else if (isObject$4(source)) { if (source[Symbol.iterator]) { ret = Array.from(source, (item, i2) => renderItem(item, i2, void 0, cached && cached[i2])); } else { const keys = Object.keys(source); ret = new Array(keys.length); for (let i2 = 0, l2 = keys.length; i2 < l2; i2++) { const key = keys[i2]; ret[i2] = renderItem(source[key], key, i2, cached && cached[i2]); } } } else { ret = []; } if (cache2) { cache2[index2] = ret; } return ret; } function createSlots(slots, dynamicSlots) { for (let i2 = 0; i2 < dynamicSlots.length; i2++) { const slot = dynamicSlots[i2]; if (isArray$1(slot)) { for (let j = 0; j < slot.length; j++) { slots[slot[j].name] = slot[j].fn; } } else if (slot) { slots[slot.name] = slot.key ? (...args) => { const res = slot.fn(...args); if (res) res.key = slot.key; return res; } : slot.fn; } } return slots; } function renderSlot(slots, name2, props = {}, fallback, noSlotted) { if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) { if (name2 !== "default") props.name = name2; return createVNode("slot", props, fallback && fallback()); } let slot = slots[name2]; if (slot && slot._c) { slot._d = false; } openBlock(); const validSlotContent = slot && ensureValidVNode(slot(props)); const rendered = createBlock( Fragment, { key: props.key || // slot content array of a dynamic conditional slot may have a branch // key attached in the `createSlots` helper, respect that validSlotContent && validSlotContent.key || `_${name2}` }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2 /* PatchFlags.BAIL */ ); if (!noSlotted && rendered.scopeId) { rendered.slotScopeIds = [rendered.scopeId + "-s"]; } if (slot && slot._c) { slot._d = true; } return rendered; } function ensureValidVNode(vnodes) { return vnodes.some((child) => { if (!isVNode(child)) return true; if (child.type === Comment) return false; if (child.type === Fragment && !ensureValidVNode(child.children)) return false; return true; }) ? vnodes : null; } function toHandlers(obj, preserveCaseIfNecessary) { const ret = {}; for (const key in obj) { ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key]; } return ret; } const getPublicInstance = (i2) => { if (!i2) return null; if (isStatefulComponent(i2)) return getExposeProxy(i2) || i2.proxy; return getPublicInstance(i2.parent); }; const publicPropertiesMap = ( // Move PURE marker to new line to workaround compiler discarding it // due to type annotation /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), { $: (i2) => i2, $el: (i2) => i2.vnode.el, $data: (i2) => i2.data, $props: (i2) => i2.props, $attrs: (i2) => i2.attrs, $slots: (i2) => i2.slots, $refs: (i2) => i2.refs, $parent: (i2) => getPublicInstance(i2.parent), $root: (i2) => getPublicInstance(i2.root), $emit: (i2) => i2.emit, $options: (i2) => resolveMergedOptions(i2), $forceUpdate: (i2) => i2.f || (i2.f = () => queueJob(i2.update)), $nextTick: (i2) => i2.n || (i2.n = nextTick.bind(i2.proxy)), $watch: (i2) => instanceWatch.bind(i2) }) ); const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$1(state, key); const PublicInstanceProxyHandlers = { get({ _: instance }, key) { const { ctx, setupState, data, props, accessCache, type: type2, appContext } = instance; let normalizedProps; if (key[0] !== "$") { const n = accessCache[key]; if (n !== void 0) { switch (n) { case 1: return setupState[key]; case 2: return data[key]; case 4: return ctx[key]; case 3: return props[key]; } } else if (hasSetupBinding(setupState, key)) { accessCache[key] = 1; return setupState[key]; } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) { accessCache[key] = 2; return data[key]; } else if ( // only cache other properties when instance has declared (thus stable) // props (normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key) ) { accessCache[key] = 3; return props[key]; } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) { accessCache[key] = 4; return ctx[key]; } else if (shouldCacheAccess) { accessCache[key] = 0; } } const publicGetter = publicPropertiesMap[key]; let cssModule, globalProperties; if (publicGetter) { if (key === "$attrs") { track(instance, "get", key); } return publicGetter(instance); } else if ( // css module (injected by vue-loader) (cssModule = type2.__cssModules) && (cssModule = cssModule[key]) ) { return cssModule; } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) { accessCache[key] = 4; return ctx[key]; } else if ( // global properties globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key) ) { { return globalProperties[key]; } } else ; }, set({ _: instance }, key, value) { const { data, setupState, ctx } = instance; if (hasSetupBinding(setupState, key)) { setupState[key] = value; return true; } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) { data[key] = value; return true; } else if (hasOwn$1(instance.props, key)) { return false; } if (key[0] === "$" && key.slice(1) in instance) { return false; } else { { ctx[key] = value; } } return true; }, has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) { let normalizedProps; return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn$1(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn$1(normalizedProps, key) || hasOwn$1(ctx, key) || hasOwn$1(publicPropertiesMap, key) || hasOwn$1(appContext.config.globalProperties, key); }, defineProperty(target2, key, descriptor) { if (descriptor.get != null) { target2._.accessCache[key] = 0; } else if (hasOwn$1(descriptor, "value")) { this.set(target2, key, descriptor.value, null); } return Reflect.defineProperty(target2, key, descriptor); } }; const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, { get(target2, key) { if (key === Symbol.unscopables) { return; } return PublicInstanceProxyHandlers.get(target2, key, target2); }, has(_2, key) { const has2 = key[0] !== "_" && !isGloballyWhitelisted(key); return has2; } }); let shouldCacheAccess = true; function applyOptions(instance) { const options2 = resolveMergedOptions(instance); const publicThis = instance.proxy; const ctx = instance.ctx; shouldCacheAccess = false; if (options2.beforeCreate) { callHook$1( options2.beforeCreate, instance, "bc" /* LifecycleHooks.BEFORE_CREATE */ ); } const { // state data: dataOptions, computed: computedOptions, methods, watch: watchOptions, provide: provideOptions, inject: injectOptions, // lifecycle created, beforeMount, mounted, beforeUpdate, updated, activated, deactivated, beforeDestroy, beforeUnmount, destroyed, unmounted, render: render2, renderTracked, renderTriggered, errorCaptured, serverPrefetch, // public API expose, inheritAttrs, // assets components, directives, filters } = options2; const checkDuplicateProperties = null; if (injectOptions) { resolveInjections(injectOptions, ctx, checkDuplicateProperties, instance.appContext.config.unwrapInjectedRef); } if (methods) { for (const key in methods) { const methodHandler = methods[key]; if (isFunction$3(methodHandler)) { { ctx[key] = methodHandler.bind(publicThis); } } } } if (dataOptions) { const data = dataOptions.call(publicThis, publicThis); if (!isObject$4(data)) ; else { instance.data = reactive(data); } } shouldCacheAccess = true; if (computedOptions) { for (const key in computedOptions) { const opt = computedOptions[key]; const get2 = isFunction$3(opt) ? opt.bind(publicThis, publicThis) : isFunction$3(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP; const set3 = !isFunction$3(opt) && isFunction$3(opt.set) ? opt.set.bind(publicThis) : NOOP; const c2 = computed({ get: get2, set: set3 }); Object.defineProperty(ctx, key, { enumerable: true, configurable: true, get: () => c2.value, set: (v) => c2.value = v }); } } if (watchOptions) { for (const key in watchOptions) { createWatcher(watchOptions[key], ctx, publicThis, key); } } if (provideOptions) { const provides = isFunction$3(provideOptions) ? provideOptions.call(publicThis) : provideOptions; Reflect.ownKeys(provides).forEach((key) => { provide(key, provides[key]); }); } if (created) { callHook$1( created, instance, "c" /* LifecycleHooks.CREATED */ ); } function registerLifecycleHook(register, hook) { if (isArray$1(hook)) { hook.forEach((_hook) => register(_hook.bind(publicThis))); } else if (hook) { register(hook.bind(publicThis)); } } registerLifecycleHook(onBeforeMount, beforeMount); registerLifecycleHook(onMounted, mounted); registerLifecycleHook(onBeforeUpdate, beforeUpdate); registerLifecycleHook(onUpdated, updated); registerLifecycleHook(onActivated, activated); registerLifecycleHook(onDeactivated, deactivated); registerLifecycleHook(onErrorCaptured, errorCaptured); registerLifecycleHook(onRenderTracked, renderTracked); registerLifecycleHook(onRenderTriggered, renderTriggered); registerLifecycleHook(onBeforeUnmount, beforeUnmount); registerLifecycleHook(onUnmounted, unmounted); registerLifecycleHook(onServerPrefetch, serverPrefetch); if (isArray$1(expose)) { if (expose.length) { const exposed = instance.exposed || (instance.exposed = {}); expose.forEach((key) => { Object.defineProperty(exposed, key, { get: () => publicThis[key], set: (val) => publicThis[key] = val }); }); } else if (!instance.exposed) { instance.exposed = {}; } } if (render2 && instance.render === NOOP) { instance.render = render2; } if (inheritAttrs != null) { instance.inheritAttrs = inheritAttrs; } if (components) instance.components = components; if (directives) instance.directives = directives; } function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP, unwrapRef = false) { if (isArray$1(injectOptions)) { injectOptions = normalizeInject(injectOptions); } for (const key in injectOptions) { const opt = injectOptions[key]; let injected; if (isObject$4(opt)) { if ("default" in opt) { injected = inject( opt.from || key, opt.default, true /* treat default function as factory */ ); } else { injected = inject(opt.from || key); } } else { injected = inject(opt); } if (isRef(injected)) { if (unwrapRef) { Object.defineProperty(ctx, key, { enumerable: true, configurable: true, get: () => injected.value, set: (v) => injected.value = v }); } else { ctx[key] = injected; } } else { ctx[key] = injected; } } } function callHook$1(hook, instance, type2) { callWithAsyncErrorHandling(isArray$1(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type2); } function createWatcher(raw, ctx, publicThis, key) { const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; if (isString$4(raw)) { const handler = ctx[raw]; if (isFunction$3(handler)) { watch(getter, handler); } } else if (isFunction$3(raw)) { watch(getter, raw.bind(publicThis)); } else if (isObject$4(raw)) { if (isArray$1(raw)) { raw.forEach((r2) => createWatcher(r2, ctx, publicThis, key)); } else { const handler = isFunction$3(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; if (isFunction$3(handler)) { watch(getter, handler, raw); } } } else ; } function resolveMergedOptions(instance) { const base2 = instance.type; const { mixins, extends: extendsOptions } = base2; const { mixins: globalMixins, optionsCache: cache2, config: { optionMergeStrategies } } = instance.appContext; const cached = cache2.get(base2); let resolved; if (cached) { resolved = cached; } else if (!globalMixins.length && !mixins && !extendsOptions) { { resolved = base2; } } else { resolved = {}; if (globalMixins.length) { globalMixins.forEach((m2) => mergeOptions(resolved, m2, optionMergeStrategies, true)); } mergeOptions(resolved, base2, optionMergeStrategies); } if (isObject$4(base2)) { cache2.set(base2, resolved); } return resolved; } function mergeOptions(to, from, strats, asMixin = false) { const { mixins, extends: extendsOptions } = from; if (extendsOptions) { mergeOptions(to, extendsOptions, strats, true); } if (mixins) { mixins.forEach((m2) => mergeOptions(to, m2, strats, true)); } for (const key in from) { if (asMixin && key === "expose") ; else { const strat = internalOptionMergeStrats[key] || strats && strats[key]; to[key] = strat ? strat(to[key], from[key]) : from[key]; } } return to; } const internalOptionMergeStrats = { data: mergeDataFn, props: mergeObjectOptions, emits: mergeObjectOptions, // objects methods: mergeObjectOptions, computed: mergeObjectOptions, // lifecycle beforeCreate: mergeAsArray, created: mergeAsArray, beforeMount: mergeAsArray, mounted: mergeAsArray, beforeUpdate: mergeAsArray, updated: mergeAsArray, beforeDestroy: mergeAsArray, beforeUnmount: mergeAsArray, destroyed: mergeAsArray, unmounted: mergeAsArray, activated: mergeAsArray, deactivated: mergeAsArray, errorCaptured: mergeAsArray, serverPrefetch: mergeAsArray, // assets components: mergeObjectOptions, directives: mergeObjectOptions, // watch watch: mergeWatchOptions, // provide / inject provide: mergeDataFn, inject: mergeInject }; function mergeDataFn(to, from) { if (!from) { return to; } if (!to) { return from; } return function mergedDataFn() { return extend(isFunction$3(to) ? to.call(this, this) : to, isFunction$3(from) ? from.call(this, this) : from); }; } function mergeInject(to, from) { return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); } function normalizeInject(raw) { if (isArray$1(raw)) { const res = {}; for (let i2 = 0; i2 < raw.length; i2++) { res[raw[i2]] = raw[i2]; } return res; } return raw; } function mergeAsArray(to, from) { return to ? [...new Set([].concat(to, from))] : from; } function mergeObjectOptions(to, from) { return to ? extend(extend(/* @__PURE__ */ Object.create(null), to), from) : from; } function mergeWatchOptions(to, from) { if (!to) return from; if (!from) return to; const merged = extend(/* @__PURE__ */ Object.create(null), to); for (const key in from) { merged[key] = mergeAsArray(to[key], from[key]); } return merged; } function initProps(instance, rawProps, isStateful, isSSR = false) { const props = {}; const attrs = {}; def(attrs, InternalObjectKey, 1); instance.propsDefaults = /* @__PURE__ */ Object.create(null); setFullProps(instance, rawProps, props, attrs); for (const key in instance.propsOptions[0]) { if (!(key in props)) { props[key] = void 0; } } if (isStateful) { instance.props = isSSR ? props : shallowReactive(props); } else { if (!instance.type.props) { instance.props = attrs; } else { instance.props = props; } } instance.attrs = attrs; } function updateProps(instance, rawProps, rawPrevProps, optimized) { const { props, attrs, vnode: { patchFlag } } = instance; const rawCurrentProps = toRaw(props); const [options2] = instance.propsOptions; let hasAttrsChanged = false; if ( // always force full diff in dev // - #1942 if hmr is enabled with sfc component // - vite#872 non-sfc component used by sfc component (optimized || patchFlag > 0) && !(patchFlag & 16) ) { if (patchFlag & 8) { const propsToUpdate = instance.vnode.dynamicProps; for (let i2 = 0; i2 < propsToUpdate.length; i2++) { let key = propsToUpdate[i2]; if (isEmitListener(instance.emitsOptions, key)) { continue; } const value = rawProps[key]; if (options2) { if (hasOwn$1(attrs, key)) { if (value !== attrs[key]) { attrs[key] = value; hasAttrsChanged = true; } } else { const camelizedKey = camelize(key); props[camelizedKey] = resolvePropValue( options2, rawCurrentProps, camelizedKey, value, instance, false /* isAbsent */ ); } } else { if (value !== attrs[key]) { attrs[key] = value; hasAttrsChanged = true; } } } } } else { if (setFullProps(instance, rawProps, props, attrs)) { hasAttrsChanged = true; } let kebabKey; for (const key in rawCurrentProps) { if (!rawProps || // for camelCase !hasOwn$1(rawProps, key) && // it's possible the original props was passed in as kebab-case // and converted to camelCase (#955) ((kebabKey = hyphenate(key)) === key || !hasOwn$1(rawProps, kebabKey))) { if (options2) { if (rawPrevProps && // for camelCase (rawPrevProps[key] !== void 0 || // for kebab-case rawPrevProps[kebabKey] !== void 0)) { props[key] = resolvePropValue( options2, rawCurrentProps, key, void 0, instance, true /* isAbsent */ ); } } else { delete props[key]; } } } if (attrs !== rawCurrentProps) { for (const key in attrs) { if (!rawProps || !hasOwn$1(rawProps, key) && true) { delete attrs[key]; hasAttrsChanged = true; } } } } if (hasAttrsChanged) { trigger(instance, "set", "$attrs"); } } function setFullProps(instance, rawProps, props, attrs) { const [options2, needCastKeys] = instance.propsOptions; let hasAttrsChanged = false; let rawCastValues; if (rawProps) { for (let key in rawProps) { if (isReservedProp(key)) { continue; } const value = rawProps[key]; let camelKey; if (options2 && hasOwn$1(options2, camelKey = camelize(key))) { if (!needCastKeys || !needCastKeys.includes(camelKey)) { props[camelKey] = value; } else { (rawCastValues || (rawCastValues = {}))[camelKey] = value; } } else if (!isEmitListener(instance.emitsOptions, key)) { if (!(key in attrs) || value !== attrs[key]) { attrs[key] = value; hasAttrsChanged = true; } } } } if (needCastKeys) { const rawCurrentProps = toRaw(props); const castValues = rawCastValues || EMPTY_OBJ; for (let i2 = 0; i2 < needCastKeys.length; i2++) { const key = needCastKeys[i2]; props[key] = resolvePropValue(options2, rawCurrentProps, key, castValues[key], instance, !hasOwn$1(castValues, key)); } } return hasAttrsChanged; } function resolvePropValue(options2, props, key, value, instance, isAbsent) { const opt = options2[key]; if (opt != null) { const hasDefault = hasOwn$1(opt, "default"); if (hasDefault && value === void 0) { const defaultValue = opt.default; if (opt.type !== Function && isFunction$3(defaultValue)) { const { propsDefaults } = instance; if (key in propsDefaults) { value = propsDefaults[key]; } else { setCurrentInstance(instance); value = propsDefaults[key] = defaultValue.call(null, props); unsetCurrentInstance(); } } else { value = defaultValue; } } if (opt[ 0 /* BooleanFlags.shouldCast */ ]) { if (isAbsent && !hasDefault) { value = false; } else if (opt[ 1 /* BooleanFlags.shouldCastTrue */ ] && (value === "" || value === hyphenate(key))) { value = true; } } } return value; } function normalizePropsOptions(comp2, appContext, asMixin = false) { const cache2 = appContext.propsCache; const cached = cache2.get(comp2); if (cached) { return cached; } const raw = comp2.props; const normalized = {}; const needCastKeys = []; let hasExtends = false; if (!isFunction$3(comp2)) { const extendProps = (raw2) => { hasExtends = true; const [props, keys] = normalizePropsOptions(raw2, appContext, true); extend(normalized, props); if (keys) needCastKeys.push(...keys); }; if (!asMixin && appContext.mixins.length) { appContext.mixins.forEach(extendProps); } if (comp2.extends) { extendProps(comp2.extends); } if (comp2.mixins) { comp2.mixins.forEach(extendProps); } } if (!raw && !hasExtends) { if (isObject$4(comp2)) { cache2.set(comp2, EMPTY_ARR); } return EMPTY_ARR; } if (isArray$1(raw)) { for (let i2 = 0; i2 < raw.length; i2++) { const normalizedKey = camelize(raw[i2]); if (validatePropName(normalizedKey)) { normalized[normalizedKey] = EMPTY_OBJ; } } } else if (raw) { for (const key in raw) { const normalizedKey = camelize(key); if (validatePropName(normalizedKey)) { const opt = raw[key]; const prop2 = normalized[normalizedKey] = isArray$1(opt) || isFunction$3(opt) ? { type: opt } : Object.assign({}, opt); if (prop2) { const booleanIndex = getTypeIndex(Boolean, prop2.type); const stringIndex = getTypeIndex(String, prop2.type); prop2[ 0 /* BooleanFlags.shouldCast */ ] = booleanIndex > -1; prop2[ 1 /* BooleanFlags.shouldCastTrue */ ] = stringIndex < 0 || booleanIndex < stringIndex; if (booleanIndex > -1 || hasOwn$1(prop2, "default")) { needCastKeys.push(normalizedKey); } } } } } const res = [normalized, needCastKeys]; if (isObject$4(comp2)) { cache2.set(comp2, res); } return res; } function validatePropName(key) { if (key[0] !== "$") { return true; } return false; } function getType(ctor) { const match3 = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/); return match3 ? match3[2] : ctor === null ? "null" : ""; } function isSameType(a2, b2) { return getType(a2) === getType(b2); } function getTypeIndex(type2, expectedTypes) { if (isArray$1(expectedTypes)) { return expectedTypes.findIndex((t2) => isSameType(t2, type2)); } else if (isFunction$3(expectedTypes)) { return isSameType(expectedTypes, type2) ? 0 : -1; } return -1; } const isInternalKey = (key) => key[0] === "_" || key === "$stable"; const normalizeSlotValue = (value) => isArray$1(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; const normalizeSlot = (key, rawSlot, ctx) => { if (rawSlot._n) { return rawSlot; } const normalized = withCtx((...args) => { if (false) ; return normalizeSlotValue(rawSlot(...args)); }, ctx); normalized._c = false; return normalized; }; const normalizeObjectSlots = (rawSlots, slots, instance) => { const ctx = rawSlots._ctx; for (const key in rawSlots) { if (isInternalKey(key)) continue; const value = rawSlots[key]; if (isFunction$3(value)) { slots[key] = normalizeSlot(key, value, ctx); } else if (value != null) { const normalized = normalizeSlotValue(value); slots[key] = () => normalized; } } }; const normalizeVNodeSlots = (instance, children) => { const normalized = normalizeSlotValue(children); instance.slots.default = () => normalized; }; const initSlots = (instance, children) => { if (instance.vnode.shapeFlag & 32) { const type2 = children._; if (type2) { instance.slots = toRaw(children); def(children, "_", type2); } else { normalizeObjectSlots(children, instance.slots = {}); } } else { instance.slots = {}; if (children) { normalizeVNodeSlots(instance, children); } } def(instance.slots, InternalObjectKey, 1); }; const updateSlots = (instance, children, optimized) => { const { vnode, slots } = instance; let needDeletionCheck = true; let deletionComparisonTarget = EMPTY_OBJ; if (vnode.shapeFlag & 32) { const type2 = children._; if (type2) { if (optimized && type2 === 1) { needDeletionCheck = false; } else { extend(slots, children); if (!optimized && type2 === 1) { delete slots._; } } } else { needDeletionCheck = !children.$stable; normalizeObjectSlots(children, slots); } deletionComparisonTarget = children; } else if (children) { normalizeVNodeSlots(instance, children); deletionComparisonTarget = { default: 1 }; } if (needDeletionCheck) { for (const key in slots) { if (!isInternalKey(key) && !(key in deletionComparisonTarget)) { delete slots[key]; } } } }; function createAppContext() { return { app: null, config: { isNativeTag: NO, performance: false, globalProperties: {}, optionMergeStrategies: {}, errorHandler: void 0, warnHandler: void 0, compilerOptions: {} }, mixins: [], components: {}, directives: {}, provides: /* @__PURE__ */ Object.create(null), optionsCache: /* @__PURE__ */ new WeakMap(), propsCache: /* @__PURE__ */ new WeakMap(), emitsCache: /* @__PURE__ */ new WeakMap() }; } let uid$1 = 0; function createAppAPI(render2, hydrate2) { return function createApp2(rootComponent, rootProps = null) { if (!isFunction$3(rootComponent)) { rootComponent = Object.assign({}, rootComponent); } if (rootProps != null && !isObject$4(rootProps)) { rootProps = null; } const context = createAppContext(); const installedPlugins = /* @__PURE__ */ new Set(); let isMounted = false; const app2 = context.app = { _uid: uid$1++, _component: rootComponent, _props: rootProps, _container: null, _context: context, _instance: null, version: version$9, get config() { return context.config; }, set config(v) { }, use(plugin, ...options2) { if (installedPlugins.has(plugin)) ; else if (plugin && isFunction$3(plugin.install)) { installedPlugins.add(plugin); plugin.install(app2, ...options2); } else if (isFunction$3(plugin)) { installedPlugins.add(plugin); plugin(app2, ...options2); } else ; return app2; }, mixin(mixin) { { if (!context.mixins.includes(mixin)) { context.mixins.push(mixin); } } return app2; }, component(name2, component) { if (!component) { return context.components[name2]; } context.components[name2] = component; return app2; }, directive(name2, directive) { if (!directive) { return context.directives[name2]; } context.directives[name2] = directive; return app2; }, mount(rootContainer, isHydrate, isSVG) { if (!isMounted) { const vnode = createVNode(rootComponent, rootProps); vnode.appContext = context; if (isHydrate && hydrate2) { hydrate2(vnode, rootContainer); } else { render2(vnode, rootContainer, isSVG); } isMounted = true; app2._container = rootContainer; rootContainer.__vue_app__ = app2; return getExposeProxy(vnode.component) || vnode.component.proxy; } }, unmount() { if (isMounted) { render2(null, app2._container); delete app2._container.__vue_app__; } }, provide(key, value) { context.provides[key] = value; return app2; } }; return app2; }; } function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { if (isArray$1(rawRef)) { rawRef.forEach((r2, i2) => setRef(r2, oldRawRef && (isArray$1(oldRawRef) ? oldRawRef[i2] : oldRawRef), parentSuspense, vnode, isUnmount)); return; } if (isAsyncWrapper(vnode) && !isUnmount) { return; } const refValue = vnode.shapeFlag & 4 ? getExposeProxy(vnode.component) || vnode.component.proxy : vnode.el; const value = isUnmount ? null : refValue; const { i: owner, r: ref2 } = rawRef; const oldRef = oldRawRef && oldRawRef.r; const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; const setupState = owner.setupState; if (oldRef != null && oldRef !== ref2) { if (isString$4(oldRef)) { refs[oldRef] = null; if (hasOwn$1(setupState, oldRef)) { setupState[oldRef] = null; } } else if (isRef(oldRef)) { oldRef.value = null; } } if (isFunction$3(ref2)) { callWithErrorHandling(ref2, owner, 12, [value, refs]); } else { const _isString = isString$4(ref2); const _isRef = isRef(ref2); if (_isString || _isRef) { const doSet = () => { if (rawRef.f) { const existing = _isString ? hasOwn$1(setupState, ref2) ? setupState[ref2] : refs[ref2] : ref2.value; if (isUnmount) { isArray$1(existing) && remove(existing, refValue); } else { if (!isArray$1(existing)) { if (_isString) { refs[ref2] = [refValue]; if (hasOwn$1(setupState, ref2)) { setupState[ref2] = refs[ref2]; } } else { ref2.value = [refValue]; if (rawRef.k) refs[rawRef.k] = ref2.value; } } else if (!existing.includes(refValue)) { existing.push(refValue); } } } else if (_isString) { refs[ref2] = value; if (hasOwn$1(setupState, ref2)) { setupState[ref2] = value; } } else if (_isRef) { ref2.value = value; if (rawRef.k) refs[rawRef.k] = value; } else ; }; if (value) { doSet.id = -1; queuePostRenderEffect(doSet, parentSuspense); } else { doSet(); } } } } let hasMismatch = false; const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== "foreignObject"; const isComment = (node) => node.nodeType === 8; function createHydrationFunctions(rendererInternals) { const { mt: mountComponent, p: patch, o: { patchProp: patchProp2, createText, nextSibling, parentNode, remove: remove2, insert: insert2, createComment } } = rendererInternals; const hydrate2 = (vnode, container) => { if (!container.hasChildNodes()) { patch(null, vnode, container); flushPostFlushCbs(); container._vnode = vnode; return; } hasMismatch = false; hydrateNode(container.firstChild, vnode, null, null, null); flushPostFlushCbs(); container._vnode = vnode; if (hasMismatch && true) { console.error(`Hydration completed but contains mismatches.`); } }; const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { const isFragmentStart = isComment(node) && node.data === "["; const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart); const { type: type2, ref: ref2, shapeFlag, patchFlag } = vnode; let domType = node.nodeType; vnode.el = node; if (patchFlag === -2) { optimized = false; vnode.dynamicChildren = null; } let nextNode = null; switch (type2) { case Text: if (domType !== 3) { if (vnode.children === "") { insert2(vnode.el = createText(""), parentNode(node), node); nextNode = node; } else { nextNode = onMismatch(); } } else { if (node.data !== vnode.children) { hasMismatch = true; node.data = vnode.children; } nextNode = nextSibling(node); } break; case Comment: if (domType !== 8 || isFragmentStart) { nextNode = onMismatch(); } else { nextNode = nextSibling(node); } break; case Static: if (isFragmentStart) { node = nextSibling(node); domType = node.nodeType; } if (domType === 1 || domType === 3) { nextNode = node; const needToAdoptContent = !vnode.children.length; for (let i2 = 0; i2 < vnode.staticCount; i2++) { if (needToAdoptContent) vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data; if (i2 === vnode.staticCount - 1) { vnode.anchor = nextNode; } nextNode = nextSibling(nextNode); } return isFragmentStart ? nextSibling(nextNode) : nextNode; } else { onMismatch(); } break; case Fragment: if (!isFragmentStart) { nextNode = onMismatch(); } else { nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized); } break; default: if (shapeFlag & 1) { if (domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) { nextNode = onMismatch(); } else { nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized); } } else if (shapeFlag & 6) { vnode.slotScopeIds = slotScopeIds; const container = parentNode(node); mountComponent(vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container), optimized); nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node); if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") { nextNode = nextSibling(nextNode); } if (isAsyncWrapper(vnode)) { let subTree; if (isFragmentStart) { subTree = createVNode(Fragment); subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; } else { subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); } subTree.el = node; vnode.component.subTree = subTree; } } else if (shapeFlag & 64) { if (domType !== 8) { nextNode = onMismatch(); } else { nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren); } } else if (shapeFlag & 128) { nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode); } else ; } if (ref2 != null) { setRef(ref2, null, parentSuspense, vnode); } return nextNode; }; const hydrateElement = (el2, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { optimized = optimized || !!vnode.dynamicChildren; const { type: type2, props, patchFlag, shapeFlag, dirs } = vnode; const forcePatchValue = type2 === "input" && dirs || type2 === "option"; if (forcePatchValue || patchFlag !== -1) { if (dirs) { invokeDirectiveHook(vnode, null, parentComponent, "created"); } if (props) { if (forcePatchValue || !optimized || patchFlag & (16 | 32)) { for (const key in props) { if (forcePatchValue && key.endsWith("value") || isOn(key) && !isReservedProp(key)) { patchProp2(el2, key, null, props[key], false, void 0, parentComponent); } } } else if (props.onClick) { patchProp2(el2, "onClick", null, props.onClick, false, void 0, parentComponent); } } let vnodeHooks; if (vnodeHooks = props && props.onVnodeBeforeMount) { invokeVNodeHook(vnodeHooks, parentComponent, vnode); } if (dirs) { invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); } if ((vnodeHooks = props && props.onVnodeMounted) || dirs) { queueEffectWithSuspense(() => { vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); }, parentSuspense); } if (shapeFlag & 16 && // skip if element has innerHTML / textContent !(props && (props.innerHTML || props.textContent))) { let next = hydrateChildren(el2.firstChild, vnode, el2, parentComponent, parentSuspense, slotScopeIds, optimized); while (next) { hasMismatch = true; const cur = next; next = next.nextSibling; remove2(cur); } } else if (shapeFlag & 8) { if (el2.textContent !== vnode.children) { hasMismatch = true; el2.textContent = vnode.children; } } } return el2.nextSibling; }; const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { optimized = optimized || !!parentVNode.dynamicChildren; const children = parentVNode.children; const l2 = children.length; for (let i2 = 0; i2 < l2; i2++) { const vnode = optimized ? children[i2] : children[i2] = normalizeVNode(children[i2]); if (node) { node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized); } else if (vnode.type === Text && !vnode.children) { continue; } else { hasMismatch = true; patch(null, vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container), slotScopeIds); } } return node; }; const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { const { slotScopeIds: fragmentSlotScopeIds } = vnode; if (fragmentSlotScopeIds) { slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; } const container = parentNode(node); const next = hydrateChildren(nextSibling(node), vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized); if (next && isComment(next) && next.data === "]") { return nextSibling(vnode.anchor = next); } else { hasMismatch = true; insert2(vnode.anchor = createComment(`]`), container, next); return next; } }; const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { hasMismatch = true; vnode.el = null; if (isFragment) { const end = locateClosingAsyncAnchor(node); while (true) { const next2 = nextSibling(node); if (next2 && next2 !== end) { remove2(next2); } else { break; } } } const next = nextSibling(node); const container = parentNode(node); remove2(node); patch(null, vnode, container, next, parentComponent, parentSuspense, isSVGContainer(container), slotScopeIds); return next; }; const locateClosingAsyncAnchor = (node) => { let match3 = 0; while (node) { node = nextSibling(node); if (node && isComment(node)) { if (node.data === "[") match3++; if (node.data === "]") { if (match3 === 0) { return nextSibling(node); } else { match3--; } } } } return node; }; return [hydrate2, hydrateNode]; } const queuePostRenderEffect = queueEffectWithSuspense; function createRenderer(options2) { return baseCreateRenderer(options2); } function createHydrationRenderer(options2) { return baseCreateRenderer(options2, createHydrationFunctions); } function baseCreateRenderer(options2, createHydrationFns) { const target2 = getGlobalThis$1(); target2.__VUE__ = true; const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = NOOP, insertStaticContent: hostInsertStaticContent } = options2; const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = !!n2.dynamicChildren) => { if (n1 === n2) { return; } if (n1 && !isSameVNodeType(n1, n2)) { anchor = getNextHostNode(n1); unmount(n1, parentComponent, parentSuspense, true); n1 = null; } if (n2.patchFlag === -2) { optimized = false; n2.dynamicChildren = null; } const { type: type2, ref: ref2, shapeFlag } = n2; switch (type2) { case Text: processText(n1, n2, container, anchor); break; case Comment: processCommentNode(n1, n2, container, anchor); break; case Static: if (n1 == null) { mountStaticNode(n2, container, anchor, isSVG); } break; case Fragment: processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); break; default: if (shapeFlag & 1) { processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); } else if (shapeFlag & 6) { processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); } else if (shapeFlag & 64) { type2.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals); } else if (shapeFlag & 128) { type2.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals); } else ; } if (ref2 != null && parentComponent) { setRef(ref2, n1 && n1.ref, parentSuspense, n2 || n1, !n2); } }; const processText = (n1, n2, container, anchor) => { if (n1 == null) { hostInsert(n2.el = hostCreateText(n2.children), container, anchor); } else { const el2 = n2.el = n1.el; if (n2.children !== n1.children) { hostSetText(el2, n2.children); } } }; const processCommentNode = (n1, n2, container, anchor) => { if (n1 == null) { hostInsert(n2.el = hostCreateComment(n2.children || ""), container, anchor); } else { n2.el = n1.el; } }; const mountStaticNode = (n2, container, anchor, isSVG) => { [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG, n2.el, n2.anchor); }; const moveStaticNode = ({ el: el2, anchor }, container, nextSibling) => { let next; while (el2 && el2 !== anchor) { next = hostNextSibling(el2); hostInsert(el2, container, nextSibling); el2 = next; } hostInsert(anchor, container, nextSibling); }; const removeStaticNode = ({ el: el2, anchor }) => { let next; while (el2 && el2 !== anchor) { next = hostNextSibling(el2); hostRemove(el2); el2 = next; } hostRemove(anchor); }; const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { isSVG = isSVG || n2.type === "svg"; if (n1 == null) { mountElement(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); } else { patchElement(n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); } }; const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { let el2; let vnodeHook; const { type: type2, props, shapeFlag, transition, dirs } = vnode; el2 = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props); if (shapeFlag & 8) { hostSetElementText(el2, vnode.children); } else if (shapeFlag & 16) { mountChildren(vnode.children, el2, null, parentComponent, parentSuspense, isSVG && type2 !== "foreignObject", slotScopeIds, optimized); } if (dirs) { invokeDirectiveHook(vnode, null, parentComponent, "created"); } setScopeId(el2, vnode, vnode.scopeId, slotScopeIds, parentComponent); if (props) { for (const key in props) { if (key !== "value" && !isReservedProp(key)) { hostPatchProp(el2, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren); } } if ("value" in props) { hostPatchProp(el2, "value", null, props.value); } if (vnodeHook = props.onVnodeBeforeMount) { invokeVNodeHook(vnodeHook, parentComponent, vnode); } } if (dirs) { invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); } const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; if (needCallTransitionHooks) { transition.beforeEnter(el2); } hostInsert(el2, container, anchor); if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { queuePostRenderEffect(() => { vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); needCallTransitionHooks && transition.enter(el2); dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); }, parentSuspense); } }; const setScopeId = (el2, vnode, scopeId, slotScopeIds, parentComponent) => { if (scopeId) { hostSetScopeId(el2, scopeId); } if (slotScopeIds) { for (let i2 = 0; i2 < slotScopeIds.length; i2++) { hostSetScopeId(el2, slotScopeIds[i2]); } } if (parentComponent) { let subTree = parentComponent.subTree; if (vnode === subTree) { const parentVNode = parentComponent.vnode; setScopeId(el2, parentVNode, parentVNode.scopeId, parentVNode.slotScopeIds, parentComponent.parent); } } }; const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => { for (let i2 = start; i2 < children.length; i2++) { const child = children[i2] = optimized ? cloneIfMounted(children[i2]) : normalizeVNode(children[i2]); patch(null, child, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); } }; const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { const el2 = n2.el = n1.el; let { patchFlag, dynamicChildren, dirs } = n2; patchFlag |= n1.patchFlag & 16; const oldProps = n1.props || EMPTY_OBJ; const newProps = n2.props || EMPTY_OBJ; let vnodeHook; parentComponent && toggleRecurse(parentComponent, false); if (vnodeHook = newProps.onVnodeBeforeUpdate) { invokeVNodeHook(vnodeHook, parentComponent, n2, n1); } if (dirs) { invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); } parentComponent && toggleRecurse(parentComponent, true); const areChildrenSVG = isSVG && n2.type !== "foreignObject"; if (dynamicChildren) { patchBlockChildren(n1.dynamicChildren, dynamicChildren, el2, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds); } else if (!optimized) { patchChildren(n1, n2, el2, null, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds, false); } if (patchFlag > 0) { if (patchFlag & 16) { patchProps(el2, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG); } else { if (patchFlag & 2) { if (oldProps.class !== newProps.class) { hostPatchProp(el2, "class", null, newProps.class, isSVG); } } if (patchFlag & 4) { hostPatchProp(el2, "style", oldProps.style, newProps.style, isSVG); } if (patchFlag & 8) { const propsToUpdate = n2.dynamicProps; for (let i2 = 0; i2 < propsToUpdate.length; i2++) { const key = propsToUpdate[i2]; const prev2 = oldProps[key]; const next = newProps[key]; if (next !== prev2 || key === "value") { hostPatchProp(el2, key, prev2, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren); } } } } if (patchFlag & 1) { if (n1.children !== n2.children) { hostSetElementText(el2, n2.children); } } } else if (!optimized && dynamicChildren == null) { patchProps(el2, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG); } if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { queuePostRenderEffect(() => { vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); }, parentSuspense); } }; const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => { for (let i2 = 0; i2 < newChildren.length; i2++) { const oldVNode = oldChildren[i2]; const newVNode = newChildren[i2]; const container = ( // oldVNode may be an errored async setup() component inside Suspense // which will not have a mounted element oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent // of the Fragment itself so it can move its children. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement // which also requires the correct parent container !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( // In other cases, the parent container is not actually used so we // just pass the block element here to avoid a DOM parentNode call. fallbackContainer ) ); patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, true); } }; const patchProps = (el2, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => { if (oldProps !== newProps) { if (oldProps !== EMPTY_OBJ) { for (const key in oldProps) { if (!isReservedProp(key) && !(key in newProps)) { hostPatchProp(el2, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren); } } } for (const key in newProps) { if (isReservedProp(key)) continue; const next = newProps[key]; const prev2 = oldProps[key]; if (next !== prev2 && key !== "value") { hostPatchProp(el2, key, prev2, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren); } } if ("value" in newProps) { hostPatchProp(el2, "value", oldProps.value, newProps.value); } } }; const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => { const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; if (fragmentSlotScopeIds) { slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; } if (n1 == null) { hostInsert(fragmentStartAnchor, container, anchor); hostInsert(fragmentEndAnchor, container, anchor); mountChildren(n2.children, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized); } else { if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result // of renderSlot() with no valid children n1.dynamicChildren) { patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, isSVG, slotScopeIds); if ( // #2080 if the stable fragment has a key, it's a