UNPKG

@futuremeng/vue-advanced-chat

Version:

A beautiful chat rooms component made with Vue.js

1,713 lines 1.06 MB
function makeMap$2(str, expectsLowerCase) { const map = /* @__PURE__ */ Object.create(null); const list2 = str.split(","); for (let i = 0; i < list2.length; i++) { map[list2[i]] = true; } return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val]; } const NOOP$1 = () => { }; const extend$2 = Object.assign; const hasOwnProperty$3 = Object.prototype.hasOwnProperty; const hasOwn$1 = (val, key) => hasOwnProperty$3.call(val, key); const isArray$2 = Array.isArray; const isMap$1 = (val) => toTypeString$1(val) === "[object Map]"; const isFunction$2 = (val) => typeof val === "function"; const isString$2 = (val) => typeof val === "string"; const isSymbol = (val) => typeof val === "symbol"; const isObject$2 = (val) => val !== null && typeof val === "object"; const objectToString$1 = Object.prototype.toString; const toTypeString$1 = (value) => objectToString$1.call(value); const toRawType = (value) => { return toTypeString$1(value).slice(8, -1); }; const isIntegerKey = (key) => isString$2(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; const hasChanged$1 = (value, oldValue) => !Object.is(value, oldValue); const def$1 = (obj, key, value) => { Object.defineProperty(obj, key, { configurable: true, enumerable: false, value }); }; let activeEffectScope; class EffectScope { constructor(detached = false) { this.active = true; this.effects = []; this.cleanups = []; if (!detached && activeEffectScope) { this.parent = activeEffectScope; this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1; } } run(fn) { if (this.active) { const currentEffectScope = activeEffectScope; try { activeEffectScope = this; return fn(); } finally { activeEffectScope = currentEffectScope; } } } on() { activeEffectScope = this; } off() { activeEffectScope = this.parent; } stop(fromParent) { if (this.active) { let i, l; for (i = 0, l = this.effects.length; i < l; i++) { this.effects[i].stop(); } for (i = 0, l = this.cleanups.length; i < l; i++) { this.cleanups[i](); } if (this.scopes) { for (i = 0, l = this.scopes.length; i < l; i++) { this.scopes[i].stop(true); } } if (this.parent && !fromParent) { const last = this.parent.scopes.pop(); if (last && last !== this) { this.parent.scopes[this.index] = last; last.index = this.index; } } this.active = false; } } } function recordEffectScope(effect, scope = activeEffectScope) { if (scope && scope.active) { scope.effects.push(effect); } } 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 i = 0; i < deps.length; i++) { deps[i].w |= trackOpBit; } } }; const finalizeDepMarkers = (effect) => { const { deps } = effect; if (deps.length) { let ptr = 0; for (let i = 0; i < deps.length; i++) { const dep = deps[i]; if (wasTracked(dep) && !newTracked(dep)) { dep.delete(effect); } 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(effect) { const { deps } = effect; if (deps.length) { for (let i = 0; i < deps.length; i++) { deps[i].delete(effect); } deps.length = 0; } } 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(target, type, key) { if (shouldTrack && activeEffect) { let depsMap = targetMap.get(target); if (!depsMap) { targetMap.set(target, 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(target, type, key, newValue, oldValue, oldTarget) { const depsMap = targetMap.get(target); if (!depsMap) { return; } let deps = []; if (type === "clear") { deps = [...depsMap.values()]; } else if (key === "length" && isArray$2(target)) { depsMap.forEach((dep, key2) => { if (key2 === "length" || key2 >= newValue) { deps.push(dep); } }); } else { if (key !== void 0) { deps.push(depsMap.get(key)); } switch (type) { case "add": if (!isArray$2(target)) { deps.push(depsMap.get(ITERATE_KEY)); if (isMap$1(target)) { deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); } } else if (isIntegerKey(key)) { deps.push(depsMap.get("length")); } break; case "delete": if (!isArray$2(target)) { deps.push(depsMap.get(ITERATE_KEY)); if (isMap$1(target)) { deps.push(depsMap.get(MAP_KEY_ITERATE_KEY)); } } break; case "set": if (isMap$1(target)) { 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$2(dep) ? dep : [...dep]; for (const effect of effects) { if (effect.computed) { triggerEffect(effect); } } for (const effect of effects) { if (!effect.computed) { triggerEffect(effect); } } } function triggerEffect(effect, debuggerEventExtraInfo) { if (effect !== activeEffect || effect.allowRecurse) { if (effect.scheduler) { effect.scheduler(); } else { effect.run(); } } } const isNonTrackableKeys = /* @__PURE__ */ makeMap$2(`__proto__,__v_isRef,__isVue`); const builtInSymbols = new Set( /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) ); const get$1 = /* @__PURE__ */ createGetter(); const shallowGet = /* @__PURE__ */ createGetter(false, true); const readonlyGet = /* @__PURE__ */ createGetter(true); const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations(); function createArrayInstrumentations() { const instrumentations = {}; ["includes", "indexOf", "lastIndexOf"].forEach((key) => { instrumentations[key] = function(...args) { const arr = toRaw(this); for (let i = 0, l = this.length; i < l; i++) { track(arr, "get", i + ""); } 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 createGetter(isReadonly2 = false, shallow = false) { return function get2(target, 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(target)) { return target; } const targetIsArray = isArray$2(target); if (!isReadonly2 && targetIsArray && hasOwn$1(arrayInstrumentations, key)) { return Reflect.get(arrayInstrumentations, key, receiver); } const res = Reflect.get(target, key, receiver); if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { return res; } if (!isReadonly2) { track(target, "get", key); } if (shallow) { return res; } if (isRef(res)) { return targetIsArray && isIntegerKey(key) ? res : res.value; } if (isObject$2(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 set2(target, key, value, receiver) { let oldValue = target[key]; if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) { return false; } if (!shallow && !isReadonly(value)) { if (!isShallow(value)) { value = toRaw(value); oldValue = toRaw(oldValue); } if (!isArray$2(target) && isRef(oldValue) && !isRef(value)) { oldValue.value = value; return true; } } const hadKey = isArray$2(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key); const result = Reflect.set(target, key, value, receiver); if (target === toRaw(receiver)) { if (!hadKey) { trigger(target, "add", key, value); } else if (hasChanged$1(value, oldValue)) { trigger(target, "set", key, value); } } return result; }; } function deleteProperty(target, key) { const hadKey = hasOwn$1(target, key); target[key]; const result = Reflect.deleteProperty(target, key); if (result && hadKey) { trigger(target, "delete", key, void 0); } return result; } function has(target, key) { const result = Reflect.has(target, key); if (!isSymbol(key) || !builtInSymbols.has(key)) { track(target, "has", key); } return result; } function ownKeys(target) { track(target, "iterate", isArray$2(target) ? "length" : ITERATE_KEY); return Reflect.ownKeys(target); } const mutableHandlers = { get: get$1, set: set$1, deleteProperty, has, ownKeys }; const readonlyHandlers = { get: readonlyGet, set(target, key) { return true; }, deleteProperty(target, key) { return true; } }; const shallowReactiveHandlers = /* @__PURE__ */ extend$2({}, mutableHandlers, { get: shallowGet, set: shallowSet }); const toShallow = (value) => value; const getProto = (v) => Reflect.getPrototypeOf(v); function get$1$1(target, key, isReadonly2 = false, isShallow2 = false) { target = target["__v_raw"]; const rawTarget = toRaw(target); const rawKey = toRaw(key); if (!isReadonly2) { if (key !== rawKey) { track(rawTarget, "get", key); } track(rawTarget, "get", rawKey); } const { has: has2 } = getProto(rawTarget); const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; if (has2.call(rawTarget, key)) { return wrap(target.get(key)); } else if (has2.call(rawTarget, rawKey)) { return wrap(target.get(rawKey)); } else if (target !== rawTarget) { target.get(key); } } function has$1(key, isReadonly2 = false) { const target = this["__v_raw"]; const rawTarget = toRaw(target); const rawKey = toRaw(key); if (!isReadonly2) { if (key !== rawKey) { track(rawTarget, "has", key); } track(rawTarget, "has", rawKey); } return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); } function size(target, isReadonly2 = false) { target = target["__v_raw"]; !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY); return Reflect.get(target, "size", target); } function add(value) { value = toRaw(value); const target = toRaw(this); const proto = getProto(target); const hadKey = proto.has.call(target, value); if (!hadKey) { target.add(value); trigger(target, "add", value, value); } return this; } function set$1$1(key, value) { value = toRaw(value); const target = toRaw(this); const { has: has2, get: get2 } = getProto(target); let hadKey = has2.call(target, key); if (!hadKey) { key = toRaw(key); hadKey = has2.call(target, key); } const oldValue = get2.call(target, key); target.set(key, value); if (!hadKey) { trigger(target, "add", key, value); } else if (hasChanged$1(value, oldValue)) { trigger(target, "set", key, value); } return this; } function deleteEntry(key) { const target = toRaw(this); const { has: has2, get: get2 } = getProto(target); let hadKey = has2.call(target, key); if (!hadKey) { key = toRaw(key); hadKey = has2.call(target, key); } get2 ? get2.call(target, key) : void 0; const result = target.delete(key); if (hadKey) { trigger(target, "delete", key, void 0); } return result; } function clear() { const target = toRaw(this); const hadItems = target.size !== 0; const result = target.clear(); if (hadItems) { trigger(target, "clear", void 0, void 0); } return result; } function createForEach(isReadonly2, isShallow2) { return function forEach(callback, thisArg) { const observed = this; const target = observed["__v_raw"]; const rawTarget = toRaw(target); const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY); return target.forEach((value, key) => { return callback.call(thisArg, wrap(value), wrap(key), observed); }); }; } function createIterableMethod(method, isReadonly2, isShallow2) { return function(...args) { const target = this["__v_raw"]; const rawTarget = toRaw(target); const targetIsMap = isMap$1(rawTarget); const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; const isKeyOnly = method === "keys" && targetIsMap; const innerIterator = target[method](...args); const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY); return { next() { const { value, done } = innerIterator.next(); return done ? { value, done } : { value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), done }; }, [Symbol.iterator]() { return this; } }; }; } function createReadonlyMethod(type) { return function(...args) { return type === "delete" ? false : this; }; } function createInstrumentations() { const mutableInstrumentations2 = { get(key) { return get$1$1(this, key); }, get size() { return size(this); }, has: has$1, add, set: set$1$1, delete: deleteEntry, clear, forEach: createForEach(false, false) }; const shallowInstrumentations2 = { get(key) { return get$1$1(this, key, false, true); }, get size() { return size(this); }, has: has$1, add, set: set$1$1, delete: deleteEntry, clear, forEach: createForEach(false, true) }; const readonlyInstrumentations2 = { get(key) { return get$1$1(this, key, true); }, get size() { return size(this, true); }, has(key) { return has$1.call(this, key, true); }, add: createReadonlyMethod("add"), set: createReadonlyMethod("set"), delete: createReadonlyMethod("delete"), clear: createReadonlyMethod("clear"), forEach: createForEach(true, false) }; const shallowReadonlyInstrumentations2 = { get(key) { return get$1$1(this, key, true, true); }, get size() { return size(this, true); }, has(key) { return has$1.call(this, key, true); }, add: createReadonlyMethod("add"), set: createReadonlyMethod("set"), delete: createReadonlyMethod("delete"), clear: createReadonlyMethod("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 (target, key, receiver) => { if (key === "__v_isReactive") { return !isReadonly2; } else if (key === "__v_isReadonly") { return isReadonly2; } else if (key === "__v_raw") { return target; } return Reflect.get(hasOwn$1(instrumentations, key) && key in target ? instrumentations : target, key, receiver); }; } const mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) }; const shallowCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, true) }; const readonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, false) }; 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"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value)); } function reactive(target) { if (isReadonly(target)) { return target; } return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap); } function shallowReactive(target) { return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap); } function readonly(target) { return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap); } function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { if (!isObject$2(target)) { return target; } if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { return target; } const existingProxy = proxyMap.get(target); if (existingProxy) { return existingProxy; } const targetType = getTargetType(target); if (targetType === 0) { return target; } const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers); proxyMap.set(target, proxy); return proxy; } function isReactive(value) { if (isReadonly(value)) { return isReactive(value["__v_raw"]); } return !!(value && value["__v_isReactive"]); } function isReadonly(value) { return !!(value && value["__v_isReadonly"]); } function isShallow(value) { return !!(value && value["__v_isShallow"]); } function isProxy(value) { return isReactive(value) || isReadonly(value); } function toRaw(observed) { const raw = observed && observed["__v_raw"]; return raw ? toRaw(raw) : observed; } function markRaw(value) { def$1(value, "__v_skip", true); return value; } const toReactive = (value) => isObject$2(value) ? reactive(value) : value; const toReadonly = (value) => isObject$2(value) ? readonly(value) : value; function trackRefValue(ref) { if (shouldTrack && activeEffect) { ref = toRaw(ref); { trackEffects(ref.dep || (ref.dep = createDep())); } } } function triggerRefValue(ref, newVal) { ref = toRaw(ref); if (ref.dep) { { triggerEffects(ref.dep); } } } function isRef(r) { return !!(r && r.__v_isRef === true); } function unref(ref) { return isRef(ref) ? ref.value : ref; } const shallowUnwrapHandlers = { get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)), set: (target, key, value, receiver) => { const oldValue = target[key]; if (isRef(oldValue) && !isRef(value)) { oldValue.value = value; return true; } else { return Reflect.set(target, key, value, receiver); } } }; function proxyRefs(objectWithRefs) { return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); } class ComputedRefImpl { constructor(getter, _setter, isReadonly2, isSSR) { this._setter = _setter; this.dep = void 0; this.__v_isRef = true; 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"] = 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); } } function computed$1(getterOrOptions, debugOptions, isSSR = false) { let getter; let setter; const onlyGetter = isFunction$2(getterOrOptions); if (onlyGetter) { getter = getterOrOptions; setter = NOOP$1; } else { getter = getterOrOptions.get; setter = getterOrOptions.set; } const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR); return cRef; } function makeMap$1(str, expectsLowerCase) { const map = /* @__PURE__ */ Object.create(null); const list2 = str.split(","); for (let i = 0; i < list2.length; i++) { map[list2[i]] = true; } return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val]; } function normalizeStyle(value) { if (isArray$1(value)) { const res = {}; for (let i = 0; i < value.length; i++) { const item = value[i]; const normalized = isString$1(item) ? parseStringStyle(item) : normalizeStyle(item); if (normalized) { for (const key in normalized) { res[key] = normalized[key]; } } } return res; } else if (isString$1(value)) { return value; } else if (isObject$1(value)) { return value; } } const listDelimiterRE = /;(?![^(]*\))/g; const propertyDelimiterRE = /:(.+)/; function parseStringStyle(cssText) { const ret = {}; cssText.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$1(value)) { res = value; } else if (isArray$1(value)) { for (let i = 0; i < value.length; i++) { const normalized = normalizeClass(value[i]); if (normalized) { res += normalized + " "; } } } else if (isObject$1(value)) { for (const name in value) { if (value[name]) { res += name + " "; } } } return res.trim(); } function normalizeProps(props) { if (!props) return null; let { class: klass, style } = props; if (klass && !isString$1(klass)) { props.class = normalizeClass(klass); } if (style) { props.style = normalizeStyle(style); } return props; } const toDisplayString = (val) => { return isString$1(val) ? val : val == null ? "" : isArray$1(val) || isObject$1(val) && (val.toString === objectToString || !isFunction$1(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$1(val) && !isArray$1(val) && !isPlainObject(val)) { return String(val); } return val; }; const EMPTY_OBJ = {}; const EMPTY_ARR = []; const NOOP = () => { }; const NO = () => false; const onRE$1 = /^on[^a-z]/; const isOn$1 = (key) => onRE$1.test(key); const isModelListener$1 = (key) => key.startsWith("onUpdate:"); const extend$1 = Object.assign; const remove = (arr, el) => { const i = arr.indexOf(el); if (i > -1) { arr.splice(i, 1); } }; const hasOwnProperty$2 = Object.prototype.hasOwnProperty; const hasOwn = (val, key) => hasOwnProperty$2.call(val, key); const isArray$1 = Array.isArray; const isMap = (val) => toTypeString(val) === "[object Map]"; const isSet = (val) => toTypeString(val) === "[object Set]"; const isFunction$1 = (val) => typeof val === "function"; const isString$1 = (val) => typeof val === "string"; const isObject$1 = (val) => val !== null && typeof val === "object"; const isPromise = (val) => { return isObject$1(val) && isFunction$1(val.then) && isFunction$1(val.catch); }; const objectToString = Object.prototype.toString; const toTypeString = (value) => objectToString.call(value); const isPlainObject = (val) => toTypeString(val) === "[object Object]"; const isReservedProp = /* @__PURE__ */ makeMap$1( ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" ); const cacheStringFunction$1 = (fn) => { const cache = /* @__PURE__ */ Object.create(null); return (str) => { const hit = cache[str]; return hit || (cache[str] = fn(str)); }; }; const camelizeRE$1 = /-(\w)/g; const camelize$1 = cacheStringFunction$1((str) => { return str.replace(camelizeRE$1, (_, c) => c ? c.toUpperCase() : ""); }); const hyphenateRE$1 = /\B([A-Z])/g; const hyphenate$1 = cacheStringFunction$1((str) => str.replace(hyphenateRE$1, "-$1").toLowerCase()); const capitalize$1 = cacheStringFunction$1((str) => str.charAt(0).toUpperCase() + str.slice(1)); const toHandlerKey = cacheStringFunction$1((str) => str ? `on${capitalize$1(str)}` : ``); const hasChanged = (value, oldValue) => !Object.is(value, oldValue); const invokeArrayFns = (fns, arg) => { for (let i = 0; i < fns.length; i++) { fns[i](arg); } }; const def = (obj, key, value) => { Object.defineProperty(obj, key, { configurable: true, enumerable: false, value }); }; const toNumber$1 = (val) => { const n = parseFloat(val); return isNaN(n) ? val : n; }; let _globalThis; const getGlobalThis = () => { return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); }; function callWithErrorHandling(fn, instance2, type, args) { let res; try { res = args ? fn(...args) : fn(); } catch (err) { handleError(err, instance2, type); } return res; } function callWithAsyncErrorHandling(fn, instance2, type, args) { if (isFunction$1(fn)) { const res = callWithErrorHandling(fn, instance2, type, args); if (res && isPromise(res)) { res.catch((err) => { handleError(err, instance2, type); }); } return res; } const values = []; for (let i = 0; i < fn.length; i++) { values.push(callWithAsyncErrorHandling(fn[i], instance2, type, args)); } return values; } function handleError(err, instance2, type, throwInDev = true) { const contextVNode = instance2 ? instance2.vnode : null; if (instance2) { let cur = instance2.parent; const exposedInstance = instance2.proxy; const errorInfo = type; while (cur) { const errorCapturedHooks = cur.ec; if (errorCapturedHooks) { for (let i = 0; i < errorCapturedHooks.length; i++) { if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { return; } } } cur = cur.parent; } const appErrorHandler = instance2.appContext.config.errorHandler; if (appErrorHandler) { callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]); return; } } logError(err, type, contextVNode, throwInDev); } function logError(err, type, contextVNode, throwInDev = true) { { console.error(err); } } let isFlushing = false; let isFlushPending = false; const queue = []; let flushIndex = 0; const pendingPreFlushCbs = []; let activePreFlushCbs = null; let preFlushIndex = 0; const pendingPostFlushCbs = []; let activePostFlushCbs = null; let postFlushIndex = 0; const resolvedPromise = /* @__PURE__ */ Promise.resolve(); let currentFlushPromise = null; let currentPreFlushParentJob = null; function nextTick(fn) { const p2 = currentFlushPromise || resolvedPromise; return fn ? p2.then(this ? fn.bind(this) : fn) : p2; } function findInsertionIndex(id) { let start = flushIndex + 1; let end = queue.length; while (start < end) { const middle = start + end >>> 1; const middleJobId = getId(queue[middle]); middleJobId < id ? start = middle + 1 : end = middle; } return start; } function queueJob(job) { if ((!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) && job !== currentPreFlushParentJob) { 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 i = queue.indexOf(job); if (i > flushIndex) { queue.splice(i, 1); } } function queueCb(cb, activeQueue, pendingQueue, index) { if (!isArray$1(cb)) { if (!activeQueue || !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) { pendingQueue.push(cb); } } else { pendingQueue.push(...cb); } queueFlush(); } function queuePreFlushCb(cb) { queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex); } function queuePostFlushCb(cb) { queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex); } function flushPreFlushCbs(seen, parentJob = null) { if (pendingPreFlushCbs.length) { currentPreFlushParentJob = parentJob; activePreFlushCbs = [...new Set(pendingPreFlushCbs)]; pendingPreFlushCbs.length = 0; for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) { activePreFlushCbs[preFlushIndex](); } activePreFlushCbs = null; preFlushIndex = 0; currentPreFlushParentJob = null; flushPreFlushCbs(seen, parentJob); } } function flushPostFlushCbs(seen) { flushPreFlushCbs(); if (pendingPostFlushCbs.length) { const deduped = [...new Set(pendingPostFlushCbs)]; pendingPostFlushCbs.length = 0; if (activePostFlushCbs) { activePostFlushCbs.push(...deduped); return; } activePostFlushCbs = deduped; activePostFlushCbs.sort((a, b) => getId(a) - getId(b)); for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { activePostFlushCbs[postFlushIndex](); } activePostFlushCbs = null; postFlushIndex = 0; } } const getId = (job) => job.id == null ? Infinity : job.id; function flushJobs(seen) { isFlushPending = false; isFlushing = true; flushPreFlushCbs(seen); queue.sort((a, b) => getId(a) - getId(b)); const check = NOOP; try { for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { const job = queue[flushIndex]; if (job && job.active !== false) { if (false) ; callWithErrorHandling(job, null, 14); } } } finally { flushIndex = 0; queue.length = 0; flushPostFlushCbs(); isFlushing = false; currentFlushPromise = null; if (queue.length || pendingPreFlushCbs.length || pendingPostFlushCbs.length) { flushJobs(seen); } } } function emit$1(instance2, event, ...rawArgs) { if (instance2.isUnmounted) return; const props = instance2.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, trim } = props[modifiersKey] || EMPTY_OBJ; if (trim) { args = rawArgs.map((a) => a.trim()); } if (number) { args = rawArgs.map(toNumber$1); } } let handlerName; let handler = props[handlerName = toHandlerKey(event)] || props[handlerName = toHandlerKey(camelize$1(event))]; if (!handler && isModelListener2) { handler = props[handlerName = toHandlerKey(hyphenate$1(event))]; } if (handler) { callWithAsyncErrorHandling(handler, instance2, 6, args); } const onceHandler = props[handlerName + `Once`]; if (onceHandler) { if (!instance2.emitted) { instance2.emitted = {}; } else if (instance2.emitted[handlerName]) { return; } instance2.emitted[handlerName] = true; callWithAsyncErrorHandling(onceHandler, instance2, 6, args); } } function normalizeEmitsOptions(comp, appContext, asMixin = false) { const cache = appContext.emitsCache; const cached = cache.get(comp); if (cached !== void 0) { return cached; } const raw = comp.emits; let normalized = {}; let hasExtends = false; if (!isFunction$1(comp)) { const extendEmits = (raw2) => { const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); if (normalizedFromExtend) { hasExtends = true; extend$1(normalized, normalizedFromExtend); } }; if (!asMixin && appContext.mixins.length) { appContext.mixins.forEach(extendEmits); } if (comp.extends) { extendEmits(comp.extends); } if (comp.mixins) { comp.mixins.forEach(extendEmits); } } if (!raw && !hasExtends) { cache.set(comp, null); return null; } if (isArray$1(raw)) { raw.forEach((key) => normalized[key] = null); } else { extend$1(normalized, raw); } cache.set(comp, normalized); return normalized; } function isEmitListener(options, key) { if (!options || !isOn$1(key)) { return false; } key = key.slice(2).replace(/Once$/, ""); return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate$1(key)) || hasOwn(options, key); } let currentRenderingInstance = null; let currentScopeId = null; function setCurrentRenderingInstance(instance2) { const prev = currentRenderingInstance; currentRenderingInstance = instance2; currentScopeId = instance2 && instance2.type.__scopeId || null; return prev; } 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); const res = fn(...args); setCurrentRenderingInstance(prevInstance); if (renderFnWithContext._d) { setBlockTracking(1); } return res; }; renderFnWithContext._n = true; renderFnWithContext._c = true; renderFnWithContext._d = true; return renderFnWithContext; } function markAttrsAccessed() { } function renderComponentRoot(instance2) { const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render: render2, renderCache, data, setupState, ctx, inheritAttrs } = instance2; let result; let fallthroughAttrs; const prev = setCurrentRenderingInstance(instance2); 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 } : { attrs, slots, emit }) : render3(props, null)); fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); } } catch (err) { blockStack.length = 0; handleError(err, instance2, 1); result = createVNode(Comment); } let root = result; if (fallthroughAttrs && inheritAttrs !== false) { const keys = Object.keys(fallthroughAttrs); const { shapeFlag } = root; if (keys.length) { if (shapeFlag & (1 | 6)) { if (propsOptions && keys.some(isModelListener$1)) { fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions); } root = cloneVNode(root, fallthroughAttrs); } } } if (vnode.dirs) { root = cloneVNode(root); root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; } if (vnode.transition) { root.transition = vnode.transition; } { result = root; } setCurrentRenderingInstance(prev); return result; } const getFunctionalFallthrough = (attrs) => { let res; for (const key in attrs) { if (key === "class" || key === "style" || isOn$1(key)) { (res || (res = {}))[key] = attrs[key]; } } return res; }; const filterModelListeners = (attrs, props) => { const res = {}; for (const key in attrs) { if (!isModelListener$1(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 i = 0; i < dynamicProps.length; i++) { const key = dynamicProps[i]; 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 i = 0; i < nextKeys.length; i++) { const key = nextKeys[i]; if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { return true; } } return false; } function updateHOCHostEl({ vnode, parent }, el) { while (parent && parent.subTree === vnode) { (vnode = parent.vnode).el = el; parent = parent.parent; } } const isSuspense = (type) => type.__isSuspense; 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 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 instance2 = currentInstance || currentRenderingInstance; if (instance2) { const provides = instance2.parent == null ? instance2.vnode.appContext && instance2.vnode.appContext.provides : instance2.parent.provides; if (provides && key in provides) { return provides[key]; } else if (arguments.length > 1) { return treatDefaultAsFactory && isFunction$1(defaultValue) ? defaultValue.call(instance2.proxy) : defaultValue; } else ; } } const INITIAL_WATCHER_VALUE = {}; function watch(source, cb, options) { return doWatch(source, cb, options); } function doWatch(source, cb, { immediate, deep, flush: flush2, onTrack, onTrigger } = EMPTY_OBJ) { const instance2 = currentInstance; 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((s) => isReactive(s) || isShallow(s)); getter = () => source.map((s) => { if (isRef(s)) { return s.value; } else if (isReactive(s)) { return traverse(s); } else if (isFunction$1(s)) { return callWithErrorHandling(s, instance2, 2); } else ; }); } else if (isFunction$1(source)) { if (cb) { getter = () => callWithErrorHandling(source, instance2, 2); } else { getter = () => { if (instance2 && instance2.isUnmounted) { return; } if (cleanup) { cleanup(); } return callWithAsyncErrorHandling(source, instance2, 3, [onCleanup]); }; } } else { getter = NOOP; } if (cb && deep) { const baseGetter = getter; getter = () => traverse(baseGetter()); } let cleanup; let onCleanup = (fn) => { cleanup = effect.onStop = () => { callWithErrorHandling(fn, instance2, 4); }; }; if (isInSSRComponentSetup) { onCleanup = NOOP; if (!cb) { getter(); } else if (immediate) { callWithAsyncErrorHandling(cb, instance2, 3, [ getter(), isMultiSource ? [] : void 0, onCleanup ]); } return NOOP; } let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE; const job = () => { if (!effect.active) { return; } if (cb) { const newValue = effect.run(); if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) { if (cleanup) { cleanup(); } callWithAsyncErrorHandling(cb, instance2, 3, [ newValue, oldValue === INITIAL_WATCHER_VALUE ? void 0 : oldValue, onCleanup ]); oldValue = newValue; } } else { effect.run(); } }; job.allowRecurse = !!cb; let scheduler; if (flush2 === "sync") { scheduler = job; } else if (flush2 === "post") { scheduler = () => queuePostRenderEffect(job, instance2 && instance2.suspense); } else { scheduler = () => queuePreFlushCb(job); } const effect = new ReactiveEffect(getter, scheduler); if (cb) { if (immediate) { job(); } else { oldValue = effect.run(); } } else if (flush2 === "post") { queuePostRenderEffect(effect.run.bind(effect), instance2 && instance2.suspense); } else { effect.run(); } return () => { effect.stop(); if (instance2 && instance2.scope) { remove(instance2.scope.effects, effect); } }; } function instanceWatch(source, value, options) { const publicThis = this.proxy; const getter = isString$1(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); let cb; if (isFunction$1(value)) { cb = value; } else { cb = value.handler; options = value; } const cur = currentInstance; setCurrentInstance(this); const res = doWatch(getter, cb.bind(publicThis), options); if (cur) { setCurrentInstance(cur); } else { unsetCurrentInstance(); } return res; } function createPathGetter(ctx, path2) { const segments = path2.split("."); return () => { let cur = ctx; for (let i = 0; i < segments.length && cur; i++) { cur = cur[segments[i]]; } return cur; }; } function traverse(value, seen) { if (!isObject$1(value) || value["__v_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 i = 0; i < value.length; i++) { traverse(value[i], seen); } } else if (isSet(value) || isMap(value)) { value.forEach((v) => { traverse(v, seen); }); } else if (isPlainObject(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, onBeforeEnter: TransitionHookValidator, onEnter: TransitionHookValidator, onAfterEnter: TransitionHookValidator, onEnterCancelled: TransitionHookValidator, onBeforeLeave: TransitionHookValidator, onLeave: TransitionHookValidator, onAfterLeave: TransitionHookValidator, onLeaveCancelled: TransitionHookValidator, onBeforeAppear: TransitionHookValidator, onAppear: TransitionHookValidator, onAfterAppear: TransitionHookValidator, onAppearCancelled: TransitionHookValidator }, setup(props, { slots }) { const instance2 = 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 c of children) { if (c.type !== Comment) { child = c; 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, instance2); setTransitionHooks(innerChild, enterHooks); const oldChild = instance2.subTree; const oldInnerChild = oldChild && getKeepAliveChild(oldChild); let transitionKeyChanged = false; const { getTransitionKey } =